From 75080daea3c4abb0c7c4f0c5efa073fca75328ad Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Mon, 14 Jan 2008 04:46:51 +0000 Subject: [PATCH] [ 1717125 ] Frequently checking for new Requests/Notices - merge patch submitted, disable manual updateInfo call. --- client/src/org/compiere/apps/AMenu.java | 46 +++++++++++++++++-- .../src/org/compiere/apps/AMenuStartItem.java | 2 +- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/client/src/org/compiere/apps/AMenu.java b/client/src/org/compiere/apps/AMenu.java index 570581c648..1be8544e78 100644 --- a/client/src/org/compiere/apps/AMenu.java +++ b/client/src/org/compiere/apps/AMenu.java @@ -131,6 +131,10 @@ public final class AMenu extends CFrame m_AD_Role_ID = Env.getContextAsInt(m_ctx, "#AD_Role_ID"); updateInfo(); // + infoUpdater = new InfoUpdater(); + infoUpdaterThread = new Thread(infoUpdater, "InfoUpdater"); + infoUpdaterThread.start(); + // splash.dispose(); splash = null; } // AMenu @@ -158,6 +162,11 @@ public final class AMenu extends CFrame /** Logger */ private static CLogger log = CLogger.getCLogger(AMenu.class); + /** The Info Update instance **/ + private InfoUpdater infoUpdater = null; + /** The Info Update thread **/ + private Thread infoUpdaterThread = null; + private WindowManager windowManager = new WindowManager(); @@ -436,6 +445,16 @@ public final class AMenu extends CFrame Ini.setDividerLocation(treePanel.getDividerLocation()); Ini.setWindowLocation(0, getLocation()); Ini.saveProperties(true); + // + infoUpdater.stop = true; + try { + infoUpdaterThread.join(50); + } catch(InterruptedException ire) { + } finally { + infoUpdaterThread = null; + infoUpdater = null; + } + // super.dispose(); AEnv.exit(0); } // dispose @@ -512,7 +531,7 @@ public final class AMenu extends CFrame gotoRequests(); else if (!AEnv.actionPerformed(e.getActionCommand(), m_WindowNo, this)) log.log(Level.SEVERE, "unknown action=" + e.getActionCommand()); - updateInfo(); + //updateInfo(); } // actionPerformed /** @@ -677,7 +696,7 @@ public final class AMenu extends CFrame */ public void stateChanged (ChangeEvent e) { - updateInfo(); + //updateInfo(); // show activities if (centerPane.getSelectedIndex() == m_tabActivities) wfActivity.display(); @@ -701,7 +720,7 @@ public final class AMenu extends CFrame if (e.getClickCount() > 1) { System.gc(); - updateInfo(); + //updateInfo(); } } } // AMenu_MouseAdapter @@ -717,5 +736,26 @@ public final class AMenu extends CFrame Adempiere.startup(true); // needs to be here for UI AMenu menu = new AMenu(); } // main + + class InfoUpdater implements Runnable + { + boolean stop = false; + + public void InfoUpdater() + { + } + + public void run() + { + while(stop == false) + { + updateInfo(); + + try { + Thread.currentThread().sleep(60000); + } catch(InterruptedException ire) { } + } + } + } } // AMenu diff --git a/client/src/org/compiere/apps/AMenuStartItem.java b/client/src/org/compiere/apps/AMenuStartItem.java index 5164a4d462..70f32cf84c 100644 --- a/client/src/org/compiere/apps/AMenuStartItem.java +++ b/client/src/org/compiere/apps/AMenuStartItem.java @@ -186,7 +186,7 @@ public class AMenuStartItem extends Thread implements ActionListener SwingUtilities.invokeLater(m_resetPB); if (m_menu != null) { - m_menu.updateInfo(); + //m_menu.updateInfo(); m_menu.setBusy(false); } } // run