From 0ba74b3130ee6600caf4963eae7eab342c0e6249 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Sat, 12 Sep 2015 02:32:31 +0300 Subject: [PATCH] add ability to wrap lines rename AWToolTip to AWDataAggregator object drop hasOutput property from ExtScript fix some bugs in AWKeysAggregator --- .../{awtooltip.cpp => awdataaggregator.cpp} | 158 ++++++++++++++---- .../{awtooltip.h => awdataaggregator.h} | 24 ++- .../plugin/awkeysaggregator.cpp | 141 ++++++++++------ .../awesome-widget/plugin/awkeysaggregator.h | 8 +- sources/awesomewidgets/extscript.cpp | 43 ++--- sources/awesomewidgets/extscript.h | 7 +- sources/awesomewidgets/extscript.ui | 35 +--- sources/extsysmon/sources/playersource.cpp | 37 ++-- sources/extsysmon/sources/playersource.h | 1 + sources/translations/awesome-widgets.pot | 53 +++--- sources/translations/en.po | 61 +++---- sources/translations/es.po | 56 +++---- sources/translations/fr.po | 56 +++---- sources/translations/nl.po | 56 +++---- sources/translations/pt_BR.po | 56 +++---- sources/translations/ru.po | 61 +++---- sources/translations/uk.po | 56 +++---- sources/translations/zh.po | 55 +++--- 18 files changed, 529 insertions(+), 435 deletions(-) rename sources/awesome-widget/plugin/{awtooltip.cpp => awdataaggregator.cpp} (57%) rename sources/awesome-widget/plugin/{awtooltip.h => awdataaggregator.h} (67%) diff --git a/sources/awesome-widget/plugin/awtooltip.cpp b/sources/awesome-widget/plugin/awdataaggregator.cpp similarity index 57% rename from sources/awesome-widget/plugin/awtooltip.cpp rename to sources/awesome-widget/plugin/awdataaggregator.cpp index ea80094..2bb10dc 100644 --- a/sources/awesome-widget/plugin/awtooltip.cpp +++ b/sources/awesome-widget/plugin/awdataaggregator.cpp @@ -15,15 +15,18 @@ * along with awesome-widgets. If not, see http://www.gnu.org/licenses/ * ***************************************************************************/ -#include "awtooltip.h" +#include "awdataaggregator.h" + +#include #include #include +#include "awactions.h" #include "awdebug.h" -AWToolTip::AWToolTip(QObject *parent, QVariantMap settings) +AWDataAggregator::AWDataAggregator(QObject *parent, QVariantMap settings) : QObject(parent), configuration(qvariant_cast(settings)) { @@ -37,6 +40,8 @@ AWToolTip::AWToolTip(QObject *parent, QVariantMap settings) toolTipView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); toolTipView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + enablePopup = configuration[QString("notify")].toBool(); + counts += configuration[QString("cpuTooltip")].toInt(); counts += configuration[QString("cpuclTooltip")].toInt(); counts += configuration[QString("memTooltip")].toInt(); @@ -67,7 +72,7 @@ AWToolTip::AWToolTip(QObject *parent, QVariantMap settings) } -AWToolTip::~AWToolTip() +AWDataAggregator::~AWDataAggregator() { qCDebug(LOG_AW); @@ -75,26 +80,36 @@ AWToolTip::~AWToolTip() } -void AWToolTip::dataUpdate(QHash values) +void AWDataAggregator::dataUpdate(QHash values) { qCDebug(LOG_AW); // battery update requires info is AC online or not - setData(QString("batTooltip"), values[QString("bat")].toFloat(), - values[QString("ac")] == configuration[QString("acOnline")]); + setData(values[QString("ac")] == configuration[QString("acOnline")], + QString("batTooltip"), values[QString("bat")].toFloat()); // usual case - setData(QString("cpuTooltip"), values[QString("cpu")].toFloat()); + setData(QString("cpuTooltip"), values[QString("cpu")].toFloat(), 90.0); setData(QString("cpuclTooltip"), values[QString("cpucl")].toFloat()); - setData(QString("memTooltip"), values[QString("mem")].toFloat()); - setData(QString("swapTooltip"), values[QString("swap")].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()); + // additional check for network device + [this](const QString value) { + checkValue(QString("netdev"), currentNetworkDevice, value); + currentNetworkDevice = value; + }(values[QString("netdev")]); + // additional check for GPU load + [this](const float value) { + checkValue(QString("gpu"), value, 90.0); + currentGPULoad = value; + }(values[QString("gpu")].toFloat()); - emit(toolTipPainted(htmlImage())); + emit(toolTipPainted(htmlImage(tooltipImage()))); } -QSize AWToolTip::getSize() const +QSize AWDataAggregator::getTooltipSize() const { qCDebug(LOG_AW); @@ -102,21 +117,20 @@ QSize AWToolTip::getSize() const } -QString AWToolTip::htmlImage() +QString AWDataAggregator::htmlImage(const QPixmap source) { qCDebug(LOG_AW); - QPixmap rawImage = image(); QByteArray byteArray; QBuffer buffer(&byteArray); - rawImage.save(&buffer, "PNG"); + source.save(&buffer, "PNG"); return byteArray.isEmpty() ? QString() : QString("").arg(QString(byteArray.toBase64())); } -QPixmap AWToolTip::image() +QPixmap AWDataAggregator::tooltipImage() { qCDebug(LOG_AW); @@ -129,53 +143,133 @@ QPixmap AWToolTip::image() QBrush(QColor(configuration[QString("tooltipBackground")].toString())) : QBrush(Qt::NoBrush)); bool down = false; - for (int i=0; i(data[requiredKeys.at(i)].count()); - float normY = 100.0 / (1.5 * boundaries[requiredKeys.at(i)]); - if (requiredKeys.at(i) != QString("batTooltip")) - pen.setColor(QColor(configuration[QString("%1Color").arg(requiredKeys.at(i))].toString())); - float shift = i * 100.0; + foreach(QString 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; if (down) shift -= 100.0; - for (int j=0; j 0) + float y2 = - fabs(data[key].at(j+1)) * normY + 5.0; + if (key == QString("batTooltip")) { + if (data[key].at(j+1) > 0) pen.setColor(QColor(configuration[QString("batTooltipColor")].toString())); else pen.setColor(QColor(configuration[QString("batInTooltipColor")].toString())); } toolTipScene->addLine(x1, y1, x2, y2, pen); } - if (requiredKeys.at(i) == QString("downTooltip")) down = true; + if (key == QString("downTooltip")) down = true; } return toolTipView->grab(); } -void AWToolTip::setData(const QString source, float value, const bool dontInvert) +void AWDataAggregator::checkValue(const QString source, const float value, const float extremum) const +{ + qCDebug(LOG_AW); + qCDebug(LOG_AW) << "Notification source" << source; + qCDebug(LOG_AW) << "Value" << value; + qCDebug(LOG_AW) << "Called with extremum" << extremum; + + if ((enablePopup) && (value > extremum) && (data[source].last() < extremum)) + return AWActions::sendNotification(QString("event"), notificationText(source, value)); +} + + +void AWDataAggregator::checkValue(const QString source, const QString current, const QString received) const +{ + qCDebug(LOG_AW); + qCDebug(LOG_AW) << "Notification source" << source; + qCDebug(LOG_AW) << "Current value" << current; + qCDebug(LOG_AW) << "Received value" << received; + + if ((enablePopup) && (current != received)) + return AWActions::sendNotification(QString("event"), notificationText(source, received)); +} + + +QString AWDataAggregator::notificationText(const QString source, const float value) const +{ + qCDebug(LOG_AW); + qCDebug(LOG_AW) << "Notification source" << source; + qCDebug(LOG_AW) << "Value" << value; + + QString output; + if (source == QString("batTooltip")) { + if (value > 0.0) + output = i18n("AC online"); + else + output = i18n("AC offline"); + } else if (source == QString("cpuTooltip")) { + output = i18n("High CPU load"); + } else if (source == QString("memTooltip")) { + output = i18n("High memory usage"); + } else if (source == QString("swapTooltip")) { + output = i18n("Swap is used"); + } else if (source == QString("gpu")) { + output = i18n("High GPU load"); + } + + return output; +} + + +QString AWDataAggregator::notificationText(const QString source, const QString value) const +{ + qCDebug(LOG_AW); + qCDebug(LOG_AW) << "Notification source" << source; + qCDebug(LOG_AW) << "Value" << value; + + QString output; + if (source == QString("netdev")) { + output = i18n("Network device has been changed to %1", value); + } + + return output; +} + + +void AWDataAggregator::setData(const QString source, float value, const float extremum) { qCDebug(LOG_AW); qCDebug(LOG_AW) << "Source" << source; qCDebug(LOG_AW) << "Value" << value; - qCDebug(LOG_AW) << "Do not invert value" << dontInvert; + qCDebug(LOG_AW) << "Called with extremum" << extremum; if (data[source].count() == 0) data[source].append(0.0); else if (data[source].count() > configuration[QString("tooltipNumber")].toInt()) - data[source].takeFirst(); + data[source].removeFirst(); if (isnan(value)) value = 0.0; - // invert values for different battery colours - data[source].append(dontInvert ? value : -value); + // notifications + checkValue(source, value, extremum); + data[source].append(value); if (source == QString("downTooltip")) { QList netValues = data[QString("downTooltip")] + data[QString("upTooltip")]; boundaries[QString("downTooltip")] = 1.2 * *std::max_element(netValues.cbegin(), netValues.cend()); boundaries[QString("upTooltip")] = boundaries[QString("downTooltip")]; } } + + +void AWDataAggregator::setData(const bool dontInvert, const QString source, float value) +{ + qCDebug(LOG_AW); + qCDebug(LOG_AW) << "Do not invert value" << dontInvert; + + // invert values for different battery colours + value = dontInvert ? value : -value; + return setData(source, value, 0.0); +} diff --git a/sources/awesome-widget/plugin/awtooltip.h b/sources/awesome-widget/plugin/awdataaggregator.h similarity index 67% rename from sources/awesome-widget/plugin/awtooltip.h rename to sources/awesome-widget/plugin/awdataaggregator.h index 3f493b4..fa629fe 100644 --- a/sources/awesome-widget/plugin/awtooltip.h +++ b/sources/awesome-widget/plugin/awdataaggregator.h @@ -27,16 +27,16 @@ #include -class AWToolTip : public QObject +class AWDataAggregator : public QObject { Q_OBJECT public: - explicit AWToolTip(QObject *parent = nullptr, QVariantMap settings = QVariantMap()); - virtual ~AWToolTip(); - QSize getSize() const; - QString htmlImage(); - QPixmap image(); + explicit AWDataAggregator(QObject *parent = nullptr, QVariantMap settings = QVariantMap()); + virtual ~AWDataAggregator(); + QSize getTooltipSize() const; + QString htmlImage(const QPixmap source); + QPixmap tooltipImage(); signals: void updateData(QHash values); @@ -49,13 +49,21 @@ private: // ui QGraphicsScene *toolTipScene = nullptr; QGraphicsView *toolTipView = nullptr; - void setData(const QString source, float value, - const bool dontInvert = true); + void checkValue(const QString source, const float value, const float extremum) const; + void checkValue(const QString source, const QString current, const QString received) const; + QString notificationText(const QString source, const float value) const; + QString notificationText(const QString source, const QString value) const; + void setData(const QString source, float value, const float extremum = -1.0); + // different signature for battery device + void setData(const bool dontInvert, const QString source, float value); // variables int counts = 0; QVariantHash configuration; + float currentGPULoad = 0.0; + QString currentNetworkDevice; QHash boundaries; QHash> data; + bool enablePopup = false; QStringList requiredKeys; QSize size; }; diff --git a/sources/awesome-widget/plugin/awkeysaggregator.cpp b/sources/awesome-widget/plugin/awkeysaggregator.cpp index 913ad64..5cbabf8 100644 --- a/sources/awesome-widget/plugin/awkeysaggregator.cpp +++ b/sources/awesome-widget/plugin/awkeysaggregator.cpp @@ -49,17 +49,20 @@ QString AWKeysAggregator::formater(const QVariant data, const QString key) const QLocale loc = m_translate ? QLocale::system() : QLocale::c(); // case block switch (m_formater[key]) { + case Float: + output = QString("%1").arg(data.toFloat(), 5, 'f', 1); + break; + case FloatTwoSymbols: + output = QString("%1").arg(data.toFloat(), 5, 'f', 2); + break; case Integer: output = QString("%1").arg(data.toFloat(), 4, 'f', 0); break; case IntegerThree: output = QString("%1").arg(data.toFloat(), 3, 'f', 0); break; - case Float: - output = QString("%1").arg(data.toFloat(), 5, 'f', 1); - break; - case FloatTwoSymbols: - output = QString("%1").arg(data.toFloat(), 5, 'f', 2); + case List: + output = data.toStringList().join(QChar(',')); break; case ACFormat: output = data.toBool() ? m_acOnline : m_acOffline; @@ -87,6 +90,9 @@ QString AWKeysAggregator::formater(const QVariant data, const QString key) const case Temperature: output = QString("%1").arg(temperature(data.toFloat()), 5, 'f', 1); break; + case Time: + output = data.toDateTime().toString(); + break; case TimeCustom: output = m_customTime; [&output, loc, this](const QDateTime dt) { @@ -201,8 +207,8 @@ void AWKeysAggregator::setTranslate(const bool translate) } -// TODO calculate: down, up, downunits, upunits, mem, swap -void AWKeysAggregator::registerSource(const QString source, const QString units) +// HACK units required to define should the value be calculated as temperature or fan data +QStringList AWKeysAggregator::registerSource(const QString source, const QString units) { qCDebug(LOG_AW); qCDebug(LOG_AW) << "Source" << source; @@ -245,7 +251,8 @@ void AWKeysAggregator::registerSource(const QString source, const QString units) } else if (source.contains(cpuclRegExp)) { // cpucls QString key = source; - key.remove(QString("cpu/")).remove(QString("/clock")); + key.remove(QString("cpu/cpu")).remove(QString("/clock")); + key = QString("cpucl%1").arg(key); m_map[source] = key; m_formater[key] = Integer; } else if (source.startsWith(QString("custom"))) { @@ -270,16 +277,22 @@ void AWKeysAggregator::registerSource(const QString source, const QString units) // read speed QString device = source; device.remove(QString("/Rate/rblk")); - QString key = QString("hddr%1").arg(m_devices[QString("disk")].indexOf(device)); - m_map[source] = key; - m_formater[key] = Integer; + int index = m_devices[QString("disk")].indexOf(device); + if (index > -1) { + QString key = QString("hddr%1").arg(index); + m_map[source] = key; + m_formater[key] = Integer; + } } else if (source.contains(hddwRegExp)) { // write speed QString device = source; device.remove(QString("/Rate/wblk")); - QString key = QString("hddw%1").arg(m_devices[QString("disk")].indexOf(device)); - m_map[source] = key; - m_formater[key] = Integer; + int index = m_devices[QString("disk")].indexOf(device); + if (index > -1) { + QString key = QString("hddw%1").arg(index); + m_map[source] = key; + m_formater[key] = Integer; + } } else if (source == QString("gpu/load")) { // gpu load m_map[source] = QString("gpu"); @@ -292,42 +305,52 @@ void AWKeysAggregator::registerSource(const QString source, const QString units) // fill level QString device = source; device.remove(QString("partitions")).remove(QString("/filllevel")); - QString key = QString("hdd%1").arg(m_devices[QString("mount")].indexOf(device)); - m_map[source] = key; - m_formater[key] = Float; + int index = m_devices[QString("mount")].indexOf(device); + if (index > -1) { + QString key = QString("hdd%1").arg(index); + m_map[source] = key; + m_formater[key] = Float; + } } else if (source.contains(mountFreeRegExp)) { // free space QString device = source; device.remove(QString("partitions")).remove(QString("/freespace")); int index = m_devices[QString("mount")].indexOf(device); - // mb - QString key = QString("hddfreemb%1").arg(index); - m_map[source] = key; - m_formater[key] = MemMBFormat; - // gb - key = QString("hddfreegb%1").arg(index); - m_map.insertMulti(source, key); - m_formater[key] = MemGBFormat; + if (index > -1) { + // mb + QString key = QString("hddfreemb%1").arg(index); + m_map[source] = key; + m_formater[key] = MemMBFormat; + // gb + key = QString("hddfreegb%1").arg(index); + m_map.insertMulti(source, key); + m_formater[key] = MemGBFormat; + } } else if (source.contains(mountUsedRegExp)) { // used QString device = source; device.remove(QString("partitions")).remove(QString("/usedspace")); int index = m_devices[QString("mount")].indexOf(device); - // mb - QString key = QString("hddmb%1").arg(index); - m_map[source] = key; - m_formater[key] = MemMBFormat; - // gb - key = QString("hddgb%1").arg(index); - m_map.insertMulti(source, key); - m_formater[key] = MemGBFormat; + if (index > -1) { + // mb + QString key = QString("hddmb%1").arg(index); + m_map[source] = key; + m_formater[key] = MemMBFormat; + // gb + key = QString("hddgb%1").arg(index); + m_map.insertMulti(source, key); + m_formater[key] = MemGBFormat; + } } else if (source.startsWith(QString("hdd/temperature"))) { // hdd temperature QString device = source; device.remove(QString("hdd/temperature")); - QString key = QString("hddtemp%1").arg(m_devices[QString("hdd")].indexOf(device)); - m_map[source] = key; - m_formater[key] = Temperature; + int index = m_devices[QString("hdd")].indexOf(device); + if (index > -1) { + QString key = QString("hddtemp%1").arg(index); + m_map[source] = key; + m_formater[key] = Temperature; + } } else if (source.startsWith(QString("cpu/system/loadavg"))) { // load average QString time = source; @@ -366,20 +389,21 @@ void AWKeysAggregator::registerSource(const QString source, const QString units) } else if (source.contains(netRegExp)) { // network speed QString type = source.contains(QString("receiver")) ? QString("down") : QString("up"); - // device name int index = m_devices[QString("net")].indexOf(source.split(QChar('/'))[2]); - // kb - QString key = QString("%1kb%2").arg(type).arg(index); - m_map[source] = key; - m_formater[key] = Integer; - // smart - key = QString("%1%2").arg(type).arg(index); - m_map.insertMulti(source, key); - m_formater[key] = NetSmartFormat; - // units - key = QString("%1units%2").arg(type).arg(index); - m_map.insertMulti(source, key); - m_formater[key] = NetSmartUnits; + if (index > -1) { + // kb + QString key = QString("%1kb%2").arg(type).arg(index); + m_map[source] = key; + m_formater[key] = Integer; + // smart + key = QString("%1%2").arg(type).arg(index); + m_map.insertMulti(source, key); + m_formater[key] = NetSmartFormat; + // units + key = QString("%1units%2").arg(type).arg(index); + m_map.insertMulti(source, key); + m_formater[key] = NetSmartUnits; + } } else if (source.startsWith(QString("upgrade"))) { // package manager QString key = source; @@ -399,7 +423,7 @@ void AWKeysAggregator::registerSource(const QString source, const QString units) } else if (source == QString("ps/running/list")) { // list of running processes m_map[source] = QString("ps"); - m_formater[QString("ps")] = NoFormat; + m_formater[QString("ps")] = List; } else if (source == QString("ps/total/count")) { // total processes count m_map[source] = QString("pstotal"); @@ -427,14 +451,19 @@ void AWKeysAggregator::registerSource(const QString source, const QString units) m_map.insertMulti(source, QString("swapgb")); m_formater[QString("swapgb")] = MemGBFormat; } else if (source.startsWith(QString("lmsensors/"))) { - // temperature m_devices - QString key = QString("temp%1").arg(m_devices[QString("temp")].indexOf(source)); - m_map[source] = key; - m_formater[key] = units == QString("°C") ? Temperature : Float; + // temperature + int index = m_devices[QString("temp")].indexOf(source); + // FIXME on DE initialization there are no units key + if (units.isEmpty()) return QStringList() << QString("temp%1").arg(index); + if (index > -1) { + QString key = QString("temp%1").arg(index); + m_map[source] = key; + m_formater[key] = units == QString("°C") ? Temperature : Integer; + } } else if (source == QString("Local")) { // time m_map[source] = QString("time"); - m_formater[QString("time")] = NoFormat; + m_formater[QString("time")] = Time; // custom time m_map.insertMulti(source, QString("ctime")); m_formater[QString("ctime")] = TimeCustom; @@ -467,6 +496,8 @@ void AWKeysAggregator::registerSource(const QString source, const QString units) m_map[source] = key; m_formater[key] = NoFormat; } + + return keyFromSource(source); } diff --git a/sources/awesome-widget/plugin/awkeysaggregator.h b/sources/awesome-widget/plugin/awkeysaggregator.h index ce9e6d9..be03161 100644 --- a/sources/awesome-widget/plugin/awkeysaggregator.h +++ b/sources/awesome-widget/plugin/awkeysaggregator.h @@ -38,10 +38,11 @@ class AWKeysAggregator : public QObject enum FormaterType { // general formaters NoFormat = 0, - Integer, - IntegerThree, Float, FloatTwoSymbols, + Integer, + IntegerThree, + List, // unit specific formaters ACFormat, MemGBFormat, @@ -49,6 +50,7 @@ class AWKeysAggregator : public QObject NetSmartFormat, NetSmartUnits, Temperature, + Time, TimeCustom, TimeISO, TimeLong, @@ -73,7 +75,7 @@ public: void setTranslate(const bool translate); public slots: - void registerSource(const QString source, const QString units); + QStringList registerSource(const QString source, const QString units); private: float temperature(const float temp) const; diff --git a/sources/awesomewidgets/extscript.cpp b/sources/awesomewidgets/extscript.cpp index e6972a6..72a2f51 100644 --- a/sources/awesomewidgets/extscript.cpp +++ b/sources/awesomewidgets/extscript.cpp @@ -72,7 +72,6 @@ ExtScript *ExtScript::copy(const QString _fileName, const int _number) item->setApiVersion(apiVersion()); item->setComment(comment()); item->setExecutable(executable()); - item->setHasOutput(hasOutput()); item->setInterval(interval()); item->setName(name()); item->setNumber(_number); @@ -99,14 +98,6 @@ QStringList ExtScript::filters() const } -bool ExtScript::hasOutput() const -{ - qCDebug(LOG_LIB); - - return m_output; -} - - QString ExtScript::prefix() const { qCDebug(LOG_LIB); @@ -143,6 +134,9 @@ QString ExtScript::strRedirect() const case stderr2stdout: value = QString("stderr2stdout"); break; + case swap: + value = QString("swap"); + break; case nothing: default: value = QString("nothing"); @@ -167,19 +161,9 @@ void ExtScript::setFilters(const QStringList _filters) qCDebug(LOG_LIB); qCDebug(LOG_LIB) << "Filters" << _filters; - std::for_each(_filters.cbegin(), _filters.cend(), - [this](QString filter) { return updateFilter(filter); }); -// foreach(QString filter, _filters) -// updateFilter(filter); -} - - -void ExtScript::setHasOutput(const bool _state) -{ - qCDebug(LOG_LIB); - qCDebug(LOG_LIB) << "State" << _state; - - m_output = _state; + std::for_each(_filters.cbegin(), _filters.cend(), [this](QString filter) { + return updateFilter(filter); + }); } @@ -210,6 +194,8 @@ void ExtScript::setStrRedirect(const QString _redirect) m_redirect = stdout2stderr; else if (_redirect == QString("stderr2sdtout")) m_redirect = stderr2stdout; + else if (_redirect == QString("swap")) + m_redirect = swap; else m_redirect = nothing; } @@ -262,7 +248,6 @@ void ExtScript::readConfiguration() settings.beginGroup(QString("Desktop Entry")); setExecutable(settings.value(QString("Exec"), m_executable).toString()); setPrefix(settings.value(QString("X-AW-Prefix"), m_prefix).toString()); - setHasOutput(settings.value(QString("X-AW-Output"), QVariant(m_output)).toString() == QString("true")); setStrRedirect(settings.value(QString("X-AW-Redirect"), strRedirect()).toString()); // api == 3 setFilters(settings.value(QString("X-AW-Filters"), m_filters).toString() @@ -270,9 +255,6 @@ void ExtScript::readConfiguration() settings.endGroup(); } - if (!m_output) - setRedirect(stdout2stderr); - // update for current API if ((apiVersion() > 0) && (apiVersion() < AWESAPI)) { qCWarning(LOG_LIB) << "Bump API version from" << apiVersion() << "to" << AWESAPI; @@ -339,7 +321,6 @@ int ExtScript::showConfiguration(const QVariant args) ui->lineEdit_command->setText(m_executable); ui->lineEdit_prefix->setText(m_prefix); ui->checkBox_active->setCheckState(isActive() ? Qt::Checked : Qt::Unchecked); - ui->checkBox_output->setCheckState(m_output ? Qt::Checked : Qt::Unchecked); ui->comboBox_redirect->setCurrentIndex(static_cast(m_redirect)); ui->spinBox_interval->setValue(interval()); // filters @@ -356,7 +337,6 @@ int ExtScript::showConfiguration(const QVariant args) setExecutable(ui->lineEdit_command->text()); setPrefix(ui->lineEdit_prefix->text()); setActive(ui->checkBox_active->checkState() == Qt::Checked); - setHasOutput(ui->checkBox_output->checkState() == Qt::Checked); setStrRedirect(ui->comboBox_redirect->currentText()); setInterval(ui->spinBox_interval->value()); // filters @@ -380,7 +360,6 @@ void ExtScript::writeConfiguration() const settings.beginGroup(QString("Desktop Entry")); settings.setValue(QString("Exec"), m_executable); settings.setValue(QString("X-AW-Prefix"), m_prefix); - settings.setValue(QString("X-AW-Output"), QVariant(m_output).toString()); settings.setValue(QString("X-AW-Redirect"), strRedirect()); settings.setValue(QString("X-AW-Filters"), m_filters.join(QChar(','))); settings.endGroup(); @@ -397,7 +376,7 @@ void ExtScript::updateValue() QString qdebug = QTextCodec::codecForMib(106)->toUnicode(process->readAllStandardError()).trimmed(); qCInfo(LOG_LIB) << "Error" << qdebug; QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process->readAllStandardOutput()).trimmed(); - qCInfo(LOG_LIB) << "Error" << qoutput; + qCInfo(LOG_LIB) << "Output" << qoutput; QString strValue; switch (m_redirect) { @@ -406,6 +385,9 @@ void ExtScript::updateValue() case stderr2stdout: strValue = QString("%1\n%2").arg(qdebug).arg(qoutput); break; + case swap: + strValue = qdebug; + break; case nothing: default: strValue = qoutput; @@ -427,7 +409,6 @@ void ExtScript::translate() ui->label_command->setText(i18n("Command")); ui->label_prefix->setText(i18n("Prefix")); ui->checkBox_active->setText(i18n("Active")); - ui->checkBox_output->setText(i18n("Has output")); ui->label_redirect->setText(i18n("Redirect")); ui->label_interval->setText(i18n("Interval")); ui->groupBox_filters->setTitle(i18n("Additional filters")); diff --git a/sources/awesomewidgets/extscript.h b/sources/awesomewidgets/extscript.h index 399afe3..ea6bfce 100644 --- a/sources/awesomewidgets/extscript.h +++ b/sources/awesomewidgets/extscript.h @@ -33,7 +33,6 @@ class ExtScript : public AbstractExtItem Q_OBJECT Q_PROPERTY(QString executable READ executable WRITE setExecutable) Q_PROPERTY(QStringList filters READ filters WRITE setFilters) - Q_PROPERTY(bool output READ hasOutput WRITE setHasOutput) Q_PROPERTY(QString prefix READ prefix WRITE setPrefix) Q_PROPERTY(Redirect redirect READ redirect WRITE setRedirect) @@ -41,7 +40,8 @@ public: enum Redirect { stdout2stderr = 0, nothing, - stderr2stdout + stderr2stdout, + swap }; explicit ExtScript(QWidget *parent = nullptr, const QString scriptName = QString(), @@ -51,7 +51,6 @@ public: // get methods QString executable() const; QStringList filters() const; - bool hasOutput() const; QString prefix() const; Redirect redirect() const; QString uniq() const; @@ -60,7 +59,6 @@ public: // set methods void setExecutable(const QString _executable = QString("/usr/bin/true")); void setFilters(const QStringList _filters = QStringList()); - void setHasOutput(const bool _state = true); void setPrefix(const QString _prefix = QString("")); void setRedirect(const Redirect _redirect = nothing); void setStrRedirect(const QString _redirect = QString("nothing")); @@ -85,7 +83,6 @@ private: // properties QString m_executable = QString("/usr/bin/true"); QStringList m_filters = QStringList(); - bool m_output = true; QString m_prefix = QString(""); Redirect m_redirect = nothing; // internal properties diff --git a/sources/awesomewidgets/extscript.ui b/sources/awesomewidgets/extscript.ui index f4295cd..25c7c77 100644 --- a/sources/awesomewidgets/extscript.ui +++ b/sources/awesomewidgets/extscript.ui @@ -157,36 +157,6 @@ - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Has output - - - - - @@ -216,6 +186,11 @@ stderr2stdout + + + swap + + diff --git a/sources/extsysmon/sources/playersource.cpp b/sources/extsysmon/sources/playersource.cpp index 2cf3aa9..7a122a6 100644 --- a/sources/extsysmon/sources/playersource.cpp +++ b/sources/extsysmon/sources/playersource.cpp @@ -143,12 +143,13 @@ void PlayerSource::run() // initial data if (m_player == QString("mpd")) { // mpd - values = getPlayerMpdInfo(m_mpdAddress); + QHash data = getPlayerMpdInfo(m_mpdAddress); + foreach(QString key, data.keys()) values[key] = data[key]; } else if (m_player == QString("mpris")) { // players which supports mpris QString mpris = m_mpris == QString("auto") ? getAutoMpris() : m_mpris; - if (mpris.isEmpty()) return; - values = getPlayerMprisInfo(mpris); + QHash data = getPlayerMprisInfo(mpris); + foreach(QString key, data.keys()) values[key] = data[key]; } // dymanic properties @@ -193,6 +194,19 @@ QStringList PlayerSource::sources() const } +QVariantHash PlayerSource::defaultInfo() const +{ + QVariantHash info; + info[QString("player/album")] = QString("unknown"); + info[QString("player/artist")] = QString("unknown"); + info[QString("player/duration")] = 0; + info[QString("player/progress")] = 0; + info[QString("player/title")] = QString("unknown"); + + return info; +} + + QString PlayerSource::getAutoMpris() const { qCDebug(LOG_ESM); @@ -218,12 +232,7 @@ QVariantHash PlayerSource::getPlayerMpdInfo(const QString mpdAddress) const qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "MPD" << mpdAddress; - QVariantHash info; - info[QString("player/album")] = QString("unknown"); - info[QString("player/artist")] = QString("unknown"); - info[QString("player/duration")] = 0; - info[QString("player/progress")] = 0; - info[QString("player/title")] = QString("unknown"); + QVariantHash info = defaultInfo(); // build cmd QString cmd = QString("bash -c \"echo 'currentsong\nstatus\nclose' | curl --connect-timeout 1 -fsm 3 telnet://%1\"") @@ -259,12 +268,8 @@ QVariantHash PlayerSource::getPlayerMprisInfo(const QString mpris) const qCDebug(LOG_ESM); qCDebug(LOG_ESM) << "MPRIS" << mpris; - QVariantHash info; - info[QString("player/album")] = QString("unknown"); - info[QString("player/artist")] = QString("unknown"); - info[QString("player/duration")] = 0; - info[QString("player/progress")] = 0; - info[QString("player/title")] = QString("unknown"); + QVariantHash info = defaultInfo(); + if (mpris.isEmpty()) return info; QDBusConnection bus = QDBusConnection::sessionBus(); // comes from the following request: @@ -318,7 +323,7 @@ QString PlayerSource::buildString(const QString current, const QString value, int index = value.indexOf(current); if ((current.isEmpty()) || ((index + s + 1) > value.count())) - return value.leftJustified(s, QLatin1Char(' ')); + return QString("%1").arg(value.left(s), s, QLatin1Char(' ')); else return QString("%1").arg(value.mid(index + 1, s), s, QLatin1Char(' ')); } diff --git a/sources/extsysmon/sources/playersource.h b/sources/extsysmon/sources/playersource.h index be2a4ee..b95ce3e 100644 --- a/sources/extsysmon/sources/playersource.h +++ b/sources/extsysmon/sources/playersource.h @@ -34,6 +34,7 @@ public: QStringList sources() const; private: + inline QVariantHash defaultInfo() const; QString getAutoMpris() const; QVariantHash getPlayerMpdInfo(const QString mpdAddress) const; QVariantHash getPlayerMprisInfo(const QString mpris) const; diff --git a/sources/translations/awesome-widgets.pot b/sources/translations/awesome-widgets.pot index 1cb60cf..bce2f02 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: 2015-09-06 21:11+0300\n" +"POT-Creation-Date: 2015-09-11 22:03+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -50,6 +50,9 @@ msgstr "" msgid "Wrap new lines" msgstr "" +msgid "Enable word wrap" +msgstr "" + msgid "Enable background" msgstr "" @@ -191,6 +194,18 @@ msgstr "" msgid "Edit weather" msgstr "" +msgid "Select tag" +msgstr "" + +msgid "Tag: %1" +msgstr "" + +msgid "Value: %1" +msgstr "" + +msgid "Info: %1" +msgstr "" + msgid "Request key" msgstr "" @@ -291,15 +306,6 @@ msgstr "" msgid "Show value" msgstr "" -msgid "Tag: %1" -msgstr "" - -msgid "Value: %1" -msgstr "" - -msgid "Info: %1" -msgstr "" - msgid "Add lambda" msgstr "" @@ -366,12 +372,6 @@ msgstr "" msgid "There are updates" msgstr "" -msgid "Select tag" -msgstr "" - -msgid "Tag" -msgstr "" - msgid "AC online" msgstr "" @@ -381,15 +381,15 @@ msgstr "" msgid "High CPU load" msgstr "" -msgid "High GPU load" -msgstr "" - -msgid "Free space on %1 less than 10%" -msgstr "" - msgid "High memory usage" msgstr "" +msgid "Swap is used" +msgstr "" + +msgid "High GPU load" +msgstr "" + msgid "Network device has been changed to %1" msgstr "" @@ -399,9 +399,6 @@ msgstr "" msgid "KB/s" msgstr "" -msgid "Swap is used" -msgstr "" - msgid "Copy" msgstr "" @@ -432,6 +429,9 @@ msgstr "" msgid "Comment" msgstr "" +msgid "Tag" +msgstr "" + msgid "" "

Use YAHOO! finance ticker to get quotes for the " "instrument. Refer to \n" "Language-Team: English \n" "Language: ru\n" @@ -51,6 +51,9 @@ msgstr "Enable notifications" msgid "Wrap new lines" msgstr "Wrap new lines" +msgid "Enable word wrap" +msgstr "Enable word wrap" + msgid "Enable background" msgstr "Enable background" @@ -192,6 +195,18 @@ msgstr "Weather" msgid "Edit weather" msgstr "Edit weather" +msgid "Select tag" +msgstr "Select tag" + +msgid "Tag: %1" +msgstr "Tag: %1" + +msgid "Value: %1" +msgstr "Value: %1" + +msgid "Info: %1" +msgstr "Info: %1" + msgid "Request key" msgstr "Request key" @@ -296,15 +311,6 @@ msgstr "Add" msgid "Show value" msgstr "Show value" -msgid "Tag: %1" -msgstr "Tag: %1" - -msgid "Value: %1" -msgstr "Value: %1" - -msgid "Info: %1" -msgstr "Info: %1" - msgid "Add lambda" msgstr "Add lambda" @@ -371,12 +377,6 @@ msgstr "Click \"Ok\" to download" msgid "There are updates" msgstr "There are updates" -msgid "Select tag" -msgstr "Select tag" - -msgid "Tag" -msgstr "Tag" - msgid "AC online" msgstr "AC online" @@ -386,15 +386,15 @@ msgstr "AC offline" msgid "High CPU load" msgstr "High CPU load" -msgid "High GPU load" -msgstr "High GPU load" - -msgid "Free space on %1 less than 10%" -msgstr "Free space on %1 less than 10%" - msgid "High memory usage" msgstr "High memory usage" +msgid "Swap is used" +msgstr "Swap is used" + +msgid "High GPU load" +msgstr "High GPU load" + msgid "Network device has been changed to %1" msgstr "Network device has been changed to %1" @@ -404,9 +404,6 @@ msgstr "MB/s" msgid "KB/s" msgstr "KB/s" -msgid "Swap is used" -msgstr "Swap is used" - msgid "Copy" msgstr "Copy" @@ -437,6 +434,9 @@ msgstr "Name" msgid "Comment" msgstr "Comment" +msgid "Tag" +msgstr "Tag" + msgid "" "

Use YAHOO! finance ticker to get quotes for the " "instrument. Refer to \n" "Language-Team: Spanish \n" @@ -51,6 +51,9 @@ msgstr "Habilitar notificaciones" msgid "Wrap new lines" msgstr "Ajustar las nuevas líneas" +msgid "Enable word wrap" +msgstr "" + msgid "Enable background" msgstr "Habilitar fondo" @@ -195,6 +198,18 @@ msgstr "" msgid "Edit weather" msgstr "Editar tickets" +msgid "Select tag" +msgstr "Elegir etiqueta" + +msgid "Tag: %1" +msgstr "Etiqueta: %1" + +msgid "Value: %1" +msgstr "Valor: %1" + +msgid "Info: %1" +msgstr "Información: %1" + msgid "Request key" msgstr "Solicitar llave" @@ -307,15 +322,6 @@ msgstr "Añadir" msgid "Show value" msgstr "Mostrar valor" -msgid "Tag: %1" -msgstr "Etiqueta: %1" - -msgid "Value: %1" -msgstr "Valor: %1" - -msgid "Info: %1" -msgstr "Información: %1" - msgid "Add lambda" msgstr "" @@ -383,12 +389,6 @@ msgstr "Haz clic en «Ok» para descargar" msgid "There are updates" msgstr "Hay actualizaciones disponibles" -msgid "Select tag" -msgstr "Elegir etiqueta" - -msgid "Tag" -msgstr "Etiqueta" - msgid "AC online" msgstr "Alimentación conectada" @@ -398,15 +398,15 @@ msgstr "Alimentación desconectada" msgid "High CPU load" msgstr "Carga alta de CPU" -msgid "High GPU load" -msgstr "Carga alta de GPU" - -msgid "Free space on %1 less than 10%" -msgstr "Espacio libre en %1 es menos del 10%" - msgid "High memory usage" msgstr "Alto uso de la memoria" +msgid "Swap is used" +msgstr "Swap está en uso" + +msgid "High GPU load" +msgstr "Carga alta de GPU" + msgid "Network device has been changed to %1" msgstr "El dispositivo de red ha sido cambiado a %1" @@ -416,9 +416,6 @@ msgstr "" msgid "KB/s" msgstr "" -msgid "Swap is used" -msgstr "Swap está en uso" - msgid "Copy" msgstr "Copiar" @@ -450,6 +447,9 @@ msgstr "Nombre" msgid "Comment" msgstr "Comentario" +msgid "Tag" +msgstr "Etiqueta" + msgid "" "

Use YAHOO! finance ticker to get quotes for the " "instrument. Refer to \n" "Language-Team: French \n" @@ -53,6 +53,9 @@ msgstr "Activer les notifications" msgid "Wrap new lines" msgstr "Couper les lignes supplémentaires" +msgid "Enable word wrap" +msgstr "" + msgid "Enable background" msgstr "Activer le fond" @@ -197,6 +200,18 @@ msgstr "" msgid "Edit weather" msgstr "Modifier les tickers" +msgid "Select tag" +msgstr "Sélectionner l'étiquette" + +msgid "Tag: %1" +msgstr "Etiquette: %1" + +msgid "Value: %1" +msgstr "Valeur: %1" + +msgid "Info: %1" +msgstr "Info: %1" + msgid "Request key" msgstr "Demander une clé" @@ -309,15 +324,6 @@ msgstr "Ajouter" msgid "Show value" msgstr "Afficher la valeur" -msgid "Tag: %1" -msgstr "Etiquette: %1" - -msgid "Value: %1" -msgstr "Valeur: %1" - -msgid "Info: %1" -msgstr "Info: %1" - msgid "Add lambda" msgstr "" @@ -387,12 +393,6 @@ msgstr "Cliquer sur \"Valider\" pour télécharger" msgid "There are updates" msgstr "Des mises à jour sont disponibles" -msgid "Select tag" -msgstr "Sélectionner l'étiquette" - -msgid "Tag" -msgstr "Étiquette" - msgid "AC online" msgstr "Alimentation branchée" @@ -402,15 +402,15 @@ msgstr "Alimentation débranchée" msgid "High CPU load" msgstr "Haute charge CPU" -msgid "High GPU load" -msgstr "Haute charge GPU" - -msgid "Free space on %1 less than 10%" -msgstr "Espace libre sur %1 inférieur à 10%" - msgid "High memory usage" msgstr "Haute utilisation mémoire" +msgid "Swap is used" +msgstr "Fichier d'échange utilisé" + +msgid "High GPU load" +msgstr "Haute charge GPU" + msgid "Network device has been changed to %1" msgstr "L'interface réseau à été changée en %1" @@ -420,9 +420,6 @@ msgstr "" msgid "KB/s" msgstr "" -msgid "Swap is used" -msgstr "Fichier d'échange utilisé" - msgid "Copy" msgstr "Copier" @@ -456,6 +453,9 @@ msgstr "Nom: %1" msgid "Comment" msgstr "Commentaire: %1" +msgid "Tag" +msgstr "Étiquette" + msgid "" "

Use YAHOO! finance ticker to get quotes for the " "instrument. Refer to \n" "Language-Team: Dutch \n" @@ -53,6 +53,9 @@ msgstr "" msgid "Wrap new lines" msgstr "" +msgid "Enable word wrap" +msgstr "" + msgid "Enable background" msgstr "Achtergrond inschakelen" @@ -198,6 +201,18 @@ msgstr "" msgid "Edit weather" msgstr "Balken bewerken" +msgid "Select tag" +msgstr "Sleutelwoord selecteren" + +msgid "Tag: %1" +msgstr "Sleutelwoord: %1" + +msgid "Value: %1" +msgstr "Waarde: %1" + +msgid "Info: %1" +msgstr "Informatie: %1" + msgid "Request key" msgstr "Sleutel aanvragen" @@ -308,15 +323,6 @@ msgstr "Toevoegen" msgid "Show value" msgstr "Waarde weergeven" -msgid "Tag: %1" -msgstr "Sleutelwoord: %1" - -msgid "Value: %1" -msgstr "Waarde: %1" - -msgid "Info: %1" -msgstr "Informatie: %1" - msgid "Add lambda" msgstr "" @@ -387,12 +393,6 @@ msgstr "Klik op \"OK\" om te downloaden" msgid "There are updates" msgstr "Er zijn updates" -msgid "Select tag" -msgstr "Sleutelwoord selecteren" - -msgid "Tag" -msgstr "Sleutelwoord" - msgid "AC online" msgstr "AC online" @@ -402,16 +402,16 @@ msgstr "AC offline" msgid "High CPU load" msgstr "Hoog CPU-verbruik" +msgid "High memory usage" +msgstr "Hoog geheugenverbruik" + +msgid "Swap is used" +msgstr "Swap wordt gebruikt" + #, fuzzy msgid "High GPU load" msgstr "Hoog CPU-verbruik" -msgid "Free space on %1 less than 10%" -msgstr "De vrije ruimte op %1 is minder dan 10%" - -msgid "High memory usage" -msgstr "Hoog geheugenverbruik" - msgid "Network device has been changed to %1" msgstr "Het netwerkapparaat is gewijzigd naar %1" @@ -421,9 +421,6 @@ msgstr "" msgid "KB/s" msgstr "" -msgid "Swap is used" -msgstr "Swap wordt gebruikt" - msgid "Copy" msgstr "Kopiëren" @@ -455,6 +452,9 @@ msgstr "Naam" msgid "Comment" msgstr "Commentaar" +msgid "Tag" +msgstr "Sleutelwoord" + msgid "" "

Use YAHOO! finance ticker to get quotes for the " "instrument. Refer to \n" "Language-Team: Russian \n" @@ -52,6 +52,9 @@ msgstr "Ativar notificações" msgid "Wrap new lines" msgstr "Cobrir novas linhas" +msgid "Enable word wrap" +msgstr "" + msgid "Enable background" msgstr "Ativar plano de fundo" @@ -196,6 +199,18 @@ msgstr "" msgid "Edit weather" msgstr "Editar relógios" +msgid "Select tag" +msgstr "Selecionar tag" + +msgid "Tag: %1" +msgstr "Tag: %1" + +msgid "Value: %1" +msgstr "Valor: %1" + +msgid "Info: %1" +msgstr "Info: %1" + msgid "Request key" msgstr "Solicitar chave" @@ -307,15 +322,6 @@ msgstr "Adicionar" msgid "Show value" msgstr "Mostrar valor" -msgid "Tag: %1" -msgstr "Tag: %1" - -msgid "Value: %1" -msgstr "Valor: %1" - -msgid "Info: %1" -msgstr "Info: %1" - msgid "Add lambda" msgstr "" @@ -383,12 +389,6 @@ msgstr "Clique \"Ok\" para baixar" msgid "There are updates" msgstr "Há atualizações disponíveis" -msgid "Select tag" -msgstr "Selecionar tag" - -msgid "Tag" -msgstr "Tag" - msgid "AC online" msgstr "Carregador conectado" @@ -398,15 +398,15 @@ msgstr "Carregador desconectado" msgid "High CPU load" msgstr "Alta carga da CPU" -msgid "High GPU load" -msgstr "Alta carga da GPU" - -msgid "Free space on %1 less than 10%" -msgstr "O espaço livre em %1 é menor que 10%" - msgid "High memory usage" msgstr "Alto uso de memória" +msgid "Swap is used" +msgstr "Swap está sendo usado" + +msgid "High GPU load" +msgstr "Alta carga da GPU" + msgid "Network device has been changed to %1" msgstr "O dispositivo de rede mudou para %1" @@ -416,9 +416,6 @@ msgstr "" msgid "KB/s" msgstr "" -msgid "Swap is used" -msgstr "Swap está sendo usado" - msgid "Copy" msgstr "Copiar" @@ -449,6 +446,9 @@ msgstr "NOme" msgid "Comment" msgstr "Comentário" +msgid "Tag" +msgstr "Tag" + msgid "" "

Use YAHOO! finance ticker to get quotes for the " "instrument. Refer to \n" "Language-Team: Russian \n" "Language: ru\n" @@ -51,6 +51,9 @@ msgstr "Включить уведомления " msgid "Wrap new lines" msgstr "Заменить символ перевода строки" +msgid "Enable word wrap" +msgstr "Включить перенос слов" + msgid "Enable background" msgstr "Включить фон" @@ -192,6 +195,18 @@ msgstr "Погода" msgid "Edit weather" msgstr "Редактировать погоду" +msgid "Select tag" +msgstr "Выберете тег" + +msgid "Tag: %1" +msgstr "Тег: %1" + +msgid "Value: %1" +msgstr "Значение: %1" + +msgid "Info: %1" +msgstr "Информация: %1" + msgid "Request key" msgstr "Показать ключ" @@ -296,15 +311,6 @@ msgstr "Добавить" msgid "Show value" msgstr "Показать значение" -msgid "Tag: %1" -msgstr "Тег: %1" - -msgid "Value: %1" -msgstr "Значение: %1" - -msgid "Info: %1" -msgstr "Информация: %1" - msgid "Add lambda" msgstr "Добавить лямбду" @@ -371,12 +377,6 @@ msgstr "Нажмите \"Ok\" для загрузки" msgid "There are updates" msgstr "Найдены обновления" -msgid "Select tag" -msgstr "Выберете тег" - -msgid "Tag" -msgstr "Тег" - msgid "AC online" msgstr "AC подключен" @@ -386,15 +386,15 @@ msgstr "AC отключен" msgid "High CPU load" msgstr "Высокая загрузка CPU" -msgid "High GPU load" -msgstr "Высокая загрузка GPU" - -msgid "Free space on %1 less than 10%" -msgstr "Свободное место на диске %1 меньше 10%" - msgid "High memory usage" msgstr "Большое потребление памяти" +msgid "Swap is used" +msgstr "Используется своп" + +msgid "High GPU load" +msgstr "Высокая загрузка GPU" + msgid "Network device has been changed to %1" msgstr "Сетевое устройство было изменено на %1" @@ -404,9 +404,6 @@ msgstr "МБ/с" msgid "KB/s" msgstr "КБ/с" -msgid "Swap is used" -msgstr "Используется своп" - msgid "Copy" msgstr "Копировать" @@ -437,6 +434,9 @@ msgstr "Имя" msgid "Comment" msgstr "Комментарий" +msgid "Tag" +msgstr "Тег" + msgid "" "

Use YAHOO! finance ticker to get quotes for the " "instrument. Refer to \n" "Language-Team: Ukrainian \n" @@ -51,6 +51,9 @@ msgstr "Включити повідомлення" msgid "Wrap new lines" msgstr "Замінити символ переводу рядка" +msgid "Enable word wrap" +msgstr "" + msgid "Enable background" msgstr "Включити фон" @@ -195,6 +198,18 @@ msgstr "" msgid "Edit weather" msgstr "Редагувати тікети" +msgid "Select tag" +msgstr "Оберіть тег" + +msgid "Tag: %1" +msgstr "Тег: %1" + +msgid "Value: %1" +msgstr "Значення: %1" + +msgid "Info: %1" +msgstr "Інформація: %1" + msgid "Request key" msgstr "Показати ключ" @@ -307,15 +322,6 @@ msgstr "Додати" msgid "Show value" msgstr "Показати значення" -msgid "Tag: %1" -msgstr "Тег: %1" - -msgid "Value: %1" -msgstr "Значення: %1" - -msgid "Info: %1" -msgstr "Інформація: %1" - msgid "Add lambda" msgstr "" @@ -383,12 +389,6 @@ msgstr "Натисніть \"Ok\" для завантаження" msgid "There are updates" msgstr "Знайдені оновлення" -msgid "Select tag" -msgstr "Оберіть тег" - -msgid "Tag" -msgstr "Тег" - msgid "AC online" msgstr "AC підключений" @@ -398,15 +398,15 @@ msgstr "AC відключений" msgid "High CPU load" msgstr "Високе завантаження CPU" -msgid "High GPU load" -msgstr "Високе завантаження GPU" - -msgid "Free space on %1 less than 10%" -msgstr "Вільний простір на диску %1 меньше ніж 10%" - msgid "High memory usage" msgstr "Велике споживання пам’яті" +msgid "Swap is used" +msgstr "Використовується swap" + +msgid "High GPU load" +msgstr "Високе завантаження GPU" + msgid "Network device has been changed to %1" msgstr "Мережевий пристрій було змінено на %1" @@ -416,9 +416,6 @@ msgstr "" msgid "KB/s" msgstr "" -msgid "Swap is used" -msgstr "Використовується swap" - msgid "Copy" msgstr "Копіювати" @@ -450,6 +447,9 @@ msgstr "Ім’я" msgid "Comment" msgstr "Коментар" +msgid "Tag" +msgstr "Тег" + msgid "" "

Use YAHOO! finance ticker to get quotes for the " "instrument. Refer to \n" "Language-Team: Russian \n" @@ -51,6 +51,9 @@ msgstr "" msgid "Wrap new lines" msgstr "" +msgid "Enable word wrap" +msgstr "" + msgid "Enable background" msgstr "启用背景" @@ -197,6 +200,19 @@ msgstr "" msgid "Edit weather" msgstr "可编辑的" +#, fuzzy +msgid "Select tag" +msgstr "选择字体" + +msgid "Tag: %1" +msgstr "" + +msgid "Value: %1" +msgstr "" + +msgid "Info: %1" +msgstr "" + msgid "Request key" msgstr "" @@ -307,15 +323,6 @@ msgstr "添加" msgid "Show value" msgstr "" -msgid "Tag: %1" -msgstr "" - -msgid "Value: %1" -msgstr "" - -msgid "Info: %1" -msgstr "" - msgid "Add lambda" msgstr "" @@ -383,13 +390,6 @@ msgstr "" msgid "There are updates" msgstr "" -#, fuzzy -msgid "Select tag" -msgstr "选择字体" - -msgid "Tag" -msgstr "" - #, fuzzy msgid "AC online" msgstr "外接电源使用中标签" @@ -401,15 +401,15 @@ msgstr "外接电源未使用标签" msgid "High CPU load" msgstr "" -msgid "High GPU load" -msgstr "" - -msgid "Free space on %1 less than 10%" -msgstr "" - msgid "High memory usage" msgstr "" +msgid "Swap is used" +msgstr "" + +msgid "High GPU load" +msgstr "" + msgid "Network device has been changed to %1" msgstr "" @@ -419,9 +419,6 @@ msgstr "" msgid "KB/s" msgstr "" -msgid "Swap is used" -msgstr "" - msgid "Copy" msgstr "" @@ -453,6 +450,9 @@ msgstr "" msgid "Comment" msgstr "自定义命令" +msgid "Tag" +msgstr "" + msgid "" "

Use YAHOO! finance ticker to get quotes for the " "instrument. Refer to