Plugins/VcsPlugins/vcsMercurial/HgArchiveDialog.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2847
1843ef6e2656
parent 3008
7848489bcb92
child 3145
a9de05d4a22f
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
38 self.__archiveDirCompleter = E5DirCompleter() 38 self.__archiveDirCompleter = E5DirCompleter()
39 self.__activeCompleter = self.__archiveFileCompleter 39 self.__activeCompleter = self.__archiveFileCompleter
40 self.archiveEdit.setCompleter(self.__activeCompleter) 40 self.archiveEdit.setCompleter(self.__activeCompleter)
41 self.__activeCompleter.model().setNameFilters([]) 41 self.__activeCompleter.model().setNameFilters([])
42 42
43 self.typeComboBox.addItem(self.trUtf8("Detect Automatically"), "") 43 self.typeComboBox.addItem(
44 self.typeComboBox.addItem(self.trUtf8("Directory of Files"), "files") 44 self.trUtf8("Detect Automatically"), "")
45 self.typeComboBox.addItem(self.trUtf8("Uncompressed TAR-Archive"), "tar") 45 self.typeComboBox.addItem(
46 self.typeComboBox.addItem(self.trUtf8("Bzip2 compressed TAR-Archive"), "tbz2") 46 self.trUtf8("Directory of Files"), "files")
47 self.typeComboBox.addItem(self.trUtf8("Gzip compressed TAR-Archive"), "tgz") 47 self.typeComboBox.addItem(
48 self.typeComboBox.addItem(self.trUtf8("Uncompressed ZIP-Archive"), "uzip") 48 self.trUtf8("Uncompressed TAR-Archive"), "tar")
49 self.typeComboBox.addItem(self.trUtf8("Compressed ZIP-Archive"), "zip") 49 self.typeComboBox.addItem(
50 self.trUtf8("Bzip2 compressed TAR-Archive"), "tbz2")
51 self.typeComboBox.addItem(
52 self.trUtf8("Gzip compressed TAR-Archive"), "tgz")
53 self.typeComboBox.addItem(
54 self.trUtf8("Uncompressed ZIP-Archive"), "uzip")
55 self.typeComboBox.addItem(
56 self.trUtf8("Compressed ZIP-Archive"), "zip")
50 57
51 self.__unixFileFilters = [ 58 self.__unixFileFilters = [
52 self.trUtf8("Bzip2 compressed TAR-Archive (*.tar.bz2)"), 59 self.trUtf8("Bzip2 compressed TAR-Archive (*.tar.bz2)"),
53 self.trUtf8("Gzip compressed TAR-Archive (*.tar.gz)"), 60 self.trUtf8("Gzip compressed TAR-Archive (*.tar.gz)"),
54 self.trUtf8("Uncompressed TAR-Archive (*.tar)"), 61 self.trUtf8("Uncompressed TAR-Archive (*.tar)"),
82 89
83 @pyqtSlot(str) 90 @pyqtSlot(str)
84 def on_archiveEdit_textChanged(self, archive): 91 def on_archiveEdit_textChanged(self, archive):
85 """ 92 """
86 Private slot to handle changes of the archive name. 93 Private slot to handle changes of the archive name.
94
95 @param archive name of the archive (string)
87 """ 96 """
88 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(archive != "") 97 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(archive != "")
89 98
90 @pyqtSlot() 99 @pyqtSlot()
91 def on_archiveButton_clicked(self): 100 def on_archiveButton_clicked(self):
137 else: 146 else:
138 if self.__activeCompleter != self.__archiveFileCompleter: 147 if self.__activeCompleter != self.__archiveFileCompleter:
139 self.__activeCompleter = self.__archiveFileCompleter 148 self.__activeCompleter = self.__archiveFileCompleter
140 self.archiveEdit.setCompleter(self.__activeCompleter) 149 self.archiveEdit.setCompleter(self.__activeCompleter)
141 if type_ in self.__typeFilters: 150 if type_ in self.__typeFilters:
142 self.__activeCompleter.model().setNameFilters(self.__typeFilters[type_]) 151 self.__activeCompleter.model().setNameFilters(
152 self.__typeFilters[type_])
143 else: 153 else:
144 self.__activeCompleter.model().setNameFilters([]) 154 self.__activeCompleter.model().setNameFilters([])
145 155
146 def getData(self): 156 def getData(self):
147 """ 157 """
148 Public method to retrieve the data. 158 Public method to retrieve the data.
149 159
150 @return tuple giving the archive name (string), the archive type (string), 160 @return tuple giving the archive name (string), the archive type
151 the directory prefix 8string) and a flag indicating to recurse into 161 (string), the directory prefix 8string) and a flag indicating
152 subrepositories (boolean) 162 to recurse into subrepositories (boolean)
153 """ 163 """
154 return ( 164 return (
155 self.archiveEdit.text(), 165 self.archiveEdit.text(),
156 self.typeComboBox.itemData(self.typeComboBox.currentIndex()), 166 self.typeComboBox.itemData(self.typeComboBox.currentIndex()),
157 self.prefixEdit.text(), 167 self.prefixEdit.text(),

eric ide

mercurial