From 7a00dce7c520e79ba7ee5d4faa7ba8436f2477be Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Fri, 7 Jul 2017 00:52:16 +0300 Subject: [PATCH 1/9] initial implementation of custom keys --- .../plugin/awcustomkeyshelper.cpp | 127 ++++++++++++++++++ .../plugin/awcustomkeyshelper.h | 48 +++++++ .../plugin/awdataaggregator.cpp | 2 - .../awesome-widget/plugin/awdataaggregator.h | 9 +- .../plugin/awformatterhelper.cpp | 16 +-- .../awesome-widget/plugin/awformatterhelper.h | 4 +- sources/awesome-widget/plugin/awkeycache.cpp | 2 + sources/awesome-widget/plugin/awkeycache.h | 1 + .../awesome-widget/plugin/awkeyoperations.cpp | 62 +++++---- .../awesome-widget/plugin/awkeyoperations.h | 5 + sources/awesome-widget/plugin/awkeys.cpp | 16 ++- sources/awesome-widget/plugin/awkeys.h | 3 +- .../plugin/awkeysaggregator.cpp | 6 +- sources/awesomewidgets/extitemaggregator.h | 26 ++-- 14 files changed, 264 insertions(+), 63 deletions(-) create mode 100644 sources/awesome-widget/plugin/awcustomkeyshelper.cpp create mode 100644 sources/awesome-widget/plugin/awcustomkeyshelper.h diff --git a/sources/awesome-widget/plugin/awcustomkeyshelper.cpp b/sources/awesome-widget/plugin/awcustomkeyshelper.cpp new file mode 100644 index 0000000..f3ac4f9 --- /dev/null +++ b/sources/awesome-widget/plugin/awcustomkeyshelper.cpp @@ -0,0 +1,127 @@ +/*************************************************************************** + * This file is part of awesome-widgets * + * * + * awesome-widgets is free software: you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * awesome-widgets is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with awesome-widgets. If not, see http://www.gnu.org/licenses/ * + ***************************************************************************/ + +#include "awcustomkeyshelper.h" + +#include +#include +#include + +#include "awdebug.h" + + +AWCustomKeysHelper::AWCustomKeysHelper(QObject *_parent) + : QObject(_parent) +{ + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; + + m_filePath = "awesomewidgets/custom.ini"; + initKeys(); +} + + +AWCustomKeysHelper::~AWCustomKeysHelper() +{ + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; +} + + +void AWCustomKeysHelper::initKeys() +{ + m_keys.clear(); + + QStringList configs = QStandardPaths::locateAll( + QStandardPaths::GenericDataLocation, m_filePath); + + for (auto &fileName : configs) { + QSettings settings(fileName, QSettings::IniFormat); + qCInfo(LOG_AW) << "Configuration file" << settings.fileName(); + + settings.beginGroup("Custom"); + QStringList keys = settings.childKeys(); + for (auto &key : keys) { + QString source = settings.value(key).toString(); + qCInfo(LOG_AW) << "Found custom key" << key << "for source" + << source << "in" << settings.fileName(); + if (source.isEmpty()) { + qCInfo(LOG_AW) << "Skip empty source for" << key; + continue; + } + m_keys[key] = source; + } + settings.endGroup(); + } +} + + +bool AWCustomKeysHelper::writeKeys( + const QHash &_configuration) const +{ + qCDebug(LOG_AW) << "Write configuration" << _configuration; + + QString fileName = QString("%1/%2") + .arg(QStandardPaths::writableLocation( + QStandardPaths::GenericDataLocation)) + .arg(m_filePath); + QSettings settings(fileName, QSettings::IniFormat); + qCInfo(LOG_AW) << "Configuration file" << fileName; + + settings.beginGroup("Custom"); + for (auto &key : _configuration.keys()) + settings.setValue(key, _configuration[key]); + settings.endGroup(); + + settings.sync(); + + return (settings.status() == QSettings::NoError); +} + + +QStringList AWCustomKeysHelper::keys() const +{ + return m_keys.keys(); +} + + +QString AWCustomKeysHelper::source(const QString &_key) const +{ + qCDebug(LOG_AW) << "Get source by key" << _key; + + return m_keys[_key]; +} + + +QStringList AWCustomKeysHelper::sources() const +{ + return QSet::fromList(m_keys.values()).toList(); +} + + +QStringList AWCustomKeysHelper::refinedSources() const +{ + auto allSources = QSet::fromList(m_keys.values()); + QSet output; + + while (output != allSources) { + output.clear(); + for (auto &src : allSources) + output.insert(m_keys.contains(src) ? source(src) : src); + allSources = output; + } + + return output.toList(); +} diff --git a/sources/awesome-widget/plugin/awcustomkeyshelper.h b/sources/awesome-widget/plugin/awcustomkeyshelper.h new file mode 100644 index 0000000..442b05d --- /dev/null +++ b/sources/awesome-widget/plugin/awcustomkeyshelper.h @@ -0,0 +1,48 @@ +/*************************************************************************** + * This file is part of awesome-widgets * + * * + * awesome-widgets is free software: you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * awesome-widgets is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with awesome-widgets. If not, see http://www.gnu.org/licenses/ * + ***************************************************************************/ + + +#ifndef AWCUSTOMKEYSHELPER_H +#define AWCUSTOMKEYSHELPER_H + +#include +#include + + +class AWCustomKeysHelper : public QObject +{ + Q_OBJECT + +public: + explicit AWCustomKeysHelper(QObject *_parent = nullptr); + virtual ~AWCustomKeysHelper(); + void initKeys(); + bool writeKeys(const QHash &_configuration) const; + // get + QStringList keys() const; + QString source(const QString &_key) const; + QStringList sources() const; + QStringList refinedSources() const; + +private: + // properties + QString m_filePath; + QHash m_keys; +}; + + +#endif /* AWCUSTOMKEYSHELPER_H */ diff --git a/sources/awesome-widget/plugin/awdataaggregator.cpp b/sources/awesome-widget/plugin/awdataaggregator.cpp index 86fd530..0a8e9b5 100644 --- a/sources/awesome-widget/plugin/awdataaggregator.cpp +++ b/sources/awesome-widget/plugin/awdataaggregator.cpp @@ -44,8 +44,6 @@ AWDataAggregator::AWDataAggregator(QObject *_parent) m_boundaries["batTooltip"] = 100.0; initScene(); - connect(this, SIGNAL(updateData(const QVariantHash &)), this, - SLOT(dataUpdate(const QVariantHash &))); } diff --git a/sources/awesome-widget/plugin/awdataaggregator.h b/sources/awesome-widget/plugin/awdataaggregator.h index 720b490..fc4be79 100644 --- a/sources/awesome-widget/plugin/awdataaggregator.h +++ b/sources/awesome-widget/plugin/awdataaggregator.h @@ -40,13 +40,12 @@ public: void setParameters(const QVariantMap &_settings); QPixmap tooltipImage(); -signals: - void updateData(const QVariantHash &_values); - void toolTipPainted(const QString &_image) const; - -private slots: +public slots: void dataUpdate(const QVariantHash &_values); +signals: + void toolTipPainted(const QString &_image) const; + private: // ui QGraphicsScene *m_toolTipScene = nullptr; diff --git a/sources/awesome-widget/plugin/awformatterhelper.cpp b/sources/awesome-widget/plugin/awformatterhelper.cpp index 29f0567..c830974 100644 --- a/sources/awesome-widget/plugin/awformatterhelper.cpp +++ b/sources/awesome-widget/plugin/awformatterhelper.cpp @@ -78,6 +78,14 @@ QHash AWFormatterHelper::getFormatters() const } +void AWFormatterHelper::initItems() +{ + installDirectories(); + initFormatters(); + initKeys(); +} + + QList AWFormatterHelper::items() const { QList converted; @@ -333,11 +341,3 @@ void AWFormatterHelper::doCreateItem() return createItem(); } } - - -void AWFormatterHelper::initItems() -{ - installDirectories(); - initFormatters(); - initKeys(); -} diff --git a/sources/awesome-widget/plugin/awformatterhelper.h b/sources/awesome-widget/plugin/awformatterhelper.h index 577c84d..e70c3d5 100644 --- a/sources/awesome-widget/plugin/awformatterhelper.h +++ b/sources/awesome-widget/plugin/awformatterhelper.h @@ -24,8 +24,6 @@ #include "awabstractformatter.h" -class AWAbstractFormatter; - class AWFormatterHelper : public AbstractExtItemAggregator { Q_OBJECT @@ -36,6 +34,7 @@ public: QString convert(const QVariant &_value, const QString &_name) const; QStringList definedFormatters() const; QHash getFormatters() const; + void initItems(); QList items() const; QStringList knownFormatters() const; bool removeUnusedFormatters(const QStringList &_keys) const; @@ -55,7 +54,6 @@ private: readMetadata(const QString &_filePath) const; // parent methods void doCreateItem(); - void initItems(); // properties QStringList m_directories; QString m_filePath; diff --git a/sources/awesome-widget/plugin/awkeycache.cpp b/sources/awesome-widget/plugin/awkeycache.cpp index dc91798..dbfd93f 100644 --- a/sources/awesome-widget/plugin/awkeycache.cpp +++ b/sources/awesome-widget/plugin/awkeycache.cpp @@ -86,6 +86,7 @@ bool AWKeyCache::addKeyToCache(const QString &_type, const QString &_key) QStringList AWKeyCache::getRequiredKeys(const QStringList &_keys, const QStringList &_bars, const QVariantMap &_tooltip, + const QStringList &_userKeys, const QStringList &_allKeys) { qCDebug(LOG_AW) << "Looking for required keys in" << _keys << _bars @@ -94,6 +95,7 @@ QStringList AWKeyCache::getRequiredKeys(const QStringList &_keys, // initial copy QSet used = QSet::fromList(_keys); used.unite(QSet::fromList(_bars)); + used.unite(QSet::fromList(_userKeys)); // insert keys from tooltip for (auto &key : _tooltip.keys()) { if ((key.endsWith("Tooltip")) && (_tooltip[key].toBool())) { diff --git a/sources/awesome-widget/plugin/awkeycache.h b/sources/awesome-widget/plugin/awkeycache.h index 6d2077a..c9fb3bf 100644 --- a/sources/awesome-widget/plugin/awkeycache.h +++ b/sources/awesome-widget/plugin/awkeycache.h @@ -29,6 +29,7 @@ namespace AWKeyCache bool addKeyToCache(const QString &_type, const QString &_key = ""); QStringList getRequiredKeys(const QStringList &_keys, const QStringList &_bars, const QVariantMap &_tooltip, + const QStringList &_userKeys, const QStringList &_allKeys); QHash loadKeysFromCache(); }; diff --git a/sources/awesome-widget/plugin/awkeyoperations.cpp b/sources/awesome-widget/plugin/awkeyoperations.cpp index 68d4c63..5dc9a0d 100644 --- a/sources/awesome-widget/plugin/awkeyoperations.cpp +++ b/sources/awesome-widget/plugin/awkeyoperations.cpp @@ -22,6 +22,7 @@ #include #include +#include "awcustomkeyshelper.h" #include "awdebug.h" #include "awkeycache.h" #include "awpatternfunctions.h" @@ -38,6 +39,16 @@ AWKeyOperations::AWKeyOperations(QObject *_parent) : QObject(_parent) { qCDebug(LOG_AW) << __PRETTY_FUNCTION__; + + m_customKeys = new AWCustomKeysHelper(this); + m_graphicalItems + = new ExtItemAggregator(nullptr, "desktops"); + m_extNetRequest + = new ExtItemAggregator(nullptr, "requests"); + m_extQuotes = new ExtItemAggregator(nullptr, "quotes"); + m_extScripts = new ExtItemAggregator(nullptr, "scripts"); + m_extUpgrade = new ExtItemAggregator(nullptr, "upgrade"); + m_extWeather = new ExtItemAggregator(nullptr, "weather"); } @@ -46,6 +57,7 @@ AWKeyOperations::~AWKeyOperations() qCDebug(LOG_AW) << __PRETTY_FUNCTION__; // extensions + delete m_customKeys; delete m_graphicalItems; delete m_extNetRequest; delete m_extQuotes; @@ -159,6 +171,8 @@ QStringList AWKeyOperations::dictKeys() const // bars for (auto &item : m_graphicalItems->activeItems()) allKeys.append(item->tag("bar")); + // user defined keys + allKeys.append(m_customKeys->keys()); // static keys allKeys.append(QString(STATIC_KEYS).split(',')); @@ -180,6 +194,24 @@ GraphicalItem *AWKeyOperations::giByKey(const QString &_key) const } +QStringList AWKeyOperations::requiredUserKeys() const +{ + return m_customKeys->refinedSources(); +} + + +QStringList AWKeyOperations::userKeys() const +{ + return m_customKeys->keys(); +} + + +QString AWKeyOperations::userKeySource(const QString &_key) const +{ + return m_customKeys->source(_key); +} + + QString AWKeyOperations::infoByKey(const QString &_key) const { qCDebug(LOG_AW) << "Requested key" << _key; @@ -314,29 +346,13 @@ void AWKeyOperations::addKeyToCache(const QString &_type, const QString &_key) void AWKeyOperations::reinitKeys() { - // renew extensions - // delete them if any - delete m_graphicalItems; - m_graphicalItems = nullptr; - delete m_extNetRequest; - m_extNetRequest = nullptr; - delete m_extQuotes; - m_extQuotes = nullptr; - delete m_extScripts; - m_extScripts = nullptr; - delete m_extUpgrade; - m_extUpgrade = nullptr; - delete m_extWeather; - m_extWeather = nullptr; - // create - m_graphicalItems - = new ExtItemAggregator(nullptr, "desktops"); - m_extNetRequest - = new ExtItemAggregator(nullptr, "requests"); - m_extQuotes = new ExtItemAggregator(nullptr, "quotes"); - m_extScripts = new ExtItemAggregator(nullptr, "scripts"); - m_extUpgrade = new ExtItemAggregator(nullptr, "upgrade"); - m_extWeather = new ExtItemAggregator(nullptr, "weather"); + m_customKeys->initKeys(); + m_graphicalItems->initItems(); + m_extNetRequest->initItems(); + m_extQuotes->initItems(); + m_extScripts->initItems(); + m_extUpgrade->initItems(); + m_extWeather->initItems(); // init QStringList allKeys = dictKeys(); diff --git a/sources/awesome-widget/plugin/awkeyoperations.h b/sources/awesome-widget/plugin/awkeyoperations.h index fbff5c0..cd74099 100644 --- a/sources/awesome-widget/plugin/awkeyoperations.h +++ b/sources/awesome-widget/plugin/awkeyoperations.h @@ -27,6 +27,7 @@ #include "extitemaggregator.h" +class AWCustomKeysHelper; class AWDataAggregator; class AWDataEngineAggregator; class AWKeysAggregator; @@ -52,6 +53,9 @@ public: // keys QStringList dictKeys() const; GraphicalItem *giByKey(const QString &_key) const; + QStringList requiredUserKeys() const; + QStringList userKeys() const; + QString userKeySource(const QString &_key) const; // values QString infoByKey(const QString &_key) const; QString pattern() const; @@ -70,6 +74,7 @@ private: void addKeyToCache(const QString &_type, const QString &_key = ""); void reinitKeys(); // objects + AWCustomKeysHelper *m_customKeys = nullptr; ExtItemAggregator *m_graphicalItems = nullptr; ExtItemAggregator *m_extNetRequest = nullptr; ExtItemAggregator *m_extQuotes = nullptr; diff --git a/sources/awesome-widget/plugin/awkeys.cpp b/sources/awesome-widget/plugin/awkeys.cpp index e5cd5b9..4d32985 100644 --- a/sources/awesome-widget/plugin/awkeys.cpp +++ b/sources/awesome-widget/plugin/awkeys.cpp @@ -250,10 +250,11 @@ void AWKeys::reinitKeys(const QStringList &_currentKeys) barKeys.append(item->usedKeys()); } // get required keys - m_requiredKeys - = m_optimize ? AWKeyCache::getRequiredKeys( - m_foundKeys, barKeys, m_tooltipParams, _currentKeys) - : QStringList(); + m_requiredKeys = m_optimize + ? AWKeyCache::getRequiredKeys( + m_foundKeys, barKeys, m_tooltipParams, + m_keyOperator->requiredUserKeys(), _currentKeys) + : QStringList(); // set key data to m_aggregator m_aggregator->setDevices(m_keyOperator->devices()); @@ -266,10 +267,11 @@ void AWKeys::updateTextData() m_mutex.lock(); calculateValues(); QString text = parsePattern(m_keyOperator->pattern()); + // update tooltip values under lock + m_dataAggregator->dataUpdate(m_values); m_mutex.unlock(); emit(needTextToBeUpdated(text)); - emit(m_dataAggregator->updateData(m_values)); } @@ -321,6 +323,10 @@ void AWKeys::calculateValues() m_values["swap"] = 100.0f * m_values["swapmb"].toFloat() / m_values["swaptotmb"].toFloat(); + // user defined keys + for (auto &key : m_keyOperator->userKeys()) + m_values[key] = m_values[m_keyOperator->userKeySource(key)]; + // lambdas for (auto &key : m_foundLambdas) m_values[key] = AWPatternFunctions::expandLambdas( diff --git a/sources/awesome-widget/plugin/awkeys.h b/sources/awesome-widget/plugin/awkeys.h index e7b6535..f0011bd 100644 --- a/sources/awesome-widget/plugin/awkeys.h +++ b/sources/awesome-widget/plugin/awkeys.h @@ -25,6 +25,7 @@ #include +class AWCustomKeysHelper; class AWDataAggregator; class AWDataEngineAggregator; class AWKeyOperations; @@ -46,7 +47,7 @@ public: const bool _optimize); Q_INVOKABLE void setAggregatorProperty(const QString &_key, const QVariant &_value); - Q_INVOKABLE void setWrapNewLines(const bool _wrap = false); + Q_INVOKABLE void setWrapNewLines(const bool _wrap); // additional method to force load keys from Qml UI. Used in some // configuration pages Q_INVOKABLE void updateCache(); diff --git a/sources/awesome-widget/plugin/awkeysaggregator.cpp b/sources/awesome-widget/plugin/awkeysaggregator.cpp index 62066cc..c8137d5 100644 --- a/sources/awesome-widget/plugin/awkeysaggregator.cpp +++ b/sources/awesome-widget/plugin/awkeysaggregator.cpp @@ -32,6 +32,8 @@ AWKeysAggregator::AWKeysAggregator(QObject *_parent) { qCDebug(LOG_AW) << __PRETTY_FUNCTION__; + m_customFormatters = new AWFormatterHelper(nullptr); + // sort time keys m_timeKeys.sort(); std::reverse(m_timeKeys.begin(), m_timeKeys.end()); @@ -65,9 +67,7 @@ AWKeysAggregator::~AWKeysAggregator() void AWKeysAggregator::initFormatters() { - if (m_customFormatters) - delete m_customFormatters; - m_customFormatters = new AWFormatterHelper(nullptr); + m_customFormatters->initItems(); } diff --git a/sources/awesomewidgets/extitemaggregator.h b/sources/awesomewidgets/extitemaggregator.h index f16a913..84a3fed 100644 --- a/sources/awesomewidgets/extitemaggregator.h +++ b/sources/awesomewidgets/extitemaggregator.h @@ -61,6 +61,19 @@ public: qCInfo(LOG_LIB) << "Dialog returns" << ret; }; + void initItems() + { + m_items.clear(); + m_activeItems.clear(); + + m_items = getItems(); + for (auto &item : m_items) { + if (!item->isActive()) + continue; + m_activeItems.append(static_cast(item)); + } + }; + void initSockets() { // HACK as soon as per one widget instance we have two objects each of @@ -148,19 +161,6 @@ private: }); return items; }; - - void initItems() - { - m_items.clear(); - m_activeItems.clear(); - - m_items = getItems(); - for (auto &item : m_items) { - if (!item->isActive()) - continue; - m_activeItems.append(static_cast(item)); - } - }; }; From 7ce3e8b1cf94c4396411d29f4761ce89bf7a163b Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Mon, 10 Jul 2017 01:43:21 +0300 Subject: [PATCH 2/9] add custom keys configuration --- .../plugin/awcustomkeysconfig.cpp | 173 ++++++++++++++++++ .../plugin/awcustomkeysconfig.h | 62 +++++++ .../plugin/awcustomkeysconfig.ui | 93 ++++++++++ .../plugin/awcustomkeyshelper.cpp | 38 +++- .../plugin/awcustomkeyshelper.h | 7 +- .../plugin/awformatterconfig.cpp | 2 +- .../plugin/awformatterconfigfactory.cpp | 11 +- .../plugin/awformatterconfigfactory.h | 3 +- .../plugin/awformatterhelper.cpp | 62 +++---- .../awesome-widget/plugin/awformatterhelper.h | 6 +- .../awesome-widget/plugin/awkeyoperations.cpp | 2 +- .../abstractextitemaggregator.h | 2 +- sources/qml/AWExtensions.qml | 12 +- sources/test/CMakeLists.txt | 1 + 14 files changed, 428 insertions(+), 46 deletions(-) create mode 100644 sources/awesome-widget/plugin/awcustomkeysconfig.cpp create mode 100644 sources/awesome-widget/plugin/awcustomkeysconfig.h create mode 100644 sources/awesome-widget/plugin/awcustomkeysconfig.ui diff --git a/sources/awesome-widget/plugin/awcustomkeysconfig.cpp b/sources/awesome-widget/plugin/awcustomkeysconfig.cpp new file mode 100644 index 0000000..5788697 --- /dev/null +++ b/sources/awesome-widget/plugin/awcustomkeysconfig.cpp @@ -0,0 +1,173 @@ +/*************************************************************************** + * This file is part of awesome-widgets * + * * + * awesome-widgets is free software: you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * awesome-widgets is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with awesome-widgets. If not, see http://www.gnu.org/licenses/ * + ***************************************************************************/ + +#include "awcustomkeysconfig.h" +#include "ui_awcustomkeysconfig.h" + +#include + +#include + +#include "awabstractselector.h" +#include "awdebug.h" +#include "awcustomkeyshelper.h" + + +AWCustomKeysConfig::AWCustomKeysConfig(QWidget *_parent, const QStringList &_keys) + : QDialog(_parent) + , ui(new Ui::AWCustomKeysConfig) + , m_keys(_keys) +{ + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; + + ui->setupUi(this); + init(); + + connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept())); + connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject())); +} + + +AWCustomKeysConfig::~AWCustomKeysConfig() +{ + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; + + clearSelectors(); + + delete m_helper; + delete ui; +} + + +void AWCustomKeysConfig::showDialog() +{ + // update dialog + updateDialog(); + // exec dialog + return execDialog(); +} + + +void AWCustomKeysConfig::updateUi() +{ + QPair current + = static_cast(sender())->current(); + int index + = m_selectors.indexOf(static_cast(sender())); + + if ((current.first.isEmpty()) && (current.second.isEmpty())) { + // remove current selector if it is empty and does not last + if (sender() == m_selectors.last()) + return; + AWAbstractSelector *selector = m_selectors.takeAt(index); + ui->verticalLayout->removeWidget(selector); + selector->deleteLater(); + } else { + // add new selector if something changed + if (sender() != m_selectors.last()) + return; + auto keys = initKeys(); + addSelector(keys.first, keys.second, QPair()); + } +} + + +void AWCustomKeysConfig::addSelector(const QStringList &_keys, + const QStringList &_values, + const QPair &_current) +{ + qCDebug(LOG_AW) << "Add selector with keys" << _keys << "values" << _values + << "and current ones" << _current; + + AWAbstractSelector *selector + = new AWAbstractSelector(ui->scrollAreaWidgetContents, {true, false}); + selector->init(_keys, _values, _current); + ui->verticalLayout->insertWidget(ui->verticalLayout->count() - 1, selector); + connect(selector, SIGNAL(selectionChanged()), this, SLOT(updateUi())); + m_selectors.append(selector); +} + + +void AWCustomKeysConfig::clearSelectors() +{ + for (auto &selector : m_selectors) { + disconnect(selector, SIGNAL(selectionChanged()), this, + SLOT(updateUi())); + ui->verticalLayout->removeWidget(selector); + selector->deleteLater(); + } + m_selectors.clear(); +} + + +void AWCustomKeysConfig::execDialog() +{ + int ret = exec(); + QHash data; + for (auto &selector : m_selectors) { + QPair select = selector->current(); + if (select.first.isEmpty()) + continue; + data[select.first] = select.second; + } + + // save configuration if required + switch (ret) { + case 0: + break; + case 1: + default: + m_helper->writeItems(data); + m_helper->removeUnusedKeys(data.keys()); + break; + } +} + + +void AWCustomKeysConfig::init() +{ + delete m_helper; + m_helper = new AWCustomKeysHelper(this); +} + + +QPair AWCustomKeysConfig::initKeys() const +{ + // we are adding empty string at the start + QStringList keys = QStringList() << ""; + keys.append(m_keys); + keys.sort(); + QStringList userKeys = QStringList() << ""; + userKeys.append(m_helper->keys()); + userKeys.sort(); + + return QPair(userKeys, keys); +} + + +void AWCustomKeysConfig::updateDialog() +{ + clearSelectors(); + auto userKeys = m_helper->getUserKeys(); + auto keys = initKeys(); + + for (auto &key : userKeys.keys()) + addSelector(keys.first, keys.second, + QPair(key, userKeys[key])); + // empty one + addSelector(keys.first, keys.second, QPair()); +} diff --git a/sources/awesome-widget/plugin/awcustomkeysconfig.h b/sources/awesome-widget/plugin/awcustomkeysconfig.h new file mode 100644 index 0000000..a6ea821 --- /dev/null +++ b/sources/awesome-widget/plugin/awcustomkeysconfig.h @@ -0,0 +1,62 @@ +/*************************************************************************** + * This file is part of awesome-widgets * + * * + * awesome-widgets is free software: you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * awesome-widgets is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with awesome-widgets. If not, see http://www.gnu.org/licenses/ * + ***************************************************************************/ + + +#ifndef AWCUSTOMKEYSCONFIG_H +#define AWCUSTOMKEYSCONFIG_H + +#include + + +class AWAbstractSelector; +class AWCustomKeysHelper; +namespace Ui +{ +class AWCustomKeysConfig; +} + +class AWCustomKeysConfig : public QDialog +{ + Q_OBJECT + +public: + explicit AWCustomKeysConfig(QWidget *_parent = nullptr, + const QStringList &_keys = QStringList()); + virtual ~AWCustomKeysConfig(); + Q_INVOKABLE void showDialog(); + +private slots: + void updateUi(); + +private: + Ui::AWCustomKeysConfig *ui = nullptr; + AWCustomKeysHelper *m_helper = nullptr; + QList m_selectors; + // properties + QStringList m_keys; + // methods + void addSelector(const QStringList &_keys, const QStringList &_values, + const QPair &_current); + void clearSelectors(); + void execDialog(); + void init(); + QPair initKeys() const; + void updateDialog(); +}; + + +#endif /* AWCUSTOMKEYSCONFIG_H */ diff --git a/sources/awesome-widget/plugin/awcustomkeysconfig.ui b/sources/awesome-widget/plugin/awcustomkeysconfig.ui new file mode 100644 index 0000000..41ee1e8 --- /dev/null +++ b/sources/awesome-widget/plugin/awcustomkeysconfig.ui @@ -0,0 +1,93 @@ + + + AWCustomKeysConfig + + + + 0 + 0 + 400 + 300 + + + + + + + true + + + + + 0 + 0 + 384 + 249 + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + AWCustomKeysConfig + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + AWCustomKeysConfig + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/sources/awesome-widget/plugin/awcustomkeyshelper.cpp b/sources/awesome-widget/plugin/awcustomkeyshelper.cpp index f3ac4f9..7030b44 100644 --- a/sources/awesome-widget/plugin/awcustomkeyshelper.cpp +++ b/sources/awesome-widget/plugin/awcustomkeyshelper.cpp @@ -30,7 +30,7 @@ AWCustomKeysHelper::AWCustomKeysHelper(QObject *_parent) qCDebug(LOG_AW) << __PRETTY_FUNCTION__; m_filePath = "awesomewidgets/custom.ini"; - initKeys(); + initItems(); } @@ -40,7 +40,7 @@ AWCustomKeysHelper::~AWCustomKeysHelper() } -void AWCustomKeysHelper::initKeys() +void AWCustomKeysHelper::initItems() { m_keys.clear(); @@ -68,7 +68,7 @@ void AWCustomKeysHelper::initKeys() } -bool AWCustomKeysHelper::writeKeys( +bool AWCustomKeysHelper::writeItems( const QHash &_configuration) const { qCDebug(LOG_AW) << "Write configuration" << _configuration; @@ -91,6 +91,38 @@ bool AWCustomKeysHelper::writeKeys( } +bool AWCustomKeysHelper::removeUnusedKeys(const QStringList &_keys) const +{ + qCDebug(LOG_AW) << "Remove keys" << _keys; + + QString fileName = QString("%1/%2") + .arg(QStandardPaths::writableLocation( + QStandardPaths::GenericDataLocation)) + .arg(m_filePath); + QSettings settings(fileName, QSettings::IniFormat); + qCInfo(LOG_AW) << "Configuration file" << fileName; + + settings.beginGroup("Custom"); + QStringList foundKeys = settings.childKeys(); + for (auto &key : foundKeys) { + if (_keys.contains(key)) + continue; + settings.remove(key); + } + settings.endGroup(); + + settings.sync(); + + return (settings.status() == QSettings::NoError); +} + + +QHash AWCustomKeysHelper::getUserKeys() const +{ + return m_keys; +} + + QStringList AWCustomKeysHelper::keys() const { return m_keys.keys(); diff --git a/sources/awesome-widget/plugin/awcustomkeyshelper.h b/sources/awesome-widget/plugin/awcustomkeyshelper.h index 442b05d..6953d83 100644 --- a/sources/awesome-widget/plugin/awcustomkeyshelper.h +++ b/sources/awesome-widget/plugin/awcustomkeyshelper.h @@ -30,9 +30,12 @@ class AWCustomKeysHelper : public QObject public: explicit AWCustomKeysHelper(QObject *_parent = nullptr); virtual ~AWCustomKeysHelper(); - void initKeys(); - bool writeKeys(const QHash &_configuration) const; + // read-write methods + void initItems(); + bool writeItems(const QHash &_configuration) const; + bool removeUnusedKeys(const QStringList &_keys) const; // get + QHash getUserKeys() const; QStringList keys() const; QString source(const QString &_key) const; QStringList sources() const; diff --git a/sources/awesome-widget/plugin/awformatterconfig.cpp b/sources/awesome-widget/plugin/awformatterconfig.cpp index e9ed850..7701ff8 100644 --- a/sources/awesome-widget/plugin/awformatterconfig.cpp +++ b/sources/awesome-widget/plugin/awformatterconfig.cpp @@ -141,7 +141,7 @@ void AWFormatterConfig::execDialog() break; case 1: default: - m_helper->writeFormatters(data); + m_helper->writeItems(data); m_helper->removeUnusedFormatters(data.keys()); break; } diff --git a/sources/awesome-widget/plugin/awformatterconfigfactory.cpp b/sources/awesome-widget/plugin/awformatterconfigfactory.cpp index 33484d1..e32441f 100644 --- a/sources/awesome-widget/plugin/awformatterconfigfactory.cpp +++ b/sources/awesome-widget/plugin/awformatterconfigfactory.cpp @@ -19,6 +19,7 @@ #include "awdebug.h" #include "awformatterconfig.h" +#include "awcustomkeysconfig.h" AWFormatterConfigFactory::AWFormatterConfigFactory(QObject *_parent) @@ -34,9 +35,17 @@ AWFormatterConfigFactory::~AWFormatterConfigFactory() } -void AWFormatterConfigFactory::showDialog(const QStringList &_keys) +void AWFormatterConfigFactory::showFormatterDialog(const QStringList &_keys) { AWFormatterConfig *config = new AWFormatterConfig(nullptr, _keys); config->showDialog(); config->deleteLater(); } + + +void AWFormatterConfigFactory::showKeysDialog(const QStringList &_keys) +{ + AWCustomKeysConfig *config = new AWCustomKeysConfig(nullptr, _keys); + config->showDialog(); + config->deleteLater(); +} diff --git a/sources/awesome-widget/plugin/awformatterconfigfactory.h b/sources/awesome-widget/plugin/awformatterconfigfactory.h index e4c4c69..b8fc7fe 100644 --- a/sources/awesome-widget/plugin/awformatterconfigfactory.h +++ b/sources/awesome-widget/plugin/awformatterconfigfactory.h @@ -29,7 +29,8 @@ class AWFormatterConfigFactory : public QObject public: explicit AWFormatterConfigFactory(QObject *_parent = nullptr); virtual ~AWFormatterConfigFactory(); - Q_INVOKABLE void showDialog(const QStringList &_keys); + Q_INVOKABLE void showFormatterDialog(const QStringList &_keys); + Q_INVOKABLE void showKeysDialog(const QStringList &_keys); private: }; diff --git a/sources/awesome-widget/plugin/awformatterhelper.cpp b/sources/awesome-widget/plugin/awformatterhelper.cpp index c830974..0d902e4 100644 --- a/sources/awesome-widget/plugin/awformatterhelper.cpp +++ b/sources/awesome-widget/plugin/awformatterhelper.cpp @@ -52,6 +52,37 @@ AWFormatterHelper::~AWFormatterHelper() } +void AWFormatterHelper::initItems() +{ + installDirectories(); + initFormatters(); + initKeys(); +} + + +bool AWFormatterHelper::writeItems( + const QHash &_configuration) const +{ + qCDebug(LOG_AW) << "Write configuration" << _configuration; + + QString fileName = QString("%1/%2") + .arg(QStandardPaths::writableLocation( + QStandardPaths::GenericDataLocation)) + .arg(m_filePath); + QSettings settings(fileName, QSettings::IniFormat); + qCInfo(LOG_AW) << "Configuration file" << fileName; + + settings.beginGroup("Formatters"); + for (auto &key : _configuration.keys()) + settings.setValue(key, _configuration[key]); + settings.endGroup(); + + settings.sync(); + + return (settings.status() == QSettings::NoError); +} + + QString AWFormatterHelper::convert(const QVariant &_value, const QString &_name) const { @@ -78,14 +109,6 @@ QHash AWFormatterHelper::getFormatters() const } -void AWFormatterHelper::initItems() -{ - installDirectories(); - initFormatters(); - initKeys(); -} - - QList AWFormatterHelper::items() const { QList converted; @@ -128,29 +151,6 @@ bool AWFormatterHelper::removeUnusedFormatters(const QStringList &_keys) const } -bool AWFormatterHelper::writeFormatters( - const QHash &_configuration) const -{ - qCDebug(LOG_AW) << "Write configuration" << _configuration; - - QString fileName = QString("%1/%2") - .arg(QStandardPaths::writableLocation( - QStandardPaths::GenericDataLocation)) - .arg(m_filePath); - QSettings settings(fileName, QSettings::IniFormat); - qCInfo(LOG_AW) << "Configuration file" << fileName; - - settings.beginGroup("Formatters"); - for (auto &key : _configuration.keys()) - settings.setValue(key, _configuration[key]); - settings.endGroup(); - - settings.sync(); - - return (settings.status() == QSettings::NoError); -} - - void AWFormatterHelper::editItems() { repaintList(); diff --git a/sources/awesome-widget/plugin/awformatterhelper.h b/sources/awesome-widget/plugin/awformatterhelper.h index e70c3d5..2da1e48 100644 --- a/sources/awesome-widget/plugin/awformatterhelper.h +++ b/sources/awesome-widget/plugin/awformatterhelper.h @@ -31,14 +31,16 @@ class AWFormatterHelper : public AbstractExtItemAggregator public: explicit AWFormatterHelper(QWidget *_parent = nullptr); virtual ~AWFormatterHelper(); + // read-write methods + void initItems(); + bool writeItems(const QHash &_configuration) const; + // methods QString convert(const QVariant &_value, const QString &_name) const; QStringList definedFormatters() const; QHash getFormatters() const; - void initItems(); QList items() const; QStringList knownFormatters() const; bool removeUnusedFormatters(const QStringList &_keys) const; - bool writeFormatters(const QHash &_configuration) const; public slots: void editItems(); diff --git a/sources/awesome-widget/plugin/awkeyoperations.cpp b/sources/awesome-widget/plugin/awkeyoperations.cpp index 5dc9a0d..5dbc60f 100644 --- a/sources/awesome-widget/plugin/awkeyoperations.cpp +++ b/sources/awesome-widget/plugin/awkeyoperations.cpp @@ -346,7 +346,7 @@ void AWKeyOperations::addKeyToCache(const QString &_type, const QString &_key) void AWKeyOperations::reinitKeys() { - m_customKeys->initKeys(); + m_customKeys->initItems(); m_graphicalItems->initItems(); m_extNetRequest->initItems(); m_extQuotes->initItems(); diff --git a/sources/awesomewidgets/abstractextitemaggregator.h b/sources/awesomewidgets/abstractextitemaggregator.h index 207a43e..7916b7e 100644 --- a/sources/awesomewidgets/abstractextitemaggregator.h +++ b/sources/awesomewidgets/abstractextitemaggregator.h @@ -67,6 +67,7 @@ public: void deleteItem(); void editItem(); QString getName(); + virtual void initItems() = 0; AbstractExtItem *itemFromWidget(); void repaintList(); int uniqNumber() const; @@ -92,7 +93,6 @@ private: QString m_type; // ui methods virtual void doCreateItem() = 0; - virtual void initItems() = 0; }; diff --git a/sources/qml/AWExtensions.qml b/sources/qml/AWExtensions.qml index c2bba77..eed6e0d 100644 --- a/sources/qml/AWExtensions.qml +++ b/sources/qml/AWExtensions.qml @@ -41,15 +41,21 @@ Row { signal showMessage(string message) QtControls.Button { - width: parent.width * 3 / 10 + width: parent.width * 3 / 15 text: i18n("Edit bars") onClicked: backend.editItem("graphicalitem") } QtControls.Button { - width: parent.width * 3 / 10 + width: parent.width * 3 / 15 text: i18n("Formatters") - onClicked: awFormatter.showDialog(backend.dictKeys(true)) + onClicked: awFormatter.showFormatterDialog(backend.dictKeys(true)) + } + + QtControls.Button { + width: parent.width * 3 / 15 + text: i18n("User keys") + onClicked: awFormatter.showKeysDialog(backend.dictKeys(true)) } QtControls.Button { diff --git a/sources/test/CMakeLists.txt b/sources/test/CMakeLists.txt index b2788e6..ae7f9db 100644 --- a/sources/test/CMakeLists.txt +++ b/sources/test/CMakeLists.txt @@ -43,6 +43,7 @@ foreach (TEST_MODULE ${TEST_MODULES}) set(${TEST_MODULE}_SOURCES ${${TEST_MODULE}_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awkeycache.cpp) elseif (TEST_MODULE MATCHES "awkeys") set(${TEST_MODULE}_SOURCES ${${TEST_MODULE}_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awactions.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awcustomkeyshelper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awdataaggregator.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awdataengineaggregator.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awdbusadaptor.cpp From 9d0a1bd70cadc8db1e9e1c1ce1317ef632d1eb37 Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Wed, 12 Jul 2017 03:28:03 +0300 Subject: [PATCH 3/9] rewrite formtatter* and customkeys* to share their code --- .../plugin/awabstractpairconfig.cpp | 190 ++++++++++++++++++ .../plugin/awabstractpairconfig.h | 75 +++++++ ...mkeysconfig.ui => awabstractpairconfig.ui} | 8 +- .../plugin/awabstractpairhelper.cpp | 135 +++++++++++++ .../plugin/awabstractpairhelper.h | 52 +++++ .../plugin/awcustomkeysconfig.cpp | 147 +------------- .../plugin/awcustomkeysconfig.h | 30 +-- .../plugin/awcustomkeyshelper.cpp | 115 ++--------- .../plugin/awcustomkeyshelper.h | 17 +- .../plugin/awformatterconfig.cpp | 152 +------------- .../awesome-widget/plugin/awformatterconfig.h | 32 +-- .../plugin/awformatterconfig.ui | 93 --------- .../plugin/awformatterconfigfactory.cpp | 2 +- .../plugin/awformatterhelper.cpp | 177 +++++----------- .../awesome-widget/plugin/awformatterhelper.h | 17 +- sources/awesome-widget/plugin/awkeys.cpp | 3 + .../abstractextitemaggregator.cpp | 21 ++ .../abstractextitemaggregator.h | 1 + sources/awesomewidgets/extitemaggregator.h | 26 +-- sources/qml/General.qml | 8 + sources/test/CMakeLists.txt | 6 +- 21 files changed, 595 insertions(+), 712 deletions(-) create mode 100644 sources/awesome-widget/plugin/awabstractpairconfig.cpp create mode 100644 sources/awesome-widget/plugin/awabstractpairconfig.h rename sources/awesome-widget/plugin/{awcustomkeysconfig.ui => awabstractpairconfig.ui} (91%) create mode 100644 sources/awesome-widget/plugin/awabstractpairhelper.cpp create mode 100644 sources/awesome-widget/plugin/awabstractpairhelper.h delete mode 100644 sources/awesome-widget/plugin/awformatterconfig.ui diff --git a/sources/awesome-widget/plugin/awabstractpairconfig.cpp b/sources/awesome-widget/plugin/awabstractpairconfig.cpp new file mode 100644 index 0000000..16c1ba9 --- /dev/null +++ b/sources/awesome-widget/plugin/awabstractpairconfig.cpp @@ -0,0 +1,190 @@ +/*************************************************************************** + * This file is part of awesome-widgets * + * * + * awesome-widgets is free software: you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * awesome-widgets is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with awesome-widgets. If not, see http://www.gnu.org/licenses/ * + ***************************************************************************/ + +#include "awabstractpairconfig.h" +#include "ui_awabstractpairconfig.h" + +#include + +#include + +#include "awabstractselector.h" +#include "awdebug.h" + + +AWAbstractPairConfig::AWAbstractPairConfig(QWidget *_parent, + const bool _hasEdit, + const QStringList &_keys) + : QDialog(_parent) + , ui(new Ui::AWAbstractPairConfig) + , m_hasEdit(_hasEdit) + , m_keys(_keys) +{ + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; + + ui->setupUi(this); + + connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept())); + connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + + // edit feature + if (m_hasEdit) { + m_editButton = ui->buttonBox->addButton(i18n("Edit"), + QDialogButtonBox::ActionRole); + connect(m_editButton, SIGNAL(clicked(bool)), this, SLOT(edit())); + } +} + + +AWAbstractPairConfig::~AWAbstractPairConfig() +{ + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; + + clearSelectors(); + + delete m_helper; + delete ui; +} + + +void AWAbstractPairConfig::showDialog() +{ + // update dialog + updateDialog(); + // exec dialog + return execDialog(); +} + + +void AWAbstractPairConfig::setEditable(const bool _first, const bool _second) +{ + qCDebug(LOG_AW) << "Set editable" << _first << _second; + + m_editable = {_first, _second}; +} + + +void AWAbstractPairConfig::edit() +{ + m_helper->editPairs(); + updateDialog(); +} + + +void AWAbstractPairConfig::updateUi() +{ + QPair current + = static_cast(sender())->current(); + int index + = m_selectors.indexOf(static_cast(sender())); + + if ((current.first.isEmpty()) && (current.second.isEmpty())) { + // remove current selector if it is empty and does not last + if (sender() == m_selectors.last()) + return; + AWAbstractSelector *selector = m_selectors.takeAt(index); + ui->verticalLayout->removeWidget(selector); + selector->deleteLater(); + } else { + // add new selector if something changed + if (sender() != m_selectors.last()) + return; + auto keys = initKeys(); + addSelector(keys.first, keys.second, QPair()); + } +} + + +void AWAbstractPairConfig::addSelector(const QStringList &_keys, + const QStringList &_values, + const QPair &_current) +{ + qCDebug(LOG_AW) << "Add selector with keys" << _keys << "values" << _values + << "and current ones" << _current; + + AWAbstractSelector *selector + = new AWAbstractSelector(ui->scrollAreaWidgetContents, m_editable); + selector->init(_keys, _values, _current); + ui->verticalLayout->insertWidget(ui->verticalLayout->count() - 1, selector); + connect(selector, SIGNAL(selectionChanged()), this, SLOT(updateUi())); + m_selectors.append(selector); +} + + +void AWAbstractPairConfig::clearSelectors() +{ + for (auto &selector : m_selectors) { + disconnect(selector, SIGNAL(selectionChanged()), this, + SLOT(updateUi())); + ui->verticalLayout->removeWidget(selector); + selector->deleteLater(); + } + m_selectors.clear(); +} + + +void AWAbstractPairConfig::execDialog() +{ + int ret = exec(); + QHash data; + for (auto &selector : m_selectors) { + QPair select = selector->current(); + if (select.first.isEmpty()) + continue; + data[select.first] = select.second; + } + + // save configuration if required + switch (ret) { + case 0: + break; + case 1: + default: + m_helper->writeItems(data); + m_helper->removeUnusedKeys(data.keys()); + break; + } +} + + +QPair AWAbstractPairConfig::initKeys() const +{ + // we are adding empty string at the start + QStringList left = {""}; + left.append(m_helper->leftKeys().isEmpty() ? m_keys : m_helper->leftKeys()); + left.sort(); + QStringList right = {""}; + right.append(m_helper->rightKeys().isEmpty() ? m_keys + : m_helper->rightKeys()); + right.sort(); + + return QPair(left, right); +} + + +void AWAbstractPairConfig::updateDialog() +{ + clearSelectors(); + auto pairs = m_helper->pairs(); + auto keys = initKeys(); + + for (auto &key : m_helper->keys()) + addSelector(keys.first, keys.second, + QPair(key, m_helper->pairs()[key])); + // empty one + addSelector(keys.first, keys.second, QPair()); +} diff --git a/sources/awesome-widget/plugin/awabstractpairconfig.h b/sources/awesome-widget/plugin/awabstractpairconfig.h new file mode 100644 index 0000000..df1fd40 --- /dev/null +++ b/sources/awesome-widget/plugin/awabstractpairconfig.h @@ -0,0 +1,75 @@ +/*************************************************************************** + * This file is part of awesome-widgets * + * * + * awesome-widgets is free software: you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * awesome-widgets is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with awesome-widgets. If not, see http://www.gnu.org/licenses/ * + ***************************************************************************/ + + +#ifndef AWABSTRACTPAIRCONFIG_H +#define AWABSTRACTPAIRCONFIG_H + +#include + +#include "awabstractpairhelper.h" + + +class AWAbstractSelector; +namespace Ui +{ +class AWAbstractPairConfig; +} + +class AWAbstractPairConfig : public QDialog +{ + Q_OBJECT + +public: + explicit AWAbstractPairConfig(QWidget *_parent = nullptr, + const bool _hasEdit = false, + const QStringList &_keys = QStringList()); + virtual ~AWAbstractPairConfig(); + template void initHelper() + { + if (m_helper) + delete m_helper; + m_helper = new T(this); + } + void showDialog(); + // properties + void setEditable(const bool _first, const bool _second); + +private slots: + void edit(); + void updateUi(); + +private: + QPushButton *m_editButton = nullptr; + Ui::AWAbstractPairConfig *ui = nullptr; + AWAbstractPairHelper *m_helper = nullptr; + QList m_selectors; + // properties + QPair m_editable = {false, false}; + bool m_hasEdit = false; + QStringList m_keys; + // methods + void addSelector(const QStringList &_keys, const QStringList &_values, + const QPair &_current); + void clearSelectors(); + void execDialog(); + QPair initKeys() const; + void updateDialog(); +}; + + +#endif /* AWABSTRACTPAIRCONFIG_H */ diff --git a/sources/awesome-widget/plugin/awcustomkeysconfig.ui b/sources/awesome-widget/plugin/awabstractpairconfig.ui similarity index 91% rename from sources/awesome-widget/plugin/awcustomkeysconfig.ui rename to sources/awesome-widget/plugin/awabstractpairconfig.ui index 41ee1e8..231f049 100644 --- a/sources/awesome-widget/plugin/awcustomkeysconfig.ui +++ b/sources/awesome-widget/plugin/awabstractpairconfig.ui @@ -1,7 +1,7 @@ - AWCustomKeysConfig - + AWAbstractPairConfig + 0 @@ -60,7 +60,7 @@ buttonBox accepted() - AWCustomKeysConfig + AWAbstractPairConfig accept() @@ -76,7 +76,7 @@ buttonBox rejected() - AWCustomKeysConfig + AWAbstractPairConfig reject() diff --git a/sources/awesome-widget/plugin/awabstractpairhelper.cpp b/sources/awesome-widget/plugin/awabstractpairhelper.cpp new file mode 100644 index 0000000..5f37995 --- /dev/null +++ b/sources/awesome-widget/plugin/awabstractpairhelper.cpp @@ -0,0 +1,135 @@ +/*************************************************************************** + * This file is part of awesome-widgets * + * * + * awesome-widgets is free software: you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * awesome-widgets is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with awesome-widgets. If not, see http://www.gnu.org/licenses/ * + ***************************************************************************/ + +#include "awabstractpairhelper.h" + +#include +#include + +#include "awdebug.h" + + +AWAbstractPairHelper::AWAbstractPairHelper(const QString &_filePath, + const QString &_section) + : m_filePath(_filePath) + , m_section(_section) +{ + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; + + initItems(); +} + + +AWAbstractPairHelper::~AWAbstractPairHelper() +{ + qCDebug(LOG_AW) << __PRETTY_FUNCTION__; +} + + +QStringList AWAbstractPairHelper::keys() const +{ + return m_pairs.keys(); +} + + +QHash AWAbstractPairHelper::pairs() const +{ + return m_pairs; +} + + +QStringList AWAbstractPairHelper::values() const +{ + return m_pairs.values(); +} + + +void AWAbstractPairHelper::initItems() +{ + m_pairs.clear(); + + QStringList configs = QStandardPaths::locateAll( + QStandardPaths::GenericDataLocation, m_filePath); + + for (auto &fileName : configs) { + QSettings settings(fileName, QSettings::IniFormat); + qCInfo(LOG_AW) << "Configuration file" << settings.fileName(); + + settings.beginGroup(m_section); + QStringList keys = settings.childKeys(); + for (auto &key : keys) { + QString value = settings.value(key).toString(); + qCInfo(LOG_AW) << "Found key" << key << "for value" << value << "in" + << settings.fileName(); + if (value.isEmpty()) { + qCInfo(LOG_AW) << "Skip empty value for" << key; + continue; + } + m_pairs[key] = value; + } + settings.endGroup(); + } +} + + +bool AWAbstractPairHelper::writeItems( + const QHash &_configuration) const +{ + qCDebug(LOG_AW) << "Write configuration" << _configuration; + + QString fileName = QString("%1/%2") + .arg(QStandardPaths::writableLocation( + QStandardPaths::GenericDataLocation)) + .arg(m_filePath); + QSettings settings(fileName, QSettings::IniFormat); + qCInfo(LOG_AW) << "Configuration file" << fileName; + + settings.beginGroup(m_section); + for (auto &key : _configuration.keys()) + settings.setValue(key, _configuration[key]); + settings.endGroup(); + + settings.sync(); + + return (settings.status() == QSettings::NoError); +} + + +bool AWAbstractPairHelper::removeUnusedKeys(const QStringList &_keys) const +{ + qCDebug(LOG_AW) << "Remove keys" << _keys; + + QString fileName = QString("%1/%2") + .arg(QStandardPaths::writableLocation( + QStandardPaths::GenericDataLocation)) + .arg(m_filePath); + QSettings settings(fileName, QSettings::IniFormat); + qCInfo(LOG_AW) << "Configuration file" << fileName; + + settings.beginGroup(m_section); + QStringList foundKeys = settings.childKeys(); + for (auto &key : foundKeys) { + if (_keys.contains(key)) + continue; + settings.remove(key); + } + settings.endGroup(); + + settings.sync(); + + return (settings.status() == QSettings::NoError); +} diff --git a/sources/awesome-widget/plugin/awabstractpairhelper.h b/sources/awesome-widget/plugin/awabstractpairhelper.h new file mode 100644 index 0000000..b1d5c33 --- /dev/null +++ b/sources/awesome-widget/plugin/awabstractpairhelper.h @@ -0,0 +1,52 @@ +/*************************************************************************** + * This file is part of awesome-widgets * + * * + * awesome-widgets is free software: you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * awesome-widgets is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with awesome-widgets. If not, see http://www.gnu.org/licenses/ * + ***************************************************************************/ + + +#ifndef AWABSTRACTPAIRHELPER_H +#define AWABSTRACTPAIRHELPER_H + +#include + + +class AWAbstractPairHelper +{ +public: + explicit AWAbstractPairHelper(const QString &_filePath = "", + const QString &_section = ""); + virtual ~AWAbstractPairHelper(); + QStringList keys() const; + QHash pairs() const; + QStringList values() const; + // read-write methods + virtual void initItems(); + virtual bool + writeItems(const QHash &_configuration) const; + virtual bool removeUnusedKeys(const QStringList &_keys) const; + // configuration related + virtual void editPairs() = 0; + virtual QStringList leftKeys() = 0; + virtual QStringList rightKeys() = 0; + +private: + // properties + QHash m_pairs; + QString m_filePath; + QString m_section; +}; + + +#endif /* AWABSTRACTPAIRHELPER_H */ diff --git a/sources/awesome-widget/plugin/awcustomkeysconfig.cpp b/sources/awesome-widget/plugin/awcustomkeysconfig.cpp index 5788697..5409151 100644 --- a/sources/awesome-widget/plugin/awcustomkeysconfig.cpp +++ b/sources/awesome-widget/plugin/awcustomkeysconfig.cpp @@ -16,158 +16,23 @@ ***************************************************************************/ #include "awcustomkeysconfig.h" -#include "ui_awcustomkeysconfig.h" -#include - -#include - -#include "awabstractselector.h" -#include "awdebug.h" #include "awcustomkeyshelper.h" +#include "awdebug.h" -AWCustomKeysConfig::AWCustomKeysConfig(QWidget *_parent, const QStringList &_keys) - : QDialog(_parent) - , ui(new Ui::AWCustomKeysConfig) - , m_keys(_keys) +AWCustomKeysConfig::AWCustomKeysConfig(QWidget *_parent, + const QStringList &_keys) + : AWAbstractPairConfig(_parent, false, _keys) { qCDebug(LOG_AW) << __PRETTY_FUNCTION__; - ui->setupUi(this); - init(); - - connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + setEditable(true, false); + initHelper(); } AWCustomKeysConfig::~AWCustomKeysConfig() { qCDebug(LOG_AW) << __PRETTY_FUNCTION__; - - clearSelectors(); - - delete m_helper; - delete ui; -} - - -void AWCustomKeysConfig::showDialog() -{ - // update dialog - updateDialog(); - // exec dialog - return execDialog(); -} - - -void AWCustomKeysConfig::updateUi() -{ - QPair current - = static_cast(sender())->current(); - int index - = m_selectors.indexOf(static_cast(sender())); - - if ((current.first.isEmpty()) && (current.second.isEmpty())) { - // remove current selector if it is empty and does not last - if (sender() == m_selectors.last()) - return; - AWAbstractSelector *selector = m_selectors.takeAt(index); - ui->verticalLayout->removeWidget(selector); - selector->deleteLater(); - } else { - // add new selector if something changed - if (sender() != m_selectors.last()) - return; - auto keys = initKeys(); - addSelector(keys.first, keys.second, QPair()); - } -} - - -void AWCustomKeysConfig::addSelector(const QStringList &_keys, - const QStringList &_values, - const QPair &_current) -{ - qCDebug(LOG_AW) << "Add selector with keys" << _keys << "values" << _values - << "and current ones" << _current; - - AWAbstractSelector *selector - = new AWAbstractSelector(ui->scrollAreaWidgetContents, {true, false}); - selector->init(_keys, _values, _current); - ui->verticalLayout->insertWidget(ui->verticalLayout->count() - 1, selector); - connect(selector, SIGNAL(selectionChanged()), this, SLOT(updateUi())); - m_selectors.append(selector); -} - - -void AWCustomKeysConfig::clearSelectors() -{ - for (auto &selector : m_selectors) { - disconnect(selector, SIGNAL(selectionChanged()), this, - SLOT(updateUi())); - ui->verticalLayout->removeWidget(selector); - selector->deleteLater(); - } - m_selectors.clear(); -} - - -void AWCustomKeysConfig::execDialog() -{ - int ret = exec(); - QHash data; - for (auto &selector : m_selectors) { - QPair select = selector->current(); - if (select.first.isEmpty()) - continue; - data[select.first] = select.second; - } - - // save configuration if required - switch (ret) { - case 0: - break; - case 1: - default: - m_helper->writeItems(data); - m_helper->removeUnusedKeys(data.keys()); - break; - } -} - - -void AWCustomKeysConfig::init() -{ - delete m_helper; - m_helper = new AWCustomKeysHelper(this); -} - - -QPair AWCustomKeysConfig::initKeys() const -{ - // we are adding empty string at the start - QStringList keys = QStringList() << ""; - keys.append(m_keys); - keys.sort(); - QStringList userKeys = QStringList() << ""; - userKeys.append(m_helper->keys()); - userKeys.sort(); - - return QPair(userKeys, keys); -} - - -void AWCustomKeysConfig::updateDialog() -{ - clearSelectors(); - auto userKeys = m_helper->getUserKeys(); - auto keys = initKeys(); - - for (auto &key : userKeys.keys()) - addSelector(keys.first, keys.second, - QPair(key, userKeys[key])); - // empty one - addSelector(keys.first, keys.second, QPair()); } diff --git a/sources/awesome-widget/plugin/awcustomkeysconfig.h b/sources/awesome-widget/plugin/awcustomkeysconfig.h index a6ea821..5554c82 100644 --- a/sources/awesome-widget/plugin/awcustomkeysconfig.h +++ b/sources/awesome-widget/plugin/awcustomkeysconfig.h @@ -19,17 +19,10 @@ #ifndef AWCUSTOMKEYSCONFIG_H #define AWCUSTOMKEYSCONFIG_H -#include +#include "awabstractpairconfig.h" -class AWAbstractSelector; -class AWCustomKeysHelper; -namespace Ui -{ -class AWCustomKeysConfig; -} - -class AWCustomKeysConfig : public QDialog +class AWCustomKeysConfig : public AWAbstractPairConfig { Q_OBJECT @@ -37,25 +30,6 @@ public: explicit AWCustomKeysConfig(QWidget *_parent = nullptr, const QStringList &_keys = QStringList()); virtual ~AWCustomKeysConfig(); - Q_INVOKABLE void showDialog(); - -private slots: - void updateUi(); - -private: - Ui::AWCustomKeysConfig *ui = nullptr; - AWCustomKeysHelper *m_helper = nullptr; - QList m_selectors; - // properties - QStringList m_keys; - // methods - void addSelector(const QStringList &_keys, const QStringList &_values, - const QPair &_current); - void clearSelectors(); - void execDialog(); - void init(); - QPair initKeys() const; - void updateDialog(); }; diff --git a/sources/awesome-widget/plugin/awcustomkeyshelper.cpp b/sources/awesome-widget/plugin/awcustomkeyshelper.cpp index 7030b44..efda044 100644 --- a/sources/awesome-widget/plugin/awcustomkeyshelper.cpp +++ b/sources/awesome-widget/plugin/awcustomkeyshelper.cpp @@ -18,19 +18,15 @@ #include "awcustomkeyshelper.h" #include -#include -#include #include "awdebug.h" AWCustomKeysHelper::AWCustomKeysHelper(QObject *_parent) : QObject(_parent) + , AWAbstractPairHelper("awesomewidgets/custom.ini", "Custom") { qCDebug(LOG_AW) << __PRETTY_FUNCTION__; - - m_filePath = "awesomewidgets/custom.ini"; - initItems(); } @@ -40,120 +36,43 @@ AWCustomKeysHelper::~AWCustomKeysHelper() } -void AWCustomKeysHelper::initItems() -{ - m_keys.clear(); - - QStringList configs = QStandardPaths::locateAll( - QStandardPaths::GenericDataLocation, m_filePath); - - for (auto &fileName : configs) { - QSettings settings(fileName, QSettings::IniFormat); - qCInfo(LOG_AW) << "Configuration file" << settings.fileName(); - - settings.beginGroup("Custom"); - QStringList keys = settings.childKeys(); - for (auto &key : keys) { - QString source = settings.value(key).toString(); - qCInfo(LOG_AW) << "Found custom key" << key << "for source" - << source << "in" << settings.fileName(); - if (source.isEmpty()) { - qCInfo(LOG_AW) << "Skip empty source for" << key; - continue; - } - m_keys[key] = source; - } - settings.endGroup(); - } -} - - -bool AWCustomKeysHelper::writeItems( - const QHash &_configuration) const -{ - qCDebug(LOG_AW) << "Write configuration" << _configuration; - - QString fileName = QString("%1/%2") - .arg(QStandardPaths::writableLocation( - QStandardPaths::GenericDataLocation)) - .arg(m_filePath); - QSettings settings(fileName, QSettings::IniFormat); - qCInfo(LOG_AW) << "Configuration file" << fileName; - - settings.beginGroup("Custom"); - for (auto &key : _configuration.keys()) - settings.setValue(key, _configuration[key]); - settings.endGroup(); - - settings.sync(); - - return (settings.status() == QSettings::NoError); -} - - -bool AWCustomKeysHelper::removeUnusedKeys(const QStringList &_keys) const -{ - qCDebug(LOG_AW) << "Remove keys" << _keys; - - QString fileName = QString("%1/%2") - .arg(QStandardPaths::writableLocation( - QStandardPaths::GenericDataLocation)) - .arg(m_filePath); - QSettings settings(fileName, QSettings::IniFormat); - qCInfo(LOG_AW) << "Configuration file" << fileName; - - settings.beginGroup("Custom"); - QStringList foundKeys = settings.childKeys(); - for (auto &key : foundKeys) { - if (_keys.contains(key)) - continue; - settings.remove(key); - } - settings.endGroup(); - - settings.sync(); - - return (settings.status() == QSettings::NoError); -} - - -QHash AWCustomKeysHelper::getUserKeys() const -{ - return m_keys; -} - - -QStringList AWCustomKeysHelper::keys() const -{ - return m_keys.keys(); -} - - QString AWCustomKeysHelper::source(const QString &_key) const { qCDebug(LOG_AW) << "Get source by key" << _key; - return m_keys[_key]; + return pairs()[_key]; } QStringList AWCustomKeysHelper::sources() const { - return QSet::fromList(m_keys.values()).toList(); + return QSet::fromList(values()).toList(); } QStringList AWCustomKeysHelper::refinedSources() const { - auto allSources = QSet::fromList(m_keys.values()); + auto allSources = QSet::fromList(pairs().values()); QSet output; while (output != allSources) { output.clear(); for (auto &src : allSources) - output.insert(m_keys.contains(src) ? source(src) : src); + output.insert(pairs().contains(src) ? source(src) : src); allSources = output; } return output.toList(); } + + +QStringList AWCustomKeysHelper::leftKeys() +{ + return keys(); +} + + +QStringList AWCustomKeysHelper::rightKeys() +{ + return QStringList(); +} diff --git a/sources/awesome-widget/plugin/awcustomkeyshelper.h b/sources/awesome-widget/plugin/awcustomkeyshelper.h index 6953d83..1d8f814 100644 --- a/sources/awesome-widget/plugin/awcustomkeyshelper.h +++ b/sources/awesome-widget/plugin/awcustomkeyshelper.h @@ -22,29 +22,26 @@ #include #include +#include "awabstractpairhelper.h" -class AWCustomKeysHelper : public QObject + +class AWCustomKeysHelper : public QObject, public AWAbstractPairHelper { Q_OBJECT public: explicit AWCustomKeysHelper(QObject *_parent = nullptr); virtual ~AWCustomKeysHelper(); - // read-write methods - void initItems(); - bool writeItems(const QHash &_configuration) const; - bool removeUnusedKeys(const QStringList &_keys) const; // get - QHash getUserKeys() const; - QStringList keys() const; QString source(const QString &_key) const; QStringList sources() const; QStringList refinedSources() const; + // configuration related + virtual void editPairs(){}; + virtual QStringList leftKeys(); + virtual QStringList rightKeys(); private: - // properties - QString m_filePath; - QHash m_keys; }; diff --git a/sources/awesome-widget/plugin/awformatterconfig.cpp b/sources/awesome-widget/plugin/awformatterconfig.cpp index 7701ff8..f12e617 100644 --- a/sources/awesome-widget/plugin/awformatterconfig.cpp +++ b/sources/awesome-widget/plugin/awformatterconfig.cpp @@ -16,168 +16,22 @@ ***************************************************************************/ #include "awformatterconfig.h" -#include "ui_awformatterconfig.h" -#include - -#include - -#include "awabstractselector.h" #include "awdebug.h" #include "awformatterhelper.h" AWFormatterConfig::AWFormatterConfig(QWidget *_parent, const QStringList &_keys) - : QDialog(_parent) - , ui(new Ui::AWFormatterConfig) - , m_keys(_keys) + : AWAbstractPairConfig(_parent, true, _keys) { qCDebug(LOG_AW) << __PRETTY_FUNCTION__; - ui->setupUi(this); - m_editButton - = ui->buttonBox->addButton(i18n("Edit"), QDialogButtonBox::ActionRole); - init(); - - connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - connect(m_editButton, SIGNAL(clicked(bool)), this, SLOT(editFormatters())); + setEditable(false, false); + initHelper(); } AWFormatterConfig::~AWFormatterConfig() { qCDebug(LOG_AW) << __PRETTY_FUNCTION__; - - clearSelectors(); - - delete m_helper; - delete ui; -} - - -void AWFormatterConfig::showDialog() -{ - // update dialog - updateDialog(); - // exec dialog - return execDialog(); -} - - -void AWFormatterConfig::editFormatters() -{ - m_helper->editItems(); - updateDialog(); -} - - -void AWFormatterConfig::updateUi() -{ - QPair current - = static_cast(sender())->current(); - int index - = m_selectors.indexOf(static_cast(sender())); - - if ((current.first.isEmpty()) && (current.second.isEmpty())) { - // remove current selector if it is empty and does not last - if (sender() == m_selectors.last()) - return; - AWAbstractSelector *selector = m_selectors.takeAt(index); - ui->verticalLayout->removeWidget(selector); - selector->deleteLater(); - } else { - // add new selector if something changed - if (sender() != m_selectors.last()) - return; - auto keys = initKeys(); - addSelector(keys.first, keys.second, QPair()); - } -} - - -void AWFormatterConfig::addSelector(const QStringList &_keys, - const QStringList &_values, - const QPair &_current) -{ - qCDebug(LOG_AW) << "Add selector with keys" << _keys << "values" << _values - << "and current ones" << _current; - - AWAbstractSelector *selector - = new AWAbstractSelector(ui->scrollAreaWidgetContents); - selector->init(_keys, _values, _current); - ui->verticalLayout->insertWidget(ui->verticalLayout->count() - 1, selector); - connect(selector, SIGNAL(selectionChanged()), this, SLOT(updateUi())); - m_selectors.append(selector); -} - - -void AWFormatterConfig::clearSelectors() -{ - for (auto &selector : m_selectors) { - disconnect(selector, SIGNAL(selectionChanged()), this, - SLOT(updateUi())); - ui->verticalLayout->removeWidget(selector); - selector->deleteLater(); - } - m_selectors.clear(); -} - - -void AWFormatterConfig::execDialog() -{ - int ret = exec(); - QHash data; - for (auto &selector : m_selectors) { - QPair select = selector->current(); - if (select.first.isEmpty()) - continue; - data[select.first] = select.second; - } - - // save configuration if required - switch (ret) { - case 0: - break; - case 1: - default: - m_helper->writeItems(data); - m_helper->removeUnusedFormatters(data.keys()); - break; - } -} - - -void AWFormatterConfig::init() -{ - delete m_helper; - m_helper = new AWFormatterHelper(this); -} - - -QPair AWFormatterConfig::initKeys() const -{ - // we are adding empty string at the start - QStringList keys = QStringList() << ""; - keys.append(m_keys); - keys.sort(); - QStringList knownFormatters = QStringList() << ""; - knownFormatters.append(m_helper->knownFormatters()); - knownFormatters.sort(); - - return QPair(keys, knownFormatters); -} - - -void AWFormatterConfig::updateDialog() -{ - clearSelectors(); - QHash appliedFormatters = m_helper->getFormatters(); - auto keys = initKeys(); - - for (auto &key : appliedFormatters.keys()) - addSelector(keys.first, keys.second, - QPair(key, appliedFormatters[key])); - // empty one - addSelector(keys.first, keys.second, QPair()); } diff --git a/sources/awesome-widget/plugin/awformatterconfig.h b/sources/awesome-widget/plugin/awformatterconfig.h index b0ce3df..c706bf9 100644 --- a/sources/awesome-widget/plugin/awformatterconfig.h +++ b/sources/awesome-widget/plugin/awformatterconfig.h @@ -19,17 +19,10 @@ #ifndef AWFORMATTERCONFIG_H #define AWFORMATTERCONFIG_H -#include +#include "awabstractpairconfig.h" -class AWAbstractSelector; -class AWFormatterHelper; -namespace Ui -{ -class AWFormatterConfig; -} - -class AWFormatterConfig : public QDialog +class AWFormatterConfig : public AWAbstractPairConfig { Q_OBJECT @@ -37,27 +30,6 @@ public: explicit AWFormatterConfig(QWidget *_parent = nullptr, const QStringList &_keys = QStringList()); virtual ~AWFormatterConfig(); - Q_INVOKABLE void showDialog(); - -private slots: - void editFormatters(); - void updateUi(); - -private: - QPushButton *m_editButton = nullptr; - Ui::AWFormatterConfig *ui = nullptr; - AWFormatterHelper *m_helper = nullptr; - QList m_selectors; - // properties - QStringList m_keys; - // methods - void addSelector(const QStringList &_keys, const QStringList &_values, - const QPair &_current); - void clearSelectors(); - void execDialog(); - void init(); - QPair initKeys() const; - void updateDialog(); }; diff --git a/sources/awesome-widget/plugin/awformatterconfig.ui b/sources/awesome-widget/plugin/awformatterconfig.ui deleted file mode 100644 index 4f0fff2..0000000 --- a/sources/awesome-widget/plugin/awformatterconfig.ui +++ /dev/null @@ -1,93 +0,0 @@ - - - AWFormatterConfig - - - - 0 - 0 - 400 - 300 - - - - - - - true - - - - - 0 - 0 - 384 - 249 - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Close|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - AWFormatterConfig - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - AWFormatterConfig - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/sources/awesome-widget/plugin/awformatterconfigfactory.cpp b/sources/awesome-widget/plugin/awformatterconfigfactory.cpp index e32441f..ebb282c 100644 --- a/sources/awesome-widget/plugin/awformatterconfigfactory.cpp +++ b/sources/awesome-widget/plugin/awformatterconfigfactory.cpp @@ -17,9 +17,9 @@ #include "awformatterconfigfactory.h" +#include "awcustomkeysconfig.h" #include "awdebug.h" #include "awformatterconfig.h" -#include "awcustomkeysconfig.h" AWFormatterConfigFactory::AWFormatterConfigFactory(QObject *_parent) diff --git a/sources/awesome-widget/plugin/awformatterhelper.cpp b/sources/awesome-widget/plugin/awformatterhelper.cpp index 0d902e4..f06e39a 100644 --- a/sources/awesome-widget/plugin/awformatterhelper.cpp +++ b/sources/awesome-widget/plugin/awformatterhelper.cpp @@ -35,10 +35,11 @@ AWFormatterHelper::AWFormatterHelper(QWidget *_parent) : AbstractExtItemAggregator(_parent, "formatters") + , AWAbstractPairHelper("awesomewidgets/formatters/formatters.ini", + "Formatters") { qCDebug(LOG_AW) << __PRETTY_FUNCTION__; - m_filePath = "awesomewidgets/formatters/formatters.ini"; initItems(); } @@ -54,32 +55,21 @@ AWFormatterHelper::~AWFormatterHelper() void AWFormatterHelper::initItems() { - installDirectories(); initFormatters(); - initKeys(); -} + AWAbstractPairHelper::initItems(); + // assign internal storage + m_formatters.clear(); + for (auto &key : pairs().keys()) { + auto name = pairs()[key]; + if (!m_formattersClasses.contains(name)) { + qCWarning(LOG_AW) + << "Invalid formatter" << name << "found in" << key; + continue; + } -bool AWFormatterHelper::writeItems( - const QHash &_configuration) const -{ - qCDebug(LOG_AW) << "Write configuration" << _configuration; - - QString fileName = QString("%1/%2") - .arg(QStandardPaths::writableLocation( - QStandardPaths::GenericDataLocation)) - .arg(m_filePath); - QSettings settings(fileName, QSettings::IniFormat); - qCInfo(LOG_AW) << "Configuration file" << fileName; - - settings.beginGroup("Formatters"); - for (auto &key : _configuration.keys()) - settings.setValue(key, _configuration[key]); - settings.endGroup(); - - settings.sync(); - - return (settings.status() == QSettings::NoError); + m_formatters[key] = m_formattersClasses[name]; + } } @@ -99,16 +89,6 @@ QStringList AWFormatterHelper::definedFormatters() const } -QHash AWFormatterHelper::getFormatters() const -{ - QHash map; - for (auto &tag : m_formatters.keys()) - map[tag] = m_formatters[tag]->name(); - - return map; -} - - QList AWFormatterHelper::items() const { QList converted; @@ -119,35 +99,21 @@ QList AWFormatterHelper::items() const } -QStringList AWFormatterHelper::knownFormatters() const +void AWFormatterHelper::editPairs() { - return m_formattersClasses.keys(); + return editItems(); } -bool AWFormatterHelper::removeUnusedFormatters(const QStringList &_keys) const +QStringList AWFormatterHelper::leftKeys() { - qCDebug(LOG_AW) << "Remove formatters" << _keys; + return QStringList(); +} - QString fileName = QString("%1/%2") - .arg(QStandardPaths::writableLocation( - QStandardPaths::GenericDataLocation)) - .arg(m_filePath); - QSettings settings(fileName, QSettings::IniFormat); - qCInfo(LOG_AW) << "Configuration file" << fileName; - settings.beginGroup("Formatters"); - QStringList foundKeys = settings.childKeys(); - for (auto &key : foundKeys) { - if (_keys.contains(key)) - continue; - settings.remove(key); - } - settings.endGroup(); - - settings.sync(); - - return (settings.status() == QSettings::NoError); +QStringList AWFormatterHelper::rightKeys() +{ + return m_formattersClasses.keys(); } @@ -191,47 +157,52 @@ void AWFormatterHelper::initFormatters() { m_formattersClasses.clear(); - for (int i = m_directories.count() - 1; i >= 0; i--) { - QStringList files - = QDir(m_directories.at(i)).entryList(QDir::Files, QDir::Name); + auto dirs = directories(); + for (auto &dir : dirs) { + QStringList files = QDir(dir).entryList(QDir::Files, QDir::Name); for (auto &file : files) { + // check filename if (!file.endsWith(".desktop")) continue; - qCInfo(LOG_AW) << "Found file" << file << "in" - << m_directories.at(i); - QString filePath - = QString("%1/%2").arg(m_directories.at(i)).arg(file); - auto metadata = readMetadata(filePath); - QString name = metadata.first; - if (m_formattersClasses.contains(name)) + qCInfo(LOG_AW) << "Found file" << file << "in" << dir; + QString filePath = QString("%1/%2").arg(dir).arg(file); + // check if already exists + auto values = m_formattersClasses.values(); + if (std::any_of(values.cbegin(), values.cend(), + [&filePath](const AWAbstractFormatter *item) { + return (item->fileName() == filePath); + })) continue; - + auto metadata = readMetadata(filePath); switch (metadata.second) { case AWAbstractFormatter::FormatterClass::DateTime: - m_formattersClasses[name] + m_formattersClasses[metadata.first] = new AWDateTimeFormatter(this, filePath); break; case AWAbstractFormatter::FormatterClass::Float: - m_formattersClasses[name] + m_formattersClasses[metadata.first] = new AWFloatFormatter(this, filePath); break; case AWAbstractFormatter::FormatterClass::List: - m_formattersClasses[name] = new AWListFormatter(this, filePath); + m_formattersClasses[metadata.first] + = new AWListFormatter(this, filePath); break; case AWAbstractFormatter::FormatterClass::Script: - m_formattersClasses[name] + m_formattersClasses[metadata.first] = new AWScriptFormatter(this, filePath); break; case AWAbstractFormatter::FormatterClass::String: - m_formattersClasses[name] + m_formattersClasses[metadata.first] = new AWStringFormatter(this, filePath); break; case AWAbstractFormatter::FormatterClass::Json: - m_formattersClasses[name] = new AWJsonFormatter(this, filePath); + m_formattersClasses[metadata.first] + = new AWJsonFormatter(this, filePath); break; case AWAbstractFormatter::FormatterClass::NoFormat: - m_formattersClasses[name] = new AWNoFormatter(this, filePath); + m_formattersClasses[metadata.first] + = new AWNoFormatter(this, filePath); break; } } @@ -239,55 +210,6 @@ void AWFormatterHelper::initFormatters() } -void AWFormatterHelper::initKeys() -{ - m_formatters.clear(); - - QStringList configs = QStandardPaths::locateAll( - QStandardPaths::GenericDataLocation, m_filePath); - - for (auto &fileName : configs) { - QSettings settings(fileName, QSettings::IniFormat); - qCInfo(LOG_AW) << "Configuration file" << settings.fileName(); - - settings.beginGroup("Formatters"); - QStringList keys = settings.childKeys(); - for (auto &key : keys) { - QString name = settings.value(key).toString(); - qCInfo(LOG_AW) << "Found formatter" << name << "for key" << key - << "in" << settings.fileName(); - if (name.isEmpty()) { - qCInfo(LOG_AW) << "Skip empty formatter for" << key; - continue; - } - if (!m_formattersClasses.contains(name)) { - qCWarning(LOG_AW) - << "Invalid formatter" << name << "found in" << key; - continue; - } - m_formatters[key] = m_formattersClasses[name]; - } - settings.endGroup(); - } -} - - -void AWFormatterHelper::installDirectories() -{ - // create directory at $HOME - QString localDir = QString("%1/awesomewidgets/formatters") - .arg(QStandardPaths::writableLocation( - QStandardPaths::GenericDataLocation)); - QDir localDirectory; - if (localDirectory.mkpath(localDir)) - qCInfo(LOG_AW) << "Created directory" << localDir; - - m_directories = QStandardPaths::locateAll( - QStandardPaths::GenericDataLocation, "awesomewidgets/formatters", - QStandardPaths::LocateDirectory); -} - - QPair AWFormatterHelper::readMetadata(const QString &_filePath) const { @@ -306,13 +228,8 @@ AWFormatterHelper::readMetadata(const QString &_filePath) const void AWFormatterHelper::doCreateItem() { - QStringList selection = QStringList() << "NoFormat" - << "DateTime" - << "Float" - << "List" - << "Script" - << "String" - << "Json"; + QStringList selection + = {"NoFormat", "DateTime", "Float", "List", "Script", "String", "Json"}; bool ok; QString select = QInputDialog::getItem( this, i18n("Select type"), i18n("Type:"), selection, 0, false, &ok); diff --git a/sources/awesome-widget/plugin/awformatterhelper.h b/sources/awesome-widget/plugin/awformatterhelper.h index 2da1e48..e8b4950 100644 --- a/sources/awesome-widget/plugin/awformatterhelper.h +++ b/sources/awesome-widget/plugin/awformatterhelper.h @@ -20,11 +20,12 @@ #define AWFORMATTERHELPER_H #include "abstractextitemaggregator.h" - #include "awabstractformatter.h" +#include "awabstractpairhelper.h" -class AWFormatterHelper : public AbstractExtItemAggregator +class AWFormatterHelper : public AbstractExtItemAggregator, + public AWAbstractPairHelper { Q_OBJECT @@ -33,14 +34,14 @@ public: virtual ~AWFormatterHelper(); // read-write methods void initItems(); - bool writeItems(const QHash &_configuration) const; // methods QString convert(const QVariant &_value, const QString &_name) const; QStringList definedFormatters() const; - QHash getFormatters() const; QList items() const; - QStringList knownFormatters() const; - bool removeUnusedFormatters(const QStringList &_keys) const; + // configuration related + virtual void editPairs(); + virtual QStringList leftKeys(); + virtual QStringList rightKeys(); public slots: void editItems(); @@ -50,15 +51,11 @@ private: AWAbstractFormatter::FormatterClass defineFormatterClass(const QString &_stringType) const; void initFormatters(); - void initKeys(); - void installDirectories(); QPair readMetadata(const QString &_filePath) const; // parent methods void doCreateItem(); // properties - QStringList m_directories; - QString m_filePath; QHash m_formatters; QHash m_formattersClasses; }; diff --git a/sources/awesome-widget/plugin/awkeys.cpp b/sources/awesome-widget/plugin/awkeys.cpp index 4d32985..72ba33e 100644 --- a/sources/awesome-widget/plugin/awkeys.cpp +++ b/sources/awesome-widget/plugin/awkeys.cpp @@ -161,6 +161,9 @@ QStringList AWKeys::dictKeys(const bool _sorted, const QString &_regexp) const // check if functions asked if (_regexp == "functions") return QString(STATIC_FUNCTIONS).split(','); + // check if user defined keys asked + if (_regexp == "userdefined") + return m_keyOperator->userKeys(); QStringList allKeys = m_keyOperator->dictKeys(); // sort if required diff --git a/sources/awesomewidgets/abstractextitemaggregator.cpp b/sources/awesomewidgets/abstractextitemaggregator.cpp index f68535a..9c9a0e7 100644 --- a/sources/awesomewidgets/abstractextitemaggregator.cpp +++ b/sources/awesomewidgets/abstractextitemaggregator.cpp @@ -20,6 +20,7 @@ #include +#include #include #include #include @@ -33,6 +34,15 @@ AbstractExtItemAggregator::AbstractExtItemAggregator(QWidget *_parent, { qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; + // create directory at $HOME + QString localDir = QString("%1/awesomewidgets/%2") + .arg(QStandardPaths::writableLocation( + QStandardPaths::GenericDataLocation)) + .arg(type()); + QDir localDirectory; + if (localDirectory.mkpath(localDir)) + qCInfo(LOG_LIB) << "Created directory" << localDir; + ui->setupUi(this); copyButton = ui->buttonBox->addButton(i18n("Copy"), QDialogButtonBox::ActionRole); @@ -182,6 +192,17 @@ QVariant AbstractExtItemAggregator::configArgs() const } +QStringList AbstractExtItemAggregator::directories() const +{ + auto dirs + = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, + QString("awesomewidgets/%1").arg(type()), + QStandardPaths::LocateDirectory); + + return dirs; +} + + QString AbstractExtItemAggregator::type() const { return m_type; diff --git a/sources/awesomewidgets/abstractextitemaggregator.h b/sources/awesomewidgets/abstractextitemaggregator.h index 7916b7e..7ef4d49 100644 --- a/sources/awesomewidgets/abstractextitemaggregator.h +++ b/sources/awesomewidgets/abstractextitemaggregator.h @@ -73,6 +73,7 @@ public: int uniqNumber() const; // get methods QVariant configArgs() const; + QStringList directories() const; virtual QList items() const = 0; QString type() const; // set methods diff --git a/sources/awesomewidgets/extitemaggregator.h b/sources/awesomewidgets/extitemaggregator.h index 84a3fed..2a775ee 100644 --- a/sources/awesomewidgets/extitemaggregator.h +++ b/sources/awesomewidgets/extitemaggregator.h @@ -127,29 +127,23 @@ private: QList getItems() { - // create directory at $HOME - QString localDir = QString("%1/awesomewidgets/%2") - .arg(QStandardPaths::writableLocation( - QStandardPaths::GenericDataLocation)) - .arg(type()); - QDir localDirectory; - if (localDirectory.mkpath(localDir)) - qCInfo(LOG_LIB) << "Created directory" << localDir; - - QStringList dirs = QStandardPaths::locateAll( - QStandardPaths::GenericDataLocation, - QString("awesomewidgets/%1").arg(type()), - QStandardPaths::LocateDirectory); - QStringList names; QList items; + + auto dirs = directories(); for (auto &dir : dirs) { QStringList files = QDir(dir).entryList(QDir::Files, QDir::Name); for (auto &file : files) { - if ((!file.endsWith(".desktop")) || (names.contains(file))) + // check filename + if (!file.endsWith(".desktop")) continue; qCInfo(LOG_LIB) << "Found file" << file << "in" << dir; - names.append(file); QString filePath = QString("%1/%2").arg(dir).arg(file); + // check if already exists + if (std::any_of(items.cbegin(), items.cend(), + [&filePath](AbstractExtItem *item) { + return (item->fileName() == filePath); + })) + continue; items.append(new T(this, filePath)); } } diff --git a/sources/qml/General.qml b/sources/qml/General.qml index 6a38431..690e716 100644 --- a/sources/qml/General.qml +++ b/sources/qml/General.qml @@ -70,6 +70,10 @@ QtObject { "label": i18n("Network"), "regexp": "^(netdev|(down|up(?!time)).*)" }, + { + "label": i18n("Network request"), + "regexp": "^response.*" + }, { "label": i18n("Music player"), "regexp": "(^|d|s)(album|artist|duration|progress|title)" @@ -97,6 +101,10 @@ QtObject { { "label": i18n("Functions"), "regexp": "functions" + }, + { + "label": i18n("User defined"), + "regexp": "userdefined" } ] property variant dpTagRegexp: [ diff --git a/sources/test/CMakeLists.txt b/sources/test/CMakeLists.txt index ae7f9db..045d319 100644 --- a/sources/test/CMakeLists.txt +++ b/sources/test/CMakeLists.txt @@ -42,7 +42,8 @@ foreach (TEST_MODULE ${TEST_MODULES}) elseif (TEST_MODULE MATCHES "awkeycache") set(${TEST_MODULE}_SOURCES ${${TEST_MODULE}_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awkeycache.cpp) elseif (TEST_MODULE MATCHES "awkeys") - set(${TEST_MODULE}_SOURCES ${${TEST_MODULE}_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awactions.cpp + set(${TEST_MODULE}_SOURCES ${${TEST_MODULE}_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awabstractpairhelper.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awactions.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awcustomkeyshelper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awdataaggregator.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awdataengineaggregator.cpp @@ -56,7 +57,8 @@ foreach (TEST_MODULE ${TEST_MODULES}) ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awupdatehelper.cpp ${PROJECT_TRDPARTY_DIR}/fontdialog/fontdialog.cpp) elseif (TEST_MODULE MATCHES "awpatternfunctions") - set(${TEST_MODULE}_SOURCES ${${TEST_MODULE}_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awformatterhelper.cpp + set(${TEST_MODULE}_SOURCES ${${TEST_MODULE}_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awabstractpairhelper.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awformatterhelper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awkeysaggregator.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awpatternfunctions.cpp) elseif (TEST_MODULE MATCHES "awtelemetryhandler") From e90e1da096b0587b2e58c710e5f9b4ad69c878ef Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Thu, 13 Jul 2017 19:15:10 +0300 Subject: [PATCH 4/9] Small fixes * update translations, add target to update translations * add custom keys support to config helper --- .../awesome-widget/plugin/awconfighelper.cpp | 14 +- sources/translations/CMakeLists.txt | 5 + sources/translations/en.po | 504 +----------- sources/translations/es.po | 58 +- sources/translations/extract_messages.sh | 32 +- sources/translations/fr.po | 469 +---------- sources/translations/lt.po | 773 ++++++++++++++++++ sources/translations/nl_NL.po | 58 +- sources/translations/pl.po | 75 +- sources/translations/pt_BR.po | 400 +-------- sources/translations/ru.po | 497 +---------- sources/translations/si.po | 768 +++++++++++++++++ sources/translations/uk.po | 397 +-------- sources/translations/zh.po | 201 +---- 14 files changed, 1803 insertions(+), 2448 deletions(-) create mode 100644 sources/translations/lt.po create mode 100644 sources/translations/si.po diff --git a/sources/awesome-widget/plugin/awconfighelper.cpp b/sources/awesome-widget/plugin/awconfighelper.cpp index 50592e9..30658c4 100644 --- a/sources/awesome-widget/plugin/awconfighelper.cpp +++ b/sources/awesome-widget/plugin/awconfighelper.cpp @@ -108,9 +108,14 @@ bool AWConfigHelper::exportConfiguration(QObject *_nativeConfig, readFile(settings, "weathers", QString("%1/weather/awesomewidgets-extweather-ids.json") .arg(m_baseDir)); + settings.endGroup(); + + settings.beginGroup("ini"); // formatter settings readFile(settings, "formatters", QString("%1/formatters/formatters.ini").arg(m_baseDir)); + // custom keys settings + readFile(settings, "custom", QString("%1/custom.ini").arg(m_baseDir)); settings.endGroup(); // sync settings @@ -151,9 +156,14 @@ QVariantMap AWConfigHelper::importConfiguration(const QString &_fileName, writeFile(settings, "weathers", QString("%1/weather/awesomewidgets-extweather-ids.json") .arg(m_baseDir)); + settings.endGroup(); + + settings.beginGroup("ini"); // formatter settings writeFile(settings, "formatters", QString("%1/formatters/formatters.ini").arg(m_baseDir)); + // custom keys settings + writeFile(settings, "custom", QString("%1/custom.ini").arg(m_baseDir)); settings.endGroup(); } @@ -290,7 +300,7 @@ void AWConfigHelper::readFile(QSettings &_settings, const QString &_key, file.close(); _settings.setValue(_key, text); } else { - qCWarning(LOG_AW) << "Could not open" << file.fileName(); + qCWarning(LOG_AW) << "Could not open to read" << file.fileName(); } } @@ -311,6 +321,6 @@ void AWConfigHelper::writeFile(QSettings &_settings, const QString &_key, out.flush(); file.close(); } else { - qCWarning(LOG_AW) << "Could not open" << file.fileName(); + qCWarning(LOG_AW) << "Could not open to write" << file.fileName(); } } diff --git a/sources/translations/CMakeLists.txt b/sources/translations/CMakeLists.txt index dc48c27..9b375e5 100644 --- a/sources/translations/CMakeLists.txt +++ b/sources/translations/CMakeLists.txt @@ -27,3 +27,8 @@ foreach (_current_PO_FILE ${_po_files}) list(APPEND _gmoFiles ${_gmoFile}) endforeach (_current_PO_FILE) add_custom_target(aw_pofiles ALL DEPENDS ${_gmoFiles}) + +add_custom_target( + translations + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/extract_messages.sh + ) diff --git a/sources/translations/en.po b/sources/translations/en.po index 6d13e2e..4ad67ac 100644 --- a/sources/translations/en.po +++ b/sources/translations/en.po @@ -6,16 +6,16 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2017-05-05 18:15+0300\n" -"PO-Revision-Date: 2017-05-05 18:17+0300\n" +"POT-Creation-Date: 2017-07-13 17:39+0300\n" +"PO-Revision-Date: 2017-07-13 17:51+0300\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: English \n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<" -"=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "X-Generator: Lokalize 2.0\n" msgid "Version %1 (build date %2)" @@ -328,6 +328,9 @@ msgstr "Battery active color" msgid "Battery inactive color" msgstr "Battery inactive color" +msgid "Edit" +msgstr "Edit" + msgid "Run %1" msgstr "Run %1" @@ -367,9 +370,6 @@ msgstr "High GPU load" msgid "Network device has been changed to %1" msgstr "Network device has been changed to %1" -msgid "Edit" -msgstr "Edit" - msgid "Select type" msgstr "Select type" @@ -553,7 +553,7 @@ msgid "Select path" msgstr "Select path" msgid "Images (*.png *.bpm *.jpg);;All files (*.*)" -msgstr "" +msgstr "Images (*.png *.bpm *.jpg);;All files (*.*)" msgid "Use custom formula" msgstr "Use custom formula" @@ -627,6 +627,9 @@ msgstr "Edit bars" msgid "Formatters" msgstr "Formatters" +msgid "User keys" +msgstr "User keys" + msgid "Preview" msgstr "Preview" @@ -647,10 +650,10 @@ msgid "Acknowledgment" msgstr "Acknowledgment" msgid "Report a bug" -msgstr "" +msgstr "Report a bug" msgid "Report subject" -msgstr "" +msgstr "Report subject" msgid "Description" msgstr "Description" @@ -694,21 +697,6 @@ msgstr "Could not save configuration file" msgid "Select a font" msgstr "Select a font" -msgid "Bgcolor" -msgstr "Bgcolor" - -msgid "Import" -msgstr "Import" - -msgid "Import plasmoid settings" -msgstr "Import plasmoid settings" - -msgid "Import extensions" -msgstr "Import extensions" - -msgid "Import additional files" -msgstr "Import additional files" - msgid "AC" msgstr "AC" @@ -718,6 +706,9 @@ msgstr "Bars" msgid "Desktops" msgstr "Desktops" +msgid "Network request" +msgstr "Network request" + msgid "Scripts" msgstr "Scripts" @@ -736,6 +727,9 @@ msgstr "Weathers" msgid "Functions" msgstr "Functions" +msgid "User defined" +msgstr "User defined" + msgid "All" msgstr "All" @@ -766,457 +760,17 @@ msgstr "raised" msgid "sunken" msgstr "sunken" -msgctxt "NAME OF TRANSLATORS" -msgid "Your names" -msgstr "Evgeniy Alekseev" +msgid "Bgcolor" +msgstr "Bgcolor" -msgctxt "EMAIL OF TRANSLATORS" -msgid "Your emails" -msgstr "esalexeev@gmail.com" +msgid "Import" +msgstr "Import" -#~ msgid "Edit scripts" -#~ msgstr "Edit scripts" +msgid "Import plasmoid settings" +msgstr "Import plasmoid settings" -#~ msgid "Edit tickers" -#~ msgstr "Edit tickers" +msgid "Import extensions" +msgstr "Import extensions" -#~ msgid "Edit command" -#~ msgstr "Edit command" - -#~ msgid "Edit weather" -#~ msgstr "Edit weather" - -#~ msgid "Use image for active" -#~ msgstr "Use image for active" - -#~ msgid "Active color" -#~ msgstr "Active color" - -#~ msgid "Use image for inactive" -#~ msgstr "Use image for inactive" - -#~ msgid "Inactive color" -#~ msgstr "Inactive color" - -#~ msgid "Add lambda" -#~ msgstr "Add lambda" - -#~ msgid "Free space on %1 less than 10%" -#~ msgstr "Free space on %1 less than 10%" - -#~ msgid "Top Edge" -#~ msgstr "Top Edge" - -#~ msgid "Bottom Edge" -#~ msgstr "Bottom Edge" - -#~ msgid "Left Edge" -#~ msgstr "Left Edge" - -#~ msgid "Right Edge" -#~ msgstr "Right Edge" - -#~ msgid "Unknown location (%1)" -#~ msgstr "Unknown location (%1)" - -#~ msgid "Ticker: %1" -#~ msgstr "Ticker: %1" - -#~ msgid "Exec: %1" -#~ msgstr "Exec: %1" - -#~ msgid "Run ksysguard" -#~ msgstr "Run ksysguard" - -#~ msgid "Update text" -#~ msgstr "Update text" - -#~ msgid "Check for updates" -#~ msgstr "Check for updates" - -#~ msgid "Enable popup on mouse click" -#~ msgstr "Enable popup on mouse click" - -#~ msgid "" -#~ "$dddd - long weekday\n" -#~ "$ddd - short weekday\n" -#~ "$dd - day\n" -#~ "$d - day w\\o zero\n" -#~ "$MMMM - long month\n" -#~ "$MMM - short month\n" -#~ "$MM - month\n" -#~ "$M - month w\\o zero\n" -#~ "$yyyy - year\n" -#~ "$yy - short year\n" -#~ "$hh - hours (24 only)\n" -#~ "$h - hours w\\o zero (24 only)\n" -#~ "$mm - minutes\n" -#~ "$m - minutes w\\o zero\n" -#~ "$ss - seconds\n" -#~ "$s - seconds w\\o zero" -#~ msgstr "" -#~ "$dddd - long weekday\n" -#~ "$ddd - short weekday\n" -#~ "$dd - day\n" -#~ "$d - day w\\o zero\n" -#~ "$MMMM - long month\n" -#~ "$MMM - short month\n" -#~ "$MM - month\n" -#~ "$M - month w\\o zero\n" -#~ "$yyyy - year\n" -#~ "$yy - short year\n" -#~ "$hh - hours (24 only)\n" -#~ "$h - hours w\\o zero (24 only)\n" -#~ "$mm - minutes\n" -#~ "$m - minutes w\\o zero\n" -#~ "$ss - seconds\n" -#~ "$s - seconds w\\o zero" - -#~ msgid "" -#~ "$dd - uptime days\n" -#~ "$d - uptime days without zero\n" -#~ "$hh - uptime hours\n" -#~ "$h - uptime hours without zero\n" -#~ "$mm - uptime minutes\n" -#~ "$m - uptime minutes without zero" -#~ msgstr "" -#~ "$dd - uptime days\n" -#~ "$d - uptime days without zero\n" -#~ "$hh - uptime hours\n" -#~ "$h - uptime hours without zero\n" -#~ "$mm - uptime minutes\n" -#~ "$m - uptime minutes without zero" - -#~ msgid "Temperature devices" -#~ msgstr "Temperature devices" - -#~ msgid "Editable" -#~ msgstr "Editable" - -#~ msgid "Fan devices" -#~ msgstr "Fan devices" - -#~ msgid "Mount points" -#~ msgstr "Mount points" - -#~ msgid "HDD devices (speed)" -#~ msgstr "HDD (speed)" - -#~ msgid "HDD devices (temp)" -#~ msgstr "HDD (temp)" - -#~ msgid "Disable auto select device and set specified device" -#~ msgstr "Disable auto select device and set specified device" - -#~ msgid "Set network device" -#~ msgstr "Set network device" - -#~ msgid "Line, which returns when AC is online" -#~ msgstr "Line, which returns when AC is online" - -#~ msgid "Line, which returns when AC is offline" -#~ msgstr "Line, which returns when AC is offline" - -#~ msgid "\"/sys/class/power_supply/\" by default" -#~ msgstr "\"/sys/class/power_supply/\" by default" - -#~ msgid "NOTE: Player DBus interface should be an active" -#~ msgstr "NOTE: Player DBus interface should be an active" - -#~ msgid "Configuration" -#~ msgstr "Configuration" - -#~ msgid "Ctrl+B" -#~ msgstr "Ctrl+B" - -#~ msgid "Ctrl+I" -#~ msgstr "Ctrl+I" - -#~ msgid "Ctrl+U" -#~ msgstr "Ctrl+U" - -#~ msgid "Null lines" -#~ msgstr "Null lines" - -#~ msgid "Desktop check cmd" -#~ msgstr "Desktop check cmd" - -#~ msgid "Battery device" -#~ msgstr "Battery device" - -#~ msgid "\"/sys/class/power_supply/BAT0/capacity\" by default" -#~ msgstr "\"/sys/class/power_supply/BAT0/capacity\" by default" - -#~ msgid "Add stretch to left/top of the layout" -#~ msgstr "Add stretch to left/top of the layout" - -#~ msgid "Add stretch to right/bottom of the layout" -#~ msgstr "Add stretch to right/bottom of the layout" - -#~ msgid "Appearance configuration" -#~ msgstr "Appearance configuration" - -#~ msgid "Widget configuration" -#~ msgstr "Widget configuration" - -#~ msgid "\"/sys/class/net\" by default" -#~ msgstr "\"/sys/class/net\" by default" - -#~ msgid "Custom command to run" -#~ msgstr "Custom command to run" - -#~ msgid "" -#~ "$time - time in default format\n" -#~ "$isotime - time in ISO format\n" -#~ "$shorttime - time in short format\n" -#~ "$longtime - time in log format\n" -#~ "$custom - custom time format" -#~ msgstr "" -#~ "$time - time in default format\n" -#~ "$isotime - time in ISO format\n" -#~ "$shorttime - time in short format\n" -#~ "$longtime - time in log format\n" -#~ "$custom - custom time format" - -#~ msgid "Uptime" -#~ msgstr "Uptime" - -#~ msgid "" -#~ "$uptime - system uptime\n" -#~ "$custom - custom format" -#~ msgstr "" -#~ "$uptime - system uptime\n" -#~ "$custom - custom format" - -#~ msgid "" -#~ "$cpu - total load CPU, %\n" -#~ "$cpu0 - load CPU for core 0, %\n" -#~ "...\n" -#~ "$cpu9 - load CPU for core 9, %\n" -#~ "...\n" -#~ "$cpuN - load CPU for core N, %" -#~ msgstr "" -#~ "$cpu - total load CPU, %\n" -#~ "$cpu0 - load CPU for core 0, %\n" -#~ "...\n" -#~ "$cpu9 - load CPU for core 9, %\n" -#~ "...\n" -#~ "$cpuN - load CPU for core N, %" - -#~ msgid "" -#~ "$cpucl - average CPU clock, MHz\n" -#~ "$cpucl0 - CPU clock for core 0, MHz\n" -#~ "...\n" -#~ "$cpucl9 - CPU clock for core 9, MHz\n" -#~ "...\n" -#~ "$cpuclN - CPU clock for core N, MHz" -#~ msgstr "" -#~ "$cpucl - average CPU clock, MHz\n" -#~ "$cpucl0 - CPU clock for core 0, MHz\n" -#~ "...\n" -#~ "$cpucl9 - CPU clock for core 9, MHz\n" -#~ "...\n" -#~ "$cpuclN - CPU clock for core N, MHz" - -#~ msgid "$tempN - physical temperature on device N (from 0). Example: $temp0" -#~ msgstr "$tempN - physical temperature on device N (from 0). Example: $temp0" - -#~ msgid "$gpu - gpu usage, %" -#~ msgstr "$gpu - gpu usage, %" - -#~ msgid "GPU Temp" -#~ msgstr "GPU Temp" - -#~ msgid "$gputemp - physical temperature on GPU" -#~ msgstr "$gputemp - physical temperature on GPU" - -#~ msgid "" -#~ "$mem - RAM usage, %\n" -#~ "$memmb - RAM usage, MB\n" -#~ "$memgb - RAM usage, GB\n" -#~ "$memtotmb - total RAM, MB\n" -#~ "$memtotgb - total RAM, GB" -#~ msgstr "" -#~ "$mem - RAM usage, %\n" -#~ "$memmb - RAM usage, MB\n" -#~ "$memgb - RAM usage, GB\n" -#~ "$memtotmb - total RAM, MB\n" -#~ "$memtotgb - total RAM, GB" - -#~ msgid "" -#~ "$swap - swap usage, %\n" -#~ "$swapmb - swap usage, MB\n" -#~ "$swapgb - swap usage, GB\n" -#~ "$swaptotmb - total swap, MB\n" -#~ "$swaptotgb - total swap, GB" -#~ msgstr "" -#~ "$swap - swap usage, %\n" -#~ "$swapmb - swap usage, MB\n" -#~ "$swapgb - swap usage, GB\n" -#~ "$swaptotmb - total swap, MB\n" -#~ "$swaptotgb - total swap, GB" - -#~ msgid "" -#~ "$hddN - usage for mount point N (from 0), %. Example: $hdd0\n" -#~ "$hddmbN - usage for mount point N (from 0), MB. Example: $hddmb0\n" -#~ "$hddgbN - usage for mount point N (from 0), GB. Example: $hddgb0\n" -#~ "$hddtotmbN - total size of mount point N (from 0), MB. Example: " -#~ "$hddtotmb0\n" -#~ "$hddtotgbN - total size of mount point N (from 0), GB. Example: $hddtotgb0" -#~ msgstr "" -#~ "$hddN - usage for mount point N (from 0), %. Example: $hdd0\n" -#~ "$hddmbN - usage for mount point N (from 0), MB. Example: $hddmb0\n" -#~ "$hddgbN - usage for mount point N (from 0), GB. Example: $hddgb0\n" -#~ "$hddtotmbN - total size of mount point N (from 0), MB. Example: " -#~ "$hddtotmb0\n" -#~ "$hddtotgbN - total size of mount point N (from 0), GB. Example: $hddtotgb0" - -#~ msgid "HDD speed" -#~ msgstr "HDD speed" - -#~ msgid "" -#~ "$hddrN - read speed HDD N (from 0), KB/s. Example: $hddr0\n" -#~ "$hddwN - write speed HDD N (from 0), KB/s. Example: $hddw0" -#~ msgstr "" -#~ "$hddrN - read speed HDD N (from 0), KB/s. Example: $hddr0\n" -#~ "$hddwN - write speed HDD N (from 0), KB/s. Example: $hddw0" - -#~ msgid "HDD temp" -#~ msgstr "HDD temp" - -#~ msgid "" -#~ "$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0" -#~ msgstr "" -#~ "$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0" - -#~ msgid "" -#~ "$down - download speed, KB/s\n" -#~ "$up - upload speed, KB/s\n" -#~ "$netdev - current network device" -#~ msgstr "" -#~ "$down - download speed, KB/s\n" -#~ "$up - upload speed, KB/s\n" -#~ "$netdev - current network device" - -#~ msgid "" -#~ "$bat - battery charge, %\n" -#~ "$ac - AC status" -#~ msgstr "" -#~ "$bat - battery charge, %\n" -#~ "$ac - AC status" - -#~ msgid "" -#~ "$album - song album\n" -#~ "$artist - song artist\n" -#~ "$progress - song progress\n" -#~ "$time - song duration\n" -#~ "$title - song title" -#~ msgstr "" -#~ "$album - song album\n" -#~ "$artist - song artist\n" -#~ "$progress - song progress\n" -#~ "$time - song duration\n" -#~ "$title - song title" - -#~ msgid "Processes" -#~ msgstr "Processes" - -#~ msgid "" -#~ "$pscount - number of running processes\n" -#~ "$pstotal - total number of running processes\n" -#~ "$ps - list of running processes comma separated" -#~ msgstr "" -#~ "$pscount - number of running processes\n" -#~ "$pstotal - total number of running processes\n" -#~ "$ps - list of running processes comma separated" - -#~ msgid "" -#~ "$pkgcountN - number of packages which are available for updates, command " -#~ "N. For example $pkgcount0" -#~ msgstr "" -#~ "$pkgcountN - number of packages which are available for updates, command " -#~ "N. For example $pkgcount0" - -#~ msgid "" -#~ "$customN - get output from custom command N (from N). Example `$custom0`" -#~ msgstr "" -#~ "$customN - get output from custom command N (from N). Example `$custom0`" - -#~ msgid "" -#~ "$name - desktop name\n" -#~ "$number - desktop number\n" -#~ "$total - total number of desktops" -#~ msgstr "" -#~ "$name - desktop name\n" -#~ "$number - desktop number\n" -#~ "$total - total number of desktops" - -#~ msgid "pacman -Qu" -#~ msgstr "pacman -Qu" - -#~ msgid "apt-show-versions -u -b" -#~ msgstr "apt-show-versions -u -b" - -#~ msgid "aptitude search '~U'" -#~ msgstr "aptitude search '~U'" - -#~ msgid "yum list updates" -#~ msgstr "yum list updates" - -#~ msgid "pkg_version -I -l '<'" -#~ msgstr "pkg_version -I -l '<'" - -#~ msgid "urpmq --auto-select" -#~ msgstr "urpmq --auto-select" - -#~ msgid "amarok" -#~ msgstr "amarok" - -#~ msgid "mpd" -#~ msgstr "mpd" - -#~ msgid "qmmp" -#~ msgstr "qmmp" - -#~ msgid "auto" -#~ msgstr "auto" - -#~ msgid "nvidia" -#~ msgstr "nvidia" - -#~ msgid "ati" -#~ msgstr "ati" - -#~ msgid "$hddN - usage for mount point N (from 0), %. Example: $hdd0" -#~ msgstr "$hddN - usage for mount point N (from 0), %. Example: $hdd0" - -#~ msgid "" -#~ "$ds - uptime days\n" -#~ "$hs - uptime hours\n" -#~ "$ms - uptime minutes" -#~ msgstr "" -#~ "$ds - uptime days\n" -#~ "$hs - uptime hours\n" -#~ "$ms - uptime minutes" - -#~ msgid "" -#~ "Command to run, example:\n" -#~ "wget -qO- http://ifconfig.me/ip - get external IP" -#~ msgstr "" -#~ "Command to run, example:\n" -#~ "wget -qO- http://ifconfig.me/ip - get external IP" - -#~ msgid "@@/;@@ - mount point usage, %" -#~ msgstr "@@/;@@ - mount point usage, %" - -#~ msgid "@@/dev/sda@@ - physical temperature on /dev/sda" -#~ msgstr "@@/dev/sda@@ - physical temperature on /dev/sda" - -#~ msgid "" -#~ "$net - network speed, down/up, KB/s\n" -#~ "$netdev - current network device\n" -#~ "@@eth0@@ - disable auto select device and set specified device" -#~ msgstr "" -#~ "$net - network speed, down/up, KB/s\n" -#~ "$netdev - current network device\n" -#~ "@@eth0@@ - disable auto select device and set specified device" +msgid "Import additional files" +msgstr "Import additional files" diff --git a/sources/translations/es.po b/sources/translations/es.po index 7961e65..51c9e87 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: 2017-05-05 18:15+0300\n" +"POT-Creation-Date: 2017-07-13 17:39+0300\n" "PO-Revision-Date: 2016-08-03 15:30+0000\n" "Last-Translator: Ernesto Avilés Vázquez \n" "Language-Team: Spanish (http://www.transifex.com/arcanis/awesome-widgets/" @@ -338,6 +338,9 @@ msgstr "Color de la batería activa" msgid "Battery inactive color" msgstr "Color de la batería inactiva" +msgid "Edit" +msgstr "Editar" + msgid "Run %1" msgstr "Ejecutar %1" @@ -377,9 +380,6 @@ msgstr "Carga alta de GPU" msgid "Network device has been changed to %1" msgstr "El dispositivo de red ha sido cambiado a %1" -msgid "Edit" -msgstr "Editar" - msgid "Select type" msgstr "Elegir tipo" @@ -639,6 +639,9 @@ msgstr "Editar barras" msgid "Formatters" msgstr "Formateadores" +msgid "User keys" +msgstr "" + msgid "Preview" msgstr "Vista previa" @@ -708,21 +711,6 @@ msgstr "No se pudo guardar el archivo de configuración" msgid "Select a font" msgstr "Elige un tipo de letra" -msgid "Bgcolor" -msgstr "Color de fondo" - -msgid "Import" -msgstr "Importar" - -msgid "Import plasmoid settings" -msgstr "Importar configuraciones de plasmoide" - -msgid "Import extensions" -msgstr "Extensiones a importar" - -msgid "Import additional files" -msgstr "Importar archivos adicionales" - msgid "AC" msgstr "CA" @@ -732,6 +720,10 @@ msgstr "Barras" msgid "Desktops" msgstr "Escritorios" +#, fuzzy +msgid "Network request" +msgstr "Red" + msgid "Scripts" msgstr "Guiones" @@ -750,6 +742,9 @@ msgstr "Tiempo" msgid "Functions" msgstr "Funciones" +msgid "User defined" +msgstr "" + msgid "All" msgstr "" @@ -781,22 +776,17 @@ msgstr "" msgid "sunken" msgstr "" -msgctxt "NAME OF TRANSLATORS" -msgid "Your names" -msgstr "Tu nombre" +msgid "Bgcolor" +msgstr "Color de fondo" -msgctxt "EMAIL OF TRANSLATORS" -msgid "Your emails" -msgstr "Tu correo electrónico" +msgid "Import" +msgstr "Importar" -#~ msgid "Edit scripts" -#~ msgstr "Editar scripts" +msgid "Import plasmoid settings" +msgstr "Importar configuraciones de plasmoide" -#~ msgid "Edit tickers" -#~ msgstr "Editar tickets" +msgid "Import extensions" +msgstr "Extensiones a importar" -#~ msgid "Edit command" -#~ msgstr "Editar orden" - -#~ msgid "Edit weather" -#~ msgstr "Editar tiempo" +msgid "Import additional files" +msgstr "Importar archivos adicionales" diff --git a/sources/translations/extract_messages.sh b/sources/translations/extract_messages.sh index 7276bd2..974d8fd 100755 --- a/sources/translations/extract_messages.sh +++ b/sources/translations/extract_messages.sh @@ -1,27 +1,31 @@ #!/bin/bash -# root of translatable sources -BASEDIR="../" + +# properties PROJECT="awesome-widgets" BUGADDR="https://github.com/arcan1s/awesome-widgets/issues" -WORKDIR=$(pwd) + +# root of translatable sources +SCRIPTDIR="$(dirname -- $(readlink -f -- $0))" +BASEDIR="${SCRIPTDIR}/../" +WORKDIR="$(pwd)" + # translations tags +# dunno what does this magic do actually TAGS="-ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 -kI18N_NOOP:1 \ -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3" -find "${BASEDIR}" -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' | sort > "${WORKDIR}/rcfiles.list" -xargs --arg-file="${WORKDIR}/rcfiles.list" > "${WORKDIR}/rc.cpp" -echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> "${WORKDIR}/rc.cpp" -echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> "${WORKDIR}/rc.cpp" - -find "${BASEDIR}" -name '*.cpp' -o -name '*.h' -o -name '*.qml' | sort > "${WORKDIR}/infiles.list" -echo "rc.cpp" >> "${WORKDIR}/infiles.list" +find "${BASEDIR}" \ + -name '*.cpp' -o -name '*.h' -o -name '*.qml' -o -name '*.ui' -o -name '*.rc' | \ + sort > "${WORKDIR}/infiles.list" xgettext -C --no-location --msgid-bugs-address="${BUGADDR}" ${TAGS} \ ---files-from="infiles.list" -D "${BASEDIR}" -D "${WORKDIR}" -o "${PROJECT}.pot" || exit 1 + --files-from="${WORKDIR}/infiles.list" -D "${BASEDIR}" -D "${WORKDIR}" \ + -o "${PROJECT}.pot" || exit 1 -TRANSLATIONS=$(find . -name '*.po') +TRANSLATIONS=$(find "${BASEDIR}" -name '*.po') for TR in ${TRANSLATIONS}; do - msgmerge -U -q --backup=off "${TR}" "${PROJECT}.pot" + msgmerge -U -q --backup=off "${TR}" "${WORKDIR}/${PROJECT}.pot" + msgattrib --no-obsolete -o "${TR}" "${TR}" done -rm -f "rcfiles.list" "infiles.list" "rc.cpp" +rm -f "${WORKDIR}/infiles.list" diff --git a/sources/translations/fr.po b/sources/translations/fr.po index d015f31..4f77ca7 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: 2017-05-05 18:15+0300\n" +"POT-Creation-Date: 2017-07-13 17:39+0300\n" "PO-Revision-Date: 2015-07-31 22:16+0300\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: French \n" @@ -346,6 +346,10 @@ msgstr "Couleur active batterie" msgid "Battery inactive color" msgstr "Couleur batterie inactive" +#, fuzzy +msgid "Edit" +msgstr "Modifiable" + msgid "Run %1" msgstr "Éxecuter %1" @@ -385,10 +389,6 @@ msgstr "Haute charge GPU" msgid "Network device has been changed to %1" msgstr "L'interface réseau à été changée en %1" -#, fuzzy -msgid "Edit" -msgstr "Modifiable" - #, fuzzy msgid "Select type" msgstr "Sélectionner l'étiquette" @@ -667,6 +667,9 @@ msgstr "Modifier les barres" msgid "Formatters" msgstr "" +msgid "User keys" +msgstr "" + msgid "Preview" msgstr "" @@ -735,22 +738,6 @@ msgstr "" msgid "Select a font" msgstr "Sélectionner une police" -#, fuzzy -msgid "Bgcolor" -msgstr "Couleur processeur" - -msgid "Import" -msgstr "" - -msgid "Import plasmoid settings" -msgstr "" - -msgid "Import extensions" -msgstr "" - -msgid "Import additional files" -msgstr "" - msgid "AC" msgstr "" @@ -760,6 +747,10 @@ msgstr "" msgid "Desktops" msgstr "" +#, fuzzy +msgid "Network request" +msgstr "Voisinage réseau" + #, fuzzy msgid "Scripts" msgstr "Modifier les scripts" @@ -782,6 +773,9 @@ msgstr "Modifier les tickers" msgid "Functions" msgstr "" +msgid "User defined" +msgstr "" + msgid "All" msgstr "" @@ -813,431 +807,18 @@ msgstr "" msgid "sunken" msgstr "" -msgctxt "NAME OF TRANSLATORS" -msgid "Your names" -msgstr "Evgeniy Alekseev MerMouY" - -msgctxt "EMAIL OF TRANSLATORS" -msgid "Your emails" -msgstr "esalexeev@gmail.com mermouy@gmail.com" - -#~ msgid "Edit scripts" -#~ msgstr "Modifier les scripts" - -#~ msgid "Edit tickers" -#~ msgstr "Modifier les tickers" - -#~ msgid "Edit command" -#~ msgstr "Modifier la commande" - #, fuzzy -#~ msgid "Edit weather" -#~ msgstr "Modifier les tickers" +msgid "Bgcolor" +msgstr "Couleur processeur" -#, fuzzy -#~ msgid "Active color" -#~ msgstr "Batterie" +msgid "Import" +msgstr "" -#, fuzzy -#~ msgid "Inactive color" -#~ msgstr "Batterie" +msgid "Import plasmoid settings" +msgstr "" -#~ msgid "Free space on %1 less than 10%" -#~ msgstr "Espace libre sur %1 inférieur à 10%" +msgid "Import extensions" +msgstr "" -#~ msgid "Top Edge" -#~ msgstr "Bord du haut" - -#~ msgid "Bottom Edge" -#~ msgstr "Bord du bas" - -#~ msgid "Left Edge" -#~ msgstr "Bord gauche" - -#~ msgid "Right Edge" -#~ msgstr "Bord droit" - -#~ msgid "Unknown location (%1)" -#~ msgstr "Position inconnue (%1)" - -#~ msgid "Exec: %1" -#~ msgstr "Exec: %1" - -#~ msgid "Run ksysguard" -#~ msgstr "Lancer ksysguard" - -#~ msgid "Update text" -#~ msgstr "Mettre à jour le texte" - -#~ msgid "Enable popup on mouse click" -#~ msgstr "Popup lors d'un click souris" - -#~ msgid "" -#~ "$dddd - long weekday\n" -#~ "$ddd - short weekday\n" -#~ "$dd - day\n" -#~ "$d - day w\\o zero\n" -#~ "$MMMM - long month\n" -#~ "$MMM - short month\n" -#~ "$MM - month\n" -#~ "$M - month w\\o zero\n" -#~ "$yyyy - year\n" -#~ "$yy - short year\n" -#~ "$hh - hours (24 only)\n" -#~ "$h - hours w\\o zero (24 only)\n" -#~ "$mm - minutes\n" -#~ "$m - minutes w\\o zero\n" -#~ "$ss - seconds\n" -#~ "$s - seconds w\\o zero" -#~ msgstr "" -#~ "$dddd - Jour de la semaine long\n" -#~ "$ddd - Jour de la semaine court\n" -#~ "$dd - jour\n" -#~ "$d - jour sans zéro\n" -#~ "$MMMM - mois long\n" -#~ "$MMM - mois court\n" -#~ "$MM - mois\n" -#~ "$M - mois sans zéro\n" -#~ "$yyyy - année\n" -#~ "$yy - année courte\n" -#~ "$hh - heures (24 uniquement)\n" -#~ "$h - heures sans zéro (24 uniquement)\n" -#~ "$mm - minutes\n" -#~ "$m - minutes sans zéro\n" -#~ "$ss - secondes\n" -#~ "$s - secondes sans zéro" - -#~ msgid "" -#~ "$dd - uptime days\n" -#~ "$d - uptime days without zero\n" -#~ "$hh - uptime hours\n" -#~ "$h - uptime hours without zero\n" -#~ "$mm - uptime minutes\n" -#~ "$m - uptime minutes without zero" -#~ msgstr "" -#~ "$dd - temps de fonctionnement en jours\n" -#~ "$d - temps de fonctionnement en jours sans zéro\n" -#~ "$hh - temps de fonctionnement en heures\n" -#~ "$h - temps de fonctionnement en heures sans zéro\n" -#~ "$mm - temps de fonctionnement en minutes\n" -#~ "$m - temps de fonctionnement en minutes sans zéro" - -#~ msgid "Temperature devices" -#~ msgstr "Temperature des périphériques" - -#~ msgid "Editable" -#~ msgstr "Modifiable" - -#, fuzzy -#~ msgid "Fan devices" -#~ msgstr "Périphérique d'alimentation" - -#~ msgid "Mount points" -#~ msgstr "Points de montage" - -#~ msgid "HDD devices (speed)" -#~ msgstr "Périphériques HDD (la vitesse)" - -#~ msgid "HDD devices (temp)" -#~ msgstr "Périphériques HDD (température)" - -#~ msgid "Disable auto select device and set specified device" -#~ msgstr "" -#~ "Désactiver la sélection automatique de périphériques et le sélectionner " -#~ "manuellement" - -#~ msgid "Set network device" -#~ msgstr "Sélectionner le périphérique réseau" - -#~ msgid "Line, which returns when AC is online" -#~ msgstr "Ligne qui est renvoyée lorsque l'alimentation est branchée" - -#~ msgid "Line, which returns when AC is offline" -#~ msgstr "Ligne, qui est renvoyée lorsque l'alimentation est débranchée" - -#, fuzzy -#~ msgid "\"/sys/class/power_supply/\" by default" -#~ msgstr "\"/sys/class/power_supply/AC/online\" par défaut" - -#~ msgid "Ctrl+B" -#~ msgstr "Ctrl+B" - -#~ msgid "Ctrl+I" -#~ msgstr "Ctrl+I" - -#~ msgid "Ctrl+U" -#~ msgstr "Ctrl+U" - -#~ msgid "Null lines" -#~ msgstr "Nombre d'éléments pour les conseils" - -#~ msgid "Battery device" -#~ msgstr "Batterie" - -#~ msgid "\"/sys/class/power_supply/BAT0/capacity\" by default" -#~ msgstr "\"/sys/class/power_supply/BAT0/capacity\" par défaut" - -#~ msgid "Add stretch to left/top of the layout" -#~ msgstr "Étirer le positionnement vers haut/gauche" - -#~ msgid "Add stretch to right/bottom of the layout" -#~ msgstr "Étirer le positionnement vers bas/droite" - -#~ msgid "\"/sys/class/net\" by default" -#~ msgstr "\"/sys/class/net\" par défaut" - -#~ msgid "Custom command to run" -#~ msgstr "Commande personnalisée à exécuter" - -#~ msgid "" -#~ "$time - time in default format\n" -#~ "$isotime - time in ISO format\n" -#~ "$shorttime - time in short format\n" -#~ "$longtime - time in log format\n" -#~ "$custom - custom time format" -#~ msgstr "" -#~ "$time - l'heure au format par défaut\n" -#~ "$isotime - l'heure au format ISO\n" -#~ "$shorttime - l'heure format court\n" -#~ "$longtime - l'heure au format log\n" -#~ "$custom - l'heure, format personnalisé" - -#~ msgid "Uptime" -#~ msgstr "temps de fonctionnement" - -#~ msgid "" -#~ "$uptime - system uptime\n" -#~ "$custom - custom format" -#~ msgstr "" -#~ "$uptime - temps de fonctionnement\n" -#~ "$custom - format personnalisé" - -#~ msgid "" -#~ "$cpu - total load CPU, %\n" -#~ "$cpu0 - load CPU for core 0, %\n" -#~ "...\n" -#~ "$cpu9 - load CPU for core 9, %\n" -#~ "...\n" -#~ "$cpuN - load CPU for core N, %" -#~ msgstr "" -#~ "$cpu - charge totale du processeur, %\n" -#~ "$cpu0 - charge du processeur pour le coeur 0, %\n" -#~ "...\n" -#~ "$cpuN - charge processeur pour le coeur N, %" - -#~ msgid "" -#~ "$cpucl - average CPU clock, MHz\n" -#~ "$cpucl0 - CPU clock for core 0, MHz\n" -#~ "...\n" -#~ "$cpucl9 - CPU clock for core 9, MHz\n" -#~ "...\n" -#~ "$cpuclN - CPU clock for core N, MHz" -#~ msgstr "" -#~ "$cpucl - Moyenne de l'horloge du processeur, MHz\n" -#~ "$cpucl0 - Horloge du coeur 0, MHz\n" -#~ "...\n" -#~ "$cpuclN - Horloge du coeur N, MHz" - -#~ msgid "$tempN - physical temperature on device N (from 0). Example: $temp0" -#~ msgstr "" -#~ "$tempN - Température physique du périphérique N (à partir de 0). Exemple: " -#~ "$temp0" - -#~ msgid "$gpu - gpu usage, %" -#~ msgstr "$gpu - utilisation du processeur graphique, %" - -#~ msgid "GPU Temp" -#~ msgstr "Temp du processeur graphique" - -#~ msgid "$gputemp - physical temperature on GPU" -#~ msgstr "$gputemp - Température physique du processeur graphique" - -#~ msgid "" -#~ "$mem - RAM usage, %\n" -#~ "$memmb - RAM usage, MB\n" -#~ "$memgb - RAM usage, GB\n" -#~ "$memtotmb - total RAM, MB\n" -#~ "$memtotgb - total RAM, GB" -#~ msgstr "" -#~ "$mem - utilisation de la RAM, %\n" -#~ "$memmb - utilisation de la RAM, MB\n" -#~ "$memgb - utilisation de la RAM, GB\n" -#~ "$memtotmb - RAM, MB\n" -#~ "$memtotgb - RAM, GB" - -#~ msgid "" -#~ "$swap - swap usage, %\n" -#~ "$swapmb - swap usage, MB\n" -#~ "$swapgb - swap usage, GB\n" -#~ "$swaptotmb - total swap, MB\n" -#~ "$swaptotgb - total swap, GB" -#~ msgstr "" -#~ "$swap - utilisation swap, %\n" -#~ "$swapmb - utilisation swap, MB\n" -#~ "$swapgb - utilisation swap, MB\n" -#~ "$swaptotmb - swap, MB\n" -#~ "$swaptotgb - swap, GB" - -#~ msgid "" -#~ "$hddN - usage for mount point N (from 0), %. Example: $hdd0\n" -#~ "$hddmbN - usage for mount point N (from 0), MB. Example: $hddmb0\n" -#~ "$hddgbN - usage for mount point N (from 0), GB. Example: $hddgb0\n" -#~ "$hddtotmbN - total size of mount point N (from 0), MB. Example: " -#~ "$hddtotmb0\n" -#~ "$hddtotgbN - total size of mount point N (from 0), GB. Example: $hddtotgb0" -#~ msgstr "" -#~ "$hddN - utilisation du point de montage N (à partir de 0), %. Exemple: " -#~ "$hdd0\n" -#~ "$hddmbN - utilisation du point de montage N (à partir de 0), MB. Exemple: " -#~ "$hddmb0\n" -#~ "$hddgbN - utilisation du point de montage N (à partir de 0), GB. Exemple: " -#~ "$hddgb0\n" -#~ "$hddtotmbN - taille totale de point de montage N (à partir de 0), MB. " -#~ "Exemple: $hddtotmb0\n" -#~ "$hddtotgbN - taille totale de point de montage N (à partir de 0), GB. " -#~ "Exemple: $hddtotgb0" - -#~ msgid "HDD speed" -#~ msgstr "Vitesse HDD" - -#~ msgid "" -#~ "$hddrN - read speed HDD N (from 0), KB/s. Example: $hddr0\n" -#~ "$hddwN - write speed HDD N (from 0), KB/s. Example: $hddw0" -#~ msgstr "" -#~ "$hddrN - vitesse de lecture HDD N (à partir de 0), KB/s. Exemple: $hddr0\n" -#~ "$hddwN - vitesse d'écriture HDD N (à partir de 0), KB/s. Exemple: $hddw0" - -#~ msgid "HDD temp" -#~ msgstr "Température HDD" - -#~ msgid "" -#~ "$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0" -#~ msgstr "" -#~ "$hddtempN - température physique du périphérique N (à partir de 0). " -#~ "Exemple: $hddtemp0" - -#~ msgid "" -#~ "$down - download speed, KB/s\n" -#~ "$up - upload speed, KB/s\n" -#~ "$netdev - current network device" -#~ msgstr "" -#~ "$down - vitesse de téléchargement, KB/s\n" -#~ "$up - vitesse ascendante, KB/s\n" -#~ "$netdev - périphérique réseau actuel" - -#~ msgid "" -#~ "$bat - battery charge, %\n" -#~ "$ac - AC status" -#~ msgstr "" -#~ "$bat - charge de la batterie, %\n" -#~ "$ac - état de l'alimentation" - -#~ msgid "" -#~ "$album - song album\n" -#~ "$artist - song artist\n" -#~ "$progress - song progress\n" -#~ "$time - song duration\n" -#~ "$title - song title" -#~ msgstr "" -#~ "$album - album du morceau\n" -#~ "$artist - artiste du morceau\n" -#~ "$progress - avancement du morceau\n" -#~ "$time - durée du morceau\n" -#~ "$title - titre du morceau" - -#~ msgid "Processes" -#~ msgstr "Processus" - -#~ msgid "" -#~ "$pscount - number of running processes\n" -#~ "$pstotal - total number of running processes\n" -#~ "$ps - list of running processes comma separated" -#~ msgstr "" -#~ "$pscount - nombre de processus actifs\n" -#~ "$pstotal - nombre total de processus actifs\n" -#~ "$ps - liste des processus actifs séparés par une virgule" - -#~ msgid "" -#~ "$pkgcountN - number of packages which are available for updates, command " -#~ "N. For example $pkgcount0" -#~ msgstr "" -#~ "$pkgcountN - nombre de paquets à mettre à jour, commande N. Par exemple " -#~ "$pkgcount0" - -#~ msgid "" -#~ "$customN - get output from custom command N (from N). Example `$custom0`" -#~ msgstr "" -#~ "$customN - sortie d'une commande personnelle N (à partir de 0). Exemple: " -#~ "$custom0" - -#~ msgid "pacman -Qu" -#~ msgstr "pacman -Qu" - -#~ msgid "apt-show-versions -u -b" -#~ msgstr "apt-show-versions -u -b" - -#~ msgid "aptitude search '~U'" -#~ msgstr "aptitude search '~U'" - -#~ msgid "yum list updates" -#~ msgstr "yum list updates" - -#~ msgid "pkg_version -I -l '<'" -#~ msgstr "pkg_version -I -l '<'" - -#~ msgid "urpmq --auto-select" -#~ msgstr "urpmq --auto-select" - -#~ msgid "$hddN - usage for mount point N (from 0), %. Example: $hdd0" -#~ msgstr "" -#~ "$hddN - espace occupé sur le point de montage N (à partir de 0), %. " -#~ "Exemple: $hdd0" - -#~ msgid "amarok" -#~ msgstr "amarok" - -#~ msgid "mpd" -#~ msgstr "mpd" - -#~ msgid "qmmp" -#~ msgstr "qmmp" - -#~ msgid "auto" -#~ msgstr "auto" - -#~ msgid "nvidia" -#~ msgstr "nvidia" - -#~ msgid "ati" -#~ msgstr "ati" - -#~ msgid "" -#~ "$ds - uptime days\n" -#~ "$hs - uptime hours\n" -#~ "$ms - uptime minutes" -#~ msgstr "" -#~ "$ds - uptime days\n" -#~ "$hs - uptime hours\n" -#~ "$ms - uptime minutes" - -#~ msgid "" -#~ "Command to run, example:\n" -#~ "wget -qO- http://ifconfig.me/ip - get external IP" -#~ msgstr "" -#~ "Command to run, example:\n" -#~ "wget -qO- http://ifconfig.me/ip - get external IP" - -#~ msgid "@@/;@@ - mount point usage, %" -#~ msgstr "@@/;@@ - mount point usage, %" - -#~ msgid "@@/dev/sda@@ - physical temperature on /dev/sda" -#~ msgstr "@@/dev/sda@@ - physical temperature on /dev/sda" - -#~ msgid "" -#~ "$net - network speed, down/up, KB/s\n" -#~ "$netdev - current network device\n" -#~ "@@eth0@@ - disable auto select device and set specified device" -#~ msgstr "" -#~ "$net - network speed, down/up, KB/s\n" -#~ "$netdev - current network device\n" -#~ "@@eth0@@ - disable auto select device and set specified device" +msgid "Import additional files" +msgstr "" diff --git a/sources/translations/lt.po b/sources/translations/lt.po new file mode 100644 index 0000000..31bc7e2 --- /dev/null +++ b/sources/translations/lt.po @@ -0,0 +1,773 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Translators: +# Moo, 2016-2017 +msgid "" +msgstr "" +"Project-Id-Version: Awesome widgets\n" +"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" +"POT-Creation-Date: 2017-07-13 17:39+0300\n" +"PO-Revision-Date: 2017-05-15 17:44+0000\n" +"Last-Translator: Evgeniy Alekseev \n" +"Language-Team: Lithuanian (http://www.transifex.com/arcanis/awesome-widgets/" +"language/lt/)\n" +"Language: lt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n" +"%100<10 || n%100>=20) ? 1 : 2);\n" + +msgid "Version %1 (build date %2)" +msgstr "Versija %1 (darinio data %2)" + +msgid "A set of minimalistic plasmoid widgets" +msgstr "" + +msgid "Links:" +msgstr "Nuorodos:" + +msgid "Homepage" +msgstr "Svetainė" + +msgid "Repository" +msgstr "Saugykla" + +msgid "Bugtracker" +msgstr "" + +msgid "Translation issue" +msgstr "Vertimo klaida" + +msgid "AUR packages" +msgstr "AUR paketai" + +msgid "openSUSE packages" +msgstr "openSUSE paketai" + +msgid "This software is licensed under %1" +msgstr "Ši programinė įranga yra licencijuota pagal %1" + +msgid "Translators:" +msgstr "" + +msgid "This software uses:" +msgstr "" + +msgid "Special thanks to:" +msgstr "" + +msgid "Widget" +msgstr "Valdiklis" + +msgid "Advanced" +msgstr "Išplėstiniai" + +msgid "Tooltip" +msgstr "Paaiškinimas" + +msgid "Appearance" +msgstr "Išvaizda" + +msgid "DataEngine" +msgstr "" + +msgid "About" +msgstr "Apie" + +msgid "Enable background" +msgstr "Įjungti foną" + +msgid "Translate strings" +msgstr "Versti eilutes" + +msgid "Wrap new lines" +msgstr "" + +msgid "Enable word wrap" +msgstr "Įjungti teksto skaidymą į eilutes" + +msgid "Enable notifications" +msgstr "Įjungti pranešimus" + +msgid "Check updates on startup" +msgstr "Paleidus, tikrinti ar yra atnaujinimų" + +msgid "Optimize subscription" +msgstr "" + +msgid "Widget height, px" +msgstr "Valdiklio aukštis, piks." + +msgid "Widget width, px" +msgstr "Valdiklio plotis, piks." + +msgid "Time interval" +msgstr "Laiko intervalas" + +msgid "Messages queue limit" +msgstr "" + +msgid "Celsius" +msgstr "Celsijus" + +msgid "Fahrenheit" +msgstr "Farenheitas" + +msgid "Kelvin" +msgstr "Kelvinas" + +msgid "Reaumur" +msgstr "Reomiūras" + +msgid "cm^-1" +msgstr "cm^-1" + +msgid "kJ/mol" +msgstr "kJ/mol" + +msgid "kcal/mol" +msgstr "kcal/mol" + +msgid "Temperature units" +msgstr "Temperatūros vienetai" + +msgid "Custom time format" +msgstr "Tinkintas laiko formatas" + +msgid "Custom uptime format" +msgstr "" + +msgid "AC online tag" +msgstr "" + +msgid "AC offline tag" +msgstr "" + +msgid "Actions" +msgstr "" + +msgid "Drop key cache" +msgstr "" + +msgid "Export configuration" +msgstr "Eksportuoti konfigūraciją" + +msgid "Import configuration" +msgstr "Importuoti konfigūraciją" + +msgid "Telemetry" +msgstr "" + +msgid "Enable remote telemetry" +msgstr "" + +msgid "History count" +msgstr "" + +msgid "Telemetry ID" +msgstr "" + +msgid "Font" +msgstr "Šriftas" + +msgid "Font size" +msgstr "Šrifto dydis" + +msgid "Font weight" +msgstr "" + +msgid "Font style" +msgstr "Šrifto dydis" + +msgid "Font color" +msgstr "Šrifto spalva" + +msgid "Style" +msgstr "" + +msgid "Style color" +msgstr "" + +msgid "ACPI" +msgstr "ACPI" + +msgid "ACPI path" +msgstr "ACPI kelias" + +msgid "GPU" +msgstr "" + +msgid "GPU device" +msgstr "" + +msgid "HDD temperature" +msgstr "" + +msgid "HDD" +msgstr "" + +msgid "hddtemp cmd" +msgstr "" + +msgid "Player" +msgstr "Grotuvas" + +msgid "Player data symbols" +msgstr "" + +msgid "Music player" +msgstr "Muzikos grotuvas" + +msgid "MPRIS player name" +msgstr "MPRIS grotuvo pavadinimas" + +msgid "MPD address" +msgstr "MPD adresas" + +msgid "MPD port" +msgstr "MPD prievadas" + +msgid "Extensions" +msgstr "" + +msgid "Custom scripts" +msgstr "Tinkinti scenarijai" + +msgid "Network requests" +msgstr "" + +msgid "Package manager" +msgstr "Paketų tvarkytuvė" + +msgid "Quotes monitor" +msgstr "" + +msgid "Weather" +msgstr "Orai" + +msgid "Select tag" +msgstr "Pasirinkti žymę" + +msgid "Tag: %1" +msgstr "Žymė: %1" + +msgid "Value: %1" +msgstr "Reikšmė: %1" + +msgid "Info: %1" +msgstr "Informacija: %1" + +msgid "Request key" +msgstr "" + +msgid "Show README" +msgstr "" + +msgid "Check updates" +msgstr "" + +msgid "Report bug" +msgstr "Pranešti apie klaidą" + +msgid "" +"CPU, CPU clock, memory, swap and network labels support graphical tooltip. " +"To enable them just make needed checkbox checked." +msgstr "" + +msgid "Number of values for tooltips" +msgstr "" + +msgid "Background" +msgstr "FOnas" + +msgid "Background color" +msgstr "Fono spalva" + +msgid "CPU" +msgstr "" + +msgid "CPU color" +msgstr "" + +msgid "CPU clock" +msgstr "" + +msgid "CPU clock color" +msgstr "" + +msgid "Memory" +msgstr "Atmintis" + +msgid "Memory color" +msgstr "Atminties spalva" + +msgid "Swap" +msgstr "Sukeitimų skaidinys" + +msgid "Swap color" +msgstr "Sukeitimų skaidinio spalva" + +msgid "Network" +msgstr "Tinklas" + +msgid "Download speed color" +msgstr "Atsiuntimo spartos spalva" + +msgid "Upload speed color" +msgstr "Išsiuntimo spartos spalva" + +msgid "Battery" +msgstr "" + +msgid "Battery active color" +msgstr "" + +msgid "Battery inactive color" +msgstr "" + +msgid "Edit" +msgstr "" + +msgid "Run %1" +msgstr "" + +msgid "Not supported" +msgstr "Nepalaikoma" + +msgid "You are using mammoth's Qt version, try to update it first" +msgstr "" + +msgid "Select font" +msgstr "Pasirinkti šriftą" + +msgid "Issue created" +msgstr "" + +msgid "Issue %1 has been created" +msgstr "" + +msgid "AC online" +msgstr "" + +msgid "AC offline" +msgstr "" + +msgid "High CPU load" +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 "Tinklo įrenginys buvo pakeistas į %1" + +msgid "Select type" +msgstr "" + +msgid "Type:" +msgstr "Tipas:" + +msgid "MB/s" +msgstr "MB/s" + +msgid "KB/s" +msgstr "KB/s" + +msgid "Changelog of %1" +msgstr "%1 keitimų žurnalas" + +msgid "You are using the actual version %1" +msgstr "" + +msgid "No new version found" +msgstr "Nerasta jokios naujos versijos" + +msgid "Current version : %1" +msgstr "Dabartinė versija : %1" + +msgid "New version : %1" +msgstr "Nauja versija : %1" + +msgid "Click \"Ok\" to download" +msgstr "Spustelėkite \"Gerai\", kad atsisiųstumėte" + +msgid "There are updates" +msgstr "Yra atnaujinimų" + +msgid "Copy" +msgstr "Kopijuoti" + +msgid "Create" +msgstr "Sukurti" + +msgid "Remove" +msgstr "Šalinti" + +msgid "Enter file name" +msgstr "" + +msgid "File name" +msgstr "Failo pavadinimas" + +msgid "Name: %1" +msgstr "Pavadinimas: %1" + +msgid "Comment: %1" +msgstr "Komentaras: %1" + +msgid "Identity: %1" +msgstr "Tapatybė: %1" + +msgid "Name" +msgstr "Pavadinimas" + +msgid "Comment" +msgstr "Komentaras" + +msgid "Type" +msgstr "Tipas" + +msgid "Format" +msgstr "" + +msgid "Precision" +msgstr "" + +msgid "Width" +msgstr "Plotis" + +msgid "Fill char" +msgstr "" + +msgid "Force width" +msgstr "" + +msgid "Multiplier" +msgstr "" + +msgid "Summand" +msgstr "" + +msgid "Path" +msgstr "" + +msgid "Filter" +msgstr "" + +msgid "Separator" +msgstr "" + +msgid "Sort" +msgstr "" + +msgid "Append code" +msgstr "" + +msgid "Has return" +msgstr "" + +msgid "Code" +msgstr "Kodas" + +msgid "Tag" +msgstr "Žymė" + +msgid "URL" +msgstr "" + +msgid "Active" +msgstr "" + +msgid "Schedule" +msgstr "" + +msgid "Socket" +msgstr "" + +msgid "Interval" +msgstr "" + +msgid "" +"

Use YAHOO! finance ticker to get quotes for the " +"instrument. Refer to http://finance.yahoo.com/

" +msgstr "" + +msgid "Ticker" +msgstr "" + +msgid "Command" +msgstr "Komanda" + +msgid "Prefix" +msgstr "" + +msgid "Redirect" +msgstr "" + +msgid "Additional filters" +msgstr "" + +msgid "Wrap colors" +msgstr "" + +msgid "Wrap spaces" +msgstr "" + +msgid "Null" +msgstr "" + +msgid "Provider" +msgstr "" + +msgid "City" +msgstr "Miestas" + +msgid "Country" +msgstr "Šalis" + +msgid "Timestamp" +msgstr "Laiko žyma" + +msgid "Use images" +msgstr "Naudoti paveikslus" + +msgid "Select color" +msgstr "" + +msgid "Select path" +msgstr "" + +msgid "Images (*.png *.bpm *.jpg);;All files (*.*)" +msgstr "" + +msgid "Use custom formula" +msgstr "" + +msgid "Value" +msgstr "Reikšmė" + +msgid "Max value" +msgstr "Didžiausia reikšmė" + +msgid "Min value" +msgstr "Mažiausia reikšmė" + +msgid "Active filling type" +msgstr "" + +msgid "Inctive filling type" +msgstr "" + +msgid "Points count" +msgstr "" + +msgid "Direction" +msgstr "" + +msgid "Height" +msgstr "Aukštis" + +msgid "color" +msgstr "spalva" + +msgid "image" +msgstr "paveikslas" + +msgid "Active desktop" +msgstr "Aktyvus darbalaukis" + +msgid "Inactive desktop" +msgstr "Neaktyvus darbalaukis" + +msgid "Vertical layout" +msgstr "Vertikalus išdėstymas" + +msgid "Mark" +msgstr "" + +msgid "contours" +msgstr "" + +msgid "windows" +msgstr "langai" + +msgid "clean desktop" +msgstr "" + +msgid "names" +msgstr "" + +msgid "none" +msgstr "nėra" + +msgid "Tooltip type" +msgstr "Paaiškinimo tipas" + +msgid "Tooltip width" +msgstr "Paaiškinimo plotis" + +msgid "Edit bars" +msgstr "" + +msgid "Formatters" +msgstr "" + +msgid "User keys" +msgstr "" + +msgid "Preview" +msgstr "Peržiūra" + +msgid "" +"Detailed information may be found on project homepage" +msgstr "" +"Išsamesnę informaciją galite rasti projekto svetainėje" + +msgid "Add" +msgstr "Pridėti" + +msgid "Show value" +msgstr "Rodyti reikšmę" + +msgid "Acknowledgment" +msgstr "Padėkos" + +msgid "Report a bug" +msgstr "Pranešti apie klaidą" + +msgid "Report subject" +msgstr "" + +msgid "Description" +msgstr "Aprašas" + +msgid "Steps to reproduce" +msgstr "" + +msgid "Expected result" +msgstr "" + +msgid "Logs" +msgstr "Žurnalai" + +msgid "Use command" +msgstr "Naudoti komandą" + +msgid "Load log file" +msgstr "Įkelti žurnalo failą" + +msgid "Open log file" +msgstr "Atverti žurnalo failą" + +msgid "Select a color" +msgstr "Pasirinkti spalvą" + +msgid "Export" +msgstr "Eksportuoti" + +msgid "Success" +msgstr "Pavyko" + +msgid "Please note that binary files were not copied" +msgstr "Turėkite omenyje, kad dvejetainių failai nebuvo nukopijuoti" + +msgid "Ooops..." +msgstr "Uuups..." + +msgid "Could not save configuration file" +msgstr "Nepavyko įrašyti konfigūracijos failo" + +msgid "Select a font" +msgstr "Pasirinkti šriftą" + +msgid "AC" +msgstr "" + +msgid "Bars" +msgstr "" + +msgid "Desktops" +msgstr "Darbalaukiai" + +#, fuzzy +msgid "Network request" +msgstr "Tinklas" + +msgid "Scripts" +msgstr "Scenarijai" + +msgid "Time" +msgstr "Laikas" + +msgid "Quotes" +msgstr "" + +msgid "Upgrades" +msgstr "" + +msgid "Weathers" +msgstr "Orai" + +msgid "Functions" +msgstr "Funkcijos" + +msgid "User defined" +msgstr "" + +msgid "All" +msgstr "" + +msgid "normal" +msgstr "" + +msgid "italic" +msgstr "kursyvas" + +msgid "light" +msgstr "" + +msgid "demi bold" +msgstr "" + +msgid "bold" +msgstr "pusjuodis" + +msgid "black" +msgstr "" + +msgid "outline" +msgstr "" + +msgid "raised" +msgstr "" + +msgid "sunken" +msgstr "" + +msgid "Bgcolor" +msgstr "Fono spalva" + +msgid "Import" +msgstr "Importuoti" + +msgid "Import plasmoid settings" +msgstr "" + +msgid "Import extensions" +msgstr "" + +msgid "Import additional files" +msgstr "Importuoti papildomus failus" diff --git a/sources/translations/nl_NL.po b/sources/translations/nl_NL.po index 0f6091b..9379e27 100644 --- a/sources/translations/nl_NL.po +++ b/sources/translations/nl_NL.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: 2017-05-05 18:15+0300\n" +"POT-Creation-Date: 2017-07-13 17:39+0300\n" "PO-Revision-Date: 2016-07-09 08:47+0000\n" "Last-Translator: Heimen Stoffels \n" "Language-Team: Dutch (Netherlands) (http://www.transifex.com/arcanis/awesome-" @@ -337,6 +337,9 @@ msgstr "Kleur van actieve accu" msgid "Battery inactive color" msgstr "Kleur van inactieve accu" +msgid "Edit" +msgstr "Bewerken" + msgid "Run %1" msgstr "%1 uitvoeren" @@ -376,9 +379,6 @@ msgstr "Hoog GPU-verbruik" msgid "Network device has been changed to %1" msgstr "Het netwerkapparaat is gewijzigd naar %1" -msgid "Edit" -msgstr "Bewerken" - msgid "Select type" msgstr "Type selecteren" @@ -638,6 +638,9 @@ msgstr "Balken bewerken" msgid "Formatters" msgstr "Opmakers" +msgid "User keys" +msgstr "" + msgid "Preview" msgstr "Voorbeeld" @@ -707,21 +710,6 @@ msgstr "Het configuratiebestand kon niet worden opgeslagen" msgid "Select a font" msgstr "Selecteer een lettertype" -msgid "Bgcolor" -msgstr "Achtergrondkleur" - -msgid "Import" -msgstr "Importeren" - -msgid "Import plasmoid settings" -msgstr "Plasmoid-instellingen importeren" - -msgid "Import extensions" -msgstr "Extensies importeren" - -msgid "Import additional files" -msgstr "Extra bestanden importeren" - msgid "AC" msgstr "AC" @@ -731,6 +719,10 @@ msgstr "Balken" msgid "Desktops" msgstr "Bureaubladen" +#, fuzzy +msgid "Network request" +msgstr "Netwerk" + msgid "Scripts" msgstr "Scripts" @@ -749,6 +741,9 @@ msgstr "Weer" msgid "Functions" msgstr "Mogelijkheden" +msgid "User defined" +msgstr "" + msgid "All" msgstr "" @@ -780,22 +775,17 @@ msgstr "" msgid "sunken" msgstr "" -msgctxt "NAME OF TRANSLATORS" -msgid "Your names" -msgstr "Heimen Stoffels" +msgid "Bgcolor" +msgstr "Achtergrondkleur" -msgctxt "EMAIL OF TRANSLATORS" -msgid "Your emails" -msgstr "vistausss@outlook.com" +msgid "Import" +msgstr "Importeren" -#~ msgid "Edit scripts" -#~ msgstr "Scripts bewerken" +msgid "Import plasmoid settings" +msgstr "Plasmoid-instellingen importeren" -#~ msgid "Edit tickers" -#~ msgstr "Tickers bewerken" +msgid "Import extensions" +msgstr "Extensies importeren" -#~ msgid "Edit command" -#~ msgstr "Commando bewerken" - -#~ msgid "Edit weather" -#~ msgstr "Weer bewerken" +msgid "Import additional files" +msgstr "Extra bestanden importeren" diff --git a/sources/translations/pl.po b/sources/translations/pl.po index 909e4f2..9de23ff 100644 --- a/sources/translations/pl.po +++ b/sources/translations/pl.po @@ -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: 2017-05-05 18:15+0300\n" +"POT-Creation-Date: 2017-07-13 17:39+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -333,6 +333,10 @@ msgstr "Kolor baterii aktywnej" msgid "Battery inactive color" msgstr "Kolor baterii nie aktywnej" +#, fuzzy +msgid "Edit" +msgstr "Edytuj paski postępu" + msgid "Run %1" msgstr "Wykonać %1" @@ -372,10 +376,6 @@ msgstr "Wysokie obciążenie procesora graficznego" msgid "Network device has been changed to %1" msgstr "Urządznie sieciowe zamienione na %1" -#, fuzzy -msgid "Edit" -msgstr "Edytuj paski postępu" - #, fuzzy msgid "Select type" msgstr "Wybierz znacznik" @@ -646,6 +646,9 @@ msgstr "Edytuj paski postępu" msgid "Formatters" msgstr "" +msgid "User keys" +msgstr "" + msgid "Preview" msgstr "Przegląd" @@ -716,22 +719,6 @@ msgstr "Nie mogę zapisać pliku konfiguracji" msgid "Select a font" msgstr "Wybierz czcionkę" -#, fuzzy -msgid "Bgcolor" -msgstr "Kolor procesora" - -msgid "Import" -msgstr "Import" - -msgid "Import plasmoid settings" -msgstr "Załaduj ustawnienai plasmoidu" - -msgid "Import extensions" -msgstr "Załaduj rozszerzenia" - -msgid "Import additional files" -msgstr "Załaduj pliki dodatkowe" - msgid "AC" msgstr "Zasialnie zewnętrzne" @@ -741,6 +728,10 @@ msgstr "Paski postępu" msgid "Desktops" msgstr "Pulpity" +#, fuzzy +msgid "Network request" +msgstr "Sieć" + msgid "Scripts" msgstr "Skrypty" @@ -759,6 +750,9 @@ msgstr "Pogoda" msgid "Functions" msgstr "" +msgid "User defined" +msgstr "" + msgid "All" msgstr "" @@ -790,35 +784,18 @@ msgstr "" msgid "sunken" msgstr "" -msgctxt "NAME OF TRANSLATORS" -msgid "Your names" -msgstr "Terminus" - -msgctxt "EMAIL OF TRANSLATORS" -msgid "Your emails" -msgstr "terminus@linux.pl" - -#~ msgid "Edit scripts" -#~ msgstr "Edytuj skrypty" - -#~ msgid "Edit tickers" -#~ msgstr "Eytuj znaczniki" - -#~ msgid "Edit command" -#~ msgstr "Polecenie edycji" - -#~ msgid "Edit weather" -#~ msgstr "Edytuj pogodę" - #, fuzzy -#~ msgid "Use image for active" -#~ msgstr "Użyj obrazków" +msgid "Bgcolor" +msgstr "Kolor procesora" -#~ msgid "Active color" -#~ msgstr "Kolor aktywnego" +msgid "Import" +msgstr "Import" -#~ msgid "Inactive color" -#~ msgstr "Kolor nieaktywnego" +msgid "Import plasmoid settings" +msgstr "Załaduj ustawnienai plasmoidu" -#~ msgid "Add lambda" -#~ msgstr "Dodaj różnicę" +msgid "Import extensions" +msgstr "Załaduj rozszerzenia" + +msgid "Import additional files" +msgstr "Załaduj pliki dodatkowe" diff --git a/sources/translations/pt_BR.po b/sources/translations/pt_BR.po index c5b0b0b..ea19447 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: 2017-05-05 18:15+0300\n" +"POT-Creation-Date: 2017-07-13 17:39+0300\n" "PO-Revision-Date: 2015-07-31 22:21+0300\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: Russian \n" @@ -346,6 +346,9 @@ msgstr "Cor da bateria ativa" msgid "Battery inactive color" msgstr "Cor da bateria inativa" +msgid "Edit" +msgstr "Editar" + msgid "Run %1" msgstr "Rodar %1" @@ -385,9 +388,6 @@ msgstr "Alta carga da GPU" msgid "Network device has been changed to %1" msgstr "O dispositivo de rede mudou para %1" -msgid "Edit" -msgstr "Editar" - #, fuzzy msgid "Select type" msgstr "Selecionar tag" @@ -655,6 +655,9 @@ msgstr "Editar barras" msgid "Formatters" msgstr "" +msgid "User keys" +msgstr "" + msgid "Preview" msgstr "" @@ -725,22 +728,6 @@ msgstr "Configuração" msgid "Select a font" msgstr "Selecionar uma fonte" -#, fuzzy -msgid "Bgcolor" -msgstr "Cor da CPU" - -msgid "Import" -msgstr "" - -msgid "Import plasmoid settings" -msgstr "" - -msgid "Import extensions" -msgstr "" - -msgid "Import additional files" -msgstr "" - msgid "AC" msgstr "" @@ -750,6 +737,10 @@ msgstr "Barras" msgid "Desktops" msgstr "" +#, fuzzy +msgid "Network request" +msgstr "Diretório de rede" + #, fuzzy msgid "Scripts" msgstr "Editar scripts" @@ -772,6 +763,9 @@ msgstr "Editar relógios" msgid "Functions" msgstr "" +msgid "User defined" +msgstr "" + msgid "All" msgstr "" @@ -803,364 +797,18 @@ msgstr "" msgid "sunken" msgstr "" -msgctxt "NAME OF TRANSLATORS" -msgid "Your names" -msgstr "under" - -msgctxt "EMAIL OF TRANSLATORS" -msgid "Your emails" -msgstr "under@insicuri.net" - -#~ msgid "Edit scripts" -#~ msgstr "Editar scripts" - -#~ msgid "Edit tickers" -#~ msgstr "Editar relógios" - -#~ msgid "Edit command" -#~ msgstr "Editar comandos" - #, fuzzy -#~ msgid "Edit weather" -#~ msgstr "Editar relógios" +msgid "Bgcolor" +msgstr "Cor da CPU" -#~ msgid "Active color" -#~ msgstr "Cor ativa" +msgid "Import" +msgstr "" -#~ msgid "Inactive color" -#~ msgstr "Cor inativa" +msgid "Import plasmoid settings" +msgstr "" -#~ msgid "Free space on %1 less than 10%" -#~ msgstr "O espaço livre em %1 é menor que 10%" +msgid "Import extensions" +msgstr "" -#~ msgid "Top Edge" -#~ msgstr "Canto do topo" - -#~ msgid "Bottom Edge" -#~ msgstr "Canto de baixo" - -#~ msgid "Left Edge" -#~ msgstr "Canto esquerdo" - -#~ msgid "Right Edge" -#~ msgstr "Canto direito" - -#~ msgid "Unknown location (%1)" -#~ msgstr "Localização desconhecida (%1)" - -#~ msgid "Exec: %1" -#~ msgstr "Exec: %1" - -#~ msgid "Run ksysguard" -#~ msgstr "Abrir ksysguard" - -#~ msgid "Update text" -#~ msgstr "Atualizar texto" - -#~ msgid "Check for updates" -#~ msgstr "Checar por atualizações" - -#~ msgid "Enable popup on mouse click" -#~ msgstr "Ativar popup no clique do mouse" - -#~ msgid "" -#~ "$dddd - long weekday\n" -#~ "$ddd - short weekday\n" -#~ "$dd - day\n" -#~ "$d - day w\\o zero\n" -#~ "$MMMM - long month\n" -#~ "$MMM - short month\n" -#~ "$MM - month\n" -#~ "$M - month w\\o zero\n" -#~ "$yyyy - year\n" -#~ "$yy - short year\n" -#~ "$hh - hours (24 only)\n" -#~ "$h - hours w\\o zero (24 only)\n" -#~ "$mm - minutes\n" -#~ "$m - minutes w\\o zero\n" -#~ "$ss - seconds\n" -#~ "$s - seconds w\\o zero" -#~ msgstr "" -#~ "$dddd - dia da semana completo\n" -#~ "$ddd - dia da semana curto\n" -#~ "$dd - dia\n" -#~ "$d - dia com zero\n" -#~ "$MMMM - mês completo\n" -#~ "$MMM - mês curto\n" -#~ "$MM - mês\n" -#~ "$M - mês com zero\n" -#~ "$hh - horas (somente 24)\n" -#~ "$h - horas sem zeros (somente 24)\n" -#~ "$mm - minutos\n" -#~ "$m - minutos sem zeros\n" -#~ "$ss - segundos\n" -#~ "$s segundos sem zeros" - -#~ msgid "" -#~ "$dd - uptime days\n" -#~ "$d - uptime days without zero\n" -#~ "$hh - uptime hours\n" -#~ "$h - uptime hours without zero\n" -#~ "$mm - uptime minutes\n" -#~ "$m - uptime minutes without zero" -#~ msgstr "" -#~ "$dd - tempo em atividade em dias\n" -#~ "$d - tempo em atividade em dias sem zeros\n" -#~ "$hh - tempo em atividade em horas\n" -#~ "$h - tempo em atividade em horas sem zeros\n" -#~ "$mm - tempo em atividade em minutos\n" -#~ "$m - tempo em atividade em minuto sem zeros" - -#~ msgid "Temperature devices" -#~ msgstr "Dispositivos de temperatura" - -#~ msgid "Editable" -#~ msgstr "Editável" - -#~ msgid "Fan devices" -#~ msgstr "Dispositivos de ventilação" - -#~ msgid "Mount points" -#~ msgstr "Pontos de montagem" - -#~ msgid "HDD devices (speed)" -#~ msgstr "Dispositivos HDD (velocidade) " - -#~ msgid "HDD devices (temp)" -#~ msgstr "Dispositivos HDD (temperatura)" - -#~ msgid "Disable auto select device and set specified device" -#~ msgstr "" -#~ "Desativar auto seleção de dispositivos e escolher um dispositivo " -#~ "específico" - -#~ msgid "Set network device" -#~ msgstr "Escolher dispositivo de rede" - -#~ msgid "Line, which returns when AC is online" -#~ msgstr "Linha, que aparece quando o carregador está conectado" - -#~ msgid "Line, which returns when AC is offline" -#~ msgstr "Linha, que aparece quando o carregador está offline" - -#~ msgid "\"/sys/class/power_supply/\" by default" -#~ msgstr "\"/sys/class/power_supply/AC/online\" por padrão" - -#~ msgid "NOTE: Player DBus interface should be an active" -#~ msgstr "NOTA: Interface do player DBus deverá ser uma ativa" - -#~ msgid "Ctrl+B" -#~ msgstr "Ctrl+B" - -#~ msgid "Ctrl+I" -#~ msgstr "Ctrl+I" - -#~ msgid "Ctrl+U" -#~ msgstr "Ctrl+U" - -#~ msgid "Null lines" -#~ msgstr "Linhas nulas" - -#~ msgid "Battery device" -#~ msgstr "Dispositivo do carregador" - -#~ msgid "\"/sys/class/power_supply/BAT0/capacity\" by default" -#~ msgstr "\"/sys/class/power_supply/BAT0/capacity\" por padrão" - -#~ msgid "Add stretch to left/top of the layout" -#~ msgstr "Adicionar esticamento à esquerda/topo do layout" - -#~ msgid "Add stretch to right/bottom of the layout" -#~ msgstr "Adicionar esticamento à direita/inferior do layout" - -#~ msgid "\"/sys/class/net\" by default" -#~ msgstr "\"/sys/class/power_supply/AC/online\" por padrão" - -#~ msgid "Custom command to run" -#~ msgstr "Comando personalizado para usar" - -#~ msgid "" -#~ "$time - time in default format\n" -#~ "$isotime - time in ISO format\n" -#~ "$shorttime - time in short format\n" -#~ "$longtime - time in log format\n" -#~ "$custom - custom time format" -#~ msgstr "" -#~ "$time - hora no formato padrão\n" -#~ "$isotime - hora no formato ISO\n" -#~ "$shorttime - hora em formato curto \n" -#~ "$longtime - hora em formato completo\n" -#~ "$custom - hora em formato personalizado" - -#~ msgid "Uptime" -#~ msgstr "Tempo em atividade" - -#~ msgid "" -#~ "$uptime - system uptime\n" -#~ "$custom - custom format" -#~ msgstr "" -#~ "$uptime - tempo em atividade do sistema\n" -#~ "$custom - formato personalizado " - -#~ msgid "" -#~ "$cpu - total load CPU, %\n" -#~ "$cpu0 - load CPU for core 0, %\n" -#~ "...\n" -#~ "$cpu9 - load CPU for core 9, %\n" -#~ "...\n" -#~ "$cpuN - load CPU for core N, %" -#~ msgstr "" -#~ "$cpu - carga total da CPU, %\n" -#~ "$cpu0 - carga total para o núcleo 0 da CPU, %\n" -#~ "...\n" -#~ "$cpu9 - carga total para o núcleo 9 da CPU, %\n" -#~ "...\n" -#~ "$cpuN - carga total para o núcleo N da CPU, %" - -#~ msgid "" -#~ "$cpucl - average CPU clock, MHz\n" -#~ "$cpucl0 - CPU clock for core 0, MHz\n" -#~ "...\n" -#~ "$cpucl9 - CPU clock for core 9, MHz\n" -#~ "...\n" -#~ "$cpuclN - CPU clock for core N, MHz" -#~ msgstr "" -#~ "$cpucl - frequência média da CPU, MHz\n" -#~ "$cpucl0 - frequência da CPU para o núcleo 0, MHz\n" -#~ "...\n" -#~ "$cpucl9 - frequência da CPU para o núcleo 9, MHz\n" -#~ "...\n" -#~ "$cpuclN - frequência da CPU para o núcleo N, MHz" - -#~ msgid "$tempN - physical temperature on device N (from 0). Example: $temp0" -#~ msgstr "" -#~ "$hddtempN - temperatura física no dispositivo N (começando por 0). " -#~ "Exemplo: $hddtemp0" - -#~ msgid "$gpu - gpu usage, %" -#~ msgstr "$gpu - uso da GPU, %" - -#~ msgid "GPU Temp" -#~ msgstr "Temperatura da GPU" - -#~ msgid "$gputemp - physical temperature on GPU" -#~ msgstr "$gputemp - temperatura física da GPU" - -#~ msgid "" -#~ "$mem - RAM usage, %\n" -#~ "$memmb - RAM usage, MB\n" -#~ "$memgb - RAM usage, GB\n" -#~ "$memtotmb - total RAM, MB\n" -#~ "$memtotgb - total RAM, GB" -#~ msgstr "" -#~ "$mem - uso de RAM, %\n" -#~ "$memmb - uso de RAM, MB\n" -#~ "$memgb - uso de RAM, GB\n" -#~ "$memtotmb - RAM total, MB\n" -#~ "$memtotgb - RAM total, GB" - -#~ msgid "" -#~ "$swap - swap usage, %\n" -#~ "$swapmb - swap usage, MB\n" -#~ "$swapgb - swap usage, GB\n" -#~ "$swaptotmb - total swap, MB\n" -#~ "$swaptotgb - total swap, GB" -#~ msgstr "" -#~ "$swap - uso de swap, %\n" -#~ "$swapmb - uso de swap, MB\n" -#~ "$swapgb - uso de swap, GB\n" -#~ "$swaptotmb - swap total, MB\n" -#~ "$swaptotgb - swap total, GB" - -#~ msgid "" -#~ "$hddN - usage for mount point N (from 0), %. Example: $hdd0\n" -#~ "$hddmbN - usage for mount point N (from 0), MB. Example: $hddmb0\n" -#~ "$hddgbN - usage for mount point N (from 0), GB. Example: $hddgb0\n" -#~ "$hddtotmbN - total size of mount point N (from 0), MB. Example: " -#~ "$hddtotmb0\n" -#~ "$hddtotgbN - total size of mount point N (from 0), GB. Example: $hddtotgb0" -#~ msgstr "" -#~ "$hddN - uso do ponto de montagem N (começando por 0), %. Exemplo: $hdd0\n" -#~ "$hddmbN - uso do ponto de montagem N (começando por 0), MB. Exemplo: " -#~ "$hddmb0\n" -#~ "$hddgbN - uso do ponto de montagem N (começando por 0), GB. Exemplo: " -#~ "$hddgbN0\n" -#~ "$hddtotmbN - tamanho total do ponto de montagem N (começando por 0), MB. " -#~ "Exemplo: $hddtotmbN\n" -#~ "$hddtotgbN - tamanho total do ponto de montagem N (começando por 0), GB. " -#~ "Exemplo: $hddtogbN" - -#~ msgid "HDD speed" -#~ msgstr "Velocidade do HDD" - -#~ msgid "" -#~ "$hddrN - read speed HDD N (from 0), KB/s. Example: $hddr0\n" -#~ "$hddwN - write speed HDD N (from 0), KB/s. Example: $hddw0" -#~ msgstr "" -#~ "$hddrN - velocidade de leitura do HDD (começando por 0), KB/s. Exemplo: " -#~ "$hddr0\n" -#~ "$hddwN - velocidade de escrita do HDD (começando por 0), Kb/s. Exemplo: " -#~ "$hddw0" - -#~ msgid "HDD temp" -#~ msgstr "Temperatura do HDD " - -#~ msgid "" -#~ "$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0" -#~ msgstr "" -#~ "$hddtempN - temperatura física no dispositivo N (começando por 0). " -#~ "Exemplo: $hddtemp0" - -#~ msgid "" -#~ "$down - download speed, KB/s\n" -#~ "$up - upload speed, KB/s\n" -#~ "$netdev - current network device" -#~ msgstr "" -#~ "$down - velocidade de download, KB/s\n" -#~ "$up - velocidade de upload, KB/s\n" -#~ "$netdev - dispositivo de rede atual" - -#~ msgid "" -#~ "$bat - battery charge, %\n" -#~ "$ac - AC status" -#~ msgstr "" -#~ "bateria - carga da bateria, %\n" -#~ "$ac - status do carregador" - -#~ msgid "" -#~ "$album - song album\n" -#~ "$artist - song artist\n" -#~ "$progress - song progress\n" -#~ "$time - song duration\n" -#~ "$title - song title" -#~ msgstr "" -#~ "$album - album da música\n" -#~ "$artist - artista da música\n" -#~ "$progress - progresso da música\n" -#~ "$time - duração da música\n" -#~ "$title - título da música" - -#~ msgid "Processes" -#~ msgstr "Processos " - -#~ msgid "" -#~ "$pscount - number of running processes\n" -#~ "$pstotal - total number of running processes\n" -#~ "$ps - list of running processes comma separated" -#~ msgstr "" -#~ "$pscount - número de processos rodando\n" -#~ "$pstotal - número total de processos rodando\n" -#~ "$ps - lista dos processos rodando separados por vírgula" - -#~ msgid "" -#~ "$pkgcountN - number of packages which are available for updates, command " -#~ "N. For example $pkgcount0" -#~ msgstr "" -#~ "$pkgcountN - número de pacotes disponíveis para atualizar, comando N. Por " -#~ "exemplo $pkgcount0" - -#~ msgid "" -#~ "$customN - get output from custom command N (from N). Example `$custom0`" -#~ msgstr "" -#~ "$customN - leia a saída de um comando personalizado N (a partir de N). " -#~ "Exemplo: `$custom0`" +msgid "Import additional files" +msgstr "" diff --git a/sources/translations/ru.po b/sources/translations/ru.po index 8dc2c0d..2f6d5d0 100644 --- a/sources/translations/ru.po +++ b/sources/translations/ru.po @@ -6,16 +6,16 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2017-05-05 18:15+0300\n" -"PO-Revision-Date: 2017-05-05 18:19+0300\n" +"POT-Creation-Date: 2017-07-13 17:39+0300\n" +"PO-Revision-Date: 2017-07-13 17:52+0300\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: Russian \n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<" -"=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "X-Generator: Lokalize 2.0\n" msgid "Version %1 (build date %2)" @@ -328,6 +328,9 @@ msgstr "Цвет заряжаемой батареи" msgid "Battery inactive color" msgstr "Цвет разряжаемой батареи" +msgid "Edit" +msgstr "Править" + msgid "Run %1" msgstr "Запуск %1" @@ -367,9 +370,6 @@ msgstr "Высокая загрузка GPU" msgid "Network device has been changed to %1" msgstr "Сетевое устройство было изменено на %1" -msgid "Edit" -msgstr "Править" - msgid "Select type" msgstr "Выберете тип" @@ -627,6 +627,9 @@ msgstr "Редактировать бары" msgid "Formatters" msgstr "Форматеры" +msgid "User keys" +msgstr "Пользовательские ключи" + msgid "Preview" msgstr "Предварительный просмотр" @@ -694,21 +697,6 @@ msgstr "Не могу сохранить файл настроек" msgid "Select a font" msgstr "Выберете шрифт" -msgid "Bgcolor" -msgstr "Цвет фона" - -msgid "Import" -msgstr "Импорт" - -msgid "Import plasmoid settings" -msgstr "Импорт настроек плазмоида" - -msgid "Import extensions" -msgstr "Импорт расширений" - -msgid "Import additional files" -msgstr "Импорт дополнительных файлов" - msgid "AC" msgstr "Адаптор питания" @@ -718,6 +706,9 @@ msgstr "Бары" msgid "Desktops" msgstr "Рабочие столы" +msgid "Network request" +msgstr "Веб-запрос" + msgid "Scripts" msgstr "Скрипты" @@ -736,6 +727,9 @@ msgstr "Погода" msgid "Functions" msgstr "Функции" +msgid "User defined" +msgstr "Пользовательские ключи" + msgid "All" msgstr "Все" @@ -766,456 +760,17 @@ msgstr "raised" msgid "sunken" msgstr "sunken" -msgctxt "NAME OF TRANSLATORS" -msgid "Your names" -msgstr "Evgeniy Alekseev" +msgid "Bgcolor" +msgstr "Цвет фона" -msgctxt "EMAIL OF TRANSLATORS" -msgid "Your emails" -msgstr "esalexeev@gmail.com" +msgid "Import" +msgstr "Импорт" -#~ msgid "Edit scripts" -#~ msgstr "Редактировать скрипты" +msgid "Import plasmoid settings" +msgstr "Импорт настроек плазмоида" -#~ msgid "Edit tickers" -#~ msgstr "Редактировать тикеры" +msgid "Import extensions" +msgstr "Импорт расширений" -#~ msgid "Edit command" -#~ msgstr "Редактировать команду" - -#~ msgid "Edit weather" -#~ msgstr "Редактировать погоду" - -#~ msgid "Use image for active" -#~ msgstr "Использовать изображения для активной части" - -#~ msgid "Active color" -#~ msgstr "Активный цвет" - -#~ msgid "Use image for inactive" -#~ msgstr "Использовать изображение для неактивной части" - -#~ msgid "Inactive color" -#~ msgstr "Неактивный цвет" - -#~ msgid "Add lambda" -#~ msgstr "Добавить лямбду" - -#~ msgid "Free space on %1 less than 10%" -#~ msgstr "Свободное место на диске %1 меньше 10%" - -#~ msgid "Top Edge" -#~ msgstr "Верхняя грань" - -#~ msgid "Bottom Edge" -#~ msgstr "Нижняя грань" - -#~ msgid "Left Edge" -#~ msgstr "Левая грань" - -#~ msgid "Right Edge" -#~ msgstr "Правая грань" - -#~ msgid "Unknown location (%1)" -#~ msgstr "Неизвестное положение (%1)" - -#~ msgid "Ticker: %1" -#~ msgstr "Тикер: %1" - -#~ msgid "Exec: %1" -#~ msgstr "Команда: %1" - -#~ msgid "Run ksysguard" -#~ msgstr "Запустить ksysguard" - -#~ msgid "Update text" -#~ msgstr "Обновить текст" - -#~ msgid "Check for updates" -#~ msgstr "Проверить обновления" - -#~ msgid "Enable popup on mouse click" -#~ msgstr "Включить сообщения по клику мыши" - -#~ msgid "" -#~ "$dddd - long weekday\n" -#~ "$ddd - short weekday\n" -#~ "$dd - day\n" -#~ "$d - day w\\o zero\n" -#~ "$MMMM - long month\n" -#~ "$MMM - short month\n" -#~ "$MM - month\n" -#~ "$M - month w\\o zero\n" -#~ "$yyyy - year\n" -#~ "$yy - short year\n" -#~ "$hh - hours (24 only)\n" -#~ "$h - hours w\\o zero (24 only)\n" -#~ "$mm - minutes\n" -#~ "$m - minutes w\\o zero\n" -#~ "$ss - seconds\n" -#~ "$s - seconds w\\o zero" -#~ msgstr "" -#~ "$dddd - день недели (длинный)\n" -#~ "$ddd - день недели (короткий)\n" -#~ "$dd - день\n" -#~ "$d - день без 0\n" -#~ "$MMMM - месяц (длинный)\n" -#~ "$MMM - месяц (короткий)\n" -#~ "$MM - месяц\n" -#~ "$M - месяц без 0\n" -#~ "$yyyy - год\n" -#~ "$yy - год (короткий)\n" -#~ "$hh - часы (24)\n" -#~ "$h - часы без 0 (24)\n" -#~ "$mm - минуты\n" -#~ "$m - минуты без 0\n" -#~ "$ss - секунды\n" -#~ "$s - секунды без 0" - -#~ msgid "" -#~ "$dd - uptime days\n" -#~ "$d - uptime days without zero\n" -#~ "$hh - uptime hours\n" -#~ "$h - uptime hours without zero\n" -#~ "$mm - uptime minutes\n" -#~ "$m - uptime minutes without zero" -#~ msgstr "" -#~ "$dd - дни аптайма\n" -#~ "$d - дни аптайма без нулей\n" -#~ "$hh - часы аптайма\n" -#~ "$h - часы аптайма без нулей\n" -#~ "$mm - минуты аптайма\n" -#~ "$m - минуты аптайма без нулей" - -#~ msgid "Temperature devices" -#~ msgstr "Температурные устройства" - -#~ msgid "Editable" -#~ msgstr "Редактируемо" - -#~ msgid "Fan devices" -#~ msgstr "Кулеры" - -#~ msgid "Mount points" -#~ msgstr "Точки монтирования" - -#~ msgid "HDD devices (speed)" -#~ msgstr "HDD (скорость)" - -#~ msgid "HDD devices (temp)" -#~ msgstr "HDD (температура)" - -#~ msgid "Disable auto select device and set specified device" -#~ msgstr "Отключить автовыбор устройства и использовать указанное" - -#~ msgid "Set network device" -#~ msgstr "Выберете сетевое устройство" - -#~ msgid "Line, which returns when AC is online" -#~ msgstr "Строка, возвращаемая при подключенном адаптере питания" - -#~ msgid "Line, which returns when AC is offline" -#~ msgstr "Строка, возвращаемая при отключенном адаптере питания" - -#~ msgid "\"/sys/class/power_supply/\" by default" -#~ msgstr "\"/sys/class/power_supply/\" по умолчанию" - -#~ msgid "NOTE: Player DBus interface should be an active" -#~ msgstr "ВНИМАНИЕ: DBus интерфейс плеера должен быть активен" - -#~ msgid "Configuration" -#~ msgstr "Настройка" - -#~ msgid "Ctrl+B" -#~ msgstr "Ctrl+B" - -#~ msgid "Ctrl+I" -#~ msgstr "Ctrl+I" - -#~ msgid "Ctrl+U" -#~ msgstr "Ctrl+U" - -#~ msgid "Null lines" -#~ msgstr "Число пустых линий" - -#~ msgid "Desktop check cmd" -#~ msgstr "Команда для проверки рабочего стола" - -#~ msgid "Battery device" -#~ msgstr "Устройство батареи" - -#~ msgid "\"/sys/class/power_supply/BAT0/capacity\" by default" -#~ msgstr "\"/sys/class/power_supply/BAT0/capacity\" по умолчанию" - -#~ msgid "Add stretch to left/top of the layout" -#~ msgstr "Добавить пустое место слева/вверху виджета" - -#~ msgid "Add stretch to right/bottom of the layout" -#~ msgstr "Добавить пустое место справа/внизу виджета" - -#~ msgid "Appearance configuration" -#~ msgstr "Настройка внешнего вида" - -#~ msgid "Widget configuration" -#~ msgstr "Настройка виджета" - -#~ msgid "\"/sys/class/net\" by default" -#~ msgstr "\"/sys/class/net\" по умолчанию" - -#~ msgid "Custom command to run" -#~ msgstr "Своя команда для запуска" - -#~ msgid "" -#~ "$time - time in default format\n" -#~ "$isotime - time in ISO format\n" -#~ "$shorttime - time in short format\n" -#~ "$longtime - time in log format\n" -#~ "$custom - custom time format" -#~ msgstr "" -#~ "$time - время в стандартном формате\n" -#~ "$isotime - время в ISO формате\n" -#~ "$shorttime - время в коротком формате\n" -#~ "$longtime - время в длинном формате\n" -#~ "$custom - свой формат времени" - -#~ msgid "Uptime" -#~ msgstr "Время работы" - -#~ msgid "" -#~ "$uptime - system uptime\n" -#~ "$custom - custom format" -#~ msgstr "" -#~ "$uptime - время работы\n" -#~ "$custom - свой формат" - -#~ msgid "" -#~ "$cpu - total load CPU, %\n" -#~ "$cpu0 - load CPU for core 0, %\n" -#~ "...\n" -#~ "$cpu9 - load CPU for core 9, %\n" -#~ "...\n" -#~ "$cpuN - load CPU for core N, %" -#~ msgstr "" -#~ "$cpu - общая загрузка CPU, %\n" -#~ "$cpu0 - загрузка CPU для ядра 0, %\n" -#~ "...\n" -#~ "$cpu9 - загрузка CPU для ядра 9, %\n" -#~ "...\n" -#~ "$cpuN - загрузка CPU для ядра N, %" - -#~ msgid "" -#~ "$cpucl - average CPU clock, MHz\n" -#~ "$cpucl0 - CPU clock for core 0, MHz\n" -#~ "...\n" -#~ "$cpucl9 - CPU clock for core 9, MHz\n" -#~ "...\n" -#~ "$cpuclN - CPU clock for core N, MHz" -#~ msgstr "" -#~ "$cpucl - средняя частота CPU, MHz\n" -#~ "$cpucl0 - частота CPU для ядра 0, MHz\n" -#~ "...\n" -#~ "$cpucl9 - частота CPU для ядра 9, MHz\n" -#~ "...\n" -#~ "$cpuclN - частота CPU для ядра N, MHz" - -#~ msgid "$tempN - physical temperature on device N (from 0). Example: $temp0" -#~ msgstr "" -#~ "$tempN - физическая температура на устройстве N (от 0). Пример: $temp0" - -#~ msgid "$gpu - gpu usage, %" -#~ msgstr "$gpu - использование GPU, %" - -#~ msgid "GPU Temp" -#~ msgstr "Температура GPU" - -#~ msgid "$gputemp - physical temperature on GPU" -#~ msgstr "$gputemp - физическая температура на GPU" - -#~ msgid "" -#~ "$mem - RAM usage, %\n" -#~ "$memmb - RAM usage, MB\n" -#~ "$memgb - RAM usage, GB\n" -#~ "$memtotmb - total RAM, MB\n" -#~ "$memtotgb - total RAM, GB" -#~ msgstr "" -#~ "$mem - использование RAM, %\n" -#~ "$memmb - использование RAM, MB\n" -#~ "$memgb - использование RAM, GB\n" -#~ "$memtotmb - RAM, MB\n" -#~ "$memtotgb - RAM, GB" - -#~ msgid "" -#~ "$swap - swap usage, %\n" -#~ "$swapmb - swap usage, MB\n" -#~ "$swapgb - swap usage, GB\n" -#~ "$swaptotmb - total swap, MB\n" -#~ "$swaptotgb - total swap, GB" -#~ msgstr "" -#~ "$swap - использование swap, %\n" -#~ "$swapmb - использование swap, MB\n" -#~ "$swapgb - использование swap, GB\n" -#~ "$swaptotmb - swap, MB\n" -#~ "$swaptotgb - swap, GB" - -#~ msgid "" -#~ "$hddN - usage for mount point N (from 0), %. Example: $hdd0\n" -#~ "$hddmbN - usage for mount point N (from 0), MB. Example: $hddmb0\n" -#~ "$hddgbN - usage for mount point N (from 0), GB. Example: $hddgb0\n" -#~ "$hddtotmbN - total size of mount point N (from 0), MB. Example: " -#~ "$hddtotmb0\n" -#~ "$hddtotgbN - total size of mount point N (from 0), GB. Example: $hddtotgb0" -#~ msgstr "" -#~ "$hddN - использование точки монтирования N (от 0), %. Пример: $hdd0\n" -#~ "$hddmbN - использование точки монтирования N (от 0), MB. Пример: $hddmb0\n" -#~ "$hddgbN - использование точки монтирования N (от 0), GB. Пример: $hddgb0\n" -#~ "$hddtotmbN - размер точки монтирования N (от 0), MB. Пример: $hddtotmb0\n" -#~ "$hddtotgbN - размер точки монтирования N (от 0), GB. Пример: $hddtotgb0" - -#~ msgid "HDD speed" -#~ msgstr "Скорость HDD" - -#~ msgid "" -#~ "$hddrN - read speed HDD N (from 0), KB/s. Example: $hddr0\n" -#~ "$hddwN - write speed HDD N (from 0), KB/s. Example: $hddw0" -#~ msgstr "" -#~ "$hddrN - скорость записи на HDD N (от 0), KB/s. Например: $hddr0\n" -#~ "$hddwN - скорость чтения с HDD N (от 0), KB/s. Например: $hddw0" - -#~ msgid "HDD temp" -#~ msgstr "Температура HDD" - -#~ msgid "" -#~ "$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0" -#~ msgstr "$hddtempN - температура на устройстве N (от 0). Пример: $hddtemp0" - -#~ msgid "" -#~ "$down - download speed, KB/s\n" -#~ "$up - upload speed, KB/s\n" -#~ "$netdev - current network device" -#~ msgstr "" -#~ "$down - скорость скачки, KB/s\n" -#~ "$up - скорость загрузки, KB/s\n" -#~ "$netdev - текущее устройство" - -#~ msgid "" -#~ "$bat - battery charge, %\n" -#~ "$ac - AC status" -#~ msgstr "" -#~ "$bat - заряд батареи, %\n" -#~ "$ac - статус адаптера питания" - -#~ msgid "" -#~ "$album - song album\n" -#~ "$artist - song artist\n" -#~ "$progress - song progress\n" -#~ "$time - song duration\n" -#~ "$title - song title" -#~ msgstr "" -#~ "$album - альбом\n" -#~ "$artist - исполнитель\n" -#~ "$progress - прогресс\n" -#~ "$time - продолжительность\n" -#~ "$title - название" - -#~ msgid "Processes" -#~ msgstr "Процессы" - -#~ msgid "" -#~ "$pscount - number of running processes\n" -#~ "$pstotal - total number of running processes\n" -#~ "$ps - list of running processes comma separated" -#~ msgstr "" -#~ "$pscount - число запущенных процессов\n" -#~ "$pstotal - общее число процессов\n" -#~ "$ps - список запущенных процессов, разделенных запятыми" - -#~ msgid "" -#~ "$pkgcountN - number of packages which are available for updates, command " -#~ "N. For example $pkgcount0" -#~ msgstr "" -#~ "$pkgcountN - число пакетов, которые доступны для обновления, для команды " -#~ "N. Например, $pkgcount0" - -#~ msgid "" -#~ "$customN - get output from custom command N (from N). Example `$custom0`" -#~ msgstr "" -#~ "$customN - получить информацию из своей команды N. Например $custom0" - -#~ msgid "" -#~ "$name - desktop name\n" -#~ "$number - desktop number\n" -#~ "$total - total number of desktops" -#~ msgstr "" -#~ "$name - имя рабочего стола\n" -#~ "$number - номер рабочего стола\n" -#~ "$total - общее число рабочих столов" - -#~ msgid "pacman -Qu" -#~ msgstr "pacman -Qu" - -#~ msgid "apt-show-versions -u -b" -#~ msgstr "apt-show-versions -u -b" - -#~ msgid "aptitude search '~U'" -#~ msgstr "aptitude search '~U'" - -#~ msgid "yum list updates" -#~ msgstr "yum list updates" - -#~ msgid "pkg_version -I -l '<'" -#~ msgstr "pkg_version -I -l '<'" - -#~ msgid "urpmq --auto-select" -#~ msgstr "urpmq --auto-select" - -#~ msgid "amarok" -#~ msgstr "amarok" - -#~ msgid "mpd" -#~ msgstr "mpd" - -#~ msgid "qmmp" -#~ msgstr "qmmp" - -#~ msgid "auto" -#~ msgstr "auto" - -#~ msgid "nvidia" -#~ msgstr "nvidia" - -#~ msgid "ati" -#~ msgstr "ati" - -#~ msgid "$hddN - usage for mount point N (from 0), %. Example: $hdd0" -#~ msgstr "$hddN - использование точки монтирования N (от 0), %. Пример: $hdd0" - -#~ msgid "" -#~ "$ds - uptime days\n" -#~ "$hs - uptime hours\n" -#~ "$ms - uptime minutes" -#~ msgstr "" -#~ "$ds - дни работы\n" -#~ "$hs - часы\n" -#~ "$ms - минуты" - -#~ msgid "" -#~ "Command to run, example:\n" -#~ "wget -qO- http://ifconfig.me/ip - get external IP" -#~ msgstr "" -#~ "Команда для запуска, например:\n" -#~ "wget -qO- http://ifconfig.me/ip - получить внешний IP" - -#~ msgid "@@/;@@ - mount point usage, %" -#~ msgstr "@@/;@@ - использование точки монтирования, %" - -#~ msgid "@@/dev/sda@@ - physical temperature on /dev/sda" -#~ msgstr "@@/dev/sda@@ - физическая температура /dev/sda" - -#~ msgid "" -#~ "$net - network speed, down/up, KB/s\n" -#~ "$netdev - current network device\n" -#~ "@@eth0@@ - disable auto select device and set specified device" -#~ msgstr "" -#~ "$net - скорость передачи данных, down/up, KB/s\n" -#~ "$netdev - используемое устройство\n" -#~ "@@eth0@@ - отключить автовыбор устройства и установить указанное" +msgid "Import additional files" +msgstr "Импорт дополнительных файлов" diff --git a/sources/translations/si.po b/sources/translations/si.po new file mode 100644 index 0000000..87108b6 --- /dev/null +++ b/sources/translations/si.po @@ -0,0 +1,768 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: Awesome widgets\n" +"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" +"POT-Creation-Date: 2017-07-13 17:39+0300\n" +"PO-Revision-Date: 2017-05-15 17:44+0000\n" +"Last-Translator: Evgeniy Alekseev \n" +"Language-Team: Sinhala (http://www.transifex.com/arcanis/awesome-widgets/" +"language/si/)\n" +"Language: si\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Version %1 (build date %2)" +msgstr "" + +msgid "A set of minimalistic plasmoid widgets" +msgstr "" + +msgid "Links:" +msgstr "" + +msgid "Homepage" +msgstr "" + +msgid "Repository" +msgstr "" + +msgid "Bugtracker" +msgstr "" + +msgid "Translation issue" +msgstr "" + +msgid "AUR packages" +msgstr "" + +msgid "openSUSE packages" +msgstr "" + +msgid "This software is licensed under %1" +msgstr "" + +msgid "Translators:" +msgstr "" + +msgid "This software uses:" +msgstr "" + +msgid "Special thanks to:" +msgstr "" + +msgid "Widget" +msgstr "" + +msgid "Advanced" +msgstr "" + +msgid "Tooltip" +msgstr "" + +msgid "Appearance" +msgstr "" + +msgid "DataEngine" +msgstr "" + +msgid "About" +msgstr "" + +msgid "Enable background" +msgstr "" + +msgid "Translate strings" +msgstr "" + +msgid "Wrap new lines" +msgstr "" + +msgid "Enable word wrap" +msgstr "" + +msgid "Enable notifications" +msgstr "" + +msgid "Check updates on startup" +msgstr "" + +msgid "Optimize subscription" +msgstr "" + +msgid "Widget height, px" +msgstr "" + +msgid "Widget width, px" +msgstr "" + +msgid "Time interval" +msgstr "" + +msgid "Messages queue limit" +msgstr "" + +msgid "Celsius" +msgstr "" + +msgid "Fahrenheit" +msgstr "" + +msgid "Kelvin" +msgstr "" + +msgid "Reaumur" +msgstr "" + +msgid "cm^-1" +msgstr "" + +msgid "kJ/mol" +msgstr "" + +msgid "kcal/mol" +msgstr "" + +msgid "Temperature units" +msgstr "" + +msgid "Custom time format" +msgstr "" + +msgid "Custom uptime format" +msgstr "" + +msgid "AC online tag" +msgstr "" + +msgid "AC offline tag" +msgstr "" + +msgid "Actions" +msgstr "" + +msgid "Drop key cache" +msgstr "" + +msgid "Export configuration" +msgstr "" + +msgid "Import configuration" +msgstr "" + +msgid "Telemetry" +msgstr "" + +msgid "Enable remote telemetry" +msgstr "" + +msgid "History count" +msgstr "" + +msgid "Telemetry ID" +msgstr "" + +msgid "Font" +msgstr "" + +msgid "Font size" +msgstr "" + +msgid "Font weight" +msgstr "" + +msgid "Font style" +msgstr "" + +msgid "Font color" +msgstr "" + +msgid "Style" +msgstr "" + +msgid "Style color" +msgstr "" + +msgid "ACPI" +msgstr "" + +msgid "ACPI path" +msgstr "" + +msgid "GPU" +msgstr "" + +msgid "GPU device" +msgstr "" + +msgid "HDD temperature" +msgstr "" + +msgid "HDD" +msgstr "" + +msgid "hddtemp cmd" +msgstr "" + +msgid "Player" +msgstr "" + +msgid "Player data symbols" +msgstr "" + +msgid "Music player" +msgstr "" + +msgid "MPRIS player name" +msgstr "" + +msgid "MPD address" +msgstr "" + +msgid "MPD port" +msgstr "" + +msgid "Extensions" +msgstr "" + +msgid "Custom scripts" +msgstr "" + +msgid "Network requests" +msgstr "" + +msgid "Package manager" +msgstr "" + +msgid "Quotes monitor" +msgstr "" + +msgid "Weather" +msgstr "" + +msgid "Select tag" +msgstr "" + +msgid "Tag: %1" +msgstr "" + +msgid "Value: %1" +msgstr "" + +msgid "Info: %1" +msgstr "" + +msgid "Request key" +msgstr "" + +msgid "Show README" +msgstr "" + +msgid "Check updates" +msgstr "" + +msgid "Report bug" +msgstr "" + +msgid "" +"CPU, CPU clock, memory, swap and network labels support graphical tooltip. " +"To enable them just make needed checkbox checked." +msgstr "" + +msgid "Number of values for tooltips" +msgstr "" + +msgid "Background" +msgstr "" + +msgid "Background color" +msgstr "" + +msgid "CPU" +msgstr "" + +msgid "CPU color" +msgstr "" + +msgid "CPU clock" +msgstr "" + +msgid "CPU clock color" +msgstr "" + +msgid "Memory" +msgstr "" + +msgid "Memory color" +msgstr "" + +msgid "Swap" +msgstr "" + +msgid "Swap color" +msgstr "" + +msgid "Network" +msgstr "" + +msgid "Download speed color" +msgstr "" + +msgid "Upload speed color" +msgstr "" + +msgid "Battery" +msgstr "" + +msgid "Battery active color" +msgstr "" + +msgid "Battery inactive color" +msgstr "" + +msgid "Edit" +msgstr "" + +msgid "Run %1" +msgstr "" + +msgid "Not supported" +msgstr "" + +msgid "You are using mammoth's Qt version, try to update it first" +msgstr "" + +msgid "Select font" +msgstr "" + +msgid "Issue created" +msgstr "" + +msgid "Issue %1 has been created" +msgstr "" + +msgid "AC online" +msgstr "" + +msgid "AC offline" +msgstr "" + +msgid "High CPU load" +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 "" + +msgid "Select type" +msgstr "" + +msgid "Type:" +msgstr "" + +msgid "MB/s" +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 "" + +msgid "Create" +msgstr "" + +msgid "Remove" +msgstr "" + +msgid "Enter file name" +msgstr "" + +msgid "File name" +msgstr "" + +msgid "Name: %1" +msgstr "" + +msgid "Comment: %1" +msgstr "" + +msgid "Identity: %1" +msgstr "" + +msgid "Name" +msgstr "" + +msgid "Comment" +msgstr "" + +msgid "Type" +msgstr "" + +msgid "Format" +msgstr "" + +msgid "Precision" +msgstr "" + +msgid "Width" +msgstr "" + +msgid "Fill char" +msgstr "" + +msgid "Force width" +msgstr "" + +msgid "Multiplier" +msgstr "" + +msgid "Summand" +msgstr "" + +msgid "Path" +msgstr "" + +msgid "Filter" +msgstr "" + +msgid "Separator" +msgstr "" + +msgid "Sort" +msgstr "" + +msgid "Append code" +msgstr "" + +msgid "Has return" +msgstr "" + +msgid "Code" +msgstr "" + +msgid "Tag" +msgstr "" + +msgid "URL" +msgstr "" + +msgid "Active" +msgstr "" + +msgid "Schedule" +msgstr "" + +msgid "Socket" +msgstr "" + +msgid "Interval" +msgstr "" + +msgid "" +"

Use YAHOO! finance ticker to get quotes for the " +"instrument. Refer to http://finance.yahoo.com/

" +msgstr "" + +msgid "Ticker" +msgstr "" + +msgid "Command" +msgstr "" + +msgid "Prefix" +msgstr "" + +msgid "Redirect" +msgstr "" + +msgid "Additional filters" +msgstr "" + +msgid "Wrap colors" +msgstr "" + +msgid "Wrap spaces" +msgstr "" + +msgid "Null" +msgstr "" + +msgid "Provider" +msgstr "" + +msgid "City" +msgstr "" + +msgid "Country" +msgstr "" + +msgid "Timestamp" +msgstr "" + +msgid "Use images" +msgstr "" + +msgid "Select color" +msgstr "" + +msgid "Select path" +msgstr "" + +msgid "Images (*.png *.bpm *.jpg);;All files (*.*)" +msgstr "" + +msgid "Use custom formula" +msgstr "" + +msgid "Value" +msgstr "" + +msgid "Max value" +msgstr "" + +msgid "Min value" +msgstr "" + +msgid "Active filling type" +msgstr "" + +msgid "Inctive filling type" +msgstr "" + +msgid "Points count" +msgstr "" + +msgid "Direction" +msgstr "" + +msgid "Height" +msgstr "" + +msgid "color" +msgstr "" + +msgid "image" +msgstr "" + +msgid "Active desktop" +msgstr "" + +msgid "Inactive desktop" +msgstr "" + +msgid "Vertical layout" +msgstr "" + +msgid "Mark" +msgstr "" + +msgid "contours" +msgstr "" + +msgid "windows" +msgstr "" + +msgid "clean desktop" +msgstr "" + +msgid "names" +msgstr "" + +msgid "none" +msgstr "" + +msgid "Tooltip type" +msgstr "" + +msgid "Tooltip width" +msgstr "" + +msgid "Edit bars" +msgstr "" + +msgid "Formatters" +msgstr "" + +msgid "User keys" +msgstr "" + +msgid "Preview" +msgstr "" + +msgid "" +"Detailed information may be found on project homepage" +msgstr "" + +msgid "Add" +msgstr "" + +msgid "Show value" +msgstr "" + +msgid "Acknowledgment" +msgstr "" + +msgid "Report a bug" +msgstr "" + +msgid "Report subject" +msgstr "" + +msgid "Description" +msgstr "" + +msgid "Steps to reproduce" +msgstr "" + +msgid "Expected result" +msgstr "" + +msgid "Logs" +msgstr "" + +msgid "Use command" +msgstr "" + +msgid "Load log file" +msgstr "" + +msgid "Open log file" +msgstr "" + +msgid "Select a color" +msgstr "" + +msgid "Export" +msgstr "" + +msgid "Success" +msgstr "" + +msgid "Please note that binary files were not copied" +msgstr "" + +msgid "Ooops..." +msgstr "" + +msgid "Could not save configuration file" +msgstr "" + +msgid "Select a font" +msgstr "" + +msgid "AC" +msgstr "" + +msgid "Bars" +msgstr "" + +msgid "Desktops" +msgstr "" + +msgid "Network request" +msgstr "" + +msgid "Scripts" +msgstr "" + +msgid "Time" +msgstr "" + +msgid "Quotes" +msgstr "" + +msgid "Upgrades" +msgstr "" + +msgid "Weathers" +msgstr "" + +msgid "Functions" +msgstr "" + +msgid "User defined" +msgstr "" + +msgid "All" +msgstr "" + +msgid "normal" +msgstr "" + +msgid "italic" +msgstr "" + +msgid "light" +msgstr "" + +msgid "demi bold" +msgstr "" + +msgid "bold" +msgstr "" + +msgid "black" +msgstr "" + +msgid "outline" +msgstr "" + +msgid "raised" +msgstr "" + +msgid "sunken" +msgstr "" + +msgid "Bgcolor" +msgstr "" + +msgid "Import" +msgstr "" + +msgid "Import plasmoid settings" +msgstr "" + +msgid "Import extensions" +msgstr "" + +msgid "Import additional files" +msgstr "" diff --git a/sources/translations/uk.po b/sources/translations/uk.po index 8a09247..204f411 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: 2017-05-05 18:15+0300\n" +"POT-Creation-Date: 2017-07-13 17:39+0300\n" "PO-Revision-Date: 2016-08-09 22:22+0300\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: Ukrainian \n" @@ -339,6 +339,9 @@ msgstr "Колір батареї, що заряджається" msgid "Battery inactive color" msgstr "Колір батарєї, що розряджається" +msgid "Edit" +msgstr "Редагувати" + msgid "Run %1" msgstr "Запуск %1" @@ -378,9 +381,6 @@ msgstr "Високе завантаження GPU" msgid "Network device has been changed to %1" msgstr "Мережевий пристрій було змінено на %1" -msgid "Edit" -msgstr "Редагувати" - msgid "Select type" msgstr "Оберіть тип" @@ -639,6 +639,9 @@ msgstr "Редагувати бари" msgid "Formatters" msgstr "Форматери" +msgid "User keys" +msgstr "" + msgid "Preview" msgstr "Попередній перегляд" @@ -708,21 +711,6 @@ msgstr "Не можу зберегти файл налаштувань" msgid "Select a font" msgstr "Оберіть шрифт" -msgid "Bgcolor" -msgstr "Колір фону" - -msgid "Import" -msgstr "Імпорт" - -msgid "Import plasmoid settings" -msgstr "Імпорт налаштувань плазмоїда" - -msgid "Import extensions" -msgstr "Імпорт розширень" - -msgid "Import additional files" -msgstr "Імпорт додаткових файлів" - msgid "AC" msgstr "Адаптер живлення" @@ -732,6 +720,10 @@ msgstr "Бари" msgid "Desktops" msgstr "Робочі столи" +#, fuzzy +msgid "Network request" +msgstr "Шлях до інтерфейсів" + msgid "Scripts" msgstr "Скрипти" @@ -750,6 +742,9 @@ msgstr "Погода" msgid "Functions" msgstr "Функції" +msgid "User defined" +msgstr "" + msgid "All" msgstr "" @@ -781,361 +776,17 @@ msgstr "" msgid "sunken" msgstr "" -msgctxt "NAME OF TRANSLATORS" -msgid "Your names" -msgstr "Slobodyan Victor" +msgid "Bgcolor" +msgstr "Колір фону" -msgctxt "EMAIL OF TRANSLATORS" -msgid "Your emails" -msgstr "sarumyan@i.ua" +msgid "Import" +msgstr "Імпорт" -#~ msgid "Edit scripts" -#~ msgstr "Редагувати скрипти" +msgid "Import plasmoid settings" +msgstr "Імпорт налаштувань плазмоїда" -#~ msgid "Edit tickers" -#~ msgstr "Редагувати тікети" +msgid "Import extensions" +msgstr "Імпорт розширень" -#~ msgid "Edit command" -#~ msgstr "Редагувати команду" - -#~ msgid "Edit weather" -#~ msgstr "Редагувати погоду" - -#, fuzzy -#~ msgid "Use image for active" -#~ msgstr "Використовувати зображення" - -#, fuzzy -#~ msgid "Active color" -#~ msgstr "Активний колір" - -#, fuzzy -#~ msgid "Inactive color" -#~ msgstr "Неактивний колір" - -#~ msgid "Add lambda" -#~ msgstr "Додати лямбду" - -#~ msgid "Free space on %1 less than 10%" -#~ msgstr "Вільний простір на диску %1 меньше ніж 10%" - -#~ msgid "Top Edge" -#~ msgstr "Верхній край" - -#~ msgid "Bottom Edge" -#~ msgstr "Нижній край" - -#~ msgid "Left Edge" -#~ msgstr "Лівий край" - -#~ msgid "Right Edge" -#~ msgstr "Правий край" - -#~ msgid "Unknown location (%1)" -#~ msgstr "Невідоме положення (%1)" - -#~ msgid "Exec: %1" -#~ msgstr "Команда: %1" - -#~ msgid "Run ksysguard" -#~ msgstr "Запустити ksysguard" - -#~ msgid "Update text" -#~ msgstr "Оновити текст" - -#~ msgid "Check for updates" -#~ msgstr "Шукати оновлення" - -#~ msgid "Enable popup on mouse click" -#~ msgstr "Включити спливаючі підказки при натисканні клавіші миші" - -#~ msgid "" -#~ "$dddd - long weekday\n" -#~ "$ddd - short weekday\n" -#~ "$dd - day\n" -#~ "$d - day w\\o zero\n" -#~ "$MMMM - long month\n" -#~ "$MMM - short month\n" -#~ "$MM - month\n" -#~ "$M - month w\\o zero\n" -#~ "$yyyy - year\n" -#~ "$yy - short year\n" -#~ "$hh - hours (24 only)\n" -#~ "$h - hours w\\o zero (24 only)\n" -#~ "$mm - minutes\n" -#~ "$m - minutes w\\o zero\n" -#~ "$ss - seconds\n" -#~ "$s - seconds w\\o zero" -#~ msgstr "" -#~ "$dddd - день тижня (довгий)\n" -#~ "$ddd - день тижня (короткий)\n" -#~ "$dd - день\n" -#~ "$d - день без нулів\n" -#~ "$MMMM - місяць (довгий)\n" -#~ "$MMM - місяць (короткий)\n" -#~ "$MM - місяць\n" -#~ "$M - місяць без нулів\n" -#~ "$yyyy - рік\n" -#~ "$yy - рук (короткий)\n" -#~ "$hh - години (24)\n" -#~ "$h - години без нулів (24)\n" -#~ "$mm - хвилини\n" -#~ "$m - хвилини без нулів\n" -#~ "$ss - секунди\n" -#~ "$s - секунди без нулів" - -#~ msgid "" -#~ "$dd - uptime days\n" -#~ "$d - uptime days without zero\n" -#~ "$hh - uptime hours\n" -#~ "$h - uptime hours without zero\n" -#~ "$mm - uptime minutes\n" -#~ "$m - uptime minutes without zero" -#~ msgstr "" -#~ "$dd - дні аптайму\n" -#~ "$d - дні аптайму без нулів\n" -#~ "$hh - години аптайму\n" -#~ "$h - години аптайму без нулів\n" -#~ "$mm - хвилини аптайму\n" -#~ "$m - хвилини аптайму без нулів" - -#~ msgid "Temperature devices" -#~ msgstr "Температурні пристрої" - -#~ msgid "Editable" -#~ msgstr "Можна редагувати" - -#, fuzzy -#~ msgid "Fan devices" -#~ msgstr "Кулери" - -#~ msgid "Mount points" -#~ msgstr "Точки монтування" - -#~ msgid "HDD devices (speed)" -#~ msgstr "HDD (швидкість)" - -#~ msgid "HDD devices (temp)" -#~ msgstr "HDD (температура)" - -#~ msgid "Disable auto select device and set specified device" -#~ msgstr "Відключити автоматичний вибір пристрою та використовувати вказаний" - -#~ msgid "Set network device" -#~ msgstr "Оберіть мережевий пристрій" - -#~ msgid "Line, which returns when AC is online" -#~ msgstr "Рядок, що повертається при підключеному адаптері живлення" - -#~ msgid "Line, which returns when AC is offline" -#~ msgstr "Рядок, що повертається при відключеному адаптері живлення" - -#, fuzzy -#~ msgid "\"/sys/class/power_supply/\" by default" -#~ msgstr "\"/sys/class/power_supply/\" за замовчуванням" - -#~ msgid "NOTE: Player DBus interface should be an active" -#~ msgstr "УВАГА: DBus інтерфейс плеєра має бути активним" - -#~ msgid "Ctrl+B" -#~ msgstr "Ctrl+B" - -#~ msgid "Ctrl+I" -#~ msgstr "Ctrl+I" - -#~ msgid "Ctrl+U" -#~ msgstr "Ctrl+U" - -#~ msgid "Null lines" -#~ msgstr "Кількість пустих рядків" - -#~ msgid "Battery device" -#~ msgstr "Пристрій батареї" - -#~ msgid "\"/sys/class/power_supply/BAT0/capacity\" by default" -#~ msgstr "\"/sys/class/power_supply/BAT0/capacity\" за замовчуванням" - -#~ msgid "Add stretch to left/top of the layout" -#~ msgstr "Додати порожнє місце ліворуч/вгорі віджету" - -#~ msgid "Add stretch to right/bottom of the layout" -#~ msgstr "Додати порожнє місце праворуч/внизу віджету" - -#~ msgid "\"/sys/class/net\" by default" -#~ msgstr "\"/sys/class/net\" за замовчуванням" - -#~ msgid "Custom command to run" -#~ msgstr "Виконання своєї команди" - -#~ msgid "" -#~ "$time - time in default format\n" -#~ "$isotime - time in ISO format\n" -#~ "$shorttime - time in short format\n" -#~ "$longtime - time in log format\n" -#~ "$custom - custom time format" -#~ msgstr "" -#~ "$time - час у стандартному форматі\n" -#~ "$isotime - час у форматі ISO\n" -#~ "$shorttime - час в короткому форматі\n" -#~ "$longtime - час у довгому форматі\n" -#~ "$custom - свій формат часу" - -#~ msgid "Uptime" -#~ msgstr "Час роботи" - -#~ msgid "" -#~ "$uptime - system uptime\n" -#~ "$custom - custom format" -#~ msgstr "" -#~ "$uptime - час роботи\n" -#~ "$custom - свій формат" - -#~ msgid "" -#~ "$cpu - total load CPU, %\n" -#~ "$cpu0 - load CPU for core 0, %\n" -#~ "...\n" -#~ "$cpu9 - load CPU for core 9, %\n" -#~ "...\n" -#~ "$cpuN - load CPU for core N, %" -#~ msgstr "" -#~ "$cpu - загальне завантаження CPU, %\n" -#~ "$cpu0 - завантаження CPU для ядра 0, %\n" -#~ "...\n" -#~ "$cpu9 - завантаження CPU для ядра 9, %\n" -#~ "...\n" -#~ "$cpuN - завантаження CPU для ядра N, %" - -#~ msgid "" -#~ "$cpucl - average CPU clock, MHz\n" -#~ "$cpucl0 - CPU clock for core 0, MHz\n" -#~ "...\n" -#~ "$cpucl9 - CPU clock for core 9, MHz\n" -#~ "...\n" -#~ "$cpuclN - CPU clock for core N, MHz" -#~ msgstr "" -#~ "$cpucl - середня частота CPU, MHz\n" -#~ "$cpucl0 - частота CPU для ядра 0, MHz\n" -#~ "...\n" -#~ "$cpucl9 - частота CPU для ядра 9, MHz\n" -#~ "...\n" -#~ "$cpuclN - частота CPU для ядра N, MHz" - -#~ msgid "$tempN - physical temperature on device N (from 0). Example: $temp0" -#~ msgstr "$tempN - фізична температура на пристрої N (від 0). Приклад: $temp0" - -#~ msgid "$gpu - gpu usage, %" -#~ msgstr "$gpu - використання gpu, %" - -#~ msgid "GPU Temp" -#~ msgstr "Температура GPU" - -#~ msgid "$gputemp - physical temperature on GPU" -#~ msgstr "$gputemp - фізична температура на GPU" - -#~ msgid "" -#~ "$mem - RAM usage, %\n" -#~ "$memmb - RAM usage, MB\n" -#~ "$memgb - RAM usage, GB\n" -#~ "$memtotmb - total RAM, MB\n" -#~ "$memtotgb - total RAM, GB" -#~ msgstr "" -#~ "$mem - використання RAM, %\n" -#~ "$memmb - використання RAM, MB\n" -#~ "$memgb - використання RAM, GB" - -#~ msgid "" -#~ "$swap - swap usage, %\n" -#~ "$swapmb - swap usage, MB\n" -#~ "$swapgb - swap usage, GB\n" -#~ "$swaptotmb - total swap, MB\n" -#~ "$swaptotgb - total swap, GB" -#~ msgstr "" -#~ "$swap - використання swap, %\n" -#~ "$swapmb - використання swap, MB\n" -#~ "$swapgb - використання swap, GB$swaptotmb - swap, MB\n" -#~ "$swaptotgb - swap, GB" - -#~ msgid "" -#~ "$hddN - usage for mount point N (from 0), %. Example: $hdd0\n" -#~ "$hddmbN - usage for mount point N (from 0), MB. Example: $hddmb0\n" -#~ "$hddgbN - usage for mount point N (from 0), GB. Example: $hddgb0\n" -#~ "$hddtotmbN - total size of mount point N (from 0), MB. Example: " -#~ "$hddtotmb0\n" -#~ "$hddtotgbN - total size of mount point N (from 0), GB. Example: $hddtotgb0" -#~ msgstr "" -#~ "$hddN - використання точки монтування N (від 0), %. Приклад: $hdd0\n" -#~ "$hddmbN - використання точки монтування N (від 0), MB. Приклад: $hddmb0\n" -#~ "$hddgbN - використання точки монтування N (від 0), GB. Приклад: $hddgb0\n" -#~ "$hddtotmbN - розмір точки монтування N (від 0), MB. Приклад: $hddtotmb0\n" -#~ "$hddtotgbN - розмір точки монтування N (від 0), GB. Приклад: $hddtotgb0" - -#~ msgid "HDD speed" -#~ msgstr "Швидкість HDD" - -#~ msgid "" -#~ "$hddrN - read speed HDD N (from 0), KB/s. Example: $hddr0\n" -#~ "$hddwN - write speed HDD N (from 0), KB/s. Example: $hddw0" -#~ msgstr "" -#~ "$hddrN - швидкість читання HDD N (від 0), KB/s. Приклад: $hddr0\n" -#~ "$hddwN - швидкість запису HDD N (від 0), KB/s. Приклад: $hddw0" - -#~ msgid "HDD temp" -#~ msgstr "Температура HDD" - -#~ msgid "" -#~ "$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0" -#~ msgstr "" -#~ "$hddtempN - фізична температура на пристрої N (від 0). Приклад: $hddtemp" - -#~ msgid "" -#~ "$down - download speed, KB/s\n" -#~ "$up - upload speed, KB/s\n" -#~ "$netdev - current network device" -#~ msgstr "" -#~ "$down - швидкість скачування, KB/s\n" -#~ "$up - швидкість віддачі, KB/s\n" -#~ "$netdev - поточний мережевий пристрій" - -#~ msgid "" -#~ "$bat - battery charge, %\n" -#~ "$ac - AC status" -#~ msgstr "" -#~ "$bat - заряд батареї, %\n" -#~ "$ac - статус адаптера живлення" - -#~ msgid "" -#~ "$album - song album\n" -#~ "$artist - song artist\n" -#~ "$progress - song progress\n" -#~ "$time - song duration\n" -#~ "$title - song title" -#~ msgstr "" -#~ "$album - альбом\n" -#~ "$artist - виконавець\n" -#~ "$progress - прогрес\n" -#~ "$time - тривалість\n" -#~ "$title - назва" - -#~ msgid "Processes" -#~ msgstr "Процеси" - -#~ msgid "" -#~ "$pscount - number of running processes\n" -#~ "$pstotal - total number of running processes\n" -#~ "$ps - list of running processes comma separated" -#~ msgstr "" -#~ "$pscount - кількість запущених процесів\n" -#~ "$pstotal - загальна кількість процесів\n" -#~ "$ps - перелік запущених процесів, розділених комами" - -#~ msgid "" -#~ "$pkgcountN - number of packages which are available for updates, command " -#~ "N. For example $pkgcount0" -#~ msgstr "" -#~ "$pkgcountN - кількість пакетів, що доступні для оновлення, для команди N. " -#~ "Наприклад: $pkgcount0" - -#~ msgid "" -#~ "$customN - get output from custom command N (from N). Example `$custom0`" -#~ msgstr "" -#~ "$customN - отримати інформацію зі своєї команди N. Наприклад `$custom0`" +msgid "Import additional files" +msgstr "Імпорт додаткових файлів" diff --git a/sources/translations/zh.po b/sources/translations/zh.po index aa5351b..92dd2ae 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: 2017-05-05 18:15+0300\n" +"POT-Creation-Date: 2017-07-13 17:39+0300\n" "PO-Revision-Date: 2015-07-31 22:24+0300\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: Russian \n" @@ -337,6 +337,10 @@ msgstr "电池使用状态提示颜色" msgid "Battery inactive color" msgstr "电池未使用状态提示颜色" +#, fuzzy +msgid "Edit" +msgstr "可编辑的" + msgid "Run %1" msgstr "运行 %1" @@ -376,10 +380,6 @@ msgstr "高 GPU 使用" msgid "Network device has been changed to %1" msgstr "网络设备变更为 %1" -#, fuzzy -msgid "Edit" -msgstr "可编辑的" - #, fuzzy msgid "Select type" msgstr "选择标签" @@ -651,6 +651,9 @@ msgstr "编辑工具栏" msgid "Formatters" msgstr "" +msgid "User keys" +msgstr "" + msgid "Preview" msgstr "预览" @@ -721,22 +724,6 @@ msgstr "无法保存配置文件" msgid "Select a font" msgstr "选择字体" -#, fuzzy -msgid "Bgcolor" -msgstr "CPU 颜色" - -msgid "Import" -msgstr "导入" - -msgid "Import plasmoid settings" -msgstr "导入[plasmoid]配置" - -msgid "Import extensions" -msgstr "导入插件" - -msgid "Import additional files" -msgstr "导入其他文件" - msgid "AC" msgstr "电源" @@ -746,6 +733,10 @@ msgstr "工具栏" msgid "Desktops" msgstr "桌面" +#, fuzzy +msgid "Network request" +msgstr "网络" + msgid "Scripts" msgstr "脚本" @@ -764,6 +755,9 @@ msgstr "天气" msgid "Functions" msgstr "" +msgid "User defined" +msgstr "" + msgid "All" msgstr "" @@ -795,163 +789,18 @@ msgstr "" msgid "sunken" msgstr "" -msgctxt "NAME OF TRANSLATORS" -msgid "Your names" -msgstr "用户名" - -msgctxt "EMAIL OF TRANSLATORS" -msgid "Your emails" -msgstr "用户邮箱" - -#~ msgid "Edit scripts" -#~ msgstr "编辑脚本" - -#~ msgid "Edit tickers" -#~ msgstr "编辑股票更新周期" - -#~ msgid "Edit command" -#~ msgstr "编辑命令" - -#~ msgid "Edit weather" -#~ msgstr "编辑天气" - #, fuzzy -#~ msgid "Use image for active" -#~ msgstr "使用图片" +msgid "Bgcolor" +msgstr "CPU 颜色" -#~ msgid "Active color" -#~ msgstr "使用状态提示颜色" +msgid "Import" +msgstr "导入" -#~ msgid "Inactive color" -#~ msgstr "未使用状态提示颜色" +msgid "Import plasmoid settings" +msgstr "导入[plasmoid]配置" -#~ msgid "Add lambda" -#~ msgstr "添加 lambda" +msgid "Import extensions" +msgstr "导入插件" -#~ msgid "Top Edge" -#~ msgstr "顶部边缘" - -#~ msgid "Bottom Edge" -#~ msgstr "底部边缘" - -#~ msgid "Left Edge" -#~ msgstr "左端边缘" - -#, fuzzy -#~ msgid "Right Edge" -#~ msgstr "未知位置(%1)" - -#~ msgid "Run ksysguard" -#~ msgstr "运行任务管理器" - -#~ msgid "Update text" -#~ msgstr "刷新文本" - -#~ msgid "Enable popup on mouse click" -#~ msgstr "鼠标点击时弹出对话框" - -#~ msgid "" -#~ "$dddd - long weekday\n" -#~ "$ddd - short weekday\n" -#~ "$dd - day\n" -#~ "$d - day w\\o zero\n" -#~ "$MMMM - long month\n" -#~ "$MMM - short month\n" -#~ "$MM - month\n" -#~ "$M - month w\\o zero\n" -#~ "$yyyy - year\n" -#~ "$yy - short year\n" -#~ "$hh - hours (24 only)\n" -#~ "$h - hours w\\o zero (24 only)\n" -#~ "$mm - minutes\n" -#~ "$m - minutes w\\o zero\n" -#~ "$ss - seconds\n" -#~ "$s - seconds w\\o zero" -#~ msgstr "" -#~ "$dddd - 详细工作日\n" -#~ "$ddd - 简短工作日\n" -#~ "$dd - 日\n" -#~ "$d - 日 w\\o 零\n" -#~ "$MMMM - 详细月份\n" -#~ "$MMM - 简短月份\n" -#~ "$MM - 月\n" -#~ "$M - 月 w\\o 零\n" -#~ "$yyyy - 年\n" -#~ "$yy - 简短年份\n" -#~ "$hh - 小时 (24 小时制)\n" -#~ "$h - 小时 w\\o 零 (24 小时制)\n" -#~ "$mm - 分\n" -#~ "$m - 分 w\\o 零\n" -#~ "$ss - 秒\n" -#~ "$s - 秒 w\\o 零" - -#~ msgid "" -#~ "$dd - uptime days\n" -#~ "$d - uptime days without zero\n" -#~ "$hh - uptime hours\n" -#~ "$h - uptime hours without zero\n" -#~ "$mm - uptime minutes\n" -#~ "$m - uptime minutes without zero" -#~ msgstr "" -#~ "$dd - 运行天数\n" -#~ "$d - 运行天数(不显示0)\n" -#~ "$hh - 运行小时数\n" -#~ "$h - 运行小时数(不显示0)\n" -#~ "$mm - 运行分钟数\n" -#~ "$m - 运行分钟数(不显示0)" - -#~ msgid "Temperature devices" -#~ msgstr "温度传感器" - -#~ msgid "Editable" -#~ msgstr "可编辑的" - -#, fuzzy -#~ msgid "Fan devices" -#~ msgstr "外界电源设备" - -#~ msgid "Mount points" -#~ msgstr "挂载点" - -#~ msgid "HDD devices (speed)" -#~ msgstr "硬盘(高速)" - -#~ msgid "HDD devices (temp)" -#~ msgstr "硬盘(临时)" - -#~ msgid "Disable auto select device and set specified device" -#~ msgstr "禁用自动选择设备和设置特殊设备" - -#~ msgid "Set network device" -#~ msgstr "设置网络设备" - -#~ msgid "Line, which returns when AC is online" -#~ msgstr "外接电源使用时显示线条" - -#~ msgid "Line, which returns when AC is offline" -#~ msgstr "外接电源未使用时显示线条" - -#, fuzzy -#~ msgid "\"/sys/class/power_supply/\" by default" -#~ msgstr "默认为 \"/sys/class/power_supply/AC/online\"" - -#~ msgid "NOTE: Player DBus interface should be an active" -#~ msgstr "提示: 播放器 DBus 应当处于激活状态" - -#~ msgid "Ctrl+B" -#~ msgstr "Ctrl+B" - -#~ msgid "Ctrl+I" -#~ msgstr "Ctrl+I" - -#~ msgid "Ctrl+U" -#~ msgstr "Ctrl+U" - -#~ msgid "Null lines" -#~ msgstr "空行" - -#~ msgid "Desktop check cmd" -#~ msgstr "检测桌面命令" - -#~ msgid "\"/sys/class/power_supply/BAT0/capacity\" by default" -#~ msgstr "默认为 \"/sys/class/power_supply/BAT0/capacity\"" +msgid "Import additional files" +msgstr "导入其他文件" From d2e6f2fe386ec9844481210b361ab5acb26fb0a4 Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Fri, 14 Jul 2017 03:34:05 +0300 Subject: [PATCH 5/9] some refactoring * massive changes inside includes, drop unused definitions * rewrite some initialization methods to avoid additional freeing/allocation * drop some explicit destructors calls --- .../plugin/awabstractpairconfig.cpp | 1 - sources/awesome-widget/plugin/awactions.cpp | 3 - .../awesome-widget/plugin/awbugreporter.cpp | 2 - .../awesome-widget/plugin/awconfighelper.cpp | 5 ++ .../awesome-widget/plugin/awconfighelper.h | 13 +--- .../plugin/awcustomkeyshelper.h | 1 - .../plugin/awdataaggregator.cpp | 9 --- .../awesome-widget/plugin/awdataaggregator.h | 1 - .../plugin/awdataengineaggregator.cpp | 71 +++++++++---------- .../plugin/awdataengineaggregator.h | 5 +- sources/awesome-widget/plugin/awdbusadaptor.h | 5 +- .../awesome-widget/plugin/awesomewidget.cpp | 5 +- sources/awesome-widget/plugin/awkeycache.cpp | 1 - .../awesome-widget/plugin/awkeyoperations.cpp | 9 --- .../awesome-widget/plugin/awkeyoperations.h | 7 -- sources/awesome-widget/plugin/awkeys.cpp | 25 +------ sources/awesome-widget/plugin/awkeys.h | 3 - .../plugin/awkeysaggregator.cpp | 2 - ...figfactory.cpp => awpairconfigfactory.cpp} | 10 +-- ...rconfigfactory.h => awpairconfigfactory.h} | 12 ++-- .../plugin/awtelemetryhandler.cpp | 2 - .../plugin/awtelemetryhandler.h | 2 - .../awesome-widget/plugin/awupdatehelper.cpp | 2 - sources/awesomewidgets/abstractextitem.cpp | 3 +- .../abstractextitemaggregator.cpp | 1 - .../awesomewidgets/awdatetimeformatter.cpp | 1 - sources/awesomewidgets/awdatetimeformatter.h | 3 +- sources/awesomewidgets/awfloatformatter.cpp | 1 - sources/awesomewidgets/awscriptformatter.cpp | 1 - sources/awesomewidgets/awstringformatter.cpp | 1 - sources/awesomewidgets/extnetworkrequest.cpp | 2 - sources/awesomewidgets/extquotes.cpp | 3 - sources/awesomewidgets/extscript.cpp | 1 - sources/awesomewidgets/extupgrade.cpp | 1 - sources/awesomewidgets/extweather.cpp | 4 -- sources/awesomewidgets/graphicalitem.cpp | 32 ++++----- .../awesomewidgets/graphicalitemhelper.cpp | 1 - sources/awesomewidgets/qcronscheduler.cpp | 1 - sources/desktop-panel/plugin/dpadds.cpp | 2 - sources/extsysmon/extsysmon.cpp | 3 - sources/extsysmonsources/customsource.cpp | 2 - sources/extsysmonsources/quotessource.cpp | 2 - sources/extsysmonsources/requestsource.cpp | 2 - sources/extsysmonsources/upgradesource.cpp | 2 - sources/extsysmonsources/weathersource.cpp | 2 - sources/qml/AWExtensions.qml | 8 +-- sources/test/testawkeys.cpp | 3 - 47 files changed, 79 insertions(+), 199 deletions(-) rename sources/awesome-widget/plugin/{awformatterconfigfactory.cpp => awpairconfigfactory.cpp} (85%) rename sources/awesome-widget/plugin/{awformatterconfigfactory.h => awpairconfigfactory.h} (84%) diff --git a/sources/awesome-widget/plugin/awabstractpairconfig.cpp b/sources/awesome-widget/plugin/awabstractpairconfig.cpp index 16c1ba9..aaab069 100644 --- a/sources/awesome-widget/plugin/awabstractpairconfig.cpp +++ b/sources/awesome-widget/plugin/awabstractpairconfig.cpp @@ -56,7 +56,6 @@ AWAbstractPairConfig::~AWAbstractPairConfig() clearSelectors(); - delete m_helper; delete ui; } diff --git a/sources/awesome-widget/plugin/awactions.cpp b/sources/awesome-widget/plugin/awactions.cpp index 639a8e9..2366109 100644 --- a/sources/awesome-widget/plugin/awactions.cpp +++ b/sources/awesome-widget/plugin/awactions.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include @@ -43,8 +42,6 @@ AWActions::AWActions(QObject *_parent) AWActions::~AWActions() { qCDebug(LOG_AW) << __PRETTY_FUNCTION__; - - delete m_updateHelper; } diff --git a/sources/awesome-widget/plugin/awbugreporter.cpp b/sources/awesome-widget/plugin/awbugreporter.cpp index ae4fc7b..edc78ed 100644 --- a/sources/awesome-widget/plugin/awbugreporter.cpp +++ b/sources/awesome-widget/plugin/awbugreporter.cpp @@ -21,11 +21,9 @@ #include #include -#include #include #include #include -#include #include "awdebug.h" diff --git a/sources/awesome-widget/plugin/awconfighelper.cpp b/sources/awesome-widget/plugin/awconfighelper.cpp index 30658c4..c2ccb57 100644 --- a/sources/awesome-widget/plugin/awconfighelper.cpp +++ b/sources/awesome-widget/plugin/awconfighelper.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "awdebug.h" @@ -31,6 +32,10 @@ AWConfigHelper::AWConfigHelper(QObject *_parent) : QObject(_parent) { qCDebug(LOG_AW) << __PRETTY_FUNCTION__; + + m_baseDir = QString("%1/awesomewidgets") + .arg(QStandardPaths::writableLocation( + QStandardPaths::GenericDataLocation)); } diff --git a/sources/awesome-widget/plugin/awconfighelper.h b/sources/awesome-widget/plugin/awconfighelper.h index f613495..1997129 100644 --- a/sources/awesome-widget/plugin/awconfighelper.h +++ b/sources/awesome-widget/plugin/awconfighelper.h @@ -20,7 +20,6 @@ #define AWCONFIGHELPER_H #include -#include #include @@ -57,15 +56,9 @@ private: void writeFile(QSettings &_settings, const QString &_key, const QString &_fileName) const; // properties - QString m_baseDir = QString("%1/awesomewidgets") - .arg(QStandardPaths::writableLocation( - QStandardPaths::GenericDataLocation)); - QStringList m_dirs = QStringList() << "desktops" - << "quotes" - << "scripts" - << "upgrade" - << "weather" - << "formatters"; + QString m_baseDir; + QStringList m_dirs + = {"desktops", "quotes", "scripts", "upgrade", "weather", "formatters"}; }; diff --git a/sources/awesome-widget/plugin/awcustomkeyshelper.h b/sources/awesome-widget/plugin/awcustomkeyshelper.h index 1d8f814..42b8af7 100644 --- a/sources/awesome-widget/plugin/awcustomkeyshelper.h +++ b/sources/awesome-widget/plugin/awcustomkeyshelper.h @@ -19,7 +19,6 @@ #ifndef AWCUSTOMKEYSHELPER_H #define AWCUSTOMKEYSHELPER_H -#include #include #include "awabstractpairhelper.h" diff --git a/sources/awesome-widget/plugin/awdataaggregator.cpp b/sources/awesome-widget/plugin/awdataaggregator.cpp index 0a8e9b5..b7f239b 100644 --- a/sources/awesome-widget/plugin/awdataaggregator.cpp +++ b/sources/awesome-widget/plugin/awdataaggregator.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include @@ -55,14 +54,6 @@ AWDataAggregator::~AWDataAggregator() } -QList AWDataAggregator::getData(const QString &_key) const -{ - qCDebug(LOG_AW) << "Key" << _key; - - return m_values[QString("%1Tooltip").arg(_key)]; -} - - QString AWDataAggregator::htmlImage(const QPixmap &_source) const { QByteArray byteArray; diff --git a/sources/awesome-widget/plugin/awdataaggregator.h b/sources/awesome-widget/plugin/awdataaggregator.h index fc4be79..b554477 100644 --- a/sources/awesome-widget/plugin/awdataaggregator.h +++ b/sources/awesome-widget/plugin/awdataaggregator.h @@ -35,7 +35,6 @@ class AWDataAggregator : public QObject public: explicit AWDataAggregator(QObject *_parent = nullptr); virtual ~AWDataAggregator(); - QList getData(const QString &_key) const; QString htmlImage(const QPixmap &_source) const; void setParameters(const QVariantMap &_settings); QPixmap tooltipImage(); diff --git a/sources/awesome-widget/plugin/awdataengineaggregator.cpp b/sources/awesome-widget/plugin/awdataengineaggregator.cpp index b2c69ff..6ca46ef 100644 --- a/sources/awesome-widget/plugin/awdataengineaggregator.cpp +++ b/sources/awesome-widget/plugin/awdataengineaggregator.cpp @@ -28,6 +28,20 @@ AWDataEngineAggregator::AWDataEngineAggregator(QObject *_parent) { qCDebug(LOG_AW) << __PRETTY_FUNCTION__; + m_consumer = new Plasma::DataEngineConsumer(); + m_dataEngines["systemmonitor"] = m_consumer->dataEngine("systemmonitor"); + m_dataEngines["extsysmon"] = m_consumer->dataEngine("extsysmon"); + m_dataEngines["time"] = m_consumer->dataEngine("time"); + + // additional method required by systemmonitor structure + m_newSourceConnection = connect( + m_dataEngines["systemmonitor"], &Plasma::DataEngine::sourceAdded, + [this](const QString source) { + emit(deviceAdded(source)); + m_dataEngines["systemmonitor"]->connectSource(source, parent(), + 1000); + }); + // required to define Qt::QueuedConnection for signal-slot connection qRegisterMetaType("Plasma::DataEngine::Data"); } @@ -37,16 +51,7 @@ AWDataEngineAggregator::~AWDataEngineAggregator() { qCDebug(LOG_AW) << __PRETTY_FUNCTION__; - clear(); -} - - -void AWDataEngineAggregator::clear() -{ - // disconnect sources first disconnectSources(); - m_dataEngines.clear(); - delete m_consumer; } @@ -55,27 +60,31 @@ void AWDataEngineAggregator::disconnectSources() for (auto dataengine : m_dataEngines.values()) for (auto &source : dataengine->sources()) dataengine->disconnectSource(source, parent()); + disconnect(m_newSourceConnection); } -void AWDataEngineAggregator::initDataEngines(const int _interval) +void AWDataEngineAggregator::reconnectSources(const int _interval) { - qCDebug(LOG_AW) << "Init dataengines with interval" << _interval; + qCDebug(LOG_AW) << "Reconnect sources with interval" << _interval; - m_consumer = new Plasma::DataEngineConsumer(); - m_dataEngines["systemmonitor"] = m_consumer->dataEngine("systemmonitor"); - m_dataEngines["extsysmon"] = m_consumer->dataEngine("extsysmon"); - m_dataEngines["time"] = m_consumer->dataEngine("time"); + disconnectSources(); - // additional method required by systemmonitor structure - connect(m_dataEngines["systemmonitor"], &Plasma::DataEngine::sourceAdded, - [this, _interval](const QString source) { - emit(deviceAdded(source)); - m_dataEngines["systemmonitor"]->connectSource(source, parent(), - _interval); - }); + m_dataEngines["systemmonitor"]->connectAllSources(parent(), _interval); + m_dataEngines["extsysmon"]->connectAllSources(parent(), _interval); + m_dataEngines["time"]->connectSource("Local", parent(), 1000); - return reconnectSources(_interval); + m_newSourceConnection = connect( + m_dataEngines["systemmonitor"], &Plasma::DataEngine::sourceAdded, + [this, _interval](const QString source) { + emit(deviceAdded(source)); + m_dataEngines["systemmonitor"]->connectSource(source, parent(), + _interval); + }); + +#ifdef BUILD_FUTURE + createQueuedConnection(); +#endif /* BUILD_FUTURE */ } @@ -84,26 +93,12 @@ void AWDataEngineAggregator::dropSource(const QString &_source) qCDebug(LOG_AW) << "Source" << _source; // HACK there is no possibility to check to which dataengine source - // connected we will try to disconnect it from systemmonitor and extsysmon + // connected we will try to disconnect it from all engines for (auto dataengine : m_dataEngines.values()) dataengine->disconnectSource(_source, parent()); } -void AWDataEngineAggregator::reconnectSources(const int _interval) -{ - qCDebug(LOG_AW) << "Reconnect sources with interval" << _interval; - - m_dataEngines["systemmonitor"]->connectAllSources(parent(), _interval); - m_dataEngines["extsysmon"]->connectAllSources(parent(), _interval); - m_dataEngines["time"]->connectSource("Local", parent(), 1000); - -#ifdef BUILD_FUTURE - createQueuedConnection(); -#endif /* BUILD_FUTURE */ -} - - void AWDataEngineAggregator::createQueuedConnection() { // HACK additional method which forces QueuedConnection instead of Auto one diff --git a/sources/awesome-widget/plugin/awdataengineaggregator.h b/sources/awesome-widget/plugin/awdataengineaggregator.h index 558d3d0..a2def21 100644 --- a/sources/awesome-widget/plugin/awdataengineaggregator.h +++ b/sources/awesome-widget/plugin/awdataengineaggregator.h @@ -32,21 +32,20 @@ class AWDataEngineAggregator : public QObject public: explicit AWDataEngineAggregator(QObject *_parent = nullptr); virtual ~AWDataEngineAggregator(); - void clear(); void disconnectSources(); - void initDataEngines(const int _interval); + void reconnectSources(const int _interval); signals: void deviceAdded(const QString &_source); public slots: void dropSource(const QString &_source); - void reconnectSources(const int _interval); private: void createQueuedConnection(); Plasma::DataEngineConsumer *m_consumer = nullptr; QHash m_dataEngines; + QMetaObject::Connection m_newSourceConnection; }; diff --git a/sources/awesome-widget/plugin/awdbusadaptor.h b/sources/awesome-widget/plugin/awdbusadaptor.h index 1cad635..5ff888e 100644 --- a/sources/awesome-widget/plugin/awdbusadaptor.h +++ b/sources/awesome-widget/plugin/awdbusadaptor.h @@ -48,10 +48,7 @@ public slots: private: AWKeys *m_plugin = nullptr; - QStringList m_logLevels = QStringList() << "debug" - << "info" - << "warning" - << "critical"; + QStringList m_logLevels = {"debug", "info", "warning", "critical"}; }; diff --git a/sources/awesome-widget/plugin/awesomewidget.cpp b/sources/awesome-widget/plugin/awesomewidget.cpp index a4828b3..fdb526b 100644 --- a/sources/awesome-widget/plugin/awesomewidget.cpp +++ b/sources/awesome-widget/plugin/awesomewidget.cpp @@ -22,8 +22,8 @@ #include "awactions.h" #include "awbugreporter.h" #include "awconfighelper.h" -#include "awformatterconfigfactory.h" #include "awkeys.h" +#include "awpairconfigfactory.h" #include "awtelemetryhandler.h" @@ -34,8 +34,7 @@ void AWPlugin::registerTypes(const char *uri) qmlRegisterType(uri, 1, 0, "AWActions"); qmlRegisterType(uri, 1, 0, "AWBugReporter"); qmlRegisterType(uri, 1, 0, "AWConfigHelper"); - qmlRegisterType(uri, 1, 0, - "AWFormatterConfigFactory"); + qmlRegisterType(uri, 1, 0, "AWPairConfigFactory"); qmlRegisterType(uri, 1, 0, "AWKeys"); qmlRegisterType(uri, 1, 0, "AWTelemetryHandler"); } diff --git a/sources/awesome-widget/plugin/awkeycache.cpp b/sources/awesome-widget/plugin/awkeycache.cpp index dbfd93f..ce3ff84 100644 --- a/sources/awesome-widget/plugin/awkeycache.cpp +++ b/sources/awesome-widget/plugin/awkeycache.cpp @@ -19,7 +19,6 @@ #include #include -#include #include #include diff --git a/sources/awesome-widget/plugin/awkeyoperations.cpp b/sources/awesome-widget/plugin/awkeyoperations.cpp index 5dbc60f..c4b4ed2 100644 --- a/sources/awesome-widget/plugin/awkeyoperations.cpp +++ b/sources/awesome-widget/plugin/awkeyoperations.cpp @@ -55,15 +55,6 @@ AWKeyOperations::AWKeyOperations(QObject *_parent) AWKeyOperations::~AWKeyOperations() { qCDebug(LOG_AW) << __PRETTY_FUNCTION__; - - // extensions - delete m_customKeys; - delete m_graphicalItems; - delete m_extNetRequest; - delete m_extQuotes; - delete m_extScripts; - delete m_extUpgrade; - delete m_extWeather; } diff --git a/sources/awesome-widget/plugin/awkeyoperations.h b/sources/awesome-widget/plugin/awkeyoperations.h index cd74099..a58d99f 100644 --- a/sources/awesome-widget/plugin/awkeyoperations.h +++ b/sources/awesome-widget/plugin/awkeyoperations.h @@ -19,25 +19,18 @@ #ifndef AWKEYOPERATIONS_H #define AWKEYOPERATIONS_H -#include - -#include #include #include "extitemaggregator.h" class AWCustomKeysHelper; -class AWDataAggregator; -class AWDataEngineAggregator; -class AWKeysAggregator; class ExtNetworkRequest; class ExtQuotes; class ExtScript; class ExtUpgrade; class ExtWeather; class GraphicalItem; -class QThreadPool; class AWKeyOperations : public QObject { diff --git a/sources/awesome-widget/plugin/awkeys.cpp b/sources/awesome-widget/plugin/awkeys.cpp index 72ba33e..e8d4745 100644 --- a/sources/awesome-widget/plugin/awkeys.cpp +++ b/sources/awesome-widget/plugin/awkeys.cpp @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -76,24 +75,9 @@ AWKeys::~AWKeys() qCDebug(LOG_AW) << __PRETTY_FUNCTION__; m_timer->stop(); - delete m_timer; - // delete dbus session qlonglong id = reinterpret_cast(this); QDBusConnection::sessionBus().unregisterObject(QString("/%1").arg(id)); - - // core - delete m_dataEngineAggregator; - delete m_threadPool; - delete m_aggregator; - delete m_dataAggregator; - delete m_keyOperator; -} - - -bool AWKeys::isDBusActive() const -{ - return m_dbusActive; } @@ -122,8 +106,7 @@ void AWKeys::initKeys(const QString &_currentPattern, const int _interval, m_aggregator->initFormatters(); m_keyOperator->setPattern(_currentPattern); m_keyOperator->updateCache(); - m_dataEngineAggregator->clear(); - m_dataEngineAggregator->initDataEngines(_interval); + m_dataEngineAggregator->reconnectSources(_interval); // timer m_timer->setInterval(_interval); @@ -348,13 +331,9 @@ void AWKeys::createDBusInterface() qCWarning(LOG_AW) << "Could not register DBus service, last error" << bus.lastError().message(); if (!bus.registerObject(QString("/%1").arg(id), new AWDBusAdaptor(this), - QDBusConnection::ExportAllContents)) { + QDBusConnection::ExportAllContents)) qCWarning(LOG_AW) << "Could not register DBus object, last error" << bus.lastError().message(); - m_dbusActive = false; - } else { - m_dbusActive = true; - } } diff --git a/sources/awesome-widget/plugin/awkeys.h b/sources/awesome-widget/plugin/awkeys.h index f0011bd..0c49b8c 100644 --- a/sources/awesome-widget/plugin/awkeys.h +++ b/sources/awesome-widget/plugin/awkeys.h @@ -25,7 +25,6 @@ #include -class AWCustomKeysHelper; class AWDataAggregator; class AWDataEngineAggregator; class AWKeyOperations; @@ -40,7 +39,6 @@ class AWKeys : public QObject public: explicit AWKeys(QObject *_parent = nullptr); virtual ~AWKeys(); - bool isDBusActive() const; Q_INVOKABLE void initDataAggregator(const QVariantMap &_tooltipParams); Q_INVOKABLE void initKeys(const QString &_currentPattern, const int _interval, const int _limit, @@ -89,7 +87,6 @@ private: AWKeyOperations *m_keyOperator = nullptr; QTimer *m_timer = nullptr; // variables - bool m_dbusActive = false; QVariantMap m_tooltipParams; QStringList m_foundBars, m_foundKeys, m_foundLambdas, m_requiredKeys; QVariantHash m_values; diff --git a/sources/awesome-widget/plugin/awkeysaggregator.cpp b/sources/awesome-widget/plugin/awkeysaggregator.cpp index c8137d5..c50f331 100644 --- a/sources/awesome-widget/plugin/awkeysaggregator.cpp +++ b/sources/awesome-widget/plugin/awkeysaggregator.cpp @@ -60,8 +60,6 @@ AWKeysAggregator::AWKeysAggregator(QObject *_parent) AWKeysAggregator::~AWKeysAggregator() { qCDebug(LOG_AW) << __PRETTY_FUNCTION__; - - delete m_customFormatters; } diff --git a/sources/awesome-widget/plugin/awformatterconfigfactory.cpp b/sources/awesome-widget/plugin/awpairconfigfactory.cpp similarity index 85% rename from sources/awesome-widget/plugin/awformatterconfigfactory.cpp rename to sources/awesome-widget/plugin/awpairconfigfactory.cpp index ebb282c..7de5dc3 100644 --- a/sources/awesome-widget/plugin/awformatterconfigfactory.cpp +++ b/sources/awesome-widget/plugin/awpairconfigfactory.cpp @@ -15,27 +15,27 @@ * along with awesome-widgets. If not, see http://www.gnu.org/licenses/ * ***************************************************************************/ -#include "awformatterconfigfactory.h" +#include "awpairconfigfactory.h" #include "awcustomkeysconfig.h" #include "awdebug.h" #include "awformatterconfig.h" -AWFormatterConfigFactory::AWFormatterConfigFactory(QObject *_parent) +AWPairConfigFactory::AWPairConfigFactory(QObject *_parent) : QObject(_parent) { qCDebug(LOG_AW) << __PRETTY_FUNCTION__; } -AWFormatterConfigFactory::~AWFormatterConfigFactory() +AWPairConfigFactory::~AWPairConfigFactory() { qCDebug(LOG_AW) << __PRETTY_FUNCTION__; } -void AWFormatterConfigFactory::showFormatterDialog(const QStringList &_keys) +void AWPairConfigFactory::showFormatterDialog(const QStringList &_keys) { AWFormatterConfig *config = new AWFormatterConfig(nullptr, _keys); config->showDialog(); @@ -43,7 +43,7 @@ void AWFormatterConfigFactory::showFormatterDialog(const QStringList &_keys) } -void AWFormatterConfigFactory::showKeysDialog(const QStringList &_keys) +void AWPairConfigFactory::showKeysDialog(const QStringList &_keys) { AWCustomKeysConfig *config = new AWCustomKeysConfig(nullptr, _keys); config->showDialog(); diff --git a/sources/awesome-widget/plugin/awformatterconfigfactory.h b/sources/awesome-widget/plugin/awpairconfigfactory.h similarity index 84% rename from sources/awesome-widget/plugin/awformatterconfigfactory.h rename to sources/awesome-widget/plugin/awpairconfigfactory.h index b8fc7fe..40d0d08 100644 --- a/sources/awesome-widget/plugin/awformatterconfigfactory.h +++ b/sources/awesome-widget/plugin/awpairconfigfactory.h @@ -16,19 +16,19 @@ ***************************************************************************/ -#ifndef AWFORMATTERCONFIGFACTORY_H -#define AWFORMATTERCONFIGFACTORY_H +#ifndef AWPAIRCONFIGFACTORY_H +#define AWPAIRCONFIGFACTORY_H #include -class AWFormatterConfigFactory : public QObject +class AWPairConfigFactory : public QObject { Q_OBJECT public: - explicit AWFormatterConfigFactory(QObject *_parent = nullptr); - virtual ~AWFormatterConfigFactory(); + explicit AWPairConfigFactory(QObject *_parent = nullptr); + virtual ~AWPairConfigFactory(); Q_INVOKABLE void showFormatterDialog(const QStringList &_keys); Q_INVOKABLE void showKeysDialog(const QStringList &_keys); @@ -36,4 +36,4 @@ private: }; -#endif /* AWFORMATTERCONFIGFACTORY_H */ +#endif /* AWPAIRCONFIGFACTORY_H */ diff --git a/sources/awesome-widget/plugin/awtelemetryhandler.cpp b/sources/awesome-widget/plugin/awtelemetryhandler.cpp index c0e3a51..8eb0091 100644 --- a/sources/awesome-widget/plugin/awtelemetryhandler.cpp +++ b/sources/awesome-widget/plugin/awtelemetryhandler.cpp @@ -18,10 +18,8 @@ #include "awtelemetryhandler.h" #include -#include #include #include -#include #include #include #include diff --git a/sources/awesome-widget/plugin/awtelemetryhandler.h b/sources/awesome-widget/plugin/awtelemetryhandler.h index 3fdab9c..9586db0 100644 --- a/sources/awesome-widget/plugin/awtelemetryhandler.h +++ b/sources/awesome-widget/plugin/awtelemetryhandler.h @@ -20,10 +20,8 @@ #define AWTELEMETRYHANDLER_H #include -#include -class QAbstractButton; class QNetworkReply; class AWTelemetryHandler : public QObject diff --git a/sources/awesome-widget/plugin/awupdatehelper.cpp b/sources/awesome-widget/plugin/awupdatehelper.cpp index f6b5338..f4839e2 100644 --- a/sources/awesome-widget/plugin/awupdatehelper.cpp +++ b/sources/awesome-widget/plugin/awupdatehelper.cpp @@ -21,10 +21,8 @@ #include #include -#include #include #include -#include #include #include "awdebug.h" diff --git a/sources/awesomewidgets/abstractextitem.cpp b/sources/awesomewidgets/abstractextitem.cpp index 6595d73..317578e 100644 --- a/sources/awesomewidgets/abstractextitem.cpp +++ b/sources/awesomewidgets/abstractextitem.cpp @@ -24,7 +24,6 @@ #include #include "abstractextitemaggregator.h" -#include "awdebug.h" #include "qcronscheduler.h" @@ -47,7 +46,7 @@ AbstractExtItem::~AbstractExtItem() if (m_socket) { m_socket->close(); m_socket->removeServer(socket()); - delete m_socket; + m_socket->deleteLater(); } } diff --git a/sources/awesomewidgets/abstractextitemaggregator.cpp b/sources/awesomewidgets/abstractextitemaggregator.cpp index 9c9a0e7..a2d8663 100644 --- a/sources/awesomewidgets/abstractextitemaggregator.cpp +++ b/sources/awesomewidgets/abstractextitemaggregator.cpp @@ -21,7 +21,6 @@ #include #include -#include #include #include diff --git a/sources/awesomewidgets/awdatetimeformatter.cpp b/sources/awesomewidgets/awdatetimeformatter.cpp index 0575d95..44bdcca 100644 --- a/sources/awesomewidgets/awdatetimeformatter.cpp +++ b/sources/awesomewidgets/awdatetimeformatter.cpp @@ -22,7 +22,6 @@ #include #include -#include #include #include "awdebug.h" diff --git a/sources/awesomewidgets/awdatetimeformatter.h b/sources/awesomewidgets/awdatetimeformatter.h index 0e023a5..c83bc6c 100644 --- a/sources/awesomewidgets/awdatetimeformatter.h +++ b/sources/awesomewidgets/awdatetimeformatter.h @@ -18,9 +18,10 @@ #ifndef AWDATETIMEFORMATTER_H #define AWDATETIMEFORMATTER_H -#include "awabstractformatter.h" #include +#include "awabstractformatter.h" + namespace Ui { diff --git a/sources/awesomewidgets/awfloatformatter.cpp b/sources/awesomewidgets/awfloatformatter.cpp index 7fab070..f587ae1 100644 --- a/sources/awesomewidgets/awfloatformatter.cpp +++ b/sources/awesomewidgets/awfloatformatter.cpp @@ -21,7 +21,6 @@ #include -#include #include #include "awdebug.h" diff --git a/sources/awesomewidgets/awscriptformatter.cpp b/sources/awesomewidgets/awscriptformatter.cpp index 965088a..f6943a4 100644 --- a/sources/awesomewidgets/awscriptformatter.cpp +++ b/sources/awesomewidgets/awscriptformatter.cpp @@ -21,7 +21,6 @@ #include -#include #include #include diff --git a/sources/awesomewidgets/awstringformatter.cpp b/sources/awesomewidgets/awstringformatter.cpp index 92e08e0..56c4e7f 100644 --- a/sources/awesomewidgets/awstringformatter.cpp +++ b/sources/awesomewidgets/awstringformatter.cpp @@ -21,7 +21,6 @@ #include -#include #include #include "awdebug.h" diff --git a/sources/awesomewidgets/extnetworkrequest.cpp b/sources/awesomewidgets/extnetworkrequest.cpp index 14fa1de..b8a85b9 100644 --- a/sources/awesomewidgets/extnetworkrequest.cpp +++ b/sources/awesomewidgets/extnetworkrequest.cpp @@ -21,8 +21,6 @@ #include #include -#include -#include #include #include diff --git a/sources/awesomewidgets/extquotes.cpp b/sources/awesomewidgets/extquotes.cpp index 5841f5f..2a265d8 100644 --- a/sources/awesomewidgets/extquotes.cpp +++ b/sources/awesomewidgets/extquotes.cpp @@ -22,9 +22,6 @@ #include #include -#include -#include -#include #include #include diff --git a/sources/awesomewidgets/extscript.cpp b/sources/awesomewidgets/extscript.cpp index 928f5b7..ef9c35d 100644 --- a/sources/awesomewidgets/extscript.cpp +++ b/sources/awesomewidgets/extscript.cpp @@ -22,7 +22,6 @@ #include #include -#include #include #include #include diff --git a/sources/awesomewidgets/extupgrade.cpp b/sources/awesomewidgets/extupgrade.cpp index 302fb02..06bdbb9 100644 --- a/sources/awesomewidgets/extupgrade.cpp +++ b/sources/awesomewidgets/extupgrade.cpp @@ -21,7 +21,6 @@ #include #include -#include #include #include diff --git a/sources/awesomewidgets/extweather.cpp b/sources/awesomewidgets/extweather.cpp index 625e501..70a00a0 100644 --- a/sources/awesomewidgets/extweather.cpp +++ b/sources/awesomewidgets/extweather.cpp @@ -22,9 +22,6 @@ #include #include -#include -#include -#include #include #include @@ -72,7 +69,6 @@ ExtWeather::~ExtWeather() disconnect(this, SIGNAL(requestDataUpdate()), this, SLOT(sendRequest())); m_manager->deleteLater(); - delete m_providerObject; delete ui; } diff --git a/sources/awesomewidgets/graphicalitem.cpp b/sources/awesomewidgets/graphicalitem.cpp index 759a603..42e8442 100644 --- a/sources/awesomewidgets/graphicalitem.cpp +++ b/sources/awesomewidgets/graphicalitem.cpp @@ -38,6 +38,19 @@ GraphicalItem::GraphicalItem(QWidget *_parent, const QString &_filePath) { qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; + // init scene + m_scene = new QGraphicsScene(); + m_scene->setBackgroundBrush(QBrush(Qt::NoBrush)); + // init view + m_view = new QGraphicsView(m_scene); + m_view->setStyleSheet("background: transparent"); + m_view->setContentsMargins(0, 0, 0, 0); + m_view->setFrameShape(QFrame::NoFrame); + m_view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + m_view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + // init helper + m_helper = new GraphicalItemHelper(this, m_scene); + if (!_filePath.isEmpty()) readConfiguration(); ui->setupUi(this); @@ -58,9 +71,7 @@ GraphicalItem::~GraphicalItem() { qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; - delete m_scene; delete ui; - delete m_helper; } @@ -141,24 +152,7 @@ QString GraphicalItem::image(const QVariant &value) void GraphicalItem::initScene() { - // cleanup - delete m_helper; - delete m_scene; - - // init scene - m_scene = new QGraphicsScene(); - m_scene->setBackgroundBrush(QBrush(Qt::NoBrush)); - // init view - m_view = new QGraphicsView(m_scene); - m_view->setStyleSheet("background: transparent"); - m_view->setContentsMargins(0, 0, 0, 0); - m_view->setFrameShape(QFrame::NoFrame); - m_view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - m_view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); m_view->resize(m_width + 5, m_height + 5); - - // init helper - m_helper = new GraphicalItemHelper(this, m_scene); m_helper->setParameters(activeColor(), inactiveColor(), itemWidth(), itemHeight(), count()); } diff --git a/sources/awesomewidgets/graphicalitemhelper.cpp b/sources/awesomewidgets/graphicalitemhelper.cpp index 1a3a474..1fcc703 100644 --- a/sources/awesomewidgets/graphicalitemhelper.cpp +++ b/sources/awesomewidgets/graphicalitemhelper.cpp @@ -17,7 +17,6 @@ #include "graphicalitemhelper.h" -#include #include #include #include diff --git a/sources/awesomewidgets/qcronscheduler.cpp b/sources/awesomewidgets/qcronscheduler.cpp index c27224b..90d5adc 100644 --- a/sources/awesomewidgets/qcronscheduler.cpp +++ b/sources/awesomewidgets/qcronscheduler.cpp @@ -44,7 +44,6 @@ QCronScheduler::~QCronScheduler() qCDebug(LOG_LIB) << __PRETTY_FUNCTION__; m_timer->stop(); - delete m_timer; } diff --git a/sources/desktop-panel/plugin/dpadds.cpp b/sources/desktop-panel/plugin/dpadds.cpp index 08149fb..098f737 100644 --- a/sources/desktop-panel/plugin/dpadds.cpp +++ b/sources/desktop-panel/plugin/dpadds.cpp @@ -27,8 +27,6 @@ #include #include #include -#include -#include #include #include diff --git a/sources/extsysmon/extsysmon.cpp b/sources/extsysmon/extsysmon.cpp index 2e074c6..fab99fd 100644 --- a/sources/extsysmon/extsysmon.cpp +++ b/sources/extsysmon/extsysmon.cpp @@ -18,7 +18,6 @@ #include "extsysmon.h" #include -#include #include #include @@ -50,8 +49,6 @@ ExtendedSysMon::ExtendedSysMon(QObject *_parent, const QVariantList &_args) ExtendedSysMon::~ExtendedSysMon() { qCDebug(LOG_ESM) << __PRETTY_FUNCTION__; - - delete m_aggregator; } diff --git a/sources/extsysmonsources/customsource.cpp b/sources/extsysmonsources/customsource.cpp index 07eb9a6..e4d9664 100644 --- a/sources/extsysmonsources/customsource.cpp +++ b/sources/extsysmonsources/customsource.cpp @@ -37,8 +37,6 @@ CustomSource::CustomSource(QObject *_parent, const QStringList &_args) CustomSource::~CustomSource() { qCDebug(LOG_ESS) << __PRETTY_FUNCTION__; - - delete m_extScripts; } diff --git a/sources/extsysmonsources/quotessource.cpp b/sources/extsysmonsources/quotessource.cpp index f759c36..2a29cad 100644 --- a/sources/extsysmonsources/quotessource.cpp +++ b/sources/extsysmonsources/quotessource.cpp @@ -37,8 +37,6 @@ QuotesSource::QuotesSource(QObject *_parent, const QStringList &_args) QuotesSource::~QuotesSource() { qCDebug(LOG_ESS) << __PRETTY_FUNCTION__; - - delete m_extQuotes; } diff --git a/sources/extsysmonsources/requestsource.cpp b/sources/extsysmonsources/requestsource.cpp index e72cfaf..6ac889b 100644 --- a/sources/extsysmonsources/requestsource.cpp +++ b/sources/extsysmonsources/requestsource.cpp @@ -38,8 +38,6 @@ RequestSource::RequestSource(QObject *_parent, const QStringList &_args) RequestSource::~RequestSource() { qCDebug(LOG_ESS) << __PRETTY_FUNCTION__; - - delete m_extNetRequest; } diff --git a/sources/extsysmonsources/upgradesource.cpp b/sources/extsysmonsources/upgradesource.cpp index 62dd975..1968e24 100644 --- a/sources/extsysmonsources/upgradesource.cpp +++ b/sources/extsysmonsources/upgradesource.cpp @@ -37,8 +37,6 @@ UpgradeSource::UpgradeSource(QObject *_parent, const QStringList &_args) UpgradeSource::~UpgradeSource() { qCDebug(LOG_ESS) << __PRETTY_FUNCTION__; - - delete m_extUpgrade; } diff --git a/sources/extsysmonsources/weathersource.cpp b/sources/extsysmonsources/weathersource.cpp index 89ac0aa..576a285 100644 --- a/sources/extsysmonsources/weathersource.cpp +++ b/sources/extsysmonsources/weathersource.cpp @@ -37,8 +37,6 @@ WeatherSource::WeatherSource(QObject *_parent, const QStringList &_args) WeatherSource::~WeatherSource() { qCDebug(LOG_ESS) << __PRETTY_FUNCTION__; - - delete m_extWeather; } diff --git a/sources/qml/AWExtensions.qml b/sources/qml/AWExtensions.qml index eed6e0d..d048ac8 100644 --- a/sources/qml/AWExtensions.qml +++ b/sources/qml/AWExtensions.qml @@ -28,8 +28,8 @@ Row { // backend property var backend - AWFormatterConfigFactory { - id: awFormatter + AWPairConfigFactory { + id: awPairConfig } AWTelemetryHandler { id: awTelemetryHandler @@ -49,13 +49,13 @@ Row { QtControls.Button { width: parent.width * 3 / 15 text: i18n("Formatters") - onClicked: awFormatter.showFormatterDialog(backend.dictKeys(true)) + onClicked: awPairConfig.showFormatterDialog(backend.dictKeys(true)) } QtControls.Button { width: parent.width * 3 / 15 text: i18n("User keys") - onClicked: awFormatter.showKeysDialog(backend.dictKeys(true)) + onClicked: awPairConfig.showKeysDialog(backend.dictKeys(true)) } QtControls.Button { diff --git a/sources/test/testawkeys.cpp b/sources/test/testawkeys.cpp index f51de28..c55d2d7 100644 --- a/sources/test/testawkeys.cpp +++ b/sources/test/testawkeys.cpp @@ -168,9 +168,6 @@ void TestAWKeys::test_valueByKey() void TestAWKeys::test_dbus() { - if (!plugin->isDBusActive()) - QSKIP("No DBus session created, skip DBus test"); - // get id qlonglong id = reinterpret_cast(plugin); From 5e0843483598ef892aa124e15d9e685348d3f4db Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Mon, 24 Jul 2017 15:07:36 +0300 Subject: [PATCH 6/9] fix issue with invalid (up|down)total($|kb) calculation (see #127) also renamed *total* tags to *tot* for consistency with other tags: * uptotal.* -> uptot.* * downtotal.* -> downtot.* * pstotal -> pstot --- sources/awesome-widget/plugin/awkeycache.cpp | 4 ++-- sources/awesome-widget/plugin/awkeyoperations.cpp | 8 ++++---- sources/awesome-widget/plugin/awkeys.cpp | 8 ++++---- sources/awesome-widget/plugin/awkeysaggregator.cpp | 12 ++++++++---- sources/awesome-widget/plugin/awkeysaggregator.h | 1 - .../awesomewidgets/configs/aw-example-standalonerc | 2 +- sources/version.h.in | 8 ++++---- 7 files changed, 23 insertions(+), 20 deletions(-) diff --git a/sources/awesome-widget/plugin/awkeycache.cpp b/sources/awesome-widget/plugin/awkeycache.cpp index ce3ff84..d72de54 100644 --- a/sources/awesome-widget/plugin/awkeycache.cpp +++ b/sources/awesome-widget/plugin/awkeycache.cpp @@ -147,8 +147,8 @@ QStringList AWKeyCache::getRequiredKeys(const QStringList &_keys, used << "swapgb" << "swapfreegb"; // network keys - QStringList netKeys({"up", "upkb", "uptotal", "uptotalkb", "upunits", - "down", "downkb", "downtotal", "downtotalkb", + QStringList netKeys({"up", "upkb", "uptot", "uptotkb", "upunits", + "down", "downkb", "downtot", "downtotkb", "downunits"}); for (auto &key : netKeys) { if (!used.contains(key)) diff --git a/sources/awesome-widget/plugin/awkeyoperations.cpp b/sources/awesome-widget/plugin/awkeyoperations.cpp index c4b4ed2..7f992da 100644 --- a/sources/awesome-widget/plugin/awkeyoperations.cpp +++ b/sources/awesome-widget/plugin/awkeyoperations.cpp @@ -122,12 +122,12 @@ QStringList AWKeyOperations::dictKeys() const for (int i = 0; i < m_devices["net"].count(); i++) { allKeys.append(QString("downunits%1").arg(i)); allKeys.append(QString("upunits%1").arg(i)); - allKeys.append(QString("downtotalkb%1").arg(i)); - allKeys.append(QString("downtotal%1").arg(i)); + allKeys.append(QString("downtotkb%1").arg(i)); + allKeys.append(QString("downtot%1").arg(i)); allKeys.append(QString("downkb%1").arg(i)); allKeys.append(QString("down%1").arg(i)); - allKeys.append(QString("uptotalkb%1").arg(i)); - allKeys.append(QString("uptotal%1").arg(i)); + allKeys.append(QString("uptotkb%1").arg(i)); + allKeys.append(QString("uptot%1").arg(i)); allKeys.append(QString("upkb%1").arg(i)); allKeys.append(QString("up%1").arg(i)); } diff --git a/sources/awesome-widget/plugin/awkeys.cpp b/sources/awesome-widget/plugin/awkeys.cpp index e8d4745..385f2e1 100644 --- a/sources/awesome-widget/plugin/awkeys.cpp +++ b/sources/awesome-widget/plugin/awkeys.cpp @@ -291,13 +291,13 @@ void AWKeys::calculateValues() = m_keyOperator->devices("net").indexOf(m_values["netdev"].toString()); m_values["down"] = m_values[QString("down%1").arg(netIndex)]; m_values["downkb"] = m_values[QString("downkb%1").arg(netIndex)]; - m_values["downtotal"] = m_values[QString("downtotal%1").arg(netIndex)]; - m_values["downtotalkb"] = m_values[QString("downtotalkb%1").arg(netIndex)]; + m_values["downtot"] = m_values[QString("downtot%1").arg(netIndex)]; + m_values["downtotkb"] = m_values[QString("downtotkb%1").arg(netIndex)]; m_values["downunits"] = m_values[QString("downunits%1").arg(netIndex)]; m_values["up"] = m_values[QString("up%1").arg(netIndex)]; m_values["upkb"] = m_values[QString("upkb%1").arg(netIndex)]; - m_values["uptotal"] = m_values[QString("uptotal%1").arg(netIndex)]; - m_values["uptotalkb"] = m_values[QString("uptotalkb%1").arg(netIndex)]; + m_values["uptot"] = m_values[QString("uptot%1").arg(netIndex)]; + m_values["uptotkb"] = m_values[QString("uptotkb%1").arg(netIndex)]; m_values["upunits"] = m_values[QString("upunits%1").arg(netIndex)]; // swaptot* diff --git a/sources/awesome-widget/plugin/awkeysaggregator.cpp b/sources/awesome-widget/plugin/awkeysaggregator.cpp index c50f331..9837d2b 100644 --- a/sources/awesome-widget/plugin/awkeysaggregator.cpp +++ b/sources/awesome-widget/plugin/awkeysaggregator.cpp @@ -46,9 +46,13 @@ AWKeysAggregator::AWKeysAggregator(QObject *_parent) // network m_formatter["down"] = FormatterType::NetSmartFormat; m_formatter["downkb"] = FormatterType::Integer; + m_formatter["downtot"] = FormatterType::MemMBFormat; + m_formatter["downtotkb"] = FormatterType::Integer; m_formatter["downunits"] = FormatterType::NetSmartUnits; m_formatter["up"] = FormatterType::NetSmartFormat; m_formatter["upkb"] = FormatterType::Integer; + m_formatter["uptot"] = FormatterType::MemMBFormat; + m_formatter["uptotkb"] = FormatterType::Integer; m_formatter["upunits"] = FormatterType::NetSmartUnits; // swap m_formatter["swap"] = FormatterType::Float; @@ -468,11 +472,11 @@ QStringList AWKeysAggregator::registerSource(const QString &_source, int index = m_devices["net"].indexOf(_source.split('/')[2]); if (index > -1) { // kb - QString key = QString("%1totalkb%2").arg(type).arg(index); + QString key = QString("%1totkb%2").arg(type).arg(index); m_map[_source] = key; m_formatter[key] = FormatterType::Integer; // mb - key = QString("%1total%2").arg(type).arg(index); + key = QString("%1tot%2").arg(type).arg(index); m_map.insertMulti(_source, key); m_formatter[key] = FormatterType::MemMBFormat; } @@ -498,8 +502,8 @@ QStringList AWKeysAggregator::registerSource(const QString &_source, m_formatter["ps"] = FormatterType::List; } else if (_source == "ps/total/count") { // total processes count - m_map[_source] = "pstotal"; - m_formatter["pstotal"] = FormatterType::NoFormat; + m_map[_source] = "pstot"; + m_formatter["pstot"] = FormatterType::NoFormat; } else if (_source.startsWith("quotes")) { // quotes QString key = _source; diff --git a/sources/awesome-widget/plugin/awkeysaggregator.h b/sources/awesome-widget/plugin/awkeysaggregator.h index d29672e..6157dc0 100644 --- a/sources/awesome-widget/plugin/awkeysaggregator.h +++ b/sources/awesome-widget/plugin/awkeysaggregator.h @@ -24,7 +24,6 @@ #include "version.h" - class AWFormatterHelper; class AWKeysAggregator : public QObject diff --git a/sources/awesomewidgets/configs/aw-example-standalonerc b/sources/awesomewidgets/configs/aw-example-standalonerc index 4ca37c7..666c91e 100644 --- a/sources/awesomewidgets/configs/aw-example-standalonerc +++ b/sources/awesomewidgets/configs/aw-example-standalonerc @@ -121,7 +121,7 @@ queueLimit=0 swapTooltip=true swapTooltipColor=#ffff00 tempUnits=Celsius -text="\n

Uptime: $cuptime
\nRAM:  $mem  $bar5
\nSwap: $swap  $bar6
\nCPU:  $cpu  $bar7
\nCPU Temp: $temp0°C
\nDown: $down$downunits    $downtotal
\n$bar8
\nUp:   $up$upunits    $uptotal
\n$bar9

\n\n" +text="\n

Uptime: $cuptime
\nRAM:  $mem  $bar5
\nSwap: $swap  $bar6
\nCPU:  $cpu  $bar7
\nCPU Temp: $temp0°C
\nDown: $down$downunits    $downtot
\n$bar8
\nUp:   $up$upunits    $uptot
\n$bar9

\n\n" textAlign=center tooltipBackground=#ffffff tooltipNumber=100 diff --git a/sources/version.h.in b/sources/version.h.in index a57ecc5..c0c3f91 100644 --- a/sources/version.h.in +++ b/sources/version.h.in @@ -57,10 +57,10 @@ const char STATIC_KEYS[] = "time,isotime,shorttime,longtime,tstime,ctime,uptime,cuptime,cpucl,cpu," "gputemp,gpu,memmb,memgb,memfreemb,memfreegb,memtotmb,memtotgb,memusedmb," "memusedgb,mem,swapmb,swapgb,swapfreemb,swapfreegb,swaptotmb,swaptotgb," - "swap,downunits,upunits,downkb,downtotalkb,downtotal,down,uptotalkb," - "uptotal,upkb,up,netdev,ac,bat,album,artist,duration,progress,title," - "dalbum,dartist,dtitle,salbum,sartist,stitle,pscount,pstotal,ps,desktop," - "ndesktop,tdesktops,la15,la5,la1"; + "swap,downunits,upunits,downkb,downtotkb,downtot,down,uptotkb,uptot,upkb," + "up,netdev,ac,bat,album,artist,duration,progress,title,dalbum,dartist," + "dtitle,salbum,sartist,stitle,pscount,pstot,ps,desktop,ndesktop," + "tdesktops,la15,la5,la1"; #cmakedefine BUILD_FUTURE #cmakedefine BUILD_LOAD #cmakedefine BUILD_TESTING From 5c56f813d28ffed8c0b0fca812721ea51cf88b57 Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Wed, 26 Jul 2017 20:23:26 +0300 Subject: [PATCH 7/9] make tests great again! Also dbus adaptor has been renamed, because it does not allow to register one service for several applications (like plasmashell and plasmawindowed) --- .../awesome-widget/plugin/awdbusadaptor.cpp | 22 +++++++++++++++++++ sources/awesome-widget/plugin/awdbusadaptor.h | 1 + sources/awesome-widget/plugin/awkeycache.cpp | 5 ++--- sources/awesome-widget/plugin/awkeys.cpp | 6 +++-- sources/test/testawkeys.cpp | 3 ++- sources/version.h.in | 1 + 6 files changed, 32 insertions(+), 6 deletions(-) diff --git a/sources/awesome-widget/plugin/awdbusadaptor.cpp b/sources/awesome-widget/plugin/awdbusadaptor.cpp index b5258b1..db6b545 100644 --- a/sources/awesome-widget/plugin/awdbusadaptor.cpp +++ b/sources/awesome-widget/plugin/awdbusadaptor.cpp @@ -17,6 +17,9 @@ #include "awdbusadaptor.h" +#include +#include + #include "awdebug.h" #include "awkeys.h" @@ -35,6 +38,25 @@ AWDBusAdaptor::~AWDBusAdaptor() } +QStringList AWDBusAdaptor::ActiveServices() const +{ + QDBusMessage listServices = QDBusConnection::sessionBus().interface()->call( + QDBus::BlockWithGui, "ListNames"); + if (listServices.arguments().isEmpty()) { + qCWarning(LOG_DBUS) << "Could not find any DBus service"; + return {}; + } + QStringList arguments = listServices.arguments().first().toStringList(); + + return std::accumulate(arguments.cbegin(), arguments.cend(), QStringList(), + [](QStringList &source, QString service) { + if (service.startsWith(AWDBUS_SERVICE)) + source.append(service); + return source; + }); +} + + QString AWDBusAdaptor::Info(const QString &key) const { return m_plugin->infoByKey(key); diff --git a/sources/awesome-widget/plugin/awdbusadaptor.h b/sources/awesome-widget/plugin/awdbusadaptor.h index 5ff888e..f73110f 100644 --- a/sources/awesome-widget/plugin/awdbusadaptor.h +++ b/sources/awesome-widget/plugin/awdbusadaptor.h @@ -37,6 +37,7 @@ public: public slots: // get methods + QStringList ActiveServices() const; QString Info(const QString &key) const; QStringList Keys(const QString ®exp) const; QString Value(const QString &key) const; diff --git a/sources/awesome-widget/plugin/awkeycache.cpp b/sources/awesome-widget/plugin/awkeycache.cpp index d72de54..e6a9f91 100644 --- a/sources/awesome-widget/plugin/awkeycache.cpp +++ b/sources/awesome-widget/plugin/awkeycache.cpp @@ -147,9 +147,8 @@ QStringList AWKeyCache::getRequiredKeys(const QStringList &_keys, used << "swapgb" << "swapfreegb"; // network keys - QStringList netKeys({"up", "upkb", "uptot", "uptotkb", "upunits", - "down", "downkb", "downtot", "downtotkb", - "downunits"}); + QStringList netKeys({"up", "upkb", "uptot", "uptotkb", "upunits", "down", + "downkb", "downtot", "downtotkb", "downunits"}); for (auto &key : netKeys) { if (!used.contains(key)) continue; diff --git a/sources/awesome-widget/plugin/awkeys.cpp b/sources/awesome-widget/plugin/awkeys.cpp index 385f2e1..b069921 100644 --- a/sources/awesome-widget/plugin/awkeys.cpp +++ b/sources/awesome-widget/plugin/awkeys.cpp @@ -327,10 +327,12 @@ void AWKeys::createDBusInterface() // create session QDBusConnection bus = QDBusConnection::sessionBus(); - if (!bus.registerService(AWDBUS_SERVICE)) + // HACK we are going to use different services because it binds to + // application + if (!bus.registerService(QString("%1.i%2").arg(AWDBUS_SERVICE).arg(id))) qCWarning(LOG_AW) << "Could not register DBus service, last error" << bus.lastError().message(); - if (!bus.registerObject(QString("/%1").arg(id), new AWDBusAdaptor(this), + if (!bus.registerObject(AWDBUS_PATH, new AWDBusAdaptor(this), QDBusConnection::ExportAllContents)) qCWarning(LOG_AW) << "Could not register DBus object, last error" << bus.lastError().message(); diff --git a/sources/test/testawkeys.cpp b/sources/test/testawkeys.cpp index c55d2d7..639bfa0 100644 --- a/sources/test/testawkeys.cpp +++ b/sources/test/testawkeys.cpp @@ -174,7 +174,8 @@ void TestAWKeys::test_dbus() // create connection and message QDBusConnection bus = QDBusConnection::sessionBus(); QDBusMessage request = QDBusMessage::createMethodCall( - AWDBUS_SERVICE, QString("/%1").arg(id), AWDBUS_SERVICE, "WhoAmI"); + QString("%1.i%2").arg(AWDBUS_SERVICE).arg(id), AWDBUS_PATH, + AWDBUS_SERVICE, "WhoAmI"); // send message to dbus QDBusMessage response = bus.call(request, QDBus::BlockWithGui); diff --git a/sources/version.h.in b/sources/version.h.in index c0c3f91..56d4ec4 100644 --- a/sources/version.h.in +++ b/sources/version.h.in @@ -44,6 +44,7 @@ const int AW_TELEMETRY_API = 1; // use define here instead of normal const definition for moc #define AWDBUS_SERVICE_NAME "org.kde.plasma.awesomewidget" const char AWDBUS_SERVICE[] = AWDBUS_SERVICE_NAME; +const char AWDBUS_PATH[] = "/awesomewidgets"; // network requests timeout, ms const int REQUEST_TIMEOUT = 3000; // available time keys From 4625afa0b9a09a5d5b63745cfbf06671dccf116b Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Thu, 27 Jul 2017 16:47:20 +0300 Subject: [PATCH 8/9] add docker files, improve dbus interface --- .docker/Dockerfile-arch | 11 +++++++ .docker/Dockerfile-ubuntu | 12 +++++++ .docker/build-arch.sh | 14 ++++++++ .docker/build-ubuntu.sh | 18 ++++++++++ .travis.yml.bckp | 25 +++++--------- sources/awesome-widget/plugin/awactions.cpp | 1 + sources/awesome-widget/plugin/awkeys.cpp | 33 ++++++++++--------- .../plugin/awkeysaggregator.cpp | 4 +++ 8 files changed, 87 insertions(+), 31 deletions(-) create mode 100644 .docker/Dockerfile-arch create mode 100644 .docker/Dockerfile-ubuntu create mode 100755 .docker/build-arch.sh create mode 100755 .docker/build-ubuntu.sh diff --git a/.docker/Dockerfile-arch b/.docker/Dockerfile-arch new file mode 100644 index 0000000..ca63def --- /dev/null +++ b/.docker/Dockerfile-arch @@ -0,0 +1,11 @@ +FROM base/archlinux + +RUN pacman -Sy + +# toolchain +RUN pacman -S --noconfirm base-devel cmake extra-cmake-modules python +# kf5 and qt5 libraries +RUN pacman -S --noconfirm plasma-framework + +# required by tests +RUN pacman -S --noconfirm xorg-server-xvfb diff --git a/.docker/Dockerfile-ubuntu b/.docker/Dockerfile-ubuntu new file mode 100644 index 0000000..ee841fa --- /dev/null +++ b/.docker/Dockerfile-ubuntu @@ -0,0 +1,12 @@ +FROM ubuntu:16.04 + +RUN apt-get update +# toolchain +RUN apt-get install -y cmake extra-cmake-modules g++ git gettext +# kf5 and qt5 libraries +RUN apt-get install -y libkf5i18n-dev libkf5notifications-dev libkf5service-dev \ + libkf5windowsystem-dev plasma-framework-dev qtbase5-dev qtdeclarative5-dev \ + plasma-framework + +# required by tests +RUN apt-get install -y xvfb diff --git a/.docker/build-arch.sh b/.docker/build-arch.sh new file mode 100755 index 0000000..950ae21 --- /dev/null +++ b/.docker/build-arch.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +rm -rf build-arch +mkdir build-arch + +# build +cd build-arch +cmake -DKDE_INSTALL_USE_QT_SYS_PATHS=ON -DCMAKE_BUILD_TYPE=Optimization -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_FUTURE=ON -DBUILD_TESTING=ON ../sources +make + +# tests +xvfb-run make test diff --git a/.docker/build-ubuntu.sh b/.docker/build-ubuntu.sh new file mode 100755 index 0000000..9ec2661 --- /dev/null +++ b/.docker/build-ubuntu.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e + +rm -rf build-ubuntu +mkdir build-ubuntu + +# patches +git apply patches/qt5.6-qversionnumber.patch +git apply patches/qt5.5-qstringlist-and-qinfo.patch + +# build +cd build-ubuntu +cmake -DKDE_INSTALL_USE_QT_SYS_PATHS=ON -DCMAKE_BUILD_TYPE=Optimization -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_FUTURE=ON -DBUILD_TESTING=ON ../sources +make + +# tests +xvfb-run make test diff --git a/.travis.yml.bckp b/.travis.yml.bckp index 0ddd9af..dad2148 100644 --- a/.travis.yml.bckp +++ b/.travis.yml.bckp @@ -1,20 +1,13 @@ sudo: required -dist: trusty -language: cpp -os: - - linux +env: + - DOCKER_TAG="arcan1s/awesome-widgets" -before_script: - - sudo apt-add-repository -y ppa:kubuntu-ppa/backports - - sudo sed -i 's/trusty/wily/g' /etc/apt/sources.list - - sudo sed -i 's/trusty/wily/g' /etc/apt/sources.list.d/kubuntu-ppa-backports-trusty.list - - sudo apt-get -qq update - - sudo apt-get -y -qq -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew install libkf5i18n-dev libkf5notifications-dev libkf5service-dev libkf5windowsystem-dev plasma-framework-dev qtbase5-dev qtdeclarative5-dev extra-cmake-modules cmake g++ - - rm -rf build - - mkdir build +services: + - docker -script: - - cd build - - cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DKDE_INSTALL_USE_QT_SYS_PATHS=ON ../sources - - make +before_install: + - docker build --tag="${DOCKER_TAG}" .docker + +scirpt: + - docker run "${DOCKER_TAG}" .docker/build.sh diff --git a/sources/awesome-widget/plugin/awactions.cpp b/sources/awesome-widget/plugin/awactions.cpp index 2366109..5ba0d69 100644 --- a/sources/awesome-widget/plugin/awactions.cpp +++ b/sources/awesome-widget/plugin/awactions.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include diff --git a/sources/awesome-widget/plugin/awkeys.cpp b/sources/awesome-widget/plugin/awkeys.cpp index b069921..9c8a8c7 100644 --- a/sources/awesome-widget/plugin/awkeys.cpp +++ b/sources/awesome-widget/plugin/awkeys.cpp @@ -326,16 +326,25 @@ void AWKeys::createDBusInterface() qlonglong id = reinterpret_cast(this); // create session - QDBusConnection bus = QDBusConnection::sessionBus(); + QDBusConnection instanceBus = QDBusConnection::sessionBus(); // HACK we are going to use different services because it binds to // application - if (!bus.registerService(QString("%1.i%2").arg(AWDBUS_SERVICE).arg(id))) + if (instanceBus.registerService( + QString("%1.i%2").arg(AWDBUS_SERVICE).arg(id))) { + if (!instanceBus.registerObject(AWDBUS_PATH, new AWDBusAdaptor(this), + QDBusConnection::ExportAllContents)) + qCWarning(LOG_AW) << "Could not register DBus object, last error" + << instanceBus.lastError().message(); + } else { qCWarning(LOG_AW) << "Could not register DBus service, last error" - << bus.lastError().message(); - if (!bus.registerObject(AWDBUS_PATH, new AWDBusAdaptor(this), - QDBusConnection::ExportAllContents)) - qCWarning(LOG_AW) << "Could not register DBus object, last error" - << bus.lastError().message(); + << instanceBus.lastError().message(); + } + + // and same instance but for id independent service + QDBusConnection commonBus = QDBusConnection::sessionBus(); + if (commonBus.registerService(AWDBUS_SERVICE)) + commonBus.registerObject(AWDBUS_PATH, new AWDBusAdaptor(this), + QDBusConnection::ExportAllContents); } @@ -350,14 +359,8 @@ QString AWKeys::parsePattern(QString _pattern) const // main keys for (auto &key : m_foundKeys) - _pattern.replace( - QString("$%1").arg(key), - [this](const QString &tag, const QVariant &value) { - QString strValue = m_aggregator->formatter(value, tag); - if ((!tag.startsWith("custom")) && (!tag.startsWith("weather"))) - strValue.replace(" ", " "); - return strValue; - }(key, m_values[key])); + _pattern.replace(QString("$%1").arg(key), + m_aggregator->formatter(m_values[key], key)); // bars for (auto &bar : m_foundBars) { diff --git a/sources/awesome-widget/plugin/awkeysaggregator.cpp b/sources/awesome-widget/plugin/awkeysaggregator.cpp index 9837d2b..c018cf2 100644 --- a/sources/awesome-widget/plugin/awkeysaggregator.cpp +++ b/sources/awesome-widget/plugin/awkeysaggregator.cpp @@ -186,6 +186,10 @@ QString AWKeysAggregator::formatter(const QVariant &_data, break; } + // replace spaces to non-breakable ones + if (!_key.startsWith("custom") && (!_key.startsWith("weather"))) + output.replace(" ", " "); + return output; } From 5d0c05e8565010b8938acb521f5874adfb200acf Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Thu, 27 Jul 2017 17:20:59 +0300 Subject: [PATCH 9/9] make tests great again (iteration #2) --- sources/test/testawkeys.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sources/test/testawkeys.cpp b/sources/test/testawkeys.cpp index 639bfa0..13c55b8 100644 --- a/sources/test/testawkeys.cpp +++ b/sources/test/testawkeys.cpp @@ -173,6 +173,15 @@ void TestAWKeys::test_dbus() // create connection and message QDBusConnection bus = QDBusConnection::sessionBus(); + + // check if there is active sessions first + QDBusMessage sessions = QDBusMessage::createMethodCall( + AWDBUS_SERVICE, AWDBUS_PATH, AWDBUS_SERVICE, "ActiveServicess"); + QDBusMessage sessionsResponse = bus.call(sessions, QDBus::BlockWithGui); + if (sessionsResponse.arguments().isEmpty()) + QSKIP("No active sessions found, skip DBus tests"); + + // dbus checks QDBusMessage request = QDBusMessage::createMethodCall( QString("%1.i%2").arg(AWDBUS_SERVICE).arg(id), AWDBUS_PATH, AWDBUS_SERVICE, "WhoAmI");