15 |
15 |
16 import sys |
16 import sys |
17 import os |
17 import os |
18 import copy |
18 import copy |
19 |
19 |
20 from PyQt4.QtCore import pyqtSlot, QDir, QProcess |
20 from PyQt5.QtCore import pyqtSlot, QDir, QProcess, QItemSelection |
21 from PyQt4.QtGui import QDialog, QListWidgetItem, QFileDialog, QPushButton, \ |
21 from PyQt5.QtWidgets import QDialog, QListWidgetItem, QFileDialog, \ |
22 QTreeView, QItemSelection, QLineEdit, QFileSystemModel |
22 QPushButton, QTreeView, QLineEdit, QFileSystemModel |
23 |
23 |
24 from E5Gui import E5FileDialog |
24 from E5Gui import E5FileDialog |
25 from E5Gui.E5Completers import E5FileCompleter, E5DirCompleter |
25 from E5Gui.E5Completers import E5FileCompleter, E5DirCompleter |
26 |
26 |
27 from .Ui_CxfreezeConfigDialog import Ui_CxfreezeConfigDialog |
27 from .Ui_CxfreezeConfigDialog import Ui_CxfreezeConfigDialog |
348 It displays a file selection dialog to select the external list file, |
348 It displays a file selection dialog to select the external list file, |
349 the list of include modules is written to. |
349 the list of include modules is written to. |
350 """ |
350 """ |
351 extList = E5FileDialog.getOpenFileName( |
351 extList = E5FileDialog.getOpenFileName( |
352 self, |
352 self, |
353 self.trUtf8("Select external list file"), |
353 self.tr("Select external list file"), |
354 self.extListFileEdit.text(), |
354 self.extListFileEdit.text(), |
355 "") |
355 "") |
356 |
356 |
357 if extList: |
357 if extList: |
358 # make it relative, if it is in a subdirectory of the project path |
358 # make it relative, if it is in a subdirectory of the project path |
366 Private slot to select an icon. |
366 Private slot to select an icon. |
367 |
367 |
368 It displays a file selection dialog to select an icon to |
368 It displays a file selection dialog to select an icon to |
369 include into the executable. |
369 include into the executable. |
370 """ |
370 """ |
371 iconsI18N = self.trUtf8("Icons") |
371 iconsI18N = self.tr("Icons") |
372 allFilesI18N = self.trUtf8("All files") |
372 allFilesI18N = self.tr("All files") |
373 if Utilities.isWindowsPlatform(): |
373 if Utilities.isWindowsPlatform(): |
374 iconFilter = "{0} (*.ico);;{1} (*.*)".format( |
374 iconFilter = "{0} (*.ico);;{1} (*.*)".format( |
375 iconsI18N, allFilesI18N) |
375 iconsI18N, allFilesI18N) |
376 elif Utilities.isMacPlatform(): |
376 elif Utilities.isMacPlatform(): |
377 iconFilter = "{0} (*.icns *.png);;{1} (*.*)".format( |
377 iconFilter = "{0} (*.icns *.png);;{1} (*.*)".format( |
380 iconFilter = "{0} (*.png);;{1} (*.*)".format( |
380 iconFilter = "{0} (*.png);;{1} (*.*)".format( |
381 iconsI18N, allFilesI18N) |
381 iconsI18N, allFilesI18N) |
382 |
382 |
383 iconList = E5FileDialog.getOpenFileName( |
383 iconList = E5FileDialog.getOpenFileName( |
384 self, |
384 self, |
385 self.trUtf8("Select the application icon"), |
385 self.tr("Select the application icon"), |
386 self.applicationIconEdit.text(), |
386 self.applicationIconEdit.text(), |
387 iconFilter) |
387 iconFilter) |
388 |
388 |
389 if iconList: |
389 if iconList: |
390 # make it relative, if it is in a subdirectory of the project path |
390 # make it relative, if it is in a subdirectory of the project path |
400 It displays a directory selection dialog to |
400 It displays a directory selection dialog to |
401 select the directory the files are written to. |
401 select the directory the files are written to. |
402 """ |
402 """ |
403 directory = E5FileDialog.getExistingDirectory( |
403 directory = E5FileDialog.getExistingDirectory( |
404 self, |
404 self, |
405 self.trUtf8("Select target directory"), |
405 self.tr("Select target directory"), |
406 self.targetDirEdit.text(), |
406 self.targetDirEdit.text(), |
407 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) |
407 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) |
408 |
408 |
409 if directory: |
409 if directory: |
410 # make it relative, if it is a subdirectory of the project path |
410 # make it relative, if it is a subdirectory of the project path |
556 select the files and directorys which should copied into |
556 select the files and directorys which should copied into |
557 the distribution folder.. |
557 the distribution folder.. |
558 """ |
558 """ |
559 items = DirFileDialog.getOpenFileNames( |
559 items = DirFileDialog.getOpenFileNames( |
560 None, |
560 None, |
561 self.trUtf8("Select files and folders")) |
561 self.tr("Select files and folders")) |
562 |
562 |
563 for itm in items: |
563 for itm in items: |
564 itm = self.project.getRelativePath(itm) |
564 itm = self.project.getRelativePath(itm) |
565 self.fileOrFolderList.addItem(Utilities.toNativeSeparators(itm)) |
565 self.fileOrFolderList.addItem(Utilities.toNativeSeparators(itm)) |
566 row = self.fileOrFolderList.currentRow() |
566 row = self.fileOrFolderList.currentRow() |