[Xfce4-commits] <postler:master> Implement mnemonics in account setup widget

Christian Dywan noreply at xfce.org
Wed Jan 12 03:42:04 CET 2011


Updating branch refs/heads/master
         to 777aa36ca6b44b2e5530f94684c89f14e3f0a0f4 (commit)
       from 234691c6e4297d6e9a2b645ebe2a8e25a58be819 (commit)

commit 777aa36ca6b44b2e5530f94684c89f14e3f0a0f4
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Jan 12 00:27:09 2011 +0100

    Implement mnemonics in account setup widget

 postler/postler-accountsetup.vala |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/postler/postler-accountsetup.vala b/postler/postler-accountsetup.vala
index 10c50f8..50025ae 100644
--- a/postler/postler-accountsetup.vala
+++ b/postler/postler-accountsetup.vala
@@ -49,52 +49,54 @@ public class Postler.AccountWidget : Gtk.VBox {
 
         realname = new Gtk.Entry ();
         realname.text = info.realname ?? "";
-        add_label_entry (_("Full Name:"), realname);
+        add_label_entry (_("_Full Name:"), realname);
         address = new Gtk.Entry ();
         address.text = info.address ?? "";
-        add_label_entry (_("Email Address:"), address);
+        add_label_entry (_("_Email Address:"), address);
         password = new Gtk.Entry ();
         password.visibility = false;
         password.text = info.password ?? "";
-        add_label_entry (_("Password:"), password);
+        add_label_entry (_("_Password:"), password);
         organization = new Gtk.Entry ();
         organization.text = info.organization ?? "";
-        add_label_entry (_("Organization:"), organization);
+        add_label_entry (_("_Organization:"), organization);
 
         signature = new Gtk.TextView ();
         signature.buffer.text = info.signature ?? "";
         signature.accepts_tab = false;
-        add_label_entry (_("Signature:"), new Postler.ScrolledWindow (signature));
+        add_label_entry (_("_Signature:"), new Postler.ScrolledWindow (signature));
         (signature.parent as Gtk.ScrolledWindow).shadow_type = Gtk.ShadowType.ETCHED_OUT;
 
-        var expander = new Gtk.Expander (_("Advanced"));
+        var expander = new Gtk.Expander.with_mnemonic (_("_Advanced"));
         content_area.pack_start (expander, false, false, 4);
         advanced_area = new Gtk.VBox (false, 4);
         expander.add (advanced_area);
 
         receiver = new Gtk.Entry ();
         receiver.text = info.receive ?? "";
-        add_label_entry (_("Receiving Server:"), receiver, true);
+        add_label_entry (_("_Receiving Server:"), receiver, true);
         username = new Gtk.Entry ();
         username.text = info.username ?? "";
-        add_label_entry (_("Username:"), username, true);
+        add_label_entry (_("_Username:"), username, true);
         prefix = new Gtk.Entry ();
         prefix.text = info.prefix ?? "";
-        add_label_entry (_("Prefix:"), prefix, true);
+        add_label_entry (_("Prefi_x:"), prefix, true);
         sender = new Gtk.Entry ();
         sender.text = info.send ?? "";
-        add_label_entry (_("Sending Server:"), sender, true);
+        add_label_entry (_("Sen_ding Server:"), sender, true);
         content_area.show_all ();
         pack_end (content_area, true, true, 0);
     }
 
-    void add_label_entry (string text, Gtk.Widget editable, bool advanced=false) {
+    void add_label_entry (string text, Gtk.Widget widget, bool advanced=false) {
+        var editable = (widget is Gtk.Bin) ? (widget as Gtk.Bin).get_child () : widget;
         var hbox = new Gtk.HBox (false, 0);
         if (advanced)
             advanced_area.pack_start (hbox, false, false, 0);
         else
             content_area.pack_start (hbox, false, false, 4);
         var label = new Gtk.Label.with_mnemonic (text);
+        label.set_mnemonic_widget (editable);
         sizegroup.add_widget (label);
         hbox.pack_start (label, false, false, 4);
         if (editable is Gtk.Entry) {
@@ -106,7 +108,7 @@ public class Postler.AccountWidget : Gtk.VBox {
             hbox.set_orientation (Gtk.Orientation.VERTICAL);
             label.xalign = 0.0f;
         }
-        hbox.pack_start (editable, false, false, 4);
+        hbox.pack_start (widget, false, false, 4);
     }
 
     public void apply () {



More information about the Xfce4-commits mailing list