22 |
22 |
23 originalPathString = os.getenv("PATH") |
23 originalPathString = os.getenv("PATH") |
24 |
24 |
25 # generate list of arguments to be remembered for a restart |
25 # generate list of arguments to be remembered for a restart |
26 restartArgsList = [ |
26 restartArgsList = [ |
|
27 "--config", |
|
28 "--debug", |
|
29 "--disable-crash", |
|
30 "--disable-plugin", |
|
31 "--no-multimedia", |
27 "--no-splash", |
32 "--no-splash", |
28 "--plugin", |
33 "--plugin", |
29 "--debug", |
|
30 "--config", |
|
31 "--settings", |
34 "--settings", |
32 "--disable-crash", |
|
33 "--disable-plugin", |
|
34 ] |
35 ] |
35 restartArgs = [arg for arg in sys.argv[1:] if arg.split("=", 1)[0] in restartArgsList] |
36 restartArgs = [arg for arg in sys.argv[1:] if arg.split("=", 1)[0] in restartArgsList] |
36 |
37 |
37 try: |
38 try: |
38 from PyQt6.QtCore import qWarning, QLibraryInfo, QTimer, QCoreApplication |
39 from PyQt6.QtCore import qWarning, QLibraryInfo, QTimer, QCoreApplication |
100 from eric7.EricWidgets.EricSingleApplication import EricSingleApplicationClient |
101 from eric7.EricWidgets.EricSingleApplication import EricSingleApplicationClient |
101 |
102 |
102 client = EricSingleApplicationClient() |
103 client = EricSingleApplicationClient() |
103 res = client.connect() |
104 res = client.connect() |
104 if res > 0: |
105 if res > 0: |
105 if "--no-splash" in sys.argv and sys.argv.index("--no-splash") < ddindex: |
106 for switch in ( |
106 sys.argv.remove("--no-splash") |
107 "--debug", |
107 ddindex -= 1 |
108 "--disable-crash", |
108 if "--no-open" in sys.argv and sys.argv.index("--no-open") < ddindex: |
109 "--no-crash", |
109 sys.argv.remove("--no-open") |
110 "--no-multimedia", |
110 ddindex -= 1 |
111 "--no-open", |
111 if "--no-crash" in sys.argv and sys.argv.index("--no-crash") < ddindex: |
112 "--no-splash", |
112 sys.argv.remove("--no-crash") |
113 "--small-screen", |
113 if ( |
|
114 "--disable-crash" in sys.argv |
|
115 and sys.argv.index("--disable-crash") < ddindex |
|
116 ): |
114 ): |
117 sys.argv.remove("--disable-crash") |
115 if switch in sys.argv and sys.argv.index(switch) < ddindex: |
118 ddindex -= 1 |
116 sys.argv.remove(switch) |
119 if "--debug" in sys.argv and sys.argv.index("--debug") < ddindex: |
|
120 sys.argv.remove("--debug") |
|
121 ddindex -= 1 |
|
122 for arg in sys.argv: |
|
123 if arg.startswith("--config=") and sys.argv.index(arg) < ddindex: |
|
124 sys.argv.remove(arg) |
|
125 ddindex -= 1 |
117 ddindex -= 1 |
126 break |
|
127 for arg in sys.argv: |
|
128 if arg.startswith("--plugin=") and sys.argv.index(arg) < ddindex: |
|
129 sys.argv.remove(arg) |
|
130 ddindex -= 1 |
|
131 break |
|
132 for arg in sys.argv[:]: |
118 for arg in sys.argv[:]: |
133 if arg.startswith("--disable-plugin=") and sys.argv.index(arg) < ddindex: |
119 for switch in ( |
134 sys.argv.remove(arg) |
120 "--config=", |
135 ddindex -= 1 |
121 "--plugin=", |
|
122 "--disable-plugin=", |
|
123 "--settings=", |
|
124 ): |
|
125 if arg.startswith(switch) and sys.argv.index(switch) < ddindex: |
|
126 sys.argv.remove(arg) |
|
127 ddindex -= 1 |
|
128 break |
136 |
129 |
137 if len(sys.argv) > 1: |
130 if len(sys.argv) > 1: |
138 client.processArgs(sys.argv[1:]) |
131 client.processArgs(sys.argv[1:]) |
139 sys.exit(0) |
132 sys.exit(0) |
|
133 |
140 elif res < 0: |
134 elif res < 0: |
141 print("eric7: {0}".format(client.errstr())) |
135 print("eric7: {0}".format(client.errstr())) |
142 # __IGNORE_WARNING_M801__ |
136 # __IGNORE_WARNING_M801__ |
143 sys.exit(res) |
137 sys.exit(res) |
144 |
138 |
245 ( |
239 ( |
246 "--config=configDir", |
240 "--config=configDir", |
247 "use the given directory as the one containing the config files", |
241 "use the given directory as the one containing the config files", |
248 ), |
242 ), |
249 ("--debug", "activate debugging output to the console"), |
243 ("--debug", "activate debugging output to the console"), |
|
244 ("--no-multimedia", "disable the support of multimedia functions"), |
|
245 ("--no-open", "don't open anything at startup except that given in command"), |
250 ("--no-splash", "don't show the splash screen"), |
246 ("--no-splash", "don't show the splash screen"), |
251 ("--no-open", "don't open anything at startup except that given in command"), |
|
252 ("--no-crash", "don't check for a crash session file on startup"), |
247 ("--no-crash", "don't check for a crash session file on startup"), |
253 ("--disable-crash", "disable the support for crash sessions"), |
248 ("--disable-crash", "disable the support for crash sessions"), |
254 ( |
249 ( |
255 "--disable-plugin=<plug-in name>", |
250 "--disable-plugin=<plug-in name>", |
256 "disable the given plug-in (may be repeated)", |
251 "disable the given plug-in (may be repeated)", |