Author: jflesch
Date: 2007-04-23 14:36:40 +0000 (Mon, 23 Apr 2007)
New Revision: 12901

Modified:
   trunk/apps/Thaw/src/thaw/core/ConfigWindow.java
   trunk/apps/Thaw/src/thaw/plugins/peerMonitor/PeerMonitorPanel.java
Log:
Fix the button 'ok' in the configuration window

Modified: trunk/apps/Thaw/src/thaw/core/ConfigWindow.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/ConfigWindow.java     2007-04-23 13:52:13 UTC 
(rev 12900)
+++ trunk/apps/Thaw/src/thaw/core/ConfigWindow.java     2007-04-23 14:36:40 UTC 
(rev 12901)
@@ -185,13 +185,13 @@
                                return;
                }

-               if((e.getSource() == okButton)
-                  || (e.getSource() == cancelButton)) {

-                       close();
-               }
+               if(e.getSource() == okButton) {
+                       close(false, true);

-               if(e.getSource() == okButton) {
+                       setChanged();
+                       notifyObservers(okButton);
+
                        advancedMode = 
Boolean.valueOf(core.getConfig().getValue("advancedMode")).booleanValue();


@@ -201,6 +201,11 @@

                        needConnectionReset = false;
                }
+
+
+               if(e.getSource() == cancelButton) {
+                       close();
+               }
        }


@@ -235,13 +240,15 @@

        /* not for later : the cancelbutton just call this */
        public void close() {
-               close(true);
+               close(true, true);
        }


-       public void close(boolean hideWin) {
-               setChanged();
-               this.notifyObservers(cancelButton); /* Equivalent to a click on 
the cancel button */
+       public void close(boolean notifyCancel, boolean hideWin) {
+               if (notifyCancel) {
+                       setChanged();
+                       this.notifyObservers(cancelButton); /* Equivalent to a 
click on the cancel button */
+               }

                core.getMainWindow().setEnabled(true);

@@ -260,7 +267,7 @@
        }

        public void windowClosing(final WindowEvent e) {
-               close(false);
+               close(true, false);
        }

        public void windowClosed(final WindowEvent e) {

Modified: trunk/apps/Thaw/src/thaw/plugins/peerMonitor/PeerMonitorPanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/peerMonitor/PeerMonitorPanel.java  
2007-04-23 13:52:13 UTC (rev 12900)
+++ trunk/apps/Thaw/src/thaw/plugins/peerMonitor/PeerMonitorPanel.java  
2007-04-23 14:36:40 UTC (rev 12901)
@@ -192,6 +192,7 @@
                peerPanel.add(memPanel, BorderLayout.SOUTH);


+               //peerPanel.setPreferredSize(


                mainPanel = new JPanel(new GridLayout(2, 1, 10, 10));
@@ -344,9 +345,11 @@
                        if (value instanceof Peer) {
                                String txt = ((Peer)value).toString();

+                               /*
                                if (txt.length() > 25) {
                                        txt = txt.substring(0, 25) + "(...)";
                                }
+                               */

                                setText(txt);
                                setForeground(((Peer)value).getTextColor());


Reply via email to