[chirp_devel] [PATCH] tooltip-recent-files completes # 8007

Rudolph Gutzerhagen
Wed Jun 24 10:42:04 PDT 2020


patch 1 of 2 for tooltips

(1) recent files

(2) editor tab
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20200624/83ae7f23/attachment-0001.html 
-------------- next part --------------
# HG changeset patch
# User Rudolph Gutzerhagen <rudolph.gutzerhagen at gmail.com>
# Date 1593020108 14400
#      Wed Jun 24 13:35:08 2020 -0400
# Node ID 9637b36c48c89f006b3cb6b4bdd0371b92891728
# Parent  0c5db792de719d4f1c373df76bcf74a51e87fc0b
tooltip-recent-files              completes # 8007
    o tooltip on recent files menu for full-path information.
      - aids in distinguishing entries with same short name.

diff --git a/chirp/ui/mainapp.py b/chirp/ui/mainapp.py
--- a/chirp/ui/mainapp.py
+++ b/chirp/ui/mainapp.py
@@ -537,15 +537,25 @@
                 self.menu_ag.remove_action(old_action)
 
             file_basename = os.path.basename(fname).replace("_", "__")
-            action = gtk.Action(
-                action_name, "_%i. %s" % (i + 1, file_basename),
-                _("Open recent file {name}").format(name=fname), "")
+            widget_name = action_name
+            widget_label = "_%i. %s" % (i + 1, file_basename)
+            widget_tip = _("Open recent file") + (" {name}").format(name=fname)
+            action = gtk.Action(action_name, widget_label, widget_tip, "")
+
             action.connect("activate", lambda a, f: self.do_open(f), fname)
             mid = self.menu_uim.new_merge_id()
             self.menu_uim.add_ui(mid, path,
                                  action_name, action_name,
                                  gtk.UI_MANAGER_MENUITEM, False)
             self.menu_ag.add_action(action)
+
+            widget_uim_path = path + "/" + widget_name
+            try:
+                widget_item = self.menu_uim.get_widget(widget_uim_path)
+                widget_item.set_tooltip_text(widget_tip)
+            except:
+                pass
+
             i += 1
 
     def record_recent_file(self, filename):
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tooltip-recent-files--2020-06-24.patch.bin
Type: application/octet-stream
Size: 1768 bytes
Desc: not available
Url : http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20200624/83ae7f23/attachment-0001.bin 


More information about the chirp_devel mailing list