[anjuta/gsettings-migration: 61/65] run: Fixed GSettings issue
- From: Johannes Schmid <jhs src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta/gsettings-migration: 61/65] run: Fixed GSettings issue
- Date: Sun, 17 Oct 2010 09:37:53 +0000 (UTC)
commit 92cf2a3d92fb15a72f6da00b87f887c0bb6be6ed
Author: Johannes Schmid <jhs gnome org>
Date: Sat Oct 16 22:28:54 2010 +0200
run: Fixed GSettings issue
plugins/run-program/Makefile.am | 5 +++++
plugins/run-program/execute.c | 17 ++++++++---------
.../org.gnome.anjuta.run.gschema.xml.in | 8 ++++++++
3 files changed, 21 insertions(+), 9 deletions(-)
---
diff --git a/plugins/run-program/Makefile.am b/plugins/run-program/Makefile.am
index 66a416a..b4613f8 100644
--- a/plugins/run-program/Makefile.am
+++ b/plugins/run-program/Makefile.am
@@ -11,6 +11,11 @@ anjuta_pixmapsdir = $(anjuta_image_dir)
anjuta_pixmaps_DATA = \
anjuta-run-program-48.png
+schema_in_files = org.gnome.anjuta.run.gschema.xml.in
+gsettings_SCHEMAS = $(schema_in_files:.gschema.xml.in=.gschema.xml)
+ INTLTOOL_XML_NOMERGE_RULE@
+ GSETTINGS_RULES@
+
# Plugin description file
plugin_in_files = anjuta-run-program.plugin.in
%.plugin: %.plugin.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
diff --git a/plugins/run-program/execute.c b/plugins/run-program/execute.c
index 9361755..e57f164 100644
--- a/plugins/run-program/execute.c
+++ b/plugins/run-program/execute.c
@@ -38,7 +38,8 @@
#define PREF_USE_SB "build.use_scratchbox"
#define PREF_SB_PATH "build.scratchbox.path"
-#define PREF_TERMINAL_COMMAND "terminal-command"
+#define PREF_SCHEMA "org.gnome.anjuta.run"
+#define PREF_TERMINAL_COMMAND "run-terminal-command"
/*----------------------------------------------------------------------------
* Type definitions
@@ -260,16 +261,12 @@ execute_with_terminal (RunProgramPlugin *plugin,
if (term == NULL)
{
/* Use gnome terminal or another user defined one */
- AnjutaPreferences *pref;
+ GSettings* settings = g_settings_new (PREF_SCHEMA);
gchar *term_cmd;
gchar **argv;
- pref = anjuta_shell_get_preferences (ANJUTA_PLUGIN (plugin)->shell, NULL);
- term_cmd = anjuta_preferences_get (pref, PREF_TERMINAL_COMMAND);
- if (!term_cmd)
- {
- term_cmd = g_strdup ("gnome-terminal --disable-factory -e %s");
- }
+ term_cmd = g_settings_get_string (settings, PREF_TERMINAL_COMMAND);
+ g_object_unref (settings);
if (g_shell_parse_argv (term_cmd, NULL, &argv, NULL))
{
gchar **arg;
@@ -422,6 +419,8 @@ run_program (RunProgramPlugin *plugin)
g_free (quote_target);
/* Take care of scratchbox */
+ /* FIXME: scratchbox */
+#if 0
prefs = anjuta_shell_get_preferences (ANJUTA_PLUGIN(plugin)->shell, NULL);
if (anjuta_preferences_get_bool (prefs , PREF_USE_SB))
{
@@ -437,7 +436,7 @@ run_program (RunProgramPlugin *plugin)
dir = g_strdup(real_dir);
g_free (olddir);
}
-
+#endif
if (run_in_terminal)
{
pid = execute_with_terminal (plugin, dir, cmd, env);
diff --git a/plugins/run-program/org.gnome.anjuta.run.gschema.xml.in b/plugins/run-program/org.gnome.anjuta.run.gschema.xml.in
new file mode 100644
index 0000000..b8c147c
--- /dev/null
+++ b/plugins/run-program/org.gnome.anjuta.run.gschema.xml.in
@@ -0,0 +1,8 @@
+<schemalist>
+ <schema id="org.gnome.anjuta.run" path="/apps/anjuta/run/">
+ <key name="run-terminal-command" type="s">
+ <default>"gnome-terminal --disable-factory -e %s"</default>
+ <_summary>Command used for starting a terminal</_summary>
+ </key>
+ </schema>
+</schemalist>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]