From 20d1c95d127d438bb19665043c3764ef343fa8d3 Mon Sep 17 00:00:00 2001 From: Alf Gaida Date: Tue, 24 Oct 2017 19:14:48 +0200 Subject: [PATCH] Cherry-picking upstream release 0.12.0. * Switched to experimental * Bumped liblxqt0-dev to >= 0.12.0 * Bumped Standards to 4.1.1 - no changes needed --- AUTHORS | 2 +- CHANGELOG | 40 ++++++++++++++++++- CMakeLists.txt | 17 +++++++- autostart/CMakeLists.txt | 17 ++++++++ autostart/lxqt-powermanagement.desktop.in | 11 +++++ .../lxqt-powermanagement_da.desktop | 2 + .../lxqt-powermanagement_de.desktop | 2 + .../lxqt-powermanagement_el.desktop | 1 + .../lxqt-powermanagement_fr.desktop | 1 + .../lxqt-powermanagement_it.desktop | 2 + .../lxqt-powermanagement_lt.desktop | 1 + .../lxqt-powermanagement_pl.desktop | 1 + .../lxqt-powermanagement_pt.desktop | 2 + config/main.cpp | 13 ++++++ config/powermanagementsettings.cpp | 10 ++--- .../lxqt-config-powermanagement_da.desktop | 2 +- .../lxqt-config-powermanagement_hu.desktop | 3 +- .../lxqt-config-powermanagement_it.desktop | 1 + .../lxqt-config-powermanagement_ja.desktop | 5 +-- .../lxqt-config-powermanagement_lt.desktop | 3 ++ .../lxqt-config-powermanagement_pl.desktop | 3 ++ .../lxqt-config-powermanagement_pl_PL.desktop | 2 - .../lxqt-config-powermanagement_pt.desktop | 1 + .../lxqt-config-powermanagement_ru.desktop | 3 +- debian/changelog | 9 +++++ debian/control | 8 ++-- src/batterywatcher.cpp | 14 +++---- src/main.cpp | 11 +++++ 28 files changed, 159 insertions(+), 28 deletions(-) create mode 100644 autostart/CMakeLists.txt create mode 100644 autostart/lxqt-powermanagement.desktop.in create mode 100644 autostart/translations/lxqt-powermanagement_da.desktop create mode 100644 autostart/translations/lxqt-powermanagement_de.desktop create mode 100644 autostart/translations/lxqt-powermanagement_el.desktop create mode 100644 autostart/translations/lxqt-powermanagement_fr.desktop create mode 100644 autostart/translations/lxqt-powermanagement_it.desktop create mode 100644 autostart/translations/lxqt-powermanagement_lt.desktop create mode 100644 autostart/translations/lxqt-powermanagement_pl.desktop create mode 100644 autostart/translations/lxqt-powermanagement_pt.desktop create mode 100644 config/translations/lxqt-config-powermanagement_lt.desktop create mode 100644 config/translations/lxqt-config-powermanagement_pl.desktop delete mode 100644 config/translations/lxqt-config-powermanagement_pl_PL.desktop diff --git a/AUTHORS b/AUTHORS index 96b08f3..95bad47 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,7 +2,7 @@ Upstream Authors: LXQt team: http://lxqt.org Copyright: - Copyright (c) 2013-2016 LXQt team + Copyright (c) 2013-2017 LXQt team License: LGPL-2.1+ The full text of the licenses can be found in the 'COPYING' file. diff --git a/CHANGELOG b/CHANGELOG index df8be61..7d8230f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,45 @@ -lxqt-powermanagement-0.11.1 / 2017-01-01 +lxqt-powermanagement-0.12.0 / 2017-10-21 ======================================== + * Set patch version + * Spell check (add "," and "-") + * Don't export github templates + * Adding missing "Comment" section to .desktop files. Fix for https://github.com/lxde/lxqt/issues/1339 + * Added Lithuanian language + * Drops Qt5Core_VERSION_STRING + * lxqt-config-powermanagement: set Qt::AA_UseHighDpiPixmaps to true + * Added QCommandLineParser and basic cli interface to lxqt-config-powermanagement and lxqt-powermanagement + * Added default CMAKE_BUILD_TYPE and LXQT_POWERMANAGEMENT_PATCH_VERSION + * added *pl.desktop + * Fixes a FTBFS in superbuild mode + * Added merged autostart to CMakeLists.txt + * Updated *_da.desktop files and removed *_da_DK.desktop files + * Update desktop entries and Replace fr_FR by fr + * Move Italian desktop entry to correct path + * Update Greek translation (el) Remove country variant from language code + * Rename LxQt to LXQt everywhere + * CMake: Adds Runtime and Devel install COMPONENTs + * Coding style changes + * Updates the build system to use the Targets infrastructure + * Rename Power Management module name again + * Rename LXQt Power Management module name + * Drops hardcoded /etc/xdg paths + * Updated german translation, replaced Qt4 by Qt in all xsession/translations + * Portuguese update for .desktop files + * Updates translations infrastructure + * Update the required minimum cmake version + * remove dead template lines switch OnlyShowIn from Razor -> LXQt stringchanges LxQt -> LXQt + * Renamed lxqt-autosuspend.desktop.in --> lxqt-powermanagement.desktop.in + * Support lxqt-session and add necessary xdg autostart desktop entry files. + * Default to no action if the action is not specified in the config file + * BatteryWatcher: Fix indentation + * Bump year + +0.11.1 / 2017-01-01 +=================== + + * Release 0.11.1: Update changelog * Add lxqt-config-powermanagement_da.desktop * Create lxqt-config-powermanagement_fr.desktop * Make CMakeLists.txt more uniform. diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a7d622..49e01c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,16 +12,26 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF) find_package(Qt5DBus REQUIRED) -find_package(Qt5LinguistTools REQUIRED QUIET) +find_package(Qt5LinguistTools REQUIRED) find_package(Qt5Svg REQUIRED) find_package(Qt5Widgets REQUIRED) find_package(Qt5X11Extras REQUIRED) -message(STATUS "Building with Qt${Qt5Core_VERSION_STRING}") +message(STATUS "Building with Qt${Qt5Core_VERSION}") find_package(KF5Solid REQUIRED) find_package(lxqt REQUIRED) +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) +endif() + +# Patch Version +set(LXQT_POWERMANAGEMENT_PATCH_VERSION 0) + +set(LXQT_POWERMANAGEMENT_VERSION ${LXQT_MAJOR_VERSION}.${LXQT_MINOR_VERSION}.${LXQT_POWERMANAGEMENT_PATCH_VERSION}) +add_definitions("-DLXQT_POWERMANAGEMENT_VERSION=\"${LXQT_POWERMANAGEMENT_VERSION}\"") + include(LXQtCompilerSettings NO_POLICY_SCOPE) # Translations ********************************** @@ -29,3 +39,6 @@ include(LXQtTranslate) add_subdirectory(config) add_subdirectory(src) + +# merged from lxqt-common +add_subdirectory(autostart) diff --git a/autostart/CMakeLists.txt b/autostart/CMakeLists.txt new file mode 100644 index 0000000..2760792 --- /dev/null +++ b/autostart/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) + +file(GLOB DESKTOP_FILES_IN *.desktop.in) + +# Translations ********************************** +lxqt_translate_desktop(DESKTOP_FILES + SOURCES + ${DESKTOP_FILES_IN} +) +add_custom_target(lxqt_powermanagement_autostart_desktop_files ALL DEPENDS ${DESKTOP_FILES}) +#************************************************ + +install(FILES + ${DESKTOP_FILES} + DESTINATION "${LXQT_ETC_XDG_DIR}/autostart" + COMPONENT Runtime +) diff --git a/autostart/lxqt-powermanagement.desktop.in b/autostart/lxqt-powermanagement.desktop.in new file mode 100644 index 0000000..624f5d0 --- /dev/null +++ b/autostart/lxqt-powermanagement.desktop.in @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Application +Version=1.0 +Name=Power Management +TryExec=lxqt-powermanagement +Exec=lxqt-powermanagement +OnlyShowIn=LXQt; +X-LXQt-Need-Tray=true +X-LXQt-Module=true + +#TRANSLATIONS_DIR=translations diff --git a/autostart/translations/lxqt-powermanagement_da.desktop b/autostart/translations/lxqt-powermanagement_da.desktop new file mode 100644 index 0000000..4f9e38d --- /dev/null +++ b/autostart/translations/lxqt-powermanagement_da.desktop @@ -0,0 +1,2 @@ +# Translations +Name[da]=Strømstyring diff --git a/autostart/translations/lxqt-powermanagement_de.desktop b/autostart/translations/lxqt-powermanagement_de.desktop new file mode 100644 index 0000000..4cad910 --- /dev/null +++ b/autostart/translations/lxqt-powermanagement_de.desktop @@ -0,0 +1,2 @@ +#TRANSLATIONS +Name[de]=LXQt-Energieverwaltung diff --git a/autostart/translations/lxqt-powermanagement_el.desktop b/autostart/translations/lxqt-powermanagement_el.desktop new file mode 100644 index 0000000..7d60988 --- /dev/null +++ b/autostart/translations/lxqt-powermanagement_el.desktop @@ -0,0 +1 @@ +Name[el]=Διαχείριση ενέργειας diff --git a/autostart/translations/lxqt-powermanagement_fr.desktop b/autostart/translations/lxqt-powermanagement_fr.desktop new file mode 100644 index 0000000..c0bb680 --- /dev/null +++ b/autostart/translations/lxqt-powermanagement_fr.desktop @@ -0,0 +1 @@ +Name[fr]=Gestion de l'énergie diff --git a/autostart/translations/lxqt-powermanagement_it.desktop b/autostart/translations/lxqt-powermanagement_it.desktop new file mode 100644 index 0000000..e6ea051 --- /dev/null +++ b/autostart/translations/lxqt-powermanagement_it.desktop @@ -0,0 +1,2 @@ +#TRANSLATIONS +Name[it]=Gestore energia diff --git a/autostart/translations/lxqt-powermanagement_lt.desktop b/autostart/translations/lxqt-powermanagement_lt.desktop new file mode 100644 index 0000000..7b7ebd6 --- /dev/null +++ b/autostart/translations/lxqt-powermanagement_lt.desktop @@ -0,0 +1 @@ +Name[lt]=Maitinimo valdymas diff --git a/autostart/translations/lxqt-powermanagement_pl.desktop b/autostart/translations/lxqt-powermanagement_pl.desktop new file mode 100644 index 0000000..adb8d81 --- /dev/null +++ b/autostart/translations/lxqt-powermanagement_pl.desktop @@ -0,0 +1 @@ +Name[pl]=Zarządzanie energią diff --git a/autostart/translations/lxqt-powermanagement_pt.desktop b/autostart/translations/lxqt-powermanagement_pt.desktop new file mode 100644 index 0000000..2557bca --- /dev/null +++ b/autostart/translations/lxqt-powermanagement_pt.desktop @@ -0,0 +1,2 @@ +#TRANSLATIONS +Name[pt]=Gestor de energia do LXQt diff --git a/config/main.cpp b/config/main.cpp index e1eab9e..52c0c0f 100644 --- a/config/main.cpp +++ b/config/main.cpp @@ -27,11 +27,24 @@ #include +#include + #include "mainwindow.h" int main(int argc, char *argv[]) { LXQt::SingleApplication a(argc, argv); + a.setAttribute(Qt::AA_UseHighDpiPixmaps, true); + + QCommandLineParser parser; + parser.setApplicationDescription(QStringLiteral("LXQt Config Powermanagement")); + const QString VERINFO = QStringLiteral(LXQT_POWERMANAGEMENT_VERSION + "\nliblxqt " LXQT_VERSION + "\nQt " QT_VERSION_STR); + a.setApplicationVersion(VERINFO); + parser.addVersionOption(); + parser.addHelpOption(); + parser.process(a); MainWindow mainWindow; mainWindow.setWindowIcon(QIcon::fromTheme("preferences-system-power-management")); diff --git a/config/powermanagementsettings.cpp b/config/powermanagementsettings.cpp index 996f608..b52b368 100644 --- a/config/powermanagementsettings.cpp +++ b/config/powermanagementsettings.cpp @@ -81,7 +81,7 @@ void PowerManagementSettings::setBatteryWatcherEnabled(bool batteryWatcherEnable int PowerManagementSettings::getPowerLowAction() { - return value(POWER_LOW_ACTION_KEY, 0).toInt(); + return value(POWER_LOW_ACTION_KEY, -1).toInt(); } void PowerManagementSettings::setPowerLowAction(int powerLowAction) @@ -141,7 +141,7 @@ void PowerManagementSettings::setLidWatcherEnabled(bool lidWatcherEnabled) int PowerManagementSettings::getLidClosedAcAction() { - return value(LID_CLOSED_AC_ACTION_KEY, 0).toInt(); + return value(LID_CLOSED_AC_ACTION_KEY, -1).toInt(); } void PowerManagementSettings::setLidClosedAcAction(int lidClosedAcAction) @@ -151,7 +151,7 @@ void PowerManagementSettings::setLidClosedAcAction(int lidClosedAcAction) int PowerManagementSettings::getLidClosedAction() { - return value(LID_CLOSED_ACTION_KEY, 0).toInt(); + return value(LID_CLOSED_ACTION_KEY, -1).toInt(); } void PowerManagementSettings::setLidClosedAction(int lidClosedAction) @@ -161,7 +161,7 @@ void PowerManagementSettings::setLidClosedAction(int lidClosedAction) int PowerManagementSettings::getLidClosedExtMonAcAction() { - return value(LID_CLOSED_EXT_MON_AC_ACTION_KEY, 0).toInt(); + return value(LID_CLOSED_EXT_MON_AC_ACTION_KEY, -1).toInt(); } void PowerManagementSettings::setLidClosedExtMonAcAction(int lidClosedExtMonAcAction) @@ -171,7 +171,7 @@ void PowerManagementSettings::setLidClosedExtMonAcAction(int lidClosedExtMonAcAc int PowerManagementSettings::getLidClosedExtMonAction() { - return value(LID_CLOSED_EXT_MON_ACTION_KEY, 0).toInt(); + return value(LID_CLOSED_EXT_MON_ACTION_KEY, -1).toInt(); } void PowerManagementSettings::setLidClosedExtMonAction(int lidClosedExtMonAction) diff --git a/config/translations/lxqt-config-powermanagement_da.desktop b/config/translations/lxqt-config-powermanagement_da.desktop index 85ce4fc..a2c1cd7 100644 --- a/config/translations/lxqt-config-powermanagement_da.desktop +++ b/config/translations/lxqt-config-powermanagement_da.desktop @@ -1,3 +1,3 @@ Name[da]=Strømstyring GenericName[da]=Indstillinger for strømstyring -Comment[da]=Diverse indstillinger omhandlende strømstyring såsom batteri eller tomgangsovervågning +Comment[da]=Diverse indstillinger omhandlende strømstyring, såsom batteri- eller tomgangsovervågning diff --git a/config/translations/lxqt-config-powermanagement_hu.desktop b/config/translations/lxqt-config-powermanagement_hu.desktop index d34e28e..531a865 100644 --- a/config/translations/lxqt-config-powermanagement_hu.desktop +++ b/config/translations/lxqt-config-powermanagement_hu.desktop @@ -1,3 +1,4 @@ # Translations -GenericName[hu]=LXQt energiakezelés beállítása Name[hu]=Energiakezelés +GenericName[hu]=LXQt energiakezelés beállítása +Comment[hu]=LXQt energiakezelés beállítása diff --git a/config/translations/lxqt-config-powermanagement_it.desktop b/config/translations/lxqt-config-powermanagement_it.desktop index c88258a..8bfc77c 100644 --- a/config/translations/lxqt-config-powermanagement_it.desktop +++ b/config/translations/lxqt-config-powermanagement_it.desktop @@ -1,2 +1,3 @@ Name[it]=Gestore energia GenericName[it]=Impostazioni del risparmio energetico +Comment[it]=Diverse impostazioni per il risparmio energetico diff --git a/config/translations/lxqt-config-powermanagement_ja.desktop b/config/translations/lxqt-config-powermanagement_ja.desktop index 76b29a5..9b9ab96 100644 --- a/config/translations/lxqt-config-powermanagement_ja.desktop +++ b/config/translations/lxqt-config-powermanagement_ja.desktop @@ -1,5 +1,4 @@ # Translations -GenericName[ja]=電源管理の設定 Name[ja]=電源管理 - -#TRANSLATIONS_DIR=translations +GenericName[ja]=電源管理の設定 +Comment[ja]=電源管理の設定 diff --git a/config/translations/lxqt-config-powermanagement_lt.desktop b/config/translations/lxqt-config-powermanagement_lt.desktop new file mode 100644 index 0000000..5c17425 --- /dev/null +++ b/config/translations/lxqt-config-powermanagement_lt.desktop @@ -0,0 +1,3 @@ +Name[lt]=Maitinimo valdymas +GenericName[lt]=Maitinimo valdymo nustatymai +Comment[lt]=Įvairūs su maitinimo valdymu susiję nustatymai diff --git a/config/translations/lxqt-config-powermanagement_pl.desktop b/config/translations/lxqt-config-powermanagement_pl.desktop new file mode 100644 index 0000000..79cb70e --- /dev/null +++ b/config/translations/lxqt-config-powermanagement_pl.desktop @@ -0,0 +1,3 @@ +Name[pl]=Zarządzanie energią +GenericName[pl]=Konfiguracja zarządzania energią +Comment[pl]=Konfiguracja zarządzania energią diff --git a/config/translations/lxqt-config-powermanagement_pl_PL.desktop b/config/translations/lxqt-config-powermanagement_pl_PL.desktop deleted file mode 100644 index 3f4894b..0000000 --- a/config/translations/lxqt-config-powermanagement_pl_PL.desktop +++ /dev/null @@ -1,2 +0,0 @@ -Name[pl_PL]=Zarządzanie energią -GenericName[pl_PL]=Konfiguracja zarządzania energią diff --git a/config/translations/lxqt-config-powermanagement_pt.desktop b/config/translations/lxqt-config-powermanagement_pt.desktop index 37af097..6bc18b9 100644 --- a/config/translations/lxqt-config-powermanagement_pt.desktop +++ b/config/translations/lxqt-config-powermanagement_pt.desktop @@ -1,2 +1,3 @@ Name[pt]=Gestão de energia GenericName[pt]=Definições do gestor de energia +Comment[pt]=Definições do gestor de energia diff --git a/config/translations/lxqt-config-powermanagement_ru.desktop b/config/translations/lxqt-config-powermanagement_ru.desktop index fee8d06..5649054 100644 --- a/config/translations/lxqt-config-powermanagement_ru.desktop +++ b/config/translations/lxqt-config-powermanagement_ru.desktop @@ -1,3 +1,4 @@ # Translations +Name[ru]=Управление энергопотреблением GenericName[ru]=Настройки управления энергопотреблением -Name[ru]=Управление энергопотреблением \ No newline at end of file +Comment[ru]=Настройки управления энергопотреблением diff --git a/debian/changelog b/debian/changelog index 48f1600..d3d7aaa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +lxqt-powermanagement (0.12.0-1) experimental; urgency=medium + + * Cherry-picking upstream release 0.12.0. + * Switched to experimental + * Bumped liblxqt0-dev to >= 0.12.0 + * Bumped Standards to 4.1.1 - no changes needed + + -- Alf Gaida Tue, 24 Oct 2017 19:14:29 +0200 + lxqt-powermanagement (0.11.1-2) unstable; urgency=medium * Bumped standards to 4.0.0 - no changes needed diff --git a/debian/control b/debian/control index cbc3506..a0e3136 100644 --- a/debian/control +++ b/debian/control @@ -9,14 +9,14 @@ Build-Depends: debhelper (>= 10), libkf5idletime-dev, libkf5solid-dev, libkf5windowsystem-dev, - liblxqt0-dev (>= 0.11.1), + liblxqt0-dev (>= 0.12.0), libqt5svg5-dev, libqt5x11extras5-dev, libx11-dev, qtbase5-private-dev, -Standards-Version: 4.0.0 -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-lxqt/lxqt-powermanagement.git/?h=debian/sid -Vcs-Git: https://anonscm.debian.org/git/pkg-lxqt/lxqt-powermanagement.git -b debian/sid +Standards-Version: 4.1.1 +Vcs-Browser: https://anonscm.debian.org/cgit/pkg-lxqt/lxqt-powermanagement.git/?h=debian/experimental +Vcs-Git: https://anonscm.debian.org/git/pkg-lxqt/lxqt-powermanagement.git -b debian/experimental Homepage: https://github.com/lxde/lxqt-powermanagement Package: lxqt-powermanagement diff --git a/src/batterywatcher.cpp b/src/batterywatcher.cpp index 59c46f6..7b120d6 100644 --- a/src/batterywatcher.cpp +++ b/src/batterywatcher.cpp @@ -44,18 +44,18 @@ BatteryWatcher::BatteryWatcher(QObject *parent) : Watcher(parent) if (devices.isEmpty()) { - LXQt::Notification::notify(tr("No battery!"), - tr("LXQt could not find data about any battery - monitoring disabled"), - "lxqt-powermanagement"); + LXQt::Notification::notify(tr("No battery!"), + tr("LXQt could not find data about any battery - monitoring disabled"), + "lxqt-powermanagement"); } foreach (Solid::Device device, devices) { Solid::Battery *battery = device.as(); - if (battery->type() != Solid::Battery::PrimaryBattery) - { - continue; - } + if (battery->type() != Solid::Battery::PrimaryBattery) + { + continue; + } mBatteries << battery; connect(battery, &Solid::Battery::energyChanged, this, &BatteryWatcher::batteryChanged); connect(battery, &Solid::Battery::chargeStateChanged, this, &BatteryWatcher::batteryChanged); diff --git a/src/main.cpp b/src/main.cpp index bfaf024..2043912 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -25,6 +25,7 @@ #include #include +#include #include @@ -36,6 +37,16 @@ int main(int argc, char *argv[]) LXQt::Application a(argc, argv); a.setQuitOnLastWindowClosed(false); + QCommandLineParser parser; + parser.setApplicationDescription(QStringLiteral("LXQt Powermanagement Daemon")); + const QString VERINFO = LXQT_POWERMANAGEMENT_VERSION \ + "\nliblxqt " LXQT_VERSION \ + "\nQt " QT_VERSION_STR; + a.setApplicationVersion(VERINFO); + parser.addVersionOption(); + parser.addHelpOption(); + parser.process(a); + // To ensure only one instance of lxqt-powermanagement is running we register as a DBus service and refuse to run // if not able to do so. // We do not register any object as we don't have any dbus-operations to expose.