diff --git a/ChangeLog b/ChangeLog index 21f32c5870..28641f51bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-05-28 Dan Williams + + Patch from Christian Persch + * configure.in + gnome/vpn-properties/nm-vpn-properties.c + - (main): Fix option parsing. Gnome.org #336847 + 2006-05-28 Dan Williams * gnome/vpn-properties/nm-vpn-properties.c diff --git a/configure.in b/configure.in index a3da0a4f99..02de6d2252 100644 --- a/configure.in +++ b/configure.in @@ -215,6 +215,11 @@ if test x"$with_gnome" != xno; then PKG_CHECK_MODULES(LIBGNOMEUI, libgnomeui-2.0) AC_SUBST(LIBGNOMEUI_CFLAGS) # is this even needed? it was typed incorrectly before AC_SUBST(LIBGNOMEUI_LIBS) + + PKG_CHECK_EXISTS([libgnome-2.0 >= 2.14.0],[have_libgnome_2_14=yes],[have_libgnome_2_14=no]) + if test "$have_libgnome_2_14" = "yes"; then + AC_DEFINE([HAVE_LIBGNOME_2_14],[1],[Define if we have libgnome 2.14]) + fi fi GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0` diff --git a/gnome/vpn-properties/nm-vpn-properties.c b/gnome/vpn-properties/nm-vpn-properties.c index 0a66501080..270b498325 100644 --- a/gnome/vpn-properties/nm-vpn-properties.c +++ b/gnome/vpn-properties/nm-vpn-properties.c @@ -39,7 +39,7 @@ #include #include #include -#include +#include #define NM_VPN_API_SUBJECT_TO_CHANGE #include "nm-vpn-ui-interface.h" @@ -1082,13 +1082,12 @@ main (int argc, char *argv[]) int ret; gboolean bad_opts; gboolean do_import; - GError *error = NULL; gchar *import_svc = NULL; gchar *import_file = NULL; GOptionEntry entries[] = { - { "import-service", 's', 0, G_OPTION_ARG_STRING, &import_svc, "VPN Service for importing", NULL}, - { "import-file", 'f', 0, G_OPTION_ARG_STRING, &import_file, "File to import", NULL}, - { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL } + { "import-service", 's', 0, G_OPTION_ARG_STRING, &import_svc, "VPN Service for importing", NULL}, + { "import-file", 'f', 0, G_OPTION_ARG_FILENAME, &import_file, "File to import", NULL}, + { NULL } }; bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); @@ -1097,8 +1096,19 @@ main (int argc, char *argv[]) context = g_option_context_new ("- NetworkManager VPN properties"); g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE); + +#ifdef HAVE_LIBGNOME_2_14 + gnome_program_init ("nm-vpn-properties", VERSION, LIBGNOMEUI_MODULE, argc, argv, + GNOME_PARAM_GOPTION_CONTEXT, context, + GNOME_PARAM_NONE); +#else g_option_context_add_group (context, gtk_get_option_group (TRUE)); g_option_context_parse (context, &argc, &argv, &error); + g_option_context_free (context); + + gnome_program_init ("nm-vpn-properties", VERSION, LIBGNOMEUI_MODULE, argc, argv, + GNOME_PARAM_NONE, GNOME_PARAM_NONE); +#endif bad_opts = FALSE; do_import = FALSE; @@ -1116,11 +1126,6 @@ main (int argc, char *argv[]) goto out; } - gnome_program_init ("nm-vpn-properties", VERSION, LIBGNOMEUI_MODULE, argc, argv, - GNOME_PARAM_NONE, GNOME_PARAM_NONE); - - glade_gnome_init (); - if (init_app () == FALSE) { ret = EXIT_FAILURE; goto out;