[network-manager-iodine] Port to libnm-gtk



commit 47e0c6a709b3b0f196211e1d1ad7d84baee7940e
Author: Guido Günther <agx sigxcpu org>
Date:   Sun Oct 12 12:53:57 2014 +0200

    Port to libnm-gtk
    
    so we don't have to maintain the password dialog code anymore

 auth-dialog/Makefile.am           |    4 +-
 auth-dialog/main.c                |   17 +-
 auth-dialog/vpn-password-dialog.c |  360 -------------------------------------
 auth-dialog/vpn-password-dialog.h |   79 --------
 configure.ac                      |    4 +
 po/POTFILES.in                    |    1 -
 6 files changed, 14 insertions(+), 451 deletions(-)
---
diff --git a/auth-dialog/Makefile.am b/auth-dialog/Makefile.am
index 97046af..2f26959 100644
--- a/auth-dialog/Makefile.am
+++ b/auth-dialog/Makefile.am
@@ -7,6 +7,7 @@ nm_iodine_auth_dialog_CPPFLAGS = \
        $(GTHREAD_CFLAGS) \
        $(GTK_CFLAGS) \
         $(LIBSECRET_CFLAGS) \
+        $(NMGTK_CFLAGS) \
        -DICONDIR=\""$(datadir)/pixmaps"\" \
        -DBINDIR=\""$(bindir)"\" \
        -DG_DISABLE_DEPRECATED \
@@ -17,13 +18,12 @@ nm_iodine_auth_dialog_CPPFLAGS = \
 
 nm_iodine_auth_dialog_SOURCES = \
        main.c \
-       vpn-password-dialog.c \
-       vpn-password-dialog.h \
        $(NULL)
 
 nm_iodine_auth_dialog_LDADD = \
        $(GTK_LIBS) \
        $(NM_LIBS) \
+       $(NMGTK_LIBS) \
         $(LIBSECRET_LIBS)
 
 CLEANFILES = *~
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index 4321c64..f482cf0 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -36,11 +36,10 @@
 
 #include <nm-setting-vpn.h>
 #include <nm-vpn-plugin-utils.h>
+#include <nm-vpn-password-dialog.h>
 
 #include "src/nm-iodine-service.h"
 
-#include "vpn-password-dialog.h"
-
 #define KEYRING_UUID_TAG "connection-uuid"
 #define KEYRING_SN_TAG "setting-name"
 #define KEYRING_SK_TAG "setting-key"
@@ -132,7 +131,7 @@ get_secrets (const char *vpn_uuid,
              char **out_pw,
              NMSettingSecretFlags pw_flags)
 {
-       VpnPasswordDialog *dialog;
+       NMAVpnPasswordDialog *dialog;
        char *prompt, *pw = NULL;
        const char *new_password = NULL;
        gboolean success = FALSE;
@@ -202,18 +201,18 @@ get_secrets (const char *vpn_uuid,
        /* Otherwise, we have no saved password, or the password flags indicated
         * that the password should never be saved.
         */
-       dialog = (VpnPasswordDialog *) \
-               vpn_password_dialog_new (_("Authenticate VPN"), prompt, NULL);
-
+       dialog = NMA_VPN_PASSWORD_DIALOG (
+                   nma_vpn_password_dialog_new (_("Authenticate VPN"), prompt, NULL));
+       nma_vpn_password_dialog_set_show_password_secondary (dialog, FALSE);
        /* pre-fill dialog with the password */
        if (pw && !(pw_flags & NM_SETTING_SECRET_FLAG_NOT_SAVED))
-               vpn_password_dialog_set_password (dialog, pw);
+               nma_vpn_password_dialog_set_password (dialog, pw);
 
        gtk_widget_show (GTK_WIDGET (dialog));
 
-       if (vpn_password_dialog_run_and_block (dialog)) {
+       if (nma_vpn_password_dialog_run_and_block (dialog)) {
 
-               new_password = vpn_password_dialog_get_password (dialog);
+               new_password = nma_vpn_password_dialog_get_password (dialog);
                if (new_password) {
                        *out_pw = g_strdup (new_password);
                        success = TRUE;
diff --git a/configure.ac b/configure.ac
index 86470a2..ffe536d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,6 +80,10 @@ PKG_CHECK_MODULES(NM,
 AC_SUBST(NM_CFLAGS)
 AC_SUBST(NM_LIBS)
 
+PKG_CHECK_MODULES(NMGTK, libnm-gtk >= 0.9.9.0)
+AC_SUBST(NMGTK_CFLAGS)
+AC_SUBST(NMGTK_LIBS)
+
 NM_COMPILER_WARNINGS
 
 AC_CONFIG_FILES([
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 2aad63d..9b5980e 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,7 +1,6 @@
 # List of source files containing translatable strings.
 # Please keep this file sorted alphabetically.
 auth-dialog/main.c
-auth-dialog/vpn-password-dialog.c
 properties/nm-iodine.c
 [type: gettext/glade]properties/nm-iodine-dialog.ui
 src/nm-iodine-service.c


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