Project/AddDirectoryDialog.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 2995
63d874899b8b
child 3058
0a02c433f52d
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
44 self.targetDirCompleter = E5DirCompleter(self.targetDirEdit) 44 self.targetDirCompleter = E5DirCompleter(self.targetDirEdit)
45 45
46 self.ppath = pro.ppath 46 self.ppath = pro.ppath
47 self.targetDirEdit.setText(self.ppath) 47 self.targetDirEdit.setText(self.ppath)
48 self.startdir = startdir 48 self.startdir = startdir
49 self.on_filterComboBox_highlighted('(*.py)') # enable all dialog elements 49 self.on_filterComboBox_highlighted('(*.py)')
50 # enable all dialog elements
50 if filter == 'source': # it is a source file 51 if filter == 'source': # it is a source file
51 self.filterComboBox.addItem(self.trUtf8("Source Files"), "SOURCES") 52 self.filterComboBox.addItem(
53 self.trUtf8("Source Files"), "SOURCES")
52 elif filter == 'form': 54 elif filter == 'form':
53 self.filterComboBox.addItem(self.trUtf8("Forms Files"), "FORMS") 55 self.filterComboBox.addItem(
56 self.trUtf8("Forms Files"), "FORMS")
54 elif filter == 'resource': 57 elif filter == 'resource':
55 self.filterComboBox.addItem(self.trUtf8("Resource Files"), "RESOURCES") 58 self.filterComboBox.addItem(
59 self.trUtf8("Resource Files"), "RESOURCES")
56 elif filter == 'interface': 60 elif filter == 'interface':
57 self.filterComboBox.addItem(self.trUtf8("Interface Files"), "INTERFACES") 61 self.filterComboBox.addItem(
62 self.trUtf8("Interface Files"), "INTERFACES")
58 elif filter == 'others': 63 elif filter == 'others':
59 self.filterComboBox.addItem(self.trUtf8("Other Files (*)"), "OTHERS") 64 self.filterComboBox.addItem(
65 self.trUtf8("Other Files (*)"), "OTHERS")
60 self.on_filterComboBox_highlighted('(*)') 66 self.on_filterComboBox_highlighted('(*)')
61 else: 67 else:
62 self.filterComboBox.addItem(self.trUtf8("Source Files"), "SOURCES") 68 self.filterComboBox.addItem(
63 self.filterComboBox.addItem(self.trUtf8("Forms Files"), "FORMS") 69 self.trUtf8("Source Files"), "SOURCES")
64 self.filterComboBox.addItem(self.trUtf8("Resource Files"), "RESOURCES") 70 self.filterComboBox.addItem(
65 self.filterComboBox.addItem(self.trUtf8("Interface Files"), "INTERFACES") 71 self.trUtf8("Forms Files"), "FORMS")
66 self.filterComboBox.addItem(self.trUtf8("Other Files (*)"), "OTHERS") 72 self.filterComboBox.addItem(
73 self.trUtf8("Resource Files"), "RESOURCES")
74 self.filterComboBox.addItem(
75 self.trUtf8("Interface Files"), "INTERFACES")
76 self.filterComboBox.addItem(
77 self.trUtf8("Other Files (*)"), "OTHERS")
67 self.filterComboBox.setCurrentIndex(0) 78 self.filterComboBox.setCurrentIndex(0)
68 79
69 @pyqtSlot(str) 80 @pyqtSlot(str)
70 def on_filterComboBox_highlighted(self, fileType): 81 def on_filterComboBox_highlighted(self, fileType):
71 """ 82 """
87 def __dirDialog(self, textEdit): 98 def __dirDialog(self, textEdit):
88 """ 99 """
89 Private slot to display a directory selection dialog. 100 Private slot to display a directory selection dialog.
90 101
91 @param textEdit field for the display of the selected directory name 102 @param textEdit field for the display of the selected directory name
92 (QLineEdit) 103 (QLineEdit)
93 """ 104 """
94 startdir = textEdit.text() 105 startdir = textEdit.text()
95 if not startdir and self.startdir is not None: 106 if not startdir and self.startdir is not None:
96 startdir = self.startdir 107 startdir = self.startdir
97 108

eric ide

mercurial