Cherry-picking upstream version 0.12.0.
This commit is contained in:
parent
a65e8a4d49
commit
fd201e3745
2
AUTHORS
2
AUTHORS
@ -2,7 +2,7 @@ Upstream Authors:
|
|||||||
LXQt team: http://lxqt.org
|
LXQt team: http://lxqt.org
|
||||||
|
|
||||||
Copyright:
|
Copyright:
|
||||||
Copyright (c) 2013-2016 LXQt team
|
Copyright (c) 2013-2017 LXQt team
|
||||||
|
|
||||||
License: LGPL-2.1+
|
License: LGPL-2.1+
|
||||||
The full text of the licenses can be found in the 'COPYING' file.
|
The full text of the licenses can be found in the 'COPYING' file.
|
||||||
|
40
CHANGELOG
40
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
|
* Add lxqt-config-powermanagement_da.desktop
|
||||||
* Create lxqt-config-powermanagement_fr.desktop
|
* Create lxqt-config-powermanagement_fr.desktop
|
||||||
* Make CMakeLists.txt more uniform.
|
* Make CMakeLists.txt more uniform.
|
||||||
|
@ -12,16 +12,26 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|||||||
option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF)
|
option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF)
|
||||||
|
|
||||||
find_package(Qt5DBus REQUIRED)
|
find_package(Qt5DBus REQUIRED)
|
||||||
find_package(Qt5LinguistTools REQUIRED QUIET)
|
find_package(Qt5LinguistTools REQUIRED)
|
||||||
find_package(Qt5Svg REQUIRED)
|
find_package(Qt5Svg REQUIRED)
|
||||||
find_package(Qt5Widgets REQUIRED)
|
find_package(Qt5Widgets REQUIRED)
|
||||||
find_package(Qt5X11Extras 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(KF5Solid REQUIRED)
|
||||||
|
|
||||||
find_package(lxqt 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)
|
include(LXQtCompilerSettings NO_POLICY_SCOPE)
|
||||||
|
|
||||||
# Translations **********************************
|
# Translations **********************************
|
||||||
@ -29,3 +39,6 @@ include(LXQtTranslate)
|
|||||||
|
|
||||||
add_subdirectory(config)
|
add_subdirectory(config)
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
||||||
|
# merged from lxqt-common
|
||||||
|
add_subdirectory(autostart)
|
||||||
|
17
autostart/CMakeLists.txt
Normal file
17
autostart/CMakeLists.txt
Normal file
@ -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
|
||||||
|
)
|
11
autostart/lxqt-powermanagement.desktop.in
Normal file
11
autostart/lxqt-powermanagement.desktop.in
Normal file
@ -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
|
2
autostart/translations/lxqt-powermanagement_da.desktop
Normal file
2
autostart/translations/lxqt-powermanagement_da.desktop
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Translations
|
||||||
|
Name[da]=Strømstyring
|
2
autostart/translations/lxqt-powermanagement_de.desktop
Normal file
2
autostart/translations/lxqt-powermanagement_de.desktop
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#TRANSLATIONS
|
||||||
|
Name[de]=LXQt-Energieverwaltung
|
1
autostart/translations/lxqt-powermanagement_el.desktop
Normal file
1
autostart/translations/lxqt-powermanagement_el.desktop
Normal file
@ -0,0 +1 @@
|
|||||||
|
Name[el]=Διαχείριση ενέργειας
|
1
autostart/translations/lxqt-powermanagement_fr.desktop
Normal file
1
autostart/translations/lxqt-powermanagement_fr.desktop
Normal file
@ -0,0 +1 @@
|
|||||||
|
Name[fr]=Gestion de l'énergie
|
2
autostart/translations/lxqt-powermanagement_it.desktop
Normal file
2
autostart/translations/lxqt-powermanagement_it.desktop
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#TRANSLATIONS
|
||||||
|
Name[it]=Gestore energia
|
1
autostart/translations/lxqt-powermanagement_lt.desktop
Normal file
1
autostart/translations/lxqt-powermanagement_lt.desktop
Normal file
@ -0,0 +1 @@
|
|||||||
|
Name[lt]=Maitinimo valdymas
|
1
autostart/translations/lxqt-powermanagement_pl.desktop
Normal file
1
autostart/translations/lxqt-powermanagement_pl.desktop
Normal file
@ -0,0 +1 @@
|
|||||||
|
Name[pl]=Zarządzanie energią
|
2
autostart/translations/lxqt-powermanagement_pt.desktop
Normal file
2
autostart/translations/lxqt-powermanagement_pt.desktop
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#TRANSLATIONS
|
||||||
|
Name[pt]=Gestor de energia do LXQt
|
@ -27,11 +27,24 @@
|
|||||||
|
|
||||||
#include <LXQt/SingleApplication>
|
#include <LXQt/SingleApplication>
|
||||||
|
|
||||||
|
#include <QCommandLineParser>
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
LXQt::SingleApplication a(argc, 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 mainWindow;
|
||||||
mainWindow.setWindowIcon(QIcon::fromTheme("preferences-system-power-management"));
|
mainWindow.setWindowIcon(QIcon::fromTheme("preferences-system-power-management"));
|
||||||
|
@ -81,7 +81,7 @@ void PowerManagementSettings::setBatteryWatcherEnabled(bool batteryWatcherEnable
|
|||||||
|
|
||||||
int PowerManagementSettings::getPowerLowAction()
|
int PowerManagementSettings::getPowerLowAction()
|
||||||
{
|
{
|
||||||
return value(POWER_LOW_ACTION_KEY, 0).toInt();
|
return value(POWER_LOW_ACTION_KEY, -1).toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PowerManagementSettings::setPowerLowAction(int powerLowAction)
|
void PowerManagementSettings::setPowerLowAction(int powerLowAction)
|
||||||
@ -141,7 +141,7 @@ void PowerManagementSettings::setLidWatcherEnabled(bool lidWatcherEnabled)
|
|||||||
|
|
||||||
int PowerManagementSettings::getLidClosedAcAction()
|
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)
|
void PowerManagementSettings::setLidClosedAcAction(int lidClosedAcAction)
|
||||||
@ -151,7 +151,7 @@ void PowerManagementSettings::setLidClosedAcAction(int lidClosedAcAction)
|
|||||||
|
|
||||||
int PowerManagementSettings::getLidClosedAction()
|
int PowerManagementSettings::getLidClosedAction()
|
||||||
{
|
{
|
||||||
return value(LID_CLOSED_ACTION_KEY, 0).toInt();
|
return value(LID_CLOSED_ACTION_KEY, -1).toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PowerManagementSettings::setLidClosedAction(int lidClosedAction)
|
void PowerManagementSettings::setLidClosedAction(int lidClosedAction)
|
||||||
@ -161,7 +161,7 @@ void PowerManagementSettings::setLidClosedAction(int lidClosedAction)
|
|||||||
|
|
||||||
int PowerManagementSettings::getLidClosedExtMonAcAction()
|
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)
|
void PowerManagementSettings::setLidClosedExtMonAcAction(int lidClosedExtMonAcAction)
|
||||||
@ -171,7 +171,7 @@ void PowerManagementSettings::setLidClosedExtMonAcAction(int lidClosedExtMonAcAc
|
|||||||
|
|
||||||
int PowerManagementSettings::getLidClosedExtMonAction()
|
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)
|
void PowerManagementSettings::setLidClosedExtMonAction(int lidClosedExtMonAction)
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
Name[da]=Strømstyring
|
Name[da]=Strømstyring
|
||||||
GenericName[da]=Indstillinger for 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
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
# Translations
|
# Translations
|
||||||
GenericName[hu]=LXQt energiakezelés beállítása
|
|
||||||
Name[hu]=Energiakezelés
|
Name[hu]=Energiakezelés
|
||||||
|
GenericName[hu]=LXQt energiakezelés beállítása
|
||||||
|
Comment[hu]=LXQt energiakezelés beállítása
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
Name[it]=Gestore energia
|
Name[it]=Gestore energia
|
||||||
GenericName[it]=Impostazioni del risparmio energetico
|
GenericName[it]=Impostazioni del risparmio energetico
|
||||||
|
Comment[it]=Diverse impostazioni per il risparmio energetico
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
# Translations
|
# Translations
|
||||||
GenericName[ja]=電源管理の設定
|
|
||||||
Name[ja]=電源管理
|
Name[ja]=電源管理
|
||||||
|
GenericName[ja]=電源管理の設定
|
||||||
#TRANSLATIONS_DIR=translations
|
Comment[ja]=電源管理の設定
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
Name[lt]=Maitinimo valdymas
|
||||||
|
GenericName[lt]=Maitinimo valdymo nustatymai
|
||||||
|
Comment[lt]=Įvairūs su maitinimo valdymu susiję nustatymai
|
@ -0,0 +1,3 @@
|
|||||||
|
Name[pl]=Zarządzanie energią
|
||||||
|
GenericName[pl]=Konfiguracja zarządzania energią
|
||||||
|
Comment[pl]=Konfiguracja zarządzania energią
|
@ -1,2 +0,0 @@
|
|||||||
Name[pl_PL]=Zarządzanie energią
|
|
||||||
GenericName[pl_PL]=Konfiguracja zarządzania energią
|
|
@ -1,2 +1,3 @@
|
|||||||
Name[pt]=Gestão de energia
|
Name[pt]=Gestão de energia
|
||||||
GenericName[pt]=Definições do gestor de energia
|
GenericName[pt]=Definições do gestor de energia
|
||||||
|
Comment[pt]=Definições do gestor de energia
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
# Translations
|
# Translations
|
||||||
|
Name[ru]=Управление энергопотреблением
|
||||||
GenericName[ru]=Настройки управления энергопотреблением
|
GenericName[ru]=Настройки управления энергопотреблением
|
||||||
Name[ru]=Управление энергопотреблением
|
Comment[ru]=Настройки управления энергопотреблением
|
||||||
|
@ -44,18 +44,18 @@ BatteryWatcher::BatteryWatcher(QObject *parent) : Watcher(parent)
|
|||||||
|
|
||||||
if (devices.isEmpty())
|
if (devices.isEmpty())
|
||||||
{
|
{
|
||||||
LXQt::Notification::notify(tr("No battery!"),
|
LXQt::Notification::notify(tr("No battery!"),
|
||||||
tr("LXQt could not find data about any battery - monitoring disabled"),
|
tr("LXQt could not find data about any battery - monitoring disabled"),
|
||||||
"lxqt-powermanagement");
|
"lxqt-powermanagement");
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (Solid::Device device, devices)
|
foreach (Solid::Device device, devices)
|
||||||
{
|
{
|
||||||
Solid::Battery *battery = device.as<Solid::Battery>();
|
Solid::Battery *battery = device.as<Solid::Battery>();
|
||||||
if (battery->type() != Solid::Battery::PrimaryBattery)
|
if (battery->type() != Solid::Battery::PrimaryBattery)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
mBatteries << battery;
|
mBatteries << battery;
|
||||||
connect(battery, &Solid::Battery::energyChanged, this, &BatteryWatcher::batteryChanged);
|
connect(battery, &Solid::Battery::energyChanged, this, &BatteryWatcher::batteryChanged);
|
||||||
connect(battery, &Solid::Battery::chargeStateChanged, this, &BatteryWatcher::batteryChanged);
|
connect(battery, &Solid::Battery::chargeStateChanged, this, &BatteryWatcher::batteryChanged);
|
||||||
|
11
src/main.cpp
11
src/main.cpp
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include <QDBusConnection>
|
#include <QDBusConnection>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QCommandLineParser>
|
||||||
|
|
||||||
#include <LXQt/Application>
|
#include <LXQt/Application>
|
||||||
|
|
||||||
@ -36,6 +37,16 @@ int main(int argc, char *argv[])
|
|||||||
LXQt::Application a(argc, argv);
|
LXQt::Application a(argc, argv);
|
||||||
a.setQuitOnLastWindowClosed(false);
|
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
|
// 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.
|
// if not able to do so.
|
||||||
// We do not register any object as we don't have any dbus-operations to expose.
|
// We do not register any object as we don't have any dbus-operations to expose.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user