8 """ |
8 """ |
9 |
9 |
10 from PyQt6.QtCore import pyqtSlot |
10 from PyQt6.QtCore import pyqtSlot |
11 from PyQt6.QtWidgets import QDialog, QDialogButtonBox |
11 from PyQt6.QtWidgets import QDialog, QDialogButtonBox |
12 |
12 |
13 from E5Gui.E5PathPicker import E5PathPickerModes |
13 from E5Gui.EricPathPicker import EricPathPickerModes |
14 |
14 |
15 from .Ui_HgArchiveDialog import Ui_HgArchiveDialog |
15 from .Ui_HgArchiveDialog import Ui_HgArchiveDialog |
16 |
16 |
17 import Utilities |
17 import Utilities |
18 |
18 |
30 """ |
30 """ |
31 super().__init__(parent) |
31 super().__init__(parent) |
32 self.setupUi(self) |
32 self.setupUi(self) |
33 |
33 |
34 self.archivePicker.setMode( |
34 self.archivePicker.setMode( |
35 E5PathPickerModes.SAVE_FILE_ENSURE_EXTENSION_MODE) |
35 EricPathPickerModes.SAVE_FILE_ENSURE_EXTENSION_MODE) |
36 |
36 |
37 self.typeComboBox.addItem( |
37 self.typeComboBox.addItem( |
38 self.tr("Detect Automatically"), "") |
38 self.tr("Detect Automatically"), "") |
39 self.typeComboBox.addItem( |
39 self.typeComboBox.addItem( |
40 self.tr("Directory of Files"), "files") |
40 self.tr("Directory of Files"), "files") |
104 |
104 |
105 @param index index of the selected type (integer) |
105 @param index index of the selected type (integer) |
106 """ |
106 """ |
107 type_ = self.typeComboBox.itemData(index) |
107 type_ = self.typeComboBox.itemData(index) |
108 if type_ == "files": |
108 if type_ == "files": |
109 self.archivePicker.setMode(E5PathPickerModes.DIRECTORY_MODE) |
109 self.archivePicker.setMode(EricPathPickerModes.DIRECTORY_MODE) |
110 else: |
110 else: |
111 self.archivePicker.setMode( |
111 self.archivePicker.setMode( |
112 E5PathPickerModes.SAVE_FILE_ENSURE_EXTENSION_MODE) |
112 EricPathPickerModes.SAVE_FILE_ENSURE_EXTENSION_MODE) |
113 if type_ in self.__typeFilters: |
113 if type_ in self.__typeFilters: |
114 self.archivePicker.setNameFilters( |
114 self.archivePicker.setNameFilters( |
115 self.__typeFilters[type_]) |
115 self.__typeFilters[type_]) |
116 else: |
116 else: |
117 self.archivePicker.setNameFilters([]) |
117 self.archivePicker.setNameFilters([]) |