[geary/wip/720779-password-dialog: 1/2] Fix plural problem, remove "IMAP Password" label if unneeded



commit 571162eb2e289aa2895f909bf953acf1d730e2e5
Author: William Jon McCann <william jon mccann gmail com>
Date:   Mon Jan 6 17:43:38 2014 -0800

    Fix plural problem, remove "IMAP Password" label if unneeded

 src/client/dialogs/password-dialog.vala |   12 +++++++++---
 ui/password-dialog.glade                |   12 ++++++------
 2 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/src/client/dialogs/password-dialog.vala b/src/client/dialogs/password-dialog.vala
index caf13d1..95014e7 100644
--- a/src/client/dialogs/password-dialog.vala
+++ b/src/client/dialogs/password-dialog.vala
@@ -23,6 +23,7 @@ public class PasswordDialog {
     private Gtk.Button ok_button;
     private Gtk.Grid grid_imap;
     private Gtk.Grid grid_smtp;
+    private Gtk.Label label_imap;
     private Geary.CredentialsMediator.ServiceFlag password_flags;
     
     public string imap_password { get; private set; default = ""; }
@@ -49,6 +50,7 @@ public class PasswordDialog {
         Gtk.Label label_service = (Gtk.Label) builder.get_object("label: service");
         
         grid_imap = (Gtk.Grid) builder.get_object("grid: imap");
+        label_imap = (Gtk.Label) builder.get_object("label: imap");
         Gtk.Label label_imap_username = (Gtk.Label) builder.get_object("label: imap username");
         Gtk.Label label_imap_server = (Gtk.Label) builder.get_object("label: imap server");
         Gtk.Label label_imap_port = (Gtk.Label) builder.get_object("label: imap port");
@@ -132,14 +134,18 @@ public class PasswordDialog {
         dialog.show();
         dialog.get_action_area().show_all();
         
+        if (password_flags.has_smtp()) {
+            grid_smtp.show();
+        }
+        
         if (!password_flags.has_imap()) {
             grid_imap.hide();
             entry_smtp_password.grab_focus();
         }
         
-        if (!password_flags.has_smtp()) {
-            grid_smtp.hide();
-            entry_imap_password.grab_focus();
+        if (password_flags.has_smtp() && password_flags.has_imap()) {
+            check_remember_password.label = _("_Remember passwords");
+            label_imap.show();
         }
         
         Gtk.ResponseType response = (Gtk.ResponseType) dialog.run();
diff --git a/ui/password-dialog.glade b/ui/password-dialog.glade
index ae9b734..9963473 100644
--- a/ui/password-dialog.glade
+++ b/ui/password-dialog.glade
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.0 on Thu Dec 19 16:59:34 2013 -->
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
   <object class="GtkDialog" id="PasswordDialog">
@@ -24,9 +25,9 @@
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="yalign">0</property>
-                <property name="use_fallback">True</property>
                 <property name="icon_name">dialog-password-symbolic</property>
-                <property name="icon-size">6</property>
+                <property name="use_fallback">True</property>
+                <property name="icon_size">6</property>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -116,7 +117,6 @@
                         <property name="visibility">False</property>
                         <property name="invisible_char">•</property>
                         <property name="activates_default">True</property>
-                        <property name="invisible_char_set">True</property>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
@@ -127,8 +127,8 @@
                     </child>
                     <child>
                       <object class="GtkLabel" id="label: imap">
-                        <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="no_show_all">True</property>
                         <property name="xalign">0</property>
                         <property name="label" translatable="yes">IMAP Credentials</property>
                         <attributes>
@@ -151,8 +151,8 @@
                 </child>
                 <child>
                   <object class="GtkGrid" id="grid: smtp">
-                    <property name="visible">True</property>
                     <property name="can_focus">False</property>
+                    <property name="no_show_all">True</property>
                     <property name="row_spacing">6</property>
                     <property name="column_spacing">12</property>
                     <child>
@@ -558,7 +558,7 @@
                 </child>
                 <child>
                   <object class="GtkCheckButton" id="check: remember_password">
-                    <property name="label" translatable="yes">_Remember passwords</property>
+                    <property name="label" translatable="yes">_Remember password</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">False</property>


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