Author: jflesch
Date: 2008-02-06 03:02:01 +0000 (Wed, 06 Feb 2008)
New Revision: 17588
Modified:
trunk/apps/Thaw/src/thaw/core/ConfigWindow.java
trunk/apps/Thaw/src/thaw/core/Core.java
trunk/apps/Thaw/src/thaw/core/MainWindow.java
trunk/apps/Thaw/src/thaw/core/ThawThread.java
trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties
trunk/apps/Thaw/src/thaw/i18n/thaw.properties
trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties
trunk/apps/Thaw/src/thaw/plugins/signatures/SigConfigTab.java
Log:
Core: Stop nicely Swing instead of calling System.exit(0); ...
Modified: trunk/apps/Thaw/src/thaw/core/ConfigWindow.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/ConfigWindow.java 2008-02-06 02:33:46 UTC
(rev 17587)
+++ trunk/apps/Thaw/src/thaw/core/ConfigWindow.java 2008-02-06 03:02:01 UTC
(rev 17588)
@@ -116,6 +116,8 @@
if (v)
configWin.repaint();
+ else if (core.isStopping())
+ configWin.dispose();
}
public boolean addTab(final String name, final java.awt.Component
panel) {
Modified: trunk/apps/Thaw/src/thaw/core/Core.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/Core.java 2008-02-06 02:33:46 UTC (rev
17587)
+++ trunk/apps/Thaw/src/thaw/core/Core.java 2008-02-06 03:02:01 UTC (rev
17588)
@@ -553,6 +553,7 @@
Logger.info(this, "Hidding main window ...");
mainWindow.setVisible(false);
+ configWindow.setVisible(false);
Logger.info(this, "Stopping plugins ...");
pluginManager.stopPlugins();
Modified: trunk/apps/Thaw/src/thaw/core/MainWindow.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/MainWindow.java 2008-02-06 02:33:46 UTC
(rev 17587)
+++ trunk/apps/Thaw/src/thaw/core/MainWindow.java 2008-02-06 03:02:01 UTC
(rev 17588)
@@ -210,6 +210,7 @@
mainWindow.setExtendedState(Integer.parseInt(core.getConfig().getValue("mainWindowState")));
}
+ mainWindow.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
@@ -235,6 +236,9 @@
if (!v || !core.isStopping()) {
mainWindow.setVisible(v);
}
+
+ if (!v && core.isStopping())
+ mainWindow.dispose();
}
@@ -531,12 +535,7 @@
Integer.toString(mainWindow.getExtendedState()));
}
- if(core == null) {
- Logger.error(this, "Warning, no ref to core, exiting
brutaly");
- System.exit(0);
- } else {
- core.exit();
- }
+ core.exit();
}
Modified: trunk/apps/Thaw/src/thaw/core/ThawThread.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/ThawThread.java 2008-02-06 02:33:46 UTC
(rev 17587)
+++ trunk/apps/Thaw/src/thaw/core/ThawThread.java 2008-02-06 03:02:01 UTC
(rev 17588)
@@ -42,12 +42,7 @@
Logger.info(this, "Thread '"+name+"' finished");
if (threads.size() == 0) {
- Logger.notice(this, "All threads are stopped");
-
- if (allowFullStop) {
- Logger.notice(this, "Halting Thaw");
- System.exit(0);
- }
+ Logger.notice(this, "All Thaw threads are stopped");
}
}
@@ -66,8 +61,7 @@
synchronized(threads) {
if (allowFullStop) {
if (threads.size() == 0) {
- Logger.notice(null, "All threads are
stopped => Halting Thaw");
- System.exit(0);
+ Logger.notice(null, "All Thaw threads
are stopped.");
}
}
}
Modified: trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties 2008-02-06
02:33:46 UTC (rev 17587)
+++ trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties 2008-02-06
03:02:01 UTC (rev 17588)
@@ -86,7 +86,9 @@
thaw.common.autodetect=Auto-detecter
+thaw.common.close=Fermer
thaw.common.closeTab=Fermer cette tabulation
+thaw.common.closeWin=Fermer cette fen?tre
thaw.common.apply=Appliquer
@@ -523,9 +525,12 @@
thaw.plugin.signature.import=Importer une ou plusieurs identit?(s)
thaw.plugin.signature.export=Exporter l'identit? selectionn?e
-thaw.plugin.signature.trustList.export=Export
-thaw.plugin.signature.trustList.import=Import
+thaw.plugin.signature.trustList.export.short=Exporter
+thaw.plugin.signature.trustList.export.long=Exporter votre liste de confiance
+thaw.plugin.signature.trustList.import.short=Importer
+thaw.plugin.signature.trustList.import.long=Import une liste de confiance
(peut remplacer certains de vos choix)
+
thaw.plugin.signature.ignoreLowerThan=Ignorer les signatures avec un status
inf?rieur ?
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2008-02-06 02:33:46 UTC
(rev 17587)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2008-02-06 03:02:01 UTC
(rev 17588)
@@ -83,6 +83,7 @@
thaw.common.paste=Paste
+thaw.common.close=Close
thaw.common.closeTab=Close this tab
thaw.common.closeWin=Close the window
@@ -527,8 +528,10 @@
thaw.plugin.signature.export=Export selected identity
thaw.plugin.signature.setOriginal=Set as original
-thaw.plugin.signature.trustList.export=Export
-thaw.plugin.signature.trustList.import=Import
+thaw.plugin.signature.trustList.export.short=Export
+thaw.plugin.signature.trustList.export.long=Export your trust list
+thaw.plugin.signature.trustList.import.short=Import
+thaw.plugin.signature.trustList.import.long=Import a trust list (may replace
some of your current choice)
thaw.plugin.signature.ignoreLowerThan=Ignore signatures with a status lower
than
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2008-02-06 02:33:46 UTC
(rev 17587)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2008-02-06 03:02:01 UTC
(rev 17588)
@@ -523,9 +523,12 @@
thaw.plugin.signature.import=Importer une ou plusieurs identit\u00e9(s)
thaw.plugin.signature.export=Exporter l'identit\u00e9 selectionn\u00e9e
-thaw.plugin.signature.trustList.export=Export
-thaw.plugin.signature.trustList.import=Import
+thaw.plugin.signature.trustList.export.short=Exporter
+thaw.plugin.signature.trustList.export.long=Exporter votre liste de confiance
+thaw.plugin.signature.trustList.import.short=Importer
+thaw.plugin.signature.trustList.import.long=Import une liste de confiance
(peut remplacer certains de vos choix)
+
thaw.plugin.signature.ignoreLowerThan=Ignorer les signatures avec un status
inf\u00e9rieur \u00e0
Modified: trunk/apps/Thaw/src/thaw/plugins/signatures/SigConfigTab.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/signatures/SigConfigTab.java
2008-02-06 02:33:46 UTC (rev 17587)
+++ trunk/apps/Thaw/src/thaw/plugins/signatures/SigConfigTab.java
2008-02-06 03:02:01 UTC (rev 17588)
@@ -154,6 +154,9 @@
else if (param == configWindow.getCancelButton())
reset();
}
+
+
+ /************************ YOUR IDENTITIES
********************************/
protected class YourIdentitiesPanel implements ActionListener {
@@ -223,7 +226,7 @@
dialog.getContentPane().add(southPanel,
BorderLayout.SOUTH);
-
+
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setSize(500, 300);
dialog.setVisible(true);
}
@@ -365,17 +368,18 @@
if (e.getSource() == closeWindow) {
dialog.setVisible(false);
+ dialog.dispose();
}
}
}
+
+
+ /********************* OTHER IDENTITIES
**********************************/
protected class IdentityModel extends
javax.swing.table.AbstractTableModel {
- /**
- *
- */
private static final long serialVersionUID =
-7614528570324908651L;
public String[] columnNames = {
@@ -436,10 +440,6 @@
protected class OtherIdentitiesRenderer extends
thaw.gui.Table.DefaultRenderer {
-
- /**
- *
- */
private static final long serialVersionUID =
5405210731032136559L;
private IdentityModel model;
@@ -479,7 +479,7 @@
private JButton close;
private JButton setOriginal;
- private Vector buttons;
+ private JButton exportButton, importButton;
public OtherIdentitiesPanel() {
@@ -505,24 +505,33 @@
JPanel eastPanel = new JPanel(new BorderLayout());
- JPanel buttonsPanel = new JPanel(new
GridLayout(Identity.trustLevelInt.length +1, 1));
+ JPanel buttonsPanel = new JPanel(new
GridLayout(Identity.trustLevelInt.length +4, 1));
- buttons = new Vector();
-
for (int i = 0 ; i < Identity.trustLevelInt.length ;
i++) {
if (Identity.trustLevelInt[i] < 100) {
JButton button = new
JButton(Identity.trustLevelStr[i]);
buttonsPanel.add(button);
- buttons.add(button);
button.addActionListener(this);
}
}
+ buttonsPanel.add(new JLabel(""));
setOriginal = new
JButton(I18n.getMessage("thaw.plugin.signature.setOriginal"));
- buttonsPanel.add(new JLabel(""));
buttonsPanel.add(setOriginal);
- buttons.add(setOriginal);
setOriginal.addActionListener(this);
+
+ buttonsPanel.add(new JLabel(""));
+ exportButton = new
JButton(I18n.getMessage("thaw.plugin.signature.trustList.export.short"),
+
IconBox.minExportAction);
+
exportButton.setToolTipText(I18n.getMessage("thaw.plugin.signature.trustList.export.long"));
+ exportButton.addActionListener(this);
+ buttonsPanel.add(exportButton);
+
+ importButton = new
JButton(I18n.getMessage("thaw.plugin.signature.trustList.import.short"),
+
IconBox.minImportAction);
+
importButton.setToolTipText(I18n.getMessage("thaw.plugin.signature.trustList.import.long"));
+ importButton.addActionListener(this);
+ buttonsPanel.add(importButton);
JPanel eastTopPanel = new JPanel();
@@ -532,7 +541,9 @@
JPanel eastBottomPanel = new JPanel();
- close = new JButton(IconBox.minClose);
+ close = new
JButton(I18n.getMessage("thaw.common.close"),
+
IconBox.minClose);
+
close.setToolTipText(I18n.getMessage("thaw.common.closeWin"));
close.addActionListener(this);
eastBottomPanel.add(close);
@@ -542,7 +553,8 @@
dialog.getContentPane().add(eastPanel,
BorderLayout.EAST);
updateList();
-
+
+
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setSize(640, 500);
dialog.setVisible(true);
}
@@ -555,6 +567,7 @@
if (e.getSource() == close) {
dialog.setVisible(false);
+ dialog.dispose();
return;
}
@@ -577,6 +590,10 @@
updateList();
+ } else if (e.getSource() == exportButton) {
+
+ } else if (e.getSource() == importButton) {
+
} else if (e.getSource() instanceof JButton) {
JButton bt = (JButton)e.getSource();
@@ -593,9 +610,7 @@
public void actionPerformed(ActionEvent e) {
if (e.getSource() == yourIdentitiesButton) {
new YourIdentitiesPanel();
- }
-
- if (e.getSource() == otherIdentitiesButton) {
+ } else if (e.getSource() == otherIdentitiesButton) {
new OtherIdentitiesPanel();
}
}