Author: jflesch
Date: 2007-04-23 13:52:13 +0000 (Mon, 23 Apr 2007)
New Revision: 12900
Modified:
trunk/apps/Thaw/src/thaw/plugins/signatures/SigConfigTab.java
Log:
Resolve partially the focus problem with the dialog asking for a new nickname
Modified: trunk/apps/Thaw/src/thaw/plugins/signatures/SigConfigTab.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/signatures/SigConfigTab.java
2007-04-23 13:43:30 UTC (rev 12899)
+++ trunk/apps/Thaw/src/thaw/plugins/signatures/SigConfigTab.java
2007-04-23 13:52:13 UTC (rev 12900)
@@ -19,7 +19,9 @@
import java.awt.BorderLayout;
import java.awt.GridLayout;
+import java.awt.event.WindowEvent;
+
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
@@ -145,7 +147,7 @@
minLevel.setSelectedItem(I18n.getMessage(Identity.trustLevelStr[i]));
}
- protected class YourIdentitiesPanel implements ActionListener {
+ protected class YourIdentitiesPanel implements ActionListener,
java.awt.event.WindowListener, Runnable {
private JDialog dialog;
private JList list;
@@ -156,9 +158,13 @@
public YourIdentitiesPanel() {
+ configWindow.setEnabled(false);
+
dialog = new JDialog(configWindow.getFrame(),
I18n.getMessage("thaw.plugin.signature.dialogTitle.yourIdentities"));
+ dialog.addWindowListener(this);
+
dialog.getContentPane().setLayout(new BorderLayout(5,
5));
dialog.getContentPane().add(new
JLabel(I18n.getMessage("thaw.plugin.signature.dialogTitle.yourIdentities")+"
:"),
@@ -205,18 +211,26 @@
list.setListData(Identity.getYourIdentities(db));
}
+ public void run() {
+ dialog.setEnabled(false);
+ String nick = JOptionPane.showInputDialog(dialog,
+
I18n.getMessage("thaw.plugin.signature.enterNick"),
+
I18n.getMessage("thaw.plugin.signature.enterNick"),
+
JOptionPane.QUESTION_MESSAGE);
+ dialog.setEnabled(true);
+
+ if (nick != null) {
+ Identity id = Identity.generate(db, nick);
+ id.insert();
+ updateList();
+ }
+ }
+
+
public void actionPerformed(ActionEvent e) {
if (e.getSource() == addIdentity) {
- String nick =
JOptionPane.showInputDialog(dialog,
-
I18n.getMessage("thaw.plugin.signature.enterNick"),
-
I18n.getMessage("thaw.plugin.signature.enterNick"),
-
JOptionPane.QUESTION_MESSAGE);
-
- if (nick != null) {
- Identity id = Identity.generate(db,
nick);
- id.insert();
- updateList();
- }
+ Thread th = new Thread(this);
+ th.start();
}
if (e.getSource() == removeIdentity) {
@@ -229,8 +243,39 @@
if (e.getSource() == closeWindow) {
dialog.setVisible(false);
+ configWindow.setEnabled(true);
}
}
+
+ public void windowActivated(final WindowEvent e) {
+
+ }
+
+ public void windowClosing(final WindowEvent e) {
+ // todo //
+ }
+
+ public void windowClosed(final WindowEvent e) {
+ configWindow.setEnabled(true);
+ }
+
+ public void windowDeactivated(final WindowEvent e) {
+ // We don't care
+ }
+
+ public void windowDeiconified(final WindowEvent e) {
+ // idem
+ }
+
+ public void windowIconified(final WindowEvent e) {
+ // idem
+ }
+
+ public void windowOpened(final WindowEvent e) {
+ // idem
+ }
+
+
}