Author: jflesch
Date: 2007-05-01 17:41:18 +0000 (Tue, 01 May 2007)
New Revision: 13089
Modified:
trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties
trunk/apps/Thaw/src/thaw/i18n/thaw.properties
trunk/apps/Thaw/src/thaw/plugins/signatures/Identity.java
trunk/apps/Thaw/src/thaw/plugins/signatures/SigConfigTab.java
Log:
Add a warning when deleting an identity
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:23:40 UTC (rev 13088)
+++ trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties 2007-05-01
17:41:18 UTC (rev 13089)
@@ -435,6 +435,12 @@
thaw.plugin.signature.ignoreLowerThan=Ignorer les signatures avec un status
inf?rieur ?
+thaw.plugin.signature.delete.areYouSureTitle=Suicider votre vous-m?me anonyme ?
+thaw.plugin.signature.delete.areYouSure=?tes-vous s?r de vouloir supprimer
cette identit? ?
+
+thaw.plugin.signature.delete.cant=Impossible de supprimer cette identit? :
Quelques messages doivent probablement ?tre toujours rattach?s ? cette identit?
+
+
# Zeroconf
thaw.zeroconf.searchingNode=Recherche de noeuds Freenet ...
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2007-05-01 17:23:40 UTC
(rev 13088)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2007-05-01 17:41:18 UTC
(rev 13089)
@@ -439,9 +439,13 @@
thaw.plugin.signature.setOriginal=Set as original
-
thaw.plugin.signature.ignoreLowerThan=Ignore signatures with a status lower
than
+thaw.plugin.signature.delete.areYouSureTitle=Make your anonymous yourself
commit suicide ?
+thaw.plugin.signature.delete.areYouSure=Are you sure you want to delete this
identity ?
+
+thaw.plugin.signature.delete.cant=Can't delete this identity : Some messages
are probably still linked to this identity
+
# ZeroConf
thaw.zeroconf.searchingNode=Searching freenet nodes ...
Modified: trunk/apps/Thaw/src/thaw/plugins/signatures/Identity.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/signatures/Identity.java 2007-05-01
17:23:40 UTC (rev 13088)
+++ trunk/apps/Thaw/src/thaw/plugins/signatures/Identity.java 2007-05-01
17:41:18 UTC (rev 13089)
@@ -388,7 +388,9 @@
st.execute();
}
} catch(SQLException e) {
- Logger.error(this, "Exception while deleting the
identity from the bdd: "+e.toString());
+ Logger.warning(this, "Exception while deleting the
identity from the bdd: "+e.toString());
+ new thaw.gui.WarningWindow((thaw.core.MainWindow)null,
+
I18n.getMessage("thaw.plugin.signature.delete.cant"));
}
}
Modified: trunk/apps/Thaw/src/thaw/plugins/signatures/SigConfigTab.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/signatures/SigConfigTab.java
2007-05-01 17:23:40 UTC (rev 13088)
+++ trunk/apps/Thaw/src/thaw/plugins/signatures/SigConfigTab.java
2007-05-01 17:41:18 UTC (rev 13089)
@@ -283,6 +283,29 @@
}
+ private class IdentityDeleter implements Runnable {
+ private Identity i;
+
+ public IdentityDeleter(Identity i) {
+ this.i = i;
+ }
+
+ public void run() {
+ int ret = JOptionPane.showConfirmDialog(dialog,
+
I18n.getMessage("thaw.plugin.signature.delete.areYouSure"),
+
I18n.getMessage("thaw.plugin.signature.delete.areYouSureTitle"),
+
JOptionPane.YES_NO_OPTION);
+ if (ret != JOptionPane.YES_OPTION) {
+ Logger.info(this, "Deletion cancelled");
+ return;
+ }
+
+ i.delete();
+ updateList();
+ }
+ }
+
+
public void actionPerformed(ActionEvent e) {
if (e.getSource() == addIdentity) {
Thread th = new Thread(new IdentityAdder());
@@ -292,8 +315,8 @@
if (e.getSource() == removeIdentity) {
Identity i = (Identity)list.getSelectedValue();
if (i != null) {
- i.delete();
- updateList();
+ Thread th = new Thread(new
IdentityDeleter(i));
+ th.start();
}
}