Tools/TrayStarter.py

changeset 4343
afe0da217745
parent 4102
74cd4222f872
child 4631
5c1a96925da4
equal deleted inserted replaced
4341:1ff0929aab09 4343:afe0da217745
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, usePyQt4): 34 def __init__(self, usePyQt4, settingsDir):
35 """ 35 """
36 Constructor 36 Constructor
37 37
38 @param usePyQt4 flag indicating to use PyQt4 (boolean) 38 @param usePyQt4 flag indicating to use PyQt4
39 @type bool
40 @param settingsDir directory to be used for the settings files
41 @type str
39 """ 42 """
40 super(TrayStarter, self).__init__( 43 super(TrayStarter, self).__init__(
41 UI.PixmapCache.getIcon( 44 UI.PixmapCache.getIcon(
42 Preferences.getTrayStarter("TrayStarterIcon"))) 45 Preferences.getTrayStarter("TrayStarterIcon")))
43 46
44 self.usePyQt4 = usePyQt4 47 self.usePyQt4 = usePyQt4
48 self.settingsDir = settingsDir
45 49
46 self.maxMenuFilePathLen = 75 50 self.maxMenuFilePathLen = 75
47 51
48 self.rsettings = QSettings( 52 self.rsettings = QSettings(
49 QSettings.IniFormat, 53 QSettings.IniFormat,
238 242
239 args = [] 243 args = []
240 args.append(applPath) 244 args.append(applPath)
241 if self.usePyQt4: 245 if self.usePyQt4:
242 args.append("--pyqt4") 246 args.append("--pyqt4")
247 args.append("--config={0}".format(Utilities.getConfigDir()))
248 if self.settingsDir:
249 args.append("--settings={0}".format(self.settingsDir))
243 for arg in applArgs: 250 for arg in applArgs:
244 args.append(arg) 251 args.append(arg)
245 252
246 if not os.path.isfile(applPath) or \ 253 if not os.path.isfile(applPath) or \
247 not proc.startDetached(sys.executable, args): 254 not proc.startDetached(sys.executable, args):
256 263
257 def __startMiniEditor(self): 264 def __startMiniEditor(self):
258 """ 265 """
259 Private slot to start the eric6 Mini Editor. 266 Private slot to start the eric6 Mini Editor.
260 """ 267 """
261 self.__startProc("eric6_editor.py", "--config={0}".format( 268 self.__startProc("eric6_editor.py")
262 Utilities.getConfigDir()))
263 269
264 def __startEric(self): 270 def __startEric(self):
265 """ 271 """
266 Private slot to start the eric6 IDE. 272 Private slot to start the eric6 IDE.
267 """ 273 """
268 self.__startProc("eric6.py", "--config={0}".format( 274 self.__startProc("eric6.py")
269 Utilities.getConfigDir()))
270 275
271 def __startPreferences(self): 276 def __startPreferences(self):
272 """ 277 """
273 Private slot to start the eric6 configuration dialog. 278 Private slot to start the eric6 configuration dialog.
274 """ 279 """
275 self.__startProc("eric6_configure.py", "--config={0}".format( 280 self.__startProc("eric6_configure.py")
276 Utilities.getConfigDir()))
277 281
278 def __startPluginInstall(self): 282 def __startPluginInstall(self):
279 """ 283 """
280 Private slot to start the eric6 plugin installation dialog. 284 Private slot to start the eric6 plugin installation dialog.
281 """ 285 """
282 self.__startProc("eric6_plugininstall.py", "--config={0}".format( 286 self.__startProc("eric6_plugininstall.py")
283 Utilities.getConfigDir()))
284 287
285 def __startPluginUninstall(self): 288 def __startPluginUninstall(self):
286 """ 289 """
287 Private slot to start the eric6 plugin uninstallation dialog. 290 Private slot to start the eric6 plugin uninstallation dialog.
288 """ 291 """
289 self.__startProc("eric6_pluginuninstall.py", "--config={0}".format( 292 self.__startProc("eric6_pluginuninstall.py")
290 Utilities.getConfigDir()))
291 293
292 def __startPluginRepository(self): 294 def __startPluginRepository(self):
293 """ 295 """
294 Private slot to start the eric6 plugin repository dialog. 296 Private slot to start the eric6 plugin repository dialog.
295 """ 297 """
296 self.__startProc("eric6_pluginrepository.py", "--config={0}".format( 298 self.__startProc("eric6_pluginrepository.py")
297 Utilities.getConfigDir()))
298 299
299 def __startHelpViewer(self): 300 def __startHelpViewer(self):
300 """ 301 """
301 Private slot to start the eric6 web browser. 302 Private slot to start the eric6 web browser.
302 """ 303 """
303 self.__startProc("eric6_webbrowser.py", "--config={0}".format( 304 self.__startProc("eric6_webbrowser.py")
304 Utilities.getConfigDir()))
305 305
306 def __startUIPreviewer(self): 306 def __startUIPreviewer(self):
307 """ 307 """
308 Private slot to start the eric6 UI previewer. 308 Private slot to start the eric6 UI previewer.
309 """ 309 """
310 self.__startProc("eric6_uipreviewer.py", "--config={0}".format( 310 self.__startProc("eric6_uipreviewer.py")
311 Utilities.getConfigDir()))
312 311
313 def __startTRPreviewer(self): 312 def __startTRPreviewer(self):
314 """ 313 """
315 Private slot to start the eric6 translations previewer. 314 Private slot to start the eric6 translations previewer.
316 """ 315 """
317 self.__startProc("eric6_trpreviewer.py", "--config={0}".format( 316 self.__startProc("eric6_trpreviewer.py")
318 Utilities.getConfigDir()))
319 317
320 def __startUnittest(self): 318 def __startUnittest(self):
321 """ 319 """
322 Private slot to start the eric6 unittest dialog. 320 Private slot to start the eric6 unittest dialog.
323 """ 321 """
324 self.__startProc("eric6_unittest.py", "--config={0}".format( 322 self.__startProc("eric6_unittest.py")
325 Utilities.getConfigDir()))
326 323
327 def __startDiff(self): 324 def __startDiff(self):
328 """ 325 """
329 Private slot to start the eric6 diff dialog. 326 Private slot to start the eric6 diff dialog.
330 """ 327 """
331 self.__startProc("eric6_diff.py", "--config={0}".format( 328 self.__startProc("eric6_diff.py")
332 Utilities.getConfigDir()))
333 329
334 def __startCompare(self): 330 def __startCompare(self):
335 """ 331 """
336 Private slot to start the eric6 compare dialog. 332 Private slot to start the eric6 compare dialog.
337 """ 333 """
338 self.__startProc("eric6_compare.py", "--config={0}".format( 334 self.__startProc("eric6_compare.py")
339 Utilities.getConfigDir()))
340 335
341 def __startSqlBrowser(self): 336 def __startSqlBrowser(self):
342 """ 337 """
343 Private slot to start the eric6 sql browser dialog. 338 Private slot to start the eric6 sql browser dialog.
344 """ 339 """
345 self.__startProc("eric6_sqlbrowser.py", "--config={0}".format( 340 self.__startProc("eric6_sqlbrowser.py")
346 Utilities.getConfigDir()))
347 341
348 def __startIconEditor(self): 342 def __startIconEditor(self):
349 """ 343 """
350 Private slot to start the eric6 icon editor dialog. 344 Private slot to start the eric6 icon editor dialog.
351 """ 345 """
352 self.__startProc("eric6_iconeditor.py", "--config={0}".format( 346 self.__startProc("eric6_iconeditor.py")
353 Utilities.getConfigDir()))
354 347
355 def __startSnapshot(self): 348 def __startSnapshot(self):
356 """ 349 """
357 Private slot to start the eric6 snapshot dialog. 350 Private slot to start the eric6 snapshot dialog.
358 """ 351 """
359 self.__startProc("eric6_snap.py", "--config={0}".format( 352 self.__startProc("eric6_snap.py")
360 Utilities.getConfigDir()))
361 353
362 def __startQRegExp(self): 354 def __startQRegExp(self):
363 """ 355 """
364 Private slot to start the eric6 QRegExp editor dialog. 356 Private slot to start the eric6 QRegExp editor dialog.
365 """ 357 """
366 self.__startProc("eric6_qregexp.py", "--config={0}".format( 358 self.__startProc("eric6_qregexp.py")
367 Utilities.getConfigDir()))
368 359
369 def __startPyRe(self): 360 def __startPyRe(self):
370 """ 361 """
371 Private slot to start the eric6 Python re editor dialog. 362 Private slot to start the eric6 Python re editor dialog.
372 """ 363 """
373 self.__startProc("eric6_re.py", "--config={0}".format( 364 self.__startProc("eric6_re.py")
374 Utilities.getConfigDir()))
375 365
376 def __showRecentProjectsMenu(self): 366 def __showRecentProjectsMenu(self):
377 """ 367 """
378 Private method to set up the recent projects menu. 368 Private method to set up the recent projects menu.
379 """ 369 """
448 """ 438 """
449 filename = act.data() 439 filename = act.data()
450 if filename: 440 if filename:
451 self.__startProc( 441 self.__startProc(
452 "eric6.py", 442 "eric6.py",
453 "--config={0}".format(Utilities.getConfigDir()),
454 filename) 443 filename)
455 444
456 def __showPreferences(self): 445 def __showPreferences(self):
457 """ 446 """
458 Private slot to set the preferences. 447 Private slot to set the preferences.

eric ide

mercurial