Tweaked parameters of SetRouterManager.

Tweaked apply button size in configuration tab.
This commit is contained in:
dev
2011-07-31 09:42:21 +00:00
parent c3b61418d2
commit e6253a47d8
3 changed files with 13 additions and 18 deletions

View File

@ -95,7 +95,7 @@ public class ConfigurationTab extends TabLogoPanel {
final JButton btnApply = new JButton(Transl._("Apply"));
add(btnApply);
btnApply.setBounds(450, 272, 75, 24);
btnApply.setBounds(450, 272, 100, 24);
btnApply.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent arg0) {
@ -401,7 +401,9 @@ public class ConfigurationTab extends TabLogoPanel {
JOptionPane.INFORMATION_MESSAGE);
if (n == JOptionPane.YES_OPTION){
try {
SetRouterManager.execute(ROUTER_MANAGER.RESTART);
HashMap<ROUTER_MANAGER, String> hm = new HashMap<ROUTER_MANAGER,String>();
hm.put(ROUTER_MANAGER.RESTART, null);
SetRouterManager.execute(hm);
StatusHandler.setStatus(Transl._("Restarting I2P node.. "));
} catch (InvalidPasswordException e) {
StatusHandler.setStatus(Transl._("Restart failed: ") + DEFAULT_STATUS.INVALID_PASSWORD);

View File

@ -1,38 +1,26 @@
package net.i2p.itoopie.gui;
import info.monitorenter.gui.chart.Chart2D;
import info.monitorenter.gui.chart.views.ChartPanel;
import java.awt.Dimension;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JTabbedPane;
import java.awt.BorderLayout;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.SwingConstants;
import javax.swing.ImageIcon;
import net.i2p.itoopie.gui.component.BandwidthChart;
import net.i2p.itoopie.gui.component.LogoPanel;
import net.i2p.itoopie.gui.component.ParticipatingTunnelsChart;
import net.i2p.itoopie.gui.component.RegisteredFrame;
import net.i2p.itoopie.gui.component.TabLogoPanel;
import net.i2p.itoopie.gui.component.util.TabChangeListener;
import net.i2p.itoopie.i18n.Transl;
import net.i2p.itoopie.util.IconLoader;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.FlowLayout;

View File

@ -14,6 +14,7 @@ import net.i2p.itoopie.i2pcontrol.InvalidParametersException;
import net.i2p.itoopie.i2pcontrol.InvalidPasswordException;
import net.i2p.itoopie.i2pcontrol.JSONRPC2Interface;
import net.i2p.itoopie.i2pcontrol.UnrecoverableFailedRequestException;
import net.i2p.itoopie.i2pcontrol.methods.NetworkSetting.NETWORK_SETTING;
import net.i2p.itoopie.i2pcontrol.methods.RouterManager.ROUTER_MANAGER;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Request;
@ -24,15 +25,19 @@ public class SetRouterManager {
private final static Log _log = LogFactory.getLog(SetRouterManager.class);
public static EnumMap<ROUTER_MANAGER, Object> execute(ROUTER_MANAGER cmd)
public static EnumMap<ROUTER_MANAGER, Object> execute(Map<ROUTER_MANAGER,String> commands)
throws InvalidPasswordException, JSONRPC2SessionException{
JSONRPC2Request req = new JSONRPC2Request("RouterManager", JSONRPC2Interface.incrNonce());
Map outParams = new HashMap();
outParams.put(cmd.toString(), null);
Set<Entry<ROUTER_MANAGER,String>> set = commands.entrySet();
for (Entry<ROUTER_MANAGER,String> e : set){
if(e.getKey().isWritable()){
outParams.put(e.getKey().toString(), e.getValue());
}
}
req.setParams(outParams);
JSONRPC2Response resp = null;