[gnome-flashback] desktop: add background settings



commit c78283774be5c146e7633d748ba1b764da77038b
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Tue Oct 29 02:48:51 2019 +0200

    desktop: add background settings

 data/schemas/Makefile.am                           |  1 +
 ....gnome-flashback.desktop.background.gschema.xml |  9 +++++++
 .../org.gnome.gnome-flashback.desktop.gschema.xml  |  2 ++
 gnome-flashback/libdesktop/gf-background.c         | 31 ++++++++++++++++++++++
 po/POTFILES.in                                     |  1 +
 5 files changed, 44 insertions(+)
---
diff --git a/data/schemas/Makefile.am b/data/schemas/Makefile.am
index 3e4f908..506e1e9 100644
--- a/data/schemas/Makefile.am
+++ b/data/schemas/Makefile.am
@@ -6,6 +6,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.desktop-background.gschema.xml \
        org.gnome.gnome-flashback.input-sources.gschema.xml \
        $(NULL)
diff --git a/data/schemas/org.gnome.gnome-flashback.desktop.background.gschema.xml 
b/data/schemas/org.gnome.gnome-flashback.desktop.background.gschema.xml
new file mode 100644
index 0000000..74bae27
--- /dev/null
+++ b/data/schemas/org.gnome.gnome-flashback.desktop.background.gschema.xml
@@ -0,0 +1,9 @@
+<schemalist gettext-domain="gnome-flashback">
+  <schema id="org.gnome.gnome-flashback.desktop.background" 
path="/org/gnome/gnome-flashback/desktop/background/">
+    <key name="fade" type="b">
+      <default>true</default>
+      <summary>Fade the background on change</summary>
+      <description>If set to true, then fade effect will be used to change the desktop 
background.</description>
+    </key>
+  </schema>
+</schemalist>
diff --git a/data/schemas/org.gnome.gnome-flashback.desktop.gschema.xml 
b/data/schemas/org.gnome.gnome-flashback.desktop.gschema.xml
index b8cd0c9..4e015fe 100644
--- a/data/schemas/org.gnome.gnome-flashback.desktop.gschema.xml
+++ b/data/schemas/org.gnome.gnome-flashback.desktop.gschema.xml
@@ -11,5 +11,7 @@
       <summary>Show desktop icons</summary>
       <description>If set to true, then GNOME Flashback will draw the icons on the desktop.</description>
     </key>
+
+    <child schema="org.gnome.gnome-flashback.desktop.background" name="background" />
   </schema>
 </schemalist>
diff --git a/gnome-flashback/libdesktop/gf-background.c b/gnome-flashback/libdesktop/gf-background.c
index 6494814..334bba1 100644
--- a/gnome-flashback/libdesktop/gf-background.c
+++ b/gnome-flashback/libdesktop/gf-background.c
@@ -23,6 +23,9 @@ struct _GfBackground
   GObject    parent;
 
   GtkWidget *window;
+
+  GSettings *settings1;
+  GSettings *settings2;
 };
 
 enum
@@ -47,6 +50,32 @@ static guint background_signals[LAST_SIGNAL] = { 0 };
 
 G_DEFINE_TYPE (GfBackground, gf_background, G_TYPE_OBJECT)
 
+static void
+gf_background_constructed (GObject *object)
+{
+  GfBackground *self;
+
+  self = GF_BACKGROUND (object);
+
+  G_OBJECT_CLASS (gf_background_parent_class)->constructed (object);
+
+  self->settings1 = g_settings_new ("org.gnome.desktop.background");
+  self->settings2 = g_settings_new ("org.gnome.gnome-flashback.desktop.background");
+}
+
+static void
+gf_background_dispose (GObject *object)
+{
+  GfBackground *self;
+
+  self = GF_BACKGROUND (object);
+
+  g_clear_object (&self->settings1);
+  g_clear_object (&self->settings2);
+
+  G_OBJECT_CLASS (gf_background_parent_class)->dispose (object);
+}
+
 static void
 gf_background_set_property (GObject      *object,
                             guint         property_id,
@@ -100,6 +129,8 @@ gf_background_class_init (GfBackgroundClass *self_class)
 
   object_class = G_OBJECT_CLASS (self_class);
 
+  object_class->constructed = gf_background_constructed;
+  object_class->dispose = gf_background_dispose;
   object_class->set_property = gf_background_set_property;
 
   install_properties (object_class);
diff --git a/po/POTFILES.in b/po/POTFILES.in
index e9fe76e..dc82a7f 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -8,6 +8,7 @@ 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.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]