[gnome-control-center] Use GOption in the shell
- From: Vincent Untz <vuntz src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-control-center] Use GOption in the shell
- Date: Sat, 8 Aug 2009 13:57:09 +0000 (UTC)
commit 525d09fc83ada600cc1822a2401598c1f9bb9c49
Author: Vincent Untz <vuntz gnome org>
Date: Sat Aug 8 14:57:37 2009 +0200
Use GOption in the shell
shell/control-center.c | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/shell/control-center.c b/shell/control-center.c
index 6ce9ece..517f1fa 100644
--- a/shell/control-center.c
+++ b/shell/control-center.c
@@ -107,6 +107,11 @@ main (int argc, char *argv[])
gboolean hidden = FALSE;
AppShellData *app_data;
GSList *actions;
+ GError *error;
+ GOptionEntry options[] = {
+ { "hide", 0, 0, G_OPTION_ARG_NONE, &hidden, N_("Hide on start (useful to preload the shell)"), NULL },
+ { NULL }
+ };
#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
@@ -114,20 +119,14 @@ main (int argc, char *argv[])
textdomain (GETTEXT_PACKAGE);
#endif
- if (argc > 1)
- {
- if (argc != 2 || strcmp ("-h", argv[1]))
- {
- printf ("Usage - gnome-control-center [-h]\n");
- printf ("Options: -h : hide on start\n");
- printf ("\tUseful if you want to autostart the control-center singleton so it can get all its slow loading done\n");
- exit (1);
- }
- hidden = TRUE;
+ error = NULL;
+ if (!gtk_init_with_args (&argc, &argv,
+ NULL, options, GETTEXT_PACKAGE, &error)) {
+ g_printerr ("%s", error->message);
+ g_error_free (error);
+ return 1;
}
- gtk_init (&argc, &argv);
-
app_data = appshelldata_new ("gnomecc.menu", NULL, CONTROL_CENTER_PREFIX,
GTK_ICON_SIZE_DND, FALSE, TRUE);
generate_categories (app_data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]