209 args.append("--onefile") |
209 args.append("--onefile") |
210 if self.__parameters["name"] != self.__defaults["name"]: |
210 if self.__parameters["name"] != self.__defaults["name"]: |
211 parms["name"] = self.__parameters["name"] |
211 parms["name"] = self.__parameters["name"] |
212 args.append("--name") |
212 args.append("--name") |
213 args.append(self.__parameters["name"]) |
213 args.append(self.__parameters["name"]) |
214 if self.__parameters["encryptionKey"] != \ |
214 if ( |
215 self.__defaults["encryptionKey"]: |
215 self.__parameters["encryptionKey"] != |
|
216 self.__defaults["encryptionKey"] |
|
217 ): |
216 parms["encryptionKey"] = self.__parameters["encryptionKey"] |
218 parms["encryptionKey"] = self.__parameters["encryptionKey"] |
217 args.append("--key") |
219 args.append("--key") |
218 args.append(self.__parameters["encryptionKey"]) |
220 args.append(self.__parameters["encryptionKey"]) |
219 |
221 |
220 # 2.3 Windows and macOS options |
222 # 2.3 Windows and macOS options |
221 if self.__parameters["consoleApplication"] != \ |
223 if ( |
222 self.__defaults["consoleApplication"]: |
224 self.__parameters["consoleApplication"] != |
223 parms["consoleApplication"] = \ |
225 self.__defaults["consoleApplication"] |
|
226 ): |
|
227 parms["consoleApplication"] = ( |
224 self.__parameters["consoleApplication"] |
228 self.__parameters["consoleApplication"] |
|
229 ) |
225 args.append("--windowed") |
230 args.append("--windowed") |
226 if self.__parameters["iconFile"] != self.__defaults["iconFile"]: |
231 if self.__parameters["iconFile"] != self.__defaults["iconFile"]: |
227 parms["iconFile"] = self.__parameters["iconFile"] |
232 parms["iconFile"] = self.__parameters["iconFile"] |
228 parms["iconId"] = self.__parameters["iconId"] |
233 parms["iconId"] = self.__parameters["iconId"] |
229 args.append("--icon") |
234 args.append("--icon") |
236 self.__parameters["iconFile"], iconId)) |
241 self.__parameters["iconFile"], iconId)) |
237 else: |
242 else: |
238 args.append(self.__parameters["iconFile"]) |
243 args.append(self.__parameters["iconFile"]) |
239 |
244 |
240 # 2.4 macOS specific options |
245 # 2.4 macOS specific options |
241 if self.__parameters["bundleIdentifier"] != \ |
246 if ( |
242 self.__defaults["bundleIdentifier"]: |
247 self.__parameters["bundleIdentifier"] != |
243 parms["bundleIdentifier"] = \ |
248 self.__defaults["bundleIdentifier"] |
|
249 ): |
|
250 parms["bundleIdentifier"] = ( |
244 self.__parameters["bundleIdentifier"] |
251 self.__parameters["bundleIdentifier"] |
|
252 ) |
245 args.append("--osx-bundle-identifier") |
253 args.append("--osx-bundle-identifier") |
246 args.append(self.__parameters["bundleIdentifier"]) |
254 args.append(self.__parameters["bundleIdentifier"]) |
247 |
255 |
248 # 2.5 general options, part 2 |
256 # 2.5 general options, part 2 |
249 if self.__parameters["cleanBeforeBuilding"] != \ |
257 if ( |
250 self.__defaults["cleanBeforeBuilding"]: |
258 self.__parameters["cleanBeforeBuilding"] != |
251 parms["cleanBeforeBuilding"] = \ |
259 self.__defaults["cleanBeforeBuilding"] |
|
260 ): |
|
261 parms["cleanBeforeBuilding"] = ( |
252 self.__parameters["cleanBeforeBuilding"] |
262 self.__parameters["cleanBeforeBuilding"] |
|
263 ) |
253 args.append("--clean") |
264 args.append("--clean") |
254 |
265 |
255 # 3. always add these arguments |
266 # 3. always add these arguments |
256 if self.__mode == "installer": |
267 if self.__mode == "installer": |
257 args.append("--noconfirm") # don't ask the user |
268 args.append("--noconfirm") # don't ask the user |
270 |
281 |
271 It saves the values in the parameters dictionary. |
282 It saves the values in the parameters dictionary. |
272 """ |
283 """ |
273 # get data of general tab |
284 # get data of general tab |
274 if self.__mode == "installer": |
285 if self.__mode == "installer": |
275 self.__parameters["pyinstaller"] = \ |
286 self.__parameters["pyinstaller"] = ( |
276 self.executableCombo.currentText() |
287 self.executableCombo.currentText() |
|
288 ) |
277 elif self.__mode == "spec": |
289 elif self.__mode == "spec": |
278 self.__parameters["pyi-makespec"] = \ |
290 self.__parameters["pyi-makespec"] = ( |
279 self.executableCombo.currentText() |
291 self.executableCombo.currentText() |
|
292 ) |
280 self.__parameters["mainscript"] = self.mainScriptButton.isChecked() |
293 self.__parameters["mainscript"] = self.mainScriptButton.isChecked() |
281 self.__parameters["inputFile"] = self.inputFilePicker.text() |
294 self.__parameters["inputFile"] = self.inputFilePicker.text() |
282 self.__parameters["oneDirectory"] = self.oneDirButton.isChecked() |
295 self.__parameters["oneDirectory"] = self.oneDirButton.isChecked() |
283 self.__parameters["name"] = self.nameEdit.text() |
296 self.__parameters["name"] = self.nameEdit.text() |
284 self.__parameters["encryptionKey"] = self.keyEdit.text() |
297 self.__parameters["encryptionKey"] = self.keyEdit.text() |
285 self.__parameters["cleanBeforeBuilding"] = \ |
298 self.__parameters["cleanBeforeBuilding"] = ( |
286 self.cleanCheckBox.isChecked() |
299 self.cleanCheckBox.isChecked() |
|
300 ) |
287 |
301 |
288 # get data of Windows and macOS tab |
302 # get data of Windows and macOS tab |
289 self.__parameters["consoleApplication"] = \ |
303 self.__parameters["consoleApplication"] = ( |
290 self.consoleButton.isChecked() |
304 self.consoleButton.isChecked() |
|
305 ) |
291 self.__parameters["iconFile"] = self.iconFilePicker.text() |
306 self.__parameters["iconFile"] = self.iconFilePicker.text() |
292 self.__parameters["iconId"] = self.iconIdEdit.text() |
307 self.__parameters["iconId"] = self.iconIdEdit.text() |
293 |
308 |
294 # get data of macOS specific tab |
309 # get data of macOS specific tab |
295 self.__parameters["bundleIdentifier"] = \ |
310 self.__parameters["bundleIdentifier"] = ( |
296 self.bundleIdentifierEdit.text() |
311 self.bundleIdentifierEdit.text() |
|
312 ) |
297 |
313 |
298 # call the accept slot of the base class |
314 # call the accept slot of the base class |
299 super(PyInstallerConfigDialog, self).accept() |
315 super(PyInstallerConfigDialog, self).accept() |
300 |
316 |
301 def __updateOkButton(self): |
317 def __updateOkButton(self): |
304 """ |
320 """ |
305 enable = True |
321 enable = True |
306 |
322 |
307 # If not to be run with the project main script, a script or |
323 # If not to be run with the project main script, a script or |
308 # spec file must be selected. |
324 # spec file must be selected. |
309 if self.selectedScriptButton.isChecked() and \ |
325 if ( |
310 not bool(self.inputFilePicker.text()): |
326 self.selectedScriptButton.isChecked() and |
|
327 not bool(self.inputFilePicker.text()) |
|
328 ): |
311 enable = False |
329 enable = False |
312 |
330 |
313 # If the icon shall be picked from a .exe file, an icon ID |
331 # If the icon shall be picked from a .exe file, an icon ID |
314 # must be entered (Windows only). |
332 # must be entered (Windows only). |
315 if self.iconFilePicker.text().endswith(".exe") and \ |
333 if ( |
316 not bool(self.iconIdEdit.text()): |
334 self.iconFilePicker.text().endswith(".exe") and |
|
335 not bool(self.iconIdEdit.text()) |
|
336 ): |
317 enable = False |
337 enable = False |
318 |
338 |
319 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable) |
339 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable) |
320 |
340 |
321 @pyqtSlot(bool) |
341 @pyqtSlot(bool) |