Commit b2b63bdb authored by Jens Georg's avatar Jens Georg Committed by Johannes Schmid

language-support-js: Port to gsettings

parent 58d26177
......@@ -64,6 +64,10 @@ libjs_support_plugin_la_LDFLAGS = $(ANJUTA_PLUGIN_LDFLAGS)
libjs_support_plugin_la_LIBADD = \
$(LIBANJUTA_LIBS)
prefs_ui_files = anjuta-language-javascript.ui
prefs_name = org.gnome.anjuta.js
include $(top_srcdir)/scripts/build-schemas.mk
EXTRA_DIST = \
$(plugin_in_files)\
$(js_support_plugin_plugin_DATA)\
......
......@@ -185,7 +185,7 @@
</packing>
</child>
<child>
<object class="GtkSpinButton" id="preferences_spin:int:3:1:javascript-min">
<object class="GtkSpinButton" id="preferences_spin:int:3:1:javascript-min-codecomplete">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x2022;</property>
......
......@@ -40,9 +40,9 @@
#define ICON_FILE "anjuta-language-cpp-java-plugin.png"
#define UI_FILE ANJUTA_UI_DIR"/anjuta-language-javascript.xml"
#define MIN_CODECOMPLETE "javascript.min"
#define ADD_BRACE_AFTER_FUNCCALL "javascript.add_brace_after_func"
#define SHOW_CALLTIPS "javascript.show_calltips"
#define MIN_CODECOMPLETE "javascript-min-codecomplete"
#define ADD_BRACE_AFTER_FUNCCALL "javascript-add-brace-after-func"
#define SHOW_CALLTIPS "javascript-show-calltips"
#define JSDIRS_LISTSTORE "jsdirs_liststore"
#define JSDIRS_TREEVIEW "jsdirs_treeview"
......@@ -75,7 +75,7 @@ js_support_plugin_activate (AnjutaPlugin *plugin)
on_value_removed_current_editor,
plugin);
js_support_plugin->prefs = anjuta_shell_get_preferences (plugin->shell, NULL);
js_support_plugin->prefs = g_settings_new ("org.gnome.anjuta.js");
return TRUE;
}
......@@ -329,7 +329,7 @@ ipreferences_merge (IAnjutaPreferences* ipref, AnjutaPreferences* prefs,
gtk_builder_connect_signals (bxml, tree);
jsdirs_init_treeview (bxml);
anjuta_preferences_add_from_builder (prefs,
bxml, "vbox1", _("JavaScript"),
bxml, NULL, "vbox1", _("JavaScript"),
ICON_FILE);
g_object_unref (bxml);
}
......@@ -370,11 +370,11 @@ iprovider_activate (IAnjutaProvider *obj, IAnjutaIterable* iter, gpointer data,
{
IAnjutaIterable *position = ianjuta_editor_get_position (IANJUTA_EDITOR (plugin->current_editor), NULL);
if (anjuta_preferences_get_bool (plugin->prefs, ADD_BRACE_AFTER_FUNCCALL))
if (g_settings_get_boolean (plugin->prefs, ADD_BRACE_AFTER_FUNCCALL))
{
ianjuta_editor_insert (IANJUTA_EDITOR (plugin->current_editor), position, " (", -1, NULL);
}
if (anjuta_preferences_get_bool (plugin->prefs, SHOW_CALLTIPS))
if (g_settings_get_boolean (plugin->prefs, SHOW_CALLTIPS))
{
/* GList *t = NULL;
gchar *args = code_completion_get_func_tooltip (plugin, sym);
......@@ -435,7 +435,7 @@ iprovider_populate (IAnjutaProvider *obj, IAnjutaIterable* iter, GError **err)
g_assert (plugin->prefs);
if (strlen (str) < anjuta_preferences_get_int (plugin->prefs, MIN_CODECOMPLETE))
if (strlen (str) < g_settings_get_int (plugin->prefs, MIN_CODECOMPLETE))
{
ianjuta_editor_assist_proposals ( IANJUTA_EDITOR_ASSIST (plugin->current_editor), obj, NULL, TRUE, NULL);
return;
......
......@@ -35,7 +35,7 @@ struct _JSLang{
gpointer last;
// GList *complition_cache;
// gint uiid;
AnjutaPreferences *prefs;
GSettings *prefs;
DatabaseSymbol* symbol;
// GtkActionGroup *action_group;
};
......
......@@ -25,9 +25,9 @@
#include "plugin.h"
#include "util.h"
#define HIGHLIGHT_MISSEDSEMICOLON "javascript_missed"
#define GIR_DIR_KEY "javascript_girdir"
#define GJS_DIR_KEY "javascript_gjsdir"
#define HIGHLIGHT_MISSEDSEMICOLON "javascript-missed"
#define GIR_DIR_KEY "javascript-girdir"
#define GJS_DIR_KEY "javascript-gjsdir"
static gchar*
get_gjs_path ()
......@@ -35,9 +35,9 @@ get_gjs_path ()
JSLang* plugin = (JSLang*)getPlugin ();
if (!plugin->prefs)
plugin->prefs = anjuta_shell_get_preferences (ANJUTA_PLUGIN (plugin)->shell, NULL);
plugin->prefs = g_settings_new ("org.gnome.anjuta.js");
gchar *path = anjuta_preferences_get (plugin->prefs, GJS_DIR_KEY);
gchar *path = g_settings_get_string (plugin->prefs, GJS_DIR_KEY);
if (!path || strlen (path) < 1)
{
g_free (path);
......@@ -114,7 +114,7 @@ highlight_lines (GList *lines)
if (!plugin->prefs)
plugin->prefs = anjuta_shell_get_preferences (ANJUTA_PLUGIN (plugin)->shell, NULL);
if (!anjuta_preferences_get_bool (plugin->prefs, HIGHLIGHT_MISSEDSEMICOLON))
if (!g_settings_get_boolean (plugin->prefs, HIGHLIGHT_MISSEDSEMICOLON))
{
return;
}
......@@ -245,7 +245,7 @@ get_gir_path ()
if (!plugin->prefs)
plugin->prefs = anjuta_shell_get_preferences (ANJUTA_PLUGIN (plugin)->shell, NULL);
gchar *path = anjuta_preferences_get (plugin->prefs, GIR_DIR_KEY);
gchar *path = g_settings_get_string (plugin->prefs, GIR_DIR_KEY);
if (!path || strlen (path) < 1)
{
g_free (path);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment