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",
|
||||
"Українська",
|
||||
"简体中文"};
|
||||
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"};
|
||||
// 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->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->cbAutorun->setChecked(Settings::getInstance().getAutorun());
|
||||
|
|
|
@ -39,8 +39,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1277</width>
|
||||
<height>1272</height>
|
||||
<width>1278</width>
|
||||
<height>1413</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,0,0,1">
|
||||
|
@ -382,6 +382,21 @@ instead of closing itself.</string>
|
|||
<property name="toolTip">
|
||||
<string>Select Markdown preference.</string>
|
||||
</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>
|
||||
</item>
|
||||
<item>
|
||||
|
|
|
@ -254,28 +254,30 @@ void FriendListWidget::setMode(Mode mode)
|
|||
currentDate = currentDate.addMonths(-1);
|
||||
}
|
||||
|
||||
QLocale *ql = new QLocale(Settings::getInstance().getTranslation());
|
||||
|
||||
CategoryWidget* categoryLast1Month = new CategoryWidget(this);
|
||||
categoryLast1Month->setName(QDate::longMonthName(currentDate.month()));
|
||||
categoryLast1Month->setName(ql->monthName(currentDate.month()));
|
||||
activityLayout->addWidget(categoryLast1Month);
|
||||
|
||||
currentDate = currentDate.addMonths(-1);
|
||||
CategoryWidget* categoryLast2Month = new CategoryWidget(this);
|
||||
categoryLast2Month->setName(QDate::longMonthName(currentDate.month()));
|
||||
categoryLast2Month->setName(ql->monthName(currentDate.month()));
|
||||
activityLayout->addWidget(categoryLast2Month);
|
||||
|
||||
currentDate = currentDate.addMonths(-1);
|
||||
CategoryWidget* categoryLast3Month = new CategoryWidget(this);
|
||||
categoryLast3Month->setName(QDate::longMonthName(currentDate.month()));
|
||||
categoryLast3Month->setName(ql->monthName(currentDate.month()));
|
||||
activityLayout->addWidget(categoryLast3Month);
|
||||
|
||||
currentDate = currentDate.addMonths(-1);
|
||||
CategoryWidget* categoryLast4Month = new CategoryWidget(this);
|
||||
categoryLast4Month->setName(QDate::longMonthName(currentDate.month()));
|
||||
categoryLast4Month->setName(ql->monthName(currentDate.month()));
|
||||
activityLayout->addWidget(categoryLast4Month);
|
||||
|
||||
currentDate = currentDate.addMonths(-1);
|
||||
CategoryWidget* categoryLast5Month = new CategoryWidget(this);
|
||||
categoryLast5Month->setName(QDate::longMonthName(currentDate.month()));
|
||||
categoryLast5Month->setName(ql->monthName(currentDate.month()));
|
||||
activityLayout->addWidget(categoryLast5Month);
|
||||
|
||||
CategoryWidget* categoryOlder = new CategoryWidget(this);
|
||||
|
@ -286,6 +288,9 @@ void FriendListWidget::setMode(Mode mode)
|
|||
categoryNever->setName(tr("Unknown", "Category for sorting friends by activity"));
|
||||
activityLayout->addWidget(categoryNever);
|
||||
|
||||
delete ql;
|
||||
ql = nullptr;
|
||||
|
||||
QList<Friend*> friendList = FriendList::getAllFriends();
|
||||
for (Friend* contact : friendList)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user