[PC-BSD Commits] r19918 - in pcbsd/current/src-qt4/pc-mounttray: . icons

svn at pcbsd.org svn at pcbsd.org
Wed Oct 24 12:43:38 PDT 2012


Author: kenmoore
Date: 2012-10-24 19:43:38 +0000 (Wed, 24 Oct 2012)
New Revision: 19918

Added:
   pcbsd/current/src-qt4/pc-mounttray/icons/refresh.png
Modified:
   pcbsd/current/src-qt4/pc-mounttray/mountTray.cpp
   pcbsd/current/src-qt4/pc-mounttray/mountTray.h
   pcbsd/current/src-qt4/pc-mounttray/pc-mounttray.qrc
Log:
Add the ability to re-scan all the devices on your system to the mount tray for 9.2



Index: pcbsd/current/src-qt4/pc-mounttray/icons/refresh.png
===================================================================
--- pcbsd/current/src-qt4/pc-mounttray/icons/refresh.png	2012-10-24 19:03:23 UTC (rev 19917)
+++ pcbsd/current/src-qt4/pc-mounttray/icons/refresh.png	2012-10-24 19:43:38 UTC (rev 19918)

Property changes on: pcbsd/current/src-qt4/pc-mounttray/icons/refresh.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
Modified: pcbsd/current/src-qt4/pc-mounttray/mountTray.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-mounttray/mountTray.cpp	2012-10-24 19:03:23 UTC (rev 19917)
+++ pcbsd/current/src-qt4/pc-mounttray/mountTray.cpp	2012-10-24 19:43:38 UTC (rev 19918)
@@ -76,6 +76,8 @@
   trayIconMenu->addSeparator();
   //Add the "open media" entry to the list
   trayIconMenu->addAction( QIcon(":icons/folder.png"), tr("Open Media Directory"), this, SLOT(slotOpenMediaDir()) );
+  trayIconMenu->addSeparator();
+  trayIconMenu->addAction( QIcon(":icons/refresh.png"),tr("Rescan Devices"), this, SLOT(slotRescan()) );
   //Add the "close tray" entry to the list
   trayIconMenu->addAction( QIcon(":icons/application-exit.png"), tr("Close Tray"), this, SLOT(closeTray()) );
   
@@ -291,6 +293,17 @@
   system( cmd.toUtf8() ); 
 }
 
+void MountTray::slotRescan(){
+  //Display a notification
+  slotDisplayPopup(tr("Please Wait"),tr("Rescanning devices attached to the system"));
+  //Rescan the device list for new devices
+  scanInitialDevices();
+  //Check that all the existing devices still exist
+  for(int i=0; i<deviceList.length(); i++){
+    deviceList[i]->updateItem();
+  }
+}
+
 void MountTray::slotSingleInstance()
 {
   trayIcon->show();

Modified: pcbsd/current/src-qt4/pc-mounttray/mountTray.h
===================================================================
--- pcbsd/current/src-qt4/pc-mounttray/mountTray.h	2012-10-24 19:03:23 UTC (rev 19917)
+++ pcbsd/current/src-qt4/pc-mounttray/mountTray.h	2012-10-24 19:43:38 UTC (rev 19918)
@@ -5,6 +5,7 @@
 #include <QFileSystemWatcher>
 #include <QSystemTrayIcon>
 #include <QMenu>
+#include <QTimer>
 
 #include "menuItem.h"
 
@@ -32,6 +33,7 @@
   void openMediaDir(QString); 
   void slotDisplayPopup(QString,QString);
   void removeDevice(QString);
+  void slotRescan();
   
 private:
   QString MOUNTDIR, DEVICEDIR, USERNAME, FILEMAN;

Modified: pcbsd/current/src-qt4/pc-mounttray/pc-mounttray.qrc
===================================================================
--- pcbsd/current/src-qt4/pc-mounttray/pc-mounttray.qrc	2012-10-24 19:03:23 UTC (rev 19917)
+++ pcbsd/current/src-qt4/pc-mounttray/pc-mounttray.qrc	2012-10-24 19:43:38 UTC (rev 19918)
@@ -11,5 +11,6 @@
     <file>icons/mount.png</file>
     <file>icons/musiccd.png</file>
     <file>icons/harddrive.png</file>
+    <file>icons/refresh.png</file>
   </qresource>
 </RCC>



More information about the Commits mailing list