Cherry-picking upstream version 0.12.0.

ubuntu/cosmic
Alf Gaida 7 years ago
parent a65e8a4d49
commit fd201e3745

@ -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.

@ -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.

@ -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)

@ -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
)

@ -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

@ -0,0 +1,2 @@
# Translations
Name[da]=Strømstyring

@ -0,0 +1,2 @@
#TRANSLATIONS
Name[de]=LXQt-Energieverwaltung

@ -0,0 +1 @@
Name[el]=Διαχείριση ενέργειας

@ -0,0 +1,2 @@
#TRANSLATIONS
Name[it]=Gestore energia

@ -0,0 +1,2 @@
#TRANSLATIONS
Name[pt]=Gestor de energia do LXQt

@ -27,11 +27,24 @@
#include <LXQt/SingleApplication>
#include <QCommandLineParser>
#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"));

@ -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)

@ -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

@ -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

@ -1,2 +1,3 @@
Name[it]=Gestore energia
GenericName[it]=Impostazioni del risparmio energetico
Comment[it]=Diverse impostazioni per il risparmio energetico

@ -1,5 +1,4 @@
# Translations
GenericName[ja]=電源管理の設定
Name[ja]=電源管理
#TRANSLATIONS_DIR=translations
GenericName[ja]=電源管理の設定
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
GenericName[pt]=Definições do gestor de energia
Comment[pt]=Definições do gestor de energia

@ -1,3 +1,4 @@
# Translations
Name[ru]=Управление энергопотреблением
GenericName[ru]=Настройки управления энергопотреблением
Name[ru]=Управление энергопотреблением
Comment[ru]=Настройки управления энергопотреблением

@ -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<Solid::Battery>();
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);

@ -25,6 +25,7 @@
#include <QDBusConnection>
#include <QDebug>
#include <QCommandLineParser>
#include <LXQt/Application>
@ -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.

Loading…
Cancel
Save