22 sys.argv.remove(arg) |
22 sys.argv.remove(arg) |
23 break |
23 break |
24 |
24 |
25 from Utilities import Startup |
25 from Utilities import Startup |
26 |
26 |
|
27 |
27 def createMainWidget(argv): |
28 def createMainWidget(argv): |
28 """ |
29 """ |
29 Function to create the main widget. |
30 Function to create the main widget. |
30 |
31 |
31 @param argv list of commandline parameters (list of strings) |
32 @param argv list of commandline parameters (list of strings) |
32 @return reference to the main widget (QWidget) |
33 @return reference to the main widget (QWidget) |
33 """ |
34 """ |
34 from Tools.TrayStarter import TrayStarter |
35 from Tools.TrayStarter import TrayStarter |
35 return TrayStarter() |
36 return TrayStarter() |
36 |
37 |
|
38 |
37 def main(): |
39 def main(): |
38 """ |
40 """ |
39 Main entry point into the application. |
41 Main entry point into the application. |
40 """ |
42 """ |
41 options = [\ |
43 options = [\ |
42 ("--config=configDir", |
44 ("--config=configDir", |
43 "use the given directory as the one containing the config files"), |
45 "use the given directory as the one containing the config files"), |
44 ] |
46 ] |
45 appinfo = Startup.makeAppInfo(sys.argv, |
47 appinfo = Startup.makeAppInfo(sys.argv, |
46 "Eric5 Tray", |
48 "Eric5 Tray", |
47 "", |
49 "", |
48 "Traystarter for eric5", |
50 "Traystarter for eric5", |
49 options) |
51 options) |
50 res = Startup.simpleAppStartup(sys.argv, |
52 res = Startup.simpleAppStartup(sys.argv, |
51 appinfo, |
53 appinfo, |
52 createMainWidget, |
54 createMainWidget, |
53 quitOnLastWindowClosed = False) |
55 quitOnLastWindowClosed=False) |
54 sys.exit(res) |
56 sys.exit(res) |
55 |
57 |
56 if __name__ == '__main__': |
58 if __name__ == '__main__': |
57 main() |
59 main() |