[chirp_devel] [PATCH] Correct menu enable/disable when changing selected editor
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1365065724 -7200 # Node ID 69e2514f8f1e4154c50591b788e7494f2ef40a78 # Parent e6d14af8e3f169012abc39d874cfe3ca2288b520 Correct menu enable/disable when changing selected editor
Introduced fixing #739
diff --git a/chirpui/mainapp.py b/chirpui/mainapp.py --- a/chirpui/mainapp.py +++ b/chirpui/mainapp.py @@ -20,6 +20,7 @@ from glob import glob import shutil import time +import re
import gtk import gobject @@ -124,13 +125,13 @@
def ev_editor_selected(self, editorset, editortype): mappings = { - "memedit" : ["view", "edit"], + "^memedit\d*$" : ["view", "edit"], }
for _editortype, actions in mappings.items(): for _action in actions: action = self.menu_ag.get_action(_action) - action.set_sensitive(_editortype == editortype) + action.set_sensitive(re.search(_editortype, editortype) is not None)
def _connect_editorset(self, eset): eset.connect("want-close", self.do_close)
Hi Marco,
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1365065724 -7200 # Node ID 69e2514f8f1e4154c50591b788e7494f2ef40a78 # Parent e6d14af8e3f169012abc39d874cfe3ca2288b520 Correct menu enable/disable when changing selected editor
Sorry for the delay on this, I was just waiting until I had a chance to review some of the surrounding code first.
action.set_sensitive(re.search(_editortype,
I think I would rather not use a regex here as I think it's too heavyweight for such a simple task. Not that this is performance-critical or anything.
I hope it's okay, but I'm going to incorporate a different fix for this into a patch for another issue I found.
Thanks for finding this!
participants (2)
-
Dan Smith
-
Marco Filippi IZ3GME