[network-manager-openconnect] Bug 643411 - Port to GTK+3
- From: David Woodhouse <dwmw2 src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openconnect] Bug 643411 - Port to GTK+3
- Date: Tue, 26 Apr 2011 21:40:42 +0000 (UTC)
commit 8148ec6ec4dfdf5bbfba55622fee87cc3d0932fc
Author: David Woodhouse <David Woodhouse intel com>
Date: Tue Apr 26 22:40:06 2011 +0100
Bug 643411 - Port to GTK+3
auth-dialog/main.c | 18 +++++++++---------
configure.ac | 11 ++++++++++-
2 files changed, 19 insertions(+), 10 deletions(-)
---
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index 2545735..0157de3 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -314,11 +314,11 @@ static gboolean ui_add_select (ui_fragment_data *data)
text = gtk_label_new(data->opt->label);
gtk_box_pack_start(GTK_BOX(hbox), text, FALSE, FALSE, 0);
- combo = gtk_combo_box_new_text();
+ combo = gtk_combo_box_text_new();
gtk_box_pack_end(GTK_BOX(hbox), combo, FALSE, FALSE, 0);
for (i = 0; i < sopt->nr_choices; i++) {
- gtk_combo_box_append_text(GTK_COMBO_BOX(combo), sopt->choices[i].label);
- if (data->entry_text &&
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), sopt->choices[i].label);
+ if (data->entry_text &&
!strcmp(data->entry_text, sopt->choices[i].name)) {
gtk_combo_box_set_active(GTK_COMBO_BOX(combo), i);
g_free(data->entry_text);
@@ -652,7 +652,7 @@ static gboolean user_validate_cert(cert_data *data)
g_free(msg);
scroll = gtk_scrolled_window_new(NULL, NULL);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)->vbox), scroll, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX (gtk_dialog_get_content_area(GTK_DIALOG (dlg))), scroll, TRUE, TRUE, 0);
gtk_widget_show(scroll);
text = gtk_text_view_new();
@@ -914,14 +914,14 @@ static void populate_vpnhost_combo(auth_ui_data *ui_data)
{
struct vpnhost *host;
int i = 0;
- GtkComboBox *combo = GTK_COMBO_BOX(ui_data->combo);
+ GtkComboBoxText *combo = GTK_COMBO_BOX_TEXT (ui_data->combo);
for (host = vpnhosts; host; host = host->next) {
- gtk_combo_box_append_text(combo, host->hostname);
+ gtk_combo_box_text_append_text(combo, host->hostname);
if (i == 0 ||
(lasthost && !strcmp(host->hostname, lasthost)))
- gtk_combo_box_set_active(combo, i);
+ gtk_combo_box_set_active(GTK_COMBO_BOX (combo), i);
i++;
}
@@ -1201,7 +1201,7 @@ static void build_main_dialog(auth_ui_data *ui_data)
g_free(title);
vbox = gtk_vbox_new(FALSE, 8);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(ui_data->dialog)->vbox), vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX (gtk_dialog_get_content_area(GTK_DIALOG (ui_data->dialog))), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 8);
gtk_widget_show(vbox);
@@ -1213,7 +1213,7 @@ static void build_main_dialog(auth_ui_data *ui_data)
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
gtk_widget_show(label);
- ui_data->combo = gtk_combo_box_new_text();
+ ui_data->combo = gtk_combo_box_text_new();
populate_vpnhost_combo(ui_data);
gtk_box_pack_start(GTK_BOX(hbox), ui_data->combo, TRUE, TRUE, 0);
g_signal_connect_swapped(ui_data->combo, "changed",
diff --git a/configure.ac b/configure.ac
index 88c3947..807b8a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,7 +71,16 @@ if test x"$with_authdlg" != xno; then
fi
if test x"$with_gnome" != xno; then
- PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6)
+ AC_ARG_WITH([gtkver], AS_HELP_STRING([--with-gtkver], [The major version of GTK+ to build with]),
+ with_gtkver="$withval",with_gtkver=3)
+ case "${with_gtkver}" in
+ 2) PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.24)
+ gtkver=2
+ ;;
+ *) PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 2.91.4)
+ gtkver=3
+ ;;
+ esac
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]