From 0f33bc4be7e9dffaa6b68cd758c3c531460c9a2f Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Thu, 12 Nov 2015 08:40:14 +0100 Subject: Fork from Ubuntu's indicator-power code project. --- .bzr-builddeb/default.conf | 2 - CMakeLists.txt | 6 +- data/CMakeLists.txt | 14 ++-- data/ayatana-indicator-power.conf.in | 9 +++ data/ayatana-indicator-power.desktop.in | 9 +++ data/ayatana-indicator-power.upstart.desktop.in | 10 +++ data/com.canonical.indicator.power | 24 ------- data/com.canonical.indicator.power.Battery.xml | 23 ------- data/com.canonical.indicator.power.Testing.xml | 39 ----------- data/com.canonical.indicator.power.gschema.xml.in | 24 ------- data/indicator-power.conf.in | 9 --- data/indicator-power.desktop.in | 9 --- data/indicator-power.upstart.desktop.in | 10 --- data/org.ayatana.indicator.power | 24 +++++++ data/org.ayatana.indicator.power.Battery.xml | 23 +++++++ data/org.ayatana.indicator.power.Testing.xml | 39 +++++++++++ data/org.ayatana.indicator.power.gschema.xml.in | 24 +++++++ debian/changelog | 6 ++ debian/control | 20 +++--- debian/copyright | 8 ++- debian/rules | 10 +-- debian/source/format | 1 + debian/source_ayatana-indicator-power.py | 12 ++++ debian/source_indicator-power.py | 12 ---- po/Makevars | 4 +- po/POTFILES.in | 2 +- src/CMakeLists.txt | 19 +++-- src/brightness.c | 14 ++-- src/com.canonical.powerd.xml | 84 ----------------------- src/dbus-shared.h | 4 +- src/notifier.c | 10 +-- src/org.ayatana.powerd.xml | 84 +++++++++++++++++++++++ src/service.c | 18 ++--- tests/CMakeLists.txt | 8 +-- tests/manual | 20 +++--- tests/test-device.cc | 4 +- tests/test-notify.cc | 4 +- 37 files changed, 322 insertions(+), 320 deletions(-) delete mode 100644 .bzr-builddeb/default.conf create mode 100644 data/ayatana-indicator-power.conf.in create mode 100644 data/ayatana-indicator-power.desktop.in create mode 100644 data/ayatana-indicator-power.upstart.desktop.in delete mode 100644 data/com.canonical.indicator.power delete mode 100644 data/com.canonical.indicator.power.Battery.xml delete mode 100644 data/com.canonical.indicator.power.Testing.xml delete mode 100644 data/com.canonical.indicator.power.gschema.xml.in delete mode 100644 data/indicator-power.conf.in delete mode 100644 data/indicator-power.desktop.in delete mode 100644 data/indicator-power.upstart.desktop.in create mode 100644 data/org.ayatana.indicator.power create mode 100644 data/org.ayatana.indicator.power.Battery.xml create mode 100644 data/org.ayatana.indicator.power.Testing.xml create mode 100644 data/org.ayatana.indicator.power.gschema.xml.in create mode 100644 debian/source/format create mode 100644 debian/source_ayatana-indicator-power.py delete mode 100644 debian/source_indicator-power.py delete mode 100644 src/com.canonical.powerd.xml create mode 100644 src/org.ayatana.powerd.xml diff --git a/.bzr-builddeb/default.conf b/.bzr-builddeb/default.conf deleted file mode 100644 index 6c96a98..0000000 --- a/.bzr-builddeb/default.conf +++ /dev/null @@ -1,2 +0,0 @@ -[BUILDDEB] -split = True diff --git a/CMakeLists.txt b/CMakeLists.txt index 569100d..07843e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,11 @@ -project(indicator-power C CXX) +project(ayatana-indicator-power C CXX) cmake_minimum_required(VERSION 2.8.9) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) -set(PROJECT_VERSION "14.10.0") +set(PROJECT_VERSION "0.11.0") set(PACKAGE ${CMAKE_PROJECT_NAME}) -set(GETTEXT_PACKAGE "indicator-power") +set(GETTEXT_PACKAGE "ayatana-indicator-power") add_definitions (-DGETTEXT_PACKAGE="${GETTEXT_PACKAGE}" -DGNOMELOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}") diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 0750128..0d903b9 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -3,7 +3,7 @@ ## include (UseGSettings) -set (SCHEMA_NAME "com.canonical.indicator.power.gschema.xml") +set (SCHEMA_NAME "org.ayatana.indicator.power.gschema.xml") set (SCHEMA_FILE "${CMAKE_CURRENT_BINARY_DIR}/${SCHEMA_NAME}") set (SCHEMA_FILE_IN "${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME}.in") @@ -80,11 +80,11 @@ install (FILES "${UPSTART_XDG_AUTOSTART_FILE}" ## # where to install -set (UNITY_INDICATOR_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/unity/indicators") -message (STATUS "${UNITY_INDICATOR_DIR} is the Unity Indicator install dir") +set (AYATANA_INDICATOR_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/ayatana/indicators") +message (STATUS "${AYATANA_INDICATOR_DIR} is the Unity Indicator install dir") -set (UNITY_INDICATOR_NAME "com.canonical.indicator.power") -set (UNITY_INDICATOR_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${UNITY_INDICATOR_NAME}") +set (AYATANA_INDICATOR_NAME "org.ayatana.indicator.power") +set (AYATANA_INDICATOR_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${AYATANA_INDICATOR_NAME}") -install (FILES "${UNITY_INDICATOR_FILE}" - DESTINATION "${UNITY_INDICATOR_DIR}") +install (FILES "${AYATANA_INDICATOR_FILE}" + DESTINATION "${AYATANA_INDICATOR_DIR}") diff --git a/data/ayatana-indicator-power.conf.in b/data/ayatana-indicator-power.conf.in new file mode 100644 index 0000000..665fb35 --- /dev/null +++ b/data/ayatana-indicator-power.conf.in @@ -0,0 +1,9 @@ +description "Indicator Power Service" + +start on indicator-services-start +stop on desktop-end or indicator-services-end + +respawn +respawn limit 2 10 + +exec @pkglibexecdir@/indicator-power-service diff --git a/data/ayatana-indicator-power.desktop.in b/data/ayatana-indicator-power.desktop.in new file mode 100644 index 0000000..c2fd54c --- /dev/null +++ b/data/ayatana-indicator-power.desktop.in @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=Indicator Power +Exec=@pkglibexecdir@/indicator-power-service +OnlyShowIn=Unity;GNOME; +NoDisplay=true +StartupNotify=false +Terminal=false +AutostartCondition=GNOME3 unless-session gnome diff --git a/data/ayatana-indicator-power.upstart.desktop.in b/data/ayatana-indicator-power.upstart.desktop.in new file mode 100644 index 0000000..5f95f8e --- /dev/null +++ b/data/ayatana-indicator-power.upstart.desktop.in @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Name=Indicator Power +Exec=@pkglibexecdir@/indicator-power-service +OnlyShowIn=Unity;GNOME; +NoDisplay=true +StartupNotify=false +Terminal=false +AutostartCondition=GNOME3 unless-session gnome +Hidden=true diff --git a/data/com.canonical.indicator.power b/data/com.canonical.indicator.power deleted file mode 100644 index f94ed0f..0000000 --- a/data/com.canonical.indicator.power +++ /dev/null @@ -1,24 +0,0 @@ -[Indicator Service] -Name=indicator-power -ObjectPath=/com/canonical/indicator/power -Position=40 - -[phone] -ObjectPath=/com/canonical/indicator/power/phone -Position=25 - -[desktop] -ObjectPath=/com/canonical/indicator/power/desktop - -[desktop_greeter] -ObjectPath=/com/canonical/indicator/power/desktop_greeter - -[desktop_lockscreen] -ObjectPath=/com/canonical/indicator/power/desktop_greeter - -[phone_greeter] -ObjectPath=/com/canonical/indicator/power/phone -Position=25 - -[ubiquity] -ObjectPath=/com/canonical/indicator/power/desktop_greeter diff --git a/data/com.canonical.indicator.power.Battery.xml b/data/com.canonical.indicator.power.Battery.xml deleted file mode 100644 index eca4524..0000000 --- a/data/com.canonical.indicator.power.Battery.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - The battery's power level. Possible values: 'ok', 'low', 'very_low', 'critical' - - - - - - - - Whether or not indicator-power-service is warning the user about low battery power. - - - - - - diff --git a/data/com.canonical.indicator.power.Testing.xml b/data/com.canonical.indicator.power.Testing.xml deleted file mode 100644 index 72cf6cf..0000000 --- a/data/com.canonical.indicator.power.Testing.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - Whether or not the mock battery is enabled. (Default: false) - - - - - - - - The charge level of the mock battery (0-100%, Default: 50%) - - - - - - - - The mock battery's state. Possible values: 'charging', 'discharging' (Default: 'discharging') - - - - - - - - Minutes left until the mock battery finishes charging/discharging (Default: 30) - - - - - - diff --git a/data/com.canonical.indicator.power.gschema.xml.in b/data/com.canonical.indicator.power.gschema.xml.in deleted file mode 100644 index 4fd2620..0000000 --- a/data/com.canonical.indicator.power.gschema.xml.in +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - false - <_summary>Show time in Menu Bar - <_description>Whether or not to show the time in the menu bar. - - - false - <_summary>Show percentage in Menu Bar - <_description>Whether or not to show the percentage in the menu bar. - - - "present" - <_summary>When to show the battery status in the menu bar. - <_description>Options for when to show battery status. Valid options are "present", "charge", and "never". - - - diff --git a/data/indicator-power.conf.in b/data/indicator-power.conf.in deleted file mode 100644 index 665fb35..0000000 --- a/data/indicator-power.conf.in +++ /dev/null @@ -1,9 +0,0 @@ -description "Indicator Power Service" - -start on indicator-services-start -stop on desktop-end or indicator-services-end - -respawn -respawn limit 2 10 - -exec @pkglibexecdir@/indicator-power-service diff --git a/data/indicator-power.desktop.in b/data/indicator-power.desktop.in deleted file mode 100644 index c2fd54c..0000000 --- a/data/indicator-power.desktop.in +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Indicator Power -Exec=@pkglibexecdir@/indicator-power-service -OnlyShowIn=Unity;GNOME; -NoDisplay=true -StartupNotify=false -Terminal=false -AutostartCondition=GNOME3 unless-session gnome diff --git a/data/indicator-power.upstart.desktop.in b/data/indicator-power.upstart.desktop.in deleted file mode 100644 index 5f95f8e..0000000 --- a/data/indicator-power.upstart.desktop.in +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Indicator Power -Exec=@pkglibexecdir@/indicator-power-service -OnlyShowIn=Unity;GNOME; -NoDisplay=true -StartupNotify=false -Terminal=false -AutostartCondition=GNOME3 unless-session gnome -Hidden=true diff --git a/data/org.ayatana.indicator.power b/data/org.ayatana.indicator.power new file mode 100644 index 0000000..1625507 --- /dev/null +++ b/data/org.ayatana.indicator.power @@ -0,0 +1,24 @@ +[Indicator Service] +Name=indicator-power +ObjectPath=/org.ayatana.indicator/power +Position=40 + +[phone] +ObjectPath=/org.ayatana.indicator/power/phone +Position=25 + +[desktop] +ObjectPath=/org.ayatana.indicator/power/desktop + +[desktop_greeter] +ObjectPath=/org.ayatana.indicator/power/desktop_greeter + +[desktop_lockscreen] +ObjectPath=/org.ayatana.indicator/power/desktop_greeter + +[phone_greeter] +ObjectPath=/org.ayatana.indicator/power/phone +Position=25 + +[ubiquity] +ObjectPath=/org.ayatana.indicator/power/desktop_greeter diff --git a/data/org.ayatana.indicator.power.Battery.xml b/data/org.ayatana.indicator.power.Battery.xml new file mode 100644 index 0000000..cfb4b01 --- /dev/null +++ b/data/org.ayatana.indicator.power.Battery.xml @@ -0,0 +1,23 @@ + + + + + + + + + The battery's power level. Possible values: 'ok', 'low', 'very_low', 'critical' + + + + + + + + Whether or not indicator-power-service is warning the user about low battery power. + + + + + + diff --git a/data/org.ayatana.indicator.power.Testing.xml b/data/org.ayatana.indicator.power.Testing.xml new file mode 100644 index 0000000..a0d7f50 --- /dev/null +++ b/data/org.ayatana.indicator.power.Testing.xml @@ -0,0 +1,39 @@ + + + + + + + + + Whether or not the mock battery is enabled. (Default: false) + + + + + + + + The charge level of the mock battery (0-100%, Default: 50%) + + + + + + + + The mock battery's state. Possible values: 'charging', 'discharging' (Default: 'discharging') + + + + + + + + Minutes left until the mock battery finishes charging/discharging (Default: 30) + + + + + + diff --git a/data/org.ayatana.indicator.power.gschema.xml.in b/data/org.ayatana.indicator.power.gschema.xml.in new file mode 100644 index 0000000..901135b --- /dev/null +++ b/data/org.ayatana.indicator.power.gschema.xml.in @@ -0,0 +1,24 @@ + + + + + + + + + false + <_summary>Show time in Menu Bar + <_description>Whether or not to show the time in the menu bar. + + + false + <_summary>Show percentage in Menu Bar + <_description>Whether or not to show the percentage in the menu bar. + + + "present" + <_summary>When to show the battery status in the menu bar. + <_description>Options for when to show battery status. Valid options are "present", "charge", and "never". + + + diff --git a/debian/changelog b/debian/changelog index 8c84c48..6437c19 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ayatana-indicator-power (0.11.0-0) UNRELEASED; urgency=medium + + * Fork from Ubuntu's indicator-power code project. + + -- Mike Gabriel Thu, 12 Nov 2015 08:26:14 +0100 + indicator-power (12.10.6+15.10.20151005.1-0ubuntu1) wily; urgency=medium [ CI Train Bot ] diff --git a/debian/control b/debian/control index 20869e3..0e9147e 100644 --- a/debian/control +++ b/debian/control @@ -1,7 +1,7 @@ -Source: indicator-power +Source: ayatana-indicator-power Section: gnome Priority: optional -Maintainer: Ubuntu Core Developers +Maintainer: Mike Gabriel Build-Depends: cmake, libnotify-dev (>= 0.7.6), libglib2.0-dev (>= 2.36), @@ -10,22 +10,18 @@ Build-Depends: cmake, python:any, # for packaging debhelper (>= 9), - dh-translations, intltool, # for tests libgtest-dev, python3-dbusmock, dbus-test-runner, libdbustest1-dev, -Standards-Version: 3.9.5 -Homepage: https://launchpad.net/indicator-power -# If you aren't a member of ~indicator-applet-developers but need to upload -# packaging changes, just go ahead. ~indicator-applet-developers will notice -# and sync up the code again. -Vcs-Bzr: https://code.launchpad.net/~indicator-applet-developers/indicator-power/trunk.13.04 -Vcs-Browser: https://bazaar.launchpad.net/~indicator-applet-developers/indicator-power/trunk.13.04/files +Standards-Version: 3.9.6 +Homepage: https://github.com/ArcticaProject/ayatana-indicator-power +Vcs-Git: git://cgit.arctica-project.org/ayatana/ayatana-indicator-power.git +Vcs-Browser: https://cgit.arctica-project.org/ayatana/ayatana-indicator-power.git/ -Package: indicator-power +Package: ayatana-indicator-power Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, @@ -34,6 +30,6 @@ Recommends: unity-control-center | gnome-control-center (>= 3.1) | ubuntu-system indicator-applet (>= 0.2) | indicator-renderer, Suggests: powerd, unity-system-compositor (>= 0.0.4), -Description: Indicator showing power state. +Description: Ayatana Indicator showing power state. This indicator displays current power management information and gives the user a way to access power management preferences. diff --git a/debian/copyright b/debian/copyright index 1f5be70..92265f8 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,9 +1,10 @@ Format: http://dep.debian.net/deps/dep5 -Upstream-Name: indicator-power -Source: http://launchpad.net/indicator-power +Upstream-Name: ayatana-indicator-power +Source: https://github.com/ArcticaProject/ayatana-indicator-power Files: * -Copyright: 2011 Canonical Ltd. +Copyright: 2011, Canonical Ltd. + 2015, Mike Gabriel License: GPL-3 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3, as published @@ -19,6 +20,7 @@ License: GPL-3 Files: debian/* Copyright: 2011 Ken VanDine + 2015, Mike Gabriel License: GPL-2+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/debian/rules b/debian/rules index 885b94c..48f1c29 100755 --- a/debian/rules +++ b/debian/rules @@ -7,11 +7,11 @@ export DPKG_GENSYMBOLS_CHECK_LEVEL=4 %: - dh $@ --with translations + dh $@ override_dh_install: - find debian/indicator-power -name \*.la -delete - find debian/indicator-power -name \*.a -delete + find debian/ayatana-indicator-power -name \*.la -delete + find debian/ayatana-indicator-power -name \*.a -delete dh_install --fail-missing - mkdir -p debian/indicator-power/usr/share/apport/package-hooks/ - cp debian/source_indicator-power.py debian/indicator-power/usr/share/apport/package-hooks/ + mkdir -p debian/ayatana-indicator-power/usr/share/apport/package-hooks/ + cp debian/source_ayatana-indicator-power.py debian/ayatana-indicator-power/usr/share/apport/package-hooks/ diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..9f8e9b6 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +1.0 \ No newline at end of file diff --git a/debian/source_ayatana-indicator-power.py b/debian/source_ayatana-indicator-power.py new file mode 100644 index 0000000..3d9b6c6 --- /dev/null +++ b/debian/source_ayatana-indicator-power.py @@ -0,0 +1,12 @@ +'''apport package hook for ayatana-indicator-power + +(c) 2011 Canonical Ltd. +Author: Ken VanDine +''' + +from apport.hookutils import * +from os import path + +def add_info(report): + report['UPowerDump'] = command_output(['upower', '-d']) + return report diff --git a/debian/source_indicator-power.py b/debian/source_indicator-power.py deleted file mode 100644 index ea0cf0f..0000000 --- a/debian/source_indicator-power.py +++ /dev/null @@ -1,12 +0,0 @@ -'''apport package hook for indicator-power - -(c) 2011 Canonical Ltd. -Author: Ken VanDine -''' - -from apport.hookutils import * -from os import path - -def add_info(report): - report['UPowerDump'] = command_output(['upower', '-d']) - return report diff --git a/po/Makevars b/po/Makevars index 383662d..924c007 100644 --- a/po/Makevars +++ b/po/Makevars @@ -18,7 +18,7 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --keyword=g_dngettext:2,3 # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. -COPYRIGHT_HOLDER = Canonical Ltd. +COPYRIGHT_HOLDER = Arctica Project # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: @@ -34,7 +34,7 @@ COPYRIGHT_HOLDER = Canonical Ltd. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. -MSGID_BUGS_ADDRESS = +MSGID_BUGS_ADDRESS = https://github.com/ArcticaProject/ayatana-indicator-power/issues # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. diff --git a/po/POTFILES.in b/po/POTFILES.in index 2a67fdc..3d4d782 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,4 +1,4 @@ -data/com.canonical.indicator.power.gschema.xml.in +data/org.ayatana.indicator.power.gschema.xml.in src/device.c src/notifier.c src/service.c diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8748484..9e537c8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,7 @@ -set (SERVICE_LIB "indicatorpowerservice") -set (SERVICE_EXEC "indicator-power-service") +set (SERVICE_LIB "ayatanaindicatorpowerservice") +set (SERVICE_EXEC "aytana-indicator-power-service") -add_definitions(-DG_LOG_DOMAIN="Indicator-Power") +add_definitions(-DG_LOG_DOMAIN="Ayatana-Indicator-Power") # handwritten sources set(SERVICE_MANUAL_SOURCES @@ -18,17 +18,17 @@ set(SERVICE_MANUAL_SOURCES include(GdbusCodegen) set(SERVICE_GENERATED_SOURCES) add_gdbus_codegen_with_namespace(SERVICE_GENERATED_SOURCES dbus-powerd - com.canonical + org.ayatana Dbus - ${CMAKE_SOURCE_DIR}/src/com.canonical.powerd.xml) + ${CMAKE_SOURCE_DIR}/src/org.ayatana.powerd.xml) add_gdbus_codegen_with_namespace(SERVICE_GENERATED_SOURCES dbus-battery - com.canonical.indicator.power + org.ayatana.indicator.power Dbus - ${CMAKE_SOURCE_DIR}/data/com.canonical.indicator.power.Battery.xml) + ${CMAKE_SOURCE_DIR}/data/org.ayatana.indicator.power.Battery.xml) add_gdbus_codegen_with_namespace(SERVICE_GENERATED_SOURCES dbus-testing - com.canonical.indicator.power + org.ayatana.indicator.power Dbus - ${CMAKE_SOURCE_DIR}/data/com.canonical.indicator.power.Testing.xml) + ${CMAKE_SOURCE_DIR}/data/org.ayatana.indicator.power.Testing.xml) # add the bin dir to our include path so the code can find the generated header files include_directories(${CMAKE_CURRENT_BINARY_DIR}) @@ -53,4 +53,3 @@ add_executable (${SERVICE_EXEC} main.c) set_source_files_properties(${SERVICE_SOURCES} main.c PROPERTIES COMPILE_FLAGS "${C_WARNING_ARGS} -g -std=c99") target_link_libraries (${SERVICE_EXEC} ${SERVICE_LIB} ${SERVICE_DEPS_LIBRARIES} ${GCOV_LIBS}) install (TARGETS ${SERVICE_EXEC} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}) - diff --git a/src/brightness.c b/src/brightness.c index eb48515..1f36aca 100644 --- a/src/brightness.c +++ b/src/brightness.c @@ -198,7 +198,7 @@ percentage_to_brightness(IndicatorPowerBrightness * self, double percentage) } /** - * DBus Chatter: com.canonical.powerd + * DBus Chatter: org.ayatana.powerd * * This is used to get default value, and upper and lower bounds, * of the brightness setting @@ -339,7 +339,7 @@ on_powerd_proxy_ready(GObject * source_object G_GNUC_UNUSED, } /** - * DBus Chatter: com.canonical.Unity.Screen + * DBus Chatter: org.ayatana.Unity.Screen * * Used to set the backlight brightness via setUserBrightness */ @@ -374,9 +374,9 @@ set_uscreen_user_brightness(IndicatorPowerBrightness * self, priv_t * p = get_priv(self); g_dbus_connection_call(p->system_bus, - "com.canonical.Unity.Screen", - "/com/canonical/Unity/Screen", - "com.canonical.Unity.Screen", + "org.ayatana.Unity.Screen", + "/org.ayatana.Unity/Screen", + "org.ayatana.Unity.Screen", "setUserBrightness", g_variant_new("(i)", value), NULL, /* no return args */ @@ -463,8 +463,8 @@ indicator_power_brightness_init(IndicatorPowerBrightness * self) dbus_powerd_proxy_new_for_bus (G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES, - "com.canonical.powerd", - "/com/canonical/powerd", + "org.ayatana.powerd", + "/org.ayatana.powerd", p->cancellable, on_powerd_proxy_ready, self); diff --git a/src/com.canonical.powerd.xml b/src/com.canonical.powerd.xml deleted file mode 100644 index b5b4ac4..0000000 --- a/src/com.canonical.powerd.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/dbus-shared.h b/src/dbus-shared.h index bf54034..c87befd 100644 --- a/src/dbus-shared.h +++ b/src/dbus-shared.h @@ -21,8 +21,8 @@ #ifndef DBUS_SHARED_H #define DBUS_SHARED_H -#define BUS_NAME "com.canonical.indicator.power" -#define BUS_PATH "/com/canonical/indicator/power" +#define BUS_NAME "org.ayatana.indicator.power" +#define BUS_PATH "/org/ayatana/indicator/power" #endif /* DBUS_SHARED_H */ diff --git a/src/notifier.c b/src/notifier.c index 4888610..5608662 100644 --- a/src/notifier.c +++ b/src/notifier.c @@ -73,7 +73,7 @@ typedef struct NotifyNotification * notify_notification; GDBusConnection * bus; - DbusBattery * dbus_battery; /* com.canonical.indicator.power.Battery skeleton */ + DbusBattery * dbus_battery; /* org.ayatana.indicator.power.Battery skeleton */ gboolean caps_queried; gboolean actions_supported; @@ -244,10 +244,10 @@ notification_show(IndicatorPowerNotifier * self) if (are_actions_supported(self)) { - notify_notification_set_hint(nn, "x-canonical-snap-decisions", g_variant_new_string("true")); - notify_notification_set_hint(nn, "x-canonical-non-shaped-icon", g_variant_new_string("true")); - notify_notification_set_hint(nn, "x-canonical-private-affirmative-tint", g_variant_new_string("true")); - notify_notification_set_hint(nn, "x-canonical-snap-decisions-timeout", g_variant_new_int32(INT32_MAX)); + notify_notification_set_hint(nn, "x-ayatana-snap-decisions", g_variant_new_string("true")); + notify_notification_set_hint(nn, "x-ayatana-non-shaped-icon", g_variant_new_string("true")); + notify_notification_set_hint(nn, "x-ayatana-private-affirmative-tint", g_variant_new_string("true")); + notify_notification_set_hint(nn, "x-ayatana-snap-decisions-timeout", g_variant_new_int32(INT32_MAX)); notify_notification_set_timeout(nn, NOTIFY_EXPIRES_NEVER); notify_notification_add_action(nn, "dismiss", _("OK"), on_dismiss_clicked, NULL, NULL); notify_notification_add_action(nn, "settings", _("Battery settings"), on_battery_settings_clicked, NULL, NULL); diff --git a/src/org.ayatana.powerd.xml b/src/org.ayatana.powerd.xml new file mode 100644 index 0000000..1d18ca9 --- /dev/null +++ b/src/org.ayatana.powerd.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/service.c b/src/service.c index cd0f24e..6bd5959 100644 --- a/src/service.c +++ b/src/service.c @@ -29,8 +29,8 @@ #include "notifier.h" #include "service.h" -#define BUS_NAME "com.canonical.indicator.power" -#define BUS_PATH "/com/canonical/indicator/power" +#define BUS_NAME "org.ayatana.indicator.power" +#define BUS_PATH "/org/ayatana/indicator/power" #define SETTINGS_SHOW_TIME_S "show-time" #define SETTINGS_ICON_POLICY_S "icon-policy" @@ -478,7 +478,7 @@ append_device_to_menu (GMenu * menu, const IndicatorPowerDevice * device, int pr item = g_menu_item_new (label, NULL); g_free (label); - g_menu_item_set_attribute (item, "x-canonical-type", "s", "com.canonical.indicator.basic"); + g_menu_item_set_attribute (item, "x-ayatana-type", "s", "org.ayatana.indicator.basic"); if ((icon = indicator_power_device_get_gicon (device))) { @@ -531,7 +531,7 @@ create_phone_devices_section (IndicatorPowerService * self G_GNUC_UNUSED) menu = g_menu_new (); item = g_menu_item_new (_("Charge level"), "indicator.battery-level"); - g_menu_item_set_attribute (item, "x-canonical-type", "s", "com.canonical.indicator.progress"); + g_menu_item_set_attribute (item, "x-ayatana-type", "s", "org.ayatana.indicator.progress"); g_menu_append_item (menu, item); g_object_unref (item); @@ -552,7 +552,7 @@ create_brightness_menu_item(void) GMenuItem * item; item = g_menu_item_new(NULL, "indicator.brightness"); - g_menu_item_set_attribute(item, "x-canonical-type", "s", "com.canonical.unity.slider"); + g_menu_item_set_attribute(item, "x-ayatana-type", "s", "org.ayatana.unity.slider"); g_menu_item_set_attribute(item, "min-value", "d", 0.0); g_menu_item_set_attribute(item, "max-value", "d", 1.0); @@ -633,7 +633,7 @@ create_phone_settings_section(IndicatorPowerService * self) if (ab_supported) { item = g_menu_item_new(_("Adjust brightness automatically"), "indicator.auto-brightness"); - g_menu_item_set_attribute(item, "x-canonical-type", "s", "com.canonical.indicator.switch"); + g_menu_item_set_attribute(item, "x-ayatana-type", "s", "org.ayatana.indicator.switch"); g_menu_append_item(section, item); g_object_unref(item); } @@ -741,8 +741,8 @@ create_menu (IndicatorPowerService * self, int profile) /* add submenu to the header */ header = g_menu_item_new (NULL, "indicator._header"); - g_menu_item_set_attribute (header, "x-canonical-type", - "s", "com.canonical.indicator.root"); + g_menu_item_set_attribute (header, "x-ayatana-type", + "s", "org.ayatana.indicator.root"); g_menu_item_set_submenu (header, G_MENU_MODEL (submenu)); g_object_unref (submenu); @@ -1176,7 +1176,7 @@ indicator_power_service_init (IndicatorPowerService * self) p->cancellable = g_cancellable_new (); - p->settings = g_settings_new ("com.canonical.indicator.power"); + p->settings = g_settings_new ("org.ayatana.indicator.power"); p->notifier = indicator_power_notifier_new (); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 02ecb1b..0d3d54a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -20,7 +20,7 @@ set_directory_properties (PROPERTIES set_source_files_properties (gschemas.compiled GENERATED) # GSettings: -# compile the indicator-power schema into a gschemas.compiled file in this directory, +# compile the ayatana-indicator-power schema into a gschemas.compiled file in this directory, # and help the tests to find that file by setting -DSCHEMA_DIR set (SCHEMA_DIR ${CMAKE_CURRENT_BINARY_DIR}) add_definitions(-DSCHEMA_DIR="${SCHEMA_DIR}") @@ -28,7 +28,7 @@ execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compil OUTPUT_VARIABLE COMPILE_SCHEMA_EXECUTABLE OUTPUT_STRIP_TRAILING_WHITESPACE) add_custom_command (OUTPUT gschemas.compiled - DEPENDS ${CMAKE_BINARY_DIR}/data/com.canonical.indicator.power.gschema.xml + DEPENDS ${CMAKE_BINARY_DIR}/data/org.ayatana.indicator.power.gschema.xml COMMAND cp -f ${CMAKE_BINARY_DIR}/data/*gschema.xml ${SCHEMA_DIR} COMMAND ${COMPILE_SCHEMA_EXECUTABLE} ${SCHEMA_DIR}) @@ -44,8 +44,8 @@ function(add_test_by_name name) set (TEST_NAME ${name}) add_executable (${TEST_NAME} ${TEST_NAME}.cc gschemas.compiled) add_test (${TEST_NAME} ${TEST_NAME}) - add_dependencies (${TEST_NAME} libindicatorpowerservice) - target_link_libraries (${TEST_NAME} indicatorpowerservice gtest ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBS}) + add_dependencies (${TEST_NAME} libayatanaindicatorpowerservice) + target_link_libraries (${TEST_NAME} ayatanaindicatorpowerservice gtest ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBS}) endfunction() add_test_by_name(test-notify) add_test(NAME dear-reader-the-next-test-takes-80-seconds COMMAND true) diff --git a/tests/manual b/tests/manual index 8a305ac..91d005d 100644 --- a/tests/manual +++ b/tests/manual @@ -3,32 +3,32 @@ Notes on Battery Testing Mock battery propreties are available for testing purposes. -The testing properties are DBus properties published on busname "com.canonical.indicator.power", object path "/com/canonical/indicator/power/Testing", and interface "com.canonical.indicator.power.Testing". The four properties are "MockBatteryEnabled" (boolean, default false), "MockBatteryLevel" (uint32 [0-100], default 50), "MockBatteryState" (string, default 'discharging'), "MockBatteryMinutesLeft" (minutes remaining to charge/discharge, uint32, default 30). +The testing properties are DBus properties published on busname "org.ayatana.indicator.power", object path "/org/ayatana/indicator/power/Testing", and interface "org.ayatana.indicator.power.Testing". The four properties are "MockBatteryEnabled" (boolean, default false), "MockBatteryLevel" (uint32 [0-100], default 50), "MockBatteryState" (string, default 'discharging'), "MockBatteryMinutesLeft" (minutes remaining to charge/discharge, uint32, default 30). Example use: Show the testing properties: -$ gdbus call --session --dest "com.canonical.indicator.power" \ - --object-path /com/canonical/indicator/power/Testing \ +$ gdbus call --session --dest "org.ayatana.indicator.power" \ + --object-path /org/ayatana/indicator/power/Testing \ --method org.freedesktop.DBus.Properties.GetAll \ - com.canonical.indicator.power.Testing + org.ayatana.indicator.power.Testing Enable the mock battery: -$ gdbus call --session --dest "com.canonical.indicator.power" \ - --object-path /com/canonical/indicator/power/Testing \ +$ gdbus call --session --dest "org.ayatana.indicator.power" \ + --object-path /org/ayatana/indicator/power/Testing \ --method org.freedesktop.DBus.Properties.Set \ - com.canonical.indicator.power.Testing \ + org.ayatana.indicator.power.Testing \ MockBatteryEnabled \ "" Set the mock battery's charge to 10% -$ gdbus call --session --dest "com.canonical.indicator.power" \ - --object-path /com/canonical/indicator/power/Testing \ +$ gdbus call --session --dest "org.ayatana.indicator.power" \ + --object-path /org/ayatana/indicator/power/Testing \ --method org.freedesktop.DBus.Properties.Set \ - com.canonical.indicator.power.Testing \ + org.ayatana.indicator.power.Testing \ MockBatteryLevel \ "" diff --git a/tests/test-device.cc b/tests/test-device.cc index e929f89..5ee9f1e 100644 --- a/tests/test-device.cc +++ b/tests/test-device.cc @@ -48,7 +48,7 @@ class DeviceTest : public ::testing::Test virtual void SetUp() { const GLogLevelFlags flags = GLogLevelFlags(G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_WARNING); - log_handler_id = g_log_set_handler ("Indicator-Power", flags, log_count_func, this); + log_handler_id = g_log_set_handler ("Ayatana-Indicator-Power", flags, log_count_func, this); log_count_ipower_expected = 0; log_count_ipower_actual = 0; } @@ -56,7 +56,7 @@ class DeviceTest : public ::testing::Test virtual void TearDown() { ASSERT_EQ (log_count_ipower_expected, log_count_ipower_actual); - g_log_remove_handler ("Indicator-Power", log_handler_id); + g_log_remove_handler ("Ayatana-Indicator-Power", log_handler_id); } protected: diff --git a/tests/test-notify.cc b/tests/test-notify.cc index d056f3f..acab34f 100644 --- a/tests/test-notify.cc +++ b/tests/test-notify.cc @@ -61,7 +61,7 @@ protected: static constexpr int NOTIFICATION_CLOSED_API {3}; static constexpr int NOTIFICATION_CLOSED_UNDEFINED {4}; - static constexpr char const * APP_NAME {"indicator-power-service"}; + static constexpr char const * APP_NAME {"ayatana-indicator-power-service"}; static constexpr char const * METHOD_CLOSE {"CloseNotification"}; static constexpr char const * METHOD_NOTIFY {"Notify"}; @@ -69,7 +69,7 @@ protected: static constexpr char const * METHOD_GET_INFO {"GetServerInformation"}; 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"}; protected: -- cgit v1.2.3