[gnome-flashback] desktop: add main settings



commit 31d43ebedd1c141615ddd3fab772d38bf19f2cae
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Oct 25 17:33:55 2019 +0300

    desktop: add main settings

 configure.ac                                       |  1 +
 data/schemas/Makefile.am                           |  1 +
 .../org.gnome.gnome-flashback.desktop.gschema.xml  | 15 ++++++++++++++
 data/schemas/org.gnome.gnome-flashback.gschema.xml |  4 ++++
 gnome-flashback/libdesktop/gf-desktop.c            | 24 +++++++++++++++++++++-
 po/POTFILES.in                                     |  1 +
 6 files changed, 45 insertions(+), 1 deletion(-)
---
diff --git a/configure.ac b/configure.ac
index 2ec9853..5fd41c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -153,6 +153,7 @@ PKG_CHECK_MODULES([COMMON], [
 
 PKG_CHECK_MODULES([DESKTOP], [
   glib-2.0 >= $GLIB_REQUIRED
+  gio-2.0 >= $GLIB_REQUIRED
   gtk+-3.0 >= $GTK_REQUIRED
 ])
 
diff --git a/data/schemas/Makefile.am b/data/schemas/Makefile.am
index 95d3c63..3e4f908 100644
--- a/data/schemas/Makefile.am
+++ b/data/schemas/Makefile.am
@@ -5,6 +5,7 @@ override_DATA = 00_gnome-flashback.gschema.override
 
 gsettings_SCHEMAS = \
        org.gnome.gnome-flashback.gschema.xml \
+       org.gnome.gnome-flashback.desktop.gschema.xml \
        org.gnome.gnome-flashback.desktop-background.gschema.xml \
        org.gnome.gnome-flashback.input-sources.gschema.xml \
        $(NULL)
diff --git a/data/schemas/org.gnome.gnome-flashback.desktop.gschema.xml 
b/data/schemas/org.gnome.gnome-flashback.desktop.gschema.xml
new file mode 100644
index 0000000..b8cd0c9
--- /dev/null
+++ b/data/schemas/org.gnome.gnome-flashback.desktop.gschema.xml
@@ -0,0 +1,15 @@
+<schemalist gettext-domain="gnome-flashback">
+  <schema id="org.gnome.gnome-flashback.desktop" path="/org/gnome/gnome-flashback/desktop/">
+    <key name="draw-background" type="b">
+      <default>true</default>
+      <summary>Draw desktop background</summary>
+      <description>If set to true, then GNOME Flashback will draw the desktop background.</description>
+    </key>
+
+    <key name="show-icons" type="b">
+      <default>true</default>
+      <summary>Show desktop icons</summary>
+      <description>If set to true, then GNOME Flashback will draw the icons on the desktop.</description>
+    </key>
+  </schema>
+</schemalist>
diff --git a/data/schemas/org.gnome.gnome-flashback.gschema.xml 
b/data/schemas/org.gnome.gnome-flashback.gschema.xml
index dad0001..149576a 100644
--- a/data/schemas/org.gnome.gnome-flashback.gschema.xml
+++ b/data/schemas/org.gnome.gnome-flashback.gschema.xml
@@ -115,5 +115,9 @@
       <summary>Status Notifier Watcher</summary>
       <description>If set to true, then GNOME Flashback application will be used as Status Notifier 
Watcher.</description>
     </key>
+
+    <child schema="org.gnome.gnome-flashback.desktop" name="desktop" />
+    <child schema="org.gnome.gnome-flashback.desktop-background" name="desktop-background" />
+    <child schema="org.gnome.gnome-flashback.input-sources" name="input-sources" />
   </schema>
 </schemalist>
diff --git a/gnome-flashback/libdesktop/gf-desktop.c b/gnome-flashback/libdesktop/gf-desktop.c
index b82bed7..dddbeb3 100644
--- a/gnome-flashback/libdesktop/gf-desktop.c
+++ b/gnome-flashback/libdesktop/gf-desktop.c
@@ -18,21 +18,43 @@
 #include "config.h"
 #include "gf-desktop.h"
 
+#include <gio/gio.h>
+
 struct _GfDesktop
 {
-  GObject parent;
+  GObject    parent;
+
+  GSettings *settings;
 };
 
 G_DEFINE_TYPE (GfDesktop, gf_desktop, G_TYPE_OBJECT)
 
+static void
+gf_desktop_dispose (GObject *object)
+{
+  GfDesktop *self;
+
+  self = GF_DESKTOP (object);
+
+  g_clear_object (&self->settings);
+
+  G_OBJECT_CLASS (gf_desktop_parent_class)->dispose (object);
+}
+
 static void
 gf_desktop_class_init (GfDesktopClass *self_class)
 {
+  GObjectClass *object_class;
+
+  object_class = G_OBJECT_CLASS (self_class);
+
+  object_class->dispose = gf_desktop_dispose;
 }
 
 static void
 gf_desktop_init (GfDesktop *self)
 {
+  self->settings = g_settings_new ("org.gnome.gnome-flashback.desktop");
 }
 
 GfDesktop *
diff --git a/po/POTFILES.in b/po/POTFILES.in
index e4c6143..e9fe76e 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -7,6 +7,7 @@ data/autostart/gnome-flashback-screensaver.desktop.in
 data/directories/X-GNOME-Flashback-Settings.directory.desktop.in
 data/directories/X-GNOME-Flashback-Settings-System.directory.desktop.in
 data/schemas/org.gnome.gnome-flashback.gschema.xml
+data/schemas/org.gnome.gnome-flashback.desktop.gschema.xml
 data/schemas/org.gnome.gnome-flashback.desktop-background.gschema.xml
 data/schemas/org.gnome.gnome-flashback.input-sources.gschema.xml
 data/ui/gf-confirm-display-change-dialog.ui


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