[PC-BSD Commits] r17234 - pcbsd/current/src-qt4/pc-netmanager/src/NetworkTray

svn at pcbsd.org svn at pcbsd.org
Sun Jun 10 09:09:33 PDT 2012


Author: kenmoore
Date: 2012-06-10 16:09:31 +0000 (Sun, 10 Jun 2012)
New Revision: 17234

Modified:
   pcbsd/current/src-qt4/pc-netmanager/src/NetworkTray/NetworkTray.cpp
   pcbsd/current/src-qt4/pc-netmanager/src/NetworkTray/NetworkTray.h
Log:
Setup the network tray to allow manual updating of the system tray icon from within the code - without waiting for the event loop



Modified: pcbsd/current/src-qt4/pc-netmanager/src/NetworkTray/NetworkTray.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/NetworkTray/NetworkTray.cpp	2012-06-10 09:17:20 UTC (rev 17233)
+++ pcbsd/current/src-qt4/pc-netmanager/src/NetworkTray/NetworkTray.cpp	2012-06-10 16:09:31 UTC (rev 17234)
@@ -96,8 +96,8 @@
   // Create the tooltip popup now
   displayTooltip();
 
-  // Start the monitor service
-  monitorStatus();
+  // Start the monitor service on a refresh loop
+  monitorStatus(TRUE);
 
 }
 
@@ -364,7 +364,7 @@
 void NetworkTray::slotTriggerFileChanged() {
 }
 
-void NetworkTray::monitorStatus() {
+void NetworkTray::monitorStatus(bool noloop) {
   // Start checking to see if the device has changed, and if it has inform the user
   QString tmp;  
   QIcon Icon;
@@ -464,9 +464,11 @@
 
   displayTooltip();
   updateWifiNetworks();
+  
+  if(!noloop){
+    QTimer::singleShot(UPDATE_MSEC,  this,  SLOT(monitorStatus()));
+  }
 
-  QTimer::singleShot(UPDATE_MSEC,  this,  SLOT(monitorStatus()));
-
 }
 
 // If the user wants to restart the network, do so

Modified: pcbsd/current/src-qt4/pc-netmanager/src/NetworkTray/NetworkTray.h
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/NetworkTray/NetworkTray.h	2012-06-10 09:17:20 UTC (rev 17233)
+++ pcbsd/current/src-qt4/pc-netmanager/src/NetworkTray/NetworkTray.h	2012-06-10 16:09:31 UTC (rev 17234)
@@ -30,7 +30,7 @@
    void openNetManager();
    void openDeviceInfo();
    void openConfigDlg();
-   void monitorStatus();
+   void monitorStatus(bool noloop=FALSE);
    void slotRestartNetwork();
    void slotTrayActivated(QSystemTrayIcon::ActivationReason);
    void slotQuit();



More information about the Commits mailing list