Author: jflesch
Date: 2007-07-03 15:24:49 +0000 (Tue, 03 Jul 2007)
New Revision: 13902
Modified:
trunk/apps/Thaw/src/thaw/gui/TabbedPane.java
trunk/apps/Thaw/src/thaw/plugins/PeerMonitor.java
trunk/apps/Thaw/src/thaw/plugins/index/AutoRefresh.java
trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
Log:
Fix the warnings related to thaw.gui.TabbedPane
Modified: trunk/apps/Thaw/src/thaw/gui/TabbedPane.java
===================================================================
--- trunk/apps/Thaw/src/thaw/gui/TabbedPane.java 2007-07-03 15:22:46 UTC
(rev 13901)
+++ trunk/apps/Thaw/src/thaw/gui/TabbedPane.java 2007-07-03 15:24:49 UTC
(rev 13902)
@@ -43,12 +43,13 @@
if (x >= 0)
tabNames.remove(x);
else {
- Logger.error(this, "remove(): Component not found ?");
- try { /* dirty way to have a trace back */
- throw new Exception("bleh");
- } catch(Exception e) {
- e.printStackTrace();
- }
+ /* ConfigWindow is a little bit lazy :
+ * when you call ConfigWindow.addTabs(),
+ * it will first try to remove the tabs before readding
them.
+ * This way, it's sure that there is not twice the tabs
+ */
+ /* so this situation can be perfectly normal */
+ Logger.debug(this, "remove(): Component not found ?");
}
super.remove(panel);
Modified: trunk/apps/Thaw/src/thaw/plugins/PeerMonitor.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/PeerMonitor.java 2007-07-03 15:22:46 UTC
(rev 13901)
+++ trunk/apps/Thaw/src/thaw/plugins/PeerMonitor.java 2007-07-03 15:24:49 UTC
(rev 13902)
@@ -121,7 +121,7 @@
public boolean stop() {
- core.getMainWindow().removeTab(peerPanel.getTabPanel());
+ hideTab();
core.getMainWindow().removeComponent(peerPanel.getPeerListPanel());
running = false;
return false;
@@ -139,18 +139,25 @@
}
+ private boolean tabVisible = false;
+
public void update(Observable o, Object param) {
core.getMainWindow().addTab(I18n.getMessage("thaw.plugin.peerMonitor.peerMonitor"),
thaw.gui.IconBox.peers,
peerPanel.getTabPanel());
core.getMainWindow().setSelectedTab(peerPanel.getTabPanel());
+ tabVisible = true;
+
peerPanel.showToolbarButtons();
}
public void hideTab() {
- peerPanel.hideToolbarButtons();
+ if (tabVisible) {
+ peerPanel.hideToolbarButtons();
- core.getMainWindow().removeTab(peerPanel.getTabPanel());
+ core.getMainWindow().removeTab(peerPanel.getTabPanel());
+ tabVisible = false;
+ }
}
}
Modified: trunk/apps/Thaw/src/thaw/plugins/index/AutoRefresh.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/AutoRefresh.java 2007-07-03
15:22:46 UTC (rev 13901)
+++ trunk/apps/Thaw/src/thaw/plugins/index/AutoRefresh.java 2007-07-03
15:24:49 UTC (rev 13902)
@@ -12,8 +12,8 @@
public class AutoRefresh implements Runnable, java.util.Observer {
public final static boolean DEFAULT_ACTIVATED = true;
- public final static int DEFAULT_INTERVAL = 300;
- public final static int DEFAULT_INDEX_NUMBER = 20;
+ public final static int DEFAULT_INTERVAL = 150;
+ public final static int DEFAULT_INDEX_NUMBER = 10;
private Hsqldb db;
private IndexBrowserPanel browserPanel;
Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
2007-07-03 15:22:46 UTC (rev 13901)
+++ trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
2007-07-03 15:24:49 UTC (rev 13902)
@@ -1708,7 +1708,7 @@
Logger.warning(this, "There is a date in the
db, but I'm unable to print it");
if (dateStr == null)
- dateStr = "";
+ dateStr =
I18n.getMessage("thaw.common.unknown");;
dialog = new JDialog(mainWindow.getMainFrame(),