Plugins/WizardPlugins/FileDialogWizard/FileDialogWizardDialog.py

branch
Py2 comp.
changeset 3484
645c12de6b0c
parent 3456
96232974dcdb
parent 3366
6084bb3c3911
child 3656
441956d8fce5
equal deleted inserted replaced
3456:96232974dcdb 3484:645c12de6b0c
68 self.cStartWith.toggled[bool].connect(self.__toggleGroupsAndTest) 68 self.cStartWith.toggled[bool].connect(self.__toggleGroupsAndTest)
69 self.cWorkDir.toggled[bool].connect(self.__toggleGroupsAndTest) 69 self.cWorkDir.toggled[bool].connect(self.__toggleGroupsAndTest)
70 self.cFilters.toggled[bool].connect(self.__toggleGroupsAndTest) 70 self.cFilters.toggled[bool].connect(self.__toggleGroupsAndTest)
71 71
72 self.bTest = self.buttonBox.addButton( 72 self.bTest = self.buttonBox.addButton(
73 self.trUtf8("Test"), QDialogButtonBox.ActionRole) 73 self.tr("Test"), QDialogButtonBox.ActionRole)
74
75 msh = self.minimumSizeHint()
76 self.resize(max(self.width(), msh.width()), msh.height())
74 77
75 def __adjustOptions(self, options): 78 def __adjustOptions(self, options):
76 """ 79 """
77 Private method to adjust the file dialog options. 80 Private method to adjust the file dialog options.
78 81
297 os.linesep, istring) 300 os.linesep, istring)
298 code += '{0},{1}{2}'.format(parent, os.linesep, istring) 301 code += '{0},{1}{2}'.format(parent, os.linesep, istring)
299 if not self.eCaption.text(): 302 if not self.eCaption.text():
300 code += '"",{0}{1}'.format(os.linesep, istring) 303 code += '"",{0}{1}'.format(os.linesep, istring)
301 else: 304 else:
302 code += 'self.trUtf8("{0}"),{1}{2}'.format( 305 code += 'self.tr("{0}"),{1}{2}'.format(
303 self.eCaption.text(), os.linesep, istring) 306 self.eCaption.text(), os.linesep, istring)
304 if not self.eStartWith.text(): 307 if not self.eStartWith.text():
305 code += '"",{0}{1}'.format(os.linesep, istring) 308 code += '"",{0}{1}'.format(os.linesep, istring)
306 else: 309 else:
307 if self.cStartWith.isChecked(): 310 if self.cStartWith.isChecked():
308 fmt = '{0},{1}{2}' 311 fmt = '{0},{1}{2}'
309 else: 312 else:
310 fmt = 'self.trUtf8("{0}"),{1}{2}' 313 fmt = 'self.tr("{0}"),{1}{2}'
311 code += fmt.format(self.eStartWith.text(), os.linesep, istring) 314 code += fmt.format(self.eStartWith.text(), os.linesep, istring)
312 if self.eFilters.text() == "": 315 if self.eFilters.text() == "":
313 code += '""' 316 code += '""'
314 else: 317 else:
315 if self.cFilters.isChecked(): 318 if self.cFilters.isChecked():
316 fmt = '{0}' 319 fmt = '{0}'
317 else: 320 else:
318 fmt = 'self.trUtf8("{0}")' 321 fmt = 'self.tr("{0}")'
319 code += fmt.format(self.eFilters.text()) 322 code += fmt.format(self.eFilters.text())
320 if self.rfOpenFile.isChecked() or self.__pyqtVariant == 5: 323 if self.rfOpenFile.isChecked() or self.__pyqtVariant == 5:
321 if self.eInitialFilter.text() == "": 324 if self.eInitialFilter.text() == "":
322 filter = "None" 325 filter = "None"
323 else: 326 else:
324 if self.cInitialFilter.isChecked(): 327 if self.cInitialFilter.isChecked():
325 fmt = '{0}' 328 fmt = '{0}'
326 else: 329 else:
327 fmt = 'self.trUtf8("{0}")' 330 fmt = 'self.tr("{0}")'
328 filter = fmt.format(self.eInitialFilter.text()) 331 filter = fmt.format(self.eInitialFilter.text())
329 code += ',{0}{1}{2}'.format(os.linesep, istring, filter) 332 code += ',{0}{1}{2}'.format(os.linesep, istring, filter)
330 if not self.cSymlinks.isChecked(): 333 if not self.cSymlinks.isChecked():
331 code += \ 334 code += \
332 ',{0}{1}QFileDialog.Options(' \ 335 ',{0}{1}QFileDialog.Options(' \
341 os.linesep, istring) 344 os.linesep, istring)
342 code += '{0},{1}{2}'.format(parent, os.linesep, istring) 345 code += '{0},{1}{2}'.format(parent, os.linesep, istring)
343 if not self.eCaption.text(): 346 if not self.eCaption.text():
344 code += '"",{0}{1}'.format(os.linesep, istring) 347 code += '"",{0}{1}'.format(os.linesep, istring)
345 else: 348 else:
346 code += 'self.trUtf8("{0}"),{1}{2}'.format( 349 code += 'self.tr("{0}"),{1}{2}'.format(
347 self.eCaption.text(), os.linesep, istring) 350 self.eCaption.text(), os.linesep, istring)
348 if not self.eStartWith.text(): 351 if not self.eStartWith.text():
349 code += '"",{0}{1}'.format(os.linesep, istring) 352 code += '"",{0}{1}'.format(os.linesep, istring)
350 else: 353 else:
351 if self.cStartWith.isChecked(): 354 if self.cStartWith.isChecked():
352 fmt = '{0},{1}{2}' 355 fmt = '{0},{1}{2}'
353 else: 356 else:
354 fmt = 'self.trUtf8("{0}"),{1}{2}' 357 fmt = 'self.tr("{0}"),{1}{2}'
355 code += fmt.format(self.eStartWith.text(), os.linesep, istring) 358 code += fmt.format(self.eStartWith.text(), os.linesep, istring)
356 if not self.eFilters.text(): 359 if not self.eFilters.text():
357 code += '""' 360 code += '""'
358 else: 361 else:
359 if self.cFilters.isChecked(): 362 if self.cFilters.isChecked():
360 fmt = '{0}' 363 fmt = '{0}'
361 else: 364 else:
362 fmt = 'self.trUtf8("{0}")' 365 fmt = 'self.tr("{0}")'
363 code += fmt.format(self.eFilters.text()) 366 code += fmt.format(self.eFilters.text())
364 if self.rfOpenFiles.isChecked() or self.__pyqtVariant == 5: 367 if self.rfOpenFiles.isChecked() or self.__pyqtVariant == 5:
365 if self.eInitialFilter.text() == "": 368 if self.eInitialFilter.text() == "":
366 filter = "None" 369 filter = "None"
367 else: 370 else:
368 if self.cInitialFilter.isChecked(): 371 if self.cInitialFilter.isChecked():
369 fmt = '{0}' 372 fmt = '{0}'
370 else: 373 else:
371 fmt = 'self.trUtf8("{0}")' 374 fmt = 'self.tr("{0}")'
372 filter = fmt.format(self.eInitialFilter.text()) 375 filter = fmt.format(self.eInitialFilter.text())
373 code += ',{0}{1}{2}'.format(os.linesep, istring, filter) 376 code += ',{0}{1}{2}'.format(os.linesep, istring, filter)
374 if not self.cSymlinks.isChecked(): 377 if not self.cSymlinks.isChecked():
375 code += \ 378 code += \
376 ',{0}{1}QFileDialog.Options(' \ 379 ',{0}{1}QFileDialog.Options(' \
385 os.linesep, istring) 388 os.linesep, istring)
386 code += '{0},{1}{2}'.format(parent, os.linesep, istring) 389 code += '{0},{1}{2}'.format(parent, os.linesep, istring)
387 if not self.eCaption.text(): 390 if not self.eCaption.text():
388 code += '"",{0}{1}'.format(os.linesep, istring) 391 code += '"",{0}{1}'.format(os.linesep, istring)
389 else: 392 else:
390 code += 'self.trUtf8("{0}"),{1}{2}'.format( 393 code += 'self.tr("{0}"),{1}{2}'.format(
391 self.eCaption.text(), os.linesep, istring) 394 self.eCaption.text(), os.linesep, istring)
392 if not self.eStartWith.text(): 395 if not self.eStartWith.text():
393 code += '"",{0}{1}'.format(os.linesep, istring) 396 code += '"",{0}{1}'.format(os.linesep, istring)
394 else: 397 else:
395 if self.cStartWith.isChecked(): 398 if self.cStartWith.isChecked():
396 fmt = '{0},{1}{2}' 399 fmt = '{0},{1}{2}'
397 else: 400 else:
398 fmt = 'self.trUtf8("{0}"),{1}{2}' 401 fmt = 'self.tr("{0}"),{1}{2}'
399 code += fmt.format(self.eStartWith.text(), os.linesep, istring) 402 code += fmt.format(self.eStartWith.text(), os.linesep, istring)
400 if not self.eFilters.text(): 403 if not self.eFilters.text():
401 code += '""' 404 code += '""'
402 else: 405 else:
403 if self.cFilters.isChecked(): 406 if self.cFilters.isChecked():
404 fmt = '{0}' 407 fmt = '{0}'
405 else: 408 else:
406 fmt = 'self.trUtf8("{0}")' 409 fmt = 'self.tr("{0}")'
407 code += fmt.format(self.eFilters.text()) 410 code += fmt.format(self.eFilters.text())
408 if self.rfSaveFile.isChecked() or self.__pyqtVariant == 5: 411 if self.rfSaveFile.isChecked() or self.__pyqtVariant == 5:
409 if self.eInitialFilter.text() == "": 412 if self.eInitialFilter.text() == "":
410 filter = "None" 413 filter = "None"
411 else: 414 else:
412 if self.cInitialFilter.isChecked(): 415 if self.cInitialFilter.isChecked():
413 fmt = '{0}' 416 fmt = '{0}'
414 else: 417 else:
415 fmt = 'self.trUtf8("{0}")' 418 fmt = 'self.tr("{0}")'
416 filter = fmt.format(self.eInitialFilter.text()) 419 filter = fmt.format(self.eInitialFilter.text())
417 code += ',{0}{1}{2}'.format(os.linesep, istring, filter) 420 code += ',{0}{1}{2}'.format(os.linesep, istring, filter)
418 if (not self.cSymlinks.isChecked()) or \ 421 if (not self.cSymlinks.isChecked()) or \
419 (not self.cConfirmOverwrite.isChecked()): 422 (not self.cConfirmOverwrite.isChecked()):
420 code += ',{0}{1}QFileDialog.Options('.format( 423 code += ',{0}{1}QFileDialog.Options('.format(
432 code += 'getExistingDirectory({0}{1}'.format(os.linesep, istring) 435 code += 'getExistingDirectory({0}{1}'.format(os.linesep, istring)
433 code += '{0},{1}{2}'.format(parent, os.linesep, istring) 436 code += '{0},{1}{2}'.format(parent, os.linesep, istring)
434 if not self.eCaption.text(): 437 if not self.eCaption.text():
435 code += '"",{0}{1}'.format(os.linesep, istring) 438 code += '"",{0}{1}'.format(os.linesep, istring)
436 else: 439 else:
437 code += 'self.trUtf8("{0}"),{1}{2}'.format( 440 code += 'self.tr("{0}"),{1}{2}'.format(
438 self.eCaption.text(), os.linesep, istring) 441 self.eCaption.text(), os.linesep, istring)
439 if not self.eWorkDir.text(): 442 if not self.eWorkDir.text():
440 code += '""' 443 code += '""'
441 else: 444 else:
442 if self.cWorkDir.isChecked(): 445 if self.cWorkDir.isChecked():
443 fmt = '{0}' 446 fmt = '{0}'
444 else: 447 else:
445 fmt = 'self.trUtf8("{0}")' 448 fmt = 'self.tr("{0}")'
446 code += fmt.format(self.eWorkDir.text()) 449 code += fmt.format(self.eWorkDir.text())
447 code += ',{0}{1}QFileDialog.Options('.format(os.linesep, istring) 450 code += ',{0}{1}QFileDialog.Options('.format(os.linesep, istring)
448 if not self.cSymlinks.isChecked(): 451 if not self.cSymlinks.isChecked():
449 code += 'QFileDialog.DontResolveSymlinks | ' 452 code += 'QFileDialog.DontResolveSymlinks | '
450 if self.cDirOnly.isChecked(): 453 if self.cDirOnly.isChecked():

eric ide

mercurial