[network-manager-vpnc] auth-dialog: port to libnm-gtk's NMAVpnPasswordDialog
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-vpnc] auth-dialog: port to libnm-gtk's NMAVpnPasswordDialog
- Date: Thu, 11 Apr 2013 18:58:32 +0000 (UTC)
commit bd49e2d8bf575fd012743ce99bd5365984aeff50
Author: Dan Winship <danw gnome org>
Date: Tue Feb 26 14:55:29 2013 +0100
auth-dialog: port to libnm-gtk's NMAVpnPasswordDialog
https://bugzilla.gnome.org/show_bug.cgi?id=697740
auth-dialog/Makefile.am | 6 +-
auth-dialog/main.c | 30 ++--
auth-dialog/vpn-password-dialog.c | 428 -------------------------------------
auth-dialog/vpn-password-dialog.h | 78 -------
configure.ac | 4 +
5 files changed, 22 insertions(+), 524 deletions(-)
---
diff --git a/auth-dialog/Makefile.am b/auth-dialog/Makefile.am
index 2a7cfee..2ea97fe 100644
--- a/auth-dialog/Makefile.am
+++ b/auth-dialog/Makefile.am
@@ -6,6 +6,7 @@ nm_vpnc_auth_dialog_CPPFLAGS = \
$(NM_CFLAGS) \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
+ $(NMGTK_CFLAGS) \
$(GNOMEKEYRING_CFLAGS) \
-DICONDIR=\""$(datadir)/pixmaps"\" \
-DBINDIR=\""$(bindir)"\" \
@@ -15,13 +16,12 @@ nm_vpnc_auth_dialog_CPPFLAGS = \
-DVERSION=\"$(VERSION)\"
nm_vpnc_auth_dialog_SOURCES = \
- main.c \
- vpn-password-dialog.c \
- vpn-password-dialog.h
+ main.c
nm_vpnc_auth_dialog_LDADD = \
$(GTK_LIBS) \
$(NM_LIBS) \
+ $(NMGTK_LIBS) \
$(GNOMEKEYRING_LIBS)
@INTLTOOL_DESKTOP_RULE@
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index 5c9428b..ad7ffb1 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -35,9 +35,9 @@
#include <nm-setting-vpn.h>
#include <nm-setting-connection.h>
#include <nm-vpn-plugin-utils.h>
+#include <nm-vpn-password-dialog.h>
#include "src/nm-vpnc-service.h"
-#include "vpn-password-dialog.h"
#define KEYRING_UUID_TAG "connection-uuid"
#define KEYRING_SN_TAG "setting-name"
@@ -114,7 +114,7 @@ get_secrets (const char *vpn_uuid,
char **out_gpw,
NMSettingSecretFlags gpw_flags)
{
- VpnPasswordDialog *dialog;
+ NMAVpnPasswordDialog *dialog;
char *upw = NULL, *gpw = NULL;
char *prompt;
gboolean success = FALSE;
@@ -207,45 +207,45 @@ get_secrets (const char *vpn_uuid,
return TRUE;
}
- dialog = VPN_PASSWORD_DIALOG (vpn_password_dialog_new (_("Authenticate VPN"), prompt, NULL));
+ dialog = NMA_VPN_PASSWORD_DIALOG (nma_vpn_password_dialog_new (_("Authenticate VPN"), prompt, NULL));
- vpn_password_dialog_set_password_secondary_label (dialog, _("_Group Password:"));
+ nma_vpn_password_dialog_set_password_secondary_label (dialog, _("_Group Password:"));
/* Don't show the user password entry if the user password isn't required,
* or if we don't need new secrets and the user password is saved.
*/
if (upw_flags & NM_SETTING_SECRET_FLAG_NOT_REQUIRED)
- vpn_password_dialog_set_show_password (dialog, FALSE);
+ nma_vpn_password_dialog_set_show_password (dialog, FALSE);
else if (!retry && upw && !(upw_flags & NM_SETTING_SECRET_FLAG_NOT_SAVED))
- vpn_password_dialog_set_show_password (dialog, FALSE);
+ nma_vpn_password_dialog_set_show_password (dialog, FALSE);
if (gpw_flags & NM_SETTING_SECRET_FLAG_NOT_REQUIRED)
- vpn_password_dialog_set_show_password_secondary (dialog, FALSE);
+ nma_vpn_password_dialog_set_show_password_secondary (dialog, FALSE);
else if (!retry && gpw && !(gpw_flags & NM_SETTING_SECRET_FLAG_NOT_SAVED))
- vpn_password_dialog_set_show_password_secondary (dialog, FALSE);
+ nma_vpn_password_dialog_set_show_password_secondary (dialog, FALSE);
/* On reprompt the first entry of type 'ask' gets the focus */
if (retry) {
if (upw_flags & NM_SETTING_SECRET_FLAG_NOT_SAVED)
- vpn_password_dialog_focus_password (dialog);
+ nma_vpn_password_dialog_focus_password (dialog);
else if (gpw_flags & NM_SETTING_SECRET_FLAG_NOT_SAVED)
- vpn_password_dialog_focus_password_secondary (dialog);
+ nma_vpn_password_dialog_focus_password_secondary (dialog);
}
/* if retrying, pre-fill dialog with the password */
if (upw)
- vpn_password_dialog_set_password (dialog, upw);
+ nma_vpn_password_dialog_set_password (dialog, upw);
if (gpw)
- vpn_password_dialog_set_password_secondary (dialog, gpw);
+ nma_vpn_password_dialog_set_password_secondary (dialog, gpw);
gtk_widget_show (GTK_WIDGET (dialog));
/* Show the dialog */
- success = vpn_password_dialog_run_and_block (dialog);
+ success = nma_vpn_password_dialog_run_and_block (dialog);
if (success) {
- *out_upw = gnome_keyring_memory_strdup (vpn_password_dialog_get_password (dialog));
- *out_gpw = gnome_keyring_memory_strdup (vpn_password_dialog_get_password_secondary (dialog));
+ *out_upw = gnome_keyring_memory_strdup (nma_vpn_password_dialog_get_password (dialog));
+ *out_gpw = gnome_keyring_memory_strdup (nma_vpn_password_dialog_get_password_secondary
(dialog));
}
gtk_widget_hide (GTK_WIDGET (dialog));
diff --git a/configure.ac b/configure.ac
index 1a24232..583b819 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,6 +72,10 @@ if test x"$with_gnome" != xno; then
AC_SUBST(GTK_LIBS)
GTK_CFLAGS="$GTK_CFLAGS -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_4"
+ PKG_CHECK_MODULES(NMGTK, libnm-gtk >= 0.9.9.0)
+ AC_SUBST(NMGTK_CFLAGS)
+ AC_SUBST(NMGTK_LIBS)
+
PKG_CHECK_MODULES(GNOMEKEYRING, gnome-keyring-1)
AC_SUBST(GNOMEKEYRING_CFLAGS)
AC_SUBST(GNOMEKEYRING_LIBS)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]