typo in delete profile fixed
[stack/code/dboxswitch.git] / gui.py
diff --git a/gui.py b/gui.py
old mode 100755 (executable)
new mode 100644 (file)
index 56d0802..920ee85
--- a/gui.py
+++ b/gui.py
@@ -33,7 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 """
 import sys
 import os
-from PyQt4 import QtGui
+from PyQt4 import QtGui, QtCore
 from PyQt4.QtCore import SIGNAL
 from qmenutooltip import QMenuToolTip
 
@@ -91,7 +91,7 @@ class Gui(QtGui.QDialog):
 
         #profile manager component
         self.addProfile = QtGui.QAction("  Add &Profile  ", self,
-                triggered=self.addProfile, icon=QtGui.QIcon(appconf.icon))
+                triggered=self.addProfile)
 
 
     def createTrayIcon(self):
@@ -120,16 +120,19 @@ class Gui(QtGui.QDialog):
         if reason in (QtGui.QSystemTrayIcon.Trigger, QtGui.QSystemTrayIcon.DoubleClick):
             self.menuProfiles = QMenuToolTip()
             self.menuProfiles.setTitle("Profiles")
+            QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_DontShowIconsInMenus, False)
 
             #Get profiles from the ProfHandler embedded in the gui
             profiles = self.profileManager.getProfilesList()
 
-            for pr in profiles:
-                pr = os.path.basename(pr)
+            for prpath in profiles:
+                pr = self.profileManager.getBaseProfileName(prpath)
+                receiver = self.activateProfileAction(prpath)
                 menuItem_Profile = self.menuProfiles.addAction(pr)
-
+                if self.profileManager.isCurrentProfile(prpath):
+                    menuItem_Profile.setIcon(QtGui.QIcon(appconf.cpicon))
+                 
                 #Using lambda function to pass additional arguments to the function, in this case the path of the profile
-                receiver = self.activateProfileAction(pr)
                 self.connect(menuItem_Profile, SIGNAL('triggered()'), receiver)
                 #set menu item ToolTip
                 menuItem_Profile.setToolTip("Activate profile: "+pr)