Compare commits

...

35 Commits

Author SHA1 Message Date
ae4e7deddd create pkgbuild for the last stable archive in 2.4.0 branch 2015-09-09 06:57:49 +03:00
be26033ff7 edit log format line 2015-09-04 00:18:46 +03:00
70020d0aef Merge branch 'master' of github.com:arcan1s/awesome-widgets 2015-09-03 00:31:07 +03:00
7218defe19 add '$this' feature to lambda functions
fix large size on startup
fix invalid key parsing
2015-09-03 00:30:10 +03:00
200ecc7196 translation update 2015-09-02 00:19:28 +03:00
6689bea9a7 implement dynamic tags 2015-09-02 00:05:11 +03:00
5940ec4531 update awdebug 2015-09-01 01:45:25 +03:00
2716f77eb2 revert 2015-09-01 01:40:48 +03:00
cfdcaae036 drop script from deps 2015-09-01 01:40:15 +03:00
82c1839634 drop hidding method 2015-09-01 01:12:10 +03:00
08dae3b02b small patch to avoid notifications on nan 2015-08-31 01:43:39 +03:00
cc2b1b7b8a add images feature to extweather (apiver == 2) 2015-08-31 00:16:04 +03:00
4c27382467 more correct logging, use qt logging for qml as well 2015-08-30 16:24:00 +03:00
aacb50c946 start moving to qt5 style logging 2015-08-29 00:58:39 +03:00
466faf53fa some refactoring, prepare to moving to qt5 style logging 2015-08-28 00:15:25 +03:00
8228d1d06b Add filter feature to ExtUpgrade (ApiVer = 3) 2015-08-26 00:24:55 +03:00
37726370ee Add additional column to configuraion ui to better tag selection 2015-08-25 00:07:23 +03:00
07305d7578 no kf5 on ubuntu 12.04 2015-08-23 02:26:12 +03:00
b97c821c8f try to upgrade ubuntu first 2015-08-23 02:16:22 +03:00
b50c1d2363 add ability to do not translate strings 2015-08-23 02:14:55 +03:00
713aa611d9 drop travis since it uses ubuntu-12.04 2015-08-22 23:11:09 +03:00
319755179f #2 2015-08-22 22:30:52 +03:00
9509d87962 try to get it working 2015-08-22 22:27:27 +03:00
6d58a3f05c add repo 2015-08-22 14:59:44 +03:00
2cca290630 try add travis-ci 2015-08-22 14:55:50 +03:00
29b75e2b12 update additional files
update translations
add "Add lambda" button to ui
2015-08-22 00:40:14 +03:00
835eb00f0d add lambda support 2015-08-21 00:05:15 +03:00
a5e9b32b28 implement support of network speed units tags
fix warning for empty tooltip image
2015-08-18 01:17:51 +03:00
fbdc9112aa update archive generator 2015-08-16 15:48:43 +03:00
b3fc0501ba unify build, allow cross build 2015-08-16 03:24:44 +03:00
a74c65a2a3 fix typo 2015-08-16 02:41:26 +03:00
4858c9dbcd add rpm recipe 2015-08-16 02:38:24 +03:00
3601b4246d add build requirements for deb packages 2015-08-16 01:54:49 +03:00
241e13ffd8 add experimental debian build 2015-08-16 01:22:28 +03:00
7a5d2d5dd4 add forgoten line to CHANGELOG
drop default active script
2015-08-11 00:05:23 +03:00
98 changed files with 3192 additions and 2923 deletions

3
.gitmodules vendored
View File

@ -1,6 +1,3 @@
[submodule "sources/3rdparty/pdebug"]
path = sources/3rdparty/pdebug
url = https://github.com/arcan1s/qtadds-pdebug.git
[submodule "sources/3rdparty/task"]
path = sources/3rdparty/task
url = https://github.com/arcan1s/qtadds-taskadds-qprocess.git

11
.travis.yml.bckp Normal file
View File

@ -0,0 +1,11 @@
install:
- sudo apt-get update -qq
- sudo apt-get install -y cmake extra-cmake-modules g++ git libkf5i18n-dev libkf5notifications-dev libkf5service-dev libkf5windowsystem-dev plasma-framework-dev qtbase5-dev qtdeclarative5-dev
- git submobule update --init
- rm -rf build
- mkdir build
script:
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DKDE_INSTALL_USE_QT_SYS_PATHS=ON ../sources
- make

View File

@ -1,3 +1,6 @@
+ add tags upunits, downunits
- fix warning for empty tooltip image
Ver.2.4.0:
+ add support of weather items
+ add support of load average (la1, la5, la15 tags)
@ -8,6 +11,7 @@ Ver.2.4.0:
+ add ability to disable player monitor
- fix bug with invalid network data calculation
- fix warning with fond dialog init
- fix bug with no object deletions (#60)
* rewrite ExtItems to use own abstract class
* improve work with data updating (#57)
* move to signal-slot interface painting

View File

@ -8,6 +8,7 @@
+ добавлена возможность отключить монитор плеера
- исправлен баг с неправильным расчетам скорости сети
- исправлен баг с неправильной инициализацией диалога шрифтов
- исправлен баг с отсутствием удаления объектов (#60)
* переписаны ExtItems для использования собственного абстрактного класса
* улучшена работа с обновлениями виджета (#57)
* рисование интерфейса переписано на модель сигнал-слот

View File

@ -1,40 +0,0 @@
# Maintainer: Evgeniy Alekseev <arcanis at archlinux dot org>
pkgname=plasma5-applet-awesome-widgets
_pkgname=awesome-widgets
pkgver=2.4.0
pkgrel=1
pkgdesc="Collection of minimalistic Plasmoids which look like Awesome WM widgets (ex-PyTextMonitor)"
arch=('i686' 'x86_64')
url="http://arcanis.name/projects/awesome-widgets"
license=('GPL3')
depends=('plasma-framework')
optdepends=("catalyst: for GPU monitor"
"hddtemp: for HDD temperature monitor"
"smartmontools: for HDD temperature monitor"
"mpd: for music player monitor"
"nvidia-utils: for GPU monitor")
makedepends=('cmake' 'extra-cmake-modules')
source=(https://github.com/arcan1s/awesome-widgets/releases/download/V.${pkgver}/${_pkgname}-${pkgver}-src.tar.xz)
install=${pkgname}.install
md5sums=('9b870da6ecefef584f11b6ba6bf9a397')
backup=('etc/xdg/plasma-dataengine-extsysmon.conf')
prepare() {
rm -rf "${srcdir}/build"
mkdir "${srcdir}/build"
}
build () {
cd "${srcdir}/build"
cmake -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
"../${_pkgname}"
make
}
package() {
cd "${srcdir}/build"
make DESTDIR="${pkgdir}" install
}

View File

@ -1,9 +1,9 @@
#!/bin/bash
SRCDIR="sources"
MAJOR=$(grep -m1 PROJECT_VERSION_MAJOR sources/CMakeLists.txt | awk '{print $2}' | sed 's/.$//g')
MINOR=$(grep -m1 PROJECT_VERSION_MINOR sources/CMakeLists.txt | awk '{print $2}' | sed 's/.$//g')
PATCH=$(grep -m1 PROJECT_VERSION_PATCH sources/CMakeLists.txt | awk '{print $2}' | sed 's/.$//g')
MAJOR=$(grep -m1 PROJECT_VERSION_MAJOR sources/CMakeLists.txt | awk '{print $2}' | sed 's/^.\(.*\)..$/\1/')
MINOR=$(grep -m1 PROJECT_VERSION_MINOR sources/CMakeLists.txt | awk '{print $2}' | sed 's/^.\(.*\)..$/\1/')
PATCH=$(grep -m1 PROJECT_VERSION_PATCH sources/CMakeLists.txt | awk '{print $2}' | sed 's/^.\(.*\)..$/\1/')
VERSION="${MAJOR}.${MINOR}.${PATCH}"
# update submodules
@ -20,13 +20,13 @@ cp -r "${SRCDIR}" "${ARCHIVE}"
for FILE in ${FILES[*]}; do cp -r "$FILE" "${ARCHIVE}"; done
for FILE in ${IGNORELIST[*]}; do rm -rf "${ARCHIVE}/${FILE}"; done
tar cJf "${ARCHIVE}-${VERSION}-src.tar.xz" "${ARCHIVE}"
ln -sf "../${ARCHIVE}-${VERSION}-src.tar.xz" arch
ln -sf "../${ARCHIVE}-${VERSION}-src.tar.xz" packages
rm -rf "${ARCHIVE}"
# update md5sum
MD5SUMS=$(md5sum ${ARCHIVE}-${VERSION}-src.tar.xz | awk '{print $1}')
sed -i "/md5sums=('[0-9A-Fa-f]*/s/[^'][^)]*/md5sums=('${MD5SUMS}'/" arch/PKGBUILD
sed -i "s/pkgver=[0-9.]*/pkgver=${VERSION}/" arch/PKGBUILD
sed -i "/md5sums=('[0-9A-Fa-f]*/s/[^'][^)]*/md5sums=('${MD5SUMS}'/" packages/PKGBUILD
sed -i "s/pkgver=[0-9.]*/pkgver=${VERSION}/" packages/PKGBUILD
# clear
find . -type f -name '*src.tar.xz' -not -name "*${VERSION}-src.tar.xz" -exec rm -rf {} \;
find arch -type l -xtype l -exec rm -rf {} \;
find packages -type l -xtype l -exec rm -rf {} \;

View File

@ -2,7 +2,7 @@
pkgname=plasma5-applet-awesome-widgets
_pkgname=awesome-widgets
pkgver=2.2.1.r15.g78931b3
pkgver=2.4.0.r34.gbe26033
pkgrel=1
pkgdesc="Collection of minimalistic Plasmoids which look like Awesome WM widgets (ex-PyTextMonitor). Git version"
arch=('i686' 'x86_64')
@ -18,7 +18,7 @@ optdepends=("amarok: for music player monitor"
"nvidia-utils: for GPU monitor"
"qmmp: for music player monitor")
makedepends=('cmake' 'extra-cmake-modules' 'git')
source=(${_pkgname}::git+https://github.com/arcan1s/awesome-widgets/)
source=(${_pkgname}::git+https://github.com/arcan1s/awesome-widgets.git#branch=release-2.4.0)
install=${pkgname}.install
md5sums=('SKIP')
backup=('etc/xdg/plasma-dataengine-extsysmon.conf')

View File

@ -0,0 +1,11 @@
cmake
extra-cmake-modules
g++
git
libkf5i18n-dev
libkf5notifications-dev
libkf5service-dev
libkf5windowsystem-dev
plasma-framework-dev
qtbase5-dev
qtdeclarative5-dev

View File

View File

@ -8,7 +8,7 @@ ProjectRootRelative=./
[CMake][CMake Build Directory 0]
Build Directory Path=file:///home/arcanis/Documents/github/awesome-widgets/build
Build Type=Debug
Build Type=Release
CMake Binary=file:///usr/bin/cmake
Environment Profile=
Extra Arguments=
@ -19,5 +19,8 @@ Name=GCC
Path=gcc
Type=GCC
[Launch]
Launch Configurations=
[Project]
VersionControlSupport=kdevgit

Submodule sources/3rdparty/pdebug deleted from 75e4a0df83

View File

@ -13,10 +13,10 @@ project(awesomewidgets)
set(PROJECT_AUTHOR "Evgeniy Alekseev")
set(PROJECT_CONTACT "esalexeev@gmail.com")
set(PROJECT_LICENSE "GPL3")
set(PROJECT_VERSION_MAJOR 2)
set(PROJECT_VERSION_MINOR 4)
set(PROJECT_VERSION_PATCH 0)
set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
set(PROJECT_VERSION_MAJOR "2")
set(PROJECT_VERSION_MINOR "4")
set(PROJECT_VERSION_PATCH "0")
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
string(TIMESTAMP CURRENT_DATE "%Y-%m-%d %H:%M" UTC)
string(TIMESTAMP CURRENT_YEAR "%Y")
@ -26,6 +26,8 @@ message(STATUS "Version: ${PROJECT_VERSION}")
message(STATUS "Build date: ${CURRENT_DATE}")
option(BUILD_PLASMOIDS "Build plasmoids" ON)
option(BUILD_DEB_PACKAGE "Build deb package" OFF)
option(BUILD_RPM_PACKAGE "Build rpm package" OFF)
# flags
if(CMAKE_COMPILER_IS_GNUCXX)
@ -61,3 +63,5 @@ if(BUILD_PLASMOIDS)
add_subdirectory(desktop-panel)
add_subdirectory(translations)
endif()
include(packages-recipe.cmake)

25
sources/awdebug.cpp Normal file
View File

@ -0,0 +1,25 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "awdebug.h"
Q_LOGGING_CATEGORY(LOG_AW, "org.kde.plasma.awesomewidget", QtMsgType::QtWarningMsg)
Q_LOGGING_CATEGORY(LOG_DP, "org.kde.plasma.desktoppanel", QtMsgType::QtWarningMsg)
Q_LOGGING_CATEGORY(LOG_ESM, "org.kde.plasma.extsysmon", QtMsgType::QtWarningMsg)
Q_LOGGING_CATEGORY(LOG_LIB, "org.kde.plasma.awesomewidgets", QtMsgType::QtWarningMsg)

45
sources/awdebug.h Normal file
View File

@ -0,0 +1,45 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef AWDEBUG_H
#define AWDEBUG_H
#include <QLoggingCategory>
#ifndef LOG_FORMAT
#define LOG_FORMAT "[%{time yyyy-MM-ddTHH:mm:ss.zzz}][%{if-debug}DD%{endif}%{if-info}II%{endif}%{if-warning}WW%{endif}%{if-critical}CC%{endif}%{if-fatal}FF%{endif}][%{category}][%{function}] %{message}"
#endif /* LOG_FORMAT */
// define info log level
// #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
// #ifndef qCInfo
// redefine info because it doesn't log properly
#ifdef qCInfo
#undef qCInfo
#endif /* qCInfo */
#define qCInfo qCDebug
// #endif /* QT_VERSION */
Q_DECLARE_LOGGING_CATEGORY(LOG_AW)
Q_DECLARE_LOGGING_CATEGORY(LOG_DP)
Q_DECLARE_LOGGING_CATEGORY(LOG_ESM)
Q_DECLARE_LOGGING_CATEGORY(LOG_LIB)
#endif /* AWDEBUG_H */

View File

@ -47,6 +47,9 @@
<entry name="checkUpdates" type="bool">
<default>true</default>
</entry>
<entry name="translateStrings" type="bool">
<default>true</default>
</entry>
</group>
<group name="Tooltip">

View File

@ -110,6 +110,6 @@ Item {
}
Component.onCompleted: {
if (debug) console.log("[about::onCompleted]")
if (debug) console.debug()
}
}

View File

@ -45,6 +45,8 @@ Item {
property string cfg_tempUnits: tempUnits.currentText
property alias cfg_acOnline: acOnline.text
property alias cfg_acOffline: acOffline.text
property alias cfg_checkUpdates: updates.checked
property alias cfg_translateStrings: translate.checked
Column {
@ -212,8 +214,10 @@ Item {
]
onCurrentIndexChanged: cfg_tempUnits = model[currentIndex]["name"]
Component.onCompleted: {
if (debug) console.debug()
for (var i = 0; i < model.length; i++) {
if (model[i]["name"] == plasmoid.configuration.tempUnits) {
if (debug) console.info("Found", model[i]["name"], "on", i)
tempUnits.currentIndex = i;
}
}
@ -255,6 +259,34 @@ Item {
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.heigth
width: parent.width * 2 / 5
}
QtControls.CheckBox {
id: updates
width: parent.width * 3 / 5
text: i18n("Check updates on startup")
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.heigth
width: parent.width * 2 / 5
}
QtControls.CheckBox {
id: translate
width: parent.width * 3 / 5
text: i18n("Translate strings")
}
}
Row {
height: implicitHeight
width: parent.width
@ -272,6 +304,6 @@ Item {
}
Component.onCompleted: {
if (debug) console.log("[advanced::onCompleted]")
if (debug) console.debug()
}
}

View File

@ -90,6 +90,7 @@ Item {
width: parent.width * 2 / 3
text: plasmoid.configuration.fontFamily
onClicked: {
if (debug) console.debug()
fontDialog.setFont()
fontDialog.visible = true
}
@ -154,8 +155,10 @@ Item {
]
onCurrentIndexChanged: cfg_fontWeight = model[currentIndex]["name"]
Component.onCompleted: {
if (debug) console.debug()
for (var i = 0; i < model.length; i++) {
if (model[i]["name"] == plasmoid.configuration.fontWeight) {
if (debug) console.info("Found", model[i]["name"], "on", i)
fontWeight.currentIndex = i;
}
}
@ -189,8 +192,10 @@ Item {
]
onCurrentIndexChanged: cfg_fontStyle = model[currentIndex]["name"]
Component.onCompleted: {
if (debug) console.debug()
for (var i = 0; i < model.length; i++) {
if (model[i]["name"] == plasmoid.configuration.fontStyle) {
if (debug) console.info("Found", model[i]["name"], "on", i)
fontStyle.currentIndex = i;
}
}
@ -235,12 +240,14 @@ Item {
signal setFont
onAccepted: {
if (debug) console.debug()
selectFont.text = fontDialog.font.family
fontSize.value = fontDialog.font.pointSize
fontStyle.currentIndex = fontDialog.font.italic ? 1 : 0
fontWeight.currentIndex = weight[fontDialog.font.weight]
}
onSetFont: {
if (debug) console.debug()
fontDialog.font = Qt.font({
family: selectFont.text,
pointSize: fontSize.value > 0 ? fontSize.value : 12,
@ -251,6 +258,6 @@ Item {
}
Component.onCompleted: {
if (debug) console.log("[appearance::onCompleted]")
if (debug) console.debug()
}
}

View File

@ -40,26 +40,6 @@ Item {
implicitHeight: pageColumn.implicitHeight
property bool debug: awActions.isDebugEnabled()
property variant tooltipSettings: {
"tooltipNumber": plasmoid.configuration.tooltipNumber,
"useTooltipBackground": plasmoid.configuration.useTooltipBackground,
"tooltipBackgroung": plasmoid.configuration.tooltipBackgroung,
"cpuTooltip": plasmoid.configuration.cpuTooltip,
"cpuclTooltip": plasmoid.configuration.cpuclTooltip,
"memTooltip": plasmoid.configuration.memTooltip,
"swapTooltip": plasmoid.configuration.swapTooltip,
"downTooltip": plasmoid.configuration.downTooltip,
"upTooltip": plasmoid.configuration.downTooltip,
"batTooltip": plasmoid.configuration.batTooltip,
"cpuTooltipColor": plasmoid.configuration.cpuTooltipColor,
"cpuclTooltipColor": plasmoid.configuration.cpuclTooltipColor,
"memTooltipColor": plasmoid.configuration.memTooltipColor,
"swapTooltipColor": plasmoid.configuration.swapTooltipColor,
"downTooltipColor": plasmoid.configuration.downTooltipColor,
"upTooltipColor": plasmoid.configuration.upTooltipColor,
"batTooltipColor": plasmoid.configuration.batTooltipColor,
"batInTooltipColor": plasmoid.configuration.batInTooltipColor
}
property variant cfg_dataengine: awActions.readDataEngineConfiguration()
@ -79,23 +59,7 @@ Item {
QtControls.TextField {
width: parent.width * 3 / 5
text: cfg_dataengine["ACPIPATH"]
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Custom scripts")
}
QtControls.Button {
width: parent.width * 3 / 5
text: i18n("Edit scripts")
onClicked: awKeys.editItem("extscript")
onEditingFinished: cfg_dataengine["ACPIPATH"] = text
}
}
@ -114,8 +78,10 @@ Item {
width: parent.width * 3 / 5
model: ["auto", "disable", "ati", "nvidia"]
Component.onCompleted: {
if (debug) console.debug()
for (var i=0; i<model.length; i++) {
if (model[i] == cfg_dataengine["GPUDEV"]) {
if (debug) console.info("Found", model[i], "on", i)
currentIndex = i;
}
}
@ -138,8 +104,10 @@ Item {
width: parent.width * 3 / 5
model: awKeys.getHddDevices(true)
Component.onCompleted: {
if (debug) console.debug()
for (var i=0; i<model.length; i++) {
if (model[i] == cfg_dataengine["HDDDEV"]) {
if (debug) console.info("Found", model[i], "on", i)
hdd.currentIndex = i;
}
}
@ -160,6 +128,7 @@ Item {
QtControls.TextField {
width: parent.width * 3 / 5
text: cfg_dataengine["HDDTEMPCMD"]
onEditingFinished: cfg_dataengine["HDDTEMPCMD"] = text
}
}
@ -176,6 +145,7 @@ Item {
QtControls.TextField {
width: parent.width * 3 / 5
text: cfg_dataengine["MPDADDRESS"]
onEditingFinished: cfg_dataengine["MPDADDRESS"] = text
}
}
@ -195,6 +165,7 @@ Item {
maximumValue: 65535
stepSize: 1
value: cfg_dataengine["MPDPORT"]
onEditingFinished: cfg_dataengine["MPDPORT"] = value
}
}
@ -233,8 +204,10 @@ Item {
width: parent.width * 3 / 5
model: ["disable", "mpris", "mpd"]
Component.onCompleted: {
if (debug) console.debug()
for (var i=0; i<model.length; i++) {
if (model[i] == cfg_dataengine["PLAYER"]) {
if (debug) console.info("Found", model[i], "on", i)
player.currentIndex = i;
}
}
@ -242,6 +215,43 @@ Item {
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Player data symbols")
}
QtControls.SpinBox {
width: parent.width * 3 / 5
minimumValue: 1
maximumValue: 100
stepSize: 1
value: cfg_dataengine["PLAYERSYMBOLS"]
onEditingFinished: cfg_dataengine["PLAYERSYMBOLS"] = value
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Custom scripts")
}
QtControls.Button {
width: parent.width * 3 / 5
text: i18n("Edit scripts")
onClicked: awKeys.editItem("extscript")
}
}
Row {
height: implicitHeight
width: parent.width
@ -295,14 +305,14 @@ Item {
}
Component.onCompleted: {
if (debug) console.log("[dataengine::onCompleted]")
if (debug) console.debug()
// init submodule
awKeys.initKeys(plasmoid.configuration.text)
}
Component.onDestruction: {
if (debug) console.log("[dataengine::onDestruction]")
if (debug) console.debug()
cfg_dataengine["GPUDEV"] = gpuDev.currentText
cfg_dataengine["HDDDEV"] = hdd.currentText

View File

@ -92,14 +92,14 @@ Item {
interval: plasmoid.configuration.interval
onNewData: {
if (debug) console.log("[main::onNewData] : Update source " + sourceName)
if (debug) console.debug("Update source", sourceName)
systemmonitorDE.interval = plasmoid.configuration.interval
awKeys.setDataBySource(sourceName, data, settings)
}
onSourceAdded: {
if (debug) console.log("[main::onSourceAdded] : Source " + source)
if (debug) console.debug("Source", source)
awKeys.addDevice(source)
}
@ -112,7 +112,7 @@ Item {
interval: plasmoid.configuration.interval
onNewData: {
if (debug) console.log("[main::onNewData] : Update source " + sourceName)
if (debug) console.debug("Update source", sourceName)
extsysmonDE.interval = plasmoid.configuration.interval
awKeys.setDataBySource(sourceName, data, settings)
@ -126,7 +126,7 @@ Item {
interval: 1000
onNewData: {
if (debug) console.log("[main::onNewData] : Update source " + sourceName)
if (debug) console.debug("Update source", sourceName)
awKeys.setDataBySource(sourceName, data, settings)
}
@ -150,8 +150,6 @@ Item {
font.pointSize: plasmoid.configuration.fontSize
font.weight: general.fontWeight[plasmoid.configuration.fontWeight]
text: plasmoid.configuration.text
PlasmaCore.ToolTipArea {
height: tooltip.height
width: tooltip.width
@ -165,7 +163,7 @@ Item {
}
Component.onCompleted: {
if (debug) console.log("[main::onCompleted]")
if (debug) console.debug()
// actions
plasmoid.setAction("requestKey", i18n("Request key"), "utilities-system-monitor")
@ -178,40 +176,44 @@ Item {
awKeys.dropSourceFromDataengine.connect(dropSource)
awKeys.needTextToBeUpdated.connect(needTextUpdate)
awKeys.needToolTipToBeUpdated.connect(needToolTipUpdate)
// check updates if required
if (plasmoid.configuration.checkUpdates) return action_checkUpdates()
}
onDropSource: {
if (debug) console.log("[main::onDropSource]")
if (debug) console.log("[main::onDropSource] : Source " + sourceName)
if (debug) console.debug()
if (debug) console.debug("Source", sourceName)
systemmonitorDE.disconnectSource(sourceName)
}
onNeedTextUpdate: {
if (debug) console.log("[main::onNeedTextUpdate]")
if (debug) console.debug()
text.text = newText
sizeUpdate()
}
onNeedToolTipUpdate: {
if (debug) console.log("[main::onNeedToolTipUpdate]")
if (debug) console.debug()
tooltip.text = newText
}
onSizeUpdate: {
if (debug) console.log("[main::onSizeUpdate]")
if (debug) console.debug()
// 16 is a magic number
// in other case plasmoid will increase own size on each update
if (plasmoid.configuration.height == 0) {
Layout.minimumHeight = text.contentHeight
Layout.minimumHeight = text.contentHeight - 16
Layout.maximumHeight = -1
} else {
Layout.minimumHeight = plasmoid.configuration.height
Layout.maximumHeight = plasmoid.configuration.height
}
if (plasmoid.configuration.width == 0) {
Layout.minimumWidth = text.contentWidth
Layout.minimumWidth = text.contentWidth - 16
Layout.maximumWidth = -1
} else {
Layout.minimumWidth = plasmoid.configuration.width
@ -221,38 +223,37 @@ Item {
Plasmoid.onUserConfiguringChanged: {
if (plasmoid.userConfiguring) return
if (debug) console.log("[main::onUserConfiguringChanged]")
if (debug) console.debug()
// init submodule
awKeys.initKeys(plasmoid.configuration.text)
awKeys.initTooltip(tooltipSettings)
awKeys.setPopupEnabled(plasmoid.configuration.notify)
awKeys.setTranslateStrings(plasmoid.configuration.translateStrings)
awKeys.setWrapNewLines(plasmoid.configuration.wrapNewLines)
needTextUpdate(plasmoid.configuration.text)
}
function action_checkUpdates() {
if (debug) console.log("[main::action_checkUpdates]")
if (debug) console.debug()
awActions.checkUpdates()
return awActions.checkUpdates()
}
function action_showReadme() {
if (debug) console.log("[main::action_showReadme]")
if (debug) console.debug()
awActions.showReadme()
return awActions.showReadme()
}
function action_report() {
if (debug) console.log("[main::action_report]")
if (debug) console.debug()
awActions.sendEmail()
return awActions.sendEmail()
}
function action_requestKey() {
if (debug) console.log("[main::action_requestKey]")
if (debug) console.debug()
awKeys.graphicalValueByKey()
return awKeys.graphicalValueByKey()
}
}

View File

@ -1 +1 @@
singleton general general.qml
singleton general 1.0 general.qml

View File

@ -513,6 +513,6 @@ Item {
}
Component.onCompleted: {
if (debug) console.log("[tooltip::onCompleted]")
if (debug) console.debug()
}
}

View File

@ -90,8 +90,7 @@ Item {
iconName: "font"
onClicked: {
if (debug) console.log("[widget::onClicked] : Font button")
if (debug) console.debug("Font button")
var defaultFont = {
"color": plasmoid.configuration.fontColor,
"family": plasmoid.configuration.fontFamily,
@ -112,8 +111,7 @@ Item {
iconName: "format-indent-more"
onClicked: {
if (debug) console.log("[widget::onClicked] : Indent button")
if (debug) console.debug("Indent button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -126,8 +124,7 @@ Item {
iconName: "format-text-bold"
onClicked: {
if (debug) console.log("[widget::onClicked] : Bold button")
if (debug) console.debug("Bold button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -139,8 +136,7 @@ Item {
iconName: "format-text-italic"
onClicked: {
if (debug) console.log("[widget::onClicked] : Italic button")
if (debug) console.debug("Italic button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -152,8 +148,7 @@ Item {
iconName: "format-text-underline"
onClicked: {
if (debug) console.log("[widget::onClicked] : Underline button")
if (debug) console.debug("Underline button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -165,8 +160,7 @@ Item {
iconName: "format-text-strikethrough"
onClicked: {
if (debug) console.log("[widget::onClicked] : Strike button")
if (debug) console.debug("Strike button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -179,8 +173,7 @@ Item {
iconName: "format-justify-left"
onClicked: {
if (debug) console.log("[widget::onClicked] : Left button")
if (debug) console.debug("Left button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -192,8 +185,7 @@ Item {
iconName: "format-justify-center"
onClicked: {
if (debug) console.log("[widget::onClicked] : Center button")
if (debug) console.debug("Center button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -205,8 +197,7 @@ Item {
iconName: "format-justify-right"
onClicked: {
if (debug) console.log("[widget::onClicked] : Right button")
if (debug) console.debug("Right button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -218,8 +209,7 @@ Item {
iconName: "format-justify-fill"
onClicked: {
if (debug) console.log("[widget::onClicked] : Justify button")
if (debug) console.debug("Justify button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -231,17 +221,81 @@ Item {
Row {
height: implicitHeight
width: parent.width
QtControls.ComboBox {
width: (parent.width - addTagButton.width - showValueButton.width - addLambdaButton.width) / 2
textRole: "label"
model: [
{
'label': i18n("AC"),
'regexp': "^(ac|bat).*"
},
{
'label': i18n("Bars"),
'regexp': "^bar.*"
},
{
'label': i18n("CPU"),
'regexp': "^(cpu|gpu|la|ps|temp(?!erature)).*"
},
{
'label': i18n("Desktops"),
'regexp': "^(n|t)?desktop(s)?"
},
{
'label': i18n("HDD"),
'regexp': "^hdd.*"
},
{
'label': i18n("Memory"),
'regexp': "^(mem|swap).*"
},
{
'label': i18n("Network"),
'regexp': "^(netdev|(down|up(?!time)).*)"
},
{
'label': i18n("Music player"),
'regexp': "(^|d|s)(album|artist|duration|progress|title)"
},
{
'label': i18n("Scripts"),
'regexp': "^custom.*"
},
{
'label': i18n("Time"),
'regexp': ".*time$"
},
{
'label': i18n("Quotes"),
'regexp': "^(perc)?(ask|bid|price)(chg)?.*"
},
{
'label': i18n("Upgrades"),
'regexp': "^pkgcount.*"
},
{
'label': i18n("Weathers"),
'regexp': "^(weather(Id)?|humidity|pressure|temperature|timestamp)"
}
]
onCurrentIndexChanged: {
if (debug) console.debug()
tags.model = awKeys.dictKeys(true, model[currentIndex]["regexp"])
if (debug) console.info("Init model", tags.model, "for", model[currentIndex]["label"])
tags.currentIndex = -1
}
}
QtControls.ComboBox {
id: tags
width: parent.width - addTagButton.width - showValueButton.width
width: (parent.width - addTagButton.width - showValueButton.width - addLambdaButton.width) / 2
}
QtControls.Button {
id: addTagButton
text: i18n("Add")
onClicked: {
if (debug) console.log("[widget::onClicked] : Add tag button")
if (!tags.currentText) return
if (debug) console.debug("Add tag button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -253,8 +307,8 @@ Item {
text: i18n("Show value")
onClicked: {
if (debug) console.log("[widget::onClicked] : Show tag button")
if (!tags.currentText) return
if (debug) console.debug("Show tag button")
var message = i18n("Tag: %1", tags.currentText)
message += "<br>"
message += i18n("Value: %1", awKeys.valueByKey(tags.currentText))
@ -263,6 +317,18 @@ Item {
awActions.sendNotification("tag", message)
}
}
QtControls.Button {
id: addLambdaButton
text: i18n("Add lambda")
onClicked: {
if (debug) console.debug("Lambda button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, selected + "${{\n\n}}")
}
}
}
Row {
@ -293,8 +359,7 @@ Item {
interval: 5000
onNewData: {
if (debug) console.log("[widget::onNewData] : Update source " + sourceName)
if (debug) console.debug("Update source", sourceName)
awKeys.setDataBySource(sourceName, data, settings)
}
}
@ -306,8 +371,7 @@ Item {
interval: 5000
onNewData: {
if (debug) console.log("[widget::onNewData] : Update source " + sourceName)
if (debug) console.debug("Update source", sourceName)
awKeys.setDataBySource(sourceName, data, settings)
}
}
@ -319,17 +383,15 @@ Item {
interval: 5000
onNewData: {
if (debug) console.log("[widget::onNewData] : Update source " + sourceName)
if (debug) console.debug("Update source", sourceName)
awKeys.setDataBySource(sourceName, data, settings)
}
}
Component.onCompleted: {
if (debug) console.log("[widget::onCompleted]")
if (debug) console.debug()
// init submodule
awKeys.initKeys(plasmoid.configuration.text)
tags.model = awKeys.dictKeys(true)
}
}

View File

@ -12,7 +12,7 @@ include_directories(
${Kf5_INCLUDE}
)
file(GLOB_RECURSE SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/fontdialog/*.cpp)
file(GLOB SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/fontdialog/*.cpp ${CMAKE_SOURCE_DIR}/*.cpp)
file(GLOB SUBPROJECT_UI *.ui)
file(GLOB SUBPROJECT_NOTIFY *.notifyrc)

View File

@ -20,7 +20,6 @@
#include <KI18n/KLocalizedString>
#include <KNotifications/KNotification>
#include <QDebug>
#include <QDesktopServices>
#include <QDir>
#include <QJsonDocument>
@ -35,32 +34,27 @@
#include <QStandardPaths>
#include <fontdialog/fontdialog.h>
#include <pdebug/pdebug.h>
#include "extscript.h"
#include "graphicalitem.h"
#include "awdebug.h"
#include "version.h"
AWActions::AWActions(QObject *parent)
: QObject(parent)
{
// debug
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
debug = (debugEnv == QString("yes"));
qCDebug(LOG_AW);
}
AWActions::~AWActions()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
}
void AWActions::checkUpdates()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(versionReplyRecieved(QNetworkReply *)));
@ -71,7 +65,7 @@ void AWActions::checkUpdates()
bool AWActions::dropCache() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
QString fileName = QString("%1/awesomewidgets.ndx")
.arg(QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation));
@ -82,16 +76,16 @@ bool AWActions::dropCache() const
bool AWActions::isDebugEnabled() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
return debug;
return LOG_AW().isDebugEnabled();
}
void AWActions::runCmd(const QString cmd) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Cmd" << cmd;
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Cmd" << cmd;
QProcess command;
sendNotification(QString("Info"), i18n("Run %1", cmd));
@ -102,13 +96,13 @@ void AWActions::runCmd(const QString cmd) const
void AWActions::sendEmail() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
}
void AWActions::showReadme() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
QDesktopServices::openUrl(QString(HOMEPAGE));
}
@ -116,8 +110,8 @@ void AWActions::showReadme() const
QString AWActions::getAboutText(const QString type) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Type" << type;
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Type" << type;
QString text;
if (type == QString("header"))
@ -155,7 +149,8 @@ QString AWActions::getAboutText(const QString type) const
QVariantMap AWActions::getFont(const QVariantMap defaultFont) const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Default font is" << defaultFont;
QVariantMap fontMap;
CFont defaultCFont = CFont(defaultFont[QString("family")].toString(),
@ -173,10 +168,10 @@ QVariantMap AWActions::getFont(const QVariantMap defaultFont) const
QVariantMap AWActions::readDataEngineConfiguration() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
QString fileName = QStandardPaths::locate(QStandardPaths::ConfigLocation, QString("plasma-dataengine-extsysmon.conf"));
if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << fileName;
qCInfo(LOG_AW) << "Configuration file" << fileName;
QSettings settings(fileName, QSettings::IniFormat);
QVariantMap configuration;
@ -189,6 +184,7 @@ QVariantMap AWActions::readDataEngineConfiguration() const
configuration[QString("MPDPORT")] = settings.value(QString("MPDPORT"), QString("6600"));
configuration[QString("MPRIS")] = settings.value(QString("MPRIS"), QString("auto"));
configuration[QString("PLAYER")] = settings.value(QString("PLAYER"), QString("mpris"));
configuration[QString("PLAYERSYMBOLS")] = settings.value(QString("PLAYERSYMBOLS"), QString("10"));
settings.endGroup();
return configuration;
@ -197,11 +193,11 @@ QVariantMap AWActions::readDataEngineConfiguration() const
void AWActions::writeDataEngineConfiguration(const QVariantMap configuration) const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
QString fileName = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QString("/plasma-dataengine-extsysmon.conf");
QSettings settings(fileName, QSettings::IniFormat);
if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << settings.fileName();
qCInfo(LOG_AW) << "Configuration file" << settings.fileName();
settings.beginGroup(QString("Configuration"));
settings.setValue(QString("ACPIPATH"), configuration[QString("ACPIPATH")]);
@ -212,6 +208,7 @@ void AWActions::writeDataEngineConfiguration(const QVariantMap configuration) co
settings.setValue(QString("MPDPORT"), configuration[QString("MPDPORT")]);
settings.setValue(QString("MPRIS"), configuration[QString("MPRIS")]);
settings.setValue(QString("PLAYER"), configuration[QString("PLAYER")]);
settings.setValue(QString("PLAYERSYMBOLS"), configuration[QString("PLAYERSYMBOLS")]);
settings.endGroup();
settings.sync();
@ -221,6 +218,9 @@ void AWActions::writeDataEngineConfiguration(const QVariantMap configuration) co
void AWActions::sendNotification(const QString eventId, const QString message,
const bool enablePopup)
{
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Event" << eventId;
qCDebug(LOG_AW) << "Message" << message;
if ((eventId == QString("event")) && (!enablePopup)) return;
KNotification *notification = KNotification::event(eventId, QString("Awesome Widget ::: %1").arg(eventId), message);
@ -230,7 +230,7 @@ void AWActions::sendNotification(const QString eventId, const QString message,
void AWActions::showUpdates(QString version) const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
QString text;
text += i18n("Current version : %1", QString(VERSION)) + QString("\n");
@ -249,14 +249,16 @@ void AWActions::showUpdates(QString version) const
void AWActions::versionReplyRecieved(QNetworkReply *reply) const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Return code" << reply->error();
qCDebug(LOG_AW) << "Reply error message" << reply->errorString();
QJsonParseError error;
QJsonDocument jsonDoc = QJsonDocument::fromJson(reply->readAll(), &error);
reply->deleteLater();
if (debug) qDebug() << PDEBUG << ":" << "Json parse error" << error.errorString();
if ((reply->error() != QNetworkReply::NoError) ||
(error.error != QJsonParseError::NoError)) {
qCWarning(LOG_AW) << "Parse error" << error.errorString();
return;
}
@ -264,6 +266,7 @@ void AWActions::versionReplyRecieved(QNetworkReply *reply) const
QVariantMap firstRelease = jsonDoc.toVariant().toList().first().toMap();
QString version = firstRelease[QString("tag_name")].toString();
version.remove(QString("V."));
qCInfo(LOG_AW) << "Found version" << version;
int old_major = QString(VERSION).split(QChar('.')).at(0).toInt();
int old_minor = QString(VERSION).split(QChar('.')).at(1).toInt();

View File

@ -30,8 +30,8 @@ class AWActions : public QObject
Q_OBJECT
public:
AWActions(QObject *parent = nullptr);
~AWActions();
explicit AWActions(QObject *parent = nullptr);
virtual ~AWActions();
Q_INVOKABLE void checkUpdates();
Q_INVOKABLE bool dropCache() const;
@ -55,8 +55,6 @@ private slots:
void versionReplyRecieved(QNetworkReply *reply) const;
private:
// variables
bool debug = false;
};

View File

@ -20,49 +20,47 @@
#include <KI18n/KLocalizedString>
#include <QDateTime>
#include <QDebug>
#include <QDir>
#include <QInputDialog>
#include <QLocale>
#include <QNetworkInterface>
#include <QProcessEnvironment>
#include <QRegExp>
#include <QScriptEngine>
#include <QSettings>
#include <QStandardPaths>
#include <QThread>
#include <pdebug/pdebug.h>
#include "awactions.h"
#include "awdebug.h"
#include "awtooltip.h"
#include "extquotes.h"
#include "extscript.h"
#include "extupgrade.h"
#include "extweather.h"
#include "graphicalitem.h"
#include "version.h"
AWKeys::AWKeys(QObject *parent)
: QObject(parent)
{
// debug
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
debug = (debugEnv == QString("yes"));
qCDebug(LOG_AW);
// logging
qSetMessagePattern(LOG_FORMAT);
// backend
graphicalItems = new ExtItemAggregator<GraphicalItem>(nullptr, QString("desktops"), debug);
extQuotes = new ExtItemAggregator<ExtQuotes>(nullptr, QString("quotes"), debug);
extScripts = new ExtItemAggregator<ExtScript>(nullptr, QString("scripts"), debug);
extUpgrade = new ExtItemAggregator<ExtUpgrade>(nullptr, QString("upgrade"), debug);
extWeather = new ExtItemAggregator<ExtWeather>(nullptr, QString("weather"), debug);
graphicalItems = new ExtItemAggregator<GraphicalItem>(nullptr, QString("desktops"));
extQuotes = new ExtItemAggregator<ExtQuotes>(nullptr, QString("quotes"));
extScripts = new ExtItemAggregator<ExtScript>(nullptr, QString("scripts"));
extUpgrade = new ExtItemAggregator<ExtUpgrade>(nullptr, QString("upgrade"));
extWeather = new ExtItemAggregator<ExtWeather>(nullptr, QString("weather"));
connect(this, SIGNAL(needToBeUpdated()), this, SLOT(dataUpdate()));
}
AWKeys::~AWKeys()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
if (toolTip != nullptr) delete toolTip;
@ -76,12 +74,8 @@ AWKeys::~AWKeys()
void AWKeys::initKeys(const QString currentPattern)
{
if (debug) qDebug() << PDEBUG;
// clear
keys.clear();
foundBars.clear();
foundKeys.clear();
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Pattern" << currentPattern;
// init
pattern = currentPattern;
@ -95,7 +89,8 @@ void AWKeys::initKeys(const QString currentPattern)
void AWKeys::initTooltip(const QVariantMap tooltipParams)
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Tooltip parameters" << tooltipParams;
if (toolTip != nullptr) {
disconnect(toolTip, SIGNAL(toolTipPainted(QString)), this, SIGNAL(needToolTipToBeUpdated(QString)));
@ -110,42 +105,34 @@ void AWKeys::initTooltip(const QVariantMap tooltipParams)
void AWKeys::setPopupEnabled(const bool popup)
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Is popup enabled" << popup;
enablePopup = popup;
}
void AWKeys::setTranslateStrings(const bool translate)
{
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Is translation enabled" << translate;
translateStrings = translate;
}
void AWKeys::setWrapNewLines(const bool wrap)
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Is wrapping enabled" << wrap;
wrapNewLines = wrap;
}
QString AWKeys::parsePattern() const
{
if (debug) qDebug() << PDEBUG;
if (keys.isEmpty()) return pattern;
QString parsed = pattern;
parsed.replace(QString("$$"), QString("$\\$\\"));
foreach(QString key, foundKeys)
parsed.replace(QString("$%1").arg(key), htmlValue(key));
foreach(QString bar, foundBars)
parsed.replace(QString("$%1").arg(bar), getItemByTag(bar)->image(valueByKey(bar).toFloat()));
parsed.replace(QString("$\\$\\"), QString("$$"));
// wrap new lines if required
if (wrapNewLines) parsed.replace(QString("\n"), QString("<br>"));
return parsed;
}
QSize AWKeys::toolTipSize() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
if (toolTip == nullptr) return QSize();
return toolTip->getSize();
@ -154,32 +141,43 @@ QSize AWKeys::toolTipSize() const
void AWKeys::addDevice(const QString source)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Source" << source;
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Source" << source;
QRegExp diskRegexp = QRegExp(QString("disk/(?:md|sd|hd)[a-z|0-9]_.*/Rate/(?:rblk)"));
QRegExp mountRegexp = QRegExp(QString("partitions/.*/filllevel"));
QRegExp tempRegexp = QRegExp(QString("lmsensors/.*"));
if (diskRegexp.indexIn(source) > -1) {
if (source.contains(diskRegexp)) {
QString device = source;
device.remove(QString("/Rate/rblk"));
addKeyToCache(QString("Disk"), device);
} else if (mountRegexp.indexIn(source) > -1) {
} else if (source.contains(mountRegexp)) {
QString device = source;
device.remove(QString("partitions")).remove(QString("/filllevel"));
addKeyToCache(QString("Mount"), device);
} else if (tempRegexp.indexIn(source) > -1) {
} else if (source.startsWith(QString("lmsensors"))) {
addKeyToCache(QString("Temp"), source);
}
}
QStringList AWKeys::dictKeys(const bool sorted) const
QStringList AWKeys::dictKeys(const bool sorted, const QString regexp) const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Should be sorted" << sorted;
qCDebug(LOG_AW) << "Filter" << regexp;
QStringList allKeys;
// weather
for (int i=extWeather->items().count()-1; i>=0; i--) {
if (!extWeather->items().at(i)->isActive()) continue;
allKeys.append(extWeather->items().at(i)->tag(QString("weatherId")));
allKeys.append(extWeather->items().at(i)->tag(QString("weather")));
allKeys.append(extWeather->items().at(i)->tag(QString("humidity")));
allKeys.append(extWeather->items().at(i)->tag(QString("pressure")));
allKeys.append(extWeather->items().at(i)->tag(QString("temperature")));
allKeys.append(extWeather->items().at(i)->tag(QString("timestamp")));
}
// time
allKeys.append(QString("time"));
allKeys.append(QString("isotime"));
@ -189,13 +187,12 @@ QStringList AWKeys::dictKeys(const bool sorted) const
// uptime
allKeys.append(QString("uptime"));
allKeys.append(QString("cuptime"));
// cpuclock
for (int i=numberCpus()-1; i>=0; i--)
// cpuclock & cpu
for (int i=QThread::idealThreadCount()-1; i>=0; i--) {
allKeys.append(QString("cpucl%1").arg(i));
allKeys.append(QString("cpucl"));
// cpu
for (int i=numberCpus()-1; i>=0; i--)
allKeys.append(QString("cpu%1").arg(i));
}
allKeys.append(QString("cpucl"));
allKeys.append(QString("cpu"));
// temperature
for (int i=tempDevices.count()-1; i>=0; i--)
@ -242,10 +239,18 @@ QStringList AWKeys::dictKeys(const bool sorted) const
allKeys.append(QString("hddtemp%1").arg(i));
// network
for (int i=networkDevices.count()-1; i>=0; i--) {
allKeys.append(QString("downunits%1").arg(i));
allKeys.append(QString("upunits%1").arg(i));
allKeys.append(QString("downkb%1").arg(i));
allKeys.append(QString("down%1").arg(i));
allKeys.append(QString("upkb%1").arg(i));
allKeys.append(QString("up%1").arg(i));
}
allKeys.append(QString("downunits"));
allKeys.append(QString("upunits"));
allKeys.append(QString("downkb"));
allKeys.append(QString("down"));
allKeys.append(QString("upkb"));
allKeys.append(QString("up"));
allKeys.append(QString("netdev"));
// battery
@ -263,6 +268,12 @@ QStringList AWKeys::dictKeys(const bool sorted) const
allKeys.append(QString("duration"));
allKeys.append(QString("progress"));
allKeys.append(QString("title"));
allKeys.append(QString("dalbum"));
allKeys.append(QString("dartist"));
allKeys.append(QString("dtitle"));
allKeys.append(QString("salbum"));
allKeys.append(QString("sartist"));
allKeys.append(QString("stitle"));
// ps
allKeys.append(QString("pscount"));
allKeys.append(QString("pstotal"));
@ -298,16 +309,6 @@ QStringList AWKeys::dictKeys(const bool sorted) const
allKeys.append(QString("la15"));
allKeys.append(QString("la5"));
allKeys.append(QString("la1"));
// weather
for (int i=extWeather->items().count()-1; i>=0; i--) {
if (!extWeather->items().at(i)->isActive()) continue;
allKeys.append(extWeather->items().at(i)->tag(QString("weatherId")));
allKeys.append(extWeather->items().at(i)->tag(QString("weather")));
allKeys.append(extWeather->items().at(i)->tag(QString("humidity")));
allKeys.append(extWeather->items().at(i)->tag(QString("pressure")));
allKeys.append(extWeather->items().at(i)->tag(QString("temperature")));
allKeys.append(extWeather->items().at(i)->tag(QString("timestamp")));
}
// bars
QStringList graphicalItemsKeys;
foreach(GraphicalItem *item, graphicalItems->items())
@ -319,13 +320,13 @@ QStringList AWKeys::dictKeys(const bool sorted) const
// sort if required
if (sorted) allKeys.sort();
return allKeys;
return allKeys.filter(QRegExp(regexp));
}
QStringList AWKeys::getHddDevices() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
QStringList devices = hddDevices;
// required by ui interface
@ -339,15 +340,12 @@ QStringList AWKeys::getHddDevices() const
void AWKeys::setDataBySource(const QString sourceName, const QVariantMap data,
const QVariantMap params)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Source" << sourceName;
if (debug) qDebug() << PDEBUG << ":" << "Data" << data;
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Source" << sourceName;
qCDebug(LOG_AW) << "Data" << data;
if (sourceName == QString("update")) return emit(needToBeUpdated());
// checking
if (keys.isEmpty()) return;
// regular expressions
QRegExp cpuRegExp = QRegExp(QString("cpu/cpu.*/TotalLoad"));
QRegExp cpuclRegExp = QRegExp(QString("cpu/cpu.*/clock"));
@ -356,9 +354,7 @@ void AWKeys::setDataBySource(const QString sourceName, const QVariantMap data,
QRegExp mountFillRegExp = QRegExp(QString("partitions/.*/filllevel"));
QRegExp mountFreeRegExp = QRegExp(QString("partitions/.*/freespace"));
QRegExp mountUsedRegExp = QRegExp(QString("partitions/.*/usedspace"));
QRegExp netRecRegExp = QRegExp(QString("network/interfaces/.*/receiver/data"));
QRegExp netTransRegExp = QRegExp(QString("network/interfaces/.*/transmitter/data"));
QRegExp tempRegExp = QRegExp(QString("lmsensors/.*"));
QRegExp netRegExp = QRegExp(QString("network/interfaces/.*/(receiver|transmitter)/data$"));
if (sourceName == QString("battery")) {
// battery
@ -512,7 +508,7 @@ void AWKeys::setDataBySource(const QString sourceName, const QVariantMap data,
// percentage
float value = 100.0 * values[QString("memmb")].toFloat() / values[QString("memtotmb")].toFloat();
// notification
if ((value >= 90.0) && (values[QString("mem")].toFloat() < 90.0))
if ((!isnan(value)) && (value >= 90.0) && (values[QString("mem")].toFloat() < 90.0))
AWActions::sendNotification(QString("event"), i18n("High memory usage"), enablePopup);
// value
values[QString("mem")] = QString("%1").arg(value, 5, 'f', 1);
@ -525,56 +521,41 @@ void AWKeys::setDataBySource(const QString sourceName, const QVariantMap data,
enablePopup);
// value
values[QString("netdev")] = data[QString("value")].toString();
} else if (sourceName.contains(netRecRegExp)) {
// download speed
QString device = sourceName;
} else if (sourceName.contains(netRegExp)) {
// network speed
QString type = sourceName.contains(QString("receiver")) ? QString("down") : QString("up");
// device name
QString device = sourceName.split(QChar('/'))[2];
// values
float value = data[QString("value")].toFloat();
device.remove(QString("network/interfaces/")).remove(QString("/receiver/data"));
QStringList allNetworkDevices = networkDevices;
for (int i=0; i<allNetworkDevices.count(); i++) {
if (allNetworkDevices.at(i) != device) continue;
if (value > 1000.0)
values[QString("down%1").arg(i)] = QString("%1").arg(value / 1024.0, 4, 'f', 1);
else
values[QString("down%1").arg(i)] = QString("%1").arg(value, 4, 'f', 0);
QString simplifiedValue = value > 1000.0 ?
QString("%1").arg(value / 1024.0, 4, 'f', 1) :
QString("%1").arg(value, 4, 'f', 0);
// units
QString units;
if (translateStrings)
units = value > 1000.0 ? i18n("MB/s") : i18n("KB/s");
else
units = value > 1000.0 ? QString("MB/s") : QString("KB/s");
// update
for (int i=0; i<networkDevices.count(); i++) {
if (networkDevices.at(i) != device) continue;
values[QString("%1kb%2").arg(type).arg(i)] = QString("%1").arg(value, 4, 'f', 0);
values[QString("%1%2").arg(type).arg(i)] = simplifiedValue;
values[QString("%1units%2").arg(type).arg(i)] = units;
break;
}
if (device == values[QString("netdev")]) {
if (value > 1000.0)
values[QString("down")] = QString("%1").arg(value / 1024.0, 4, 'f', 1);
else
values[QString("down")] = QString("%1").arg(value, 4, 'f', 0);
}
} else if (sourceName.contains(netTransRegExp)) {
// upload speed
QString device = sourceName;
float value = data[QString("value")].toFloat();
device.remove(QString("network/interfaces/")).remove(QString("/transmitter/data"));
QStringList allNetworkDevices = networkDevices;
for (int i=0; i<allNetworkDevices.count(); i++) {
if (allNetworkDevices.at(i) != device) continue;
if (value > 1000.0)
values[QString("up%1").arg(i)] = QString("%1").arg(data[QString("value")].toFloat() / 1024.0, 4, 'f', 1);
else
values[QString("up%1").arg(i)] = QString("%1").arg(data[QString("value")].toFloat(), 4, 'f', 0);
break;
}
if (device == values[QString("netdev")]) {
if (value > 1000.0)
values[QString("up")] = QString("%1").arg(value / 1024.0, 4, 'f', 1);
else
values[QString("up")] = QString("%1").arg(value, 4, 'f', 0);
values[QString("%1kb").arg(type)] = QString("%1").arg(value, 4, 'f', 0);
values[type] = simplifiedValue;
values[QString("%1units").arg(type)] = units;
}
} else if (sourceName == QString("pkg")) {
// package manager
foreach(QString key, data.keys()) values[key] = QString("%1").arg(data[key].toInt(), 2);
} else if (sourceName == QString("player")) {
// player
values[QString("album")] = data[QString("album")].toString();
values[QString("artist")] = data[QString("artist")].toString();
values[QString("duration")] = data[QString("duration")].toString();
values[QString("progress")] = data[QString("progress")].toString();
values[QString("title")] = data[QString("title")].toString();
foreach(QString key, data.keys()) values[key] = data[key].toString();
} else if (sourceName == QString("ps")) {
// ps
values[QString("ps")] = data[QString("ps")].toString();
@ -599,11 +580,11 @@ void AWKeys::setDataBySource(const QString sourceName, const QVariantMap data,
// percentage
float value = 100.0 * values[QString("swapmb")].toFloat() / values[QString("swaptotmb")].toFloat();
// notification
if ((value > 0.0) && (values[QString("swap")].toFloat() == 0.0))
if ((!isnan(value)) && (value > 0.0) && (values[QString("swap")].toFloat() == 0.0))
AWActions::sendNotification(QString("event"), i18n("Swap is used"), enablePopup);
// value
values[QString("swap")] = QString("%1").arg(value, 5, 'f', 1);
} else if (sourceName.contains(tempRegExp)) {
} else if (sourceName.startsWith(QString("lmsensors/"))) {
// temperature devices
for (int i=0; i<tempDevices.count(); i++) {
if (sourceName != tempDevices.at(i)) continue;
@ -614,15 +595,17 @@ void AWKeys::setDataBySource(const QString sourceName, const QVariantMap data,
break;
}
} else if (sourceName == QString("Local")) {
// init locale
QLocale loc = translateStrings ? QLocale::system() : QLocale::c();
QDateTime dt = data[QString("DateTime")].toDateTime();
// time
values[QString("time")] = data[QString("DateTime")].toDateTime().toString(Qt::TextDate);
values[QString("isotime")] = data[QString("DateTime")].toDateTime().toString(Qt::ISODate);
values[QString("shorttime")] = data[QString("DateTime")].toDateTime().toString(Qt::SystemLocaleShortDate);
values[QString("longtime")] = data[QString("DateTime")].toDateTime().toString(Qt::SystemLocaleLongDate);
values[QString("time")] = dt.toString(Qt::TextDate);
values[QString("isotime")] = dt.toString(Qt::ISODate);
values[QString("shorttime")] = loc.toString(dt, QLocale::ShortFormat);
values[QString("longtime")] = loc.toString(dt, QLocale::LongFormat);
values[QString("ctime")] = params[QString("customTime")].toString();
foreach(QString key, getTimeKeys())
values[QString("ctime")].replace(QString("$%1").arg(key),
data[QString("DateTime")].toDateTime().toString(key));
foreach(QString key, timeKeys)
values[QString("ctime")].replace(QString("$%1").arg(key), loc.toString(dt, key));
} else if (sourceName == QString("system/uptime")) {
// uptime
int uptime = data[QString("value")].toFloat();
@ -653,7 +636,7 @@ void AWKeys::setDataBySource(const QString sourceName, const QVariantMap data,
temperature(data[key].toFloat(), params[QString("tempUnits")].toString()), 4, 'f', 1);
}
} else {
if (debug) qDebug() << PDEBUG << ":" << "Source" << sourceName << "not found";
qCDebug(LOG_AW) << "Source" << sourceName << "not found";
emit(dropSourceFromDataengine(sourceName));
}
}
@ -661,11 +644,11 @@ void AWKeys::setDataBySource(const QString sourceName, const QVariantMap data,
void AWKeys::graphicalValueByKey() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
bool ok;
QString tag = QInputDialog::getItem(nullptr, i18n("Select tag"), i18n("Tag"),
dictKeys(true), 0, false, &ok);
dictKeys(true), 0, true, &ok);
if ((!ok) || (tag.isEmpty())) return;
QString message = i18n("Tag: %1", tag);
@ -678,8 +661,8 @@ void AWKeys::graphicalValueByKey() const
QString AWKeys::infoByKey(QString key) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Requested key" << key;
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Requested key" << key;
key.remove(QRegExp(QString("^bar[0-9]{1,}")));
if (key.startsWith(QString("custom")))
@ -714,28 +697,20 @@ QString AWKeys::infoByKey(QString key) const
QString AWKeys::valueByKey(QString key) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Requested key" << key;
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Requested key" << key;
key.remove(QRegExp(QString("^bar[0-9]{1,}")));
return values[key];
return values[key.remove(QRegExp(QString("^bar[0-9]{1,}")))];
}
void AWKeys::editItem(const QString type)
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Item type" << type;
if (type == QString("graphicalitem")) {
QStringList bars;
bars.append(keys.filter((QRegExp(QString("^cpu(?!cl).*")))));
bars.append(keys.filter((QRegExp(QString("^gpu$")))));
bars.append(keys.filter((QRegExp(QString("^mem$")))));
bars.append(keys.filter((QRegExp(QString("^swap$")))));
bars.append(keys.filter((QRegExp(QString("^hdd[0-9].*")))));
bars.append(keys.filter((QRegExp(QString("^bat.*")))));
graphicalItems->setConfigArgs(bars);
graphicalItems->setConfigArgs(dictKeys(true, QString("^(cpu(?!cl).*|gpu$|mem$|swap$|hdd[0-9].*|bat.*)")));
return graphicalItems->editItems();
} else if (type == QString("extquotes")) {
return extQuotes->editItems();
@ -749,10 +724,11 @@ void AWKeys::editItem(const QString type)
}
void AWKeys::dataUpdate() const
void AWKeys::dataUpdate()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
calculateLambdas();
emit(needTextToBeUpdated(parsePattern()));
if (toolTip != nullptr) emit(toolTip->updateData(values));
}
@ -760,11 +736,11 @@ void AWKeys::dataUpdate() const
void AWKeys::loadKeysFromCache()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
QString fileName = QString("%1/awesomewidgets.ndx")
.arg(QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation));
if (debug) qDebug() << PDEBUG << ":" << "Cache file" << fileName;
qCInfo(LOG_AW) << "Cache file" << fileName;
QSettings cache(fileName, QSettings::IniFormat);
cache.beginGroup(QString("Disk"));
@ -801,22 +777,70 @@ void AWKeys::loadKeysFromCache()
void AWKeys::reinitKeys()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
keys = dictKeys();
foundBars = findGraphicalItems();
foundKeys = findKeys();
// init
QStringList allKeys = dictKeys();
// append lists
// bars
foundBars = [allKeys](QString pattern) {
QStringList selectedKeys;
foreach(QString key, allKeys)
if ((key.startsWith(QString("bar"))) &&
(pattern.contains(QString("$%1").arg(key)))) {
qCInfo(LOG_AW) << "Found bar" << key;
selectedKeys.append(key);
}
if (selectedKeys.isEmpty()) qCWarning(LOG_AW) << "No bars found";
return selectedKeys;
}(pattern);
// main key list
foundKeys = [allKeys](QString pattern) {
QStringList selectedKeys;
foreach(QString key, allKeys)
if ((!key.startsWith(QString("bar"))) &&
(pattern.contains(QString("$%1").arg(key)))) {
qCInfo(LOG_AW) << "Found key" << key;
selectedKeys.append(key);
}
if (selectedKeys.isEmpty()) qCWarning(LOG_AW) << "No keys found";
return selectedKeys;
}(pattern);
// lambdas
foundLambdas = [](QString pattern) {
QStringList selectedKeys;
// substring inside ${{ }} (with brackets) which should not contain ${{
QRegularExpression lambdaRegexp(QString("\\$\\{\\{((?!\\$\\{\\{).)*?\\}\\}"));
lambdaRegexp.setPatternOptions(QRegularExpression::DotMatchesEverythingOption);
QRegularExpressionMatchIterator it = lambdaRegexp.globalMatch(pattern);
while (it.hasNext()) {
QRegularExpressionMatch match = it.next();
QString lambda = match.captured();
// drop brakets
lambda.remove(QRegExp(QString("^\\$\\{\\{")));
lambda.remove(QRegExp(QString("\\}\\}$")));
// append
qCInfo(LOG_AW) << "Found lambda" << lambda;
selectedKeys.append(lambda);
}
if (selectedKeys.isEmpty()) qCWarning(LOG_AW) << "No lambdas found";
return selectedKeys;
}(pattern);
}
void AWKeys::addKeyToCache(const QString type, const QString key)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Key type" << type;
if (debug) qDebug() << PDEBUG << ":" << "Key" << key;
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Key type" << type;
qCDebug(LOG_AW) << "Key" << key;
QString fileName = QString("%1/awesomewidgets.ndx").arg(QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation));
if (debug) qDebug() << PDEBUG << ":" << "Cache file" << fileName;
qCInfo(LOG_AW) << "Cache file" << fileName;
QSettings cache(fileName, QSettings::IniFormat);
cache.beginGroup(type);
@ -830,7 +854,7 @@ void AWKeys::addKeyToCache(const QString type, const QString key)
foreach(QString dev, devices) {
QString device = QString("/dev/%1").arg(dev);
if (cachedValues.contains(device)) continue;
if (debug) qDebug() << PDEBUG << ":" << "Found new key" << device << "for type" << type;
qCInfo(LOG_AW) << "Found new key" << device << "for type" << type;
cache.setValue(QString("%1").arg(cache.allKeys().count(), 3, 10, QChar('0')), device);
}
} else if (type == QString("Network")) {
@ -838,12 +862,12 @@ void AWKeys::addKeyToCache(const QString type, const QString key)
foreach(QNetworkInterface interface, rawInterfaceList) {
QString device = interface.name();
if (cachedValues.contains(device)) continue;
if (debug) qDebug() << PDEBUG << ":" << "Found new key" << device << "for type" << type;
qCInfo(LOG_AW) << "Found new key" << device << "for type" << type;
cache.setValue(QString("%1").arg(cache.allKeys().count(), 3, 10, QChar('0')), device);
}
} else {
if (cachedValues.contains(key)) return;
if (debug) qDebug() << PDEBUG << ":" << "Found new key" << key << "for type" << type;
qCInfo(LOG_AW) << "Found new key" << key << "for type" << type;
cache.setValue(QString("%1").arg(cache.allKeys().count(), 3, 10, QChar('0')), key);
}
cache.endGroup();
@ -854,29 +878,67 @@ void AWKeys::addKeyToCache(const QString type, const QString key)
}
QString AWKeys::htmlValue(QString key) const
void AWKeys::calculateLambdas()
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Requested key" << key;
qCDebug(LOG_AW);
QString value = values[key];
if (!key.startsWith(QString("custom")))
value.replace(QString(" "), QString("&nbsp;"));
return value;
foreach(QString key, foundLambdas)
values[key] = [this](QString key) {
QScriptEngine engine;
// apply $this values
key.replace(QString("$this"), values[key]);
foreach(QString lambdaKey, foundKeys)
key.replace(QString("$%1").arg(lambdaKey), values[lambdaKey]);
qCInfo(LOG_AW) << "Expression" << key;
QScriptValue result = engine.evaluate(key);
if (engine.hasUncaughtException()) {
int line = engine.uncaughtExceptionLineNumber();
qCWarning(LOG_AW) << "Uncaught exception at line" << line << ":" << result.toString();
return QString();
} else
return result.toString();
}(key);
}
int AWKeys::numberCpus() const
QString AWKeys::parsePattern() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
return QThread::idealThreadCount();
QString parsed = pattern;
parsed.replace(QString("$$"), QString("$\\$\\"));
// lambdas
foreach(QString key, foundLambdas)
parsed.replace(QString("${{%1}}").arg(key), values[key]);
// main keys
foreach(QString key, foundKeys)
parsed.replace(QString("$%1").arg(key), [](QString key, QString value) {
if ((!key.startsWith(QString("custom"))) &&
(!key.startsWith(QString("weather"))))
value.replace(QString(" "), QString("&nbsp;"));
return value;
}(key, values[key]));
// bars
foreach(QString bar, foundBars)
parsed.replace(QString("$%1").arg(bar),
graphicalItems->itemByTag(bar)->image(valueByKey(bar).toFloat()));
// prepare strings
parsed.replace(QString("$\\$\\"), QString("$$"));
if (wrapNewLines) parsed.replace(QString("\n"), QString("<br>"));
return parsed;
}
float AWKeys::temperature(const float temp, const QString units) const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Temperature value" << temp;
qCDebug(LOG_AW) << "Temperature units" << units;
float converted = temp;
if (units == QString("Celsius"))
@ -896,79 +958,3 @@ float AWKeys::temperature(const float temp, const QString units) const
return converted;
}
QStringList AWKeys::findGraphicalItems() const
{
if (debug) qDebug() << PDEBUG;
QStringList orderedKeys;
foreach(GraphicalItem *item, graphicalItems->items())
orderedKeys.append(item->name() + item->bar());
orderedKeys.sort();
QStringList selectedKeys;
for (int i=orderedKeys.count()-1; i>=0; i--)
if (pattern.contains(QString("$%1").arg(orderedKeys.at(i)))) {
if (debug) qDebug() << PDEBUG << ":" << "Found key" << orderedKeys.at(i);
selectedKeys.append(orderedKeys.at(i));
}
return selectedKeys;
}
QStringList AWKeys::findKeys() const
{
QStringList selectedKeys;
foreach(QString key, keys) {
if (key.startsWith(QString("bar"))) continue;
if (pattern.contains(QString("$%1").arg(key))) {
if (debug) qDebug() << PDEBUG << ":" << "Found key" << key;
selectedKeys.append(key);
}
}
return selectedKeys;
}
GraphicalItem *AWKeys::getItemByTag(const QString tag) const
{
if (debug) qDebug() << PDEBUG;
GraphicalItem *item = nullptr;
foreach(GraphicalItem *gitem, graphicalItems->items()) {
if ((gitem->name() + gitem->bar()) != tag) continue;
item = gitem;
break;
}
return item;
}
QStringList AWKeys::getTimeKeys() const
{
if (debug) qDebug() << PDEBUG;
QStringList keys;
keys.append(QString("dddd"));
keys.append(QString("ddd"));
keys.append(QString("dd"));
keys.append(QString("d"));
keys.append(QString("MMMM"));
keys.append(QString("MMM"));
keys.append(QString("MM"));
keys.append(QString("M"));
keys.append(QString("yyyy"));
keys.append(QString("yy"));
keys.append(QString("hh"));
keys.append(QString("h"));
keys.append(QString("mm"));
keys.append(QString("m"));
keys.append(QString("ss"));
keys.append(QString("s"));
return keys;
}

View File

@ -25,6 +25,7 @@
#include <QVariant>
#include "extitemaggregator.h"
#include "version.h"
class AWToolTip;
@ -39,18 +40,19 @@ class AWKeys : public QObject
Q_OBJECT
public:
AWKeys(QObject *parent = nullptr);
~AWKeys();
explicit AWKeys(QObject *parent = nullptr);
virtual ~AWKeys();
Q_INVOKABLE void initKeys(const QString currentPattern);
Q_INVOKABLE void initTooltip(const QVariantMap tooltipParams);
Q_INVOKABLE void setPopupEnabled(const bool popup = false);
Q_INVOKABLE void setTranslateStrings(const bool translate = false);
Q_INVOKABLE void setWrapNewLines(const bool wrap = false);
Q_INVOKABLE QString parsePattern() const;
Q_INVOKABLE QSize toolTipSize() const;
// keys
Q_INVOKABLE void addDevice(const QString source);
Q_INVOKABLE QStringList dictKeys(const bool sorted = false) const;
Q_INVOKABLE QStringList dictKeys(const bool sorted = false,
const QString regexp = QString()) const;
Q_INVOKABLE QStringList getHddDevices() const;
Q_INVOKABLE void setDataBySource(const QString sourceName, const QVariantMap data,
const QVariantMap params);
@ -68,25 +70,20 @@ signals:
void needToBeUpdated();
private slots:
void dataUpdate() const;
void dataUpdate();
void loadKeysFromCache();
void reinitKeys();
private:
// methods
void addKeyToCache(const QString type, const QString key = QString(""));
QString htmlValue(QString key) const;
int numberCpus() const;
void calculateLambdas();
QString parsePattern() const;
float temperature(const float temp, const QString units) const;
// find methods
QStringList findGraphicalItems() const;
QStringList findKeys() const;
// get methods
GraphicalItem *getItemByTag(const QString tag) const;
QStringList getTimeKeys() const;
AWToolTip *toolTip = nullptr;
bool debug = false;
bool enablePopup = false;
bool translateStrings = false;
bool wrapNewLines = false;
ExtItemAggregator<GraphicalItem> *graphicalItems;
ExtItemAggregator<ExtQuotes> *extQuotes;
@ -94,7 +91,8 @@ private:
ExtItemAggregator<ExtUpgrade> *extUpgrade;
ExtItemAggregator<ExtWeather> *extWeather;
QString pattern;
QStringList foundBars, foundKeys, keys;
QStringList foundBars, foundKeys, foundLambdas;
QStringList timeKeys = QString(TIME_KEYS).split(QChar(','));
QHash<QString, QString> values;
QStringList diskDevices, hddDevices, mountDevices, networkDevices, tempDevices;
};

View File

@ -18,21 +18,16 @@
#include "awtooltip.h"
#include <QBuffer>
#include <QDebug>
#include <QProcessEnvironment>
#include <math.h>
#include <pdebug/pdebug.h>
#include "awdebug.h"
AWToolTip::AWToolTip(QObject *parent, QVariantMap settings)
: QObject(parent),
configuration(qvariant_cast<QVariantHash>(settings))
{
// debug
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
debug = (debugEnv == QString("yes"));
qCDebug(LOG_AW);
toolTipScene = new QGraphicsScene(nullptr);
toolTipView = new QGraphicsView(toolTipScene);
@ -74,7 +69,7 @@ AWToolTip::AWToolTip(QObject *parent, QVariantMap settings)
AWToolTip::~AWToolTip()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
delete toolTipScene;
}
@ -82,7 +77,7 @@ AWToolTip::~AWToolTip()
void AWToolTip::dataUpdate(QHash<QString, QString> values)
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
// battery update requires info is AC online or not
setData(QString("batTooltip"), values[QString("bat")].toFloat(),
@ -92,11 +87,8 @@ void AWToolTip::dataUpdate(QHash<QString, QString> values)
setData(QString("cpuclTooltip"), values[QString("cpucl")].toFloat());
setData(QString("memTooltip"), values[QString("mem")].toFloat());
setData(QString("swapTooltip"), values[QString("swap")].toFloat());
// network may be showed as float (MB/s) or as int (KB/s)
setData(QString("downTooltip"), values[QString("down")].contains(QChar('.')) ?
values[QString("down")].toFloat() * 1024.0 : values[QString("down")].toFloat());
setData(QString("upTooltip"), values[QString("up")].contains(QChar('.')) ?
values[QString("up")].toFloat() * 1024.0 : values[QString("up")].toFloat());
setData(QString("downTooltip"), values[QString("downkb")].toFloat());
setData(QString("upTooltip"), values[QString("upkb")].toFloat());
emit(toolTipPainted(htmlImage()));
}
@ -104,7 +96,7 @@ void AWToolTip::dataUpdate(QHash<QString, QString> values)
QSize AWToolTip::getSize() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
return size;
}
@ -112,20 +104,21 @@ QSize AWToolTip::getSize() const
QString AWToolTip::htmlImage()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
QPixmap rawImage = image();
QByteArray byteArray;
QBuffer buffer(&byteArray);
rawImage.save(&buffer, "PNG");
return QString("<img src=\"data:image/png;base64,%1\"/>").arg(QString(byteArray.toBase64()));
return byteArray.isEmpty() ? QString() :
QString("<img src=\"data:image/png;base64,%1\"/>").arg(QString(byteArray.toBase64()));
}
QPixmap AWToolTip::image()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
toolTipView->resize(size);
// create image
@ -144,6 +137,7 @@ QPixmap AWToolTip::image()
float shift = i * 100.0;
if (down) shift -= 100.0;
for (int j=0; j<data[requiredKeys.at(i)].count()-1; j++) {
// some magic here
float x1 = j * normX + shift;
float y1 = - fabs(data[requiredKeys.at(i)].at(j)) * normY + 5.0;
float x2 = (j + 1) * normX + shift;
@ -163,9 +157,12 @@ QPixmap AWToolTip::image()
}
void AWToolTip::setData(const QString source, float value, const bool ac)
void AWToolTip::setData(const QString source, float value, const bool dontInvert)
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_AW);
qCDebug(LOG_AW) << "Source" << source;
qCDebug(LOG_AW) << "Value" << value;
qCDebug(LOG_AW) << "Do not invert value" << dontInvert;
if (data[source].count() == 0)
data[source].append(0.0);
@ -173,19 +170,12 @@ void AWToolTip::setData(const QString source, float value, const bool ac)
data[source].takeFirst();
if (isnan(value)) value = 0.0;
if (ac)
data[source].append(value);
else
data[source].append(-value);
// invert values for different battery colours
data[source].append(dontInvert ? value : -value);
if ((source == QString("downTooltip")) || (source == QString("upTooltip"))) {
foreach(float val, data[QString("downTooltip")])
if (boundaries[QString("downTooltip")] < val)
boundaries[QString("downTooltip")] = val;
foreach(float val, data[QString("upTooltip")])
if (boundaries[QString("downTooltip")] < val)
boundaries[QString("downTooltip")] = val;
boundaries[QString("downTooltip")] *= 1.2;
if (source == QString("downTooltip")) {
QList<float> netValues = data[QString("downTooltip")] + data[QString("upTooltip")];
boundaries[QString("downTooltip")] = 1.2 * *std::max_element(netValues.cbegin(), netValues.cend());
boundaries[QString("upTooltip")] = boundaries[QString("downTooltip")];
}
}

View File

@ -32,8 +32,8 @@ class AWToolTip : public QObject
Q_OBJECT
public:
AWToolTip(QObject *parent = nullptr, QVariantMap settings = QVariantMap());
~AWToolTip();
explicit AWToolTip(QObject *parent = nullptr, QVariantMap settings = QVariantMap());
virtual ~AWToolTip();
QSize getSize() const;
QString htmlImage();
QPixmap image();
@ -50,9 +50,8 @@ private:
QGraphicsScene *toolTipScene = nullptr;
QGraphicsView *toolTipView = nullptr;
void setData(const QString source, float value,
const bool ac = true);
const bool dontInvert = true);
// variables
bool debug = false;
int counts = 0;
QVariantHash configuration;
QHash<QString, float> boundaries;

View File

@ -1,3 +1,2 @@
module org.kde.plasma.private.awesomewidget
plugin awplugin

View File

@ -12,7 +12,7 @@ include_directories(
${Kf5_INCLUDE}
)
file(GLOB_RECURSE SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/qreplytimeout/*.cpp)
file(GLOB SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/qreplytimeout/*.cpp ${CMAKE_SOURCE_DIR}/*.cpp)
file(GLOB SUBPROJECT_HEADER *.h ${PROJECT_TRDPARTY_DIR}/qreplytimeout/*.h)
file(GLOB SUBPROJECT_UI *.ui)
set(SUBPROJECT_GRAPHITEMS ${CMAKE_CURRENT_SOURCE_DIR}/desktops)
@ -20,6 +20,11 @@ set(SUBPROJECT_QUOTES ${CMAKE_CURRENT_SOURCE_DIR}/quotes)
set(SUBPROJECT_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/scripts)
set(SUBPROJECT_UPGRADE ${CMAKE_CURRENT_SOURCE_DIR}/upgrade)
set(SUBPROJECT_WEATHER ${CMAKE_CURRENT_SOURCE_DIR}/weather)
file(GLOB SUBPROJECT_WEATHER_JSON_IN *.json)
file(RELATIVE_PATH SUBPROJECT_WEATHER_JSON ${CMAKE_SOURCE_DIR} ${SUBPROJECT_WEATHER_JSON_IN})
# prepare
configure_file(${SUBPROJECT_WEATHER_JSON_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_WEATHER_JSON})
qt5_wrap_cpp(SUBPROJECT_MOC_SOURCE ${SUBPROJECT_HEADER})
qt5_wrap_ui(SUBPROJECT_UI_HEADER ${SUBPROJECT_UI})
@ -33,3 +38,4 @@ install(DIRECTORY ${SUBPROJECT_QUOTES} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT
install(DIRECTORY ${SUBPROJECT_SCRIPTS} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
install(DIRECTORY ${SUBPROJECT_UPGRADE} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
install(DIRECTORY ${SUBPROJECT_WEATHER} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_WEATHER_JSON} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/weather)

View File

@ -17,39 +17,41 @@
#include "abstractextitem.h"
#include <QDebug>
#include <QDir>
#include <QSettings>
#include <QStandardPaths>
#include <QTime>
#include <pdebug/pdebug.h>
#include "awdebug.h"
#include "version.h"
AbstractExtItem::AbstractExtItem(QWidget *parent, const QString desktopName,
const QStringList directories, const bool debugCmd)
const QStringList directories)
: QDialog(parent),
m_fileName(desktopName),
m_dirs(directories),
debug(debugCmd)
m_dirs(directories)
{
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Desktop name" << desktopName;
qCDebug(LOG_LIB) << "Directories" << directories;
m_name = m_fileName;
}
AbstractExtItem::~AbstractExtItem()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
}
template <class T>
T *AbstractExtItem::copy(const QString fileName, const int number)
T *AbstractExtItem::copy(const QString _fileName, const int _number)
{
Q_UNUSED(fileName)
Q_UNUSED(number)
Q_UNUSED(_fileName)
Q_UNUSED(_number)
qCDebug(LOG_LIB);
// an analog of pure virtual method
return new T();
@ -59,7 +61,7 @@ T *AbstractExtItem::copy(const QString fileName, const int number)
int AbstractExtItem::apiVersion() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_apiVersion;
}
@ -67,7 +69,7 @@ int AbstractExtItem::apiVersion() const
QString AbstractExtItem::comment() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_comment;
}
@ -75,7 +77,7 @@ QString AbstractExtItem::comment() const
QStringList AbstractExtItem::directories() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_dirs;
}
@ -83,7 +85,7 @@ QStringList AbstractExtItem::directories() const
QString AbstractExtItem::fileName() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_fileName;
}
@ -91,7 +93,7 @@ QString AbstractExtItem::fileName() const
int AbstractExtItem::interval() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_interval;
}
@ -99,7 +101,7 @@ int AbstractExtItem::interval() const
bool AbstractExtItem::isActive() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_active;
}
@ -107,7 +109,7 @@ bool AbstractExtItem::isActive() const
QString AbstractExtItem::name() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_name;
}
@ -115,7 +117,7 @@ QString AbstractExtItem::name() const
int AbstractExtItem::number() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_number;
}
@ -123,8 +125,8 @@ int AbstractExtItem::number() const
QString AbstractExtItem::tag(const QString _type) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Tag type" << _type;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Tag type" << _type;
return QString("%1%2").arg(_type).arg(m_number);
}
@ -132,8 +134,8 @@ QString AbstractExtItem::tag(const QString _type) const
void AbstractExtItem::setApiVersion(const int _apiVersion)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Version" << _apiVersion;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Version" << _apiVersion;
m_apiVersion = _apiVersion;
}
@ -141,8 +143,8 @@ void AbstractExtItem::setApiVersion(const int _apiVersion)
void AbstractExtItem::setActive(const bool _state)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "State" << _state;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "State" << _state;
m_active = _state;
}
@ -150,8 +152,8 @@ void AbstractExtItem::setActive(const bool _state)
void AbstractExtItem::setComment(const QString _comment)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Comment" << _comment;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Comment" << _comment;
m_comment = _comment;
}
@ -159,8 +161,8 @@ void AbstractExtItem::setComment(const QString _comment)
void AbstractExtItem::setInterval(const int _interval)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Interval" << _interval;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Interval" << _interval;
if (_interval <= 0) return;
m_interval = _interval;
@ -169,8 +171,8 @@ void AbstractExtItem::setInterval(const int _interval)
void AbstractExtItem::setName(const QString _name)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Name" << _name;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Name" << _name;
m_name = _name;
}
@ -178,14 +180,16 @@ void AbstractExtItem::setName(const QString _name)
void AbstractExtItem::setNumber(int _number)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Number" << _number;
if (_number == -1) {
if (debug) qDebug() << PDEBUG << ":" << "Number is empty, generate new one";
qsrand(QTime::currentTime().msec());
_number = qrand() % 1000;
if (debug) qDebug() << PDEBUG << ":" << "Generated number is" << _number;
}
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Number" << _number;
if (_number == -1)
_number = []() {
qCWarning(LOG_LIB) << "Number is empty, generate new one";
qsrand(QTime::currentTime().msec());
int n = qrand() % 1000;
qCInfo(LOG_LIB) << "Generated number is" << n;
return n;
}();
m_number = _number;
}
@ -193,7 +197,7 @@ void AbstractExtItem::setNumber(int _number)
void AbstractExtItem::readConfiguration()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
for (int i=m_dirs.count()-1; i>=0; i--) {
if (!QDir(m_dirs.at(i)).entryList(QDir::Files).contains(m_fileName)) continue;
@ -213,11 +217,11 @@ void AbstractExtItem::readConfiguration()
bool AbstractExtItem::tryDelete() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
foreach(QString dir, m_dirs) {
bool status = QFile::remove(QString("%1/%2").arg(dir).arg(m_fileName));
if (debug) qDebug() << PDEBUG << ":" << "Remove file" << QString("%1/%2").arg(dir).arg(m_fileName) << status;
qCInfo(LOG_LIB) << "Remove file" << QString("%1/%2").arg(dir).arg(m_fileName) << status;
}
// check if exists
@ -229,10 +233,10 @@ bool AbstractExtItem::tryDelete() const
void AbstractExtItem::writeConfiguration() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
QSettings settings(QString("%1/%2").arg(m_dirs.first()).arg(m_fileName), QSettings::IniFormat);
if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << settings.fileName();
qCInfo(LOG_LIB) << "Configuration file" << settings.fileName();
settings.beginGroup(QString("Desktop Entry"));
settings.setValue(QString("Encoding"), QString("UTF-8"));

View File

@ -38,10 +38,9 @@ class AbstractExtItem : public QDialog
public:
explicit AbstractExtItem(QWidget *parent = nullptr, const QString desktopName = QString(),
const QStringList directories = QStringList(),
const bool debugCmd = false);
const QStringList directories = QStringList());
virtual ~AbstractExtItem();
template <class T> T *copy(const QString fileName, const int number);
template <class T> T *copy(const QString _fileName, const int _number);
// get methods
int apiVersion() const;
QString comment() const;
@ -71,7 +70,6 @@ public slots:
private:
QString m_fileName;
QStringList m_dirs;
bool debug;
virtual void translate() = 0;
// properties
int m_apiVersion = 0;

View File

@ -19,18 +19,18 @@
#include <KI18n/KLocalizedString>
#include <QDebug>
#include <QHBoxLayout>
#include <QInputDialog>
#include <QLineEdit>
#include <pdebug/pdebug.h>
#include "awdebug.h"
AbstractExtItemAggregator::AbstractExtItemAggregator(QWidget *parent, const bool debugCmd)
: QWidget(parent),
debug(debugCmd)
AbstractExtItemAggregator::AbstractExtItemAggregator(QWidget *parent)
: QWidget(parent)
{
qCDebug(LOG_LIB);
dialog = new QDialog(this);
widgetDialog = new QListWidget(dialog);
dialogButtons = new QDialogButtonBox(QDialogButtonBox::Open | QDialogButtonBox::Close,
@ -53,7 +53,7 @@ AbstractExtItemAggregator::AbstractExtItemAggregator(QWidget *parent, const bool
AbstractExtItemAggregator::~AbstractExtItemAggregator()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
delete dialog;
}
@ -61,7 +61,7 @@ AbstractExtItemAggregator::~AbstractExtItemAggregator()
QString AbstractExtItemAggregator::getName()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
bool ok;
QString name = QInputDialog::getText(this, i18n("Enter file name"),
@ -76,7 +76,7 @@ QString AbstractExtItemAggregator::getName()
QVariant AbstractExtItemAggregator::configArgs() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_configArgs;
}
@ -84,8 +84,8 @@ QVariant AbstractExtItemAggregator::configArgs() const
void AbstractExtItemAggregator::setConfigArgs(const QVariant _configArgs)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Configuration arguments" << _configArgs;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Configuration arguments" << _configArgs;
m_configArgs = _configArgs;
}
@ -94,7 +94,7 @@ void AbstractExtItemAggregator::setConfigArgs(const QVariant _configArgs)
void AbstractExtItemAggregator::editItemActivated(QListWidgetItem *item)
{
Q_UNUSED(item)
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return editItem();
}
@ -102,7 +102,7 @@ void AbstractExtItemAggregator::editItemActivated(QListWidgetItem *item)
void AbstractExtItemAggregator::editItemButtonPressed(QAbstractButton *button)
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
if (static_cast<QPushButton *>(button) == copyButton)
return copyItem();

View File

@ -33,7 +33,7 @@ class AbstractExtItemAggregator : public QWidget
Q_PROPERTY(QVariant configArgs READ configArgs WRITE setConfigArgs)
public:
AbstractExtItemAggregator(QWidget *parent = nullptr, const bool debugCmd = false);
explicit AbstractExtItemAggregator(QWidget *parent = nullptr);
virtual ~AbstractExtItemAggregator();
QString getName();
// ui
@ -53,7 +53,6 @@ private slots:
void editItemButtonPressed(QAbstractButton *button);
private:
bool debug;
QVariant m_configArgs;
// methods
virtual void copyItem() = 0;

View File

@ -0,0 +1,139 @@
{
"__url": "http://openweathermap.org/weather-conditions",
"image": {
"__comment": "should be described as html image with full path inside",
"default": "",
"800": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/01d.png\">",
"801": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/02d.png\">",
"802": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/03d.png\">",
"803": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/03d.png\">",
"804": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/04d.png\">",
"300": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/09d.png\">",
"301": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/09d.png\">",
"302": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/09d.png\">",
"310": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/09d.png\">",
"311": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/09d.png\">",
"312": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/09d.png\">",
"313": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/09d.png\">",
"314": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/09d.png\">",
"321": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/09d.png\">",
"520": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/09d.png\">",
"521": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/09d.png\">",
"522": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/09d.png\">",
"531": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/09d.png\">",
"500": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/10d.png\">",
"501": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/10d.png\">",
"502": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/10d.png\">",
"503": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/10d.png\">",
"504": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/10d.png\">",
"200": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/11d.png\">",
"201": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/11d.png\">",
"202": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/11d.png\">",
"210": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/11d.png\">",
"211": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/11d.png\">",
"212": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/11d.png\">",
"221": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/11d.png\">",
"230": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/11d.png\">",
"231": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/11d.png\">",
"232": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/11d.png\">",
"511": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/13d.png\">",
"600": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/13d.png\">",
"601": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/13d.png\">",
"602": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/13d.png\">",
"611": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/13d.png\">",
"612": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/13d.png\">",
"615": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/13d.png\">",
"616": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/13d.png\">",
"620": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/13d.png\">",
"621": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/13d.png\">",
"622": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/13d.png\">",
"701": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/50d.png\">",
"711": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/50d.png\">",
"721": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/50d.png\">",
"731": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/50d.png\">",
"741": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/50d.png\">",
"751": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/50d.png\">",
"761": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/50d.png\">",
"762": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/50d.png\">",
"771": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/50d.png\">",
"781": "<img src=\"@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/weather/50d.png\">"
},
"text": {
"default": "\u2604",
"800": "\u2600",
"801": "\u26C5",
"802": "\u2601",
"803": "\u2601",
"804": "\u2601",
"300": "\u2602",
"301": "\u2602",
"302": "\u2602",
"310": "\u2602",
"311": "\u2602",
"312": "\u2602",
"313": "\u2602",
"314": "\u2602",
"321": "\u2602",
"520": "\u2602",
"521": "\u2602",
"522": "\u2602",
"531": "\u2602",
"500": "\u2614",
"501": "\u2614",
"502": "\u2614",
"503": "\u2614",
"504": "\u2614",
"200": "\u2608",
"201": "\u2608",
"202": "\u2608",
"210": "\u2608",
"211": "\u2608",
"212": "\u2608",
"221": "\u2608",
"230": "\u2608",
"231": "\u2608",
"232": "\u2608",
"511": "\u2603",
"600": "\u2603",
"601": "\u2603",
"602": "\u2603",
"611": "\u2603",
"612": "\u2603",
"615": "\u2603",
"616": "\u2603",
"620": "\u2603",
"621": "\u2603",
"622": "\u2603",
"701": "\u26C5",
"711": "\u26C5",
"721": "\u26C5",
"731": "\u26C5",
"741": "\u26C5",
"751": "\u26C5",
"761": "\u26C5",
"762": "\u26C5",
"771": "\u26C5",
"781": "\u26C5"
}
}

View File

@ -20,12 +20,11 @@
#include <KI18n/KLocalizedString>
#include <QDebug>
#include <QDir>
#include <QSettings>
#include <QStandardPaths>
#include <pdebug/pdebug.h>
#include "awdebug.h"
#include "abstractextitemaggregator.h"
@ -34,66 +33,105 @@ template <class T>
class ExtItemAggregator : public AbstractExtItemAggregator
{
public:
explicit ExtItemAggregator(QWidget *parent, const QString type,
const bool debugCmd = false)
: AbstractExtItemAggregator(parent, debugCmd),
debug(debugCmd),
explicit ExtItemAggregator(QWidget *parent, const QString type)
: AbstractExtItemAggregator(parent),
m_type(type)
{
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Type" << type;
qSetMessagePattern(LOG_FORMAT);
initItems();
};
~ExtItemAggregator()
virtual ~ExtItemAggregator()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
m_items.clear();
}
void editItems()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
repaint();
int ret = dialog->exec();
if (debug) qDebug() << PDEBUG << ":" << "Dialog returns" << ret;
qCInfo(LOG_LIB) << "Dialog returns" << ret;
};
void initItems()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
m_items.clear();
m_items = getItems();
};
T *itemFromWidget() const
T *itemByTag(const QString _tag) const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Tag" << _tag;
QListWidgetItem *item = widgetDialog->currentItem();
if (item == nullptr) return nullptr;
int originalItem = -1;
for (int i=0; i<m_items.count(); i++) {
if (m_items.at(i)->fileName() != item->text()) continue;
originalItem = i;
T *found = nullptr;
foreach(T *item, m_items) {
if (item->tag() != _tag) continue;
found = item;
break;
}
if (found == nullptr)
qCWarning(LOG_LIB) << "Could not find item by tag" << _tag;
return originalItem == -1 ? nullptr : m_items[originalItem];
return found;
}
T *itemByTagNumber(const int _number) const
{
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Number" << _number;
T *found = nullptr;
foreach(T *item, m_items) {
if (item->number() != _number) continue;
found = item;
break;
}
if (found == nullptr)
qCWarning(LOG_LIB) << "Could not find item by number" << _number;
return found;
}
T *itemFromWidget() const
{
qCDebug(LOG_LIB);
QListWidgetItem *widgetItem = widgetDialog->currentItem();
if (widgetItem == nullptr) return nullptr;
T *found = nullptr;
foreach(T *item, m_items) {
if (item->fileName() != widgetItem->text()) continue;
found = item;
break;
}
if (found == nullptr)
qCWarning(LOG_LIB) << "Could not find item by name" << widgetItem->text();
return found;
};
QList<T *> items() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_items;
};
int uniqNumber() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
QList<int> tagList;
foreach(T *item, m_items) tagList.append(item->number());
@ -104,14 +142,13 @@ public:
};
private:
bool debug;
QList<T *> m_items;
QString m_type;
// init method
QList<T *> getItems()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
// create directory at $HOME
QString localDir = QString("%1/awesomewidgets/%2")
@ -119,7 +156,7 @@ private:
.arg(m_type);
QDir localDirectory;
if (localDirectory.mkpath(localDir))
if (debug) qDebug() << PDEBUG << ":" << "Created directory" << localDir;
qCInfo(LOG_LIB) << "Created directory" << localDir;
QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
QString("awesomewidgets/%1").arg(m_type),
@ -131,17 +168,23 @@ private:
foreach(QString file, files) {
if (!file.endsWith(QString(".desktop"))) continue;
if (names.contains(file)) continue;
if (debug) qDebug() << PDEBUG << ":" << "Found file" << file << "in" << dir;
qCInfo(LOG_LIB) << "Found file" << file << "in" << dir;
names.append(file);
items.append(new T(this, file, dirs, debug));
items.append(new T(this, file, dirs));
}
}
// sort items
std::sort(items.begin(), items.end(), [](const T *lhs, const T *rhs){
return lhs->number() < rhs->number();
});
return items;
};
void repaint()
{
qCDebug(LOG_LIB);
widgetDialog->clear();
foreach(T *_item, m_items) {
QListWidgetItem *item = new QListWidgetItem(_item->fileName(), widgetDialog);
@ -157,12 +200,15 @@ private:
// methods
void copyItem()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
T *source = itemFromWidget();
QString fileName = getName();
int number = uniqNumber();
if ((source == nullptr) || (fileName.isEmpty())) return;
if ((source == nullptr) || (fileName.isEmpty())) {
qCWarning(LOG_LIB) << "Nothing to copy";
return;
}
T *newItem = source->copy(fileName, number);
if (newItem->showConfiguration(configArgs()) == 1) {
@ -173,16 +219,19 @@ private:
void createItem()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
QString fileName = getName();
int number = uniqNumber();
QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
QString("awesomewidgets/%1").arg(m_type),
QStandardPaths::LocateDirectory);
if (fileName.isEmpty()) return;
if (fileName.isEmpty()) {
qCWarning(LOG_LIB) << "Nothing to create";
return;
};
T *newItem = new T(this, fileName, dirs, debug);
T *newItem = new T(this, fileName, dirs);
newItem->setNumber(number);
if (newItem->showConfiguration(configArgs()) == 1) {
initItems();
@ -192,10 +241,13 @@ private:
void deleteItem()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
T *source = itemFromWidget();
if (source == nullptr) return;
if (source == nullptr) {
qCWarning(LOG_LIB) << "Nothing to delete";
return;
};
if (source->tryDelete()) {
initItems();
@ -205,10 +257,13 @@ private:
void editItem()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
T *source = itemFromWidget();
if (source == nullptr) return;
if (source == nullptr) {
qCWarning(LOG_LIB) << "Nothing to edit";
return;
};
if (source->showConfiguration(configArgs()) == 1) {
initItems();

View File

@ -20,7 +20,6 @@
#include <KI18n/KLocalizedString>
#include <QDebug>
#include <QDir>
#include <QJsonDocument>
#include <QJsonParseError>
@ -28,18 +27,19 @@
#include <QNetworkRequest>
#include <QSettings>
#include <pdebug/pdebug.h>
#include <qreplytimeout/qreplytimeout.h>
#include "awdebug.h"
#include "version.h"
ExtQuotes::ExtQuotes(QWidget *parent, const QString quotesName,
const QStringList directories, const bool debugCmd)
: AbstractExtItem(parent, quotesName, directories, debugCmd),
debug(debugCmd),
const QStringList directories)
: AbstractExtItem(parent, quotesName, directories),
ui(new Ui::ExtQuotes)
{
qCDebug(LOG_LIB);
readConfiguration();
ui->setupUi(this);
translate();
@ -62,7 +62,7 @@ ExtQuotes::ExtQuotes(QWidget *parent, const QString quotesName,
ExtQuotes::~ExtQuotes()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
disconnect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(quotesReplyReceived(QNetworkReply *)));
@ -71,18 +71,19 @@ ExtQuotes::~ExtQuotes()
}
ExtQuotes *ExtQuotes::copy(const QString fileName, const int number)
ExtQuotes *ExtQuotes::copy(const QString _fileName, const int _number)
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "File" << _fileName;
qCDebug(LOG_LIB) << "Number" << _number;
ExtQuotes *item = new ExtQuotes(static_cast<QWidget *>(parent()), fileName,
directories(), debug);
ExtQuotes *item = new ExtQuotes(static_cast<QWidget *>(parent()), _fileName, directories());
item->setActive(isActive());
item->setApiVersion(apiVersion());
item->setComment(comment());
item->setInterval(interval());
item->setName(name());
item->setNumber(number);
item->setNumber(_number);
item->setTicker(ticker());
return item;
@ -91,7 +92,7 @@ ExtQuotes *ExtQuotes::copy(const QString fileName, const int number)
QString ExtQuotes::ticker() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_ticker;
}
@ -99,7 +100,7 @@ QString ExtQuotes::ticker() const
QString ExtQuotes::uniq() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_ticker;
}
@ -107,8 +108,8 @@ QString ExtQuotes::uniq() const
void ExtQuotes::setTicker(const QString _ticker)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Ticker" << _ticker;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Ticker" << _ticker;
m_ticker = _ticker;
}
@ -116,7 +117,7 @@ void ExtQuotes::setTicker(const QString _ticker)
void ExtQuotes::readConfiguration()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
AbstractExtItem::readConfiguration();
for (int i=directories().count()-1; i>=0; i--) {
@ -130,6 +131,7 @@ void ExtQuotes::readConfiguration()
// update for current API
if ((apiVersion() > 0) && (apiVersion() < AWEQAPI)) {
qCWarning(LOG_LIB) << "Bump API version from" << apiVersion() << "to" << AWEQAPI;
setApiVersion(AWEQAPI);
writeConfiguration();
}
@ -138,11 +140,11 @@ void ExtQuotes::readConfiguration()
QVariantHash ExtQuotes::run()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
if ((!isActive()) || (isRunning)) return values;
if (times == 1) {
if (debug) qDebug() << PDEBUG << ":" << "Send request";
qCInfo(LOG_LIB) << "Send request";
isRunning = true;
QNetworkReply *reply = manager->get(QNetworkRequest(QUrl(url())));
new QReplyTimeout(reply, 1000);
@ -159,7 +161,7 @@ QVariantHash ExtQuotes::run()
int ExtQuotes::showConfiguration(const QVariant args)
{
Q_UNUSED(args)
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
ui->lineEdit_name->setText(name());
ui->lineEdit_comment->setText(comment());
@ -185,11 +187,11 @@ int ExtQuotes::showConfiguration(const QVariant args)
void ExtQuotes::writeConfiguration() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
AbstractExtItem::writeConfiguration();
QSettings settings(QString("%1/%2").arg(directories().first()).arg(fileName()), QSettings::IniFormat);
if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << settings.fileName();
qCInfo(LOG_LIB) << "Configuration file" << settings.fileName();
settings.beginGroup(QString("Desktop Entry"));
settings.setValue(QString("X-AW-Ticker"), m_ticker);
@ -200,17 +202,17 @@ void ExtQuotes::writeConfiguration() const
void ExtQuotes::quotesReplyReceived(QNetworkReply *reply)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Return code" << reply->error();
if (debug) qDebug() << PDEBUG << ":" << "Reply error message" << reply->errorString();
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Return code" << reply->error();
qCDebug(LOG_LIB) << "Reply error message" << reply->errorString();
isRunning = false;
QJsonParseError error;
QJsonDocument jsonDoc = QJsonDocument::fromJson(reply->readAll(), &error);
reply->deleteLater();
if (debug) qDebug() << PDEBUG << ":" << "Json parse error" << error.errorString();
if ((reply->error() != QNetworkReply::NoError) ||
(error.error != QJsonParseError::NoError)) {
qCWarning(LOG_LIB) << "Parse error" << error.errorString();
return;
}
QVariantMap jsonQuotes = jsonDoc.toVariant().toMap()[QString("query")].toMap();
@ -220,21 +222,21 @@ void ExtQuotes::quotesReplyReceived(QNetworkReply *reply)
// ask
value = jsonQuotes[QString("Ask")].toString().toFloat();
values[tag(QString("askchg"))] = values[QString("ask")].toFloat() == 0.0 ? 0.0 :
value - values[QString("ask")].toFloat();
value - values[QString("ask")].toFloat();
values[tag(QString("percaskchg"))] = 100.0 * values[QString("askchg")].toFloat() / values[QString("ask")].toFloat();
values[tag(QString("ask"))] = value;
// bid
value = jsonQuotes[QString("Bid")].toString().toFloat();
values[tag(QString("bidchg"))] = values[QString("bid")].toFloat() == 0.0 ? 0.0 :
value - values[QString("bid")].toFloat();
value - values[QString("bid")].toFloat();
values[tag(QString("percbidchg"))] = 100.0 * values[QString("bidchg")].toFloat() / values[QString("bid")].toFloat();
values[tag(QString("bid"))] = value;
// last trade
value = jsonQuotes[QString("LastTradePriceOnly")].toString().toFloat();
values[tag(QString("pricechg"))] = values[QString("price")].toFloat() == 0.0 ? 0.0 :
value - values[QString("price")].toFloat();
value - values[QString("price")].toFloat();
values[tag(QString("percpricechg"))] = 100.0 * values[QString("pricechg")].toFloat() / values[QString("price")].toFloat();
values[tag(QString("price"))] = value;
}
@ -242,7 +244,7 @@ void ExtQuotes::quotesReplyReceived(QNetworkReply *reply)
void ExtQuotes::translate()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
ui->label_name->setText(i18n("Name"));
ui->label_comment->setText(i18n("Comment"));
@ -256,11 +258,11 @@ void ExtQuotes::translate()
QString ExtQuotes::url() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
QString apiUrl = QString(YAHOO_URL);
apiUrl.replace(QString("$TICKER"), m_ticker);
if (debug) qDebug() << PDEBUG << ":" << "API url" << apiUrl;
qCInfo(LOG_LIB) << "API url" << apiUrl;
return apiUrl;
}

View File

@ -37,10 +37,9 @@ class ExtQuotes : public AbstractExtItem
public:
explicit ExtQuotes(QWidget *parent = nullptr, const QString quotesName = QString(),
const QStringList directories = QStringList(),
const bool debugCmd = false);
~ExtQuotes();
ExtQuotes *copy(const QString fileName, const int number);
const QStringList directories = QStringList());
virtual ~ExtQuotes();
ExtQuotes *copy(const QString _fileName, const int _number);
// get methods
QString ticker() const;
QString uniq() const;
@ -57,7 +56,6 @@ private slots:
void quotesReplyReceived(QNetworkReply *reply);
private:
bool debug;
QNetworkAccessManager *manager;
bool isRunning = false;
Ui::ExtQuotes *ui;

View File

@ -20,7 +20,6 @@
#include <KI18n/KLocalizedString>
#include <QDebug>
#include <QDir>
#include <QJsonDocument>
#include <QJsonParseError>
@ -28,17 +27,17 @@
#include <QStandardPaths>
#include <QTextCodec>
#include <pdebug/pdebug.h>
#include "awdebug.h"
#include "version.h"
ExtScript::ExtScript(QWidget *parent, const QString scriptName,
const QStringList directories, const bool debugCmd)
: AbstractExtItem(parent, scriptName, directories, debugCmd),
debug(debugCmd),
const QStringList directories)
: AbstractExtItem(parent, scriptName, directories),
ui(new Ui::ExtScript)
{
qCDebug(LOG_LIB);
readConfiguration();
readJsonFilters();
ui->setupUi(this);
@ -54,7 +53,7 @@ ExtScript::ExtScript(QWidget *parent, const QString scriptName,
ExtScript::~ExtScript()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
process->kill();
delete process;
@ -62,12 +61,13 @@ ExtScript::~ExtScript()
}
ExtScript *ExtScript::copy(const QString fileName, const int number)
ExtScript *ExtScript::copy(const QString _fileName, const int _number)
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "File" << _fileName;
qCDebug(LOG_LIB) << "Number" << _number;
ExtScript *item = new ExtScript(static_cast<QWidget *>(parent()), fileName,
directories(), debug);
ExtScript *item = new ExtScript(static_cast<QWidget *>(parent()), _fileName, directories());
item->setActive(isActive());
item->setApiVersion(apiVersion());
item->setComment(comment());
@ -75,7 +75,7 @@ ExtScript *ExtScript::copy(const QString fileName, const int number)
item->setHasOutput(hasOutput());
item->setInterval(interval());
item->setName(name());
item->setNumber(number);
item->setNumber(_number);
item->setPrefix(prefix());
item->setRedirect(redirect());
@ -85,7 +85,7 @@ ExtScript *ExtScript::copy(const QString fileName, const int number)
QString ExtScript::executable() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_executable;
}
@ -93,7 +93,7 @@ QString ExtScript::executable() const
QStringList ExtScript::filters() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_filters;
}
@ -101,7 +101,7 @@ QStringList ExtScript::filters() const
bool ExtScript::hasOutput() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_output;
}
@ -109,7 +109,7 @@ bool ExtScript::hasOutput() const
QString ExtScript::prefix() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_prefix;
}
@ -117,7 +117,7 @@ QString ExtScript::prefix() const
ExtScript::Redirect ExtScript::redirect() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_redirect;
}
@ -125,7 +125,7 @@ ExtScript::Redirect ExtScript::redirect() const
QString ExtScript::uniq() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_executable;
}
@ -133,7 +133,7 @@ QString ExtScript::uniq() const
QString ExtScript::strRedirect() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
QString value;
switch (m_redirect) {
@ -155,8 +155,8 @@ QString ExtScript::strRedirect() const
void ExtScript::setExecutable(const QString _executable)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Executable" << _executable;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Executable" << _executable;
m_executable = _executable;
}
@ -164,18 +164,20 @@ void ExtScript::setExecutable(const QString _executable)
void ExtScript::setFilters(const QStringList _filters)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Filters" << _filters;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Filters" << _filters;
foreach(QString filter, _filters)
updateFilter(filter);
std::for_each(_filters.cbegin(), _filters.cend(),
[this](QString filter) { return updateFilter(filter); });
// foreach(QString filter, _filters)
// updateFilter(filter);
}
void ExtScript::setHasOutput(const bool _state)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "State" << _state;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "State" << _state;
m_output = _state;
}
@ -183,8 +185,8 @@ void ExtScript::setHasOutput(const bool _state)
void ExtScript::setPrefix(const QString _prefix)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Prefix" << _prefix;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Prefix" << _prefix;
m_prefix = _prefix;
}
@ -192,8 +194,8 @@ void ExtScript::setPrefix(const QString _prefix)
void ExtScript::setRedirect(const Redirect _redirect)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Redirect" << _redirect;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Redirect" << _redirect;
m_redirect = _redirect;
}
@ -201,8 +203,8 @@ void ExtScript::setRedirect(const Redirect _redirect)
void ExtScript::setStrRedirect(const QString _redirect)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Redirect" << _redirect;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Redirect" << _redirect;
if (_redirect == QString("stdout2sdterr"))
m_redirect = stdout2stderr;
@ -215,14 +217,14 @@ void ExtScript::setStrRedirect(const QString _redirect)
QString ExtScript::applyFilters(QString _value) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Value" << _value;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Value" << _value;
foreach(QString filt, m_filters) {
if (debug) qDebug() << PDEBUG << ":" << "Found filter" << filt;
qCInfo(LOG_LIB) << "Found filter" << filt;
QVariantMap filter = jsonFilters[filt].toMap();
if (filter.isEmpty()) {
if (debug) qDebug() << PDEBUG << ":" << "Could not find filter in the json";
qCWarning(LOG_LIB) << "Could not find filter" << _value << "in the json";
continue;
}
foreach(QString f, filter.keys())
@ -235,9 +237,9 @@ QString ExtScript::applyFilters(QString _value) const
void ExtScript::updateFilter(const QString _filter, const bool _add)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Filter" << _filter;
if (debug) qDebug() << PDEBUG << ":" << "Should be added" << _add;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Filter" << _filter;
qCDebug(LOG_LIB) << "Should be added" << _add;
if (_add) {
if (m_filters.contains(_filter)) return;
@ -250,7 +252,7 @@ void ExtScript::updateFilter(const QString _filter, const bool _add)
void ExtScript::readConfiguration()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
AbstractExtItem::readConfiguration();
for (int i=directories().count()-1; i>=0; i--) {
@ -273,6 +275,7 @@ void ExtScript::readConfiguration()
// update for current API
if ((apiVersion() > 0) && (apiVersion() < AWESAPI)) {
qCWarning(LOG_LIB) << "Bump API version from" << apiVersion() << "to" << AWESAPI;
setApiVersion(AWESAPI);
writeConfiguration();
}
@ -281,37 +284,41 @@ void ExtScript::readConfiguration()
void ExtScript::readJsonFilters()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
QString fileName = QStandardPaths::locate(QStandardPaths::GenericDataLocation,
QString("awesomewidgets/scripts/awesomewidgets-extscripts-filters.json"));
if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << fileName;
qCInfo(LOG_LIB) << "Filters file" << fileName;
QFile jsonFile(fileName);
if (!jsonFile.open(QIODevice::ReadOnly | QIODevice::Text))
if (!jsonFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
qCWarning(LOG_LIB) << "Could not open" << fileName;
return;
}
QString jsonText = jsonFile.readAll();
jsonFile.close();
QJsonParseError error;
QJsonDocument jsonDoc = QJsonDocument::fromJson(jsonText.toUtf8(), &error);
if (debug) qDebug() << PDEBUG << ":" << "Json parse error" << error.errorString();
if (error.error != QJsonParseError::NoError) return;
if (error.error != QJsonParseError::NoError) {
qCWarning(LOG_LIB) << "Parse error" << error.errorString();
return;
}
jsonFilters = jsonDoc.toVariant().toMap();
if (debug) qDebug() << PDEBUG << ":" << "Filters" << jsonFilters;
qCInfo(LOG_LIB) << "Filters" << jsonFilters;
}
QVariantHash ExtScript::run()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
if (!isActive()) return value;
if ((times == 1) && (process->state() == QProcess::NotRunning)) {
QStringList cmdList;
if (!m_prefix.isEmpty()) cmdList.append(m_prefix);
cmdList.append(m_executable);
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmdList.join(QChar(' '));
qCInfo(LOG_LIB) << "Run cmd" << cmdList.join(QChar(' '));
process->start(cmdList.join(QChar(' ')));
} else if (times >= interval())
times = 0;
@ -324,7 +331,7 @@ QVariantHash ExtScript::run()
int ExtScript::showConfiguration(const QVariant args)
{
Q_UNUSED(args)
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
ui->lineEdit_name->setText(name());
ui->lineEdit_comment->setText(comment());
@ -364,11 +371,11 @@ int ExtScript::showConfiguration(const QVariant args)
void ExtScript::writeConfiguration() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
AbstractExtItem::writeConfiguration();
QSettings settings(QString("%1/%2").arg(directories().first()).arg(fileName()), QSettings::IniFormat);
if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << settings.fileName();
qCInfo(LOG_LIB) << "Configuration file" << settings.fileName();
settings.beginGroup(QString("Desktop Entry"));
settings.setValue(QString("Exec"), m_executable);
@ -384,25 +391,23 @@ void ExtScript::writeConfiguration() const
void ExtScript::updateValue()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process->exitCode();
qCInfo(LOG_LIB) << "Cmd returns" << process->exitCode();
QString qdebug = QTextCodec::codecForMib(106)->toUnicode(process->readAllStandardError()).trimmed();
if (debug) qDebug() << PDEBUG << ":" << "Error" << qdebug;
qCInfo(LOG_LIB) << "Error" << qdebug;
QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process->readAllStandardOutput()).trimmed();
qCInfo(LOG_LIB) << "Error" << qoutput;
QString strValue;
switch (m_redirect) {
case stdout2stderr:
if (debug) qDebug() << PDEBUG << ":" << "Debug" << qdebug;
if (debug) qDebug() << PDEBUG << ":" << "Output" << qoutput;
break;
case stderr2stdout:
strValue = QString("%1\n%2").arg(qdebug).arg(qoutput);
break;
case nothing:
default:
if (debug) qDebug() << PDEBUG << ":" << "Debug" << qdebug;
strValue = qoutput;
break;
}
@ -414,7 +419,7 @@ void ExtScript::updateValue()
void ExtScript::translate()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
ui->label_name->setText(i18n("Name"));
ui->label_comment->setText(i18n("Comment"));

View File

@ -45,10 +45,9 @@ public:
};
explicit ExtScript(QWidget *parent = nullptr, const QString scriptName = QString(),
const QStringList directories = QStringList(),
const bool debugCmd = false);
~ExtScript();
ExtScript *copy(const QString fileName, const int number);
const QStringList directories = QStringList());
virtual ~ExtScript();
ExtScript *copy(const QString _fileName, const int _number);
// get methods
QString executable() const;
QStringList filters() const;
@ -80,7 +79,6 @@ private slots:
void updateValue();
private:
bool debug;
QProcess *process = nullptr;
Ui::ExtScript *ui;
void translate();

View File

@ -20,22 +20,22 @@
#include <KI18n/KLocalizedString>
#include <QDebug>
#include <QDir>
#include <QRegExp>
#include <QSettings>
#include <QTextCodec>
#include <pdebug/pdebug.h>
#include "awdebug.h"
#include "version.h"
ExtUpgrade::ExtUpgrade(QWidget *parent, const QString upgradeName,
const QStringList directories, const bool debugCmd)
: AbstractExtItem(parent, upgradeName, directories, debugCmd),
debug(debugCmd),
const QStringList directories)
: AbstractExtItem(parent, upgradeName, directories),
ui(new Ui::ExtUpgrade)
{
qCDebug(LOG_LIB);
readConfiguration();
ui->setupUi(this);
translate();
@ -50,7 +50,7 @@ ExtUpgrade::ExtUpgrade(QWidget *parent, const QString upgradeName,
ExtUpgrade::~ExtUpgrade()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
process->kill();
delete process;
@ -58,19 +58,21 @@ ExtUpgrade::~ExtUpgrade()
}
ExtUpgrade *ExtUpgrade::copy(const QString fileName, const int number)
ExtUpgrade *ExtUpgrade::copy(const QString _fileName, const int _number)
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "File" << _fileName;
qCDebug(LOG_LIB) << "Number" << _number;
ExtUpgrade *item = new ExtUpgrade(static_cast<QWidget *>(parent()), fileName,
directories(), debug);
ExtUpgrade *item = new ExtUpgrade(static_cast<QWidget *>(parent()), _fileName, directories());
item->setActive(isActive());
item->setApiVersion(apiVersion());
item->setComment(comment());
item->setExecutable(executable());
item->setFilter(filter());
item->setInterval(interval());
item->setName(name());
item->setNumber(number);
item->setNumber(_number);
item->setNull(null());
return item;
@ -79,15 +81,23 @@ ExtUpgrade *ExtUpgrade::copy(const QString fileName, const int number)
QString ExtUpgrade::executable() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_executable;
}
QString ExtUpgrade::filter() const
{
qCDebug(LOG_LIB);
return m_filter;
}
int ExtUpgrade::null() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_null;
}
@ -95,7 +105,7 @@ int ExtUpgrade::null() const
QString ExtUpgrade::uniq() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_executable;
}
@ -103,17 +113,26 @@ QString ExtUpgrade::uniq() const
void ExtUpgrade::setExecutable(const QString _executable)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Executable" << _executable;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Executable" << _executable;
m_executable = _executable;
}
void ExtUpgrade::setFilter(const QString _filter)
{
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Filter" << _filter;
m_filter = _filter;
}
void ExtUpgrade::setNull(const int _null)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Null lines" << _null;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Null lines" << _null;
if (_null < 0) return;
m_null = _null;
@ -122,7 +141,7 @@ void ExtUpgrade::setNull(const int _null)
void ExtUpgrade::readConfiguration()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
AbstractExtItem::readConfiguration();
for (int i=directories().count()-1; i>=0; i--) {
@ -132,11 +151,14 @@ void ExtUpgrade::readConfiguration()
settings.beginGroup(QString("Desktop Entry"));
setExecutable(settings.value(QString("Exec"), m_executable).toString());
setNull(settings.value(QString("X-AW-Null"), m_null).toInt());
// api == 3
setFilter(settings.value(QString("X-AW-Filter"), m_filter).toString());
settings.endGroup();
}
// update for current API
if ((apiVersion() > 0) && (apiVersion() < AWEUAPI)) {
qCWarning(LOG_LIB) << "Bump API version from" << apiVersion() << "to" << AWEUAPI;
setApiVersion(AWEUAPI);
writeConfiguration();
}
@ -145,12 +167,14 @@ void ExtUpgrade::readConfiguration()
QVariantHash ExtUpgrade::run()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
if (!isActive()) return value;
if ((times == 1) && (process->state() == QProcess::NotRunning))
process->start(QString("sh -c \"%1\"").arg(m_executable));
else if (times >= interval())
if ((times == 1) && (process->state() == QProcess::NotRunning)) {
QString cmd = QString("sh -c \"%1\"").arg(m_executable);
qCInfo(LOG_LIB) << "Run cmd" << cmd;
process->start(cmd);
} else if (times >= interval())
times = 0;
times++;
@ -161,12 +185,13 @@ QVariantHash ExtUpgrade::run()
int ExtUpgrade::showConfiguration(const QVariant args)
{
Q_UNUSED(args)
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
ui->lineEdit_name->setText(name());
ui->lineEdit_comment->setText(comment());
ui->label_numberValue->setText(QString("%1").arg(number()));
ui->lineEdit_command->setText(m_executable);
ui->lineEdit_filter->setText(m_filter);
ui->checkBox_active->setCheckState(isActive() ? Qt::Checked : Qt::Unchecked);
ui->spinBox_null->setValue(m_null);
ui->spinBox_interval->setValue(interval());
@ -178,6 +203,7 @@ int ExtUpgrade::showConfiguration(const QVariant args)
setNumber(ui->label_numberValue->text().toInt());
setApiVersion(AWEUAPI);
setExecutable(ui->lineEdit_command->text());
setFilter(ui->lineEdit_filter->text());
setActive(ui->checkBox_active->checkState() == Qt::Checked);
setNull(ui->spinBox_null->value());
setInterval(ui->spinBox_interval->value());
@ -189,14 +215,15 @@ int ExtUpgrade::showConfiguration(const QVariant args)
void ExtUpgrade::writeConfiguration() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
AbstractExtItem::writeConfiguration();
QSettings settings(QString("%1/%2").arg(directories().first()).arg(fileName()), QSettings::IniFormat);
if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << settings.fileName();
qCInfo(LOG_LIB) << "Configuration file" << settings.fileName();
settings.beginGroup(QString("Desktop Entry"));
settings.setValue(QString("Exec"), m_executable);
settings.setValue(QString("X-AW-Filter"), m_filter);
settings.setValue(QString("X-AW-Null"), m_null);
settings.endGroup();
@ -206,24 +233,29 @@ void ExtUpgrade::writeConfiguration() const
void ExtUpgrade::updateValue()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process->exitCode();
if (debug) qDebug() << PDEBUG << ":" << "Error" << process->readAllStandardError();
qCInfo(LOG_LIB) << "Cmd returns" << process->exitCode();
qCInfo(LOG_LIB) << "Error" << process->readAllStandardError();
QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process->readAllStandardOutput()).trimmed();
value[tag(QString("pkgcount"))] = qoutput.split(QChar('\n'), QString::SkipEmptyParts).count() - m_null;
value[tag(QString("pkgcount"))] = [this](QString output) {
return m_filter.isEmpty() ?
output.split(QChar('\n'), QString::SkipEmptyParts).count() - m_null :
output.split(QChar('\n'), QString::SkipEmptyParts).filter(QRegExp(m_filter)).count();
}(qoutput);
}
void ExtUpgrade::translate()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
ui->label_name->setText(i18n("Name"));
ui->label_comment->setText(i18n("Comment"));
ui->label_number->setText(i18n("Tag"));
ui->label_command->setText(i18n("Command"));
ui->label_filter->setText(i18n("Filter"));
ui->checkBox_active->setText(i18n("Active"));
ui->label_null->setText(i18n("Null"));
ui->label_interval->setText(i18n("Interval"));

View File

@ -31,20 +31,22 @@ class ExtUpgrade : public AbstractExtItem
{
Q_OBJECT
Q_PROPERTY(QString executable READ executable WRITE setExecutable)
Q_PROPERTY(QString filter READ filter WRITE setFilter)
Q_PROPERTY(int null READ null WRITE setNull)
public:
explicit ExtUpgrade(QWidget *parent = nullptr, const QString upgradeName = QString(),
const QStringList directories = QStringList(),
const bool debugCmd = false);
~ExtUpgrade();
ExtUpgrade *copy(const QString fileName, const int number);
const QStringList directories = QStringList());
virtual ~ExtUpgrade();
ExtUpgrade *copy(const QString _fileName, const int _number);
// get methods
QString executable() const;
QString filter() const;
int null() const;
QString uniq() const;
// set methods
void setExecutable(const QString _executable = QString("/usr/bin/true"));
void setFilter(const QString _filter = QString());
void setNull(const int _null = 0);
public slots:
@ -57,12 +59,12 @@ private slots:
void updateValue();
private:
bool debug;
QProcess *process = nullptr;
Ui::ExtUpgrade *ui;
void translate();
// properties
QString m_executable = QString("/usr/bin/true");
QString m_filter = QString("");
int m_null = 0;
// internal properties
int times = 0;

View File

@ -104,6 +104,29 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_filter">
<item>
<widget class="QLabel" name="label_filter">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Filter</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_filter"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_active">
<item>

View File

@ -20,27 +20,29 @@
#include <KI18n/KLocalizedString>
#include <QDebug>
#include <QDir>
#include <QJsonDocument>
#include <QJsonParseError>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QSettings>
#include <QStandardPaths>
#include <pdebug/pdebug.h>
#include <qreplytimeout/qreplytimeout.h>
#include "awdebug.h"
#include "version.h"
ExtWeather::ExtWeather(QWidget *parent, const QString weatherName,
const QStringList directories, const bool debugCmd)
: AbstractExtItem(parent, weatherName, directories, debugCmd),
debug(debugCmd),
const QStringList directories)
: AbstractExtItem(parent, weatherName, directories),
ui(new Ui::ExtWeather)
{
qCDebug(LOG_LIB);
readConfiguration();
readJsonMap();
ui->setupUi(this);
translate();
@ -58,7 +60,7 @@ ExtWeather::ExtWeather(QWidget *parent, const QString weatherName,
ExtWeather::~ExtWeather()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
disconnect(manager, SIGNAL(finished(QNetworkReply *)),
this, SLOT(weatherReplyReceived(QNetworkReply *)));
@ -68,20 +70,22 @@ ExtWeather::~ExtWeather()
}
ExtWeather *ExtWeather::copy(const QString fileName, const int number)
ExtWeather *ExtWeather::copy(const QString _fileName, const int _number)
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "File" << _fileName;
qCDebug(LOG_LIB) << "Number" << _number;
ExtWeather *item = new ExtWeather(static_cast<QWidget *>(parent()), fileName,
directories(), debug);
ExtWeather *item = new ExtWeather(static_cast<QWidget *>(parent()), _fileName, directories());
item->setActive(isActive());
item->setApiVersion(apiVersion());
item->setCity(city());
item->setComment(comment());
item->setCountry(country());
item->setInterval(interval());
item->setImage(image());
item->setName(name());
item->setNumber(number);
item->setNumber(_number);
item->setTs(ts());
return item;
@ -90,107 +94,17 @@ ExtWeather *ExtWeather::copy(const QString fileName, const int number)
QString ExtWeather::weatherFromInt(const int _id) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "ID" << _id;
// refer to http://openweathermap.org/weather-conditions
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Weather ID" << _id;
QString weather;
switch (_id) {
case 800:
// 01d
weather = QString("\u2600");
break;
case 801:
// 02d
weather = QString("\u26C5");
break;
case 802:
case 803:
// 03d
weather = QString("\u2601");
break;
case 804:
// 04d
weather = QString("\u2601");
break;
case 300:
case 301:
case 302:
case 310:
case 311:
case 312:
case 313:
case 314:
case 321:
case 520:
case 521:
case 522:
case 531:
// 09d
weather = QString("\u2602");
break;
case 500:
case 501:
case 502:
case 503:
case 504:
// 10d
weather = QString("\u2614");
break;
case 200:
case 201:
case 202:
case 210:
case 211:
case 212:
case 221:
case 230:
case 231:
case 232:
// 11d
weather = QString("\u2608");
break;
case 511:
case 600:
case 601:
case 602:
case 611:
case 612:
case 615:
case 616:
case 620:
case 621:
case 622:
// 13d
weather = QString("\u2603");
// weather = QString("\u26C4");
break;
case 701:
case 711:
case 721:
case 731:
case 741:
case 751:
case 761:
case 762:
case 771:
case 781:
// 50d
weather = QString("\u26C5");
break;
default:
// extreme other conditions
weather = QString("\u2604");
break;
}
return weather;
QVariantMap map = jsonMap[m_image ? QString("image") : QString("text")].toMap();
return map.value(QString::number(_id), map[QString("default")]).toString();
}
QString ExtWeather::city() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_city;
}
@ -198,15 +112,23 @@ QString ExtWeather::city() const
QString ExtWeather::country() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_country;
}
bool ExtWeather::image() const
{
qCDebug(LOG_LIB);
return m_image;
}
int ExtWeather::ts() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_ts;
}
@ -214,7 +136,7 @@ int ExtWeather::ts() const
QString ExtWeather::uniq() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return QString("%1 (%2) at %3").arg(m_city).arg(m_country).arg(m_ts);
}
@ -222,8 +144,8 @@ QString ExtWeather::uniq() const
void ExtWeather::setCity(const QString _city)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "City" << _city;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "City" << _city;
m_city = _city;
}
@ -231,17 +153,26 @@ void ExtWeather::setCity(const QString _city)
void ExtWeather::setCountry(const QString _country)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Country" << _country;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Country" << _country;
m_country = _country;
}
void ExtWeather::setImage(const bool _image)
{
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Use image" << _image;
m_image = _image;
}
void ExtWeather::setTs(const int _ts)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Timestamp" << _ts;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Timestamp" << _ts;
m_ts = _ts;
}
@ -249,7 +180,7 @@ void ExtWeather::setTs(const int _ts)
void ExtWeather::readConfiguration()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
AbstractExtItem::readConfiguration();
for (int i=directories().count()-1; i>=0; i--) {
@ -260,24 +191,54 @@ void ExtWeather::readConfiguration()
setCity(settings.value(QString("X-AW-City"), m_city).toString());
setCountry(settings.value(QString("X-AW-Country"), m_country).toString());
setTs(settings.value(QString("X-AW-TS"), m_ts).toInt());
// api == 2
setImage(settings.value(QString("X-AW-Image"), QVariant(m_image)).toString() == QString("true"));
settings.endGroup();
}
// update for current API
if ((apiVersion() > 0) && (apiVersion() < AWEWAPI)) {
qCWarning(LOG_LIB) << "Bump API version from" << apiVersion() << "to" << AWEWAPI;
setApiVersion(AWEWAPI);
writeConfiguration();
}
}
void ExtWeather::readJsonMap()
{
qCDebug(LOG_LIB);
QString fileName = QStandardPaths::locate(QStandardPaths::GenericDataLocation,
QString("awesomewidgets/weather/awesomewidgets-extweather-ids.json"));
qCInfo(LOG_LIB) << "Map file" << fileName;
QFile jsonFile(fileName);
if (!jsonFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
qCWarning(LOG_LIB) << "Could not open" << fileName;
return;
}
QString jsonText = jsonFile.readAll();
jsonFile.close();
QJsonParseError error;
QJsonDocument jsonDoc = QJsonDocument::fromJson(jsonText.toUtf8(), &error);
if (error.error != QJsonParseError::NoError) {
qCWarning(LOG_LIB) << "Parse error" << error.errorString();
return;
}
jsonMap = jsonDoc.toVariant().toMap();
qCInfo(LOG_LIB) << "Weather map" << jsonMap;
}
QVariantHash ExtWeather::run()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
if ((!isActive()) || (isRunning)) return values;
if (times == 1) {
if (debug) qDebug() << PDEBUG << ":" << "Send request";
qCInfo(LOG_LIB) << "Send request";
isRunning = true;
QNetworkReply *reply = manager->get(QNetworkRequest(QUrl(url(m_ts != 0))));
new QReplyTimeout(reply, 1000);
@ -294,7 +255,7 @@ QVariantHash ExtWeather::run()
int ExtWeather::showConfiguration(const QVariant args)
{
Q_UNUSED(args)
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
ui->lineEdit_name->setText(name());
ui->lineEdit_comment->setText(comment());
@ -302,6 +263,7 @@ int ExtWeather::showConfiguration(const QVariant args)
ui->lineEdit_city->setText(m_city);
ui->lineEdit_country->setText(m_country);
ui->spinBox_timestamp->setValue(m_ts);
ui->checkBox_image->setCheckState(m_image ? Qt::Checked : Qt::Unchecked);
ui->checkBox_active->setCheckState(isActive() ? Qt::Checked : Qt::Unchecked);
ui->spinBox_interval->setValue(interval());
@ -314,6 +276,7 @@ int ExtWeather::showConfiguration(const QVariant args)
setCity(ui->lineEdit_city->text());
setCountry(ui->lineEdit_country->text());
setTs(ui->spinBox_timestamp->value());
setImage(ui->checkBox_image->checkState() == Qt::Checked);
setActive(ui->checkBox_active->checkState() == Qt::Checked);
setInterval(ui->spinBox_interval->value());
@ -324,15 +287,16 @@ int ExtWeather::showConfiguration(const QVariant args)
void ExtWeather::writeConfiguration() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
AbstractExtItem::writeConfiguration();
QSettings settings(QString("%1/%2").arg(directories().first()).arg(fileName()), QSettings::IniFormat);
if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << settings.fileName();
qCInfo(LOG_LIB) << "Configuration file" << settings.fileName();
settings.beginGroup(QString("Desktop Entry"));
settings.setValue(QString("X-AW-City"), m_city);
settings.setValue(QString("X-AW-Country"), m_country);
settings.setValue(QString("X-AW-Image"), m_image);
settings.setValue(QString("X-AW-TS"), m_ts);
settings.endGroup();
@ -342,24 +306,24 @@ void ExtWeather::writeConfiguration() const
void ExtWeather::weatherReplyReceived(QNetworkReply *reply)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Return code" << reply->error();
if (debug) qDebug() << PDEBUG << ":" << "Reply error message" << reply->errorString();
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Return code" << reply->error();
qCDebug(LOG_LIB) << "Reply error message" << reply->errorString();
isRunning = false;
QJsonParseError error;
QJsonDocument jsonDoc = QJsonDocument::fromJson(reply->readAll(), &error);
reply->deleteLater();
if (debug) qDebug() << PDEBUG << ":" << "Json parse error" << error.errorString();
if ((reply->error() != QNetworkReply::NoError) ||
(error.error != QJsonParseError::NoError)) {
qCWarning(LOG_LIB) << "Parse error" << error.errorString();
return;
}
// convert to map
QVariantMap json = jsonDoc.toVariant().toMap();
if (json[QString("cod")].toInt() != 200) {
if (debug) qDebug() << PDEBUG << ":" << "Invalid return code";
qCWarning(LOG_LIB) << "Invalid return code";
return;
}
@ -376,7 +340,8 @@ void ExtWeather::weatherReplyReceived(QNetworkReply *reply)
QVariantHash ExtWeather::parseSingleJson(const QVariantMap json) const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Single json data" << json;
QVariantHash output;
@ -402,7 +367,7 @@ QVariantHash ExtWeather::parseSingleJson(const QVariantMap json) const
void ExtWeather::translate()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
ui->label_name->setText(i18n("Name"));
ui->label_comment->setText(i18n("Comment"));
@ -410,6 +375,7 @@ void ExtWeather::translate()
ui->label_city->setText(i18n("City"));
ui->label_country->setText(i18n("Country"));
ui->label_timestamp->setText(i18n("Timestamp"));
ui->checkBox_image->setText(i18n("Use images"));
ui->checkBox_active->setText(i18n("Active"));
ui->label_interval->setText(i18n("Interval"));
}
@ -417,13 +383,13 @@ void ExtWeather::translate()
QString ExtWeather::url(const bool isForecast) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << "Is forecast" << isForecast;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Is forecast" << isForecast;
QString apiUrl = isForecast ? QString(OWM_FORECAST_URL) : QString(OWM_URL);
apiUrl.replace(QString("$CITY"), m_city);
apiUrl.replace(QString("$COUNTRY"), m_country);
if (debug) qDebug() << PDEBUG << ":" << "API url" << apiUrl;
qCInfo(LOG_LIB) << "API url" << apiUrl;
return apiUrl;
}

View File

@ -36,27 +36,30 @@ class ExtWeather : public AbstractExtItem
Q_OBJECT
Q_PROPERTY(QString city READ city WRITE setCity)
Q_PROPERTY(QString country READ country WRITE setCountry)
Q_PROPERTY(bool image READ image WRITE setImage)
Q_PROPERTY(int ts READ ts WRITE setTs)
public:
explicit ExtWeather(QWidget *parent = nullptr, const QString weatherName = QString(),
const QStringList directories = QStringList(),
const bool debugCmd = false);
~ExtWeather();
ExtWeather *copy(const QString fileName, const int number);
const QStringList directories = QStringList());
virtual ~ExtWeather();
ExtWeather *copy(const QString _fileName, const int _number);
QString weatherFromInt(const int _id) const;
// get methods
QString city() const;
QString country() const;
bool image() const;
int ts() const;
QString uniq() const;
// set methods
void setCity(const QString _city = QString("London"));
void setCountry(const QString _country = QString("uk"));
void setImage(const bool _image = false);
void setTs(const int _ts = 0);
public slots:
void readConfiguration();
void readJsonMap();
QVariantHash run();
int showConfiguration(const QVariant args = QVariant());
void writeConfiguration() const;
@ -65,7 +68,6 @@ private slots:
void weatherReplyReceived(QNetworkReply *reply);
private:
bool debug;
QNetworkAccessManager *manager;
bool isRunning = false;
Ui::ExtWeather *ui;
@ -75,7 +77,9 @@ private:
// properties
QString m_city = QString("London");
QString m_country = QString("uk");
bool m_image = false;
int m_ts = 0;
QVariantMap jsonMap = QVariantMap();
// values
int times = 0;
QVariantHash values;

View File

@ -148,6 +148,36 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_image">
<item>
<spacer name="spacer_image">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBox_image">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Use images</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_active">
<item>

View File

@ -22,24 +22,23 @@
#include <QBuffer>
#include <QColorDialog>
#include <QDebug>
#include <QDir>
#include <QGraphicsEllipseItem>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QSettings>
#include <pdebug/pdebug.h>
#include "awdebug.h"
#include "version.h"
GraphicalItem::GraphicalItem(QWidget *parent, const QString desktopName,
const QStringList directories, const bool debugCmd)
: AbstractExtItem(parent, desktopName, directories, debugCmd),
debug(debugCmd),
const QStringList directories)
: AbstractExtItem(parent, desktopName, directories),
ui(new Ui::GraphicalItem)
{
qCDebug(LOG_LIB);
readConfiguration();
ui->setupUi(this);
translate();
@ -51,18 +50,19 @@ GraphicalItem::GraphicalItem(QWidget *parent, const QString desktopName,
GraphicalItem::~GraphicalItem()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
delete ui;
}
GraphicalItem *GraphicalItem::copy(const QString fileName, const int number)
GraphicalItem *GraphicalItem::copy(const QString _fileName, const int _number)
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "File" << _fileName;
qCDebug(LOG_LIB) << "Number" << _number;
GraphicalItem *item = new GraphicalItem(static_cast<QWidget *>(parent()),
fileName, directories(), debug);
GraphicalItem *item = new GraphicalItem(static_cast<QWidget *>(parent()), _fileName, directories());
item->setActive(isActive());
item->setActiveColor(activeColor());
item->setApiVersion(apiVersion());
@ -72,8 +72,8 @@ GraphicalItem *GraphicalItem::copy(const QString fileName, const int number)
item->setHeight(height());
item->setInactiveColor(inactiveColor());
item->setInterval(interval());
item->setName(QString("bar%1").arg(number));
item->setNumber(number);
item->setName(QString("bar%1").arg(_number));
item->setNumber(_number);
item->setType(type());
item->setWidth(width());
@ -83,14 +83,14 @@ GraphicalItem *GraphicalItem::copy(const QString fileName, const int number)
QString GraphicalItem::image(const float value) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Value" << value;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Value" << value;
if (m_bar == QString("none")) return QString("");
QColor active = stringToColor(m_activeColor);
QColor inactive = stringToColor(m_inactiveColor);
float percent = value / 100.0;
int scale[2] = {1, 1};
int scale[2] = { 1, 1 };
QPen pen = QPen();
QGraphicsScene *scene = new QGraphicsScene();
scene->setBackgroundBrush(QBrush(Qt::NoBrush));
@ -163,7 +163,7 @@ QString GraphicalItem::image(const float value) const
QString GraphicalItem::bar() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_bar;
}
@ -171,7 +171,7 @@ QString GraphicalItem::bar() const
QString GraphicalItem::activeColor() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_activeColor;
}
@ -179,15 +179,23 @@ QString GraphicalItem::activeColor() const
QString GraphicalItem::inactiveColor() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_inactiveColor;
}
QString GraphicalItem::tag() const
{
qCDebug(LOG_LIB);
return name() + m_bar;
}
GraphicalItem::Type GraphicalItem::type() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_type;
}
@ -195,7 +203,7 @@ GraphicalItem::Type GraphicalItem::type() const
QString GraphicalItem::strType() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
QString value;
switch (m_type) {
@ -216,7 +224,7 @@ QString GraphicalItem::strType() const
GraphicalItem::Direction GraphicalItem::direction() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_direction;
}
@ -224,7 +232,7 @@ GraphicalItem::Direction GraphicalItem::direction() const
QString GraphicalItem::strDirection() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
QString value;
switch (m_direction) {
@ -242,7 +250,7 @@ QString GraphicalItem::strDirection() const
int GraphicalItem::height() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_height;
}
@ -250,7 +258,7 @@ int GraphicalItem::height() const
int GraphicalItem::width() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_width;
}
@ -258,7 +266,7 @@ int GraphicalItem::width() const
QString GraphicalItem::uniq() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
return m_bar;
}
@ -266,25 +274,21 @@ QString GraphicalItem::uniq() const
void GraphicalItem::setBar(const QString _bar)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Bar" << _bar;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Bar" << _bar;
if ((!_bar.contains(QRegExp(QString("cpu(?!cl).*")))) &&
(!_bar.contains(QRegExp(QString("gpu")))) &&
(!_bar.contains(QRegExp(QString("mem")))) &&
(!_bar.contains(QRegExp(QString("swap")))) &&
(!_bar.contains(QRegExp(QString("hdd[0-9].*")))) &&
(!_bar.contains(QRegExp(QString("bat.*")))))
if (!_bar.contains(QRegExp(QString("^(cpu(?!cl).*|gpu$|mem$|swap$|hdd[0-9].*|bat.*)")))) {
qCWarning(LOG_LIB) << "Unsupported bar type" << _bar;
m_bar = QString("none");
else
} else
m_bar = _bar;
}
void GraphicalItem::setActiveColor(const QString _color)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Color" << _color;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Color" << _color;
m_activeColor = _color;
}
@ -292,8 +296,8 @@ void GraphicalItem::setActiveColor(const QString _color)
void GraphicalItem::setInactiveColor(const QString _color)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Color" << _color;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Color" << _color;
m_inactiveColor = _color;
}
@ -301,8 +305,8 @@ void GraphicalItem::setInactiveColor(const QString _color)
void GraphicalItem::setType(const Type _type)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Type" << _type;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Type" << _type;
m_type = _type;
}
@ -310,8 +314,8 @@ void GraphicalItem::setType(const Type _type)
void GraphicalItem::setStrType(const QString _type)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Type" << _type;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Type" << _type;
if (_type == QString("Vertical"))
setType(Vertical);
@ -324,8 +328,8 @@ void GraphicalItem::setStrType(const QString _type)
void GraphicalItem::setDirection(const Direction _direction)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Direction" << _direction;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Direction" << _direction;
m_direction = _direction;
}
@ -333,8 +337,8 @@ void GraphicalItem::setDirection(const Direction _direction)
void GraphicalItem::setStrDirection(const QString _direction)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Direction" << _direction;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Direction" << _direction;
if (_direction == QString("RightToLeft"))
setDirection(RightToLeft);
@ -345,8 +349,8 @@ void GraphicalItem::setStrDirection(const QString _direction)
void GraphicalItem::setHeight(const int _height)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Height" << _height;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Height" << _height;
if (_height <= 0) return;
m_height = _height;
@ -355,8 +359,8 @@ void GraphicalItem::setHeight(const int _height)
void GraphicalItem::setWidth(const int _width)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Width" << _width;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Width" << _width;
if (_width <= 0) return;
m_width = _width;
@ -365,7 +369,7 @@ void GraphicalItem::setWidth(const int _width)
void GraphicalItem::readConfiguration()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
AbstractExtItem::readConfiguration();
for (int i=directories().count()-1; i>=0; i--) {
@ -387,6 +391,7 @@ void GraphicalItem::readConfiguration()
// update for current API
if ((apiVersion() > 0) && (apiVersion() < AWGIAPI)) {
qCWarning(LOG_LIB) << "Bump API version from" << apiVersion() << "to" << AWGIAPI;
setApiVersion(AWGIAPI);
writeConfiguration();
}
@ -395,7 +400,7 @@ void GraphicalItem::readConfiguration()
QVariantHash GraphicalItem::run()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
// required by abstract class
return QVariantHash();
@ -404,7 +409,8 @@ QVariantHash GraphicalItem::run()
int GraphicalItem::showConfiguration(const QVariant args)
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Combobox arguments" << args;
QStringList tags = args.toStringList();
ui->label_nameValue->setText(name());
@ -440,11 +446,11 @@ int GraphicalItem::showConfiguration(const QVariant args)
void GraphicalItem::writeConfiguration() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
AbstractExtItem::writeConfiguration();
QSettings settings(QString("%1/%2").arg(directories().first()).arg(fileName()), QSettings::IniFormat);
if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << settings.fileName();
qCInfo(LOG_LIB) << "Configuration file" << settings.fileName();
settings.beginGroup(QString("Desktop Entry"));
settings.setValue(QString("X-AW-Value"), m_bar);
@ -462,26 +468,28 @@ void GraphicalItem::writeConfiguration() const
void GraphicalItem::changeColor()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
QColor color = stringToColor((static_cast<QPushButton *>(sender()))->text());
QColor newColor = QColorDialog::getColor(color, this, tr("Select color"),
QColorDialog::ShowAlphaChannel);
if (!newColor.isValid()) return;
qCInfo(LOG_LIB) << "Selected color" << newColor;
QStringList colorText;
colorText.append(QString("%1").arg(newColor.red()));
colorText.append(QString("%1").arg(newColor.green()));
colorText.append(QString("%1").arg(newColor.blue()));
colorText.append(QString("%1").arg(newColor.alpha()));
static_cast<QPushButton *>(sender())->setText(colorText.join(QChar(',')));
return static_cast<QPushButton *>(sender())->setText(colorText.join(QChar(',')));
}
QColor GraphicalItem::stringToColor(const QString _color) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Color" << _color;
qCDebug(LOG_LIB);
qCDebug(LOG_LIB) << "Color" << _color;
QColor qcolor;
QStringList listColor = _color.split(QChar(','));
@ -498,7 +506,7 @@ QColor GraphicalItem::stringToColor(const QString _color) const
void GraphicalItem::translate()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_LIB);
ui->label_name->setText(i18n("Name"));
ui->label_comment->setText(i18n("Comment"));

View File

@ -50,15 +50,15 @@ public:
};
explicit GraphicalItem(QWidget *parent = nullptr, const QString desktopName = QString(),
const QStringList directories = QStringList(),
const bool debugCmd = false);
~GraphicalItem();
GraphicalItem *copy(const QString fileName, const int number);
const QStringList directories = QStringList());
virtual ~GraphicalItem();
GraphicalItem *copy(const QString _fileName, const int _number);
QString image(const float value) const;
// get methods
QString bar() const;
QString activeColor() const;
QString inactiveColor() const;
QString tag() const;
Type type() const;
QString strType() const;
Direction direction() const;
@ -89,14 +89,10 @@ private slots:
private:
QString m_fileName;
QStringList m_dirs;
bool debug;
Ui::GraphicalItem *ui;
QColor stringToColor(const QString _color) const;
void translate();
// properties
int m_apiVersion = 0;
QString m_name = QString("none");
QString m_comment = QString("empty");
QString m_bar = QString("cpu");
QString m_activeColor = QString("0,0,0,130");
QString m_inactiveColor = QString("255,255,255,130");

View File

@ -4,7 +4,7 @@ Name=aw-get-external-ip
Comment=Custom command to get external IP
Exec=curl ip4.telize.com
X-AW-Prefix=
X-AW-Active=true
X-AW-Active=false
X-AW-Output=true
X-AW-Redirect=nothing
X-AW-Interval=1

View File

@ -4,7 +4,8 @@ Name=default-arch
Comment=Archlinux upgrade info
Exec=pacman -Qu
X-AW-Active=false
X-AW-Filter=
X-AW-Null=0
X-AW-Interval=3600
X-AW-ApiVersion=2
X-AW-ApiVersion=3
X-AW-Number=0

View File

@ -4,7 +4,8 @@ Name=default-debian
Comment=Debian upgrade info
Exec=apt-show-versions -u -b
X-AW-Active=false
X-AW-Filter=
X-AW-Null=0
X-AW-Interval=3600
X-AW-ApiVersion=2
X-AW-ApiVersion=3
X-AW-Number=1

View File

@ -4,7 +4,8 @@ Name=default-fedora
Comment=Fedora upgrade info
Exec=yum list updates
X-AW-Active=false
X-AW-Filter=
X-AW-Null=3
X-AW-Interval=3600
X-AW-ApiVersion=2
X-AW-ApiVersion=3
X-AW-Number=2

View File

@ -4,7 +4,8 @@ Name=default-mandriva
Comment=Mandriva upgrade info
Exec=urpmq --auto-select
X-AW-Active=false
X-AW-Filter=
X-AW-Null=0
X-AW-Interval=3600
X-AW-ApiVersion=2
X-AW-ApiVersion=3
X-AW-Number=3

View File

@ -4,7 +4,8 @@ Name=default-ubuntu
Comment=Ubuntu upgrade info
Exec=aptitude search '~U'
X-AW-Active=false
X-AW-Filter=
X-AW-Null=0
X-AW-Interval=3600
X-AW-ApiVersion=2
X-AW-ApiVersion=3
X-AW-Number=4

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -3,9 +3,10 @@ Comment=London current weather
Encoding=UTF-8
Name=London current
X-AW-Active=false
X-AW-ApiVersion=1
X-AW-ApiVersion=2
X-AW-City=London
X-AW-Country=uk
X-AW-Image=false
X-AW-Interval=3600
X-AW-Number=0
X-AW-TS=0

View File

@ -38,9 +38,6 @@
<entry name="mark" type="string">
<default>¤</default>
</entry>
<entry name="panels" type="int">
<default>-1</default>
</entry>
</group>
<group name="Appearance">

View File

@ -111,6 +111,6 @@ Item {
}
Component.onCompleted: {
if (debug) console.log("[about::onCompleted]")
if (debug) console.debug()
}
}

View File

@ -69,6 +69,7 @@ Item {
width: parent.width * 2 / 3
text: plasmoid.configuration.currentFontFamily
onClicked: {
if (debug) console.debug()
fontDialog.setFont()
fontDialog.visible = true
}
@ -133,8 +134,10 @@ Item {
]
onCurrentIndexChanged: cfg_currentFontWeight = model[currentIndex]["name"]
Component.onCompleted: {
if (debug) console.debug()
for (var i = 0; i < model.length; i++) {
if (model[i]["name"] == plasmoid.configuration.currentFontWeight) {
if (debug) console.info("Found", model[i]["name"], "on", i)
fontWeight.currentIndex = i;
}
}
@ -168,8 +171,10 @@ Item {
]
onCurrentIndexChanged: cfg_currentFontStyle = model[currentIndex]["name"]
Component.onCompleted: {
if (debug) console.debug()
for (var i = 0; i < model.length; i++) {
if (model[i]["name"] == plasmoid.configuration.currentFontStyle) {
if (debug) console.info("Found", model[i]["name"], "on", i)
fontStyle.currentIndex = i;
}
}
@ -214,12 +219,14 @@ Item {
signal setFont
onAccepted: {
if (debug) console.debug()
selectFont.text = fontDialog.font.family
fontSize.value = fontDialog.font.pointSize
fontStyle.currentIndex = fontDialog.font.italic ? 1 : 0
fontWeight.currentIndex = weight[fontDialog.font.weight]
}
onSetFont: {
if (debug) console.debug()
fontDialog.font = Qt.font({
family: selectFont.text,
pointSize: fontSize.value > 0 ? fontSize.value : 12,
@ -230,6 +237,6 @@ Item {
}
Component.onCompleted: {
if (debug) console.log("[activeapp::onCompleted]")
if (debug) console.debug()
}
}

View File

@ -29,7 +29,7 @@ Item {
DPAdds {
id: dpAdds;
}
width: childrenRect.width
height: childrenRect.height
implicitWidth: pageColumn.implicitWidth
@ -128,8 +128,10 @@ Item {
]
onCurrentIndexChanged: cfg_tooltipType = model[currentIndex]["name"]
Component.onCompleted: {
if (debug) console.debug()
for (var i = 0; i < model.length; i++) {
if (model[i]["name"] == plasmoid.configuration.tooltipType) {
if (debug) console.info("Found", model[i]["name"], "on", i)
tooltipType.currentIndex = i;
}
}
@ -228,23 +230,6 @@ Item {
onCurrentIndexChanged: cfg_mark = currentText
}
}
// Row {
// height: implicitHeight
// width: parent.width
// QtControls.Label {
// height: parent.height
// width: parent.width * 2 / 5
// horizontalAlignment: Text.AlignRight
// verticalAlignment: Text.AlignVCenter
// text: i18n("Panels to be hidden")
// }
// QtControls.Button {
// width: parent.width * 3 / 5
// text: i18n("Edit panels")
// onClicked: cfg_panels = dpAdds.editPanelsToContol(plasmoid.configuration.panels)
// }
// }
}
QtDialogs.ColorDialog {
@ -255,6 +240,6 @@ Item {
}
Component.onCompleted: {
if (debug) console.log("[advanced::onCompleted]")
if (debug) console.debug()
}
}

View File

@ -69,6 +69,7 @@ Item {
width: parent.width * 2 / 3
text: plasmoid.configuration.fontFamily
onClicked: {
if (debug) console.debug()
fontDialog.setFont()
fontDialog.visible = true
}
@ -133,8 +134,10 @@ Item {
]
onCurrentIndexChanged: cfg_fontWeight = model[currentIndex]["name"]
Component.onCompleted: {
if (debug) console.debug()
for (var i = 0; i < model.length; i++) {
if (model[i]["name"] == plasmoid.configuration.fontWeight) {
if (debug) console.info("Found", model[i]["name"], "on", i)
fontWeight.currentIndex = i;
}
}
@ -168,8 +171,10 @@ Item {
]
onCurrentIndexChanged: cfg_fontStyle = model[currentIndex]["name"]
Component.onCompleted: {
if (debug) console.debug()
for (var i = 0; i < model.length; i++) {
if (model[i]["name"] == plasmoid.configuration.fontStyle) {
if (debug) console.info("Found", model[i]["name"], "on", i)
fontStyle.currentIndex = i;
}
}
@ -214,12 +219,14 @@ Item {
signal setFont
onAccepted: {
if (debug) console.debug()
selectFont.text = fontDialog.font.family
fontSize.value = fontDialog.font.pointSize
fontStyle.currentIndex = fontDialog.font.italic ? 1 : 0
fontWeight.currentIndex = weight[fontDialog.font.weight]
}
onSetFont: {
if (debug) console.debug()
fontDialog.font = Qt.font({
family: selectFont.text,
pointSize: fontSize.value > 0 ? fontSize.value : 12,
@ -230,6 +237,6 @@ Item {
}
Component.onCompleted: {
if (debug) console.log("[inactiveapp::onCompleted]")
if (debug) console.debug()
}
}

View File

@ -108,11 +108,11 @@ Item {
}
onNeedUpdate: {
if (debug) console.log("[main::onNeedUpdate]")
if (debug) console.debug()
for (var i=0; i<repeater.count; i++) {
if (!repeater.itemAt(i)) {
if (debug) console.log("[main::onNeedUpdate] : Nothing to do here " + i)
if (debug) console.info("Nothing to do here", i)
timer.start()
return
}
@ -138,7 +138,7 @@ Item {
}
onNeedTooltipUpdate: {
if (debug) console.log("[main::onNeedTooltipUpdate]")
if (debug) console.debug()
for (var i=0; i<repeater.count; i++) {
repeater.itemAt(i).tooltip.text = dpAdds.toolTipImage(i + 1)
@ -146,7 +146,7 @@ Item {
}
onSizeUpdate: {
if (debug) console.log("[main::onSizeUpdate]")
if (debug) console.debug()
if (plasmoid.configuration.height == 0) {
var newHeight = 0
@ -170,25 +170,18 @@ Item {
}
}
Plasmoid.onActivated: {
if (debug) console.log("[main::onActivated]")
// dpAdds.changePanelsState()
}
Plasmoid.onUserConfiguringChanged: {
if (plasmoid.userConfiguring) return
if (debug) console.log("[main::onUserConfiguringChanged]")
if (debug) console.debug()
dpAdds.setMark(plasmoid.configuration.mark)
dpAdds.setPanelsToControl(plasmoid.configuration.panels)
dpAdds.setToolTipData(tooltipSettings)
needUpdate()
}
Component.onCompleted: {
if (debug) console.log("[main::onCompleted]")
if (debug) console.debug()
// init submodule
Plasmoid.userConfiguringChanged(false)

View File

@ -1 +1 @@
singleton general general.qml
singleton general 1.0 general.qml

View File

@ -59,8 +59,7 @@ Item {
iconName: "font"
onClicked: {
if (debug) console.log("[widget::onClicked] : Font button")
if (debug) console.debug("Font button")
var defaultFont = {
"color": plasmoid.configuration.fontColor,
"family": plasmoid.configuration.fontFamily,
@ -81,8 +80,7 @@ Item {
iconName: "format-indent-more"
onClicked: {
if (debug) console.log("[widget::onClicked] : Indent button")
if (debug) console.debug("Indent button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -95,8 +93,7 @@ Item {
iconName: "format-text-bold"
onClicked: {
if (debug) console.log("[widget::onClicked] : Bold button")
if (debug) console.debug("Bold button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -108,8 +105,7 @@ Item {
iconName: "format-text-italic"
onClicked: {
if (debug) console.log("[widget::onClicked] : Italic button")
if (debug) console.debug("Italic button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -121,8 +117,7 @@ Item {
iconName: "format-text-underline"
onClicked: {
if (debug) console.log("[widget::onClicked] : Underline button")
if (debug) console.debug("Underline button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -134,8 +129,7 @@ Item {
iconName: "format-text-strikethrough"
onClicked: {
if (debug) console.log("[widget::onClicked] : Strike button")
if (debug) console.debug("Strike button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -148,8 +142,7 @@ Item {
iconName: "format-justify-left"
onClicked: {
if (debug) console.log("[widget::onClicked] : Left button")
if (debug) console.debug("Left button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -161,8 +154,7 @@ Item {
iconName: "format-justify-center"
onClicked: {
if (debug) console.log("[widget::onClicked] : Center button")
if (debug) console.debug("Center button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -174,8 +166,7 @@ Item {
iconName: "format-justify-right"
onClicked: {
if (debug) console.log("[widget::onClicked] : Right button")
if (debug) console.debug("Right button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -187,8 +178,7 @@ Item {
iconName: "format-justify-fill"
onClicked: {
if (debug) console.log("[widget::onClicked] : Justify button")
if (debug) console.debug("Justify button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -210,8 +200,7 @@ Item {
text: i18n("Add")
onClicked: {
if (debug) console.log("[widget::onClicked] : Add tag button")
if (debug) console.debug("Add tag button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
@ -223,8 +212,7 @@ Item {
text: i18n("Show value")
onClicked: {
if (debug) console.log("[widget::onClicked] : Show tag button")
if (debug) console.debug("Show tag button")
var message = i18n("Tag: %1", tags.currentText)
message += "<br>"
message += i18n("Value: %1", dpAdds.valueByKey(tags.currentText))
@ -244,6 +232,6 @@ Item {
Component.onCompleted: {
if (debug) console.log("[widget::onCompleted]")
if (debug) console.debug()
}
}

View File

@ -11,8 +11,7 @@ include_directories(
${Kf5_INCLUDE}
)
file(GLOB_RECURSE SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/fontdialog/*.cpp
${PROJECT_TRDPARTY_DIR}/pdebug/*.cpp)
file(GLOB SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/fontdialog/*.cpp ${CMAKE_SOURCE_DIR}/*.cpp)
file(GLOB SUBPROJECT_NOTIFY *.notifyrc)
add_library(${PLUGIN_NAME} SHARED ${SUBPROJECT_SOURCE})

View File

@ -22,7 +22,6 @@
#include <KWindowSystem/KWindowSystem>
#include <QBuffer>
#include <QDebug>
#include <QGraphicsPixmapItem>
#include <QGraphicsScene>
#include <QGraphicsView>
@ -30,49 +29,45 @@
#include <QListWidget>
#include <QMessageBox>
#include <QPixmap>
#include <QProcessEnvironment>
#include <QScreen>
#include <fontdialog/fontdialog.h>
#include <pdebug/pdebug.h>
#include <pdebug/pdebug-time.h>
#include "awdebug.h"
#include "version.h"
DPAdds::DPAdds(QObject *parent)
: QObject(parent)
{
qInstallMessageHandler(debugString);
qCDebug(LOG_DP);
// debug
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
debug = (debugEnv == QString("yes"));
// logging
qSetMessagePattern(LOG_FORMAT);
connect(KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), this, SLOT(changeDesktop(int)));
connect(KWindowSystem::self(), SIGNAL(windowAdded(WId)), this, SLOT(changeWindowList(WId)));
connect(KWindowSystem::self(), SIGNAL(windowRemoved(WId)), this, SLOT(changeWindowList(WId)));
connect(KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), this, SIGNAL(desktopChanged()));
connect(KWindowSystem::self(), SIGNAL(windowAdded(WId)), this, SIGNAL(windowListChanged()));
connect(KWindowSystem::self(), SIGNAL(windowRemoved(WId)), this, SIGNAL(windowListChanged()));
}
DPAdds::~DPAdds()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_DP);
}
bool DPAdds::isDebugEnabled() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_DP);
return debug;
return LOG_DP().isDebugEnabled();
}
int DPAdds::currentDesktop() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_DP);
return KWindowSystem::currentDesktop();
}
@ -80,7 +75,7 @@ int DPAdds::currentDesktop() const
QStringList DPAdds::dictKeys() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_DP);
QStringList allKeys;
allKeys.append(QString("mark"));
@ -94,7 +89,7 @@ QStringList DPAdds::dictKeys() const
int DPAdds::numberOfDesktops() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_DP);
return KWindowSystem::numberOfDesktops();
}
@ -102,15 +97,16 @@ int DPAdds::numberOfDesktops() const
QString DPAdds::toolTipImage(const int desktop) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Desktop" << desktop;
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Desktop" << desktop;
if (tooltipType == QString("none")) return QString();
// prepare
DesktopWindowsInfo info = getInfoByDesktop(desktop);
if (tooltipType == QString("names")) {
QStringList windowList;
foreach(WindowData data, info.windowsData) windowList.append(data.name);
std::for_each(info.windowsData.cbegin(), info.windowsData.cend(),
[&windowList](WindowData data) { windowList.append(data.name); });
return QString("<ul><li>%1</li></ul>").arg(windowList.join(QString("</li><li>")));
}
// init
@ -151,20 +147,23 @@ QString DPAdds::toolTipImage(const int desktop) const
}
} else if (tooltipType == QString("clean")) {
QScreen *screen = QGuiApplication::primaryScreen();
foreach(WindowData data, info.desktopsData) {
QPixmap desktop = screen->grabWindow(data.id);
toolTipScene->addPixmap(desktop)->setOffset(data.rect.left(), data.rect.top());
}
std::for_each(info.desktopsData.cbegin(), info.desktopsData.cend(),
[&toolTipScene, &screen](WindowData data) {
QPixmap desktop = screen->grabWindow(data.id);
toolTipScene->addPixmap(desktop)->setOffset(data.rect.left(), data.rect.top());
});
} else if (tooltipType == QString("windows")) {
QScreen *screen = QGuiApplication::primaryScreen();
foreach(WindowData data, info.desktopsData) {
QPixmap desktop = screen->grabWindow(data.id);
toolTipScene->addPixmap(desktop)->setOffset(data.rect.left(), data.rect.top());
}
foreach(WindowData data, info.windowsData) {
QPixmap window = screen->grabWindow(data.id);
toolTipScene->addPixmap(window)->setOffset(data.rect.left(), data.rect.top());
}
std::for_each(info.desktopsData.cbegin(), info.desktopsData.cend(),
[&toolTipScene, &screen](WindowData data) {
QPixmap desktop = screen->grabWindow(data.id);
toolTipScene->addPixmap(desktop)->setOffset(data.rect.left(), data.rect.top());
});
std::for_each(info.windowsData.cbegin(), info.windowsData.cend(),
[&toolTipScene, &screen](WindowData data) {
QPixmap window = screen->grabWindow(data.id);
toolTipScene->addPixmap(window)->setOffset(data.rect.left(), data.rect.top());
});
}
QPixmap image = toolTipView->grab().scaledToWidth(tooltipWidth);
@ -181,7 +180,9 @@ QString DPAdds::toolTipImage(const int desktop) const
QString DPAdds::parsePattern(const QString pattern, const int desktop) const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Pattern" << pattern;
qCDebug(LOG_DP) << "Desktop number" << desktop;
QString parsed = pattern;
parsed.replace(QString("$$"), QString("$\\$\\"));
@ -195,33 +196,17 @@ QString DPAdds::parsePattern(const QString pattern, const int desktop) const
void DPAdds::setMark(const QString newMark)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Mark" << newMark;
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Mark" << newMark;
mark = newMark;
}
void DPAdds::setPanelsToControl(const QString newPanels)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Panels" << newPanels;
panelsToControl.clear();
if (newPanels == QString("-1")) {
int count = getPanels().count();
for (int i=0; i<count; i++)
panelsToControl.append(i);
} else
foreach(QString panel, newPanels.split(QChar(',')))
panelsToControl.append(panel.toInt());
}
void DPAdds::setToolTipData(const QVariantMap tooltipData)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Data" << tooltipData;
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Data" << tooltipData;
tooltipColor = tooltipData[QString("tooltipColor")].toString();
tooltipType = tooltipData[QString("tooltipType")].toString();
@ -231,8 +216,9 @@ void DPAdds::setToolTipData(const QVariantMap tooltipData)
QString DPAdds::valueByKey(const QString key, int desktop) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Requested key" << key;
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Requested key" << key;
qCDebug(LOG_DP) << "Desktop number" << desktop;
if (desktop == -1) desktop = currentDesktop();
QString currentMark = currentDesktop() == desktop ? mark : QString("");
@ -250,60 +236,10 @@ QString DPAdds::valueByKey(const QString key, int desktop) const
}
QString DPAdds::editPanelsToContol(const QString current)
{
if (debug) qDebug() << PDEBUG;
// paint
QDialog *dialog = new QDialog(nullptr);
QListWidget *widget = new QListWidget(dialog);
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Open | QDialogButtonBox::Close,
Qt::Vertical, dialog);
QHBoxLayout *layout = new QHBoxLayout(dialog);
layout->addWidget(widget);
layout->addWidget(buttons);
dialog->setLayout(layout);
connect(buttons, SIGNAL(rejected()), dialog, SLOT(reject()));
connect(buttons, SIGNAL(accepted()), dialog, SLOT(accept()));
// fill
QList<Plasma::Containment *> panels = getPanels();
for (int i=0; i<panels.count(); i++) {
QListWidgetItem *item = new QListWidgetItem(panelLocationToStr(panels.at(i)->location()), widget);
if ((current.split(QChar(',')).contains(QString::number(i))) ||
(current == QString("-1")))
item->setCheckState(Qt::Checked);
else
item->setCheckState(Qt::Unchecked);
}
// exec
QString value;
QStringList indexes;
int ret = dialog->exec();
switch (ret) {
case QDialog::Accepted:
for (int i=0; i<widget->count(); i++)
if (widget->item(i)->checkState() == Qt::Checked)
indexes.append(QString::number(i));
if (indexes.count() == widget->count())
value = QString("-1");
else
value = indexes.join(QChar(','));
break;
default:
value = current;
break;
}
return value;
}
QString DPAdds::getAboutText(const QString type) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Type" << type;
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Type" << type;
QString text;
if (type == QString("header"))
@ -341,7 +277,8 @@ QString DPAdds::getAboutText(const QString type) const
QVariantMap DPAdds::getFont(const QVariantMap defaultFont) const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Default font is" << defaultFont;
QVariantMap fontMap;
CFont defaultCFont = CFont(defaultFont[QString("family")].toString(),
@ -357,35 +294,12 @@ QVariantMap DPAdds::getFont(const QVariantMap defaultFont) const
}
void DPAdds::changePanelsState() const
{
if (debug) qDebug() << PDEBUG;
if (panelsToControl.isEmpty()) return;
// QList<Plasma::Containment *> panels = getPanels();
// for (int i=0; i<panels.count(); i++) {
// if (!panelsToControl.contains(i)) continue;
// bool wasVisible = panels.at(i)->view()->isVisible();
// int winId = panels.at(i)->view()->winId();
// if (wasVisible) {
// if (debug) qDebug() << PDEBUG << ":" << "Hide panel";
// KWindowInfo oldInfo = KWindowSystem::windowInfo(winId, NET::WMState);
// oldState = oldInfo.state();
// panels.at(i)->view()->setVisible(false);
// } else {
// if (debug) qDebug() << PDEBUG << ":" << "Show panel";
// panels.at(i)->view()->setVisible(true);
// KWindowSystem::clearState(winId, NET::KeepAbove);
// KWindowSystem::setState(winId, oldState | NET::StaysOnTop);
// KWindowSystem::setOnAllDesktops(winId, true);
// }
// }
// panels.clear();
}
void DPAdds::sendNotification(const QString eventId, const QString message)
{
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Event" << eventId;
qCDebug(LOG_DP) << "Message" << message;
KNotification *notification = KNotification::event(eventId, QString("Desktop Panel ::: %1").arg(eventId), message);
notification->setComponentName(QString("plasma-applet-org.kde.plasma.desktop-panel"));
}
@ -393,35 +307,17 @@ void DPAdds::sendNotification(const QString eventId, const QString message)
void DPAdds::setCurrentDesktop(const int desktop) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Desktop" << desktop;
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Desktop" << desktop;
KWindowSystem::setCurrentDesktop(desktop);
}
void DPAdds::changeDesktop(const int desktop) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Desktop" << desktop;
emit(desktopChanged());
}
void DPAdds::changeWindowList(const WId window) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Window" << window;
emit(windowListChanged());
}
DPAdds::DesktopWindowsInfo DPAdds::getInfoByDesktop(const int desktop) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Desktop" << desktop;
qCDebug(LOG_DP);
qCDebug(LOG_DP) << "Desktop" << desktop;
DesktopWindowsInfo info;
@ -447,39 +343,3 @@ DPAdds::DesktopWindowsInfo DPAdds::getInfoByDesktop(const int desktop) const
return info;
}
QList<Plasma::Containment *> DPAdds::getPanels() const
{
if (debug) qDebug() << PDEBUG;
// Plasma::Corona *corona = new Plasma::Corona(this);
QList<Plasma::Containment *> panels;
// foreach(Plasma::Containment *cont, corona->containments()) {
// if (cont->containmentType() != Plasma::Types::ContainmentType::PanelContainment) continue
// panels.append(cont);
// }
// delete corona;
return panels;
}
QString DPAdds::panelLocationToStr(Plasma::Types::Location location) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Location" << location;
switch (location) {
case Plasma::Types::Location::TopEdge:
return i18n("Top Edge");
case Plasma::Types::Location::BottomEdge:
return i18n("Bottom Edge");
case Plasma::Types::Location::LeftEdge:
return i18n("Left Edge");
case Plasma::Types::Location::RightEdge:
return i18n("Right Edge");
default:
return i18n("Unknown location (%1)", location);
}
}

View File

@ -43,8 +43,8 @@ class DPAdds : public QObject
} DesktopWindowsInfo;
public:
DPAdds(QObject *parent = nullptr);
~DPAdds();
explicit DPAdds(QObject *parent = nullptr);
virtual ~DPAdds();
Q_INVOKABLE bool isDebugEnabled() const;
Q_INVOKABLE int currentDesktop() const;
@ -54,11 +54,9 @@ public:
Q_INVOKABLE QString parsePattern(const QString pattern, const int desktop) const;
// values
Q_INVOKABLE void setMark(const QString newMark);
Q_INVOKABLE void setPanelsToControl(const QString newPanels);
Q_INVOKABLE void setToolTipData(const QVariantMap tooltipData);
Q_INVOKABLE QString valueByKey(const QString key, int desktop = -1) const;
// configuration slots
Q_INVOKABLE QString editPanelsToContol(const QString current);
Q_INVOKABLE QString getAboutText(const QString type = "header") const;
Q_INVOKABLE QVariantMap getFont(const QVariantMap defaultFont) const;
@ -67,25 +65,16 @@ signals:
void windowListChanged() const;
public slots:
Q_INVOKABLE void changePanelsState() const;
Q_INVOKABLE static void sendNotification(const QString eventId, const QString message);
Q_INVOKABLE void setCurrentDesktop(const int desktop) const;
private slots:
void changeDesktop(const int desktop) const;
void changeWindowList(const WId window) const;
private:
DesktopWindowsInfo getInfoByDesktop(const int desktop) const;
QList<Plasma::Containment *> getPanels() const;
QString panelLocationToStr(Plasma::Types::Location location) const;
// variables
bool debug = false;
int oldState, tooltipWidth = 200;
int tooltipWidth = 200;
QString mark = QString("*");
QString tooltipColor = QString("#000000");
QString tooltipType = QString("none");
QList<int> panelsToControl;
};

View File

@ -1,3 +1,2 @@
module org.kde.plasma.private.desktoppanel
plugin dpplugin

View File

@ -16,10 +16,10 @@ include_directories(
file(GLOB SUBPROJECT_DESKTOP_IN *.desktop)
file(RELATIVE_PATH SUBPROJECT_DESKTOP ${CMAKE_SOURCE_DIR} ${SUBPROJECT_DESKTOP_IN})
file(GLOB_RECURSE SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp
${PROJECT_TRDPARTY_DIR}/pdebug/*.cpp)
file(GLOB SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp ${CMAKE_SOURCE_DIR}/*.cpp)
set(TASK_HEADER ${PROJECT_TRDPARTY_DIR}/task/task.h)
file(GLOB SUBPROJECT_CONF *.conf)
file(GLOB SUBPROJECT_INI *.ini)
# prepare
configure_file(${SUBPROJECT_DESKTOP_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP})
@ -35,3 +35,4 @@ kcoreaddons_desktop_to_json(${PLUGIN_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJ
install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGIN_INSTALL_DIR}/plasma/dataengine)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP} DESTINATION ${SERVICES_INSTALL_DIR})
install(FILES ${SUBPROJECT_CONF} DESTINATION ${CONFIG_INSTALL_DIR})
install(FILES ${SUBPROJECT_INI} DESTINATION ${CONFIG_INSTALL_DIR})

View File

@ -0,0 +1,17 @@
[Rules]
org.kde.plasma.awesomewidget.debug=true
org.kde.plasma.awesomewidget.info=true
org.kde.plasma.awesomewidget.warning=true
org.kde.plasma.awesomewidget.critical=true
org.kde.plasma.desktoppanel.debug=true
org.kde.plasma.desktoppanel.info=true
org.kde.plasma.desktoppanel.warning=true
org.kde.plasma.desktoppanel.critical=true
org.kde.plasma.extsysmon.debug=true
org.kde.plasma.extsysmon.info=true
org.kde.plasma.extsysmon.warning=true
org.kde.plasma.extsysmon.critical=true
org.kde.plasma.awesomewidgets.debug=true
org.kde.plasma.awesomewidgets.info=true
org.kde.plasma.awesomewidgets.warning=true
org.kde.plasma.awesomewidgets.critical=true

View File

@ -24,20 +24,17 @@
#include <QDBusConnection>
#include <QDBusConnectionInterface>
#include <QDBusMessage>
#include <QDebug>
#include <QDir>
#include <QFile>
#include <QNetworkInterface>
#include <QProcessEnvironment>
#include <QRegExp>
#include <QTextCodec>
#include <QSettings>
#include <QStandardPaths>
#include <pdebug/pdebug.h>
#include <pdebug/pdebug-time.h>
#include <task/taskadds.h>
#include "awdebug.h"
#include "extquotes.h"
#include "extscript.h"
#include "extupgrade.h"
@ -45,186 +42,40 @@
#include "version.h"
ExtendedSysMon::ExtendedSysMon(QObject* parent, const QVariantList &args)
ExtendedSysMon::ExtendedSysMon(QObject *parent, const QVariantList &args)
: Plasma::DataEngine(parent, args)
{
Q_UNUSED(args)
qInstallMessageHandler(debugString);
qCDebug(LOG_ESM);
// debug
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
debug = (debugEnv == QString("yes"));
// logging
qSetMessagePattern(LOG_FORMAT);
setMinimumPollingInterval(333);
readConfiguration();
externalQuotes = new ExtItemAggregator<ExtQuotes>(nullptr, QString("quotes"), debug);
externalScripts = new ExtItemAggregator<ExtScript>(nullptr, QString("scripts"), debug);
externalUpgrade = new ExtItemAggregator<ExtUpgrade>(nullptr, QString("upgrade"), debug);
externalWeather = new ExtItemAggregator<ExtWeather>(nullptr, QString("weather"), debug);
extQuotes = new ExtItemAggregator<ExtQuotes>(nullptr, QString("quotes"));
extScripts = new ExtItemAggregator<ExtScript>(nullptr, QString("scripts"));
extUpgrade = new ExtItemAggregator<ExtUpgrade>(nullptr, QString("upgrade"));
extWeather = new ExtItemAggregator<ExtWeather>(nullptr, QString("weather"));
}
ExtendedSysMon::~ExtendedSysMon()
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_ESM);
delete externalQuotes;
delete externalScripts;
delete externalUpgrade;
delete externalWeather;
}
QStringList ExtendedSysMon::getAllHdd() const
{
if (debug) qDebug() << PDEBUG;
QStringList allDevices = QDir(QString("/dev")).entryList(QDir::System, QDir::Name);
QStringList devices = allDevices.filter(QRegExp(QString("^[hms]d[a-z]$")));
for (int i=0; i<devices.count(); i++)
devices[i] = QString("/dev/%1").arg(devices.at(i));
if (debug) qDebug() << PDEBUG << ":" << "Device list" << devices;
return devices;
}
QString ExtendedSysMon::getAutoGpu() const
{
if (debug) qDebug() << PDEBUG;
QString gpu = QString("disable");
QFile moduleFile(QString("/proc/modules"));
if (!moduleFile.open(QIODevice::ReadOnly)) return gpu;
QString output = moduleFile.readAll();
if (output.contains(QString("fglrx")))
gpu = QString("ati");
else if (output.contains(QString("nvidia")))
gpu = QString("nvidia");
if (debug) qDebug() << PDEBUG << ":" << "Device" << gpu;
return gpu;
}
QString ExtendedSysMon::getAutoMpris() const
{
if (debug) qDebug() << PDEBUG;
QDBusMessage listServices = QDBusConnection::sessionBus().interface()->call(QDBus::BlockWithGui, QString("ListNames"));
if (listServices.arguments().isEmpty()) return QString();
QStringList arguments = listServices.arguments().first().toStringList();
foreach(QString arg, arguments) {
if (debug) qDebug() << PDEBUG << ":" << "Service found" << arg;
if (!arg.startsWith(QString("org.mpris.MediaPlayer2."))) continue;
QString service = arg;
service.remove(QString("org.mpris.MediaPlayer2."));
return service;
}
return QString();
}
QStringList ExtendedSysMon::sources() const
{
if (debug) qDebug() << PDEBUG;
QStringList source;
source.append(QString("battery"));
source.append(QString("custom"));
source.append(QString("desktop"));
source.append(QString("netdev"));
source.append(QString("gpu"));
source.append(QString("gputemp"));
source.append(QString("hddtemp"));
source.append(QString("pkg"));
source.append(QString("player"));
source.append(QString("ps"));
source.append(QString("quotes"));
source.append(QString("update"));
source.append(QString("weather"));
if (debug) qDebug() << PDEBUG << ":" << "Sources" << source;
return source;
}
void ExtendedSysMon::readConfiguration()
{
if (debug) qDebug() << PDEBUG;
QString fileName = QStandardPaths::locate(QStandardPaths::ConfigLocation,
QString("plasma-dataengine-extsysmon.conf"));
if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << fileName;
QSettings settings(fileName, QSettings::IniFormat);
QHash<QString, QString> rawConfig;
settings.beginGroup(QString("Configuration"));
rawConfig[QString("ACPIPATH")] = settings.value(QString("ACPIPATH"), QString("/sys/class/power_supply/")).toString();
rawConfig[QString("GPUDEV")] = settings.value(QString("GPUDEV"), QString("auto")).toString();
rawConfig[QString("HDDDEV")] = settings.value(QString("HDDDEV"), QString("all")).toString();
rawConfig[QString("HDDTEMPCMD")] = settings.value(QString("HDDTEMPCMD"), QString("sudo smartctl -a")).toString();
rawConfig[QString("MPDADDRESS")] = settings.value(QString("MPDADDRESS"), QString("localhost")).toString();
rawConfig[QString("MPDPORT")] = settings.value(QString("MPDPORT"), QString("6600")).toString();
rawConfig[QString("MPRIS")] = settings.value(QString("MPRIS"), QString("auto")).toString();
rawConfig[QString("PLAYER")] = settings.value(QString("PLAYER"), QString("mpris")).toString();
settings.endGroup();
configuration = updateConfiguration(rawConfig);
}
QHash<QString, QString> ExtendedSysMon::updateConfiguration(QHash<QString, QString> rawConfig) const
{
if (debug) qDebug() << PDEBUG;
// gpudev
if (rawConfig[QString("GPUDEV")] == QString("disable"))
rawConfig[QString("GPUDEV")] = QString("disable");
else if (rawConfig[QString("GPUDEV")] == QString("auto"))
rawConfig[QString("GPUDEV")] = getAutoGpu();
else if ((rawConfig[QString("GPUDEV")] != QString("ati")) &&
(rawConfig[QString("GPUDEV")] != QString("nvidia")))
rawConfig[QString("GPUDEV")] = getAutoGpu();
// hdddev
QStringList allHddDevices = getAllHdd();
if (rawConfig[QString("HDDDEV")] == QString("all"))
rawConfig[QString("HDDDEV")] = allHddDevices.join(QChar(','));
else if (rawConfig[QString("HDDDEV")] == QString("disable"))
rawConfig[QString("HDDDEV")] = QString("");
else {
QStringList deviceList = rawConfig[QString("HDDDEV")].split(QChar(','), QString::SkipEmptyParts);
QStringList devices;
QRegExp diskRegexp = QRegExp("^/dev/[hms]d[a-z]$");
foreach(QString device, deviceList)
if ((QFile::exists(device)) && (diskRegexp.indexIn(device) > -1))
devices.append(device);
if (devices.isEmpty())
rawConfig[QString("HDDDEV")] = allHddDevices.join(QChar(','));
else
rawConfig[QString("HDDDEV")] = devices.join(QChar(','));
}
// player
if ((rawConfig[QString("PLAYER")] != QString("mpd")) &&
(rawConfig[QString("PLAYER")] != QString("mpris")) &&
(rawConfig[QString("PLAYER")] != QString("disable")))
rawConfig[QString("PLAYER")] = QString("mpris");
foreach(QString key, rawConfig.keys())
if (debug) qDebug() << PDEBUG << ":" << key << "=" << rawConfig[key];
return rawConfig;
delete extQuotes;
delete extScripts;
delete extUpgrade;
delete extWeather;
}
QVariantHash ExtendedSysMon::getBattery(const QString acpiPath) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "ACPI path" << acpiPath;
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "ACPI path" << acpiPath;
QVariantHash battery;
battery[QString("ac")] = false;
@ -266,7 +117,7 @@ QVariantHash ExtendedSysMon::getBattery(const QString acpiPath) const
QVariantHash ExtendedSysMon::getCurrentDesktop() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_ESM);
int number = KWindowSystem::currentDesktop();
int total = KWindowSystem::numberOfDesktops();
@ -284,8 +135,8 @@ QVariantHash ExtendedSysMon::getCurrentDesktop() const
float ExtendedSysMon::getGpu(const QString device) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Device" << device;
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Device" << device;
float value = 0.0;
if ((device != QString("nvidia")) && (device != QString("ati")))
@ -295,10 +146,10 @@ float ExtendedSysMon::getGpu(const QString device) const
cmd = QString("nvidia-smi -q -x");
else if (device == QString("ati"))
cmd = QString("aticonfig --od-getclocks");
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd;
qCInfo(LOG_ESM) << "cmd" << cmd;
TaskResult process = runTask(cmd);
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
qCInfo(LOG_ESM) << "Cmd returns" << process.exitCode;
qCInfo(LOG_ESM) << "Error" << process.error;
QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed();
if (configuration[QString("GPUDEV")] == QString("nvidia"))
@ -324,8 +175,8 @@ float ExtendedSysMon::getGpu(const QString device) const
float ExtendedSysMon::getGpuTemp(const QString device) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Device" << device;
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Device" << device;
float value = 0.0;
if ((device != QString("nvidia")) && (device != QString("ati")))
@ -335,10 +186,10 @@ float ExtendedSysMon::getGpuTemp(const QString device) const
cmd = QString("nvidia-smi -q -x");
else if (device == QString("ati"))
cmd = QString("aticonfig --od-gettemperature");
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd;
qCInfo(LOG_ESM) << "cmd" << cmd;
TaskResult process = runTask(cmd);
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
qCInfo(LOG_ESM) << "Cmd returns" << process.exitCode;
qCInfo(LOG_ESM) << "Error" << process.error;
QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output);
if (configuration[QString("GPUDEV")] == QString("nvidia"))
@ -362,17 +213,17 @@ float ExtendedSysMon::getGpuTemp(const QString device) const
float ExtendedSysMon::getHddTemp(const QString cmd, const QString device) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd;
if (debug) qDebug() << PDEBUG << ":" << "Device" << device;
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "cmd" << cmd;
qCDebug(LOG_ESM) << "Device" << device;
float value = 0.0;
TaskResult process = runTask(QString("%1 %2").arg(cmd).arg(device));
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
qCInfo(LOG_ESM) << "Cmd returns" << process.exitCode;
qCInfo(LOG_ESM) << "Error" << process.error;
bool smartctl = cmd.contains(QString("smartctl"));
if (debug) qDebug() << PDEBUG << ":" << "Define smartctl" << smartctl;
qCInfo(LOG_ESM) << "Parse as smartctl" << smartctl;
QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed();
if (smartctl) {
@ -396,10 +247,11 @@ float ExtendedSysMon::getHddTemp(const QString cmd, const QString device) const
QString ExtendedSysMon::getNetworkDevice() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_ESM);
QString device = QString("lo");
QList<QNetworkInterface> rawInterfaceList = QNetworkInterface::allInterfaces();
qCInfo(LOG_ESM) << "Devices" << rawInterfaceList;
foreach(QNetworkInterface interface, rawInterfaceList)
if ((interface.flags().testFlag(QNetworkInterface::IsUp)) &&
(!interface.flags().testFlag(QNetworkInterface::IsLoopBack)) &&
@ -413,12 +265,12 @@ QString ExtendedSysMon::getNetworkDevice() const
QVariantHash ExtendedSysMon::getPlayerInfo(const QString playerName, const QString mpdAddress,
const QString mpdPort, QString mpris) const
const QString mpdPort, QString mpris) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "player" << playerName;
if (debug) qDebug() << PDEBUG << ":" << "MPD" << QString("%1:%2").arg(mpdAddress).arg(mpdPort);
if (debug) qDebug() << PDEBUG << ":" << "MPRIS" << mpris;
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "player" << playerName;
qCDebug(LOG_ESM) << "MPD" << QString("%1:%2").arg(mpdAddress).arg(mpdPort);
qCDebug(LOG_ESM) << "MPRIS" << mpris;
QVariantHash info;
info[QString("album")] = QString("unknown");
@ -429,22 +281,37 @@ QVariantHash ExtendedSysMon::getPlayerInfo(const QString playerName, const QStri
if (playerName == QString("mpd"))
// mpd
return getPlayerMpdInfo(mpdAddress, mpdPort);
info = getPlayerMpdInfo(mpdAddress, mpdPort);
else if (playerName == QString("mpris")) {
// players which supports mpris
if (mpris == QString("auto")) mpris = getAutoMpris();
if (mpris.isEmpty()) return info;
return getPlayerMprisInfo(mpris);
info = getPlayerMprisInfo(mpris);
}
// dymanic properties
// solid
info[QString("salbum")] = stripString(info[QString("album")].toString(), symbols);
info[QString("sartist")] = stripString(info[QString("artist")].toString(), symbols);
info[QString("stitle")] = stripString(info[QString("title")].toString(), symbols);
// dynamic
Plasma::DataContainer *playerDC = containerDict()["player"];
QVariantHash data = playerDC == nullptr ? info : qvariant_cast<QVariantHash>(playerDC->data());
info[QString("dalbum")] = buildString(data[QString("dalbum")].toString(),
info[QString("album")].toString(), symbols);
info[QString("dartist")] = buildString(data[QString("dartist")].toString(),
info[QString("artist")].toString(), symbols);
info[QString("dtitle")] = buildString(data[QString("dtitle")].toString(),
info[QString("title")].toString(), symbols);
return info;
}
QVariantHash ExtendedSysMon::getPlayerMpdInfo(const QString mpdAddress, const QString mpdPort) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "MPD" << QString("%1:%2").arg(mpdAddress).arg(mpdPort);
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "MPD" << QString("%1:%2").arg(mpdAddress).arg(mpdPort);
QVariantHash info;
info[QString("album")] = QString("unknown");
@ -456,10 +323,10 @@ QVariantHash ExtendedSysMon::getPlayerMpdInfo(const QString mpdAddress, const QS
QString cmd = QString("bash -c \"echo 'currentsong\nstatus\nclose' | curl --connect-timeout 1 -fsm 3 telnet://%1:%2\"")
.arg(mpdAddress)
.arg(mpdPort);
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd;
qCInfo(LOG_ESM) << "cmd" << cmd;
TaskResult process = runTask(cmd);
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
qCInfo(LOG_ESM) << "Cmd returns" << process.exitCode;
qCInfo(LOG_ESM) << "Error" << process.error;
QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed();
foreach(QString str, qoutput.split(QChar('\n'), QString::SkipEmptyParts)) {
@ -482,8 +349,8 @@ QVariantHash ExtendedSysMon::getPlayerMpdInfo(const QString mpdAddress, const QS
QVariantHash ExtendedSysMon::getPlayerMprisInfo(const QString mpris) const
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << "MPRIS" << mpris;
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "MPRIS" << mpris;
QVariantHash info;
info[QString("album")] = QString("unknown");
@ -505,7 +372,7 @@ QVariantHash ExtendedSysMon::getPlayerMprisInfo(const QString mpris) const
request.setArguments(args);
QDBusMessage response = bus.call(request, QDBus::BlockWithGui);
if ((response.type() != QDBusMessage::ReplyMessage) || (response.arguments().isEmpty())) {
if (debug) qDebug() << PDEBUG << ":" << "Error message" << response.errorMessage();
qCWarning(LOG_ESM) << "Error message" << response.errorMessage();
} else {
// another portion of dirty magic
QVariantHash map = qdbus_cast<QVariantHash>(response.arguments().first()
@ -523,7 +390,7 @@ QVariantHash ExtendedSysMon::getPlayerMprisInfo(const QString mpris) const
request.setArguments(args);
response = bus.call(request, QDBus::BlockWithGui);
if ((response.type() != QDBusMessage::ReplyMessage) || (response.arguments().isEmpty())) {
if (debug) qDebug() << PDEBUG << ":" << "Error message" << response.errorMessage();
qCWarning(LOG_ESM) << "Error message" << response.errorMessage();
} else
// this cast is simpler than the previous one ;)
info[QString("progress")] = response.arguments().first().value<QDBusVariant>()
@ -535,7 +402,7 @@ QVariantHash ExtendedSysMon::getPlayerMprisInfo(const QString mpris) const
QVariantHash ExtendedSysMon::getPsStats() const
{
if (debug) qDebug() << PDEBUG;
qCDebug(LOG_ESM);
QStringList allDirectories = QDir(QString("/proc")).entryList(QDir::Dirs | QDir::NoDotAndDotDot,
QDir::Name);
@ -554,17 +421,41 @@ QVariantHash ExtendedSysMon::getPsStats() const
QVariantHash psStats;
psStats[QString("pscount")] = running.count();
psStats[QString("ps")] = running.join(QString(","));
psStats[QString("ps")] = running.join(QChar(','));
psStats[QString("pstotal")] = directories.count();
return psStats;
}
QStringList ExtendedSysMon::sources() const
{
qCDebug(LOG_ESM);
QStringList source;
source.append(QString("battery"));
source.append(QString("custom"));
source.append(QString("desktop"));
source.append(QString("netdev"));
source.append(QString("gpu"));
source.append(QString("gputemp"));
source.append(QString("hddtemp"));
source.append(QString("pkg"));
source.append(QString("player"));
source.append(QString("ps"));
source.append(QString("quotes"));
source.append(QString("update"));
source.append(QString("weather"));
qCInfo(LOG_ESM) << "Sources" << source;
return source;
}
bool ExtendedSysMon::sourceRequestEvent(const QString &source)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Source" << source;
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source;
return updateSourceEvent(source);
}
@ -572,14 +463,14 @@ bool ExtendedSysMon::sourceRequestEvent(const QString &source)
bool ExtendedSysMon::updateSourceEvent(const QString &source)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Source" << source;
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Source" << source;
if (source == QString("battery")) {
QVariantHash battery = getBattery(configuration[QString("ACPIPATH")]);
foreach(QString key, battery.keys()) setData(source, key, battery[key]);
} else if (source == QString("custom")) {
foreach(ExtScript *script, externalScripts->items()) {
foreach(ExtScript *script, extScripts->items()) {
QVariantHash data = script->run();
foreach(QString key, data.keys()) setData(source, key, data[key]);
}
@ -599,7 +490,7 @@ bool ExtendedSysMon::updateSourceEvent(const QString &source)
} else if (source == QString("netdev")) {
setData(source, QString("value"), getNetworkDevice());
} else if (source == QString("pkg")) {
foreach(ExtUpgrade *upgrade, externalUpgrade->items()) {
foreach(ExtUpgrade *upgrade, extUpgrade->items()) {
QVariantHash data = upgrade->run();
foreach(QString key, data.keys()) setData(source, key, data[key]);
}
@ -613,23 +504,179 @@ bool ExtendedSysMon::updateSourceEvent(const QString &source)
QVariantHash ps = getPsStats();
foreach(QString key, ps.keys()) setData(source, key, ps[key]);
} else if (source == QString("quotes")) {
foreach(ExtQuotes *quote, externalQuotes->items()) {
foreach(ExtQuotes *quote, extQuotes->items()) {
QVariantHash data = quote->run();
foreach(QString key, data.keys()) setData(source, key, data[key]);
}
} else if (source == QString("update")) {
setData(source, QString("value"), true);
} else if (source == QString("weather")) {
foreach(ExtWeather *weather, externalWeather->items()) {
foreach(ExtWeather *weather, extWeather->items()) {
QVariantHash data = weather->run();
foreach(QString key, data.keys()) setData(source, key, data[key]);
}
} else {
qCWarning(LOG_ESM) << "Unknown source" << source;
return false;
}
return true;
}
QString ExtendedSysMon::buildString(const QString current, const QString value,
const int s) const
{
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Current value" << current;
qCDebug(LOG_ESM) << "New value" << value;
qCDebug(LOG_ESM) << "Strip after" << s;
int index = value.indexOf(current);
if ((current.isEmpty()) || ((index + s + 1) > value.count()))
return QString("%1").arg(value.left(s), s, QLatin1Char(' '));
else
return QString("%1").arg(value.mid(index + 1, s), s, QLatin1Char(' '));
}
QStringList ExtendedSysMon::getAllHdd() const
{
qCDebug(LOG_ESM);
QStringList allDevices = QDir(QString("/dev")).entryList(QDir::System, QDir::Name);
QStringList devices = allDevices.filter(QRegExp(QString("^[hms]d[a-z]$")));
for (int i=0; i<devices.count(); i++)
devices[i] = QString("/dev/%1").arg(devices.at(i));
qCInfo(LOG_ESM) << "Device list" << devices;
return devices;
}
QString ExtendedSysMon::getAutoGpu() const
{
qCDebug(LOG_ESM);
QString gpu = QString("disable");
QFile moduleFile(QString("/proc/modules"));
if (!moduleFile.open(QIODevice::ReadOnly)) return gpu;
QString output = moduleFile.readAll();
if (output.contains(QString("fglrx")))
gpu = QString("ati");
else if (output.contains(QString("nvidia")))
gpu = QString("nvidia");
qCInfo(LOG_ESM) << "Device" << gpu;
return gpu;
}
QString ExtendedSysMon::getAutoMpris() const
{
qCDebug(LOG_ESM);
QDBusMessage listServices = QDBusConnection::sessionBus().interface()->call(QDBus::BlockWithGui, QString("ListNames"));
if (listServices.arguments().isEmpty()) return QString();
QStringList arguments = listServices.arguments().first().toStringList();
foreach(QString arg, arguments) {
qCInfo(LOG_ESM) << "Service found" << arg;
if (!arg.startsWith(QString("org.mpris.MediaPlayer2."))) continue;
QString service = arg;
service.remove(QString("org.mpris.MediaPlayer2."));
return service;
}
return QString();
}
void ExtendedSysMon::readConfiguration()
{
qCDebug(LOG_ESM);
QString fileName = QStandardPaths::locate(QStandardPaths::ConfigLocation,
QString("plasma-dataengine-extsysmon.conf"));
qCInfo(LOG_ESM) << "Configuration file" << fileName;
QSettings settings(fileName, QSettings::IniFormat);
QHash<QString, QString> rawConfig;
settings.beginGroup(QString("Configuration"));
rawConfig[QString("ACPIPATH")] = settings.value(QString("ACPIPATH"), QString("/sys/class/power_supply/")).toString();
rawConfig[QString("GPUDEV")] = settings.value(QString("GPUDEV"), QString("auto")).toString();
rawConfig[QString("HDDDEV")] = settings.value(QString("HDDDEV"), QString("all")).toString();
rawConfig[QString("HDDTEMPCMD")] = settings.value(QString("HDDTEMPCMD"), QString("sudo smartctl -a")).toString();
rawConfig[QString("MPDADDRESS")] = settings.value(QString("MPDADDRESS"), QString("localhost")).toString();
rawConfig[QString("MPDPORT")] = settings.value(QString("MPDPORT"), QString("6600")).toString();
rawConfig[QString("MPRIS")] = settings.value(QString("MPRIS"), QString("auto")).toString();
rawConfig[QString("PLAYER")] = settings.value(QString("PLAYER"), QString("mpris")).toString();
rawConfig[QString("PLAYERSYMBOLS")] = settings.value(QString("PLAYERSYMBOLS"), QString("10")).toString();
settings.endGroup();
configuration = updateConfiguration(rawConfig);
symbols = configuration[QString("PLAYERSYMBOLS")].toInt();
}
QString ExtendedSysMon::stripString(const QString value, const int s) const
{
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "New value" << value;
qCDebug(LOG_ESM) << "Strip after" << s;
return value.count() > s ? QString("%1\u2026").arg(value.left(s - 1)) :
QString("%1").arg(value, s, QLatin1Char(' '));
}
QHash<QString, QString> ExtendedSysMon::updateConfiguration(QHash<QString, QString> rawConfig) const
{
qCDebug(LOG_ESM);
qCDebug(LOG_ESM) << "Raw configuration" << rawConfig;
// gpudev
if (rawConfig[QString("GPUDEV")] == QString("disable"))
rawConfig[QString("GPUDEV")] = QString("disable");
else if (rawConfig[QString("GPUDEV")] == QString("auto"))
rawConfig[QString("GPUDEV")] = getAutoGpu();
else if ((rawConfig[QString("GPUDEV")] != QString("ati")) &&
(rawConfig[QString("GPUDEV")] != QString("nvidia")))
rawConfig[QString("GPUDEV")] = getAutoGpu();
// hdddev
QStringList allHddDevices = getAllHdd();
if (rawConfig[QString("HDDDEV")] == QString("all"))
rawConfig[QString("HDDDEV")] = allHddDevices.join(QChar(','));
else if (rawConfig[QString("HDDDEV")] == QString("disable"))
rawConfig[QString("HDDDEV")] = QString("");
else {
QStringList deviceList = rawConfig[QString("HDDDEV")].split(QChar(','), QString::SkipEmptyParts);
QStringList devices;
QRegExp diskRegexp = QRegExp("^/dev/[hms]d[a-z]$");
foreach(QString device, deviceList)
if ((QFile::exists(device)) && (device.contains(diskRegexp)))
devices.append(device);
if (devices.isEmpty())
rawConfig[QString("HDDDEV")] = allHddDevices.join(QChar(','));
else
rawConfig[QString("HDDDEV")] = devices.join(QChar(','));
}
// player
if ((rawConfig[QString("PLAYER")] != QString("mpd")) &&
(rawConfig[QString("PLAYER")] != QString("mpris")) &&
(rawConfig[QString("PLAYER")] != QString("disable")))
rawConfig[QString("PLAYER")] = QString("mpris");
// player symbols
if (rawConfig[QString("PLAYERSYMBOLS")].toInt() <= 0)
rawConfig[QString("PLAYERSYMBOLS")] = QString("10");
foreach(QString key, rawConfig.keys())
qCInfo(LOG_ESM) << key << "=" << rawConfig[key];
return rawConfig;
}
K_EXPORT_PLASMA_DATAENGINE_WITH_JSON(extsysmon, ExtendedSysMon, "plasma-dataengine-extsysmon.json")
#include "extsysmon.moc"

View File

@ -34,7 +34,7 @@ class ExtendedSysMon : public Plasma::DataEngine
public:
explicit ExtendedSysMon(QObject *parent, const QVariantList &args);
~ExtendedSysMon();
virtual ~ExtendedSysMon();
// update functions
QVariantHash getBattery(const QString acpiPath) const;
QVariantHash getCurrentDesktop() const;
@ -52,23 +52,25 @@ public:
QVariantHash getPsStats() const;
protected:
QStringList sources() const;
bool sourceRequestEvent(const QString &source);
bool updateSourceEvent(const QString &source);
QStringList sources() const;
private:
// configuration
QHash<QString, QString> configuration;
ExtItemAggregator<ExtQuotes> *externalQuotes;
ExtItemAggregator<ExtScript> *externalScripts;
ExtItemAggregator<ExtUpgrade> *externalUpgrade;
ExtItemAggregator<ExtWeather> *externalWeather;
bool debug;
// reread configuration
int symbols = 10;
ExtItemAggregator<ExtQuotes> *extQuotes;
ExtItemAggregator<ExtScript> *extScripts;
ExtItemAggregator<ExtUpgrade> *extUpgrade;
ExtItemAggregator<ExtWeather> *extWeather;
// methods
QString buildString(const QString current, const QString value, const int s) const;
QStringList getAllHdd() const;
QString getAutoGpu() const;
QString getAutoMpris() const;
void readConfiguration();
QString stripString(const QString value, const int s) const;
QHash<QString, QString> updateConfiguration(QHash<QString, QString> rawConfig) const;
};

View File

@ -16,3 +16,5 @@ MPDPORT=6600
MPRIS=auto
# Player name. Supported players are 'mpd', 'mpris', 'disable'
PLAYER=mpris
# Show only this symbols count for dynamic player tags
PLAYERSYMBOLS=10

View File

@ -1,6 +1,6 @@
[Desktop Entry]
Encoding=UTF-8
Name=Extended SystemMonitor DataEngine
Name=Extended SystemMonitor
Comment=Adds some additional functions to System DataEngine
ServiceTypes=Plasma/DataEngine
Type=Service

View File

@ -1,5 +1,5 @@
find_package(Gettext REQUIRED)
find_package(Qt5 REQUIRED COMPONENTS Core DBus Network Qml Widgets)
find_package(Qt5 REQUIRED COMPONENTS Core DBus Network Script Qml Widgets)
find_package(ECM 0.0.11 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
find_package(KF5 REQUIRED COMPONENTS I18n Notifications Plasma Service WindowSystem)
@ -10,16 +10,16 @@ include(KDECompilerSettings)
add_definitions(
${Qt5Core_DEFINITIONS} ${Qt5DBus_DEFINITIONS} ${Qt5Network_DEFINITIONS}
${Qt5Qml_DEFINITIONS} ${Qt5Widgets_DEFINITIONS}
${Qt5Script_DEFINITIONS} ${Qt5Qml_DEFINITIONS} ${Qt5Widgets_DEFINITIONS}
)
set(Qt_INCLUDE
${Qt5Core_INCLUDE_DIRS} ${Qt5DBus_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS}
${Qt5Qml_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS}
${Qt5Script_INCLUDE_DIRS} ${Qt5Qml_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS}
)
set(Kf5_INCLUDE ${I18n_INCLUDE_DIR} ${Notifications_INCLUDE_DIR} ${Plasma_INCLUDE_DIR})
set(Qt_LIBRARIES
${Qt5Core_LIBRARIES} ${Qt5DBus_LIBRARIES} ${Qt5Network_LIBRARIES}
${Qt5Qml_LIBRARIES} ${Qt5Widgets_LIBRARIES}
${Qt5Script_LIBRARIES} ${Qt5Qml_LIBRARIES} ${Qt5Widgets_LIBRARIES}
)
set(Kf5_LIBRARIES KF5::I18n KF5::Notifications KF5::Plasma KF5::WindowSystem)

View File

@ -0,0 +1,37 @@
# generators
if(BUILD_DEB_PACKAGE)
set(CPACK_GENERATOR ${CPACK_GENERATOR} "DEB")
endif()
if(BUILD_RPM_PACKAGE)
set(CPACK_GENERATOR ${CPACK_GENERATOR} "RPM")
endif()
# build properties
set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# general metadata
set(CPACK_PACKAGE_NAME "plasma-widget-awesome-widgets")
set(CPACK_PACKAGE_CONTACT "${PROJECT_AUTHOR}")
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
set(CPACK_PACKAGE_RELEASE "1")
# doesn't match to official arch :/
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}")
# deb specific
set(CPACK_DEBIAN_PACKAGE_DEPENDS "plasma-framework")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Collection of minimalistic Plasmoids which look like Awesome WM widgets (ex-PyTextMonitor)")
set(CPACK_DEBIAN_PACKAGE_ENHANCES "mpd, smartmontools")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://arcanis.name/projects/awesome-widgets")
set(CPACK_DEBIAN_PACKAGE_SECTION "KDE")
# rpm specific
set(CPACK_RPM_PACKAGE_DESCRIPTION "Collection of minimalistic Plasmoids which look like Awesome WM widgets (ex-PyTextMonitor)")
set(CPACK_RPM_PACKAGE_GROUP "User Interface/Desktops")
set(CPACK_RPM_PACKAGE_LICENSE "${PROJECT_LICENSE}")
set(CPACK_RPM_PACKAGE_REQUIRES "plasma-framework")
set(CPACK_RPM_PACKAGE_SUGGESTS "mpd, smartmontools")
set(CPACK_RPM_PACKAGE_URL "https://arcanis.name/projects/awesome-widgets")
if(BUILD_DEB_PACKAGE OR BUILD_RPM_PACKAGE)
include(CPack)
endif()

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
"POT-Creation-Date: 2015-08-01 22:13+0300\n"
"POT-Creation-Date: 2015-09-02 00:03+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,467 +17,403 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#, kde-format
msgid "Widget"
msgstr ""
#, kde-format
msgid "Advanced"
msgstr ""
#, kde-format
msgid "Tooltip"
msgstr ""
#, kde-format
msgid "Appearance"
msgstr ""
#, kde-format
msgid "DataEngine"
msgstr ""
#, kde-format
msgid "About"
msgstr ""
#, kde-format
msgid "Acknowledgment"
msgstr ""
#, kde-format
msgid "Widget height, px"
msgstr ""
#, kde-format
msgid "Widget width, px"
msgstr ""
#, kde-format
msgid "Enable notifications"
msgstr ""
#, kde-format
msgid "Wrap new lines"
msgstr ""
#, kde-format
msgid "Enable background"
msgstr ""
#, kde-format
msgid "Custom time format"
msgstr ""
#, kde-format
msgid "Custom uptime format"
msgstr ""
#, kde-format
msgid "Temperature units"
msgstr ""
#, kde-format
msgid "Celsius"
msgstr ""
#, kde-format
msgid "Fahrenheit"
msgstr ""
#, kde-format
msgid "Kelvin"
msgstr ""
#, kde-format
msgid "Reaumur"
msgstr ""
#, kde-format
msgid "cm^-1"
msgstr ""
#, kde-format
msgid "kJ/mol"
msgstr ""
#, kde-format
msgid "kcal/mol"
msgstr ""
#, kde-format
msgid "AC online tag"
msgstr ""
#, kde-format
msgid "AC offline tag"
msgstr ""
#, kde-format
msgid "Check updates on startup"
msgstr ""
msgid "Translate strings"
msgstr ""
msgid "Drop key cache"
msgstr ""
#, kde-format
msgid "Time interval"
msgstr ""
#, kde-format
msgid "Font"
msgstr ""
#, kde-format
msgid "Font size"
msgstr ""
#, kde-format
msgid "Font weight"
msgstr ""
#, kde-format
msgid "light"
msgstr ""
#, kde-format
msgid "normal"
msgstr ""
#, kde-format
msgid "demi bold"
msgstr ""
#, kde-format
msgid "bold"
msgstr ""
#, kde-format
msgid "black"
msgstr ""
#, kde-format
msgid "Font style"
msgstr ""
#, kde-format
msgid "italic"
msgstr ""
#, kde-format
msgid "Font color"
msgstr ""
#, kde-format
msgid "Select a color"
msgstr ""
#, kde-format
msgid "Select a font"
msgstr ""
#, kde-format
msgid "ACPI path"
msgstr ""
#, kde-format
msgid "Custom scripts"
msgstr ""
#, kde-format
msgid "Edit scripts"
msgstr ""
#, kde-format
msgid "GPU device"
msgstr ""
#, kde-format
msgid "HDD"
msgstr ""
#, kde-format
msgid "hddtemp cmd"
msgstr ""
#, kde-format
msgid "MPD address"
msgstr ""
#, kde-format
msgid "MPD port"
msgstr ""
#, kde-format
msgid "MPRIS player name"
msgstr ""
#, kde-format
msgid "Music player"
msgstr ""
#, kde-format
msgid "Player data symbols"
msgstr ""
msgid "Custom scripts"
msgstr ""
msgid "Edit scripts"
msgstr ""
msgid "Quotes monitor"
msgstr ""
#, kde-format
msgid "Edit tickers"
msgstr ""
#, kde-format
msgid "Package manager"
msgstr ""
#, kde-format
msgid "Edit command"
msgstr ""
#, kde-format
msgid "Weather"
msgstr ""
#, kde-format
msgid "Edit weather"
msgstr ""
#, kde-format
msgid "Request key"
msgstr ""
#, kde-format
msgid "Show README"
msgstr ""
#, kde-format
msgid "Check updates"
msgstr ""
#, kde-format
msgid ""
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
"To enable them just make needed checkbox fully checked."
msgstr ""
#, kde-format
msgid "Number of values for tooltips"
msgstr ""
#, kde-format
msgid "Background"
msgstr ""
#, kde-format
msgid "CPU color"
msgstr ""
#, kde-format
msgid "CPU clock color"
msgstr ""
#, kde-format
msgid "Memory color"
msgstr ""
#, kde-format
msgid "Swap color"
msgstr ""
#, kde-format
msgid "Download speed color"
msgstr ""
#, kde-format
msgid "Upload speed color"
msgstr ""
#, kde-format
msgid "Battery active color"
msgstr ""
#, kde-format
msgid "Battery inactive color"
msgstr ""
#, kde-format
msgid ""
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
"awesome-widgets/\">project homepage</a>"
msgstr ""
#, kde-format
msgid "AC"
msgstr ""
msgid "Bars"
msgstr ""
msgid "CPU"
msgstr ""
msgid "Desktops"
msgstr ""
msgid "Memory"
msgstr ""
msgid "Network"
msgstr ""
msgid "Scripts"
msgstr ""
msgid "Time"
msgstr ""
msgid "Quotes"
msgstr ""
msgid "Upgrades"
msgstr ""
msgid "Weathers"
msgstr ""
msgid "Add"
msgstr ""
#, kde-format
msgid "Show value"
msgstr ""
#, kde-format
msgid "Tag: %1"
msgstr ""
#, kde-format
msgid "Value: %1"
msgstr ""
#, kde-format
msgid "Info: %1"
msgstr ""
#, kde-format
msgid "Add lambda"
msgstr ""
msgid "Edit bars"
msgstr ""
#, kde-format
msgid "Run %1"
msgstr ""
#, kde-format
msgid "Version %1 (build date %2)"
msgstr ""
#, kde-format
msgid "A set of minimalistic plasmoid widgets"
msgstr ""
#, kde-format
msgid "Links:"
msgstr ""
#, kde-format
msgid "Homepage"
msgstr ""
#, kde-format
msgid "Repository"
msgstr ""
#, kde-format
msgid "Bugtracker"
msgstr ""
#, kde-format
msgid "Translation issue"
msgstr ""
#, kde-format
msgid "AUR packages"
msgstr ""
#, kde-format
msgid "openSUSE packages"
msgstr ""
#, kde-format
msgid "This software is licensed under %1"
msgstr ""
#, kde-format
msgid "Translators: %1"
msgstr ""
#, kde-format
msgid "This software uses: %1"
msgstr ""
#, kde-format
msgid "Select font"
msgstr ""
#, kde-format
msgid "Current version : %1"
msgstr ""
#, kde-format
msgid "New version : %1"
msgstr ""
#, kde-format
msgid "Click \"Ok\" to download"
msgstr ""
#, kde-format
msgid "There are updates"
msgstr ""
#, kde-format
msgid "AC online"
msgstr ""
#, kde-format
msgid "AC offline"
msgstr ""
#, kde-format
msgid "High CPU load"
msgstr ""
#, kde-format
msgid "High GPU load"
msgstr ""
#, kde-format
msgid "Free space on %1 less than 10%"
msgstr ""
#, kde-format
msgid "High memory usage"
msgstr ""
#, kde-format
msgid "Network device has been changed to %1"
msgstr ""
#, kde-format
msgid "MB/s"
msgstr ""
msgid "KB/s"
msgstr ""
msgid "Swap is used"
msgstr ""
#, kde-format
msgid "Select tag"
msgstr ""
#, kde-format
msgid "Tag"
msgstr ""
#, kde-format
msgid "Copy"
msgstr ""
#, kde-format
msgid "Create"
msgstr ""
#, kde-format
msgid "Remove"
msgstr ""
#, kde-format
msgid "Enter file name"
msgstr ""
#, kde-format
msgid "File name"
msgstr ""
#, kde-format
msgid "Name: %1"
msgstr ""
#, kde-format
msgid "Comment: %1"
msgstr ""
#, kde-format
msgid "Identity: %1"
msgstr ""
#, kde-format
msgid "Name"
msgstr ""
#, kde-format
msgid "Comment"
msgstr ""
#, kde-format
msgid ""
"<html><head/><body><p>Use YAHOO! finance ticker to get quotes for the "
"instrument. Refer to <a href=\"http://finance.yahoo.com/\"><span style=\" "
@ -485,160 +421,112 @@ msgid ""
"span></a></p></body></html>"
msgstr ""
#, kde-format
msgid "Ticker"
msgstr ""
#, kde-format
msgid "Active"
msgstr ""
#, kde-format
msgid "Interval"
msgstr ""
#, kde-format
msgid "Command"
msgstr ""
#, kde-format
msgid "Prefix"
msgstr ""
#, kde-format
msgid "Has output"
msgstr ""
#, kde-format
msgid "Redirect"
msgstr ""
#, kde-format
msgid "Additional filters"
msgstr ""
#, kde-format
msgid "Wrap colors"
msgstr ""
#, kde-format
msgid "Wrap spaces"
msgstr ""
#, kde-format
msgid "Filter"
msgstr ""
msgid "Null"
msgstr ""
#, kde-format
msgid "City"
msgstr ""
#, kde-format
msgid "Country"
msgstr ""
#, kde-format
msgid "Timestamp"
msgstr ""
#, kde-format
msgid "Use images"
msgstr ""
msgid "Value"
msgstr ""
#, kde-format
msgid "Active color"
msgstr ""
#, kde-format
msgid "Inactive color"
msgstr ""
#, kde-format
msgid "Type"
msgstr ""
#, kde-format
msgid "Direction"
msgstr ""
#, kde-format
msgid "Height"
msgstr ""
#, kde-format
msgid "Width"
msgstr ""
#, kde-format
msgid "Active desktop"
msgstr ""
#, kde-format
msgid "Inactive desktop"
msgstr ""
#, kde-format
msgid "Tooltip type"
msgstr ""
#, kde-format
msgid "contours"
msgstr ""
#, kde-format
msgid "windows"
msgstr ""
#, kde-format
msgid "clean desktop"
msgstr ""
#, kde-format
msgid "names"
msgstr ""
#, kde-format
msgid "none"
msgstr ""
#, kde-format
msgid "Tooltip width"
msgstr ""
#, kde-format
msgid "Vertical layout"
msgstr ""
#, kde-format
msgid "Mark"
msgstr ""
#, kde-format
msgid "Top Edge"
msgstr ""
#, kde-format
msgid "Bottom Edge"
msgstr ""
#, kde-format
msgid "Left Edge"
msgstr ""
#, kde-format
msgid "Right Edge"
msgstr ""
#, kde-format
msgid "Unknown location (%1)"
msgstr ""
#, kde-format
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr ""
#, kde-format
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr ""

View File

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
"POT-Creation-Date: 2015-08-01 22:13+0300\n"
"PO-Revision-Date: 2015-07-31 22:09+0300\n"
"POT-Creation-Date: 2015-09-02 00:03+0300\n"
"PO-Revision-Date: 2015-09-02 00:18+0300\n"
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
"Language-Team: English <kde-russian@lists.kde.ru>\n"
"Language: ru\n"
@ -18,239 +18,189 @@ msgstr ""
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Lokalize 2.0\n"
#, kde-format
msgid "Widget"
msgstr "Widget"
#, kde-format
msgid "Advanced"
msgstr "Advanced"
#, kde-format
msgid "Tooltip"
msgstr "Tooltip"
#, kde-format
msgid "Appearance"
msgstr "Appearance"
#, kde-format
msgid "DataEngine"
msgstr "DataEngine"
#, kde-format
msgid "About"
msgstr "About"
#, kde-format
msgid "Acknowledgment"
msgstr "Acknowledgment"
#, kde-format
msgid "Widget height, px"
msgstr "Widget height, px"
#, kde-format
msgid "Widget width, px"
msgstr "Widget width, px"
#, kde-format
msgid "Enable notifications"
msgstr "Enable notifications"
#, kde-format
msgid "Wrap new lines"
msgstr "Wrap new lines"
#, kde-format
msgid "Enable background"
msgstr "Enable background"
#, kde-format
msgid "Custom time format"
msgstr "Custom time format"
#, kde-format
msgid "Custom uptime format"
msgstr "Custom uptime format"
#, kde-format
msgid "Temperature units"
msgstr "Temperature units"
#, kde-format
msgid "Celsius"
msgstr "Celsius"
#, kde-format
msgid "Fahrenheit"
msgstr "Fahrenheit"
#, kde-format
msgid "Kelvin"
msgstr "Kelvin"
#, kde-format
msgid "Reaumur"
msgstr "Reaumur"
#, kde-format
msgid "cm^-1"
msgstr "cm^-1"
#, kde-format
msgid "kJ/mol"
msgstr "kJ/mol"
#, kde-format
msgid "kcal/mol"
msgstr "kcal/mol"
#, kde-format
msgid "AC online tag"
msgstr "AC online tag"
#, kde-format
msgid "AC offline tag"
msgstr "AC offline tag"
#, kde-format
msgid "Check updates on startup"
msgstr "Check updates on startup"
msgid "Translate strings"
msgstr "Translate strings"
msgid "Drop key cache"
msgstr "Drop key cache"
#, kde-format
msgid "Time interval"
msgstr "Time interval"
#, kde-format
msgid "Font"
msgstr "Font"
#, kde-format
msgid "Font size"
msgstr "Font size"
#, kde-format
msgid "Font weight"
msgstr "Font weight"
#, kde-format
msgid "light"
msgstr "light"
#, kde-format
msgid "normal"
msgstr "normal"
#, kde-format
msgid "demi bold"
msgstr "demi bold"
#, kde-format
msgid "bold"
msgstr "bold"
#, kde-format
msgid "black"
msgstr "black"
#, kde-format
msgid "Font style"
msgstr "Font style"
#, kde-format
msgid "italic"
msgstr "italic"
#, kde-format
msgid "Font color"
msgstr "Font color"
#, kde-format
msgid "Select a color"
msgstr "Select a color"
#, kde-format
msgid "Select a font"
msgstr "Select a font"
#, kde-format
msgid "ACPI path"
msgstr "ACPI path"
#, kde-format
msgid "Custom scripts"
msgstr "Custom scripts"
#, kde-format
msgid "Edit scripts"
msgstr "Edit scripts"
#, kde-format
msgid "GPU device"
msgstr "GPU device"
#, kde-format
msgid "HDD"
msgstr "HDD"
#, kde-format
msgid "hddtemp cmd"
msgstr "hddtemp cmd"
#, kde-format
msgid "MPD address"
msgstr "MPD address"
#, kde-format
msgid "MPD port"
msgstr "MPD port"
#, kde-format
msgid "MPRIS player name"
msgstr "MPRIS player name"
#, kde-format
msgid "Music player"
msgstr "Music player"
#, kde-format
msgid "Player data symbols"
msgstr "Player data symbols"
msgid "Custom scripts"
msgstr "Custom scripts"
msgid "Edit scripts"
msgstr "Edit scripts"
msgid "Quotes monitor"
msgstr "Quotes monitor"
#, kde-format
msgid "Edit tickers"
msgstr "Edit tickers"
#, kde-format
msgid "Package manager"
msgstr "Package manager"
#, kde-format
msgid "Edit command"
msgstr "Edit command"
#, kde-format
msgid "Weather"
msgstr "Weather"
#, kde-format
msgid "Edit weather"
msgstr "Edit weather"
#, kde-format
msgid "Request key"
msgstr "Request key"
#, kde-format
msgid "Show README"
msgstr "Show README"
#, kde-format
msgid "Check updates"
msgstr "Check updates"
#, kde-format
msgid ""
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
"To enable them just make needed checkbox fully checked."
@ -258,47 +208,36 @@ msgstr ""
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
"To enable them just make needed checkbox fully checked."
#, kde-format
msgid "Number of values for tooltips"
msgstr "Number of values for tooltips"
#, kde-format
msgid "Background"
msgstr "Background"
#, kde-format
msgid "CPU color"
msgstr "CPU color"
#, kde-format
msgid "CPU clock color"
msgstr "CPU clock color"
#, kde-format
msgid "Memory color"
msgstr "Memory color"
#, kde-format
msgid "Swap color"
msgstr "Swap color"
#, kde-format
msgid "Download speed color"
msgstr "Download speed color"
#, kde-format
msgid "Upload speed color"
msgstr "Upload speed color"
#, kde-format
msgid "Battery active color"
msgstr "Battery active color"
#, kde-format
msgid "Battery inactive color"
msgstr "Battery inactive color"
#, kde-format
msgid ""
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
"awesome-widgets/\">project homepage</a>"
@ -306,183 +245,180 @@ msgstr ""
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
"awesome-widgets/\">project homepage</a>"
#, kde-format
msgid "AC"
msgstr "AC"
msgid "Bars"
msgstr "Bars"
msgid "CPU"
msgstr "CPU"
msgid "Desktops"
msgstr "Desktops"
msgid "Memory"
msgstr "Memory"
msgid "Network"
msgstr "Network"
msgid "Scripts"
msgstr "Scripts"
msgid "Time"
msgstr "Time"
msgid "Quotes"
msgstr "Quotes"
msgid "Upgrades"
msgstr "Upgrades"
msgid "Weathers"
msgstr "Weathers"
msgid "Add"
msgstr "Add"
#, kde-format
msgid "Show value"
msgstr "Show value"
#, kde-format
msgid "Tag: %1"
msgstr "Tag: %1"
#, kde-format
msgid "Value: %1"
msgstr "Value: %1"
#, kde-format
msgid "Info: %1"
msgstr "Info: %1"
#, kde-format
msgid "Add lambda"
msgstr "Add lambda"
msgid "Edit bars"
msgstr "Edit bars"
#, kde-format
msgid "Run %1"
msgstr "Run %1"
#, kde-format
msgid "Version %1 (build date %2)"
msgstr "Version %1 (build date %2)"
#, kde-format
msgid "A set of minimalistic plasmoid widgets"
msgstr "A set of minimalistic plasmoid widgets"
#, kde-format
msgid "Links:"
msgstr "Links:"
#, kde-format
msgid "Homepage"
msgstr "Homepage"
#, kde-format
msgid "Repository"
msgstr "Repository"
#, kde-format
msgid "Bugtracker"
msgstr "Bugtracker"
#, kde-format
msgid "Translation issue"
msgstr "Translation issue"
#, kde-format
msgid "AUR packages"
msgstr "AUR packages"
#, kde-format
msgid "openSUSE packages"
msgstr "openSUSE packages"
#, kde-format
msgid "This software is licensed under %1"
msgstr "This software is licensed under %1"
#, kde-format
msgid "Translators: %1"
msgstr "Translators: %1"
#, kde-format
msgid "This software uses: %1"
msgstr "This software uses: %1"
#, kde-format
msgid "Select font"
msgstr "Select font"
#, kde-format
msgid "Current version : %1"
msgstr "Current version : %1"
#, kde-format
msgid "New version : %1"
msgstr "New version : %1"
#, kde-format
msgid "Click \"Ok\" to download"
msgstr "Click \"Ok\" to download"
#, kde-format
msgid "There are updates"
msgstr "There are updates"
#, kde-format
msgid "AC online"
msgstr "AC online"
#, kde-format
msgid "AC offline"
msgstr "AC offline"
#, kde-format
msgid "High CPU load"
msgstr "High CPU load"
#, kde-format
msgid "High GPU load"
msgstr "High GPU load"
#, kde-format
msgid "Free space on %1 less than 10%"
msgstr "Free space on %1 less than 10%"
#, kde-format
msgid "High memory usage"
msgstr "High memory usage"
#, kde-format
msgid "Network device has been changed to %1"
msgstr "Network device has been changed to %1"
#, kde-format
msgid "MB/s"
msgstr "MB/s"
msgid "KB/s"
msgstr "KB/s"
msgid "Swap is used"
msgstr "Swap is used"
#, kde-format
msgid "Select tag"
msgstr "Select tag"
#, kde-format
msgid "Tag"
msgstr "Tag"
#, kde-format
msgid "Copy"
msgstr "Copy"
#, kde-format
msgid "Create"
msgstr "Create"
#, kde-format
msgid "Remove"
msgstr "Remove"
#, kde-format
msgid "Enter file name"
msgstr "Enter file name"
#, kde-format
msgid "File name"
msgstr "File name"
#, kde-format
msgid "Name: %1"
msgstr "Name: %1"
#, kde-format
msgid "Comment: %1"
msgstr "Comment: %1"
#, kde-format
msgid "Identity: %1"
msgstr "Identity: %1"
#, kde-format
msgid "Name"
msgstr "Name"
#, kde-format
msgid "Comment"
msgstr "Comment"
#, kde-format
msgid ""
"<html><head/><body><p>Use YAHOO! finance ticker to get quotes for the "
"instrument. Refer to <a href=\"http://finance.yahoo.com/\"><span style=\" "
@ -494,164 +430,131 @@ msgstr ""
"text-decoration: underline; color:#0057ae;\">http://finance.yahoo.com/</"
"span></a></p></body></html>"
#, kde-format
msgid "Ticker"
msgstr "Ticker"
#, kde-format
msgid "Active"
msgstr "Active"
#, kde-format
msgid "Interval"
msgstr "Interval"
#, kde-format
msgid "Command"
msgstr "Command"
#, kde-format
msgid "Prefix"
msgstr "Prefix"
#, kde-format
msgid "Has output"
msgstr "Has output"
#, kde-format
msgid "Redirect"
msgstr "Redirect"
#, kde-format
msgid "Additional filters"
msgstr "Additional filters"
#, kde-format
msgid "Wrap colors"
msgstr "Wrap colors"
#, kde-format
msgid "Wrap spaces"
msgstr "Wrap spaces"
#, kde-format
msgid "Filter"
msgstr "Filter"
msgid "Null"
msgstr "Null"
#, kde-format
msgid "City"
msgstr "City"
#, kde-format
msgid "Country"
msgstr "Country"
#, kde-format
msgid "Timestamp"
msgstr "Timestamp"
#, kde-format
msgid "Use images"
msgstr "Use images"
msgid "Value"
msgstr "Value"
#, kde-format
msgid "Active color"
msgstr "Active color"
#, kde-format
msgid "Inactive color"
msgstr "Inactive color"
#, kde-format
msgid "Type"
msgstr "Type"
#, kde-format
msgid "Direction"
msgstr "Direction"
#, kde-format
msgid "Height"
msgstr "Height"
#, kde-format
msgid "Width"
msgstr "Width"
#, kde-format
msgid "Active desktop"
msgstr "Active desktop"
#, kde-format
msgid "Inactive desktop"
msgstr "Inactive desktop"
#, kde-format
msgid "Tooltip type"
msgstr "Tooltip type"
#, kde-format
msgid "contours"
msgstr "contours"
#, kde-format
msgid "windows"
msgstr "windows"
#, kde-format
msgid "clean desktop"
msgstr "clean desktop"
#, kde-format
msgid "names"
msgstr "names"
#, kde-format
msgid "none"
msgstr "none"
#, kde-format
msgid "Tooltip width"
msgstr "Tooltip width"
#, kde-format
msgid "Vertical layout"
msgstr "Vertical layout"
#, kde-format
msgid "Mark"
msgstr "Mark"
#, kde-format
msgid "Top Edge"
msgstr "Top Edge"
#, kde-format
msgid "Bottom Edge"
msgstr "Bottom Edge"
#, kde-format
msgid "Left Edge"
msgstr "Left Edge"
#, kde-format
msgid "Right Edge"
msgstr "Right Edge"
#, kde-format
msgid "Unknown location (%1)"
msgstr "Unknown location (%1)"
#, kde-format
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "Evgeniy Alekseev"
#, kde-format
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "esalexeev@gmail.com"
#~ msgid "Top Edge"
#~ msgstr "Top Edge"
#~ msgid "Bottom Edge"
#~ msgstr "Bottom Edge"
#~ msgid "Left Edge"
#~ msgstr "Left Edge"
#~ msgid "Right Edge"
#~ msgstr "Right Edge"
#~ msgid "Unknown location (%1)"
#~ msgstr "Unknown location (%1)"
#~ msgid "Ticker: %1"
#~ msgstr "Ticker: %1"
@ -673,9 +576,6 @@ msgstr "esalexeev@gmail.com"
#~ msgid "Edit"
#~ msgstr "Edit"
#~ msgid "Bars"
#~ msgstr "Bars"
#~ msgid "Enable popup on mouse click"
#~ msgstr "Enable popup on mouse click"
@ -849,9 +749,6 @@ msgstr "esalexeev@gmail.com"
#~ "$uptime - system uptime\n"
#~ "$custom - custom format"
#~ msgid "CPU"
#~ msgstr "CPU"
#~ msgid ""
#~ "$cpu - total load CPU, %\n"
#~ "$cpu0 - load CPU for core 0, %\n"
@ -903,9 +800,6 @@ msgstr "esalexeev@gmail.com"
#~ msgid "$gputemp - physical temperature on GPU"
#~ msgstr "$gputemp - physical temperature on GPU"
#~ msgid "Memory"
#~ msgstr "Memory"
#~ msgid ""
#~ "$mem - RAM usage, %\n"
#~ "$memmb - RAM usage, MB\n"
@ -968,9 +862,6 @@ msgstr "esalexeev@gmail.com"
#~ msgstr ""
#~ "$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0"
#~ msgid "Network"
#~ msgstr "Network"
#~ msgid ""
#~ "$down - download speed, KB/s\n"
#~ "$up - upload speed, KB/s\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
"POT-Creation-Date: 2015-08-01 22:13+0300\n"
"POT-Creation-Date: 2015-09-02 00:03+0300\n"
"PO-Revision-Date: 2015-07-31 22:13+0300\n"
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
"Language-Team: Spanish <kde-russian@lists.kde.ru>\n"
@ -18,239 +18,192 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Lokalize 2.0\n"
#, kde-format
msgid "Widget"
msgstr "Widget"
#, kde-format
msgid "Advanced"
msgstr "Avanzado"
#, kde-format
msgid "Tooltip"
msgstr "Ventana emergente"
#, kde-format
msgid "Appearance"
msgstr "Apariencia"
#, kde-format
msgid "DataEngine"
msgstr "DataEngine"
#, kde-format
msgid "About"
msgstr "Acerca de"
#, kde-format
msgid "Acknowledgment"
msgstr "Reconocimiento"
#, kde-format
msgid "Widget height, px"
msgstr "Alto del widget, px"
#, kde-format
msgid "Widget width, px"
msgstr "Ancho del widget, px"
#, kde-format
msgid "Enable notifications"
msgstr "Habilitar notificaciones"
#, kde-format
msgid "Wrap new lines"
msgstr "Ajustar las nuevas líneas"
#, kde-format
msgid "Enable background"
msgstr "Habilitar fondo"
#, kde-format
msgid "Custom time format"
msgstr "Formato personalizado de hora"
#, kde-format
msgid "Custom uptime format"
msgstr "Formato personalizado de actividad del sistema"
#, kde-format
msgid "Temperature units"
msgstr "Unidades de temperatura"
#, kde-format
msgid "Celsius"
msgstr "Celsius"
#, kde-format
msgid "Fahrenheit"
msgstr "Fahrenheit"
#, kde-format
msgid "Kelvin"
msgstr "Kelvin"
#, kde-format
msgid "Reaumur"
msgstr "Réaumur"
#, kde-format
msgid "cm^-1"
msgstr "cm^-1"
#, kde-format
msgid "kJ/mol"
msgstr "kJ/mol"
#, kde-format
msgid "kcal/mol"
msgstr "kcal/mol"
#, kde-format
msgid "AC online tag"
msgstr "Etiqueta para alimentación conectada"
#, kde-format
msgid "AC offline tag"
msgstr "Etiqueta para la alimentación desconectada"
#, kde-format
#, fuzzy
msgid "Check updates on startup"
msgstr "Comprobar actualizaciones"
#, fuzzy
msgid "Translate strings"
msgstr "Problemas de traducción"
msgid "Drop key cache"
msgstr ""
#, kde-format
msgid "Time interval"
msgstr "Intervalo de tiempo"
#, kde-format
msgid "Font"
msgstr "Tipo de letra"
#, kde-format
msgid "Font size"
msgstr "Tamaño de letra"
#, kde-format
msgid "Font weight"
msgstr "Grosor de la letra"
#, kde-format
msgid "light"
msgstr "fina"
#, kde-format
msgid "normal"
msgstr "normal"
#, kde-format
msgid "demi bold"
msgstr "medio negrita"
#, kde-format
msgid "bold"
msgstr "negrita"
#, kde-format
msgid "black"
msgstr "negro"
#, kde-format
msgid "Font style"
msgstr "Estilo de letra"
#, kde-format
msgid "italic"
msgstr "cursiva"
#, kde-format
msgid "Font color"
msgstr "Color de letra"
#, kde-format
msgid "Select a color"
msgstr "Elige un color"
#, kde-format
msgid "Select a font"
msgstr "Elige un tipo de letra"
#, kde-format
msgid "ACPI path"
msgstr "Ruta ACPI"
#, kde-format
msgid "Custom scripts"
msgstr "Scripts personalizados"
#, kde-format
msgid "Edit scripts"
msgstr "Editar scripts"
#, kde-format
msgid "GPU device"
msgstr "Dispositivo de GPU"
#, kde-format
msgid "HDD"
msgstr "Disco duro"
#, kde-format
msgid "hddtemp cmd"
msgstr "Comando hddtemp"
#, kde-format
msgid "MPD address"
msgstr "Dirección de MPD"
#, kde-format
msgid "MPD port"
msgstr "Puerto de MPD"
#, kde-format
msgid "MPRIS player name"
msgstr "Nombre del reproductor MPRIS"
#, kde-format
msgid "Music player"
msgstr "Reproductor de música"
#, kde-format
msgid "Player data symbols"
msgstr ""
msgid "Custom scripts"
msgstr "Scripts personalizados"
msgid "Edit scripts"
msgstr "Editar scripts"
msgid "Quotes monitor"
msgstr "Monitor de citas"
#, kde-format
msgid "Edit tickers"
msgstr "Editar tickets"
#, kde-format
msgid "Package manager"
msgstr "Gestor de paquetes"
#, kde-format
msgid "Edit command"
msgstr "Editar orden"
#, kde-format
msgid "Weather"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Edit weather"
msgstr "Editar tickets"
#, kde-format
msgid "Request key"
msgstr "Solicitar llave"
#, kde-format
msgid "Show README"
msgstr "Mostrar el README"
#, kde-format
msgid "Check updates"
msgstr "Comprobar actualizaciones"
#, kde-format
msgid ""
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
"To enable them just make needed checkbox fully checked."
@ -259,47 +212,36 @@ msgstr ""
"ventanas emergentes. Para habilitarlas marca respectivas las cajas de "
"selección necesarias."
#, kde-format
msgid "Number of values for tooltips"
msgstr "Número de valores para las ventanas emergentes"
#, kde-format
msgid "Background"
msgstr "Fondo"
#, kde-format
msgid "CPU color"
msgstr "Color de la CPU"
#, kde-format
msgid "CPU clock color"
msgstr "Color de la frecuencia de la CPU"
#, kde-format
msgid "Memory color"
msgstr "Color de la memoria"
#, kde-format
msgid "Swap color"
msgstr "Color de la swap"
#, kde-format
msgid "Download speed color"
msgstr "Color de la velocidad de recepción"
#, kde-format
msgid "Upload speed color"
msgstr "Color de la velocidad de envío"
#, kde-format
msgid "Battery active color"
msgstr "Color de la batería activa"
#, kde-format
msgid "Battery inactive color"
msgstr "Color de la batería inactiva"
#, kde-format
msgid ""
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
"awesome-widgets/\">project homepage</a>"
@ -307,183 +249,185 @@ msgstr ""
"Puedes encontrar información detallada en el <a href=\"http://arcanis.name/"
"projects/awesome-widgets/\">sitio del proyecto</a>"
#, kde-format
msgid "AC"
msgstr ""
msgid "Bars"
msgstr "Barras"
msgid "CPU"
msgstr "CPU"
msgid "Desktops"
msgstr ""
msgid "Memory"
msgstr "Memoria"
msgid "Network"
msgstr "Red"
#, fuzzy
msgid "Scripts"
msgstr "Editar scripts"
#, fuzzy
msgid "Time"
msgstr "Hora"
#, fuzzy
msgid "Quotes"
msgstr "Monitor de citas"
msgid "Upgrades"
msgstr ""
#, fuzzy
msgid "Weathers"
msgstr "Editar tickets"
msgid "Add"
msgstr "Añadir"
#, kde-format
msgid "Show value"
msgstr "Mostrar valor"
#, kde-format
msgid "Tag: %1"
msgstr "Etiqueta: %1"
#, kde-format
msgid "Value: %1"
msgstr "Valor: %1"
#, kde-format
msgid "Info: %1"
msgstr "Información: %1"
#, kde-format
msgid "Add lambda"
msgstr ""
msgid "Edit bars"
msgstr "Editar barras"
#, kde-format
msgid "Run %1"
msgstr "Ejecutar %1"
#, kde-format
msgid "Version %1 (build date %2)"
msgstr "Versión %1 (fecha de construcción %2)"
#, kde-format
msgid "A set of minimalistic plasmoid widgets"
msgstr "Un conjunto de plasmoides minimalistas"
#, kde-format
msgid "Links:"
msgstr "Enlaces:"
#, kde-format
msgid "Homepage"
msgstr "Página principal"
#, kde-format
msgid "Repository"
msgstr "Repositorio"
#, kde-format
msgid "Bugtracker"
msgstr "Reporte de errores"
#, kde-format
msgid "Translation issue"
msgstr "Problemas de traducción"
#, kde-format
msgid "AUR packages"
msgstr "Paquetes AUR"
#, kde-format
msgid "openSUSE packages"
msgstr "Paquetes de openSUSE"
#, kde-format
msgid "This software is licensed under %1"
msgstr "Este software está licenciado bajo %1"
#, kde-format
msgid "Translators: %1"
msgstr "Traductores: %1"
#, kde-format
msgid "This software uses: %1"
msgstr "Este software usa: %1"
#, kde-format
msgid "Select font"
msgstr "Elegir tipo de letra"
#, kde-format
msgid "Current version : %1"
msgstr "Versión actual: %1"
#, kde-format
msgid "New version : %1"
msgstr "Nueva versión: %1"
#, kde-format
msgid "Click \"Ok\" to download"
msgstr "Haz clic en «Ok» para descargar"
#, kde-format
msgid "There are updates"
msgstr "Hay actualizaciones disponibles"
#, kde-format
msgid "AC online"
msgstr "Alimentación conectada"
#, kde-format
msgid "AC offline"
msgstr "Alimentación desconectada"
#, kde-format
msgid "High CPU load"
msgstr "Carga alta de CPU"
#, kde-format
msgid "High GPU load"
msgstr "Carga alta de GPU"
#, kde-format
msgid "Free space on %1 less than 10%"
msgstr "Espacio libre en %1 es menos del 10%"
#, kde-format
msgid "High memory usage"
msgstr "Alto uso de la memoria"
#, kde-format
msgid "Network device has been changed to %1"
msgstr "El dispositivo de red ha sido cambiado a %1"
#, kde-format
msgid "MB/s"
msgstr ""
msgid "KB/s"
msgstr ""
msgid "Swap is used"
msgstr "Swap está en uso"
#, kde-format
msgid "Select tag"
msgstr "Elegir etiqueta"
#, kde-format
msgid "Tag"
msgstr "Etiqueta"
#, kde-format
msgid "Copy"
msgstr "Copiar"
#, kde-format
msgid "Create"
msgstr "Crear"
#, kde-format
msgid "Remove"
msgstr "Eliminar"
#, kde-format
msgid "Enter file name"
msgstr "Inserta el nombre de archivo"
#, kde-format
msgid "File name"
msgstr "Nombre de archivo"
#, kde-format
msgid "Name: %1"
msgstr "Nombre: %1"
#, kde-format
msgid "Comment: %1"
msgstr "Comentario: %1"
#, fuzzy, kde-format
#, fuzzy
msgid "Identity: %1"
msgstr "Comentario: %1"
#, kde-format
msgid "Name"
msgstr "Nombre"
#, kde-format
msgid "Comment"
msgstr "Comentario"
#, kde-format
msgid ""
"<html><head/><body><p>Use YAHOO! finance ticker to get quotes for the "
"instrument. Refer to <a href=\"http://finance.yahoo.com/\"><span style=\" "
@ -491,164 +435,137 @@ msgid ""
"span></a></p></body></html>"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Ticker"
msgstr "Reloj: %1"
#, fuzzy, kde-format
#, fuzzy
msgid "Active"
msgstr "Color de activo"
#, fuzzy, kde-format
#, fuzzy
msgid "Interval"
msgstr "Intervalo de tiempo"
#, fuzzy, kde-format
#, fuzzy
msgid "Command"
msgstr "Comentario"
#, kde-format
msgid "Prefix"
msgstr ""
#, kde-format
msgid "Has output"
msgstr ""
#, kde-format
msgid "Redirect"
msgstr ""
#, kde-format
msgid "Additional filters"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Wrap colors"
msgstr "Color de la swap"
#, kde-format
msgid "Wrap spaces"
msgstr ""
#, kde-format
msgid "Filter"
msgstr ""
msgid "Null"
msgstr ""
#, kde-format
msgid "City"
msgstr ""
#, kde-format
msgid "Country"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Timestamp"
msgstr "Hora"
#, kde-format
msgid "Use images"
msgstr ""
msgid "Value"
msgstr "Valor"
#, kde-format
msgid "Active color"
msgstr "Color de activo"
#, kde-format
msgid "Inactive color"
msgstr "Color de inactivo"
#, kde-format
msgid "Type"
msgstr "Tipo"
#, kde-format
msgid "Direction"
msgstr "Dirección"
#, kde-format
msgid "Height"
msgstr "Alto"
#, kde-format
msgid "Width"
msgstr "Ancho"
#, kde-format
msgid "Active desktop"
msgstr "Escritorio activo"
#, kde-format
msgid "Inactive desktop"
msgstr "Escritorio inactivo"
#, kde-format
msgid "Tooltip type"
msgstr "Tipo de ventana emergente"
#, kde-format
msgid "contours"
msgstr "contornos"
#, kde-format
msgid "windows"
msgstr "ventanas"
#, kde-format
msgid "clean desktop"
msgstr "limpiar escritorio"
#, kde-format
msgid "names"
msgstr "nombres"
#, kde-format
msgid "none"
msgstr "ninguno"
#, kde-format
msgid "Tooltip width"
msgstr "Ancho de la ventana emergente"
#, kde-format
msgid "Vertical layout"
msgstr "Orientación vertical"
#, kde-format
msgid "Mark"
msgstr "Marca"
#, kde-format
msgid "Top Edge"
msgstr "Borde superior"
#, kde-format
msgid "Bottom Edge"
msgstr "Borde inferior"
#, kde-format
msgid "Left Edge"
msgstr "Borde izquierdo"
#, kde-format
msgid "Right Edge"
msgstr "Borde derecho"
#, kde-format
msgid "Unknown location (%1)"
msgstr "Ubicación desconocida (%1)"
#, kde-format
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "Tu nombre"
#, kde-format
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "Tu correo electrónico"
#~ msgid "Top Edge"
#~ msgstr "Borde superior"
#~ msgid "Bottom Edge"
#~ msgstr "Borde inferior"
#~ msgid "Left Edge"
#~ msgstr "Borde izquierdo"
#~ msgid "Right Edge"
#~ msgstr "Borde derecho"
#~ msgid "Unknown location (%1)"
#~ msgstr "Ubicación desconocida (%1)"
#~ msgid "Exec: %1"
#~ msgstr "Ejecutar: %1"
@ -667,9 +584,6 @@ msgstr "Tu correo electrónico"
#~ msgid "Edit"
#~ msgstr "Editar"
#~ msgid "Bars"
#~ msgstr "Barras"
#~ msgid "Enable popup on mouse click"
#~ msgstr "Habilitar ventana emergente al hacer clic"
@ -830,9 +744,6 @@ msgstr "Tu correo electrónico"
#~ "$uptime - tiempo de actividad del sistema\n"
#~ "$custom - formato personalizado"
#~ msgid "CPU"
#~ msgstr "CPU"
#~ msgid ""
#~ "$cpu - total load CPU, %\n"
#~ "$cpu0 - load CPU for core 0, %\n"
@ -886,9 +797,6 @@ msgstr "Tu correo electrónico"
#~ msgid "$gputemp - physical temperature on GPU"
#~ msgstr "$gputemp - temperatura física de la GPU"
#~ msgid "Memory"
#~ msgstr "Memoria"
#~ msgid ""
#~ "$mem - RAM usage, %\n"
#~ "$memmb - RAM usage, MB\n"
@ -958,9 +866,6 @@ msgstr "Tu correo electrónico"
#~ "$hddtempN - temperatura física en el dispositivo N (a partir de 0). "
#~ "Ejemplo: $hddtemp0"
#~ msgid "Network"
#~ msgstr "Red"
#~ msgid ""
#~ "$down - download speed, KB/s\n"
#~ "$up - upload speed, KB/s\n"

View File

@ -4,6 +4,9 @@ BASEDIR="../"
PROJECT="awesome-widgets"
BUGADDR="https://github.com/arcan1s/awesome-widgets/issues"
WORKDIR=$(pwd)
# translations tags
TAGS="-ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 -kI18N_NOOP:1 \
-kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3"
find "${BASEDIR}" -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' | sort > "${WORKDIR}/rcfiles.list"
xargs --arg-file="${WORKDIR}/rcfiles.list" > "${WORKDIR}/rc.cpp"
@ -13,7 +16,7 @@ echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> "${WORKDIR}/rc.cpp"
find "${BASEDIR}" -name '*.cpp' -o -name '*.h' -o -name '*.qml' | sort > "${WORKDIR}/infiles.list"
echo "rc.cpp" >> "${WORKDIR}/infiles.list"
xgettext -C --no-location --msgid-bugs-address="${BUGADDR}" \
xgettext -C --no-location --msgid-bugs-address="${BUGADDR}" ${TAGS} \
--files-from="infiles.list" -D "${BASEDIR}" -D "${WORKDIR}" -o "${PROJECT}.pot" || exit 1
TRANSLATIONS=$(find . -name '*.po')

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
"POT-Creation-Date: 2015-08-01 22:13+0300\n"
"POT-Creation-Date: 2015-09-02 00:03+0300\n"
"PO-Revision-Date: 2015-07-31 22:16+0300\n"
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
"Language-Team: French <kde-russian@lists.kde.ru>\n"
@ -20,239 +20,192 @@ msgstr ""
"X-Generator: Lokalize 2.0\n"
"X-Language: fr-FR\n"
#, kde-format
msgid "Widget"
msgstr "Composant"
#, kde-format
msgid "Advanced"
msgstr "Avancé"
#, kde-format
msgid "Tooltip"
msgstr "Conseil"
#, kde-format
msgid "Appearance"
msgstr "Apparence"
#, kde-format
msgid "DataEngine"
msgstr "Moteur de données"
#, kde-format
msgid "About"
msgstr "À propos"
#, kde-format
msgid "Acknowledgment"
msgstr "À savoir"
#, kde-format
msgid "Widget height, px"
msgstr "Paramètres du composant"
#, kde-format
msgid "Widget width, px"
msgstr "Largeur de l'applet"
#, kde-format
msgid "Enable notifications"
msgstr "Activer les notifications"
#, kde-format
msgid "Wrap new lines"
msgstr "Couper les lignes supplémentaires"
#, kde-format
msgid "Enable background"
msgstr "Activer le fond"
#, kde-format
msgid "Custom time format"
msgstr "Format de l'heure personnalisé"
#, kde-format
msgid "Custom uptime format"
msgstr "Temps de fonctionnement personalisé"
#, kde-format
msgid "Temperature units"
msgstr "Unités de température"
#, kde-format
msgid "Celsius"
msgstr "Celsius"
#, kde-format
msgid "Fahrenheit"
msgstr "Fahrenheit"
#, kde-format
msgid "Kelvin"
msgstr "Kelvin"
#, kde-format
msgid "Reaumur"
msgstr "Reaumur"
#, kde-format
msgid "cm^-1"
msgstr "cm^-1"
#, kde-format
msgid "kJ/mol"
msgstr "kJ/mol"
#, kde-format
msgid "kcal/mol"
msgstr "kcal/mol"
#, kde-format
msgid "AC online tag"
msgstr "Étiquette alimentation branchée"
#, kde-format
msgid "AC offline tag"
msgstr "Étiquette alimentation débranchée"
#, kde-format
#, fuzzy
msgid "Check updates on startup"
msgstr "Vérifier les mises à jour"
#, fuzzy
msgid "Translate strings"
msgstr "Traductions"
msgid "Drop key cache"
msgstr ""
#, kde-format
msgid "Time interval"
msgstr "Intervalle"
#, kde-format
msgid "Font"
msgstr "Police"
#, kde-format
msgid "Font size"
msgstr "Taille de la police"
#, kde-format
msgid "Font weight"
msgstr "Épaisseur de la police"
#, kde-format
msgid "light"
msgstr "léger"
#, kde-format
msgid "normal"
msgstr "normal"
#, kde-format
msgid "demi bold"
msgstr "mi-gras"
#, kde-format
msgid "bold"
msgstr "gras"
#, kde-format
msgid "black"
msgstr "noir"
#, kde-format
msgid "Font style"
msgstr "Style de la police"
#, kde-format
msgid "italic"
msgstr "italique"
#, kde-format
msgid "Font color"
msgstr "Couleur de la police"
#, kde-format
msgid "Select a color"
msgstr "Sélectionner une couleur"
#, kde-format
msgid "Select a font"
msgstr "Sélectionner une police"
#, kde-format
msgid "ACPI path"
msgstr "chemin ACPI"
#, kde-format
msgid "Custom scripts"
msgstr "Scripts personnalisés"
#, kde-format
msgid "Edit scripts"
msgstr "Modifier les scripts"
#, kde-format
msgid "GPU device"
msgstr "Périphérique graphique"
#, kde-format
msgid "HDD"
msgstr "Disque dur"
#, kde-format
msgid "hddtemp cmd"
msgstr "Cmd de température disques"
#, kde-format
msgid "MPD address"
msgstr "Adresse MPD"
#, kde-format
msgid "MPD port"
msgstr "Port MPD"
#, kde-format
msgid "MPRIS player name"
msgstr "Nom du lecteur MPRIS"
#, kde-format
msgid "Music player"
msgstr "Lecteur audio"
#, kde-format
msgid "Player data symbols"
msgstr ""
msgid "Custom scripts"
msgstr "Scripts personnalisés"
msgid "Edit scripts"
msgstr "Modifier les scripts"
msgid "Quotes monitor"
msgstr "Moniteur de citations"
#, kde-format
msgid "Edit tickers"
msgstr "Modifier les tickers"
#, kde-format
msgid "Package manager"
msgstr "Gestionnaire de paquets"
#, kde-format
msgid "Edit command"
msgstr "Modifier la commande"
#, kde-format
msgid "Weather"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Edit weather"
msgstr "Modifier les tickers"
#, kde-format
msgid "Request key"
msgstr "Demander une clé"
#, kde-format
msgid "Show README"
msgstr "Voir le README"
#, kde-format
msgid "Check updates"
msgstr "Vérifier les mises à jour"
#, kde-format
msgid ""
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
"To enable them just make needed checkbox fully checked."
@ -261,47 +214,36 @@ msgstr ""
"conseils visuels. Pour les activer cochez simplement les cases "
"correspondantes."
#, kde-format
msgid "Number of values for tooltips"
msgstr "Nombre d'éléments pour les conseils"
#, kde-format
msgid "Background"
msgstr "Fond"
#, kde-format
msgid "CPU color"
msgstr "Couleur processeur"
#, kde-format
msgid "CPU clock color"
msgstr "Couleur de l'horloge processeur"
#, kde-format
msgid "Memory color"
msgstr "Couleur de la mémoire"
#, kde-format
msgid "Swap color"
msgstr "Couleur de la mémoire d'échange"
#, kde-format
msgid "Download speed color"
msgstr "Couleur de la vitesse de téléchargement"
#, kde-format
msgid "Upload speed color"
msgstr "Couleur du téléversement"
#, kde-format
msgid "Battery active color"
msgstr "Couleur active batterie"
#, kde-format
msgid "Battery inactive color"
msgstr "Couleur batterie inactive"
#, kde-format
msgid ""
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
"awesome-widgets/\">project homepage</a>"
@ -309,183 +251,189 @@ msgstr ""
"D'avantage d'informations se trouvent sur <a href=\"http://arcanis.name/"
"projects/awesome-widgets/\">la page du projet</a>"
#, kde-format
msgid "AC"
msgstr ""
msgid "Bars"
msgstr ""
msgid "CPU"
msgstr "CPU"
msgid "Desktops"
msgstr ""
msgid "Memory"
msgstr "Mémoire"
msgid "Network"
msgstr "Réseau"
#, fuzzy
msgid "Scripts"
msgstr "Modifier les scripts"
#, fuzzy
msgid "Time"
msgstr "Durée"
#, fuzzy
msgid "Quotes"
msgstr "Moniteur de citations"
msgid "Upgrades"
msgstr ""
#, fuzzy
msgid "Weathers"
msgstr "Modifier les tickers"
msgid "Add"
msgstr "Ajouter"
#, kde-format
msgid "Show value"
msgstr "Afficher la valeur"
#, kde-format
msgid "Tag: %1"
msgstr "Etiquette: %1"
#, kde-format
msgid "Value: %1"
msgstr "Valeur: %1"
#, kde-format
msgid "Info: %1"
msgstr "Info: %1"
#, kde-format
msgid "Add lambda"
msgstr ""
msgid "Edit bars"
msgstr "Modifier les barres"
#, kde-format
msgid "Run %1"
msgstr "Éxecuter %1"
#, kde-format
msgid "Version %1 (build date %2)"
msgstr "Version %1 (build date %2)"
#, kde-format
msgid "A set of minimalistic plasmoid widgets"
msgstr "Un jeu de composants plasmoïds minimalistes"
#, kde-format
msgid "Links:"
msgstr "Liens:"
#, kde-format
msgid "Homepage"
msgstr "Page d'accueil"
#, kde-format
msgid "Repository"
msgstr "Dépôt"
#, kde-format
msgid "Bugtracker"
msgstr "Suivi des bugs"
#, kde-format
msgid "Translation issue"
msgstr "Traductions"
#, kde-format
msgid "AUR packages"
msgstr "Paquets depuis AUR"
#, kde-format
msgid "openSUSE packages"
msgstr "Paquets openSUSE"
#, kde-format
msgid "This software is licensed under %1"
msgstr "Ce programme est publié sous la licence %1"
#, kde-format
msgid "Translators: %1"
msgstr "Traducteurs: %1"
#, kde-format
msgid "This software uses: %1"
msgstr "Ce logiciel utilise: %1"
#, kde-format
msgid "Select font"
msgstr "Sélectionner une couleur"
#, fuzzy, kde-format
#, fuzzy
msgid "Current version : %1"
msgstr "Version actuelle"
#, fuzzy, kde-format
#, fuzzy
msgid "New version : %1"
msgstr "Nouvelle version"
#, kde-format
msgid "Click \"Ok\" to download"
msgstr "Cliquer sur \"Valider\" pour télécharger"
#, kde-format
msgid "There are updates"
msgstr "Des mises à jour sont disponibles"
#, kde-format
msgid "AC online"
msgstr "Alimentation branchée"
#, kde-format
msgid "AC offline"
msgstr "Alimentation débranchée"
#, kde-format
msgid "High CPU load"
msgstr "Haute charge CPU"
#, kde-format
msgid "High GPU load"
msgstr "Haute charge GPU"
#, kde-format
msgid "Free space on %1 less than 10%"
msgstr "Espace libre sur %1 inférieur à 10%"
#, kde-format
msgid "High memory usage"
msgstr "Haute utilisation mémoire"
#, kde-format
msgid "Network device has been changed to %1"
msgstr "L'interface réseau à été changée en %1"
#, kde-format
msgid "MB/s"
msgstr ""
msgid "KB/s"
msgstr ""
msgid "Swap is used"
msgstr "Fichier d'échange utilisé"
#, kde-format
msgid "Select tag"
msgstr "Sélectionner l'étiquette"
#, kde-format
msgid "Tag"
msgstr "Étiquette"
#, kde-format
msgid "Copy"
msgstr "Copier"
#, kde-format
msgid "Create"
msgstr "Créer"
#, kde-format
msgid "Remove"
msgstr "Supprimer"
#, kde-format
msgid "Enter file name"
msgstr "Entrer le nom du fichier"
#, kde-format
msgid "File name"
msgstr "Nom du fichier"
#, kde-format
msgid "Name: %1"
msgstr "Nom: %1"
#, kde-format
msgid "Comment: %1"
msgstr "Commentaire: %1"
#, fuzzy, kde-format
#, fuzzy
msgid "Identity: %1"
msgstr "Commentaire: %1"
#, fuzzy, kde-format
#, fuzzy
msgid "Name"
msgstr "Nom: %1"
#, fuzzy, kde-format
#, fuzzy
msgid "Comment"
msgstr "Commentaire: %1"
#, kde-format
msgid ""
"<html><head/><body><p>Use YAHOO! finance ticker to get quotes for the "
"instrument. Refer to <a href=\"http://finance.yahoo.com/\"><span style=\" "
@ -493,164 +441,141 @@ msgid ""
"span></a></p></body></html>"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Ticker"
msgstr "Ticker: %1"
#, fuzzy, kde-format
#, fuzzy
msgid "Active"
msgstr "Batterie"
#, fuzzy, kde-format
#, fuzzy
msgid "Interval"
msgstr "Intervalle"
#, fuzzy, kde-format
#, fuzzy
msgid "Command"
msgstr "Commande personnalisée"
#, kde-format
msgid "Prefix"
msgstr ""
#, kde-format
msgid "Has output"
msgstr ""
#, kde-format
msgid "Redirect"
msgstr ""
#, kde-format
msgid "Additional filters"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Wrap colors"
msgstr "Couleur de la mémoire d'échange"
#, kde-format
msgid "Wrap spaces"
msgstr ""
#, kde-format
msgid "Filter"
msgstr ""
msgid "Null"
msgstr ""
#, kde-format
msgid "City"
msgstr ""
#, kde-format
msgid "Country"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Timestamp"
msgstr "Durée"
#, fuzzy, kde-format
msgid "Use images"
msgstr ""
#, fuzzy
msgid "Value"
msgstr "Valeur: %1"
#, fuzzy, kde-format
#, fuzzy
msgid "Active color"
msgstr "Batterie"
#, fuzzy, kde-format
#, fuzzy
msgid "Inactive color"
msgstr "Batterie"
#, kde-format
msgid "Type"
msgstr ""
#, kde-format
msgid "Direction"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Height"
msgstr "léger"
#, kde-format
msgid "Width"
msgstr ""
#, kde-format
msgid "Active desktop"
msgstr "Bureau actif"
#, kde-format
msgid "Inactive desktop"
msgstr "Bureau inactif"
#, kde-format
msgid "Tooltip type"
msgstr "Type d'infobulle"
#, kde-format
msgid "contours"
msgstr "contours"
#, kde-format
msgid "windows"
msgstr "fenêtres"
#, kde-format
msgid "clean desktop"
msgstr "nettoyer le bureau"
#, kde-format
msgid "names"
msgstr "noms"
#, kde-format
msgid "none"
msgstr "Aucun"
#, kde-format
msgid "Tooltip width"
msgstr "Largeur de l'infobulle"
#, kde-format
msgid "Vertical layout"
msgstr "Positionnement vertical"
#, kde-format
msgid "Mark"
msgstr "Marquer"
#, kde-format
msgid "Top Edge"
msgstr "Bord du haut"
#, kde-format
msgid "Bottom Edge"
msgstr "Bord du bas"
#, kde-format
msgid "Left Edge"
msgstr "Bord gauche"
#, kde-format
msgid "Right Edge"
msgstr "Bord droit"
#, kde-format
msgid "Unknown location (%1)"
msgstr "Position inconnue (%1)"
#, kde-format
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "Evgeniy Alekseev MerMouY"
#, kde-format
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "esalexeev@gmail.com mermouy@gmail.com"
#~ msgid "Top Edge"
#~ msgstr "Bord du haut"
#~ msgid "Bottom Edge"
#~ msgstr "Bord du bas"
#~ msgid "Left Edge"
#~ msgstr "Bord gauche"
#~ msgid "Right Edge"
#~ msgstr "Bord droit"
#~ msgid "Unknown location (%1)"
#~ msgstr "Position inconnue (%1)"
#~ msgid "Exec: %1"
#~ msgstr "Exec: %1"
@ -823,9 +748,6 @@ msgstr "esalexeev@gmail.com mermouy@gmail.com"
#~ "$uptime - temps de fonctionnement\n"
#~ "$custom - format personnalisé"
#~ msgid "CPU"
#~ msgstr "CPU"
#~ msgid ""
#~ "$cpu - total load CPU, %\n"
#~ "$cpu0 - load CPU for core 0, %\n"
@ -875,9 +797,6 @@ msgstr "esalexeev@gmail.com mermouy@gmail.com"
#~ msgid "$gputemp - physical temperature on GPU"
#~ msgstr "$gputemp - Température physique du processeur graphique"
#~ msgid "Memory"
#~ msgstr "Mémoire"
#~ msgid ""
#~ "$mem - RAM usage, %\n"
#~ "$memmb - RAM usage, MB\n"
@ -945,9 +864,6 @@ msgstr "esalexeev@gmail.com mermouy@gmail.com"
#~ "$hddtempN - température physique du périphérique N (à partir de 0). "
#~ "Exemple: $hddtemp0"
#~ msgid "Network"
#~ msgstr "Réseau"
#~ msgid ""
#~ "$down - download speed, KB/s\n"
#~ "$up - upload speed, KB/s\n"

694
sources/translations/nl.po Normal file
View File

@ -0,0 +1,694 @@
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Heimen Stoffels <vistausss@outlook.com>, 2015.
# Evgeniy Alekseev <esalexeev@gmail.com>, 2015.
msgid ""
msgstr ""
"Project-Id-Version: Awesome widgets\n"
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
"POT-Creation-Date: 2015-09-02 00:03+0300\n"
"PO-Revision-Date: 2015-08-20 22:52+0300\n"
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
"Language-Team: Dutch <kde-i18n-nl@kde.org>\n"
"Language: nl_NL\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"widgets/language/nl_NL/)\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Lokalize 2.0\n"
msgid "Widget"
msgstr "Widget"
msgid "Advanced"
msgstr "Geavanceerd"
msgid "Tooltip"
msgstr "Opmerkingsballon"
msgid "Appearance"
msgstr "Uiterlijk"
msgid "DataEngine"
msgstr "DataEngine"
msgid "About"
msgstr "Over"
msgid "Acknowledgment"
msgstr "Erkenning"
msgid "Widget height, px"
msgstr ""
msgid "Widget width, px"
msgstr ""
msgid "Enable notifications"
msgstr ""
msgid "Wrap new lines"
msgstr ""
msgid "Enable background"
msgstr "Achtergrond inschakelen"
msgid "Custom time format"
msgstr "Aangepaste tijdsopmaak"
msgid "Custom uptime format"
msgstr "Aangepast uptime-opmaak"
msgid "Temperature units"
msgstr "Temperatuureenheden"
msgid "Celsius"
msgstr "Celsius"
msgid "Fahrenheit"
msgstr "Fahrenheit"
msgid "Kelvin"
msgstr "Kelvin"
msgid "Reaumur"
msgstr "Reaumur"
msgid "cm^-1"
msgstr "cm^-1"
msgid "kJ/mol"
msgstr "kJ/mol"
msgid "kcal/mol"
msgstr "kcal/mol"
msgid "AC online tag"
msgstr "AC online-sleutelwoord"
msgid "AC offline tag"
msgstr "AC offline-sleutelwoord"
#, fuzzy
msgid "Check updates on startup"
msgstr "Controleren op updates"
#, fuzzy
msgid "Translate strings"
msgstr "Probleem met de vertaling"
msgid "Drop key cache"
msgstr ""
msgid "Time interval"
msgstr "Tijdstussenpose"
msgid "Font"
msgstr "Lettertype"
msgid "Font size"
msgstr "Lettertypegrootte"
msgid "Font weight"
msgstr "Lettertypeopmaak"
msgid "light"
msgstr "licht"
msgid "normal"
msgstr "normaal"
msgid "demi bold"
msgstr "semi-donker"
msgid "bold"
msgstr "donker"
msgid "black"
msgstr "zwart"
msgid "Font style"
msgstr "Lettertypestijl"
msgid "italic"
msgstr "Cursief"
msgid "Font color"
msgstr "Lettertypekleur"
msgid "Select a color"
msgstr "Selecteer een kleur"
msgid "Select a font"
msgstr "Selecteer een lettertype"
msgid "ACPI path"
msgstr "ACPI-pad"
msgid "GPU device"
msgstr "GPU-apparaat"
msgid "HDD"
msgstr "HDD"
msgid "hddtemp cmd"
msgstr "hddtemp cmd"
msgid "MPD address"
msgstr "MPD-adres"
msgid "MPD port"
msgstr "MPD-poort"
msgid "MPRIS player name"
msgstr "MPRIS-mediaspelernaam"
msgid "Music player"
msgstr "Muziekspeler"
msgid "Player data symbols"
msgstr ""
msgid "Custom scripts"
msgstr "Aangepaste scripts"
msgid "Edit scripts"
msgstr "Scripts bewerken"
msgid "Quotes monitor"
msgstr ""
#, fuzzy
msgid "Edit tickers"
msgstr "Balken bewerken"
msgid "Package manager"
msgstr "Pakketbeheerder"
msgid "Edit command"
msgstr "Commando bewerken"
msgid "Weather"
msgstr ""
#, fuzzy
msgid "Edit weather"
msgstr "Balken bewerken"
msgid "Request key"
msgstr "Sleutel aanvragen"
msgid "Show README"
msgstr "README weergeven"
msgid "Check updates"
msgstr "Controleren op updates"
msgid ""
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
"To enable them just make needed checkbox fully checked."
msgstr ""
"CPU, CPU-klok, geheugen, swap en netwerklabels-ondersteuning in een "
"grafische opmerkingsballon. Vink ze aan om ze in te schakelen."
msgid "Number of values for tooltips"
msgstr "Aantal waarden voor de opmerkingsballonnen"
msgid "Background"
msgstr "Achtergrond"
msgid "CPU color"
msgstr "CPU-kleur"
msgid "CPU clock color"
msgstr "CPU-klokkleur"
msgid "Memory color"
msgstr "Geheugenkleur"
msgid "Swap color"
msgstr "Swap-kleur"
msgid "Download speed color"
msgstr "Kleur van downloadsnelheid"
msgid "Upload speed color"
msgstr "Kleur van uploadsnelheid"
msgid "Battery active color"
msgstr "Kleur van actieve accu"
msgid "Battery inactive color"
msgstr "Kleur van inactieve accu"
msgid ""
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
"awesome-widgets/\">project homepage</a>"
msgstr ""
"Gedetailleerde informatie kan worden gevonden op de <a href=\"http://arcanis."
"name/projects/awesome-widgets/\">projectwebsite</a>"
msgid "AC"
msgstr ""
msgid "Bars"
msgstr "Balken"
msgid "CPU"
msgstr ""
msgid "Desktops"
msgstr ""
#, fuzzy
msgid "Memory"
msgstr "Geheugenkleur"
msgid "Network"
msgstr ""
#, fuzzy
msgid "Scripts"
msgstr "Scripts bewerken"
msgid "Time"
msgstr ""
msgid "Quotes"
msgstr ""
msgid "Upgrades"
msgstr ""
#, fuzzy
msgid "Weathers"
msgstr "Balken bewerken"
msgid "Add"
msgstr "Toevoegen"
msgid "Show value"
msgstr "Waarde weergeven"
msgid "Tag: %1"
msgstr "Sleutelwoord: %1"
msgid "Value: %1"
msgstr "Waarde: %1"
msgid "Info: %1"
msgstr "Informatie: %1"
msgid "Add lambda"
msgstr ""
msgid "Edit bars"
msgstr "Balken bewerken"
msgid "Run %1"
msgstr "%1 uitvoeren"
#, fuzzy
msgid "Version %1 (build date %2)"
msgstr ""
"Versie %1\n"
"(bouwdatum %2)"
msgid "A set of minimalistic plasmoid widgets"
msgstr "Een set van minimalistische plasmoid-widgets"
msgid "Links:"
msgstr "Links:"
msgid "Homepage"
msgstr "Website"
msgid "Repository"
msgstr "Pakketbron"
msgid "Bugtracker"
msgstr "Bugtracker"
msgid "Translation issue"
msgstr "Probleem met de vertaling"
msgid "AUR packages"
msgstr "AUR-pakketten"
msgid "openSUSE packages"
msgstr "openSUSE-pakketten"
msgid "This software is licensed under %1"
msgstr "Deze software is gelicenseerd onder %1"
msgid "Translators: %1"
msgstr "Vertalers: %1"
msgid "This software uses: %1"
msgstr "Deze software gebruikt: %1"
msgid "Select font"
msgstr "Lettertype selecteren"
msgid "Current version : %1"
msgstr "Huidige versie: %1"
msgid "New version : %1"
msgstr "Nieuwe versie: %1"
msgid "Click \"Ok\" to download"
msgstr "Klik op \"OK\" om te downloaden"
msgid "There are updates"
msgstr "Er zijn updates"
msgid "AC online"
msgstr "AC online"
msgid "AC offline"
msgstr "AC offline"
msgid "High CPU load"
msgstr "Hoog CPU-verbruik"
#, fuzzy
msgid "High GPU load"
msgstr "Hoog CPU-verbruik"
msgid "Free space on %1 less than 10%"
msgstr "De vrije ruimte op %1 is minder dan 10%"
msgid "High memory usage"
msgstr "Hoog geheugenverbruik"
msgid "Network device has been changed to %1"
msgstr "Het netwerkapparaat is gewijzigd naar %1"
msgid "MB/s"
msgstr ""
msgid "KB/s"
msgstr ""
msgid "Swap is used"
msgstr "Swap wordt gebruikt"
msgid "Select tag"
msgstr "Sleutelwoord selecteren"
msgid "Tag"
msgstr "Sleutelwoord"
msgid "Copy"
msgstr "Kopiëren"
msgid "Create"
msgstr "Creëren"
msgid "Remove"
msgstr "Verwijderen"
msgid "Enter file name"
msgstr "Vul bestandsnaam i"
msgid "File name"
msgstr "Bestandsnaam"
msgid "Name: %1"
msgstr "Naam: %1"
msgid "Comment: %1"
msgstr "Commentaar: %1"
#, fuzzy
msgid "Identity: %1"
msgstr "Commentaar: %1"
msgid "Name"
msgstr "Naam"
msgid "Comment"
msgstr "Commentaar"
msgid ""
"<html><head/><body><p>Use YAHOO! finance ticker to get quotes for the "
"instrument. Refer to <a href=\"http://finance.yahoo.com/\"><span style=\" "
"text-decoration: underline; color:#0057ae;\">http://finance.yahoo.com/</"
"span></a></p></body></html>"
msgstr ""
msgid "Ticker"
msgstr ""
#, fuzzy
msgid "Active"
msgstr "Actieve kleur"
#, fuzzy
msgid "Interval"
msgstr "Tijdstussenpose"
#, fuzzy
msgid "Command"
msgstr "Commentaar"
msgid "Prefix"
msgstr ""
msgid "Has output"
msgstr ""
msgid "Redirect"
msgstr ""
msgid "Additional filters"
msgstr ""
#, fuzzy
msgid "Wrap colors"
msgstr "Swap-kleur"
msgid "Wrap spaces"
msgstr ""
msgid "Filter"
msgstr ""
msgid "Null"
msgstr ""
msgid "City"
msgstr ""
msgid "Country"
msgstr ""
msgid "Timestamp"
msgstr ""
msgid "Use images"
msgstr ""
msgid "Value"
msgstr "Waarde"
msgid "Active color"
msgstr "Actieve kleur"
msgid "Inactive color"
msgstr "Inactieve kleur"
msgid "Type"
msgstr "Type"
msgid "Direction"
msgstr "Richting"
msgid "Height"
msgstr "Hoogte"
msgid "Width"
msgstr "Breedte"
#, fuzzy
msgid "Active desktop"
msgstr "Actieve kleur"
#, fuzzy
msgid "Inactive desktop"
msgstr "Inactieve kleur"
#, fuzzy
msgid "Tooltip type"
msgstr "Opmerkingsballon"
msgid "contours"
msgstr "contouren"
msgid "windows"
msgstr "vensters"
msgid "clean desktop"
msgstr "opgeruimd bureaublad"
msgid "names"
msgstr "namen"
msgid "none"
msgstr "geen"
msgid "Tooltip width"
msgstr "Opmerkingsballonbreedte"
msgid "Vertical layout"
msgstr "Verticale layout"
msgid "Mark"
msgstr "Markeren"
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "Heimen Stoffels"
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "vistausss@outlook.com"
#~ msgid "Top Edge"
#~ msgstr "Bovenrand"
#~ msgid "Bottom Edge"
#~ msgstr "Onderrand"
#~ msgid "Left Edge"
#~ msgstr "Linkerrand"
#~ msgid "Right Edge"
#~ msgstr "Linkerrand"
#~ msgid "Unknown location (%1)"
#~ msgstr "Onbekende positie (%1)"
#~ msgid "Run ksysguard"
#~ msgstr "ksysguard openen"
#~ msgid "Update text"
#~ msgstr "Tekst bijwerken"
#~ msgid "Check for updates"
#~ msgstr "Controleren op updates"
#~ msgid "Exec: %1"
#~ msgstr "Uitvoeren: %1"
#~ msgid "Edit"
#~ msgstr "Bewerken"
#~ msgid "Select color"
#~ msgstr "Kleur selecteren"
#~ msgid "Enable popup on mouse click"
#~ msgstr "Pop-up bij muisklik inschakelen"
#~ msgid ""
#~ "$dddd - long weekday\n"
#~ "$ddd - short weekday\n"
#~ "$dd - day\n"
#~ "$d - day w\\o zero\n"
#~ "$MMMM - long month\n"
#~ "$MMM - short month\n"
#~ "$MM - month\n"
#~ "$M - month w\\o zero\n"
#~ "$yyyy - year\n"
#~ "$yy - short year\n"
#~ "$hh - hours (24 only)\n"
#~ "$h - hours w\\o zero (24 only)\n"
#~ "$mm - minutes\n"
#~ "$m - minutes w\\o zero\n"
#~ "$ss - seconds\n"
#~ "$s - seconds w\\o zero"
#~ msgstr ""
#~ "$dddd - weekdag (lang)\n"
#~ "$ddd - weekdag (kort)\n"
#~ "$dd - dag\n"
#~ "$d - dag zonder nul\n"
#~ "$MMMM - maand (lang)\n"
#~ "$MMM - maand (kort)\n"
#~ "$MM - maand\n"
#~ "$M - month zonder nul\n"
#~ "$yyyy - jaar\n"
#~ "$yy - jaar (kort)\n"
#~ "$hh - uren (alleen 24)\n"
#~ "$h - uren zonder nul (alleen 24)\n"
#~ "$mm - minuten\n"
#~ "$m - minuten zonder nul\n"
#~ "$ss - seconden\n"
#~ "$s - seconden zonder nul"
#~ msgid ""
#~ "$dd - uptime days\n"
#~ "$d - uptime days without zero\n"
#~ "$hh - uptime hours\n"
#~ "$h - uptime hours without zero\n"
#~ "$mm - uptime minutes\n"
#~ "$m - uptime minutes without zero"
#~ msgstr ""
#~ "$dd - uptime-dagen\n"
#~ "$d - uptime-dagen zonder nul\n"
#~ "$hh - uptime-uren\n"
#~ "$h - uptime-uren zonder nul\n"
#~ "$mm - uptime-minuten\n"
#~ "$m - uptime minuten zonder nul"
#~ msgid "Temperature devices"
#~ msgstr "Temperatuurapparaten"
#~ msgid "Editable"
#~ msgstr "Bewerkbaar"
#~ msgid "Fan devices"
#~ msgstr "Koelingsapparaten"
#~ msgid "Mount points"
#~ msgstr "Aankoppelpunten"
#~ msgid "HDD devices (speed)"
#~ msgstr "HDD-apparaten (snelheid)"
#~ msgid "HDD devices (temp)"
#~ msgstr "HDD-apparaten (temp)"
#~ msgid "Disable auto select device and set specified device"
#~ msgstr ""
#~ "Apparaat automatisch selecteren uitschakelen en specifiek apparaat "
#~ "instellen"
#~ msgid "Set network device"
#~ msgstr "Netwerkapparaat instellen"
#~ msgid "Line, which returns when AC is online"
#~ msgstr "Lijn. welke terugkeert wanneer AC online is"
#~ msgid "Line, which returns when AC is offline"
#~ msgstr "Lijn, welke terugkeert wanneer AC offline is"
#~ msgid "\"/sys/class/power_supply/\" by default"
#~ msgstr "\"/sys/class/power_supply/\" standaard"
#~ msgid "<b>NOTE:</b> Player DBus interface should be an active"
#~ msgstr "<b>LET OP:</b> De DBus-interface van de speler moet actief zijn"
#~ msgid "Configuration"
#~ msgstr "Configuratie"
#~ msgid "Ctrl+B"
#~ msgstr "Ctrl+B"
#~ msgid "Ctrl+I"
#~ msgstr "Ctrl+I"
#~ msgid "Ctrl+U"
#~ msgstr "Ctrl+U"

View File

@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
"POT-Creation-Date: 2015-08-01 22:13+0300\n"
"POT-Creation-Date: 2015-09-02 00:03+0300\n"
"PO-Revision-Date: 2015-07-31 22:21+0300\n"
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
"Language-Team: Russian <kde-russian@lists.kde.ru>\n"
@ -19,239 +19,192 @@ msgstr ""
"X-Language: pt_BR\n"
"X-Source-Language: en\n"
#, kde-format
msgid "Widget"
msgstr "Widget"
#, kde-format
msgid "Advanced"
msgstr "Avançado"
#, kde-format
msgid "Tooltip"
msgstr "Dica de contexto"
#, kde-format
msgid "Appearance"
msgstr "Aparência"
#, kde-format
msgid "DataEngine"
msgstr "Engine de dados"
#, kde-format
msgid "About"
msgstr "Sobre"
#, kde-format
msgid "Acknowledgment"
msgstr "Confirmação"
#, kde-format
msgid "Widget height, px"
msgstr "Altura do widget, px"
#, kde-format
msgid "Widget width, px"
msgstr "Largura do widget, px"
#, kde-format
msgid "Enable notifications"
msgstr "Ativar notificações"
#, kde-format
msgid "Wrap new lines"
msgstr "Cobrir novas linhas"
#, kde-format
msgid "Enable background"
msgstr "Ativar plano de fundo"
#, kde-format
msgid "Custom time format"
msgstr "Formato de hora personalizado"
#, kde-format
msgid "Custom uptime format"
msgstr "Tempo em atividade com formato personalizado"
#, kde-format
msgid "Temperature units"
msgstr "Unidades de temperatura"
#, kde-format
msgid "Celsius"
msgstr "Celsius"
#, kde-format
msgid "Fahrenheit"
msgstr "Fahrenheit"
#, kde-format
msgid "Kelvin"
msgstr "Kelvin"
#, kde-format
msgid "Reaumur"
msgstr "Reaumur"
#, kde-format
msgid "cm^-1"
msgstr "cm^-1"
#, kde-format
msgid "kJ/mol"
msgstr "KJ/mol"
#, kde-format
msgid "kcal/mol"
msgstr "kcal/mol"
#, kde-format
msgid "AC online tag"
msgstr "Rótulo com carregador conectado"
#, kde-format
msgid "AC offline tag"
msgstr "Rótulo com carregador desconectado"
#, kde-format
#, fuzzy
msgid "Check updates on startup"
msgstr "Checar por atualizações"
#, fuzzy
msgid "Translate strings"
msgstr "Problema na tradução"
msgid "Drop key cache"
msgstr ""
#, kde-format
msgid "Time interval"
msgstr "Intervalo de tempo"
#, kde-format
msgid "Font"
msgstr "Tamanho da fonte"
#, kde-format
msgid "Font size"
msgstr "Tamanho da fonte"
#, kde-format
msgid "Font weight"
msgstr "Grossura da fonte"
#, kde-format
msgid "light"
msgstr "leve"
#, kde-format
msgid "normal"
msgstr "normal"
#, kde-format
msgid "demi bold"
msgstr "demi negrito"
#, kde-format
msgid "bold"
msgstr "negrito"
#, kde-format
msgid "black"
msgstr "preto"
#, kde-format
msgid "Font style"
msgstr "Estilo da fonte"
#, kde-format
msgid "italic"
msgstr "itálico"
#, kde-format
msgid "Font color"
msgstr "Cor da fonte"
#, kde-format
msgid "Select a color"
msgstr "Selecionar uma cor"
#, kde-format
msgid "Select a font"
msgstr "Selecionar uma fonte"
#, kde-format
msgid "ACPI path"
msgstr "Caminho ACPI"
#, kde-format
msgid "Custom scripts"
msgstr "Scripts customizados"
#, kde-format
msgid "Edit scripts"
msgstr "Editar scripts"
#, kde-format
msgid "GPU device"
msgstr "Dispositivo GPU"
#, kde-format
msgid "HDD"
msgstr "HDD"
#, kde-format
msgid "hddtemp cmd"
msgstr "comando hddtemp"
#, kde-format
msgid "MPD address"
msgstr "Endereço do MPD"
#, kde-format
msgid "MPD port"
msgstr "Porta do MPD"
#, kde-format
msgid "MPRIS player name"
msgstr "Nome do player MPRIS"
#, kde-format
msgid "Music player"
msgstr "Reprodutor de áudio"
#, kde-format
msgid "Player data symbols"
msgstr ""
msgid "Custom scripts"
msgstr "Scripts customizados"
msgid "Edit scripts"
msgstr "Editar scripts"
msgid "Quotes monitor"
msgstr "Monitor de citações"
#, kde-format
msgid "Edit tickers"
msgstr "Editar relógios"
#, kde-format
msgid "Package manager"
msgstr "Gerenciador de pacotes"
#, kde-format
msgid "Edit command"
msgstr "Editar comandos"
#, kde-format
msgid "Weather"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Edit weather"
msgstr "Editar relógios"
#, kde-format
msgid "Request key"
msgstr "Solicitar chave"
#, kde-format
msgid "Show README"
msgstr "Mostrar README"
#, kde-format
msgid "Check updates"
msgstr "Checar por atualizações"
#, kde-format
msgid ""
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
"To enable them just make needed checkbox fully checked."
@ -259,47 +212,36 @@ msgstr ""
"Os rótulos de CPU, frequência de GPU, memória, swap e rede suportam dica de "
"contexto gráfica. Para ativá-los, basta selecionar a caixa necessária."
#, kde-format
msgid "Number of values for tooltips"
msgstr "Número de valores para dicas de contexto"
#, kde-format
msgid "Background"
msgstr "Plano de fundo"
#, kde-format
msgid "CPU color"
msgstr "Cor da CPU"
#, kde-format
msgid "CPU clock color"
msgstr "Cor do relógio da CPU"
#, kde-format
msgid "Memory color"
msgstr "Cor da memória"
#, kde-format
msgid "Swap color"
msgstr "Cor da swap"
#, kde-format
msgid "Download speed color"
msgstr "Cor da velocidade de download"
#, kde-format
msgid "Upload speed color"
msgstr "Cor da velocidade de upload"
#, kde-format
msgid "Battery active color"
msgstr "Cor da bateria ativa"
#, kde-format
msgid "Battery inactive color"
msgstr "Cor da bateria inativa"
#, kde-format
msgid ""
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
"awesome-widgets/\">project homepage</a>"
@ -307,183 +249,184 @@ msgstr ""
"Informações detalhadas podem ser encontradas na <a href=\"http://arcanis."
"name/projects/awesome-widgets/\">página do projeto</a>"
#, kde-format
msgid "AC"
msgstr ""
msgid "Bars"
msgstr "Barras"
msgid "CPU"
msgstr "CPU"
msgid "Desktops"
msgstr ""
msgid "Memory"
msgstr "Memória"
msgid "Network"
msgstr "Rede"
#, fuzzy
msgid "Scripts"
msgstr "Editar scripts"
#, fuzzy
msgid "Time"
msgstr "Hora"
#, fuzzy
msgid "Quotes"
msgstr "Monitor de citações"
msgid "Upgrades"
msgstr ""
#, fuzzy
msgid "Weathers"
msgstr "Editar relógios"
msgid "Add"
msgstr "Adicionar"
#, kde-format
msgid "Show value"
msgstr "Mostrar valor"
#, kde-format
msgid "Tag: %1"
msgstr "Tag: %1"
#, kde-format
msgid "Value: %1"
msgstr "Valor: %1"
#, kde-format
msgid "Info: %1"
msgstr "Info: %1"
#, kde-format
msgid "Add lambda"
msgstr ""
msgid "Edit bars"
msgstr "Editar barras"
#, kde-format
msgid "Run %1"
msgstr "Rodar %1"
#, kde-format
msgid "Version %1 (build date %2)"
msgstr "Versão: %1 (data de compilação %2)"
#, kde-format
msgid "A set of minimalistic plasmoid widgets"
msgstr "Um conjunto de widgets plasmoid minimalistas."
#, kde-format
msgid "Links:"
msgstr "Links:"
#, kde-format
msgid "Homepage"
msgstr "Homepage"
#, kde-format
msgid "Repository"
msgstr "Repositório"
#, kde-format
msgid "Bugtracker"
msgstr "Bugtracker"
#, kde-format
msgid "Translation issue"
msgstr "Problema na tradução"
#, kde-format
msgid "AUR packages"
msgstr "Pacotes AUR"
#, kde-format
msgid "openSUSE packages"
msgstr "Pacotes openSUSE"
#, kde-format
msgid "This software is licensed under %1"
msgstr "Este software é licenciado sob %1"
#, kde-format
msgid "Translators: %1"
msgstr "Tradutores: %1"
#, kde-format
msgid "This software uses: %1"
msgstr "Este software usa: %1"
#, kde-format
msgid "Select font"
msgstr "Selecionar fonte"
#, kde-format
msgid "Current version : %1"
msgstr "Versão atual: %1"
#, kde-format
msgid "New version : %1"
msgstr "Nova versão: %1"
#, kde-format
msgid "Click \"Ok\" to download"
msgstr "Clique \"Ok\" para baixar"
#, kde-format
msgid "There are updates"
msgstr "Há atualizações disponíveis"
#, kde-format
msgid "AC online"
msgstr "Carregador conectado"
#, kde-format
msgid "AC offline"
msgstr "Carregador desconectado"
#, kde-format
msgid "High CPU load"
msgstr "Alta carga da CPU"
#, kde-format
msgid "High GPU load"
msgstr "Alta carga da GPU"
#, kde-format
msgid "Free space on %1 less than 10%"
msgstr "O espaço livre em %1 é menor que 10%"
#, kde-format
msgid "High memory usage"
msgstr "Alto uso de memória"
#, kde-format
msgid "Network device has been changed to %1"
msgstr "O dispositivo de rede mudou para %1"
#, kde-format
msgid "MB/s"
msgstr ""
msgid "KB/s"
msgstr ""
msgid "Swap is used"
msgstr "Swap está sendo usado"
#, kde-format
msgid "Select tag"
msgstr "Selecionar tag"
#, kde-format
msgid "Tag"
msgstr "Tag"
#, kde-format
msgid "Copy"
msgstr "Copiar"
#, kde-format
msgid "Create"
msgstr "Criar"
#, kde-format
msgid "Remove"
msgstr "Remover"
#, kde-format
msgid "Enter file name"
msgstr "Digite o nome de arquivo"
#, kde-format
msgid "File name"
msgstr "Nome de arquivo"
#, kde-format
msgid "Name: %1"
msgstr "Nome: %1"
#, kde-format
msgid "Comment: %1"
msgstr "Comentário: %1"
#, kde-format
msgid "Identity: %1"
msgstr "Comentário: %1"
#, kde-format
msgid "Name"
msgstr "NOme"
#, kde-format
msgid "Comment"
msgstr "Comentário"
#, kde-format
msgid ""
"<html><head/><body><p>Use YAHOO! finance ticker to get quotes for the "
"instrument. Refer to <a href=\"http://finance.yahoo.com/\"><span style=\" "
@ -491,164 +434,132 @@ msgid ""
"span></a></p></body></html>"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Ticker"
msgstr "Relógio: %1"
#, kde-format
msgid "Active"
msgstr "Cor ativa"
#, kde-format
msgid "Interval"
msgstr "Intervalo de tempo"
#, kde-format
msgid "Command"
msgstr "Comentário"
#, kde-format
msgid "Prefix"
msgstr ""
#, kde-format
msgid "Has output"
msgstr ""
#, kde-format
msgid "Redirect"
msgstr ""
#, kde-format
msgid "Additional filters"
msgstr ""
#, kde-format
msgid "Wrap colors"
msgstr "Cor da swap"
#, kde-format
msgid "Wrap spaces"
msgstr ""
#, kde-format
msgid "Filter"
msgstr ""
msgid "Null"
msgstr ""
#, kde-format
msgid "City"
msgstr ""
#, kde-format
msgid "Country"
msgstr ""
#, kde-format
msgid "Timestamp"
msgstr "Hora"
#, kde-format
msgid "Use images"
msgstr ""
msgid "Value"
msgstr "Valor"
#, kde-format
msgid "Active color"
msgstr "Cor ativa"
#, kde-format
msgid "Inactive color"
msgstr "Cor inativa"
#, kde-format
msgid "Type"
msgstr "Tipo"
#, kde-format
msgid "Direction"
msgstr "Direção"
#, kde-format
msgid "Height"
msgstr "Altura"
#, kde-format
msgid "Width"
msgstr "Largura"
#, kde-format
msgid "Active desktop"
msgstr "Desktop ativo"
#, kde-format
msgid "Inactive desktop"
msgstr "Desktop inativo"
#, kde-format
msgid "Tooltip type"
msgstr "Tipo de dica de contexto"
#, kde-format
msgid "contours"
msgstr "Contornos"
#, kde-format
msgid "windows"
msgstr "Janelas"
#, kde-format
msgid "clean desktop"
msgstr "Limpar desktop"
#, kde-format
msgid "names"
msgstr "nomes"
#, kde-format
msgid "none"
msgstr "nenhum"
#, kde-format
msgid "Tooltip width"
msgstr "Largura da dica de contexto"
#, kde-format
msgid "Vertical layout"
msgstr "Layout vertical"
#, kde-format
msgid "Mark"
msgstr "Marca"
#, kde-format
msgid "Top Edge"
msgstr "Canto do topo"
#, kde-format
msgid "Bottom Edge"
msgstr "Canto de baixo"
#, kde-format
msgid "Left Edge"
msgstr "Canto esquerdo"
#, kde-format
msgid "Right Edge"
msgstr "Canto direito"
#, kde-format
msgid "Unknown location (%1)"
msgstr "Localização desconhecida (%1)"
#, kde-format
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "under"
#, kde-format
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "under@insicuri.net"
#~ msgid "Top Edge"
#~ msgstr "Canto do topo"
#~ msgid "Bottom Edge"
#~ msgstr "Canto de baixo"
#~ msgid "Left Edge"
#~ msgstr "Canto esquerdo"
#~ msgid "Right Edge"
#~ msgstr "Canto direito"
#~ msgid "Unknown location (%1)"
#~ msgstr "Localização desconhecida (%1)"
#~ msgid "Exec: %1"
#~ msgstr "Exec: %1"
@ -667,9 +578,6 @@ msgstr "under@insicuri.net"
#~ msgid "Edit"
#~ msgstr "Editar"
#~ msgid "Bars"
#~ msgstr "Barras"
#~ msgid "Enable popup on mouse click"
#~ msgstr "Ativar popup no clique do mouse"
@ -828,9 +736,6 @@ msgstr "under@insicuri.net"
#~ "$uptime - tempo em atividade do sistema\n"
#~ "$custom - formato personalizado "
#~ msgid "CPU"
#~ msgstr "CPU"
#~ msgid ""
#~ "$cpu - total load CPU, %\n"
#~ "$cpu0 - load CPU for core 0, %\n"
@ -884,9 +789,6 @@ msgstr "under@insicuri.net"
#~ msgid "$gputemp - physical temperature on GPU"
#~ msgstr "$gputemp - temperatura física da GPU"
#~ msgid "Memory"
#~ msgstr "Memória"
#~ msgid ""
#~ "$mem - RAM usage, %\n"
#~ "$memmb - RAM usage, MB\n"
@ -955,9 +857,6 @@ msgstr "under@insicuri.net"
#~ "$hddtempN - temperatura física no dispositivo N (começando por 0). "
#~ "Exemplo: $hddtemp0"
#~ msgid "Network"
#~ msgstr "Rede"
#~ msgid ""
#~ "$down - download speed, KB/s\n"
#~ "$up - upload speed, KB/s\n"

View File

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
"POT-Creation-Date: 2015-08-01 22:13+0300\n"
"PO-Revision-Date: 2015-07-31 22:11+0300\n"
"POT-Creation-Date: 2015-09-02 00:03+0300\n"
"PO-Revision-Date: 2015-09-02 00:19+0300\n"
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
"Language-Team: Russian <kde-russian@lists.kde.ru>\n"
"Language: ru\n"
@ -18,239 +18,189 @@ msgstr ""
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Lokalize 2.0\n"
#, kde-format
msgid "Widget"
msgstr "Виджет"
#, kde-format
msgid "Advanced"
msgstr "Расширенные"
#, kde-format
msgid "Tooltip"
msgstr "Тултип"
#, kde-format
msgid "Appearance"
msgstr "Внешний вид"
#, kde-format
msgid "DataEngine"
msgstr "DataEngine"
#, kde-format
msgid "About"
msgstr "О программе"
#, kde-format
msgid "Acknowledgment"
msgstr "Благодарности"
#, kde-format
msgid "Widget height, px"
msgstr "Высота виджета, пиксели"
#, kde-format
msgid "Widget width, px"
msgstr "Ширина виджета, пиксели"
#, kde-format
msgid "Enable notifications"
msgstr "Включить уведомления "
#, kde-format
msgid "Wrap new lines"
msgstr "Заменить символ перевода строки"
#, kde-format
msgid "Enable background"
msgstr "Включить фон"
#, kde-format
msgid "Custom time format"
msgstr "Свой формат времени"
#, kde-format
msgid "Custom uptime format"
msgstr "Свой формат аптайма"
#, kde-format
msgid "Temperature units"
msgstr "Температурные единицы"
#, kde-format
msgid "Celsius"
msgstr "Цельсий"
#, kde-format
msgid "Fahrenheit"
msgstr "Фаренгейт"
#, kde-format
msgid "Kelvin"
msgstr "Кельвин"
#, kde-format
msgid "Reaumur"
msgstr "Реамюр"
#, kde-format
msgid "cm^-1"
msgstr "см^-1"
#, kde-format
msgid "kJ/mol"
msgstr "кДж/моль"
#, kde-format
msgid "kcal/mol"
msgstr "ккал/моль"
#, kde-format
msgid "AC online tag"
msgstr "AC подключен"
#, kde-format
msgid "AC offline tag"
msgstr "AC отключен"
#, kde-format
msgid "Check updates on startup"
msgstr "Проверять обновления при запуске"
msgid "Translate strings"
msgstr "Переводить строки"
msgid "Drop key cache"
msgstr "Сбросить кеш ключей"
#, kde-format
msgid "Time interval"
msgstr "Интервал обновления"
#, kde-format
msgid "Font"
msgstr "Шрифт"
#, kde-format
msgid "Font size"
msgstr "Размер шрифта"
#, kde-format
msgid "Font weight"
msgstr "Ширина шрифта"
#, kde-format
msgid "light"
msgstr "тонкий"
#, kde-format
msgid "normal"
msgstr "нормальный"
#, kde-format
msgid "demi bold"
msgstr "полужирный"
#, kde-format
msgid "bold"
msgstr "жирный"
#, kde-format
msgid "black"
msgstr "очень жирный"
#, kde-format
msgid "Font style"
msgstr "Стиль шрифта"
#, kde-format
msgid "italic"
msgstr "курсив"
#, kde-format
msgid "Font color"
msgstr "Цвет шрифта"
#, kde-format
msgid "Select a color"
msgstr "Выберете цвет"
#, kde-format
msgid "Select a font"
msgstr "Выберете шрифт"
#, kde-format
msgid "ACPI path"
msgstr "Пусть к ACPI"
#, kde-format
msgid "Custom scripts"
msgstr "Свои скрипты"
#, kde-format
msgid "Edit scripts"
msgstr "Редактировать скрипты"
#, kde-format
msgid "GPU device"
msgstr "Устройство GPU"
#, kde-format
msgid "HDD"
msgstr "HDD"
#, kde-format
msgid "hddtemp cmd"
msgstr "Команда hddtemp"
#, kde-format
msgid "MPD address"
msgstr "Адрес сервера MPD"
#, kde-format
msgid "MPD port"
msgstr "Порт сервера MPD"
#, kde-format
msgid "MPRIS player name"
msgstr "Имя плеера в MPRIS"
#, kde-format
msgid "Music player"
msgstr "Музыкальный плеер"
#, kde-format
msgid "Player data symbols"
msgstr "Символы в информации о плеере"
msgid "Custom scripts"
msgstr "Свои скрипты"
msgid "Edit scripts"
msgstr "Редактировать скрипты"
msgid "Quotes monitor"
msgstr "Монитор котировок"
#, kde-format
msgid "Edit tickers"
msgstr "Редактировать тикеры"
#, kde-format
msgid "Package manager"
msgstr "Пакетный менеджер"
#, kde-format
msgid "Edit command"
msgstr "Редактировать команду"
#, kde-format
msgid "Weather"
msgstr "Погода"
#, kde-format
msgid "Edit weather"
msgstr "Редактировать погоду"
#, kde-format
msgid "Request key"
msgstr "Показать ключ"
#, kde-format
msgid "Show README"
msgstr "Показать README"
#, kde-format
msgid "Check updates"
msgstr "Проверить обновления"
#, kde-format
msgid ""
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
"To enable them just make needed checkbox fully checked."
@ -259,47 +209,36 @@ msgstr ""
"графический тултип. Чтобы включить его, просто сделайте требуемые чекбоксы "
"полностью чекнутыми."
#, kde-format
msgid "Number of values for tooltips"
msgstr "Число хранящихся значений"
#, kde-format
msgid "Background"
msgstr "Фон"
#, kde-format
msgid "CPU color"
msgstr "Цвет CPU"
#, kde-format
msgid "CPU clock color"
msgstr "Цвет частоты CPU"
#, kde-format
msgid "Memory color"
msgstr "Цвет памяти"
#, kde-format
msgid "Swap color"
msgstr "Цвет swap"
#, kde-format
msgid "Download speed color"
msgstr "Цвет скорости загрузки"
#, kde-format
msgid "Upload speed color"
msgstr "Цвет скорости отдачи"
#, kde-format
msgid "Battery active color"
msgstr "Цвет заряжаемой батареи"
#, kde-format
msgid "Battery inactive color"
msgstr "Цвет разряжаемой батареи"
#, kde-format
msgid ""
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
"awesome-widgets/\">project homepage</a>"
@ -307,183 +246,180 @@ msgstr ""
"Подробная информация может быть найдена на <a href=\"http://arcanis.name/ru/"
"projects/awesome-widgets/\">домашней странице проекта</a>"
#, kde-format
msgid "AC"
msgstr "Адаптор питания"
msgid "Bars"
msgstr "Бары"
msgid "CPU"
msgstr "CPU"
msgid "Desktops"
msgstr "Рабочие столы"
msgid "Memory"
msgstr "Память"
msgid "Network"
msgstr "Сеть"
msgid "Scripts"
msgstr "Скрипты"
msgid "Time"
msgstr "Время"
msgid "Quotes"
msgstr "Котировоки"
msgid "Upgrades"
msgstr "Обновления"
msgid "Weathers"
msgstr "Погода"
msgid "Add"
msgstr "Добавить"
#, kde-format
msgid "Show value"
msgstr "Показать значение"
#, kde-format
msgid "Tag: %1"
msgstr "Тег: %1"
#, kde-format
msgid "Value: %1"
msgstr "Значение: %1"
#, kde-format
msgid "Info: %1"
msgstr "Информация: %1"
#, kde-format
msgid "Add lambda"
msgstr "Добавить лямбду"
msgid "Edit bars"
msgstr "Редактировать бары"
#, kde-format
msgid "Run %1"
msgstr "Запуск %1"
#, kde-format
msgid "Version %1 (build date %2)"
msgstr "Версия %1 (дата сборки %2)"
#, kde-format
msgid "A set of minimalistic plasmoid widgets"
msgstr "Коллекция минималистичных плазмоидов"
#, kde-format
msgid "Links:"
msgstr "Ссылки:"
#, kde-format
msgid "Homepage"
msgstr "Домашняя страница"
#, kde-format
msgid "Repository"
msgstr "Репозиторий"
#, kde-format
msgid "Bugtracker"
msgstr "Баг-трекер"
#, kde-format
msgid "Translation issue"
msgstr "Тикет перевода"
#, kde-format
msgid "AUR packages"
msgstr "Пакеты в AUR"
#, kde-format
msgid "openSUSE packages"
msgstr "Пакеты для openSUSE"
#, kde-format
msgid "This software is licensed under %1"
msgstr "Данное приложение лицензировано под %1"
#, kde-format
msgid "Translators: %1"
msgstr "Переводчики: %1"
#, kde-format
msgid "This software uses: %1"
msgstr "Данное приложение использует: %1"
#, kde-format
msgid "Select font"
msgstr "Выберете шрифт"
#, kde-format
msgid "Current version : %1"
msgstr "Текущая версия : %1"
#, kde-format
msgid "New version : %1"
msgstr "Новая версия : %1"
#, kde-format
msgid "Click \"Ok\" to download"
msgstr "Нажмите \"Ok\" для загрузки"
#, kde-format
msgid "There are updates"
msgstr "Найдены обновления"
#, kde-format
msgid "AC online"
msgstr "AC подключен"
#, kde-format
msgid "AC offline"
msgstr "AC отключен"
#, kde-format
msgid "High CPU load"
msgstr "Высокая загрузка CPU"
#, kde-format
msgid "High GPU load"
msgstr "Высокая загрузка GPU"
#, kde-format
msgid "Free space on %1 less than 10%"
msgstr "Свободное место на диске %1 меньше 10%"
#, kde-format
msgid "High memory usage"
msgstr "Большое потребление памяти"
#, kde-format
msgid "Network device has been changed to %1"
msgstr "Сетевое устройство было изменено на %1"
#, kde-format
msgid "MB/s"
msgstr "МБ/с"
msgid "KB/s"
msgstr "КБ/с"
msgid "Swap is used"
msgstr "Используется своп"
#, kde-format
msgid "Select tag"
msgstr "Выберете тег"
#, kde-format
msgid "Tag"
msgstr "Тег"
#, kde-format
msgid "Copy"
msgstr "Копировать"
#, kde-format
msgid "Create"
msgstr "Создать"
#, kde-format
msgid "Remove"
msgstr "Удалить"
#, kde-format
msgid "Enter file name"
msgstr "Введите имя файла"
#, kde-format
msgid "File name"
msgstr "Имя файла"
#, kde-format
msgid "Name: %1"
msgstr "Имя: %1"
#, kde-format
msgid "Comment: %1"
msgstr "Комментарий: %1"
#, kde-format
msgid "Identity: %1"
msgstr "Идентификатор: %1"
#, kde-format
msgid "Name"
msgstr "Имя"
#, kde-format
msgid "Comment"
msgstr "Комментарий"
#, kde-format
msgid ""
"<html><head/><body><p>Use YAHOO! finance ticker to get quotes for the "
"instrument. Refer to <a href=\"http://finance.yahoo.com/\"><span style=\" "
@ -495,164 +431,131 @@ msgstr ""
"style=\" text-decoration: underline; color:#0057ae;\">http://finance.yahoo."
"com/</span></a></p></body></html>"
#, kde-format
msgid "Ticker"
msgstr "Тикер"
#, kde-format
msgid "Active"
msgstr "Активен"
#, kde-format
msgid "Interval"
msgstr "Интервал"
#, kde-format
msgid "Command"
msgstr "Команда"
#, kde-format
msgid "Prefix"
msgstr "Префикс"
#, kde-format
msgid "Has output"
msgstr "Имеет сообщения"
#, kde-format
msgid "Redirect"
msgstr "Перенаправление"
#, kde-format
msgid "Additional filters"
msgstr "Дополнительные фильтры"
#, kde-format
msgid "Wrap colors"
msgstr "Обработать цвета"
#, kde-format
msgid "Wrap spaces"
msgstr "Обработать пробелы"
#, kde-format
msgid "Filter"
msgstr "Фильтр"
msgid "Null"
msgstr "Пустые строки"
#, kde-format
msgid "City"
msgstr "Город"
#, kde-format
msgid "Country"
msgstr "Страна"
#, kde-format
msgid "Timestamp"
msgstr "Таймштамп"
#, kde-format
msgid "Use images"
msgstr "Использовать изображения"
msgid "Value"
msgstr "Значение"
#, kde-format
msgid "Active color"
msgstr "Активный цвет"
#, kde-format
msgid "Inactive color"
msgstr "Неактивный цвет"
#, kde-format
msgid "Type"
msgstr "Тип"
#, kde-format
msgid "Direction"
msgstr "Направление"
#, kde-format
msgid "Height"
msgstr "Высота"
#, kde-format
msgid "Width"
msgstr "Ширина"
#, kde-format
msgid "Active desktop"
msgstr "Активный рабочий стол"
#, kde-format
msgid "Inactive desktop"
msgstr "Неактивный рабочий стол"
#, kde-format
msgid "Tooltip type"
msgstr "Тип тултипа"
#, kde-format
msgid "contours"
msgstr "контуры"
#, kde-format
msgid "windows"
msgstr "окна"
#, kde-format
msgid "clean desktop"
msgstr "пустой рабочий стол"
#, kde-format
msgid "names"
msgstr "названия"
#, kde-format
msgid "none"
msgstr "ничего"
#, kde-format
msgid "Tooltip width"
msgstr "Ширина тултипа"
#, kde-format
msgid "Vertical layout"
msgstr "Вертикальная разметка"
#, kde-format
msgid "Mark"
msgstr "Метка"
#, kde-format
msgid "Top Edge"
msgstr "Верхняя грань"
#, kde-format
msgid "Bottom Edge"
msgstr "Нижняя грань"
#, kde-format
msgid "Left Edge"
msgstr "Левая грань"
#, kde-format
msgid "Right Edge"
msgstr "Правая грань"
#, kde-format
msgid "Unknown location (%1)"
msgstr "Неизвестное положение (%1)"
#, kde-format
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "Evgeniy Alekseev"
#, kde-format
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "esalexeev@gmail.com"
#~ msgid "Top Edge"
#~ msgstr "Верхняя грань"
#~ msgid "Bottom Edge"
#~ msgstr "Нижняя грань"
#~ msgid "Left Edge"
#~ msgstr "Левая грань"
#~ msgid "Right Edge"
#~ msgstr "Правая грань"
#~ msgid "Unknown location (%1)"
#~ msgstr "Неизвестное положение (%1)"
#~ msgid "Ticker: %1"
#~ msgstr "Тикер: %1"
@ -674,9 +577,6 @@ msgstr "esalexeev@gmail.com"
#~ msgid "Edit"
#~ msgstr "Править"
#~ msgid "Bars"
#~ msgstr "Бары"
#~ msgid "Enable popup on mouse click"
#~ msgstr "Включить сообщения по клику мыши"
@ -850,9 +750,6 @@ msgstr "esalexeev@gmail.com"
#~ "$uptime - время работы\n"
#~ "$custom - свой формат"
#~ msgid "CPU"
#~ msgstr "CPU"
#~ msgid ""
#~ "$cpu - total load CPU, %\n"
#~ "$cpu0 - load CPU for core 0, %\n"
@ -905,9 +802,6 @@ msgstr "esalexeev@gmail.com"
#~ msgid "$gputemp - physical temperature on GPU"
#~ msgstr "$gputemp - физическая температура на GPU"
#~ msgid "Memory"
#~ msgstr "Память"
#~ msgid ""
#~ "$mem - RAM usage, %\n"
#~ "$memmb - RAM usage, MB\n"
@ -968,9 +862,6 @@ msgstr "esalexeev@gmail.com"
#~ "$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0"
#~ msgstr "$hddtempN - температура на устройстве N (от 0). Пример: $hddtemp0"
#~ msgid "Network"
#~ msgstr "Сеть"
#~ msgid ""
#~ "$down - download speed, KB/s\n"
#~ "$up - upload speed, KB/s\n"

View File

@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
"POT-Creation-Date: 2015-08-01 22:13+0300\n"
"POT-Creation-Date: 2015-09-02 00:03+0300\n"
"PO-Revision-Date: 2015-07-31 22:23+0300\n"
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
"Language-Team: Ukrainian <kde-russian@lists.kde.ru>\n"
@ -18,239 +18,192 @@ msgstr ""
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Lokalize 2.0\n"
#, kde-format
msgid "Widget"
msgstr "Віджет"
#, kde-format
msgid "Advanced"
msgstr "Розширені"
#, kde-format
msgid "Tooltip"
msgstr "Підказки"
#, kde-format
msgid "Appearance"
msgstr "Зовнішній вигляд"
#, kde-format
msgid "DataEngine"
msgstr "DataEngine"
#, kde-format
msgid "About"
msgstr "Про програму"
#, kde-format
msgid "Acknowledgment"
msgstr "Подяка"
#, kde-format
msgid "Widget height, px"
msgstr "Висота віджету, пікселі"
#, kde-format
msgid "Widget width, px"
msgstr "Ширина віджету, пікселі"
#, kde-format
msgid "Enable notifications"
msgstr "Включити повідомлення"
#, kde-format
msgid "Wrap new lines"
msgstr "Замінити символ переводу рядка"
#, kde-format
msgid "Enable background"
msgstr "Включити фон"
#, kde-format
msgid "Custom time format"
msgstr "Свій формат часу"
#, kde-format
msgid "Custom uptime format"
msgstr "Свій формат аптайму (uptime)"
#, kde-format
msgid "Temperature units"
msgstr "Одиниці виміру температури"
#, kde-format
msgid "Celsius"
msgstr "Цельсій"
#, kde-format
msgid "Fahrenheit"
msgstr "Фаренгейт"
#, kde-format
msgid "Kelvin"
msgstr "Кельвін"
#, kde-format
msgid "Reaumur"
msgstr "Реамюр"
#, kde-format
msgid "cm^-1"
msgstr "см^-1"
#, kde-format
msgid "kJ/mol"
msgstr "кДж/моль"
#, kde-format
msgid "kcal/mol"
msgstr "ккал/моль"
#, kde-format
msgid "AC online tag"
msgstr "AC підключений"
#, kde-format
msgid "AC offline tag"
msgstr "AC відключений"
#, kde-format
#, fuzzy
msgid "Check updates on startup"
msgstr "Шукати оновлення"
#, fuzzy
msgid "Translate strings"
msgstr "Тікет перекладу"
msgid "Drop key cache"
msgstr ""
#, kde-format
msgid "Time interval"
msgstr "Інтервал оновлення"
#, kde-format
msgid "Font"
msgstr "Шрифт"
#, kde-format
msgid "Font size"
msgstr "Розмір шрифту"
#, kde-format
msgid "Font weight"
msgstr "Ширина шрифту"
#, kde-format
msgid "light"
msgstr "тонкий"
#, kde-format
msgid "normal"
msgstr "нормальний"
#, kde-format
msgid "demi bold"
msgstr "напівжирний"
#, kde-format
msgid "bold"
msgstr "жирний"
#, kde-format
msgid "black"
msgstr "дуже жирний"
#, kde-format
msgid "Font style"
msgstr "Стиль шрифту"
#, kde-format
msgid "italic"
msgstr "курсив"
#, kde-format
msgid "Font color"
msgstr "Колір шрифту"
#, kde-format
msgid "Select a color"
msgstr "Оберіть колір"
#, kde-format
msgid "Select a font"
msgstr "Оберіть шрифт"
#, kde-format
msgid "ACPI path"
msgstr "Шлях до ICPI"
#, kde-format
msgid "Custom scripts"
msgstr "Свої скрипти"
#, kde-format
msgid "Edit scripts"
msgstr "Редагувати скрипти"
#, kde-format
msgid "GPU device"
msgstr "Пристій GPU"
#, kde-format
msgid "HDD"
msgstr "HDD"
#, kde-format
msgid "hddtemp cmd"
msgstr "Команда hddtemp"
#, kde-format
msgid "MPD address"
msgstr "Адреса сервера MPD"
#, kde-format
msgid "MPD port"
msgstr "Порт сервера MPD"
#, kde-format
msgid "MPRIS player name"
msgstr "Ім’я плеєру в MPRIS"
#, kde-format
msgid "Music player"
msgstr "Музичний плеєр"
#, kde-format
msgid "Player data symbols"
msgstr ""
msgid "Custom scripts"
msgstr "Свої скрипти"
msgid "Edit scripts"
msgstr "Редагувати скрипти"
msgid "Quotes monitor"
msgstr "Монітор котирувань"
#, kde-format
msgid "Edit tickers"
msgstr "Редагувати тікети"
#, kde-format
msgid "Package manager"
msgstr "Пакетний менеджер"
#, kde-format
msgid "Edit command"
msgstr "Редагувати команду"
#, kde-format
msgid "Weather"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Edit weather"
msgstr "Редагувати тікети"
#, kde-format
msgid "Request key"
msgstr "Показати ключ"
#, kde-format
msgid "Show README"
msgstr "Показати README"
#, kde-format
msgid "Check updates"
msgstr "Шукати оновлення"
#, kde-format
msgid ""
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
"To enable them just make needed checkbox fully checked."
@ -259,47 +212,36 @@ msgstr ""
"підтримують графічні підказки. Щоб їх задіяти, просто зробіть необхідні "
"чекбокси повністю чекнутими."
#, kde-format
msgid "Number of values for tooltips"
msgstr "Кількість значень для підказки"
#, kde-format
msgid "Background"
msgstr "Фон"
#, kde-format
msgid "CPU color"
msgstr "Колір CPU"
#, kde-format
msgid "CPU clock color"
msgstr "Колір частоти CPU"
#, kde-format
msgid "Memory color"
msgstr "Колір пам’яті"
#, kde-format
msgid "Swap color"
msgstr "Колір swap"
#, kde-format
msgid "Download speed color"
msgstr "Колір швидкості скачування"
#, kde-format
msgid "Upload speed color"
msgstr "Колір швидкості віддачі"
#, kde-format
msgid "Battery active color"
msgstr "Колір батареї, що заряджається"
#, kde-format
msgid "Battery inactive color"
msgstr "Колір батарєї, що розряджається"
#, kde-format
msgid ""
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
"awesome-widgets/\">project homepage</a>"
@ -307,183 +249,185 @@ msgstr ""
"Детальна інформація може бути знайдена на <a href=\"http://arcanis.name/"
"projects/awesome-widgets/\">домашній сторінці проекту</a>"
#, kde-format
msgid "AC"
msgstr ""
msgid "Bars"
msgstr "Бари"
msgid "CPU"
msgstr "CPU"
msgid "Desktops"
msgstr ""
msgid "Memory"
msgstr "Пам’ять"
msgid "Network"
msgstr "Мережа"
#, fuzzy
msgid "Scripts"
msgstr "Редагувати скрипти"
#, fuzzy
msgid "Time"
msgstr "Час"
#, fuzzy
msgid "Quotes"
msgstr "Монітор котирувань"
msgid "Upgrades"
msgstr ""
#, fuzzy
msgid "Weathers"
msgstr "Редагувати тікети"
msgid "Add"
msgstr "Додати"
#, kde-format
msgid "Show value"
msgstr "Показати значення"
#, kde-format
msgid "Tag: %1"
msgstr "Тег: %1"
#, kde-format
msgid "Value: %1"
msgstr "Значення: %1"
#, kde-format
msgid "Info: %1"
msgstr "Інформація: %1"
#, kde-format
msgid "Add lambda"
msgstr ""
msgid "Edit bars"
msgstr "Редагувати бари"
#, kde-format
msgid "Run %1"
msgstr "Запуск %1"
#, kde-format
msgid "Version %1 (build date %2)"
msgstr "Версія %1 (дата створення %2)"
#, kde-format
msgid "A set of minimalistic plasmoid widgets"
msgstr "Набір мінімалістичних плазмоїдів"
#, kde-format
msgid "Links:"
msgstr "Посилання:"
#, kde-format
msgid "Homepage"
msgstr "Домашня сторінка"
#, kde-format
msgid "Repository"
msgstr "Репозиторій"
#, kde-format
msgid "Bugtracker"
msgstr "Баг-трекер"
#, kde-format
msgid "Translation issue"
msgstr "Тікет перекладу"
#, kde-format
msgid "AUR packages"
msgstr "Пакети в AUR"
#, kde-format
msgid "openSUSE packages"
msgstr "Пакети для openSUSE"
#, kde-format
msgid "This software is licensed under %1"
msgstr "Цю програму ліцензовано під %1"
#, kde-format
msgid "Translators: %1"
msgstr "Перекладачі: %1"
#, kde-format
msgid "This software uses: %1"
msgstr "Ця програма використовує: %1"
#, kde-format
msgid "Select font"
msgstr "Оберіть шрифт"
#, kde-format
msgid "Current version : %1"
msgstr "Поточна версія : %1"
#, kde-format
msgid "New version : %1"
msgstr "Нова версія : %1"
#, kde-format
msgid "Click \"Ok\" to download"
msgstr "Натисніть \"Ok\" для завантаження"
#, kde-format
msgid "There are updates"
msgstr "Знайдені оновлення"
#, kde-format
msgid "AC online"
msgstr "AC підключений"
#, kde-format
msgid "AC offline"
msgstr "AC відключений"
#, kde-format
msgid "High CPU load"
msgstr "Високе завантаження CPU"
#, kde-format
msgid "High GPU load"
msgstr "Високе завантаження GPU"
#, kde-format
msgid "Free space on %1 less than 10%"
msgstr "Вільний простір на диску %1 меньше ніж 10%"
#, kde-format
msgid "High memory usage"
msgstr "Велике споживання пам’яті"
#, kde-format
msgid "Network device has been changed to %1"
msgstr "Мережевий пристрій було змінено на %1"
#, kde-format
msgid "MB/s"
msgstr ""
msgid "KB/s"
msgstr ""
msgid "Swap is used"
msgstr "Використовується swap"
#, kde-format
msgid "Select tag"
msgstr "Оберіть тег"
#, kde-format
msgid "Tag"
msgstr "Тег"
#, kde-format
msgid "Copy"
msgstr "Копіювати"
#, kde-format
msgid "Create"
msgstr "Створити"
#, kde-format
msgid "Remove"
msgstr "Видалити"
#, kde-format
msgid "Enter file name"
msgstr "Введіть ім’я файлу"
#, kde-format
msgid "File name"
msgstr "Ім’я файлу"
#, kde-format
msgid "Name: %1"
msgstr "Ім’я: %1"
#, kde-format
msgid "Comment: %1"
msgstr "Коментар: %1"
#, fuzzy, kde-format
#, fuzzy
msgid "Identity: %1"
msgstr "Коментар: %1"
#, kde-format
msgid "Name"
msgstr "Ім’я"
#, kde-format
msgid "Comment"
msgstr "Коментар"
#, kde-format
msgid ""
"<html><head/><body><p>Use YAHOO! finance ticker to get quotes for the "
"instrument. Refer to <a href=\"http://finance.yahoo.com/\"><span style=\" "
@ -491,164 +435,139 @@ msgid ""
"span></a></p></body></html>"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Ticker"
msgstr "Тікер: %1"
#, fuzzy, kde-format
#, fuzzy
msgid "Active"
msgstr "Активний колір"
#, fuzzy, kde-format
#, fuzzy
msgid "Interval"
msgstr "Інтервал оновлення"
#, fuzzy, kde-format
#, fuzzy
msgid "Command"
msgstr "Коментар"
#, kde-format
msgid "Prefix"
msgstr ""
#, kde-format
msgid "Has output"
msgstr ""
#, kde-format
msgid "Redirect"
msgstr ""
#, kde-format
msgid "Additional filters"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Wrap colors"
msgstr "Колір swap"
#, kde-format
msgid "Wrap spaces"
msgstr ""
#, kde-format
msgid "Filter"
msgstr ""
msgid "Null"
msgstr ""
#, kde-format
msgid "City"
msgstr ""
#, kde-format
msgid "Country"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Timestamp"
msgstr "Час"
#, kde-format
msgid "Use images"
msgstr ""
msgid "Value"
msgstr "Значення"
#, fuzzy, kde-format
#, fuzzy
msgid "Active color"
msgstr "Активний колір"
#, fuzzy, kde-format
#, fuzzy
msgid "Inactive color"
msgstr "Неактивний колір"
#, kde-format
msgid "Type"
msgstr "Тип"
#, kde-format
msgid "Direction"
msgstr "Напрямок"
#, kde-format
msgid "Height"
msgstr "Висота"
#, kde-format
msgid "Width"
msgstr "Ширина"
#, kde-format
msgid "Active desktop"
msgstr "Активний робочий стіл"
#, kde-format
msgid "Inactive desktop"
msgstr "Неактивний робочий стіл"
#, kde-format
msgid "Tooltip type"
msgstr "Тип підказки"
#, kde-format
msgid "contours"
msgstr "Контури"
#, kde-format
msgid "windows"
msgstr "Вікна"
#, kde-format
msgid "clean desktop"
msgstr "пустий робочий стіл"
#, kde-format
msgid "names"
msgstr "назви"
#, kde-format
msgid "none"
msgstr "немає"
#, kde-format
msgid "Tooltip width"
msgstr "Ширина підказки"
#, kde-format
msgid "Vertical layout"
msgstr "Вертикальна розмітка"
#, kde-format
msgid "Mark"
msgstr "Позначка"
#, kde-format
msgid "Top Edge"
msgstr "Верхній край"
#, kde-format
msgid "Bottom Edge"
msgstr "Нижній край"
#, kde-format
msgid "Left Edge"
msgstr "Лівий край"
#, kde-format
msgid "Right Edge"
msgstr "Правий край"
#, kde-format
msgid "Unknown location (%1)"
msgstr "Невідоме положення (%1)"
#, kde-format
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "Slobodyan Victor"
#, kde-format
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "sarumyan@i.ua"
#~ msgid "Top Edge"
#~ msgstr "Верхній край"
#~ msgid "Bottom Edge"
#~ msgstr "Нижній край"
#~ msgid "Left Edge"
#~ msgstr "Лівий край"
#~ msgid "Right Edge"
#~ msgstr "Правий край"
#~ msgid "Unknown location (%1)"
#~ msgstr "Невідоме положення (%1)"
#~ msgid "Exec: %1"
#~ msgstr "Команда: %1"
@ -668,9 +587,6 @@ msgstr "sarumyan@i.ua"
#~ msgid "Edit"
#~ msgstr "Редагувати"
#~ msgid "Bars"
#~ msgstr "Бари"
#~ msgid "Enable popup on mouse click"
#~ msgstr "Включити спливаючі підказки при натисканні клавіші миші"
@ -831,9 +747,6 @@ msgstr "sarumyan@i.ua"
#~ "$uptime - час роботи\n"
#~ "$custom - свій формат"
#~ msgid "CPU"
#~ msgstr "CPU"
#~ msgid ""
#~ "$cpu - total load CPU, %\n"
#~ "$cpu0 - load CPU for core 0, %\n"
@ -885,9 +798,6 @@ msgstr "sarumyan@i.ua"
#~ msgid "$gputemp - physical temperature on GPU"
#~ msgstr "$gputemp - фізична температура на GPU"
#~ msgid "Memory"
#~ msgstr "Пам’ять"
#~ msgid ""
#~ "$mem - RAM usage, %\n"
#~ "$memmb - RAM usage, MB\n"
@ -946,9 +856,6 @@ msgstr "sarumyan@i.ua"
#~ msgstr ""
#~ "$hddtempN - фізична температура на пристрої N (від 0). Приклад: $hddtemp"
#~ msgid "Network"
#~ msgstr "Мережа"
#~ msgid ""
#~ "$down - download speed, KB/s\n"
#~ "$up - upload speed, KB/s\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
"POT-Creation-Date: 2015-08-01 22:13+0300\n"
"POT-Creation-Date: 2015-09-02 00:03+0300\n"
"PO-Revision-Date: 2015-07-31 22:24+0300\n"
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
"Language-Team: Russian <kde-russian@lists.kde.ru>\n"
@ -18,239 +18,194 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Lokalize 2.0\n"
#, kde-format
msgid "Widget"
msgstr "窗口小部件"
#, kde-format
msgid "Advanced"
msgstr "高级设置"
#, kde-format
msgid "Tooltip"
msgstr "提示"
#, kde-format
msgid "Appearance"
msgstr "外观"
#, kde-format
msgid "DataEngine"
msgstr "数据引擎"
#, kde-format
msgid "About"
msgstr ""
#, kde-format
msgid "Acknowledgment"
msgstr ""
#, kde-format
msgid "Widget height, px"
msgstr ""
#, kde-format
msgid "Widget width, px"
msgstr ""
#, kde-format
msgid "Enable notifications"
msgstr ""
#, kde-format
msgid "Wrap new lines"
msgstr ""
#, kde-format
msgid "Enable background"
msgstr "启用背景"
#, kde-format
msgid "Custom time format"
msgstr "自定义时间格式"
#, kde-format
msgid "Custom uptime format"
msgstr "自定义启动时间显示格式"
#, kde-format
msgid "Temperature units"
msgstr "温度单位"
#, kde-format
msgid "Celsius"
msgstr ""
#, kde-format
msgid "Fahrenheit"
msgstr ""
#, kde-format
msgid "Kelvin"
msgstr ""
#, kde-format
msgid "Reaumur"
msgstr ""
#, kde-format
msgid "cm^-1"
msgstr ""
#, kde-format
msgid "kJ/mol"
msgstr ""
#, kde-format
msgid "kcal/mol"
msgstr ""
#, kde-format
msgid "AC online tag"
msgstr "外接电源使用中标签"
#, kde-format
msgid "AC offline tag"
msgstr "外接电源未使用标签"
#, kde-format
msgid "Check updates on startup"
msgstr ""
msgid "Translate strings"
msgstr ""
msgid "Drop key cache"
msgstr ""
#, kde-format
msgid "Time interval"
msgstr "时间周期"
#, kde-format
msgid "Font"
msgstr "字体"
#, kde-format
msgid "Font size"
msgstr "字体大小"
#, kde-format
msgid "Font weight"
msgstr "字体宽度"
#, kde-format
msgid "light"
msgstr ""
#, kde-format
msgid "normal"
msgstr ""
#, kde-format
msgid "demi bold"
msgstr ""
#, kde-format
msgid "bold"
msgstr ""
#, kde-format
msgid "black"
msgstr ""
#, kde-format
msgid "Font style"
msgstr "字体样式"
#, kde-format
msgid "italic"
msgstr ""
#, kde-format
msgid "Font color"
msgstr "字体颜色"
#, fuzzy, kde-format
#, fuzzy
msgid "Select a color"
msgstr "选择字体"
#, fuzzy, kde-format
#, fuzzy
msgid "Select a font"
msgstr "选择字体"
#, kde-format
msgid "ACPI path"
msgstr ""
#, kde-format
msgid "Custom scripts"
msgstr ""
#, kde-format
msgid "Edit scripts"
msgstr ""
#, kde-format
msgid "GPU device"
msgstr "GPU 设备"
#, kde-format
msgid "HDD"
msgstr "硬盘"
#, kde-format
msgid "hddtemp cmd"
msgstr "硬盘温度显示命令"
#, kde-format
msgid "MPD address"
msgstr "MPD 地址"
#, kde-format
msgid "MPD port"
msgstr "MPD 端口"
#, kde-format
msgid "MPRIS player name"
msgstr "MPRIS 播放器名"
#, kde-format
msgid "Music player"
msgstr "音乐播放器"
#, kde-format
msgid "Player data symbols"
msgstr ""
msgid "Custom scripts"
msgstr ""
msgid "Edit scripts"
msgstr ""
msgid "Quotes monitor"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Edit tickers"
msgstr "可编辑的"
#, kde-format
msgid "Package manager"
msgstr "包管理器"
#, fuzzy, kde-format
#, fuzzy
msgid "Edit command"
msgstr "自定义命令"
#, kde-format
msgid "Weather"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Edit weather"
msgstr "可编辑的"
#, kde-format
msgid "Request key"
msgstr ""
#, kde-format
msgid "Show README"
msgstr "显示帮助文档"
#, kde-format
msgid "Check updates"
msgstr ""
#, kde-format
msgid ""
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
"To enable them just make needed checkbox fully checked."
@ -258,47 +213,36 @@ msgstr ""
"CPU CPU 时钟,内存,虚拟内存和网络连接标签均支持图形化提示显示。 请在相应复"
"选框中勾选以启用该功能。 "
#, kde-format
msgid "Number of values for tooltips"
msgstr "提示的数值"
#, kde-format
msgid "Background"
msgstr "背景"
#, kde-format
msgid "CPU color"
msgstr "CPU 颜色"
#, kde-format
msgid "CPU clock color"
msgstr "CPU 时钟颜色"
#, kde-format
msgid "Memory color"
msgstr "内存显示颜色"
#, kde-format
msgid "Swap color"
msgstr "虚拟内存颜色"
#, kde-format
msgid "Download speed color"
msgstr "下载速度颜色"
#, kde-format
msgid "Upload speed color"
msgstr "上传速度颜色"
#, kde-format
msgid "Battery active color"
msgstr "电池使用状态提示颜色"
#, kde-format
msgid "Battery inactive color"
msgstr "电池未使用状态提示颜色"
#, kde-format
msgid ""
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
"awesome-widgets/\">project homepage</a>"
@ -306,183 +250,187 @@ msgstr ""
"详情请参照 <a href=\"http://arcanis.name/projects/ awesome-widgets/\">项目主"
"页</a>"
#, kde-format
msgid "AC"
msgstr ""
msgid "Bars"
msgstr ""
msgid "CPU"
msgstr ""
msgid "Desktops"
msgstr ""
#, fuzzy
msgid "Memory"
msgstr "内存显示颜色"
msgid "Network"
msgstr ""
msgid "Scripts"
msgstr ""
msgid "Time"
msgstr ""
msgid "Quotes"
msgstr ""
msgid "Upgrades"
msgstr ""
#, fuzzy
msgid "Weathers"
msgstr "可编辑的"
msgid "Add"
msgstr "添加"
#, kde-format
msgid "Show value"
msgstr ""
#, kde-format
msgid "Tag: %1"
msgstr ""
#, kde-format
msgid "Value: %1"
msgstr ""
#, kde-format
msgid "Info: %1"
msgstr ""
#, fuzzy, kde-format
msgid "Add lambda"
msgstr ""
#, fuzzy
msgid "Edit bars"
msgstr "可编辑的"
#, kde-format
msgid "Run %1"
msgstr ""
#, kde-format
msgid "Version %1 (build date %2)"
msgstr ""
#, kde-format
msgid "A set of minimalistic plasmoid widgets"
msgstr ""
#, kde-format
msgid "Links:"
msgstr ""
#, kde-format
msgid "Homepage"
msgstr ""
#, kde-format
msgid "Repository"
msgstr ""
#, kde-format
msgid "Bugtracker"
msgstr ""
#, kde-format
msgid "Translation issue"
msgstr ""
#, kde-format
msgid "AUR packages"
msgstr ""
#, kde-format
msgid "openSUSE packages"
msgstr ""
#, kde-format
msgid "This software is licensed under %1"
msgstr ""
#, kde-format
msgid "Translators: %1"
msgstr ""
#, kde-format
msgid "This software uses: %1"
msgstr ""
#, kde-format
msgid "Select font"
msgstr "选择字体"
#, kde-format
msgid "Current version : %1"
msgstr ""
#, kde-format
msgid "New version : %1"
msgstr ""
#, kde-format
msgid "Click \"Ok\" to download"
msgstr ""
#, kde-format
msgid "There are updates"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "AC online"
msgstr "外接电源使用中标签"
#, fuzzy, kde-format
#, fuzzy
msgid "AC offline"
msgstr "外接电源未使用标签"
#, kde-format
msgid "High CPU load"
msgstr ""
#, kde-format
msgid "High GPU load"
msgstr ""
#, kde-format
msgid "Free space on %1 less than 10%"
msgstr ""
#, kde-format
msgid "High memory usage"
msgstr ""
#, kde-format
msgid "Network device has been changed to %1"
msgstr ""
#, kde-format
msgid "MB/s"
msgstr ""
msgid "KB/s"
msgstr ""
msgid "Swap is used"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Select tag"
msgstr "选择字体"
#, kde-format
msgid "Tag"
msgstr ""
#, kde-format
msgid "Copy"
msgstr ""
#, kde-format
msgid "Create"
msgstr ""
#, kde-format
msgid "Remove"
msgstr "移除"
#, kde-format
msgid "Enter file name"
msgstr ""
#, kde-format
msgid "File name"
msgstr ""
#, kde-format
msgid "Name: %1"
msgstr ""
#, kde-format
msgid "Comment: %1"
msgstr ""
#, kde-format
msgid "Identity: %1"
msgstr ""
#, kde-format
msgid "Name"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Comment"
msgstr "自定义命令"
#, kde-format
msgid ""
"<html><head/><body><p>Use YAHOO! finance ticker to get quotes for the "
"instrument. Refer to <a href=\"http://finance.yahoo.com/\"><span style=\" "
@ -490,164 +438,138 @@ msgid ""
"span></a></p></body></html>"
msgstr ""
#, kde-format
msgid "Ticker"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Active"
msgstr "电池使用状态提示颜色"
#, fuzzy, kde-format
#, fuzzy
msgid "Interval"
msgstr "时间周期"
#, fuzzy, kde-format
#, fuzzy
msgid "Command"
msgstr "自定义命令"
#, kde-format
msgid "Prefix"
msgstr ""
#, kde-format
msgid "Has output"
msgstr ""
#, kde-format
msgid "Redirect"
msgstr ""
#, kde-format
msgid "Additional filters"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Wrap colors"
msgstr "虚拟内存颜色"
#, kde-format
msgid "Wrap spaces"
msgstr ""
#, kde-format
msgid "Filter"
msgstr ""
msgid "Null"
msgstr ""
#, kde-format
msgid "City"
msgstr ""
#, kde-format
msgid "Country"
msgstr ""
#, kde-format
msgid "Timestamp"
msgstr ""
#, kde-format
msgid "Use images"
msgstr ""
msgid "Value"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Active color"
msgstr "电池使用状态提示颜色"
#, fuzzy, kde-format
#, fuzzy
msgid "Inactive color"
msgstr "电池未使用状态提示颜色"
#, kde-format
msgid "Type"
msgstr ""
#, kde-format
msgid "Direction"
msgstr ""
#, kde-format
msgid "Height"
msgstr ""
#, kde-format
msgid "Width"
msgstr ""
#, kde-format
msgid "Active desktop"
msgstr "当前激活桌面"
#, kde-format
msgid "Inactive desktop"
msgstr "未激活桌面"
#, fuzzy, kde-format
#, fuzzy
msgid "Tooltip type"
msgstr "提示"
#, kde-format
msgid "contours"
msgstr ""
#, kde-format
msgid "windows"
msgstr ""
#, kde-format
msgid "clean desktop"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "names"
msgstr "用户名"
#, kde-format
msgid "none"
msgstr ""
#, fuzzy, kde-format
#, fuzzy
msgid "Tooltip width"
msgstr "提示"
#, kde-format
msgid "Vertical layout"
msgstr ""
#, kde-format
msgid "Mark"
msgstr "标记"
#, kde-format
msgid "Top Edge"
msgstr "顶部边缘"
#, kde-format
msgid "Bottom Edge"
msgstr "底部边缘"
#, kde-format
msgid "Left Edge"
msgstr "左端边缘"
#, fuzzy, kde-format
msgid "Right Edge"
msgstr "未知位置(%1)"
#, kde-format
msgid "Unknown location (%1)"
msgstr ""
#, kde-format
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "用户名"
#, kde-format
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "用户邮箱"
#~ msgid "Top Edge"
#~ msgstr "顶部边缘"
#~ msgid "Bottom Edge"
#~ msgstr "底部边缘"
#~ msgid "Left Edge"
#~ msgstr "左端边缘"
#, fuzzy
#~ msgid "Right Edge"
#~ msgstr "未知位置(%1)"
#, fuzzy
#~ msgid "Select color"
#~ msgstr "选择字体"

View File

@ -5,10 +5,12 @@
#define NAME "Awesome Widgets"
#define VERSION "@PROJECT_VERSION@"
#define AUTHOR "@PROJECT_AUTHOR@"
#define TRANSLATORS "Ernesto Aviles Vzqz (Spanish), Mermouy (French), underr (Brazillian Portuguese), Viktor Slobodyan (Ukrainian), Lemueler (Chinese)"
#define TRANSLATORS "Ernesto Aviles Vzqz (Spanish), Mermouy (French), underr (Brazillian Portuguese), Viktor Slobodyan (Ukrainian), Lemueler (Chinese), Heimen Stoffels (Dutch)"
#define EMAIL "@PROJECT_CONTACT@"
#define LICENSE "@PROJECT_LICENSE@"
#define TRDPARTY_LICENSE "tasks,BSD,https://github.com/mhogomchungu/tasks"
// configuraion
// graphical items api version
#define AWGIAPI 2
// extquotes api version
@ -16,12 +18,14 @@
// extscript api version
#define AWESAPI 3
// extupgrade api version
#define AWEUAPI 2
#define AWEUAPI 3
// extweather api version
#define AWEWAPI 1
#define AWEWAPI 2
// available time keys
#define TIME_KEYS "dddd,ddd,dd,d,MMMM,MMM,MM,M,yyyy,yy,hh,h,HH,H,mm,m,ss,s,t,ap,a,AP,A"
// links
#define HOMEPAGE "http://arcanis.name/projects/awesome-widgets/"
#define HOMEPAGE "https://arcanis.name/projects/awesome-widgets/"
#define REPOSITORY "https://github.com/arcan1s/awesome-widgets"
#define RELEASES "https://github.com/arcan1s/awesome-widgets/releases/tag/V."
#define VERSION_API "https://api.github.com/repos/arcan1s/awesome-widgets/releases"