From d856fa8e97e67144bdd4ff1cd74aa420433266db Mon Sep 17 00:00:00 2001 From: arcan1s Date: Fri, 5 Feb 2016 11:08:09 +0300 Subject: [PATCH] possible fix #75 I've added 'optimize' option (by default true). If it options is set then sources will be checked if they are required (with dependencies if any). And if they are not required they will be dropped by using common mechanism. Please note that if this option enabled the following features (at the moment) will be unavailable: * key request from context menu (from configuration interface it still works) * notifications event if sources on which notification is not connected I suppose this commit will increase performance in about 4-5 times. --- .../package/contents/config/main.xml | 9 +- .../package/contents/ui/advanced.qml | 15 ++++ .../package/contents/ui/main.qml | 16 ++-- .../package/contents/ui/tooltip.qml | 36 ++++---- .../package/contents/ui/widget.qml | 4 +- .../plugin/awdataaggregator.cpp | 39 +++++---- .../plugin/awdataengineaggregator.cpp | 63 +++++++------- .../plugin/awdataengineaggregator.h | 12 +-- sources/awesome-widget/plugin/awkeycache.cpp | 87 +++++++++++++++++++ sources/awesome-widget/plugin/awkeycache.h | 4 + sources/awesome-widget/plugin/awkeys.cpp | 42 +++++---- sources/awesome-widget/plugin/awkeys.h | 6 +- .../plugin/awkeysaggregator.cpp | 78 +++++------------ .../awesome-widget/plugin/awkeysaggregator.h | 5 +- sources/translations/awesome-widgets.pot | 50 ++++++----- sources/translations/en.po | 55 +++++++----- sources/translations/es.po | 53 ++++++----- sources/translations/fr.po | 56 ++++++------ sources/translations/nl.po | 52 ++++++----- sources/translations/pt_BR.po | 52 ++++++----- sources/translations/ru.po | 57 +++++++----- sources/translations/uk.po | 55 +++++++----- sources/translations/zh.po | 50 ++++++----- 23 files changed, 522 insertions(+), 374 deletions(-) diff --git a/sources/awesome-widget/package/contents/config/main.xml b/sources/awesome-widget/package/contents/config/main.xml index 05fc242..23d14c7 100644 --- a/sources/awesome-widget/package/contents/config/main.xml +++ b/sources/awesome-widget/package/contents/config/main.xml @@ -32,6 +32,9 @@ true + + true + 0 @@ -95,13 +98,13 @@ #ffff00 - + true - + #00ffff - + #ff00ff diff --git a/sources/awesome-widget/package/contents/ui/advanced.qml b/sources/awesome-widget/package/contents/ui/advanced.qml index 01bcd58..273727b 100644 --- a/sources/awesome-widget/package/contents/ui/advanced.qml +++ b/sources/awesome-widget/package/contents/ui/advanced.qml @@ -45,6 +45,7 @@ Item { property alias cfg_wrapText: wordWrap.checked property alias cfg_notify: notify.checked property alias cfg_checkUpdates: updates.checked + property alias cfg_optimize: optimize.checked property alias cfg_height: widgetHeight.value property alias cfg_width: widgetWidth.value property alias cfg_interval: update.value @@ -143,6 +144,20 @@ Item { } } + Row { + height: implicitHeight + width: parent.width + QtControls.Label { + height: parent.heigth + width: parent.width * 2 / 5 + } + QtControls.CheckBox { + id: optimize + width: parent.width * 3 / 5 + text: i18n("Optimize subscription") + } + } + Row { height: implicitHeight width: parent.width diff --git a/sources/awesome-widget/package/contents/ui/main.qml b/sources/awesome-widget/package/contents/ui/main.qml index 23e9690..0e20bc9 100644 --- a/sources/awesome-widget/package/contents/ui/main.qml +++ b/sources/awesome-widget/package/contents/ui/main.qml @@ -46,15 +46,15 @@ Item { "cpuclTooltip": plasmoid.configuration.cpuclTooltip, "memTooltip": plasmoid.configuration.memTooltip, "swapTooltip": plasmoid.configuration.swapTooltip, - "downTooltip": plasmoid.configuration.downTooltip, - "upTooltip": plasmoid.configuration.downTooltip, + "downkbTooltip": plasmoid.configuration.downkbTooltip, + "upkbTooltip": plasmoid.configuration.downkbTooltip, "batTooltip": plasmoid.configuration.batTooltip, "cpuTooltipColor": plasmoid.configuration.cpuTooltipColor, "cpuclTooltipColor": plasmoid.configuration.cpuclTooltipColor, "memTooltipColor": plasmoid.configuration.memTooltipColor, "swapTooltipColor": plasmoid.configuration.swapTooltipColor, - "downTooltipColor": plasmoid.configuration.downTooltipColor, - "upTooltipColor": plasmoid.configuration.upTooltipColor, + "downkbTooltipColor": plasmoid.configuration.downkbTooltipColor, + "upkbTooltipColor": plasmoid.configuration.upkbTooltipColor, "batTooltipColor": plasmoid.configuration.batTooltipColor, "batInTooltipColor": plasmoid.configuration.batInTooltipColor, // additional field to parse AC status @@ -136,7 +136,9 @@ Item { if (debug) console.debug() // actions - plasmoid.setAction("requestKey", i18n("Request key"), "utilities-system-monitor") + // it makes no sense to use this field with optimization enable + if (!plasmoid.configuration.optimize) + plasmoid.setAction("requestKey", i18n("Request key"), "utilities-system-monitor") plasmoid.setAction("showReadme", i18n("Show README"), "text-x-readme") plasmoid.setAction("checkUpdates", i18n("Check updates"), "system-software-update") // init submodule @@ -187,9 +189,9 @@ Item { if (debug) console.debug() // init submodule - awKeys.initKeys(plasmoid.configuration.text, plasmoid.configuration.interval, - plasmoid.configuration.queueLimit) awKeys.initDataAggregator(tooltipSettings) + awKeys.initKeys(plasmoid.configuration.text, plasmoid.configuration.interval, + plasmoid.configuration.queueLimit, plasmoid.configuration.optimize) awKeys.setWrapNewLines(plasmoid.configuration.wrapNewLines) // configure aggregator awKeys.setAggregatorProperty("acOffline", plasmoid.configuration.acOffline) diff --git a/sources/awesome-widget/package/contents/ui/tooltip.qml b/sources/awesome-widget/package/contents/ui/tooltip.qml index 15b68f4..64eba9a 100644 --- a/sources/awesome-widget/package/contents/ui/tooltip.qml +++ b/sources/awesome-widget/package/contents/ui/tooltip.qml @@ -48,9 +48,9 @@ Item { property alias cfg_memTooltipColor: memTooltipColor.text property alias cfg_swapTooltip: swapTooltip.checked property alias cfg_swapTooltipColor: swapTooltipColor.text - property alias cfg_downTooltip: downTooltip.checked - property alias cfg_downTooltipColor: downTooltipColor.text - property alias cfg_upTooltipColor: upTooltipColor.text + property alias cfg_downkbTooltip: downkbTooltip.checked + property alias cfg_downkbTooltipColor: downkbTooltipColor.text + property alias cfg_upkbTooltipColor: upkbTooltipColor.text property alias cfg_batTooltip: batTooltip.checked property alias cfg_batTooltipColor: batTooltipColor.text property alias cfg_batInTooltipColor: batInTooltipColor.text @@ -273,7 +273,7 @@ Item { } QtControls.GroupBox { - id: downTooltip + id: downkbTooltip height: implicitHeight width: parent.width checkable: true @@ -292,22 +292,22 @@ Item { text: i18n("Download speed color") } QtControls.Button { - id: downTooltipColor + id: downkbTooltipColor width: parent.width * 3 / 5 style: QtStyles.ButtonStyle { background: Rectangle { - color: plasmoid.configuration.downTooltipColor + color: plasmoid.configuration.downkbTooltipColor } } - text: plasmoid.configuration.downTooltipColor - onClicked: downTooltipColorDialog.visible = true + text: plasmoid.configuration.downkbTooltipColor + onClicked: downkbTooltipColorDialog.visible = true } QtDialogs.ColorDialog { - id: downTooltipColorDialog + id: downkbTooltipColorDialog title: i18n("Select a color") - color: downTooltipColor.text - onAccepted: downTooltipColor.text = downTooltipColorDialog.color + color: downkbTooltipColor.text + onAccepted: downkbTooltipColor.text = downkbTooltipColorDialog.color } } Row { @@ -321,22 +321,22 @@ Item { text: i18n("Upload speed color") } QtControls.Button { - id: upTooltipColor + id: upkbTooltipColor width: parent.width * 3 / 5 style: QtStyles.ButtonStyle { background: Rectangle { - color: plasmoid.configuration.upTooltipColor + color: plasmoid.configuration.upkbTooltipColor } } - text: plasmoid.configuration.upTooltipColor - onClicked: upTooltipColorDialog.visible = true + text: plasmoid.configuration.upkbTooltipColor + onClicked: upkbTooltipColorDialog.visible = true } QtDialogs.ColorDialog { - id: upTooltipColorDialog + id: upkbTooltipColorDialog title: i18n("Select a color") - color: upTooltipColor.text - onAccepted: upTooltipColor.text = upTooltipColorDialog.color + color: upkbTooltipColor.text + onAccepted: upkbTooltipColor.text = upkbTooltipColorDialog.color } } } diff --git a/sources/awesome-widget/package/contents/ui/widget.qml b/sources/awesome-widget/package/contents/ui/widget.qml index 4c7c508..0034686 100644 --- a/sources/awesome-widget/package/contents/ui/widget.qml +++ b/sources/awesome-widget/package/contents/ui/widget.qml @@ -318,7 +318,7 @@ Item { onClicked: { lock = false awKeys.initKeys(textPattern.text, plasmoid.configuration.interval, - plasmoid.configuration.queueLimit) + plasmoid.configuration.queueLimit, false) awKeys.needToBeUpdated() } } @@ -346,7 +346,7 @@ Item { awKeys.needTextToBeUpdated.connect(needTextUpdate) // init submodule awKeys.initKeys(plasmoid.configuration.text, plasmoid.configuration.interval, - plasmoid.configuration.queueLimit) + plasmoid.configuration.queueLimit, false) awKeys.setAggregatorProperty("acOffline", plasmoid.configuration.acOffline) awKeys.setAggregatorProperty("acOnline", plasmoid.configuration.acOnline) awKeys.setAggregatorProperty("customTime", plasmoid.configuration.customTime) diff --git a/sources/awesome-widget/plugin/awdataaggregator.cpp b/sources/awesome-widget/plugin/awdataaggregator.cpp index 01b358c..4bc886f 100644 --- a/sources/awesome-widget/plugin/awdataaggregator.cpp +++ b/sources/awesome-widget/plugin/awdataaggregator.cpp @@ -87,7 +87,7 @@ void AWDataAggregator::setParameters(QVariantMap settings) counts += configuration[QString("cpuclTooltip")].toInt(); counts += configuration[QString("memTooltip")].toInt(); counts += configuration[QString("swapTooltip")].toInt(); - counts += configuration[QString("downTooltip")].toInt(); + counts += configuration[QString("downkbTooltip")].toInt(); counts += configuration[QString("batTooltip")].toInt(); // resize tooltip image toolTipView->resize(100 * counts, 105); @@ -96,8 +96,8 @@ void AWDataAggregator::setParameters(QVariantMap settings) boundaries[QString("cpuclTooltip")] = 4000.0; boundaries[QString("memTooltip")] = 100.0; boundaries[QString("swapTooltip")] = 100.0; - boundaries[QString("downTooltip")] = 1.0; - boundaries[QString("upTooltip")] = 1.0; + boundaries[QString("downkbTooltip")] = 1.0; + boundaries[QString("upkbTooltip")] = 1.0; boundaries[QString("batTooltip")] = 100.0; requiredKeys.clear(); @@ -109,10 +109,10 @@ void AWDataAggregator::setParameters(QVariantMap settings) requiredKeys.append(QString("memTooltip")); if (configuration[QString("swapTooltip")].toBool()) requiredKeys.append(QString("swapTooltip")); - if (configuration[QString("downTooltip")].toBool()) - requiredKeys.append(QString("downTooltip")); - if (configuration[QString("upTooltip")].toBool()) - requiredKeys.append(QString("upTooltip")); + if (configuration[QString("downkbTooltip")].toBool()) + requiredKeys.append(QString("downkbTooltip")); + if (configuration[QString("upkbTooltip")].toBool()) + requiredKeys.append(QString("upkbTooltip")); if (configuration[QString("batTooltip")].toBool()) requiredKeys.append(QString("batTooltip")); @@ -133,9 +133,9 @@ QPixmap AWDataAggregator::tooltipImage() bool down = false; for (auto key : requiredKeys) { // create frame - float normX = 100.0 / static_cast(data[key].count()); - float normY = 100.0 / (1.5 * boundaries[key]); - float shift = requiredKeys.indexOf(key) * 100.0; + float normX = 100.0f / static_cast(data[key].count()); + float normY = 100.0f / (1.5f * boundaries[key]); + float shift = requiredKeys.indexOf(key) * 100.0f; if (down) shift -= 100.0; // apply pen color @@ -146,9 +146,9 @@ QPixmap AWDataAggregator::tooltipImage() for (int j = 0; j < data[key].count() - 1; j++) { // some magic here float x1 = j * normX + shift; - float y1 = -fabs(data[key].at(j)) * normY + 5.0; + float y1 = -fabs(data[key].at(j)) * normY + 5.0f; float x2 = (j + 1) * normX + shift; - float y2 = -fabs(data[key].at(j + 1)) * normY + 5.0; + float y2 = -fabs(data[key].at(j + 1)) * normY + 5.0f; if (key == QString("batTooltip")) { if (data[key].at(j + 1) > 0) pen.setColor(QColor( @@ -160,7 +160,7 @@ QPixmap AWDataAggregator::tooltipImage() } toolTipScene->addLine(x1, y1, x2, y2, pen); } - if (key == QString("downTooltip")) + if (key == QString("downkbTooltip")) down = true; } @@ -265,8 +265,8 @@ void AWDataAggregator::setData(const QHash &values) setData(QString("cpuclTooltip"), values[QString("cpucl")].toFloat()); setData(QString("memTooltip"), values[QString("mem")].toFloat(), 90.0); setData(QString("swapTooltip"), values[QString("swap")].toFloat(), 0.0); - setData(QString("downTooltip"), values[QString("downkb")].toFloat()); - setData(QString("upTooltip"), values[QString("upkb")].toFloat()); + setData(QString("downkbTooltip"), values[QString("downkb")].toFloat()); + setData(QString("upkbTooltip"), values[QString("upkb")].toFloat()); // additional check for network device [this](const QString value) { checkValue(QString("netdev"), currentNetworkDevice, value); @@ -298,12 +298,13 @@ void AWDataAggregator::setData(const QString &source, float value, checkValue(source, value, extremum); data[source].append(value); - if (source == QString("downTooltip")) { + if (source == QString("downkbTooltip")) { QList netValues - = data[QString("downTooltip")] + data[QString("upTooltip")]; - boundaries[QString("downTooltip")] + = data[QString("downkbTooltip")] + data[QString("upkbTooltip")]; + boundaries[QString("downkbTooltip")] = 1.2 * *std::max_element(netValues.cbegin(), netValues.cend()); - boundaries[QString("upTooltip")] = boundaries[QString("downTooltip")]; + boundaries[QString("upkbTooltip")] + = boundaries[QString("downkbTooltip")]; } } diff --git a/sources/awesome-widget/plugin/awdataengineaggregator.cpp b/sources/awesome-widget/plugin/awdataengineaggregator.cpp index 7ff6642..4b75e7f 100644 --- a/sources/awesome-widget/plugin/awdataengineaggregator.cpp +++ b/sources/awesome-widget/plugin/awdataengineaggregator.cpp @@ -21,14 +21,10 @@ #include "awkeys.h" -AWDataEngineAggregator::AWDataEngineAggregator(QObject *parent, - const int interval) +AWDataEngineAggregator::AWDataEngineAggregator(QObject *parent) : QObject(parent) { qCDebug(LOG_AW) << __PRETTY_FUNCTION__; - - setInterval(interval); - initDataEngines(); } @@ -36,10 +32,17 @@ AWDataEngineAggregator::~AWDataEngineAggregator() { qCDebug(LOG_AW) << __PRETTY_FUNCTION__; + clear(); +} + + +void AWDataEngineAggregator::clear() +{ // disconnect sources first disconnectSources(); m_dataEngines.clear(); delete m_consumer; + m_consumer = nullptr; } @@ -51,11 +54,27 @@ void AWDataEngineAggregator::disconnectSources() } -void AWDataEngineAggregator::setInterval(const int _interval) +void AWDataEngineAggregator::initDataEngines(const int interval) { - qCDebug(LOG_AW) << "Interval" << _interval; + qCDebug(LOG_AW) << "Init dataengines with interval" << interval; - m_interval = _interval; + m_consumer = new Plasma::DataEngineConsumer(); + m_dataEngines[QString("systemmonitor")] + = m_consumer->dataEngine(QString("systemmonitor")); + m_dataEngines[QString("extsysmon")] + = m_consumer->dataEngine(QString("extsysmon")); + m_dataEngines[QString("time")] = m_consumer->dataEngine(QString("time")); + + // additional method required by systemmonitor structure + connect(m_dataEngines[QString("systemmonitor")], + &Plasma::DataEngine::sourceAdded, + [this, interval](const QString source) { + emit(deviceAdded(source)); + m_dataEngines[QString("systemmonitor")]->connectSource( + source, parent(), interval); + }); + + return reconnectSources(interval); } @@ -70,31 +89,13 @@ void AWDataEngineAggregator::dropSource(const QString source) } -void AWDataEngineAggregator::reconnectSources() +void AWDataEngineAggregator::reconnectSources(const int interval) { + qCDebug(LOG_AW) << "Reconnect sources with interval" << interval; + m_dataEngines[QString("systemmonitor")]->connectAllSources(parent(), - m_interval); - m_dataEngines[QString("extsysmon")]->connectAllSources(parent(), - m_interval); + interval); + m_dataEngines[QString("extsysmon")]->connectAllSources(parent(), interval); m_dataEngines[QString("time")]->connectSource(QString("Local"), parent(), 1000); } - - -void AWDataEngineAggregator::initDataEngines() -{ - m_consumer = new Plasma::DataEngineConsumer(); - m_dataEngines[QString("systemmonitor")] - = m_consumer->dataEngine(QString("systemmonitor")); - m_dataEngines[QString("extsysmon")] - = m_consumer->dataEngine(QString("extsysmon")); - m_dataEngines[QString("time")] = m_consumer->dataEngine(QString("time")); - - // additional method required by systemmonitor structure - connect(m_dataEngines[QString("systemmonitor")], - &Plasma::DataEngine::sourceAdded, [this](const QString source) { - emit(deviceAdded(source)); - m_dataEngines[QString("systemmonitor")]->connectSource( - source, parent(), m_interval); - }); -} diff --git a/sources/awesome-widget/plugin/awdataengineaggregator.h b/sources/awesome-widget/plugin/awdataengineaggregator.h index 229fce1..11afab3 100644 --- a/sources/awesome-widget/plugin/awdataengineaggregator.h +++ b/sources/awesome-widget/plugin/awdataengineaggregator.h @@ -28,28 +28,24 @@ class AWDataEngineAggregator : public QObject { Q_OBJECT - Q_PROPERTY(int interval MEMBER m_interval WRITE setInterval); public: - explicit AWDataEngineAggregator(QObject *parent = nullptr, - const int interval = 1000); + explicit AWDataEngineAggregator(QObject *parent = nullptr); virtual ~AWDataEngineAggregator(); + void clear(); void disconnectSources(); - // properties - void setInterval(const int _interval); + void initDataEngines(const int interval); signals: void deviceAdded(const QString &source); public slots: void dropSource(const QString source); - void reconnectSources(); + void reconnectSources(const int interval); private: - void initDataEngines(); Plasma::DataEngineConsumer *m_consumer = nullptr; QHash m_dataEngines; - int m_interval; }; diff --git a/sources/awesome-widget/plugin/awkeycache.cpp b/sources/awesome-widget/plugin/awkeycache.cpp index 4002f7d..c1133ad 100644 --- a/sources/awesome-widget/plugin/awkeycache.cpp +++ b/sources/awesome-widget/plugin/awkeycache.cpp @@ -81,6 +81,93 @@ bool AWKeyCache::addKeyToCache(const QString type, const QString key) } +QStringList AWKeyCache::getRequiredKeys(const QStringList &keys, + const QStringList &bars, + const QVariantMap &tooltip, + const QStringList &allKeys) +{ + qCDebug(LOG_AW) << "Looking for required keys in" << keys << bars + << "using tooltip settings" << tooltip; + + // initial copy + QSet used = QSet::fromList(keys); + // insert bars + for (auto bar : bars) { + bar.remove(QRegExp(QString("^bar[0-9]{1,}"))); + used << bar; + } + // insert keys from tooltip + for (auto key : tooltip.keys()) { + if ((key.endsWith(QString("Tooltip"))) && (tooltip[key].toBool())) { + key.remove(QString("Tooltip")); + used << key; + } + } + + // insert depending keys, refer to AWKeys::calculateValues() + // hddtotmb* + for (auto key : allKeys.filter(QRegExp(QString("^hddtotmb")))) { + if (!used.contains(key)) + continue; + key.remove(QString("hddtotmb")); + int index = key.toInt(); + used << QString("hddfreemb%1").arg(index) + << QString("hddmb%1").arg(index); + } + // hddtotgb* + for (auto key : allKeys.filter(QRegExp(QString("^hddtotgb")))) { + if (!used.contains(key)) + continue; + key.remove(QString("hddtotgb")); + int index = key.toInt(); + used << QString("hddfreegb%1").arg(index) + << QString("hddgb%1").arg(index); + } + // mem + if (used.contains(QString("mem"))) + used << QString("memmb") << QString("memtotmb"); + // memtotmb + if (used.contains(QString("memtotmb"))) + used << QString("memusedmb") << QString("memfreemb"); + // memtotgb + if (used.contains(QString("memtotgb"))) + used << QString("memusedgb") << QString("memfreegb"); + // swap + if (used.contains(QString("swap"))) + used << QString("swapmb") << QString("swaptotmb"); + // swaptotmb + if (used.contains(QString("swaptotmb"))) + used << QString("swapmb") << QString("swapfreemb"); + // memtotgb + if (used.contains(QString("swaptotgb"))) + used << QString("swapgb") << QString("swapfreegb"); + // network keys + QStringList netKeys(QStringList() << QString("up") << QString("upkb") + << QString("upunits") << QString("down") + << QString("downkb") + << QString("downunits")); + for (auto key : netKeys) { + if (!used.contains(key)) + continue; + QStringList filt + = allKeys.filter(QRegExp(QString("^%1[0-9]{1,}").arg(key))); + for (auto filtered : filt) + used << filtered; + } + // netdev key + if (std::any_of(netKeys.cbegin(), netKeys.cend(), + [&used](const QString &key) { return used.contains(key); })) + used << QString("netdev"); + + // HACK append dummy if there are no other keys. This hack is required + // because empty list leads to the same behaviour as skip checking + if (used.isEmpty()) + used << QString("dummy"); + + return used.toList(); +} + + QHash AWKeyCache::loadKeysFromCache() { QString fileName = QString("%1/awesomewidgets.ndx") diff --git a/sources/awesome-widget/plugin/awkeycache.h b/sources/awesome-widget/plugin/awkeycache.h index 806e61d..9685122 100644 --- a/sources/awesome-widget/plugin/awkeycache.h +++ b/sources/awesome-widget/plugin/awkeycache.h @@ -21,11 +21,15 @@ #include #include +#include namespace AWKeyCache { bool addKeyToCache(const QString type, const QString key = QString("")); +QStringList getRequiredKeys(const QStringList &keys, const QStringList &bars, + const QVariantMap &tooltip, + const QStringList &allKeys); QHash loadKeysFromCache(); }; diff --git a/sources/awesome-widget/plugin/awkeys.cpp b/sources/awesome-widget/plugin/awkeys.cpp index 23ccd90..eab56e3 100644 --- a/sources/awesome-widget/plugin/awkeys.cpp +++ b/sources/awesome-widget/plugin/awkeys.cpp @@ -25,6 +25,7 @@ #include "awdataaggregator.h" #include "awdataengineaggregator.h" #include "awdebug.h" +#include "awkeycache.h" #include "awkeyoperations.h" #include "awkeysaggregator.h" #include "awpatternfunctions.h" @@ -45,7 +46,9 @@ AWKeys::AWKeys(QObject *parent) aggregator = new AWKeysAggregator(this); dataAggregator = new AWDataAggregator(this); + dataEngineAggregator = new AWDataEngineAggregator(this); keyOperator = new AWKeyOperations(this); + // update key data if required connect(keyOperator, SIGNAL(updateKeys(QStringList)), this, SLOT(reinitKeys(QStringList))); @@ -53,6 +56,11 @@ AWKeys::AWKeys(QObject *parent) connect(dataAggregator, SIGNAL(toolTipPainted(const QString)), this, SIGNAL(needToolTipToBeUpdated(const QString))); connect(this, SIGNAL(needToBeUpdated()), this, SLOT(updateTextData())); + connect(this, SIGNAL(dropSourceFromDataengine(QString)), + dataEngineAggregator, SLOT(dropSource(QString))); + // transfer signal from dataengine to update source list + connect(dataEngineAggregator, SIGNAL(deviceAdded(const QString &)), + keyOperator, SLOT(addDevice(const QString &))); } @@ -73,32 +81,29 @@ void AWKeys::initDataAggregator(const QVariantMap tooltipParams) { qCDebug(LOG_AW) << "Tooltip parameters" << tooltipParams; - dataAggregator->setParameters(tooltipParams); + // store parameters to generate m_requiredKeys + m_tooltipParams = tooltipParams; + dataAggregator->setParameters(m_tooltipParams); } void AWKeys::initKeys(const QString currentPattern, const int interval, - const int limit) + const int limit, const bool optimize) { qCDebug(LOG_AW) << "Pattern" << currentPattern << "with interval" - << interval << "and queue limit" << limit; + << interval << "and queue limit" << limit + << "with optimization" << optimize; // init - keyOperator->setPattern(currentPattern); - if (dataEngineAggregator == nullptr) { - dataEngineAggregator = new AWDataEngineAggregator(this, interval); - connect(this, SIGNAL(dropSourceFromDataengine(QString)), - dataEngineAggregator, SLOT(dropSource(QString))); - // transfer signal from dataengine to update source list - connect(dataEngineAggregator, SIGNAL(deviceAdded(const QString &)), - keyOperator, SLOT(addDevice(const QString &))); - } else - dataEngineAggregator->setInterval(interval); + m_optimize = optimize; m_threadPool->setMaxThreadCount(limit == 0 ? QThread::idealThreadCount() : limit); + // child objects + keyOperator->setPattern(currentPattern); keyOperator->updateCache(); + dataEngineAggregator->clear(); - return dataEngineAggregator->reconnectSources(); + return dataEngineAggregator->initDataEngines(interval); } @@ -200,6 +205,11 @@ void AWKeys::reinitKeys(const QStringList currentKeys) m_foundKeys = AWPatternFunctions::findKeys(keyOperator->pattern(), currentKeys); m_foundLambdas = AWPatternFunctions::findLambdas(keyOperator->pattern()); + // get required keys + m_requiredKeys + = m_optimize ? AWKeyCache::getRequiredKeys(m_foundKeys, m_foundBars, + m_tooltipParams, currentKeys) + : QStringList(); // set key data to aggregator aggregator->setDevices(keyOperator->devices()); @@ -347,8 +357,8 @@ void AWKeys::setDataBySource(const QString &sourceName, const QVariantMap &data) // first list init QStringList tags = aggregator->keysFromSource(sourceName); if (tags.isEmpty()) - tags = aggregator->registerSource(sourceName, - data[QString("units")].toString()); + tags = aggregator->registerSource( + sourceName, data[QString("units")].toString(), m_requiredKeys); // update data or drop source if there are no matches and exit if (tags.isEmpty()) { diff --git a/sources/awesome-widget/plugin/awkeys.h b/sources/awesome-widget/plugin/awkeys.h index c3c0ff9..b834462 100644 --- a/sources/awesome-widget/plugin/awkeys.h +++ b/sources/awesome-widget/plugin/awkeys.h @@ -40,7 +40,7 @@ public: virtual ~AWKeys(); Q_INVOKABLE void initDataAggregator(const QVariantMap tooltipParams); Q_INVOKABLE void initKeys(const QString currentPattern, const int interval, - const int limit); + const int limit, const bool optimize); Q_INVOKABLE void setAggregatorProperty(const QString key, const QVariant value); Q_INVOKABLE void setWrapNewLines(const bool wrap = false); @@ -84,8 +84,10 @@ private: AWKeysAggregator *aggregator = nullptr; AWKeyOperations *keyOperator = nullptr; // variables - QStringList m_foundBars, m_foundKeys, m_foundLambdas; + QVariantMap m_tooltipParams; + QStringList m_foundBars, m_foundKeys, m_foundLambdas, m_requiredKeys; QHash values; + bool m_optimize = false; bool m_wrapNewLines = false; // multithread features QThreadPool *m_threadPool = nullptr; diff --git a/sources/awesome-widget/plugin/awkeysaggregator.cpp b/sources/awesome-widget/plugin/awkeysaggregator.cpp index f846b72..dc83ff6 100644 --- a/sources/awesome-widget/plugin/awkeysaggregator.cpp +++ b/sources/awesome-widget/plugin/awkeysaggregator.cpp @@ -154,15 +154,6 @@ QStringList AWKeysAggregator::keysFromSource(const QString &source) const } -QStringList -AWKeysAggregator::requiredByKeysFromSource(const QString &source) const -{ - qCDebug(LOG_AW) << "Search for source" << source; - - return m_requiredByMap.values(source); -} - - void AWKeysAggregator::setAcOffline(const QString inactive) { qCDebug(LOG_AW) << "Inactive AC string" << inactive; @@ -222,7 +213,8 @@ void AWKeysAggregator::setTranslate(const bool translate) // HACK units required to define should the value be calculated as temperature // or fan data QStringList AWKeysAggregator::registerSource(const QString &source, - const QString &units) + const QString &units, + const QStringList &keys) { qCDebug(LOG_AW) << "Source" << source << "with units" << units; @@ -338,11 +330,6 @@ QStringList AWKeysAggregator::registerSource(const QString &source, key = QString("hddfreegb%1").arg(index); m_map.insertMulti(source, key); m_formater[key] = MemGBFormat; - // fill required by list - m_requiredByMap.insertMulti(source, - QString("hddtotmb%1").arg(index)); - m_requiredByMap.insertMulti(source, - QString("hddtotgb%1").arg(index)); } } else if (source.contains(mountUsedRegExp)) { // used @@ -358,11 +345,6 @@ QStringList AWKeysAggregator::registerSource(const QString &source, key = QString("hddgb%1").arg(index); m_map.insertMulti(source, key); m_formater[key] = MemGBFormat; - // fill required by list - m_requiredByMap.insertMulti(source, - QString("hddtotmb%1").arg(index)); - m_requiredByMap.insertMulti(source, - QString("hddtotgb%1").arg(index)); } } else if (source.startsWith(QString("hdd/temperature"))) { // hdd temperature @@ -389,8 +371,6 @@ QStringList AWKeysAggregator::registerSource(const QString &source, // gb m_map.insertMulti(source, QString("memgb")); m_formater[QString("memgb")] = MemGBFormat; - // fill required by list - m_requiredByMap.insertMulti(source, QString("mem")); } else if (source == QString("mem/physical/free")) { // free memory // mb @@ -399,10 +379,6 @@ QStringList AWKeysAggregator::registerSource(const QString &source, // gb m_map.insertMulti(source, QString("memfreegb")); m_formater[QString("memfreegb")] = MemGBFormat; - // fill required by list - m_requiredByMap.insertMulti(source, QString("memtotmb")); - m_requiredByMap.insertMulti(source, QString("memtotgb")); - m_requiredByMap.insertMulti(source, QString("mem")); } else if (source == QString("mem/physical/used")) { // used memory // mb @@ -411,21 +387,10 @@ QStringList AWKeysAggregator::registerSource(const QString &source, // gb m_map.insertMulti(source, QString("memusedgb")); m_formater[QString("memusedgb")] = MemGBFormat; - // fill required by list - m_requiredByMap.insertMulti(source, QString("memtotmb")); - m_requiredByMap.insertMulti(source, QString("memtotgb")); - m_requiredByMap.insertMulti(source, QString("mem")); } else if (source == QString("network/current/name")) { // network device m_map[source] = QString("netdev"); m_formater[QString("netdev")] = NoFormat; - // fill required by list - m_requiredByMap.insertMulti(source, QString("down")); - m_requiredByMap.insertMulti(source, QString("downkb")); - m_requiredByMap.insertMulti(source, QString("downunits")); - m_requiredByMap.insertMulti(source, QString("up")); - m_requiredByMap.insertMulti(source, QString("upkb")); - m_requiredByMap.insertMulti(source, QString("upunits")); } else if (source.contains(netRegExp)) { // network speed QString type = source.contains(QString("receiver")) ? QString("down") @@ -446,13 +411,6 @@ QStringList AWKeysAggregator::registerSource(const QString &source, m_map.insertMulti(source, key); m_formater[key] = NetSmartUnits; } - // fill required by list - m_requiredByMap.insertMulti(source, QString("%1").arg(type)); - m_requiredByMap.insertMulti(source, QString("%1kb").arg(type)); - m_requiredByMap.insertMulti(source, QString("%1units").arg(type)); - m_requiredByMap.insertMulti(source, QString("%1").arg(type)); - m_requiredByMap.insertMulti(source, QString("%1kb").arg(type)); - m_requiredByMap.insertMulti(source, QString("%1units").arg(type)); } else if (source.startsWith(QString("upgrade"))) { // package manager QString key = source; @@ -491,10 +449,6 @@ QStringList AWKeysAggregator::registerSource(const QString &source, // gb m_map.insertMulti(source, QString("swapfreegb")); m_formater[QString("swapfreegb")] = MemGBFormat; - // fill required by list - m_requiredByMap.insertMulti(source, QString("swaptotmb")); - m_requiredByMap.insertMulti(source, QString("swaptotgb")); - m_requiredByMap.insertMulti(source, QString("swap")); } else if (source == QString("mem/swap/used")) { // used swap // mb @@ -503,10 +457,6 @@ QStringList AWKeysAggregator::registerSource(const QString &source, // gb m_map.insertMulti(source, QString("swapgb")); m_formater[QString("swapgb")] = MemGBFormat; - // fill required by list - m_requiredByMap.insertMulti(source, QString("swaptotmb")); - m_requiredByMap.insertMulti(source, QString("swaptotgb")); - m_requiredByMap.insertMulti(source, QString("swap")); } else if (source.startsWith(QString("lmsensors/"))) { // temperature int index = m_devices[QString("temp")].indexOf(source); @@ -561,6 +511,18 @@ QStringList AWKeysAggregator::registerSource(const QString &source, m_formater[key] = Temperature; } + // drop key from dictionary if no one user requested key required it + QStringList foundKeys = keysFromSource(source); + qCInfo(LOG_AW) << "Looking for keys" << foundKeys << "in" << keys; + // let required if key list is empty no one use it + bool required + = keys.isEmpty() || std::any_of(foundKeys.cbegin(), foundKeys.cend(), + [&keys](const QString &key) { + return keys.contains(key); + }); + if (!required) + m_map.remove(source); + return keysFromSource(source); } @@ -572,17 +534,17 @@ float AWKeysAggregator::temperature(const float temp) const float converted = temp; if (m_tempUnits == QString("Celsius")) { } else if (m_tempUnits == QString("Fahrenheit")) { - converted = temp * 9.0 / 5.0 + 32.0; + converted = temp * 9.0f / 5.0f + 32.0f; } else if (m_tempUnits == QString("Kelvin")) { - converted = temp + 273.15; + converted = temp + 273.15f; } else if (m_tempUnits == QString("Reaumur")) { - converted = temp * 0.8; + converted = temp * 0.8f; } else if (m_tempUnits == QString("cm^-1")) { - converted = (temp + 273.15) * 0.695; + converted = (temp + 273.15f) * 0.695f; } else if (m_tempUnits == QString("kJ/mol")) { - converted = (temp + 273.15) * 8.31; + converted = (temp + 273.15f) * 8.31f; } else if (m_tempUnits == QString("kcal/mol")) { - converted = (temp + 273.15) * 1.98; + converted = (temp + 273.15f) * 1.98f; } else { qCWarning(LOG_AW) << "Invalid units" << m_tempUnits; } diff --git a/sources/awesome-widget/plugin/awkeysaggregator.h b/sources/awesome-widget/plugin/awkeysaggregator.h index 37bfc77..1032d0d 100644 --- a/sources/awesome-widget/plugin/awkeysaggregator.h +++ b/sources/awesome-widget/plugin/awkeysaggregator.h @@ -67,7 +67,6 @@ public: // get methods QString formater(const QVariant &data, const QString &key) const; QStringList keysFromSource(const QString &source) const; - QStringList requiredByKeysFromSource(const QString &source) const; // set methods void setAcOffline(const QString inactive); void setAcOnline(const QString active); @@ -78,7 +77,8 @@ public: void setTranslate(const bool translate); public slots: - QStringList registerSource(const QString &source, const QString &units); + QStringList registerSource(const QString &source, const QString &units, + const QStringList &keys = QStringList()); private: float temperature(const float temp) const; @@ -91,7 +91,6 @@ private: QHash m_devices; QHash m_formater; QHash m_map; - QHash m_requiredByMap; QString m_tempUnits; bool m_translate = false; }; diff --git a/sources/translations/awesome-widgets.pot b/sources/translations/awesome-widgets.pot index 437a528..1a90bae 100644 --- a/sources/translations/awesome-widgets.pot +++ b/sources/translations/awesome-widgets.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2016-01-26 21:48+0300\n" +"POT-Creation-Date: 2016-02-03 23:02+0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -56,6 +56,9 @@ msgstr "" msgid "Check updates on startup" msgstr "" +msgid "Optimize subscription" +msgstr "" + msgid "Widget height, px" msgstr "" @@ -351,15 +354,15 @@ msgstr "" msgid "Weathers" msgstr "" +msgid "Functions" +msgstr "" + msgid "Add" msgstr "" msgid "Show value" msgstr "" -msgid "Add lambda" -msgstr "" - msgid "Edit bars" msgstr "" @@ -411,24 +414,6 @@ msgstr "" msgid "Select font" msgstr "" -msgid "You are using the actual version %1" -msgstr "" - -msgid "No new version found" -msgstr "" - -msgid "Current version : %1" -msgstr "" - -msgid "New version : %1" -msgstr "" - -msgid "Click \"Ok\" to download" -msgstr "" - -msgid "There are updates" -msgstr "" - msgid "AC online" msgstr "" @@ -456,6 +441,27 @@ msgstr "" msgid "KB/s" msgstr "" +msgid "Changelog of %1" +msgstr "" + +msgid "You are using the actual version %1" +msgstr "" + +msgid "No new version found" +msgstr "" + +msgid "Current version : %1" +msgstr "" + +msgid "New version : %1" +msgstr "" + +msgid "Click \"Ok\" to download" +msgstr "" + +msgid "There are updates" +msgstr "" + msgid "Copy" msgstr "" diff --git a/sources/translations/en.po b/sources/translations/en.po index c40d104..99a4ea9 100644 --- a/sources/translations/en.po +++ b/sources/translations/en.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2016-01-26 21:48+0300\n" -"PO-Revision-Date: 2016-01-26 21:48+0300\n" +"POT-Creation-Date: 2016-02-03 23:02+0700\n" +"PO-Revision-Date: 2016-02-03 23:03+0700\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: English \n" "Language: ru\n" @@ -57,6 +57,9 @@ msgstr "Enable notifications" msgid "Check updates on startup" msgstr "Check updates on startup" +msgid "Optimize subscription" +msgstr "Optimize subscription" + msgid "Widget height, px" msgstr "Widget height, px" @@ -356,15 +359,15 @@ msgstr "Upgrades" msgid "Weathers" msgstr "Weathers" +msgid "Functions" +msgstr "Functions" + msgid "Add" msgstr "Add" msgid "Show value" msgstr "Show value" -msgid "Add lambda" -msgstr "Add lambda" - msgid "Edit bars" msgstr "Edit bars" @@ -416,24 +419,6 @@ msgstr "Special thanks to %1" msgid "Select font" msgstr "Select font" -msgid "You are using the actual version %1" -msgstr "You are using the actual version %1" - -msgid "No new version found" -msgstr "No new version found" - -msgid "Current version : %1" -msgstr "Current version : %1" - -msgid "New version : %1" -msgstr "New version : %1" - -msgid "Click \"Ok\" to download" -msgstr "Click \"Ok\" to download" - -msgid "There are updates" -msgstr "There are updates" - msgid "AC online" msgstr "AC online" @@ -461,6 +446,27 @@ msgstr "MB/s" msgid "KB/s" msgstr "KB/s" +msgid "Changelog of %1" +msgstr "Changelog of %1" + +msgid "You are using the actual version %1" +msgstr "You are using the actual version %1" + +msgid "No new version found" +msgstr "No new version found" + +msgid "Current version : %1" +msgstr "Current version : %1" + +msgid "New version : %1" +msgstr "New version : %1" + +msgid "Click \"Ok\" to download" +msgstr "Click \"Ok\" to download" + +msgid "There are updates" +msgstr "There are updates" + msgid "Copy" msgstr "Copy" @@ -612,6 +618,9 @@ msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "esalexeev@gmail.com" +#~ msgid "Add lambda" +#~ msgstr "Add lambda" + #~ msgid "Free space on %1 less than 10%" #~ msgstr "Free space on %1 less than 10%" diff --git a/sources/translations/es.po b/sources/translations/es.po index b1b6c63..5dcfb6f 100644 --- a/sources/translations/es.po +++ b/sources/translations/es.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Awesome widgets\n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2016-01-26 21:48+0300\n" +"POT-Creation-Date: 2016-02-03 23:02+0700\n" "PO-Revision-Date: 2015-09-26 22:07+0000\n" "Last-Translator: Ernesto Avilés Vázquez \n" "Language-Team: Spanish (http://www.transifex.com/arcanis/awesome-widgets/" @@ -59,6 +59,9 @@ msgstr "Habilitar notificaciones" msgid "Check updates on startup" msgstr "Comprobar actualizaciones al inicio" +msgid "Optimize subscription" +msgstr "" + msgid "Widget height, px" msgstr "Alto del widget, px" @@ -361,15 +364,15 @@ msgstr "Actualizaciones" msgid "Weathers" msgstr "Tiempo" +msgid "Functions" +msgstr "" + msgid "Add" msgstr "Añadir" msgid "Show value" msgstr "Mostrar valor" -msgid "Add lambda" -msgstr "Añadir lambda" - msgid "Edit bars" msgstr "Editar barras" @@ -421,24 +424,6 @@ msgstr "" msgid "Select font" msgstr "Elegir tipo de letra" -msgid "You are using the actual version %1" -msgstr "Estás usando al versión actual %1" - -msgid "No new version found" -msgstr "No se encontraron nuevas versiones" - -msgid "Current version : %1" -msgstr "Versión actual: %1" - -msgid "New version : %1" -msgstr "Nueva versión: %1" - -msgid "Click \"Ok\" to download" -msgstr "Haz clic en «Ok» para descargar" - -msgid "There are updates" -msgstr "Hay actualizaciones disponibles" - msgid "AC online" msgstr "Alimentación conectada" @@ -466,6 +451,27 @@ msgstr "MB/s" msgid "KB/s" msgstr "KB/s" +msgid "Changelog of %1" +msgstr "" + +msgid "You are using the actual version %1" +msgstr "Estás usando al versión actual %1" + +msgid "No new version found" +msgstr "No se encontraron nuevas versiones" + +msgid "Current version : %1" +msgstr "Versión actual: %1" + +msgid "New version : %1" +msgstr "Nueva versión: %1" + +msgid "Click \"Ok\" to download" +msgstr "Haz clic en «Ok» para descargar" + +msgid "There are updates" +msgstr "Hay actualizaciones disponibles" + msgid "Copy" msgstr "Copiar" @@ -616,3 +622,6 @@ msgstr "Tu nombre" msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "Tu correo electrónico" + +#~ msgid "Add lambda" +#~ msgstr "Añadir lambda" diff --git a/sources/translations/fr.po b/sources/translations/fr.po index 34ddcf5..4c328a7 100644 --- a/sources/translations/fr.po +++ b/sources/translations/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2016-01-26 21:48+0300\n" +"POT-Creation-Date: 2016-02-03 23:02+0700\n" "PO-Revision-Date: 2015-07-31 22:16+0300\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: French \n" @@ -61,6 +61,9 @@ msgstr "Activer les notifications" msgid "Check updates on startup" msgstr "Vérifier les mises à jour" +msgid "Optimize subscription" +msgstr "" + msgid "Widget height, px" msgstr "Paramètres du composant" @@ -371,15 +374,15 @@ msgstr "" msgid "Weathers" msgstr "Modifier les tickers" +msgid "Functions" +msgstr "" + msgid "Add" msgstr "Ajouter" msgid "Show value" msgstr "Afficher la valeur" -msgid "Add lambda" -msgstr "" - msgid "Edit bars" msgstr "Modifier les barres" @@ -431,27 +434,6 @@ msgstr "" msgid "Select font" msgstr "Sélectionner une couleur" -msgid "You are using the actual version %1" -msgstr "" - -#, fuzzy -msgid "No new version found" -msgstr "Nouvelle version" - -#, fuzzy -msgid "Current version : %1" -msgstr "Version actuelle" - -#, fuzzy -msgid "New version : %1" -msgstr "Nouvelle version" - -msgid "Click \"Ok\" to download" -msgstr "Cliquer sur \"Valider\" pour télécharger" - -msgid "There are updates" -msgstr "Des mises à jour sont disponibles" - msgid "AC online" msgstr "Alimentation branchée" @@ -479,6 +461,30 @@ msgstr "" msgid "KB/s" msgstr "" +msgid "Changelog of %1" +msgstr "" + +msgid "You are using the actual version %1" +msgstr "" + +#, fuzzy +msgid "No new version found" +msgstr "Nouvelle version" + +#, fuzzy +msgid "Current version : %1" +msgstr "Version actuelle" + +#, fuzzy +msgid "New version : %1" +msgstr "Nouvelle version" + +msgid "Click \"Ok\" to download" +msgstr "Cliquer sur \"Valider\" pour télécharger" + +msgid "There are updates" +msgstr "Des mises à jour sont disponibles" + msgid "Copy" msgstr "Copier" diff --git a/sources/translations/nl.po b/sources/translations/nl.po index 9c4a562..6450b0b 100644 --- a/sources/translations/nl.po +++ b/sources/translations/nl.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Awesome widgets\n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2016-01-26 21:48+0300\n" +"POT-Creation-Date: 2016-02-03 23:02+0700\n" "PO-Revision-Date: 2015-08-20 22:52+0300\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: Dutch \n" @@ -61,6 +61,9 @@ msgstr "" msgid "Check updates on startup" msgstr "Controleren op updates" +msgid "Optimize subscription" +msgstr "" + msgid "Widget height, px" msgstr "" @@ -373,15 +376,15 @@ msgstr "" msgid "Weathers" msgstr "Balken bewerken" +msgid "Functions" +msgstr "" + msgid "Add" msgstr "Toevoegen" msgid "Show value" msgstr "Waarde weergeven" -msgid "Add lambda" -msgstr "" - msgid "Edit bars" msgstr "Balken bewerken" @@ -436,25 +439,6 @@ msgstr "" msgid "Select font" msgstr "Lettertype selecteren" -msgid "You are using the actual version %1" -msgstr "" - -#, fuzzy -msgid "No new version found" -msgstr "Nieuwe versie: %1" - -msgid "Current version : %1" -msgstr "Huidige versie: %1" - -msgid "New version : %1" -msgstr "Nieuwe versie: %1" - -msgid "Click \"Ok\" to download" -msgstr "Klik op \"OK\" om te downloaden" - -msgid "There are updates" -msgstr "Er zijn updates" - msgid "AC online" msgstr "AC online" @@ -483,6 +467,28 @@ msgstr "" msgid "KB/s" msgstr "" +msgid "Changelog of %1" +msgstr "" + +msgid "You are using the actual version %1" +msgstr "" + +#, fuzzy +msgid "No new version found" +msgstr "Nieuwe versie: %1" + +msgid "Current version : %1" +msgstr "Huidige versie: %1" + +msgid "New version : %1" +msgstr "Nieuwe versie: %1" + +msgid "Click \"Ok\" to download" +msgstr "Klik op \"OK\" om te downloaden" + +msgid "There are updates" +msgstr "Er zijn updates" + msgid "Copy" msgstr "Kopiëren" diff --git a/sources/translations/pt_BR.po b/sources/translations/pt_BR.po index 9cb71f1..0a46a37 100644 --- a/sources/translations/pt_BR.po +++ b/sources/translations/pt_BR.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2016-01-26 21:48+0300\n" +"POT-Creation-Date: 2016-02-03 23:02+0700\n" "PO-Revision-Date: 2015-07-31 22:21+0300\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: Russian \n" @@ -60,6 +60,9 @@ msgstr "Ativar notificações" msgid "Check updates on startup" msgstr "Checar por atualizações" +msgid "Optimize subscription" +msgstr "" + msgid "Widget height, px" msgstr "Altura do widget, px" @@ -372,15 +375,15 @@ msgstr "" msgid "Weathers" msgstr "Editar relógios" +msgid "Functions" +msgstr "" + msgid "Add" msgstr "Adicionar" msgid "Show value" msgstr "Mostrar valor" -msgid "Add lambda" -msgstr "" - msgid "Edit bars" msgstr "Editar barras" @@ -432,25 +435,6 @@ msgstr "" msgid "Select font" msgstr "Selecionar fonte" -msgid "You are using the actual version %1" -msgstr "" - -#, fuzzy -msgid "No new version found" -msgstr "Nova versão: %1" - -msgid "Current version : %1" -msgstr "Versão atual: %1" - -msgid "New version : %1" -msgstr "Nova versão: %1" - -msgid "Click \"Ok\" to download" -msgstr "Clique \"Ok\" para baixar" - -msgid "There are updates" -msgstr "Há atualizações disponíveis" - msgid "AC online" msgstr "Carregador conectado" @@ -478,6 +462,28 @@ msgstr "" msgid "KB/s" msgstr "" +msgid "Changelog of %1" +msgstr "" + +msgid "You are using the actual version %1" +msgstr "" + +#, fuzzy +msgid "No new version found" +msgstr "Nova versão: %1" + +msgid "Current version : %1" +msgstr "Versão atual: %1" + +msgid "New version : %1" +msgstr "Nova versão: %1" + +msgid "Click \"Ok\" to download" +msgstr "Clique \"Ok\" para baixar" + +msgid "There are updates" +msgstr "Há atualizações disponíveis" + msgid "Copy" msgstr "Copiar" diff --git a/sources/translations/ru.po b/sources/translations/ru.po index 97a8e6b..b0207f1 100644 --- a/sources/translations/ru.po +++ b/sources/translations/ru.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2016-01-26 21:48+0300\n" -"PO-Revision-Date: 2016-01-26 21:49+0300\n" +"POT-Creation-Date: 2016-02-03 23:02+0700\n" +"PO-Revision-Date: 2016-02-03 23:04+0700\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: Russian \n" "Language: ru\n" @@ -57,6 +57,9 @@ msgstr "Включить уведомления " msgid "Check updates on startup" msgstr "Проверять обновления при запуске" +msgid "Optimize subscription" +msgstr "Оптимизировать подписку" + msgid "Widget height, px" msgstr "Высота виджета, пиксели" @@ -356,15 +359,15 @@ msgstr "Обновления" msgid "Weathers" msgstr "Погода" +msgid "Functions" +msgstr "Функции" + msgid "Add" msgstr "Добавить" msgid "Show value" msgstr "Показать значение" -msgid "Add lambda" -msgstr "Добавить лямбду" - msgid "Edit bars" msgstr "Редактировать бары" @@ -411,29 +414,11 @@ msgid "This software uses: %1" msgstr "Данное приложение использует: %1" msgid "Special thanks to %1" -msgstr "Отдельно спасибо %1" +msgstr "Отдельное спасибо %1" msgid "Select font" msgstr "Выберете шрифт" -msgid "You are using the actual version %1" -msgstr "Вы используете актуальную версию %1" - -msgid "No new version found" -msgstr "Обновления не найдены" - -msgid "Current version : %1" -msgstr "Текущая версия : %1" - -msgid "New version : %1" -msgstr "Новая версия : %1" - -msgid "Click \"Ok\" to download" -msgstr "Нажмите \"Ok\" для загрузки" - -msgid "There are updates" -msgstr "Найдены обновления" - msgid "AC online" msgstr "AC подключен" @@ -461,6 +446,27 @@ msgstr "МБ/с" msgid "KB/s" msgstr "КБ/с" +msgid "Changelog of %1" +msgstr "Список изменений %1" + +msgid "You are using the actual version %1" +msgstr "Вы используете актуальную версию %1" + +msgid "No new version found" +msgstr "Обновления не найдены" + +msgid "Current version : %1" +msgstr "Текущая версия : %1" + +msgid "New version : %1" +msgstr "Новая версия : %1" + +msgid "Click \"Ok\" to download" +msgstr "Нажмите \"Ok\" для загрузки" + +msgid "There are updates" +msgstr "Найдены обновления" + msgid "Copy" msgstr "Копировать" @@ -612,6 +618,9 @@ msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "esalexeev@gmail.com" +#~ msgid "Add lambda" +#~ msgstr "Добавить лямбду" + #~ msgid "Free space on %1 less than 10%" #~ msgstr "Свободное место на диске %1 меньше 10%" diff --git a/sources/translations/uk.po b/sources/translations/uk.po index 330f72e..4c527ac 100644 --- a/sources/translations/uk.po +++ b/sources/translations/uk.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2016-01-26 21:48+0300\n" +"POT-Creation-Date: 2016-02-03 23:02+0700\n" "PO-Revision-Date: 2015-09-27 12:37+0300\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: Ukrainian \n" @@ -59,6 +59,9 @@ msgstr "Включити повідомлення" msgid "Check updates on startup" msgstr "Перевіряти оновлення при запуску" +msgid "Optimize subscription" +msgstr "" + msgid "Widget height, px" msgstr "Висота віджету, пікселі" @@ -374,15 +377,15 @@ msgstr "Оновлення" msgid "Weathers" msgstr "Погода" +msgid "Functions" +msgstr "" + msgid "Add" msgstr "Додати" msgid "Show value" msgstr "Показати значення" -msgid "Add lambda" -msgstr "Додати лямбду" - msgid "Edit bars" msgstr "Редагувати бари" @@ -434,25 +437,6 @@ msgstr "" msgid "Select font" msgstr "Оберіть шрифт" -msgid "You are using the actual version %1" -msgstr "Ви використовуєте актуальну версію %1" - -#, fuzzy -msgid "No new version found" -msgstr "Оновлень не знайдено" - -msgid "Current version : %1" -msgstr "Поточна версія : %1" - -msgid "New version : %1" -msgstr "Нова версія : %1" - -msgid "Click \"Ok\" to download" -msgstr "Натисніть \"Ok\" для завантаження" - -msgid "There are updates" -msgstr "Знайдені оновлення" - msgid "AC online" msgstr "AC підключений" @@ -480,6 +464,28 @@ msgstr "МБ/с" msgid "KB/s" msgstr "КБ/с" +msgid "Changelog of %1" +msgstr "" + +msgid "You are using the actual version %1" +msgstr "Ви використовуєте актуальну версію %1" + +#, fuzzy +msgid "No new version found" +msgstr "Оновлень не знайдено" + +msgid "Current version : %1" +msgstr "Поточна версія : %1" + +msgid "New version : %1" +msgstr "Нова версія : %1" + +msgid "Click \"Ok\" to download" +msgstr "Натисніть \"Ok\" для завантаження" + +msgid "There are updates" +msgstr "Знайдені оновлення" + msgid "Copy" msgstr "Копіювати" @@ -640,6 +646,9 @@ msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" msgstr "sarumyan@i.ua" +#~ msgid "Add lambda" +#~ msgstr "Додати лямбду" + #~ msgid "Free space on %1 less than 10%" #~ msgstr "Вільний простір на диску %1 меньше ніж 10%" diff --git a/sources/translations/zh.po b/sources/translations/zh.po index 20de05f..41754da 100644 --- a/sources/translations/zh.po +++ b/sources/translations/zh.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2016-01-26 21:48+0300\n" +"POT-Creation-Date: 2016-02-03 23:02+0700\n" "PO-Revision-Date: 2015-07-31 22:24+0300\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: Russian \n" @@ -57,6 +57,9 @@ msgstr "" msgid "Check updates on startup" msgstr "" +msgid "Optimize subscription" +msgstr "" + msgid "Widget height, px" msgstr "" @@ -369,15 +372,15 @@ msgstr "" msgid "Weathers" msgstr "可编辑的" +msgid "Functions" +msgstr "" + msgid "Add" msgstr "添加" msgid "Show value" msgstr "" -msgid "Add lambda" -msgstr "" - #, fuzzy msgid "Edit bars" msgstr "可编辑的" @@ -430,24 +433,6 @@ msgstr "" msgid "Select font" msgstr "选择字体" -msgid "You are using the actual version %1" -msgstr "" - -msgid "No new version found" -msgstr "" - -msgid "Current version : %1" -msgstr "" - -msgid "New version : %1" -msgstr "" - -msgid "Click \"Ok\" to download" -msgstr "" - -msgid "There are updates" -msgstr "" - #, fuzzy msgid "AC online" msgstr "外接电源使用中标签" @@ -477,6 +462,27 @@ msgstr "" msgid "KB/s" msgstr "" +msgid "Changelog of %1" +msgstr "" + +msgid "You are using the actual version %1" +msgstr "" + +msgid "No new version found" +msgstr "" + +msgid "Current version : %1" +msgstr "" + +msgid "New version : %1" +msgstr "" + +msgid "Click \"Ok\" to download" +msgstr "" + +msgid "There are updates" +msgstr "" + msgid "Copy" msgstr ""