anjuta r4883 - in trunk: . libanjuta manuals/reference/libanjuta plugins/build-basic-autotools plugins/class-inheritance plugins/cvs-plugin plugins/debug-manager plugins/document-manager plugins/file-loader plugins/file-manager plugins/gdb plugins/language-support-cpp-java plugins/macro plugins/message-view plugins/project-import plugins/project-wizard plugins/run-program plugins/scintilla plugins/sourceview plugins/subversion plugins/symbol-db plugins/terminal plugins/tools scripts src



Author: jhs
Date: Fri Mar 20 12:13:35 2009
New Revision: 4883
URL: http://svn.gnome.org/viewvc/anjuta?rev=4883&view=rev

Log:
2009-03-20  Johannes Schmid  <jhs gnome org>

	* libanjuta/Makefile.am:
	* libanjuta/anjuta-preferences.c (unbuild_key),
	(anjuta_preferences_get_int), (anjuta_preferences_get_bool),
	(anjuta_preferences_get_int_with_default),
	(anjuta_preferences_get_bool_with_default),
	(anjuta_preferences_default_get_bool),
	(anjuta_preferences_set_int), (anjuta_preferences_set_bool),
	(set_property_value_as_bool), (update_property_on_change_bool),
	(get_property), (register_callbacks),
	(preferences_foreach_callback), (connect_prop_to_object),
	(anjuta_preferences_register_property_custom),
	(anjuta_preferences_foreach), (anjuta_preferences_instance_init),
	(anjuta_preferences_new), (anjuta_preferences_default),
	(gconf_notify), (anjuta_preferences_notify_add_int),
	(anjuta_preferences_notify_add_string),
	(anjuta_preferences_notify_add_bool),
	(anjuta_preferences_get_prefix):
	* libanjuta/anjuta-preferences.h:
	* manuals/reference/libanjuta/libanjuta.types:
	
	Make AnjutaPreferences a singleton (available through anjuta_preferences_default()).
	Add methods for boolean values and be more pedantic that boolean != int when
	setting getting keys.
	Added new notification system that allows to remove any custom gconf code from
	the plugins and instead is really based on the anjuta preferences system though
	it of course still relies on the gconf backend.
	
	* plugins/build-basic-autotools/executer.c (execute_program):
	* plugins/build-basic-autotools/plugin.c
	(build_execute_command_in_context), (get_root_install_command),
	(on_update_indicators_idle):
	* plugins/class-inheritance/class-inherit.c (gtree_compare_func):
	* plugins/cvs-plugin/cvs-callbacks.c (check_entry):
	* plugins/cvs-plugin/cvs-interface.c
	(create_cvs_command_with_cvsroot):
	* plugins/debug-manager/command.c (dma_command_run):
	* plugins/debug-manager/info.c (gdb_info_show_command):
	* plugins/debug-manager/registers.c (on_find_register_list),
	(dma_thread_set_register_list):
	* plugins/debug-manager/stack_trace.c (on_find_stack_trace),
	(dma_thread_set_stack_trace):
	* plugins/document-manager/action-callbacks.c
	(on_editor_linenos1_activate), (on_editor_markers1_activate),
	(on_editor_codefold1_activate), (on_editor_indentguides1_activate),
	(on_editor_whitespaces1_activate), (on_editor_eolchars1_activate),
	(on_editor_linewrap1_activate):
	* plugins/document-manager/anjuta-docman.c
	(on_notebook_tab_btnrelease), (anjuta_docman_save_document_as),
	(on_notebook_switch_page), (anjuta_docman_set_current_document):
	* plugins/document-manager/plugin.c (ui_states_init),
	(on_window_key_release_event), (docman_plugin_set_tab_pos),
	(on_notify_prefs), (on_docman_auto_save), (on_notify_timer),
	(prefs_init):
	* plugins/file-loader/plugin.c (open_with_dialog):
	* plugins/file-manager/plugin.c (on_notify_root), (on_notify),
	(file_manager_activate):
	* plugins/gdb/debugger.c (debugger_set_frame):
	* plugins/language-support-cpp-java/cpp-java-assist.c
	(on_editor_char_added), (on_assist_chosen):
	* plugins/language-support-cpp-java/plugin.c
	(on_editor_char_inserted_cpp):
	* plugins/macro/macro-util.c (get_date_time), (get_use_tabs):
	* plugins/message-view/anjuta-msgman.c (on_notify_message_pref),
	(anjuta_msgman_new), (anjuta_msgman_add_view),
	(anjuta_msgman_deserialize):
	* plugins/message-view/anjuta-msgman.h:
	* plugins/message-view/message-view.c (message_view_query_tooltip),
	(message_view_dispose), (message_view_instance_init),
	(message_view_class_init), (message_view_new), (pref_change_color),
	(on_notify_color), (prefs_init), (prefs_finalize),
	(imessage_view_append):
	* plugins/message-view/message-view.h:
	* plugins/message-view/plugin.c (activate_plugin),
	(ipreferences_merge):
	* plugins/project-import/project-import.c (on_import_next):
	* plugins/project-wizard/druid.c (npw_druid_fill_selection_page):
	* plugins/project-wizard/parser.c (npw_header_list_read),
	(npw_page_read), (npw_action_list_parser_parse):
	* plugins/run-program/execute.c (run_program):
	* plugins/scintilla/print.c (anjuta_print_setup):
	* plugins/scintilla/text_editor.c (text_editor_instance_init),
	(text_editor_dispose), (text_editor_hilite_one), (load_from_file),
	(save_to_file), (text_editor_load_file),
	(text_editor_set_line_number_width):
	* plugins/scintilla/text_editor.h:
	* plugins/scintilla/text_editor_prefs.c (pref_notify),
	(set_n_get_prop_bool), (on_notify_disable_hilite),
	(on_notify_zoom_factor), (on_notify_tab_size),
	(on_notify_use_tab_for_indentation), (on_notify_indent_size),
	(on_notify_wrap_bookmarks), (on_notify_braces_check),
	(on_notify_indent_maintain), (on_notify_tab_indents),
	(on_notify_backspace_unindents), (on_notify_view_eols),
	(on_notify_view_whitespaces), (on_notify_view_linewrap),
	(on_notify_view_indentation_guides), (on_notify_view_folds),
	(on_notify_view_markers), (on_notify_view_linenums),
	(on_notify_fold_symbols), (on_notify_fold_underline),
	(on_notify_edge_column), (text_editor_prefs_init),
	(text_editor_prefs_finalize):
	* plugins/scratchbox/plugin.c (ipreferences_merge):
	* plugins/sourceview/sourceview-io.c (sourceview_io_save_as):
	* plugins/sourceview/sourceview-prefs.c (on_notify_view_spaces),
	(on_notify_view_eol), (on_notify_line_wrap),
	(on_notify_disable_hilite), (on_notify_highlight_current_line),
	(on_notify_tab_size), (on_notify_use_tab_for_indentation),
	(on_notify_braces_check), (on_notify_view_marks),
	(on_notify_view_linenums), (on_notify_view_right_margin),
	(on_notify_right_margin_position), (on_notify_font),
	(on_notify_font_theme), (init_fonts), (get_key_int),
	(get_key_bool), (sourceview_prefs_init),
	(sourceview_prefs_destroy):
	* plugins/sourceview/sourceview-print.c (print_setup):
	* plugins/sourceview/sourceview-private.h:
	* plugins/subversion/subversion-ui-utils.c (check_input):
	* plugins/terminal/terminal.c (terminal_set_preferences),
	(on_notify_prefs_profile), (on_notify_prefs_default), (prefs_init):
	* plugins/tools/fileop.c (atp_tool_list_load_from_file):
	* src/action-callbacks.c (on_toolbar_view_toggled):
	* src/anjuta-app.c (on_toolbar_style_changed),
	(on_gdl_style_changed), (anjuta_app_instance_init):
	* src/anjuta.c (anjuta_new):
	Fixed code to use the new notification system and to use 
	anjuta_preferences_get_bool() were appropriate.
	
		* plugins/symbol-db/plugin.c (value_added_current_editor),
	(on_session_load), (on_scan_end_manager):
	* plugins/symbol-db/symbol-db-prefs.c
	(on_prefs_executable_changed), (on_notify_prefs),
	(sdb_prefs_init1):
	* plugins/symbol-db/symbol-db-prefs.h:
	Fix symbol-db preference system. It was totally broken. This part will be
	backported to 2.26.
	
	* plugins/file-manager/Makefile.am:
	Install schemas for file-manager plugin (was missing somehow)

	* scripts/build-schemas.mk:
	#575893 â plugins schema files are not installed
	(thanks to Marcin Banasiak for the patch)

Modified:
   trunk/ChangeLog
   trunk/libanjuta/Makefile.am
   trunk/libanjuta/anjuta-preferences-dialog.c
   trunk/libanjuta/anjuta-preferences.c
   trunk/libanjuta/anjuta-preferences.h
   trunk/manuals/reference/libanjuta/libanjuta.types
   trunk/plugins/build-basic-autotools/executer.c
   trunk/plugins/build-basic-autotools/plugin.c
   trunk/plugins/class-inheritance/class-inherit.c
   trunk/plugins/cvs-plugin/cvs-callbacks.c
   trunk/plugins/cvs-plugin/cvs-interface.c
   trunk/plugins/debug-manager/command.c
   trunk/plugins/debug-manager/info.c
   trunk/plugins/debug-manager/registers.c
   trunk/plugins/debug-manager/stack_trace.c
   trunk/plugins/document-manager/action-callbacks.c
   trunk/plugins/document-manager/anjuta-docman.c
   trunk/plugins/document-manager/plugin.c
   trunk/plugins/file-loader/plugin.c
   trunk/plugins/file-manager/Makefile.am
   trunk/plugins/file-manager/plugin.c
   trunk/plugins/gdb/debugger.c
   trunk/plugins/language-support-cpp-java/cpp-java-assist.c
   trunk/plugins/language-support-cpp-java/plugin.c
   trunk/plugins/macro/macro-util.c
   trunk/plugins/message-view/anjuta-msgman.c
   trunk/plugins/message-view/anjuta-msgman.h
   trunk/plugins/message-view/message-view.c
   trunk/plugins/message-view/message-view.h
   trunk/plugins/message-view/plugin.c
   trunk/plugins/project-import/project-import.c
   trunk/plugins/project-wizard/druid.c
   trunk/plugins/project-wizard/parser.c
   trunk/plugins/run-program/execute.c
   trunk/plugins/scintilla/print.c
   trunk/plugins/scintilla/text_editor.c
   trunk/plugins/scintilla/text_editor.h
   trunk/plugins/scintilla/text_editor_prefs.c
   trunk/plugins/sourceview/sourceview-io.c
   trunk/plugins/sourceview/sourceview-prefs.c
   trunk/plugins/sourceview/sourceview-print.c
   trunk/plugins/sourceview/sourceview-private.h
   trunk/plugins/subversion/subversion-ui-utils.c
   trunk/plugins/symbol-db/plugin.c
   trunk/plugins/symbol-db/symbol-db-prefs.c
   trunk/plugins/symbol-db/symbol-db-prefs.h
   trunk/plugins/terminal/terminal.c
   trunk/plugins/tools/fileop.c
   trunk/scripts/build-schemas.mk
   trunk/src/action-callbacks.c
   trunk/src/anjuta-app.c
   trunk/src/anjuta.c

Modified: trunk/libanjuta/Makefile.am
==============================================================================
--- trunk/libanjuta/Makefile.am	(original)
+++ trunk/libanjuta/Makefile.am	Fri Mar 20 12:13:35 2009
@@ -157,7 +157,7 @@
 	&& cp xgenc-gmc $(@F) \
 	&& rm -f xgenc-gmc
 
-anjuta-enum-types.h: stamp-anjuta-enum-types.h
+anjuta-enum-types.h: stamp-anjuta-enum-types.h $(libanjuta_include)
 	@true
 stamp-anjuta-enum-types.h: Makefile $(libanjuta_include) anjuta-enum-types.c
 	( cd $(srcdir) && $(GLIB_MKENUMS) \
@@ -195,4 +195,4 @@
 DISTCLEANFILES = \
   anjuta-enum-types.h \
   anjuta-enum-types.c \
-  stamp-anjuta-enum-types.h
\ No newline at end of file
+  stamp-anjuta-enum-types.h

Modified: trunk/libanjuta/anjuta-preferences-dialog.c
==============================================================================
--- trunk/libanjuta/anjuta-preferences-dialog.c	(original)
+++ trunk/libanjuta/anjuta-preferences-dialog.c	Fri Mar 20 12:13:35 2009
@@ -270,10 +270,10 @@
 			    COL_PIXBUF, icon,
 			    COL_WIDGET, page,
 			    -1);
-	
-		gtk_tree_model_get_iter_first (GTK_TREE_MODEL (dlg->priv->store),
-									   &first);
-		gtk_tree_selection_select_iter (selection, &first);
+
+	gtk_tree_model_get_iter_first (GTK_TREE_MODEL (dlg->priv->store),
+	                               &first);
+	gtk_tree_selection_select_iter (selection, &first);
 }
 
 /**

Modified: trunk/libanjuta/anjuta-preferences.c
==============================================================================
--- trunk/libanjuta/anjuta-preferences.c	(original)
+++ trunk/libanjuta/anjuta-preferences.c	Fri Mar 20 12:13:35 2009
@@ -74,6 +74,9 @@
 #include <libanjuta/anjuta-debug.h>
 #include <libanjuta/interfaces/ianjuta-preferences.h>
 
+/* AnjutaPreferences is a singleton */
+static AnjutaPreferences* default_preferences = NULL;
+
 struct _AnjutaProperty
 {
 	GtkWidget                *object;
@@ -103,17 +106,20 @@
 	GtkWidget           *prefs_dialog;
 	AnjutaPluginManager *plugin_manager;
 	gboolean             is_showing;
+
+	GHashTable			*notifications;
 };
 
 /* Internal structure for anjuta_preferences_foreach */
 struct _AnjutaPreferencesForeachData
 {
 	AnjutaPreferences *pr;
-	AnjutaPreferencesFilterType filter;
 	AnjutaPreferencesCallback callback;
 	gpointer callback_data;
 };
 
+/* Data for notifications */
+
 #define PREFERENCE_PROPERTY_PREFIX "preferences_"
 #define GCONF_KEY_PREFIX "/apps/anjuta/preferences"
 
@@ -125,6 +131,14 @@
 	return buffer;
 }
 
+static const gchar*
+unbuild_key (const gchar* key)
+{
+	if (g_str_has_prefix (key, GCONF_KEY_PREFIX))
+		return key + strlen (GCONF_KEY_PREFIX);
+	return NULL;
+}
+
 /**
  * anjuta_preferences_get:
  * @pr: A #AnjutaPreferences object
@@ -148,71 +162,102 @@
 }
 
 /**
- * anjuta_preferences_get_list:
+ * anjuta_preferences_get_int:
  * @pr: A #AnjutaPreferences object
  * @key: Property key
- * @list_type: Type of each list element
  *
- * Gets the list of @key.
+ * Gets the value of @key as integer.
  *
- * Return value: Key list or NULL if the key is not defined.
+ * Return value: Key value as integer or 0 if the key is not defined.
  */
 #ifdef __GNUC__
 inline
 #endif
-GSList *
-anjuta_preferences_get_list (AnjutaPreferences *pr, const gchar *key,
-                             GConfValueType list_type)
+gint
+anjuta_preferences_get_int (AnjutaPreferences *pr, const gchar *key)
 {
-	g_return_val_if_fail (ANJUTA_IS_PREFERENCES (pr), NULL);
-	g_return_val_if_fail (key != NULL, NULL);
-
-	return gconf_client_get_list(pr->priv->gclient, build_key (key), list_type, NULL);
+	gint ret_val;
+	GConfValue *value;
+	
+	g_return_val_if_fail (ANJUTA_IS_PREFERENCES (pr), 0);
+	g_return_val_if_fail (key != NULL, 0);
+	
+	ret_val = 0;
+	value = gconf_client_get (pr->priv->gclient, build_key (key), NULL);
+	if (value)
+	{
+		switch (value->type)
+		{
+			case GCONF_VALUE_INT:
+				ret_val = gconf_value_get_int (value);
+				break;
+			default:
+				g_warning ("Invalid gconf type for key: %s", key);
+		}
+		gconf_value_free (value);
+	}
+	else
+		DEBUG_PRINT ("The preference key %s is not defined", key);
+	return ret_val;
 }
 
 /**
- * anjuta_preferences_get_pair:
+ * anjuta_preferences_get_int:
  * @pr: A #AnjutaPreferences object
  * @key: Property key
- * @car_type: Desired type of the pair's first field (car).
- * @cdr_type: Desired type of the pair's second field (cdr).
- * @car_retloc: Address of a return location for the car.
- * @cdr_retloc: Address of a return location for the cdr.
  *
- * Gets the pair of @key.
+ * Gets the value of @key as integer.
  *
- * Return value: TRUE or FALSE.
+ * Return value: Key value as boolean or FALSE if the key is not defined.
  */
 #ifdef __GNUC__
 inline
 #endif
-gboolean
-anjuta_preferences_get_pair (AnjutaPreferences *pr, const gchar *key,
-                             GConfValueType car_type, GConfValueType cdr_type,
-                             gpointer car_retloc, gpointer cdr_retloc)
+gint
+anjuta_preferences_get_bool (AnjutaPreferences *pr, const gchar *key)
 {
-	g_return_val_if_fail (ANJUTA_IS_PREFERENCES (pr), FALSE);
-	g_return_val_if_fail (key != NULL, FALSE);
-
-	return gconf_client_get_pair(pr->priv->gclient, build_key (key),
-                                 car_type, cdr_type,
-                                 car_retloc, cdr_retloc, NULL);
+	gboolean ret_val;
+	GConfValue *value;
+	
+	g_return_val_if_fail (ANJUTA_IS_PREFERENCES (pr), 0);
+	g_return_val_if_fail (key != NULL, 0);
+	
+	ret_val = FALSE;
+	value = gconf_client_get (pr->priv->gclient, build_key (key), NULL);
+	if (value)
+	{
+		switch (value->type)
+		{
+			case GCONF_VALUE_BOOL:
+				ret_val = gconf_value_get_bool (value);
+				break;
+			default:
+				g_warning ("Invalid gconf type for key: %s", key);
+		}
+		gconf_value_free (value);
+	}
+	else
+		DEBUG_PRINT ("The preference key %s is not defined", key);
+	return ret_val;
 }
 
 /**
- * anjuta_preferences_get_int:
+ * anjuta_preferences_get_int_with_default:
  * @pr: A #AnjutaPreferences object
  * @key: Property key
+ * @default_value: Default value to return if the key is not defined.
  *
  * Gets the value of @key as integer.
  *
- * Return value: Key value as integer or 0 if the key is not defined.
+ * Return value: Key value as integer or @default_value if the
+ * key is not defined.
  */
 #ifdef __GNUC__
 inline
 #endif
 gint
-anjuta_preferences_get_int (AnjutaPreferences *pr, const gchar *key)
+anjuta_preferences_get_int_with_default (AnjutaPreferences *pr,
+										 const gchar *key, gint default_value)
 {
 	gint ret_val;
 	GConfValue *value;
@@ -220,7 +265,7 @@
 	g_return_val_if_fail (ANJUTA_IS_PREFERENCES (pr), 0);
 	g_return_val_if_fail (key != NULL, 0);
 	
-	ret_val = 0;
+	ret_val = default_value;
 	value = gconf_client_get (pr->priv->gclient, build_key (key), NULL);
 	if (value)
 	{
@@ -229,16 +274,11 @@
 			case GCONF_VALUE_INT:
 				ret_val = gconf_value_get_int (value);
 				break;
-			case GCONF_VALUE_BOOL:
-				ret_val = gconf_value_get_bool (value);
-				break;
 			default:
 				g_warning ("Invalid gconf type for key: %s", key);
 		}
 		gconf_value_free (value);
 	}
-	/* else
-		g_warning ("The preference key %s is not defined", key); */
 	return ret_val;
 }
 
@@ -257,10 +297,10 @@
 inline
 #endif
 gint
-anjuta_preferences_get_int_with_default (AnjutaPreferences *pr,
-										 const gchar *key, gint default_value)
+anjuta_preferences_get_bool_with_default (AnjutaPreferences *pr,
+                                          const gchar *key, gboolean default_value)
 {
-	gint ret_val;
+	gboolean ret_val;
 	GConfValue *value;
 	
 	g_return_val_if_fail (ANJUTA_IS_PREFERENCES (pr), 0);
@@ -272,9 +312,6 @@
 	{
 		switch (value->type)
 		{
-			case GCONF_VALUE_INT:
-				ret_val = gconf_value_get_int (value);
-				break;
 			case GCONF_VALUE_BOOL:
 				ret_val = gconf_value_get_bool (value);
 				break;
@@ -354,6 +391,39 @@
 }
 
 /**
+ * anjuta_preferences_default_get_int:
+ * @pr: A #AnjutaPreferences object
+ * @key: Property key
+ *
+ * Gets the default value of @key as integer. The default value of the key
+ * is the value defined in System defaults (generally installed during 
+ * program installation).
+ *
+ * Return value: Default key value as integer or 0 if the key is not defined.
+ */
+#ifdef __GNUC__
+inline
+#endif
+gboolean
+anjuta_preferences_default_get_bool (AnjutaPreferences *pr, const gchar *key)
+{
+	GConfValue *val;
+	gint ret;
+	GError *err = NULL;
+	
+	g_return_val_if_fail (ANJUTA_IS_PREFERENCES (pr), 0);
+	g_return_val_if_fail (key != NULL, 0);
+	val = gconf_client_get_default_from_schema (pr->priv->gclient, build_key (key), &err);
+	if (err) {
+		g_error_free (err);
+		return 0;
+	}
+	ret = gconf_value_get_bool (val);
+	gconf_value_free (val);
+	return ret;
+}
+
+/**
  * anjuta_preferences_set:
  * @pr: A #AnjutaPreferences object.
  * @key: Property key.
@@ -382,61 +452,52 @@
 }
 
 /**
- * anjuta_preferences_set_list:
+ * anjuta_preferences_set_int:
  * @pr: A #AnjutaPreferences object.
  * @key: Property key.
- * @list_type: Type of each element.
- * @list: New value of the key.
+ * @value: Integer value of the key.
  *
- * Sets a list in current session.
+ * Sets the value of @key in current session.
  */
 #ifdef __GNUC__
 inline
 #endif
 void
-anjuta_preferences_set_list (AnjutaPreferences *pr, const gchar *key,
-					         GConfValueType list_type, GSList *list)
+anjuta_preferences_set_int (AnjutaPreferences *pr, const gchar *key,
+							gint value)
 {
+	GConfValue *gvalue;
+	
 	g_return_if_fail (ANJUTA_IS_PREFERENCES (pr));
 	g_return_if_fail (key != NULL);
-
-	gconf_client_set_list(pr->priv->gclient, build_key (key), 
-		                      list_type, list, NULL);
-}
-
-/**
- * anjuta_preferences_set_pair:
- * @pr: A #AnjutaPreferences object.
- * @key: Property key.
- * @car_type: Type of the pair's first field (car).
- * @cdr_type: Type of the pair's second field (cdr).
- * @address_of_car: Address of the car.
- * @address_of_cdr: Address of the cdr.
- *
- */
-#ifdef __GNUC__
-inline
-#endif
-gboolean
-anjuta_preferences_set_pair (AnjutaPreferences *pr, const gchar *key,
-					         GConfValueType car_type, GConfValueType cdr_type,
-                             gconstpointer address_of_car,
-                             gconstpointer address_of_cdr)
-{
-	g_return_val_if_fail (ANJUTA_IS_PREFERENCES (pr), FALSE);
-	g_return_val_if_fail (key != NULL, FALSE);
-
-	return gconf_client_set_pair (pr->priv->gclient, build_key (key),
-                                  car_type, cdr_type,
-                                  address_of_car, address_of_cdr,
-                                  NULL);
+	
+	gvalue = gconf_client_get (pr->priv->gclient, build_key (key), NULL);
+	if (gvalue)
+	{
+		switch (gvalue->type)
+		{
+			case GCONF_VALUE_INT:
+				gconf_client_set_int (pr->priv->gclient, build_key (key),
+									  value, NULL);
+				break;
+			default:
+				g_warning ("Invalid gconf type for key: %s", key);
+		}
+		gconf_value_free (gvalue);
+	}
+	else
+	{
+		DEBUG_PRINT ("The preference key %s is not defined", key);
+		gconf_client_set_int (pr->priv->gclient, build_key (key),
+							  value, NULL);
+	}
 }
 
 /**
- * anjuta_preferences_set_int:
+ * anjuta_preferences_set_bool:
  * @pr: A #AnjutaPreferences object.
  * @key: Property key.
- * @value: Integer value of the key.
+ * @value: Boolean value of the key.
  *
  * Sets the value of @key in current session.
  */
@@ -444,8 +505,8 @@
 inline
 #endif
 void
-anjuta_preferences_set_int (AnjutaPreferences *pr, const gchar *key,
-							gint value)
+anjuta_preferences_set_bool (AnjutaPreferences *pr, const gchar *key,
+							 gboolean value)
 {
 	GConfValue *gvalue;
 	
@@ -461,10 +522,6 @@
 				gconf_client_set_bool (pr->priv->gclient, build_key (key),
 									   value, NULL);
 				break;
-			case GCONF_VALUE_INT:
-				gconf_client_set_int (pr->priv->gclient, build_key (key),
-									  value, NULL);
-				break;
 			default:
 				g_warning ("Invalid gconf type for key: %s", key);
 		}
@@ -472,9 +529,9 @@
 	}
 	else
 	{
-		/* g_warning ("The preference key %s is not defined", key); */
-		gconf_client_set_int (pr->priv->gclient, build_key (key),
-							  value, NULL);
+		DEBUG_PRINT ("The preference key %s is not defined", key);
+		gconf_client_set_bool (pr->priv->gclient, build_key (key),
+		                       value, NULL);
 	}
 }
 
@@ -807,6 +864,15 @@
 	g_free (text_value);	
 }
 
+static void
+set_property_value_as_bool (AnjutaProperty *prop, gboolean value)
+{
+	gchar *text_value;
+	text_value = g_strdup_printf ("%d", value);
+	set_property_value_as_string (prop, text_value);
+	g_free (text_value);	
+}
+
 static gboolean
 update_property_on_event_str (GtkWidget *widget, GdkEvent *event,
 							  gpointer user_data)
@@ -874,6 +940,20 @@
 }
 
 static void
+update_property_on_change_bool (GtkWidget *widget, gpointer user_data)
+{
+	AnjutaPreferences *pr;
+	AnjutaProperty *p;
+	gint val;
+	
+	pr = ANJUTA_PREFERENCES (g_object_get_data (G_OBJECT (widget),
+												"AnjutaPreferences"));
+	p = (AnjutaProperty *) user_data;
+	val = get_property_value_as_int (p);
+	anjuta_preferences_set_bool (pr, p->key, val);
+}
+
+static void
 update_property_on_change_color (GtkWidget *widget, gpointer user_data)
 {
 	AnjutaPreferences *pr;
@@ -938,7 +1018,7 @@
 		gboolean gconf_value;
 		
 		gconf_value = gconf_value_get_bool (value);
-		set_property_value_as_int (p, gconf_value);
+		set_property_value_as_bool (p, gconf_value);
 	}
 	else if (p->data_type == ANJUTA_PROPERTY_DATA_TYPE_INT)
 	{
@@ -992,7 +1072,7 @@
 			break;
 		case ANJUTA_PROPERTY_OBJECT_TYPE_TOGGLE:
 			g_signal_connect (G_OBJECT(p->object), "toggled",
-							  G_CALLBACK (update_property_on_change_int), p);
+							  G_CALLBACK (update_property_on_change_bool), p);
 			break;
 		case ANJUTA_PROPERTY_OBJECT_TYPE_COLOR:
 			g_signal_connect (G_OBJECT(p->object), "color-set",
@@ -1032,10 +1112,7 @@
 {	
 	if (p->object_type != ANJUTA_PROPERTY_OBJECT_TYPE_COMBO)
 	{
-		if (data->filter == ANJUTA_PREFERENCES_FILTER_NONE)
-			return data->callback (data->pr, key, data->callback_data);
-		else if (p->flags & data->filter)
-			return data->callback (data->pr, key, data->callback_data);
+		return data->callback (data->pr, key, data->callback_data);
 	}
 	
 	return TRUE;
@@ -1047,13 +1124,18 @@
 	int gconf_value;
 	gchar *value;
 	
-	if (p->data_type == ANJUTA_PROPERTY_DATA_TYPE_BOOL ||
-		p->data_type == ANJUTA_PROPERTY_DATA_TYPE_INT)
+	if (p->data_type == ANJUTA_PROPERTY_DATA_TYPE_BOOL)
 	{	
+		gconf_value = anjuta_preferences_get_bool (pr, p->key);
+		value = g_strdup_printf ("%d", gconf_value);
+		set_property_value_as_string (p, value);
+	}
+	else if (p->data_type == ANJUTA_PROPERTY_DATA_TYPE_INT)
+	{
 		gconf_value = anjuta_preferences_get_int (pr, p->key);
 		value = g_strdup_printf ("%d", gconf_value);
 		set_property_value_as_string (p, value);
-	} 
+    }
 	else 
 	{
 		value = anjuta_preferences_get (pr, p->key);
@@ -1247,9 +1329,7 @@
 			   data_type == ANJUTA_PROPERTY_DATA_TYPE_BOOL) ||
 			  (value->type == GCONF_VALUE_INT &&
 			   data_type == ANJUTA_PROPERTY_DATA_TYPE_INT) ||
-			  (value->type == GCONF_VALUE_STRING &&
-			   data_type != ANJUTA_PROPERTY_DATA_TYPE_BOOL &&
-			   data_type != ANJUTA_PROPERTY_DATA_TYPE_INT)))
+			  (value->type == GCONF_VALUE_STRING)))
 		{
 			gconf_client_unset (pr->priv->gclient, build_key (key), NULL);
 		}
@@ -1474,14 +1554,12 @@
  */
 void
 anjuta_preferences_foreach (AnjutaPreferences *pr,
-							AnjutaPreferencesFilterType filter,
 							AnjutaPreferencesCallback callback,
 							gpointer data)
 {
 	struct _AnjutaPreferencesForeachData foreach_data;
 	
 	foreach_data.pr = pr;
-	foreach_data.filter = filter;
 	foreach_data.callback = callback;
 	foreach_data.callback_data = data;
 	
@@ -1701,6 +1779,10 @@
 	pr->priv->properties = g_hash_table_new_full (g_str_hash, g_str_equal,
 												  g_free, 
 												  (GDestroyNotify) property_destroy);
+	pr->priv->notifications = g_hash_table_new_full (g_int_hash,
+	                                                 g_int_equal,
+	                                                 g_free, 
+	                                                 NULL);
 	
 	pr->priv->gclient = gconf_client_get_default();
 	gconf_client_add_dir (pr->priv->gclient, GCONF_KEY_PREFIX,
@@ -1740,16 +1822,93 @@
 anjuta_preferences_new (AnjutaPluginManager *plugin_manager)
 {
 	AnjutaPreferences *pr;
+
+	if (!default_preferences)
+	{
+		pr = g_object_new (ANJUTA_TYPE_PREFERENCES, NULL);
+		pr->priv->plugin_manager = g_object_ref (plugin_manager);
+		default_preferences = pr;
+		return pr;
+	}
+	else
+		return default_preferences;
 	
-	pr = g_object_new (ANJUTA_TYPE_PREFERENCES, NULL);
-	pr->priv->plugin_manager = g_object_ref (plugin_manager);
-	
-	return pr;
+}
+
+/**
+ * anjuta_preferences_default:
+ * 
+ * Get the default instace of anjuta preferences
+ * 
+ * Return value: A #AnjutaPreferences object.
+ */
+AnjutaPreferences *anjuta_preferences_default ()
+{
+	return default_preferences;
+}
+
+static void
+gconf_notify (GConfEngine* conf,
+              guint id,
+              GConfEntry* entry,
+              gpointer user_data)
+{
+	AnjutaPreferences* prefs = anjuta_preferences_default();
+	gpointer notify =
+		g_hash_table_lookup (prefs->priv->notifications,
+		                     &id);
 	
+	if (entry->value)
+	{
+		const gchar* real_key = unbuild_key (entry->key);
+		switch (entry->value->type)
+		{
+			case GCONF_VALUE_INT:
+			{
+				AnjutaPreferencesNotifyInt int_func = notify;
+				int_func (prefs, real_key,
+				          gconf_value_get_int (entry->value), user_data);
+				break;
+			}
+			case GCONF_VALUE_STRING:
+			{
+				AnjutaPreferencesNotify str_func = notify;
+				str_func (prefs, real_key, 
+				          gconf_value_get_string (entry->value), user_data);
+				break;
+			}
+			case GCONF_VALUE_BOOL:
+			{
+				AnjutaPreferencesNotifyBool bool_func = notify;
+				bool_func (prefs, real_key,
+				           gconf_value_get_bool (entry->value), user_data);
+				break;
+			}
+			default:
+				g_warning ("Notification for unknown type of key: %s", entry->key);
+		}
+	}
+}
+
+guint 
+anjuta_preferences_notify_add_int (AnjutaPreferences *pr,
+                                   const gchar *key,
+                                   AnjutaPreferencesNotifyInt func,
+                                   gpointer data,
+                                   GFreeFunc destroy_notify)
+{
+	guint* id = g_new0 (guint, 1);
+	*id = gconf_client_notify_add (pr->priv->gclient,
+	                              build_key (key),
+	                              (GConfClientNotifyFunc) gconf_notify, data, destroy_notify, NULL);
+	g_hash_table_insert (pr->priv->notifications,
+	                     id,
+	                     func);
+	return *id;
 }
 
 /**
- * anjuta_preferences_notify_add:
+ * anjuta_preferences_notify_add_string:
  * @pr: A #AnjutaPreferences object.
  * @key: Key to monitor.
  * @func: User callback function.
@@ -1762,18 +1921,41 @@
  *
  * Return value: Notify ID.
  */
-guint
-anjuta_preferences_notify_add (AnjutaPreferences *pr,
-							   const gchar *key,
-							   GConfClientNotifyFunc func,
-							   gpointer data,
-							   GFreeFunc destroy_notify)
-{
-	return gconf_client_notify_add (pr->priv->gclient,
-									build_key (key),
-									func, data, destroy_notify, NULL);
+guint 
+anjuta_preferences_notify_add_string (AnjutaPreferences *pr,
+                                      const gchar *key,
+                                      AnjutaPreferencesNotify func,
+                                      gpointer data,
+                                      GFreeFunc destroy_notify)
+{
+	guint* id = g_new0 (guint, 1);
+	*id = gconf_client_notify_add (pr->priv->gclient,
+	                              build_key (key),
+	                              (GConfClientNotifyFunc)gconf_notify, data, destroy_notify, NULL);
+	g_hash_table_insert (pr->priv->notifications,
+	                     id,
+	                     func);
+	return *id;
+}
+
+guint 
+anjuta_preferences_notify_add_bool (AnjutaPreferences *pr,
+                                    const gchar *key,
+                                    AnjutaPreferencesNotifyBool func,
+                                    gpointer data,
+                                    GFreeFunc destroy_notify)
+{
+	guint* id = g_new0 (guint, 1);
+	*id = gconf_client_notify_add (pr->priv->gclient,
+	                              build_key (key),
+	                              (GConfClientNotifyFunc)gconf_notify, data, destroy_notify, NULL);
+	g_hash_table_insert (pr->priv->notifications,
+	                     id,
+	                     func);
+	return *id;
 }
 
+
 /**
  * anjuta_preferences_notify_remove:
  * @pr: A #AnjutaPreferences object.
@@ -1800,63 +1982,3 @@
 {
 	return PREFERENCE_PROPERTY_PREFIX;
 }
-
-/**
- * anjuta_preferences_dir_exists:
- * @pr: A #AnjutaPreferences object.
- * @dir: Directory to checkfor.
- *
- * Return value: TRUE if dir exists.
- */
-#ifdef __GNUC__
-inline
-#endif
-gboolean
-anjuta_preferences_dir_exists (AnjutaPreferences *pr, const gchar *dir)
-{
-	g_return_val_if_fail (ANJUTA_IS_PREFERENCES (pr), FALSE);
-	g_return_val_if_fail (dir != NULL, FALSE);
-
-	return gconf_client_dir_exists(pr->priv->gclient, build_key (dir), NULL);
-}
-
-/**
- * anjuta_preferences_add_dir:
- * @pr: A #AnjutaPreferences object.
- * @dir: Directory to add to the list.
- * @preload: Degree of preload.
- *
- * Add a directory to the list of directories the GConfClient.
- */
-#ifdef __GNUC__
-inline
-#endif
-void
-anjuta_preferences_add_dir (AnjutaPreferences *pr, const gchar *dir, 
-                               GConfClientPreloadType preload)
-{
-	g_return_if_fail (ANJUTA_IS_PREFERENCES (pr));
-	g_return_if_fail (dir != NULL);
-
-	gconf_client_add_dir(pr->priv->gclient, build_key (dir), 
-	                     preload, NULL);
-}
-
-/**
- * anjuta_preferences_remove_dir:
- * @pr: A #AnjutaPreferences object.
- * @dir: Directory to remove from the list.
- *
- * Remove a directory from the list of directories.
- */
-#ifdef __GNUC__
-inline
-#endif
-void
-anjuta_preferences_remove_dir (AnjutaPreferences *pr, const gchar *dir)
-{
-	g_return_if_fail (ANJUTA_IS_PREFERENCES (pr));
-	g_return_if_fail (dir != NULL);
-
-	gconf_client_remove_dir(pr->priv->gclient, build_key (dir), NULL);
-}

Modified: trunk/libanjuta/anjuta-preferences.h
==============================================================================
--- trunk/libanjuta/anjuta-preferences.h	(original)
+++ trunk/libanjuta/anjuta-preferences.h	Fri Mar 20 12:13:35 2009
@@ -22,7 +22,6 @@
 
 #include <gnome.h>
 #include <glade/glade.h>
-#include <gconf/gconf-client.h>
 
 #include <libanjuta/anjuta-preferences-dialog.h>
 #include <libanjuta/anjuta-plugin-manager.h>
@@ -51,12 +50,6 @@
 	ANJUTA_PROPERTY_DATA_TYPE_FONT
 } AnjutaPropertyDataType;
 
-typedef enum
-{
-	ANJUTA_PREFERENCES_FILTER_NONE = 0,
-	ANJUTA_PREFERENCES_FILTER_PROJECT = 1
-} AnjutaPreferencesFilterType;
-
 typedef struct _AnjutaProperty AnjutaProperty;
 
 /* Get functions. Add more get functions for AnjutaProperty, if required */
@@ -76,7 +69,7 @@
 struct _AnjutaPreferences
 {
 	GObject parent;
-	
+
 	/*< private >*/
 	AnjutaPreferencesPriv *priv;
 };
@@ -87,152 +80,149 @@
 };
 
 typedef gboolean (*AnjutaPreferencesCallback) (AnjutaPreferences *pr,
-											   const gchar *key,
-											   gpointer data);
+                                               const gchar *key,
+                                               gpointer data);
 
 GType anjuta_preferences_get_type (void);
 
 AnjutaPreferences *anjuta_preferences_new (AnjutaPluginManager *plugin_manager);
+AnjutaPreferences *anjuta_preferences_default (void);
 
 void anjuta_preferences_add_page (AnjutaPreferences* pr, GladeXML *gxml,
-								  const gchar* glade_widget_name,
-								  const gchar* title,
-								  const gchar *icon_filename);
+                                  const gchar* glade_widget_name,
+                                  const gchar* title,
+                                  const gchar *icon_filename);
 void anjuta_preferences_remove_page (AnjutaPreferences *pr, 
-									 const gchar *page_name);
+                                     const gchar *page_name);
 
 /*
  * Registers all properties defined for widgets below the 'parent' widget
  * in the given gxml glade UI tree
  */
 void anjuta_preferences_register_all_properties_from_glade_xml (AnjutaPreferences* pr,
-																GladeXML *gxml,
-																GtkWidget *parent);
+                                                                GladeXML *gxml,
+                                                                GtkWidget *parent);
 gboolean
 anjuta_preferences_register_property_from_string (AnjutaPreferences *pr,
-												  GtkWidget *object,
-												  const gchar *property_desc);
+                                                  GtkWidget *object,
+                                                  const gchar *property_desc);
 
 gboolean
 anjuta_preferences_register_property_raw (AnjutaPreferences *pr, GtkWidget *object,
-										  const gchar *key,
-										  const gchar *default_value,
-										  guint flags,
-										  AnjutaPropertyObjectType object_type,
-										  AnjutaPropertyDataType  data_type);
+                                          const gchar *key,
+                                          const gchar *default_value,
+                                          guint flags,
+                                          AnjutaPropertyObjectType object_type,
+                                          AnjutaPropertyDataType  data_type);
 
 gboolean
 anjuta_preferences_register_property_custom (AnjutaPreferences *pr,
-											 GtkWidget *object,
-										     const gchar *key,
-										     const gchar *default_value,
-											 AnjutaPropertyDataType data_type,
-										     guint flags,
-		void    (*set_property) (AnjutaProperty *prop, const gchar *value),
-		gchar * (*get_property) (AnjutaProperty *));
+                                             GtkWidget *object,
+                                             const gchar *key,
+                                             const gchar *default_value,
+                                             AnjutaPropertyDataType data_type,
+                                             guint flags,
+                                             void    (*set_property) (AnjutaProperty *prop, const gchar *value),
+                                             gchar * (*get_property) (AnjutaProperty *));
 
 void anjuta_preferences_reset_defaults (AnjutaPreferences *pr);
 
-gboolean 
-anjuta_preferences_load_gconf (AnjutaPreferences *pr);
-
-gboolean 
-anjuta_preferences_save (AnjutaPreferences *pr, FILE *stream);
-
-/* Save excluding the filtered properties. This will save only those
- * properties which DOES NOT have the flags set to values given by the filter.
- */
-gboolean 
-anjuta_preferences_save_filtered (AnjutaPreferences *pr, FILE *stream,
-										   AnjutaPreferencesFilterType filter);
-gboolean 
-anjuta_preferences_save_gconf (AnjutaPreferences *pr,
-										   AnjutaPreferencesFilterType filter);
-
-
-
 /* Calls the callback function for each of the properties with the flags
  * matching with the given filter 
  */
 void anjuta_preferences_foreach (AnjutaPreferences *pr,
-								 AnjutaPreferencesFilterType filter,
-								 AnjutaPreferencesCallback callback,
-								 gpointer data);
+                                 AnjutaPreferencesCallback callback,
+                                 gpointer data);
 
 /* This will transfer all the properties values from the main
-properties database to the parent session properties database */
+ properties database to the parent session properties database */
 void anjuta_preferences_sync_to_session (AnjutaPreferences *pr);
 
 /* Sets the value (string) of a key */
 void anjuta_preferences_set (AnjutaPreferences *pr,
-									const gchar *key,
-									const gchar *value);
+                             const gchar *key,
+                             const gchar *value);
 
-/* Sets the list of a key */
-void anjuta_preferences_set_list (AnjutaPreferences *pr, const gchar *key,
-					                    GConfValueType list_type, GSList *list);
-										
-/* Sets the pair of a key */
-gboolean anjuta_preferences_set_pair (AnjutaPreferences *pr, const gchar *key,
-					         GConfValueType car_type, GConfValueType cdr_type,
-                             gconstpointer address_of_car,
-                             gconstpointer address_of_cdr);
-							 
 /* Sets the value (int) of a key */
 void anjuta_preferences_set_int (AnjutaPreferences *pr,
-										const gchar *key,
-										const gint value);
+                                 const gchar *key,
+                                 const gint value);
+
+void anjuta_preferences_set_bool (AnjutaPreferences *pr,
+                                  const gchar *key,
+                                  const gboolean value);
 
 /* Gets the value (string) of a key */
 /* Must free the return string */
 gchar * anjuta_preferences_get (AnjutaPreferences *pr,
-									   const gchar *key);
-
-/* Gets the list of a key */
-GSList *anjuta_preferences_get_list (AnjutaPreferences *pr, const gchar *key,
-                                           GConfValueType list_type);
-
-/* Gets the pair of a key */
-gboolean anjuta_preferences_get_pair (AnjutaPreferences *pr, const gchar *key,
-                             GConfValueType car_type, GConfValueType cdr_type,
-                             gpointer car_retloc, gpointer cdr_retloc);										   
+                                const gchar *key);
 
 /* Gets the value (int) of a key. If not found, 0 is returned */
 gint anjuta_preferences_get_int (AnjutaPreferences *pr,
-										const gchar *key);
+                                 const gchar *key);
+
+gboolean anjuta_preferences_get_bool (AnjutaPreferences *pr,
+                                      const gchar *key);
 
 /* Gets the value (int) of a key. If not found, the default_value is returned */
 gint anjuta_preferences_get_int_with_default (AnjutaPreferences* pr,
-													 const gchar *key,
-													 gint default_value);
+                                              const gchar *key,
+                                              gint default_value);
+
+gint anjuta_preferences_get_bool_with_default (AnjutaPreferences* pr,
+                                               const gchar *key,
+                                               gint default_value);
 
 gchar * anjuta_preferences_default_get (AnjutaPreferences *pr,
-											   const gchar *key);
+                                        const gchar *key);
 
 /* Gets the value (int) of a key */
 gint anjuta_preferences_default_get_int (AnjutaPreferences *pr,
-												const gchar *key);
+                                         const gchar *key);
+
+gint anjuta_preferences_default_get_bool (AnjutaPreferences *pr,
+                                          const gchar *key);
 
 /* Dialog methods */
 GtkWidget *anjuta_preferences_get_dialog (AnjutaPreferences *pr);
 gboolean anjuta_preferences_is_dialog_created (AnjutaPreferences *pr);
 
 /* Key notifications */
-guint anjuta_preferences_notify_add (AnjutaPreferences *pr,
-									 const gchar *key,
-									 GConfClientNotifyFunc func,
-									 gpointer data,
-									 GFreeFunc destroy_notify);
-void anjuta_preferences_notify_remove (AnjutaPreferences *pr, guint notify_id);
-
-const gchar* anjuta_preferences_get_prefix (AnjutaPreferences *pr);
 
-gboolean anjuta_preferences_dir_exists (AnjutaPreferences *pr, const gchar *dir);
+typedef void (*AnjutaPreferencesNotify) (AnjutaPreferences *pr,
+                                         const gchar* key,
+                                         const gchar* value,
+                                         gpointer data);
+typedef void (*AnjutaPreferencesNotifyInt) (AnjutaPreferences *pr,
+                                            const gchar* key,
+                                            gint value,
+                                            gpointer data);
+typedef void (*AnjutaPreferencesNotifyBool) (AnjutaPreferences *pr,
+                                             const gchar* key,
+                                             gboolean value,
+                                             gpointer data);
+
+guint anjuta_preferences_notify_add_int (AnjutaPreferences *pr,
+                                         const gchar *key,
+                                         AnjutaPreferencesNotifyInt func,
+                                         gpointer data,
+                                         GFreeFunc destroy_notify);
+
+guint anjuta_preferences_notify_add_string (AnjutaPreferences *pr,
+                                            const gchar *key,
+                                            AnjutaPreferencesNotify func,
+                                            gpointer data,
+                                            GFreeFunc destroy_notify);
+
+guint anjuta_preferences_notify_add_bool (AnjutaPreferences *pr,
+                                          const gchar *key,
+                                          AnjutaPreferencesNotifyBool func,
+                                          gpointer data,
+                                          GFreeFunc destroy_notify);
 
-void anjuta_preferences_add_dir (AnjutaPreferences *pr, const gchar *dir, 
-                                       GConfClientPreloadType preload);
+void anjuta_preferences_notify_remove (AnjutaPreferences *pr, guint notify_id);
 
-void anjuta_preferences_remove_dir (AnjutaPreferences *pr, const gchar *dir);
+const gchar* anjuta_preferences_get_prefix (AnjutaPreferences *pr);
 
 G_END_DECLS
 

Modified: trunk/manuals/reference/libanjuta/libanjuta.types
==============================================================================
--- trunk/manuals/reference/libanjuta/libanjuta.types	(original)
+++ trunk/manuals/reference/libanjuta/libanjuta.types	Fri Mar 20 12:13:35 2009
@@ -5,7 +5,6 @@
 anjuta_ui_get_type
 anjuta_status_get_type
 anjuta_plugin_handle_get_type
-anjuta_cell_renderer_captioned_image_get_type
 anjuta_plugin_get_type
 anjuta_preferences_dialog_get_type
 anjuta_plugin_manager_get_type
@@ -13,7 +12,6 @@
 anjuta_encoding_get_type
 anjuta_save_prompt_get_type
 anjuta_session_get_type
-anjuta_c_module_get_type
 anjuta_profile_get_type
 anjuta_preferences_get_type
 anjuta_launcher_get_type
@@ -25,7 +23,6 @@
 anjuta_profile_error_get_type
 anjuta_property_object_type_get_type
 anjuta_property_data_type_get_type
-anjuta_preferences_filter_type_get_type
 anjuta_launcher_output_type_get_type
 anjuta_session_phase_get_type
 anjuta_serializer_mode_get_type
@@ -33,7 +30,6 @@
 anjuta_command_get_type
 anjuta_profile_manager_get_type
 g_error_get_type
-anjuta_c_plugin_factory_get_type
 anjuta_vcs_status_tree_view_get_type
 anjuta_async_command_get_type
 anjuta_message_area_get_type

Modified: trunk/plugins/build-basic-autotools/executer.c
==============================================================================
--- trunk/plugins/build-basic-autotools/executer.c	(original)
+++ trunk/plugins/build-basic-autotools/executer.c	Fri Mar 20 12:13:35 2009
@@ -370,7 +370,7 @@
 	else
 		cmd = g_strdup (target);
 
-	if (anjuta_preferences_get_int (prefs , PREF_USE_SB))
+	if (anjuta_preferences_get_bool (prefs , PREF_USE_SB))
 	{
 		const gchar* sb_path = anjuta_preferences_get(prefs, PREF_SB_PATH);
 		/* we need to skip the /scratchbox/users part, maybe could be done more clever */

Modified: trunk/plugins/build-basic-autotools/plugin.c
==============================================================================
--- trunk/plugins/build-basic-autotools/plugin.c	(original)
+++ trunk/plugins/build-basic-autotools/plugin.c	Fri Mar 20 12:13:35 2009
@@ -1232,22 +1232,6 @@
 	return context;
 }
 
-/* Save all current anjuta files */
-static void
-save_all_files (AnjutaPlugin *plugin)
-{
-	IAnjutaDocumentManager *docman;
-	IAnjutaFileSavable* save;
-
-	docman = anjuta_shell_get_interface (plugin->shell, IAnjutaDocumentManager, NULL);
-	/* No document manager, so no file to save */
-	if (docman != NULL)
-	{
-		save = IANJUTA_FILE_SAVABLE (docman);
-		if (save) ianjuta_file_savable_save (save, NULL);
-	}
-}
-
 static void
 build_set_command_in_context (BuildContext* context, BuildProgram *prog)
 {
@@ -1265,17 +1249,17 @@
 	/* Send options to make */
 	if (strcmp (build_program_get_basename (context->program), "make") == 0)
 	{
-		if (!anjuta_preferences_get_int (prefs , PREF_TRANSLATE_MESSAGE))
+		if (!anjuta_preferences_get_bool (prefs , PREF_TRANSLATE_MESSAGE))
 		{
 			build_program_add_env (context->program, "LANGUAGE", "C");
 		}
-		if (anjuta_preferences_get_int (prefs , PREF_PARALLEL_MAKE))
+		if (anjuta_preferences_get_bool (prefs , PREF_PARALLEL_MAKE))
 		{
 			gchar *arg = g_strdup_printf ("-j%d", anjuta_preferences_get_int (prefs , PREF_PARALLEL_MAKE_JOB));
 			build_program_insert_arg (context->program, 1, arg);
 			g_free (arg);
 		}
-		if (anjuta_preferences_get_int (prefs , PREF_CONTINUE_ON_ERROR))
+		if (anjuta_preferences_get_bool (prefs , PREF_CONTINUE_ON_ERROR))
 		{
 			build_program_insert_arg (context->program, 1, "-k");
 		}
@@ -1513,7 +1497,7 @@
 {
 	AnjutaPlugin* plugin = ANJUTA_PLUGIN(bplugin);
 	AnjutaPreferences* prefs = anjuta_shell_get_preferences (plugin->shell, NULL);
-	if (anjuta_preferences_get_int (prefs , PREF_INSTALL_ROOT))
+	if (anjuta_preferences_get_bool (prefs , PREF_INSTALL_ROOT))
 	{
 		gchar* command = anjuta_preferences_get(prefs, PREF_INSTALL_ROOT_COMMAND);
 		if (command != NULL)
@@ -2789,7 +2773,7 @@
 	/* If indicators are not yet updated in the editor, do it */
 	if (ba_plugin->current_editor_filename &&
 		IANJUTA_IS_INDICABLE (editor) &&
-		anjuta_preferences_get_int (anjuta_shell_get_preferences (plugin->shell,
+		anjuta_preferences_get_bool (anjuta_shell_get_preferences (plugin->shell,
 																  NULL),
 									PREF_INDICATORS_AUTOMATIC))
 	{

Modified: trunk/plugins/class-inheritance/class-inherit.c
==============================================================================
--- trunk/plugins/class-inheritance/class-inherit.c	(original)
+++ trunk/plugins/class-inheritance/class-inherit.c	Fri Mar 20 12:13:35 2009
@@ -65,7 +65,7 @@
 static gint
 gtree_compare_func (gconstpointer a, gconstpointer b, gpointer user_data)
 {
-	return (gint)a - (gint)b;
+	return GPOINTER_TO_INT(a) - GPOINTER_TO_INT(b);
 }
 
 gchar *

Modified: trunk/plugins/cvs-plugin/cvs-callbacks.c
==============================================================================
--- trunk/plugins/cvs-plugin/cvs-callbacks.c	(original)
+++ trunk/plugins/cvs-plugin/cvs-callbacks.c	Fri Mar 20 12:13:35 2009
@@ -60,7 +60,7 @@
 		gchar* message = g_strdup_printf(_("Please fill field: %s"), stringname);
 		GtkWidget* dlg = gtk_message_dialog_new(GTK_WINDOW(dialog), 
 			GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO,
-			GTK_BUTTONS_CLOSE, message);
+			GTK_BUTTONS_CLOSE, "%s", message);
 		gtk_dialog_run(GTK_DIALOG(dlg));
 		gtk_widget_destroy(dlg);
 		return FALSE;

Modified: trunk/plugins/cvs-plugin/cvs-interface.c
==============================================================================
--- trunk/plugins/cvs-plugin/cvs-interface.c	(original)
+++ trunk/plugins/cvs-plugin/cvs-interface.c	Fri Mar 20 12:13:35 2009
@@ -45,7 +45,7 @@
 	
 	cvs = anjuta_preferences_get(prefs, "cvs.path");
 	compression = anjuta_preferences_get_int(prefs, "cvs.compression");
-	ignorerc = anjuta_preferences_get_int(prefs, "cvs.ignorerc");
+	ignorerc = anjuta_preferences_get_bool(prefs, "cvs.ignorerc");
 	if (compression && ignorerc)
 		global_options = g_strdup_printf("-f -z%d", compression);
 	else if (compression)

Modified: trunk/plugins/debug-manager/command.c
==============================================================================
--- trunk/plugins/debug-manager/command.c	(original)
+++ trunk/plugins/debug-manager/command.c	Fri Mar 20 12:13:35 2009
@@ -1155,7 +1155,6 @@
 	gboolean ret = FALSE;
 	DmaDebuggerCommandType type = cmd->type & COMMAND_MASK;
 	IAnjutaDebuggerCallback callback = cmd->callback == NULL ? NULL : dma_debugger_queue_command_callback;
-	GFile* file;
 	switch (type)
 	{
 	case EMPTY_COMMAND:

Modified: trunk/plugins/debug-manager/info.c
==============================================================================
--- trunk/plugins/debug-manager/info.c	(original)
+++ trunk/plugins/debug-manager/info.c	Fri Mar 20 12:13:35 2009
@@ -179,7 +179,7 @@
 	if (!g_spawn_command_line_sync (command_line, &std_output,
 									NULL, NULL, &err))
 	{
-		g_warning (err->message);
+		g_warning ("%s", err->message);
 		g_error_free (err);
 
 		return FALSE;

Modified: trunk/plugins/debug-manager/registers.c
==============================================================================
--- trunk/plugins/debug-manager/registers.c	(original)
+++ trunk/plugins/debug-manager/registers.c	Fri Mar 20 12:13:35 2009
@@ -308,13 +308,13 @@
 on_find_register_list (gconstpointer a, gconstpointer b)
 {
 	const DmaThreadRegisterList *regs = (const DmaThreadRegisterList *)a;
-	guint thread = (gint)b;
+	guint thread = GPOINTER_TO_UINT(b);
 	
 	return regs->thread != thread;
 }
 
 static void
-dma_thread_set_register_list (CpuRegisters *self, gint thread)
+dma_thread_set_register_list (CpuRegisters *self, guint thread)
 {
 	GList *list;
 	DmaThreadRegisterList *regs;
@@ -323,7 +323,7 @@
 
 	if (self->current->thread != thread)
 	{
-		list = g_list_find_custom (self->list, (gconstpointer) thread, on_find_register_list);
+		list = g_list_find_custom (self->list, GUINT_TO_POINTER(thread), on_find_register_list);
 	
 		if (list == NULL)
 		{

Modified: trunk/plugins/debug-manager/stack_trace.c
==============================================================================
--- trunk/plugins/debug-manager/stack_trace.c	(original)
+++ trunk/plugins/debug-manager/stack_trace.c	Fri Mar 20 12:13:35 2009
@@ -381,13 +381,13 @@
 on_find_stack_trace (gconstpointer a, gconstpointer b)
 {
 	const DmaThreadStackTrace *trace = (const DmaThreadStackTrace *)a;
-	guint thread = (gint)b;
+	guint thread = GPOINTER_TO_UINT(b);
 	
 	return trace->thread != thread;
 }
 
 static void
-dma_thread_set_stack_trace (StackTrace *self, gint thread)
+dma_thread_set_stack_trace (StackTrace *self, guint thread)
 {
 	GList *list;
 	DmaThreadStackTrace *trace;
@@ -396,7 +396,7 @@
 	{
 		self->current_frame = 0;
 		
-		list = g_list_find_custom (self->list, (gconstpointer) thread, on_find_stack_trace);
+		list = g_list_find_custom (self->list, GINT_TO_POINTER(thread), on_find_stack_trace);
 	
 		if (list == NULL)
 		{

Modified: trunk/plugins/document-manager/action-callbacks.c
==============================================================================
--- trunk/plugins/document-manager/action-callbacks.c	(original)
+++ trunk/plugins/document-manager/action-callbacks.c	Fri Mar 20 12:13:35 2009
@@ -710,7 +710,7 @@
 	DocmanPlugin *plugin;
 	plugin = ANJUTA_PLUGIN_DOCMAN (user_data);
 	state = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
-	anjuta_preferences_set_int (plugin->prefs,
+	anjuta_preferences_set_bool (plugin->prefs,
 								VIEW_LINENUMBERS_MARGIN, state);
 }
 
@@ -721,7 +721,7 @@
 	DocmanPlugin *plugin;
 	plugin = ANJUTA_PLUGIN_DOCMAN (user_data);
 	state = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
-	anjuta_preferences_set_int (plugin->prefs,
+	anjuta_preferences_set_bool (plugin->prefs,
 								VIEW_MARKER_MARGIN, state);
 }
 
@@ -732,7 +732,7 @@
 	DocmanPlugin *plugin;
 	plugin = ANJUTA_PLUGIN_DOCMAN (user_data);
 	state = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
-	anjuta_preferences_set_int (plugin->prefs,
+	anjuta_preferences_set_bool (plugin->prefs,
 								VIEW_FOLD_MARGIN, state);
 }
 
@@ -743,7 +743,7 @@
 	DocmanPlugin *plugin;
 	plugin = ANJUTA_PLUGIN_DOCMAN (user_data);
 	state = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
-	anjuta_preferences_set_int (plugin->prefs,
+	anjuta_preferences_set_bool (plugin->prefs,
 								VIEW_INDENTATION_GUIDES, state);
 }
 
@@ -754,7 +754,7 @@
 	DocmanPlugin *plugin;
 	plugin = ANJUTA_PLUGIN_DOCMAN (user_data);
 	state = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
-	anjuta_preferences_set_int (plugin->prefs,
+	anjuta_preferences_set_bool (plugin->prefs,
 								VIEW_WHITE_SPACES, state);
 }
 
@@ -765,7 +765,7 @@
 	DocmanPlugin *plugin;
 	plugin = ANJUTA_PLUGIN_DOCMAN (user_data);
 	state = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
-	anjuta_preferences_set_int (plugin->prefs,
+	anjuta_preferences_set_bool (plugin->prefs,
 								VIEW_EOL, state);
 }
 
@@ -776,7 +776,7 @@
 	DocmanPlugin *plugin;
 	plugin = ANJUTA_PLUGIN_DOCMAN (user_data);
 	state = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
-	anjuta_preferences_set_int (plugin->prefs,
+	anjuta_preferences_set_bool (plugin->prefs,
 								VIEW_LINE_WRAP, state);
 }
 

Modified: trunk/plugins/document-manager/anjuta-docman.c
==============================================================================
--- trunk/plugins/document-manager/anjuta-docman.c	(original)
+++ trunk/plugins/document-manager/anjuta-docman.c	Fri Mar 20 12:13:35 2009
@@ -297,7 +297,7 @@
 {
 	docman->priv->tab_pressed = FALSE;
 
-	if (anjuta_preferences_get_int (docman->priv->preferences, EDITOR_TABS_RECENT_FIRST))
+	if (anjuta_preferences_get_bool (docman->priv->preferences, EDITOR_TABS_RECENT_FIRST))
 	{
 		GList *node;
 
@@ -685,7 +685,7 @@
 		ianjuta_file_savable_save_as (IANJUTA_FILE_SAVABLE (doc), file, NULL);
 	}
 	
-	if (anjuta_preferences_get_int (ANJUTA_PREFERENCES (docman->priv->preferences),
+	if (anjuta_preferences_get_bool (ANJUTA_PREFERENCES (docman->priv->preferences),
 									EDITOR_TABS_ORDERING))
 		anjuta_docman_order_tabs (docman);
 
@@ -901,8 +901,8 @@
 		 */
 		if (!docman->priv->tab_pressed	/* after a tab-click, sorting is done upon release */
 			&& !g_tabbing
-			&& !anjuta_preferences_get_int (docman->priv->preferences, EDITOR_TABS_ORDERING)
-			&& anjuta_preferences_get_int (docman->priv->preferences, EDITOR_TABS_RECENT_FIRST))
+			&& !anjuta_preferences_get_bool (docman->priv->preferences, EDITOR_TABS_ORDERING)
+			&& anjuta_preferences_get_bool (docman->priv->preferences, EDITOR_TABS_RECENT_FIRST))
 		{
 			gtk_notebook_reorder_child (notebook, page->widget, 0);
 		}
@@ -1166,7 +1166,7 @@
 											  page->widget);
 			gtk_notebook_set_current_page (GTK_NOTEBOOK (docman), page_num);
 
-			if (anjuta_preferences_get_int (ANJUTA_PREFERENCES (docman->priv->preferences),
+			if (anjuta_preferences_get_bool (ANJUTA_PREFERENCES (docman->priv->preferences),
 											EDITOR_TABS_ORDERING))
 				anjuta_docman_order_tabs (docman);
 

Modified: trunk/plugins/document-manager/plugin.c
==============================================================================
--- trunk/plugins/document-manager/plugin.c	(original)
+++ trunk/plugins/document-manager/plugin.c	Fri Mar 20 12:13:35 2009
@@ -577,7 +577,7 @@
 		GtkAction *action;
 		gboolean state;
 		
-		state = anjuta_preferences_get_int (eplugin->prefs, prefs[i]);
+		state = anjuta_preferences_get_bool (eplugin->prefs, prefs[i]);
 		action = anjuta_ui_get_action (eplugin->ui, "ActionGroupEditorView",
 									   actions_view[i].name);
 		gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), state);
@@ -1326,7 +1326,7 @@
 		gint cur_page;
 		plugin->g_tabbing = FALSE;
 		
-		if (anjuta_preferences_get_int (plugin->prefs,
+		if (anjuta_preferences_get_bool (plugin->prefs,
 										EDITOR_TABS_RECENT_FIRST))
 		{
 			/*
@@ -1450,8 +1450,8 @@
 static void
 docman_plugin_set_tab_pos (DocmanPlugin *ep)
 {
-	if (anjuta_preferences_get_int_with_default (ep->prefs, EDITOR_TABS_HIDE,
-												 1))
+	if (anjuta_preferences_get_bool_with_default (ep->prefs, EDITOR_TABS_HIDE,
+												 TRUE))
 	{
 		gtk_notebook_set_show_tabs (GTK_NOTEBOOK (ep->docman), FALSE);
 	}
@@ -1481,8 +1481,8 @@
 }
 
 static void
-on_gconf_notify_prefs (GConfClient *gclient, guint cnxn_id,
-					   GConfEntry *entry, gpointer user_data)
+on_notify_prefs (AnjutaPreferences* prefs, 
+                 const gchar* key, gint value, gpointer user_data)
 {
 	DocmanPlugin *ep = ANJUTA_PLUGIN_DOCMAN (user_data);
 	docman_plugin_set_tab_pos (ep);
@@ -1505,7 +1505,7 @@
 		return FALSE;
 
 	prefs = anjuta_shell_get_preferences (docman->shell, NULL);
-	if (anjuta_preferences_get_int (prefs, SAVE_AUTOMATIC) == FALSE)
+	if (anjuta_preferences_get_bool (prefs, SAVE_AUTOMATIC) == FALSE)
 	{
 		plugin->autosave_on = FALSE;
 		return FALSE;
@@ -1554,22 +1554,21 @@
 }
 
 static void
-on_gconf_notify_timer (GConfClient *gclient, guint cnxn_id,
-					   GConfEntry *entry, gpointer user_data)
+on_notify_timer (AnjutaPreferences* prefs,
+                 const gchar* key,
+                 gboolean value,
+                 gpointer user_data)
 {
 	DocmanPlugin *plugin;
 	AnjutaDocman *docman;
-	AnjutaPreferences* prefs;
 	gint auto_save_timer;
 	gboolean auto_save;
 	
 	plugin = ANJUTA_PLUGIN_DOCMAN (user_data);
 	docman = ANJUTA_DOCMAN (plugin->docman);
-
-	prefs = anjuta_shell_get_preferences (docman->shell, NULL);
 	
 	auto_save_timer = anjuta_preferences_get_int(prefs, AUTOSAVE_TIMER);
-	auto_save = anjuta_preferences_get_int(prefs, SAVE_AUTOMATIC);
+	auto_save = anjuta_preferences_get_bool(prefs, SAVE_AUTOMATIC);
 	
 	if (auto_save)
 	{
@@ -1599,8 +1598,8 @@
 	}
 }
 
-#define REGISTER_NOTIFY(key, func) \
-	notify_id = anjuta_preferences_notify_add (ep->prefs, \
+#define REGISTER_NOTIFY(key, func, type) \
+	notify_id = anjuta_preferences_notify_add_##type (ep->prefs, \
 											   key, func, ep, NULL); \
 	ep->gconf_notify_ids = g_list_prepend (ep->gconf_notify_ids, \
 										   GUINT_TO_POINTER (notify_id));
@@ -1609,12 +1608,12 @@
 {
 	guint notify_id;
 	docman_plugin_set_tab_pos (ep);
-	REGISTER_NOTIFY (EDITOR_TABS_HIDE, on_gconf_notify_prefs);
-	REGISTER_NOTIFY (EDITOR_TABS_POS, on_gconf_notify_prefs);
-	REGISTER_NOTIFY (AUTOSAVE_TIMER, on_gconf_notify_timer);
-	REGISTER_NOTIFY (SAVE_AUTOMATIC, on_gconf_notify_timer);
+	REGISTER_NOTIFY (EDITOR_TABS_HIDE, on_notify_prefs, bool);
+	REGISTER_NOTIFY (EDITOR_TABS_POS, on_notify_prefs, int);
+	REGISTER_NOTIFY (AUTOSAVE_TIMER, on_notify_timer, bool);
+	REGISTER_NOTIFY (SAVE_AUTOMATIC, on_notify_timer, bool);
 	
-	on_gconf_notify_timer(NULL,0,NULL, ep);
+	on_notify_timer(anjuta_preferences_default(), NULL, FALSE, ep);
 }
 
 static void

Modified: trunk/plugins/file-loader/plugin.c
==============================================================================
--- trunk/plugins/file-loader/plugin.c	(original)
+++ trunk/plugins/file-loader/plugin.c	Fri Mar 20 12:13:35 2009
@@ -222,9 +222,10 @@
 	parent =
 		gtk_widget_get_toplevel (GTK_WIDGET(ANJUTA_PLUGIN (plugin)->shell));
 	dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (parent),
-									 GTK_DIALOG_DESTROY_WITH_PARENT,
-									 GTK_MESSAGE_INFO,
-									 GTK_BUTTONS_OK_CANCEL, message);
+	                                             GTK_DIALOG_DESTROY_WITH_PARENT,
+	                                             GTK_MESSAGE_INFO,
+	                                             GTK_BUTTONS_OK_CANCEL, "%s",
+	                                             message);
 	g_free (message);
 	
 	hbox = gtk_hbox_new (FALSE, 5);

Modified: trunk/plugins/file-manager/Makefile.am
==============================================================================
--- trunk/plugins/file-manager/Makefile.am	(original)
+++ trunk/plugins/file-manager/Makefile.am	Fri Mar 20 12:13:35 2009
@@ -69,7 +69,10 @@
 	        --prefix=file_view_cclosure_marshal file-view-marshal.list --body >> xgen-gmc \
 	&& cp xgen-gmc $(@F) \
 	&& rm -f xgen-gmc	
-	
+
+prefs_glade_files = file-manager.glade
+include $(top_srcdir)/scripts/build-schemas.mk
+
 EXTRA_DIST = \
 	$(plugin_in_files) \
 	$(file_manager_plugin_DATA) \

Modified: trunk/plugins/file-manager/plugin.c
==============================================================================
--- trunk/plugins/file-manager/plugin.c	(original)
+++ trunk/plugins/file-manager/plugin.c	Fri Mar 20 12:13:35 2009
@@ -46,8 +46,8 @@
 #define PREF_FILTER_BACKUP "filemanager.filter.backup"
 #define PREF_FILTER_UNVERSIONED "filemanager.filter.unversioned"
 
-#define REGISTER_NOTIFY(key, func) \
-	notify_id = anjuta_preferences_notify_add (file_manager->prefs, \
+#define REGISTER_NOTIFY(key, func, type) \
+	notify_id = anjuta_preferences_notify_add_##type (file_manager->prefs, \
 											   key, func, file_manager, NULL); \
 	file_manager->gconf_notify_ids = g_list_prepend (file_manager->gconf_notify_ids, \
 										   GUINT_TO_POINTER(notify_id));
@@ -243,8 +243,10 @@
 }
 
 static void 
-on_gconf_notify_root(GConfClient *gclient, guint cnxn_id,
-					 GConfEntry *entry, gpointer user_data)
+on_notify_root(AnjutaPreferences* prefs,
+                         const gchar* key,
+                         const gchar* value,
+                         gpointer user_data)
 {
 	AnjutaFileManager* file_manager = (AnjutaFileManager*) user_data;
 	if (!file_manager->have_project)
@@ -253,19 +255,22 @@
 		file_view_refresh (file_manager->fv);
 	}
 }
+
 static void 
-on_gconf_notify(GConfClient *gclient, guint cnxn_id,
-				GConfEntry *entry, gpointer user_data)
+on_notify(AnjutaPreferences* prefs,
+          const gchar* key,
+          gboolean value,
+          gpointer user_data)
 {
 	AnjutaFileManager* file_manager = (AnjutaFileManager*) user_data;
 	GtkTreeModel* sort_model = gtk_tree_view_get_model (GTK_TREE_VIEW (file_manager->fv));
 	GtkTreeModel* file_model = gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT(sort_model));
 	
 	g_object_set (G_OBJECT (file_model),
-				  "filter_binary", anjuta_preferences_get_int (file_manager->prefs, PREF_FILTER_BINARY),
-				  "filter_hidden", anjuta_preferences_get_int (file_manager->prefs, PREF_FILTER_HIDDEN),
-				  "filter_backup", anjuta_preferences_get_int (file_manager->prefs, PREF_FILTER_BACKUP),
-				  "filter_unversioned", anjuta_preferences_get_int (file_manager->prefs, PREF_FILTER_UNVERSIONED), NULL);
+				  "filter_binary", anjuta_preferences_get_bool (file_manager->prefs, PREF_FILTER_BINARY),
+				  "filter_hidden", anjuta_preferences_get_bool (file_manager->prefs, PREF_FILTER_HIDDEN),
+				  "filter_backup", anjuta_preferences_get_bool (file_manager->prefs, PREF_FILTER_BACKUP),
+				  "filter_unversioned", anjuta_preferences_get_bool (file_manager->prefs, PREF_FILTER_UNVERSIONED), NULL);
 	file_view_refresh (file_manager->fv);
 }
 
@@ -329,12 +334,12 @@
 								 project_root_removed, NULL);
 	
 	
-	REGISTER_NOTIFY (PREF_ROOT, on_gconf_notify_root);
-	REGISTER_NOTIFY (PREF_FILTER_BINARY, on_gconf_notify);
-	REGISTER_NOTIFY (PREF_FILTER_BACKUP, on_gconf_notify);
-	REGISTER_NOTIFY (PREF_FILTER_HIDDEN, on_gconf_notify);
-	REGISTER_NOTIFY (PREF_FILTER_UNVERSIONED, on_gconf_notify);
-	on_gconf_notify (NULL, 0, NULL, file_manager);
+	REGISTER_NOTIFY (PREF_ROOT, on_notify_root, string);
+	REGISTER_NOTIFY (PREF_FILTER_BINARY, on_notify, bool);
+	REGISTER_NOTIFY (PREF_FILTER_BACKUP, on_notify, bool);
+	REGISTER_NOTIFY (PREF_FILTER_HIDDEN, on_notify, bool);
+	REGISTER_NOTIFY (PREF_FILTER_UNVERSIONED, on_notify, bool);
+	on_notify (anjuta_preferences_default(), NULL, FALSE, file_manager);
 	
 	return TRUE;
 }

Modified: trunk/plugins/gdb/debugger.c
==============================================================================
--- trunk/plugins/gdb/debugger.c	(original)
+++ trunk/plugins/gdb/debugger.c	Fri Mar 20 12:13:35 2009
@@ -3542,7 +3542,7 @@
 
 	g_return_if_fail (IS_DEBUGGER (debugger));
 
-	buff = g_strdup_printf ("-stack-select-frame %u", frame);
+	buff = g_strdup_printf ("-stack-select-frame %" G_GSIZE_FORMAT, frame);
 
 	debugger_queue_command (debugger, buff, FALSE, FALSE, (DebuggerParserFunc)debugger_set_frame_finish, NULL, (gpointer)frame);
 	g_free (buff);

Modified: trunk/plugins/language-support-cpp-java/cpp-java-assist.c
==============================================================================
--- trunk/plugins/language-support-cpp-java/cpp-java-assist.c	(original)
+++ trunk/plugins/language-support-cpp-java/cpp-java-assist.c	Fri Mar 20 12:13:35 2009
@@ -875,12 +875,12 @@
 					  gchar ch, CppJavaAssist *assist)
 {
 	gboolean enable_complete =
-		anjuta_preferences_get_int_with_default (assist->priv->preferences,
+		anjuta_preferences_get_bool_with_default (assist->priv->preferences,
 												 PREF_AUTOCOMPLETE_ENABLE,
 												 TRUE);
 	
 	gboolean enable_calltips =
-		anjuta_preferences_get_int_with_default (assist->priv->preferences,
+		anjuta_preferences_get_bool_with_default (assist->priv->preferences,
 												 PREF_CALLTIP_ENABLE,
 												 TRUE);
 	cpp_java_assist_check (assist, enable_complete, enable_calltips);
@@ -919,11 +919,11 @@
 	if (tag->is_func)
 	{
 		add_space_after_func =
-			anjuta_preferences_get_int_with_default (assist->priv->preferences,
+			anjuta_preferences_get_bool_with_default (assist->priv->preferences,
 													 PREF_AUTOCOMPLETE_SPACE_AFTER_FUNC,
 													 TRUE);
 		add_brace_after_func =
-			anjuta_preferences_get_int_with_default (assist->priv->preferences,
+			anjuta_preferences_get_bool_with_default (assist->priv->preferences,
 													 PREF_AUTOCOMPLETE_BRACE_AFTER_FUNC,
 													 TRUE);
 		if (add_space_after_func)

Modified: trunk/plugins/language-support-cpp-java/plugin.c
==============================================================================
--- trunk/plugins/language-support-cpp-java/plugin.c	(original)
+++ trunk/plugins/language-support-cpp-java/plugin.c	Fri Mar 20 12:13:35 2009
@@ -1392,7 +1392,7 @@
 	iter = ianjuta_iterable_clone (insert_pos, NULL);
 	
 	/* If autoindent is enabled*/
-	if (anjuta_preferences_get_int (plugin->prefs, PREF_INDENT_AUTOMATIC))
+	if (anjuta_preferences_get_bool (plugin->prefs, PREF_INDENT_AUTOMATIC))
 	{
 	
 		/* DEBUG_PRINT ("Char added at position %d: '%c'", insert_pos, ch); */	
@@ -1457,7 +1457,7 @@
 		}
 	}
 	
-	if (anjuta_preferences_get_int (plugin->prefs, PREF_BRACE_AUTOCOMPLETION))
+	if (anjuta_preferences_get_bool (plugin->prefs, PREF_BRACE_AUTOCOMPLETION))
 	{
 		if (ch == '[' || ch == '(')
 		{

Modified: trunk/plugins/macro/macro-util.c
==============================================================================
--- trunk/plugins/macro/macro-util.c	(original)
+++ trunk/plugins/macro/macro-util.c	Fri Mar 20 12:13:35 2009
@@ -41,7 +41,7 @@
 	gchar *buffer;
 
 	DateTime = g_new(gchar, 100);
-	sprintf(DateTime,ctime(&cur_time));
+	sprintf("%s", DateTime,ctime(&cur_time));
 	buffer = g_strndup(DateTime, strlen(DateTime) - 1);
 	g_free(DateTime);
 	return buffer;
@@ -148,7 +148,7 @@
 	gchar *ut;
 	
 	prefs = anjuta_shell_get_preferences ((ANJUTA_PLUGIN(plugin))->shell, NULL);
-	if (anjuta_preferences_get_int (prefs, "use.tabs"))
+	if (anjuta_preferences_get_bool (prefs, "use.tabs"))
 		ut = g_strdup("indent-tabs: t");
 	else
 		ut = g_strdup("");

Modified: trunk/plugins/message-view/anjuta-msgman.c
==============================================================================
--- trunk/plugins/message-view/anjuta-msgman.c	(original)
+++ trunk/plugins/message-view/anjuta-msgman.c	Fri Mar 20 12:13:35 2009
@@ -257,24 +257,20 @@
 }
 
 void
-on_gconf_notify_message_pref (GConfClient *gclient, guint cnxn_id,
-					   GConfEntry *entry, gpointer user_data)
+on_notify_message_pref (AnjutaPreferences* prefs, const gchar* key,
+                        const gchar* value, gpointer user_data)
 {
-	AnjutaPreferences *pref;
-	
-	pref = ANJUTA_MSGMAN (user_data)->priv->preferences;
-	set_message_tab(pref, GTK_NOTEBOOK (user_data));
+	set_message_tab(prefs, GTK_NOTEBOOK (user_data));
 }
 
 
 GtkWidget*
-anjuta_msgman_new (AnjutaPreferences *pref, GtkWidget *popup_menu)
+anjuta_msgman_new (GtkWidget *popup_menu)
 {
 	GtkWidget *msgman = NULL;
 	msgman = gtk_widget_new (ANJUTA_TYPE_MSGMAN, NULL);
 	if (msgman)
 	{
-	    ANJUTA_MSGMAN (msgman)->priv->preferences = pref;
 	    ANJUTA_MSGMAN (msgman)->priv->popup_menu = popup_menu;
 	}
 	return msgman;
@@ -373,7 +369,7 @@
 	g_return_val_if_fail (msgman != NULL, NULL);
 	g_return_val_if_fail (name != NULL, NULL);
 
-	mv = message_view_new (msgman->priv->preferences, msgman->priv->popup_menu);
+	mv = message_view_new (msgman->priv->popup_menu);
 	g_return_val_if_fail (mv != NULL, NULL);
 	g_object_set (G_OBJECT (mv), "highlite", TRUE, "label", name,
 				  "pixmap", pixmap, NULL);
@@ -531,8 +527,7 @@
 	{
 		gchar *label, *pixmap;
 		GtkWidget *view;
-		view = message_view_new (msgman->priv->preferences,
-								 msgman->priv->popup_menu);
+		view = message_view_new (msgman->priv->popup_menu);
 		g_return_val_if_fail (view != NULL, FALSE);
 		if (!message_view_deserialize (MESSAGE_VIEW (view), serializer))
 		{

Modified: trunk/plugins/message-view/anjuta-msgman.h
==============================================================================
--- trunk/plugins/message-view/anjuta-msgman.h	(original)
+++ trunk/plugins/message-view/anjuta-msgman.h	Fri Mar 20 12:13:35 2009
@@ -49,7 +49,7 @@
 };
 
 GType anjuta_msgman_get_type (void);
-GtkWidget *anjuta_msgman_new (AnjutaPreferences * pref, GtkWidget* popup_menu);
+GtkWidget *anjuta_msgman_new (GtkWidget* popup_menu);
 
 MessageView *anjuta_msgman_add_view (AnjutaMsgman * msgman,
 									 const gchar * name,
@@ -74,7 +74,7 @@
 									AnjutaSerializer *serializer);
 
 void
-on_gconf_notify_message_pref (GConfClient *gclient, guint cnxn_id,
-					   GConfEntry *entry, gpointer user_data);
+on_notify_message_pref (AnjutaPreferences* prefs, const gchar* key,
+                        const gchar* value, gpointer user_data);
 
 #endif /* _ANJUTA_MSGMAN_H */

Modified: trunk/plugins/message-view/message-view.c
==============================================================================
--- trunk/plugins/message-view/message-view.c	(original)
+++ trunk/plugins/message-view/message-view.c	Fri Mar 20 12:13:35 2009
@@ -17,13 +17,12 @@
 
 #include <libanjuta/anjuta-utils.h>
 #include <libanjuta/anjuta-debug.h>
+#include <libanjuta/anjuta-preferences.h>
 #include <libanjuta/interfaces/ianjuta-message-view.h>
 
 #include "message-view.h"
 #define MESSAGE_TYPE message_get_type()
 
-#define HAVE_TOOLTIP_API (GTK_MAJOR_VERSION > 2 || (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 12))
-
 struct _MessageViewPrivate
 {
 	//guint num_messages;
@@ -33,7 +32,6 @@
 	GtkTreeModel *model;
 	GtkTreeModel *filter;
 	
-	AnjutaPreferences* prefs;
 	GtkWidget *popup_menu;
 	
 	gint adj_chgd_hdlr;
@@ -47,15 +45,8 @@
 	gchar *pixmap;
 	gboolean highlite;
 	
-#if !HAVE_TOOLTIP_API
-	GdkRectangle tooltip_rect;
-	GtkWidget *tooltip_window;
-	gulong tooltip_timeout;
-	PangoLayout *tooltip_layout;
-#endif
-	
 	/* gconf notification ids */
-	GList *gconf_notify_ids;
+	GList *notify_ids;
 };
 
 typedef struct
@@ -230,7 +221,6 @@
 	return g_string_free (gstr, FALSE);
 }
 
-#if HAVE_TOOLTIP_API
 static gboolean
 message_view_query_tooltip (GtkWidget* widget, gint x, gint y, gboolean keyboard,
 						 GtkTooltip* tooltip)
@@ -270,224 +260,6 @@
 	}
 	return FALSE;
 }
-#endif
-
-#if !HAVE_TOOLTIP_API
-/* Tooltip operations -- taken from gtodo */
-
-static gchar *
-tooltip_get_display_text (MessageView *view)
-{
-	GtkTreePath *path;
-	GtkTreeIter iter;
-	GtkTreeModel *model;
-	
-	model = view->privat->model;
-	
-	if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW(view->privat->tree_view),
-		view->privat->tooltip_rect.x, view->privat->tooltip_rect.y,
-		&path, NULL, NULL, NULL))
-	{
-		Message *message;
-		gchar *text, *title, *desc;
-		
-		gtk_tree_model_get_iter (model, &iter, path);
-		gtk_tree_model_get (model, &iter, COLUMN_MESSAGE, &message, -1); 
-		gtk_tree_path_free(path);
-		
-		if (!message->details || !message->summary ||
-			strlen (message->details) <= 0 ||
-			strlen (message->summary) <= 0)
-			return NULL;
-		
-		title = escape_string (message->summary);
-		desc = escape_string (message->details);
-		text = g_strdup_printf ("<b>%s</b>\n%s", title, desc);
-		
-		g_free (title);
-		g_free (desc);
-		
-		return text;
-	}
-	return NULL;
-}
-
-static void
-tooltip_paint (GtkWidget *widget, GdkEventExpose *event, MessageView *view)
-{
-	GtkStyle *style;
-	gchar *tooltiptext;
-
-	tooltiptext = tooltip_get_display_text (view);
-	
-	if (!tooltiptext)
-		tooltiptext = g_strdup (_("No message details"));
-
-	pango_layout_set_markup (view->privat->tooltip_layout,
-							 tooltiptext,
-							 strlen (tooltiptext));
-	pango_layout_set_wrap(view->privat->tooltip_layout, PANGO_WRAP_CHAR);
-	pango_layout_set_width(view->privat->tooltip_layout, 600000);
-	style = view->privat->tooltip_window->style;
-
-	gtk_paint_flat_box (style, view->privat->tooltip_window->window,
-						GTK_STATE_NORMAL, GTK_SHADOW_OUT,
-						NULL, view->privat->tooltip_window,
-						"tooltip", 0, 0, -1, -1);
-
-	gtk_paint_layout (style, view->privat->tooltip_window->window,
-					  GTK_STATE_NORMAL, TRUE,
-					  NULL, view->privat->tooltip_window,
-					  "tooltip", 4, 4, view->privat->tooltip_layout);
-	/*
-	   g_object_unref(layout);
-	   */
-	g_free(tooltiptext);
-	return;
-}
-
-static gboolean
-tooltip_timeout (MessageView *view)
-{
-	gint scr_w,scr_h, w, h, x, y;
-	gchar *tooltiptext;
-
-	tooltiptext = tooltip_get_display_text (view);
-	
-	if (!tooltiptext)
-		tooltiptext = g_strdup (_("No message details"));
-	
-	view->privat->tooltip_window = gtk_window_new (GTK_WINDOW_POPUP);
-	view->privat->tooltip_window->parent = view->privat->tree_view;
-	gtk_widget_set_app_paintable (view->privat->tooltip_window, TRUE);
-	gtk_window_set_resizable (GTK_WINDOW(view->privat->tooltip_window), FALSE);
-	gtk_widget_set_name (view->privat->tooltip_window, "gtk-tooltips");
-	g_signal_connect (G_OBJECT(view->privat->tooltip_window), "expose_event",
-					  G_CALLBACK(tooltip_paint), view);
-	gtk_widget_ensure_style (view->privat->tooltip_window);
-
-	view->privat->tooltip_layout =
-		gtk_widget_create_pango_layout (view->privat->tooltip_window, NULL);
-	pango_layout_set_wrap (view->privat->tooltip_layout, PANGO_WRAP_CHAR);
-	pango_layout_set_width (view->privat->tooltip_layout, 600000);
-	pango_layout_set_markup (view->privat->tooltip_layout, tooltiptext,
-							 strlen (tooltiptext));
-	scr_w = gdk_screen_width();
-	scr_h = gdk_screen_height();
-	pango_layout_get_size (view->privat->tooltip_layout, &w, &h);
-	w = PANGO_PIXELS(w) + 8;
-	h = PANGO_PIXELS(h) + 8;
-
-	gdk_window_get_pointer (NULL, &x, &y, NULL);
-	if (GTK_WIDGET_NO_WINDOW (view->privat->tree_view))
-		y += view->privat->tree_view->allocation.y;
-
-	x -= ((w >> 1) + 4);
-
-	if ((x + w) > scr_w)
-		x -= (x + w) - scr_w;
-	else if (x < 0)
-		x = 0;
-
-	if ((y + h + 4) > scr_h)
-		y = y - h;
-	else
-		y = y + 6;
-	/*
-	   g_object_unref(layout);
-	   */
-	gtk_widget_set_size_request (view->privat->tooltip_window, w, h);
-	gtk_window_move (GTK_WINDOW (view->privat->tooltip_window), x, y);
-	gtk_widget_show (view->privat->tooltip_window);
-	g_free (tooltiptext);
-	
-	return FALSE;
-}
-
-static gboolean
-tooltip_motion_cb (GtkWidget *tv, GdkEventMotion *event, MessageView *view)
-{
-	GtkTreePath *path;
-	
-	if (view->privat->tooltip_rect.y == 0 &&
-		view->privat->tooltip_rect.height == 0 &&
-		view->privat->tooltip_timeout)
-	{
-		g_source_remove (view->privat->tooltip_timeout);
-		view->privat->tooltip_timeout = 0;
-		if (view->privat->tooltip_window) {
-			gtk_widget_destroy (view->privat->tooltip_window);
-			view->privat->tooltip_window = NULL;
-		}
-		return FALSE;
-	}
-	if (view->privat->tooltip_timeout) {
-		if (((int)event->y > view->privat->tooltip_rect.y) &&
-			(((int)event->y - view->privat->tooltip_rect.height)
-				< view->privat->tooltip_rect.y))
-			return FALSE;
-
-		if(event->y == 0)
-		{
-			g_source_remove (view->privat->tooltip_timeout);
-			view->privat->tooltip_timeout = 0;
-			return FALSE;
-		}
-		/* We've left the cell.  Remove the timeout and create a new one below */
-		if (view->privat->tooltip_window) {
-			gtk_widget_destroy (view->privat->tooltip_window);
-			view->privat->tooltip_window = NULL;
-		}
-		g_source_remove (view->privat->tooltip_timeout);
-		view->privat->tooltip_timeout = 0;
-	}
-
-	if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW(view->privat->tree_view),
-									   event->x, event->y, &path,
-									   NULL, NULL, NULL))
-	{
-		GtkTreeSelection *selection;
-		
-		selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(view->privat->tree_view));
-		if (gtk_tree_selection_path_is_selected (selection, path))
-		{
-			gtk_tree_view_get_cell_area (GTK_TREE_VIEW (view->privat->tree_view),
-										 path, NULL, &view->privat->tooltip_rect);
-			
-			if (view->privat->tooltip_rect.y != 0 &&
-				view->privat->tooltip_rect.height != 0)
-			{
-				gchar *tooltiptext;
-				
-				tooltiptext = tooltip_get_display_text (view);
-				if (tooltiptext == NULL)
-					return FALSE;
-				g_free (tooltiptext);
-				
-				view->privat->tooltip_timeout =
-					g_timeout_add (500, (GSourceFunc) tooltip_timeout, view);
-			}
-		}
-		gtk_tree_path_free (path);
-	}
-	return FALSE;
-}
-
-static void
-tooltip_leave_cb (GtkWidget *w, GdkEventCrossing *e, MessageView *view)
-{
-	if (view->privat->tooltip_timeout) {
-		g_source_remove (view->privat->tooltip_timeout);
-		view->privat->tooltip_timeout = 0;
-	}
-	if (view->privat->tooltip_window) {
-		gtk_widget_destroy (view->privat->tooltip_window);
-		g_object_unref (view->privat->tooltip_layout);
-		view->privat->tooltip_window = NULL;
-	}
-}
-#endif
-
 
 /* MessageView signal callbacks */
 /* Send a signal if a message was double-clicked or ENTER or SPACE was pressed */
@@ -664,23 +436,11 @@
 message_view_dispose (GObject *obj)
 {
 	MessageView *mview = MESSAGE_VIEW (obj);
-	if (mview->privat->gconf_notify_ids)
+	if (mview->privat->notify_ids)
 	{
 		prefs_finalize (mview);
-		mview->privat->gconf_notify_ids = NULL;
-	}
-#if !HAVE_TOOLTIP_API
-	if (mview->privat->tooltip_timeout) {
-		g_source_remove (mview->privat->tooltip_timeout);
-		mview->privat->tooltip_timeout = 0;
-	}
-
-	if (mview->privat->tooltip_window) {
-		gtk_widget_destroy (mview->privat->tooltip_window);
-		g_object_unref (mview->privat->tooltip_layout);
-		mview->privat->tooltip_window = NULL;
+		mview->privat->notify_ids = NULL;
 	}
-#endif
 	if (mview->privat->tree_view)
 	{
 		mview->privat->tree_view = NULL;
@@ -867,14 +627,9 @@
 	/* Connect signals */
 	g_signal_connect (G_OBJECT(self->privat->tree_view), "event", 
 					  G_CALLBACK (on_message_event), self);
-#if !HAVE_TOOLTIP_API
-	g_signal_connect (G_OBJECT (self->privat->tree_view), "motion-notify-event",
-					  G_CALLBACK (tooltip_motion_cb), self);
-	g_signal_connect (G_OBJECT (self->privat->tree_view), "leave-notify-event",
-					  G_CALLBACK (tooltip_leave_cb), self);
-#else
+	
 	g_object_set (G_OBJECT(self), "has-tooltip", TRUE, NULL);
-#endif
+
 }
 
 static void
@@ -892,9 +647,8 @@
 	gobject_class->finalize = message_view_finalize;
 	gobject_class->dispose = message_view_dispose;
 	
-#if HAVE_TOOLTIP_API
 	widget_class->query_tooltip = message_view_query_tooltip;
-#endif
+
 	
 	message_view_spec_label = g_param_spec_string ("label",
 						       "Label of the view",
@@ -928,10 +682,9 @@
 
 /* Returns a new message-view instance */
 GtkWidget *
-message_view_new (AnjutaPreferences* prefs, GtkWidget* popup_menu)
+message_view_new (GtkWidget* popup_menu)
 {
 	MessageView * mv = MESSAGE_VIEW (g_object_new (message_view_get_type (), NULL));
-	mv->privat->prefs = prefs;
 	mv->privat->popup_menu = popup_menu;
 	prefs_init (mv);
 	return GTK_WIDGET(mv);
@@ -1240,7 +993,7 @@
 	GtkTreeIter iter;
 	gboolean success;
 	
-	color = anjuta_preferences_get (mview->privat->prefs, color_pref_key);
+	color = anjuta_preferences_get (anjuta_preferences_default(), color_pref_key);
 	store = GTK_LIST_STORE (mview->privat->model);
 	success = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter);
 	while (success)
@@ -1259,49 +1012,47 @@
 
 
 static void
-on_gconf_notify_color_warning (GConfClient *gclient, guint cnxn_id,
-							   GConfEntry *entry, gpointer user_data)
+on_notify_color (AnjutaPreferences* prefs, const gchar* key,
+                 const gchar* value, gpointer user_data)
 {
 	pref_change_color (MESSAGE_VIEW (user_data),
 					   IANJUTA_MESSAGE_VIEW_TYPE_WARNING,
-					   "messages.color.warning");
-}
-
-static void
-on_gconf_notify_color_error (GConfClient *gclient, guint cnxn_id,
-							 GConfEntry *entry, gpointer user_data)
-{
-	pref_change_color (MESSAGE_VIEW (user_data),
-					   IANJUTA_MESSAGE_VIEW_TYPE_ERROR,
-					   "messages.color.error");
+					   key);
 }
 
-#define REGISTER_NOTIFY(key, func) \
-	notify_id = anjuta_preferences_notify_add (mview->privat->prefs, \
-											   key, func, mview, NULL); \
-	mview->privat->gconf_notify_ids = g_list_prepend (mview->privat->gconf_notify_ids, \
-										   GINT_TO_POINTER(notify_id));
 static void
 prefs_init (MessageView *mview)
 {
-	guint notify_id;
-	REGISTER_NOTIFY ("messages.color.warning", on_gconf_notify_color_warning);
-	REGISTER_NOTIFY ("messages.color.error", on_gconf_notify_color_error);
+	gint id;
+	id = anjuta_preferences_notify_add_string (anjuta_preferences_default (),
+	                                           "messages.color.error",
+	                                           on_notify_color,
+	                                           mview,
+	                                           NULL);
+	mview->privat->notify_ids = g_list_append (mview->privat->notify_ids,
+	                                           GINT_TO_POINTER (id));	
+	id = anjuta_preferences_notify_add_string (anjuta_preferences_default (),
+	                                      "messages.color.warning",
+	                                      on_notify_color,
+	                                      mview,
+	                                      NULL);
+	mview->privat->notify_ids = g_list_append (mview->privat->notify_ids,
+	                                         GINT_TO_POINTER (id));
 }
 
 static void
 prefs_finalize (MessageView *mview)
 {
 	GList *node;
-	node = mview->privat->gconf_notify_ids;
+	node = mview->privat->notify_ids;
 	while (node)
 	{
-		anjuta_preferences_notify_remove (mview->privat->prefs,
+		anjuta_preferences_notify_remove (anjuta_preferences_default(),
 										  GPOINTER_TO_INT (node->data));
 		node = g_list_next (node);
 	}
-	g_list_free (mview->privat->gconf_notify_ids);
-	mview->privat->gconf_notify_ids = NULL;
+	g_list_free (mview->privat->notify_ids);
+	mview->privat->notify_ids = NULL;
 }
 
 /* IAnjutaMessageView interface implementation */
@@ -1405,14 +1156,14 @@
 				stock_id = GTK_STOCK_INFO;
 				break;
 			case IANJUTA_MESSAGE_VIEW_TYPE_WARNING:
-				color = anjuta_preferences_get (view->privat->prefs,
+				color = anjuta_preferences_get (anjuta_preferences_default(),
 									  "messages.color.warning");
 				/* FIXME: There is no GTK_STOCK_WARNING which would fit better here */
 				view->privat->warn_count++;
 				stock_id = GTK_STOCK_DIALOG_WARNING;
 				break;
 			case IANJUTA_MESSAGE_VIEW_TYPE_ERROR:
-				color = anjuta_preferences_get (view->privat->prefs,
+				color = anjuta_preferences_get (anjuta_preferences_default(),
 									  "messages.color.error");
 				view->privat->error_count++;
 				stock_id = GTK_STOCK_STOP;

Modified: trunk/plugins/message-view/message-view.h
==============================================================================
--- trunk/plugins/message-view/message-view.h	(original)
+++ trunk/plugins/message-view/message-view.h	Fri Mar 20 12:13:35 2009
@@ -58,7 +58,7 @@
 
 /* Note: MessageView implements IAnjutaMessageView interface */
 GType message_view_get_type (void);
-GtkWidget* message_view_new (AnjutaPreferences* prefs, GtkWidget* popup_menu);
+GtkWidget* message_view_new (GtkWidget* popup_menu);
 
 void message_view_next(MessageView* view);
 void message_view_previous(MessageView* view);

Modified: trunk/plugins/message-view/plugin.c
==============================================================================
--- trunk/plugins/message-view/plugin.c	(original)
+++ trunk/plugins/message-view/plugin.c	Fri Mar 20 12:13:35 2009
@@ -216,7 +216,7 @@
 	mv_plugin->uiid = anjuta_ui_merge (ui, UI_FILE);
 	popup = gtk_ui_manager_get_widget (GTK_UI_MANAGER (ui), "/PopupMessageView");
 	mv_plugin->msgman = 
-		anjuta_msgman_new(anjuta_shell_get_preferences(plugin->shell, NULL), popup);
+		anjuta_msgman_new(popup);
 	g_signal_connect(G_OBJECT(mv_plugin->msgman), "view_changed", 
 					 G_CALLBACK(on_view_changed), mv_plugin);
 	GtkAction* action_next = anjuta_ui_get_action (ui, "ActionGroupGotoMessages",
@@ -416,8 +416,8 @@
 		anjuta_preferences_add_page (prefs, gxml,
 									"Messages", _("Messages"),
 									 ANJUTA_PIXMAP_MESSAGES);
-		notify_id = anjuta_preferences_notify_add (prefs, MESSAGES_TABS_POS, 
-			on_gconf_notify_message_pref, plugin->msgman, NULL);
+		notify_id = anjuta_preferences_notify_add_string (prefs, MESSAGES_TABS_POS, 
+		                                                on_notify_message_pref, plugin->msgman, NULL);
 		
 		g_object_unref (gxml);
 }

Modified: trunk/plugins/project-import/project-import.c
==============================================================================
--- trunk/plugins/project-import/project-import.c	(original)
+++ trunk/plugins/project-import/project-import.c	Fri Mar 20 12:13:35 2009
@@ -116,7 +116,7 @@
 										  GTK_DIALOG_DESTROY_WITH_PARENT,
 										  GTK_MESSAGE_ERROR,
 										  GTK_BUTTONS_CLOSE,
-										  message_text));
+										  "%s", message_text));
 		
 		g_free(message_text);
 	

Modified: trunk/plugins/project-wizard/druid.c
==============================================================================
--- trunk/plugins/project-wizard/druid.c	(original)
+++ trunk/plugins/project-wizard/druid.c	Fri Mar 20 12:13:35 2009
@@ -341,10 +341,8 @@
 static gboolean
 npw_druid_fill_selection_page (NPWDruid* druid)
 {
-	gboolean ok;
 	gchar* dir;
 	const gchar * const * sys_dir;
-	const gchar * user_dir;
  
 	/* Remove all previous data */
 	druid->project_book = GTK_NOTEBOOK (gtk_assistant_get_nth_page (GTK_ASSISTANT (druid->window), PROJECT_PAGE));

Modified: trunk/plugins/project-wizard/parser.c
==============================================================================
--- trunk/plugins/project-wizard/parser.c	(original)
+++ trunk/plugins/project-wizard/parser.c	Fri Mar 20 12:13:35 2009
@@ -619,7 +619,7 @@
 
 	if (!g_file_get_contents (filename, &content, &len, &err))
 	{
- 		g_warning (err->message);
+ 		g_warning ("%s", err->message);
 		g_error_free (err);
 
 		return FALSE;
@@ -646,7 +646,7 @@
 	if (g_error_matches (err, parser_error_quark (), NPW_STOP_PARSING) == FALSE)
 	{
 		/* Parsing error */
-		g_warning (err->message);
+		g_warning ("%s", err->message);
 		g_error_free (err);
 		npw_header_free (header);
 
@@ -990,7 +990,7 @@
 
 	if (!g_file_get_contents (filename, &content, &len, &err))
 	{
-		g_warning (err->message);
+		g_warning ("%s", err->message);
 		g_error_free (err);
 
 		return FALSE;
@@ -1007,7 +1007,7 @@
 	if (err != NULL)
 	{
 		/* Parsing error */
-		g_warning (err->message);
+		g_warning ("%s", err->message);
 		g_error_free (err);
 
 		return FALSE;
@@ -1690,7 +1690,7 @@
 	g_markup_parse_context_parse (parser->ctx, text, len, &err);
 	if (err != NULL)
 	{
-		g_warning (err->message);
+		g_warning ("%s", err->message);
 	}
 
 	return TRUE;

Modified: trunk/plugins/run-program/execute.c
==============================================================================
--- trunk/plugins/run-program/execute.c	(original)
+++ trunk/plugins/run-program/execute.c	Fri Mar 20 12:13:35 2009
@@ -411,7 +411,7 @@
 
 	/* Take care of scratchbox */
 	prefs = anjuta_shell_get_preferences (ANJUTA_PLUGIN(plugin)->shell, NULL);
-	if (anjuta_preferences_get_int (prefs , PREF_USE_SB))
+	if (anjuta_preferences_get_bool (prefs , PREF_USE_SB))
 	{
 		const gchar* sb_path = anjuta_preferences_get(prefs, PREF_SB_PATH);
 		/* we need to skip the /scratchbox/users part, maybe could be done more clever */

Modified: trunk/plugins/scintilla/print.c
==============================================================================
--- trunk/plugins/scintilla/print.c	(original)
+++ trunk/plugins/scintilla/print.c	Fri Mar 20 12:13:35 2009
@@ -919,13 +919,13 @@
 	
 	/* Set preferences */
 	pji->print_line_numbers =
-		anjuta_preferences_get_int_with_default (p, PRINT_LINENUM_COUNT, 1);
+		anjuta_preferences_get_bool_with_default (p, PRINT_LINENUM_COUNT, 1);
 	pji->print_header =
-		anjuta_preferences_get_int_with_default (p, PRINT_HEADER, 1);
+		anjuta_preferences_get_bool_with_default (p, PRINT_HEADER, 1);
 	pji->print_color =
-		anjuta_preferences_get_int_with_default (p, PRINT_COLOR, 1);
+		anjuta_preferences_get_bool_with_default (p, PRINT_COLOR, 1);
 	pji->wrapping =
-		anjuta_preferences_get_int_with_default (p, PRINT_WRAP, 1);
+		anjuta_preferences_get_bool_with_default (p, PRINT_WRAP, 1);
 	pji->tab_width =
 		anjuta_preferences_get_int_with_default (p, TAB_SIZE, 8);
 	pji->zoom_factor = anjuta_preferences_get_int (te->preferences,

Modified: trunk/plugins/scintilla/text_editor.c
==============================================================================
--- trunk/plugins/scintilla/text_editor.c	(original)
+++ trunk/plugins/scintilla/text_editor.c	Fri Mar 20 12:13:35 2009
@@ -130,7 +130,7 @@
 	te->props_base = 0;
 	te->first_time_expose = TRUE;
 	te->encoding = NULL;
-	te->gconf_notify_ids = NULL;
+	te->notify_ids = NULL;
 	te->hover_tip_on = FALSE;
 	te->last_saved_content = NULL;
 	te->force_not_saved = FALSE;
@@ -612,10 +612,10 @@
 		te->editor_id = 0;
 		te->views = NULL;
 	}
-	if (te->gconf_notify_ids)
+	if (te->notify_ids)
 	{
 		text_editor_prefs_finalize (te);
-		te->gconf_notify_ids = NULL;
+		te->notify_ids = NULL;
 	}
 	G_OBJECT_CLASS (parent_class)->dispose (obj);
 }
@@ -671,7 +671,7 @@
 {
 	/* If syntax highlighting is disabled ... */
 	if (override_by_pref &&
-		anjuta_preferences_get_int (ANJUTA_PREFERENCES (te->preferences),
+		anjuta_preferences_get_bool (ANJUTA_PREFERENCES (te->preferences),
 									DISABLE_SYNTAX_HILIGHTING))
 	{
 		aneditor_command (editor_id, ANE_SETHILITE, (glong) "plain.txt", 0);
@@ -1406,7 +1406,7 @@
 		/* DEBUG_PRINT ("File size and loaded size not matching"); */
 	}
 	dos_filter = 
-		anjuta_preferences_get_int (ANJUTA_PREFERENCES (te->preferences),
+		anjuta_preferences_get_bool (ANJUTA_PREFERENCES (te->preferences),
 									DOS_EOL_CHECK);
 	
 	/* Set editor mode */
@@ -1528,7 +1528,7 @@
 		}				
 		
 		/* Strip trailing spaces */
-		strip = anjuta_preferences_get_int (te->preferences,
+		strip = anjuta_preferences_get_bool (te->preferences,
 											STRIP_TRAILING_SPACES);
 		if (strip)
 		{
@@ -1540,7 +1540,7 @@
 			data[size] = '\n';
 			++ size;
 		}
-		dos_filter = anjuta_preferences_get_int (te->preferences,
+		dos_filter = anjuta_preferences_get_bool (te->preferences,
 												 DOS_EOL_CHECK);
 		editor_mode =  scintilla_send_message (SCINTILLA (te->scintilla),
 											   SCI_GETEOLMODE, 0, 0);
@@ -1607,7 +1607,7 @@
 	scintilla_send_message (SCINTILLA (te->scintilla),
 							SCI_EMPTYUNDOBUFFER, 0, 0);
 	text_editor_set_hilite_type (te, NULL);
-	if (anjuta_preferences_get_int (te->preferences, FOLD_ON_OPEN))
+	if (anjuta_preferences_get_bool (te->preferences, FOLD_ON_OPEN))
 	{
 		aneditor_command (te->editor_id, ANE_CLOSE_FOLDALL, 0, 0);
 	}
@@ -2060,8 +2060,8 @@
 text_editor_set_line_number_width (TextEditor* te)
 {
 	/* Set line numbers with according to file size */
-	if (anjuta_preferences_get_int_with_default(te->preferences,
-			"margin.linenumber.visible", 0))
+	if (anjuta_preferences_get_bool_with_default(te->preferences,
+			"margin.linenumber.visible", FALSE))
 	{
 		int lines, line_number_width;
 		gchar* line_number;

Modified: trunk/plugins/scintilla/text_editor.h
==============================================================================
--- trunk/plugins/scintilla/text_editor.h	(original)
+++ trunk/plugins/scintilla/text_editor.h	Fri Mar 20 12:13:35 2009
@@ -95,8 +95,8 @@
 	/* Popup menu widget */
 	GtkWidget *popup_menu;
 	
-	/* Gconf notify IDs */
-	GList* gconf_notify_ids;
+	/* notify IDs */
+	GList* notify_ids;
 	
 	/* Current zoom factor */
 	gint zoom_factor;

Modified: trunk/plugins/scintilla/text_editor_prefs.c
==============================================================================
--- trunk/plugins/scintilla/text_editor_prefs.c	(original)
+++ trunk/plugins/scintilla/text_editor_prefs.c	Fri Mar 20 12:13:35 2009
@@ -62,7 +62,7 @@
 }
 
 static void
-pref_gconf_notify (GConfClient *gclient, guint cnxn_id,
+pref_notify (GConfClient *gclient, guint cnxn_id,
 				   GConfEntry *entry, gpointer user_data)
 {
 	PrefPassedData *pd = (PrefPassedData*)user_data;
@@ -87,6 +87,17 @@
 	return val;
 }
 
+static gint
+set_n_get_prop_bool (TextEditor *te, const gchar *key)
+{
+	gboolean val;
+	AnjutaPreferences *pr;
+	pr = te->preferences;
+	val = anjuta_preferences_get_bool (pr, key);
+	sci_prop_set_int_with_key (text_editor_get_props (), key, val);
+	return val;
+}
+
 static gchar *
 set_n_get_prop_string (TextEditor *te, const gchar *key)
 {
@@ -99,8 +110,10 @@
 }
 
 static void
-on_gconf_notify_disable_hilite (GConfClient *gclient, guint cnxn_id,
-								GConfEntry *entry, gpointer user_data)
+on_notify_disable_hilite (AnjutaPreferences* prefs,
+                          const gchar* key,
+                          gboolean value,
+                          gpointer user_data)
 {
 	TextEditor *te;
 	
@@ -110,12 +123,14 @@
 }
 
 static void
-on_gconf_notify_zoom_factor (GConfClient *gclient, guint cnxn_id,
-							 GConfEntry *entry, gpointer user_data)
+on_notify_zoom_factor(AnjutaPreferences* prefs,
+                      const gchar* key,
+                      gint value,
+                      gpointer user_data)
 {
 	TextEditor *te;
 	gint zoom_factor;
-	
+
 	te = TEXT_EDITOR (user_data);
 	zoom_factor = set_n_get_prop_int (te, TEXT_ZOOM_FACTOR);
 	text_editor_set_zoom_factor (te, zoom_factor);
@@ -123,222 +138,211 @@
 }
 
 static void
-on_gconf_notify_tab_size (GConfClient *gclient, guint cnxn_id,
-						  GConfEntry *entry, gpointer user_data)
+on_notify_tab_size (AnjutaPreferences* prefs,
+                    const gchar* key,
+                    gint value,
+                    gpointer user_data)
 {
 	TextEditor *te;
 	gint tab_size;
-	
+
 	te = TEXT_EDITOR (user_data);
 	tab_size = set_n_get_prop_int (te, TAB_SIZE);
 	text_editor_command (te, ANE_SETTABSIZE, tab_size, 0);
 }
 
 static void
-on_gconf_notify_use_tab_for_indentation (GConfClient *gclient, guint cnxn_id,
-										 GConfEntry *entry, gpointer user_data)
+on_notify_use_tab_for_indentation(AnjutaPreferences* prefs,
+                                  const gchar* key,
+                                  gboolean value,
+                                  gpointer user_data)
 {
 	TextEditor *te;
 	gboolean use_tabs;
-	
+
 	te = TEXT_EDITOR (user_data);
 	use_tabs = set_n_get_prop_int (te, USE_TABS);
 	text_editor_command (te, ANE_SETUSETABFORINDENT, use_tabs, 0);
 	// text_editor_scintilla_command (te, SCI_SETTABWIDTH,	use_tabs, 0);
 }
 
-#if 0
-static void
-on_gconf_notify_automatic_indentation (GConfClient *gclient, guint cnxn_id,
-									   GConfEntry *entry, gpointer user_data)
-{
-	TextEditor *te;
-	gboolean indent_automatic;
-	
-	te = TEXT_EDITOR (user_data);
-	indent_automatic = set_n_get_prop_int (te, INDENT_AUTOMATIC);
-	text_editor_command (te, ANE_SETAUTOINDENTATION, indent_automatic, 0);
-}
-#endif
-
 static void
-on_gconf_notify_indent_size (GConfClient *gclient, guint cnxn_id,
-							 GConfEntry *entry, gpointer user_data)
+on_notify_indent_size (AnjutaPreferences* prefs,
+                       const gchar* key,
+                       gint value,
+                       gpointer user_data)
 {
 	TextEditor *te;
 	gint indent_size;
-	
+
 	te = TEXT_EDITOR (user_data);
 	indent_size = set_n_get_prop_int (te, INDENT_SIZE);
 	text_editor_command (te, ANE_SETINDENTSIZE, indent_size, 0);
 }
 
 static void
-on_gconf_notify_wrap_bookmarks (GConfClient *gclient, guint cnxn_id,
-								GConfEntry *entry, gpointer user_data)
+on_notify_wrap_bookmarks(AnjutaPreferences* prefs,
+                         const gchar* key,
+                         gboolean value,
+                         gpointer user_data)
 {
 	TextEditor *te;
 	gboolean state;
-	
+
 	te = TEXT_EDITOR (user_data);
 	state = set_n_get_prop_int (te, WRAP_BOOKMARKS);
 	text_editor_command (te, ANE_SETWRAPBOOKMARKS, state, 0);
 }
 
 static void
-on_gconf_notify_braces_check (GConfClient *gclient, guint cnxn_id,
-							  GConfEntry *entry, gpointer user_data)
+on_notify_braces_check (AnjutaPreferences* prefs,
+                        const gchar* key,
+                        gboolean value,
+                        gpointer user_data)
 {
 	TextEditor *te;
 	gboolean state;
-	
+
 	te = TEXT_EDITOR (user_data);
 	state = set_n_get_prop_int (te, BRACES_CHECK);
 	text_editor_command (te, ANE_SETINDENTBRACESCHECK, state, 0);
 }
 
-#if 0
-static void
-on_gconf_notify_indent_opening (GConfClient *gclient, guint cnxn_id,
-								GConfEntry *entry, gpointer user_data)
-{
-	TextEditor *te;
-	gboolean state;
-	
-	te = TEXT_EDITOR (user_data);
-	state = set_n_get_prop_int (te, INDENT_OPENING);
-	text_editor_command (te, ANE_SETINDENTOPENING, state, 0);
-}
-
 static void
-on_gconf_notify_indent_closing (GConfClient *gclient, guint cnxn_id,
-								GConfEntry *entry, gpointer user_data)
+on_notify_indent_maintain (AnjutaPreferences* prefs,
+                           const gchar* key,
+                           gboolean value,
+                           gpointer user_data)
 {
 	TextEditor *te;
 	gboolean state;
-	
-	te = TEXT_EDITOR (user_data);
-	state = set_n_get_prop_int (te, INDENT_CLOSING);
-	text_editor_command (te, ANE_SETINDENTCLOSING, state, 0);
-}
-
-#endif
 
-static void
-on_gconf_notify_indent_maintain (GConfClient *gclient, guint cnxn_id,
-								 GConfEntry *entry, gpointer user_data)
-{
-	TextEditor *te;
-	gboolean state;
-	
 	te = TEXT_EDITOR (user_data);
 	state = set_n_get_prop_int (te, INDENT_MAINTAIN);
 	text_editor_command (te, ANE_SETINDENTMAINTAIN, state, 0);
 }
 
 static void
-on_gconf_notify_tab_indents (GConfClient *gclient, guint cnxn_id,
-							 GConfEntry *entry, gpointer user_data)
+on_notify_tab_indents (AnjutaPreferences* prefs,
+                       const gchar* key,
+                       gboolean value,
+                       gpointer user_data)
 {
 	TextEditor *te;
 	gboolean state;
-	
+
 	te = TEXT_EDITOR (user_data);
 	state = set_n_get_prop_int (te, TAB_INDENTS);
 	text_editor_command (te, ANE_SETTABINDENTS, state, 0);
 }
 
 static void
-on_gconf_notify_backspace_unindents (GConfClient *gclient, guint cnxn_id,
-									 GConfEntry *entry, gpointer user_data)
+on_notify_backspace_unindents (AnjutaPreferences* prefs,
+                               const gchar* key,
+                               gboolean value,
+                               gpointer user_data)
 {
 	TextEditor *te;
 	gboolean state;
-	
+
 	te = TEXT_EDITOR (user_data);
 	state = set_n_get_prop_int (te, BACKSPACE_UNINDENTS);
 	text_editor_command (te, ANE_SETBACKSPACEUNINDENTS, state, 0);
 }
 
 static void
-on_gconf_notify_view_eols (GConfClient *gclient, guint cnxn_id,
-							   GConfEntry *entry, gpointer user_data)
+on_notify_view_eols (AnjutaPreferences* prefs,
+                     const gchar* key,
+                     gint value,
+                     gpointer user_data)
 {
 	TextEditor *te;
 	gboolean state;
-	
+
 	te = TEXT_EDITOR (user_data);
 	state = set_n_get_prop_int (te, VIEW_EOL);
 	text_editor_command (te, ANE_VIEWEOL, state, 0);
 }
 
 static void
-on_gconf_notify_view_whitespaces (GConfClient *gclient, guint cnxn_id,
-								  GConfEntry *entry, gpointer user_data)
+on_notify_view_whitespaces (AnjutaPreferences* prefs,
+                            const gchar* key,
+                            gint value,
+                            gpointer user_data)
 {
 	TextEditor *te;
 	gboolean state;
-	
+
 	te = TEXT_EDITOR (user_data);
 	state = set_n_get_prop_int (te, VIEW_WHITE_SPACES);
 	text_editor_command (te, ANE_VIEWSPACE, state, 0);
 }
 
 static void
-on_gconf_notify_view_linewrap (GConfClient *gclient, guint cnxn_id,
-						  GConfEntry *entry, gpointer user_data)
+on_notify_view_linewrap (AnjutaPreferences* prefs,
+                         const gchar* key,
+                         gint value,
+                         gpointer user_data)
 {
 	TextEditor *te;
 	gboolean state;
-	
+
 	te = TEXT_EDITOR (user_data);
 	state = set_n_get_prop_int (te, VIEW_LINE_WRAP);
 	text_editor_command (te, ANE_LINEWRAP, state, 0);
 }
 
 static void
-on_gconf_notify_view_indentation_guides (GConfClient *gclient, guint cnxn_id,
-										 GConfEntry *entry, gpointer user_data)
+on_notify_view_indentation_guides (AnjutaPreferences* prefs,
+                                   const gchar* key,
+                                   gint value,
+                                   gpointer user_data)
 {
 	TextEditor *te;
 	gboolean state;
-	
+
 	te = TEXT_EDITOR (user_data);
 	state = set_n_get_prop_int (te, VIEW_INDENTATION_GUIDES);
 	text_editor_command (te, ANE_VIEWGUIDES, state, 0);
 }
 
 static void
-on_gconf_notify_view_folds (GConfClient *gclient, guint cnxn_id,
-							GConfEntry *entry, gpointer user_data)
+on_notify_view_folds (AnjutaPreferences* prefs,
+                      const gchar* key,
+                      gint value,
+                      gpointer user_data)
 {
 	TextEditor *te;
 	gboolean state;
-	
+
 	te = TEXT_EDITOR (user_data);
 	state = set_n_get_prop_int (te, VIEW_FOLD_MARGIN);
 	text_editor_command (te, ANE_FOLDMARGIN, state, 0);
 }
 
 static void
-on_gconf_notify_view_markers (GConfClient *gclient, guint cnxn_id,
-							  GConfEntry *entry, gpointer user_data)
+on_notify_view_markers (AnjutaPreferences* prefs,
+                        const gchar* key,
+                        gint value,
+                        gpointer user_data)
 {
 	TextEditor *te;
 	gboolean state;
-	
+
 	te = TEXT_EDITOR (user_data);
 	state = set_n_get_prop_int (te, VIEW_MARKER_MARGIN);
 	text_editor_command (te, ANE_SELMARGIN, state, 0);
 }
 
 static void
-on_gconf_notify_view_linenums (GConfClient *gclient, guint cnxn_id,
-							   GConfEntry *entry, gpointer user_data)
+on_notify_view_linenums (AnjutaPreferences* prefs,
+                         const gchar* key,
+                         gint value,
+                         gpointer user_data)
 {
 	TextEditor *te;
 	gboolean state;
-	
+
 	te = TEXT_EDITOR (user_data);
 	state = set_n_get_prop_int (te, VIEW_LINENUMBERS_MARGIN);
 	text_editor_command (te, ANE_LINENUMBERMARGIN, state, 0);
@@ -346,12 +350,14 @@
 }
 
 static void
-on_gconf_notify_fold_symbols (GConfClient *gclient, guint cnxn_id,
-							  GConfEntry *entry, gpointer user_data)
+on_notify_fold_symbols (AnjutaPreferences* prefs,
+                        const gchar* key,
+                        gint value,
+                        gpointer user_data)
 {
 	TextEditor *te;
 	gchar *symbols;
-	
+
 	te = TEXT_EDITOR (user_data);
 	symbols = set_n_get_prop_string (te, FOLD_SYMBOLS);
 	text_editor_command (te, ANE_SETFOLDSYMBOLS, (long)symbols, 0);
@@ -359,33 +365,37 @@
 }
 
 static void
-on_gconf_notify_fold_underline (GConfClient *gclient, guint cnxn_id,
-								GConfEntry *entry, gpointer user_data)
+on_notify_fold_underline (AnjutaPreferences* prefs,
+                          const gchar* key,
+                          gint value,
+                          gpointer user_data)
 {
 	TextEditor *te;
 	gboolean state;
-	
+
 	te = TEXT_EDITOR (user_data);
 	state = set_n_get_prop_int (te, FOLD_UNDERLINE);
 	text_editor_command (te, ANE_SETFOLDUNDERLINE, state, 0);
 }
 
 static void
-on_gconf_notify_edge_column (GConfClient *gclient, guint cnxn_id,
-								GConfEntry *entry, gpointer user_data)
+on_notify_edge_column (AnjutaPreferences* prefs,
+                       const gchar* key,
+                       gint value,
+                       gpointer user_data)
 {
 	TextEditor *te;
 	gint size;
-	
+
 	te = TEXT_EDITOR (user_data);
 	size = set_n_get_prop_int (te, EDGE_COLUMN);
 	text_editor_command (te, ANE_SETEDGECOLUMN, size, 0);
 }
 
-#define REGISTER_NOTIFY(key, func) \
-	notify_id = anjuta_preferences_notify_add (te->preferences, \
+#define REGISTER_NOTIFY(key, func, type) \
+	notify_id = anjuta_preferences_notify_add_##type (te->preferences, \
 											   key, func, te, NULL); \
-	te->gconf_notify_ids = g_list_prepend (te->gconf_notify_ids, \
+	te->notify_ids = g_list_prepend (te->notify_ids, \
 										   GUINT_TO_POINTER (notify_id));
 
 void
@@ -398,76 +408,68 @@
 	set_n_get_prop_int (te, TAB_SIZE);
 	set_n_get_prop_int (te, TEXT_ZOOM_FACTOR);
 	set_n_get_prop_int (te, INDENT_SIZE);
-	set_n_get_prop_int (te, USE_TABS);
-	set_n_get_prop_int (te, DISABLE_SYNTAX_HILIGHTING);
-	/* set_n_get_prop_int (te, INDENT_AUTOMATIC); */
-	set_n_get_prop_int (te, WRAP_BOOKMARKS);
-	set_n_get_prop_int (te, BRACES_CHECK);
-	/*
-	set_n_get_prop_int (te, INDENT_OPENING);
-	set_n_get_prop_int (te, INDENT_CLOSING);
-	*/
+	set_n_get_prop_bool (te, USE_TABS);
+	set_n_get_prop_bool (te, DISABLE_SYNTAX_HILIGHTING);
+	set_n_get_prop_bool (te, WRAP_BOOKMARKS);
+	set_n_get_prop_bool (te, BRACES_CHECK);
+
 	
 	/* This one is special */
-	val = set_n_get_prop_int (te, INDENT_MAINTAIN);
+	val = set_n_get_prop_bool (te, INDENT_MAINTAIN);
 	if (val)
 		sci_prop_set_int_with_key (te->props_base, INDENT_MAINTAIN".*", 1);
 	else
-		sci_prop_set_with_key (te->props_base, INDENT_MAINTAIN".*", "");
+		sci_prop_set_int_with_key (te->props_base, INDENT_MAINTAIN".*", 0);
 	
-	set_n_get_prop_int (te, TAB_INDENTS);
-	set_n_get_prop_int (te, BACKSPACE_UNINDENTS);
+	set_n_get_prop_bool (te, TAB_INDENTS);
+	set_n_get_prop_bool (te, BACKSPACE_UNINDENTS);
 	
-	set_n_get_prop_int (te, VIEW_EOL);
-	set_n_get_prop_int (te, VIEW_LINE_WRAP);
-	set_n_get_prop_int (te, VIEW_WHITE_SPACES);
-	set_n_get_prop_int (te, VIEW_INDENTATION_GUIDES);
-	set_n_get_prop_int (te, VIEW_FOLD_MARGIN);
-	set_n_get_prop_int (te, VIEW_MARKER_MARGIN);
-	set_n_get_prop_int (te, VIEW_LINENUMBERS_MARGIN);
+	set_n_get_prop_bool (te, VIEW_EOL);
+	set_n_get_prop_bool (te, VIEW_LINE_WRAP);
+	set_n_get_prop_bool (te, VIEW_WHITE_SPACES);
+	set_n_get_prop_bool (te, VIEW_INDENTATION_GUIDES);
+	set_n_get_prop_bool (te, VIEW_FOLD_MARGIN);
+	set_n_get_prop_bool (te, VIEW_MARKER_MARGIN);
+	set_n_get_prop_bool (te, VIEW_LINENUMBERS_MARGIN);
 	g_free (set_n_get_prop_string (te, FOLD_SYMBOLS));
-	set_n_get_prop_int (te, FOLD_UNDERLINE);
+	set_n_get_prop_bool (te, FOLD_UNDERLINE);
 	set_n_get_prop_int (te, EDGE_COLUMN);
 	
 	/* Register gconf notifications */
-	REGISTER_NOTIFY (TAB_SIZE, on_gconf_notify_tab_size);
-	REGISTER_NOTIFY (TEXT_ZOOM_FACTOR, on_gconf_notify_zoom_factor);
-	REGISTER_NOTIFY (INDENT_SIZE, on_gconf_notify_indent_size);
-	REGISTER_NOTIFY (USE_TABS, on_gconf_notify_use_tab_for_indentation);
-	REGISTER_NOTIFY (DISABLE_SYNTAX_HILIGHTING, on_gconf_notify_disable_hilite);
-	/* REGISTER_NOTIFY (INDENT_AUTOMATIC, on_gconf_notify_automatic_indentation); */
-	REGISTER_NOTIFY (WRAP_BOOKMARKS, on_gconf_notify_wrap_bookmarks);
-	REGISTER_NOTIFY (BRACES_CHECK, on_gconf_notify_braces_check);
-	/*
-	REGISTER_NOTIFY (INDENT_OPENING, on_gconf_notify_indent_opening);
-	REGISTER_NOTIFY (INDENT_CLOSING, on_gconf_notify_indent_closing);
-	*/
-	REGISTER_NOTIFY (INDENT_MAINTAIN, on_gconf_notify_indent_maintain);
-	REGISTER_NOTIFY (TAB_INDENTS, on_gconf_notify_tab_indents);
-	REGISTER_NOTIFY (BACKSPACE_UNINDENTS, on_gconf_notify_backspace_unindents);
-	REGISTER_NOTIFY (VIEW_EOL, on_gconf_notify_view_eols);
-	REGISTER_NOTIFY (VIEW_LINE_WRAP, on_gconf_notify_view_linewrap);
-	REGISTER_NOTIFY (VIEW_WHITE_SPACES, on_gconf_notify_view_whitespaces);
-	REGISTER_NOTIFY (VIEW_INDENTATION_GUIDES, on_gconf_notify_view_indentation_guides);
-	REGISTER_NOTIFY (VIEW_FOLD_MARGIN, on_gconf_notify_view_folds);
-	REGISTER_NOTIFY (VIEW_MARKER_MARGIN, on_gconf_notify_view_markers);
-	REGISTER_NOTIFY (VIEW_LINENUMBERS_MARGIN, on_gconf_notify_view_linenums);
-	REGISTER_NOTIFY (FOLD_SYMBOLS, on_gconf_notify_fold_symbols);
-	REGISTER_NOTIFY (FOLD_UNDERLINE, on_gconf_notify_fold_underline);
-	REGISTER_NOTIFY (EDGE_COLUMN, on_gconf_notify_edge_column);
+	REGISTER_NOTIFY (TAB_SIZE, on_notify_tab_size, int);
+	REGISTER_NOTIFY (TEXT_ZOOM_FACTOR, on_notify_zoom_factor, int);
+	REGISTER_NOTIFY (INDENT_SIZE, on_notify_indent_size, int);
+	REGISTER_NOTIFY (USE_TABS, on_notify_use_tab_for_indentation, bool);
+	REGISTER_NOTIFY (DISABLE_SYNTAX_HILIGHTING, on_notify_disable_hilite, bool);
+	/* REGISTER_NOTIFY (INDENT_AUTOMATIC, on_notify_automatic_indentation); */
+	REGISTER_NOTIFY (WRAP_BOOKMARKS, on_notify_wrap_bookmarks, bool);
+	REGISTER_NOTIFY (BRACES_CHECK, on_notify_braces_check, bool);
+	REGISTER_NOTIFY (INDENT_MAINTAIN, on_notify_indent_maintain, bool);
+	REGISTER_NOTIFY (TAB_INDENTS, on_notify_tab_indents, bool);
+	REGISTER_NOTIFY (BACKSPACE_UNINDENTS, on_notify_backspace_unindents, bool);
+	REGISTER_NOTIFY (VIEW_EOL, on_notify_view_eols, bool);
+	REGISTER_NOTIFY (VIEW_LINE_WRAP, on_notify_view_linewrap, bool);
+	REGISTER_NOTIFY (VIEW_WHITE_SPACES, on_notify_view_whitespaces, bool);
+	REGISTER_NOTIFY (VIEW_INDENTATION_GUIDES, on_notify_view_indentation_guides, bool);
+	REGISTER_NOTIFY (VIEW_FOLD_MARGIN, on_notify_view_folds, bool);
+	REGISTER_NOTIFY (VIEW_MARKER_MARGIN, on_notify_view_markers, bool);
+	REGISTER_NOTIFY (VIEW_LINENUMBERS_MARGIN, on_notify_view_linenums, bool);
+	REGISTER_NOTIFY (FOLD_SYMBOLS, on_notify_fold_symbols, bool);
+	REGISTER_NOTIFY (FOLD_UNDERLINE, on_notify_fold_underline, bool);
+	REGISTER_NOTIFY (EDGE_COLUMN, on_notify_edge_column, int);
 }
 
 void
 text_editor_prefs_finalize (TextEditor *te)
 {
 	GList *node;
-	node = te->gconf_notify_ids;
+	node = te->notify_ids;
 	while (node)
 	{
 		anjuta_preferences_notify_remove (te->preferences,
 										  GPOINTER_TO_UINT (node->data));
 		node = g_list_next (node);
 	}
-	g_list_free (te->gconf_notify_ids);
-	te->gconf_notify_ids = NULL;
+	g_list_free (te->notify_ids);
+	te->notify_ids = NULL;
 }

Modified: trunk/plugins/sourceview/sourceview-io.c
==============================================================================
--- trunk/plugins/sourceview/sourceview-io.c	(original)
+++ trunk/plugins/sourceview/sourceview-io.c	Fri Mar 20 12:13:35 2009
@@ -290,7 +290,7 @@
 	
 	cancel_monitor (sio);
 	
-	backup = anjuta_preferences_get_int_with_default (sio->sv->priv->prefs,
+	backup = anjuta_preferences_get_bool_with_default (sio->sv->priv->prefs,
 													  "sourceview.backup", TRUE);
 	
 	if (sio->last_encoding == NULL)

Modified: trunk/plugins/sourceview/sourceview-prefs.c
==============================================================================
--- trunk/plugins/sourceview/sourceview-prefs.c	(original)
+++ trunk/plugins/sourceview/sourceview-prefs.c	Fri Mar 20 12:13:35 2009
@@ -20,13 +20,13 @@
 
 #include <libanjuta/anjuta-debug.h>
 
-static AnjutaPreferences* prefs = NULL;
+#include <gconf/gconf-client.h>
 
-#define REGISTER_NOTIFY(key, func) \
-	notify_id = anjuta_preferences_notify_add (sv->priv->prefs, \
-																						key, func, sv, NULL); \
-	sv->priv->gconf_notify_ids = g_list_prepend (sv->priv->gconf_notify_ids, \
-																							GUINT_TO_POINTER(notify_id));
+#define REGISTER_NOTIFY(key, func, type) \
+	notify_id = anjuta_preferences_notify_add_##type (sv->priv->prefs, \
+																						       key, func, sv, NULL); \
+	sv->priv->notify_ids = g_list_prepend (sv->priv->notify_ids, \
+						 														GUINT_TO_POINTER(notify_id));
 /* Editor preferences */
 #define HIGHLIGHT_SYNTAX           "sourceview.syntax.highlight"
 #define HIGHLIGHT_CURRENT_LINE	   "sourceview.currentline.highlight"
@@ -49,37 +49,14 @@
 #define FONT "sourceview.font"
 #define DESKTOP_FIXED_FONT "/desktop/gnome/interface/monospace_font_name"
 
-static int
-get_int_default(GConfEntry* entry, gint default_value)
-{
-	GConfValue* value = gconf_entry_get_value(entry);
-	if (value)
-		return gconf_value_get_int(value);
-	else
-		return default_value;
-}
-
-static gboolean
-get_bool(GConfEntry* entry)
-{
-	GConfValue* value = gconf_entry_get_value(entry);
-	/* The value might be deleted */
-	if (!value)
-		return FALSE;
-	/* Usually we would use get_bool but anjuta_preferences saves bool as int 
-		#409408 */
-	if (value->type == GCONF_VALUE_BOOL)
-		return gconf_value_get_bool (value);
-	else
-		return gconf_value_get_int(value);
-}
 
 static void
-on_gconf_notify_view_spaces (GConfClient *gclient, guint cnxn_id,
-														 GConfEntry *entry, gpointer user_data)
+on_notify_view_spaces (AnjutaPreferences* prefs,
+                       const gchar* key,
+                       gboolean visible,
+                       gpointer user_data)
 {
 	Sourceview *sv;
-	gboolean visible = get_bool(entry);
 	sv = ANJUTA_SOURCEVIEW(user_data);
 	GtkSourceDrawSpacesFlags flags = 
 		gtk_source_view_get_draw_spaces (GTK_SOURCE_VIEW (sv->priv->view));
@@ -94,11 +71,12 @@
 }
 
 static void
-on_gconf_notify_view_eols (GConfClient *gclient, guint cnxn_id,
-													 GConfEntry *entry, gpointer user_data)
+on_notify_view_eol (AnjutaPreferences* prefs,
+                    const gchar* key,
+                    gboolean visible,
+                    gpointer user_data)
 {
 	Sourceview *sv;
-	gboolean visible = get_bool(entry);
 	sv = ANJUTA_SOURCEVIEW(user_data);
 	GtkSourceDrawSpacesFlags flags = 
 		gtk_source_view_get_draw_spaces (GTK_SOURCE_VIEW (sv->priv->view));
@@ -113,11 +91,12 @@
 }
 
 static void
-on_gconf_notify_line_wrap (GConfClient *gclient, guint cnxn_id,
-													 GConfEntry *entry, gpointer user_data)
+on_notify_line_wrap (AnjutaPreferences* prefs,
+                           const gchar* key,
+                           gboolean line_wrap,
+                           gpointer user_data)
 {
 	Sourceview *sv;
-	gboolean line_wrap = get_bool(entry);
 	sv = ANJUTA_SOURCEVIEW(user_data);
 	
 	gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (sv->priv->view),
@@ -125,87 +104,94 @@
 }
 
 static void
-on_gconf_notify_disable_hilite (GConfClient *gclient, guint cnxn_id,
-																GConfEntry *entry, gpointer user_data)
+on_notify_disable_hilite (AnjutaPreferences* prefs,
+                          const gchar* key,
+                          gboolean highlight,
+                          gpointer user_data)
 {
 	Sourceview *sv;
-	gboolean highlight = get_bool(entry);
 	sv = ANJUTA_SOURCEVIEW(user_data);
-	
+
 	gtk_source_buffer_set_highlight_syntax(GTK_SOURCE_BUFFER(sv->priv->document),
-																				 highlight);
-	
+	                                       highlight);
+
 }
 
 static void
-on_gconf_notify_highlight_current_line (GConfClient *gclient, guint cnxn_id,
-																				GConfEntry *entry, gpointer user_data)
+on_notify_highlight_current_line(AnjutaPreferences* prefs,
+                                 const gchar* key,
+                                 gboolean highlight_current_line,
+                                 gpointer user_data)
 {
 	Sourceview *sv;
-	gboolean highlight_current_line = get_bool(entry);
 	sv = ANJUTA_SOURCEVIEW(user_data);
-	
+
 	gtk_source_view_set_highlight_current_line(GTK_SOURCE_VIEW(sv->priv->view),
-																						 highlight_current_line);
+	                                           highlight_current_line);
 }
 
 static void
-on_gconf_notify_tab_size (GConfClient *gclient, guint cnxn_id,
-													GConfEntry *entry, gpointer user_data)
+on_notify_tab_size (AnjutaPreferences* prefs,
+                    const gchar* key,
+                    gint tab_size,
+                    gpointer user_data)
 {
 	Sourceview *sv;
-	gint tab_size = get_int_default(entry, 4);
-	
+
 	sv = ANJUTA_SOURCEVIEW(user_data);
-	
+
 	g_return_if_fail(GTK_IS_SOURCE_VIEW(sv->priv->view));
-	
+
 	gtk_source_view_set_tab_width(GTK_SOURCE_VIEW(sv->priv->view), tab_size);
 }
 
 static void
-on_gconf_notify_use_tab_for_indentation (GConfClient *gclient, guint cnxn_id,
-																				 GConfEntry *entry, gpointer user_data)
+on_notify_use_tab_for_indentation (AnjutaPreferences* prefs,
+                                   const gchar* key,
+                                   gboolean use_tabs,
+                                   gpointer user_data)
 {
 	Sourceview *sv;
-	gboolean use_tabs = get_bool(entry);
 	sv = ANJUTA_SOURCEVIEW(user_data);
-	
+
 	gtk_source_view_set_insert_spaces_instead_of_tabs(GTK_SOURCE_VIEW(sv->priv->view),
-																										!use_tabs);
+	                                                  !use_tabs);
 }
 
 static void
-on_gconf_notify_braces_check (GConfClient *gclient, guint cnxn_id,
-															GConfEntry *entry, gpointer user_data)
+on_notify_braces_check (AnjutaPreferences* prefs,
+                        const gchar* key,
+                        gboolean braces_check,
+                        gpointer user_data)
 {
 	Sourceview *sv;
-	gboolean braces_check = get_bool(entry);
 	sv = ANJUTA_SOURCEVIEW(user_data);
-	
+
 	gtk_source_buffer_set_highlight_matching_brackets(GTK_SOURCE_BUFFER(sv->priv->document), 
-																										braces_check);
+	                                                  braces_check);
 }
 
 static void
-on_gconf_notify_view_marks (GConfClient *gclient, guint cnxn_id,
-														GConfEntry *entry, gpointer user_data)
+on_notify_view_marks (AnjutaPreferences* prefs,
+                      const gchar* key,
+                      gboolean show_markers,
+                      gpointer user_data)
 {
 	Sourceview *sv;
-	gboolean show_markers = get_bool(entry);
 	sv = ANJUTA_SOURCEVIEW(user_data);
-	
+
 	gtk_source_view_set_show_line_marks(GTK_SOURCE_VIEW(sv->priv->view), 
-																			show_markers);
-	
+	                                    show_markers);
+
 }
 
 static void
-on_gconf_notify_view_linenums (GConfClient *gclient, guint cnxn_id,
-															 GConfEntry *entry, gpointer user_data)
+on_notify_view_linenums (AnjutaPreferences* prefs,
+                         const gchar* key,
+                         gboolean show_lineno,
+                         gpointer user_data)
 {
 	Sourceview *sv;
-	gboolean show_lineno = get_bool(entry);
 	sv = ANJUTA_SOURCEVIEW(user_data);
 	
 	gtk_source_view_set_show_line_numbers(GTK_SOURCE_VIEW(sv->priv->view), 
@@ -214,24 +200,25 @@
 }
 
 static void
-on_gconf_notify_view_right_margin (GConfClient *gclient, guint cnxn_id,
-																	 GConfEntry *entry, gpointer user_data)
+on_notify_view_right_margin (AnjutaPreferences* prefs,
+                             const gchar* key,
+                             gboolean show_margin,
+                             gpointer user_data)
 {
 	Sourceview *sv;
-	gboolean show_margin = get_bool(entry);
 	sv = ANJUTA_SOURCEVIEW(user_data);
 	
 	gtk_source_view_set_show_right_margin(GTK_SOURCE_VIEW(sv->priv->view), 
 																				show_margin);
-	
 }
 
 static void
-on_gconf_notify_right_margin_position (GConfClient *gclient, guint cnxn_id,
-									   GConfEntry *entry, gpointer user_data)
+on_notify_right_margin_position (AnjutaPreferences* prefs,
+                                 const gchar* key,
+                                 int pos,
+                                 gpointer user_data)
 {
 	Sourceview *sv;
-	gboolean pos = get_int_default(entry, 80);
 	sv = ANJUTA_SOURCEVIEW(user_data);
 	
 	gtk_source_view_set_right_margin_position(GTK_SOURCE_VIEW(sv->priv->view), 
@@ -240,31 +227,30 @@
 }
 
 static void
-on_gconf_notify_font (GConfClient *gclient, guint cnxn_id,
-											GConfEntry *entry, gpointer user_data)
+on_notify_font (AnjutaPreferences* prefs,
+                const gchar* key,
+                const gchar* font,
+                gpointer user_data)
 {
 	Sourceview *sv;
-	gchar* font;
-	AnjutaPreferences* prefs = sourceview_get_prefs();
 	sv = ANJUTA_SOURCEVIEW(user_data);
-	
-	font = anjuta_preferences_get(prefs, FONT);
-	
+		
 	if (font != NULL)
 		anjuta_view_set_font(sv->priv->view, FALSE, font);
-	g_free (font);
 }
 
 static void
-on_gconf_notify_font_theme (GConfClient *gclient, guint cnxn_id,
-														GConfEntry *entry, gpointer user_data)
+on_notify_font_theme (AnjutaPreferences* prefs,
+                      const gchar* key,
+                      gboolean use_theme,
+                      gpointer user_data)
 {
 	Sourceview *sv;
-	gboolean use_theme = get_bool(entry);
 	sv = ANJUTA_SOURCEVIEW(user_data);
 	
 	if (use_theme)
 	{
+		GConfClient *gclient = gconf_client_get_default ();
 		gchar *desktop_fixed_font;
 		desktop_fixed_font =
 			gconf_client_get_string (gclient, DESKTOP_FIXED_FONT, NULL);
@@ -275,7 +261,12 @@
 		g_free (desktop_fixed_font);
 	}
 	else
-		on_gconf_notify_font(NULL, 0, NULL, sv);
+	{
+		gchar* font = anjuta_preferences_get (prefs, FONT);
+		if (font != NULL)
+			anjuta_view_set_font(sv->priv->view, FALSE, font);
+		g_free (font);
+	}
 }
 
 static void
@@ -283,11 +274,14 @@
 {
 	gboolean font_theme;
 	
-	font_theme = anjuta_preferences_get_int(prefs, FONT_THEME);
+	font_theme = anjuta_preferences_get_bool (sv->priv->prefs, FONT_THEME);
 	
 	if (!font_theme)
 	{
-		on_gconf_notify_font(NULL, 0, NULL, sv);
+		gchar* font = anjuta_preferences_get (sv->priv->prefs, FONT);
+		if (font != NULL)
+			anjuta_view_set_font(sv->priv->view, FALSE, font);
+		g_free (font);
 	}
 	else
 	{
@@ -307,44 +301,48 @@
 }
 
 static int
-get_key(Sourceview* sv, const gchar* key, gint default_value)
+get_key_int(Sourceview* sv, const gchar* key, gint default_value)
 {
 	return anjuta_preferences_get_int_with_default (sv->priv->prefs, key, default_value);
 }
 
+static int
+get_key_bool(Sourceview* sv, const gchar* key, gboolean default_value)
+{
+	return anjuta_preferences_get_bool_with_default (sv->priv->prefs, key, default_value);
+}
+
 void 
 sourceview_prefs_init(Sourceview* sv)
 {
 	guint notify_id;
 	GtkSourceDrawSpacesFlags flags = 0;
 	
-	prefs = sv->priv->prefs;
-	
 	/* Init */
-	gtk_source_buffer_set_highlight_syntax(GTK_SOURCE_BUFFER(sv->priv->document), get_key(sv, HIGHLIGHT_SYNTAX, TRUE));
+	gtk_source_buffer_set_highlight_syntax(GTK_SOURCE_BUFFER(sv->priv->document), get_key_bool(sv, HIGHLIGHT_SYNTAX, TRUE));
 	gtk_source_view_set_highlight_current_line(GTK_SOURCE_VIEW(sv->priv->view),
-																						 get_key(sv, HIGHLIGHT_CURRENT_LINE, FALSE));
-	gtk_source_view_set_tab_width(GTK_SOURCE_VIEW(sv->priv->view), get_key(sv, TAB_SIZE, 4));
+																						 get_key_bool(sv, HIGHLIGHT_CURRENT_LINE, FALSE));
+	gtk_source_view_set_tab_width(GTK_SOURCE_VIEW(sv->priv->view), get_key_int(sv, TAB_SIZE, 4));
 	gtk_source_view_set_indent_width(GTK_SOURCE_VIEW(sv->priv->view), -1); /* Same as tab width */
 	gtk_source_view_set_insert_spaces_instead_of_tabs(GTK_SOURCE_VIEW(sv->priv->view),
-																										!get_key(sv, USE_TABS, FALSE));
+																										!get_key_bool(sv, USE_TABS, FALSE));
 	gtk_source_buffer_set_highlight_matching_brackets(GTK_SOURCE_BUFFER(sv->priv->document), 
-																										get_key(sv, HIGHLIGHT_BRACKETS, FALSE));
+																										get_key_bool(sv, HIGHLIGHT_BRACKETS, FALSE));
 	gtk_source_view_set_show_line_marks(GTK_SOURCE_VIEW(sv->priv->view), 
-																			get_key(sv, VIEW_MARKS, TRUE));
+																			get_key_bool(sv, VIEW_MARKS, TRUE));
 	gtk_source_view_set_show_line_numbers(GTK_SOURCE_VIEW(sv->priv->view), 
-																				get_key(sv, VIEW_LINENUMBERS, TRUE));
+																				get_key_bool(sv, VIEW_LINENUMBERS, TRUE));
 	gtk_source_view_set_show_right_margin(GTK_SOURCE_VIEW(sv->priv->view), 
-																				get_key(sv, VIEW_RIGHTMARGIN, TRUE));
+																				get_key_bool(sv, VIEW_RIGHTMARGIN, TRUE));
 	gtk_source_view_set_right_margin_position(GTK_SOURCE_VIEW(sv->priv->view), 
-																						get_key(sv, RIGHTMARGIN_POSITION, 80));
+																						get_key_int(sv, RIGHTMARGIN_POSITION, 80));
 	gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (sv->priv->view),
-															 get_key (sv, VIEW_EOL, FALSE) ? GTK_WRAP_WORD : GTK_WRAP_NONE);
+															 get_key_bool (sv, VIEW_EOL, FALSE) ? GTK_WRAP_WORD : GTK_WRAP_NONE);
 
 	
-	if (get_key (sv, VIEW_WHITE_SPACES, FALSE))
+	if (get_key_bool (sv, VIEW_WHITE_SPACES, FALSE))
 		flags |= (GTK_SOURCE_DRAW_SPACES_SPACE | GTK_SOURCE_DRAW_SPACES_TAB);
-	if (get_key (sv, VIEW_EOL, FALSE))
+	if (get_key_bool (sv, VIEW_EOL, FALSE))
 		flags |= GTK_SOURCE_DRAW_SPACES_NEWLINE;
 	
 	gtk_source_view_set_draw_spaces (GTK_SOURCE_VIEW (sv->priv->view),
@@ -353,20 +351,20 @@
 	init_fonts(sv);
 	
 	/* Register gconf notifications */
-	REGISTER_NOTIFY (TAB_SIZE, on_gconf_notify_tab_size);
-	REGISTER_NOTIFY (USE_TABS, on_gconf_notify_use_tab_for_indentation);
-	REGISTER_NOTIFY (HIGHLIGHT_SYNTAX, on_gconf_notify_disable_hilite);
-	REGISTER_NOTIFY (HIGHLIGHT_CURRENT_LINE, on_gconf_notify_highlight_current_line);
-	REGISTER_NOTIFY (HIGHLIGHT_BRACKETS, on_gconf_notify_braces_check);
-	REGISTER_NOTIFY (VIEW_MARKS, on_gconf_notify_view_marks);
-	REGISTER_NOTIFY (VIEW_LINENUMBERS, on_gconf_notify_view_linenums);
-	REGISTER_NOTIFY (VIEW_RIGHTMARGIN, on_gconf_notify_view_right_margin);
-	REGISTER_NOTIFY (VIEW_WHITE_SPACES, on_gconf_notify_view_spaces);		
-	REGISTER_NOTIFY (VIEW_EOL, on_gconf_notify_view_eols);		  
-	REGISTER_NOTIFY (VIEW_LINE_WRAP, on_gconf_notify_line_wrap);		  
-	REGISTER_NOTIFY (RIGHTMARGIN_POSITION, on_gconf_notify_right_margin_position);
-	REGISTER_NOTIFY (FONT_THEME, on_gconf_notify_font_theme);
-	REGISTER_NOTIFY (FONT, on_gconf_notify_font);	
+	REGISTER_NOTIFY (TAB_SIZE, on_notify_tab_size, int);
+	REGISTER_NOTIFY (USE_TABS, on_notify_use_tab_for_indentation, bool);
+	REGISTER_NOTIFY (HIGHLIGHT_SYNTAX, on_notify_disable_hilite, bool);
+	REGISTER_NOTIFY (HIGHLIGHT_CURRENT_LINE, on_notify_highlight_current_line, bool);
+	REGISTER_NOTIFY (HIGHLIGHT_BRACKETS, on_notify_braces_check, bool);
+	REGISTER_NOTIFY (VIEW_MARKS, on_notify_view_marks, bool);
+	REGISTER_NOTIFY (VIEW_LINENUMBERS, on_notify_view_linenums, bool);
+	REGISTER_NOTIFY (VIEW_WHITE_SPACES, on_notify_view_spaces, bool);		
+	REGISTER_NOTIFY (VIEW_EOL, on_notify_view_eol, bool);		  
+	REGISTER_NOTIFY (VIEW_LINE_WRAP, on_notify_line_wrap, bool);		  
+	REGISTER_NOTIFY (VIEW_RIGHTMARGIN, on_notify_view_right_margin, bool);
+	REGISTER_NOTIFY (RIGHTMARGIN_POSITION, on_notify_right_margin_position, int);
+	REGISTER_NOTIFY (FONT_THEME, on_notify_font_theme, bool);
+	REGISTER_NOTIFY (FONT, on_notify_font, string);	
 }
 
 void sourceview_prefs_destroy(Sourceview* sv)
@@ -374,16 +372,9 @@
 	AnjutaPreferences* prefs = sv->priv->prefs;
 	GList* id;
 	DEBUG_PRINT("%s", "Destroying preferences");
-	for (id = sv->priv->gconf_notify_ids; id != NULL; id = id->next)
+	for (id = sv->priv->notify_ids; id != NULL; id = id->next)
 	{
 		anjuta_preferences_notify_remove(prefs,GPOINTER_TO_UINT(id->data));
 	}
-	g_list_free(sv->priv->gconf_notify_ids);
-}
-
-
-AnjutaPreferences*
-sourceview_get_prefs()
-{
-	return prefs;
+	g_list_free(sv->priv->notify_ids);
 }

Modified: trunk/plugins/sourceview/sourceview-print.c
==============================================================================
--- trunk/plugins/sourceview/sourceview-print.c	(original)
+++ trunk/plugins/sourceview/sourceview-print.c	Fri Mar 20 12:13:35 2009
@@ -98,8 +98,8 @@
 																						 GTK_WRAP_NONE);
 	
 	gtk_source_print_compositor_set_print_line_numbers (compositor,
-																											anjuta_preferences_get_int (sv->priv->prefs,
-																																									PRINT_LINENUMBERS));
+																											anjuta_preferences_get_bool (sv->priv->prefs,
+																											                             PRINT_LINENUMBERS));
 	
 	gtk_source_print_compositor_set_header_format (compositor,
 																								 TRUE,
@@ -114,15 +114,15 @@
 																								 "Page %N/%Q");
 	
 	gtk_source_print_compositor_set_print_header (compositor,
-																								anjuta_preferences_get_int (sv->priv->prefs,
+																								anjuta_preferences_get_bool (sv->priv->prefs,
 																																						PRINT_HEADER));
 	gtk_source_print_compositor_set_print_footer (compositor,
-																								anjuta_preferences_get_int (sv->priv->prefs,
-																																						PRINT_HEADER));
+																								anjuta_preferences_get_bool (sv->priv->prefs,
+																																						PRINT_FOOTER));
 	
 	
 	gtk_source_print_compositor_set_highlight_syntax (compositor,
-																										anjuta_preferences_get_int (sv->priv->prefs,
+																										anjuta_preferences_get_bool (sv->priv->prefs,
 																																								PRINT_HIGHLIGHT)),
 	
 	operation = gtk_print_operation_new ();

Modified: trunk/plugins/sourceview/sourceview-private.h
==============================================================================
--- trunk/plugins/sourceview/sourceview-private.h	(original)
+++ trunk/plugins/sourceview/sourceview-private.h	Fri Mar 20 12:13:35 2009
@@ -45,7 +45,7 @@
 	
 	/* Preferences */
 	AnjutaPreferences* prefs;
-	GList* gconf_notify_ids;
+	GList* notify_ids;
 	
 	/* Popup menu */
 	GtkWidget* menu;

Modified: trunk/plugins/subversion/subversion-ui-utils.c
==============================================================================
--- trunk/plugins/subversion/subversion-ui-utils.c	(original)
+++ trunk/plugins/subversion/subversion-ui-utils.c	Fri Mar 20 12:13:35 2009
@@ -93,7 +93,7 @@
 										 GTK_DIALOG_DESTROY_WITH_PARENT,
 										 GTK_MESSAGE_WARNING,
 										 GTK_BUTTONS_OK,
-										 error_message);
+										 "%s", error_message);
 		
 		gtk_dialog_run (GTK_DIALOG (dialog));
 		gtk_widget_destroy (dialog);

Modified: trunk/plugins/symbol-db/plugin.c
==============================================================================
--- trunk/plugins/symbol-db/plugin.c	(original)
+++ trunk/plugins/symbol-db/plugin.c	Fri Mar 20 12:13:35 2009
@@ -22,8 +22,6 @@
  * 	Boston, MA  02110-1301, USA.
  */
 
-
-
 #include <config.h>
 #include <gio/gio.h>
 #include <libanjuta/anjuta-shell.h>
@@ -673,7 +671,7 @@
 	g_free (local_path);
 	
 	/* add a default timeout to the updating of buffer symbols */	
-	tags_update = anjuta_preferences_get_int (sdb_plugin->prefs, BUFFER_AUTOSCAN);
+	tags_update = anjuta_preferences_get_bool (sdb_plugin->prefs, BUFFER_AUTOSCAN);
 				
 	if (tags_update)
 		sdb_plugin->buf_update_timeout_id = 
@@ -1694,7 +1692,7 @@
 		if (sdb_plugin->session_packages == NULL)
 		{
 			/* hey, does user want to import system sources for this project? */
-			gboolean automatic_scan = anjuta_preferences_get_int (sdb_plugin->prefs, 
+			gboolean automatic_scan = anjuta_preferences_get_bool (sdb_plugin->prefs, 
 																  PROJECT_AUTOSCAN);
 			
 			if (automatic_scan == TRUE)
@@ -1704,7 +1702,7 @@
 		}
 		
 		/* get preferences about the parallel scan */
-		gboolean parallel_scan = anjuta_preferences_get_int (sdb_plugin->prefs, 
+		gboolean parallel_scan = anjuta_preferences_get_bool (sdb_plugin->prefs, 
 															 PARALLEL_SCAN); 
 		
 		if (parallel_scan == TRUE && 
@@ -2016,7 +2014,7 @@
 										  sdb_plugin);
 			
 			/* get preferences about the parallel scan */
-			gboolean parallel_scan = anjuta_preferences_get_int (sdb_plugin->prefs, 
+			gboolean parallel_scan = anjuta_preferences_get_bool (sdb_plugin->prefs, 
 														 PARALLEL_SCAN); 
 			
 			do_check_languages_count (sdb_plugin);

Modified: trunk/plugins/symbol-db/symbol-db-prefs.c
==============================================================================
--- trunk/plugins/symbol-db/symbol-db-prefs.c	(original)
+++ trunk/plugins/symbol-db/symbol-db-prefs.c	Fri Mar 20 12:13:35 2009
@@ -106,7 +106,7 @@
 	if (new_file != NULL) 
 	{
 		GtkWidget *fchooser;
-		fchooser = 	glade_xml_get_widget (priv->prefs_gxml, CTAGS_PREFS_KEY);	
+		fchooser = 	glade_xml_get_widget (priv->prefs_gxml, CTAGS_PREFS);	
 		/*gtk_widget_set_sensitive (fchooser, TRUE);*/
 		
 		anjuta_preferences_set (priv->prefs, CTAGS_PREFS_KEY,
@@ -119,10 +119,10 @@
 }
 
 static void
-on_gconf_notify_prefs (GConfClient *gclient, guint cnxn_id,
-					   GConfEntry *entry, gpointer user_data)
+on_notify_prefs (AnjutaPreferences* prefs, const gchar* key,
+                 const gchar* value, gpointer user_data)
 {
-	DEBUG_PRINT ("%s", "on_gconf_notify_prefs ()");
+	DEBUG_PRINT ("%s", "on_notify_prefs ()");
 }
 
 static void
@@ -351,65 +351,15 @@
 }
 
 static void
-on_autoscan_button_toggled (GtkToggleButton *togglebutton, SymbolDBPrefs *sdbp)
-{
-	SymbolDBPrefsPriv *priv;	
-	gboolean check_button_value;
-	priv = sdbp->priv;
-	GtkWidget *check_button;
-	
-	check_button = glade_xml_get_widget (priv->prefs_gxml, PROJECT_AUTOSCAN);
-
-	check_button_value =  gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check_button));
-	DEBUG_PRINT ("%s", "on_check_button_toggled ()");
-	anjuta_preferences_set_int (priv->prefs, PROJECT_AUTOSCAN, check_button_value);
-
-}
-
-static void
-on_update_button_toggled (GtkToggleButton *togglebutton, SymbolDBPrefs *sdbp)
-{
-	SymbolDBPrefsPriv *priv;	
-	gboolean update_button_value;
-	priv = sdbp->priv;
-	GtkWidget *update_button;
-	
-	update_button = glade_xml_get_widget (priv->prefs_gxml, BUFFER_AUTOSCAN);
-
-	update_button_value =  gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (update_button));
-	DEBUG_PRINT ("%s", "on_update_button_toggled ()");
-	anjuta_preferences_set_int (priv->prefs, BUFFER_AUTOSCAN, update_button_value);	
-
-	g_signal_emit (sdbp, signals[BUFFER_UPDATE_TOGGLED], 0, update_button_value);
-}
-
-static void
-on_parallel_button_toggled (GtkToggleButton *togglebutton, SymbolDBPrefs *sdbp)
-{
-	SymbolDBPrefsPriv *priv;	
-	gboolean parallel_button_value;
-	priv = sdbp->priv;
-	GtkWidget *parallel_button;
-	
-	parallel_button = glade_xml_get_widget (priv->prefs_gxml, PARALLEL_SCAN);
-
-	parallel_button_value =  gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (parallel_button));
-	DEBUG_PRINT ("%s", "on_parallel_button_toggled ()");
-	anjuta_preferences_set_int (priv->prefs, PARALLEL_SCAN, parallel_button_value);	
-}
-
-static void
 sdb_prefs_init1 (SymbolDBPrefs *sdbp)
 {
 	SymbolDBPrefsPriv *priv;
 	GtkWidget *fchooser;
-	GtkWidget *check_button, *update_button, *parallel_button;
-	gboolean check_button_value, update_button_value, parallel_button_value;
 	gchar *ctags_value;
 
 	priv = sdbp->priv;
 
-	fchooser = 	glade_xml_get_widget (priv->prefs_gxml, CTAGS_PREFS_KEY);
+	fchooser = 	glade_xml_get_widget (priv->prefs_gxml, CTAGS_PREFS);
 	/* we will reactivate it after the listall has been finished */
 	/*gtk_widget_set_sensitive (fchooser, FALSE);*/
 			
@@ -447,29 +397,10 @@
 					  G_CALLBACK (on_prefs_executable_changed), sdbp);	
 	
 
-	priv->prefs_notify_id = anjuta_preferences_notify_add (priv->prefs, 
-												CTAGS_PREFS_KEY, 
-											   on_gconf_notify_prefs, 
-											   priv->prefs, NULL);		
-
-	
-	check_button = glade_xml_get_widget (priv->prefs_gxml, PROJECT_AUTOSCAN);
-	g_signal_connect (G_OBJECT (check_button), "toggled", 
-					  G_CALLBACK (on_autoscan_button_toggled), sdbp);
-	check_button_value = anjuta_preferences_get_int (priv->prefs, PROJECT_AUTOSCAN);
-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), check_button_value);
-
-	update_button = glade_xml_get_widget (priv->prefs_gxml, BUFFER_AUTOSCAN);
-	g_signal_connect (G_OBJECT (update_button), "toggled", 
-					  G_CALLBACK (on_update_button_toggled), sdbp);
-	update_button_value = anjuta_preferences_get_int (priv->prefs, BUFFER_AUTOSCAN);
-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (update_button), update_button_value);
-	
-	parallel_button	= glade_xml_get_widget (priv->prefs_gxml, PARALLEL_SCAN);
-	g_signal_connect (G_OBJECT (parallel_button), "toggled", 
-					  G_CALLBACK (on_parallel_button_toggled), sdbp);
-	parallel_button_value = anjuta_preferences_get_int (priv->prefs, PARALLEL_SCAN);
-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (parallel_button), parallel_button_value);
+	priv->prefs_notify_id = anjuta_preferences_notify_add_string (priv->prefs, 
+	                                                              CTAGS_PREFS_KEY, 
+	                                                              on_notify_prefs, 
+	                                                              priv->prefs, NULL);
 	
 	g_free (ctags_value);
 }

Modified: trunk/plugins/symbol-db/symbol-db-prefs.h
==============================================================================
--- trunk/plugins/symbol-db/symbol-db-prefs.h	(original)
+++ trunk/plugins/symbol-db/symbol-db-prefs.h	Fri Mar 20 12:13:35 2009
@@ -40,10 +40,11 @@
 #include "symbol-db-system.h"
 
 
-#define CTAGS_PREFS_KEY		"preferences_entry:text:/usr/bin/ctags:0:symboldb.ctags"
-#define PROJECT_AUTOSCAN	"preferences_toggle:bool:1:1:symboldb.scan_prj_pkgs"
-#define PARALLEL_SCAN		"preferences_toggle:bool:1:1:symboldb.parallel_scan"
-#define BUFFER_AUTOSCAN		"preferences_toggle:bool:1:1:symboldb.buffer_update"
+#define CTAGS_PREFS			 "preferences_entry:text:/usr/bin/ctags:0:symboldb.ctags"
+#define CTAGS_PREFS_KEY		 "symboldb.ctags"
+#define PROJECT_AUTOSCAN	 "symboldb.scan_prj_pkgs"
+#define PARALLEL_SCAN		 "symboldb.parallel_scan"
+#define BUFFER_AUTOSCAN		 "symboldb.buffer_update"
 
 struct _SymbolDBPrefsClass
 {

Modified: trunk/plugins/terminal/terminal.c
==============================================================================
--- trunk/plugins/terminal/terminal.c	(original)
+++ trunk/plugins/terminal/terminal.c	Fri Mar 20 12:13:35 2009
@@ -145,7 +145,7 @@
 	g_return_if_fail (client != NULL);
 	
 	/* Update the currently available list of terminal profiles */
-	setting = anjuta_preferences_get_int (pref,
+	setting = anjuta_preferences_get_bool (pref,
 										  PREFS_TERMINAL_PROFILE_USE_DEFAULT);
 	if (setting)
 	{
@@ -177,7 +177,8 @@
 	g_free (text);
 	
 	setting = GET_PROFILE_BOOL (GCONF_CURSOR_BLINK);
-	vte_terminal_set_cursor_blinks ((term), setting);
+	vte_terminal_set_cursor_blink_mode ((term), 
+	                                    setting ? VTE_CURSOR_BLINK_ON : VTE_CURSOR_BLINK_OFF);
 	setting = GET_PROFILE_BOOL (GCONF_SILENT_BELL);
 	vte_terminal_set_audible_bell (term, !setting);
 	value = GET_PROFILE_INT (GCONF_SCROLLBACK_LINES);
@@ -256,15 +257,27 @@
 }
 
 static void
-on_gconf_notify_prefs (GConfClient *gclient, guint cnxn_id,
-					   GConfEntry *entry, gpointer user_data)
+on_notify_prefs_profile(AnjutaPreferences* prefs,
+                        const gchar* key,
+                        const gchar* value,
+                        gpointer user_data)
 {
 	TerminalPlugin *tp = ANJUTA_PLUGIN_TERMINAL (user_data);
 	preferences_changed (tp->prefs, tp);
 }
 
-#define REGISTER_NOTIFY(key, func) \
-	notify_id = anjuta_preferences_notify_add (tp->prefs, \
+static void
+on_notify_prefs_default (AnjutaPreferences* prefs,
+                         const gchar* key,
+                         gboolean value,
+                         gpointer user_data)
+{
+	TerminalPlugin *tp = ANJUTA_PLUGIN_TERMINAL (user_data);
+	preferences_changed (tp->prefs, tp);
+}
+
+#define REGISTER_NOTIFY(key, func, type) \
+	notify_id = anjuta_preferences_notify_add_##type (tp->prefs, \
 											   key, func, tp, NULL); \
 	tp->gconf_notify_ids = g_list_prepend (tp->gconf_notify_ids, \
 										   GUINT_TO_POINTER (notify_id));
@@ -272,8 +285,8 @@
 prefs_init (TerminalPlugin *tp)
 {
 	guint notify_id;
-	REGISTER_NOTIFY (PREFS_TERMINAL_PROFILE, on_gconf_notify_prefs);
-	REGISTER_NOTIFY (PREFS_TERMINAL_PROFILE_USE_DEFAULT, on_gconf_notify_prefs);
+	REGISTER_NOTIFY (PREFS_TERMINAL_PROFILE, on_notify_prefs_profile, string);
+	REGISTER_NOTIFY (PREFS_TERMINAL_PROFILE_USE_DEFAULT, on_notify_prefs_default, bool);
 }
 
 static void

Modified: trunk/plugins/tools/fileop.c
==============================================================================
--- trunk/plugins/tools/fileop.c	(original)
+++ trunk/plugins/tools/fileop.c	Fri Mar 20 12:13:35 2009
@@ -507,7 +507,7 @@
 	if (err != NULL)
 	{
 		/* Parsing error */
-		g_warning (err->message);
+		g_warning ("%s", err->message);
 		g_error_free (err);
 
 		return FALSE;

Modified: trunk/scripts/build-schemas.mk
==============================================================================
--- trunk/scripts/build-schemas.mk	(original)
+++ trunk/scripts/build-schemas.mk	Fri Mar 20 12:13:35 2009
@@ -2,6 +2,7 @@
 
 prefs_glade_schemasdir = @GCONF_SCHEMA_FILE_DIR@
 prefs_glade_schemas = $(prefs_glade_files:.glade=.schemas)
+prefs_glade_schemas_DATA = $(prefs_glade_schemas)
 
 %.schemas: %.glade
 	$(top_srcdir)/scripts/glade2schema.pl $(srcdir)/$(?) > $(@)

Modified: trunk/src/action-callbacks.c
==============================================================================
--- trunk/src/action-callbacks.c	(original)
+++ trunk/src/action-callbacks.c	Fri Mar 20 12:13:35 2009
@@ -86,7 +86,7 @@
 	{
 		gtk_widget_hide (app->toolbar);
 	}
-	anjuta_preferences_set_int (app->preferences,
+	anjuta_preferences_set_bool (app->preferences,
 								"anjuta.toolbar.visible",
 								status);
 }

Modified: trunk/src/anjuta-app.c
==============================================================================
--- trunk/src/anjuta-app.c	(original)
+++ trunk/src/anjuta-app.c	Fri Mar 20 12:13:35 2009
@@ -60,13 +60,13 @@
 static GtkToolbarStyle style = -1;
 
 static void
-on_toolbar_style_changed (GConfClient* client, guint id, GConfEntry* entry,
-						  gpointer user_data)
+on_toolbar_style_changed (AnjutaPreferences* prefs,
+                          const gchar* key,
+                          const gchar* tb_style,
+                          gpointer user_data)
 {
 	AnjutaApp* app = ANJUTA_APP (user_data);
-	
-	char* tb_style = anjuta_preferences_get (app->preferences, "anjuta.toolbar.style");
-	
+		
 	if (tb_style)
 	{	
 		if (strcasecmp (tb_style, "Default") == 0)
@@ -81,8 +81,6 @@
 			style = GTK_TOOLBAR_TEXT;
 		
 		DEBUG_PRINT ("Toolbar style: %s", tb_style);
-		
-		g_free(tb_style);
 	}
 	
 	if (style != -1)
@@ -96,14 +94,14 @@
 }
 
 static void
-on_gdl_style_changed (GConfClient* client, guint id, GConfEntry* entry,
-					  gpointer user_data)
+on_gdl_style_changed (AnjutaPreferences* prefs,
+                      const gchar* key,
+                      const gchar* pr_style,
+                      gpointer user_data)
 {
 	AnjutaApp* app = ANJUTA_APP (user_data);
 	GdlSwitcherStyle style = GDL_SWITCHER_STYLE_BOTH;
 	
-	gchar* pr_style = anjuta_preferences_get (app->preferences, "anjuta.gdl.style");
-
 	if (pr_style)
 	{
 		if (strcasecmp (pr_style, "Text") == 0)
@@ -118,8 +116,6 @@
 			style = GDL_SWITCHER_STYLE_TABS;
 		
 		DEBUG_PRINT ("Switcher style: %s", pr_style);
-		
-		g_free (pr_style);
 	}
 	g_object_set (G_OBJECT(app->layout_manager->master), "switcher-style",
 				  style, NULL);
@@ -350,6 +346,7 @@
 	GtkWidget *dockbar;
 	GtkAction* action;
 	GList *plugins_dirs = NULL;
+	gchar* style;
 	GdkGeometry size_hints = {
     	100, 100, 0, 0, 100, 100, 1, 1, 0.0, 0.0, GDK_GRAVITY_NORTH_WEST
   	};
@@ -413,10 +410,13 @@
 	g_object_add_weak_pointer (G_OBJECT (app->preferences),
 							   (gpointer)&app->preferences);
 	
-	anjuta_preferences_notify_add (app->preferences, "anjuta.gdl.style",
-								   on_gdl_style_changed, app, NULL);
-	
-	on_gdl_style_changed (NULL, 0, NULL, app);
+	anjuta_preferences_notify_add_string (app->preferences, "anjuta.gdl.style",
+	                                      on_gdl_style_changed, app, NULL);
+	style = anjuta_preferences_get (app->preferences, "anjuta.gdl.style");
+	
+	on_gdl_style_changed (app->preferences, NULL, 
+	                      style, app);
+	g_free (style);
 	
 	/* Register actions */
 	anjuta_ui_add_action_group_entries (app->ui, "ActionGroupFile", _("File"),
@@ -461,12 +461,14 @@
 	action = gtk_ui_manager_get_action (GTK_UI_MANAGER (app->ui),
 										"/MenuMain/MenuView/Toolbar");
 	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION(action),
-								  anjuta_preferences_get_int_with_default (app->preferences,
+								  anjuta_preferences_get_bool_with_default (app->preferences,
 																		   "anjuta.toolbar.visible",
 																		   TRUE));
-	anjuta_preferences_notify_add (app->preferences, "anjuta.toolbar.style",
+	anjuta_preferences_notify_add_string (app->preferences, "anjuta.toolbar.style",
 								   on_toolbar_style_changed, app, NULL);
-	on_toolbar_style_changed (NULL, 0, NULL, app);
+	style = anjuta_preferences_get (app->preferences, "anjuta.toolbar.style");
+	on_toolbar_style_changed (app->preferences, NULL, style, app);
+	g_free (style);
 
 	/* Create widgets menu */
 	view_menu = 

Modified: trunk/src/anjuta.c
==============================================================================
--- trunk/src/anjuta.c	(original)
+++ trunk/src/anjuta.c	Fri Mar 20 12:13:35 2009
@@ -373,7 +373,7 @@
 		
 		/* If preferences is set to not load last session, clear it */
 		if (no_session ||
-			anjuta_preferences_get_int (app->preferences,
+			anjuta_preferences_get_bool (app->preferences,
 										ANJUTA_SESSION_SKIP_LAST))
 		{
 			/* Reset default session */
@@ -383,7 +383,7 @@
 		}
 		/* If preferences is set to not load last project, clear it */
 		else if (no_files ||
-				 anjuta_preferences_get_int (app->preferences,
+				 anjuta_preferences_get_bool (app->preferences,
 											 ANJUTA_SESSION_SKIP_LAST_FILES))
 		{
 			session = anjuta_session_new (session_dir);



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