Commit 719023f8 authored by Johannes Schmid's avatar Johannes Schmid

Port Anjuta from gconf to GSettings (using the gsettings-migration branch))

parents 8274903c a28a1194
......@@ -99,6 +99,9 @@ ANJUTA_PLUGIN_LDFLAGS="-module -avoid-version -no-undefined"
AC_SUBST(ANJUTA_LDFLAGS)
AC_SUBST(ANJUTA_PLUGIN_LDFLAGS)
dnl GSettings
GLIB_GSETTINGS
dnl Disable deprecated APIs
dnl if test x$MAINT = x; then
dnl DEPRECATED_FLAGS="-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
......
This diff is collapsed.
......@@ -35,7 +35,6 @@ typedef enum
ANJUTA_PROPERTY_OBJECT_TYPE_SPIN,
ANJUTA_PROPERTY_OBJECT_TYPE_ENTRY,
ANJUTA_PROPERTY_OBJECT_TYPE_COMBO,
ANJUTA_PROPERTY_OBJECT_TYPE_TEXT,
ANJUTA_PROPERTY_OBJECT_TYPE_COLOR,
ANJUTA_PROPERTY_OBJECT_TYPE_FONT,
ANJUTA_PROPERTY_OBJECT_TYPE_FILE,
......@@ -89,9 +88,11 @@ GType anjuta_preferences_get_type (void);
AnjutaPreferences *anjuta_preferences_new (AnjutaPluginManager *plugin_manager);
AnjutaPreferences *anjuta_preferences_default (void);
void anjuta_preferences_add_from_builder (AnjutaPreferences* pr,GtkBuilder *builder,
const gchar* glade_widget_name,
const gchar* title,
void anjuta_preferences_add_from_builder (AnjutaPreferences *pr,
GtkBuilder *builder,
GSettings *settings,
const gchar *glade_widget_name,
const gchar *stitle,
const gchar *icon_filename);
void anjuta_preferences_remove_page (AnjutaPreferences *pr,
......@@ -102,130 +103,29 @@ void anjuta_preferences_remove_page (AnjutaPreferences *pr,
* in the given gtkbuilder UI tree
*/
void anjuta_preferences_register_all_properties_from_builder_xml (AnjutaPreferences* pr,
GtkBuilder* builder,
GtkBuilder *builder,
GSettings *settings,
GtkWidget *parent);
gboolean
anjuta_preferences_register_property_from_string (AnjutaPreferences *pr,
GSettings *settings,
GtkWidget *object,
const gchar *property_desc);
gboolean
anjuta_preferences_register_property_raw (AnjutaPreferences *pr, GtkWidget *object,
anjuta_preferences_register_property_raw (AnjutaPreferences *pr,
GSettings *settings,
GtkWidget *object,
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 *));
void anjuta_preferences_reset_defaults (AnjutaPreferences *pr);
/* Calls the callback function for each of the properties with the flags
* matching with the given filter
*/
void anjuta_preferences_foreach (AnjutaPreferences *pr,
AnjutaPreferencesCallback callback,
gpointer data);
/* This will transfer all the properties values from the main
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 value (int) of a key */
void anjuta_preferences_set_int (AnjutaPreferences *pr,
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 value (int) of a key. If not found, 0 is returned */
gint anjuta_preferences_get_int (AnjutaPreferences *pr,
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);
gboolean anjuta_preferences_get_bool_with_default (AnjutaPreferences* pr,
const gchar *key,
gboolean default_value);
gchar * anjuta_preferences_default_get (AnjutaPreferences *pr,
const gchar *key);
/* Gets the value (int) of a key */
gint anjuta_preferences_default_get_int (AnjutaPreferences *pr,
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 */
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_notify_remove (AnjutaPreferences *pr, guint notify_id);
const gchar* anjuta_preferences_get_prefix (AnjutaPreferences *pr);
G_END_DECLS
#endif
## The '.' is to make sure install-data-hook rule is executed first
SUBDIRS = . \
gtodo \
message-view \
gdb \
debug-manager \
......@@ -34,10 +33,10 @@ SUBDIRS = . \
gbf-mkfile \
dir-project \
starter \
js-debugger \
language-support-js \
language-support-vala \
language-support-python \
python-loader
js-debugger
# language-support-js \
# language-support-vala \
# language-support-python \
# python-loader
-include $(top_srcdir)/git.mk
......@@ -58,6 +58,7 @@ libanjuta_build_basic_autotools_la_LIBADD = \
libanjuta_build_basic_autotools_la_LDFLAGS = $(ANJUTA_PLUGIN_LDFLAGS)
prefs_name = org.gnome.anjuta.build
prefs_ui_files = anjuta-build-basic-autotools-plugin.ui
include $(top_srcdir)/scripts/build-schemas.mk
......
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkAdjustment" id="adjustment1">
<property name="value">4</property>
<property name="lower">1</property>
<property name="upper">30</property>
<property name="value">4</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
......@@ -163,10 +163,10 @@
<action-widget response="-5">okbutton3</action-widget>
</action-widgets>
</object>
<object class="GtkWindow" id="preferences_dialog_build">
<object class="GtkWindow" id="preferences-dialog-build">
<property name="title" translatable="yes">window1</property>
<child>
<object class="GtkVBox" id="preferences_build_container">
<object class="GtkVBox" id="preferences-build-container">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
......@@ -190,7 +190,7 @@
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkCheckButton" id="preferences_toggle:bool:0:0:build.parallel.make">
<object class="GtkCheckButton" id="preferences_toggle:bool:0:0:build-parallel-make">
<property name="label" translatable="yes">Run several commands at a time:</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
......@@ -204,7 +204,7 @@
</packing>
</child>
<child>
<object class="GtkSpinButton" id="preferences_spin:int:1:0:build.parallel.make.job">
<object class="GtkSpinButton" id="preferences_spin:int:1:0:build-parallel-make-job">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="xalign">1</property>
......@@ -227,7 +227,7 @@
</packing>
</child>
<child>
<object class="GtkCheckButton" id="preferences_toggle:bool:0:0:build.continue.error">
<object class="GtkCheckButton" id="preferences_toggle:bool:0:0:build-continue-error">
<property name="label" translatable="yes">Continue on errors</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
......@@ -242,7 +242,7 @@
</packing>
</child>
<child>
<object class="GtkCheckButton" id="preferences_toggle:bool:1:0:build.translate.message">
<object class="GtkCheckButton" id="preferences_toggle:bool:1:0:build-translate-message">
<property name="label" translatable="yes">Translate messages</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
......@@ -254,7 +254,7 @@
</packing>
</child>
<child>
<object class="GtkCheckButton" id="preferences_toggle:bool:0:0:indicators.automatic">
<object class="GtkCheckButton" id="preferences_toggle:bool:0:0:build-indicators-automatic">
<property name="label" translatable="yes">Highlight message locations in editor</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
......@@ -311,7 +311,7 @@
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkCheckButton" id="preferences_toggle:bool:0:0:build.install.root">
<object class="GtkCheckButton" id="preferences_toggle:bool:0:0:build-install-root">
<property name="label" translatable="yes">Install as root:</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
......@@ -326,13 +326,20 @@
</packing>
</child>
<child>
<object class="GtkEntry" id="preferences_entry:text:sudo:0:build.install.root.command">
<object class="GtkComboBox" id="preferences_combo:text:sudo, su -c:0:build-install-root-command">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">install_list</property>
<property name="row_span_column">0</property>
<property name="column_span_column">0</property>
<property name="active">0</property>
<child>
<object class="GtkCellRendererText" id="renderer2"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
......@@ -375,7 +382,6 @@
<property name="window_position">center-on-parent</property>
<property name="default_width">450</property>
<property name="type_hint">dialog</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox2">
<property name="visible">True</property>
......@@ -582,4 +588,18 @@
<action-widget response="-5">ok_button</action-widget>
</action-widgets>
</object>
<object class="GtkListStore" id="install_list">
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">sudo</col>
</row>
<row>
<col id="0" translatable="yes">su -c</col>
</row>
</data>
</object>
</interface>
......@@ -222,7 +222,7 @@ get_program_parameters (BasicAutotoolsPlugin *plugin,
void
execute_program (BasicAutotoolsPlugin* plugin, const gchar *pre_select_uri)
{
AnjutaPreferences* prefs = anjuta_shell_get_preferences (ANJUTA_PLUGIN(plugin)->shell, NULL);
GSettings* settings = plugin->settings;
gboolean run_in_terminal, error_condition;
gchar *target = NULL, *args = NULL, *dir = NULL, *cmd = NULL;
......@@ -375,9 +375,9 @@ execute_program (BasicAutotoolsPlugin* plugin, const gchar *pre_select_uri)
else
cmd = g_strdup (target);
if (anjuta_preferences_get_bool (prefs , PREF_USE_SB))
if (g_settings_get_boolean (settings, PREF_USE_SB))
{
const gchar* sb_path = anjuta_preferences_get(prefs, PREF_SB_PATH);
const gchar* sb_path = g_settings_get_string (settings, PREF_SB_PATH);
/* we need to skip the /scratchbox/users part, maybe could be done more clever */
const gchar* real_dir = strstr(target, "/home");
gchar* oldcmd = cmd;
......
......@@ -59,20 +59,21 @@
#define UI_FILE PACKAGE_DATA_DIR"/ui/anjuta-build-basic-autotools-plugin.xml"
#define MAX_BUILD_PANES 3
#define PREF_INDICATORS_AUTOMATIC "indicators.automatic"
#define PREF_INSTALL_ROOT "build.install.root"
#define PREF_INSTALL_ROOT_COMMAND "build.install.root.command"
#define PREF_PARALLEL_MAKE "build.parallel.make"
#define PREF_PARALLEL_MAKE_JOB "build.parallel.make.job"
#define PREF_TRANSLATE_MESSAGE "build.translate.message"
#define PREF_CONTINUE_ON_ERROR "build.continue.error"
#define BUILD_PREFS_DIALOG "preferences_dialog_build"
#define BUILD_PREFS_ROOT "preferences_build_container"
#define INSTALL_ROOT_CHECK "preferences_toggle:bool:0:0:build.install.root"
#define INSTALL_ROOT_ENTRY "preferences_entry:text:sudo:0:build.install.root.command"
#define PARALLEL_MAKE_CHECK "preferences_toggle:bool:0:0:build.parallel.make"
#define PARALLEL_MAKE_SPIN "preferences_spin:int:1:0:build.parallel.make.job"
#define PREF_SCHEMA "org.gnome.anjuta.build"
#define PREF_INDICATORS_AUTOMATIC "build-indicators-automatic"
#define PREF_INSTALL_ROOT "build-install-root"
#define PREF_INSTALL_ROOT_COMMAND "build-install-root-command"
#define PREF_PARALLEL_MAKE "build-parallel-make"
#define PREF_PARALLEL_MAKE_JOB "build-parallel-make-job"
#define PREF_TRANSLATE_MESSAGE "build-translate-message"
#define PREF_CONTINUE_ON_ERROR "build-continue-error"
#define BUILD_PREFS_DIALOG "preferences-dialog-build"
#define BUILD_PREFS_ROOT "preferences-build-container"
#define INSTALL_ROOT_CHECK "preferences_toggle:bool:0:0:build-install-root"
#define INSTALL_ROOT_ENTRY "preferences_combo:text:sudo, su -c:0:build-install-root-command"
#define PARALLEL_MAKE_CHECK "preferences_toggle:bool:0:0:build-parallel-make"
#define PARALLEL_MAKE_SPIN "preferences_spin:int:1:0:build-parallel-make-job"
#define DEFAULT_COMMAND_COMPILE "make"
#define DEFAULT_COMMAND_BUILD "make"
......@@ -972,7 +973,7 @@ on_build_mesg_format (IAnjutaMessageView *view, const gchar *one_line,
context->locations = g_slist_prepend (context->locations, loc);
/* If current editor file is same as indicator file, set indicator */
if (anjuta_preferences_get_bool (anjuta_shell_get_preferences (context->plugin->shell, NULL), PREF_INDICATORS_AUTOMATIC))
if (g_settings_get_boolean (p->settings, PREF_INDICATORS_AUTOMATIC))
{
build_indicator_location_set (loc, p->current_editor,
p->current_editor_filename);
......@@ -1328,18 +1329,18 @@ build_set_command_in_context (BuildContext* context, BuildProgram *prog)
static gboolean
build_execute_command_in_context (BuildContext* context, GError **err)
{
AnjutaPreferences* prefs = anjuta_shell_get_preferences (context->plugin->shell, NULL);
GSettings* settings = ANJUTA_PLUGIN_BASIC_AUTOTOOLS(context->plugin)->settings;
/* Send options to make */
if (strcmp (build_program_get_basename (context->program), "make") == 0)
{
if (anjuta_preferences_get_bool (prefs , PREF_PARALLEL_MAKE))
if (g_settings_get_boolean (settings, PREF_PARALLEL_MAKE))
{
gchar *arg = g_strdup_printf ("-j%d", anjuta_preferences_get_int (prefs , PREF_PARALLEL_MAKE_JOB));
gchar *arg = g_strdup_printf ("-j%d", g_settings_get_int (settings , PREF_PARALLEL_MAKE_JOB));
build_program_insert_arg (context->program, 1, arg);
g_free (arg);
}
if (anjuta_preferences_get_bool (prefs , PREF_CONTINUE_ON_ERROR))
if (g_settings_get_boolean (settings, PREF_CONTINUE_ON_ERROR))
{
build_program_insert_arg (context->program, 1, "-k");
}
......@@ -1348,7 +1349,7 @@ build_execute_command_in_context (BuildContext* context, GError **err)
/* Set a current working directory which can contains symbolic links */
build_program_add_env (context->program, "PWD", context->program->work_dir);
if (!anjuta_preferences_get_bool (prefs , PREF_TRANSLATE_MESSAGE))
if (!g_settings_get_boolean (settings, PREF_TRANSLATE_MESSAGE))
{
build_program_add_env (context->program, "LANGUAGE", "C");
}
......@@ -1652,15 +1653,11 @@ build_is_file_built (BasicAutotoolsPlugin *plugin, const gchar *filename,
static gchar*
get_root_install_command(BasicAutotoolsPlugin *bplugin)
{
AnjutaPlugin* plugin = ANJUTA_PLUGIN(bplugin);
AnjutaPreferences* prefs = anjuta_shell_get_preferences (plugin->shell, NULL);
if (anjuta_preferences_get_bool (prefs , PREF_INSTALL_ROOT))
GSettings* settings = bplugin->settings;
if (g_settings_get_boolean (settings, PREF_INSTALL_ROOT))
{
gchar* command = anjuta_preferences_get(prefs, PREF_INSTALL_ROOT_COMMAND);
if (command != NULL)
return command;
else
return g_strdup("");
gchar* command = g_settings_get_string (settings, PREF_INSTALL_ROOT_COMMAND);
return command;
}
else
return g_strdup("");
......@@ -1679,7 +1676,7 @@ build_install_dir (BasicAutotoolsPlugin *plugin, const gchar *dirname,
prog = build_program_new_with_command (build_dir,
"%s %s",
root,
CHOOSE_COMMAND (plugin, INSTALL)),
CHOOSE_COMMAND (plugin, INSTALL));
build_program_set_callback (prog, callback, user_data);
context = build_save_and_execute_command (plugin, prog, TRUE, err);
......@@ -2997,16 +2994,14 @@ value_added_project_build_uri (AnjutaPlugin *plugin, const gchar *name,
static gint
on_update_indicators_idle (gpointer data)
{
AnjutaPlugin *plugin = ANJUTA_PLUGIN (data);
BasicAutotoolsPlugin *ba_plugin = ANJUTA_PLUGIN_BASIC_AUTOTOOLS (data);
IAnjutaEditor *editor = ba_plugin->current_editor;
/* If indicators are not yet updated in the editor, do it */
if (ba_plugin->current_editor_filename &&
IANJUTA_IS_INDICABLE (editor) &&
anjuta_preferences_get_bool (anjuta_shell_get_preferences (plugin->shell,
NULL),
PREF_INDICATORS_AUTOMATIC))
g_settings_get_boolean (ba_plugin->settings,
PREF_INDICATORS_AUTOMATIC))
{
GList *node;
node = ba_plugin->contexts_pool;
......@@ -3254,6 +3249,10 @@ deactivate_plugin (AnjutaPlugin *plugin)
static void
dispose (GObject *obj)
{
BasicAutotoolsPlugin *ba_plugin = ANJUTA_PLUGIN_BASIC_AUTOTOOLS (obj);
g_object_unref (ba_plugin->settings);
G_OBJECT_CLASS (parent_class)->dispose (obj);
}
......@@ -3310,6 +3309,7 @@ basic_autotools_plugin_instance_init (GObject *obj)
ba_plugin->last_exec_uri = NULL;
ba_plugin->editors_created = g_hash_table_new (g_direct_hash,
g_direct_equal);
ba_plugin->settings = g_settings_new (PREF_SCHEMA);
}
static void
......@@ -3547,6 +3547,7 @@ ipreferences_merge(IAnjutaPreferences* ipref, AnjutaPreferences* prefs, GError**
GtkWidget *root_entry;
GtkWidget *make_entry;
GtkBuilder *bxml;
BasicAutotoolsPlugin *plugin = ANJUTA_PLUGIN_BASIC_AUTOTOOLS (ipref);
/* Create the preferences page */
bxml = anjuta_util_builder_new (BUILDER_FILE, NULL);
......@@ -3565,7 +3566,8 @@ ipreferences_merge(IAnjutaPreferences* ipref, AnjutaPreferences* prefs, GError**
g_signal_connect(G_OBJECT(make_check), "toggled", G_CALLBACK(on_root_check_toggled), make_entry);
on_root_check_toggled (make_check, make_entry);
anjuta_preferences_add_from_builder (prefs, bxml, BUILD_PREFS_ROOT, _("Build Autotools"), ICON_FILE);
anjuta_preferences_add_from_builder (prefs, bxml, plugin->settings,
BUILD_PREFS_ROOT, _("Build Autotools"), ICON_FILE);
g_object_unref (bxml);
}
......
......@@ -79,6 +79,9 @@ struct _BasicAutotoolsPlugin{
/* Editors that have been created so far */
GHashTable *editors_created;
/* Settings */
GSettings *settings;
};
struct _BasicAutotoolsPluginClass{
......
......@@ -438,6 +438,8 @@ cg_plugin_window_response_cb (G_GNUC_UNUSED GtkDialog *dialog,
}
}
#define PREF_SCHEMA "org.gnome.anjuta"
static void
iwizard_activate (IAnjutaWizard *wiz, G_GNUC_UNUSED GError **err)
{
......@@ -455,10 +457,9 @@ iwizard_activate (IAnjutaWizard *wiz, G_GNUC_UNUSED GError **err)
cg_plugin->window = cg_window_new ();
user_name = anjuta_preferences_get (cg_plugin->prefs,
"anjuta.user.name");
user_email = anjuta_preferences_get (cg_plugin->prefs,
"anjuta.user.email");
user_name = g_strdup(g_get_real_name ());
/* FIXME: */
user_email = NULL;
if (user_name != NULL)
cg_window_set_author (cg_plugin->window, user_name);
......
......@@ -41,7 +41,8 @@ libanjuta_cvs_plugin_la_SOURCES = \
cvs-callbacks.h \
cvs-interface.c \
cvs-interface.h
prefs_name = org.gnome.anjuta.cvs
prefs_ui_files = anjuta-cvs-plugin.ui
include $(top_srcdir)/scripts/build-schemas.mk
......
......@@ -67,7 +67,7 @@
</packing>
</child>
<child>
<object class="GtkFileChooserButton" id="preferences_file:text:/usr/bin/cvs:0:cvs.path">
<object class="GtkFileChooserButton" id="preferences_file:text:/usr/bin/cvs:0:cvs-path">
<property name="visible">True</property>
</object>
<packing>
......@@ -95,7 +95,7 @@
</packing>
</child>
<child>
<object class="GtkCheckButton" id="preferences_toggle:bool:1:0:cvs.ignorerc">
<object class="GtkCheckButton" id="preferences_toggle:bool:1:0:cvs-ignorerc">
<property name="label" translatable="yes">Ignore .cvsrc file (recommended)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
......@@ -112,7 +112,7 @@
</packing>
</child>
<child>
<object class="GtkSpinButton" id="preferences_spin:int:3:0:cvs.compression">
<object class="GtkSpinButton" id="preferences_spin:int:3:0:cvs-compression">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="adjustment">adjustment1</property>
......
......@@ -24,7 +24,7 @@
#include "plugin.h"
#include "libgen.h"
static gchar* create_cvs_command_with_cvsroot(AnjutaPreferences* prefs,
static gchar* create_cvs_command_with_cvsroot(GSettings* settings,
const gchar* action,
const gchar* command_options,
const gchar* command_arguments,
......@@ -38,14 +38,14 @@ static gchar* create_cvs_command_with_cvsroot(AnjutaPreferences* prefs,
/* command global_options cvsroot action command_options command_arguments */
gchar* CVS_FORMAT = "%s %s %s %s %s %s";
g_return_val_if_fail (prefs != NULL, NULL);
g_return_val_if_fail (settings != NULL, NULL);
g_return_val_if_fail (action != NULL, NULL);
g_return_val_if_fail (command_options != NULL, NULL);
g_return_val_if_fail (command_arguments != NULL, NULL);
cvs = anjuta_preferences_get(prefs, "cvs.path");
compression = anjuta_preferences_get_int(prefs, "cvs.compression");
ignorerc = anjuta_preferences_get_bool(prefs, "cvs.ignorerc");
cvs = g_settings_get_string(settings, "cvs.path");
compression = g_settings_get_int(settings, "cvs.compression");
ignorerc = g_settings_get_boolean(settings, "cvs.ignorerc");
if (compression && ignorerc)
global_options = g_strdup_printf("-f -z%d", compression);
else if (compression)
......@@ -66,12 +66,12 @@ static gchar* create_cvs_command_with_cvsroot(AnjutaPreferences* prefs,
return command;
}
inline static gchar* create_cvs_command(AnjutaPreferences* prefs,
inline static gchar* create_cvs_command(GSettings* settings,
const gchar* action,
const gchar* command_options,
const gchar* command_arguments)
{
return create_cvs_command_with_cvsroot(prefs, action, command_options,
return create_cvs_command_with_cvsroot(settings, action, command_options,
command_arguments, NULL);
}
......@@ -122,8 +122,7 @@ void anjuta_cvs_add (AnjutaPlugin *obj, const gchar* filename,
command = create_cvs_command(
anjuta_shell_get_preferences (ANJUTA_PLUGIN(plugin)->shell,
NULL), "add", options->str, basename(file));
plugin->settings, "add", options->str, basename(file));
cvs_execute(plugin, command, dirname(file));
g_free(command);
......@@ -152,16 +151,14 @@ void anjuta_cvs_commit (AnjutaPlugin *obj, const gchar* filename, const gchar* l
if (!is_directory(filename))
{
gchar* file = g_strdup(filename);
command = create_cvs_command(anjuta_shell_get_preferences (ANJUTA_PLUGIN(plugin)->shell,
NULL), "commit", options->str, basename(file));
command = create_cvs_command(plugin->settings, "commit", options->str, basename(file));
cvs_execute(plugin, command, dirname(file));
g_free(file);
}
else
{
gchar* dir = g_strdup(filename);
command = create_cvs_command(anjuta_shell_get_preferences (ANJUTA_PLUGIN(plugin)->shell,
NULL), "commit", options->str, "");
command = create_cvs_command(plugin->settings, "commit", options->str, "");
cvs_execute(plugin, command, dir);
g_free(dir);
}
......@@ -186,15 +183,13 @@ void anjuta_cvs_diff (AnjutaPlugin *obj, const gchar* filename, const gchar* rev
if (!is_directory(filename))
{
gchar* file = g_strdup(filename);
command = create_cvs_command(anjuta_shell_get_preferences (ANJUTA_PLUGIN(plugin)->shell,
NULL), "diff", options->str, basename(file));
command = create_cvs_command(plugin->settings, "diff", options->str, basename(file));
cvs_execute_diff(plugin, command, dirname(file));
}
else
{
gchar* dir = g_strdup(filename);
command = create_cvs_command(anjuta_shell_get_preferences (ANJUTA_PLUGIN(plugin)->shell,
NULL), "diff", options->str, "");
command = create_cvs_command(plugin->settings, "diff", options->str, "");
cvs_execute_diff(plugin, command, dir);
g_free(dir);
}
......@@ -214,16 +209,14 @@ void anjuta_cvs_log (AnjutaPlugin *obj, const gchar* filename, gboolean recurse,
if (!is_directory(filename))
{
gchar* file = g_strdup(filename);
command = create_cvs_command(anjuta_shell_get_preferences (ANJUTA_PLUGIN(plugin)->shell,
NULL), "log", options->str, basename(file));