[PATCH 2/3] Add keyboard mnemonics to the spoke selectors, too.

Chris Lumens clumens at redhat.com
Fri Jan 4 15:49:16 UTC 2013


---
 pyanaconda/ui/gui/spokes/__init__.py       | 5 -----
 pyanaconda/ui/gui/spokes/datetime_spoke.py | 2 +-
 pyanaconda/ui/gui/spokes/keyboard.py       | 2 +-
 pyanaconda/ui/gui/spokes/network.py        | 2 +-
 pyanaconda/ui/gui/spokes/password.py       | 2 +-
 pyanaconda/ui/gui/spokes/software.py       | 2 +-
 pyanaconda/ui/gui/spokes/source.py         | 2 +-
 pyanaconda/ui/gui/spokes/storage.py        | 2 +-
 widgets/src/SpokeSelector.c                | 5 +++--
 9 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/__init__.py b/pyanaconda/ui/gui/spokes/__init__.py
index 99039a6..c1a35b3 100644
--- a/pyanaconda/ui/gui/spokes/__init__.py
+++ b/pyanaconda/ui/gui/spokes/__init__.py
@@ -58,11 +58,6 @@ class Spoke(GUIObject):
         """
         pass
 
-    def initialize(self):
-        GUIObject.initialize(self)
-
-        self.window.set_property("window-name", self.title or "")
-
 class StandaloneSpoke(Spoke, common.StandaloneSpoke):
     def __init__(self, data, storage, payload, instclass):
         Spoke.__init__(self, data)
diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py
index 91af50f..b9b59bb 100644
--- a/pyanaconda/ui/gui/spokes/datetime_spoke.py
+++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py
@@ -293,7 +293,7 @@ class DatetimeSpoke(NormalSpoke):
     category = LocalizationCategory
 
     icon = "preferences-system-time-symbolic"
-    title = N_("DATE & TIME")
+    title = N_("DATE & _TIME")
 
     def __init__(self, *args):
         NormalSpoke.__init__(self, *args)
diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py
index c4281fe..10ede4c 100644
--- a/pyanaconda/ui/gui/spokes/keyboard.py
+++ b/pyanaconda/ui/gui/spokes/keyboard.py
@@ -260,7 +260,7 @@ class KeyboardSpoke(NormalSpoke):
     category = LocalizationCategory
 
     icon = "input-keyboard-symbolic"
-    title = N_("KEYBOARD")
+    title = N_("_KEYBOARD")
 
     def __init__(self, *args):
         NormalSpoke.__init__(self, *args)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index 95fd1ac..0c49f0d 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -954,7 +954,7 @@ class NetworkSpoke(NormalSpoke):
     mainWidgetName = "networkWindow"
     uiFile = "spokes/network.glade"
 
-    title = N_("NETWORK CONFIGURATION")
+    title = N_("_NETWORK CONFIGURATION")
     icon = "network-transmit-receive-symbolic"
 
     category = SoftwareCategory
diff --git a/pyanaconda/ui/gui/spokes/password.py b/pyanaconda/ui/gui/spokes/password.py
index 44be1ca..6950472 100644
--- a/pyanaconda/ui/gui/spokes/password.py
+++ b/pyanaconda/ui/gui/spokes/password.py
@@ -46,7 +46,7 @@ class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke):
     category = UserSettingsCategory
 
     icon = "dialog-password-symbolic"
-    title = N_("ROOT PASSWORD")
+    title = N_("_ROOT PASSWORD")
 
     def __init__(self, *args):
         NormalSpoke.__init__(self, *args)
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py
index 59c1787..8ab93d3 100644
--- a/pyanaconda/ui/gui/spokes/software.py
+++ b/pyanaconda/ui/gui/spokes/software.py
@@ -50,7 +50,7 @@ class SoftwareSelectionSpoke(NormalSpoke):
     category = SoftwareCategory
 
     icon = "package-x-generic-symbolic"
-    title = N_("SOFTWARE SELECTION")
+    title = N_("_SOFTWARE SELECTION")
 
     def __init__(self, *args, **kwargs):
         NormalSpoke.__init__(self, *args, **kwargs)
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index 528193d..d989d98 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -425,7 +425,7 @@ class SourceSpoke(NormalSpoke):
     category = SoftwareCategory
 
     icon = "media-optical-symbolic"
-    title = N_("INSTALLATION SOURCE")
+    title = N_("_INSTALLATION SOURCE")
 
     def __init__(self, *args, **kwargs):
         NormalSpoke.__init__(self, *args, **kwargs)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index ae7b419..eb1c2f2 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -321,7 +321,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
 
     # other candidates: computer-symbolic, folder-symbolic
     icon = "drive-harddisk-symbolic"
-    title = N_("INSTALLATION DESTINATION")
+    title = N_("INSTALLATION _DESTINATION")
 
     def __init__(self, *args, **kwargs):
         NormalSpoke.__init__(self, *args, **kwargs)
diff --git a/widgets/src/SpokeSelector.c b/widgets/src/SpokeSelector.c
index 94966c2..25d7cd9 100644
--- a/widgets/src/SpokeSelector.c
+++ b/widgets/src/SpokeSelector.c
@@ -210,7 +210,8 @@ static void anaconda_spoke_selector_init(AnacondaSpokeSelector *spoke) {
     spoke->priv->title_label = gtk_label_new(NULL);
     markup = g_markup_printf_escaped("<span weight='bold' size='large'>%s</span>", _(DEFAULT_TITLE));
     gtk_label_set_justify(GTK_LABEL(spoke->priv->title_label), GTK_JUSTIFY_LEFT);
-    gtk_label_set_markup(GTK_LABEL(spoke->priv->title_label), markup);
+    gtk_label_set_markup_with_mnemonic(GTK_LABEL(spoke->priv->title_label), markup);
+    gtk_label_set_mnemonic_widget(GTK_LABEL(spoke->priv->title_label), GTK_WIDGET(spoke));
     gtk_misc_set_alignment(GTK_MISC(spoke->priv->title_label), 0, 1);
     gtk_widget_set_hexpand(GTK_WIDGET(spoke->priv->title_label), FALSE);
     g_free(markup);
@@ -284,7 +285,7 @@ static void anaconda_spoke_selector_set_property(GObject *object, guint prop_id,
 
         case PROP_TITLE: {
             char *markup = g_markup_printf_escaped("<span weight='bold' size='large'>%s</span>", g_value_get_string(value));
-            gtk_label_set_markup(GTK_LABEL(priv->title_label), markup);
+            gtk_label_set_markup_with_mnemonic(GTK_LABEL(priv->title_label), markup);
             g_free(markup);
             break;
         }
-- 
1.7.11.2



More information about the anaconda-patches mailing list