Sat, 05 Sep 2015 13:08:44 +0200
Merged with remote changes.
.hgtags | file | annotate | diff | comparison | revisions | |
ChangeLog | file | annotate | diff | comparison | revisions | |
PluginColorString.py | file | annotate | diff | comparison | revisions | |
PluginColorString.zip | file | annotate | diff | comparison | revisions |
--- a/.hgtags Sat Sep 05 13:03:46 2015 +0200 +++ b/.hgtags Sat Sep 05 13:08:44 2015 +0200 @@ -10,3 +10,4 @@ ffe2ec016dfb899c83805c21b4beb80844c238a5 release_2.1.0 8a7d311ecf9693cf8ffc6cf15495abee33a67b5e release_2.1.1 ca045ea5f3994e8fb934c1e7c3089b4bfe31fb86 release_2.1.2 +cf10856f55de4594e8be894fd8b912120487d666 release_2.2.0
--- a/ChangeLog Sat Sep 05 13:03:46 2015 +0200 +++ b/ChangeLog Sat Sep 05 13:08:44 2015 +0200 @@ -1,8 +1,11 @@ ChangeLog --------- -Version 2.1.2: +Version 2.2.1: - updated Russian translations +Version 2.2.0: +- adaptation for the new plug-in tools menu handling + Version 2.1.1: - updated Spanish translations
--- a/PluginColorString.py Sat Sep 05 13:03:46 2015 +0200 +++ b/PluginColorString.py Sat Sep 05 13:08:44 2015 +0200 @@ -23,7 +23,7 @@ author = "Detlev Offenbach <detlev@die-offenbachs.de>" autoactivate = True deactivateable = True -version = "2.1.2" +version = "2.2.1" className = "ColorStringPlugin" packageName = "ColorString" shortDescription = "Insert color as string" @@ -59,6 +59,7 @@ self.__initMenu() self.__editors = {} + self.__mainActions = [] def activate(self): """ @@ -71,6 +72,14 @@ self.__ui.showMenu.connect(self.__populateMenu) + menu = self.__ui.getMenu("plugin_tools") + if menu is not None: + if not menu.isEmpty(): + act = menu.addSeparator() + self.__mainActions.append(act) + act = menu.addMenu(self.__menu) + self.__mainActions.append(act) + e5App().getObject("ViewManager").editorOpenedEd.connect( self.__editorOpened) e5App().getObject("ViewManager").editorClosedEd.connect( @@ -87,6 +96,12 @@ """ self.__ui.showMenu.disconnect(self.__populateMenu) + menu = self.__ui.getMenu("plugin_tools") + if menu is not None: + for act in self.__mainActions: + menu.removeAction(act) + self.__mainActions = [] + e5App().getObject("ViewManager").editorOpenedEd.disconnect( self.__editorOpened) e5App().getObject("ViewManager").editorClosedEd.disconnect( @@ -137,12 +152,18 @@ @param name name of the menu (string) @param menu reference to the menu to be populated (QMenu) """ - if name != "Tools": + if name not in ["Tools", "PluginTools"]: return - if not menu.isEmpty(): - menu.addSeparator() - menu.addMenu(self.__menu) + editor = e5App().getObject("ViewManager").activeWindow() + + if name == "Tools": + if not menu.isEmpty(): + menu.addSeparator() + act = menu.addMenu(self.__menu) + act.setEnabled(editor is not None) + elif name == "PluginTools" and self.__mainActions: + self.__mainActions[-1].setEnabled(editor is not None) def __editorOpened(self, editor): """