on xenial help sign in
allow changing the system TZ by clicking on the location item

requires the user to be in the "sudo" group at least; we don't have any polkit agent available in unity8 yet

commitb1bb0527587851241d516503c88120087e342239 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateThu 17 Sep 2015, 20:02 (11 years ago) parent87a5e9b
1 file changed+13−3
qml/Panel/Indicators/MenuItemFactory.qml+13−3
qml/Panel/Indicators/MenuItemFactory.qml+13−3
@@ -471,7 +471,7 @@ Item {
471471 property var menuModel: menuFactory.menuModel
472472 property int menuIndex: -1
473473 property var extendedData: menuData && menuData.ext || undefined
474− readonly property var tz: getExtendedProperty(extendedData, "xCanonicalTimezone", "UTC")
474+ readonly property string tz: getExtendedProperty(extendedData, "xCanonicalTimezone", "UTC")
475475 property var updateTimer: Timer {
476476 repeat: true
477477 running: tzMenuItem.visible // only run when we're open
@@ -481,7 +481,6 @@ Item {
481481 city: menuData && menuData.label || ""
482482 time: Utils.TimezoneFormatter.currentTimeInTimezone(tz)
483483 enabled: menuData && menuData.sensitive || false
484− highlightWhenPressed: false
485484
486485 onMenuModelChanged: {
487486 loadAttributes();
@@ -490,7 +489,18 @@ Item {
490489 loadAttributes();
491490 }
492491 onTriggered: {
493− menuModel.activate(menuIndex);
492+ tzActionGroup.setLocation.activate(tz);
493+ }
494+
495+ QDBusActionGroup {
496+ id: tzActionGroup
497+ busType: DBus.SessionBus
498+ busName: "com.canonical.indicator.datetime"
499+ objectPath: "/com/canonical/indicator/datetime"
500+
501+ property variant setLocation: action("set-location")
502+
503+ Component.onCompleted: tzActionGroup.start()
494504 }
495505
496506 function loadAttributes() {