aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-08-11 14:14:00 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-08-11 14:14:00 +0200
commit6bdea82a3226f45291522c87d7866f949a83f4c2 (patch)
tree3373fcba7d4755665fe2987116bc5fea114312cf
parent594bd0b5b81f4b46decc2d0bbebae5a94ab28b5a (diff)
parentfab51b477ad295de8ae5e030ceef09104feea09b (diff)
downloadayatana-indicator-datetime-6bdea82a3226f45291522c87d7866f949a83f4c2.tar.gz
ayatana-indicator-datetime-6bdea82a3226f45291522c87d7866f949a83f4c2.tar.bz2
ayatana-indicator-datetime-6bdea82a3226f45291522c87d7866f949a83f4c2.zip
Merge branch 'tari01-pr/replace-x-canonical-attributes'
Attributes GH PR #11: https://github.com/AyatanaIndicators/ayatana-indicator-datetime/pull/11
-rw-r--r--README.md22
-rw-r--r--include/notifications/notifications.h8
-rw-r--r--src/engine-eds.cpp4
-rw-r--r--src/menu.cpp22
-rw-r--r--src/notifications.cpp2
-rw-r--r--tests/test-eds-ics-missing-trigger.ics.in4
-rw-r--r--tests/test-eds-ics-nonrepeating-events.ics.in2
-rw-r--r--tests/test-eds-ics-repeating-events.ics.in2
-rw-r--r--tests/test-menus.cpp28
-rw-r--r--tests/test-snap.cpp2
10 files changed, 48 insertions, 48 deletions
diff --git a/README.md b/README.md
index 785f3f9..59ce0f4 100644
--- a/README.md
+++ b/README.md
@@ -54,26 +54,26 @@
## CUSTOM MENUITEMS
* Calendar
- - x-canonical-type s "org.ayatana.indicator.calendar"
+ - x-ayatana-type s "org.ayatana.indicator.calendar"
* Alarm
- label s short summary of the appointment
- - x-canonical-type s "org.ayatana.indicator.alarm"
- - x-canonical-time x the date of the appointment
- - x-canonical-time-format s strftime format string
+ - x-ayatana-type s "org.ayatana.indicator.alarm"
+ - x-ayatana-time x the date of the appointment
+ - x-ayatana-time-format s strftime format string
* Appointment
- label s short summary of the appointment
- - x-canonical-type s "org.ayatana.indicator.appointment"
- - x-canonical-color s color of the appt's type, to give a visual cue
- - x-canonical-time x the date of the appointment
- - x-canonical-time-format s strftime format string
+ - x-ayatana-type s "org.ayatana.indicator.appointment"
+ - x-ayatana-color s color of the appt's type, to give a visual cue
+ - x-ayatana-time x the date of the appointment
+ - x-ayatana-time-format s strftime format string
* Location
- label s the location's name, eg "Oklahoma City"
- - x-canonical-type s "org.ayatana.indicator.location"
- - x-canonical-timezone s timezone that the location is in
- - x-canonical-time-format s strftime format string
+ - x-ayatana-type s "org.ayatana.indicator.location"
+ - x-ayatana-timezone s timezone that the location is in
+ - x-ayatana-time-format s strftime format string
diff --git a/include/notifications/notifications.h b/include/notifications/notifications.h
index 0de1e23..e3c4389 100644
--- a/include/notifications/notifications.h
+++ b/include/notifications/notifications.h
@@ -58,10 +58,10 @@ public:
/* Add a notification hint.
These keys may be dependent on the notification server. */
void add_hint (const std::string& name);
- static constexpr char const * HINT_SNAP {"x-canonical-snap-decisions"};
- static constexpr char const * HINT_NONSHAPED_ICON {"x-canonical-non-shaped-icon"};
- static constexpr char const * HINT_AFFIRMATIVE_HINT {"x-canonical-private-affirmative-tint"};
- static constexpr char const * HINT_REJECTION_TINT {"x-canonical-private-rejection-tint"};
+ static constexpr char const * HINT_SNAP {"x-ayatana-snap-decisions"};
+ static constexpr char const * HINT_NONSHAPED_ICON {"x-ayatana-non-shaped-icon"};
+ static constexpr char const * HINT_AFFIRMATIVE_HINT {"x-ayatana-private-affirmative-tint"};
+ static constexpr char const * HINT_REJECTION_TINT {"x-ayatana-private-rejection-tint"};
/* Add an action button.
This may fail if the Engine doesn't support actions.
diff --git a/src/engine-eds.cpp b/src/engine-eds.cpp
index f8a4ce8..3120b3f 100644
--- a/src/engine-eds.cpp
+++ b/src/engine-eds.cpp
@@ -35,8 +35,8 @@ namespace ayatana {
namespace indicator {
namespace datetime {
-static constexpr char const * TAG_ALARM {"x-canonical-alarm"};
-static constexpr char const * TAG_DISABLED {"x-canonical-disabled"};
+static constexpr char const * TAG_ALARM {"x-ayatana-alarm"};
+static constexpr char const * TAG_DISABLED {"x-ayatana-disabled"};
static constexpr char const * X_PROP_ACTIVATION_URL {"X-CANONICAL-ACTIVATION-URL"};
diff --git a/src/menu.cpp b/src/menu.cpp
index b8e9728..5469dd1 100644
--- a/src/menu.cpp
+++ b/src/menu.cpp
@@ -88,7 +88,7 @@ protected:
update_header();
});
m_formatter->header_format.changed().connect([this](const std::string&){
- update_section(Locations); // need to update x-canonical-time-format
+ update_section(Locations); // need to update x-ayatana-time-format
});
m_formatter->relative_format_changed.connect([this](){
update_section(Appointments); // uses formatter.relative_format()
@@ -219,7 +219,7 @@ private:
// add submenu to the header
const auto detailed_action = std::string("indicator.") + name() + "-header";
auto header = g_menu_item_new(nullptr, detailed_action.c_str());
- g_menu_item_set_attribute(header, "x-canonical-type", "s",
+ g_menu_item_set_attribute(header, "x-ayatana-type", "s",
"org.ayatana.indicator.root");
g_menu_item_set_attribute(header, "submenu-action", "s",
"indicator.calendar-active");
@@ -270,7 +270,7 @@ private:
item = g_menu_item_new ("[calendar]", nullptr);
v = g_variant_new_int64(0);
g_menu_item_set_action_and_target_value (item, "indicator.calendar", v);
- g_menu_item_set_attribute (item, "x-canonical-type",
+ g_menu_item_set_attribute (item, "x-ayatana-type",
"s", "org.ayatana.indicator.calendar");
if (action_name != nullptr)
g_menu_item_set_attribute (item, "activation-action", "s", action_name);
@@ -313,21 +313,21 @@ private:
auto unix_time = g_date_time_to_unix(begin);
auto menu_item = g_menu_item_new (appt.summary.c_str(), nullptr);
- g_menu_item_set_attribute (menu_item, "x-canonical-time", "x", unix_time);
- g_menu_item_set_attribute (menu_item, "x-canonical-time-format", "s", fmt.c_str());
+ g_menu_item_set_attribute (menu_item, "x-ayatana-time", "x", unix_time);
+ g_menu_item_set_attribute (menu_item, "x-ayatana-time-format", "s", fmt.c_str());
if (appt.is_ubuntu_alarm())
{
- g_menu_item_set_attribute (menu_item, "x-canonical-type", "s", "org.ayatana.indicator.alarm");
+ g_menu_item_set_attribute (menu_item, "x-ayatana-type", "s", "org.ayatana.indicator.alarm");
g_menu_item_set_attribute_value(menu_item, G_MENU_ATTRIBUTE_ICON, get_serialized_alarm_icon());
}
else
{
- g_menu_item_set_attribute (menu_item, "x-canonical-type", "s", "org.ayatana.indicator.appointment");
+ g_menu_item_set_attribute (menu_item, "x-ayatana-type", "s", "org.ayatana.indicator.appointment");
}
if (!appt.color.empty())
- g_menu_item_set_attribute (menu_item, "x-canonical-color", "s", appt.color.c_str());
+ g_menu_item_set_attribute (menu_item, "x-ayatana-color", "s", appt.color.c_str());
if (action_name != nullptr)
g_menu_item_set_action_and_target_value (menu_item, action_name,
@@ -386,9 +386,9 @@ private:
const auto fmt = m_formatter->relative_format(zone_now.get());
auto detailed_action = g_strdup_printf("indicator.set-location::%s %s", zone.c_str(), name.c_str());
auto i = g_menu_item_new (name.c_str(), detailed_action);
- g_menu_item_set_attribute(i, "x-canonical-type", "s", "org.ayatana.indicator.location");
- g_menu_item_set_attribute(i, "x-canonical-timezone", "s", zone.c_str());
- g_menu_item_set_attribute(i, "x-canonical-time-format", "s", fmt.c_str());
+ g_menu_item_set_attribute(i, "x-ayatana-type", "s", "org.ayatana.indicator.location");
+ g_menu_item_set_attribute(i, "x-ayatana-timezone", "s", zone.c_str());
+ g_menu_item_set_attribute(i, "x-ayatana-time-format", "s", fmt.c_str());
g_menu_append_item (menu, i);
g_object_unref(i);
g_free(detailed_action);
diff --git a/src/notifications.cpp b/src/notifications.cpp
index 051653d..f8782de 100644
--- a/src/notifications.cpp
+++ b/src/notifications.cpp
@@ -314,7 +314,7 @@ private:
// as the name indicates, don't use this directly: use server_caps() instead
mutable std::set<std::string> m_lazy_caps;
- static constexpr char const * HINT_TIMEOUT {"x-canonical-snap-decisions-timeout"};
+ static constexpr char const * HINT_TIMEOUT {"x-ayatana-snap-decisions-timeout"};
};
/***
diff --git a/tests/test-eds-ics-missing-trigger.ics.in b/tests/test-eds-ics-missing-trigger.ics.in
index 0b7881f..01a306c 100644
--- a/tests/test-eds-ics-missing-trigger.ics.in
+++ b/tests/test-eds-ics-missing-trigger.ics.in
@@ -8,7 +8,7 @@ UID:20150617T211838Z-6217-32011-2036-1@ubuntu-phablet
DTSTAMP:20150617T211838Z
DTSTART:20150618T100000
SUMMARY:One Time Alarm
-CATEGORIES:x-canonical-alarm
+CATEGORIES:x-ayatana-alarm
CREATED:20150617T211838Z
LAST-MODIFIED:20150617T211838Z
BEGIN:VALARM
@@ -28,7 +28,7 @@ DTSTAMP:20150617T211913Z
DTSTART:20150618T100100
RRULE:FREQ=DAILY
SUMMARY:Recurring Alarm
-CATEGORIES:x-canonical-alarm
+CATEGORIES:x-ayatana-alarm
CREATED:20150617T211913Z
LAST-MODIFIED:20150617T211913Z
BEGIN:VALARM
diff --git a/tests/test-eds-ics-nonrepeating-events.ics.in b/tests/test-eds-ics-nonrepeating-events.ics.in
index be95ed1..6e45450 100644
--- a/tests/test-eds-ics-nonrepeating-events.ics.in
+++ b/tests/test-eds-ics-nonrepeating-events.ics.in
@@ -8,7 +8,7 @@ UID:20150520T000726Z-3878-32011-1770-81@ubuntu-phablet
DTSTAMP:20150520T223932Z
DTSTART:20150520T200000
SUMMARY:Alarm
-CATEGORIES:x-canonical-alarm
+CATEGORIES:x-ayatana-alarm
SEQUENCE:1
LAST-MODIFIED:20150520T223932Z
BEGIN:VALARM
diff --git a/tests/test-eds-ics-repeating-events.ics.in b/tests/test-eds-ics-repeating-events.ics.in
index 7c728c6..51679a3 100644
--- a/tests/test-eds-ics-repeating-events.ics.in
+++ b/tests/test-eds-ics-repeating-events.ics.in
@@ -9,7 +9,7 @@ DTSTAMP:20150508T211449Z
DTSTART:20150508T164000
RRULE:FREQ=WEEKLY;BYDAY=FR
SUMMARY:Alarm
-CATEGORIES:x-canonical-alarm
+CATEGORIES:x-ayatana-alarm
CREATED:20150507T211449Z
LAST-MODIFIED:20150507T211449Z
BEGIN:VALARM
diff --git a/tests/test-menus.cpp b/tests/test-menus.cpp
index dd19487..8650201 100644
--- a/tests/test-menus.cpp
+++ b/tests/test-menus.cpp
@@ -62,7 +62,7 @@ protected:
// check that there's a header menuitem
EXPECT_EQ(1,g_menu_model_get_n_items(menu_model));
gchar* str = nullptr;
- g_menu_model_get_item_attribute(menu_model, 0, "x-canonical-type", "s", &str);
+ g_menu_model_get_item_attribute(menu_model, 0, "x-ayatana-type", "s", &str);
EXPECT_STREQ("org.ayatana.indicator.root", str);
g_clear_pointer(&str, g_free);
g_menu_model_get_item_attribute(menu_model, 0, G_MENU_ATTRIBUTE_ACTION, "s", &str);
@@ -131,7 +131,7 @@ protected:
// look at the calendar menuitem
if (calendar_expected)
{
- g_menu_model_get_item_attribute(section, 1, "x-canonical-type", "s", &str);
+ g_menu_model_get_item_attribute(section, 1, "x-ayatana-type", "s", &str);
EXPECT_STREQ("org.ayatana.indicator.calendar", str);
g_clear_pointer(&str, g_free);
@@ -205,27 +205,27 @@ private:
int index,
const Appointment& appt)
{
- // confirm it has the right x-canonical-type
+ // confirm it has the right x-ayatana-type
gchar * str = nullptr;
- g_menu_model_get_item_attribute(section, index, "x-canonical-type", "s", &str);
+ g_menu_model_get_item_attribute(section, index, "x-ayatana-type", "s", &str);
if (appt.is_ubuntu_alarm())
EXPECT_STREQ("org.ayatana.indicator.alarm", str);
else
EXPECT_STREQ("org.ayatana.indicator.appointment", str);
g_clear_pointer(&str, g_free);
- // confirm it has a nonempty x-canonical-time-format
- g_menu_model_get_item_attribute(section, index, "x-canonical-time-format", "s", &str);
+ // confirm it has a nonempty x-ayatana-time-format
+ g_menu_model_get_item_attribute(section, index, "x-ayatana-time-format", "s", &str);
EXPECT_TRUE(str && *str);
g_clear_pointer(&str, g_free);
// confirm the color hint, if it exists,
- // is in the x-canonical-color attribute
+ // is in the x-ayatana-color attribute
if (appt.color.empty())
{
EXPECT_FALSE(g_menu_model_get_item_attribute(section,
index,
- "x-canonical-color",
+ "x-ayatana-color",
"s",
&str));
}
@@ -233,7 +233,7 @@ private:
{
EXPECT_TRUE(g_menu_model_get_item_attribute(section,
index,
- "x-canonical-color",
+ "x-ayatana-color",
"s",
&str));
EXPECT_EQ(appt.color, str);
@@ -398,18 +398,18 @@ protected:
{
gchar* str = nullptr;
- // confirm that the x-canonical-type is right
- g_menu_model_get_item_attribute(section, i, "x-canonical-type", "s", &str);
+ // confirm that the x-ayatana-type is right
+ g_menu_model_get_item_attribute(section, i, "x-ayatana-type", "s", &str);
EXPECT_STREQ("org.ayatana.indicator.location", str);
g_clear_pointer(&str, g_free);
// confirm that the timezones match the ones in the vector
- g_menu_model_get_item_attribute(section, i, "x-canonical-timezone", "s", &str);
+ g_menu_model_get_item_attribute(section, i, "x-ayatana-timezone", "s", &str);
EXPECT_EQ(locations[i].zone(), str);
g_clear_pointer(&str, g_free);
- // confirm that x-canonical-time-format has some kind of time format string
- g_menu_model_get_item_attribute(section, i, "x-canonical-time-format", "s", &str);
+ // confirm that x-ayatana-time-format has some kind of time format string
+ g_menu_model_get_item_attribute(section, i, "x-ayatana-time-format", "s", &str);
EXPECT_TRUE(str && *str && (strchr(str,'%')!=nullptr));
g_clear_pointer(&str, g_free);
}
diff --git a/tests/test-snap.cpp b/tests/test-snap.cpp
index 1904bef..8a310e4 100644
--- a/tests/test-snap.cpp
+++ b/tests/test-snap.cpp
@@ -84,7 +84,7 @@ protected:
static constexpr char const * SIGNAL_CLOSED {"NotificationClosed"};
- static constexpr char const * HINT_TIMEOUT {"x-canonical-snap-decisions-timeout"};
+ static constexpr char const * HINT_TIMEOUT {"x-ayatana-snap-decisions-timeout"};
static constexpr char const * AS_BUSNAME {"org.freedesktop.Accounts"};
static constexpr char const * AS_INTERFACE {"com.ubuntu.touch.AccountsService.Sound"};