Added code to emit a signal when a file is removed from the project.

Mon, 20 Dec 2010 19:39:15 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 20 Dec 2010 19:39:15 +0100
changeset 765
e5cbb3f273eb
parent 763
59c27b72d344
child 766
0940de08fa75

Added code to emit a signal when a file is removed from the project.

Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Source/eric5.Project.Project.html file | annotate | diff | comparison | revisions
Project/Project.py file | annotate | diff | comparison | revisions
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Source/eric5.Project.Project.html	Sun Dec 19 19:52:49 2010 +0100
+++ b/Documentation/Source/eric5.Project.Project.html	Mon Dec 20 19:39:15 2010 +0100
@@ -89,16 +89,25 @@
 </dd><dt>projectFormAdded(str)</dt>
 <dd>
 emitted after a new form was added
+</dd><dt>projectFormRemoved(str)</dt>
+<dd>
+emitted after a form was removed
 </dd><dt>projectInterfaceAdded(str)</dt>
 <dd>
 emitted after a new IDL file was added
+</dd><dt>projectInterfaceRemoved(str)</dt>
+<dd>
+emitted after a IDL file was removed
 </dd><dt>projectLanguageAdded(str)</dt>
 <dd>
 emitted after a new language was added
 </dd><dt>projectLanguageAddedByCode(str)</dt>
 <dd>
 emitted after a new language was added.
-        The language code is sent by this signal.
+            The language code is sent by this signal.
+</dd><dt>projectLanguageRemoved(str)</dt>
+<dd>
+emitted after a language was removed
 </dd><dt>projectOpened()</dt>
 <dd>
 emitted after a project file was read
@@ -110,15 +119,25 @@
 <dd>
 emitted after a file or directory was added
             to the OTHERS project data area
+</dd><dt>projectOthersRemoved(str)</dt>
+<dd>
+emitted after a file was removed from the
+            OTHERS project data area
 </dd><dt>projectPropertiesChanged()</dt>
 <dd>
 emitted after the project properties were changed
 </dd><dt>projectResourceAdded(str)</dt>
 <dd>
 emitted after a new resource file was added
+</dd><dt>projectResourceRemoved(str)</dt>
+<dd>
+emitted after a resource was removed
 </dd><dt>projectSourceAdded(str)</dt>
 <dd>
 emitted after a new source file was added
+</dd><dt>projectSourceRemoved(str)</dt>
+<dd>
+emitted after a source was removed
 </dd><dt>reinitVCS()</dt>
 <dd>
 emitted after the VCS has been reinitialized
@@ -140,7 +159,7 @@
 QObject
 <h3>Class Attributes</h3>
 <table>
-<tr><td>completeRepopulateItem</td></tr><tr><td>dbgKeynames</td></tr><tr><td>directoryRemoved</td></tr><tr><td>dirty</td></tr><tr><td>eols</td></tr><tr><td>keynames</td></tr><tr><td>lexerAssociationsChanged</td></tr><tr><td>newProject</td></tr><tr><td>newProjectHooks</td></tr><tr><td>prepareRepopulateItem</td></tr><tr><td>projectAboutToBeCreated</td></tr><tr><td>projectClosed</td></tr><tr><td>projectClosedHooks</td></tr><tr><td>projectFileRenamed</td></tr><tr><td>projectFormAdded</td></tr><tr><td>projectInterfaceAdded</td></tr><tr><td>projectLanguageAdded</td></tr><tr><td>projectLanguageAddedByCode</td></tr><tr><td>projectOpened</td></tr><tr><td>projectOpenedHooks</td></tr><tr><td>projectOthersAdded</td></tr><tr><td>projectPropertiesChanged</td></tr><tr><td>projectResourceAdded</td></tr><tr><td>projectSourceAdded</td></tr><tr><td>reinitVCS</td></tr><tr><td>showMenu</td></tr><tr><td>sourceFile</td></tr><tr><td>userKeynames</td></tr><tr><td>vcsStatusMonitorStatus</td></tr>
+<tr><td>completeRepopulateItem</td></tr><tr><td>dbgKeynames</td></tr><tr><td>directoryRemoved</td></tr><tr><td>dirty</td></tr><tr><td>eols</td></tr><tr><td>keynames</td></tr><tr><td>lexerAssociationsChanged</td></tr><tr><td>newProject</td></tr><tr><td>newProjectHooks</td></tr><tr><td>prepareRepopulateItem</td></tr><tr><td>projectAboutToBeCreated</td></tr><tr><td>projectClosed</td></tr><tr><td>projectClosedHooks</td></tr><tr><td>projectFileRenamed</td></tr><tr><td>projectFormAdded</td></tr><tr><td>projectFormRemoved</td></tr><tr><td>projectInterfaceAdded</td></tr><tr><td>projectInterfaceRemoved</td></tr><tr><td>projectLanguageAdded</td></tr><tr><td>projectLanguageAddedByCode</td></tr><tr><td>projectLanguageRemoved</td></tr><tr><td>projectOpened</td></tr><tr><td>projectOpenedHooks</td></tr><tr><td>projectOthersAdded</td></tr><tr><td>projectOthersRemoved</td></tr><tr><td>projectPropertiesChanged</td></tr><tr><td>projectResourceAdded</td></tr><tr><td>projectResourceRemoved</td></tr><tr><td>projectSourceAdded</td></tr><tr><td>projectSourceRemoved</td></tr><tr><td>reinitVCS</td></tr><tr><td>showMenu</td></tr><tr><td>sourceFile</td></tr><tr><td>userKeynames</td></tr><tr><td>vcsStatusMonitorStatus</td></tr>
 </table>
 <h3>Methods</h3>
 <table>
--- a/Project/Project.py	Sun Dec 19 19:52:49 2010 +0100
+++ b/Project/Project.py	Mon Dec 20 19:39:15 2010 +0100
@@ -71,11 +71,20 @@
     @signal dirty(int) emitted when the dirty state changes
     @signal projectLanguageAdded(str) emitted after a new language was added
     @signal projectLanguageAddedByCode(str) emitted after a new language was added.
-        The language code is sent by this signal.
+            The language code is sent by this signal.
+    @signal projectLanguageRemoved(str) emitted after a language was removed
     @signal projectFormAdded(str) emitted after a new form was added
+    @signal projectFormRemoved(str) emitted after a form was removed
     @signal projectSourceAdded(str) emitted after a new source file was added
+    @signal projectSourceRemoved(str) emitted after a source was removed
     @signal projectInterfaceAdded(str) emitted after a new IDL file was added
+    @signal projectInterfaceRemoved(str) emitted after a IDL file was removed
     @signal projectResourceAdded(str) emitted after a new resource file was added
+    @signal projectResourceRemoved(str) emitted after a resource was removed
+    @signal projectOthersAdded(str) emitted after a file or directory was added
+            to the OTHERS project data area
+    @signal projectOthersRemoved(str) emitted after a file was removed from the
+            OTHERS project data area
     @signal projectAboutToBeCreated() emitted just before the project will be created
     @signal newProjectHooks() emitted after a new project was generated but before
             the newProject() signal is sent
@@ -88,8 +97,6 @@
     @signal projectClosedHooks() emitted after a project file was closed but before the
             projectClosed() signal is sent
     @signal projectClosed() emitted after a project was closed
-    @signal projectOthersAdded(str) emitted after a file or directory was added
-            to the OTHERS project data area
     @signal projectFileRenamed(str, str) emitted after a file of the project
             has been renamed
     @signal projectPropertiesChanged() emitted after the project properties were changed
@@ -110,11 +117,17 @@
     dirty = pyqtSignal(int)
     projectLanguageAdded = pyqtSignal(str)
     projectLanguageAddedByCode = pyqtSignal(str)
+    projectLanguageRemoved = pyqtSignal(str)
     projectFormAdded = pyqtSignal(str)
+    projectFormRemoved = pyqtSignal(str)
     projectSourceAdded = pyqtSignal(str)
+    projectSourceRemoved = pyqtSignal(str)
     projectInterfaceAdded = pyqtSignal(str)
+    projectInterfaceRemoved = pyqtSignal(str)
     projectResourceAdded = pyqtSignal(str)
+    projectResourceRemoved = pyqtSignal(str)
     projectOthersAdded = pyqtSignal(str)
+    projectOthersRemoved = pyqtSignal(str)
     projectAboutToBeCreated = pyqtSignal()
     newProjectHooks = pyqtSignal()
     newProject = pyqtSignal()
@@ -1634,16 +1647,22 @@
         dirty = True
         if fn in self.pdata["SOURCES"]:
             self.pdata["SOURCES"].remove(fn)
+            self.projectSourceRemoved.emit(fn)
         elif fn in self.pdata["FORMS"]:
             self.pdata["FORMS"].remove(fn)
+            self.projectFormRemoved.emit(fn)
         elif fn in self.pdata["INTERFACES"]:
             self.pdata["INTERFACES"].remove(fn)
+            self.projectInterfaceRemoved.emit(fn)
         elif fn in self.pdata["RESOURCES"]:
             self.pdata["RESOURCES"].remove(fn)
+            self.projectResourceRemoved.emit(fn)
         elif fn in self.pdata["OTHERS"]:
             self.pdata["OTHERS"].remove(fn)
+            self.projectOthersRemoved.emit(fn)
         elif fn in self.pdata["TRANSLATIONS"]:
             self.pdata["TRANSLATIONS"].remove(fn)
+            self.projectLanguageRemoved.emit(fn)
         else:
             dirty = False
         updateModel and self.__model.removeItem(fn)

eric ide

mercurial