diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-03-14 17:37:21 +0000 |
---|---|---|
committer | CI bot <ps-jenkins@lists.canonical.com> | 2014-03-14 17:37:21 +0000 |
commit | 5148b720cf8aa9ab2c89442ff528c5b344da556e (patch) | |
tree | 94c68d5551f00eb3f9828931c8545c42050fd564 /src/menu.cpp | |
parent | 8c4067b5484a81e2bb9158266601e30262bfb119 (diff) | |
parent | 01dca64fc75b6bff4494f1886f2397f6fd0ad8d1 (diff) | |
download | ayatana-indicator-datetime-5148b720cf8aa9ab2c89442ff528c5b344da556e.tar.gz ayatana-indicator-datetime-5148b720cf8aa9ab2c89442ff528c5b344da556e.tar.bz2 ayatana-indicator-datetime-5148b720cf8aa9ab2c89442ff528c5b344da556e.zip |
Don't show the "Add Event..." button if the calendar app can't be found. Fixes: 1250632
Diffstat (limited to 'src/menu.cpp')
-rw-r--r-- | src/menu.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/menu.cpp b/src/menu.cpp index d6abd27..90ef41f 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -308,7 +308,7 @@ private: g_menu_item_set_action_and_target_value (menu_item, "indicator.activate-appointment", g_variant_new_string (appt.uid.c_str())); - else + else if (m_actions->can_open_planner()) g_menu_item_set_action_and_target_value (menu_item, "indicator.activate-planner", g_variant_new_int64 (unix_time)); @@ -325,13 +325,16 @@ private: { add_appointments (menu, profile); - // add the 'Add Event…' menuitem - auto menu_item = g_menu_item_new(_("Add Event…"), nullptr); - const gchar* action_name = "indicator.activate-planner"; - auto v = g_variant_new_int64(0); - g_menu_item_set_action_and_target_value(menu_item, action_name, v); - g_menu_append_item(menu, menu_item); - g_object_unref(menu_item); + if (m_actions->can_open_planner()) + { + // add the 'Add Event…' menuitem + auto menu_item = g_menu_item_new(_("Add Event…"), nullptr); + const gchar* action_name = "indicator.activate-planner"; + auto v = g_variant_new_int64(0); + g_menu_item_set_action_and_target_value(menu_item, action_name, v); + g_menu_append_item(menu, menu_item); + g_object_unref(menu_item); + } } else if (profile==Phone) { |