[network-manager-openconnect] ui: migrate to GtkBuilder (bgo #641272)
- From: Jiří Klimeš <jklimes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openconnect] ui: migrate to GtkBuilder (bgo #641272)
- Date: Mon, 7 Feb 2011 09:42:00 +0000 (UTC)
commit 8568de76bc0db0dd192539e8e186b27836209662
Author: JiÅ?à KlimeÅ¡ <jklimes redhat com>
Date: Mon Feb 7 10:39:15 2011 +0100
ui: migrate to GtkBuilder (bgo #641272)
configure.ac | 4 -
po/POTFILES.in | 2 +-
properties/Makefile.am | 14 +-
properties/auth-helpers.c | 27 +-
properties/auth-helpers.h | 10 +-
properties/nm-openconnect-dialog.glade | 604 --------------------------------
properties/nm-openconnect-dialog.ui | 555 +++++++++++++++++++++++++++++
properties/nm-openconnect.c | 61 ++--
8 files changed, 614 insertions(+), 663 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 697d335..a535c5f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,10 +66,6 @@ if test x"$with_gnome" != xno; then
AC_SUBST(GDK_PIXBUF_CFLAGS)
AC_SUBST(GDK_PIXBUF_LIBS)
- PKG_CHECK_MODULES(GLADE, libglade-2.0)
- AC_SUBST(GLADE_CFLAGS)
- AC_SUBST(GLADE_LIBS)
-
PKG_CHECK_MODULES(GCONF, gconf-2.0)
AC_SUBST(GCONF_CFLAGS)
AC_SUBST(GCONF_LIBS)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 9751d36..535139e 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -2,7 +2,7 @@
# Please keep this file sorted alphabetically.
properties/auth-helpers.c
properties/nm-openconnect.c
-properties/nm-openconnect-dialog.glade
+properties/nm-openconnect-dialog.ui
src/nm-openconnect-service.c
diff --git a/properties/Makefile.am b/properties/Makefile.am
index 159f7d2..c3dea82 100644
--- a/properties/Makefile.am
+++ b/properties/Makefile.am
@@ -7,16 +7,15 @@ libnm_openconnect_properties_la_SOURCES = \
nm-openconnect.c \
nm-openconnect.h
-gladedir = $(datadir)/gnome-vpn-properties/openconnect
-glade_DATA = nm-openconnect-dialog.glade
+uidir = $(datadir)/gnome-vpn-properties/openconnect
+ui_DATA = nm-openconnect-dialog.ui
-libnm_openconnect_properties_la_CFLAGS = \
- $(GLADE_CFLAGS) \
+libnm_openconnect_properties_la_CFLAGS = \
$(GTK_CFLAGS) \
$(GCONF_CFLAGS) \
$(NETWORKMANAGER_CFLAGS) \
-DICONDIR=\""$(datadir)/pixmaps"\" \
- -DGLADEDIR=\""$(gladedir)"\" \
+ -DUIDIR=\""$(uidir)"\" \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DGNOME_DISABLE_DEPRECATED \
@@ -24,7 +23,6 @@ libnm_openconnect_properties_la_CFLAGS = \
-DVERSION=\"$(VERSION)\"
libnm_openconnect_properties_la_LIBADD = \
- $(GLADE_LIBS) \
$(GTK_LIBS) \
$(GCONF_LIBS) \
$(NETWORKMANAGER_LIBS)
@@ -32,7 +30,7 @@ libnm_openconnect_properties_la_LIBADD = \
libnm_openconnect_properties_la_LDFLAGS = \
-avoid-version
-CLEANFILES = *.bak *.gladep *~
+CLEANFILES = *.bak *~
EXTRA_DIST = \
- $(glade_DATA)
+ $(ui_DATA)
diff --git a/properties/auth-helpers.c b/properties/auth-helpers.c
index b7a8be2..905c1fe 100644
--- a/properties/auth-helpers.c
+++ b/properties/auth-helpers.c
@@ -2,6 +2,7 @@
/***************************************************************************
*
* Copyright (C) 2008 Dan Williams, <dcbw redhat com>
+ * Copyright (C) 2008 - 2011 Red Hat, Inc.
* Copyright (C) 2008 Tambet Ingo, <tambet gmail com>
*
* This program is free software; you can redistribute it and/or modify
@@ -39,7 +40,7 @@
#include "../src/nm-openconnect-service.h"
void
-tls_pw_init_auth_widget (GladeXML *xml,
+tls_pw_init_auth_widget (GtkBuilder *builder,
GtkSizeGroup *group,
NMSettingVPN *s_vpn,
ChangedCallback changed_cb,
@@ -49,11 +50,11 @@ tls_pw_init_auth_widget (GladeXML *xml,
const char *value;
GtkFileFilter *filter;
- g_return_if_fail (xml != NULL);
+ g_return_if_fail (builder != NULL);
g_return_if_fail (group != NULL);
g_return_if_fail (changed_cb != NULL);
- widget = glade_xml_get_widget (xml, "ca_cert_chooser");
+ widget = GTK_WIDGET (gtk_builder_get_object (builder, "ca_cert_chooser"));
gtk_size_group_add_widget (group, widget);
filter = tls_file_chooser_filter_new ();
@@ -69,7 +70,7 @@ tls_pw_init_auth_widget (GladeXML *xml,
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), value);
}
- widget = glade_xml_get_widget (xml, "cert_user_cert_chooser");
+ widget = GTK_WIDGET (gtk_builder_get_object (builder, "cert_user_cert_chooser"));
gtk_size_group_add_widget (group, widget);
filter = tls_file_chooser_filter_new ();
@@ -85,7 +86,7 @@ tls_pw_init_auth_widget (GladeXML *xml,
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), value);
}
- widget = glade_xml_get_widget (xml, "cert_private_key_chooser");
+ widget = GTK_WIDGET (gtk_builder_get_object (builder, "cert_private_key_chooser"));
gtk_size_group_add_widget (group, widget);
filter = tls_file_chooser_filter_new ();
@@ -103,13 +104,13 @@ tls_pw_init_auth_widget (GladeXML *xml,
}
gboolean
-auth_widget_check_validity (GladeXML *xml, GError **error)
+auth_widget_check_validity (GtkBuilder *builder, GError **error)
{
return TRUE;
}
static void
-update_from_filechooser (GladeXML *xml,
+update_from_filechooser (GtkBuilder *builder,
const char *key,
const char *widget_name,
NMSettingVPN *s_vpn)
@@ -118,12 +119,12 @@ update_from_filechooser (GladeXML *xml,
char *filename;
char *authtype;
- g_return_if_fail (xml != NULL);
+ g_return_if_fail (builder != NULL);
g_return_if_fail (key != NULL);
g_return_if_fail (widget_name != NULL);
g_return_if_fail (s_vpn != NULL);
- widget = glade_xml_get_widget (xml, widget_name);
+ widget = GTK_WIDGET (gtk_builder_get_object (builder, widget_name));
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
if (filename && strlen(filename)) {
@@ -140,13 +141,13 @@ update_from_filechooser (GladeXML *xml,
}
gboolean
-auth_widget_update_connection (GladeXML *xml,
+auth_widget_update_connection (GtkBuilder *builder,
const char *contype,
NMSettingVPN *s_vpn)
{
- update_from_filechooser (xml, NM_OPENCONNECT_KEY_CACERT, "ca_cert_chooser", s_vpn);
- update_from_filechooser (xml, NM_OPENCONNECT_KEY_USERCERT, "cert_user_cert_chooser", s_vpn);
- update_from_filechooser (xml, NM_OPENCONNECT_KEY_PRIVKEY, "cert_private_key_chooser", s_vpn);
+ update_from_filechooser (builder, NM_OPENCONNECT_KEY_CACERT, "ca_cert_chooser", s_vpn);
+ update_from_filechooser (builder, NM_OPENCONNECT_KEY_USERCERT, "cert_user_cert_chooser", s_vpn);
+ update_from_filechooser (builder, NM_OPENCONNECT_KEY_PRIVKEY, "cert_private_key_chooser", s_vpn);
return TRUE;
}
diff --git a/properties/auth-helpers.h b/properties/auth-helpers.h
index 79e86f9..c2efe5e 100644
--- a/properties/auth-helpers.h
+++ b/properties/auth-helpers.h
@@ -2,6 +2,7 @@
/***************************************************************************
*
* Copyright (C) 2008 Dan Williams, <dcbw redhat com>
+ * Copyright (C) 2008 - 2011 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,28 +26,27 @@
#include <glib.h>
#include <gtk/gtk.h>
#include <gtk/gtkfilefilter.h>
-#include <glade/glade.h>
#include <nm-connection.h>
#include <nm-setting-vpn.h>
typedef void (*ChangedCallback) (GtkWidget *widget, gpointer user_data);
-void tls_pw_init_auth_widget (GladeXML *xml,
+void tls_pw_init_auth_widget (GtkBuilder *builder,
GtkSizeGroup *group,
NMSettingVPN *s_vpn,
ChangedCallback changed_cb,
gpointer user_data);
-void sk_init_auth_widget (GladeXML *xml,
+void sk_init_auth_widget (GtkBuilder *builder,
GtkSizeGroup *group,
NMSettingVPN *s_vpn,
ChangedCallback changed_cb,
gpointer user_data);
-gboolean auth_widget_check_validity (GladeXML *xml, GError **error);
+gboolean auth_widget_check_validity (GtkBuilder *builder, GError **error);
-gboolean auth_widget_update_connection (GladeXML *xml,
+gboolean auth_widget_update_connection (GtkBuilder *builder,
const char *contype,
NMSettingVPN *s_vpn);
diff --git a/properties/nm-openconnect-dialog.ui b/properties/nm-openconnect-dialog.ui
new file mode 100644
index 0000000..fce77ba
--- /dev/null
+++ b/properties/nm-openconnect-dialog.ui
@@ -0,0 +1,555 @@
+<?xml version="1.0"?>
+<!--*- mode: xml -*-->
+<interface>
+ <!-- interface-requires gtk+ 2.6 -->
+ <!-- interface-naming-policy toplevel-contextual -->
+ <object class="GtkVBox" id="openconnect-vbox">
+ <property name="border_width">12</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">16</property>
+ <child>
+ <object class="GtkVBox" id="vbox8">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label22">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>General</b></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment8">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">1</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">0</property>
+ <child>
+ <object class="GtkTable" id="table2">
+ <property name="visible">True</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">2</property>
+ <property name="homogeneous">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
+ <child>
+ <object class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+ <child>
+ <object class="GtkEntry" id="gateway_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes"/>
+ <property name="has_frame">True</property>
+ <property name="invisible_char">•</property>
+ <property name="activates_default">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment11">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+ <child>
+ <object class="GtkEntry" id="proxy_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes"/>
+ <property name="has_frame">True</property>
+ <property name="invisible_char">•</property>
+ <property name="activates_default">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment12">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+ <child>
+ <object class="GtkFileChooserButton" id="ca_cert_chooser">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Select A File</property>
+ <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
+ <property name="local_only">True</property>
+ <property name="show_hidden">True</property>
+ <property name="do_overwrite_confirmation">False</property>
+ <property name="width_chars">-1</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label23">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Gateway:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">gateway_entry</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label28">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Proxy:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">proxy_entry</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label27">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_CA Certificate:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="csd_button">
+ <property name="border_width">2</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Allow Cisco Secure Desktop _trojan</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment14">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">1</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">0</property>
+ <child>
+ <object class="GtkTable" id="table3">
+ <property name="visible">True</property>
+ <property name="n_rows">1</property>
+ <property name="n_columns">2</property>
+ <property name="homogeneous">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
+ <child>
+ <object class="GtkAlignment" id="alignment15">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+ <child>
+ <object class="GtkEntry" id="csd_wrapper_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes"/>
+ <property name="has_frame">True</property>
+ <property name="invisible_char">•</property>
+ <property name="activates_default">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label29">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">CSD _Wrapper Script:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">csd_wrapper_entry</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox11">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label25">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Certificate Authentication</b></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment13">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">1</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">0</property>
+ <child>
+ <object class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="homogeneous">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
+ <child>
+ <object class="GtkAlignment" id="alignment5">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+ <child>
+ <object class="GtkFileChooserButton" id="cert_user_cert_chooser">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Select A File</property>
+ <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
+ <property name="local_only">True</property>
+ <property name="show_hidden">False</property>
+ <property name="do_overwrite_confirmation">False</property>
+ <property name="width_chars">-1</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_User Certificate:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">cert_user_cert_chooser</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment6">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0.019999999553</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+ <child>
+ <object class="GtkFileChooserButton" id="cert_private_key_chooser">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Select A File</property>
+ <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
+ <property name="local_only">True</property>
+ <property name="show_hidden">False</property>
+ <property name="do_overwrite_confirmation">False</property>
+ <property name="width_chars">-1</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Private _Key:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">cert_private_key_chooser</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="fsid_button">
+ <property name="border_width">2</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Use _FSID for key passphrase</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/properties/nm-openconnect.c b/properties/nm-openconnect.c
index 8b5b1bb..8b6a696 100644
--- a/properties/nm-openconnect.c
+++ b/properties/nm-openconnect.c
@@ -6,6 +6,7 @@
*
* Copyright (C) 2005 David Zeuthen, <davidz redhat com>
* Copyright (C) 2005 - 2008 Dan Williams, <dcbw redhat com>
+ * Copyright (C) 2005 - 2011 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -34,7 +35,6 @@
#include <glib/gi18n-lib.h>
#include <string.h>
#include <gtk/gtk.h>
-#include <glade/glade.h>
#define NM_VPN_API_SUBJECT_TO_CHANGE
@@ -71,7 +71,7 @@ G_DEFINE_TYPE_EXTENDED (OpenconnectPluginUiWidget, openconnect_plugin_ui_widget,
#define OPENCONNECT_PLUGIN_UI_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), OPENCONNECT_TYPE_PLUGIN_UI_WIDGET, OpenconnectPluginUiWidgetPrivate))
typedef struct {
- GladeXML *xml;
+ GtkBuilder *builder;
GtkWidget *widget;
GtkSizeGroup *group;
GtkWindowGroup *window_group;
@@ -305,7 +305,7 @@ check_validity (OpenconnectPluginUiWidget *self, GError **error)
GtkWidget *widget;
const char *str;
- widget = glade_xml_get_widget (priv->xml, "gateway_entry");
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "gateway_entry"));
str = gtk_entry_get_text (GTK_ENTRY (widget));
if (!str || !strlen (str)) {
g_set_error (error,
@@ -316,7 +316,7 @@ check_validity (OpenconnectPluginUiWidget *self, GError **error)
}
- widget = glade_xml_get_widget (priv->xml, "proxy_entry");
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "proxy_entry"));
str = gtk_entry_get_text (GTK_ENTRY (widget));
if (str && str[0] &&
strncmp(str, "socks://", 8) && strncmp(str, "http://", 7)) {
@@ -327,7 +327,7 @@ check_validity (OpenconnectPluginUiWidget *self, GError **error)
return FALSE;
}
- if (!auth_widget_check_validity (priv->xml, error))
+ if (!auth_widget_check_validity (priv->builder, error))
return FALSE;
return TRUE;
@@ -351,7 +351,7 @@ init_plugin_ui (OpenconnectPluginUiWidget *self, NMConnection *connection, GErro
priv->group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- widget = glade_xml_get_widget (priv->xml, "gateway_entry");
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "gateway_entry"));
if (!widget)
return FALSE;
gtk_size_group_add_widget (priv->group, widget);
@@ -362,7 +362,7 @@ init_plugin_ui (OpenconnectPluginUiWidget *self, NMConnection *connection, GErro
}
g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (stuff_changed_cb), self);
- widget = glade_xml_get_widget (priv->xml, "proxy_entry");
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "proxy_entry"));
if (!widget)
return FALSE;
gtk_size_group_add_widget (priv->group, widget);
@@ -373,7 +373,7 @@ init_plugin_ui (OpenconnectPluginUiWidget *self, NMConnection *connection, GErro
}
g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (stuff_changed_cb), self);
- widget = glade_xml_get_widget (priv->xml, "fsid_button");
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "fsid_button"));
if (!widget)
return FALSE;
if (s_vpn) {
@@ -383,7 +383,7 @@ init_plugin_ui (OpenconnectPluginUiWidget *self, NMConnection *connection, GErro
}
g_signal_connect (G_OBJECT (widget), "toggled", G_CALLBACK (stuff_changed_cb), self);
- widget = glade_xml_get_widget (priv->xml, "csd_button");
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "csd_button"));
if (!widget)
return FALSE;
if (s_vpn) {
@@ -393,7 +393,7 @@ init_plugin_ui (OpenconnectPluginUiWidget *self, NMConnection *connection, GErro
}
g_signal_connect (G_OBJECT (widget), "toggled", G_CALLBACK (stuff_changed_cb), self);
- widget = glade_xml_get_widget (priv->xml, "csd_wrapper_entry");
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "csd_wrapper_entry"));
if (!widget)
return FALSE;
if (s_vpn) {
@@ -403,8 +403,7 @@ init_plugin_ui (OpenconnectPluginUiWidget *self, NMConnection *connection, GErro
}
g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (stuff_changed_cb), self);
- tls_pw_init_auth_widget (priv->xml, priv->group, s_vpn,
- stuff_changed_cb, self);
+ tls_pw_init_auth_widget (priv->builder, priv->group, s_vpn, stuff_changed_cb, self);
return TRUE;
}
@@ -436,30 +435,30 @@ update_connection (NMVpnPluginUiWidgetInterface *iface,
s_vpn = NM_SETTING_VPN (nm_setting_vpn_new ());
g_object_set (s_vpn, NM_SETTING_VPN_SERVICE_TYPE, NM_DBUS_SERVICE_OPENCONNECT, NULL);
- widget = glade_xml_get_widget (priv->xml, "gateway_entry");
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "gateway_entry"));
str = (char *) gtk_entry_get_text (GTK_ENTRY (widget));
if (str && strlen (str))
nm_setting_vpn_add_data_item (s_vpn, NM_OPENCONNECT_KEY_GATEWAY, str);
- widget = glade_xml_get_widget (priv->xml, "proxy_entry");
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "proxy_entry"));
str = (char *) gtk_entry_get_text (GTK_ENTRY (widget));
if (str && strlen (str))
nm_setting_vpn_add_data_item (s_vpn, NM_OPENCONNECT_KEY_PROXY, str);
- widget = glade_xml_get_widget (priv->xml, "fsid_button");
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "fsid_button"));
str = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget))?"yes":"no";
nm_setting_vpn_add_data_item (s_vpn, NM_OPENCONNECT_KEY_PEM_PASSPHRASE_FSID, str);
- widget = glade_xml_get_widget (priv->xml, "csd_button");
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "csd_button"));
str = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget))?"yes":"no";
nm_setting_vpn_add_data_item (s_vpn, NM_OPENCONNECT_KEY_CSD_ENABLE, str);
- widget = glade_xml_get_widget (priv->xml, "csd_wrapper_entry");
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "csd_wrapper_entry"));
str = (char *) gtk_entry_get_text (GTK_ENTRY (widget));
if (str && strlen (str))
nm_setting_vpn_add_data_item (s_vpn, NM_OPENCONNECT_KEY_CSD_WRAPPER, str);
- auth_widget_update_connection (priv->xml, auth_type, s_vpn);
+ auth_widget_update_connection (priv->builder, auth_type, s_vpn);
nm_connection_add_setting (connection, NM_SETTING (s_vpn));
return TRUE;
@@ -479,7 +478,7 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
{
NMVpnPluginUiWidgetInterface *object;
OpenconnectPluginUiWidgetPrivate *priv;
- char *glade_file;
+ char *ui_file;
if (error)
g_return_val_if_fail (*error == NULL, NULL);
@@ -492,18 +491,24 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
priv = OPENCONNECT_PLUGIN_UI_WIDGET_GET_PRIVATE (object);
- glade_file = g_strdup_printf ("%s/%s", GLADEDIR, "nm-openconnect-dialog.glade");
- priv->xml = glade_xml_new (glade_file, "openconnect-vbox", GETTEXT_PACKAGE);
- if (priv->xml == NULL) {
+ ui_file = g_strdup_printf ("%s/%s", UIDIR, "nm-openconnect-dialog.ui");
+ priv->builder = gtk_builder_new ();
+
+ if (!gtk_builder_add_from_file (priv->builder, ui_file, error)) {
+ g_warning ("Couldn't load builder file: %s",
+ error && *error ? (*error)->message : "(unknown)");
+ g_clear_error (error);
g_set_error (error, OPENCONNECT_PLUGIN_UI_ERROR, 0,
- "could not load required resources at %s", glade_file);
- g_free (glade_file);
+ "could not load required resources at %s", ui_file);
+ g_free (ui_file);
g_object_unref (object);
return NULL;
}
- g_free (glade_file);
+ g_free (ui_file);
+
+ gtk_builder_set_translation_domain (priv->builder, GETTEXT_PACKAGE);
- priv->widget = glade_xml_get_widget (priv->xml, "openconnect-vbox");
+ priv->widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "openconnect-vbox"));
if (!priv->widget) {
g_set_error (error, OPENCONNECT_PLUGIN_UI_ERROR, 0, "could not load UI widget");
g_object_unref (object);
@@ -536,8 +541,8 @@ dispose (GObject *object)
if (priv->widget)
g_object_unref (priv->widget);
- if (priv->xml)
- g_object_unref (priv->xml);
+ if (priv->builder)
+ g_object_unref (priv->builder);
G_OBJECT_CLASS (openconnect_plugin_ui_widget_parent_class)->dispose (object);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]