diff --git a/sources/awesome-widget/plugin/awkeyoperations.cpp b/sources/awesome-widget/plugin/awkeyoperations.cpp index 72d2c8b..813bfb1 100644 --- a/sources/awesome-widget/plugin/awkeyoperations.cpp +++ b/sources/awesome-widget/plugin/awkeyoperations.cpp @@ -226,8 +226,9 @@ QStringList AWKeyOperations::dictKeys() const allKeys.append(QString("la5")); allKeys.append(QString("la1")); // bars - for (int i = graphicalItems->activeItems().count() -1; i >= 0; i--) - allKeys.append(graphicalItems->activeItems().at(i)->tag(QString("bar"))); + for (int i = graphicalItems->activeItems().count() - 1; i >= 0; i--) + allKeys.append( + graphicalItems->activeItems().at(i)->tag(QString("bar"))); return allKeys; } diff --git a/sources/awesome-widget/plugin/awkeys.cpp b/sources/awesome-widget/plugin/awkeys.cpp index 8251cfe..f5f20f0 100644 --- a/sources/awesome-widget/plugin/awkeys.cpp +++ b/sources/awesome-widget/plugin/awkeys.cpp @@ -210,7 +210,8 @@ void AWKeys::reinitKeys(const QStringList currentKeys) for (auto bar : m_foundBars) { GraphicalItem *item = keyOperator->giByKey(bar); if (item->isCustom()) - item->setUsedKeys(AWPatternFunctions::findKeys(item->bar(), currentKeys)); + item->setUsedKeys( + AWPatternFunctions::findKeys(item->bar(), currentKeys)); else item->setUsedKeys(QStringList() << item->bar()); barKeys.append(item->usedKeys()); @@ -330,26 +331,32 @@ QString AWKeys::parsePattern(QString pattern) const GraphicalItem *item = keyOperator->giByKey(bar); if (item->type() == GraphicalItem::Graph) pattern.replace(QString("$%1").arg(bar), - item->image(QVariant::fromValue>(dataAggregator->getData(item->bar())))); + item->image(QVariant::fromValue>( + dataAggregator->getData(item->bar())))); else { if (item->isCustom()) - pattern.replace(QString("$%1").arg(bar),item->image([this, item](QString bar ){ - QJSEngine engine; - for (auto key : item->usedKeys()) - bar.replace(QString("$%1").arg(key), aggregator->formater(values[key], key)); - qCInfo(LOG_AW) << "Expression" << bar; - QJSValue result = engine.evaluate(bar); - if (result.isError()) { - qCWarning(LOG_AW) << "Uncaught exception at line" - << result.property("lineNumber").toInt() - << ":" << result.toString(); - return QString(); - } else { - return result.toString(); - } - }(item->bar()))); + pattern.replace( + QString("$%1").arg(bar), + item->image([this, item](QString bar) { + QJSEngine engine; + for (auto key : item->usedKeys()) + bar.replace(QString("$%1").arg(key), + aggregator->formater(values[key], key)); + qCInfo(LOG_AW) << "Expression" << bar; + QJSValue result = engine.evaluate(bar); + if (result.isError()) { + qCWarning(LOG_AW) + << "Uncaught exception at line" + << result.property("lineNumber").toInt() << ":" + << result.toString(); + return QString(); + } else { + return result.toString(); + } + }(item->bar()))); else - pattern.replace(QString("$%1").arg(bar),item->image(values[item->bar()])); + pattern.replace(QString("$%1").arg(bar), + item->image(values[item->bar()])); } } diff --git a/sources/awesome-widget/plugin/awupdatehelper.cpp b/sources/awesome-widget/plugin/awupdatehelper.cpp index 32a50e6..78b2839 100644 --- a/sources/awesome-widget/plugin/awupdatehelper.cpp +++ b/sources/awesome-widget/plugin/awupdatehelper.cpp @@ -38,7 +38,7 @@ AWUpdateHelper::AWUpdateHelper(QObject *parent) qCDebug(LOG_AW) << __PRETTY_FUNCTION__; m_foundVersion = QString(VERSION); - m_genericConfig = QString("%1/awesomewidgets/generic.ini") + m_genericConfig = QString("%1/awesomewidgets/general.ini") .arg(QStandardPaths::writableLocation( QStandardPaths::GenericDataLocation)); } diff --git a/sources/awesomewidgets/abstractextitem.h b/sources/awesomewidgets/abstractextitem.h index bc01a81..e2ec0b8 100644 --- a/sources/awesomewidgets/abstractextitem.h +++ b/sources/awesomewidgets/abstractextitem.h @@ -40,7 +40,8 @@ public: const QString desktopName = QString(), const QStringList directories = QStringList()); virtual ~AbstractExtItem(); - virtual AbstractExtItem *copy(const QString _fileName, const int _number) = 0; + virtual AbstractExtItem *copy(const QString _fileName, const int _number) + = 0; void copyDefaults(AbstractExtItem *_other) const; // get methods int apiVersion() const; diff --git a/sources/awesomewidgets/graphicalitem.cpp b/sources/awesomewidgets/graphicalitem.cpp index 7b0a27d..6ceec17 100644 --- a/sources/awesomewidgets/graphicalitem.cpp +++ b/sources/awesomewidgets/graphicalitem.cpp @@ -447,7 +447,8 @@ int GraphicalItem::showConfiguration(const QVariant args) setComment(ui->lineEdit_comment->text()); setApiVersion(AWGIAPI); setCustom(ui->checkBox_custom->isChecked()); - setBar(m_custom ? ui->lineEdit_customValue->text() : ui->comboBox_value->currentText()); + setBar(m_custom ? ui->lineEdit_customValue->text() + : ui->comboBox_value->currentText()); setMaxValue(ui->doubleSpinBox_max->value()); setMinValue(ui->doubleSpinBox_min->value()); setActiveColor(ui->pushButton_activeColor->text().remove(QChar('&'))); diff --git a/sources/translations/awesome-widgets.pot b/sources/translations/awesome-widgets.pot index 1a90bae..0aa7113 100644 --- a/sources/translations/awesome-widgets.pot +++ b/sources/translations/awesome-widgets.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2016-02-03 23:02+0700\n" +"POT-Creation-Date: 2016-02-15 11:43+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -547,9 +547,18 @@ msgstr "" msgid "Use images" msgstr "" +msgid "Use custom formula" +msgstr "" + msgid "Value" msgstr "" +msgid "Max value" +msgstr "" + +msgid "Min value" +msgstr "" + msgid "Active color" msgstr "" diff --git a/sources/translations/en.po b/sources/translations/en.po index 99a4ea9..7d4abd3 100644 --- a/sources/translations/en.po +++ b/sources/translations/en.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2016-02-03 23:02+0700\n" -"PO-Revision-Date: 2016-02-03 23:03+0700\n" +"POT-Creation-Date: 2016-02-15 11:43+0300\n" +"PO-Revision-Date: 2016-02-15 11:43+0300\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: English \n" "Language: ru\n" @@ -556,9 +556,18 @@ msgstr "Timestamp" msgid "Use images" msgstr "Use images" +msgid "Use custom formula" +msgstr "Use custom formula" + msgid "Value" msgstr "Value" +msgid "Max value" +msgstr "Max value" + +msgid "Min value" +msgstr "Min value" + msgid "Active color" msgstr "Active color" diff --git a/sources/translations/es.po b/sources/translations/es.po index 5dcfb6f..25cc4d9 100644 --- a/sources/translations/es.po +++ b/sources/translations/es.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Awesome widgets\n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2016-02-03 23:02+0700\n" +"POT-Creation-Date: 2016-02-15 11:43+0300\n" "PO-Revision-Date: 2015-09-26 22:07+0000\n" "Last-Translator: Ernesto Avilés Vázquez \n" "Language-Team: Spanish (http://www.transifex.com/arcanis/awesome-widgets/" @@ -561,9 +561,21 @@ msgstr "Marca de tiempo" msgid "Use images" msgstr "Usar imágenes" +#, fuzzy +msgid "Use custom formula" +msgstr "Formato personalizado de hora" + msgid "Value" msgstr "Valor" +#, fuzzy +msgid "Max value" +msgstr "Mostrar valor" + +#, fuzzy +msgid "Min value" +msgstr "Mostrar valor" + msgid "Active color" msgstr "Color de activo" diff --git a/sources/translations/fr.po b/sources/translations/fr.po index 4c328a7..c92d48b 100644 --- a/sources/translations/fr.po +++ b/sources/translations/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2016-02-03 23:02+0700\n" +"POT-Creation-Date: 2016-02-15 11:43+0300\n" "PO-Revision-Date: 2015-07-31 22:16+0300\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: French \n" @@ -579,10 +579,22 @@ msgstr "Durée" msgid "Use images" msgstr "" +#, fuzzy +msgid "Use custom formula" +msgstr "Format de l'heure personnalisé" + #, fuzzy msgid "Value" msgstr "Valeur: %1" +#, fuzzy +msgid "Max value" +msgstr "Afficher la valeur" + +#, fuzzy +msgid "Min value" +msgstr "Afficher la valeur" + #, fuzzy msgid "Active color" msgstr "Batterie" diff --git a/sources/translations/nl.po b/sources/translations/nl.po index 6450b0b..14bf75c 100644 --- a/sources/translations/nl.po +++ b/sources/translations/nl.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Awesome widgets\n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2016-02-03 23:02+0700\n" +"POT-Creation-Date: 2016-02-15 11:43+0300\n" "PO-Revision-Date: 2015-08-20 22:52+0300\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: Dutch \n" @@ -579,9 +579,21 @@ msgstr "" msgid "Use images" msgstr "" +#, fuzzy +msgid "Use custom formula" +msgstr "Aangepaste tijdsopmaak" + msgid "Value" msgstr "Waarde" +#, fuzzy +msgid "Max value" +msgstr "Waarde weergeven" + +#, fuzzy +msgid "Min value" +msgstr "Waarde weergeven" + msgid "Active color" msgstr "Actieve kleur" diff --git a/sources/translations/pt_BR.po b/sources/translations/pt_BR.po index 0a46a37..8a4af3c 100644 --- a/sources/translations/pt_BR.po +++ b/sources/translations/pt_BR.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2016-02-03 23:02+0700\n" +"POT-Creation-Date: 2016-02-15 11:43+0300\n" "PO-Revision-Date: 2015-07-31 22:21+0300\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: Russian \n" @@ -570,9 +570,21 @@ msgstr "Hora" msgid "Use images" msgstr "" +#, fuzzy +msgid "Use custom formula" +msgstr "Formato de hora personalizado" + msgid "Value" msgstr "Valor" +#, fuzzy +msgid "Max value" +msgstr "Mostrar valor" + +#, fuzzy +msgid "Min value" +msgstr "Mostrar valor" + msgid "Active color" msgstr "Cor ativa" diff --git a/sources/translations/ru.po b/sources/translations/ru.po index b0207f1..a6abf92 100644 --- a/sources/translations/ru.po +++ b/sources/translations/ru.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2016-02-03 23:02+0700\n" -"PO-Revision-Date: 2016-02-03 23:04+0700\n" +"POT-Creation-Date: 2016-02-15 11:43+0300\n" +"PO-Revision-Date: 2016-02-15 11:44+0300\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: Russian \n" "Language: ru\n" @@ -556,9 +556,18 @@ msgstr "Таймштамп" msgid "Use images" msgstr "Использовать изображения" +msgid "Use custom formula" +msgstr "Использовать свою формулу" + msgid "Value" msgstr "Значение" +msgid "Max value" +msgstr "Максимальное значение" + +msgid "Min value" +msgstr "Минимальное значение" + msgid "Active color" msgstr "Активный цвет" diff --git a/sources/translations/uk.po b/sources/translations/uk.po index 4c527ac..b4e20ce 100644 --- a/sources/translations/uk.po +++ b/sources/translations/uk.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2016-02-03 23:02+0700\n" +"POT-Creation-Date: 2016-02-15 11:43+0300\n" "PO-Revision-Date: 2015-09-27 12:37+0300\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: Ukrainian \n" @@ -582,9 +582,21 @@ msgstr "Відмітка часу" msgid "Use images" msgstr "Використовувати зображення" +#, fuzzy +msgid "Use custom formula" +msgstr "Свій формат часу" + msgid "Value" msgstr "Значення" +#, fuzzy +msgid "Max value" +msgstr "Показати значення" + +#, fuzzy +msgid "Min value" +msgstr "Показати значення" + #, fuzzy msgid "Active color" msgstr "Активний колір" diff --git a/sources/translations/zh.po b/sources/translations/zh.po index 41754da..2933dc1 100644 --- a/sources/translations/zh.po +++ b/sources/translations/zh.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n" -"POT-Creation-Date: 2016-02-03 23:02+0700\n" +"POT-Creation-Date: 2016-02-15 11:43+0300\n" "PO-Revision-Date: 2015-07-31 22:24+0300\n" "Last-Translator: Evgeniy Alekseev \n" "Language-Team: Russian \n" @@ -573,9 +573,19 @@ msgstr "" msgid "Use images" msgstr "" +#, fuzzy +msgid "Use custom formula" +msgstr "自定义时间格式" + msgid "Value" msgstr "" +msgid "Max value" +msgstr "" + +msgid "Min value" +msgstr "" + #, fuzzy msgid "Active color" msgstr "电池使用状态提示颜色"