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

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

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 08 Feb 2015 13:23:22 +0100
changeset 4102
74cd4222f872
parent 4101
68c26f72c0d1
child 4103
ce70c1a618ca

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

Tools/TrayStarter.py file | annotate | diff | comparison | revisions
eric6_tray.py file | annotate | diff | comparison | revisions
--- a/Tools/TrayStarter.py	Sun Feb 08 13:09: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	Sun Feb 08 13:09: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