From 71f97cd047f58ca93303f0262f65fb48682b2e70 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 21 Mar 2014 18:07:12 -0500 Subject: give 'phone' and 'desktop' their own action namespaces. Fix documentation on 'activate-settings', since there are two forms of it, one for phone and one for desktop. --- README | 3 ++- src/actions.cpp | 4 ++-- src/menu.cpp | 4 ++-- tests/test-actions.cpp | 12 ++++++------ 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/README b/README index 6bd0edb..85948db 100644 --- a/README +++ b/README @@ -1,7 +1,8 @@ ACTIONS ======= - * "activate-settings" + * "phone.open-settings" + * "desktop.open-settings" Description: opens a page for changing indicator-datetime's settings State: None Parameter: None diff --git a/src/actions.cpp b/src/actions.cpp index c9c6286..dc9a34b 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -183,8 +183,8 @@ Actions::Actions(const std::shared_ptr& state): m_actions(g_simple_action_group_new()) { GActionEntry entries[] = { - { "activate-desktop-settings", on_desktop_settings_activated }, - { "activate-phone-settings", on_phone_settings_activated }, + { "desktop.open-settings", on_desktop_settings_activated }, + { "phone.open-settings", on_phone_settings_activated }, { "activate-phone-clock-app", on_phone_clock_activated }, { "activate-appointment", on_activate_appointment, "s", nullptr }, { "activate-planner", on_activate_planner, "x", nullptr }, diff --git a/src/menu.cpp b/src/menu.cpp index 90ef41f..9091951 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -383,11 +383,11 @@ private: if (profile == Desktop) { - g_menu_append (menu, _("Date & Time Settings…"), "indicator.activate-desktop-settings"); + g_menu_append (menu, _("Date & Time Settings…"), "indicator.desktop.open-settings"); } else if (profile == Phone) { - g_menu_append (menu, _("Time & Date settings…"), "indicator.activate-phone-settings"); + g_menu_append (menu, _("Time & Date settings…"), "indicator.phone.open-settings"); } return G_MENU_MODEL (menu); diff --git a/tests/test-actions.cpp b/tests/test-actions.cpp index 5d1efd5..105c850 100644 --- a/tests/test-actions.cpp +++ b/tests/test-actions.cpp @@ -34,18 +34,18 @@ TEST_F(ActionsFixture, ActionsExist) "set-location", "activate-planner", "activate-appointment", - "activate-phone-settings", "activate-phone-clock-app", - "activate-desktop-settings" }; + "phone.open-settings", + "desktop.open-settings" }; for(const auto& name: names) { EXPECT_TRUE(g_action_group_has_action(m_actions->action_group(), name)); } } -TEST_F(ActionsFixture, ActivateDesktopSettings) +TEST_F(ActionsFixture, DesktopOpenSettings) { - const auto action_name = "activate-desktop-settings"; + const auto action_name = "desktop.open-settings"; const auto expected_action = MockActions::OpenDesktopSettings; auto action_group = m_actions->action_group(); @@ -59,9 +59,9 @@ TEST_F(ActionsFixture, ActivateDesktopSettings) EXPECT_EQ(expected_action, history[0]); } -TEST_F(ActionsFixture, ActivatePhoneSettings) +TEST_F(ActionsFixture, PhoneOpenSettings) { - const auto action_name = "activate-phone-settings"; + const auto action_name = "phone.open-settings"; const auto expected_action = MockActions::OpenPhoneSettings; auto action_group = m_actions->action_group(); -- cgit v1.2.3