[meld] meldwindow: Encode underscores for accelerator parsing (bgo#744143)



commit c26a5d04fb74d1bc87d89d813bced21f9081878a
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Feb 8 07:53:08 2015 +1000

    meldwindow: Encode underscores for accelerator parsing (bgo#744143)
    
    This fixes display in the Tabs menu when comparing e.g., "foo" and
    "foo_bar".
    
    Ideally, we'd just disable underscore accelerators for these actions,
    but there seems to be no such API.

 meld/meldwindow.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/meld/meldwindow.py b/meld/meldwindow.py
index c2afbe4..6a9b15c 100644
--- a/meld/meldwindow.py
+++ b/meld/meldwindow.py
@@ -402,7 +402,8 @@ class MeldWindow(gnomeglade.Component):
         if actiongroup:
             idx = self.notebook.page_num(page)
             action_name = "SwitchTab%d" % idx
-            actiongroup.get_action(action_name).set_label(text)
+            label = text.replace("_", "__")
+            actiongroup.get_action(action_name).set_label(label)
 
     def on_can_undo(self, undosequence, can):
         self.actiongroup.get_action("Undo").set_sensitive(can)
@@ -542,6 +543,7 @@ class MeldWindow(gnomeglade.Component):
         for i in range(self.notebook.get_n_pages()):
             page = self.notebook.get_nth_page(i)
             label = self.notebook.get_menu_label_text(page) or ""
+            label = label.replace("_", "__")
             name = "SwitchTab%d" % i
             tooltip = _("Switch to this tab")
             action = Gtk.RadioAction(name=name, label=label, tooltip=tooltip, stock_id=None, value=i)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]