Tools/TrayStarter.py

branch
6_0_x
changeset 4104
2bba16cc7f39
parent 4022
f5f42921717e
child 4343
afe0da217745
equal deleted inserted replaced
4100:c48e8cfc9704 4104:2bba16cc7f39
29 29
30 class TrayStarter(QSystemTrayIcon): 30 class TrayStarter(QSystemTrayIcon):
31 """ 31 """
32 Class implementing a starter for the system tray. 32 Class implementing a starter for the system tray.
33 """ 33 """
34 def __init__(self): 34 def __init__(self, usePyQt4):
35 """ 35 """
36 Constructor 36 Constructor
37
38 @param usePyQt4 flag indicating to use PyQt4 (boolean)
37 """ 39 """
38 super(TrayStarter, self).__init__( 40 super(TrayStarter, self).__init__(
39 UI.PixmapCache.getIcon( 41 UI.PixmapCache.getIcon(
40 Preferences.getTrayStarter("TrayStarterIcon"))) 42 Preferences.getTrayStarter("TrayStarterIcon")))
43
44 self.usePyQt4 = usePyQt4
41 45
42 self.maxMenuFilePathLen = 75 46 self.maxMenuFilePathLen = 75
43 47
44 self.rsettings = QSettings( 48 self.rsettings = QSettings(
45 QSettings.IniFormat, 49 QSettings.IniFormat,
232 proc = QProcess() 236 proc = QProcess()
233 applPath = os.path.join(getConfig("ericDir"), applName) 237 applPath = os.path.join(getConfig("ericDir"), applName)
234 238
235 args = [] 239 args = []
236 args.append(applPath) 240 args.append(applPath)
241 if self.usePyQt4:
242 args.append("--pyqt4")
237 for arg in applArgs: 243 for arg in applArgs:
238 args.append(arg) 244 args.append(arg)
239 245
240 if not os.path.isfile(applPath) or \ 246 if not os.path.isfile(applPath) or \
241 not proc.startDetached(sys.executable, args): 247 not proc.startDetached(sys.executable, args):
440 446
441 @param act reference to the action that triggered (QAction) 447 @param act reference to the action that triggered (QAction)
442 """ 448 """
443 filename = act.data() 449 filename = act.data()
444 if filename: 450 if filename:
445 self.__startProc("eric6.py", filename) 451 self.__startProc(
452 "eric6.py",
453 "--config={0}".format(Utilities.getConfigDir()),
454 filename)
446 455
447 def __showPreferences(self): 456 def __showPreferences(self):
448 """ 457 """
449 Private slot to set the preferences. 458 Private slot to set the preferences.
450 """ 459 """

eric ide

mercurial