diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-06-26 22:13:13 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2014-06-26 22:13:13 -0500 |
commit | 8bb09ca0225886c18e351d3c6156521ed479edd1 (patch) | |
tree | cd5e30c6fc5531f0ad1efb711957a3d951e4a66a /src/exporter.cpp | |
parent | c5081444f4f493dc386012bcb99d2430fe26dc5a (diff) | |
download | ayatana-indicator-datetime-8bb09ca0225886c18e351d3c6156521ed479edd1.tar.gz ayatana-indicator-datetime-8bb09ca0225886c18e351d3c6156521ed479edd1.tar.bz2 ayatana-indicator-datetime-8bb09ca0225886c18e351d3c6156521ed479edd1.zip |
Design prefers to have a volume slider instead of presets, so remove the AlarmVolume enum and replace it with an int range.
Diffstat (limited to 'src/exporter.cpp')
-rw-r--r-- | src/exporter.cpp | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/src/exporter.cpp b/src/exporter.cpp index 3ba95bf..a5a059d 100644 --- a/src/exporter.cpp +++ b/src/exporter.cpp @@ -137,34 +137,10 @@ private: } - static void - on_gobject_notify_volume(GObject* o, GParamSpec* pspec, gpointer p) - { - int val = 0; - g_object_get (o, pspec->name, &val, nullptr); - static_cast<core::Property<AlarmVolume>*>(p)->set(AlarmVolume(val)); - } - void bind_volume_property(gpointer o, const char* propname, core::Property<AlarmVolume>& p) - { - // initialize the GObject property from the Settings - g_object_set(o, propname, (int)p.get(), nullptr); - - // when the GObject changes, update the Settings - const std::string notify_propname = std::string("notify::") + propname; - g_signal_connect(o, notify_propname.c_str(), - G_CALLBACK(on_gobject_notify_volume), &p); - - // when the Settings changes, update the GObject - p.changed().connect([o, propname](AlarmVolume i){ - g_object_set(o, propname, (int)i, nullptr); - }); - } - - void alarm_properties_init() { bind_int_property(m_alarm_props, "duration", m_settings->alarm_duration); - bind_volume_property(m_alarm_props, "default-volume", m_settings->alarm_volume); + bind_int_property(m_alarm_props, "default-volume", m_settings->alarm_volume); bind_string_property(m_alarm_props, "default-sound", m_settings->alarm_sound); } |