8 """ |
8 """ |
9 |
9 |
10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 |
11 |
12 import os |
12 import os |
|
13 import shutil |
13 |
14 |
14 from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QFileInfo, QFile, \ |
15 from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QFileInfo, QFile, \ |
15 QIODevice, QObject |
16 QIODevice, QObject |
16 from PyQt5.QtGui import QCursor |
17 from PyQt5.QtGui import QCursor |
17 from PyQt5.QtWidgets import QMenu, QApplication, QDialog, QToolBar |
18 from PyQt5.QtWidgets import QMenu, QApplication, QDialog, QToolBar |
412 project = self.__projects[uid] |
413 project = self.__projects[uid] |
413 del self.__projects[uid] |
414 del self.__projects[uid] |
414 self.projectRemoved.emit(project) |
415 self.projectRemoved.emit(project) |
415 self.setDirty(True) |
416 self.setDirty(True) |
416 |
417 |
|
418 def deleteProject(self, uid): |
|
419 """ |
|
420 Public slot to delete project(s) from the multi project and disk. |
|
421 |
|
422 @param uid UID of the project to be removed from the multi |
|
423 project |
|
424 @type str |
|
425 """ |
|
426 if uid in self.__projects: |
|
427 project = self.__projects[uid] |
|
428 projectPath = os.path.dirname(project["file"]) |
|
429 shutil.rmtree(projectPath, True) |
|
430 |
|
431 self.removeProject(uid) |
|
432 |
417 def __newMultiProject(self): |
433 def __newMultiProject(self): |
418 """ |
434 """ |
419 Private slot to build a new multi project. |
435 Private slot to build a new multi project. |
420 |
436 |
421 This method displays the new multi project dialog and initializes |
437 This method displays the new multi project dialog and initializes |