Author: jflesch
Date: 2006-11-01 23:48:15 +0000 (Wed, 01 Nov 2006)
New Revision: 10792
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/index/Index.java
trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueuePanel.java
Log:
Add two item to the contextual menus in the QueueWatcher
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2006-11-01 22:38:27 UTC
(rev 10791)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2006-11-01 23:48:15 UTC
(rev 10792)
@@ -12,8 +12,10 @@
thaw.common.insertion=Insertion
thaw.common.download=Download
+thaw.common.addDownloads=Download files
thaw.common.insertions=Insertions
thaw.common.downloads=Downloads
+thaw.common.addInsertions=Insert files
thaw.common.uploading=Uploading
Modified: trunk/apps/Thaw/src/thaw/plugins/FetchPlugin.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/FetchPlugin.java 2006-11-01 22:38:27 UTC
(rev 10791)
+++ trunk/apps/Thaw/src/thaw/plugins/FetchPlugin.java 2006-11-01 23:48:15 UTC
(rev 10792)
@@ -7,6 +7,8 @@
import javax.swing.JButton;
import javax.swing.WindowConstants;
+import javax.swing.JMenuItem;
+
import thaw.core.*;
import thaw.plugins.fetchPlugin.*;
@@ -19,6 +21,7 @@
private JFrame fetchFrame = null;
private JButton buttonInToolBar = null;
+ private JMenuItem menuItem = null;
private QueueWatcher queueWatcher;
@@ -52,6 +55,8 @@
buttonInToolBar.setToolTipText(I18n.getMessage("thaw.common.download"));
buttonInToolBar.addActionListener(this);
+ menuItem = new
JMenuItem(I18n.getMessage("thaw.common.addDownloads"));
+ menuItem.addActionListener(this);
if(core.getPluginManager().getPlugin("thaw.plugins.QueueWatcher") == null) {
Logger.info(this, "Loading QueueWatcher plugin");
@@ -67,6 +72,9 @@
queueWatcher.addButtonToTheToolbar(buttonInToolBar);
+ /* WARNING: This menu item can't be remove cleanly ... :/ */
+ queueWatcher.addMenuItemToTheDownloadTable(menuItem);
+
return true;
}
@@ -87,8 +95,7 @@
}
public void actionPerformed(ActionEvent e) {
- if (e.getSource() == buttonInToolBar)
- fetchFrame.setVisible(true);
+ fetchFrame.setVisible(true);
}
public void fetchFiles(String[] keys, int priority,
Modified: trunk/apps/Thaw/src/thaw/plugins/InsertPlugin.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/InsertPlugin.java 2006-11-01 22:38:27 UTC
(rev 10791)
+++ trunk/apps/Thaw/src/thaw/plugins/InsertPlugin.java 2006-11-01 23:48:15 UTC
(rev 10792)
@@ -10,6 +10,8 @@
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
+import javax.swing.JMenuItem;
+
import thaw.core.*;
import thaw.plugins.insertPlugin.*;
import thaw.fcp.*;
@@ -23,6 +25,8 @@
private JFrame insertionFrame;
private JButton buttonInToolBar;
+ private JMenuItem menuItem;
+
private QueueWatcher queueWatcher;
@@ -61,6 +65,9 @@
buttonInToolBar.setToolTipText(I18n.getMessage("thaw.common.insertion"));
buttonInToolBar.addActionListener(this);
+ menuItem = new
JMenuItem(I18n.getMessage("thaw.common.addInsertions"));
+ menuItem.addActionListener(this);
+
if(core.getPluginManager().getPlugin("thaw.plugins.QueueWatcher") == null) {
Logger.info(this, "Loading QueueWatcher plugin");
@@ -75,6 +82,9 @@
queueWatcher.addButtonToTheToolbar(buttonInToolBar);
+ /* WARNING: This menu item can't be remove cleanly ... :/ */
+ queueWatcher.addMenuItemToTheInsertionTable(menuItem);
+
return true;
}
@@ -97,8 +107,7 @@
public void actionPerformed(ActionEvent e) {
- if (e.getSource() == buttonInToolBar)
- insertionFrame.setVisible(true);
+ insertionFrame.setVisible(true);
}
Modified: trunk/apps/Thaw/src/thaw/plugins/QueueWatcher.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/QueueWatcher.java 2006-11-01 22:38:27 UTC
(rev 10791)
+++ trunk/apps/Thaw/src/thaw/plugins/QueueWatcher.java 2006-11-01 23:48:15 UTC
(rev 10792)
@@ -112,6 +112,14 @@
}
+ public void addMenuItemToTheDownloadTable(javax.swing.JMenuItem item) {
+ queuePanels[0].addMenuItem(item);
+ }
+
+ public void addMenuItemToTheInsertionTable(javax.swing.JMenuItem item) {
+ queuePanels[1].addMenuItem(item);
+ }
+
public String getNameForUser() {
return I18n.getMessage("thaw.common.status");
}
Modified: trunk/apps/Thaw/src/thaw/plugins/index/Index.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/Index.java 2006-11-01 22:38:27 UTC
(rev 10791)
+++ trunk/apps/Thaw/src/thaw/plugins/index/Index.java 2006-11-01 23:48:15 UTC
(rev 10792)
@@ -437,7 +437,7 @@
st.execute();
this.linkList = new Vector();
} catch(SQLException e) {
- Logger.warning(this, "Unable to purge da list !
Exception: "+e.toString());
+ Logger.error(this, "Unable to purge da list !
Exception: "+e.toString());
}
}
@@ -449,7 +449,7 @@
st.execute();
this.fileList = new Vector();
} catch(SQLException e) {
- Logger.warning(this, "Unable to purge da list !
Exception: "+e.toString());
+ Logger.error(this, "Unable to purge da list !
Exception: "+e.toString());
}
}
@@ -644,7 +644,7 @@
} catch(java.sql.SQLException e) {
- Logger.warning(this, "Unable to get the file list for
index: '"+this.toString()+"' because: "+e.toString());
+ Logger.error(this, "Unable to get the file list for
index: '"+this.toString()+"' because: "+e.toString());
}
this.setChanged();
@@ -854,7 +854,7 @@
} catch(java.sql.SQLException e) {
- Logger.warning(this, "Unable to get the link list for
index: '"+this.toString()+"' because: "+e.toString());
+ Logger.error(this, "Unable to get the link list for
index: '"+this.toString()+"' because: "+e.toString());
}
}
@@ -1099,6 +1099,7 @@
thaw.plugins.index.File file = new
thaw.plugins.index.File(this.db, e, this);
this.addFile(file);
+
}
}
Modified: trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueuePanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueuePanel.java
2006-11-01 22:38:27 UTC (rev 10791)
+++ trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueuePanel.java
2006-11-01 23:48:15 UTC (rev 10792)
@@ -176,7 +176,11 @@
}
}
+ public void addMenuItem(JMenuItem item) {
+ rightClickMenu.insert(item, 0);
+ }
+
private class ProgressRenderer extends DefaultTableCellRenderer {
private final static long serialVersionUID = 20060709;