[virt-manager PATCH 2/2] fsdetails: fix a shortkey issue when combo is invisible

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

 



We use either combo or label after title in fsdetails ui.
But shortkey is meaningless to label.
This patch will disable underline shortkey
when label is visible.

Signed-off-by: Chen Hanxiao <chenhanxiao@xxxxxxxxxxxxxx>
---
 virtManager/fsdetails.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/virtManager/fsdetails.py b/virtManager/fsdetails.py
index 51aac66..b8bc527 100644
--- a/virtManager/fsdetails.py
+++ b/virtManager/fsdetails.py
@@ -70,11 +70,29 @@ class vmmFSDetails(vmmGObjectUI):
             self.storage_browser = None
 
     def show_pair_combo(self, basename, show_combo):
+        def change_fsdetails_title(basename, show):
+            combo_label_title = {
+                    "fs-type": "_Type",
+                    "fs-format": "_Format",
+                    "fs-mode": "M_ode",
+                    "fs-driver": "_Driver",
+                    "fs-wrpolicy": "_Write Policy"
+                    }
+
+            title = self.widget(basename + "-title")
+            title_text = combo_label_title.get(basename)
+            if not show:
+                title_text = title_text.replace("_", "")
+
+            title.set_text(title_text)
+            title.set_use_underline(True)
+
         combo = self.widget(basename + "-combo")
         label = self.widget(basename + "-label")
 
         combo.set_visible(show_combo)
         label.set_visible(not show_combo)
+        change_fsdetails_title(basename, show_combo)
 
     def show_check_button(self, basename, show):
         check = self.widget(basename)
-- 
1.9.3

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux