Author: jflesch
Date: 2007-05-01 18:41:15 +0000 (Tue, 01 May 2007)
New Revision: 13090

Modified:
   trunk/apps/Thaw/src/thaw/core/SplashScreen.java
   trunk/apps/Thaw/src/thaw/gui/WarningWindow.java
   trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties
   trunk/apps/Thaw/src/thaw/i18n/thaw.properties
   trunk/apps/Thaw/src/thaw/plugins/InsertPlugin.java
   trunk/apps/Thaw/src/thaw/plugins/index/IndexConfigPanel.java
   trunk/apps/Thaw/src/thaw/plugins/insertPlugin/InsertPanel.java
   trunk/apps/Thaw/src/thaw/plugins/peerMonitor/PeerHelper.java
Log:
Should fix all the focus problem with the warning dialogs

Modified: trunk/apps/Thaw/src/thaw/core/SplashScreen.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/SplashScreen.java     2007-05-01 17:41:18 UTC 
(rev 13089)
+++ trunk/apps/Thaw/src/thaw/core/SplashScreen.java     2007-05-01 18:41:15 UTC 
(rev 13090)
@@ -92,7 +92,11 @@
        }


+       public JDialog getDialog() {
+               return splashScreen;
+       }

+
        /**
         * @param progress In percent
         */

Modified: trunk/apps/Thaw/src/thaw/gui/WarningWindow.java
===================================================================
--- trunk/apps/Thaw/src/thaw/gui/WarningWindow.java     2007-05-01 17:41:18 UTC 
(rev 13089)
+++ trunk/apps/Thaw/src/thaw/gui/WarningWindow.java     2007-05-01 18:41:15 UTC 
(rev 13090)
@@ -18,21 +18,24 @@
        public WarningWindow(final Core core,
                             final String warning)
        {
-               this(core != null ? core.getMainWindow() : null, warning);
+               this(core != null ?
+                    (core.getSplashScreen().getDialog() != null ?
+                     core.getSplashScreen().getDialog()
+                     : core.getMainWindow().getMainFrame())
+                    : null,
+                    warning);
        }

        public WarningWindow(final MainWindow mainWindow, String warning) {
+               this(mainWindow != null ? mainWindow.getMainFrame() : null, 
warning);
+       }

-               if (mainWindow != null) {
-                       JOptionPane.showMessageDialog(mainWindow.getMainFrame(),
-                                                     warning,
-                                                     "Thaw - 
"+I18n.getMessage("thaw.warning.title"),
-                                                     
JOptionPane.WARNING_MESSAGE);
-               } else {
-                       JOptionPane.showMessageDialog(null,
-                                                     warning,
-                                                     "Thaw - 
"+I18n.getMessage("thaw.warning.title"),
-                                                     
JOptionPane.WARNING_MESSAGE);
-               }
+
+       public WarningWindow(final java.awt.Component parent, String warning) {
+
+               JOptionPane.showMessageDialog(parent,
+                                             warning,
+                                             "Thaw - 
"+I18n.getMessage("thaw.warning.title"),
+                                             JOptionPane.WARNING_MESSAGE);
        }
 }

Modified: trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties     2007-05-01 
17:41:18 UTC (rev 13089)
+++ trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties     2007-05-01 
18:41:15 UTC (rev 13090)
@@ -303,7 +303,7 @@
 thaw.plugin.index.autoRefreshInterval=Intervalle de rafraichissement (en 
secondes):
 thaw.plugin.index.nmbIndexPerRefresh=Nombre d'indexes rafraichis au cours de 
l'intervalle:

-thaw.plugin.index.importExportPlugin=Index import / export
+thaw.plugin.index.importExportPlugin=Import / export de la base de donn?es 
d'indexes
 thaw.plugin.index.export=Export
 thaw.plugin.index.import=Import
 thaw.plugin.index.export.indexKeys=Clefs des indexes + les dossiers

Modified: trunk/apps/Thaw/src/thaw/i18n/thaw.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw.properties       2007-05-01 17:41:18 UTC 
(rev 13089)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw.properties       2007-05-01 18:41:15 UTC 
(rev 13090)
@@ -303,7 +303,7 @@
 thaw.plugin.index.autoRefreshInterval=Auto-refresh interval (in sec):
 thaw.plugin.index.nmbIndexPerRefresh=Number of indexes refreshed during each 
interval:

-thaw.plugin.index.importExportPlugin=Index import / export
+thaw.plugin.index.importExportPlugin=Index database import / export
 thaw.plugin.index.export=Export
 thaw.plugin.index.import=Import
 thaw.plugin.index.export.indexKeys=Index keys + folders

Modified: trunk/apps/Thaw/src/thaw/plugins/InsertPlugin.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/InsertPlugin.java  2007-05-01 17:41:18 UTC 
(rev 13089)
+++ trunk/apps/Thaw/src/thaw/plugins/InsertPlugin.java  2007-05-01 18:41:15 UTC 
(rev 13090)
@@ -43,7 +43,8 @@

                Logger.info(this, "Starting plugin \"InsertPlugin\" ...");

-               insertPanel = new InsertPanel(this, core.getConfig(),
+               insertPanel = new InsertPanel(this,
+                                             core.getConfig(), 
core.getMainWindow(),
                                              
Boolean.valueOf(core.getConfig().getValue("advancedMode")).booleanValue());

                scrollPane = new JScrollPane(insertPanel.getPanel());

Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexConfigPanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/IndexConfigPanel.java        
2007-05-01 17:41:18 UTC (rev 13089)
+++ trunk/apps/Thaw/src/thaw/plugins/index/IndexConfigPanel.java        
2007-05-01 18:41:15 UTC (rev 13090)
@@ -176,7 +176,7 @@

                if (!fetchNegative.isSelected()
                    && fetchComments.isSelected()) {
-                       new WarningWindow((thaw.core.MainWindow)null,
+                       new WarningWindow(configWindow.getFrame(),
                                          
I18n.getMessage("thaw.plugin.index.warningNonNegative"));
                }
        }

Modified: trunk/apps/Thaw/src/thaw/plugins/insertPlugin/InsertPanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/insertPlugin/InsertPanel.java      
2007-05-01 17:41:18 UTC (rev 13089)
+++ trunk/apps/Thaw/src/thaw/plugins/insertPlugin/InsertPanel.java      
2007-05-01 18:41:15 UTC (rev 13090)
@@ -30,6 +30,7 @@
 import thaw.gui.WarningWindow;
 import thaw.fcp.FCPClientPut;
 import thaw.plugins.InsertPlugin;
+import thaw.core.MainWindow;


 public class InsertPanel implements ActionListener, ItemListener, Observer {
@@ -81,10 +82,14 @@
        private boolean advancedMode = false;

        private Config config; /* keep a ref to the config for the 
"lastSourceDirectory" option */
+       private MainWindow mainWindow;

-       public InsertPanel(final InsertPlugin insertPlugin, final Config 
config, final boolean advancedMode) {
+       public InsertPanel(final InsertPlugin insertPlugin,
+                          final Config config, final MainWindow mainWindow,
+                          final boolean advancedMode) {
                this.insertPlugin = insertPlugin;
                this.config = config;
+               this.mainWindow = mainWindow;

                this.advancedMode = advancedMode;

@@ -290,7 +295,7 @@

                        if((selectedFiles.getText() == null)
                           || "".equals( selectedFiles.getText() )) {
-                               new WarningWindow((thaw.core.MainWindow)null,
+                               new WarningWindow(mainWindow,
                                                  
I18n.getMessage("thaw.plugin.insert.specifyFile"));
                                return;
                        }
@@ -300,7 +305,7 @@
                                   || "".equals( nameField.getText() )
                                   || (revField.getText() == null)
                                   || revField.getText().equals("")) {
-                                       new 
WarningWindow(((thaw.core.MainWindow)null),
+                                       new WarningWindow(mainWindow,
                                                          
I18n.getMessage("thaw.plugin.insert.specifyNameAndRev"));
                                        return;
                                }

Modified: trunk/apps/Thaw/src/thaw/plugins/peerMonitor/PeerHelper.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/peerMonitor/PeerHelper.java        
2007-05-01 17:41:18 UTC (rev 13089)
+++ trunk/apps/Thaw/src/thaw/plugins/peerMonitor/PeerHelper.java        
2007-05-01 18:41:15 UTC (rev 13090)
@@ -117,7 +117,7 @@
                                        addPeer(queueManager, ref);
                                        dialog.setVisible(false);
                                } else {
-                                       new 
thaw.gui.WarningWindow((thaw.core.MainWindow)null,
+                                       new thaw.gui.WarningWindow(dialog,
                                                                   
I18n.getMessage("thaw.plugin.peerMonitor.invalidRef"));
                                }
                        }


Reply via email to