Fixed an issue with the tray starter not forwarding the use of the '--pyqt4' command line option. 6_0_x

Sun, 08 Feb 2015 13:23:22 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 08 Feb 2015 13:23:22 +0100
branch
6_0_x
changeset 4104
2bba16cc7f39
parent 4100
c48e8cfc9704
child 4105
05fc2796fd90

Fixed an issue with the tray starter not forwarding the use of the '--pyqt4' command line option.
(grafted from 74cd4222f8720970873a3ea4ae193fe8e304612e)

Tools/TrayStarter.py file | annotate | diff | comparison | revisions
eric6_tray.py file | annotate | diff | comparison | revisions
--- a/Tools/TrayStarter.py	Sat Feb 07 12:43:00 2015 +0100
+++ b/Tools/TrayStarter.py	Sun Feb 08 13:23:22 2015 +0100
@@ -31,14 +31,18 @@
     """
     Class implementing a starter for the system tray.
     """
-    def __init__(self):
+    def __init__(self, usePyQt4):
         """
         Constructor
+        
+        @param usePyQt4 flag indicating to use PyQt4 (boolean)
         """
         super(TrayStarter, self).__init__(
             UI.PixmapCache.getIcon(
                 Preferences.getTrayStarter("TrayStarterIcon")))
         
+        self.usePyQt4 = usePyQt4
+        
         self.maxMenuFilePathLen = 75
         
         self.rsettings = QSettings(
@@ -234,6 +238,8 @@
         
         args = []
         args.append(applPath)
+        if self.usePyQt4:
+            args.append("--pyqt4")
         for arg in applArgs:
             args.append(arg)
         
@@ -442,7 +448,10 @@
         """
         filename = act.data()
         if filename:
-            self.__startProc("eric6.py", filename)
+            self.__startProc(
+                "eric6.py",
+                "--config={0}".format(Utilities.getConfigDir()),
+                filename)
     
     def __showPreferences(self):
         """
--- a/eric6_tray.py	Sat Feb 07 12:43:00 2015 +0100
+++ b/eric6_tray.py	Sun Feb 08 13:23:22 2015 +0100
@@ -14,6 +14,10 @@
 
 from __future__ import unicode_literals
 
+import sys
+
+PyQt4Option = "--pyqt4" in sys.argv
+
 import Toolbox.PyQt4ImportHook  # __IGNORE_WARNING__ 
 
 try:  # Only for Py2
@@ -21,8 +25,6 @@
 except (ImportError):
     pass
 
-import sys
-
 for arg in sys.argv:
     if arg.startswith("--config="):
         import Globals
@@ -43,8 +45,10 @@
     @param argv list of commandline parameters (list of strings)
     @return reference to the main widget (QWidget)
     """
+    global PyQt4Option
+    
     from Tools.TrayStarter import TrayStarter
-    return TrayStarter()
+    return TrayStarter(PyQt4Option)
 
 
 def main():

eric ide

mercurial