From e5f71ea767515f50f5ed8c34946a87746a3d4ed7 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 26 Feb 2014 03:46:01 -0600 Subject: use the timezones object to set the ECalComponent's default timezone. This is needed to properly handle the 'floating' dates in the alarms --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 31d9db6..762795f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -59,7 +59,7 @@ 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.reset(new PlannerEds(live_clock, live_timezones)); state->planner->time = live_clock->localtime(); std::shared_ptr actions(new LiveActions(state)); MenuFactory factory(actions, state); -- cgit v1.2.3 From ed9d932ef17fd55d8858a9391ab81d237a6be5ad Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 9 Mar 2014 12:41:45 -0500 Subject: in EdsPlanner, use a Timezone instead of Timezones object --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 762795f..24a9409 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include // bindtextdomain() @@ -56,10 +57,11 @@ main(int /*argc*/, char** /*argv*/) std::shared_ptr live_settings(new LiveSettings); std::shared_ptr live_timezones(new LiveTimezones(live_settings, TIMEZONE_FILE)); std::shared_ptr live_clock(new LiveClock(live_timezones)); + std::shared_ptr file_timezone(new FileTimezone(TIMEZONE_FILE)); state->settings = live_settings; state->clock = live_clock; state->locations.reset(new SettingsLocations(live_settings, live_timezones)); - state->planner.reset(new PlannerEds(live_clock, live_timezones)); + state->planner.reset(new PlannerEds(live_clock, file_timezone)); state->planner->time = live_clock->localtime(); std::shared_ptr actions(new LiveActions(state)); MenuFactory factory(actions, state); -- cgit v1.2.3 From 3f4d409f21bbb1f79f149a5ee66dcddaa505ddb1 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 9 Mar 2014 21:08:47 -0500 Subject: decouple the planner's states; need three separate sets: upcoming-now (for alarms in the current time), upcoming-calendar (to show events coming from the selected calendar date), and calendar-month (all the appointments in the month displayed in the menu). --- src/main.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 24a9409..3e16555 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -58,16 +59,20 @@ main(int /*argc*/, char** /*argv*/) std::shared_ptr live_timezones(new LiveTimezones(live_settings, TIMEZONE_FILE)); std::shared_ptr live_clock(new LiveClock(live_timezones)); std::shared_ptr file_timezone(new FileTimezone(TIMEZONE_FILE)); + std::shared_ptr eds_engine (new EdsEngine); + const auto now = live_clock->localtime(); state->settings = live_settings; state->clock = live_clock; state->locations.reset(new SettingsLocations(live_settings, live_timezones)); - state->planner.reset(new PlannerEds(live_clock, file_timezone)); - state->planner->time = live_clock->localtime(); + auto calendar_month = new MonthPlanner(std::shared_ptr(new EdsPlanner(eds_engine, file_timezone)), now); + state->calendar_month.reset(calendar_month); + state->calendar_upcoming.reset(new UpcomingPlanner(std::shared_ptr(new EdsPlanner(eds_engine, file_timezone)), now)); std::shared_ptr actions(new LiveActions(state)); MenuFactory factory(actions, state); // snap decisions - ClockWatcherImpl clock_watcher(state); + std::shared_ptr upcoming_planner(new UpcomingPlanner(std::shared_ptr(new EdsPlanner (eds_engine, file_timezone)), now)); + ClockWatcherImpl clock_watcher(live_clock, upcoming_planner); Snap snap; clock_watcher.alarm_reached().connect([&snap](const Appointment& appt){ auto snap_show = [](const Appointment& a){ -- cgit v1.2.3