38 super(AddDirectoryDialog, self).__init__(parent) |
39 super(AddDirectoryDialog, self).__init__(parent) |
39 if name: |
40 if name: |
40 self.setObjectName(name) |
41 self.setObjectName(name) |
41 self.setupUi(self) |
42 self.setupUi(self) |
42 |
43 |
|
44 self.sourceDirButton.setIcon(UI.PixmapCache.getIcon("open.png")) |
|
45 self.targetDirButton.setIcon(UI.PixmapCache.getIcon("open.png")) |
|
46 |
43 self.sourceDirCompleter = E5DirCompleter(self.sourceDirEdit) |
47 self.sourceDirCompleter = E5DirCompleter(self.sourceDirEdit) |
44 self.targetDirCompleter = E5DirCompleter(self.targetDirEdit) |
48 self.targetDirCompleter = E5DirCompleter(self.targetDirEdit) |
45 |
49 |
46 self.ppath = pro.ppath |
50 self.ppath = pro.ppath |
47 self.targetDirEdit.setText(self.ppath) |
51 self.targetDirEdit.setText(self.ppath) |
48 self.startdir = startdir |
52 self.startdir = startdir |
49 self.on_filterComboBox_highlighted('(*.py)') |
53 self.on_filterComboBox_highlighted('(*.py)') |
50 # enable all dialog elements |
54 # enable all dialog elements |
51 if filter == 'source': # it is a source file |
55 if filter == 'source': # it is a source file |
52 self.filterComboBox.addItem( |
56 self.filterComboBox.addItem( |
53 self.trUtf8("Source Files"), "SOURCES") |
57 self.tr("Source Files"), "SOURCES") |
54 elif filter == 'form': |
58 elif filter == 'form': |
55 self.filterComboBox.addItem( |
59 self.filterComboBox.addItem( |
56 self.trUtf8("Forms Files"), "FORMS") |
60 self.tr("Forms Files"), "FORMS") |
57 elif filter == 'resource': |
61 elif filter == 'resource': |
58 self.filterComboBox.addItem( |
62 self.filterComboBox.addItem( |
59 self.trUtf8("Resource Files"), "RESOURCES") |
63 self.tr("Resource Files"), "RESOURCES") |
60 elif filter == 'interface': |
64 elif filter == 'interface': |
61 self.filterComboBox.addItem( |
65 self.filterComboBox.addItem( |
62 self.trUtf8("Interface Files"), "INTERFACES") |
66 self.tr("Interface Files"), "INTERFACES") |
63 elif filter == 'others': |
67 elif filter == 'others': |
64 self.filterComboBox.addItem( |
68 self.filterComboBox.addItem( |
65 self.trUtf8("Other Files (*)"), "OTHERS") |
69 self.tr("Other Files (*)"), "OTHERS") |
66 self.on_filterComboBox_highlighted('(*)') |
70 self.on_filterComboBox_highlighted('(*)') |
67 else: |
71 else: |
68 self.filterComboBox.addItem( |
72 self.filterComboBox.addItem( |
69 self.trUtf8("Source Files"), "SOURCES") |
73 self.tr("Source Files"), "SOURCES") |
70 self.filterComboBox.addItem( |
74 self.filterComboBox.addItem( |
71 self.trUtf8("Forms Files"), "FORMS") |
75 self.tr("Forms Files"), "FORMS") |
72 self.filterComboBox.addItem( |
76 self.filterComboBox.addItem( |
73 self.trUtf8("Resource Files"), "RESOURCES") |
77 self.tr("Resource Files"), "RESOURCES") |
74 self.filterComboBox.addItem( |
78 self.filterComboBox.addItem( |
75 self.trUtf8("Interface Files"), "INTERFACES") |
79 self.tr("Interface Files"), "INTERFACES") |
76 self.filterComboBox.addItem( |
80 self.filterComboBox.addItem( |
77 self.trUtf8("Other Files (*)"), "OTHERS") |
81 self.tr("Other Files (*)"), "OTHERS") |
78 self.filterComboBox.setCurrentIndex(0) |
82 self.filterComboBox.setCurrentIndex(0) |
|
83 |
|
84 msh = self.minimumSizeHint() |
|
85 self.resize(max(self.width(), msh.width()), msh.height()) |
79 |
86 |
80 @pyqtSlot(str) |
87 @pyqtSlot(str) |
81 def on_filterComboBox_highlighted(self, fileType): |
88 def on_filterComboBox_highlighted(self, fileType): |
82 """ |
89 """ |
83 Private slot to handle the selection of a file type. |
90 Private slot to handle the selection of a file type. |