1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

put tr list in "alphabetical" order

This commit is contained in:
Dubslow 2014-11-29 22:32:12 -06:00
parent a004fc872f
commit 6452cfa702
No known key found for this signature in database
GPG Key ID: 3DB8E05315C220AA

View File

@ -30,23 +30,23 @@
#include "src/autoupdate.h" #include "src/autoupdate.h"
static QStringList locales = {"bg", "de", "en", "fr", "es", "it", "mannol", "pirate", "pl", "ru", "fi", "sv", "uk"}; static QStringList locales = {"bg", "de", "en", "es", "fr", "it", "mannol", "pirate", "pl", "ru", "fi", "sv", "uk"};
static QStringList langs = {"Български", "Deutsch", "English", "Français", "Español", "Italiano", "mannol", "Pirate", "Polski", "Русский", "Suomi", "Svenska", "Українська"}; static QStringList langs = {"Български", "Deutsch", "English", "Español", "Français", "Italiano", "mannol", "Pirate", "Polski", "Русский", "Suomi", "Svenska", "Українська"};
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"};
GeneralForm::GeneralForm(SettingsWidget *myParent) : GeneralForm::GeneralForm(SettingsWidget *myParent) :
GenericForm(tr("General"), QPixmap(":/img/settings/general.png")) GenericForm(tr("General"), QPixmap(":/img/settings/general.png"))
{ {
parent = myParent; parent = myParent;
bodyUI = new Ui::GeneralSettings; bodyUI = new Ui::GeneralSettings;
bodyUI->setupUi(this); bodyUI->setupUi(this);
bodyUI->checkUpdates->setVisible(AUTOUPDATE_ENABLED); bodyUI->checkUpdates->setVisible(AUTOUPDATE_ENABLED);
bodyUI->checkUpdates->setChecked(Settings::getInstance().getCheckUpdates()); bodyUI->checkUpdates->setChecked(Settings::getInstance().getCheckUpdates());
bodyUI->trayLayout->addStretch(); bodyUI->trayLayout->addStretch();
bodyUI->cbEnableIPv6->setChecked(Settings::getInstance().getEnableIPv6()); bodyUI->cbEnableIPv6->setChecked(Settings::getInstance().getEnableIPv6());
for (int i = 0; i < langs.size(); i++) for (int i = 0; i < langs.size(); i++)
bodyUI->transComboBox->insertItem(i, langs[i]); bodyUI->transComboBox->insertItem(i, langs[i]);
@ -62,7 +62,7 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
bodyUI->autoSaveFilesDir->setText(Settings::getInstance().getGlobalAutoAcceptDir()); bodyUI->autoSaveFilesDir->setText(Settings::getInstance().getGlobalAutoAcceptDir());
bodyUI->showInFront->setChecked(Settings::getInstance().getShowInFront()); bodyUI->showInFront->setChecked(Settings::getInstance().getShowInFront());
bodyUI->cbFauxOfflineMessaging->setChecked(Settings::getInstance().getFauxOfflineMessaging()); bodyUI->cbFauxOfflineMessaging->setChecked(Settings::getInstance().getFauxOfflineMessaging());
for (auto entry : SmileyPack::listSmileyPacks()) for (auto entry : SmileyPack::listSmileyPacks())
{ {
bodyUI->smileyPackBrowser->addItem(entry.first, entry.second); bodyUI->smileyPackBrowser->addItem(entry.first, entry.second);
@ -72,31 +72,31 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
bodyUI->styleBrowser->addItem(tr("None")); bodyUI->styleBrowser->addItem(tr("None"));
bodyUI->styleBrowser->addItems(QStyleFactory::keys()); bodyUI->styleBrowser->addItems(QStyleFactory::keys());
if(QStyleFactory::keys().contains(Settings::getInstance().getStyle())) if(QStyleFactory::keys().contains(Settings::getInstance().getStyle()))
bodyUI->styleBrowser->setCurrentText(Settings::getInstance().getStyle()); bodyUI->styleBrowser->setCurrentText(Settings::getInstance().getStyle());
else else
bodyUI->styleBrowser->setCurrentText(tr("None")); bodyUI->styleBrowser->setCurrentText(tr("None"));
for (QString color : Style::themeColorNames) for (QString color : Style::themeColorNames)
bodyUI->themeColorCBox->addItem(color); bodyUI->themeColorCBox->addItem(color);
bodyUI->themeColorCBox->setCurrentIndex(Settings::getInstance().getThemeColor()); bodyUI->themeColorCBox->setCurrentIndex(Settings::getInstance().getThemeColor());
bodyUI->emoticonSize->setValue(Settings::getInstance().getEmojiFontPointSize()); bodyUI->emoticonSize->setValue(Settings::getInstance().getEmojiFontPointSize());
QStringList timestamps; QStringList timestamps;
timestamps << QString("%1 - %2").arg(timeFormats[0],QTime::currentTime().toString(timeFormats[0])) timestamps << QString("%1 - %2").arg(timeFormats[0],QTime::currentTime().toString(timeFormats[0]))
<< QString("%1 - %2").arg(timeFormats[1],QTime::currentTime().toString(timeFormats[1])) << QString("%1 - %2").arg(timeFormats[1],QTime::currentTime().toString(timeFormats[1]))
<< QString("%1 - %2").arg(timeFormats[2],QTime::currentTime().toString(timeFormats[2])) << QString("%1 - %2").arg(timeFormats[2],QTime::currentTime().toString(timeFormats[2]))
<< QString("%1 - %2").arg(timeFormats[3],QTime::currentTime().toString(timeFormats[3])); << QString("%1 - %2").arg(timeFormats[3],QTime::currentTime().toString(timeFormats[3]));
bodyUI->timestamp->addItems(timestamps); bodyUI->timestamp->addItems(timestamps);
bodyUI->timestamp->setCurrentText(QString("%1 - %2").arg(Settings::getInstance().getTimestampFormat(), bodyUI->timestamp->setCurrentText(QString("%1 - %2").arg(Settings::getInstance().getTimestampFormat(),
QTime::currentTime().toString(Settings::getInstance().getTimestampFormat())) QTime::currentTime().toString(Settings::getInstance().getTimestampFormat()))
); //idiot proof enough? ); //idiot proof enough?
bodyUI->autoAwaySpinBox->setValue(Settings::getInstance().getAutoAwayTime()); bodyUI->autoAwaySpinBox->setValue(Settings::getInstance().getAutoAwayTime());
bodyUI->cbEnableUDP->setChecked(!Settings::getInstance().getForceTCP()); bodyUI->cbEnableUDP->setChecked(!Settings::getInstance().getForceTCP());
bodyUI->proxyAddr->setText(Settings::getInstance().getProxyAddr()); bodyUI->proxyAddr->setText(Settings::getInstance().getProxyAddr());
int port = Settings::getInstance().getProxyPort(); int port = Settings::getInstance().getProxyPort();
@ -125,12 +125,12 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
connect(bodyUI->smileyPackBrowser, SIGNAL(currentIndexChanged(int)), this, SLOT(onSmileyBrowserIndexChanged(int))); connect(bodyUI->smileyPackBrowser, SIGNAL(currentIndexChanged(int)), this, SLOT(onSmileyBrowserIndexChanged(int)));
connect(bodyUI->styleBrowser, SIGNAL(currentTextChanged(QString)), this, SLOT(onStyleSelected(QString))); connect(bodyUI->styleBrowser, SIGNAL(currentTextChanged(QString)), this, SLOT(onStyleSelected(QString)));
connect(bodyUI->themeColorCBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onThemeColorChanged(int))); connect(bodyUI->themeColorCBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onThemeColorChanged(int)));
connect(bodyUI->emoticonSize, SIGNAL(editingFinished()), this, SLOT(onEmoticonSizeChanged())); connect(bodyUI->emoticonSize, SIGNAL(editingFinished()), this, SLOT(onEmoticonSizeChanged()));
connect(bodyUI->timestamp, SIGNAL(currentIndexChanged(int)), this, SLOT(onTimestampSelected(int))); connect(bodyUI->timestamp, SIGNAL(currentIndexChanged(int)), this, SLOT(onTimestampSelected(int)));
//connection //connection
connect(bodyUI->cbEnableIPv6, &QCheckBox::stateChanged, this, &GeneralForm::onEnableIPv6Updated); connect(bodyUI->cbEnableIPv6, &QCheckBox::stateChanged, this, &GeneralForm::onEnableIPv6Updated);
connect(bodyUI->cbEnableUDP, &QCheckBox::stateChanged, this, &GeneralForm::onUDPUpdated); connect(bodyUI->cbEnableUDP, &QCheckBox::stateChanged, this, &GeneralForm::onUDPUpdated);
connect(bodyUI->cbUseProxy, &QCheckBox::stateChanged, this, &GeneralForm::onUseProxyUpdated); connect(bodyUI->cbUseProxy, &QCheckBox::stateChanged, this, &GeneralForm::onUseProxyUpdated);
connect(bodyUI->proxyAddr, &QLineEdit::editingFinished, this, &GeneralForm::onProxyAddrEdited); connect(bodyUI->proxyAddr, &QLineEdit::editingFinished, this, &GeneralForm::onProxyAddrEdited);
connect(bodyUI->proxyPort, SIGNAL(valueChanged(int)), this, SLOT(onProxyPortEdited(int))); connect(bodyUI->proxyPort, SIGNAL(valueChanged(int)), this, SLOT(onProxyPortEdited(int)));
connect(bodyUI->reconnectButton, &QPushButton::clicked, this, &GeneralForm::onReconnectClicked); connect(bodyUI->reconnectButton, &QPushButton::clicked, this, &GeneralForm::onReconnectClicked);
@ -185,7 +185,7 @@ void GeneralForm::onStyleSelected(QString style)
Settings::getInstance().setStyle("None"); Settings::getInstance().setStyle("None");
else else
Settings::getInstance().setStyle(style); Settings::getInstance().setStyle(style);
this->setStyle(QStyleFactory::create(style)); this->setStyle(QStyleFactory::create(style));
parent->setBodyHeadStyle(style); parent->setBodyHeadStyle(style);
} }
@ -210,7 +210,7 @@ void GeneralForm::onAutoAwayChanged()
void GeneralForm::onAutoAcceptFileChange() void GeneralForm::onAutoAcceptFileChange()
{ {
Settings::getInstance().setAutoSaveEnabled(bodyUI->autoacceptFiles->isChecked()); Settings::getInstance().setAutoSaveEnabled(bodyUI->autoacceptFiles->isChecked());
if(bodyUI->autoacceptFiles->isChecked() == true) if(bodyUI->autoacceptFiles->isChecked() == true)
connect(bodyUI->autoSaveFilesDir, SIGNAL(clicked()), this, SLOT(onAutoSaveDirChange())); connect(bodyUI->autoSaveFilesDir, SIGNAL(clicked()), this, SLOT(onAutoSaveDirChange()));
else else
@ -223,7 +223,7 @@ void GeneralForm::onAutoSaveDirChange()
QString directory = QFileDialog::getExistingDirectory(0, tr("Choose an auto accept directory","popup title")); QString directory = QFileDialog::getExistingDirectory(0, tr("Choose an auto accept directory","popup title"));
if(directory.isEmpty()) if(directory.isEmpty())
directory = previousDir; directory = previousDir;
Settings::getInstance().setGlobalAutoAcceptDir(directory); Settings::getInstance().setGlobalAutoAcceptDir(directory);
bodyUI->autoSaveFilesDir->setText(directory); bodyUI->autoSaveFilesDir->setText(directory);
} }
@ -289,17 +289,17 @@ void GeneralForm::reloadSmiles()
QStringList smiles; QStringList smiles;
smiles << ":)" << ";)" << ":p" << ":O" << ":["; //just in case... smiles << ":)" << ";)" << ":p" << ":O" << ":["; //just in case...
for(int i = 0; i < emoticons.size(); i++) for(int i = 0; i < emoticons.size(); i++)
smiles.push_front(emoticons.at(i).first()); smiles.push_front(emoticons.at(i).first());
int pixSize = 30; int pixSize = 30;
bodyUI->smile1->setPixmap(SmileyPack::getInstance().getAsIcon(smiles[0]).pixmap(pixSize, pixSize)); bodyUI->smile1->setPixmap(SmileyPack::getInstance().getAsIcon(smiles[0]).pixmap(pixSize, pixSize));
bodyUI->smile2->setPixmap(SmileyPack::getInstance().getAsIcon(smiles[1]).pixmap(pixSize, pixSize)); bodyUI->smile2->setPixmap(SmileyPack::getInstance().getAsIcon(smiles[1]).pixmap(pixSize, pixSize));
bodyUI->smile3->setPixmap(SmileyPack::getInstance().getAsIcon(smiles[2]).pixmap(pixSize, pixSize)); bodyUI->smile3->setPixmap(SmileyPack::getInstance().getAsIcon(smiles[2]).pixmap(pixSize, pixSize));
bodyUI->smile4->setPixmap(SmileyPack::getInstance().getAsIcon(smiles[3]).pixmap(pixSize, pixSize)); bodyUI->smile4->setPixmap(SmileyPack::getInstance().getAsIcon(smiles[3]).pixmap(pixSize, pixSize));
bodyUI->smile5->setPixmap(SmileyPack::getInstance().getAsIcon(smiles[4]).pixmap(pixSize, pixSize)); bodyUI->smile5->setPixmap(SmileyPack::getInstance().getAsIcon(smiles[4]).pixmap(pixSize, pixSize));
bodyUI->smile1->setToolTip(smiles[0]); bodyUI->smile1->setToolTip(smiles[0]);
bodyUI->smile2->setToolTip(smiles[1]); bodyUI->smile2->setToolTip(smiles[1]);
bodyUI->smile3->setToolTip(smiles[2]); bodyUI->smile3->setToolTip(smiles[2]);
bodyUI->smile4->setToolTip(smiles[3]); bodyUI->smile4->setToolTip(smiles[3]);