From fcd77b806a8826d5f694f78c63943d0f768ef6ec Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 26 Jul 2014 23:35:38 -0500 Subject: refactor the Notifications / sound / awake code --- include/datetime/dbus-shared.h | 14 +++----------- include/datetime/snap.h | 12 +++++------- 2 files changed, 8 insertions(+), 18 deletions(-) (limited to 'include/datetime') diff --git a/include/datetime/dbus-shared.h b/include/datetime/dbus-shared.h index 4b71ce5..db10c1d 100644 --- a/include/datetime/dbus-shared.h +++ b/include/datetime/dbus-shared.h @@ -18,18 +18,10 @@ * Charles Kerr */ -#ifndef _DBUS_SHARED_H_ -#define _DBUS_SHARED_H_ +#ifndef _INDICATOR_DATETIME_DBUS_SHARED_H_ +#define _INDICATOR_DATETIME_DBUS_SHARED_H_ #define BUS_DATETIME_NAME "com.canonical.indicator.datetime" #define BUS_DATETIME_PATH "/com/canonical/indicator/datetime" -#define BUS_SCREEN_NAME "com.canonical.Unity.Screen" -#define BUS_SCREEN_PATH "/com/canonical/Unity/Screen" -#define BUS_SCREEN_INTERFACE "com.canonical.Unity.Screen" - -#define BUS_POWERD_NAME "com.canonical.powerd" -#define BUS_POWERD_PATH "/com/canonical/powerd" -#define BUS_POWERD_INTERFACE "com.canonical.powerd" - -#endif /* _DBUS_SHARED_H_ */ +#endif /* _INDICATOR_DATETIME_DBUS_SHARED_H_ */ diff --git a/include/datetime/snap.h b/include/datetime/snap.h index 1c90496..78d9f65 100644 --- a/include/datetime/snap.h +++ b/include/datetime/snap.h @@ -21,9 +21,10 @@ #define INDICATOR_DATETIME_SNAP_H #include -#include #include +#include + #include #include #include @@ -38,7 +39,7 @@ namespace datetime { class Snap { public: - Snap(const std::shared_ptr& clock, + Snap(const std::shared_ptr& engine, const std::shared_ptr& settings); virtual ~Snap(); @@ -48,12 +49,9 @@ public: appointment_func dismiss); private: - const std::shared_ptr m_clock; + const std::shared_ptr m_engine; const std::shared_ptr m_settings; - - class Popup; - friend class Popup; - std::set m_pending; + std::set m_notifications; }; } // namespace datetime -- cgit v1.2.3 From d6b290fda978379fb07285aaddfeb31686735667 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 30 Jul 2014 14:54:37 -0500 Subject: move Snap's guts into an Impl class --- include/datetime/snap.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'include/datetime') diff --git a/include/datetime/snap.h b/include/datetime/snap.h index 78d9f65..ef5c868 100644 --- a/include/datetime/snap.h +++ b/include/datetime/snap.h @@ -27,7 +27,6 @@ #include #include -#include namespace unity { namespace indicator { @@ -49,9 +48,8 @@ public: appointment_func dismiss); private: - const std::shared_ptr m_engine; - const std::shared_ptr m_settings; - std::set m_notifications; + class Impl; + std::unique_ptr impl; }; } // namespace datetime -- cgit v1.2.3 From 4148750ea93e67e5d9aaa15ebc8e3c7a5a5554f1 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 31 Jul 2014 16:48:00 -0500 Subject: configurable haptic mode, part 1 of 3: add haptic feedback mode to the GSettings schema and to our Settings object --- include/datetime/settings-live.h | 1 + include/datetime/settings-shared.h | 1 + include/datetime/settings.h | 1 + 3 files changed, 3 insertions(+) (limited to 'include/datetime') diff --git a/include/datetime/settings-live.h b/include/datetime/settings-live.h index 4db2d40..4850e69 100644 --- a/include/datetime/settings-live.h +++ b/include/datetime/settings-live.h @@ -58,6 +58,7 @@ private: void update_alarm_sound(); void update_alarm_volume(); void update_alarm_duration(); + void update_alarm_haptic(); GSettings* m_settings; diff --git a/include/datetime/settings-shared.h b/include/datetime/settings-shared.h index 23d2e1c..a211821 100644 --- a/include/datetime/settings-shared.h +++ b/include/datetime/settings-shared.h @@ -48,5 +48,6 @@ TimeFormatMode; #define SETTINGS_ALARM_SOUND_S "alarm-default-sound" #define SETTINGS_ALARM_VOLUME_S "alarm-default-volume" #define SETTINGS_ALARM_DURATION_S "alarm-duration-minutes" +#define SETTINGS_ALARM_HAPTIC_S "alarm-haptic-feedback" #endif // INDICATOR_DATETIME_SETTINGS_SHARED diff --git a/include/datetime/settings.h b/include/datetime/settings.h index e5f885e..c6fe13b 100644 --- a/include/datetime/settings.h +++ b/include/datetime/settings.h @@ -57,6 +57,7 @@ public: core::Property time_format_mode; core::Property timezone_name; core::Property alarm_sound; + core::Property alarm_haptic; core::Property alarm_volume; core::Property alarm_duration; }; -- cgit v1.2.3