42 self.ppath = pro.ppath |
42 self.ppath = pro.ppath |
43 self.targetDirEdit.setText(self.ppath) |
43 self.targetDirEdit.setText(self.ppath) |
44 self.startdir = startdir |
44 self.startdir = startdir |
45 self.on_filterComboBox_highlighted('(*.py)') # enable all dialog elements |
45 self.on_filterComboBox_highlighted('(*.py)') # enable all dialog elements |
46 if filter == 'source': # it is a source file |
46 if filter == 'source': # it is a source file |
47 self.filterComboBox.addItem(self.trUtf8("Source Files"), |
47 self.filterComboBox.addItem(self.trUtf8("Source Files"), "SOURCES") |
48 QVariant("SOURCES")) |
|
49 elif filter == 'form': |
48 elif filter == 'form': |
50 self.filterComboBox.addItem(self.trUtf8("Forms Files"), |
49 self.filterComboBox.addItem(self.trUtf8("Forms Files"), "FORMS") |
51 QVariant("FORMS")) |
|
52 elif filter == 'resource': |
50 elif filter == 'resource': |
53 self.filterComboBox.addItem(self.trUtf8("Resource Files"), |
51 self.filterComboBox.addItem(self.trUtf8("Resource Files"), "RESOURCES") |
54 QVariant("RESOURCES")) |
|
55 elif filter == 'interface': |
52 elif filter == 'interface': |
56 self.filterComboBox.addItem(self.trUtf8("Interface Files"), |
53 self.filterComboBox.addItem(self.trUtf8("Interface Files"), "INTERFACES") |
57 QVariant("INTERFACES")) |
|
58 elif filter == 'others': |
54 elif filter == 'others': |
59 self.filterComboBox.addItem(self.trUtf8("Other Files (*)"), |
55 self.filterComboBox.addItem(self.trUtf8("Other Files (*)"), "OTHERS") |
60 QVariant("OTHERS")) |
|
61 self.on_filterComboBox_highlighted('(*)') |
56 self.on_filterComboBox_highlighted('(*)') |
62 else: |
57 else: |
63 self.filterComboBox.addItem(self.trUtf8("Source Files"), |
58 self.filterComboBox.addItem(self.trUtf8("Source Files"), "SOURCES") |
64 QVariant("SOURCES")) |
59 self.filterComboBox.addItem(self.trUtf8("Forms Files"), "FORMS") |
65 self.filterComboBox.addItem(self.trUtf8("Forms Files"), |
60 self.filterComboBox.addItem(self.trUtf8("Resource Files"), "RESOURCES") |
66 QVariant("FORMS")) |
61 self.filterComboBox.addItem(self.trUtf8("Interface Files"), "INTERFACES") |
67 self.filterComboBox.addItem(self.trUtf8("Resource Files"), |
62 self.filterComboBox.addItem(self.trUtf8("Other Files (*)"), "OTHERS") |
68 QVariant("RESOURCES")) |
|
69 self.filterComboBox.addItem(self.trUtf8("Interface Files"), |
|
70 QVariant("INTERFACES")) |
|
71 self.filterComboBox.addItem(self.trUtf8("Other Files (*)"), |
|
72 QVariant("OTHERS")) |
|
73 self.filterComboBox.setCurrentIndex(0) |
63 self.filterComboBox.setCurrentIndex(0) |
74 |
64 |
75 @pyqtSlot(str) |
65 @pyqtSlot(str) |
76 def on_filterComboBox_highlighted(self, fileType): |
66 def on_filterComboBox_highlighted(self, fileType): |
77 """ |
67 """ |
146 @return tuple of four values (string, string, string, boolean) giving |
136 @return tuple of four values (string, string, string, boolean) giving |
147 the selected file type, the source and target directory and |
137 the selected file type, the source and target directory and |
148 a flag indicating a recursive add |
138 a flag indicating a recursive add |
149 """ |
139 """ |
150 filetype = \ |
140 filetype = \ |
151 self.filterComboBox.itemData(self.filterComboBox.currentIndex()).toString() |
141 self.filterComboBox.itemData(self.filterComboBox.currentIndex()) |
152 return (filetype, self.sourceDirEdit.text(), |
142 return (filetype, self.sourceDirEdit.text(), |
153 self.targetDirEdit.text(), |
143 self.targetDirEdit.text(), |
154 self.recursiveCheckBox.isChecked()) |
144 self.recursiveCheckBox.isChecked()) |