diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/datetime/exporter.h | 27 | ||||
-rw-r--r-- | include/datetime/settings-shared.h | 10 | ||||
-rw-r--r-- | include/datetime/settings.h | 4 |
3 files changed, 10 insertions, 31 deletions
diff --git a/include/datetime/exporter.h b/include/datetime/exporter.h index c228cc1..dd57263 100644 --- a/include/datetime/exporter.h +++ b/include/datetime/exporter.h @@ -22,11 +22,10 @@ #include <datetime/actions.h> #include <datetime/menu.h> +#include <datetime/settings.h> #include <core/signal.h> -#include <gio/gio.h> // GActionGroup - #include <memory> // std::shared_ptr #include <vector> @@ -40,31 +39,21 @@ namespace datetime { class Exporter { public: - Exporter() =default; + Exporter(const std::shared_ptr<Settings>&); ~Exporter(); - core::Signal<> name_lost; + core::Signal<>& name_lost(); void publish(const std::shared_ptr<Actions>& actions, const std::vector<std::shared_ptr<Menu>>& menus); private: - static void on_bus_acquired(GDBusConnection*, const gchar *name, gpointer gthis); - void on_bus_acquired(GDBusConnection*, const gchar *name); - - static void on_name_lost(GDBusConnection*, const gchar *name, gpointer gthis); - void on_name_lost(GDBusConnection*, const gchar *name); - - std::set<guint> m_exported_menu_ids; - guint m_own_id = 0; - guint m_exported_actions_id = 0; - GDBusConnection * m_dbus_connection = nullptr; - std::shared_ptr<Actions> m_actions; - std::vector<std::shared_ptr<Menu>> m_menus; + class Impl; + std::unique_ptr<Impl> p; - // we've got raw pointers and gsignal tags in here, so disable copying - Exporter(const Exporter&) =delete; - Exporter& operator=(const Exporter&) =delete; + // disable copying + Exporter(const Exporter&) =delete; + Exporter& operator=(const Exporter&) =delete; }; } // namespace datetime diff --git a/include/datetime/settings-shared.h b/include/datetime/settings-shared.h index bfddd88..23d2e1c 100644 --- a/include/datetime/settings-shared.h +++ b/include/datetime/settings-shared.h @@ -30,16 +30,6 @@ typedef enum } TimeFormatMode; -typedef enum -{ - ALARM_VOLUME_VERY_QUIET, - ALARM_VOLUME_QUIET, - ALARM_VOLUME_NORMAL, - ALARM_VOLUME_LOUD, - ALARM_VOLUME_VERY_LOUD -} -AlarmVolume; - #define SETTINGS_INTERFACE "com.canonical.indicator.datetime" #define SETTINGS_SHOW_CLOCK_S "show-clock" #define SETTINGS_TIME_FORMAT_S "time-format" diff --git a/include/datetime/settings.h b/include/datetime/settings.h index a941f05..e5f885e 100644 --- a/include/datetime/settings.h +++ b/include/datetime/settings.h @@ -57,8 +57,8 @@ public: core::Property<TimeFormatMode> time_format_mode; core::Property<std::string> timezone_name; core::Property<std::string> alarm_sound; - core::Property<AlarmVolume> alarm_volume; - core::Property<int> alarm_duration; + core::Property<unsigned int> alarm_volume; + core::Property<unsigned int> alarm_duration; }; } // namespace datetime |