Commit 472db510 authored by Johannes Schmid's avatar Johannes Schmid Committed by Johannes Schmid

Make AnjutaPreferences a singleton (available through

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)

svn path=/trunk/; revision=4883
parent e9b9bfcf
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)
2009-03-18 Johannes Schmid <jhs@gnome.org>
Patch from Michael Trimarchi <michael@evidence.eu.com>
......@@ -157,7 +157,7 @@ anjuta-marshal.c: anjuta-marshal.h anjuta-marshal.list
&& 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 @@ EXTRA_DIST = \
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
......@@ -270,10 +270,10 @@ anjuta_preferences_dialog_add_page (AnjutaPreferencesDialog *dlg,
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);
}
/**
......
This diff is collapsed.
......@@ -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 @@ typedef enum
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 @@ typedef struct _AnjutaPreferencesPriv AnjutaPreferencesPriv;
struct _AnjutaPreferences
{
GObject parent;
/*< private >*/
AnjutaPreferencesPriv *priv;
};
......@@ -87,152 +80,149 @@ struct _AnjutaPreferencesClass
};
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);
/* 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);
const gchar *key,
const gchar *value);
/* 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
......
......@@ -5,7 +5,6 @@ anjuta_serializer_get_type
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_shell_get_type
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_plugin_manager_error_get_type
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_vcs_status_get_type
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
......
......@@ -370,7 +370,7 @@ execute_program (BasicAutotoolsPlugin* plugin, const gchar *pre_select_uri)
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 */
......
......@@ -1232,22 +1232,6 @@ build_get_context (BasicAutotoolsPlugin *plugin, const gchar *dir,
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 @@ build_execute_command_in_context (BuildContext* context, GError **err)
/* 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 @@ get_root_install_command(BasicAutotoolsPlugin *bplugin)
{
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 @@ on_update_indicators_idle (gpointer data)
/* 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))
{
......
......@@ -65,7 +65,7 @@ cls_inherit_nodestatus_destroy (NodeExpansionStatus *node) {
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 *
......
......@@ -60,7 +60,7 @@ static gboolean check_entry(GtkDialog* dialog, GtkWidget* entry,
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;
......
......@@ -45,7 +45,7 @@ static gchar* create_cvs_command_with_cvsroot(AnjutaPreferences* prefs,
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)
......
......@@ -1155,7 +1155,6 @@ dma_command_run (DmaQueueCommand *cmd, IAnjutaDebugger *debugger,
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:
......
......@@ -179,7 +179,7 @@ gdb_info_show_command (GtkWindow *parent, const gchar *command_line,
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;
......
......@@ -308,13 +308,13 @@ static gboolean
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 @@ dma_thread_set_register_list (CpuRegisters *self, gint thread)
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)
{
......
......@@ -381,13 +381,13 @@ static gboolean
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 @@ dma_thread_set_stack_trace (StackTrace *self, gint thread)
{
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)
{
......
......@@ -710,7 +710,7 @@ on_editor_linenos1_activate (GtkAction *action, gpointer user_data)
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 @@ on_editor_markers1_activate (GtkAction *action, gpointer user_data)
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 @@ on_editor_codefold1_activate (GtkAction *action, gpointer user_data)
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 @@ on_editor_indentguides1_activate (GtkAction *action, gpointer user_data)
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 @@ on_editor_whitespaces1_activate (GtkAction *action, gpointer user_data)
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 @@ on_editor_eolchars1_activate (GtkAction *action, gpointer user_data)
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 @@ on_editor_linewrap1_activate (GtkAction *action, gpointer user_data)
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);
}
......
......@@ -297,7 +297,7 @@ on_notebook_tab_btnrelease (GtkWidget *widget, GdkEventButton *event, AnjutaDocm
{
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 @@ anjuta_docman_save_document_as (AnjutaDocman *docman, IAnjutaDocument *doc,
ianjuta_file_savable_save_as (IANJUTA_FILE_SAVABLE (doc), file, NULL);
}