|
|
@ -118,13 +118,18 @@ UserInterfaceForm::UserInterfaceForm(SettingsWidget* myParent) : |
|
|
|
bodyUI->themeColorCBox->setCurrentIndex(s.getThemeColor()); |
|
|
|
bodyUI->themeColorCBox->setCurrentIndex(s.getThemeColor()); |
|
|
|
bodyUI->emoticonSize->setValue(s.getEmojiFontPointSize()); |
|
|
|
bodyUI->emoticonSize->setValue(s.getEmojiFontPointSize()); |
|
|
|
|
|
|
|
|
|
|
|
QStringList timestamps; |
|
|
|
QLocale ql; |
|
|
|
for (QString timestamp : timeFormats) |
|
|
|
timeFormats << ql.timeFormat(QLocale::ShortFormat) |
|
|
|
timestamps << QString("%1 - %2").arg(timestamp, QTime::currentTime().toString(timestamp)); |
|
|
|
<< ql.timeFormat(QLocale::LongFormat); |
|
|
|
|
|
|
|
timeFormats.removeDuplicates(); |
|
|
|
|
|
|
|
|
|
|
|
bodyUI->timestamp->addItems(timestamps); |
|
|
|
for (QString format : timeFormats) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
QString timeExample = QTime::currentTime().toString(format); |
|
|
|
|
|
|
|
QString element = QString("%1 - %2").arg(format, timeExample); |
|
|
|
|
|
|
|
bodyUI->timestamp->addItem(element, format); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QLocale ql; |
|
|
|
|
|
|
|
QStringList dateFormats; |
|
|
|
QStringList dateFormats; |
|
|
|
dateFormats << QStringLiteral("yyyy-MM-dd") // ISO 8601
|
|
|
|
dateFormats << QStringLiteral("yyyy-MM-dd") // ISO 8601
|
|
|
|
|
|
|
|
|
|
|
@ -134,10 +139,6 @@ UserInterfaceForm::UserInterfaceForm(SettingsWidget* myParent) : |
|
|
|
<< ql.dateFormat(QLocale::NarrowFormat); |
|
|
|
<< ql.dateFormat(QLocale::NarrowFormat); |
|
|
|
dateFormats.removeDuplicates(); |
|
|
|
dateFormats.removeDuplicates(); |
|
|
|
|
|
|
|
|
|
|
|
timeFormats.append(ql.timeFormat()); |
|
|
|
|
|
|
|
timeFormats.append(ql.timeFormat(QLocale::LongFormat)); |
|
|
|
|
|
|
|
timeFormats.removeDuplicates(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (QString format : dateFormats) |
|
|
|
for (QString format : dateFormats) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QString dateExample = QDate::currentDate().toString(format); |
|
|
|
QString dateExample = QDate::currentDate().toString(format); |
|
|
@ -176,7 +177,15 @@ void UserInterfaceForm::on_emoticonSize_editingFinished() |
|
|
|
|
|
|
|
|
|
|
|
void UserInterfaceForm::on_timestamp_currentIndexChanged(int index) |
|
|
|
void UserInterfaceForm::on_timestamp_currentIndexChanged(int index) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Settings::getInstance().setTimestampFormat(timeFormats.at(index)); |
|
|
|
Q_UNUSED(index) |
|
|
|
|
|
|
|
QString format = bodyUI->timestamp->currentData().toString(); |
|
|
|
|
|
|
|
Settings::getInstance().setTimestampFormat(format); |
|
|
|
|
|
|
|
Translator::translate(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UserInterfaceForm::on_timestamp_editTextChanged(const QString &format) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Settings::getInstance().setTimestampFormat(format); |
|
|
|
Translator::translate(); |
|
|
|
Translator::translate(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|