From dfa174a82854b214b7eeaa62ad8b7567c4c1a949 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 1 Feb 2016 18:05:45 -0600 Subject: don't show calendar event notifications if com.ubuntu.calendar's notifications are blacklisted --- include/datetime/settings.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/datetime') diff --git a/include/datetime/settings.h b/include/datetime/settings.h index 253a00a..d5e81c6 100644 --- a/include/datetime/settings.h +++ b/include/datetime/settings.h @@ -61,6 +61,7 @@ public: core::Property alarm_volume; core::Property alarm_duration; core::Property snooze_duration; + core::Property>> muted_apps; }; } // namespace datetime -- cgit v1.2.3 From fee2f8fdbe5a851643bed55decb14e1cff84cb8a Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 1 Feb 2016 18:07:18 -0600 Subject: in LiveSettings, add gschema support for notification app blacklisting --- include/datetime/settings-live.h | 8 ++++++-- include/datetime/settings-shared.h | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'include/datetime') diff --git a/include/datetime/settings-live.h b/include/datetime/settings-live.h index ccf7122..330b8e8 100644 --- a/include/datetime/settings-live.h +++ b/include/datetime/settings-live.h @@ -38,8 +38,10 @@ public: virtual ~LiveSettings(); private: - static void on_changed(GSettings*, gchar*, gpointer); - void update_key(const std::string& key); + static void on_changed_ccid(GSettings*, gchar*, gpointer); + static void on_changed_cunh(GSettings*, gchar*, gpointer); + void update_key_ccid(const std::string& key); + void update_key_cunh(const std::string& key); void update_custom_time_format(); void update_locations(); @@ -60,8 +62,10 @@ private: void update_alarm_duration(); void update_alarm_haptic(); void update_snooze_duration(); + void update_muted_apps(); GSettings* m_settings; + GSettings* m_settings_cunh; // we've got a raw pointer here, so disable copying LiveSettings(const LiveSettings&) =delete; diff --git a/include/datetime/settings-shared.h b/include/datetime/settings-shared.h index bd84a2d..f385e7a 100644 --- a/include/datetime/settings-shared.h +++ b/include/datetime/settings-shared.h @@ -51,4 +51,7 @@ TimeFormatMode; #define SETTINGS_ALARM_HAPTIC_S "alarm-haptic-feedback" #define SETTINGS_SNOOZE_DURATION_S "snooze-duration-minutes" +#define SETTINGS_CUNH_SCHEMA_ID "com.lomiri.notifications.hub" +#define SETTINGS_CUNH_BLACKLIST_S "blacklist" + #endif // INDICATOR_DATETIME_SETTINGS_SHARED -- cgit v1.2.3 From a8ea3ba0548c30696245f74ed701ca9105f7ce5b Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 18 Mar 2016 10:17:55 -0500 Subject: get event selection up-to-date with the spec, including showing in-progress events. add unit tests to cover event priority and display order. --- include/datetime/date-time.h | 2 ++ include/datetime/menu.h | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'include/datetime') diff --git a/include/datetime/date-time.h b/include/datetime/date-time.h index fc83388..845716d 100644 --- a/include/datetime/date-time.h +++ b/include/datetime/date-time.h @@ -68,7 +68,9 @@ public: int64_t to_unix() const; bool operator<(const DateTime& that) const; + bool operator>(const DateTime& that) const; bool operator<=(const DateTime& that) const; + bool operator>=(const DateTime& that) const; bool operator!=(const DateTime& that) const; bool operator==(const DateTime& that) const; int64_t operator- (const DateTime& that) const; diff --git a/include/datetime/menu.h b/include/datetime/menu.h index acd9ed8..0074ea5 100644 --- a/include/datetime/menu.h +++ b/include/datetime/menu.h @@ -21,6 +21,7 @@ #define INDICATOR_DATETIME_MENU_H #include +#include #include #include // std::shared_ptr @@ -49,6 +50,11 @@ public: Profile profile() const; GMenuModel* menu_model(); + static std::vector get_display_appointments( + const std::vector&, + const DateTime& start, + unsigned int max_items=5); + protected: Menu (Profile profile_in, const std::string& name_in); virtual ~Menu() =default; -- cgit v1.2.3 From 7fde2181c74fada11d537e2f09ccbb8e5745ae8c Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Mon, 21 Mar 2016 14:32:39 -0300 Subject: Make sure that the ocurrence time is used to build the url to launch external application. --- include/datetime/actions-live.h | 4 ++-- include/datetime/actions.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'include/datetime') diff --git a/include/datetime/actions-live.h b/include/datetime/actions-live.h index 2c348c6..1f84659 100644 --- a/include/datetime/actions-live.h +++ b/include/datetime/actions-live.h @@ -41,12 +41,12 @@ public: bool desktop_has_calendar_app() const override; void desktop_open_alarm_app() override; - void desktop_open_appointment(const Appointment&) override; + void desktop_open_appointment(const Appointment&, const DateTime&) override; void desktop_open_calendar_app(const DateTime&) override; void desktop_open_settings_app() override; void phone_open_alarm_app() override; - void phone_open_appointment(const Appointment&) override; + void phone_open_appointment(const Appointment&, const DateTime &) override; void phone_open_calendar_app(const DateTime&) override; void phone_open_settings_app() override; diff --git a/include/datetime/actions.h b/include/datetime/actions.h index 47931ac..ea163e4 100644 --- a/include/datetime/actions.h +++ b/include/datetime/actions.h @@ -45,12 +45,12 @@ public: virtual bool desktop_has_calendar_app() const =0; virtual void desktop_open_alarm_app() =0; - virtual void desktop_open_appointment(const Appointment&) =0; + virtual void desktop_open_appointment(const Appointment&, const DateTime&) =0; virtual void desktop_open_calendar_app(const DateTime&) =0; virtual void desktop_open_settings_app() =0; virtual void phone_open_alarm_app() =0; - virtual void phone_open_appointment(const Appointment&) =0; + virtual void phone_open_appointment(const Appointment&, const DateTime&) =0; virtual void phone_open_calendar_app(const DateTime&) =0; virtual void phone_open_settings_app() =0; -- cgit v1.2.3 From e69137d907e884e23e77ee0e5550ccb9faa78d37 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Fri, 2 Jul 2021 02:01:24 +0200 Subject: Drop myself.[h|cpp] --- include/datetime/myself.h | 62 ----------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 include/datetime/myself.h (limited to 'include/datetime') diff --git a/include/datetime/myself.h b/include/datetime/myself.h deleted file mode 100644 index 67e938d..0000000 --- a/include/datetime/myself.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2016 Canonical Ltd. - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 3, as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranties of - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - * - * Authors: - * Renato Araujo Oliveira Filho - */ - -#ifndef INDICATOR_DATETIME_MYSELF_H -#define INDICATOR_DATETIME_MYSELF_H - -#include - -#include -#include -#include -#include - -typedef struct _AgManager AgManager; - -namespace ayatana { -namespace indicator { -namespace datetime { - -class Myself -{ -public: - Myself(); - - const core::Property>& emails() - { - return m_emails; - } - - bool isMyEmail(const std::string &email); - -private: - std::shared_ptr m_accounts_manager; - core::Property > m_emails; - - static void on_accounts_changed(AgManager*, guint, Myself*); - void reloadEmails(); - -}; - - -} // namespace datetime -} // namespace indicator -} // namespace ayatana - -#endif // INDICATOR_DATETIME_MYSELF_H -- cgit v1.2.3 From a3fa5c819c23f283879b4ce93042247b2ac22e43 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Wed, 30 Mar 2016 13:26:14 -0300 Subject: Ignore alarms for events marked as not attending. --- include/datetime/engine-eds.h | 2 +- include/datetime/myself.h | 61 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 include/datetime/myself.h (limited to 'include/datetime') diff --git a/include/datetime/engine-eds.h b/include/datetime/engine-eds.h index 12425b3..0b854e5 100644 --- a/include/datetime/engine-eds.h +++ b/include/datetime/engine-eds.h @@ -48,7 +48,7 @@ class EdsEngine: public Engine { public: EdsEngine(); - explicit EdsEngine(const std::shared_ptr &myself); + explicit EdsEngine(const std::unique_ptr &myself); ~EdsEngine(); void get_appointments(const DateTime& begin, diff --git a/include/datetime/myself.h b/include/datetime/myself.h new file mode 100644 index 0000000..c381780 --- /dev/null +++ b/include/datetime/myself.h @@ -0,0 +1,61 @@ +/* + * Copyright 2016 Canonical Ltd. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + * Authors: + * Renato Araujo Oliveira Filho + */ + +#ifndef INDICATOR_DATETIME_MYSELF_H +#define INDICATOR_DATETIME_MYSELF_H + +#include + +#include + +#include +#include +#include + +namespace ayatana { +namespace indicator { +namespace datetime { + +class Myself +{ +public: + Myself(); + + core::Property>& emails() + { + return m_emails; + } + + bool isMyEmail(const std::string &email); + +private: + std::shared_ptr m_accounts_manager; + core::Property > m_emails; + + static void on_accounts_changed(AgManager*, guint, Myself*); + void reloadEmails(); + +}; + + +} // namespace datetime +} // namespace indicator +} // namespace ayatana + +#endif // INDICATOR_DATETIME_MYSELF_H -- cgit v1.2.3 From dd4265f22ee05aab8dbe6d60f9c7a13f85818466 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Wed, 30 Mar 2016 16:52:02 -0300 Subject: Only play a sound alert if the event contains a SOUND reminder. --- include/datetime/appointment.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/datetime') diff --git a/include/datetime/appointment.h b/include/datetime/appointment.h index 950f4bb..5b4c27e 100644 --- a/include/datetime/appointment.h +++ b/include/datetime/appointment.h @@ -34,9 +34,15 @@ namespace datetime { */ struct Alarm { + enum Type { + EMAIL = 0x001, + SOUND = 0x010, + TEXT = 0x100 + }; std::string text; std::string audio_url; DateTime time; + int type; bool operator== (const Alarm& that) const; bool has_sound() const; -- cgit v1.2.3 From b2908655d4cb5384f2125f63e92a8c6c0bc5dd90 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Wed, 30 Mar 2016 21:41:08 -0300 Subject: Create a constructor for Alarm class. --- include/datetime/appointment.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include/datetime') diff --git a/include/datetime/appointment.h b/include/datetime/appointment.h index 5b4c27e..14adb5d 100644 --- a/include/datetime/appointment.h +++ b/include/datetime/appointment.h @@ -42,7 +42,14 @@ struct Alarm std::string text; std::string audio_url; DateTime time; - int type; + int type = TEXT; + + Alarm(const std::string &text_, const std::string &audio_url_, const DateTime & time_, int type_ = TEXT) + : text(text_), audio_url(audio_url_), time(time_), type(type_) + {} + + Alarm() + {} bool operator== (const Alarm& that) const; bool has_sound() const; -- cgit v1.2.3 From 406aa751ab0a66c909a7ce60345aed42cda8f147 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Thu, 31 Mar 2016 09:41:29 -0300 Subject: Remove constructors from Alarm. --- include/datetime/appointment.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'include/datetime') diff --git a/include/datetime/appointment.h b/include/datetime/appointment.h index 14adb5d..2c225fc 100644 --- a/include/datetime/appointment.h +++ b/include/datetime/appointment.h @@ -42,14 +42,7 @@ struct Alarm std::string text; std::string audio_url; DateTime time; - int type = TEXT; - - Alarm(const std::string &text_, const std::string &audio_url_, const DateTime & time_, int type_ = TEXT) - : text(text_), audio_url(audio_url_), time(time_), type(type_) - {} - - Alarm() - {} + int type : SOUND; bool operator== (const Alarm& that) const; bool has_sound() const; -- cgit v1.2.3 From ed2c8341c2fbf527e99cd6b56f6ae637ea6c76a8 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Thu, 31 Mar 2016 10:55:01 -0300 Subject: Update tests. --- include/datetime/appointment.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/datetime') diff --git a/include/datetime/appointment.h b/include/datetime/appointment.h index 2c225fc..ae9e8ff 100644 --- a/include/datetime/appointment.h +++ b/include/datetime/appointment.h @@ -35,21 +35,21 @@ namespace datetime { struct Alarm { enum Type { + None = 0, EMAIL = 0x001, SOUND = 0x010, TEXT = 0x100 }; + int type; std::string text; std::string audio_url; DateTime time; - int type : SOUND; bool operator== (const Alarm& that) const; - bool has_sound() const; - bool has_text() const; + Alarm(); + Alarm(int type_, const std::string &text_, const std::string& audio_url_, const DateTime &time_); }; - /** * \brief An instance of an appointment; e.g. a calendar event or clock-app alarm * -- cgit v1.2.3 From 87d2694ceeadee723573b3866a8bc2e3fb49de58 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Thu, 31 Mar 2016 15:51:29 -0300 Subject: Remove type property from Alarm. --- include/datetime/appointment.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'include/datetime') diff --git a/include/datetime/appointment.h b/include/datetime/appointment.h index ae9e8ff..faf8a18 100644 --- a/include/datetime/appointment.h +++ b/include/datetime/appointment.h @@ -34,20 +34,13 @@ namespace datetime { */ struct Alarm { - enum Type { - None = 0, - EMAIL = 0x001, - SOUND = 0x010, - TEXT = 0x100 - }; - int type; std::string text; std::string audio_url; DateTime time; bool operator== (const Alarm& that) const; - Alarm(); - Alarm(int type_, const std::string &text_, const std::string& audio_url_, const DateTime &time_); + bool has_sound() const; + bool has_text() const; }; /** -- cgit v1.2.3 From 676b6c35768e707710a7121ed9f71002c6226bd7 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Thu, 31 Mar 2016 16:53:36 -0300 Subject: Update code as requested by reviewer. --- include/datetime/engine-eds.h | 3 +-- include/datetime/myself.h | 9 +++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'include/datetime') diff --git a/include/datetime/engine-eds.h b/include/datetime/engine-eds.h index 0b854e5..96b0f76 100644 --- a/include/datetime/engine-eds.h +++ b/include/datetime/engine-eds.h @@ -47,8 +47,7 @@ class Myself; class EdsEngine: public Engine { public: - EdsEngine(); - explicit EdsEngine(const std::unique_ptr &myself); + EdsEngine(const std::shared_ptr &myself); ~EdsEngine(); void get_appointments(const DateTime& begin, diff --git a/include/datetime/myself.h b/include/datetime/myself.h index c381780..452fa53 100644 --- a/include/datetime/myself.h +++ b/include/datetime/myself.h @@ -20,13 +20,14 @@ #ifndef INDICATOR_DATETIME_MYSELF_H #define INDICATOR_DATETIME_MYSELF_H -#include - #include #include #include #include +#include + +typedef struct _AgManager AgManager; namespace ayatana { namespace indicator { @@ -37,7 +38,7 @@ class Myself public: Myself(); - core::Property>& emails() + const core::Property>& emails() { return m_emails; } @@ -46,7 +47,7 @@ public: private: std::shared_ptr m_accounts_manager; - core::Property > m_emails; + core::Property > m_emails; static void on_accounts_changed(AgManager*, guint, Myself*); void reloadEmails(); -- cgit v1.2.3 From bce738fc440a3f3de205fa1ec096288c03640794 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Fri, 1 Apr 2016 11:53:55 -0300 Subject: Include the correct header for set. --- include/datetime/myself.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/datetime') diff --git a/include/datetime/myself.h b/include/datetime/myself.h index 452fa53..67e938d 100644 --- a/include/datetime/myself.h +++ b/include/datetime/myself.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include -- cgit v1.2.3 From 53721ecc9f3d3d2c0b65b06d313d57e266ba31ad Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 8 Apr 2016 15:46:50 -0500 Subject: pull the timezone from timedate1 regardless of whether it appears on the bus before or after we startup --- include/datetime/dbus-shared.h | 42 +++++++++++++++++++++++++++++++++++ include/datetime/timezone-timedated.h | 6 ++--- 2 files changed, 44 insertions(+), 4 deletions(-) (limited to 'include/datetime') diff --git a/include/datetime/dbus-shared.h b/include/datetime/dbus-shared.h index 057ac6b..fd43ae8 100644 --- a/include/datetime/dbus-shared.h +++ b/include/datetime/dbus-shared.h @@ -28,5 +28,47 @@ #define BUS_POWERD_PATH "/com/canonical/powerd" #define BUS_POWERD_INTERFACE "com.canonical.powerd" +namespace ayatana { +namespace indicator { +namespace datetime { + +namespace Bus +{ + namespace Timedate1 + { + static constexpr char const * BUSNAME {"org.freedesktop.timedate1"}; + static constexpr char const * ADDR {"/org/freedesktop/timedate1"}; + static constexpr char const * IFACE {"org.freedesktop.timedate1"}; + + namespace Properties + { + static constexpr char const * TIMEZONE {"Timezone"}; + } + + namespace Methods + { + static constexpr char const * SET_TIMEZONE {"SetTimezone"}; + } + } + + namespace Properties + { + static constexpr char const * IFACE {"org.freedesktop.DBus.Properties"}; + + namespace Methods + { + static constexpr char const * GET {"Get"}; + } + + namespace Signals + { + static constexpr char const * PROPERTIES_CHANGED {"PropertiesChanged"}; + } + } +} + +} // namespace datetime +} // namespace indicator +} // namespace ayatana #endif /* INDICATOR_DATETIME_DBUS_SHARED_H */ diff --git a/include/datetime/timezone-timedated.h b/include/datetime/timezone-timedated.h index 336a148..0857706 100644 --- a/include/datetime/timezone-timedated.h +++ b/include/datetime/timezone-timedated.h @@ -20,8 +20,6 @@ #ifndef INDICATOR_DATETIME_TIMEDATED_TIMEZONE_H #define INDICATOR_DATETIME_TIMEDATED_TIMEZONE_H -#define DEFAULT_FILENAME "/etc/timezone" - #include // base class #include // std::string @@ -31,12 +29,12 @@ namespace indicator { namespace datetime { /** - * \brief A #Timezone that gets its information from monitoring a file, such as /etc/timezone + * \brief A #Timezone that gets its information from org.freedesktop.timedate1 */ class TimedatedTimezone: public Timezone { public: - TimedatedTimezone(std::string filename = DEFAULT_FILENAME); + TimedatedTimezone(); ~TimedatedTimezone(); private: -- cgit v1.2.3 From 32a1c8a2ff80533b7c5902b869fb4b889ded5736 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 9 Apr 2016 19:07:04 -0500 Subject: update test-live-actions to last commit's TimedatedFixture changes --- include/datetime/dbus-shared.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'include/datetime') diff --git a/include/datetime/dbus-shared.h b/include/datetime/dbus-shared.h index fd43ae8..9c80336 100644 --- a/include/datetime/dbus-shared.h +++ b/include/datetime/dbus-shared.h @@ -28,10 +28,6 @@ #define BUS_POWERD_PATH "/com/canonical/powerd" #define BUS_POWERD_INTERFACE "com.canonical.powerd" -namespace ayatana { -namespace indicator { -namespace datetime { - namespace Bus { namespace Timedate1 @@ -67,8 +63,4 @@ namespace Bus } } -} // namespace datetime -} // namespace indicator -} // namespace ayatana - #endif /* INDICATOR_DATETIME_DBUS_SHARED_H */ -- cgit v1.2.3 From 3cd2c8e20343ef4b4efe7a34daba72f9af23205d Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 12 Apr 2016 12:03:36 -0500 Subject: in TimedatedTimezone, take a GDBusConnection argument in the ctor to simplify state management --- include/datetime/timezone-timedated.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/datetime') diff --git a/include/datetime/timezone-timedated.h b/include/datetime/timezone-timedated.h index 0857706..e0af184 100644 --- a/include/datetime/timezone-timedated.h +++ b/include/datetime/timezone-timedated.h @@ -22,6 +22,8 @@ #include // base class +#include // GDBusConnection* + #include // std::string namespace ayatana { @@ -34,7 +36,7 @@ namespace datetime { class TimedatedTimezone: public Timezone { public: - TimedatedTimezone(); + TimedatedTimezone(GDBusConnection* connection); ~TimedatedTimezone(); private: -- cgit v1.2.3 From d50e6b5cd520143b833ac5f0b55173980d130c14 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 12 Apr 2016 12:05:11 -0500 Subject: in LiveTimezones, pass the primary timezone to it on construction. We used to create it implicitly but can't do that anymore now that TimedatedTimezone takes its own ctor argument. --- include/datetime/timezones-live.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include/datetime') diff --git a/include/datetime/timezones-live.h b/include/datetime/timezones-live.h index e722576..8b8b5fa 100644 --- a/include/datetime/timezones-live.h +++ b/include/datetime/timezones-live.h @@ -23,7 +23,6 @@ #include #include #include -#include #include // shared_ptr<> @@ -38,13 +37,13 @@ namespace datetime { class LiveTimezones: public Timezones { public: - LiveTimezones(const std::shared_ptr& settings); + LiveTimezones(const std::shared_ptr& settings, const std::shared_ptr& primary_timezone); private: void update_geolocation(); void update_timezones(); - TimedatedTimezone m_file; + std::shared_ptr m_primary_timezone; std::shared_ptr m_settings; std::shared_ptr m_geo; }; -- cgit v1.2.3 From a6422822a9b9a18bae705e56f2b53ee0b61ff1dc Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Thu, 28 Apr 2016 11:56:11 -0300 Subject: Detect desktop to launch applications. --- include/datetime/actions-live.h | 17 ++++++----------- include/datetime/actions.h | 12 ++++-------- 2 files changed, 10 insertions(+), 19 deletions(-) (limited to 'include/datetime') diff --git a/include/datetime/actions-live.h b/include/datetime/actions-live.h index 1f84659..1eb34ec 100644 --- a/include/datetime/actions-live.h +++ b/include/datetime/actions-live.h @@ -40,21 +40,16 @@ public: virtual ~LiveActions() =default; bool desktop_has_calendar_app() const override; - void desktop_open_alarm_app() override; - void desktop_open_appointment(const Appointment&, const DateTime&) override; - void desktop_open_calendar_app(const DateTime&) override; - void desktop_open_settings_app() override; - - void phone_open_alarm_app() override; - void phone_open_appointment(const Appointment&, const DateTime &) override; - void phone_open_calendar_app(const DateTime&) override; - void phone_open_settings_app() override; + void open_alarm_app() override; + void open_appointment(const Appointment&, const DateTime&) override; + void open_calendar_app(const DateTime&) override; + void open_settings_app() override; void set_location(const std::string& zone, const std::string& name) override; protected: - virtual void execute_command(const std::string& command); - virtual void dispatch_url(const std::string& url); + + void lomiri_open_appointment(const Appointment& appt, const DateTime& date); }; } // namespace datetime diff --git a/include/datetime/actions.h b/include/datetime/actions.h index ea163e4..d866b00 100644 --- a/include/datetime/actions.h +++ b/include/datetime/actions.h @@ -44,15 +44,11 @@ class Actions public: virtual bool desktop_has_calendar_app() const =0; - virtual void desktop_open_alarm_app() =0; - virtual void desktop_open_appointment(const Appointment&, const DateTime&) =0; - virtual void desktop_open_calendar_app(const DateTime&) =0; - virtual void desktop_open_settings_app() =0; - virtual void phone_open_alarm_app() =0; - virtual void phone_open_appointment(const Appointment&, const DateTime&) =0; - virtual void phone_open_calendar_app(const DateTime&) =0; - virtual void phone_open_settings_app() =0; + virtual void open_alarm_app() =0; + virtual void open_appointment(const Appointment&, const DateTime&) =0; + virtual void open_calendar_app(const DateTime&) =0; + virtual void open_settings_app() =0; virtual void set_location(const std::string& zone, const std::string& name)=0; -- cgit v1.2.3 From b639e39dc4a2aa82a40f0a6922577b65ff3dd35f Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 14 May 2016 12:18:45 -0500 Subject: add a new Snap::Response enum for more flexible handling of snap decisions --- include/datetime/snap.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/datetime') diff --git a/include/datetime/snap.h b/include/datetime/snap.h index a295d9f..099426b 100644 --- a/include/datetime/snap.h +++ b/include/datetime/snap.h @@ -42,11 +42,11 @@ public: const std::shared_ptr& settings); virtual ~Snap(); - typedef std::function appointment_func; + enum class Response { None, Snooze, ShowApp }; + typedef std::function response_func; void operator()(const Appointment& appointment, const Alarm& alarm, - appointment_func snooze, - appointment_func ok); + response_func on_response); private: class Impl; -- cgit v1.2.3 From 525a38eb600292ffb764f6b5de058f9ba6ddd2b8 Mon Sep 17 00:00:00 2001 From: Arthur Mello Date: Wed, 22 Jun 2016 15:37:55 -0300 Subject: Update indicator-datetime to work with the new notification settings --- include/datetime/settings-live.h | 12 ++++++++---- include/datetime/settings-shared.h | 9 +++++++-- include/datetime/settings.h | 6 +++++- 3 files changed, 20 insertions(+), 7 deletions(-) (limited to 'include/datetime') diff --git a/include/datetime/settings-live.h b/include/datetime/settings-live.h index 330b8e8..4aeaa9b 100644 --- a/include/datetime/settings-live.h +++ b/include/datetime/settings-live.h @@ -39,9 +39,9 @@ public: private: static void on_changed_ccid(GSettings*, gchar*, gpointer); - static void on_changed_cunh(GSettings*, gchar*, gpointer); + static void on_changed_cal_notification(GSettings*, gchar*, gpointer); void update_key_ccid(const std::string& key); - void update_key_cunh(const std::string& key); + void update_key_cal_notification(const std::string& key); void update_custom_time_format(); void update_locations(); @@ -62,10 +62,14 @@ private: void update_alarm_duration(); void update_alarm_haptic(); void update_snooze_duration(); - void update_muted_apps(); + void update_cal_notification_enabled(); + void update_cal_notification_sounds(); + void update_cal_notification_vibrations(); + void update_cal_notification_bubbles(); + void update_cal_notification_list(); GSettings* m_settings; - GSettings* m_settings_cunh; + GSettings* m_settings_cal_notification; // we've got a raw pointer here, so disable copying LiveSettings(const LiveSettings&) =delete; diff --git a/include/datetime/settings-shared.h b/include/datetime/settings-shared.h index f385e7a..236b8f1 100644 --- a/include/datetime/settings-shared.h +++ b/include/datetime/settings-shared.h @@ -51,7 +51,12 @@ TimeFormatMode; #define SETTINGS_ALARM_HAPTIC_S "alarm-haptic-feedback" #define SETTINGS_SNOOZE_DURATION_S "snooze-duration-minutes" -#define SETTINGS_CUNH_SCHEMA_ID "com.lomiri.notifications.hub" -#define SETTINGS_CUNH_BLACKLIST_S "blacklist" +#define SETTINGS_NOTIFY_SCHEMA_ID "com.lomiri.notifications.settings" +#define SETTINGS_NOTIFY_CALENDAR_PATH "/com/lomiri/NotificationSettings/com.lomiri.calendar/calendar/" +#define SETTINGS_NOTIFY_ENABLED_KEY "enable-notifications" +#define SETTINGS_NOTIFY_SOUNDS_KEY "use-sounds-notifications" +#define SETTINGS_NOTIFY_VIBRATIONS_KEY "use-vibrations-notifications" +#define SETTINGS_NOTIFY_BUBBLES_KEY "use-bubbles-notifications" +#define SETTINGS_NOTIFY_LIST_KEY "use-list-notifications" #endif // INDICATOR_DATETIME_SETTINGS_SHARED diff --git a/include/datetime/settings.h b/include/datetime/settings.h index d5e81c6..5ae00f6 100644 --- a/include/datetime/settings.h +++ b/include/datetime/settings.h @@ -61,7 +61,11 @@ public: core::Property alarm_volume; core::Property alarm_duration; core::Property snooze_duration; - core::Property>> muted_apps; + core::Property cal_notification_enabled; + core::Property cal_notification_sounds; + core::Property cal_notification_vibrations; + core::Property cal_notification_bubbles; + core::Property cal_notification_list; }; } // namespace datetime -- cgit v1.2.3 From cd03321181ba64c66a93c60d444dfea59f293fa1 Mon Sep 17 00:00:00 2001 From: Arthur Mello Date: Mon, 4 Jul 2016 16:30:18 -0300 Subject: If in silent mode should only vibrate if the settings say so --- include/datetime/settings-live.h | 4 ++++ include/datetime/settings-shared.h | 2 ++ include/datetime/settings.h | 1 + 3 files changed, 7 insertions(+) (limited to 'include/datetime') diff --git a/include/datetime/settings-live.h b/include/datetime/settings-live.h index 4aeaa9b..85071ce 100644 --- a/include/datetime/settings-live.h +++ b/include/datetime/settings-live.h @@ -40,8 +40,10 @@ public: private: static void on_changed_ccid(GSettings*, gchar*, gpointer); static void on_changed_cal_notification(GSettings*, gchar*, gpointer); + static void on_changed_general_notification(GSettings*, gchar*, gpointer); void update_key_ccid(const std::string& key); void update_key_cal_notification(const std::string& key); + void update_key_general_notification(const std::string& key); void update_custom_time_format(); void update_locations(); @@ -67,9 +69,11 @@ private: void update_cal_notification_vibrations(); void update_cal_notification_bubbles(); void update_cal_notification_list(); + void update_vibrate_silent_mode(); GSettings* m_settings; GSettings* m_settings_cal_notification; + GSettings* m_settings_general_notification; // we've got a raw pointer here, so disable copying LiveSettings(const LiveSettings&) =delete; diff --git a/include/datetime/settings-shared.h b/include/datetime/settings-shared.h index 236b8f1..7280c16 100644 --- a/include/datetime/settings-shared.h +++ b/include/datetime/settings-shared.h @@ -51,6 +51,8 @@ TimeFormatMode; #define SETTINGS_ALARM_HAPTIC_S "alarm-haptic-feedback" #define SETTINGS_SNOOZE_DURATION_S "snooze-duration-minutes" +#define SETTINGS_NOTIFY_APPS_SCHEMA_ID "com.lomiri.notifications.settings.applications" +#define SETTINGS_VIBRATE_SILENT_KEY "vibrate-silent-mode" #define SETTINGS_NOTIFY_SCHEMA_ID "com.lomiri.notifications.settings" #define SETTINGS_NOTIFY_CALENDAR_PATH "/com/lomiri/NotificationSettings/com.lomiri.calendar/calendar/" #define SETTINGS_NOTIFY_ENABLED_KEY "enable-notifications" diff --git a/include/datetime/settings.h b/include/datetime/settings.h index 5ae00f6..af9227d 100644 --- a/include/datetime/settings.h +++ b/include/datetime/settings.h @@ -66,6 +66,7 @@ public: core::Property cal_notification_vibrations; core::Property cal_notification_bubbles; core::Property cal_notification_list; + core::Property vibrate_silent_mode; }; } // namespace datetime -- cgit v1.2.3 From 6863282c60b01752ecd53ea329a74940ee8380e4 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 6 Oct 2016 12:08:29 -0500 Subject: in Snap, add a constructor arg for the system bus because we need it when instantiating Awake objects --- include/datetime/snap.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/datetime') diff --git a/include/datetime/snap.h b/include/datetime/snap.h index 099426b..baa765b 100644 --- a/include/datetime/snap.h +++ b/include/datetime/snap.h @@ -24,6 +24,9 @@ #include #include +#include + +#include // GDBusConnection #include #include @@ -39,7 +42,9 @@ class Snap { public: Snap(const std::shared_ptr& engine, - const std::shared_ptr& settings); + const std::shared_ptr& sound_builder, + const std::shared_ptr& settings, + GDBusConnection* system_bus); virtual ~Snap(); enum class Response { None, Snooze, ShowApp }; -- cgit v1.2.3 From 6055485c2215e55cc0febe0eb15141e837d8e17b Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Mon, 19 Jul 2021 00:19:07 +0200 Subject: Rename com.canonical.powerd -> com.lomiri.Repowerd --- include/datetime/dbus-shared.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/datetime') diff --git a/include/datetime/dbus-shared.h b/include/datetime/dbus-shared.h index 9c80336..0b6aa95 100644 --- a/include/datetime/dbus-shared.h +++ b/include/datetime/dbus-shared.h @@ -24,9 +24,9 @@ #define BUS_DATETIME_NAME "org.ayatana.indicator.datetime" #define BUS_DATETIME_PATH "/org/ayatana/indicator/datetime" -#define BUS_POWERD_NAME "com.canonical.powerd" -#define BUS_POWERD_PATH "/com/canonical/powerd" -#define BUS_POWERD_INTERFACE "com.canonical.powerd" +#define BUS_POWERD_NAME "com.lomiri.Repowerd" +#define BUS_POWERD_PATH "/com/lomiri/Repowerd" +#define BUS_POWERD_INTERFACE "com.lomiri.Repowerd" namespace Bus { -- cgit v1.2.3 From 28d347f433a90dd8a928a417fd7d76b86d576d59 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Wed, 28 Jul 2021 21:53:06 +0200 Subject: Some fixes in UBports patches after a review - debian/control: Add liblomiri-url-dispatcher-dev as optional - .build.yml: Add liblomiri-url-dispatcher-dev dependency - CMakeLists.txt: Remove duplicate enable_testing() - include/datetime/actions-live.h: Remove lomiri_open_appointment --- include/datetime/actions-live.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include/datetime') diff --git a/include/datetime/actions-live.h b/include/datetime/actions-live.h index 1eb34ec..6f536c4 100644 --- a/include/datetime/actions-live.h +++ b/include/datetime/actions-live.h @@ -46,10 +46,6 @@ public: void open_settings_app() override; void set_location(const std::string& zone, const std::string& name) override; - -protected: - - void lomiri_open_appointment(const Appointment& appt, const DateTime& date); }; } // namespace datetime -- cgit v1.2.3