gnome-control-center r9106 - in trunk/capplets: common mouse sound



Author: ssp
Date: Fri Oct 24 22:29:43 2008
New Revision: 9106
URL: http://svn.gnome.org/viewvc/gnome-control-center?rev=9106&view=rev

Log:
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.



Modified:
   trunk/capplets/common/ChangeLog
   trunk/capplets/common/capplet-util.c
   trunk/capplets/mouse/gnome-mouse-properties.c
   trunk/capplets/sound/ChangeLog
   trunk/capplets/sound/sound-properties-capplet.c

Modified: trunk/capplets/common/capplet-util.c
==============================================================================
--- trunk/capplets/common/capplet-util.c	(original)
+++ trunk/capplets/common/capplet-util.c	Fri Oct 24 22:29:43 2008
@@ -192,6 +192,10 @@
 	textdomain (GETTEXT_PACKAGE);
 #endif
 	
+#if GLIB_CHECK_VERSION (2, 12, 0)
+        g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
+#endif
+	
 	if (context) {
 		g_option_context_add_group (context, gtk_get_option_group (TRUE));
 		

Modified: trunk/capplets/mouse/gnome-mouse-properties.c
==============================================================================
--- trunk/capplets/mouse/gnome-mouse-properties.c	(original)
+++ trunk/capplets/mouse/gnome-mouse-properties.c	Fri Oct 24 22:29:43 2008
@@ -431,8 +431,8 @@
 	GladeXML       *dialog;
 	GtkWidget      *dialog_win, *w;
 	gchar *start_page = NULL;
-	GError *err = NULL;
 
+	GOptionContext *context;
 	GOptionEntry cap_options[] = {
 		{"show-page", 'p', G_OPTION_FLAG_IN_MAIN,
 		 G_OPTION_ARG_STRING,
@@ -443,15 +443,9 @@
 		{NULL}
 	};
 
-	bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
-	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-	textdomain (GETTEXT_PACKAGE);
-
-	if (!gtk_init_with_args (&argc, &argv, _("- GNOME Mouse Preferences"), cap_options, GETTEXT_PACKAGE, &err)) {
-	    g_printerr ("%s\n", err->message);
-	    
-	    return 1;
-	}
+	context = g_option_context_new (_("- GNOME Mouse Preferences"));
+	g_option_context_add_main_entries (context, cap_options, GETTEXT_PACKAGE);
+	capplet_init (context, &argc, &argv);
 	
 	capplet_init_stock_icons ();
 

Modified: trunk/capplets/sound/sound-properties-capplet.c
==============================================================================
--- trunk/capplets/sound/sound-properties-capplet.c	(original)
+++ trunk/capplets/sound/sound-properties-capplet.c	Fri Oct 24 22:29:43 2008
@@ -1175,7 +1175,6 @@
 {
 	GConfChangeSet *changeset;
 	GladeXML       *dialog;
-	GnomeProgram   *program;
  	GOptionContext *context;
 	gboolean apply_only = FALSE;
 	gboolean get_legacy = FALSE;
@@ -1189,26 +1188,16 @@
  		{ NULL }
 	};
 
-	bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
-	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-	textdomain (GETTEXT_PACKAGE);
-
         /* Since gstreamer and gnome-vfs require threads, we
          * have to initialise threads here as the first call to glib.
          */
         g_thread_init (NULL);
 
  	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_group (context, gst_init_get_option_group ());
 
-	program = gnome_program_init ("gnome-sound-properties", VERSION,
-				      LIBGNOMEUI_MODULE, argc, argv,
- 			    	      GNOME_PARAM_GOPTION_CONTEXT, context,
-				      NULL);
+	capplet_init (context, &argc, &argv);
 
 	activate_settings_daemon ();
 
@@ -1239,7 +1228,6 @@
 	}
 
 	g_object_unref (gconf_client);
-	g_object_unref (program);
 
 	return 0;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]