Author: jflesch
Date: 2006-06-29 21:22:54 +0000 (Thu, 29 Jun 2006)
New Revision: 9406

Modified:
   trunk/apps/Thaw/src/thaw/i18n/thaw.properties
   trunk/apps/Thaw/src/thaw/plugins/FetchPlugin.java
   trunk/apps/Thaw/src/thaw/plugins/InsertPlugin.java
   trunk/apps/Thaw/src/thaw/plugins/QueueWatcher.java
   trunk/apps/Thaw/src/thaw/plugins/queueWatcher/DetailPanel.java
Log:
Finishing fetchPlugin UI

Modified: trunk/apps/Thaw/src/thaw/i18n/thaw.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw.properties       2006-06-29 19:37:07 UTC 
(rev 9405)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw.properties       2006-06-29 21:22:54 UTC 
(rev 9406)
@@ -14,6 +14,8 @@
 thaw.common.insertions=Insertions
 thaw.common.downloads=Downloads

+thaw.common.fetch=Fetch
+
 thaw.common.file=File
 thaw.common.progress=Progress
 thaw.common.size=Size
@@ -26,7 +28,7 @@
 thaw.common.selectFiles=Select file(s)

 thaw.common.persistence=Keep inserting:
-thaw.common.persistenceReboot=Until the freenet node reboots
+thaw.common.persistenceReboot=Until the freenode reboots
 thaw.common.persistenceForever=Until insertion completes
 thaw.common.persistenceConnection=Until Thaw is closed

@@ -34,6 +36,8 @@
 thaw.common.true=True
 thaw.common.false=False

+thaw.common.priority=Priority
+
 ## Menus
 thaw.menu.file=File
 thaw.menu.item.options=Options
@@ -57,9 +61,6 @@
 thaw.config.pluginsLoaded=Plugins loaded:

 ##?Plugins
-thaw.plugin.copySelectedAndInsertedKeys=Copy selected and inserted keys to 
clipboard
-thaw.plugin.copySelectedAndDownloadedKeys=Copy selected and downloaded keys to 
clipboard
-
 thaw.plugin.insert.filesToInsert=File(s) to insert
 thaw.plugin.insert.selectKey=Select the kind of key wanted
 thaw.plugin.insert.KSK=KSK (not recommended)
@@ -70,12 +71,16 @@
 thaw.plugin.insert.publicKey=Public key
 thaw.plugin.insert.privateKey=Private key
 thaw.plugin.insert.insertAction=Insert
-thaw.plugin.insert.priority=Priority

-thaw.plugin.insert.p0=Emergency (*not* for normal use)
-thaw.plugin.insert.p1=Very high
-thaw.plugin.insert.p2=High
-thaw.plugin.insert.p3=Medium (recommanded)
-thaw.plugin.insert.p4=Low
-thaw.plugin.insert.p5=Very low
-thaw.plugin.insert.p6=Will never finish
+thaw.plugin.priority.p0=Emergency (*not* for normal use)
+thaw.plugin.priority.p1=Very high
+thaw.plugin.priority.p2=High
+thaw.plugin.priority.p3=Medium (recommanded)
+thaw.plugin.priority.p4=Low
+thaw.plugin.priority.p5=Very low
+thaw.plugin.priority.p6=Will never finish
+
+thaw.plugin.fetch.keyList=Key list
+thaw.plugin.fetch.loadKeyListFromFile=Load keys from file ...
+thaw.plugin.fetch.destinationDirectory=Destination directory
+thaw.plugin.fetch.chooseDestination=Choose destination ...

Modified: trunk/apps/Thaw/src/thaw/plugins/FetchPlugin.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/FetchPlugin.java   2006-06-29 19:37:07 UTC 
(rev 9405)
+++ trunk/apps/Thaw/src/thaw/plugins/FetchPlugin.java   2006-06-29 21:22:54 UTC 
(rev 9406)
@@ -4,12 +4,13 @@

 import thaw.core.*;
 import thaw.i18n.I18n;
+import thaw.plugins.fetchPlugin.*;


 public class FetchPlugin implements thaw.core.Plugin {
        private Core core;

-       private JPanel mainPanel;
+       private FetchPanel fetchPanel = null;


        public FetchPlugin() {
@@ -22,9 +23,9 @@

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

-               mainPanel = new JPanel();
+               fetchPanel = new FetchPanel();

-               
core.getMainWindow().addTab(I18n.getMessage("thaw.common.download"), mainPanel);
+               
core.getMainWindow().addTab(I18n.getMessage("thaw.common.download"), 
fetchPanel.getPanel());

                return true;
        }
@@ -33,7 +34,7 @@
        public boolean stop() {
                Logger.info(this, "Stopping plugin \"FetchPlugin\" ...");

-               core.getMainWindow().removeTab(mainPanel);
+               core.getMainWindow().removeTab(fetchPanel.getPanel());

                return true;
        }

Modified: trunk/apps/Thaw/src/thaw/plugins/InsertPlugin.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/InsertPlugin.java  2006-06-29 19:37:07 UTC 
(rev 9405)
+++ trunk/apps/Thaw/src/thaw/plugins/InsertPlugin.java  2006-06-29 21:22:54 UTC 
(rev 9406)
@@ -13,51 +13,13 @@

 import thaw.core.*;
 import thaw.i18n.I18n;
+import thaw.plugins.insertPlugin.*;

-
 public class InsertPlugin implements thaw.core.Plugin {
        private Core core;

-       private JPanel globalPanel;
+       private InsertPanel insertPanel;

-       private JPanel mainPanel;
-
-       private JPanel subPanel; /* because we won't use the whole space */
-
-
-       private JLabel browseLabel;
-       private JTextField selectedFiles;
-       private JButton browseButton;
-
-       private JLabel selectKeyLabel;
-       private ButtonGroup keyRadioGroup;
-       private JRadioButton[] keyRadioButtons;
-
-       private JLabel selectRevLabel;
-       private JTextField revField;
-
-       private JLabel selectNameLabel;
-       private JTextField nameField;
-
-       private JLabel publicKeyLabel;
-       private JTextField publicKeyField;
-       private JLabel privateKeyLabel;
-       private JTextField privateKeyField;
-
-       private String[] priorities;
-       private JLabel priorityLabel;
-       private JComboBox prioritySelecter;
-
-       private String[] globalStr;
-       private JLabel globalLabel;
-       private JComboBox globalSelecter;
-
-       private String[] persistences;
-       private JLabel persistenceLabel;
-       private JComboBox persistenceSelecter;
-
-       private JButton letsGoButton;
-
        public InsertPlugin() {

        }
@@ -68,164 +30,10 @@

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

-               globalPanel = new JPanel();
+               insertPanel = new InsertPanel();

-               mainPanel = new JPanel();
-               mainPanel.setLayout(new BorderLayout(10, 10));
+               
core.getMainWindow().addTab(I18n.getMessage("thaw.common.insertion"), 
insertPanel.getPanel());

-               subPanel = new JPanel();
-
-               subPanel.setLayout(new GridLayout(3,2, 40, 40));
-
-               
-               // FILE SELECTION
-
-               JPanel subSubPanel = new JPanel();
-               subSubPanel.setLayout(new GridLayout(3, 1));
-               browseLabel = new 
JLabel(I18n.getMessage("thaw.plugin.insert.filesToInsert"));
-               subSubPanel.add(browseLabel);
-               selectedFiles = new JTextField(20);
-               selectedFiles.setEditable(false);
-               subSubPanel.add(selectedFiles);
-               browseButton = new 
JButton(I18n.getMessage("thaw.common.selectFiles"));
-               subSubPanel.add(browseButton);
-
-               subPanel.add(subSubPanel);
-
-
-               // KEY TYPE SELECTION
-
-               subSubPanel = new JPanel();
-               subSubPanel.setLayout(new GridLayout(4, 1));
-               selectKeyLabel = new 
JLabel(I18n.getMessage("thaw.plugin.insert.selectKey"));
-               subSubPanel.add(selectKeyLabel);
-               keyRadioButtons = new JRadioButton[3];
-               keyRadioButtons[0] = new 
JRadioButton(I18n.getMessage("thaw.plugin.insert.CHK"));
-               keyRadioButtons[0].setSelected(true);
-               keyRadioButtons[1] = new 
JRadioButton(I18n.getMessage("thaw.plugin.insert.KSK"));
-               keyRadioButtons[2] = new 
JRadioButton(I18n.getMessage("thaw.plugin.insert.SSK"));
-               keyRadioGroup = new ButtonGroup();
-               for(int i = 0 ; i < keyRadioButtons.length ; i++) {
-                       keyRadioGroup.add(keyRadioButtons[i]);
-                       subSubPanel.add(keyRadioButtons[i]);
-               }
-
-               subPanel.add(subSubPanel);
-
-
-               // PERSISTENCE & GLOBAL
-
-               persistences = new String[] {
-                       I18n.getMessage("thaw.common.persistenceConnection"),
-                       I18n.getMessage("thaw.common.persistenceReboot"),
-                       I18n.getMessage("thaw.common.persistenceForever"),
-               };
-
-               subSubPanel = new JPanel();
-               subSubPanel.setLayout(new GridLayout(4, 1));
-               persistenceLabel = new 
JLabel(I18n.getMessage("thaw.common.persistence"));
-               subSubPanel.add(persistenceLabel);
-               persistenceSelecter = new JComboBox(persistences);
-               
persistenceSelecter.setSelectedItem(I18n.getMessage("thaw.common.persistenceReboot"));
-               subSubPanel.add(persistenceSelecter);
-               
-
-               globalStr = new String[] {
-                       I18n.getMessage("thaw.common.true"),
-                       I18n.getMessage("thaw.common.false"),
-               };
-
-               globalLabel = new 
JLabel(I18n.getMessage("thaw.common.globalQueue"));
-               subSubPanel.add(globalLabel);
-               globalSelecter = new JComboBox(globalStr);
-               
globalSelecter.setSelectedItem(I18n.getMessage("thaw.common.true"));
-               subSubPanel.add(globalSelecter);
-
-               subPanel.add(subSubPanel);
-
-
-
-               // REVISION SELECTION
-
-               subSubPanel = new JPanel();
-               subSubPanel.setLayout(new GridLayout(4, 1));
-
-               selectRevLabel = new 
JLabel(I18n.getMessage("thaw.plugin.insert.selectRev"));
-               subSubPanel.add(selectRevLabel);
-               revField = new JTextField(4);
-               revField.setEditable(false);
-               subSubPanel.add(revField);
-               
-               selectNameLabel = new 
JLabel(I18n.getMessage("thaw.plugin.insert.selectName"));
-               subSubPanel.add(selectNameLabel);
-               nameField = new JTextField(10);
-               nameField.setEditable(false);
-               subSubPanel.add(nameField);
-
-               subPanel.add(subSubPanel);
-
-
-
-               // PRIORITY SELECTION
-
-               priorities = new String[] {
-                       I18n.getMessage("thaw.plugin.insert.p0"),
-                       I18n.getMessage("thaw.plugin.insert.p1"),
-                       I18n.getMessage("thaw.plugin.insert.p2"),
-                       I18n.getMessage("thaw.plugin.insert.p3"),
-                       I18n.getMessage("thaw.plugin.insert.p4"),
-                       I18n.getMessage("thaw.plugin.insert.p5"),
-                       I18n.getMessage("thaw.plugin.insert.p6") 
-                       
-               };
-
-               subSubPanel = new JPanel();
-               subSubPanel.setLayout(new GridLayout(4, 1));
-               priorityLabel = new 
JLabel(I18n.getMessage("thaw.plugin.insert.priority"));
-               subSubPanel.add(priorityLabel);
-               prioritySelecter = new JComboBox(priorities);
-               
prioritySelecter.setSelectedItem(I18n.getMessage("thaw.plugin.insert.p3"));
-               subSubPanel.add(prioritySelecter);
-               
-               subPanel.add(subSubPanel);
-               
-
-
-               // PUBLIC / PRIVATE KEY
-
-               subSubPanel = new JPanel();
-               subSubPanel.setLayout(new GridLayout(4, 1));
-
-               publicKeyLabel = new 
JLabel(I18n.getMessage("thaw.plugin.insert.publicKey"));
-               subSubPanel.add(publicKeyLabel);
-               publicKeyField = new JTextField(20);
-               publicKeyField.setEditable(false);
-               subSubPanel.add(publicKeyField);
-
-               privateKeyLabel = new 
JLabel(I18n.getMessage("thaw.plugin.insert.privateKey"));
-               subSubPanel.add(privateKeyLabel);
-               privateKeyField = new JTextField(20);
-               privateKeyField.setEditable(false);
-               subSubPanel.add(privateKeyField);
-
-               subPanel.add(subSubPanel);
-
-
-
-
-               mainPanel.add(subPanel, BorderLayout.CENTER);
-
-               letsGoButton = new 
JButton(I18n.getMessage("thaw.plugin.insert.insertAction"));
-               mainPanel.add(letsGoButton, BorderLayout.SOUTH);
-
-               mainPanel.setSize(400, 400);
-
-               globalPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 50, 
50));
-
-               globalPanel.add(mainPanel);
-
-               
core.getMainWindow().addTab(I18n.getMessage("thaw.common.insertion"), 
globalPanel);
-
                return true;
        }

@@ -233,7 +41,7 @@
        public boolean stop() {
                Logger.info(this, "Stopping plugin \"InsertPlugin\" ...");

-               core.getMainWindow().removeTab(mainPanel);
+               core.getMainWindow().removeTab(insertPanel.getPanel());

                return true;
        }

Modified: trunk/apps/Thaw/src/thaw/plugins/QueueWatcher.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/QueueWatcher.java  2006-06-29 19:37:07 UTC 
(rev 9405)
+++ trunk/apps/Thaw/src/thaw/plugins/QueueWatcher.java  2006-06-29 21:22:54 UTC 
(rev 9406)
@@ -21,11 +21,6 @@
        private DetailPanel detailPanel;
        private JPanel panel;

-
-       private JPanel buttonPanel;
-       private JButton buttonCopyInsertedKeys;
-       private JButton buttonCopyDownloadedKeys;
-
        public QueueWatcher() {

        }
@@ -63,17 +58,6 @@
                        mainPanel.add(detailPanel.getPanel(), 
BorderLayout.EAST);
                }

-               buttonPanel = new JPanel();
-               buttonPanel.setLayout(new GridLayout(1, 2));
-
-               buttonCopyInsertedKeys = new 
JButton(I18n.getMessage("thaw.plugin.copySelectedAndInsertedKeys"));
-               buttonCopyDownloadedKeys = new 
JButton(I18n.getMessage("thaw.plugin.copySelectedAndDownloadedKeys"));
-
-               buttonPanel.add(buttonCopyInsertedKeys);
-               buttonPanel.add(buttonCopyDownloadedKeys);
-
-               mainPanel.add(buttonPanel, BorderLayout.SOUTH);
-
                
core.getMainWindow().addTab(I18n.getMessage("thaw.common.status"), mainPanel);

                return true;

Modified: trunk/apps/Thaw/src/thaw/plugins/queueWatcher/DetailPanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/queueWatcher/DetailPanel.java      
2006-06-29 19:37:07 UTC (rev 9405)
+++ trunk/apps/Thaw/src/thaw/plugins/queueWatcher/DetailPanel.java      
2006-06-29 21:22:54 UTC (rev 9406)
@@ -5,6 +5,8 @@
 import javax.swing.JPanel;
 import javax.swing.JLabel;
 import javax.swing.JTextField;
+import javax.swing.JProgressBar;
+import javax.swing.JComponent;

 import thaw.core.*;
 import thaw.i18n.I18n;
@@ -19,7 +21,7 @@

        private JTextField file     = new JTextField();
        private JTextField size     = new JTextField();
-       private JTextField progress = new JTextField();
+       private JProgressBar progress = new JProgressBar(0, 100);
        private JTextField key      = new JTextField();
        private JTextField path     = new JTextField();
        private JTextField priority = new JTextField();
@@ -49,19 +51,23 @@
                                JLabel newLabel = new JLabel(fieldNames[i/2]);
                                subPanel.add(newLabel);
                        } else {
-                               JTextField field = null;
+                               JComponent field = null;

                                switch(((int)i/2)) {
-                               case(0): field = file; break;
-                               case(1): field = size; break;
-                               case(2): field = progress; break;
-                               case(3): field = key; break;
-                               case(4): field = path; break;
-                               case(5): field = priority; break;
-                               case(6): field = attempt; break;
+                               case(0): field = file; file.setEditable(false); 
break;
+                               case(1): field = size; size.setEditable(false); 
break;
+                               case(2):
+                                       field = progress; 
+                                       progress.setString("");
+                                       progress.setStringPainted(true);
+                                       break;
+                               case(3): field = key; 
key.setEditable(false);break;
+                               case(4): field = path; path.setEditable(false); 
break;
+                               case(5): field = priority; 
priority.setEditable(false); break;
+                               case(6): field = attempt; 
attempt.setEditable(false); break;
                                default: Logger.warning(this, "Gouli goula ? 
... is going to crash :p"); break;
                                }
-                               field.setEditable(false);
+
                                subPanel.add(field);
                        }



Reply via email to