Changeset 867286b


Ignore:
Timestamp:
Dec 20, 2010 9:31:17 PM (9 years ago)
Author:
mathiasdm <mathiasdm@…>
Branches:
master
Children:
2a6c763
Parents:
e247e95
Message:
  • Replaced RouterContext? with I2PAppContext.
  • Detect I2P location using I2PAppContext.
Location:
apps/desktopgui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • apps/desktopgui/TODO

    re247e95 r867286b  
    44- Internationalisation:
    55    * Add strings - DONE
    6     * Add Windows support
     6    * Add Windows support - NEED TO CHECK
    77    * Might need some kind of trigger to reload the menu (for live language switching)
    88    * Language choice is not actually set as a parameter in I2P config?
  • apps/desktopgui/src/net/i2p/desktopgui/i18n/DesktopguiTranslator.java

    re247e95 r867286b  
    11package net.i2p.desktopgui.i18n;
    22
    3 import net.i2p.router.RouterContext;
     3import net.i2p.I2PAppContext;
    44import net.i2p.util.Translate;
    55
     
    88    private static final String BUNDLE_NAME = "net.i2p.desktopgui.messages";
    99       
    10         private static RouterContext ctx;
     10    private static I2PAppContext ctx;
    1111       
    12         private static RouterContext getRouterContext() {
     12        private static I2PAppContext getRouterContext() {
    1313                if(ctx == null) {
    14                         ctx = RouterContext.listContexts().get(0);
     14                        ctx = I2PAppContext.getCurrentContext();
    1515                }
    1616                return ctx;
     
    1818       
    1919    public static String _(String s) {
    20         return Translate.getString(s, getRouterContext(), BUNDLE_NAME);
     20                return Translate.getString(s, getRouterContext(), BUNDLE_NAME);
    2121    }
    2222
    2323    public static String _(String s, Object o) {
    24         return Translate.getString(s, o, getRouterContext(), BUNDLE_NAME);
     24                return Translate.getString(s, o, getRouterContext(), BUNDLE_NAME);
    2525    }
    2626}
  • apps/desktopgui/src/net/i2p/desktopgui/router/RouterManager.java

    re247e95 r867286b  
    33import java.io.IOException;
    44
     5import net.i2p.I2PAppContext;
    56import net.i2p.desktopgui.i18n.DesktopguiTranslator;
    67import net.i2p.desktopgui.util.ConfigurationManager;
     
    3233        public static void start() {
    3334                try {
    34                         //TODO: detect I2P directory
    3535                        //TODO: set/get PID
    3636                        String separator = System.getProperty("file.separator");
    37                         String homeDirectory = System.getProperty("user.home");
    38                         String location = ConfigurationManager.getInstance()
    39                                 .getStringConfiguration("I2PLocation", homeDirectory + separator + "i2p");
     37                        String location = I2PAppContext.getCurrentContext().getBaseDir().getAbsolutePath();
    4038                       
    41                         Runtime.getRuntime().exec(location + separator + "i2psvc" + location + separator + "wrapper.config");
     39                        Runtime.getRuntime().exec(location + separator + "i2psvc " + location + separator + "wrapper.config");
    4240                } catch (IOException e) {
    4341                        log.log(Log.WARN, "Failed to start I2P", e);
Note: See TracChangeset for help on using the changeset viewer.