gnome-control-center r9112 - in trunk/capplets: about-me accessibility/at-properties appearance common keyboard sound



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

Log:
+Fri Oct 24 19:16:46 2008  SÃren Sandmann  <sandmann redhat com>
+
+	* gnome-about-me.c (main): Remove unused GnomeProgram variable
+
+Fri Oct 24 19:19:46 2008  SÃren Sandmann  <sandmann redhat com>
+
+	* sound-properties-capplet.c (setup_dialog): Delete code for
+	legacy config options
+	
+Fri Oct 24 19:18:37 2008  SÃren Sandmann  <sandmann redhat com>
+
+	* capplet-util.c: Include <stdlib.h>
+	* capplet-util.h: Delete COPY_FROM_LEGACY macro
+
+Fri Oct 24 19:16:10 2008  SÃren Sandmann  <sandmann redhat com>
+
+	* gnome-keyboard-properties.c (main): Remove copying of legacy settings
+



Modified:
   trunk/capplets/about-me/ChangeLog
   trunk/capplets/about-me/gnome-about-me.c
   trunk/capplets/accessibility/at-properties/main.c
   trunk/capplets/appearance/theme-util.c
   trunk/capplets/common/ChangeLog
   trunk/capplets/common/capplet-util.c
   trunk/capplets/common/capplet-util.h
   trunk/capplets/keyboard/ChangeLog
   trunk/capplets/keyboard/gnome-keyboard-properties.c
   trunk/capplets/sound/ChangeLog
   trunk/capplets/sound/sound-properties-capplet.c

Modified: trunk/capplets/about-me/gnome-about-me.c
==============================================================================
--- trunk/capplets/about-me/gnome-about-me.c	(original)
+++ trunk/capplets/about-me/gnome-about-me.c	Fri Oct 24 23:22:41 2008
@@ -1024,7 +1024,6 @@
 int
 main (int argc, char **argv)
 {
-	GnomeProgram *program;
 	int rc = 0;
 
 	capplet_init (NULL, &argc, &argv);

Modified: trunk/capplets/accessibility/at-properties/main.c
==============================================================================
--- trunk/capplets/accessibility/at-properties/main.c	(original)
+++ trunk/capplets/accessibility/at-properties/main.c	Fri Oct 24 23:22:41 2008
@@ -2,6 +2,7 @@
 #include <gtk/gtk.h>
 #include <gconf/gconf-client.h>
 #include <glade/glade.h>
+#include <gnome.h>
 
 #include "capplet-util.h"
 #include "gconf-property-editor.h"

Modified: trunk/capplets/appearance/theme-util.c
==============================================================================
--- trunk/capplets/appearance/theme-util.c	(original)
+++ trunk/capplets/appearance/theme-util.c	Fri Oct 24 23:22:41 2008
@@ -26,6 +26,7 @@
 #include <dbus/dbus-glib.h>
 #include <dbus/dbus-glib-bindings.h>
 
+#include "capplet-util.h"
 #include "theme-util.h"
 
 gboolean

Modified: trunk/capplets/common/capplet-util.c
==============================================================================
--- trunk/capplets/common/capplet-util.c	(original)
+++ trunk/capplets/common/capplet-util.c	Fri Oct 24 23:22:41 2008
@@ -32,6 +32,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include <glib/gi18n.h>
+#include <stdlib.h>
 
 #include "capplet-util.h"
 

Modified: trunk/capplets/common/capplet-util.h
==============================================================================
--- trunk/capplets/common/capplet-util.h	(original)
+++ trunk/capplets/common/capplet-util.h	Fri Oct 24 23:22:41 2008
@@ -25,7 +25,8 @@
 #define __CAPPLET_UTIL_H
 
 #include <gio/gio.h>
-#include <gnome.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
 #include <gconf/gconf.h>
 #include <gconf/gconf-changeset.h>
 
@@ -35,14 +36,6 @@
 
 #define WID(s) glade_xml_get_widget (dialog, s)
 
-/* Copy a setting from the legacy gnome-config settings to the ConfigDatabase */
-
-#define COPY_FROM_LEGACY(type, key, legacy_key)                                 \
-	val_##type = gnome_config_get_##type##_with_default (legacy_key, &def); \
-                                                                                \
-	if (!def)                                                               \
-		gconf_client_set_##type (client, key, val_##type, NULL);
-
 /* Some miscellaneous functions useful to all capplets */
 
 void capplet_help (GtkWindow *parent, char const *section);

Modified: trunk/capplets/keyboard/gnome-keyboard-properties.c
==============================================================================
--- trunk/capplets/keyboard/gnome-keyboard-properties.c	(original)
+++ trunk/capplets/keyboard/gnome-keyboard-properties.c	Fri Oct 24 23:22:41 2008
@@ -192,42 +192,6 @@
 	setup_a11y_tabs (dialog, changeset);
 }
 
-static void
-get_legacy_settings (void)
-{
-	GConfClient *client;
-	gboolean val_bool, def;
-	gulong val_int;
-
-	client = gconf_client_get_default ();
-
-	COPY_FROM_LEGACY (bool,
-			  "/gnome/desktop/peripherals/keyboard/repeat",
-			  "/Desktop/Keyboard/repeat=true");
-	COPY_FROM_LEGACY (bool,
-			  "/gnome/desktop/peripherals/keyboard/click",
-			  "/Desktop/Keyboard/click=true");
-	COPY_FROM_LEGACY (int, "/gnome/desktop/peripherals/keyboard/rate",
-			  "/Desktop/Keyboard/rate=30");
-	COPY_FROM_LEGACY (int, "/gnome/desktop/peripherals/keyboard/delay",
-			  "/Desktop/Keyboard/delay=500");
-	COPY_FROM_LEGACY (int,
-			  "/gnome/desktop/peripherals/keyboard/volume",
-			  "/Desktop/Keyboard/clickvolume=0");
-#if 0
-	COPY_FROM_LEGACY (int,
-			  "/gnome/desktop/peripherals/keyboard/bell_volume",
-			  "/Desktop/Bell/percent=50");
-#endif
-	COPY_FROM_LEGACY (int,
-			  "/gnome/desktop/peripherals/keyboard/bell_pitch",
-			  "/Desktop/Bell/pitch=50");
-	COPY_FROM_LEGACY (int,
-			  "/gnome/desktop/peripherals/keyboard/bell_duration",
-			  "/Desktop/Bell/duration=100");
-	g_object_unref (G_OBJECT (client));
-}
-
 int
 main (int argc, char **argv)
 {
@@ -237,7 +201,6 @@
 	GOptionContext *context;
 
 	static gboolean apply_only = FALSE;
-	static gboolean get_legacy = FALSE;
 	static gboolean switch_to_typing_break_page = FALSE;
 	static gboolean switch_to_a11y_page = FALSE;
 
@@ -251,8 +214,6 @@
 		 N_
 		 ("Just apply settings and quit (compatibility only; now handled by daemon)"),
 		 NULL},
-		{"get-legacy", 0, 0, G_OPTION_ARG_NONE, &get_legacy,
-		 N_("Retrieve and store legacy settings"), NULL},
 		{"typing-break", 0, 0, G_OPTION_ARG_NONE,
 		 &switch_to_typing_break_page,
 		 N_
@@ -283,31 +244,27 @@
 			      GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
 	g_object_unref (client);
 
-	if (get_legacy) {
-		get_legacy_settings ();
-	} else {
-		changeset = NULL;
-		dialog = create_dialog ();
-		setup_dialog (dialog, changeset);
-		if (switch_to_typing_break_page) {
-			gtk_notebook_set_current_page (GTK_NOTEBOOK
-						       (WID
-							("keyboard_notebook")),
-						       4);
-		}
-		else if (switch_to_a11y_page) {
-			gtk_notebook_set_current_page (GTK_NOTEBOOK
-						       (WID
-							("keyboard_notebook")),
-						       2);
-
-		}
-
-		capplet_set_icon (WID ("keyboard_dialog"),
-				  "preferences-desktop-keyboard");
-		gtk_widget_show (WID ("keyboard_dialog"));
-		gtk_main ();
+	changeset = NULL;
+	dialog = create_dialog ();
+	setup_dialog (dialog, changeset);
+	if (switch_to_typing_break_page) {
+		gtk_notebook_set_current_page (GTK_NOTEBOOK
+					       (WID
+						("keyboard_notebook")),
+					       4);
 	}
+	else if (switch_to_a11y_page) {
+		gtk_notebook_set_current_page (GTK_NOTEBOOK
+					       (WID
+						("keyboard_notebook")),
+					       2);
+		
+	}
+	
+	capplet_set_icon (WID ("keyboard_dialog"),
+			  "preferences-desktop-keyboard");
+	gtk_widget_show (WID ("keyboard_dialog"));
+	gtk_main ();
 
 	return 0;
 }

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 23:22:41 2008
@@ -1138,26 +1138,6 @@
 	setup_sound_theme_custom (dialog, CheckXKB());
 }
 
-/* get_legacy_settings
- *
- * Retrieve older gnome_config -style settings and store them in the
- * configuration database.
- *
- * In most cases, it's best to use the COPY_FROM_LEGACY macro defined in
- * capplets/common/capplet-util.h.
- */
-
-static void
-get_legacy_settings (void)
-{
-	GConfClient *client;
-	gboolean val_bool, def;
-
-	client = gconf_client_get_default ();
-	COPY_FROM_LEGACY (bool, "/desktop/gnome/sound/event_sounds", "/sound/system/settings/event_sounds=false");
-	g_object_unref (G_OBJECT (client));
-}
-
 static void
 dialog_response_cb (GtkWidget *dialog, gint response_id, GConfChangeSet *changeset)
 {
@@ -1177,14 +1157,11 @@
 	GladeXML       *dialog;
  	GOptionContext *context;
 	gboolean apply_only = FALSE;
-	gboolean get_legacy = FALSE;
  	GOptionEntry cap_options[] = {
  		{ "apply", 0, 0, G_OPTION_ARG_NONE, &apply_only,
 		  N_("Just apply settings and quit (compatibility only; now handled by daemon)"), NULL },
 		{ "init-session-settings", 0, 0, G_OPTION_ARG_NONE, &apply_only,
 		  N_("Just apply settings and quit (compatibility only; now handled by daemon)"), NULL },
- 		{ "get-legacy", 0, 0, G_OPTION_ARG_NONE, &get_legacy,
-		  N_("Retrieve and store legacy settings"), NULL },
  		{ NULL }
 	};
 
@@ -1205,26 +1182,22 @@
 	gconf_client_add_dir (gconf_client, "/desktop/gnome/sound", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
 	gconf_client_add_dir (gconf_client, "/apps/metacity/general", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
 
-	if (get_legacy) {
-		get_legacy_settings ();
-	} else {
-		dialog = create_dialog ();
-
-		if (dialog) {
-			changeset = gconf_change_set_new ();
-			setup_dialog (dialog, changeset);
-			setup_devices ();
-
-			dialog_win = WID ("sound_prefs_dialog");
-			g_signal_connect (dialog_win, "response", G_CALLBACK (dialog_response_cb), changeset);
-			g_signal_connect (dialog_win, "destroy", G_CALLBACK (gtk_main_quit), NULL);
-			capplet_set_icon (dialog_win, "gnome-sound-properties");
-			gtk_widget_show (dialog_win);
-
-			gtk_main ();
-			gconf_change_set_unref (changeset);
-			g_object_unref (dialog);
-		}
+	dialog = create_dialog ();
+	
+	if (dialog) {
+		changeset = gconf_change_set_new ();
+		setup_dialog (dialog, changeset);
+		setup_devices ();
+		
+		dialog_win = WID ("sound_prefs_dialog");
+		g_signal_connect (dialog_win, "response", G_CALLBACK (dialog_response_cb), changeset);
+		g_signal_connect (dialog_win, "destroy", G_CALLBACK (gtk_main_quit), NULL);
+		capplet_set_icon (dialog_win, "gnome-sound-properties");
+		gtk_widget_show (dialog_win);
+		
+		gtk_main ();
+		gconf_change_set_unref (changeset);
+		g_object_unref (dialog);
 	}
 
 	g_object_unref (gconf_client);



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