11 |
11 |
12 import os |
12 import os |
13 |
13 |
14 from PyQt4.QtCore import QModelIndex, pyqtSignal, Qt |
14 from PyQt4.QtCore import QModelIndex, pyqtSignal, Qt |
15 from PyQt4.QtGui import QTreeView, QCursor, QItemSelection, QItemSelectionModel, \ |
15 from PyQt4.QtGui import QTreeView, QCursor, QItemSelection, QItemSelectionModel, \ |
16 QApplication, QMenu, QAbstractItemView |
16 QApplication, QMenu, QAbstractItemView, QDialog |
17 |
17 |
18 from E5Gui.E5Application import e5App |
18 from E5Gui.E5Application import e5App |
19 from E5Gui import E5MessageBox |
19 from E5Gui import E5MessageBox |
20 |
20 |
21 from UI.Browser import Browser |
21 from UI.Browser import Browser |
267 itmList = self.getSelectedItems( |
267 itmList = self.getSelectedItems( |
268 [ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem]) |
268 [ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem]) |
269 for itm in itmList[:]: |
269 for itm in itmList[:]: |
270 dn = itm.dirName() |
270 dn = itm.dirName() |
271 self.project.removeDirectory(dn) |
271 self.project.removeDirectory(dn) |
|
272 |
|
273 def _deleteDirectory(self): |
|
274 """ |
|
275 Protected method to delete the selected directory from the project data area. |
|
276 """ |
|
277 itmList = self.getSelectedItems() |
|
278 |
|
279 dirs = [] |
|
280 fullNames = [] |
|
281 for itm in itmList: |
|
282 dn = itm.dirName() |
|
283 fullNames.append(dn) |
|
284 dn = self.project.getRelativePath(dn) |
|
285 dirs.append(dn) |
|
286 |
|
287 from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog |
|
288 dlg = DeleteFilesConfirmationDialog(self.parent(), |
|
289 self.trUtf8("Delete directories"), |
|
290 self.trUtf8("Do you really want to delete these directories from" |
|
291 " the project?"), |
|
292 dirs) |
|
293 |
|
294 if dlg.exec_() == QDialog.Accepted: |
|
295 for dn in fullNames: |
|
296 self.project.deleteDirectory(dn) |
272 |
297 |
273 def _renameFile(self): |
298 def _renameFile(self): |
274 """ |
299 """ |
275 Protected method to rename a file of the project. |
300 Protected method to rename a file of the project. |
276 """ |
301 """ |