Changed code to always add the entry to the tools menu and disable it, if prerequisites are not fulfilled. release-0.4.0

Sat, 28 Dec 2013 19:26:10 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 28 Dec 2013 19:26:10 +0100
changeset 16
7df001a05b6b
parent 15
7a982632a974
child 17
4a31029d9686

Changed code to always add the entry to the tools menu and disable it, if prerequisites are not fulfilled.

ChangeLog file | annotate | diff | comparison | revisions
PluginSplitMergeCamelCase.py file | annotate | diff | comparison | revisions
PluginSplitMergeCamelCase.zip file | annotate | diff | comparison | revisions
--- a/ChangeLog	Mon Dec 23 19:12:22 2013 +0100
+++ b/ChangeLog	Sat Dec 28 19:26:10 2013 +0100
@@ -1,5 +1,9 @@
 ChangeLog
 ---------
+Version 0.4.0:
+- always add the entry to the tools menu and disable it, if prerequisites
+  are not fulfilled
+
 Version 0.3.0:
 - added support for the editor Tools context menu (as of eric5 5.4.0)
 
--- a/PluginSplitMergeCamelCase.py	Mon Dec 23 19:12:22 2013 +0100
+++ b/PluginSplitMergeCamelCase.py	Sat Dec 28 19:26:10 2013 +0100
@@ -20,7 +20,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "0.3.0"
+version = "0.4.0"
 className = "SplitMergeCamelCasePlugin"
 packageName = "SplitMergeCamelCase"
 shortDescription = "Split, merge or convert camel case text"
@@ -144,14 +144,12 @@
             return
         
         editor = e5App().getObject("ViewManager").activeWindow()
-        if editor is None:
-            return
         
         if not menu.isEmpty():
             menu.addSeparator()
         
         act = menu.addMenu(self.__menu)
-        act.setEnabled(editor.hasSelectedText())
+        act.setEnabled(editor is not None and editor.hasSelectedText())
     
     def __editorOpened(self, editor):
         """
Binary file PluginSplitMergeCamelCase.zip has changed

eric ide

mercurial