On 04.10.2009 23:19, Steve Borho wrote: > On Sun, Oct 4, 2009 at 2:59 PM, Adrian Buehlmann <adr...@cadifra.com> wrote: > >> # HG changeset patch >> # User Adrian Buehlmann <adr...@cadifra.com> >> # Date 1254685874 -7200 >> # Node ID 8b01e4132762b3b34b9392f69366ad4769e4e30c >> # Parent fa025bd9f03f50e316fe3c5bfe23910ed4b05acd >> gdialog: refactor: use dicts for menu entries >> >> don't use the text of the menu item to address it >> > > Interesting. Is this to avoid using translated strings as keys?
Not only. But having to use something like _('Re_vert') in multiple places to address the same menu item is ugly. Imagine, you wanted to change the accelerator. Then it would be better to have to do it in a single place. So I decided to separate ui text and name of item. I was working on another change and I got annoyed to have to update *all* table initializations everywhere when I wanted to introduce another parameter for the setup of the menu. So I came up with this dict idea. > Unfortunately, this conflicts with a change I just made to history.py. I will have a look and adapt. [..] >> diff --git a/tortoisehg/hgtk/status.py b/tortoisehg/hgtk/status.py >> --- a/tortoisehg/hgtk/status.py >> +++ b/tortoisehg/hgtk/status.py >> @@ -462,8 +462,6 @@ class GStatus(gdialog.GDialog): >> for label in (_('_Diff'), _('Re_vert'), _('_Add'), _('_Remove'), >> _('Move'), _('_Forget')): >> self.get_toolbutton(label).set_sensitive(sensitive) >> - i = self.get_menuitem(label) >> - if i: i.set_sensitive(sensitive) >> if self.diff_notebook.get_current_page() == 2: >> self.update_commit_preview() This was an error conclusion I made. I forgot that status is used in commit, and commit *does* have those menu entries. I will fix and send a new pile of patches when finished. ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Tortoisehg-develop mailing list Tortoisehg-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop