mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge pull request #3293
Zetok Zalbavar (1): fix(friendlistwidget): use nullptr instead of `0` agilob (2): feat(i18n): make Markdown settings translatable feat(i18n): Make activity by time labels translated by locale
This commit is contained in:
commit
4f0ef6cd71
|
@ -92,9 +92,6 @@ static QStringList langs = {"Arabic",
|
||||||
"Türkçe",
|
"Türkçe",
|
||||||
"Українська",
|
"Українська",
|
||||||
"简体中文"};
|
"简体中文"};
|
||||||
static QStringList mdPrefs = {"Plaintext",
|
|
||||||
"Show Formatting Characters",
|
|
||||||
"Don't Show Formatting Characters"};
|
|
||||||
|
|
||||||
static QStringList timeFormats = {"hh:mm AP", "hh:mm", "hh:mm:ss AP", "hh:mm:ss"};
|
static QStringList timeFormats = {"hh:mm AP", "hh:mm", "hh:mm:ss AP", "hh:mm:ss"};
|
||||||
// http://doc.qt.io/qt-4.8/qdate.html#fromString
|
// http://doc.qt.io/qt-4.8/qdate.html#fromString
|
||||||
|
@ -116,8 +113,6 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
|
||||||
bodyUI->transComboBox->insertItem(i, langs[i]);
|
bodyUI->transComboBox->insertItem(i, langs[i]);
|
||||||
|
|
||||||
bodyUI->transComboBox->setCurrentIndex(locales.indexOf(Settings::getInstance().getTranslation()));
|
bodyUI->transComboBox->setCurrentIndex(locales.indexOf(Settings::getInstance().getTranslation()));
|
||||||
for (int i = 0; i < mdPrefs.size(); i++)
|
|
||||||
bodyUI->markdownComboBox->insertItem(i, mdPrefs[i]);
|
|
||||||
|
|
||||||
bodyUI->markdownComboBox->setCurrentIndex(Settings::getInstance().getMarkdownPreference());
|
bodyUI->markdownComboBox->setCurrentIndex(Settings::getInstance().getMarkdownPreference());
|
||||||
bodyUI->cbAutorun->setChecked(Settings::getInstance().getAutorun());
|
bodyUI->cbAutorun->setChecked(Settings::getInstance().getAutorun());
|
||||||
|
|
|
@ -39,8 +39,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1277</width>
|
<width>1278</width>
|
||||||
<height>1272</height>
|
<height>1413</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,0,0,1">
|
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,0,0,1">
|
||||||
|
@ -382,6 +382,21 @@ instead of closing itself.</string>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Select Markdown preference.</string>
|
<string>Select Markdown preference.</string>
|
||||||
</property>
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Plaintext</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Show formatting characters</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Don't show formatting characters</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
|
@ -254,28 +254,30 @@ void FriendListWidget::setMode(Mode mode)
|
||||||
currentDate = currentDate.addMonths(-1);
|
currentDate = currentDate.addMonths(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QLocale *ql = new QLocale(Settings::getInstance().getTranslation());
|
||||||
|
|
||||||
CategoryWidget* categoryLast1Month = new CategoryWidget(this);
|
CategoryWidget* categoryLast1Month = new CategoryWidget(this);
|
||||||
categoryLast1Month->setName(QDate::longMonthName(currentDate.month()));
|
categoryLast1Month->setName(ql->monthName(currentDate.month()));
|
||||||
activityLayout->addWidget(categoryLast1Month);
|
activityLayout->addWidget(categoryLast1Month);
|
||||||
|
|
||||||
currentDate = currentDate.addMonths(-1);
|
currentDate = currentDate.addMonths(-1);
|
||||||
CategoryWidget* categoryLast2Month = new CategoryWidget(this);
|
CategoryWidget* categoryLast2Month = new CategoryWidget(this);
|
||||||
categoryLast2Month->setName(QDate::longMonthName(currentDate.month()));
|
categoryLast2Month->setName(ql->monthName(currentDate.month()));
|
||||||
activityLayout->addWidget(categoryLast2Month);
|
activityLayout->addWidget(categoryLast2Month);
|
||||||
|
|
||||||
currentDate = currentDate.addMonths(-1);
|
currentDate = currentDate.addMonths(-1);
|
||||||
CategoryWidget* categoryLast3Month = new CategoryWidget(this);
|
CategoryWidget* categoryLast3Month = new CategoryWidget(this);
|
||||||
categoryLast3Month->setName(QDate::longMonthName(currentDate.month()));
|
categoryLast3Month->setName(ql->monthName(currentDate.month()));
|
||||||
activityLayout->addWidget(categoryLast3Month);
|
activityLayout->addWidget(categoryLast3Month);
|
||||||
|
|
||||||
currentDate = currentDate.addMonths(-1);
|
currentDate = currentDate.addMonths(-1);
|
||||||
CategoryWidget* categoryLast4Month = new CategoryWidget(this);
|
CategoryWidget* categoryLast4Month = new CategoryWidget(this);
|
||||||
categoryLast4Month->setName(QDate::longMonthName(currentDate.month()));
|
categoryLast4Month->setName(ql->monthName(currentDate.month()));
|
||||||
activityLayout->addWidget(categoryLast4Month);
|
activityLayout->addWidget(categoryLast4Month);
|
||||||
|
|
||||||
currentDate = currentDate.addMonths(-1);
|
currentDate = currentDate.addMonths(-1);
|
||||||
CategoryWidget* categoryLast5Month = new CategoryWidget(this);
|
CategoryWidget* categoryLast5Month = new CategoryWidget(this);
|
||||||
categoryLast5Month->setName(QDate::longMonthName(currentDate.month()));
|
categoryLast5Month->setName(ql->monthName(currentDate.month()));
|
||||||
activityLayout->addWidget(categoryLast5Month);
|
activityLayout->addWidget(categoryLast5Month);
|
||||||
|
|
||||||
CategoryWidget* categoryOlder = new CategoryWidget(this);
|
CategoryWidget* categoryOlder = new CategoryWidget(this);
|
||||||
|
@ -286,6 +288,9 @@ void FriendListWidget::setMode(Mode mode)
|
||||||
categoryNever->setName(tr("Unknown", "Category for sorting friends by activity"));
|
categoryNever->setName(tr("Unknown", "Category for sorting friends by activity"));
|
||||||
activityLayout->addWidget(categoryNever);
|
activityLayout->addWidget(categoryNever);
|
||||||
|
|
||||||
|
delete ql;
|
||||||
|
ql = nullptr;
|
||||||
|
|
||||||
QList<Friend*> friendList = FriendList::getAllFriends();
|
QList<Friend*> friendList = FriendList::getAllFriends();
|
||||||
for (Friend* contact : friendList)
|
for (Friend* contact : friendList)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user