[network-manager-vpnc/NM_0_8] ui: fix compilation with -DGSEAL_ENABLE



commit 78118f3be1dc1f1b58e7a8e4b4ecf1d6ea9ac68a
Author: Dan Williams <dcbw redhat com>
Date:   Mon Aug 2 15:48:40 2010 -0700

    ui: fix compilation with -DGSEAL_ENABLE

 auth-dialog/gnome-two-password-dialog.c |   27 ++++++++++++++++++++-------
 configure.ac                            |    2 +-
 2 files changed, 21 insertions(+), 8 deletions(-)
---
diff --git a/auth-dialog/gnome-two-password-dialog.c b/auth-dialog/gnome-two-password-dialog.c
index 1b787eb..baa1dc7 100644
--- a/auth-dialog/gnome-two-password-dialog.c
+++ b/auth-dialog/gnome-two-password-dialog.c
@@ -109,10 +109,19 @@ dialog_show_callback (GtkWidget *widget, gpointer callback_data)
 {
 	VpnPasswordDialog *dialog = VPN_PASSWORD_DIALOG (callback_data);
 	VpnPasswordDialogPrivate *priv = VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
+	gboolean primary_visible = FALSE, secondary_visible = FALSE;
 
-	if (GTK_WIDGET_VISIBLE (priv->password_entry))
+#if GTK_CHECK_VERSION(2,30,0)
+	primary_visible = gtk_widget_get_visible (priv->password_entry);
+	secondary_visible = gtk_widget_get_visible (priv->password_entry_secondary);
+#else
+	primary_visible = GTK_WIDGET_VISIBLE (priv->password_entry);
+	secondary_visible = GTK_WIDGET_VISIBLE (priv->password_entry_secondary);
+#endif
+
+	if (primary_visible)
 		gtk_widget_grab_focus (priv->password_entry);
-	else if (GTK_WIDGET_VISIBLE (priv->password_entry_secondary))
+	else if (secondary_visible)
 		gtk_widget_grab_focus (priv->password_entry_secondary);
 }
 
@@ -191,6 +200,7 @@ vpn_password_dialog_new (const char *title,
 	GtkWidget *vbox;
 	GtkWidget *main_vbox;
 	GtkWidget *dialog_icon;
+	GtkBox *content, *action_area;
 
 	dialog = gtk_widget_new (VPN_TYPE_PASSWORD_DIALOG, NULL);
 	if (!dialog)
@@ -206,12 +216,15 @@ vpn_password_dialog_new (const char *title,
 	                        NULL);
 	gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
 
+	content = GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog)));
+	action_area = GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dialog)));
+
 	/* Setup the dialog */
 	gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
 	gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
-	gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2); /* 2 * 5 + 2 = 12 */
-	gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 5);
-	gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->action_area), 6);
+	gtk_box_set_spacing (content, 2); /* 2 * 5 + 2 = 12 */
+	gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
+	gtk_box_set_spacing (action_area, 6);
 
  	gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
 	gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
@@ -293,8 +306,8 @@ vpn_password_dialog_new (const char *title,
 	gtk_box_pack_start (GTK_BOX (main_vbox), vbox, FALSE, FALSE, 0);
 	gtk_box_pack_start (GTK_BOX (vbox), priv->table_alignment, FALSE, FALSE, 0);
 	gtk_box_pack_start (GTK_BOX (hbox), main_vbox, FALSE, FALSE, 0);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 0);
-	gtk_widget_show_all (GTK_DIALOG (dialog)->vbox);
+	gtk_box_pack_start (content, hbox, FALSE, FALSE, 0);
+	gtk_widget_show_all (GTK_WIDGET (content));
 
 	priv->remember_session_button = gtk_check_button_new_with_mnemonic (_("_Remember passwords for this session"));
 	priv->remember_forever_button = gtk_check_button_new_with_mnemonic (_("_Save passwords in keyring"));
diff --git a/configure.ac b/configure.ac
index 672fca9..5d0bc14 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,7 +66,7 @@ AC_SUBST(DBUS_CFLAGS)
 AC_SUBST(DBUS_LIBS)
 
 if test x"$with_gnome" != xno; then
-	PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6)
+	PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.14)
 	AC_SUBST(GTK_CFLAGS)
 	AC_SUBST(GTK_LIBS)
 



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