74 @return reference to the main widget (QWidget) |
74 @return reference to the main widget (QWidget) |
75 """ |
75 """ |
76 from WebBrowser.WebBrowserWindow import WebBrowserWindow |
76 from WebBrowser.WebBrowserWindow import WebBrowserWindow |
77 |
77 |
78 searchWord = None |
78 searchWord = None |
|
79 private = False |
79 for arg in reversed(argv): |
80 for arg in reversed(argv): |
80 if arg.startswith("--search="): |
81 if arg.startswith("--search="): |
81 searchWord = argv[1].split("=", 1)[1] |
82 searchWord = argv[1].split("=", 1)[1] |
|
83 argv.remove(arg) |
|
84 elif arg == "--private": |
|
85 private = True |
82 argv.remove(arg) |
86 argv.remove(arg) |
83 elif arg.startswith("--"): |
87 elif arg.startswith("--"): |
84 argv.remove(arg) |
88 argv.remove(arg) |
85 |
89 |
86 try: |
90 try: |
87 home = argv[1] |
91 home = argv[1] |
88 except IndexError: |
92 except IndexError: |
89 home = "" |
93 home = "" |
90 |
94 |
91 browser = WebBrowserWindow(home, '.', None, 'web_browser', |
95 browser = WebBrowserWindow(home, '.', None, 'web_browser', |
92 searchWord=searchWord) |
96 searchWord=searchWord, private=private) |
93 return browser |
97 return browser |
94 |
98 |
95 |
99 |
96 def main(): |
100 def main(): |
97 """ |
101 """ |
98 Main entry point into the application. |
102 Main entry point into the application. |
99 """ |
103 """ |
100 options = [ |
104 options = [ |
101 ("--config=configDir", |
105 ("--config=configDir", |
102 "use the given directory as the one containing the config files"), |
106 "use the given directory as the one containing the config files"), |
|
107 ("--private", "start the browser in private browsing mode"), |
103 ("--search=word", "search for the given word"), |
108 ("--search=word", "search for the given word"), |
104 ("--settings=settingsDir", |
109 ("--settings=settingsDir", |
105 "use the given directory to store the settings files"), |
110 "use the given directory to store the settings files"), |
106 ] |
111 ] |
107 appinfo = AppInfo.makeAppInfo(sys.argv, |
112 appinfo = AppInfo.makeAppInfo(sys.argv, |