aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-02-05 16:26:34 -0600
committerCharles Kerr <charles.kerr@canonical.com>2014-02-05 16:26:34 -0600
commit613cbb1d468fe99767a5541956266191511ec9ef (patch)
tree8987586f56570779d12e0384acef39d96a68f046 /src/main.cpp
parent131faf8f832c053343bbc0af694777a5e8f6cbe5 (diff)
downloadayatana-indicator-datetime-613cbb1d468fe99767a5541956266191511ec9ef.tar.gz
ayatana-indicator-datetime-613cbb1d468fe99767a5541956266191511ec9ef.tar.bz2
ayatana-indicator-datetime-613cbb1d468fe99767a5541956266191511ec9ef.zip
remove alarms from the menu once they've been shown in a snap decision.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index daf2a22..5f5ee3c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -59,15 +59,17 @@ main(int /*argc*/, char** /*argv*/)
state->settings = live_settings;
state->clock = live_clock;
state->locations.reset(new SettingsLocations(live_settings, live_timezones));
- state->planner.reset(new PlannerEds(live_clock));
- state->planner->time = live_clock->localtime();
+ std::shared_ptr<PlannerEds> eds_planner(new PlannerEds(live_clock));
+ eds_planner->time = live_clock->localtime();
+ state->planner = eds_planner;
std::shared_ptr<Actions> actions(new LiveActions(state));
MenuFactory factory(actions, state);
// snap decisions
ClockWatcherImpl clock_watcher(state);
Snap snap;
- clock_watcher.alarm_reached().connect([&snap](const Appointment& appt){
+ clock_watcher.alarm_reached().connect([&snap,&eds_planner](const Appointment& appt){
+ eds_planner->block_appointment(appt); // when we show a snap decision, take it out of the menu
auto snap_show = [](const Appointment& a){url_dispatch_send(a.url.c_str(), nullptr, nullptr);};
auto snap_dismiss = [](const Appointment&){};
snap(appt, snap_show, snap_dismiss);