Use capplet_init()

Fri Oct 24 18:28:54 2008  Søren Sandmann  <sandmann@redhat.com>

	* sound-properties-capplet.c (main): Use capplet_init()

Fri Oct 24 18:29:14 2008  Søren Sandmann  <sandmann@redhat.com>

	* capplet-util.c: Call g_option_context_set_translation_domain on
	the context.


svn path=/trunk/; revision=9106
This commit is contained in:
Søren Sandmann 2008-10-24 22:29:43 +00:00 committed by Søren Sandmann Pedersen
parent 2f8de6c511
commit 06a74d0ef1
5 changed files with 18 additions and 23 deletions

View file

@ -1,3 +1,8 @@
Fri Oct 24 18:29:14 2008 Søren Sandmann <sandmann@redhat.com>
* capplet-util.c: Call g_option_context_set_translation_domain on
the context.
Fri Oct 24 18:22:06 2008 Søren Sandmann <sandmann@redhat.com> Fri Oct 24 18:22:06 2008 Søren Sandmann <sandmann@redhat.com>
* capplet-util.[ch]: Add new capplet_init() function * capplet-util.[ch]: Add new capplet_init() function

View file

@ -192,6 +192,10 @@ capplet_init (GOptionContext *context,
textdomain (GETTEXT_PACKAGE); textdomain (GETTEXT_PACKAGE);
#endif #endif
#if GLIB_CHECK_VERSION (2, 12, 0)
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
#endif
if (context) { if (context) {
g_option_context_add_group (context, gtk_get_option_group (TRUE)); g_option_context_add_group (context, gtk_get_option_group (TRUE));

View file

@ -431,8 +431,8 @@ main (int argc, char **argv)
GladeXML *dialog; GladeXML *dialog;
GtkWidget *dialog_win, *w; GtkWidget *dialog_win, *w;
gchar *start_page = NULL; gchar *start_page = NULL;
GError *err = NULL;
GOptionContext *context;
GOptionEntry cap_options[] = { GOptionEntry cap_options[] = {
{"show-page", 'p', G_OPTION_FLAG_IN_MAIN, {"show-page", 'p', G_OPTION_FLAG_IN_MAIN,
G_OPTION_ARG_STRING, G_OPTION_ARG_STRING,
@ -443,15 +443,9 @@ main (int argc, char **argv)
{NULL} {NULL}
}; };
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); context = g_option_context_new (_("- GNOME Mouse Preferences"));
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); g_option_context_add_main_entries (context, cap_options, GETTEXT_PACKAGE);
textdomain (GETTEXT_PACKAGE); capplet_init (context, &argc, &argv);
if (!gtk_init_with_args (&argc, &argv, _("- GNOME Mouse Preferences"), cap_options, GETTEXT_PACKAGE, &err)) {
g_printerr ("%s\n", err->message);
return 1;
}
capplet_init_stock_icons (); capplet_init_stock_icons ();

View file

@ -1,3 +1,7 @@
Fri Oct 24 18:28:54 2008 Søren Sandmann <sandmann@redhat.com>
* sound-properties-capplet.c (main): Use capplet_init()
2008-10-10 Bastien Nocera <hadess@hadess.net> 2008-10-10 Bastien Nocera <hadess@hadess.net>
* Makefile.am: * Makefile.am:

View file

@ -1175,7 +1175,6 @@ main (int argc, char **argv)
{ {
GConfChangeSet *changeset; GConfChangeSet *changeset;
GladeXML *dialog; GladeXML *dialog;
GnomeProgram *program;
GOptionContext *context; GOptionContext *context;
gboolean apply_only = FALSE; gboolean apply_only = FALSE;
gboolean get_legacy = FALSE; gboolean get_legacy = FALSE;
@ -1189,26 +1188,16 @@ main (int argc, char **argv)
{ NULL } { NULL }
}; };
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
/* Since gstreamer and gnome-vfs require threads, we /* Since gstreamer and gnome-vfs require threads, we
* have to initialise threads here as the first call to glib. * have to initialise threads here as the first call to glib.
*/ */
g_thread_init (NULL); g_thread_init (NULL);
context = g_option_context_new (N_("- GNOME Sound Preferences")); context = g_option_context_new (N_("- GNOME Sound Preferences"));
#if GLIB_CHECK_VERSION (2, 12, 0)
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
#endif
g_option_context_add_main_entries (context, cap_options, GETTEXT_PACKAGE); g_option_context_add_main_entries (context, cap_options, GETTEXT_PACKAGE);
g_option_context_add_group (context, gst_init_get_option_group ()); g_option_context_add_group (context, gst_init_get_option_group ());
program = gnome_program_init ("gnome-sound-properties", VERSION, capplet_init (context, &argc, &argv);
LIBGNOMEUI_MODULE, argc, argv,
GNOME_PARAM_GOPTION_CONTEXT, context,
NULL);
activate_settings_daemon (); activate_settings_daemon ();
@ -1239,7 +1228,6 @@ main (int argc, char **argv)
} }
g_object_unref (gconf_client); g_object_unref (gconf_client);
g_object_unref (program);
return 0; return 0;
} }