aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.co.uk>2009-08-28 06:13:03 +0800
committerOlivier CrĂȘte <olivier.crete@collabora.co.uk>2009-09-02 05:14:42 +0800
commit43ce322dd93f7294affa1847c6f311f7be176d67 (patch)
tree15911cef023501ea31c18287139d68cbf14af38a
parent6288040da442c9e7cc7c2f1b8bfab13515a3d4a1 (diff)
downloadgsoc2013-empathy-43ce322dd93f7294affa1847c6f311f7be176d67.tar
gsoc2013-empathy-43ce322dd93f7294affa1847c6f311f7be176d67.tar.gz
gsoc2013-empathy-43ce322dd93f7294affa1847c6f311f7be176d67.tar.bz2
gsoc2013-empathy-43ce322dd93f7294affa1847c6f311f7be176d67.tar.lz
gsoc2013-empathy-43ce322dd93f7294affa1847c6f311f7be176d67.tar.xz
gsoc2013-empathy-43ce322dd93f7294affa1847c6f311f7be176d67.tar.zst
gsoc2013-empathy-43ce322dd93f7294affa1847c6f311f7be176d67.zip
Use GOptionContext to parse options
Use GOptionContext directly to the help for gst options is also displayed.
-rw-r--r--src/empathy.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/empathy.c b/src/empathy.c
index 84bdfdd9c..5be52082f 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -651,6 +651,7 @@ main (int argc, char *argv[])
TpDBusDaemon *dbus_daemon;
UniqueApp *unique_app;
+ GOptionContext *optcontext;
GOptionEntry options[] = {
{ "no-connect", 'n',
0, G_OPTION_ARG_NONE, &no_connect,
@@ -674,19 +675,24 @@ main (int argc, char *argv[])
g_thread_init (NULL);
empathy_init ();
- if (!gtk_init_with_args (&argc, &argv, N_("- Empathy IM Client"),
- options, GETTEXT_PACKAGE, &error))
- {
- g_warning ("Error in empathy init: %s", error->message);
- return EXIT_FAILURE;
- }
+ optcontext = g_option_context_new (N_("- Empathy IM Client"));
+ g_option_context_add_group (optcontext, gst_init_get_option_group ());
+ g_option_context_add_group (optcontext, gtk_get_option_group (TRUE));
+ g_option_context_add_main_entries (optcontext, options, GETTEXT_PACKAGE);
+
+ if (!g_option_context_parse (optcontext, &argc, &argv, &error)) {
+ g_print ("%s\nRun '%s --help' to see a full list of available command line options.\n",
+ error->message, argv[0]);
+ g_warning ("Error in empathy init: %s", error->message);
+ return EXIT_FAILURE;
+ }
+
+ g_option_context_free (optcontext);
empathy_gtk_init ();
g_set_application_name (_(PACKAGE_NAME));
g_setenv ("PULSE_PROP_media.role", "phone", TRUE);
- gst_init (&argc, &argv);
-
#if HAVE_LIBCHAMPLAIN
gtk_clutter_init (&argc, &argv);
#endif