PluginProjectDjangoTagsMenu.py

changeset 3
6d10c1249cb8
parent 2
4be31b0908c7
child 16
f2d493540f04
equal deleted inserted replaced
2:4be31b0908c7 3:6d10c1249cb8
116 self.__pluginAboutToBeDeactivated) 116 self.__pluginAboutToBeDeactivated)
117 117
118 if pluginManager.isPluginActive("PluginProjectDjango"): 118 if pluginManager.isPluginActive("PluginProjectDjango"):
119 self.__attachMenu() 119 self.__attachMenu()
120 120
121 e5App().getObject("Project").projectClosed.connect(
122 self.__projectClosed)
123
121 return None, True 124 return None, True
122 125
123 def deactivate(self): 126 def deactivate(self):
124 """ 127 """
125 Public method to deactivate this plugin. 128 Public method to deactivate this plugin.
126 """ 129 """
130 e5App().getObject("Project").projectClosed.disconnect(
131 self.__projectClosed)
132
133 self.__handler.closeAllWindows()
127 self.__detachMenu() 134 self.__detachMenu()
128 135
129 pluginManager = e5App().getObject("PluginManager") 136 pluginManager = e5App().getObject("PluginManager")
130 pluginManager.pluginActivated.disconnect(self.__pluginActivated) 137 pluginManager.pluginActivated.disconnect(self.__pluginActivated)
131 pluginManager.pluginAboutToBeDeactivated.disconnect( 138 pluginManager.pluginAboutToBeDeactivated.disconnect(
149 else: 156 else:
150 print("Warning: translation file '{0}' could not be" 157 print("Warning: translation file '{0}' could not be"
151 " loaded.".format(translation)) 158 " loaded.".format(translation))
152 print("Using default.") 159 print("Using default.")
153 160
161 def __projectClosed(self):
162 """
163 Private slot to handle the projectClosed signal.
164 """
165 self.__handler.closeAllWindows()
166
154 def __pluginActivated(self, moduleName, pluginObject): 167 def __pluginActivated(self, moduleName, pluginObject):
155 """ 168 """
156 Private slot to react on plugin activation of the Django plugin. 169 Private slot to react on plugin activation of the Django plugin.
157 170
158 @param moduleName name of the module activated (string) 171 @param moduleName name of the module activated (string)
168 @param moduleName name of the module about to be deactivated (string) 181 @param moduleName name of the module about to be deactivated (string)
169 @param pluginObject reference to the about to be deactivated 182 @param pluginObject reference to the about to be deactivated
170 plug-in object (object) 183 plug-in object (object)
171 """ 184 """
172 if moduleName == "PluginProjectDjango": 185 if moduleName == "PluginProjectDjango":
186 self.__handler.closeAllWindows()
173 self.__detachMenu() 187 self.__detachMenu()

eric ide

mercurial