[network-manager-applet/bg/libnm-vpn-dialog-api: 2/2] libnma: vpn-password-dialog: introduce new generic API



commit ce646e78e82481b7195f3d74316d2381980e1f9f
Author: Beniamino Galvani <bgalvani redhat com>
Date:   Fri Oct 12 22:21:01 2018 +0200

    libnma: vpn-password-dialog: introduce new generic API
    
    The new API can handle a potentially arbitrary number of fields (now
    limited to 6), where each field can be either a password or a
    not. This will be used soon in nm-openvpn to ask the username in
    addition to existing passwords.

 src/libnma/libnma.ver                 |   8 ++
 src/libnma/nma-vpn-password-dialog.c  | 219 ++++++++++++++++------------------
 src/libnma/nma-vpn-password-dialog.h  |  25 ++++
 src/libnma/nma-vpn-password-dialog.ui | 145 +++++++++++++++++-----
 4 files changed, 250 insertions(+), 147 deletions(-)
---
diff --git a/src/libnma/libnma.ver b/src/libnma/libnma.ver
index 2f6a1b64..2b69cc99 100644
--- a/src/libnma/libnma.ver
+++ b/src/libnma/libnma.ver
@@ -99,3 +99,11 @@ global:
 libnma_1_8_12 {
        nma_mobile_wizard_get_type;
 } libnma_1_8_0;
+
+libnma_1_10_0 {
+       nma_vpn_password_dialog_field_focus;
+       nma_vpn_password_dialog_field_get_text;
+       nma_vpn_password_dialog_field_set_label;
+       nma_vpn_password_dialog_field_set_show;
+       nma_vpn_password_dialog_field_set_text;
+} libnma_1_8_12;
diff --git a/src/libnma/nma-vpn-password-dialog.c b/src/libnma/nma-vpn-password-dialog.c
index 7ff13e66..36db4f3c 100644
--- a/src/libnma/nma-vpn-password-dialog.c
+++ b/src/libnma/nma-vpn-password-dialog.c
@@ -29,12 +29,9 @@
 
 typedef struct {
        GtkWidget *message_label;
-       GtkWidget *password_label;
-       GtkWidget *password_label_secondary;
-       GtkWidget *password_label_tertiary;
-       GtkWidget *password_entry;
-       GtkWidget *password_entry_secondary;
-       GtkWidget *password_entry_tertiary;
+       GtkWidget *field_label[NMA_VPN_PASSWORD_DIALOG_NUM_FIELDS];
+       GtkWidget *field_entry[NMA_VPN_PASSWORD_DIALOG_NUM_FIELDS];
+       gboolean   is_password[NMA_VPN_PASSWORD_DIALOG_NUM_FIELDS];
        GtkWidget *show_passwords_checkbox;
 } NMAVpnPasswordDialogPrivate;
 
@@ -60,30 +57,41 @@ show_passwords_toggled_cb (GtkWidget *widget, gpointer user_data)
        NMAVpnPasswordDialog *dialog = NMA_VPN_PASSWORD_DIALOG (user_data);
        NMAVpnPasswordDialogPrivate *priv = NMA_VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
        gboolean visible;
+       guint i;
 
        visible = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
 
-       gtk_entry_set_visibility (GTK_ENTRY (priv->password_entry), visible);
-       gtk_entry_set_visibility (GTK_ENTRY (priv->password_entry_secondary), visible);
-       gtk_entry_set_visibility (GTK_ENTRY (priv->password_entry_tertiary), visible);
+       for (i = 0; i < NMA_VPN_PASSWORD_DIALOG_NUM_FIELDS; i++) {
+               if (priv->is_password[i])
+                       gtk_entry_set_visibility (GTK_ENTRY (priv->field_entry[i]), visible);
+       }
 }
 
 static void
 nma_vpn_password_dialog_class_init (NMAVpnPasswordDialogClass *klass)
 {
        GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+       char name[256];
+       guint i;
 
        g_type_ensure (NM_TYPE_DEVICE);
        gtk_widget_class_set_template_from_resource (widget_class,
                                                     
"/org/freedesktop/network-manager-applet/nma-vpn-password-dialog.ui");
 
        gtk_widget_class_bind_template_child_private (widget_class, NMAVpnPasswordDialog, message_label);
-       gtk_widget_class_bind_template_child_private (widget_class, NMAVpnPasswordDialog, password_label);
-       gtk_widget_class_bind_template_child_private (widget_class, NMAVpnPasswordDialog, 
password_label_secondary);
-       gtk_widget_class_bind_template_child_private (widget_class, NMAVpnPasswordDialog, 
password_label_tertiary);
-       gtk_widget_class_bind_template_child_private (widget_class, NMAVpnPasswordDialog, password_entry);
-       gtk_widget_class_bind_template_child_private (widget_class, NMAVpnPasswordDialog, 
password_entry_secondary);
-       gtk_widget_class_bind_template_child_private (widget_class, NMAVpnPasswordDialog, 
password_entry_tertiary);
+       for (i = 0; i < NMA_VPN_PASSWORD_DIALOG_NUM_FIELDS; i++) {
+               nm_sprintf_buf (name, "field_label_%u", i);
+               gtk_widget_class_bind_template_child_full (widget_class,
+                                                          name,
+                                                          FALSE,
+                                                          G_PRIVATE_OFFSET (NMAVpnPasswordDialog, 
field_label[i]));
+               nm_sprintf_buf (name, "field_entry_%u", i);
+               gtk_widget_class_bind_template_child_full (widget_class,
+                                                          name,
+                                                          FALSE,
+                                                          G_PRIVATE_OFFSET (NMAVpnPasswordDialog, 
field_entry[i]));
+       }
+
        gtk_widget_class_bind_template_child_private (widget_class, NMAVpnPasswordDialog, 
show_passwords_checkbox);
 
        gtk_widget_class_bind_template_callback (widget_class, dialog_close_callback);
@@ -104,13 +112,14 @@ dialog_show_callback (GtkWidget *widget, gpointer callback_data)
 {
        NMAVpnPasswordDialog *dialog = NMA_VPN_PASSWORD_DIALOG (callback_data);
        NMAVpnPasswordDialogPrivate *priv = NMA_VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
+       guint i;
 
-       if (gtk_widget_get_visible (priv->password_entry))
-               gtk_widget_grab_focus (priv->password_entry);
-       else if (gtk_widget_get_visible (priv->password_entry_secondary))
-               gtk_widget_grab_focus (priv->password_entry_secondary);
-       else if (gtk_widget_get_visible (priv->password_entry_tertiary))
-               gtk_widget_grab_focus (priv->password_entry_tertiary);
+       for (i = 0; i < NMA_VPN_PASSWORD_DIALOG_NUM_FIELDS; i++) {
+               if (gtk_widget_get_visible (priv->field_entry[i])) {
+                       gtk_widget_grab_focus (priv->field_entry[i]);
+                       break;
+               }
+       }
 }
 
 static void
@@ -158,192 +167,172 @@ nma_vpn_password_dialog_run_and_block (NMAVpnPasswordDialog *dialog)
 }
 
 void
-nma_vpn_password_dialog_set_password (NMAVpnPasswordDialog     *dialog,
-                                      const char *password)
+nma_vpn_password_dialog_field_set_show (NMAVpnPasswordDialog *dialog,
+                                        guint i,
+                                        gboolean show,
+                                        gboolean is_password)
 {
        NMAVpnPasswordDialogPrivate *priv;
 
        g_return_if_fail (NMA_VPN_IS_PASSWORD_DIALOG (dialog));
+       g_return_if_fail (i < NMA_VPN_PASSWORD_DIALOG_NUM_FIELDS);
 
        priv = NMA_VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
-       gtk_entry_set_text (GTK_ENTRY (priv->password_entry), password ? password : "");
+       priv->is_password[i] = is_password;
+       gtk_widget_set_visible (priv->field_label[i], show);
+       gtk_widget_set_visible (priv->field_entry[i], show);
+       gtk_entry_set_visibility (GTK_ENTRY (priv->field_entry[i]), !is_password);
 }
 
 void
-nma_vpn_password_dialog_set_password_secondary (NMAVpnPasswordDialog *dialog,
-                                                const char *password_secondary)
+nma_vpn_password_dialog_field_focus (NMAVpnPasswordDialog *dialog,
+                                     guint i)
 {
        NMAVpnPasswordDialogPrivate *priv;
 
        g_return_if_fail (NMA_VPN_IS_PASSWORD_DIALOG (dialog));
+       g_return_if_fail (i < NMA_VPN_PASSWORD_DIALOG_NUM_FIELDS);
 
        priv = NMA_VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
-       gtk_entry_set_text (GTK_ENTRY (priv->password_entry_secondary),
-                           password_secondary ? password_secondary : "");
+       if (gtk_widget_get_visible (priv->field_entry[i]))
+               gtk_widget_grab_focus (priv->field_entry[i]);
+
 }
 
 void
-nma_vpn_password_dialog_set_password_ternary (NMAVpnPasswordDialog *dialog,
-                                              const char *password_tertiary)
+nma_vpn_password_dialog_field_set_text (NMAVpnPasswordDialog *dialog,
+                                        guint i,
+                                        const char *text)
 {
        NMAVpnPasswordDialogPrivate *priv;
 
        g_return_if_fail (NMA_VPN_IS_PASSWORD_DIALOG (dialog));
+       g_return_if_fail (i < NMA_VPN_PASSWORD_DIALOG_NUM_FIELDS);
 
        priv = NMA_VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
-       gtk_entry_set_text (GTK_ENTRY (priv->password_entry_tertiary),
-                           password_tertiary ? password_tertiary : "");
+       gtk_entry_set_text (GTK_ENTRY (priv->field_entry[i]), text ?: "");
 }
 
 void
-nma_vpn_password_dialog_set_show_password (NMAVpnPasswordDialog *dialog, gboolean show)
+nma_vpn_password_dialog_field_set_label (NMAVpnPasswordDialog *dialog,
+                                         guint i,
+                                         const char *label)
 {
        NMAVpnPasswordDialogPrivate *priv;
 
-       g_return_if_fail (dialog != NULL);
        g_return_if_fail (NMA_VPN_IS_PASSWORD_DIALOG (dialog));
+       g_return_if_fail (i < NMA_VPN_PASSWORD_DIALOG_NUM_FIELDS);
 
        priv = NMA_VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
-       gtk_widget_set_visible (priv->password_label, show);
-       gtk_widget_set_visible (priv->password_entry, show);
+       gtk_label_set_text_with_mnemonic (GTK_LABEL (priv->field_label[i]), label);
+
 }
 
-void
-nma_vpn_password_dialog_set_show_password_secondary (NMAVpnPasswordDialog *dialog,
-                                                     gboolean show)
+const char *
+nma_vpn_password_dialog_field_get_text (NMAVpnPasswordDialog *dialog, guint i)
 {
        NMAVpnPasswordDialogPrivate *priv;
 
-       g_return_if_fail (dialog != NULL);
-       g_return_if_fail (NMA_VPN_IS_PASSWORD_DIALOG (dialog));
+       g_return_val_if_fail (NMA_VPN_IS_PASSWORD_DIALOG (dialog), NULL);
+       g_return_val_if_fail (i < NMA_VPN_PASSWORD_DIALOG_NUM_FIELDS, NULL);
 
        priv = NMA_VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
-       gtk_widget_set_visible (priv->password_label_secondary, show);
-       gtk_widget_set_visible (priv->password_entry_secondary, show);
+       return gtk_entry_get_text (GTK_ENTRY (priv->field_entry[i]));
 }
 
 void
-nma_vpn_password_dialog_set_show_password_ternary (NMAVpnPasswordDialog *dialog,
-                                                   gboolean show)
+nma_vpn_password_dialog_set_password (NMAVpnPasswordDialog     *dialog,
+                                      const char *password)
 {
-       NMAVpnPasswordDialogPrivate *priv;
 
-       g_return_if_fail (dialog != NULL);
-       g_return_if_fail (NMA_VPN_IS_PASSWORD_DIALOG (dialog));
+       nma_vpn_password_dialog_field_set_text (dialog, 0, password);
+}
 
-       priv = NMA_VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
-       gtk_widget_set_visible (priv->password_label_tertiary, show);
-       gtk_widget_set_visible (priv->password_entry_tertiary, show);
+void
+nma_vpn_password_dialog_set_password_secondary (NMAVpnPasswordDialog *dialog,
+                                                const char *password_secondary)
+{
+       nma_vpn_password_dialog_field_set_text (dialog, 1, password_secondary);
 }
 
 void
-nma_vpn_password_dialog_focus_password (NMAVpnPasswordDialog *dialog)
+nma_vpn_password_dialog_set_password_ternary (NMAVpnPasswordDialog *dialog,
+                                              const char *password_tertiary)
 {
-       NMAVpnPasswordDialogPrivate *priv;
+       nma_vpn_password_dialog_field_set_text (dialog, 2, password_tertiary);
+}
 
-       g_return_if_fail (dialog != NULL);
-       g_return_if_fail (NMA_VPN_IS_PASSWORD_DIALOG (dialog));
+void
+nma_vpn_password_dialog_set_show_password (NMAVpnPasswordDialog *dialog, gboolean show)
+{
+       nma_vpn_password_dialog_field_set_show (dialog, 0, show, TRUE);
+}
 
-       priv = NMA_VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
-       if (gtk_widget_get_visible (priv->password_entry))
-               gtk_widget_grab_focus (priv->password_entry);
+void
+nma_vpn_password_dialog_set_show_password_secondary (NMAVpnPasswordDialog *dialog,
+                                                     gboolean show)
+{
+       nma_vpn_password_dialog_field_set_show (dialog, 1, show, TRUE);
 }
 
 void
-nma_vpn_password_dialog_focus_password_secondary (NMAVpnPasswordDialog *dialog)
+nma_vpn_password_dialog_set_show_password_ternary (NMAVpnPasswordDialog *dialog,
+                                                   gboolean show)
 {
-       NMAVpnPasswordDialogPrivate *priv;
+       nma_vpn_password_dialog_field_set_show (dialog, 2, show, TRUE);
+}
 
-       g_return_if_fail (dialog != NULL);
-       g_return_if_fail (NMA_VPN_IS_PASSWORD_DIALOG (dialog));
+void
+nma_vpn_password_dialog_focus_password (NMAVpnPasswordDialog *dialog)
+{
+       nma_vpn_password_dialog_field_focus (dialog, 0);
+}
 
-       priv = NMA_VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
-       if (gtk_widget_get_visible (priv->password_entry_secondary))
-               gtk_widget_grab_focus (priv->password_entry_secondary);
+void
+nma_vpn_password_dialog_focus_password_secondary (NMAVpnPasswordDialog *dialog)
+{
+       nma_vpn_password_dialog_field_focus (dialog, 1);
 }
 
 void
 nma_vpn_password_dialog_focus_password_ternary (NMAVpnPasswordDialog *dialog)
 {
-       NMAVpnPasswordDialogPrivate *priv;
-
-       g_return_if_fail (dialog != NULL);
-       g_return_if_fail (NMA_VPN_IS_PASSWORD_DIALOG (dialog));
-
-       priv = NMA_VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
-       if (gtk_widget_get_visible (priv->password_entry_tertiary))
-               gtk_widget_grab_focus (priv->password_entry_tertiary);
+       nma_vpn_password_dialog_field_focus (dialog, 2);
 }
 
 const char *
 nma_vpn_password_dialog_get_password (NMAVpnPasswordDialog *dialog)
 {
-       NMAVpnPasswordDialogPrivate *priv;
-
-       g_return_val_if_fail (NMA_VPN_IS_PASSWORD_DIALOG (dialog), NULL);
-
-       priv = NMA_VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
-       return gtk_entry_get_text (GTK_ENTRY (priv->password_entry));
+       return nma_vpn_password_dialog_field_get_text (dialog, 0);
 }
 
 const char *
 nma_vpn_password_dialog_get_password_secondary (NMAVpnPasswordDialog *dialog)
 {
-       NMAVpnPasswordDialogPrivate *priv;
-
-       g_return_val_if_fail (NMA_VPN_IS_PASSWORD_DIALOG (dialog), NULL);
-
-       priv = NMA_VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
-       return gtk_entry_get_text (GTK_ENTRY (priv->password_entry_secondary));
+       return nma_vpn_password_dialog_field_get_text (dialog, 1);
 }
 
 const char *
 nma_vpn_password_dialog_get_password_ternary (NMAVpnPasswordDialog *dialog)
 {
-       NMAVpnPasswordDialogPrivate *priv;
-
-       g_return_val_if_fail (NMA_VPN_IS_PASSWORD_DIALOG (dialog), NULL);
-
-       priv = NMA_VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
-       return gtk_entry_get_text (GTK_ENTRY (priv->password_entry_tertiary));
+       return nma_vpn_password_dialog_field_get_text (dialog, 2);
 }
 
 void nma_vpn_password_dialog_set_password_label (NMAVpnPasswordDialog *dialog,
                                                  const char *label)
 {
-       NMAVpnPasswordDialogPrivate *priv;
-
-       g_return_if_fail (dialog != NULL);
-       g_return_if_fail (NMA_VPN_IS_PASSWORD_DIALOG (dialog));
-
-       priv = NMA_VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
-
-       gtk_label_set_text_with_mnemonic (GTK_LABEL (priv->password_label), label);
+       nma_vpn_password_dialog_field_set_label (dialog, 0, label);
 }
 
 void nma_vpn_password_dialog_set_password_secondary_label (NMAVpnPasswordDialog *dialog,
                                                            const char *label)
 {
-       NMAVpnPasswordDialogPrivate *priv;
-
-       g_return_if_fail (dialog != NULL);
-       g_return_if_fail (NMA_VPN_IS_PASSWORD_DIALOG (dialog));
-
-       priv = NMA_VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
-
-       gtk_label_set_text_with_mnemonic (GTK_LABEL (priv->password_label_secondary), label);
+       nma_vpn_password_dialog_field_set_label (dialog, 1, label);
 }
 
 void
 nma_vpn_password_dialog_set_password_ternary_label (NMAVpnPasswordDialog *dialog,
                                                     const char *label)
 {
-       NMAVpnPasswordDialogPrivate *priv;
-
-       g_return_if_fail (dialog != NULL);
-       g_return_if_fail (NMA_VPN_IS_PASSWORD_DIALOG (dialog));
-
-       priv = NMA_VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
-
-       gtk_label_set_text_with_mnemonic (GTK_LABEL (priv->password_label_tertiary), label);
+       nma_vpn_password_dialog_field_set_label (dialog, 2, label);
 }
diff --git a/src/libnma/nma-vpn-password-dialog.h b/src/libnma/nma-vpn-password-dialog.h
index 3f9a8fb6..f4fc7ceb 100644
--- a/src/libnma/nma-vpn-password-dialog.h
+++ b/src/libnma/nma-vpn-password-dialog.h
@@ -27,6 +27,8 @@
 
 #include <gtk/gtk.h>
 
+#include "nma-version.h"
+
 G_BEGIN_DECLS
 
 #define NMA_VPN_TYPE_PASSWORD_DIALOG            (nma_vpn_password_dialog_get_type ())
@@ -38,6 +40,8 @@ G_BEGIN_DECLS
 typedef struct NMAVpnPasswordDialog        NMAVpnPasswordDialog;
 typedef struct NMAVpnPasswordDialogClass   NMAVpnPasswordDialogClass;
 
+#define NMA_VPN_PASSWORD_DIALOG_NUM_FIELDS       6
+
 struct NMAVpnPasswordDialog {
        GtkDialog parent;
 };
@@ -85,6 +89,27 @@ const char *nma_vpn_password_dialog_get_password_secondary (NMAVpnPasswordDialog
 
 const char *nma_vpn_password_dialog_get_password_ternary (NMAVpnPasswordDialog *dialog);
 
+/* New API */
+NMA_AVAILABLE_IN_1_10
+void        nma_vpn_password_dialog_field_set_show  (NMAVpnPasswordDialog *dialog,
+                                                     guint                 i,
+                                                     gboolean              show,
+                                                     gboolean              is_password);
+NMA_AVAILABLE_IN_1_10
+void        nma_vpn_password_dialog_field_focus     (NMAVpnPasswordDialog *dialog,
+                                                     guint                 i);
+NMA_AVAILABLE_IN_1_10
+void        nma_vpn_password_dialog_field_set_text  (NMAVpnPasswordDialog *dialog,
+                                                     guint                 i,
+                                                     const char            *text);
+NMA_AVAILABLE_IN_1_10
+void        nma_vpn_password_dialog_field_set_label (NMAVpnPasswordDialog *dialog,
+                                                     guint                 i,
+                                                     const char           *label);
+NMA_AVAILABLE_IN_1_10
+const char *nma_vpn_password_dialog_field_get_text  (NMAVpnPasswordDialog *dialog,
+                                                     guint                 i);
+
 G_END_DECLS
 
 #endif /* NMA_VPN_PASSWORD_DIALOG_H */
diff --git a/src/libnma/nma-vpn-password-dialog.ui b/src/libnma/nma-vpn-password-dialog.ui
index bcbac83c..56a3eea4 100644
--- a/src/libnma/nma-vpn-password-dialog.ui
+++ b/src/libnma/nma-vpn-password-dialog.ui
@@ -85,7 +85,94 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="password_entry_tertiary">
+              <object class="GtkLabel" id="field_label_0">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="label" translatable="yes">_Password:</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">field_entry_0</property>
+                <property name="xalign">0</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="field_label_1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="label" translatable="yes">_Secondary Password:</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">field_entry_1</property>
+                <property name="xalign">0</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="field_label_2">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="label" translatable="yes">_Tertiary Password:</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">field_entry_2</property>
+                <property name="xalign">0</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">3</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="field_label_3">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="label" translatable="yes">Password #3:</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">field_entry_3</property>
+                <property name="xalign">0</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">4</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="field_label_4">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="label" translatable="yes">Password #4:</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">field_entry_4</property>
+                <property name="xalign">0</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">5</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="field_label_5">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="label" translatable="yes">Password #5:</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">field_entry_5</property>
+                <property name="xalign">0</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">6</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="field_entry_0">
+                <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="no_show_all">True</property>
                 <property name="visibility">False</property>
@@ -94,11 +181,11 @@
               </object>
               <packing>
                 <property name="left_attach">2</property>
-                <property name="top_attach">3</property>
+                <property name="top_attach">1</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="password_entry_secondary">
+              <object class="GtkEntry" id="field_entry_1">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="no_show_all">True</property>
@@ -112,8 +199,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="password_entry">
-                <property name="visible">True</property>
+              <object class="GtkEntry" id="field_entry_2">
                 <property name="can_focus">True</property>
                 <property name="no_show_all">True</property>
                 <property name="visibility">False</property>
@@ -122,51 +208,46 @@
               </object>
               <packing>
                 <property name="left_attach">2</property>
-                <property name="top_attach">1</property>
+                <property name="top_attach">3</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="password_label_tertiary">
-                <property name="can_focus">False</property>
+              <object class="GtkEntry" id="field_entry_3">
+                <property name="can_focus">True</property>
                 <property name="no_show_all">True</property>
-                <property name="label" translatable="yes">_Tertiary Password:</property>
-                <property name="use_underline">True</property>
-                <property name="mnemonic_widget">password_entry_tertiary</property>
-                <property name="xalign">0</property>
+                <property name="visibility">False</property>
+                <property name="width_chars">20</property>
+                <signal name="activate" handler="gtk_window_activate_default" swapped="yes"/>
               </object>
               <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">3</property>
+                <property name="left_attach">2</property>
+                <property name="top_attach">4</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="password_label_secondary">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
+              <object class="GtkEntry" id="field_entry_4">
+                <property name="can_focus">True</property>
                 <property name="no_show_all">True</property>
-                <property name="label" translatable="yes">_Secondary Password:</property>
-                <property name="use_underline">True</property>
-                <property name="mnemonic_widget">password_entry_secondary</property>
-                <property name="xalign">0</property>
+                <property name="visibility">False</property>
+                <property name="width_chars">20</property>
+                <signal name="activate" handler="gtk_window_activate_default" swapped="yes"/>
               </object>
               <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">2</property>
+                <property name="left_attach">2</property>
+                <property name="top_attach">5</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="password_label">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
+              <object class="GtkEntry" id="field_entry_5">
+                <property name="can_focus">True</property>
                 <property name="no_show_all">True</property>
-                <property name="label" translatable="yes">_Password:</property>
-                <property name="use_underline">True</property>
-                <property name="mnemonic_widget">password_entry</property>
-                <property name="xalign">0</property>
+                <property name="visibility">False</property>
+                <property name="width_chars">20</property>
+                <signal name="activate" handler="gtk_window_activate_default" swapped="yes"/>
               </object>
               <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">1</property>
+                <property name="left_attach">2</property>
+                <property name="top_attach">6</property>
               </packing>
             </child>
             <child>


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