mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 23:47:20 +00:00
commit
a7b2d16342
11
CHANGELOG
11
CHANGELOG
@ -1,3 +1,14 @@
|
|||||||
|
Ver.3.2.1:
|
||||||
|
+ add X-AW-Translate option to DateTime formatter
|
||||||
|
+ add formatters to configuration export and import
|
||||||
|
+ add macro fuction to selector
|
||||||
|
+ add default formatters
|
||||||
|
- add translation reinit (fix #102)
|
||||||
|
- fix invalid float formatter saving
|
||||||
|
- fix missing ApiVersion for formatters
|
||||||
|
* use sockets for MPD data
|
||||||
|
* translation update
|
||||||
|
|
||||||
Ver.3.2.0:
|
Ver.3.2.0:
|
||||||
+ custom formatters (#91)
|
+ custom formatters (#91)
|
||||||
+ add backend tests (#95)
|
+ add backend tests (#95)
|
||||||
|
@ -6,8 +6,8 @@ for more details. To avoid manual labor there is automatic cmake target named
|
|||||||
`clangformat` (see below). Some additional detail see below.
|
`clangformat` (see below). Some additional detail see below.
|
||||||
|
|
||||||
* Indent is only spaces. 4 spaces.
|
* Indent is only spaces. 4 spaces.
|
||||||
* It is highly recommended to name private variables with `m_` prefix (`m_foo`).
|
* Any private variable should start with `m_` prefix (`m_foo`). The only one
|
||||||
There is no exceptions for properties.
|
exception is `Ui` object which should be named as `ui`.
|
||||||
* Avoid to create a large methods. Exception: if method contains lambda functions.
|
* Avoid to create a large methods. Exception: if method contains lambda functions.
|
||||||
* If some method is called only once, it is recommended to use lambda functions.
|
* If some method is called only once, it is recommended to use lambda functions.
|
||||||
Exception is `Q_INVOKABLE` methods.
|
Exception is `Q_INVOKABLE` methods.
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
pkgname=plasma5-applet-awesome-widgets
|
pkgname=plasma5-applet-awesome-widgets
|
||||||
_pkgname=awesome-widgets
|
_pkgname=awesome-widgets
|
||||||
pkgver=3.2.0
|
pkgver=3.2.1
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Collection of minimalistic Plasmoids which look like Awesome WM widgets (ex-PyTextMonitor)"
|
pkgdesc="Collection of minimalistic Plasmoids which look like Awesome WM widgets (ex-PyTextMonitor)"
|
||||||
arch=('i686' 'x86_64')
|
arch=('i686' 'x86_64')
|
||||||
@ -17,7 +17,7 @@ optdepends=("catalyst: for GPU monitor"
|
|||||||
makedepends=('cmake' 'extra-cmake-modules' 'python')
|
makedepends=('cmake' 'extra-cmake-modules' 'python')
|
||||||
source=(https://github.com/arcan1s/awesome-widgets/releases/download/V.${pkgver}/${_pkgname}-${pkgver}-src.tar.xz)
|
source=(https://github.com/arcan1s/awesome-widgets/releases/download/V.${pkgver}/${_pkgname}-${pkgver}-src.tar.xz)
|
||||||
install=${pkgname}.install
|
install=${pkgname}.install
|
||||||
md5sums=('81a85890d519bd8c5791d0d99cffc9c1')
|
md5sums=('73da19c31aa95edd428ff5ce7b541ee1')
|
||||||
backup=('etc/xdg/plasma-dataengine-extsysmon.conf')
|
backup=('etc/xdg/plasma-dataengine-extsysmon.conf')
|
||||||
|
|
||||||
prepare() {
|
prepare() {
|
||||||
|
@ -15,7 +15,7 @@ set(PROJECT_CONTACT "esalexeev@gmail.com")
|
|||||||
set(PROJECT_LICENSE "GPL3")
|
set(PROJECT_LICENSE "GPL3")
|
||||||
set(PROJECT_VERSION_MAJOR "3")
|
set(PROJECT_VERSION_MAJOR "3")
|
||||||
set(PROJECT_VERSION_MINOR "2")
|
set(PROJECT_VERSION_MINOR "2")
|
||||||
set(PROJECT_VERSION_PATCH "0")
|
set(PROJECT_VERSION_PATCH "1")
|
||||||
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
||||||
# append git version if any
|
# append git version if any
|
||||||
set(PROJECT_COMMIT_SHA "Commit hash" CACHE INTERNAL "")
|
set(PROJECT_COMMIT_SHA "Commit hash" CACHE INTERNAL "")
|
||||||
|
@ -279,7 +279,7 @@ Item {
|
|||||||
if (model[currentIndex]["regexp"] == "functions")
|
if (model[currentIndex]["regexp"] == "functions")
|
||||||
tags.model = ["{{\n\n}}", "template{{\n\n}}",
|
tags.model = ["{{\n\n}}", "template{{\n\n}}",
|
||||||
"aw_all<>{{}}", "aw_count<>{{}}", "aw_keys<>{{}}",
|
"aw_all<>{{}}", "aw_count<>{{}}", "aw_keys<>{{}}",
|
||||||
"aw_names<>{{}}"]
|
"aw_macro<>{{}}", "aw_names<>{{}}"]
|
||||||
else
|
else
|
||||||
tags.model = awKeys.dictKeys(true, model[currentIndex]["regexp"])
|
tags.model = awKeys.dictKeys(true, model[currentIndex]["regexp"])
|
||||||
if (debug) console.info("Init model", tags.model, "for", model[currentIndex]["label"])
|
if (debug) console.info("Init model", tags.model, "for", model[currentIndex]["label"])
|
||||||
|
@ -20,7 +20,7 @@ X-Plasma-RemoteLocation=
|
|||||||
X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis
|
X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis
|
||||||
X-KDE-PluginInfo-Email=esalexeev@gmail.com
|
X-KDE-PluginInfo-Email=esalexeev@gmail.com
|
||||||
X-KDE-PluginInfo-Name=org.kde.plasma.awesomewidget
|
X-KDE-PluginInfo-Name=org.kde.plasma.awesomewidget
|
||||||
X-KDE-PluginInfo-Version=3.1.2
|
X-KDE-PluginInfo-Version=3.2.1
|
||||||
X-KDE-PluginInfo-Website=https://arcanis.me/projects/awesome-widgets/
|
X-KDE-PluginInfo-Website=https://arcanis.me/projects/awesome-widgets/
|
||||||
X-KDE-PluginInfo-Category=System Information
|
X-KDE-PluginInfo-Category=System Information
|
||||||
X-KDE-PluginInfo-Depends=
|
X-KDE-PluginInfo-Depends=
|
||||||
|
@ -110,6 +110,9 @@ bool AWConfigHelper::exportConfiguration(const QObject *nativeConfig,
|
|||||||
readFile(settings, QString("weathers"),
|
readFile(settings, QString("weathers"),
|
||||||
QString("%1/weather/awesomewidgets-extweather-ids.json")
|
QString("%1/weather/awesomewidgets-extweather-ids.json")
|
||||||
.arg(m_baseDir));
|
.arg(m_baseDir));
|
||||||
|
// formatter settings
|
||||||
|
readFile(settings, QString("formatters"),
|
||||||
|
QString("%1/formatters/formatters.ini").arg(m_baseDir));
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
// sync settings
|
// sync settings
|
||||||
@ -150,6 +153,9 @@ QVariantMap AWConfigHelper::importConfiguration(const QString fileName,
|
|||||||
writeFile(settings, QString("weathers"),
|
writeFile(settings, QString("weathers"),
|
||||||
QString("%1/weather/awesomewidgets-extweather-ids.json")
|
QString("%1/weather/awesomewidgets-extweather-ids.json")
|
||||||
.arg(m_baseDir));
|
.arg(m_baseDir));
|
||||||
|
// formatter settings
|
||||||
|
writeFile(settings, QString("formatters"),
|
||||||
|
QString("%1/formatters/formatters.ini").arg(m_baseDir));
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ private:
|
|||||||
QStringList m_dirs = QStringList()
|
QStringList m_dirs = QStringList()
|
||||||
<< QString("desktops") << QString("quotes")
|
<< QString("desktops") << QString("quotes")
|
||||||
<< QString("scripts") << QString("upgrade")
|
<< QString("scripts") << QString("upgrade")
|
||||||
<< QString("weather");
|
<< QString("weather") << QString("formatters");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,13 +36,13 @@ AWDataAggregator::AWDataAggregator(QObject *parent)
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
boundaries[QString("cpuTooltip")] = 100.0;
|
m_boundaries[QString("cpuTooltip")] = 100.0;
|
||||||
boundaries[QString("cpuclTooltip")] = 4000.0;
|
m_boundaries[QString("cpuclTooltip")] = 4000.0;
|
||||||
boundaries[QString("memTooltip")] = 100.0;
|
m_boundaries[QString("memTooltip")] = 100.0;
|
||||||
boundaries[QString("swapTooltip")] = 100.0;
|
m_boundaries[QString("swapTooltip")] = 100.0;
|
||||||
boundaries[QString("downkbTooltip")] = 1.0;
|
m_boundaries[QString("downkbTooltip")] = 1.0;
|
||||||
boundaries[QString("upkbTooltip")] = 1.0;
|
m_boundaries[QString("upkbTooltip")] = 1.0;
|
||||||
boundaries[QString("batTooltip")] = 100.0;
|
m_boundaries[QString("batTooltip")] = 100.0;
|
||||||
|
|
||||||
initScene();
|
initScene();
|
||||||
connect(this, SIGNAL(updateData(const QVariantHash &)), this,
|
connect(this, SIGNAL(updateData(const QVariantHash &)), this,
|
||||||
@ -54,7 +54,7 @@ AWDataAggregator::~AWDataAggregator()
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
delete toolTipScene;
|
delete m_toolTipScene;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ QList<float> AWDataAggregator::getData(const QString key) const
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_AW) << "Key" << key;
|
qCDebug(LOG_AW) << "Key" << key;
|
||||||
|
|
||||||
return data[QString("%1Tooltip").arg(key)];
|
return m_values[QString("%1Tooltip").arg(key)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -84,41 +84,41 @@ void AWDataAggregator::setParameters(QVariantMap settings)
|
|||||||
qCDebug(LOG_AW) << "Settings" << settings;
|
qCDebug(LOG_AW) << "Settings" << settings;
|
||||||
|
|
||||||
// cast from QVariantMap to QVariantHash without data lost
|
// cast from QVariantMap to QVariantHash without data lost
|
||||||
configuration = qvariant_cast<QVariantHash>(settings);
|
m_configuration = qvariant_cast<QVariantHash>(settings);
|
||||||
|
|
||||||
m_enablePopup = configuration[QString("notify")].toBool();
|
m_enablePopup = m_configuration[QString("notify")].toBool();
|
||||||
|
|
||||||
counts = 0;
|
m_counts = 0;
|
||||||
counts += configuration[QString("cpuTooltip")].toInt();
|
m_counts += m_configuration[QString("cpuTooltip")].toInt();
|
||||||
counts += configuration[QString("cpuclTooltip")].toInt();
|
m_counts += m_configuration[QString("cpuclTooltip")].toInt();
|
||||||
counts += configuration[QString("memTooltip")].toInt();
|
m_counts += m_configuration[QString("memTooltip")].toInt();
|
||||||
counts += configuration[QString("swapTooltip")].toInt();
|
m_counts += m_configuration[QString("swapTooltip")].toInt();
|
||||||
counts += configuration[QString("downkbTooltip")].toInt();
|
m_counts += m_configuration[QString("downkbTooltip")].toInt();
|
||||||
counts += configuration[QString("batTooltip")].toInt();
|
m_counts += m_configuration[QString("batTooltip")].toInt();
|
||||||
// resize tooltip image
|
// resize tooltip image
|
||||||
toolTipView->resize(100 * counts, 105);
|
m_toolTipView->resize(100 * m_counts, 105);
|
||||||
|
|
||||||
requiredKeys.clear();
|
requiredKeys.clear();
|
||||||
if (configuration[QString("cpuTooltip")].toBool())
|
if (m_configuration[QString("cpuTooltip")].toBool())
|
||||||
requiredKeys.append(QString("cpuTooltip"));
|
requiredKeys.append(QString("cpuTooltip"));
|
||||||
if (configuration[QString("cpuclTooltip")].toBool())
|
if (m_configuration[QString("cpuclTooltip")].toBool())
|
||||||
requiredKeys.append(QString("cpuclTooltip"));
|
requiredKeys.append(QString("cpuclTooltip"));
|
||||||
if (configuration[QString("memTooltip")].toBool())
|
if (m_configuration[QString("memTooltip")].toBool())
|
||||||
requiredKeys.append(QString("memTooltip"));
|
requiredKeys.append(QString("memTooltip"));
|
||||||
if (configuration[QString("swapTooltip")].toBool())
|
if (m_configuration[QString("swapTooltip")].toBool())
|
||||||
requiredKeys.append(QString("swapTooltip"));
|
requiredKeys.append(QString("swapTooltip"));
|
||||||
if (configuration[QString("downkbTooltip")].toBool())
|
if (m_configuration[QString("downkbTooltip")].toBool())
|
||||||
requiredKeys.append(QString("downkbTooltip"));
|
requiredKeys.append(QString("downkbTooltip"));
|
||||||
if (configuration[QString("upkbTooltip")].toBool())
|
if (m_configuration[QString("upkbTooltip")].toBool())
|
||||||
requiredKeys.append(QString("upkbTooltip"));
|
requiredKeys.append(QString("upkbTooltip"));
|
||||||
if (configuration[QString("batTooltip")].toBool())
|
if (m_configuration[QString("batTooltip")].toBool())
|
||||||
requiredKeys.append(QString("batTooltip"));
|
requiredKeys.append(QString("batTooltip"));
|
||||||
|
|
||||||
// background
|
// background
|
||||||
toolTipScene->setBackgroundBrush(
|
m_toolTipScene->setBackgroundBrush(
|
||||||
configuration[QString("useTooltipBackground")].toBool()
|
m_configuration[QString("useTooltipBackground")].toBool()
|
||||||
? QBrush(QColor(
|
? QBrush(QColor(
|
||||||
configuration[QString("tooltipBackground")].toString()))
|
m_configuration[QString("tooltipBackground")].toString()))
|
||||||
: QBrush(Qt::NoBrush));
|
: QBrush(Qt::NoBrush));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,43 +126,44 @@ void AWDataAggregator::setParameters(QVariantMap settings)
|
|||||||
QPixmap AWDataAggregator::tooltipImage()
|
QPixmap AWDataAggregator::tooltipImage()
|
||||||
{
|
{
|
||||||
// create image
|
// create image
|
||||||
toolTipScene->clear();
|
m_toolTipScene->clear();
|
||||||
QPen pen;
|
QPen pen;
|
||||||
bool down = false;
|
bool down = false;
|
||||||
for (auto key : requiredKeys) {
|
for (auto key : requiredKeys) {
|
||||||
// create frame
|
// create frame
|
||||||
float normX = 100.0f / static_cast<float>(data[key].count());
|
float normX = 100.0f / static_cast<float>(m_values[key].count());
|
||||||
float normY = 100.0f / (1.5f * boundaries[key]);
|
float normY = 100.0f / (1.5f * m_boundaries[key]);
|
||||||
float shift = requiredKeys.indexOf(key) * 100.0f;
|
float shift = requiredKeys.indexOf(key) * 100.0f;
|
||||||
if (down)
|
if (down)
|
||||||
shift -= 100.0;
|
shift -= 100.0;
|
||||||
// apply pen color
|
// apply pen color
|
||||||
if (key != QString("batTooltip"))
|
if (key != QString("batTooltip"))
|
||||||
pen.setColor(
|
pen.setColor(QColor(
|
||||||
QColor(configuration[QString("%1Color").arg(key)].toString()));
|
m_configuration[QString("%1Color").arg(key)].toString()));
|
||||||
// paint data inside frame
|
// paint data inside frame
|
||||||
for (int j = 0; j < data[key].count() - 1; j++) {
|
for (int j = 0; j < m_values[key].count() - 1; j++) {
|
||||||
// some magic here
|
// some magic here
|
||||||
float x1 = j * normX + shift;
|
float x1 = j * normX + shift;
|
||||||
float y1 = -fabs(data[key].at(j)) * normY + 5.0f;
|
float y1 = -fabs(m_values[key].at(j)) * normY + 5.0f;
|
||||||
float x2 = (j + 1) * normX + shift;
|
float x2 = (j + 1) * normX + shift;
|
||||||
float y2 = -fabs(data[key].at(j + 1)) * normY + 5.0f;
|
float y2 = -fabs(m_values[key].at(j + 1)) * normY + 5.0f;
|
||||||
if (key == QString("batTooltip")) {
|
if (key == QString("batTooltip")) {
|
||||||
if (data[key].at(j + 1) > 0)
|
if (m_values[key].at(j + 1) > 0)
|
||||||
pen.setColor(QColor(
|
pen.setColor(
|
||||||
configuration[QString("batTooltipColor")].toString()));
|
QColor(m_configuration[QString("batTooltipColor")]
|
||||||
|
.toString()));
|
||||||
else
|
else
|
||||||
pen.setColor(
|
pen.setColor(
|
||||||
QColor(configuration[QString("batInTooltipColor")]
|
QColor(m_configuration[QString("batInTooltipColor")]
|
||||||
.toString()));
|
.toString()));
|
||||||
}
|
}
|
||||||
toolTipScene->addLine(x1, y1, x2, y2, pen);
|
m_toolTipScene->addLine(x1, y1, x2, y2, pen);
|
||||||
}
|
}
|
||||||
if (key == QString("downkbTooltip"))
|
if (key == QString("downkbTooltip"))
|
||||||
down = true;
|
down = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return toolTipView->grab();
|
return m_toolTipView->grab();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -182,12 +183,12 @@ void AWDataAggregator::checkValue(const QString source, const float value,
|
|||||||
|
|
||||||
if (value >= 0.0) {
|
if (value >= 0.0) {
|
||||||
if ((m_enablePopup) && (value > extremum)
|
if ((m_enablePopup) && (value > extremum)
|
||||||
&& (data[source].last() < extremum))
|
&& (m_values[source].last() < extremum))
|
||||||
return AWActions::sendNotification(QString("event"),
|
return AWActions::sendNotification(QString("event"),
|
||||||
notificationText(source, value));
|
notificationText(source, value));
|
||||||
} else {
|
} else {
|
||||||
if ((m_enablePopup) && (value < extremum)
|
if ((m_enablePopup) && (value < extremum)
|
||||||
&& (data[source].last() > extremum))
|
&& (m_values[source].last() > extremum))
|
||||||
return AWActions::sendNotification(QString("event"),
|
return AWActions::sendNotification(QString("event"),
|
||||||
notificationText(source, value));
|
notificationText(source, value));
|
||||||
}
|
}
|
||||||
@ -208,13 +209,13 @@ void AWDataAggregator::checkValue(const QString source, const QString current,
|
|||||||
|
|
||||||
void AWDataAggregator::initScene()
|
void AWDataAggregator::initScene()
|
||||||
{
|
{
|
||||||
toolTipScene = new QGraphicsScene(nullptr);
|
m_toolTipScene = new QGraphicsScene(nullptr);
|
||||||
toolTipView = new QGraphicsView(toolTipScene);
|
m_toolTipView = new QGraphicsView(m_toolTipScene);
|
||||||
toolTipView->setStyleSheet(QString("background: transparent"));
|
m_toolTipView->setStyleSheet(QString("background: transparent"));
|
||||||
toolTipView->setContentsMargins(0, 0, 0, 0);
|
m_toolTipView->setContentsMargins(0, 0, 0, 0);
|
||||||
toolTipView->setFrameShape(QFrame::NoFrame);
|
m_toolTipView->setFrameShape(QFrame::NoFrame);
|
||||||
toolTipView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
m_toolTipView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
toolTipView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
m_toolTipView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -257,7 +258,7 @@ void AWDataAggregator::setData(const QVariantHash &values)
|
|||||||
// do not log these arguments
|
// do not log these arguments
|
||||||
// battery update requires info is AC online or not
|
// battery update requires info is AC online or not
|
||||||
setData(values[QString("ac")].toString()
|
setData(values[QString("ac")].toString()
|
||||||
== configuration[QString("acOnline")],
|
== m_configuration[QString("acOnline")],
|
||||||
QString("batTooltip"), values[QString("bat")].toFloat());
|
QString("batTooltip"), values[QString("bat")].toFloat());
|
||||||
// usual case
|
// usual case
|
||||||
setData(QString("cpuTooltip"), values[QString("cpu")].toFloat(), 90.0);
|
setData(QString("cpuTooltip"), values[QString("cpu")].toFloat(), 90.0);
|
||||||
@ -268,13 +269,13 @@ void AWDataAggregator::setData(const QVariantHash &values)
|
|||||||
setData(QString("upkbTooltip"), values[QString("upkb")].toFloat());
|
setData(QString("upkbTooltip"), values[QString("upkb")].toFloat());
|
||||||
// additional check for network device
|
// additional check for network device
|
||||||
[this](const QString value) {
|
[this](const QString value) {
|
||||||
checkValue(QString("netdev"), currentNetworkDevice, value);
|
checkValue(QString("netdev"), m_currentNetworkDevice, value);
|
||||||
currentNetworkDevice = value;
|
m_currentNetworkDevice = value;
|
||||||
}(values[QString("netdev")].toString());
|
}(values[QString("netdev")].toString());
|
||||||
// additional check for GPU load
|
// additional check for GPU load
|
||||||
[this](const float value) {
|
[this](const float value) {
|
||||||
checkValue(QString("gpu"), value, 90.0);
|
checkValue(QString("gpu"), value, 90.0);
|
||||||
currentGPULoad = value;
|
m_currentGPULoad = value;
|
||||||
}(values[QString("gpu")].toFloat());
|
}(values[QString("gpu")].toFloat());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -285,27 +286,27 @@ void AWDataAggregator::setData(const QString &source, float value,
|
|||||||
qCDebug(LOG_AW) << "Source" << source << "to value" << value
|
qCDebug(LOG_AW) << "Source" << source << "to value" << value
|
||||||
<< "with extremum" << extremum;
|
<< "with extremum" << extremum;
|
||||||
|
|
||||||
if (data[source].count() == 0)
|
if (m_values[source].count() == 0)
|
||||||
data[source].append(0.0);
|
m_values[source].append(0.0);
|
||||||
else if (data[source].count()
|
else if (m_values[source].count()
|
||||||
> configuration[QString("tooltipNumber")].toInt())
|
> m_configuration[QString("tooltipNumber")].toInt())
|
||||||
data[source].removeFirst();
|
m_values[source].removeFirst();
|
||||||
if (std::isnan(value))
|
if (std::isnan(value))
|
||||||
value = 0.0;
|
value = 0.0;
|
||||||
|
|
||||||
// notifications
|
// notifications
|
||||||
checkValue(source, value, extremum);
|
checkValue(source, value, extremum);
|
||||||
|
|
||||||
data[source].append(value);
|
m_values[source].append(value);
|
||||||
if (source == QString("downkbTooltip")) {
|
if (source == QString("downkbTooltip")) {
|
||||||
QList<float> netValues
|
QList<float> netValues = m_values[QString("downkbTooltip")]
|
||||||
= data[QString("downkbTooltip")] + data[QString("upkbTooltip")];
|
+ m_values[QString("upkbTooltip")];
|
||||||
// to avoid inf value of normY
|
// to avoid inf value of normY
|
||||||
netValues << 1.0;
|
netValues << 1.0;
|
||||||
boundaries[QString("downkbTooltip")]
|
m_boundaries[QString("downkbTooltip")]
|
||||||
= 1.2f * *std::max_element(netValues.cbegin(), netValues.cend());
|
= 1.2f * *std::max_element(netValues.cbegin(), netValues.cend());
|
||||||
boundaries[QString("upkbTooltip")]
|
m_boundaries[QString("upkbTooltip")]
|
||||||
= boundaries[QString("downkbTooltip")];
|
= m_boundaries[QString("downkbTooltip")];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,8 +49,8 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// ui
|
// ui
|
||||||
QGraphicsScene *toolTipScene = nullptr;
|
QGraphicsScene *m_toolTipScene = nullptr;
|
||||||
QGraphicsView *toolTipView = nullptr;
|
QGraphicsView *m_toolTipView = nullptr;
|
||||||
void checkValue(const QString source, const float value,
|
void checkValue(const QString source, const float value,
|
||||||
const float extremum) const;
|
const float extremum) const;
|
||||||
void checkValue(const QString source, const QString current,
|
void checkValue(const QString source, const QString current,
|
||||||
@ -65,12 +65,12 @@ private:
|
|||||||
// different signature for battery device
|
// different signature for battery device
|
||||||
void setData(const bool dontInvert, const QString &source, float value);
|
void setData(const bool dontInvert, const QString &source, float value);
|
||||||
// variables
|
// variables
|
||||||
int counts = 0;
|
int m_counts = 0;
|
||||||
QVariantHash configuration;
|
QVariantHash m_configuration;
|
||||||
float currentGPULoad = 0.0;
|
float m_currentGPULoad = 0.0;
|
||||||
QString currentNetworkDevice = QString("lo");
|
QString m_currentNetworkDevice = QString("lo");
|
||||||
QHash<QString, float> boundaries;
|
QHash<QString, float> m_boundaries;
|
||||||
QHash<QString, QList<float>> data;
|
QHash<QString, QList<float>> m_values;
|
||||||
bool m_enablePopup = false;
|
bool m_enablePopup = false;
|
||||||
QStringList requiredKeys;
|
QStringList requiredKeys;
|
||||||
};
|
};
|
||||||
|
@ -35,13 +35,13 @@ AWFormatterConfig::AWFormatterConfig(QWidget *parent, const QStringList keys)
|
|||||||
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
editButton
|
m_editButton
|
||||||
= ui->buttonBox->addButton(i18n("Edit"), QDialogButtonBox::ActionRole);
|
= ui->buttonBox->addButton(i18n("Edit"), QDialogButtonBox::ActionRole);
|
||||||
init();
|
init();
|
||||||
|
|
||||||
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||||
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||||
connect(editButton, SIGNAL(clicked(bool)), this, SLOT(editFormatters()));
|
connect(m_editButton, SIGNAL(clicked(bool)), this, SLOT(editFormatters()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ private slots:
|
|||||||
void updateUi();
|
void updateUi();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPushButton *editButton = nullptr;
|
QPushButton *m_editButton = nullptr;
|
||||||
Ui::AWFormatterConfig *ui = nullptr;
|
Ui::AWFormatterConfig *ui = nullptr;
|
||||||
AWFormatterHelper *m_helper = nullptr;
|
AWFormatterHelper *m_helper = nullptr;
|
||||||
QList<AWAbstractSelector *> m_selectors;
|
QList<AWAbstractSelector *> m_selectors;
|
||||||
|
@ -45,11 +45,11 @@ AWKeyOperations::~AWKeyOperations()
|
|||||||
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
// extensions
|
// extensions
|
||||||
delete graphicalItems;
|
delete m_graphicalItems;
|
||||||
delete extQuotes;
|
delete m_extQuotes;
|
||||||
delete extScripts;
|
delete m_extScripts;
|
||||||
delete extUpgrade;
|
delete m_extUpgrade;
|
||||||
delete extWeather;
|
delete m_extWeather;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -79,19 +79,19 @@ QStringList AWKeyOperations::dictKeys() const
|
|||||||
{
|
{
|
||||||
QStringList allKeys;
|
QStringList allKeys;
|
||||||
// weather
|
// weather
|
||||||
for (int i = extWeather->activeItems().count() - 1; i >= 0; i--) {
|
for (int i = m_extWeather->activeItems().count() - 1; i >= 0; i--) {
|
||||||
allKeys.append(
|
allKeys.append(
|
||||||
extWeather->activeItems().at(i)->tag(QString("weatherId")));
|
m_extWeather->activeItems().at(i)->tag(QString("weatherId")));
|
||||||
allKeys.append(
|
allKeys.append(
|
||||||
extWeather->activeItems().at(i)->tag(QString("weather")));
|
m_extWeather->activeItems().at(i)->tag(QString("weather")));
|
||||||
allKeys.append(
|
allKeys.append(
|
||||||
extWeather->activeItems().at(i)->tag(QString("humidity")));
|
m_extWeather->activeItems().at(i)->tag(QString("humidity")));
|
||||||
allKeys.append(
|
allKeys.append(
|
||||||
extWeather->activeItems().at(i)->tag(QString("pressure")));
|
m_extWeather->activeItems().at(i)->tag(QString("pressure")));
|
||||||
allKeys.append(
|
allKeys.append(
|
||||||
extWeather->activeItems().at(i)->tag(QString("temperature")));
|
m_extWeather->activeItems().at(i)->tag(QString("temperature")));
|
||||||
allKeys.append(
|
allKeys.append(
|
||||||
extWeather->activeItems().at(i)->tag(QString("timestamp")));
|
m_extWeather->activeItems().at(i)->tag(QString("timestamp")));
|
||||||
}
|
}
|
||||||
// cpuclock & cpu
|
// cpuclock & cpu
|
||||||
for (int i = QThread::idealThreadCount() - 1; i >= 0; i--) {
|
for (int i = QThread::idealThreadCount() - 1; i >= 0; i--) {
|
||||||
@ -140,32 +140,35 @@ QStringList AWKeyOperations::dictKeys() const
|
|||||||
for (int i = allBatteryDevices.count() - 1; i >= 0; i--)
|
for (int i = allBatteryDevices.count() - 1; i >= 0; i--)
|
||||||
allKeys.append(QString("bat%1").arg(i));
|
allKeys.append(QString("bat%1").arg(i));
|
||||||
// package manager
|
// package manager
|
||||||
for (int i = extUpgrade->activeItems().count() - 1; i >= 0; i--)
|
for (int i = m_extUpgrade->activeItems().count() - 1; i >= 0; i--)
|
||||||
allKeys.append(
|
allKeys.append(
|
||||||
extUpgrade->activeItems().at(i)->tag(QString("pkgcount")));
|
m_extUpgrade->activeItems().at(i)->tag(QString("pkgcount")));
|
||||||
// quotes
|
// quotes
|
||||||
for (int i = extQuotes->activeItems().count() - 1; i >= 0; i--) {
|
for (int i = m_extQuotes->activeItems().count() - 1; i >= 0; i--) {
|
||||||
allKeys.append(extQuotes->activeItems().at(i)->tag(QString("ask")));
|
allKeys.append(m_extQuotes->activeItems().at(i)->tag(QString("ask")));
|
||||||
allKeys.append(extQuotes->activeItems().at(i)->tag(QString("askchg")));
|
|
||||||
allKeys.append(
|
allKeys.append(
|
||||||
extQuotes->activeItems().at(i)->tag(QString("percaskchg")));
|
m_extQuotes->activeItems().at(i)->tag(QString("askchg")));
|
||||||
allKeys.append(extQuotes->activeItems().at(i)->tag(QString("bid")));
|
|
||||||
allKeys.append(extQuotes->activeItems().at(i)->tag(QString("bidchg")));
|
|
||||||
allKeys.append(
|
allKeys.append(
|
||||||
extQuotes->activeItems().at(i)->tag(QString("percbidchg")));
|
m_extQuotes->activeItems().at(i)->tag(QString("percaskchg")));
|
||||||
allKeys.append(extQuotes->activeItems().at(i)->tag(QString("price")));
|
allKeys.append(m_extQuotes->activeItems().at(i)->tag(QString("bid")));
|
||||||
allKeys.append(
|
allKeys.append(
|
||||||
extQuotes->activeItems().at(i)->tag(QString("pricechg")));
|
m_extQuotes->activeItems().at(i)->tag(QString("bidchg")));
|
||||||
allKeys.append(
|
allKeys.append(
|
||||||
extQuotes->activeItems().at(i)->tag(QString("percpricechg")));
|
m_extQuotes->activeItems().at(i)->tag(QString("percbidchg")));
|
||||||
|
allKeys.append(m_extQuotes->activeItems().at(i)->tag(QString("price")));
|
||||||
|
allKeys.append(
|
||||||
|
m_extQuotes->activeItems().at(i)->tag(QString("pricechg")));
|
||||||
|
allKeys.append(
|
||||||
|
m_extQuotes->activeItems().at(i)->tag(QString("percpricechg")));
|
||||||
}
|
}
|
||||||
// custom
|
// custom
|
||||||
for (int i = extScripts->activeItems().count() - 1; i >= 0; i--)
|
for (int i = m_extScripts->activeItems().count() - 1; i >= 0; i--)
|
||||||
allKeys.append(extScripts->activeItems().at(i)->tag(QString("custom")));
|
|
||||||
// bars
|
|
||||||
for (int i = graphicalItems->activeItems().count() - 1; i >= 0; i--)
|
|
||||||
allKeys.append(
|
allKeys.append(
|
||||||
graphicalItems->activeItems().at(i)->tag(QString("bar")));
|
m_extScripts->activeItems().at(i)->tag(QString("custom")));
|
||||||
|
// bars
|
||||||
|
for (int i = m_graphicalItems->activeItems().count() - 1; i >= 0; i--)
|
||||||
|
allKeys.append(
|
||||||
|
m_graphicalItems->activeItems().at(i)->tag(QString("bar")));
|
||||||
// static keys
|
// static keys
|
||||||
QStringList staticKeys = QString(STATIC_KEYS).split(QChar(','));
|
QStringList staticKeys = QString(STATIC_KEYS).split(QChar(','));
|
||||||
std::for_each(staticKeys.cbegin(), staticKeys.cend(),
|
std::for_each(staticKeys.cbegin(), staticKeys.cend(),
|
||||||
@ -181,7 +184,7 @@ GraphicalItem *AWKeyOperations::giByKey(const QString key) const
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_AW) << "Looking for item" << key;
|
qCDebug(LOG_AW) << "Looking for item" << key;
|
||||||
|
|
||||||
return graphicalItems->itemByTag(key, QString("bar"));
|
return m_graphicalItems->itemByTag(key, QString("bar"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -194,11 +197,11 @@ QString AWKeyOperations::infoByKey(QString key) const
|
|||||||
QString output;
|
QString output;
|
||||||
|
|
||||||
if (key.startsWith(QString("bar"))) {
|
if (key.startsWith(QString("bar"))) {
|
||||||
AbstractExtItem *item = graphicalItems->itemByTag(key, stripped);
|
AbstractExtItem *item = m_graphicalItems->itemByTag(key, stripped);
|
||||||
if (item)
|
if (item)
|
||||||
output = item->uniq();
|
output = item->uniq();
|
||||||
} else if (key.startsWith(QString("custom"))) {
|
} else if (key.startsWith(QString("custom"))) {
|
||||||
AbstractExtItem *item = extScripts->itemByTag(key, stripped);
|
AbstractExtItem *item = m_extScripts->itemByTag(key, stripped);
|
||||||
if (item)
|
if (item)
|
||||||
output = item->uniq();
|
output = item->uniq();
|
||||||
} else if (key.contains(QRegExp(QString("^hdd[rw]")))) {
|
} else if (key.contains(QRegExp(QString("^hdd[rw]")))) {
|
||||||
@ -219,17 +222,17 @@ QString AWKeyOperations::infoByKey(QString key) const
|
|||||||
output = m_devices[QString("net")]
|
output = m_devices[QString("net")]
|
||||||
[key.remove(QRegExp(QString("^(down|up)"))).toInt()];
|
[key.remove(QRegExp(QString("^(down|up)"))).toInt()];
|
||||||
} else if (key.startsWith(QString("pkgcount"))) {
|
} else if (key.startsWith(QString("pkgcount"))) {
|
||||||
AbstractExtItem *item = extUpgrade->itemByTag(key, stripped);
|
AbstractExtItem *item = m_extUpgrade->itemByTag(key, stripped);
|
||||||
if (item)
|
if (item)
|
||||||
output = item->uniq();
|
output = item->uniq();
|
||||||
} else if (key.contains(
|
} else if (key.contains(
|
||||||
QRegExp(QString("(^|perc)(ask|bid|price)(chg|)")))) {
|
QRegExp(QString("(^|perc)(ask|bid|price)(chg|)")))) {
|
||||||
AbstractExtItem *item = extQuotes->itemByTag(key, stripped);
|
AbstractExtItem *item = m_extQuotes->itemByTag(key, stripped);
|
||||||
if (item)
|
if (item)
|
||||||
output = item->uniq();
|
output = item->uniq();
|
||||||
} else if (key.contains(QRegExp(QString(
|
} else if (key.contains(QRegExp(QString(
|
||||||
"(weather|weatherId|humidity|pressure|temperature)")))) {
|
"(weather|weatherId|humidity|pressure|temperature)")))) {
|
||||||
AbstractExtItem *item = extWeather->itemByTag(key, stripped);
|
AbstractExtItem *item = m_extWeather->itemByTag(key, stripped);
|
||||||
if (item)
|
if (item)
|
||||||
output = item->uniq();
|
output = item->uniq();
|
||||||
} else if (key.startsWith(QString("temp"))) {
|
} else if (key.startsWith(QString("temp"))) {
|
||||||
@ -265,16 +268,16 @@ void AWKeyOperations::editItem(const QString type)
|
|||||||
QStringList keys = dictKeys().filter(QRegExp(
|
QStringList keys = dictKeys().filter(QRegExp(
|
||||||
QString("^(cpu(?!cl).*|gpu$|mem$|swap$|hdd[0-9].*|bat.*)")));
|
QString("^(cpu(?!cl).*|gpu$|mem$|swap$|hdd[0-9].*|bat.*)")));
|
||||||
keys.sort();
|
keys.sort();
|
||||||
graphicalItems->setConfigArgs(keys);
|
m_graphicalItems->setConfigArgs(keys);
|
||||||
return graphicalItems->editItems();
|
return m_graphicalItems->editItems();
|
||||||
} else if (type == QString("extquotes")) {
|
} else if (type == QString("extquotes")) {
|
||||||
return extQuotes->editItems();
|
return m_extQuotes->editItems();
|
||||||
} else if (type == QString("extscript")) {
|
} else if (type == QString("extscript")) {
|
||||||
return extScripts->editItems();
|
return m_extScripts->editItems();
|
||||||
} else if (type == QString("extupgrade")) {
|
} else if (type == QString("extupgrade")) {
|
||||||
return extUpgrade->editItems();
|
return m_extUpgrade->editItems();
|
||||||
} else if (type == QString("extweather")) {
|
} else if (type == QString("extweather")) {
|
||||||
return extWeather->editItems();
|
return m_extWeather->editItems();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -316,23 +319,26 @@ void AWKeyOperations::reinitKeys()
|
|||||||
{
|
{
|
||||||
// renew extensions
|
// renew extensions
|
||||||
// delete them if any
|
// delete them if any
|
||||||
delete graphicalItems;
|
delete m_graphicalItems;
|
||||||
graphicalItems = nullptr;
|
m_graphicalItems = nullptr;
|
||||||
delete extQuotes;
|
delete m_extQuotes;
|
||||||
extQuotes = nullptr;
|
m_extQuotes = nullptr;
|
||||||
delete extScripts;
|
delete m_extScripts;
|
||||||
extScripts = nullptr;
|
m_extScripts = nullptr;
|
||||||
delete extUpgrade;
|
delete m_extUpgrade;
|
||||||
extUpgrade = nullptr;
|
m_extUpgrade = nullptr;
|
||||||
delete extWeather;
|
delete m_extWeather;
|
||||||
extWeather = nullptr;
|
m_extWeather = nullptr;
|
||||||
// create
|
// create
|
||||||
graphicalItems
|
m_graphicalItems
|
||||||
= new ExtItemAggregator<GraphicalItem>(nullptr, QString("desktops"));
|
= new ExtItemAggregator<GraphicalItem>(nullptr, QString("desktops"));
|
||||||
extQuotes = new ExtItemAggregator<ExtQuotes>(nullptr, QString("quotes"));
|
m_extQuotes = new ExtItemAggregator<ExtQuotes>(nullptr, QString("quotes"));
|
||||||
extScripts = new ExtItemAggregator<ExtScript>(nullptr, QString("scripts"));
|
m_extScripts
|
||||||
extUpgrade = new ExtItemAggregator<ExtUpgrade>(nullptr, QString("upgrade"));
|
= new ExtItemAggregator<ExtScript>(nullptr, QString("scripts"));
|
||||||
extWeather = new ExtItemAggregator<ExtWeather>(nullptr, QString("weather"));
|
m_extUpgrade
|
||||||
|
= new ExtItemAggregator<ExtUpgrade>(nullptr, QString("upgrade"));
|
||||||
|
m_extWeather
|
||||||
|
= new ExtItemAggregator<ExtWeather>(nullptr, QString("weather"));
|
||||||
|
|
||||||
// init
|
// init
|
||||||
QStringList allKeys = dictKeys();
|
QStringList allKeys = dictKeys();
|
||||||
|
@ -69,11 +69,11 @@ private:
|
|||||||
void addKeyToCache(const QString type, const QString key = QString(""));
|
void addKeyToCache(const QString type, const QString key = QString(""));
|
||||||
void reinitKeys();
|
void reinitKeys();
|
||||||
// objects
|
// objects
|
||||||
ExtItemAggregator<GraphicalItem> *graphicalItems = nullptr;
|
ExtItemAggregator<GraphicalItem> *m_graphicalItems = nullptr;
|
||||||
ExtItemAggregator<ExtQuotes> *extQuotes = nullptr;
|
ExtItemAggregator<ExtQuotes> *m_extQuotes = nullptr;
|
||||||
ExtItemAggregator<ExtScript> *extScripts = nullptr;
|
ExtItemAggregator<ExtScript> *m_extScripts = nullptr;
|
||||||
ExtItemAggregator<ExtUpgrade> *extUpgrade = nullptr;
|
ExtItemAggregator<ExtUpgrade> *m_extUpgrade = nullptr;
|
||||||
ExtItemAggregator<ExtWeather> *extWeather = nullptr;
|
ExtItemAggregator<ExtWeather> *m_extWeather = nullptr;
|
||||||
// variables
|
// variables
|
||||||
QHash<QString, QStringList> m_devices;
|
QHash<QString, QStringList> m_devices;
|
||||||
QString m_pattern;
|
QString m_pattern;
|
||||||
|
@ -44,26 +44,26 @@ AWKeys::AWKeys(QObject *parent)
|
|||||||
// thread pool
|
// thread pool
|
||||||
m_threadPool = new QThreadPool(this);
|
m_threadPool = new QThreadPool(this);
|
||||||
|
|
||||||
aggregator = new AWKeysAggregator(this);
|
m_aggregator = new AWKeysAggregator(this);
|
||||||
dataAggregator = new AWDataAggregator(this);
|
m_dataAggregator = new AWDataAggregator(this);
|
||||||
dataEngineAggregator = new AWDataEngineAggregator(this);
|
m_dataEngineAggregator = new AWDataEngineAggregator(this);
|
||||||
keyOperator = new AWKeyOperations(this);
|
m_keyOperator = new AWKeyOperations(this);
|
||||||
|
|
||||||
m_timer = new QTimer(this);
|
m_timer = new QTimer(this);
|
||||||
m_timer->setSingleShot(false);
|
m_timer->setSingleShot(false);
|
||||||
|
|
||||||
// update key data if required
|
// update key data if required
|
||||||
connect(keyOperator, SIGNAL(updateKeys(QStringList)), this,
|
connect(m_keyOperator, SIGNAL(updateKeys(QStringList)), this,
|
||||||
SLOT(reinitKeys(QStringList)));
|
SLOT(reinitKeys(QStringList)));
|
||||||
connect(m_timer, SIGNAL(timeout()), this, SLOT(updateTextData()));
|
connect(m_timer, SIGNAL(timeout()), this, SLOT(updateTextData()));
|
||||||
// transfer signal from AWDataAggregator object to QML ui
|
// transfer signal from AWDataAggregator object to QML ui
|
||||||
connect(dataAggregator, SIGNAL(toolTipPainted(const QString)), this,
|
connect(m_dataAggregator, SIGNAL(toolTipPainted(const QString)), this,
|
||||||
SIGNAL(needToolTipToBeUpdated(const QString)));
|
SIGNAL(needToolTipToBeUpdated(const QString)));
|
||||||
connect(this, SIGNAL(dropSourceFromDataengine(QString)),
|
connect(this, SIGNAL(dropSourceFromDataengine(QString)),
|
||||||
dataEngineAggregator, SLOT(dropSource(QString)));
|
m_dataEngineAggregator, SLOT(dropSource(QString)));
|
||||||
// transfer signal from dataengine to update source list
|
// transfer signal from dataengine to update source list
|
||||||
connect(dataEngineAggregator, SIGNAL(deviceAdded(const QString &)),
|
connect(m_dataEngineAggregator, SIGNAL(deviceAdded(const QString &)),
|
||||||
keyOperator, SLOT(addDevice(const QString &)));
|
m_keyOperator, SLOT(addDevice(const QString &)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -75,11 +75,11 @@ AWKeys::~AWKeys()
|
|||||||
delete m_timer;
|
delete m_timer;
|
||||||
|
|
||||||
// core
|
// core
|
||||||
delete dataEngineAggregator;
|
delete m_dataEngineAggregator;
|
||||||
delete m_threadPool;
|
delete m_threadPool;
|
||||||
delete aggregator;
|
delete m_aggregator;
|
||||||
delete dataAggregator;
|
delete m_dataAggregator;
|
||||||
delete keyOperator;
|
delete m_keyOperator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ void AWKeys::initDataAggregator(const QVariantMap tooltipParams)
|
|||||||
|
|
||||||
// store parameters to generate m_requiredKeys
|
// store parameters to generate m_requiredKeys
|
||||||
m_tooltipParams = tooltipParams;
|
m_tooltipParams = tooltipParams;
|
||||||
dataAggregator->setParameters(m_tooltipParams);
|
m_dataAggregator->setParameters(m_tooltipParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -105,11 +105,11 @@ void AWKeys::initKeys(const QString currentPattern, const int interval,
|
|||||||
m_threadPool->setMaxThreadCount(limit == 0 ? QThread::idealThreadCount()
|
m_threadPool->setMaxThreadCount(limit == 0 ? QThread::idealThreadCount()
|
||||||
: limit);
|
: limit);
|
||||||
// child objects
|
// child objects
|
||||||
keyOperator->setPattern(currentPattern);
|
m_aggregator->initFormatters();
|
||||||
keyOperator->updateCache();
|
m_keyOperator->setPattern(currentPattern);
|
||||||
dataEngineAggregator->clear();
|
m_keyOperator->updateCache();
|
||||||
|
m_dataEngineAggregator->clear();
|
||||||
dataEngineAggregator->initDataEngines(interval);
|
m_dataEngineAggregator->initDataEngines(interval);
|
||||||
|
|
||||||
// timer
|
// timer
|
||||||
m_timer->setInterval(interval);
|
m_timer->setInterval(interval);
|
||||||
@ -121,7 +121,7 @@ void AWKeys::setAggregatorProperty(const QString key, const QVariant value)
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_AW) << "Key" << key << "with value" << value;
|
qCDebug(LOG_AW) << "Key" << key << "with value" << value;
|
||||||
|
|
||||||
aggregator->setProperty(key.toUtf8().constData(), value);
|
m_aggregator->setProperty(key.toUtf8().constData(), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ void AWKeys::setWrapNewLines(const bool wrap)
|
|||||||
|
|
||||||
void AWKeys::updateCache()
|
void AWKeys::updateCache()
|
||||||
{
|
{
|
||||||
return keyOperator->updateCache();
|
return m_keyOperator->updateCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ QStringList AWKeys::dictKeys(const bool sorted, const QString regexp) const
|
|||||||
qCDebug(LOG_AW) << "Should be sorted" << sorted << "and filter applied"
|
qCDebug(LOG_AW) << "Should be sorted" << sorted << "and filter applied"
|
||||||
<< regexp;
|
<< regexp;
|
||||||
|
|
||||||
QStringList allKeys = keyOperator->dictKeys();
|
QStringList allKeys = m_keyOperator->dictKeys();
|
||||||
// sort if required
|
// sort if required
|
||||||
if (sorted)
|
if (sorted)
|
||||||
allKeys.sort();
|
allKeys.sort();
|
||||||
@ -155,7 +155,7 @@ QStringList AWKeys::dictKeys(const bool sorted, const QString regexp) const
|
|||||||
|
|
||||||
QStringList AWKeys::getHddDevices() const
|
QStringList AWKeys::getHddDevices() const
|
||||||
{
|
{
|
||||||
QStringList devices = keyOperator->devices(QString("hdd"));
|
QStringList devices = m_keyOperator->devices(QString("hdd"));
|
||||||
// required by selector in the UI
|
// required by selector in the UI
|
||||||
devices.insert(0, QString("disable"));
|
devices.insert(0, QString("disable"));
|
||||||
devices.insert(0, QString("auto"));
|
devices.insert(0, QString("auto"));
|
||||||
@ -168,7 +168,7 @@ QString AWKeys::infoByKey(QString key) const
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_AW) << "Requested info for key" << key;
|
qCDebug(LOG_AW) << "Requested info for key" << key;
|
||||||
|
|
||||||
return keyOperator->infoByKey(key);
|
return m_keyOperator->infoByKey(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -178,9 +178,9 @@ QString AWKeys::valueByKey(QString key) const
|
|||||||
qCDebug(LOG_AW) << "Requested value for key" << key;
|
qCDebug(LOG_AW) << "Requested value for key" << key;
|
||||||
|
|
||||||
QString trueKey
|
QString trueKey
|
||||||
= key.startsWith(QString("bar")) ? keyOperator->infoByKey(key) : key;
|
= key.startsWith(QString("bar")) ? m_keyOperator->infoByKey(key) : key;
|
||||||
|
|
||||||
return aggregator->formatter(values[trueKey], trueKey);
|
return m_aggregator->formatter(m_values[trueKey], trueKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -188,7 +188,7 @@ void AWKeys::editItem(const QString type)
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_AW) << "Item type" << type;
|
qCDebug(LOG_AW) << "Item type" << type;
|
||||||
|
|
||||||
return keyOperator->editItem(type);
|
return m_keyOperator->editItem(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -206,15 +206,15 @@ void AWKeys::reinitKeys(const QStringList currentKeys)
|
|||||||
qCDebug(LOG_AW) << "Update found keys by using list" << currentKeys;
|
qCDebug(LOG_AW) << "Update found keys by using list" << currentKeys;
|
||||||
|
|
||||||
// append lists
|
// append lists
|
||||||
m_foundBars = AWPatternFunctions::findKeys(keyOperator->pattern(),
|
m_foundBars = AWPatternFunctions::findKeys(m_keyOperator->pattern(),
|
||||||
currentKeys, true);
|
currentKeys, true);
|
||||||
m_foundKeys = AWPatternFunctions::findKeys(keyOperator->pattern(),
|
m_foundKeys = AWPatternFunctions::findKeys(m_keyOperator->pattern(),
|
||||||
currentKeys, false);
|
currentKeys, false);
|
||||||
m_foundLambdas = AWPatternFunctions::findLambdas(keyOperator->pattern());
|
m_foundLambdas = AWPatternFunctions::findLambdas(m_keyOperator->pattern());
|
||||||
// generate list of required keys for bars
|
// generate list of required keys for bars
|
||||||
QStringList barKeys;
|
QStringList barKeys;
|
||||||
for (auto bar : m_foundBars) {
|
for (auto bar : m_foundBars) {
|
||||||
GraphicalItem *item = keyOperator->giByKey(bar);
|
GraphicalItem *item = m_keyOperator->giByKey(bar);
|
||||||
if (item->isCustom())
|
if (item->isCustom())
|
||||||
item->setUsedKeys(
|
item->setUsedKeys(
|
||||||
AWPatternFunctions::findKeys(item->bar(), currentKeys, false));
|
AWPatternFunctions::findKeys(item->bar(), currentKeys, false));
|
||||||
@ -228,8 +228,8 @@ void AWKeys::reinitKeys(const QStringList currentKeys)
|
|||||||
m_tooltipParams, currentKeys)
|
m_tooltipParams, currentKeys)
|
||||||
: QStringList();
|
: QStringList();
|
||||||
|
|
||||||
// set key data to aggregator
|
// set key data to m_aggregator
|
||||||
aggregator->setDevices(keyOperator->devices());
|
m_aggregator->setDevices(m_keyOperator->devices());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -238,11 +238,11 @@ void AWKeys::updateTextData()
|
|||||||
// do not do it in parallel to avoid race condition
|
// do not do it in parallel to avoid race condition
|
||||||
m_mutex.lock();
|
m_mutex.lock();
|
||||||
calculateValues();
|
calculateValues();
|
||||||
QString text = parsePattern(keyOperator->pattern());
|
QString text = parsePattern(m_keyOperator->pattern());
|
||||||
m_mutex.unlock();
|
m_mutex.unlock();
|
||||||
|
|
||||||
emit(needTextToBeUpdated(text));
|
emit(needTextToBeUpdated(text));
|
||||||
emit(dataAggregator->updateData(values));
|
emit(m_dataAggregator->updateData(m_values));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -251,54 +251,58 @@ void AWKeys::updateTextData()
|
|||||||
void AWKeys::calculateValues()
|
void AWKeys::calculateValues()
|
||||||
{
|
{
|
||||||
// hddtot*
|
// hddtot*
|
||||||
QStringList mountDevices = keyOperator->devices(QString("mount"));
|
QStringList mountDevices = m_keyOperator->devices(QString("mount"));
|
||||||
for (auto device : mountDevices) {
|
for (auto device : mountDevices) {
|
||||||
int index = mountDevices.indexOf(device);
|
int index = mountDevices.indexOf(device);
|
||||||
values[QString("hddtotmb%1").arg(index)]
|
m_values[QString("hddtotmb%1").arg(index)]
|
||||||
= values[QString("hddfreemb%1").arg(index)].toFloat()
|
= m_values[QString("hddfreemb%1").arg(index)].toFloat()
|
||||||
+ values[QString("hddmb%1").arg(index)].toFloat();
|
+ m_values[QString("hddmb%1").arg(index)].toFloat();
|
||||||
values[QString("hddtotgb%1").arg(index)]
|
m_values[QString("hddtotgb%1").arg(index)]
|
||||||
= values[QString("hddfreegb%1").arg(index)].toFloat()
|
= m_values[QString("hddfreegb%1").arg(index)].toFloat()
|
||||||
+ values[QString("hddgb%1").arg(index)].toFloat();
|
+ m_values[QString("hddgb%1").arg(index)].toFloat();
|
||||||
}
|
}
|
||||||
|
|
||||||
// memtot*
|
// memtot*
|
||||||
values[QString("memtotmb")] = values[QString("memusedmb")].toInt()
|
m_values[QString("memtotmb")] = m_values[QString("memusedmb")].toInt()
|
||||||
+ values[QString("memfreemb")].toInt();
|
+ m_values[QString("memfreemb")].toInt();
|
||||||
values[QString("memtotgb")] = values[QString("memusedgb")].toFloat()
|
m_values[QString("memtotgb")] = m_values[QString("memusedgb")].toFloat()
|
||||||
+ values[QString("memfreegb")].toFloat();
|
+ m_values[QString("memfreegb")].toFloat();
|
||||||
// mem
|
// mem
|
||||||
values[QString("mem")] = 100.0f * values[QString("memmb")].toFloat()
|
m_values[QString("mem")] = 100.0f * m_values[QString("memmb")].toFloat()
|
||||||
/ values[QString("memtotmb")].toFloat();
|
/ m_values[QString("memtotmb")].toFloat();
|
||||||
|
|
||||||
// up, down, upkb, downkb, upunits, downunits
|
// up, down, upkb, downkb, upunits, downunits
|
||||||
int netIndex = keyOperator->devices(QString("net"))
|
int netIndex = m_keyOperator->devices(QString("net"))
|
||||||
.indexOf(values[QString("netdev")].toString());
|
.indexOf(m_values[QString("netdev")].toString());
|
||||||
values[QString("down")] = values[QString("down%1").arg(netIndex)];
|
m_values[QString("down")] = m_values[QString("down%1").arg(netIndex)];
|
||||||
values[QString("downkb")] = values[QString("downkb%1").arg(netIndex)];
|
m_values[QString("downkb")] = m_values[QString("downkb%1").arg(netIndex)];
|
||||||
values[QString("downtotal")] = values[QString("downtotal%1").arg(netIndex)];
|
m_values[QString("downtotal")]
|
||||||
values[QString("downtotalkb")]
|
= m_values[QString("downtotal%1").arg(netIndex)];
|
||||||
= values[QString("downtotalkb%1").arg(netIndex)];
|
m_values[QString("downtotalkb")]
|
||||||
values[QString("downunits")] = values[QString("downunits%1").arg(netIndex)];
|
= m_values[QString("downtotalkb%1").arg(netIndex)];
|
||||||
values[QString("up")] = values[QString("up%1").arg(netIndex)];
|
m_values[QString("downunits")]
|
||||||
values[QString("upkb")] = values[QString("upkb%1").arg(netIndex)];
|
= m_values[QString("downunits%1").arg(netIndex)];
|
||||||
values[QString("uptotal")] = values[QString("uptotal%1").arg(netIndex)];
|
m_values[QString("up")] = m_values[QString("up%1").arg(netIndex)];
|
||||||
values[QString("uptotalkb")] = values[QString("uptotalkb%1").arg(netIndex)];
|
m_values[QString("upkb")] = m_values[QString("upkb%1").arg(netIndex)];
|
||||||
values[QString("upunits")] = values[QString("upunits%1").arg(netIndex)];
|
m_values[QString("uptotal")] = m_values[QString("uptotal%1").arg(netIndex)];
|
||||||
|
m_values[QString("uptotalkb")]
|
||||||
|
= m_values[QString("uptotalkb%1").arg(netIndex)];
|
||||||
|
m_values[QString("upunits")] = m_values[QString("upunits%1").arg(netIndex)];
|
||||||
|
|
||||||
// swaptot*
|
// swaptot*
|
||||||
values[QString("swaptotmb")] = values[QString("swapmb")].toInt()
|
m_values[QString("swaptotmb")] = m_values[QString("swapmb")].toInt()
|
||||||
+ values[QString("swapfreemb")].toInt();
|
+ m_values[QString("swapfreemb")].toInt();
|
||||||
values[QString("swaptotgb")] = values[QString("swapgb")].toFloat()
|
m_values[QString("swaptotgb")]
|
||||||
+ values[QString("swapfreegb")].toFloat();
|
= m_values[QString("swapgb")].toFloat()
|
||||||
|
+ m_values[QString("swapfreegb")].toFloat();
|
||||||
// swap
|
// swap
|
||||||
values[QString("swap")] = 100.0f * values[QString("swapmb")].toFloat()
|
m_values[QString("swap")] = 100.0f * m_values[QString("swapmb")].toFloat()
|
||||||
/ values[QString("swaptotmb")].toFloat();
|
/ m_values[QString("swaptotmb")].toFloat();
|
||||||
|
|
||||||
// lambdas
|
// lambdas
|
||||||
for (auto key : m_foundLambdas)
|
for (auto key : m_foundLambdas)
|
||||||
values[key] = AWPatternFunctions::expandLambdas(key, aggregator, values,
|
m_values[key] = AWPatternFunctions::expandLambdas(
|
||||||
m_foundKeys);
|
key, m_aggregator, m_values, m_foundKeys);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -309,27 +313,27 @@ QString AWKeys::parsePattern(QString pattern) const
|
|||||||
|
|
||||||
// lambdas
|
// lambdas
|
||||||
for (auto key : m_foundLambdas)
|
for (auto key : m_foundLambdas)
|
||||||
pattern.replace(QString("${{%1}}").arg(key), values[key].toString());
|
pattern.replace(QString("${{%1}}").arg(key), m_values[key].toString());
|
||||||
|
|
||||||
// main keys
|
// main keys
|
||||||
for (auto key : m_foundKeys)
|
for (auto key : m_foundKeys)
|
||||||
pattern.replace(QString("$%1").arg(key), [this](const QString &tag,
|
pattern.replace(QString("$%1").arg(key), [this](const QString &tag,
|
||||||
const QVariant &value) {
|
const QVariant &value) {
|
||||||
QString strValue = aggregator->formatter(value, tag);
|
QString strValue = m_aggregator->formatter(value, tag);
|
||||||
if ((!tag.startsWith(QString("custom")))
|
if ((!tag.startsWith(QString("custom")))
|
||||||
&& (!tag.startsWith(QString("weather"))))
|
&& (!tag.startsWith(QString("weather"))))
|
||||||
strValue.replace(QString(" "), QString(" "));
|
strValue.replace(QString(" "), QString(" "));
|
||||||
return strValue;
|
return strValue;
|
||||||
}(key, values[key]));
|
}(key, m_values[key]));
|
||||||
|
|
||||||
// bars
|
// bars
|
||||||
for (auto bar : m_foundBars) {
|
for (auto bar : m_foundBars) {
|
||||||
GraphicalItem *item = keyOperator->giByKey(bar);
|
GraphicalItem *item = m_keyOperator->giByKey(bar);
|
||||||
QString image
|
QString image
|
||||||
= item->isCustom()
|
= item->isCustom()
|
||||||
? item->image(AWPatternFunctions::expandLambdas(
|
? item->image(AWPatternFunctions::expandLambdas(
|
||||||
item->bar(), aggregator, values, item->usedKeys()))
|
item->bar(), m_aggregator, m_values, item->usedKeys()))
|
||||||
: item->image(values[item->bar()]);
|
: item->image(m_values[item->bar()]);
|
||||||
pattern.replace(QString("$%1").arg(bar), image);
|
pattern.replace(QString("$%1").arg(bar), image);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,9 +351,9 @@ void AWKeys::setDataBySource(const QString &sourceName, const QVariantMap &data)
|
|||||||
qCDebug(LOG_AW) << "Source" << sourceName << "with data" << data;
|
qCDebug(LOG_AW) << "Source" << sourceName << "with data" << data;
|
||||||
|
|
||||||
// first list init
|
// first list init
|
||||||
QStringList tags = aggregator->keysFromSource(sourceName);
|
QStringList tags = m_aggregator->keysFromSource(sourceName);
|
||||||
if (tags.isEmpty())
|
if (tags.isEmpty())
|
||||||
tags = aggregator->registerSource(
|
tags = m_aggregator->registerSource(
|
||||||
sourceName, data[QString("units")].toString(), m_requiredKeys);
|
sourceName, data[QString("units")].toString(), m_requiredKeys);
|
||||||
|
|
||||||
// update data or drop source if there are no matches and exit
|
// update data or drop source if there are no matches and exit
|
||||||
@ -362,9 +366,9 @@ void AWKeys::setDataBySource(const QString &sourceName, const QVariantMap &data)
|
|||||||
// HACK workaround for time values which are stored in the different path
|
// HACK workaround for time values which are stored in the different path
|
||||||
std::for_each(tags.cbegin(), tags.cend(),
|
std::for_each(tags.cbegin(), tags.cend(),
|
||||||
[this, &data, &sourceName](const QString &tag) {
|
[this, &data, &sourceName](const QString &tag) {
|
||||||
values[tag] = sourceName == QString("Local")
|
m_values[tag] = sourceName == QString("Local")
|
||||||
? data[QString("DateTime")]
|
? data[QString("DateTime")]
|
||||||
: data[QString("value")];
|
: data[QString("value")];
|
||||||
});
|
});
|
||||||
m_mutex.unlock();
|
m_mutex.unlock();
|
||||||
}
|
}
|
||||||
|
@ -79,15 +79,15 @@ private:
|
|||||||
QString parsePattern(QString pattern) const;
|
QString parsePattern(QString pattern) const;
|
||||||
void setDataBySource(const QString &sourceName, const QVariantMap &data);
|
void setDataBySource(const QString &sourceName, const QVariantMap &data);
|
||||||
// objects
|
// objects
|
||||||
AWDataAggregator *dataAggregator = nullptr;
|
AWDataAggregator *m_dataAggregator = nullptr;
|
||||||
AWDataEngineAggregator *dataEngineAggregator = nullptr;
|
AWDataEngineAggregator *m_dataEngineAggregator = nullptr;
|
||||||
AWKeysAggregator *aggregator = nullptr;
|
AWKeysAggregator *m_aggregator = nullptr;
|
||||||
AWKeyOperations *keyOperator = nullptr;
|
AWKeyOperations *m_keyOperator = nullptr;
|
||||||
QTimer *m_timer = nullptr;
|
QTimer *m_timer = nullptr;
|
||||||
// variables
|
// variables
|
||||||
QVariantMap m_tooltipParams;
|
QVariantMap m_tooltipParams;
|
||||||
QStringList m_foundBars, m_foundKeys, m_foundLambdas, m_requiredKeys;
|
QStringList m_foundBars, m_foundKeys, m_foundLambdas, m_requiredKeys;
|
||||||
QVariantHash values;
|
QVariantHash m_values;
|
||||||
bool m_optimize = false;
|
bool m_optimize = false;
|
||||||
bool m_wrapNewLines = false;
|
bool m_wrapNewLines = false;
|
||||||
// multithread features
|
// multithread features
|
||||||
|
@ -48,8 +48,6 @@ AWKeysAggregator::AWKeysAggregator(QObject *parent)
|
|||||||
m_formatter[QString("swap")] = FormatterType::Float;
|
m_formatter[QString("swap")] = FormatterType::Float;
|
||||||
m_formatter[QString("swaptotmb")] = FormatterType::MemMBFormat;
|
m_formatter[QString("swaptotmb")] = FormatterType::MemMBFormat;
|
||||||
m_formatter[QString("swaptotgb")] = FormatterType::MemGBFormat;
|
m_formatter[QString("swaptotgb")] = FormatterType::MemGBFormat;
|
||||||
|
|
||||||
m_customFormatters = new AWFormatterHelper(nullptr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -61,6 +59,14 @@ AWKeysAggregator::~AWKeysAggregator()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void AWKeysAggregator::initFormatters()
|
||||||
|
{
|
||||||
|
if (m_customFormatters)
|
||||||
|
delete m_customFormatters;
|
||||||
|
m_customFormatters = new AWFormatterHelper(nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QString AWKeysAggregator::formatter(const QVariant &data,
|
QString AWKeysAggregator::formatter(const QVariant &data,
|
||||||
const QString &key) const
|
const QString &key) const
|
||||||
{
|
{
|
||||||
@ -126,7 +132,7 @@ QString AWKeysAggregator::formatter(const QVariant &data,
|
|||||||
case FormatterType::TimeCustom:
|
case FormatterType::TimeCustom:
|
||||||
output = m_customTime;
|
output = m_customTime;
|
||||||
[&output, loc, this](const QDateTime dt) {
|
[&output, loc, this](const QDateTime dt) {
|
||||||
for (auto key : timeKeys)
|
for (auto key : m_timeKeys)
|
||||||
output.replace(QString("$%1").arg(key), loc.toString(dt, key));
|
output.replace(QString("$%1").arg(key), loc.toString(dt, key));
|
||||||
}(data.toDateTime());
|
}(data.toDateTime());
|
||||||
break;
|
break;
|
||||||
@ -170,7 +176,8 @@ QString AWKeysAggregator::formatter(const QVariant &data,
|
|||||||
output = data.toString();
|
output = data.toString();
|
||||||
break;
|
break;
|
||||||
case FormatterType::Custom:
|
case FormatterType::Custom:
|
||||||
output = m_customFormatters->convert(data, key);
|
if (m_customFormatters)
|
||||||
|
output = m_customFormatters->convert(data, key);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -574,7 +581,9 @@ QStringList AWKeysAggregator::registerSource(const QString &source,
|
|||||||
QStringList foundKeys = keysFromSource(source);
|
QStringList foundKeys = keysFromSource(source);
|
||||||
|
|
||||||
// rewrite formatters for custom ones
|
// rewrite formatters for custom ones
|
||||||
QStringList customFormattersKeys = m_customFormatters->definedFormatters();
|
QStringList customFormattersKeys;
|
||||||
|
if (m_customFormatters)
|
||||||
|
customFormattersKeys = m_customFormatters->definedFormatters();
|
||||||
qCInfo(LOG_AW) << "Looking for fprmatters" << foundKeys << "in"
|
qCInfo(LOG_AW) << "Looking for fprmatters" << foundKeys << "in"
|
||||||
<< customFormattersKeys;
|
<< customFormattersKeys;
|
||||||
for (auto key : foundKeys) {
|
for (auto key : foundKeys) {
|
||||||
|
@ -69,6 +69,7 @@ class AWKeysAggregator : public QObject
|
|||||||
public:
|
public:
|
||||||
explicit AWKeysAggregator(QObject *parent = nullptr);
|
explicit AWKeysAggregator(QObject *parent = nullptr);
|
||||||
virtual ~AWKeysAggregator();
|
virtual ~AWKeysAggregator();
|
||||||
|
void initFormatters();
|
||||||
// get methods
|
// get methods
|
||||||
QString formatter(const QVariant &data, const QString &key) const;
|
QString formatter(const QVariant &data, const QString &key) const;
|
||||||
QStringList keysFromSource(const QString &source) const;
|
QStringList keysFromSource(const QString &source) const;
|
||||||
@ -88,7 +89,7 @@ public slots:
|
|||||||
private:
|
private:
|
||||||
float temperature(const float temp) const;
|
float temperature(const float temp) const;
|
||||||
AWFormatterHelper *m_customFormatters = nullptr;
|
AWFormatterHelper *m_customFormatters = nullptr;
|
||||||
QStringList timeKeys = QString(TIME_KEYS).split(QChar(','));
|
QStringList m_timeKeys = QString(TIME_KEYS).split(QChar(','));
|
||||||
// variables
|
// variables
|
||||||
QString m_acOffline;
|
QString m_acOffline;
|
||||||
QString m_acOnline;
|
QString m_acOnline;
|
||||||
|
@ -15,6 +15,7 @@ file(GLOB SUBPROJECT_HEADER *.h ${PROJECT_TRDPARTY_DIR}/qreplytimeout/*.h)
|
|||||||
file(GLOB SUBPROJECT_UI *.ui)
|
file(GLOB SUBPROJECT_UI *.ui)
|
||||||
file(GLOB SUBPROJECT_INI *.ini)
|
file(GLOB SUBPROJECT_INI *.ini)
|
||||||
set(SUBPROJECT_CONFIGS ${CMAKE_CURRENT_SOURCE_DIR}/configs)
|
set(SUBPROJECT_CONFIGS ${CMAKE_CURRENT_SOURCE_DIR}/configs)
|
||||||
|
set(SUBPROJECT_FORMATTERS ${CMAKE_CURRENT_SOURCE_DIR}/formatters)
|
||||||
set(SUBPROJECT_GRAPHITEMS ${CMAKE_CURRENT_SOURCE_DIR}/desktops)
|
set(SUBPROJECT_GRAPHITEMS ${CMAKE_CURRENT_SOURCE_DIR}/desktops)
|
||||||
set(SUBPROJECT_QUOTES ${CMAKE_CURRENT_SOURCE_DIR}/quotes)
|
set(SUBPROJECT_QUOTES ${CMAKE_CURRENT_SOURCE_DIR}/quotes)
|
||||||
set(SUBPROJECT_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/scripts)
|
set(SUBPROJECT_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/scripts)
|
||||||
@ -32,6 +33,7 @@ target_link_libraries(${SUBPROJECT} ${Qt_LIBRARIES} ${Kf5_LIBRARIES})
|
|||||||
|
|
||||||
# install
|
# install
|
||||||
install(DIRECTORY ${SUBPROJECT_CONFIGS} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
|
install(DIRECTORY ${SUBPROJECT_CONFIGS} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
|
||||||
|
install(DIRECTORY ${SUBPROJECT_FORMATTERS} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
|
||||||
install(DIRECTORY ${SUBPROJECT_GRAPHITEMS} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
|
install(DIRECTORY ${SUBPROJECT_GRAPHITEMS} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
|
||||||
install(DIRECTORY ${SUBPROJECT_QUOTES} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
|
install(DIRECTORY ${SUBPROJECT_QUOTES} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
|
||||||
install(DIRECTORY ${SUBPROJECT_SCRIPTS} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
|
install(DIRECTORY ${SUBPROJECT_SCRIPTS} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
|
||||||
|
@ -54,7 +54,7 @@ QString AWDateTimeFormatter::convert(const QVariant &_value) const
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_LIB) << "Convert value" << _value;
|
qCDebug(LOG_LIB) << "Convert value" << _value;
|
||||||
|
|
||||||
return _value.toDateTime().toString(m_format);
|
return m_locale.toString(_value.toDateTime(), m_format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -67,6 +67,7 @@ AWDateTimeFormatter *AWDateTimeFormatter::copy(const QString _fileName,
|
|||||||
= new AWDateTimeFormatter(static_cast<QWidget *>(parent()), _fileName);
|
= new AWDateTimeFormatter(static_cast<QWidget *>(parent()), _fileName);
|
||||||
AWAbstractFormatter::copyDefaults(item);
|
AWAbstractFormatter::copyDefaults(item);
|
||||||
item->setFormat(format());
|
item->setFormat(format());
|
||||||
|
item->setTranslateString(translateString());
|
||||||
item->setNumber(_number);
|
item->setNumber(_number);
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
@ -79,6 +80,12 @@ QString AWDateTimeFormatter::format() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool AWDateTimeFormatter::translateString() const
|
||||||
|
{
|
||||||
|
return m_translate;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void AWDateTimeFormatter::setFormat(const QString _format)
|
void AWDateTimeFormatter::setFormat(const QString _format)
|
||||||
{
|
{
|
||||||
qCDebug(LOG_LIB) << "Set format" << _format;
|
qCDebug(LOG_LIB) << "Set format" << _format;
|
||||||
@ -87,6 +94,15 @@ void AWDateTimeFormatter::setFormat(const QString _format)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void AWDateTimeFormatter::setTranslateString(const bool _translate)
|
||||||
|
{
|
||||||
|
qCDebug(LOG_LIB) << "Set translate string" << _translate;
|
||||||
|
|
||||||
|
m_translate = _translate;
|
||||||
|
initLocale();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void AWDateTimeFormatter::readConfiguration()
|
void AWDateTimeFormatter::readConfiguration()
|
||||||
{
|
{
|
||||||
AWAbstractFormatter::readConfiguration();
|
AWAbstractFormatter::readConfiguration();
|
||||||
@ -95,6 +111,8 @@ void AWDateTimeFormatter::readConfiguration()
|
|||||||
|
|
||||||
settings.beginGroup(QString("Desktop Entry"));
|
settings.beginGroup(QString("Desktop Entry"));
|
||||||
setFormat(settings.value(QString("X-AW-Format"), format()).toString());
|
setFormat(settings.value(QString("X-AW-Format"), format()).toString());
|
||||||
|
setTranslateString(
|
||||||
|
settings.value(QString("X-AW-Translate"), translateString()).toBool());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
bumpApi(AWEFAPI);
|
bumpApi(AWEFAPI);
|
||||||
@ -109,14 +127,18 @@ int AWDateTimeFormatter::showConfiguration(const QVariant args)
|
|||||||
ui->lineEdit_comment->setText(comment());
|
ui->lineEdit_comment->setText(comment());
|
||||||
ui->label_typeValue->setText(QString("DateTime"));
|
ui->label_typeValue->setText(QString("DateTime"));
|
||||||
ui->lineEdit_format->setText(format());
|
ui->lineEdit_format->setText(format());
|
||||||
|
ui->checkBox_translate->setCheckState(translateString() ? Qt::Checked
|
||||||
|
: Qt::Unchecked);
|
||||||
|
|
||||||
int ret = exec();
|
int ret = exec();
|
||||||
if (ret != 1)
|
if (ret != 1)
|
||||||
return ret;
|
return ret;
|
||||||
setName(ui->lineEdit_name->text());
|
setName(ui->lineEdit_name->text());
|
||||||
setComment(ui->lineEdit_comment->text());
|
setComment(ui->lineEdit_comment->text());
|
||||||
|
setApiVersion(AWEFAPI);
|
||||||
setStrType(ui->label_typeValue->text());
|
setStrType(ui->label_typeValue->text());
|
||||||
setFormat(ui->lineEdit_format->text());
|
setFormat(ui->lineEdit_format->text());
|
||||||
|
setTranslateString(ui->checkBox_translate->checkState() == Qt::Checked);
|
||||||
|
|
||||||
writeConfiguration();
|
writeConfiguration();
|
||||||
return ret;
|
return ret;
|
||||||
@ -132,16 +154,24 @@ void AWDateTimeFormatter::writeConfiguration() const
|
|||||||
|
|
||||||
settings.beginGroup(QString("Desktop Entry"));
|
settings.beginGroup(QString("Desktop Entry"));
|
||||||
settings.setValue(QString("X-AW-Format"), format());
|
settings.setValue(QString("X-AW-Format"), format());
|
||||||
|
settings.setValue(QString("X-AW-Translate"), translateString());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
settings.sync();
|
settings.sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void AWDateTimeFormatter::initLocale()
|
||||||
|
{
|
||||||
|
m_locale = m_translate ? QLocale::system() : QLocale::c();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void AWDateTimeFormatter::translate()
|
void AWDateTimeFormatter::translate()
|
||||||
{
|
{
|
||||||
ui->label_name->setText(i18n("Name"));
|
ui->label_name->setText(i18n("Name"));
|
||||||
ui->label_comment->setText(i18n("Comment"));
|
ui->label_comment->setText(i18n("Comment"));
|
||||||
ui->label_type->setText(i18n("Type"));
|
ui->label_type->setText(i18n("Type"));
|
||||||
ui->label_format->setText(i18n("Format"));
|
ui->label_format->setText(i18n("Format"));
|
||||||
|
ui->checkBox_translate->setText(i18n("Translate strings"));
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#define AWDATETIMEFORMATTER_H
|
#define AWDATETIMEFORMATTER_H
|
||||||
|
|
||||||
#include "awabstractformatter.h"
|
#include "awabstractformatter.h"
|
||||||
|
#include <QLocale>
|
||||||
|
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
@ -30,6 +31,8 @@ class AWDateTimeFormatter : public AWAbstractFormatter
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(QString format READ format WRITE setFormat)
|
Q_PROPERTY(QString format READ format WRITE setFormat)
|
||||||
|
Q_PROPERTY(
|
||||||
|
bool translateString READ translateString WRITE setTranslateString)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AWDateTimeFormatter(QWidget *parent,
|
explicit AWDateTimeFormatter(QWidget *parent,
|
||||||
@ -39,7 +42,9 @@ public:
|
|||||||
AWDateTimeFormatter *copy(const QString _fileName, const int _number);
|
AWDateTimeFormatter *copy(const QString _fileName, const int _number);
|
||||||
// properties
|
// properties
|
||||||
QString format() const;
|
QString format() const;
|
||||||
|
bool translateString() const;
|
||||||
void setFormat(const QString _format);
|
void setFormat(const QString _format);
|
||||||
|
void setTranslateString(const bool _translate);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void readConfiguration();
|
void readConfiguration();
|
||||||
@ -48,9 +53,12 @@ public slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::AWDateTimeFormatter *ui = nullptr;
|
Ui::AWDateTimeFormatter *ui = nullptr;
|
||||||
|
void initLocale();
|
||||||
void translate();
|
void translate();
|
||||||
// properties
|
// properties
|
||||||
|
QLocale m_locale;
|
||||||
QString m_format = QString();
|
QString m_format = QString();
|
||||||
|
bool m_translate = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>420</width>
|
<width>420</width>
|
||||||
<height>157</height>
|
<height>185</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -104,6 +104,36 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="layout_translate">
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<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_translate">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Translate strings</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -236,6 +236,7 @@ int AWFloatFormatter::showConfiguration(const QVariant args)
|
|||||||
return ret;
|
return ret;
|
||||||
setName(ui->lineEdit_name->text());
|
setName(ui->lineEdit_name->text());
|
||||||
setComment(ui->lineEdit_comment->text());
|
setComment(ui->lineEdit_comment->text());
|
||||||
|
setApiVersion(AWEFAPI);
|
||||||
setStrType(ui->label_typeValue->text());
|
setStrType(ui->label_typeValue->text());
|
||||||
setFormat(ui->comboBox_format->currentText().at(0).toLatin1());
|
setFormat(ui->comboBox_format->currentText().at(0).toLatin1());
|
||||||
setPrecision(ui->spinBox_precision->value());
|
setPrecision(ui->spinBox_precision->value());
|
||||||
@ -260,7 +261,7 @@ void AWFloatFormatter::writeConfiguration() const
|
|||||||
settings.beginGroup(QString("Desktop Entry"));
|
settings.beginGroup(QString("Desktop Entry"));
|
||||||
settings.setValue(QString("X-AW-Width"), count());
|
settings.setValue(QString("X-AW-Width"), count());
|
||||||
settings.setValue(QString("X-AW-FillChar"), fillChar());
|
settings.setValue(QString("X-AW-FillChar"), fillChar());
|
||||||
settings.setValue(QString("X-AW-Format"), format());
|
settings.setValue(QString("X-AW-Format"), QString(format()));
|
||||||
settings.setValue(QString("X-AW-ForceWidth"), forceWidth());
|
settings.setValue(QString("X-AW-ForceWidth"), forceWidth());
|
||||||
settings.setValue(QString("X-AW-Multiplier"), multiplier());
|
settings.setValue(QString("X-AW-Multiplier"), multiplier());
|
||||||
settings.setValue(QString("X-AW-Precision"), precision());
|
settings.setValue(QString("X-AW-Precision"), precision());
|
||||||
|
@ -153,6 +153,7 @@ int AWListFormatter::showConfiguration(const QVariant args)
|
|||||||
return ret;
|
return ret;
|
||||||
setName(ui->lineEdit_name->text());
|
setName(ui->lineEdit_name->text());
|
||||||
setComment(ui->lineEdit_comment->text());
|
setComment(ui->lineEdit_comment->text());
|
||||||
|
setApiVersion(AWEFAPI);
|
||||||
setStrType(ui->label_typeValue->text());
|
setStrType(ui->label_typeValue->text());
|
||||||
setFilter(ui->lineEdit_filter->text());
|
setFilter(ui->lineEdit_filter->text());
|
||||||
setSeparator(ui->lineEdit_separator->text());
|
setSeparator(ui->lineEdit_separator->text());
|
||||||
|
@ -79,6 +79,7 @@ int AWNoFormatter::showConfiguration(const QVariant args)
|
|||||||
return ret;
|
return ret;
|
||||||
setName(ui->lineEdit_name->text());
|
setName(ui->lineEdit_name->text());
|
||||||
setComment(ui->lineEdit_comment->text());
|
setComment(ui->lineEdit_comment->text());
|
||||||
|
setApiVersion(AWEFAPI);
|
||||||
setStrType(ui->label_typeValue->text());
|
setStrType(ui->label_typeValue->text());
|
||||||
|
|
||||||
writeConfiguration();
|
writeConfiguration();
|
||||||
|
@ -174,6 +174,7 @@ int AWScriptFormatter::showConfiguration(const QVariant args)
|
|||||||
return ret;
|
return ret;
|
||||||
setName(ui->lineEdit_name->text());
|
setName(ui->lineEdit_name->text());
|
||||||
setComment(ui->lineEdit_comment->text());
|
setComment(ui->lineEdit_comment->text());
|
||||||
|
setApiVersion(AWEFAPI);
|
||||||
setStrType(ui->label_typeValue->text());
|
setStrType(ui->label_typeValue->text());
|
||||||
setAppendCode(ui->checkBox_appendCode->checkState() == Qt::Checked);
|
setAppendCode(ui->checkBox_appendCode->checkState() == Qt::Checked);
|
||||||
setHasReturn(ui->checkBox_hasReturn->checkState() == Qt::Checked);
|
setHasReturn(ui->checkBox_hasReturn->checkState() == Qt::Checked);
|
||||||
|
@ -154,6 +154,7 @@ int AWStringFormatter::showConfiguration(const QVariant args)
|
|||||||
return ret;
|
return ret;
|
||||||
setName(ui->lineEdit_name->text());
|
setName(ui->lineEdit_name->text());
|
||||||
setComment(ui->lineEdit_comment->text());
|
setComment(ui->lineEdit_comment->text());
|
||||||
|
setApiVersion(AWEFAPI);
|
||||||
setStrType(ui->label_typeValue->text());
|
setStrType(ui->label_typeValue->text());
|
||||||
setCount(ui->spinBox_width->value());
|
setCount(ui->spinBox_width->value());
|
||||||
setFillChar(ui->lineEdit_fill->text().at(0));
|
setFillChar(ui->lineEdit_fill->text().at(0));
|
||||||
|
@ -44,15 +44,15 @@ ExtQuotes::ExtQuotes(QWidget *parent, const QString filePath)
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
translate();
|
translate();
|
||||||
|
|
||||||
values[tag(QString("ask"))] = 0.0;
|
m_values[tag(QString("ask"))] = 0.0;
|
||||||
values[tag(QString("askchg"))] = 0.0;
|
m_values[tag(QString("askchg"))] = 0.0;
|
||||||
values[tag(QString("percaskchg"))] = 0.0;
|
m_values[tag(QString("percaskchg"))] = 0.0;
|
||||||
values[tag(QString("bid"))] = 0.0;
|
m_values[tag(QString("bid"))] = 0.0;
|
||||||
values[tag(QString("bidchg"))] = 0.0;
|
m_values[tag(QString("bidchg"))] = 0.0;
|
||||||
values[tag(QString("percbidchg"))] = 0.0;
|
m_values[tag(QString("percbidchg"))] = 0.0;
|
||||||
values[tag(QString("price"))] = 0.0;
|
m_values[tag(QString("price"))] = 0.0;
|
||||||
values[tag(QString("pricechg"))] = 0.0;
|
m_values[tag(QString("pricechg"))] = 0.0;
|
||||||
values[tag(QString("percpricechg"))] = 0.0;
|
m_values[tag(QString("percpricechg"))] = 0.0;
|
||||||
|
|
||||||
// HACK declare as child of nullptr to avoid crash with plasmawindowed
|
// HACK declare as child of nullptr to avoid crash with plasmawindowed
|
||||||
// in the destructor
|
// in the destructor
|
||||||
@ -119,36 +119,28 @@ void ExtQuotes::readConfiguration()
|
|||||||
setTicker(settings.value(QString("X-AW-Ticker"), ticker()).toString());
|
setTicker(settings.value(QString("X-AW-Ticker"), ticker()).toString());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
// update for current API
|
|
||||||
if ((apiVersion() > 0) && (apiVersion() < AWEQAPI)) {
|
|
||||||
qCWarning(LOG_LIB) << "Bump API version from" << apiVersion() << "to"
|
|
||||||
<< AWEQAPI;
|
|
||||||
setApiVersion(AWEQAPI);
|
|
||||||
writeConfiguration();
|
|
||||||
}
|
|
||||||
|
|
||||||
bumpApi(AWEQAPI);
|
bumpApi(AWEQAPI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariantHash ExtQuotes::run()
|
QVariantHash ExtQuotes::run()
|
||||||
{
|
{
|
||||||
if ((!isActive()) || (isRunning))
|
if ((!isActive()) || (m_isRunning))
|
||||||
return values;
|
return m_values;
|
||||||
|
|
||||||
if (times == 1) {
|
if (m_times == 1) {
|
||||||
qCInfo(LOG_LIB) << "Send request";
|
qCInfo(LOG_LIB) << "Send request";
|
||||||
isRunning = true;
|
m_isRunning = true;
|
||||||
QNetworkReply *reply = m_manager->get(QNetworkRequest(m_url));
|
QNetworkReply *reply = m_manager->get(QNetworkRequest(m_url));
|
||||||
new QReplyTimeout(reply, REQUEST_TIMEOUT);
|
new QReplyTimeout(reply, REQUEST_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
// update value
|
// update value
|
||||||
if (times >= interval())
|
if (m_times >= interval())
|
||||||
times = 0;
|
m_times = 0;
|
||||||
times++;
|
m_times++;
|
||||||
|
|
||||||
return values;
|
return m_values;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -199,7 +191,7 @@ void ExtQuotes::quotesReplyReceived(QNetworkReply *reply)
|
|||||||
qCDebug(LOG_LIB) << "Return code" << reply->error() << "with message"
|
qCDebug(LOG_LIB) << "Return code" << reply->error() << "with message"
|
||||||
<< reply->errorString();
|
<< reply->errorString();
|
||||||
|
|
||||||
isRunning = false;
|
m_isRunning = false;
|
||||||
QJsonParseError error;
|
QJsonParseError error;
|
||||||
QJsonDocument jsonDoc = QJsonDocument::fromJson(reply->readAll(), &error);
|
QJsonDocument jsonDoc = QJsonDocument::fromJson(reply->readAll(), &error);
|
||||||
reply->deleteLater();
|
reply->deleteLater();
|
||||||
@ -216,38 +208,38 @@ void ExtQuotes::quotesReplyReceived(QNetworkReply *reply)
|
|||||||
|
|
||||||
// ask
|
// ask
|
||||||
value = jsonQuotes[QString("Ask")].toString().toDouble();
|
value = jsonQuotes[QString("Ask")].toString().toDouble();
|
||||||
values[tag(QString("askchg"))]
|
m_values[tag(QString("askchg"))]
|
||||||
= values[tag(QString("ask"))].toDouble() == 0.0
|
= m_values[tag(QString("ask"))].toDouble() == 0.0
|
||||||
? 0.0
|
? 0.0
|
||||||
: value - values[tag(QString("ask"))].toDouble();
|
: value - m_values[tag(QString("ask"))].toDouble();
|
||||||
values[tag(QString("percaskchg"))]
|
m_values[tag(QString("percaskchg"))]
|
||||||
= 100.0 * values[tag(QString("askchg"))].toDouble()
|
= 100.0 * m_values[tag(QString("askchg"))].toDouble()
|
||||||
/ values[tag(QString("ask"))].toDouble();
|
/ m_values[tag(QString("ask"))].toDouble();
|
||||||
values[tag(QString("ask"))] = value;
|
m_values[tag(QString("ask"))] = value;
|
||||||
|
|
||||||
// bid
|
// bid
|
||||||
value = jsonQuotes[QString("Bid")].toString().toDouble();
|
value = jsonQuotes[QString("Bid")].toString().toDouble();
|
||||||
values[tag(QString("bidchg"))]
|
m_values[tag(QString("bidchg"))]
|
||||||
= values[tag(QString("bid"))].toDouble() == 0.0
|
= m_values[tag(QString("bid"))].toDouble() == 0.0
|
||||||
? 0.0
|
? 0.0
|
||||||
: value - values[tag(QString("bid"))].toDouble();
|
: value - m_values[tag(QString("bid"))].toDouble();
|
||||||
values[tag(QString("percbidchg"))]
|
m_values[tag(QString("percbidchg"))]
|
||||||
= 100.0 * values[tag(QString("bidchg"))].toDouble()
|
= 100.0 * m_values[tag(QString("bidchg"))].toDouble()
|
||||||
/ values[tag(QString("bid"))].toDouble();
|
/ m_values[tag(QString("bid"))].toDouble();
|
||||||
values[tag(QString("bid"))] = value;
|
m_values[tag(QString("bid"))] = value;
|
||||||
|
|
||||||
// last trade
|
// last trade
|
||||||
value = jsonQuotes[QString("LastTradePriceOnly")].toString().toDouble();
|
value = jsonQuotes[QString("LastTradePriceOnly")].toString().toDouble();
|
||||||
values[tag(QString("pricechg"))]
|
m_values[tag(QString("pricechg"))]
|
||||||
= values[tag(QString("price"))].toDouble() == 0.0
|
= m_values[tag(QString("price"))].toDouble() == 0.0
|
||||||
? 0.0
|
? 0.0
|
||||||
: value - values[tag(QString("price"))].toDouble();
|
: value - m_values[tag(QString("price"))].toDouble();
|
||||||
values[tag(QString("percpricechg"))]
|
m_values[tag(QString("percpricechg"))]
|
||||||
= 100.0 * values[tag(QString("pricechg"))].toDouble()
|
= 100.0 * m_values[tag(QString("pricechg"))].toDouble()
|
||||||
/ values[tag(QString("price"))].toDouble();
|
/ m_values[tag(QString("price"))].toDouble();
|
||||||
values[tag(QString("price"))] = value;
|
m_values[tag(QString("price"))] = value;
|
||||||
|
|
||||||
emit(dataReceived(values));
|
emit(dataReceived(m_values));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,15 +59,15 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
QNetworkAccessManager *m_manager = nullptr;
|
QNetworkAccessManager *m_manager = nullptr;
|
||||||
QUrl m_url;
|
QUrl m_url;
|
||||||
bool isRunning = false;
|
bool m_isRunning = false;
|
||||||
Ui::ExtQuotes *ui = nullptr;
|
Ui::ExtQuotes *ui = nullptr;
|
||||||
void initUrl();
|
void initUrl();
|
||||||
void translate();
|
void translate();
|
||||||
// properties
|
// properties
|
||||||
QString m_ticker = QString("EURUSD=X");
|
QString m_ticker = QString("EURUSD=X");
|
||||||
// values
|
// values
|
||||||
int times = 0;
|
int m_times = 0;
|
||||||
QVariantHash values;
|
QVariantHash m_values;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,12 +42,12 @@ ExtScript::ExtScript(QWidget *parent, const QString filePath)
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
translate();
|
translate();
|
||||||
|
|
||||||
value[tag(QString("custom"))] = QString("");
|
m_values[tag(QString("custom"))] = QString("");
|
||||||
|
|
||||||
process = new QProcess(nullptr);
|
m_process = new QProcess(nullptr);
|
||||||
connect(process, SIGNAL(finished(int, QProcess::ExitStatus)), this,
|
connect(m_process, SIGNAL(finished(int, QProcess::ExitStatus)), this,
|
||||||
SLOT(updateValue()));
|
SLOT(updateValue()));
|
||||||
process->waitForFinished(0);
|
m_process->waitForFinished(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -55,8 +55,8 @@ ExtScript::~ExtScript()
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
process->kill();
|
m_process->kill();
|
||||||
process->deleteLater();
|
m_process->deleteLater();
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,7 +184,7 @@ QString ExtScript::applyFilters(QString _value) const
|
|||||||
|
|
||||||
for (auto filt : filters()) {
|
for (auto filt : filters()) {
|
||||||
qCInfo(LOG_LIB) << "Found filter" << filt;
|
qCInfo(LOG_LIB) << "Found filter" << filt;
|
||||||
QVariantMap filter = jsonFilters[filt].toMap();
|
QVariantMap filter = m_jsonFilters[filt].toMap();
|
||||||
if (filter.isEmpty()) {
|
if (filter.isEmpty()) {
|
||||||
qCWarning(LOG_LIB) << "Could not find filter" << _value
|
qCWarning(LOG_LIB) << "Could not find filter" << _value
|
||||||
<< "in the json";
|
<< "in the json";
|
||||||
@ -254,35 +254,35 @@ void ExtScript::readJsonFilters()
|
|||||||
qCWarning(LOG_LIB) << "Parse error" << error.errorString();
|
qCWarning(LOG_LIB) << "Parse error" << error.errorString();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
jsonFilters = jsonDoc.toVariant().toMap();
|
m_jsonFilters = jsonDoc.toVariant().toMap();
|
||||||
|
|
||||||
qCInfo(LOG_LIB) << "Filters" << jsonFilters;
|
qCInfo(LOG_LIB) << "Filters" << m_jsonFilters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariantHash ExtScript::run()
|
QVariantHash ExtScript::run()
|
||||||
{
|
{
|
||||||
if (!isActive())
|
if (!isActive())
|
||||||
return value;
|
return m_values;
|
||||||
if (process->state() != QProcess::NotRunning)
|
if (m_process->state() != QProcess::NotRunning)
|
||||||
qCWarning(LOG_LIB) << "Another process is already running"
|
qCWarning(LOG_LIB) << "Another process is already running"
|
||||||
<< process->state();
|
<< m_process->state();
|
||||||
|
|
||||||
if ((times == 1) && (process->state() == QProcess::NotRunning)) {
|
if ((m_times == 1) && (m_process->state() == QProcess::NotRunning)) {
|
||||||
QStringList cmdList;
|
QStringList cmdList;
|
||||||
if (!prefix().isEmpty())
|
if (!prefix().isEmpty())
|
||||||
cmdList.append(prefix());
|
cmdList.append(prefix());
|
||||||
cmdList.append(executable());
|
cmdList.append(executable());
|
||||||
qCInfo(LOG_LIB) << "Run cmd" << cmdList.join(QChar(' '));
|
qCInfo(LOG_LIB) << "Run cmd" << cmdList.join(QChar(' '));
|
||||||
process->start(cmdList.join(QChar(' ')));
|
m_process->start(cmdList.join(QChar(' ')));
|
||||||
}
|
}
|
||||||
|
|
||||||
// update value
|
// update value
|
||||||
if (times >= interval())
|
if (m_times >= interval())
|
||||||
times = 0;
|
m_times = 0;
|
||||||
times++;
|
m_times++;
|
||||||
|
|
||||||
return value;
|
return m_values;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -352,13 +352,13 @@ void ExtScript::writeConfiguration() const
|
|||||||
|
|
||||||
void ExtScript::updateValue()
|
void ExtScript::updateValue()
|
||||||
{
|
{
|
||||||
qCInfo(LOG_LIB) << "Cmd returns" << process->exitCode();
|
qCInfo(LOG_LIB) << "Cmd returns" << m_process->exitCode();
|
||||||
QString qdebug = QTextCodec::codecForMib(106)
|
QString qdebug = QTextCodec::codecForMib(106)
|
||||||
->toUnicode(process->readAllStandardError())
|
->toUnicode(m_process->readAllStandardError())
|
||||||
.trimmed();
|
.trimmed();
|
||||||
qCInfo(LOG_LIB) << "Error" << qdebug;
|
qCInfo(LOG_LIB) << "Error" << qdebug;
|
||||||
QString qoutput = QTextCodec::codecForMib(106)
|
QString qoutput = QTextCodec::codecForMib(106)
|
||||||
->toUnicode(process->readAllStandardOutput())
|
->toUnicode(m_process->readAllStandardOutput())
|
||||||
.trimmed();
|
.trimmed();
|
||||||
qCInfo(LOG_LIB) << "Output" << qoutput;
|
qCInfo(LOG_LIB) << "Output" << qoutput;
|
||||||
QString strValue;
|
QString strValue;
|
||||||
@ -378,8 +378,8 @@ void ExtScript::updateValue()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// filters
|
// filters
|
||||||
value[tag(QString("custom"))] = applyFilters(strValue);
|
m_values[tag(QString("custom"))] = applyFilters(strValue);
|
||||||
emit(dataReceived(value));
|
emit(dataReceived(m_values));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ private slots:
|
|||||||
void updateValue();
|
void updateValue();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QProcess *process = nullptr;
|
QProcess *m_process = nullptr;
|
||||||
Ui::ExtScript *ui = nullptr;
|
Ui::ExtScript *ui = nullptr;
|
||||||
void translate();
|
void translate();
|
||||||
// properties
|
// properties
|
||||||
@ -85,9 +85,9 @@ private:
|
|||||||
QString m_prefix = QString("");
|
QString m_prefix = QString("");
|
||||||
Redirect m_redirect = Redirect::nothing;
|
Redirect m_redirect = Redirect::nothing;
|
||||||
// internal properties
|
// internal properties
|
||||||
QVariantMap jsonFilters = QVariantMap();
|
QVariantMap m_jsonFilters = QVariantMap();
|
||||||
int times = 0;
|
int m_times = 0;
|
||||||
QVariantHash value;
|
QVariantHash m_values;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,11 +39,11 @@ ExtUpgrade::ExtUpgrade(QWidget *parent, const QString filePath)
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
translate();
|
translate();
|
||||||
|
|
||||||
value[tag(QString("pkgcount"))] = 0;
|
m_values[tag(QString("pkgcount"))] = 0;
|
||||||
|
|
||||||
process = new QProcess(nullptr);
|
m_process = new QProcess(nullptr);
|
||||||
connect(process, SIGNAL(finished(int)), this, SLOT(updateValue()));
|
connect(m_process, SIGNAL(finished(int)), this, SLOT(updateValue()));
|
||||||
process->waitForFinished(0);
|
m_process->waitForFinished(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -51,8 +51,8 @@ ExtUpgrade::~ExtUpgrade()
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
process->kill();
|
m_process->kill();
|
||||||
process->deleteLater();
|
m_process->deleteLater();
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,20 +143,20 @@ void ExtUpgrade::readConfiguration()
|
|||||||
QVariantHash ExtUpgrade::run()
|
QVariantHash ExtUpgrade::run()
|
||||||
{
|
{
|
||||||
if (!isActive())
|
if (!isActive())
|
||||||
return value;
|
return m_values;
|
||||||
|
|
||||||
if ((times == 1) && (process->state() == QProcess::NotRunning)) {
|
if ((m_times == 1) && (m_process->state() == QProcess::NotRunning)) {
|
||||||
QString cmd = QString("sh -c \"%1\"").arg(executable());
|
QString cmd = QString("sh -c \"%1\"").arg(executable());
|
||||||
qCInfo(LOG_LIB) << "Run cmd" << cmd;
|
qCInfo(LOG_LIB) << "Run cmd" << cmd;
|
||||||
process->start(cmd);
|
m_process->start(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
// update value
|
// update value
|
||||||
if (times >= interval())
|
if (m_times >= interval())
|
||||||
times = 0;
|
m_times = 0;
|
||||||
times++;
|
m_times++;
|
||||||
|
|
||||||
return value;
|
return m_values;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -211,13 +211,13 @@ void ExtUpgrade::writeConfiguration() const
|
|||||||
|
|
||||||
void ExtUpgrade::updateValue()
|
void ExtUpgrade::updateValue()
|
||||||
{
|
{
|
||||||
qCInfo(LOG_LIB) << "Cmd returns" << process->exitCode();
|
qCInfo(LOG_LIB) << "Cmd returns" << m_process->exitCode();
|
||||||
qCInfo(LOG_LIB) << "Error" << process->readAllStandardError();
|
qCInfo(LOG_LIB) << "Error" << m_process->readAllStandardError();
|
||||||
|
|
||||||
QString qoutput = QTextCodec::codecForMib(106)
|
QString qoutput = QTextCodec::codecForMib(106)
|
||||||
->toUnicode(process->readAllStandardOutput())
|
->toUnicode(m_process->readAllStandardOutput())
|
||||||
.trimmed();
|
.trimmed();
|
||||||
value[tag(QString("pkgcount"))] = [this](QString output) {
|
m_values[tag(QString("pkgcount"))] = [this](QString output) {
|
||||||
return filter().isEmpty()
|
return filter().isEmpty()
|
||||||
? output.split(QChar('\n'), QString::SkipEmptyParts).count()
|
? output.split(QChar('\n'), QString::SkipEmptyParts).count()
|
||||||
- null()
|
- null()
|
||||||
@ -226,7 +226,7 @@ void ExtUpgrade::updateValue()
|
|||||||
.count();
|
.count();
|
||||||
}(qoutput);
|
}(qoutput);
|
||||||
|
|
||||||
emit(dataReceived(value));
|
emit(dataReceived(m_values));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ private slots:
|
|||||||
void updateValue();
|
void updateValue();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QProcess *process = nullptr;
|
QProcess *m_process = nullptr;
|
||||||
Ui::ExtUpgrade *ui = nullptr;
|
Ui::ExtUpgrade *ui = nullptr;
|
||||||
void translate();
|
void translate();
|
||||||
// properties
|
// properties
|
||||||
@ -67,8 +67,8 @@ private:
|
|||||||
QString m_filter = QString("");
|
QString m_filter = QString("");
|
||||||
int m_null = 0;
|
int m_null = 0;
|
||||||
// internal properties
|
// internal properties
|
||||||
int times = 0;
|
int m_times = 0;
|
||||||
QVariantHash value;
|
QVariantHash m_values;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,11 +47,11 @@ ExtWeather::ExtWeather(QWidget *parent, const QString filePath)
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
translate();
|
translate();
|
||||||
|
|
||||||
values[tag(QString("weatherId"))] = 0;
|
m_values[tag(QString("weatherId"))] = 0;
|
||||||
values[tag(QString("weather"))] = QString("");
|
m_values[tag(QString("weather"))] = QString("");
|
||||||
values[tag(QString("humidity"))] = 0;
|
m_values[tag(QString("humidity"))] = 0;
|
||||||
values[tag(QString("pressure"))] = 0.0;
|
m_values[tag(QString("pressure"))] = 0.0;
|
||||||
values[tag(QString("temperature"))] = 0.0;
|
m_values[tag(QString("temperature"))] = 0.0;
|
||||||
|
|
||||||
// HACK declare as child of nullptr to avoid crash with plasmawindowed
|
// HACK declare as child of nullptr to avoid crash with plasmawindowed
|
||||||
// in the destructor
|
// in the destructor
|
||||||
@ -259,23 +259,23 @@ void ExtWeather::readJsonMap()
|
|||||||
|
|
||||||
QVariantHash ExtWeather::run()
|
QVariantHash ExtWeather::run()
|
||||||
{
|
{
|
||||||
if ((!isActive()) || (isRunning))
|
if ((!isActive()) || (m_isRunning))
|
||||||
return values;
|
return m_values;
|
||||||
|
|
||||||
if (times == 1) {
|
if (m_times == 1) {
|
||||||
qCInfo(LOG_LIB) << "Send request";
|
qCInfo(LOG_LIB) << "Send request";
|
||||||
isRunning = true;
|
m_isRunning = true;
|
||||||
QNetworkReply *reply
|
QNetworkReply *reply
|
||||||
= m_manager->get(QNetworkRequest(m_providerObject->url()));
|
= m_manager->get(QNetworkRequest(m_providerObject->url()));
|
||||||
new QReplyTimeout(reply, REQUEST_TIMEOUT);
|
new QReplyTimeout(reply, REQUEST_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
// update value
|
// update value
|
||||||
if (times >= interval())
|
if (m_times >= interval())
|
||||||
times = 0;
|
m_times = 0;
|
||||||
times++;
|
m_times++;
|
||||||
|
|
||||||
return values;
|
return m_values;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -339,7 +339,7 @@ void ExtWeather::weatherReplyReceived(QNetworkReply *reply)
|
|||||||
qCDebug(LOG_LIB) << "Return code" << reply->error() << "with message"
|
qCDebug(LOG_LIB) << "Return code" << reply->error() << "with message"
|
||||||
<< reply->errorString();
|
<< reply->errorString();
|
||||||
|
|
||||||
isRunning = false;
|
m_isRunning = false;
|
||||||
QJsonParseError error;
|
QJsonParseError error;
|
||||||
QJsonDocument jsonDoc = QJsonDocument::fromJson(reply->readAll(), &error);
|
QJsonDocument jsonDoc = QJsonDocument::fromJson(reply->readAll(), &error);
|
||||||
reply->deleteLater();
|
reply->deleteLater();
|
||||||
@ -352,11 +352,11 @@ void ExtWeather::weatherReplyReceived(QNetworkReply *reply)
|
|||||||
QVariantHash data = m_providerObject->parse(jsonDoc.toVariant().toMap());
|
QVariantHash data = m_providerObject->parse(jsonDoc.toVariant().toMap());
|
||||||
if (data.isEmpty())
|
if (data.isEmpty())
|
||||||
return;
|
return;
|
||||||
values = data;
|
m_values = data;
|
||||||
values[tag(QString("weather"))]
|
m_values[tag(QString("weather"))]
|
||||||
= weatherFromInt(values[tag(QString("weatherId"))].toInt());
|
= weatherFromInt(m_values[tag(QString("weatherId"))].toInt());
|
||||||
|
|
||||||
emit(dataReceived(values));
|
emit(dataReceived(m_values));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
QNetworkAccessManager *m_manager = nullptr;
|
QNetworkAccessManager *m_manager = nullptr;
|
||||||
AbstractWeatherProvider *m_providerObject = nullptr;
|
AbstractWeatherProvider *m_providerObject = nullptr;
|
||||||
bool isRunning = false;
|
bool m_isRunning = false;
|
||||||
Ui::ExtWeather *ui = nullptr;
|
Ui::ExtWeather *ui = nullptr;
|
||||||
void initProvider();
|
void initProvider();
|
||||||
void translate();
|
void translate();
|
||||||
@ -87,8 +87,8 @@ private:
|
|||||||
int m_ts = 0;
|
int m_ts = 0;
|
||||||
QVariantMap m_jsonMap = QVariantMap();
|
QVariantMap m_jsonMap = QVariantMap();
|
||||||
// values
|
// values
|
||||||
int times = 0;
|
int m_times = 0;
|
||||||
QVariantHash values;
|
QVariantHash m_values;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
16
sources/awesomewidgets/formatters/default-float.desktop
Normal file
16
sources/awesomewidgets/formatters/default-float.desktop
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
[Desktop%20Entry]
|
||||||
|
Comment=Default float formatter
|
||||||
|
Encoding=UTF-8
|
||||||
|
Name=Float
|
||||||
|
X-AW-Active=true
|
||||||
|
X-AW-ApiVersion=2
|
||||||
|
X-AW-FillChar=@Variant(\0\0\0\a\0\0)
|
||||||
|
X-AW-ForceWidth=false
|
||||||
|
X-AW-Format=f
|
||||||
|
X-AW-Interval=1
|
||||||
|
X-AW-Multiplier=1
|
||||||
|
X-AW-Number=0
|
||||||
|
X-AW-Precision=1
|
||||||
|
X-AW-Summand=0
|
||||||
|
X-AW-Type=Float
|
||||||
|
X-AW-Width=5
|
16
sources/awesomewidgets/formatters/default-integer.desktop
Normal file
16
sources/awesomewidgets/formatters/default-integer.desktop
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
[Desktop%20Entry]
|
||||||
|
Comment=Default integer formatter
|
||||||
|
Encoding=UTF-8
|
||||||
|
Name=Integer
|
||||||
|
X-AW-Active=true
|
||||||
|
X-AW-ApiVersion=2
|
||||||
|
X-AW-FillChar=@Variant(\0\0\0\a\0\0)
|
||||||
|
X-AW-ForceWidth=false
|
||||||
|
X-AW-Format=f
|
||||||
|
X-AW-Interval=1
|
||||||
|
X-AW-Multiplier=1
|
||||||
|
X-AW-Number=2
|
||||||
|
X-AW-Precision=0
|
||||||
|
X-AW-Summand=0
|
||||||
|
X-AW-Type=Float
|
||||||
|
X-AW-Width=4
|
12
sources/awesomewidgets/formatters/default-list.desktop
Normal file
12
sources/awesomewidgets/formatters/default-list.desktop
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[Desktop%20Entry]
|
||||||
|
Comment=Default list formatter
|
||||||
|
Encoding=UTF-8
|
||||||
|
Name=List
|
||||||
|
X-AW-Active=true
|
||||||
|
X-AW-ApiVersion=2
|
||||||
|
X-AW-Filter=
|
||||||
|
X-AW-Interval=1
|
||||||
|
X-AW-Number=5
|
||||||
|
X-AW-Separator=","
|
||||||
|
X-AW-Sort=false
|
||||||
|
X-AW-Type=NoFormat
|
16
sources/awesomewidgets/formatters/float-two-symbols.desktop
Normal file
16
sources/awesomewidgets/formatters/float-two-symbols.desktop
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
[Desktop%20Entry]
|
||||||
|
Comment=Float formatter with two symbols
|
||||||
|
Encoding=UTF-8
|
||||||
|
Name=FloatTwoSymbols
|
||||||
|
X-AW-Active=true
|
||||||
|
X-AW-ApiVersion=2
|
||||||
|
X-AW-FillChar=@Variant(\0\0\0\a\0\0)
|
||||||
|
X-AW-ForceWidth=false
|
||||||
|
X-AW-Format=f
|
||||||
|
X-AW-Interval=1
|
||||||
|
X-AW-Multiplier=1
|
||||||
|
X-AW-Number=1
|
||||||
|
X-AW-Precision=2
|
||||||
|
X-AW-Summand=0
|
||||||
|
X-AW-Type=Float
|
||||||
|
X-AW-Width=5
|
16
sources/awesomewidgets/formatters/long-integer.desktop
Normal file
16
sources/awesomewidgets/formatters/long-integer.desktop
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
[Desktop%20Entry]
|
||||||
|
Comment=Long integer formatter
|
||||||
|
Encoding=UTF-8
|
||||||
|
Name=LongInteger
|
||||||
|
X-AW-Active=true
|
||||||
|
X-AW-ApiVersion=2
|
||||||
|
X-AW-FillChar=@Variant(\0\0\0\a\0\0)
|
||||||
|
X-AW-ForceWidth=false
|
||||||
|
X-AW-Format=f
|
||||||
|
X-AW-Interval=1
|
||||||
|
X-AW-Multiplier=1
|
||||||
|
X-AW-Number=3
|
||||||
|
X-AW-Precision=0
|
||||||
|
X-AW-Summand=0
|
||||||
|
X-AW-Type=Float
|
||||||
|
X-AW-Width=5
|
16
sources/awesomewidgets/formatters/memory-gb.desktop
Normal file
16
sources/awesomewidgets/formatters/memory-gb.desktop
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
[Desktop%20Entry]
|
||||||
|
Comment=Memory in GB formatter
|
||||||
|
Encoding=UTF-8
|
||||||
|
Name=MemGB
|
||||||
|
X-AW-Active=true
|
||||||
|
X-AW-ApiVersion=2
|
||||||
|
X-AW-FillChar=@Variant(\0\0\0\a\0\0)
|
||||||
|
X-AW-ForceWidth=false
|
||||||
|
X-AW-Format=f
|
||||||
|
X-AW-Interval=1
|
||||||
|
X-AW-Multiplier=1048576
|
||||||
|
X-AW-Number=6
|
||||||
|
X-AW-Precision=1
|
||||||
|
X-AW-Summand=0
|
||||||
|
X-AW-Type=Float
|
||||||
|
X-AW-Width=5
|
16
sources/awesomewidgets/formatters/memory-mb.desktop
Normal file
16
sources/awesomewidgets/formatters/memory-mb.desktop
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
[Desktop%20Entry]
|
||||||
|
Comment=Memory in MB formatter
|
||||||
|
Encoding=UTF-8
|
||||||
|
Name=MemMB
|
||||||
|
X-AW-Active=true
|
||||||
|
X-AW-ApiVersion=2
|
||||||
|
X-AW-FillChar=@Variant(\0\0\0\a\0\0)
|
||||||
|
X-AW-ForceWidth=false
|
||||||
|
X-AW-Format=f
|
||||||
|
X-AW-Interval=1
|
||||||
|
X-AW-Multiplier=1024
|
||||||
|
X-AW-Number=7
|
||||||
|
X-AW-Precision=0
|
||||||
|
X-AW-Summand=0
|
||||||
|
X-AW-Type=Float
|
||||||
|
X-AW-Width=5
|
16
sources/awesomewidgets/formatters/short-integer.desktop
Normal file
16
sources/awesomewidgets/formatters/short-integer.desktop
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
[Desktop%20Entry]
|
||||||
|
Comment=Short integer formatter
|
||||||
|
Encoding=UTF-8
|
||||||
|
Name=ShortInteger
|
||||||
|
X-AW-Active=true
|
||||||
|
X-AW-ApiVersion=2
|
||||||
|
X-AW-FillChar=@Variant(\0\0\0\a\0\0)
|
||||||
|
X-AW-ForceWidth=false
|
||||||
|
X-AW-Format=f
|
||||||
|
X-AW-Interval=1
|
||||||
|
X-AW-Multiplier=1
|
||||||
|
X-AW-Number=4
|
||||||
|
X-AW-Precision=0
|
||||||
|
X-AW-Summand=0
|
||||||
|
X-AW-Type=Float
|
||||||
|
X-AW-Width=3
|
@ -27,6 +27,8 @@ class QGraphicsScene;
|
|||||||
|
|
||||||
class GraphicalItemHelper : public QObject
|
class GraphicalItemHelper : public QObject
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit GraphicalItemHelper(QObject *parent = nullptr,
|
explicit GraphicalItemHelper(QObject *parent = nullptr,
|
||||||
QGraphicsScene *scene = nullptr);
|
QGraphicsScene *scene = nullptr);
|
||||||
|
@ -20,12 +20,16 @@
|
|||||||
|
|
||||||
#include "abstractweatherprovider.h"
|
#include "abstractweatherprovider.h"
|
||||||
|
|
||||||
|
// we are using own server to pass requests to OpenWeatherMap because it
|
||||||
|
// requires specific APPID which belongs to developer not user
|
||||||
#define OWM_WEATHER_URL "http://arcanis.me/weather"
|
#define OWM_WEATHER_URL "http://arcanis.me/weather"
|
||||||
#define OWM_FORECAST_URL "http://arcanis.me/forecast"
|
#define OWM_FORECAST_URL "http://arcanis.me/forecast"
|
||||||
|
|
||||||
|
|
||||||
class OWMWeatherProvider : public AbstractWeatherProvider
|
class OWMWeatherProvider : public AbstractWeatherProvider
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit OWMWeatherProvider(QObject *parent, const int number);
|
explicit OWMWeatherProvider(QObject *parent, const int number);
|
||||||
virtual ~OWMWeatherProvider();
|
virtual ~OWMWeatherProvider();
|
||||||
|
@ -28,6 +28,8 @@
|
|||||||
|
|
||||||
class YahooWeatherProvider : public AbstractWeatherProvider
|
class YahooWeatherProvider : public AbstractWeatherProvider
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit YahooWeatherProvider(QObject *parent, const int number);
|
explicit YahooWeatherProvider(QObject *parent, const int number);
|
||||||
virtual ~YahooWeatherProvider();
|
virtual ~YahooWeatherProvider();
|
||||||
|
@ -20,7 +20,7 @@ X-Plasma-RemoteLocation=
|
|||||||
X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis
|
X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis
|
||||||
X-KDE-PluginInfo-Email=esalexeev@gmail.com
|
X-KDE-PluginInfo-Email=esalexeev@gmail.com
|
||||||
X-KDE-PluginInfo-Name=org.kde.plasma.desktoppanel
|
X-KDE-PluginInfo-Name=org.kde.plasma.desktoppanel
|
||||||
X-KDE-PluginInfo-Version=3.1.2
|
X-KDE-PluginInfo-Version=3.2.1
|
||||||
X-KDE-PluginInfo-Website=https://arcanis.me/projects/awesome-widgets/
|
X-KDE-PluginInfo-Website=https://arcanis.me/projects/awesome-widgets/
|
||||||
X-KDE-PluginInfo-Category=System Information
|
X-KDE-PluginInfo-Category=System Information
|
||||||
X-KDE-PluginInfo-Depends=
|
X-KDE-PluginInfo-Depends=
|
||||||
|
@ -41,9 +41,9 @@ ExtendedSysMon::ExtendedSysMon(QObject *parent, const QVariantList &args)
|
|||||||
readConfiguration();
|
readConfiguration();
|
||||||
|
|
||||||
// init aggregator
|
// init aggregator
|
||||||
aggregator = new ExtSysMonAggregator(this, configuration);
|
m_aggregator = new ExtSysMonAggregator(this, m_configuration);
|
||||||
for (auto source : aggregator->sources())
|
for (auto source : m_aggregator->sources())
|
||||||
setData(source, aggregator->initialData(source));
|
setData(source, m_aggregator->initialData(source));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -51,13 +51,13 @@ ExtendedSysMon::~ExtendedSysMon()
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
delete aggregator;
|
delete m_aggregator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QStringList ExtendedSysMon::sources() const
|
QStringList ExtendedSysMon::sources() const
|
||||||
{
|
{
|
||||||
return aggregator->sources();
|
return m_aggregator->sources();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -73,8 +73,8 @@ bool ExtendedSysMon::updateSourceEvent(const QString &source)
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_ESM) << "Source" << source;
|
qCDebug(LOG_ESM) << "Source" << source;
|
||||||
|
|
||||||
if (aggregator->hasSource(source)) {
|
if (m_aggregator->hasSource(source)) {
|
||||||
QVariant data = aggregator->data(source);
|
QVariant data = m_aggregator->data(source);
|
||||||
if (data.isNull())
|
if (data.isNull())
|
||||||
return false;
|
return false;
|
||||||
setData(source, QString("value"), data);
|
setData(source, QString("value"), data);
|
||||||
@ -121,7 +121,7 @@ void ExtendedSysMon::readConfiguration()
|
|||||||
= settings.value(QString("PLAYERSYMBOLS"), QString("10")).toString();
|
= settings.value(QString("PLAYERSYMBOLS"), QString("10")).toString();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
configuration = updateConfiguration(rawConfig);
|
m_configuration = updateConfiguration(rawConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,8 +38,8 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// configuration
|
// configuration
|
||||||
ExtSysMonAggregator *aggregator = nullptr;
|
ExtSysMonAggregator *m_aggregator = nullptr;
|
||||||
QHash<QString, QString> configuration;
|
QHash<QString, QString> m_configuration;
|
||||||
// methods
|
// methods
|
||||||
void readConfiguration();
|
void readConfiguration();
|
||||||
QHash<QString, QString>
|
QHash<QString, QString>
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
class BatterySource : public AbstractExtSysMonSource
|
class BatterySource : public AbstractExtSysMonSource
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit BatterySource(QObject *parent, const QStringList args);
|
explicit BatterySource(QObject *parent, const QStringList args);
|
||||||
virtual ~BatterySource();
|
virtual ~BatterySource();
|
||||||
|
@ -28,7 +28,8 @@ CustomSource::CustomSource(QObject *parent, const QStringList args)
|
|||||||
Q_ASSERT(args.count() == 0);
|
Q_ASSERT(args.count() == 0);
|
||||||
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
extScripts = new ExtItemAggregator<ExtScript>(nullptr, QString("scripts"));
|
m_extScripts
|
||||||
|
= new ExtItemAggregator<ExtScript>(nullptr, QString("scripts"));
|
||||||
m_sources = getSources();
|
m_sources = getSources();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +38,7 @@ CustomSource::~CustomSource()
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
delete extScripts;
|
delete m_extScripts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -46,7 +47,7 @@ QVariant CustomSource::data(QString source)
|
|||||||
qCDebug(LOG_ESS) << "Source" << source;
|
qCDebug(LOG_ESS) << "Source" << source;
|
||||||
|
|
||||||
// there are only one value
|
// there are only one value
|
||||||
return extScripts->itemByTagNumber(index(source))->run().values().first();
|
return m_extScripts->itemByTagNumber(index(source))->run().values().first();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -59,7 +60,7 @@ QVariantMap CustomSource::initialData(QString source) const
|
|||||||
data[QString("max")] = QString("");
|
data[QString("max")] = QString("");
|
||||||
data[QString("name")]
|
data[QString("name")]
|
||||||
= QString("Custom command '%1' output")
|
= QString("Custom command '%1' output")
|
||||||
.arg(extScripts->itemByTagNumber(index(source))->uniq());
|
.arg(m_extScripts->itemByTagNumber(index(source))->uniq());
|
||||||
data[QString("type")] = QString("QString");
|
data[QString("type")] = QString("QString");
|
||||||
data[QString("units")] = QString("");
|
data[QString("units")] = QString("");
|
||||||
|
|
||||||
@ -76,7 +77,7 @@ QStringList CustomSource::sources() const
|
|||||||
QStringList CustomSource::getSources()
|
QStringList CustomSource::getSources()
|
||||||
{
|
{
|
||||||
QStringList sources;
|
QStringList sources;
|
||||||
for (auto item : extScripts->activeItems())
|
for (auto item : m_extScripts->activeItems())
|
||||||
sources.append(QString("custom/%1").arg(item->tag(QString("custom"))));
|
sources.append(QString("custom/%1").arg(item->tag(QString("custom"))));
|
||||||
|
|
||||||
return sources;
|
return sources;
|
||||||
|
@ -28,6 +28,8 @@ class ExtScript;
|
|||||||
|
|
||||||
class CustomSource : public AbstractExtSysMonSource
|
class CustomSource : public AbstractExtSysMonSource
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CustomSource(QObject *parent, const QStringList args);
|
explicit CustomSource(QObject *parent, const QStringList args);
|
||||||
virtual ~CustomSource();
|
virtual ~CustomSource();
|
||||||
@ -39,7 +41,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
QStringList getSources();
|
QStringList getSources();
|
||||||
// configuration and values
|
// configuration and values
|
||||||
ExtItemAggregator<ExtScript> *extScripts = nullptr;
|
ExtItemAggregator<ExtScript> *m_extScripts = nullptr;
|
||||||
QStringList m_sources;
|
QStringList m_sources;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
class DesktopSource : public AbstractExtSysMonSource
|
class DesktopSource : public AbstractExtSysMonSource
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DesktopSource(QObject *parent, const QStringList args);
|
explicit DesktopSource(QObject *parent, const QStringList args);
|
||||||
virtual ~DesktopSource();
|
virtual ~DesktopSource();
|
||||||
|
@ -27,6 +27,8 @@ class QProcess;
|
|||||||
|
|
||||||
class GPULoadSource : public AbstractExtSysMonSource
|
class GPULoadSource : public AbstractExtSysMonSource
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit GPULoadSource(QObject *parent, const QStringList args);
|
explicit GPULoadSource(QObject *parent, const QStringList args);
|
||||||
virtual ~GPULoadSource();
|
virtual ~GPULoadSource();
|
||||||
|
@ -27,6 +27,8 @@ class QProcess;
|
|||||||
|
|
||||||
class GPUTemperatureSource : public AbstractExtSysMonSource
|
class GPUTemperatureSource : public AbstractExtSysMonSource
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit GPUTemperatureSource(QObject *parent, const QStringList args);
|
explicit GPUTemperatureSource(QObject *parent, const QStringList args);
|
||||||
virtual ~GPUTemperatureSource();
|
virtual ~GPUTemperatureSource();
|
||||||
|
@ -27,6 +27,8 @@ class QProcess;
|
|||||||
|
|
||||||
class HDDTemperatureSource : public AbstractExtSysMonSource
|
class HDDTemperatureSource : public AbstractExtSysMonSource
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit HDDTemperatureSource(QObject *parent, const QStringList args);
|
explicit HDDTemperatureSource(QObject *parent, const QStringList args);
|
||||||
virtual ~HDDTemperatureSource();
|
virtual ~HDDTemperatureSource();
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
class LoadSource : public AbstractExtSysMonSource
|
class LoadSource : public AbstractExtSysMonSource
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit LoadSource(QObject *parent, const QStringList args);
|
explicit LoadSource(QObject *parent, const QStringList args);
|
||||||
virtual ~LoadSource();
|
virtual ~LoadSource();
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
class NetworkSource : public AbstractExtSysMonSource
|
class NetworkSource : public AbstractExtSysMonSource
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit NetworkSource(QObject *parent, const QStringList args);
|
explicit NetworkSource(QObject *parent, const QStringList args);
|
||||||
virtual ~NetworkSource();
|
virtual ~NetworkSource();
|
||||||
|
@ -35,17 +35,17 @@ PlayerSource::PlayerSource(QObject *parent, const QStringList args)
|
|||||||
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
m_player = args.at(0);
|
m_player = args.at(0);
|
||||||
m_mpdAddress = QString("%1:%2").arg(args.at(1)).arg(args.at(2));
|
m_mpdAddress = args.at(1);
|
||||||
|
m_mpdPort = args.at(2).toInt();
|
||||||
m_mpris = args.at(3);
|
m_mpris = args.at(3);
|
||||||
m_symbols = args.at(4).toInt();
|
m_symbols = args.at(4).toInt();
|
||||||
|
|
||||||
m_mpdProcess = new QProcess(nullptr);
|
connect(&m_mpdSocket, SIGNAL(connected()), this,
|
||||||
// fucking magic from http://doc.qt.io/qt-5/qprocess.html#finished
|
SLOT(mpdSocketConnected()));
|
||||||
connect(m_mpdProcess,
|
connect(&m_mpdSocket, SIGNAL(readyRead()), this,
|
||||||
static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(
|
SLOT(mpdSocketReadyRead()));
|
||||||
&QProcess::finished),
|
connect(&m_mpdSocket, SIGNAL(bytesWritten(qint64)), this,
|
||||||
[this](int, QProcess::ExitStatus) { return updateMpdValue(); });
|
SLOT(mpdSocketWritten(const qint64)));
|
||||||
m_mpdProcess->waitForFinished(0);
|
|
||||||
m_mpdCached = defaultInfo();
|
m_mpdCached = defaultInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,8 +54,7 @@ PlayerSource::~PlayerSource()
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
m_mpdProcess->kill();
|
m_mpdSocket.close();
|
||||||
m_mpdProcess->deleteLater();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -182,7 +181,7 @@ void PlayerSource::run()
|
|||||||
// initial data
|
// initial data
|
||||||
if (m_player == QString("mpd")) {
|
if (m_player == QString("mpd")) {
|
||||||
// mpd
|
// mpd
|
||||||
m_values = getPlayerMpdInfo(m_mpdAddress);
|
m_values = getPlayerMpdInfo();
|
||||||
} else if (m_player == QString("mpris")) {
|
} else if (m_player == QString("mpris")) {
|
||||||
// players which supports mpris
|
// players which supports mpris
|
||||||
if (m_dbusMutex.tryLock()) {
|
if (m_dbusMutex.tryLock()) {
|
||||||
@ -256,18 +255,21 @@ QString PlayerSource::stripString(const QString &value, const int s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PlayerSource::updateMpdValue()
|
void PlayerSource::mpdSocketConnected()
|
||||||
|
{
|
||||||
|
qCDebug(LOG_ESS) << "MPD socket connected to" << m_mpdSocket.peerName()
|
||||||
|
<< "with state" << m_mpdSocket.state();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PlayerSource::mpdSocketReadyRead()
|
||||||
{
|
{
|
||||||
qCInfo(LOG_ESS) << "Cmd returns" << m_mpdProcess->exitCode();
|
|
||||||
QString qdebug = QTextCodec::codecForMib(106)
|
|
||||||
->toUnicode(m_mpdProcess->readAllStandardError())
|
|
||||||
.trimmed();
|
|
||||||
qCInfo(LOG_ESS) << "Error" << qdebug;
|
|
||||||
QString qoutput = QTextCodec::codecForMib(106)
|
QString qoutput = QTextCodec::codecForMib(106)
|
||||||
->toUnicode(m_mpdProcess->readAllStandardOutput())
|
->toUnicode(m_mpdSocket.readAll())
|
||||||
.trimmed();
|
.trimmed();
|
||||||
qCInfo(LOG_ESS) << "Output" << qoutput;
|
qCInfo(LOG_ESS) << "Output" << qoutput;
|
||||||
|
|
||||||
|
// parse
|
||||||
for (auto str : qoutput.split(QChar('\n'), QString::SkipEmptyParts)) {
|
for (auto str : qoutput.split(QChar('\n'), QString::SkipEmptyParts)) {
|
||||||
if (str.split(QString(": "), QString::SkipEmptyParts).count() == 2) {
|
if (str.split(QString(": "), QString::SkipEmptyParts).count() == 2) {
|
||||||
// "Metadata: data"
|
// "Metadata: data"
|
||||||
@ -292,6 +294,13 @@ void PlayerSource::updateMpdValue()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PlayerSource::mpdSocketWritten(const qint64 bytes)
|
||||||
|
{
|
||||||
|
qCDebug(LOG_ESS) << "Bytes written" << bytes << "to"
|
||||||
|
<< m_mpdSocket.peerName();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariantHash PlayerSource::defaultInfo() const
|
QVariantHash PlayerSource::defaultInfo() const
|
||||||
{
|
{
|
||||||
QVariantHash info;
|
QVariantHash info;
|
||||||
@ -305,16 +314,18 @@ QVariantHash PlayerSource::defaultInfo() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariantHash PlayerSource::getPlayerMpdInfo(const QString mpdAddress) const
|
QVariantHash PlayerSource::getPlayerMpdInfo()
|
||||||
{
|
{
|
||||||
qCDebug(LOG_ESS) << "MPD" << mpdAddress;
|
if (m_mpdSocket.state() == QAbstractSocket::UnconnectedState) {
|
||||||
|
// connect to host
|
||||||
// build cmd
|
qCInfo(LOG_ESS) << "Connect to" << m_mpdAddress << m_mpdPort;
|
||||||
QString cmd = QString("bash -c \"echo 'currentsong\nstatus\nclose' | curl "
|
m_mpdSocket.connectToHost(m_mpdAddress, m_mpdPort);
|
||||||
"--connect-timeout 1 -fsm 3 telnet://%1\"")
|
} else if (m_mpdSocket.state() == QAbstractSocket::ConnectedState) {
|
||||||
.arg(mpdAddress);
|
// send request
|
||||||
qCInfo(LOG_ESS) << "cmd" << cmd;
|
if (m_mpdSocket.write(MPD_STATUS_REQUEST) == -1)
|
||||||
m_mpdProcess->start(cmd);
|
qCWarning(LOG_ESS) << "Could not write request to"
|
||||||
|
<< m_mpdSocket.peerName();
|
||||||
|
}
|
||||||
|
|
||||||
return m_mpdCached;
|
return m_mpdCached;
|
||||||
}
|
}
|
||||||
|
@ -20,14 +20,19 @@
|
|||||||
|
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QTcpSocket>
|
||||||
|
|
||||||
#include "abstractextsysmonsource.h"
|
#include "abstractextsysmonsource.h"
|
||||||
|
|
||||||
|
#define MPD_STATUS_REQUEST "currentsong\nstatus\n"
|
||||||
|
|
||||||
|
|
||||||
class QProcess;
|
class QProcess;
|
||||||
|
|
||||||
class PlayerSource : public AbstractExtSysMonSource
|
class PlayerSource : public AbstractExtSysMonSource
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PlayerSource(QObject *parent, const QStringList args);
|
explicit PlayerSource(QObject *parent, const QStringList args);
|
||||||
virtual ~PlayerSource();
|
virtual ~PlayerSource();
|
||||||
@ -42,16 +47,19 @@ public:
|
|||||||
static QString stripString(const QString &value, const int s);
|
static QString stripString(const QString &value, const int s);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void updateMpdValue();
|
void mpdSocketConnected();
|
||||||
|
void mpdSocketReadyRead();
|
||||||
|
void mpdSocketWritten(const qint64 bytes);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
inline QVariantHash defaultInfo() const;
|
inline QVariantHash defaultInfo() const;
|
||||||
QVariantHash getPlayerMpdInfo(const QString mpdAddress) const;
|
QVariantHash getPlayerMpdInfo();
|
||||||
QVariantHash getPlayerMprisInfo(const QString mpris) const;
|
QVariantHash getPlayerMprisInfo(const QString mpris) const;
|
||||||
|
QTcpSocket m_mpdSocket;
|
||||||
// configuration and values
|
// configuration and values
|
||||||
QString m_mpdAddress;
|
QString m_mpdAddress;
|
||||||
|
int m_mpdPort;
|
||||||
QVariantHash m_mpdCached;
|
QVariantHash m_mpdCached;
|
||||||
QProcess *m_mpdProcess = nullptr;
|
|
||||||
QString m_mpris;
|
QString m_mpris;
|
||||||
QMutex m_dbusMutex;
|
QMutex m_dbusMutex;
|
||||||
QString m_player;
|
QString m_player;
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
class ProcessesSource : public AbstractExtSysMonSource
|
class ProcessesSource : public AbstractExtSysMonSource
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ProcessesSource(QObject *parent, const QStringList args);
|
explicit ProcessesSource(QObject *parent, const QStringList args);
|
||||||
virtual ~ProcessesSource();
|
virtual ~ProcessesSource();
|
||||||
|
@ -28,7 +28,7 @@ QuotesSource::QuotesSource(QObject *parent, const QStringList args)
|
|||||||
Q_ASSERT(args.count() == 0);
|
Q_ASSERT(args.count() == 0);
|
||||||
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
extQuotes = new ExtItemAggregator<ExtQuotes>(nullptr, QString("quotes"));
|
m_extQuotes = new ExtItemAggregator<ExtQuotes>(nullptr, QString("quotes"));
|
||||||
m_sources = getSources();
|
m_sources = getSources();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ QuotesSource::~QuotesSource()
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
delete extQuotes;
|
delete m_extQuotes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ QVariant QuotesSource::data(QString source)
|
|||||||
int ind = index(source);
|
int ind = index(source);
|
||||||
source.remove(QString("quotes/"));
|
source.remove(QString("quotes/"));
|
||||||
if (!m_values.contains(source)) {
|
if (!m_values.contains(source)) {
|
||||||
QVariantHash data = extQuotes->itemByTagNumber(ind)->run();
|
QVariantHash data = m_extQuotes->itemByTagNumber(ind)->run();
|
||||||
for (auto key : data.keys())
|
for (auto key : data.keys())
|
||||||
m_values[key] = data[key];
|
m_values[key] = data[key];
|
||||||
}
|
}
|
||||||
@ -68,7 +68,7 @@ QVariantMap QuotesSource::initialData(QString source) const
|
|||||||
data[QString("max")] = 0.0;
|
data[QString("max")] = 0.0;
|
||||||
data[QString("name")]
|
data[QString("name")]
|
||||||
= QString("Absolute ask changes for '%1'")
|
= QString("Absolute ask changes for '%1'")
|
||||||
.arg(extQuotes->itemByTagNumber(ind)->uniq());
|
.arg(m_extQuotes->itemByTagNumber(ind)->uniq());
|
||||||
data[QString("type")] = QString("double");
|
data[QString("type")] = QString("double");
|
||||||
data[QString("units")] = QString("");
|
data[QString("units")] = QString("");
|
||||||
} else if (source.startsWith(QString("quotes/ask"))) {
|
} else if (source.startsWith(QString("quotes/ask"))) {
|
||||||
@ -76,7 +76,7 @@ QVariantMap QuotesSource::initialData(QString source) const
|
|||||||
data[QString("max")] = 0.0;
|
data[QString("max")] = 0.0;
|
||||||
data[QString("name")]
|
data[QString("name")]
|
||||||
= QString("Ask for '%1'")
|
= QString("Ask for '%1'")
|
||||||
.arg(extQuotes->itemByTagNumber(ind)->uniq());
|
.arg(m_extQuotes->itemByTagNumber(ind)->uniq());
|
||||||
data[QString("type")] = QString("double");
|
data[QString("type")] = QString("double");
|
||||||
data[QString("units")] = QString("");
|
data[QString("units")] = QString("");
|
||||||
} else if (source.startsWith(QString("quotes/percaskchg"))) {
|
} else if (source.startsWith(QString("quotes/percaskchg"))) {
|
||||||
@ -84,7 +84,7 @@ QVariantMap QuotesSource::initialData(QString source) const
|
|||||||
data[QString("max")] = 100.0;
|
data[QString("max")] = 100.0;
|
||||||
data[QString("name")]
|
data[QString("name")]
|
||||||
= QString("Ask changes for '%1'")
|
= QString("Ask changes for '%1'")
|
||||||
.arg(extQuotes->itemByTagNumber(ind)->uniq());
|
.arg(m_extQuotes->itemByTagNumber(ind)->uniq());
|
||||||
data[QString("type")] = QString("double");
|
data[QString("type")] = QString("double");
|
||||||
data[QString("units")] = QString("");
|
data[QString("units")] = QString("");
|
||||||
} else if (source.startsWith(QString("quotes/bidchg"))) {
|
} else if (source.startsWith(QString("quotes/bidchg"))) {
|
||||||
@ -92,7 +92,7 @@ QVariantMap QuotesSource::initialData(QString source) const
|
|||||||
data[QString("max")] = 0.0;
|
data[QString("max")] = 0.0;
|
||||||
data[QString("name")]
|
data[QString("name")]
|
||||||
= QString("Absolute bid changes for '%1'")
|
= QString("Absolute bid changes for '%1'")
|
||||||
.arg(extQuotes->itemByTagNumber(ind)->uniq());
|
.arg(m_extQuotes->itemByTagNumber(ind)->uniq());
|
||||||
data[QString("type")] = QString("double");
|
data[QString("type")] = QString("double");
|
||||||
data[QString("units")] = QString("");
|
data[QString("units")] = QString("");
|
||||||
} else if (source.startsWith(QString("quotes/bid"))) {
|
} else if (source.startsWith(QString("quotes/bid"))) {
|
||||||
@ -100,7 +100,7 @@ QVariantMap QuotesSource::initialData(QString source) const
|
|||||||
data[QString("max")] = 0.0;
|
data[QString("max")] = 0.0;
|
||||||
data[QString("name")]
|
data[QString("name")]
|
||||||
= QString("Bid for '%1'")
|
= QString("Bid for '%1'")
|
||||||
.arg(extQuotes->itemByTagNumber(ind)->uniq());
|
.arg(m_extQuotes->itemByTagNumber(ind)->uniq());
|
||||||
data[QString("type")] = QString("double");
|
data[QString("type")] = QString("double");
|
||||||
data[QString("units")] = QString("");
|
data[QString("units")] = QString("");
|
||||||
} else if (source.startsWith(QString("quotes/percbidchg"))) {
|
} else if (source.startsWith(QString("quotes/percbidchg"))) {
|
||||||
@ -108,7 +108,7 @@ QVariantMap QuotesSource::initialData(QString source) const
|
|||||||
data[QString("max")] = 100.0;
|
data[QString("max")] = 100.0;
|
||||||
data[QString("name")]
|
data[QString("name")]
|
||||||
= QString("Bid changes for '%1'")
|
= QString("Bid changes for '%1'")
|
||||||
.arg(extQuotes->itemByTagNumber(ind)->uniq());
|
.arg(m_extQuotes->itemByTagNumber(ind)->uniq());
|
||||||
data[QString("type")] = QString("double");
|
data[QString("type")] = QString("double");
|
||||||
data[QString("units")] = QString("");
|
data[QString("units")] = QString("");
|
||||||
} else if (source.startsWith(QString("quotes/pricechg"))) {
|
} else if (source.startsWith(QString("quotes/pricechg"))) {
|
||||||
@ -116,7 +116,7 @@ QVariantMap QuotesSource::initialData(QString source) const
|
|||||||
data[QString("max")] = 0.0;
|
data[QString("max")] = 0.0;
|
||||||
data[QString("name")]
|
data[QString("name")]
|
||||||
= QString("Absolute prie changes for '%1'")
|
= QString("Absolute prie changes for '%1'")
|
||||||
.arg(extQuotes->itemByTagNumber(ind)->uniq());
|
.arg(m_extQuotes->itemByTagNumber(ind)->uniq());
|
||||||
data[QString("type")] = QString("double");
|
data[QString("type")] = QString("double");
|
||||||
data[QString("units")] = QString("");
|
data[QString("units")] = QString("");
|
||||||
} else if (source.startsWith(QString("quotes/price"))) {
|
} else if (source.startsWith(QString("quotes/price"))) {
|
||||||
@ -124,7 +124,7 @@ QVariantMap QuotesSource::initialData(QString source) const
|
|||||||
data[QString("max")] = 0.0;
|
data[QString("max")] = 0.0;
|
||||||
data[QString("name")]
|
data[QString("name")]
|
||||||
= QString("Price for '%1'")
|
= QString("Price for '%1'")
|
||||||
.arg(extQuotes->itemByTagNumber(ind)->uniq());
|
.arg(m_extQuotes->itemByTagNumber(ind)->uniq());
|
||||||
data[QString("type")] = QString("double");
|
data[QString("type")] = QString("double");
|
||||||
data[QString("units")] = QString("");
|
data[QString("units")] = QString("");
|
||||||
} else if (source.startsWith(QString("quotes/percpricechg"))) {
|
} else if (source.startsWith(QString("quotes/percpricechg"))) {
|
||||||
@ -132,7 +132,7 @@ QVariantMap QuotesSource::initialData(QString source) const
|
|||||||
data[QString("max")] = 100.0;
|
data[QString("max")] = 100.0;
|
||||||
data[QString("name")]
|
data[QString("name")]
|
||||||
= QString("Price changes for '%1'")
|
= QString("Price changes for '%1'")
|
||||||
.arg(extQuotes->itemByTagNumber(ind)->uniq());
|
.arg(m_extQuotes->itemByTagNumber(ind)->uniq());
|
||||||
data[QString("type")] = QString("double");
|
data[QString("type")] = QString("double");
|
||||||
data[QString("units")] = QString("");
|
data[QString("units")] = QString("");
|
||||||
}
|
}
|
||||||
@ -150,7 +150,7 @@ QStringList QuotesSource::sources() const
|
|||||||
QStringList QuotesSource::getSources()
|
QStringList QuotesSource::getSources()
|
||||||
{
|
{
|
||||||
QStringList sources;
|
QStringList sources;
|
||||||
for (auto item : extQuotes->activeItems()) {
|
for (auto item : m_extQuotes->activeItems()) {
|
||||||
sources.append(QString("quotes/%1").arg(item->tag(QString("ask"))));
|
sources.append(QString("quotes/%1").arg(item->tag(QString("ask"))));
|
||||||
sources.append(QString("quotes/%1").arg(item->tag(QString("askchg"))));
|
sources.append(QString("quotes/%1").arg(item->tag(QString("askchg"))));
|
||||||
sources.append(
|
sources.append(
|
||||||
|
@ -28,6 +28,8 @@ class ExtQuotes;
|
|||||||
|
|
||||||
class QuotesSource : public AbstractExtSysMonSource
|
class QuotesSource : public AbstractExtSysMonSource
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QuotesSource(QObject *parent, const QStringList args);
|
explicit QuotesSource(QObject *parent, const QStringList args);
|
||||||
virtual ~QuotesSource();
|
virtual ~QuotesSource();
|
||||||
@ -39,7 +41,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
QStringList getSources();
|
QStringList getSources();
|
||||||
// configuration and values
|
// configuration and values
|
||||||
ExtItemAggregator<ExtQuotes> *extQuotes = nullptr;
|
ExtItemAggregator<ExtQuotes> *m_extQuotes = nullptr;
|
||||||
QStringList m_sources;
|
QStringList m_sources;
|
||||||
QVariantHash m_values;
|
QVariantHash m_values;
|
||||||
};
|
};
|
||||||
|
@ -28,7 +28,8 @@ UpgradeSource::UpgradeSource(QObject *parent, const QStringList args)
|
|||||||
Q_ASSERT(args.count() == 0);
|
Q_ASSERT(args.count() == 0);
|
||||||
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
extUpgrade = new ExtItemAggregator<ExtUpgrade>(nullptr, QString("upgrade"));
|
m_extUpgrade
|
||||||
|
= new ExtItemAggregator<ExtUpgrade>(nullptr, QString("upgrade"));
|
||||||
m_sources = getSources();
|
m_sources = getSources();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +38,7 @@ UpgradeSource::~UpgradeSource()
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
delete extUpgrade;
|
delete m_extUpgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -46,7 +47,7 @@ QVariant UpgradeSource::data(QString source)
|
|||||||
qCDebug(LOG_ESS) << "Source" << source;
|
qCDebug(LOG_ESS) << "Source" << source;
|
||||||
|
|
||||||
// there are only one value
|
// there are only one value
|
||||||
return extUpgrade->itemByTagNumber(index(source))->run().values().first();
|
return m_extUpgrade->itemByTagNumber(index(source))->run().values().first();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -59,7 +60,7 @@ QVariantMap UpgradeSource::initialData(QString source) const
|
|||||||
data[QString("max")] = QString("");
|
data[QString("max")] = QString("");
|
||||||
data[QString("name")]
|
data[QString("name")]
|
||||||
= QString("Package manager '%1' metadata")
|
= QString("Package manager '%1' metadata")
|
||||||
.arg(extUpgrade->itemByTagNumber(index(source))->uniq());
|
.arg(m_extUpgrade->itemByTagNumber(index(source))->uniq());
|
||||||
data[QString("type")] = QString("QString");
|
data[QString("type")] = QString("QString");
|
||||||
data[QString("units")] = QString("");
|
data[QString("units")] = QString("");
|
||||||
|
|
||||||
@ -76,7 +77,7 @@ QStringList UpgradeSource::sources() const
|
|||||||
QStringList UpgradeSource::getSources()
|
QStringList UpgradeSource::getSources()
|
||||||
{
|
{
|
||||||
QStringList sources;
|
QStringList sources;
|
||||||
for (auto item : extUpgrade->activeItems())
|
for (auto item : m_extUpgrade->activeItems())
|
||||||
sources.append(
|
sources.append(
|
||||||
QString("upgrade/%1").arg(item->tag(QString("pkgcount"))));
|
QString("upgrade/%1").arg(item->tag(QString("pkgcount"))));
|
||||||
|
|
||||||
|
@ -28,6 +28,8 @@ class ExtUpgrade;
|
|||||||
|
|
||||||
class UpgradeSource : public AbstractExtSysMonSource
|
class UpgradeSource : public AbstractExtSysMonSource
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit UpgradeSource(QObject *parent, const QStringList args);
|
explicit UpgradeSource(QObject *parent, const QStringList args);
|
||||||
virtual ~UpgradeSource();
|
virtual ~UpgradeSource();
|
||||||
@ -39,7 +41,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
QStringList getSources();
|
QStringList getSources();
|
||||||
// configuration and values
|
// configuration and values
|
||||||
ExtItemAggregator<ExtUpgrade> *extUpgrade = nullptr;
|
ExtItemAggregator<ExtUpgrade> *m_extUpgrade = nullptr;
|
||||||
QStringList m_sources;
|
QStringList m_sources;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -28,7 +28,8 @@ WeatherSource::WeatherSource(QObject *parent, const QStringList args)
|
|||||||
Q_ASSERT(args.count() == 0);
|
Q_ASSERT(args.count() == 0);
|
||||||
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
extWeather = new ExtItemAggregator<ExtWeather>(nullptr, QString("weather"));
|
m_extWeather
|
||||||
|
= new ExtItemAggregator<ExtWeather>(nullptr, QString("weather"));
|
||||||
m_sources = getSources();
|
m_sources = getSources();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +38,7 @@ WeatherSource::~WeatherSource()
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_ESS) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
delete extWeather;
|
delete m_extWeather;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -48,7 +49,7 @@ QVariant WeatherSource::data(QString source)
|
|||||||
int ind = index(source);
|
int ind = index(source);
|
||||||
source.remove(QString("weather/"));
|
source.remove(QString("weather/"));
|
||||||
if (!m_values.contains(source)) {
|
if (!m_values.contains(source)) {
|
||||||
QVariantHash data = extWeather->itemByTagNumber(ind)->run();
|
QVariantHash data = m_extWeather->itemByTagNumber(ind)->run();
|
||||||
for (auto key : data.keys())
|
for (auto key : data.keys())
|
||||||
m_values[key] = data[key];
|
m_values[key] = data[key];
|
||||||
}
|
}
|
||||||
@ -68,7 +69,7 @@ QVariantMap WeatherSource::initialData(QString source) const
|
|||||||
data[QString("max")] = 1000;
|
data[QString("max")] = 1000;
|
||||||
data[QString("name")]
|
data[QString("name")]
|
||||||
= QString("Numeric weather ID for '%1'")
|
= QString("Numeric weather ID for '%1'")
|
||||||
.arg(extWeather->itemByTagNumber(ind)->uniq());
|
.arg(m_extWeather->itemByTagNumber(ind)->uniq());
|
||||||
data[QString("type")] = QString("integer");
|
data[QString("type")] = QString("integer");
|
||||||
data[QString("units")] = QString("");
|
data[QString("units")] = QString("");
|
||||||
} else if (source.startsWith(QString("weather/weather"))) {
|
} else if (source.startsWith(QString("weather/weather"))) {
|
||||||
@ -76,7 +77,7 @@ QVariantMap WeatherSource::initialData(QString source) const
|
|||||||
data[QString("max")] = QString("");
|
data[QString("max")] = QString("");
|
||||||
data[QString("name")]
|
data[QString("name")]
|
||||||
= QString("ID string map for '%1'")
|
= QString("ID string map for '%1'")
|
||||||
.arg(extWeather->itemByTagNumber(ind)->uniq());
|
.arg(m_extWeather->itemByTagNumber(ind)->uniq());
|
||||||
data[QString("type")] = QString("QString");
|
data[QString("type")] = QString("QString");
|
||||||
data[QString("units")] = QString("");
|
data[QString("units")] = QString("");
|
||||||
} else if (source.startsWith(QString("weather/humidity"))) {
|
} else if (source.startsWith(QString("weather/humidity"))) {
|
||||||
@ -84,7 +85,7 @@ QVariantMap WeatherSource::initialData(QString source) const
|
|||||||
data[QString("max")] = 100;
|
data[QString("max")] = 100;
|
||||||
data[QString("name")]
|
data[QString("name")]
|
||||||
= QString("Humidity for '%1'")
|
= QString("Humidity for '%1'")
|
||||||
.arg(extWeather->itemByTagNumber(ind)->uniq());
|
.arg(m_extWeather->itemByTagNumber(ind)->uniq());
|
||||||
data[QString("type")] = QString("integer");
|
data[QString("type")] = QString("integer");
|
||||||
data[QString("units")] = QString("%");
|
data[QString("units")] = QString("%");
|
||||||
} else if (source.startsWith(QString("weather/pressure"))) {
|
} else if (source.startsWith(QString("weather/pressure"))) {
|
||||||
@ -92,7 +93,7 @@ QVariantMap WeatherSource::initialData(QString source) const
|
|||||||
data[QString("max")] = 0;
|
data[QString("max")] = 0;
|
||||||
data[QString("name")]
|
data[QString("name")]
|
||||||
= QString("Atmospheric pressure for '%1'")
|
= QString("Atmospheric pressure for '%1'")
|
||||||
.arg(extWeather->itemByTagNumber(ind)->uniq());
|
.arg(m_extWeather->itemByTagNumber(ind)->uniq());
|
||||||
data[QString("type")] = QString("integer");
|
data[QString("type")] = QString("integer");
|
||||||
data[QString("units")] = QString("mb");
|
data[QString("units")] = QString("mb");
|
||||||
} else if (source.startsWith(QString("weather/temperature"))) {
|
} else if (source.startsWith(QString("weather/temperature"))) {
|
||||||
@ -100,7 +101,7 @@ QVariantMap WeatherSource::initialData(QString source) const
|
|||||||
data[QString("max")] = 0.0;
|
data[QString("max")] = 0.0;
|
||||||
data[QString("name")]
|
data[QString("name")]
|
||||||
= QString("Temperature for '%1'")
|
= QString("Temperature for '%1'")
|
||||||
.arg(extWeather->itemByTagNumber(ind)->uniq());
|
.arg(m_extWeather->itemByTagNumber(ind)->uniq());
|
||||||
data[QString("type")] = QString("float");
|
data[QString("type")] = QString("float");
|
||||||
data[QString("units")] = QString("°C");
|
data[QString("units")] = QString("°C");
|
||||||
} else if (source.startsWith(QString("weather/timestamp"))) {
|
} else if (source.startsWith(QString("weather/timestamp"))) {
|
||||||
@ -108,7 +109,7 @@ QVariantMap WeatherSource::initialData(QString source) const
|
|||||||
data[QString("max")] = QString("");
|
data[QString("max")] = QString("");
|
||||||
data[QString("name")]
|
data[QString("name")]
|
||||||
= QString("Timestamp for '%1'")
|
= QString("Timestamp for '%1'")
|
||||||
.arg(extWeather->itemByTagNumber(ind)->uniq());
|
.arg(m_extWeather->itemByTagNumber(ind)->uniq());
|
||||||
data[QString("type")] = QString("QString");
|
data[QString("type")] = QString("QString");
|
||||||
data[QString("units")] = QString("");
|
data[QString("units")] = QString("");
|
||||||
}
|
}
|
||||||
@ -126,7 +127,7 @@ QStringList WeatherSource::sources() const
|
|||||||
QStringList WeatherSource::getSources()
|
QStringList WeatherSource::getSources()
|
||||||
{
|
{
|
||||||
QStringList sources;
|
QStringList sources;
|
||||||
for (auto item : extWeather->activeItems()) {
|
for (auto item : m_extWeather->activeItems()) {
|
||||||
sources.append(
|
sources.append(
|
||||||
QString("weather/%1").arg(item->tag(QString("weatherId"))));
|
QString("weather/%1").arg(item->tag(QString("weatherId"))));
|
||||||
sources.append(
|
sources.append(
|
||||||
|
@ -28,6 +28,8 @@ class ExtWeather;
|
|||||||
|
|
||||||
class WeatherSource : public AbstractExtSysMonSource
|
class WeatherSource : public AbstractExtSysMonSource
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit WeatherSource(QObject *parent, const QStringList args);
|
explicit WeatherSource(QObject *parent, const QStringList args);
|
||||||
virtual ~WeatherSource();
|
virtual ~WeatherSource();
|
||||||
@ -39,7 +41,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
QStringList getSources();
|
QStringList getSources();
|
||||||
// configuration and values
|
// configuration and values
|
||||||
ExtItemAggregator<ExtWeather> *extWeather = nullptr;
|
ExtItemAggregator<ExtWeather> *m_extWeather = nullptr;
|
||||||
QStringList m_sources;
|
QStringList m_sources;
|
||||||
QVariantHash m_values;
|
QVariantHash m_values;
|
||||||
};
|
};
|
||||||
|
@ -56,10 +56,12 @@ void TestAWDateTimeFormatter::test_conversion()
|
|||||||
|
|
||||||
void TestAWDateTimeFormatter::test_copy()
|
void TestAWDateTimeFormatter::test_copy()
|
||||||
{
|
{
|
||||||
|
formatter->setTranslateString(false);
|
||||||
AWDateTimeFormatter *newFormatter
|
AWDateTimeFormatter *newFormatter
|
||||||
= formatter->copy(QString("/dev/null"), 1);
|
= formatter->copy(QString("/dev/null"), 1);
|
||||||
|
|
||||||
QCOMPARE(newFormatter->format(), formatter->format());
|
QCOMPARE(newFormatter->format(), formatter->format());
|
||||||
|
QCOMPARE(newFormatter->translateString(), formatter->translateString());
|
||||||
QCOMPARE(newFormatter->number(), 1);
|
QCOMPARE(newFormatter->number(), 1);
|
||||||
|
|
||||||
delete newFormatter;
|
delete newFormatter;
|
||||||
|
@ -8,7 +8,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
|
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
|
||||||
"POT-Creation-Date: 2016-07-06 19:36+0300\n"
|
"POT-Creation-Date: 2016-08-03 16:10+0300\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# SOME DESCRIPTIVE TITLE.
|
# SOME DESCRIPTIVE TITLE.
|
||||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
# This file is distributed under the same license as the PACKAGE package.
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
#
|
#
|
||||||
# Translators:
|
# Translators:
|
||||||
# Ernesto Avilés Vázquez <whippiii@gmail.com>, 2014-2016
|
# Ernesto Avilés Vázquez <whippiii@gmail.com>, 2014-2016
|
||||||
# Evgeniy Alekseev <esalexeev@gmail.com>, 2014-2015
|
# Evgeniy Alekseev <esalexeev@gmail.com>, 2014-2015
|
||||||
@ -10,14 +10,13 @@ msgstr ""
|
|||||||
"Project-Id-Version: Awesome widgets\n"
|
"Project-Id-Version: Awesome widgets\n"
|
||||||
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
|
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
|
||||||
"POT-Creation-Date: 2016-07-06 19:36+0300\n"
|
"POT-Creation-Date: 2016-07-06 19:36+0300\n"
|
||||||
"PO-Revision-Date: 2016-05-03 06:47+0000\n"
|
"PO-Revision-Date: 2016-08-03 15:30+0000\n"
|
||||||
"Last-Translator: Ernesto Avilés Vázquez <whippiii@gmail.com>\n"
|
"Last-Translator: Ernesto Avilés Vázquez <whippiii@gmail.com>\n"
|
||||||
"Language-Team: Spanish (http://www.transifex.com/arcanis/awesome-widgets/"
|
"Language-Team: Spanish (http://www.transifex.com/arcanis/awesome-widgets/language/es/)\n"
|
||||||
"language/es/)\n"
|
|
||||||
"Language: es\n"
|
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Language: es\n"
|
||||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
msgid "Widget"
|
msgid "Widget"
|
||||||
@ -275,10 +274,7 @@ msgstr "Comprobar actualizaciones"
|
|||||||
msgid ""
|
msgid ""
|
||||||
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
|
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
|
||||||
"To enable them just make needed checkbox checked."
|
"To enable them just make needed checkbox checked."
|
||||||
msgstr ""
|
msgstr "Las etiquetas para CPU, reloj de CPU, memoria, swap y red soportan ventanas emergentes. Para habilitarlas, simplemente marca las casillas correspondientes."
|
||||||
"Las etiquetas para CPU, reloj de CPU, memoria, swap y red soportan ventanas "
|
|
||||||
"emergentes. Para habilitarlas, simplemente marca las casillas "
|
|
||||||
"correspondientes."
|
|
||||||
|
|
||||||
msgid "Number of values for tooltips"
|
msgid "Number of values for tooltips"
|
||||||
msgstr "Número de valores para las ventanas emergentes"
|
msgstr "Número de valores para las ventanas emergentes"
|
||||||
@ -332,11 +328,9 @@ msgid "Battery inactive color"
|
|||||||
msgstr "Color de la batería inactiva"
|
msgstr "Color de la batería inactiva"
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Detailed information may be found on <a href=\"https://arcanis.me/projects/"
|
"Detailed information may be found on <a href=\"https://arcanis.me/projects"
|
||||||
"awesome-widgets/\">project homepage</a>"
|
"/awesome-widgets/\">project homepage</a>"
|
||||||
msgstr ""
|
msgstr "Puedes encontrar información detallada en el <a href=\"https://arcanis.me/projects/awesome-widgets/\">sitio del proyecto</a>"
|
||||||
"Puedes encontrar información detallada en el <a href=\"https://arcanis.me/"
|
|
||||||
"projects/awesome-widgets/\">sitio del proyecto</a>"
|
|
||||||
|
|
||||||
msgid "Bgcolor"
|
msgid "Bgcolor"
|
||||||
msgstr "Color de fondo"
|
msgstr "Color de fondo"
|
||||||
@ -378,7 +372,7 @@ msgid "Edit bars"
|
|||||||
msgstr "Editar barras"
|
msgstr "Editar barras"
|
||||||
|
|
||||||
msgid "Formatters"
|
msgid "Formatters"
|
||||||
msgstr ""
|
msgstr "Formateadores"
|
||||||
|
|
||||||
msgid "Preview"
|
msgid "Preview"
|
||||||
msgstr "Vista previa"
|
msgstr "Vista previa"
|
||||||
@ -449,17 +443,14 @@ msgstr "Carga alta de GPU"
|
|||||||
msgid "Network device has been changed to %1"
|
msgid "Network device has been changed to %1"
|
||||||
msgstr "El dispositivo de red ha sido cambiado a %1"
|
msgstr "El dispositivo de red ha sido cambiado a %1"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Edit"
|
msgid "Edit"
|
||||||
msgstr "Editar barras"
|
msgstr "Editar"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Select type"
|
msgid "Select type"
|
||||||
msgstr "Elegir etiqueta"
|
msgstr "Elegir tipo"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Type:"
|
msgid "Type:"
|
||||||
msgstr "Tipo"
|
msgstr "Tipo:"
|
||||||
|
|
||||||
msgid "MB/s"
|
msgid "MB/s"
|
||||||
msgstr "MB/s"
|
msgstr "MB/s"
|
||||||
@ -521,47 +512,44 @@ msgstr "Comentario"
|
|||||||
msgid "Type"
|
msgid "Type"
|
||||||
msgstr "Tipo"
|
msgstr "Tipo"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Format"
|
msgid "Format"
|
||||||
msgstr "normal"
|
msgstr "Formato"
|
||||||
|
|
||||||
msgid "Precision"
|
msgid "Precision"
|
||||||
msgstr ""
|
msgstr "Precisión"
|
||||||
|
|
||||||
msgid "Width"
|
msgid "Width"
|
||||||
msgstr "Ancho"
|
msgstr "Ancho"
|
||||||
|
|
||||||
msgid "Fill char"
|
msgid "Fill char"
|
||||||
msgstr ""
|
msgstr "Relleno"
|
||||||
|
|
||||||
msgid "Force width"
|
msgid "Force width"
|
||||||
msgstr ""
|
msgstr "Fijar ancho"
|
||||||
|
|
||||||
msgid "Multiplier"
|
msgid "Multiplier"
|
||||||
msgstr ""
|
msgstr "Factor"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Summand"
|
msgid "Summand"
|
||||||
msgstr "Orden"
|
msgstr "Sumando"
|
||||||
|
|
||||||
msgid "Filter"
|
msgid "Filter"
|
||||||
msgstr "Filtro"
|
msgstr "Filtro"
|
||||||
|
|
||||||
msgid "Separator"
|
msgid "Separator"
|
||||||
msgstr ""
|
msgstr "Separador"
|
||||||
|
|
||||||
msgid "Sort"
|
msgid "Sort"
|
||||||
msgstr ""
|
msgstr "Clasificación"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Append code"
|
msgid "Append code"
|
||||||
msgstr "Apariencia"
|
msgstr "Agregar código"
|
||||||
|
|
||||||
msgid "Has return"
|
msgid "Has return"
|
||||||
msgstr ""
|
msgstr "Contiene return"
|
||||||
|
|
||||||
msgid "Code"
|
msgid "Code"
|
||||||
msgstr ""
|
msgstr "Código"
|
||||||
|
|
||||||
msgid "Tag"
|
msgid "Tag"
|
||||||
msgstr "Etiqueta"
|
msgstr "Etiqueta"
|
||||||
@ -569,13 +557,9 @@ msgstr "Etiqueta"
|
|||||||
msgid ""
|
msgid ""
|
||||||
"<html><head/><body><p>Use YAHOO! finance ticker to get quotes for the "
|
"<html><head/><body><p>Use YAHOO! finance ticker to get quotes for the "
|
||||||
"instrument. Refer to <a href=\"http://finance.yahoo.com/\"><span style=\" "
|
"instrument. Refer to <a href=\"http://finance.yahoo.com/\"><span style=\" "
|
||||||
"text-decoration: underline; color:#0057ae;\">http://finance.yahoo.com/</"
|
"text-decoration: underline; "
|
||||||
"span></a></p></body></html>"
|
"color:#0057ae;\">http://finance.yahoo.com/</span></a></p></body></html>"
|
||||||
msgstr ""
|
msgstr "<html><head/><body><p>Usa el tablero electrónico de YAHOO! para obtener la cotización del medio. Dirígete a <a href=\"http://finance.yahoo.com/\"><span style=\" text-decoration: underline; color:#0057ae;\">http://finance.yahoo.com/</span></a></p></body></html>"
|
||||||
"<html><head/><body><p>Usa el tablero electrónico de YAHOO! para obtener la "
|
|
||||||
"cotización del medio. Dirígete a <a href=\"http://finance.yahoo.com/\"><span "
|
|
||||||
"style=\" text-decoration: underline; color:#0057ae;\">http://finance.yahoo."
|
|
||||||
"com/</span></a></p></body></html>"
|
|
||||||
|
|
||||||
msgid "Ticker"
|
msgid "Ticker"
|
||||||
msgstr "Tablero"
|
msgstr "Tablero"
|
||||||
@ -608,7 +592,7 @@ msgid "Null"
|
|||||||
msgstr "Líneas en blanco"
|
msgstr "Líneas en blanco"
|
||||||
|
|
||||||
msgid "Provider"
|
msgid "Provider"
|
||||||
msgstr ""
|
msgstr "Proveedor"
|
||||||
|
|
||||||
msgid "City"
|
msgid "City"
|
||||||
msgstr "Ciudad"
|
msgstr "Ciudad"
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
# This file is distributed under the same license as the PACKAGE package.
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
#
|
#
|
||||||
# Translators:
|
# Translators:
|
||||||
# Heimen Stoffels <vistausss@outlook.com>, 2015.
|
# Evgeniy Alekseev <esalexeev@gmail.com>, 2015
|
||||||
# Evgeniy Alekseev <esalexeev@gmail.com>, 2015.
|
# Heimen Stoffels <vistausss@outlook.com>, 2015-2016
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Awesome widgets\n"
|
"Project-Id-Version: Awesome widgets\n"
|
||||||
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
|
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
|
||||||
"POT-Creation-Date: 2016-07-06 19:36+0300\n"
|
"POT-Creation-Date: 2016-08-03 16:10+0300\n"
|
||||||
"PO-Revision-Date: 2015-08-20 22:52+0300\n"
|
"PO-Revision-Date: 2016-07-09 08:47+0000\n"
|
||||||
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
|
"Last-Translator: Heimen Stoffels <vistausss@outlook.com>\n"
|
||||||
"Language-Team: Dutch <kde-i18n-nl@kde.org>\n"
|
"Language-Team: Dutch (Netherlands) (http://www.transifex.com/arcanis/awesome-"
|
||||||
|
"widgets/language/nl_NL/)\n"
|
||||||
"Language: nl_NL\n"
|
"Language: nl_NL\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"widgets/language/nl_NL/)\n"
|
|
||||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
"X-Generator: Lokalize 2.0\n"
|
|
||||||
|
|
||||||
msgid "Widget"
|
msgid "Widget"
|
||||||
msgstr "Widget"
|
msgstr "Widget"
|
||||||
@ -44,37 +44,35 @@ msgstr "Erkenning"
|
|||||||
msgid "Enable background"
|
msgid "Enable background"
|
||||||
msgstr "Achtergrond inschakelen"
|
msgstr "Achtergrond inschakelen"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Translate strings"
|
msgid "Translate strings"
|
||||||
msgstr "Probleem met de vertaling"
|
msgstr "Strings vertalen"
|
||||||
|
|
||||||
msgid "Wrap new lines"
|
msgid "Wrap new lines"
|
||||||
msgstr ""
|
msgstr "Nieuwe regels omslaan"
|
||||||
|
|
||||||
msgid "Enable word wrap"
|
msgid "Enable word wrap"
|
||||||
msgstr ""
|
msgstr "Woordomslag inschakelen"
|
||||||
|
|
||||||
msgid "Enable notifications"
|
msgid "Enable notifications"
|
||||||
msgstr ""
|
msgstr "Meldingen inschakelen"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Check updates on startup"
|
msgid "Check updates on startup"
|
||||||
msgstr "Controleren op updates"
|
msgstr "Controleren op updates bij opstarten"
|
||||||
|
|
||||||
msgid "Optimize subscription"
|
msgid "Optimize subscription"
|
||||||
msgstr ""
|
msgstr "Abonnement optimaliseren"
|
||||||
|
|
||||||
msgid "Widget height, px"
|
msgid "Widget height, px"
|
||||||
msgstr ""
|
msgstr "Widget-hoogte, px"
|
||||||
|
|
||||||
msgid "Widget width, px"
|
msgid "Widget width, px"
|
||||||
msgstr ""
|
msgstr "Widget-breedte, px"
|
||||||
|
|
||||||
msgid "Time interval"
|
msgid "Time interval"
|
||||||
msgstr "Tijdstussenpose"
|
msgstr "Tijdstussenpose"
|
||||||
|
|
||||||
msgid "Messages queue limit"
|
msgid "Messages queue limit"
|
||||||
msgstr ""
|
msgstr "Limiet van berichtenwachtrij"
|
||||||
|
|
||||||
msgid "Temperature units"
|
msgid "Temperature units"
|
||||||
msgstr "Temperatuureenheden"
|
msgstr "Temperatuureenheden"
|
||||||
@ -113,43 +111,40 @@ msgid "AC offline tag"
|
|||||||
msgstr "AC offline-sleutelwoord"
|
msgstr "AC offline-sleutelwoord"
|
||||||
|
|
||||||
msgid "Drop key cache"
|
msgid "Drop key cache"
|
||||||
msgstr ""
|
msgstr "Sleutelcache verwerpen"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Export configuration"
|
msgid "Export configuration"
|
||||||
msgstr "Configuratie"
|
msgstr "Configuratie exporteren"
|
||||||
|
|
||||||
msgid "Export"
|
msgid "Export"
|
||||||
msgstr ""
|
msgstr "Exporteren"
|
||||||
|
|
||||||
msgid "Success"
|
msgid "Success"
|
||||||
msgstr ""
|
msgstr "Succesvol"
|
||||||
|
|
||||||
msgid "Please note that binary files were not copied"
|
msgid "Please note that binary files were not copied"
|
||||||
msgstr ""
|
msgstr "Let op: binaire bestanden zijn niet gekopieerd"
|
||||||
|
|
||||||
msgid "Ooops..."
|
msgid "Ooops..."
|
||||||
msgstr ""
|
msgstr "Oeps..."
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Could not save configuration file"
|
msgid "Could not save configuration file"
|
||||||
msgstr "Configuratie"
|
msgstr "Het configuratiebestand kon niet worden opgeslagen"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Import configuration"
|
msgid "Import configuration"
|
||||||
msgstr "Configuratie"
|
msgstr "Configuratie importeren"
|
||||||
|
|
||||||
msgid "Import"
|
msgid "Import"
|
||||||
msgstr ""
|
msgstr "Importeren"
|
||||||
|
|
||||||
msgid "Import plasmoid settings"
|
msgid "Import plasmoid settings"
|
||||||
msgstr ""
|
msgstr "Plasmoid-instellingen importeren"
|
||||||
|
|
||||||
msgid "Import extensions"
|
msgid "Import extensions"
|
||||||
msgstr ""
|
msgstr "Extensies importeren"
|
||||||
|
|
||||||
msgid "Import additional files"
|
msgid "Import additional files"
|
||||||
msgstr ""
|
msgstr "Extra bestanden importeren"
|
||||||
|
|
||||||
msgid "Font"
|
msgid "Font"
|
||||||
msgstr "Lettertype"
|
msgstr "Lettertype"
|
||||||
@ -190,22 +185,20 @@ msgstr "Selecteer een kleur"
|
|||||||
msgid "Select a font"
|
msgid "Select a font"
|
||||||
msgstr "Selecteer een lettertype"
|
msgstr "Selecteer een lettertype"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "ACPI"
|
msgid "ACPI"
|
||||||
msgstr "ACPI-pad"
|
msgstr "ACPI"
|
||||||
|
|
||||||
msgid "ACPI path"
|
msgid "ACPI path"
|
||||||
msgstr "ACPI-pad"
|
msgstr "ACPI-pad"
|
||||||
|
|
||||||
msgid "GPU"
|
msgid "GPU"
|
||||||
msgstr ""
|
msgstr "GPU"
|
||||||
|
|
||||||
msgid "GPU device"
|
msgid "GPU device"
|
||||||
msgstr "GPU-apparaat"
|
msgstr "GPU-apparaat"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "HDD temperature"
|
msgid "HDD temperature"
|
||||||
msgstr "Temperatuureenheden"
|
msgstr "HDD-temperatuur"
|
||||||
|
|
||||||
msgid "HDD"
|
msgid "HDD"
|
||||||
msgstr "HDD"
|
msgstr "HDD"
|
||||||
@ -214,10 +207,10 @@ msgid "hddtemp cmd"
|
|||||||
msgstr "hddtemp cmd"
|
msgstr "hddtemp cmd"
|
||||||
|
|
||||||
msgid "Player"
|
msgid "Player"
|
||||||
msgstr ""
|
msgstr "Speler"
|
||||||
|
|
||||||
msgid "Player data symbols"
|
msgid "Player data symbols"
|
||||||
msgstr ""
|
msgstr "Speler-gegevenssymbolen"
|
||||||
|
|
||||||
msgid "Music player"
|
msgid "Music player"
|
||||||
msgstr "Muziekspeler"
|
msgstr "Muziekspeler"
|
||||||
@ -232,7 +225,7 @@ msgid "MPD port"
|
|||||||
msgstr "MPD-poort"
|
msgstr "MPD-poort"
|
||||||
|
|
||||||
msgid "Extensions"
|
msgid "Extensions"
|
||||||
msgstr ""
|
msgstr "Extensies"
|
||||||
|
|
||||||
msgid "Custom scripts"
|
msgid "Custom scripts"
|
||||||
msgstr "Aangepaste scripts"
|
msgstr "Aangepaste scripts"
|
||||||
@ -241,11 +234,10 @@ msgid "Edit scripts"
|
|||||||
msgstr "Scripts bewerken"
|
msgstr "Scripts bewerken"
|
||||||
|
|
||||||
msgid "Quotes monitor"
|
msgid "Quotes monitor"
|
||||||
msgstr ""
|
msgstr "Citaten-monitor"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Edit tickers"
|
msgid "Edit tickers"
|
||||||
msgstr "Balken bewerken"
|
msgstr "Tickers bewerken"
|
||||||
|
|
||||||
msgid "Package manager"
|
msgid "Package manager"
|
||||||
msgstr "Pakketbeheerder"
|
msgstr "Pakketbeheerder"
|
||||||
@ -254,11 +246,10 @@ msgid "Edit command"
|
|||||||
msgstr "Commando bewerken"
|
msgstr "Commando bewerken"
|
||||||
|
|
||||||
msgid "Weather"
|
msgid "Weather"
|
||||||
msgstr ""
|
msgstr "Weer"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Edit weather"
|
msgid "Edit weather"
|
||||||
msgstr "Balken bewerken"
|
msgstr "Weer bewerken"
|
||||||
|
|
||||||
msgid "Select tag"
|
msgid "Select tag"
|
||||||
msgstr "Sleutelwoord selecteren"
|
msgstr "Sleutelwoord selecteren"
|
||||||
@ -281,7 +272,6 @@ msgstr "README weergeven"
|
|||||||
msgid "Check updates"
|
msgid "Check updates"
|
||||||
msgstr "Controleren op updates"
|
msgstr "Controleren op updates"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
|
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
|
||||||
"To enable them just make needed checkbox checked."
|
"To enable them just make needed checkbox checked."
|
||||||
@ -295,38 +285,35 @@ msgstr "Aantal waarden voor de opmerkingsballonnen"
|
|||||||
msgid "Background"
|
msgid "Background"
|
||||||
msgstr "Achtergrond"
|
msgstr "Achtergrond"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Background color"
|
msgid "Background color"
|
||||||
msgstr "Achtergrond"
|
msgstr "Achtergrondkleur"
|
||||||
|
|
||||||
msgid "CPU"
|
msgid "CPU"
|
||||||
msgstr ""
|
msgstr "CPU"
|
||||||
|
|
||||||
msgid "CPU color"
|
msgid "CPU color"
|
||||||
msgstr "CPU-kleur"
|
msgstr "CPU-kleur"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "CPU clock"
|
msgid "CPU clock"
|
||||||
msgstr "CPU-kleur"
|
msgstr "CPU-klok"
|
||||||
|
|
||||||
msgid "CPU clock color"
|
msgid "CPU clock color"
|
||||||
msgstr "CPU-klokkleur"
|
msgstr "CPU-klokkleur"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Memory"
|
msgid "Memory"
|
||||||
msgstr "Geheugenkleur"
|
msgstr "Geheugen"
|
||||||
|
|
||||||
msgid "Memory color"
|
msgid "Memory color"
|
||||||
msgstr "Geheugenkleur"
|
msgstr "Geheugenkleur"
|
||||||
|
|
||||||
msgid "Swap"
|
msgid "Swap"
|
||||||
msgstr ""
|
msgstr "SWAP"
|
||||||
|
|
||||||
msgid "Swap color"
|
msgid "Swap color"
|
||||||
msgstr "Swap-kleur"
|
msgstr "Swap-kleur"
|
||||||
|
|
||||||
msgid "Network"
|
msgid "Network"
|
||||||
msgstr ""
|
msgstr "Netwerk"
|
||||||
|
|
||||||
msgid "Download speed color"
|
msgid "Download speed color"
|
||||||
msgstr "Kleur van downloadsnelheid"
|
msgstr "Kleur van downloadsnelheid"
|
||||||
@ -335,7 +322,7 @@ msgid "Upload speed color"
|
|||||||
msgstr "Kleur van uploadsnelheid"
|
msgstr "Kleur van uploadsnelheid"
|
||||||
|
|
||||||
msgid "Battery"
|
msgid "Battery"
|
||||||
msgstr ""
|
msgstr "Accu"
|
||||||
|
|
||||||
msgid "Battery active color"
|
msgid "Battery active color"
|
||||||
msgstr "Kleur van actieve accu"
|
msgstr "Kleur van actieve accu"
|
||||||
@ -350,38 +337,35 @@ msgstr ""
|
|||||||
"Gedetailleerde informatie kan worden gevonden op de <a href=\"http://arcanis."
|
"Gedetailleerde informatie kan worden gevonden op de <a href=\"http://arcanis."
|
||||||
"name/projects/awesome-widgets/\">projectwebsite</a>"
|
"name/projects/awesome-widgets/\">projectwebsite</a>"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Bgcolor"
|
msgid "Bgcolor"
|
||||||
msgstr "CPU-kleur"
|
msgstr "Achtergrondkleur"
|
||||||
|
|
||||||
msgid "AC"
|
msgid "AC"
|
||||||
msgstr ""
|
msgstr "AC"
|
||||||
|
|
||||||
msgid "Bars"
|
msgid "Bars"
|
||||||
msgstr "Balken"
|
msgstr "Balken"
|
||||||
|
|
||||||
msgid "Desktops"
|
msgid "Desktops"
|
||||||
msgstr ""
|
msgstr "Bureaubladen"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Scripts"
|
msgid "Scripts"
|
||||||
msgstr "Scripts bewerken"
|
msgstr "Scripts"
|
||||||
|
|
||||||
msgid "Time"
|
msgid "Time"
|
||||||
msgstr ""
|
msgstr "Tijd"
|
||||||
|
|
||||||
msgid "Quotes"
|
msgid "Quotes"
|
||||||
msgstr ""
|
msgstr "Citaten"
|
||||||
|
|
||||||
msgid "Upgrades"
|
msgid "Upgrades"
|
||||||
msgstr ""
|
msgstr "Upgrades"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Weathers"
|
msgid "Weathers"
|
||||||
msgstr "Balken bewerken"
|
msgstr "Weer"
|
||||||
|
|
||||||
msgid "Functions"
|
msgid "Functions"
|
||||||
msgstr ""
|
msgstr "Mogelijkheden"
|
||||||
|
|
||||||
msgid "Add"
|
msgid "Add"
|
||||||
msgstr "Toevoegen"
|
msgstr "Toevoegen"
|
||||||
@ -393,19 +377,16 @@ msgid "Edit bars"
|
|||||||
msgstr "Balken bewerken"
|
msgstr "Balken bewerken"
|
||||||
|
|
||||||
msgid "Formatters"
|
msgid "Formatters"
|
||||||
msgstr ""
|
msgstr "Opmakers"
|
||||||
|
|
||||||
msgid "Preview"
|
msgid "Preview"
|
||||||
msgstr ""
|
msgstr "Voorbeeld"
|
||||||
|
|
||||||
msgid "Run %1"
|
msgid "Run %1"
|
||||||
msgstr "%1 uitvoeren"
|
msgstr "%1 uitvoeren"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Version %1 (build date %2)"
|
msgid "Version %1 (build date %2)"
|
||||||
msgstr ""
|
msgstr "Versie %1 (bouwdatum %2)"
|
||||||
"Versie %1\n"
|
|
||||||
"(bouwdatum %2)"
|
|
||||||
|
|
||||||
msgid "A set of minimalistic plasmoid widgets"
|
msgid "A set of minimalistic plasmoid widgets"
|
||||||
msgstr "Een set van minimalistische plasmoid-widgets"
|
msgstr "Een set van minimalistische plasmoid-widgets"
|
||||||
@ -441,7 +422,7 @@ msgid "This software uses: %1"
|
|||||||
msgstr "Deze software gebruikt: %1"
|
msgstr "Deze software gebruikt: %1"
|
||||||
|
|
||||||
msgid "Special thanks to %1"
|
msgid "Special thanks to %1"
|
||||||
msgstr ""
|
msgstr "Veel dank aan %1"
|
||||||
|
|
||||||
msgid "Select font"
|
msgid "Select font"
|
||||||
msgstr "Lettertype selecteren"
|
msgstr "Lettertype selecteren"
|
||||||
@ -461,9 +442,8 @@ msgstr "Hoog geheugenverbruik"
|
|||||||
msgid "Swap is used"
|
msgid "Swap is used"
|
||||||
msgstr "Swap wordt gebruikt"
|
msgstr "Swap wordt gebruikt"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "High GPU load"
|
msgid "High GPU load"
|
||||||
msgstr "Hoog CPU-verbruik"
|
msgstr "Hoog GPU-verbruik"
|
||||||
|
|
||||||
msgid "Network device has been changed to %1"
|
msgid "Network device has been changed to %1"
|
||||||
msgstr "Het netwerkapparaat is gewijzigd naar %1"
|
msgstr "Het netwerkapparaat is gewijzigd naar %1"
|
||||||
@ -471,29 +451,26 @@ msgstr "Het netwerkapparaat is gewijzigd naar %1"
|
|||||||
msgid "Edit"
|
msgid "Edit"
|
||||||
msgstr "Bewerken"
|
msgstr "Bewerken"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Select type"
|
msgid "Select type"
|
||||||
msgstr "Sleutelwoord selecteren"
|
msgstr "Type selecteren"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Type:"
|
msgid "Type:"
|
||||||
msgstr "Type"
|
msgstr "Type:"
|
||||||
|
|
||||||
msgid "MB/s"
|
msgid "MB/s"
|
||||||
msgstr ""
|
msgstr "MB/s"
|
||||||
|
|
||||||
msgid "KB/s"
|
msgid "KB/s"
|
||||||
msgstr ""
|
msgstr "KB/s"
|
||||||
|
|
||||||
msgid "Changelog of %1"
|
msgid "Changelog of %1"
|
||||||
msgstr ""
|
msgstr "Wijzigingslog van %1"
|
||||||
|
|
||||||
msgid "You are using the actual version %1"
|
msgid "You are using the actual version %1"
|
||||||
msgstr ""
|
msgstr "U gebruikt de actuele versie %1"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "No new version found"
|
msgid "No new version found"
|
||||||
msgstr "Nieuwe versie: %1"
|
msgstr "Geen nieuwe versie gevonden"
|
||||||
|
|
||||||
msgid "Current version : %1"
|
msgid "Current version : %1"
|
||||||
msgstr "Huidige versie: %1"
|
msgstr "Huidige versie: %1"
|
||||||
@ -528,9 +505,8 @@ msgstr "Naam: %1"
|
|||||||
msgid "Comment: %1"
|
msgid "Comment: %1"
|
||||||
msgstr "Commentaar: %1"
|
msgstr "Commentaar: %1"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Identity: %1"
|
msgid "Identity: %1"
|
||||||
msgstr "Commentaar: %1"
|
msgstr "Identiteit: %1"
|
||||||
|
|
||||||
msgid "Name"
|
msgid "Name"
|
||||||
msgstr "Naam"
|
msgstr "Naam"
|
||||||
@ -541,47 +517,44 @@ msgstr "Commentaar"
|
|||||||
msgid "Type"
|
msgid "Type"
|
||||||
msgstr "Type"
|
msgstr "Type"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Format"
|
msgid "Format"
|
||||||
msgstr "normaal"
|
msgstr "Opmaak"
|
||||||
|
|
||||||
msgid "Precision"
|
msgid "Precision"
|
||||||
msgstr ""
|
msgstr "Precisie"
|
||||||
|
|
||||||
msgid "Width"
|
msgid "Width"
|
||||||
msgstr "Breedte"
|
msgstr "Breedte"
|
||||||
|
|
||||||
msgid "Fill char"
|
msgid "Fill char"
|
||||||
msgstr ""
|
msgstr "Karakters vullen"
|
||||||
|
|
||||||
msgid "Force width"
|
msgid "Force width"
|
||||||
msgstr ""
|
msgstr "Breedte forceren"
|
||||||
|
|
||||||
msgid "Multiplier"
|
msgid "Multiplier"
|
||||||
msgstr ""
|
msgstr "Vermenigvuldiger"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Summand"
|
msgid "Summand"
|
||||||
msgstr "Commentaar"
|
msgstr "Lid"
|
||||||
|
|
||||||
msgid "Filter"
|
msgid "Filter"
|
||||||
msgstr ""
|
msgstr "Filter"
|
||||||
|
|
||||||
msgid "Separator"
|
msgid "Separator"
|
||||||
msgstr ""
|
msgstr "Scheidingslijn"
|
||||||
|
|
||||||
msgid "Sort"
|
msgid "Sort"
|
||||||
msgstr ""
|
msgstr "Sorteren"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Append code"
|
msgid "Append code"
|
||||||
msgstr "Uiterlijk"
|
msgstr "Code toewijzen"
|
||||||
|
|
||||||
msgid "Has return"
|
msgid "Has return"
|
||||||
msgstr ""
|
msgstr "Heeft return"
|
||||||
|
|
||||||
msgid "Code"
|
msgid "Code"
|
||||||
msgstr ""
|
msgstr "Code"
|
||||||
|
|
||||||
msgid "Tag"
|
msgid "Tag"
|
||||||
msgstr "Sleutelwoord"
|
msgstr "Sleutelwoord"
|
||||||
@ -592,81 +565,76 @@ msgid ""
|
|||||||
"text-decoration: underline; color:#0057ae;\">http://finance.yahoo.com/</"
|
"text-decoration: underline; color:#0057ae;\">http://finance.yahoo.com/</"
|
||||||
"span></a></p></body></html>"
|
"span></a></p></body></html>"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"<html><head/><body><p>Gebruik YAHOO! financiën-ticket om citaten te "
|
||||||
|
"verkrijgen voor het instrument. Refereer naar <a href=\"http://finance.yahoo."
|
||||||
|
"com/\"><span style=\" text-decoration: underline; color:#0057ae;\">http://"
|
||||||
|
"finance.yahoo.com/</span></a></p></body></html>"
|
||||||
|
|
||||||
msgid "Ticker"
|
msgid "Ticker"
|
||||||
msgstr ""
|
msgstr "Ticker"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Active"
|
msgid "Active"
|
||||||
msgstr "Actieve kleur"
|
msgstr "Actief"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Interval"
|
msgid "Interval"
|
||||||
msgstr "Tijdstussenpose"
|
msgstr "Tussenpozen"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Command"
|
msgid "Command"
|
||||||
msgstr "Commentaar"
|
msgstr "Commando"
|
||||||
|
|
||||||
msgid "Prefix"
|
msgid "Prefix"
|
||||||
msgstr ""
|
msgstr "Voorvoegsel"
|
||||||
|
|
||||||
msgid "Redirect"
|
msgid "Redirect"
|
||||||
msgstr ""
|
msgstr "Doorsturen"
|
||||||
|
|
||||||
msgid "Additional filters"
|
msgid "Additional filters"
|
||||||
msgstr ""
|
msgstr "Extra filters"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Wrap colors"
|
msgid "Wrap colors"
|
||||||
msgstr "Swap-kleur"
|
msgstr "Omslagkleuren"
|
||||||
|
|
||||||
msgid "Wrap spaces"
|
msgid "Wrap spaces"
|
||||||
msgstr ""
|
msgstr "Omslagwitruimten"
|
||||||
|
|
||||||
msgid "Null"
|
msgid "Null"
|
||||||
msgstr ""
|
msgstr "Null"
|
||||||
|
|
||||||
msgid "Provider"
|
msgid "Provider"
|
||||||
msgstr ""
|
msgstr "Dienst"
|
||||||
|
|
||||||
msgid "City"
|
msgid "City"
|
||||||
msgstr ""
|
msgstr "Stad"
|
||||||
|
|
||||||
msgid "Country"
|
msgid "Country"
|
||||||
msgstr ""
|
msgstr "Land"
|
||||||
|
|
||||||
msgid "Timestamp"
|
msgid "Timestamp"
|
||||||
msgstr ""
|
msgstr "Tijdstempel"
|
||||||
|
|
||||||
msgid "Use images"
|
msgid "Use images"
|
||||||
msgstr ""
|
msgstr "Afbeeldingen gebruiken"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Use custom formula"
|
msgid "Use custom formula"
|
||||||
msgstr "Aangepaste tijdsopmaak"
|
msgstr "Aangepaste formule gebruiken"
|
||||||
|
|
||||||
msgid "Value"
|
msgid "Value"
|
||||||
msgstr "Waarde"
|
msgstr "Waarde"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Max value"
|
msgid "Max value"
|
||||||
msgstr "Waarde weergeven"
|
msgstr "Maximale waarde"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Min value"
|
msgid "Min value"
|
||||||
msgstr "Waarde weergeven"
|
msgstr "Minimale waarde"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Active filling type"
|
msgid "Active filling type"
|
||||||
msgstr "Actieve kleur"
|
msgstr "Actief vultype"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Inctive filling type"
|
msgid "Inctive filling type"
|
||||||
msgstr "Inactieve kleur"
|
msgstr "Inactief vultype"
|
||||||
|
|
||||||
msgid "Points count"
|
msgid "Points count"
|
||||||
msgstr ""
|
msgstr "Puntentelling"
|
||||||
|
|
||||||
msgid "Direction"
|
msgid "Direction"
|
||||||
msgstr "Richting"
|
msgstr "Richting"
|
||||||
@ -674,20 +642,17 @@ msgstr "Richting"
|
|||||||
msgid "Height"
|
msgid "Height"
|
||||||
msgstr "Hoogte"
|
msgstr "Hoogte"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "color"
|
msgid "color"
|
||||||
msgstr "CPU-kleur"
|
msgstr "kleur"
|
||||||
|
|
||||||
msgid "image"
|
msgid "image"
|
||||||
msgstr ""
|
msgstr "afbeelding"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Active desktop"
|
msgid "Active desktop"
|
||||||
msgstr "Actieve kleur"
|
msgstr "Actief bureaublad"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Inactive desktop"
|
msgid "Inactive desktop"
|
||||||
msgstr "Inactieve kleur"
|
msgstr "Inactief bureaublad"
|
||||||
|
|
||||||
msgid "Vertical layout"
|
msgid "Vertical layout"
|
||||||
msgstr "Verticale layout"
|
msgstr "Verticale layout"
|
||||||
@ -695,9 +660,8 @@ msgstr "Verticale layout"
|
|||||||
msgid "Mark"
|
msgid "Mark"
|
||||||
msgstr "Markeren"
|
msgstr "Markeren"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Tooltip type"
|
msgid "Tooltip type"
|
||||||
msgstr "Opmerkingsballon"
|
msgstr "Opmerkingsballon-type"
|
||||||
|
|
||||||
msgid "contours"
|
msgid "contours"
|
||||||
msgstr "contouren"
|
msgstr "contouren"
|
||||||
@ -724,142 +688,3 @@ msgstr "Heimen Stoffels"
|
|||||||
msgctxt "EMAIL OF TRANSLATORS"
|
msgctxt "EMAIL OF TRANSLATORS"
|
||||||
msgid "Your emails"
|
msgid "Your emails"
|
||||||
msgstr "vistausss@outlook.com"
|
msgstr "vistausss@outlook.com"
|
||||||
|
|
||||||
#~ msgid "Active color"
|
|
||||||
#~ msgstr "Actieve kleur"
|
|
||||||
|
|
||||||
#~ msgid "Inactive color"
|
|
||||||
#~ msgstr "Inactieve kleur"
|
|
||||||
|
|
||||||
#~ msgid "Free space on %1 less than 10%"
|
|
||||||
#~ msgstr "De vrije ruimte op %1 is minder dan 10%"
|
|
||||||
|
|
||||||
#~ 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 "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 "Ctrl+B"
|
|
||||||
#~ msgstr "Ctrl+B"
|
|
||||||
|
|
||||||
#~ msgid "Ctrl+I"
|
|
||||||
#~ msgstr "Ctrl+I"
|
|
||||||
|
|
||||||
#~ msgid "Ctrl+U"
|
|
||||||
#~ msgstr "Ctrl+U"
|
|
||||||
|
@ -7,7 +7,7 @@ msgstr ""
|
|||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
|
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
|
||||||
"POT-Creation-Date: 2016-07-06 19:36+0300\n"
|
"POT-Creation-Date: 2016-07-06 19:36+0300\n"
|
||||||
"PO-Revision-Date: 2016-05-05 17:18+0300\n"
|
"PO-Revision-Date: 2016-08-09 22:22+0300\n"
|
||||||
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
|
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
|
||||||
"Language-Team: Ukrainian <kde-russian@lists.kde.ru>\n"
|
"Language-Team: Ukrainian <kde-russian@lists.kde.ru>\n"
|
||||||
"Language: uk\n"
|
"Language: uk\n"
|
||||||
@ -16,7 +16,7 @@ msgstr ""
|
|||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
|
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
|
||||||
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||||
"X-Generator: Poedit 1.8.7.1\n"
|
"X-Generator: Poedit 1.8.8\n"
|
||||||
|
|
||||||
msgid "Widget"
|
msgid "Widget"
|
||||||
msgstr "Віджет"
|
msgstr "Віджет"
|
||||||
@ -376,7 +376,7 @@ msgid "Edit bars"
|
|||||||
msgstr "Редагувати бари"
|
msgstr "Редагувати бари"
|
||||||
|
|
||||||
msgid "Formatters"
|
msgid "Formatters"
|
||||||
msgstr ""
|
msgstr "Форматери"
|
||||||
|
|
||||||
msgid "Preview"
|
msgid "Preview"
|
||||||
msgstr "Попередній перегляд"
|
msgstr "Попередній перегляд"
|
||||||
@ -447,17 +447,14 @@ msgstr "Високе завантаження GPU"
|
|||||||
msgid "Network device has been changed to %1"
|
msgid "Network device has been changed to %1"
|
||||||
msgstr "Мережевий пристрій було змінено на %1"
|
msgstr "Мережевий пристрій було змінено на %1"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Edit"
|
msgid "Edit"
|
||||||
msgstr "Редагувати"
|
msgstr "Редагувати"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Select type"
|
msgid "Select type"
|
||||||
msgstr "Оберіть тег"
|
msgstr "Оберіть тип"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Type:"
|
msgid "Type:"
|
||||||
msgstr "Тип"
|
msgstr "Тип:"
|
||||||
|
|
||||||
msgid "MB/s"
|
msgid "MB/s"
|
||||||
msgstr "МБ/с"
|
msgstr "МБ/с"
|
||||||
@ -519,47 +516,44 @@ msgstr "Коментар"
|
|||||||
msgid "Type"
|
msgid "Type"
|
||||||
msgstr "Тип"
|
msgstr "Тип"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Format"
|
msgid "Format"
|
||||||
msgstr "Form"
|
msgstr "Формат"
|
||||||
|
|
||||||
msgid "Precision"
|
msgid "Precision"
|
||||||
msgstr ""
|
msgstr "Точність"
|
||||||
|
|
||||||
msgid "Width"
|
msgid "Width"
|
||||||
msgstr "Ширина"
|
msgstr "Ширина"
|
||||||
|
|
||||||
msgid "Fill char"
|
msgid "Fill char"
|
||||||
msgstr ""
|
msgstr "Заповнення"
|
||||||
|
|
||||||
msgid "Force width"
|
msgid "Force width"
|
||||||
msgstr ""
|
msgstr "Зафіксувати ширину"
|
||||||
|
|
||||||
msgid "Multiplier"
|
msgid "Multiplier"
|
||||||
msgstr ""
|
msgstr "Множник"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Summand"
|
msgid "Summand"
|
||||||
msgstr "Команда"
|
msgstr "Доданок"
|
||||||
|
|
||||||
msgid "Filter"
|
msgid "Filter"
|
||||||
msgstr "Фільтр"
|
msgstr "Фільтр"
|
||||||
|
|
||||||
msgid "Separator"
|
msgid "Separator"
|
||||||
msgstr ""
|
msgstr "Роздільник"
|
||||||
|
|
||||||
msgid "Sort"
|
msgid "Sort"
|
||||||
msgstr ""
|
msgstr "Сортування"
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Append code"
|
msgid "Append code"
|
||||||
msgstr "Зовнішній вигляд"
|
msgstr "Доповнити код"
|
||||||
|
|
||||||
msgid "Has return"
|
msgid "Has return"
|
||||||
msgstr ""
|
msgstr "Має return"
|
||||||
|
|
||||||
msgid "Code"
|
msgid "Code"
|
||||||
msgstr ""
|
msgstr "Код"
|
||||||
|
|
||||||
msgid "Tag"
|
msgid "Tag"
|
||||||
msgstr "Тег"
|
msgstr "Тег"
|
||||||
@ -606,7 +600,7 @@ msgid "Null"
|
|||||||
msgstr "Пусті рядки"
|
msgstr "Пусті рядки"
|
||||||
|
|
||||||
msgid "Provider"
|
msgid "Provider"
|
||||||
msgstr ""
|
msgstr "Провайдер"
|
||||||
|
|
||||||
msgid "City"
|
msgid "City"
|
||||||
msgstr "Місто"
|
msgstr "Місто"
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
// extweather api version
|
// extweather api version
|
||||||
#define AWEWAPI 3
|
#define AWEWAPI 3
|
||||||
// formatter api version
|
// formatter api version
|
||||||
#define AWEFAPI 1
|
#define AWEFAPI 2
|
||||||
// network requests timeout, ms
|
// network requests timeout, ms
|
||||||
#define REQUEST_TIMEOUT 3000
|
#define REQUEST_TIMEOUT 3000
|
||||||
// available time keys
|
// available time keys
|
||||||
|
Loading…
Reference in New Issue
Block a user