[gnote] Add utils for gnome desktop settings



commit 13a5c16e0c7cbcc39fd5dcac8991e5f04d46c5d7
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sun Dec 13 13:10:05 2020 +0200

    Add utils for gnome desktop settings

 src/preferences.cpp | 12 ++++++++++++
 src/preferences.hpp | 14 ++++++++++++++
 2 files changed, 26 insertions(+)
---
diff --git a/src/preferences.cpp b/src/preferences.cpp
index ce12cdcc..3eae761d 100644
--- a/src/preferences.cpp
+++ b/src/preferences.cpp
@@ -82,6 +82,18 @@ namespace gnote {
     m_schemas[SCHEMA_GNOTE] = Gio::Settings::create(SCHEMA_GNOTE);
     m_schema_gnome_interface = Gio::Settings::create(SCHEMA_DESKTOP_GNOME_INTERFACE);
     m_schema_sync = Gio::Settings::create(SCHEMA_SYNC);
+
+    m_schema_gnome_interface->signal_changed(DESKTOP_GNOME_CLOCK_FORMAT).connect([this](const Glib::ustring 
&) {
+      m_desktop_gnome_clock_format = m_schema_gnome_interface->get_string(DESKTOP_GNOME_CLOCK_FORMAT);
+      signal_desktop_gnome_clock_format_changed();
+    });
+    m_schema_gnome_interface->signal_changed(DESKTOP_GNOME_FONT).connect([this](const Glib::ustring &) {
+      m_desktop_gnome_font = m_schema_gnome_interface->get_string(DESKTOP_GNOME_FONT);
+      signal_desktop_gnome_font_changed();
+    });
+
+    m_desktop_gnome_clock_format = m_schema_gnome_interface->get_string(DESKTOP_GNOME_CLOCK_FORMAT);
+    m_desktop_gnome_font = m_schema_gnome_interface->get_string(DESKTOP_GNOME_FONT);
   }
   
   Glib::RefPtr<Gio::Settings> Preferences::get_schema_settings(const Glib::ustring & schema)
diff --git a/src/preferences.hpp b/src/preferences.hpp
index 2ed7c013..6a652bc2 100644
--- a/src/preferences.hpp
+++ b/src/preferences.hpp
@@ -88,6 +88,17 @@ namespace gnote {
         return m_schema_sync;
       }
 
+    const Glib::ustring & desktop_gnome_clock_format() const
+      {
+        return m_desktop_gnome_clock_format;
+      }
+    sigc::signal<void> signal_desktop_gnome_clock_format_changed;
+    const Glib::ustring & desktop_gnome_font() const
+      {
+        return m_desktop_gnome_font;
+      }
+    sigc::signal<void> signal_desktop_gnome_font_changed;
+
     Glib::ustring sync_client_id() const;
     Glib::ustring sync_local_path() const;
     void sync_local_path(const Glib::ustring &);
@@ -114,6 +125,9 @@ namespace gnote {
     std::map<Glib::ustring, Glib::RefPtr<Gio::Settings> > m_schemas;
     Glib::RefPtr<Gio::Settings> m_schema_gnome_interface;
     Glib::RefPtr<Gio::Settings> m_schema_sync;
+
+    Glib::ustring m_desktop_gnome_clock_format;
+    Glib::ustring m_desktop_gnome_font;
   };
 
 


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