[PC-BSD Commits] r6997 - in pcbsd: current/SoftwareManager current/SystemUpdaterTray stable/SoftwareManager stable/SystemUpdaterTray

svn at pcbsd.org svn at pcbsd.org
Mon Jun 21 14:05:00 PDT 2010


Author: kris
Date: 2010-06-21 14:05:00 -0700 (Mon, 21 Jun 2010)
New Revision: 6997

Modified:
   pcbsd/current/SoftwareManager/softmanager-main.h
   pcbsd/current/SoftwareManager/softmanager-pbiupdate.cpp
   pcbsd/current/SoftwareManager/softmanager-sysupdate.cpp
   pcbsd/current/SystemUpdaterTray/UpdaterTray.cpp
   pcbsd/current/SystemUpdaterTray/UpdaterTray.h
   pcbsd/stable/SoftwareManager/softmanager-main.h
   pcbsd/stable/SoftwareManager/softmanager-pbiupdate.cpp
   pcbsd/stable/SoftwareManager/softmanager-sysupdate.cpp
   pcbsd/stable/SystemUpdaterTray/UpdaterTray.cpp
   pcbsd/stable/SystemUpdaterTray/UpdaterTray.h
Log:

Updated SoftwareManager & SystemTray, now after applying system / pbi updates, properly trigger the tray application to rescan and display current results



Modified: pcbsd/current/SoftwareManager/softmanager-main.h
===================================================================
--- pcbsd/current/SoftwareManager/softmanager-main.h	2010-06-21 20:50:41 UTC (rev 6996)
+++ pcbsd/current/SoftwareManager/softmanager-main.h	2010-06-21 21:05:00 UTC (rev 6997)
@@ -1,6 +1,9 @@
 #ifndef PBM_H
 #define PBM_H
 
+#define SYSTRIGGER "/tmp/.sysupdatetraytrigger"
+#define PBITRIGGER "/tmp/.pbiupdatetraytrigger"
+
 /* QT4 */
 #include <qfile.h>
 #include <qmessagebox.h>

Modified: pcbsd/current/SoftwareManager/softmanager-pbiupdate.cpp
===================================================================
--- pcbsd/current/SoftwareManager/softmanager-pbiupdate.cpp	2010-06-21 20:50:41 UTC (rev 6996)
+++ pcbsd/current/SoftwareManager/softmanager-pbiupdate.cpp	2010-06-21 21:05:00 UTC (rev 6997)
@@ -3,6 +3,7 @@
 #include <QTextStream>
 #include <QSettings>
 #include <QToolTip>
+#include <QDateTime>
 #include "pbi.h"
 
 
@@ -542,6 +543,14 @@
   } else {
      // Update the status on the previous download to finished
      item->setStatusText(tr("Upgrade complete!"));
+
+     // Update our trigger
+     QFile pbiTrig( PBITRIGGER );
+     if ( pbiTrig.open( QIODevice::WriteOnly ) ) {
+       QTextStream streamTrig( &pbiTrig );
+        streamTrig << QDateTime::currentDateTime().toString("hhmmss");
+	pbiTrig.close();
+     }
   }
   
   // If this was a new PBI remove the old list item

Modified: pcbsd/current/SoftwareManager/softmanager-sysupdate.cpp
===================================================================
--- pcbsd/current/SoftwareManager/softmanager-sysupdate.cpp	2010-06-21 20:50:41 UTC (rev 6996)
+++ pcbsd/current/SoftwareManager/softmanager-sysupdate.cpp	2010-06-21 21:05:00 UTC (rev 6997)
@@ -905,6 +905,15 @@
            // Check for updates again now
 	   slotStartUpdateCheck();
 
+           // Update our tray trigger
+     	   QFile sysTrig( SYSTRIGGER );
+     	   if ( sysTrig.open( QIODevice::WriteOnly ) ) {
+       		QTextStream streamTrig( &sysTrig );
+        	streamTrig << QDateTime::currentDateTime().toString("hhmmss");
+        	sysTrig.close();
+     	   }
+
+
         return;
       }
 

Modified: pcbsd/current/SystemUpdaterTray/UpdaterTray.cpp
===================================================================
--- pcbsd/current/SystemUpdaterTray/UpdaterTray.cpp	2010-06-21 20:50:41 UTC (rev 6996)
+++ pcbsd/current/SystemUpdaterTray/UpdaterTray.cpp	2010-06-21 21:05:00 UTC (rev 6997)
@@ -139,10 +139,27 @@
   QTimer::singleShot(500, this, SLOT(slotMonitorForChanges()));
 
   // Watch our trigger file, to see if any automated updates are being downloaded
+  QFile sysTrig( SYSTRIGGER );
+  if ( sysTrig.open( QIODevice::WriteOnly ) ) {
+    QTextStream streamTrig( &sysTrig );
+     streamTrig << QDateTime::currentDateTime().toString("hhmmss");
+     sysTrig.close();
+  }
   fileWatcherAutoUpdate = KDirWatch::self();
   fileWatcherAutoUpdate->addFile(SYSTRIGGER);
   connect(fileWatcherAutoUpdate, SIGNAL(dirty(const QString&)), this, SLOT(slotSetTimerReadAutoStatus() ));
 
+  // Watch for PBI updates and refresh
+  QFile pbiTrig( PBITRIGGER );
+  if ( pbiTrig.open( QIODevice::WriteOnly ) ) {
+    QTextStream streamTrig1( &pbiTrig );
+     streamTrig1 << QDateTime::currentDateTime().toString("hhmmss");
+     pbiTrig.close();
+  }
+  pbiWatcherAutoUpdate = KDirWatch::self();
+  pbiWatcherAutoUpdate->addFile(PBITRIGGER);
+  connect(pbiWatcherAutoUpdate, SIGNAL(dirty(const QString&)), this, SLOT(slotScheduledPBICheck() ));
+
   // Watch our trigger file, to see if any automated updates are being downloaded
   fileWatcherSys = KDirWatch::self();
   fileWatcherSys->addFile("/PCBSD/SystemUpdater/conf/sysupdate.conf");

Modified: pcbsd/current/SystemUpdaterTray/UpdaterTray.h
===================================================================
--- pcbsd/current/SystemUpdaterTray/UpdaterTray.h	2010-06-21 20:50:41 UTC (rev 6996)
+++ pcbsd/current/SystemUpdaterTray/UpdaterTray.h	2010-06-21 21:05:00 UTC (rev 6997)
@@ -6,6 +6,7 @@
 #include <kdirwatch.h>
 
 #define SYSTRIGGER "/tmp/.sysupdatetraytrigger"
+#define PBITRIGGER "/tmp/.pbiupdatetraytrigger"
 
 class QString;
 class QPixmap;
@@ -57,6 +58,7 @@
    KDirWatch *fileWatcher;
    KDirWatch *fileWatcherSys;
    KDirWatch *fileWatcherAutoUpdate;
+   KDirWatch *pbiWatcherAutoUpdate;
    QString sysPatchsetTmpFile;
    bool useCustomTmpDir;
    QString customTmpDir;

Modified: pcbsd/stable/SoftwareManager/softmanager-main.h
===================================================================
--- pcbsd/stable/SoftwareManager/softmanager-main.h	2010-06-21 20:50:41 UTC (rev 6996)
+++ pcbsd/stable/SoftwareManager/softmanager-main.h	2010-06-21 21:05:00 UTC (rev 6997)
@@ -1,6 +1,9 @@
 #ifndef PBM_H
 #define PBM_H
 
+#define SYSTRIGGER "/tmp/.sysupdatetraytrigger"
+#define PBITRIGGER "/tmp/.pbiupdatetraytrigger"
+
 /* QT4 */
 #include <qfile.h>
 #include <qmessagebox.h>

Modified: pcbsd/stable/SoftwareManager/softmanager-pbiupdate.cpp
===================================================================
--- pcbsd/stable/SoftwareManager/softmanager-pbiupdate.cpp	2010-06-21 20:50:41 UTC (rev 6996)
+++ pcbsd/stable/SoftwareManager/softmanager-pbiupdate.cpp	2010-06-21 21:05:00 UTC (rev 6997)
@@ -3,6 +3,7 @@
 #include <QTextStream>
 #include <QSettings>
 #include <QToolTip>
+#include <QDateTime>
 #include "pbi.h"
 
 
@@ -542,6 +543,14 @@
   } else {
      // Update the status on the previous download to finished
      item->setStatusText(tr("Upgrade complete!"));
+
+     // Update our trigger
+     QFile pbiTrig( PBITRIGGER );
+     if ( pbiTrig.open( QIODevice::WriteOnly ) ) {
+       QTextStream streamTrig( &pbiTrig );
+        streamTrig << QDateTime::currentDateTime().toString("hhmmss");
+	pbiTrig.close();
+     }
   }
   
   // If this was a new PBI remove the old list item

Modified: pcbsd/stable/SoftwareManager/softmanager-sysupdate.cpp
===================================================================
--- pcbsd/stable/SoftwareManager/softmanager-sysupdate.cpp	2010-06-21 20:50:41 UTC (rev 6996)
+++ pcbsd/stable/SoftwareManager/softmanager-sysupdate.cpp	2010-06-21 21:05:00 UTC (rev 6997)
@@ -905,6 +905,15 @@
            // Check for updates again now
 	   slotStartUpdateCheck();
 
+           // Update our tray trigger
+     	   QFile sysTrig( SYSTRIGGER );
+     	   if ( sysTrig.open( QIODevice::WriteOnly ) ) {
+       		QTextStream streamTrig( &sysTrig );
+        	streamTrig << QDateTime::currentDateTime().toString("hhmmss");
+        	sysTrig.close();
+     	   }
+
+
         return;
       }
 

Modified: pcbsd/stable/SystemUpdaterTray/UpdaterTray.cpp
===================================================================
--- pcbsd/stable/SystemUpdaterTray/UpdaterTray.cpp	2010-06-21 20:50:41 UTC (rev 6996)
+++ pcbsd/stable/SystemUpdaterTray/UpdaterTray.cpp	2010-06-21 21:05:00 UTC (rev 6997)
@@ -139,10 +139,27 @@
   QTimer::singleShot(500, this, SLOT(slotMonitorForChanges()));
 
   // Watch our trigger file, to see if any automated updates are being downloaded
+  QFile sysTrig( SYSTRIGGER );
+  if ( sysTrig.open( QIODevice::WriteOnly ) ) {
+    QTextStream streamTrig( &sysTrig );
+     streamTrig << QDateTime::currentDateTime().toString("hhmmss");
+     sysTrig.close();
+  }
   fileWatcherAutoUpdate = KDirWatch::self();
   fileWatcherAutoUpdate->addFile(SYSTRIGGER);
   connect(fileWatcherAutoUpdate, SIGNAL(dirty(const QString&)), this, SLOT(slotSetTimerReadAutoStatus() ));
 
+  // Watch for PBI updates and refresh
+  QFile pbiTrig( PBITRIGGER );
+  if ( pbiTrig.open( QIODevice::WriteOnly ) ) {
+    QTextStream streamTrig1( &pbiTrig );
+     streamTrig1 << QDateTime::currentDateTime().toString("hhmmss");
+     pbiTrig.close();
+  }
+  pbiWatcherAutoUpdate = KDirWatch::self();
+  pbiWatcherAutoUpdate->addFile(PBITRIGGER);
+  connect(pbiWatcherAutoUpdate, SIGNAL(dirty(const QString&)), this, SLOT(slotScheduledPBICheck() ));
+
   // Watch our trigger file, to see if any automated updates are being downloaded
   fileWatcherSys = KDirWatch::self();
   fileWatcherSys->addFile("/PCBSD/SystemUpdater/conf/sysupdate.conf");

Modified: pcbsd/stable/SystemUpdaterTray/UpdaterTray.h
===================================================================
--- pcbsd/stable/SystemUpdaterTray/UpdaterTray.h	2010-06-21 20:50:41 UTC (rev 6996)
+++ pcbsd/stable/SystemUpdaterTray/UpdaterTray.h	2010-06-21 21:05:00 UTC (rev 6997)
@@ -6,6 +6,7 @@
 #include <kdirwatch.h>
 
 #define SYSTRIGGER "/tmp/.sysupdatetraytrigger"
+#define PBITRIGGER "/tmp/.pbiupdatetraytrigger"
 
 class QString;
 class QPixmap;
@@ -57,6 +58,7 @@
    KDirWatch *fileWatcher;
    KDirWatch *fileWatcherSys;
    KDirWatch *fileWatcherAutoUpdate;
+   KDirWatch *pbiWatcherAutoUpdate;
    QString sysPatchsetTmpFile;
    bool useCustomTmpDir;
    QString customTmpDir;



More information about the Commits mailing list