Cosmetic commit

* apply clangformat settings
* update translations
* rename settings
This commit is contained in:
Evgenii Alekseev 2016-02-16 08:46:43 +03:00
parent 362f1fd87e
commit 95a5eec108
14 changed files with 141 additions and 34 deletions

View File

@ -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;
}

View File

@ -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<QList<float>>(dataAggregator->getData(item->bar()))));
item->image(QVariant::fromValue<QList<float>>(
dataAggregator->getData(item->bar()))));
else {
if (item->isCustom())
pattern.replace(QString("$%1").arg(bar),item->image([this, item](QString 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));
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();
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()]));
}
}

View File

@ -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));
}

View File

@ -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;

View File

@ -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('&')));

View File

@ -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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@ -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 <esalexeev@gmail.com>\n"
"Language-Team: English <kde-russian@lists.kde.ru>\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"

View File

@ -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 <whippiii@gmail.com>\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"

View File

@ -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 <esalexeev@gmail.com>\n"
"Language-Team: French <kde-russian@lists.kde.ru>\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"

View File

@ -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 <esalexeev@gmail.com>\n"
"Language-Team: Dutch <kde-i18n-nl@kde.org>\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"

View File

@ -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 <esalexeev@gmail.com>\n"
"Language-Team: Russian <kde-russian@lists.kde.ru>\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"

View File

@ -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 <esalexeev@gmail.com>\n"
"Language-Team: Russian <kde-russian@lists.kde.ru>\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 "Активный цвет"

View File

@ -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 <esalexeev@gmail.com>\n"
"Language-Team: Ukrainian <kde-russian@lists.kde.ru>\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 "Активний колір"

View File

@ -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 <esalexeev@gmail.com>\n"
"Language-Team: Russian <kde-russian@lists.kde.ru>\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 "电池使用状态提示颜色"