Tools/TrayStarter.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 2997
7f0ef975da9e
child 3058
0a02c433f52d
--- a/Tools/TrayStarter.py	Tue Oct 15 22:03:54 2013 +0200
+++ b/Tools/TrayStarter.py	Fri Oct 18 23:00:41 2013 +0200
@@ -13,7 +13,8 @@
 import os
 
 from PyQt4.QtCore import QProcess, QSettings, QFileInfo
-from PyQt4.QtGui  import QSystemTrayIcon, QMenu, qApp, QCursor, QApplication, QDialog
+from PyQt4.QtGui  import QSystemTrayIcon, QMenu, qApp, QCursor, \
+    QApplication, QDialog
 
 from E5Gui import E5MessageBox
 
@@ -35,7 +36,8 @@
         Constructor
         """
         super(TrayStarter, self).__init__(
-            UI.PixmapCache.getIcon(Preferences.getTrayStarter("TrayStarterIcon")))
+            UI.PixmapCache.getIcon(
+                Preferences.getTrayStarter("TrayStarterIcon")))
         
         self.maxMenuFilePathLen = 75
         
@@ -55,8 +57,10 @@
         
         self.__menu = QMenu(self.trUtf8("Eric5 tray starter"))
         
-        self.recentProjectsMenu = QMenu(self.trUtf8('Recent Projects'), self.__menu)
-        self.recentProjectsMenu.aboutToShow.connect(self.__showRecentProjectsMenu)
+        self.recentProjectsMenu = QMenu(
+            self.trUtf8('Recent Projects'), self.__menu)
+        self.recentProjectsMenu.aboutToShow.connect(
+            self.__showRecentProjectsMenu)
         self.recentProjectsMenu.triggered.connect(self.__openRecent)
         
         self.recentMultiProjectsMenu = \
@@ -76,8 +80,10 @@
         act.setFont(font)
         self.__menu.addSeparator()
         
-        self.__menu.addAction(self.trUtf8("QRegExp editor"), self.__startQRegExp)
-        self.__menu.addAction(self.trUtf8("Python re editor"), self.__startPyRe)
+        self.__menu.addAction(
+            self.trUtf8("QRegExp editor"), self.__startQRegExp)
+        self.__menu.addAction(
+            self.trUtf8("Python re editor"), self.__startPyRe)
         self.__menu.addSeparator()
         
         self.__menu.addAction(UI.PixmapCache.getIcon("uiPreviewer.png"),
@@ -132,7 +138,8 @@
         self.menuRecentMultiProjectsAct = \
             self.__menu.addMenu(self.recentMultiProjectsMenu)
         # recent projects
-        self.menuRecentProjectsAct = self.__menu.addMenu(self.recentProjectsMenu)
+        self.menuRecentProjectsAct = self.__menu.addMenu(
+            self.recentProjectsMenu)
         self.__menu.addSeparator()
         
         self.__menu.addAction(UI.PixmapCache.getIcon("exit.png"),
@@ -172,7 +179,8 @@
         """
         Private slot to handle the activated signal.
         
-        @param reason reason code of the signal (QSystemTrayIcon.ActivationReason)
+        @param reason reason code of the signal
+            (QSystemTrayIcon.ActivationReason)
         """
         if reason == QSystemTrayIcon.Context or \
            reason == QSystemTrayIcon.MiddleClick:
@@ -185,7 +193,8 @@
         Private slot to show the context menu.
         """
         self.menuRecentProjectsAct.setEnabled(len(self.recentProjects) > 0)
-        self.menuRecentMultiProjectsAct.setEnabled(len(self.recentMultiProjects) > 0)
+        self.menuRecentMultiProjectsAct.setEnabled(
+            len(self.recentMultiProjects) > 0)
         self.menuRecentFilesAct.setEnabled(len(self.recentFiles) > 0)
         
         pos = QCursor.pos()
@@ -210,7 +219,8 @@
         for arg in applArgs:
             args.append(arg)
         
-        if not os.path.isfile(applPath) or not proc.startDetached(sys.executable, args):
+        if not os.path.isfile(applPath) or \
+                not proc.startDetached(sys.executable, args):
             E5MessageBox.critical(self,
                 self.trUtf8('Process Generation Error'),
                 self.trUtf8(
@@ -406,8 +416,8 @@
     
     def __openRecent(self, act):
         """
-        Private method to open a project or file from the list of rencently opened
-        projects or files.
+        Private method to open a project or file from the list of recently
+        opened projects or files.
         
         @param act reference to the action that triggered (QAction)
         """
@@ -420,9 +430,9 @@
         Private slot to set the preferences.
         """
         from Preferences.ConfigurationDialog import ConfigurationDialog
-        dlg = ConfigurationDialog(None, 'Configuration', True,
-                                  fromEric=True,
-                                  displayMode=ConfigurationDialog.TrayStarterMode)
+        dlg = ConfigurationDialog(
+            None, 'Configuration', True, fromEric=True,
+            displayMode=ConfigurationDialog.TrayStarterMode)
         dlg.preferencesChanged.connect(self.preferencesChanged)
         dlg.show()
         dlg.showConfigurationPageByName("trayStarterPage")
@@ -438,7 +448,8 @@
         Public slot to handle a change of preferences.
         """
         self.setIcon(
-            UI.PixmapCache.getIcon(Preferences.getTrayStarter("TrayStarterIcon")))
+            UI.PixmapCache.getIcon(
+                Preferences.getTrayStarter("TrayStarterIcon")))
 
     def __about(self):
         """

eric ide

mercurial