Type fixes for i2pd
This commit is contained in:
@ -3,12 +3,14 @@
|
|||||||
* Build fixes
|
* Build fixes
|
||||||
* Support i2pcontrol HTTP Java console webapp at port 7657
|
* Support i2pcontrol HTTP Java console webapp at port 7657
|
||||||
* Layout fixes and adjustments
|
* Layout fixes and adjustments
|
||||||
|
* Fixes for i2pd
|
||||||
* Graph adjustments
|
* Graph adjustments
|
||||||
* Localize time format on graphs
|
* Localize time format on graphs
|
||||||
* Move Settings from a popup frame to a new tab
|
* Move Settings from a popup frame to a new tab
|
||||||
* Remove "Change I2PControl" part of Settings
|
* Remove "Change I2PControl" part of Settings
|
||||||
* Rename Configuration tab to "I2P Control"
|
* Rename Configuration tab to "I2P Control"
|
||||||
* Remove "Settings read from I2P router" message
|
* Remove "Settings read from I2P router" message
|
||||||
|
* Set graph values to 0 when router is gone
|
||||||
* Update to jchart2d 3.2.2 2011-09-25
|
* Update to jchart2d 3.2.2 2011-09-25
|
||||||
* Remove debug output
|
* Remove debug output
|
||||||
* README updates
|
* README updates
|
||||||
|
@ -8,7 +8,7 @@ package net.i2p.itoopie;
|
|||||||
public class ItoopieVersion {
|
public class ItoopieVersion {
|
||||||
|
|
||||||
/** Version of itoopie */
|
/** Version of itoopie */
|
||||||
public static final String VERSION = "0.0.4-beta2";
|
public static final String VERSION = "0.0.4-beta3";
|
||||||
|
|
||||||
/** Version of the I2PControl API implemented */
|
/** Version of the I2PControl API implemented */
|
||||||
public static final int I2PCONTROL_API_VERSION = 1;
|
public static final int I2PCONTROL_API_VERSION = 1;
|
||||||
|
@ -227,13 +227,14 @@ public class ConfigurationTab extends TabLogoPanel {
|
|||||||
EnumMap<NETWORK_SETTING, Object> em = GetNetworkSetting.execute(NETWORK_SETTING.TCP_PORT, NETWORK_SETTING.UDP_PORT,
|
EnumMap<NETWORK_SETTING, Object> em = GetNetworkSetting.execute(NETWORK_SETTING.TCP_PORT, NETWORK_SETTING.UDP_PORT,
|
||||||
NETWORK_SETTING.UPNP, NETWORK_SETTING.BW_IN, NETWORK_SETTING.BW_OUT, NETWORK_SETTING.BW_SHARE);
|
NETWORK_SETTING.UPNP, NETWORK_SETTING.BW_IN, NETWORK_SETTING.BW_OUT, NETWORK_SETTING.BW_SHARE);
|
||||||
|
|
||||||
txtTCPPort.setText((String) em.get(NETWORK_SETTING.TCP_PORT));
|
// i2pd may send these as numbers
|
||||||
txtUDPPort.setText((String) em.get(NETWORK_SETTING.UDP_PORT));
|
txtTCPPort.setText(ConfigurationTab.toString(em.get(NETWORK_SETTING.TCP_PORT)));
|
||||||
|
txtUDPPort.setText(ConfigurationTab.toString(em.get(NETWORK_SETTING.UDP_PORT)));
|
||||||
boolean upnpValue = Boolean.parseBoolean((String) em.get(NETWORK_SETTING.UPNP));
|
boolean upnpValue = Boolean.parseBoolean((String) em.get(NETWORK_SETTING.UPNP));
|
||||||
chkbxUPNP.setSelected(upnpValue);
|
chkbxUPNP.setSelected(upnpValue);
|
||||||
txtDownload.setText((String) em.get(NETWORK_SETTING.BW_IN));
|
txtDownload.setText(ConfigurationTab.toString(em.get(NETWORK_SETTING.BW_IN)));
|
||||||
txtUpload.setText((String) em.get(NETWORK_SETTING.BW_OUT));
|
txtUpload.setText(ConfigurationTab.toString(em.get(NETWORK_SETTING.BW_OUT)));
|
||||||
txtShare.setText((String) em.get(NETWORK_SETTING.BW_SHARE));
|
txtShare.setText(ConfigurationTab.toString(em.get(NETWORK_SETTING.BW_SHARE)));
|
||||||
//StatusHandler.setStatus(SETTINGS_READ);
|
//StatusHandler.setStatus(SETTINGS_READ);
|
||||||
|
|
||||||
} catch (InvalidPasswordException e) {
|
} catch (InvalidPasswordException e) {
|
||||||
@ -245,6 +246,16 @@ public class ConfigurationTab extends TabLogoPanel {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert numbers to Strings for i2pd
|
||||||
|
* @since 0.0.4
|
||||||
|
*/
|
||||||
|
private static String toString(Object o) {
|
||||||
|
if (o == null)
|
||||||
|
return null;
|
||||||
|
return o.toString();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch the application.
|
* Launch the application.
|
||||||
*/
|
*/
|
||||||
|
@ -145,7 +145,8 @@ public class OverviewTab extends TabLogoPanel {
|
|||||||
|
|
||||||
|
|
||||||
lblVersionSpecified.setText((String) em.get(ROUTER_INFO.VERSION));
|
lblVersionSpecified.setText((String) em.get(ROUTER_INFO.VERSION));
|
||||||
lblUptimeSpecified.setText(DataHelper.formatDuration((Long) em.get(ROUTER_INFO.UPTIME)));
|
// i2pd sends as String
|
||||||
|
lblUptimeSpecified.setText(DataHelper.formatDuration(toLong(em.get(ROUTER_INFO.UPTIME))));
|
||||||
lblStatusSpecified.setText((String) em.get(ROUTER_INFO.STATUS));
|
lblStatusSpecified.setText((String) em.get(ROUTER_INFO.STATUS));
|
||||||
Long netStatus = (Long) em.get(ROUTER_INFO.NETWORK_STATUS);
|
Long netStatus = (Long) em.get(ROUTER_INFO.NETWORK_STATUS);
|
||||||
Integer intNetStatus = netStatus.intValue();
|
Integer intNetStatus = netStatus.intValue();
|
||||||
@ -165,6 +166,22 @@ public class OverviewTab extends TabLogoPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert String to long for i2pd
|
||||||
|
* @since 0.0.4
|
||||||
|
*/
|
||||||
|
private static long toLong(Object o) {
|
||||||
|
if (o == null)
|
||||||
|
return 0;
|
||||||
|
if (o instanceof Number)
|
||||||
|
return ((Number) o).longValue();
|
||||||
|
if (o instanceof String) {
|
||||||
|
try {
|
||||||
|
return Long.parseLong((String) o);
|
||||||
|
} catch (NumberFormatException nfe) {}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTabFocus(ChangeEvent e) {
|
public void onTabFocus(ChangeEvent e) {
|
||||||
|
Reference in New Issue
Block a user