diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-01-30 10:57:19 -0600 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2014-01-30 10:57:19 -0600 |
commit | 9752ca1cd3e75e1245ebb8dcb4719503e332a352 (patch) | |
tree | dcb99d6928c3dc4a5e79a233005affa73ee4c119 /src | |
parent | c0c764e032787251d1990d2949b2044d87b6db38 (diff) | |
download | ayatana-indicator-datetime-9752ca1cd3e75e1245ebb8dcb4719503e332a352.tar.gz ayatana-indicator-datetime-9752ca1cd3e75e1245ebb8dcb4719503e332a352.tar.bz2 ayatana-indicator-datetime-9752ca1cd3e75e1245ebb8dcb4719503e332a352.zip |
fix 'clock app' menuitem on phone profile reported by seb128 and update the corresponding unit tests
Diffstat (limited to 'src')
-rw-r--r-- | src/menu.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/menu.cpp b/src/menu.cpp index 44da7b7..d0756cc 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -293,10 +293,10 @@ private: else { g_menu_item_set_attribute (menu_item, "x-canonical-type", "s", "com.canonical.indicator.appointment"); - - if (!appt.color.empty()) - g_menu_item_set_attribute (menu_item, "x-canonical-color", "s", appt.color.c_str()); } + + if (!appt.color.empty()) + g_menu_item_set_attribute (menu_item, "x-canonical-color", "s", appt.color.c_str()); if (profile == Phone) g_menu_item_set_action_and_target_value (menu_item, @@ -315,7 +315,7 @@ private: { auto menu = g_menu_new(); - if (((profile==Phone) || (profile==Desktop)) && m_state->settings->show_events.get()) + if ((profile==Desktop) && m_state->settings->show_events.get()) { add_appointments (menu, profile); @@ -327,6 +327,15 @@ private: g_menu_append_item(menu, menu_item); g_object_unref(menu_item); } + else if (profile==Phone) + { + auto menu_item = g_menu_item_new (_("Clock"), "indicator.activate-phone-clock-app"); + g_menu_item_set_attribute_value (menu_item, G_MENU_ATTRIBUTE_ICON, get_serialized_alarm_icon()); + g_menu_append_item (menu, menu_item); + g_object_unref (menu_item); + + add_appointments (menu, profile); + } return G_MENU_MODEL(menu); } |