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). --- tests/test-menus.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/test-menus.cpp') diff --git a/tests/test-menus.cpp b/tests/test-menus.cpp index 73d6036..61d1295 100644 --- a/tests/test-menus.cpp +++ b/tests/test-menus.cpp @@ -255,7 +255,7 @@ private: const std::vector& appointments) { // try adding a few appointments and see if the menu updates itself - m_state->planner->upcoming.set(appointments); + m_state->calendar_upcoming->appointments().set(appointments); wait_msec(); // wait a moment for the menu to update //auto submenu = g_menu_model_get_item_link(menu_model, 0, G_MENU_LINK_SUBMENU); @@ -285,7 +285,7 @@ private: // there should be an "add event" button even if there aren't any appointments std::vector appointments; m_state->settings->show_events.set(true); - m_state->planner->upcoming.set(appointments); + m_state->calendar_upcoming->appointments().set(appointments); wait_msec(); section = g_menu_model_get_item_link(submenu, Menu::Appointments, G_MENU_LINK_SECTION); EXPECT_EQ(1, g_menu_model_get_n_items(section)); @@ -299,7 +299,7 @@ private: // try adding a few appointments and see if the menu updates itself appointments = build_some_appointments(); - m_state->planner->upcoming.set(appointments); + m_state->calendar_upcoming->appointments().set(appointments); wait_msec(); // wait a moment for the menu to update section = g_menu_model_get_item_link(submenu, Menu::Appointments, G_MENU_LINK_SECTION); EXPECT_EQ(3, g_menu_model_get_n_items(section)); @@ -316,7 +316,7 @@ private: // clear all the appointments std::vector appointments; - m_state->planner->upcoming.set(appointments); + m_state->calendar_upcoming->appointments().set(appointments); wait_msec(); // wait a moment for the menu to update // check that there's a "clock app" menuitem even when there are no appointments @@ -332,7 +332,7 @@ private: // add some appointments and test them appointments = build_some_appointments(); - m_state->planner->upcoming.set(appointments); + m_state->calendar_upcoming->appointments().set(appointments); wait_msec(); // wait a moment for the menu to update section = g_menu_model_get_item_link(submenu, Menu::Appointments, G_MENU_LINK_SECTION); EXPECT_EQ(3, g_menu_model_get_n_items(section)); -- cgit v1.2.3