[solang/gsettings: 1/4] Added support for user-preferences using GSettings This patch introduce a dependency againt glib >=



commit 0b9e48a730750ab655ca64e3829a3a35e24cd7cf
Author: Florent Thévenet <feuloren free fr>
Date:   Sat May 15 08:50:33 2010 +0200

    Added support for user-preferences using GSettings
    This patch introduce a dependency againt glib >= 2.25.3 (not specified in configure.ac) and gconf >= 2.31.1 (specified in configure.ac)

 configure.ac                    |    1 +
 data/gschemas.compiled          |  Bin 0 -> 2483 bytes
 data/solang.gschema.xml         |  214 +++++++++++++++++++++++++++++++++++++++
 src/application/application.cpp |   10 ++
 src/application/application.h   |    5 +
 5 files changed, 230 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ab40d9c..0861120 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,7 @@ PKG_CHECK_MODULES(GEGLMM, [geglmm >= 0.1.0])
 PKG_CHECK_MODULES(GTKIMAGEVIEW, [gtkimageview])
 PKG_CHECK_MODULES(GTKMM, [gtkmm-2.4 >= 2.8])
 PKG_CHECK_MODULES(TRACKER, [tracker-client-0.8])
+PKG_CHECK_MODULES(GCONF, [gconf-2.0 >= 2.31.1])
 
 AC_ARG_ENABLE(
     [brasero-exporter],
diff --git a/data/gschemas.compiled b/data/gschemas.compiled
new file mode 100644
index 0000000..a692f35
Binary files /dev/null and b/data/gschemas.compiled differ
diff --git a/data/solang.gschema.xml b/data/solang.gschema.xml
new file mode 100644
index 0000000..0c4a3a0
--- /dev/null
+++ b/data/solang.gschema.xml
@@ -0,0 +1,214 @@
+<schemalist>
+  <schema id="org.gnome.solang" path="/org/gnome/solang">
+    <key name="background-color" type="s">
+      <default>""</default>
+      <summary>Background color</summary>
+      <description>The Background color of the icon view.</description>
+    </key>
+    <key name="use-background-color" type="b">
+      <default>false</default>
+      <summary>Use Background color</summary>
+      <description>If True, the icon view will use the specified background-color instead of the gtk theme color.</description>
+    </key>
+    <key name="window-width" type="i">
+      <default>800</default>
+      <summary>Window width</summary>
+      <description>Saved width of the main window</description>
+    </key>
+    <key name="window-height" type="i">
+      <default>600</default>
+      <summary>Window height</summary>
+      <description>Saved height of the main window</description>
+    </key>
+    <key name="window-maximized" type="b">
+      <default>false</default>
+      <summary>Window maximized</summary>
+      <description>Save state of the main window</description>
+    </key>
+    <child name="keys" schema="org.gnome.solang.keys" />
+  </schema>
+  
+  <schema id="org.gnome.solang.keys" path="/org/gnome/solang/keys">
+    <key name="key-a" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-b" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-c" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-d" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-e" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-f" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-g" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-h" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-i" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-j" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-k" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-l" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-m" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-n" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-o" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-p" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-q" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-r" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-s" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-t" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-u" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-v" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-w" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-x" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-y" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-z" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-0" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-1" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-2" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-3" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-4" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-5" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-6" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-7" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-8" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+    <key name="key-9" type="s">
+      <default>""</default>
+      <summary>Tag associated to this key</summary>
+      <description>The URN of the tag associated to this key.</description>
+    </key>
+  </schema>
+
+</schemalist>
diff --git a/src/application/application.cpp b/src/application/application.cpp
index 0c9a48b..da42adb 100644
--- a/src/application/application.cpp
+++ b/src/application/application.cpp
@@ -272,6 +272,10 @@ Application::init() throw()
         sigc::mem_fun(*this,
                       &Application::on_async_search));
 
+    //we use the gconf backend for gsettings
+    g_setenv("GSETTINGS_BACKEND", "gconf", FALSE);
+    settings_ = g_settings_new("org.gnome.solang");
+
     // Plugins.
 
 //    IPluginPtr date_manager(new DateManager());
@@ -504,6 +508,12 @@ Application::get_main_window() throw()
     return mainWindow_;
 }
 
+GSettings *
+Application::get_settings() throw()
+{
+    return settings_;
+}
+
 ProgressDialog &
 Application::get_progress_dialog() throw()
 {
diff --git a/src/application/application.h b/src/application/application.h
index 57ce530..177ec28 100644
--- a/src/application/application.h
+++ b/src/application/application.h
@@ -70,6 +70,9 @@ class Application :
 
         MainWindow &
         get_main_window() throw();
+        
+        GSettings *
+        get_settings() throw();
 
         ProgressDialog &
         get_progress_dialog() throw();
@@ -135,6 +138,8 @@ class Application :
         RendererRegistry rendererRegistry_;
 
         DragDropCriteriaMap dragItemMap_;
+        
+        GSettings * settings_;
 
         sigc::signal<void, Application &> initEnd_;
 



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