26 # Start-Of-Header |
27 # Start-Of-Header |
27 name = "Generic Web Project Plug-in" |
28 name = "Generic Web Project Plug-in" |
28 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
29 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
29 autoactivate = True |
30 autoactivate = True |
30 deactivateable = True |
31 deactivateable = True |
31 version = "2.1.0" |
32 version = "2.2.0" |
32 className = "ProjectWebPlugin" |
33 className = "ProjectWebPlugin" |
33 packageName = "ProjectWeb" |
34 packageName = "ProjectWeb" |
34 shortDescription = "Support for Web projects and web related tools." |
35 shortDescription = "Support for Web projects and web related tools." |
35 longDescription = ( |
36 longDescription = ( |
36 """This plug-in provides support for ordinary web projects and some web""" |
37 """This plug-in provides support for ordinary web projects and some web""" |
244 """ |
245 """ |
245 Private slot called, when an editor was closed. |
246 Private slot called, when an editor was closed. |
246 |
247 |
247 @param editor reference to the editor (QScintilla.Editor) |
248 @param editor reference to the editor (QScintilla.Editor) |
248 """ |
249 """ |
249 try: |
250 with contextlib.suppress(KeyError): |
250 del self.__editors[editor] |
251 del self.__editors[editor] |
251 except KeyError: |
|
252 pass |
|
253 |
252 |
254 def __editorShowMenu(self, menuName, menu, editor): |
253 def __editorShowMenu(self, menuName, menu, editor): |
255 """ |
254 """ |
256 Private slot called, when the the editor context menu or a submenu is |
255 Private slot called, when the the editor context menu or a submenu is |
257 about to be shown. |
256 about to be shown. |
258 |
257 |
259 @param menuName name of the menu to be shown (string) |
258 @param menuName name of the menu to be shown (string) |
260 @param menu reference to the menu (QMenu) |
259 @param menu reference to the menu (QMenu) |
261 @param editor reference to the editor |
260 @param editor reference to the editor |
262 """ |
261 """ |
263 if menuName == "Tools": |
262 if ( |
264 if self.__menu.menuAction() not in menu.actions(): |
263 menuName == "Tools" and |
265 # Re-add our menu |
264 self.__menu.menuAction() not in menu.actions() |
266 self.__editors[editor] = [] |
265 ): |
267 if not menu.isEmpty(): |
266 # Re-add our menu |
268 act = menu.addSeparator() |
267 self.__editors[editor] = [] |
269 self.__editors[editor].append(act) |
268 if not menu.isEmpty(): |
270 act = menu.addMenu(self.__menu) |
269 act = menu.addSeparator() |
271 self.__editors[editor].append(act) |
270 self.__editors[editor].append(act) |
|
271 act = menu.addMenu(self.__menu) |
|
272 self.__editors[editor].append(act) |
272 |
273 |
273 def __html5ToCss3(self): |
274 def __html5ToCss3(self): |
274 """ |
275 """ |
275 Private slot handling the HTML5 to CSS3 conversion. |
276 Private slot handling the HTML5 to CSS3 conversion. |
276 """ |
277 """ |