aboutsummaryrefslogtreecommitdiff
path: root/src/menu.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-03-06 17:54:57 -0600
committerCharles Kerr <charles.kerr@canonical.com>2014-03-06 17:54:57 -0600
commitdf650bec0f1c634ee773c150b451c3bdd8ed4e65 (patch)
tree0373cd9ece920ace2ac790610299b1454c464e67 /src/menu.cpp
parent58dd68d0f2d513f70c0348bc26bb6b4db09377df (diff)
downloadayatana-indicator-datetime-df650bec0f1c634ee773c150b451c3bdd8ed4e65.tar.gz
ayatana-indicator-datetime-df650bec0f1c634ee773c150b451c3bdd8ed4e65.tar.bz2
ayatana-indicator-datetime-df650bec0f1c634ee773c150b451c3bdd8ed4e65.zip
In the Desktop profile, don't show the 'Add Event…' button if evolution can't be launched.
Diffstat (limited to 'src/menu.cpp')
-rw-r--r--src/menu.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/menu.cpp b/src/menu.cpp
index 797757f..f88c290 100644
--- a/src/menu.cpp
+++ b/src/menu.cpp
@@ -302,7 +302,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));
@@ -319,13 +319,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)
{