aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-02-04 13:00:22 -0600
committerCharles Kerr <charles.kerr@canonical.com>2014-02-04 13:00:22 -0600
commit61581201f13509fbce9eb05fc90a5da17307c6a3 (patch)
tree75adcfe01936ed16d2958dfdbd657352be23aef5 /src/main.cpp
parent61accb9ce497e1f1cbe8038ac495d66d6a4505ff (diff)
downloadayatana-indicator-datetime-61581201f13509fbce9eb05fc90a5da17307c6a3.tar.gz
ayatana-indicator-datetime-61581201f13509fbce9eb05fc90a5da17307c6a3.tar.bz2
ayatana-indicator-datetime-61581201f13509fbce9eb05fc90a5da17307c6a3.zip
Add audio notitication when the alarm is triggered. Add a manual test to tests/ to trigger a snap decision.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 71a1ce5..7e09fda 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -17,8 +17,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
-
#include <datetime/actions-live.h>
#include <datetime/clock.h>
#include <datetime/clock-watcher.h>
@@ -33,10 +31,11 @@
#include <glib/gi18n.h> // bindtextdomain()
#include <gio/gio.h>
-#include <libnotify/notify.h>
+
+#include <url-dispatcher.h>
#include <locale.h>
-#include <stdlib.h> // exit()
+#include <cstdlib> // exit()
using namespace unity::indicator::datetime;
@@ -52,10 +51,6 @@ main(int /*argc*/, char** /*argv*/)
bindtextdomain(GETTEXT_PACKAGE, GNOMELOCALEDIR);
textdomain(GETTEXT_PACKAGE);
- // init libnotify
- if(!notify_init("indicator-datetime-service"))
- g_critical("libnotify initialization failed");
-
// build the state, actions, and menufactory
std::shared_ptr<State> state(new State);
std::shared_ptr<Settings> live_settings(new LiveSettings);
@@ -73,7 +68,9 @@ main(int /*argc*/, char** /*argv*/)
ClockWatcherImpl clock_watcher(state);
Snap snap;
clock_watcher.alarm_reached().connect([&snap](const Appointment& appt){
- snap(appt);
+ snap(appt,
+ [](const Appointment& a){url_dispatch_send(a.url.c_str(), nullptr, nullptr);},
+ [](const Appointment&){});
});
// create the menus