[geary/wip/720779-password-dialog: 2/2] Remove Details section from password dialog



commit 7f7ac0bf69e20c01a5e0a0f8c7a4f8703de6cf2e
Author: William Jon McCann <william jon mccann gmail com>
Date:   Mon Jan 6 17:47:47 2014 -0800

    Remove Details section from password dialog

 src/client/dialogs/password-dialog.vala |   40 ----
 ui/password-dialog.glade                |  321 +------------------------------
 2 files changed, 2 insertions(+), 359 deletions(-)
---
diff --git a/src/client/dialogs/password-dialog.vala b/src/client/dialogs/password-dialog.vala
index 95014e7..ba04cca 100644
--- a/src/client/dialogs/password-dialog.vala
+++ b/src/client/dialogs/password-dialog.vala
@@ -45,57 +45,26 @@ public class PasswordDialog {
         entry_smtp_password = (Gtk.Entry) builder.get_object("entry: smtp password");
         check_remember_password = (Gtk.CheckButton) builder.get_object("check: remember_password");
         
-        // Load non-editable widgets
-        Gtk.Label label_real_name = (Gtk.Label) builder.get_object("label: real_name");
-        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");
-        Gtk.Label label_imap_encryption = (Gtk.Label) builder.get_object("label: imap encryption");
         
         grid_smtp = (Gtk.Grid) builder.get_object("grid: smtp");
         Gtk.Label label_smtp_username = (Gtk.Label) builder.get_object("label: smtp username");
-        Gtk.Label label_smtp_server = (Gtk.Label) builder.get_object("label: smtp server");
-        Gtk.Label label_smtp_port = (Gtk.Label) builder.get_object("label: smtp port");
-        Gtk.Label label_smtp_encryption = (Gtk.Label) builder.get_object("label: smtp encryption");
         
         // Load translated text for labels with markup unsupported by glade.
         Gtk.Label primary_text_label = (Gtk.Label) builder.get_object("primary_text_label");
         primary_text_label.set_markup(get_primary_text_markup(first_try));
 
-        // Find server configuration information
-        Geary.Endpoint imap_endpoint;
-        Geary.Endpoint smtp_endpoint;
-        imap_endpoint = account_information.get_imap_endpoint();
-        smtp_endpoint = account_information.get_smtp_endpoint();
-
-        string imap_server_host = imap_endpoint.host_specifier;
-        uint16 imap_server_port = imap_endpoint.default_port;
-        string smtp_server_host = smtp_endpoint.host_specifier;
-        uint16 smtp_server_port = smtp_endpoint.default_port;
-        
         // Load initial values
-        label_real_name.set_text(account_information.real_name ?? "");
-        label_service.set_text(account_information.service_provider.display_name() ?? "");
-        
         label_imap_username.set_text(account_information.imap_credentials.user ?? "");
         entry_imap_password.set_text(account_information.imap_credentials.pass ?? "");
-        label_imap_server.set_text(imap_server_host);
-        label_imap_port.set_text(imap_server_port.to_string());
-        label_imap_encryption.set_text(get_security_status(imap_endpoint.flags));
         
         if (account_information.smtp_credentials != null) {
             label_smtp_username.set_text(account_information.smtp_credentials.user ?? "");
             entry_smtp_password.set_text(account_information.smtp_credentials.pass ?? "");
         }
         
-        label_smtp_server.set_text(smtp_server_host);
-        label_smtp_port.set_text(smtp_server_port.to_string());
-        label_smtp_encryption.set_text(get_security_status(smtp_endpoint.flags));
-        
         check_remember_password.active = account_information.imap_remember_password;
         
         // Add action buttons
@@ -121,15 +90,6 @@ public class PasswordDialog {
             !Geary.String.is_empty_or_whitespace(entry_smtp_password.get_text());
     }
     
-    private string get_security_status(Geary.Endpoint.Flags flags) {
-        if (flags.is_all_set(Geary.Endpoint.Flags.SSL))
-            return _("SSL");
-        else if (flags.is_all_set(Geary.Endpoint.Flags.STARTTLS))
-            return _("STARTTLS");
-        
-        return _("None");
-    }
-    
     public bool run() {
         dialog.show();
         dialog.get_action_area().show_all();
diff --git a/ui/password-dialog.glade b/ui/password-dialog.glade
index 9963473..0dc6d03 100644
--- a/ui/password-dialog.glade
+++ b/ui/password-dialog.glade
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.0 on Thu Dec 19 16:59:34 2013 -->
+<!-- Generated with glade 3.16.0 on Thu Dec 19 17:05:59 2013 -->
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
   <object class="GtkDialog" id="PasswordDialog">
@@ -240,323 +240,6 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkExpander" id="expander1">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <object class="GtkGrid" id="grid2">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="row_spacing">6</property>
-                        <property name="column_spacing">12</property>
-                        <child>
-                          <object class="GtkLabel" id="label for: service">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                            <property name="xpad">12</property>
-                            <property name="label" translatable="yes">Service:</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">1</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label for: real_name">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                            <property name="xpad">13</property>
-                            <property name="label" translatable="yes">Real name:</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">2</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label: service">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="top_attach">1</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label: real_name">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="top_attach">2</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label: general">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                            <property name="ypad">6</property>
-                            <property name="label" translatable="yes">General</property>
-                            <attributes>
-                              <attribute name="weight" value="bold"/>
-                            </attributes>
-                          </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">0</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label: imap settings">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="margin_top">6</property>
-                            <property name="xalign">0</property>
-                            <property name="ypad">6</property>
-                            <property name="label" translatable="yes">IMAP settings</property>
-                            <attributes>
-                              <attribute name="weight" value="bold"/>
-                            </attributes>
-                          </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">3</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label for: imap server">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                            <property name="xpad">12</property>
-                            <property name="label" translatable="yes">Server:</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">4</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label for: imap port">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                            <property name="xpad">12</property>
-                            <property name="label" translatable="yes">Port:</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">5</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label for: imap encryption">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                            <property name="xpad">12</property>
-                            <property name="label" translatable="yes">SSL/TLS encryption:</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">6</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label: imap server">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="top_attach">4</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label: imap port">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="top_attach">5</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label: imap encryption">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="top_attach">6</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label: smtp settings">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="margin_top">6</property>
-                            <property name="xalign">0</property>
-                            <property name="ypad">6</property>
-                            <property name="label" translatable="yes">SMTP settings</property>
-                            <attributes>
-                              <attribute name="weight" value="bold"/>
-                            </attributes>
-                          </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">7</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label for: smtp server">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                            <property name="xpad">12</property>
-                            <property name="label" translatable="yes">Server:</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">8</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label for: smtp port">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                            <property name="xpad">12</property>
-                            <property name="label" translatable="yes">Port:</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">9</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label for: smtp encryption">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                            <property name="xpad">12</property>
-                            <property name="label" translatable="yes">SSL/TLS encryption:</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">10</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label: smtp server">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="top_attach">8</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label: smtp port">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="top_attach">9</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label: smtp encryption">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="top_attach">10</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <placeholder/>
-                        </child>
-                        <child>
-                          <placeholder/>
-                        </child>
-                        <child>
-                          <placeholder/>
-                        </child>
-                      </object>
-                    </child>
-                    <child type="label">
-                      <object class="GtkLabel" id="label: details">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">_Details</property>
-                        <property name="use_underline">True</property>
-                      </object>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">3</property>
-                  </packing>
-                </child>
-                <child>
                   <object class="GtkCheckButton" id="check: remember_password">
                     <property name="label" translatable="yes">_Remember password</property>
                     <property name="visible">True</property>
@@ -570,7 +253,7 @@
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">True</property>
-                    <property name="position">4</property>
+                    <property name="position">3</property>
                   </packing>
                 </child>
               </object>


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