Author: jflesch
Date: 2007-04-21 21:07:45 +0000 (Sat, 21 Apr 2007)
New Revision: 12846

Added:
   trunk/apps/Thaw/src/thaw/plugins/signatures/
Modified:
   trunk/apps/Thaw/src/thaw/core/PluginManager.java
   trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java
   trunk/apps/Thaw/src/thaw/gui/IconBox.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/IndexBrowser.java
   trunk/apps/Thaw/src/thaw/plugins/Signatures.java
Log:
Fix possible redirection bug

Modified: trunk/apps/Thaw/src/thaw/core/PluginManager.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/PluginManager.java    2007-04-21 18:52:09 UTC 
(rev 12845)
+++ trunk/apps/Thaw/src/thaw/core/PluginManager.java    2007-04-21 21:07:45 UTC 
(rev 12846)
@@ -15,7 +15,6 @@
                "thaw.plugins.StatusBar",
                "thaw.plugins.ThemeSelector",
                "thaw.plugins.Hsqldb",
-               "thaw.plugins.Signatures",
                "thaw.plugins.IndexBrowser",
                "thaw.plugins.IndexExporter"
        };

Modified: trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java
===================================================================
--- trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java      2007-04-21 18:52:09 UTC 
(rev 12845)
+++ trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java      2007-04-21 21:07:45 UTC 
(rev 12846)
@@ -48,7 +48,10 @@

        private FCPTestDDA testDDA = null;

+       /* used when redirected */
+       private boolean restartIfFailed = false;

+
        /**
         * See setParameters().
         */
@@ -400,7 +403,12 @@
                                Logger.debug(this, "Redirected !");
                                key = message.getValue("RedirectURI");
                                status = "Redirected ...";
+                               restartIfFailed = true;
                                stop(queueManager);
+                       }
+
+                       if (restartIfFailed) {
+                               restartIfFailed = false;
                                start(queueManager);
                                return;
                        }

Modified: trunk/apps/Thaw/src/thaw/gui/IconBox.java
===================================================================
--- trunk/apps/Thaw/src/thaw/gui/IconBox.java   2007-04-21 18:52:09 UTC (rev 
12845)
+++ trunk/apps/Thaw/src/thaw/gui/IconBox.java   2007-04-21 21:07:45 UTC (rev 
12846)
@@ -84,7 +84,9 @@

        public static ImageIcon add;
        public static ImageIcon minAdd;
+
        public static ImageIcon remove;
+       public static ImageIcon minRemove;

        public static ImageIcon terminal;
        public static ImageIcon minTerminal;
@@ -208,6 +210,7 @@
                IconBox.terminal            = IconBox.loadIcon("terminal.png");
                IconBox.minTerminal         = 
IconBox.loadIcon("min-terminal.png");
                IconBox.remove              = IconBox.loadIcon("remove.png");
+               IconBox.minRemove           = 
IconBox.loadIcon("min-remove.png");
                IconBox.queueWatcher        = 
IconBox.loadIcon("queueWatcher.png");
                IconBox.importExport        = IconBox.loadIcon("refresh.png");
                IconBox.minImportAction     = 
IconBox.loadIcon("min-import.png");

Modified: trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties     2007-04-21 
18:52:09 UTC (rev 12845)
+++ trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties     2007-04-21 
21:07:45 UTC (rev 12846)
@@ -379,9 +379,19 @@
 thaw.plugin.themeSelector.theme=Th?me


+thaw.plugin.signature.signatures=Identit?s
 thaw.plugin.signature.pluginName=Gestion des signatures
+thaw.plugin.signature.yourIdentities=G?rer vos identit?s
+thaw.plugin.signature.otherIdentities=G?rer les autres identit?s

+thaw.plugin.signature.trustLevel.dev=ARCHITECTE DE LA MATRICE
+thaw.plugin.signature.trustLevel.good=BON
+thaw.plugin.signature.trustLevel.observe=EN OBSERVATION
+thaw.plugin.signature.trustLevel.check=VALIDE
+thaw.plugin.signature.trustLevel.bad=MAUVAIS
+thaw.plugin.signature.trustLevel.evil=DIABOLIQUE

+
 # 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-04-21 18:52:09 UTC 
(rev 12845)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw.properties       2007-04-21 21:07:45 UTC 
(rev 12846)
@@ -78,6 +78,7 @@
 thaw.common.paste=Paste

 thaw.common.closeTab=Close this tab
+thaw.common.closeWin=Close the window


 thaw.common.autodetect=Auto-detect
@@ -382,10 +383,32 @@

 thaw.plugin.index.blackList=Index blacklist

+
+
+thaw.plugin.signature.signatures=Identities
 thaw.plugin.signature.pluginName=Signature management
+thaw.plugin.signature.yourIdentities=Manage your identities
+thaw.plugin.signature.otherIdentities=Manage other identities

+thaw.plugin.signature.dialogTitle.yourIdentities=Your Identities
+thaw.plugin.signature.dialogTitle.otherIdentities=Identities

+thaw.plugin.signature.nickname=Nickname
+thaw.plugin.signature.trustLevel=Trust level

+thaw.plugin.signature.addIdentity=Generate a new identity
+thaw.plugin.signature.removeIdentity=Delete the selected identity
+
+thaw.plugin.signature.enterNick=Enter a nickname :
+
+thaw.plugin.signature.trustLevel.dev=MATRIX ARCHITECT
+thaw.plugin.signature.trustLevel.good=GOOD
+thaw.plugin.signature.trustLevel.observe=OBSERVE
+thaw.plugin.signature.trustLevel.check=CHECK
+thaw.plugin.signature.trustLevel.bad=BAD
+thaw.plugin.signature.trustLevel.evil=EVIL
+
+
 # ZeroConf

 thaw.zeroconf.searchingNode=Searching freenet nodes ...

Modified: trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties    2007-04-21 18:52:09 UTC 
(rev 12845)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties    2007-04-21 21:07:45 UTC 
(rev 12846)
@@ -378,6 +378,12 @@
 thaw.plugin.themeSelector.selectATheme=Selectionnez un th\u00e8me:
 thaw.plugin.themeSelector.theme=Th\u00e8me

+
+thaw.plugin.signature.pluginName=Gestion des signatures
+thaw.plugin.signature.yourIdentities=G\u00e9rer vos identit\u00e9s
+thaw.plugin.signature.otherIdentities=G\u00e9rer les autres identit\u00e9s
+
+
 # Zeroconf

 thaw.zeroconf.searchingNode=Recherche de noeuds Freenet ...

Modified: trunk/apps/Thaw/src/thaw/plugins/IndexBrowser.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/IndexBrowser.java  2007-04-21 18:52:09 UTC 
(rev 12845)
+++ trunk/apps/Thaw/src/thaw/plugins/IndexBrowser.java  2007-04-21 21:07:45 UTC 
(rev 12846)
@@ -23,7 +23,9 @@

        private Core core;
        private Hsqldb hsqldb;
+       private Signatures signatures;

+
        private IndexBrowserPanel browserPanel;
        private Vector toolbarActions;

@@ -52,6 +54,23 @@
                hsqldb = 
(Hsqldb)core.getPluginManager().getPlugin("thaw.plugins.Hsqldb");
                hsqldb.registerChild(this);

+
+               /*
+               if(core.getPluginManager().getPlugin("thaw.plugins.Signatures") 
== null) {
+                       Logger.info(this, "Loading signatures plugin");
+
+                       
if(core.getPluginManager().loadPlugin("thaw.plugins.Signatures") == null
+                          || 
!core.getPluginManager().runPlugin("thaw.plugins.Signatures")) {
+                               Logger.error(this, "Unable to load 
thaw.plugins.Signatures !");
+                               return false;
+                       }
+               }
+
+               signatures = 
(Signatures)core.getPluginManager().getPlugin("thaw.plugins.Signatures");
+               signatures.registerChild(this);
+               *//* (don't forget to unregister) */
+
+
                boolean newDb;

                newDb = DatabaseManager.init(hsqldb, core.getConfig(), 
core.getSplashScreen());
@@ -114,6 +133,7 @@
                }

                hsqldb.unregisterChild(this);
+               //signatures.unregisterChild(this);

                if (configPanel != null)
                        configPanel.removeTab();

Modified: trunk/apps/Thaw/src/thaw/plugins/Signatures.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/Signatures.java    2007-04-21 18:52:09 UTC 
(rev 12845)
+++ trunk/apps/Thaw/src/thaw/plugins/Signatures.java    2007-04-21 21:07:45 UTC 
(rev 12846)
@@ -3,25 +3,84 @@

 import thaw.core.I18n;
 import thaw.core.Core;
+import thaw.core.Logger;
 import thaw.core.PluginManager;
+import thaw.core.LibraryPlugin;

 import thaw.gui.IconBox;

+import thaw.plugins.signatures.*;

-public class Signatures implements thaw.core.Plugin {
+
+public class Signatures extends LibraryPlugin {
+       public Core core;
+       public Hsqldb db;
+       public SigConfigTab configTab;
+
+       /**
+        * because we must be sure that we won't be used anymore when we will
+        * unregister from the db
+        */
+       private int used;
+
        public Signatures() {
-
+               used = 0;
        }


+
        public boolean run(Core core) {
+               this.core = core;
+
+               used++;
+
+               if(core.getPluginManager().getPlugin("thaw.plugins.Hsqldb") == 
null) {
+                       Logger.info(this, "Loading Hsqldb plugin");
+
+                       
if(core.getPluginManager().loadPlugin("thaw.plugins.Hsqldb") == null
+                          || 
!core.getPluginManager().runPlugin("thaw.plugins.Hsqldb")) {
+                               Logger.error(this, "Unable to load 
thaw.plugins.Hsqldb !");
+                               return false;
+                       }
+               }
+
+               db = 
(Hsqldb)core.getPluginManager().getPlugin("thaw.plugins.Hsqldb");
+               db.registerChild(this);
+
+               configTab = new SigConfigTab(core.getConfigWindow(), db);
+
+               
core.getConfigWindow().addTab(I18n.getMessage("thaw.plugin.signature.signatures"),
+                                             null 
/*thaw.gui.IconBox.minIdentities*/,
+                                             configTab.getPanel());
+
                return true;
        }

+
+       public void realStart() {
+               used++;
+       }
+
+
        public boolean stop() {
+               core.getConfigWindow().removeTab(configTab.getPanel());
+
+               used--;
+
+               if (used == 0)
+                       db.unregisterChild(this);
+
                return true;
        }

+
+       public void realStop() {
+               used--;
+
+               if (used == 0)
+                       db.unregisterChild(this);
+       }
+
        public String getNameForUser() {
                return I18n.getMessage("thaw.plugin.signature.pluginName");
        }


Reply via email to