51 # 1 = specials for Others browser |
51 # 1 = specials for Others browser |
52 self.specialMenuEntries = [] |
52 self.specialMenuEntries = [] |
53 self.isTranslationsBrowser = False |
53 self.isTranslationsBrowser = False |
54 self.expandedNames = [] |
54 self.expandedNames = [] |
55 |
55 |
56 self.SelectFlags = QItemSelectionModel.SelectionFlags(\ |
56 self.SelectFlags = QItemSelectionModel.SelectionFlags( |
57 QItemSelectionModel.Select | QItemSelectionModel.Rows) |
57 QItemSelectionModel.Select | QItemSelectionModel.Rows) |
58 self.DeselectFlags = QItemSelectionModel.SelectionFlags(\ |
58 self.DeselectFlags = QItemSelectionModel.SelectionFlags( |
59 QItemSelectionModel.Deselect | QItemSelectionModel.Rows) |
59 QItemSelectionModel.Deselect | QItemSelectionModel.Rows) |
60 |
60 |
61 self.setContextMenuPolicy(Qt.CustomContextMenu) |
61 self.setContextMenuPolicy(Qt.CustomContextMenu) |
62 self.customContextMenuRequested.connect(self._contextMenuRequested) |
62 self.customContextMenuRequested.connect(self._contextMenuRequested) |
63 self.activated.connect(self._openItem) |
63 self.activated.connect(self._openItem) |
150 |
150 |
151 @param index index of item to be selected (QModelIndex) |
151 @param index index of item to be selected (QModelIndex) |
152 """ |
152 """ |
153 if index.isValid(): |
153 if index.isValid(): |
154 self.setCurrentIndex(index) |
154 self.setCurrentIndex(index) |
155 flags = QItemSelectionModel.SelectionFlags(\ |
155 flags = QItemSelectionModel.SelectionFlags( |
156 QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows) |
156 QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows) |
157 self.selectionModel().select(index, flags) |
157 self.selectionModel().select(index, flags) |
158 |
158 |
159 def _setItemSelected(self, index, selected): |
159 def _setItemSelected(self, index, selected): |
160 """ |
160 """ |
264 |
264 |
265 def _removeDir(self): |
265 def _removeDir(self): |
266 """ |
266 """ |
267 Protected method to remove a (single) directory from the project. |
267 Protected method to remove a (single) directory from the project. |
268 """ |
268 """ |
269 itmList = self.getSelectedItems(\ |
269 itmList = self.getSelectedItems( |
270 [ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem]) |
270 [ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem]) |
271 for itm in itmList[:]: |
271 for itm in itmList[:]: |
272 dn = itm.dirName() |
272 dn = itm.dirName() |
273 self.project.removeDirectory(dn) |
273 self.project.removeDirectory(dn) |
274 |
274 |