2007-01-06  Lucas Rocha <lucasr.at.mundo@gmail.com>

	Fixes #336286

	* gnome-keyboard-properties.c (main): switched from popt to GOptionContext.

svn path=/trunk/; revision=7056
This commit is contained in:
Lucas Rocha 2007-01-06 18:53:08 +00:00 committed by Rodrigo Moya
parent 64a73e5288
commit 9767345608
2 changed files with 17 additions and 7 deletions

View file

@ -1,3 +1,9 @@
2007-01-06 Lucas Rocha <lucasr.at.mundo@gmail.com>
Fixes #336286
* gnome-keyboard-properties.c (main): switched from popt to GOptionContext.
2006-09-15 Rodrigo Moya <rodrigo@novell.com> 2006-09-15 Rodrigo Moya <rodrigo@novell.com>
Fixes #356074 Fixes #356074

View file

@ -211,29 +211,33 @@ main (int argc, char **argv)
GConfClient *client; GConfClient *client;
GConfChangeSet *changeset; GConfChangeSet *changeset;
GladeXML *dialog; GladeXML *dialog;
GOptionContext *context;
static gboolean apply_only = FALSE; static gboolean apply_only = FALSE;
static gboolean get_legacy = FALSE; static gboolean get_legacy = FALSE;
static gboolean switch_to_typing_break_page = FALSE; static gboolean switch_to_typing_break_page = FALSE;
static struct poptOption cap_options[] = { static GOptionEntry cap_options[] = {
{ "apply", '\0', POPT_ARG_NONE, &apply_only, 0, { "apply", 0, 0, G_OPTION_ARG_NONE, &apply_only,
N_("Just apply settings and quit (compatibility only; now handled by daemon)"), NULL }, N_("Just apply settings and quit (compatibility only; now handled by daemon)"), NULL },
{ "init-session-settings", '\0', POPT_ARG_NONE, &apply_only, 0, { "init-session-settings", 0, 0, G_OPTION_ARG_NONE, &apply_only,
N_("Just apply settings and quit (compatibility only; now handled by daemon)"), NULL }, N_("Just apply settings and quit (compatibility only; now handled by daemon)"), NULL },
{ "get-legacy", '\0', POPT_ARG_NONE, &get_legacy, 0, { "get-legacy", 0, 0, G_OPTION_ARG_NONE, &get_legacy,
N_("Retrieve and store legacy settings"), NULL }, N_("Retrieve and store legacy settings"), NULL },
{ "typing-break", '\0', POPT_ARG_NONE, &switch_to_typing_break_page, 0, { "typing-break", 0, 0, G_OPTION_ARG_NONE, &switch_to_typing_break_page,
N_("Start the page with the typing break settings showing"), NULL }, N_("Start the page with the typing break settings showing"), NULL },
{ NULL, '\0', 0, NULL, 0, NULL, NULL } { NULL }
}; };
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE); textdomain (GETTEXT_PACKAGE);
context = g_option_context_new (_("- GNOME Keyboard Preferencies"));
g_option_context_add_main_entries (context, cap_options, GETTEXT_PACKAGE);
gnome_program_init ("gnome-keyboard-properties", VERSION, LIBGNOMEUI_MODULE, argc, argv, gnome_program_init ("gnome-keyboard-properties", VERSION, LIBGNOMEUI_MODULE, argc, argv,
GNOME_PARAM_POPT_TABLE, cap_options, GNOME_PARAM_GOPTION_CONTEXT, context,
GNOME_PARAM_APP_DATADIR, GNOMECC_DATA_DIR, GNOME_PARAM_APP_DATADIR, GNOMECC_DATA_DIR,
NULL); NULL);