qTox
Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
|
Go to the documentation of this file.
21 #include "ui_generalsettings.h"
23 #include <QFileDialog>
38 static QStringList locales = {
98 :
GenericForm(QPixmap(
":/img/settings/general.png"))
99 , bodyUI(new
Ui::GeneralSettings)
110 #ifndef UPDATE_CHECK_ENABLED
111 bodyUI->checkUpdates->setVisible(
false);
114 #ifndef SPELL_CHECKING
115 bodyUI->cbSpellChecking->setVisible(
false);
120 for (
int i = 0; i < locales.size(); ++i) {
123 if (locales[i].startsWith(QLatin1String(
"eo")))
124 langName = QLocale::languageToString(QLocale::Esperanto);
125 else if (locales[i].startsWith(QLatin1String(
"jbo")))
126 langName = QLatin1String(
"Lojban");
127 else if (locales[i].startsWith(QLatin1String(
"pr")))
128 langName = QLatin1String(
"Pirate");
129 else if (locales[i] == (QLatin1String(
"pt")))
130 langName = QStringLiteral(
"português");
132 langName = QLocale(locales[i]).nativeLanguageName();
134 bodyUI->transComboBox->insertItem(i, langName);
145 bodyUI->showSystemTray->setChecked(showSystemTray);
147 bodyUI->startInTray->setEnabled(showSystemTray);
149 bodyUI->minimizeToTray->setEnabled(showSystemTray);
151 bodyUI->closeToTray->setEnabled(showSystemTray);
162 #ifndef QTOX_PLATFORM_EXT
163 bodyUI->autoAwayLabel->setEnabled(
false);
164 bodyUI->autoAwaySpinBox->setEnabled(
false);
179 const QString& locale = locales[index];
233 int minutes =
bodyUI->autoAwaySpinBox->value();
246 QFileDialog::getExistingDirectory(Q_NULLPTR,
247 tr(
"Choose an auto accept directory",
"popup title"),
249 if (directory.isEmpty())
250 directory = previousDir;
253 bodyUI->autoSaveFilesDir->setText(directory);
258 auto newMaxSizeMB =
bodyUI->maxAutoAcceptSizeMB->value();
259 auto newMaxSizeB = std::lround(newMaxSizeMB * 1024 * 1024);
274 bodyUI->retranslateUi(
this);
void setGlobalAutoAcceptDir(const QString &dir)
bool getCheckUpdates() const
bool getAutostartInTray() const
bool getMinimizeToTray() const
int getAutoAwayTime() const
void setMinimizeToTray(bool newValue)
static void translate(const QString &localeName)
Loads the translations according to the settings or locale.
static void unregister(void *owner)
Unregisters all handlers of an owner.
bool getStatusChangeNotificationEnabled() const
void setAutostartInTray(bool newValue)
void setMaxAutoAcceptSize(size_t size)
bool getSpellCheckingEnabled() const
void setShowGroupJoinLeaveMessages(bool newValue) override
bool getShowSystemTray() const
QString getGlobalAutoAcceptDir() const
void setAutorun(bool newValue)
void setShowSystemTray(bool newValue)
bool getShowGroupJoinLeaveMessages() const override
void setLightTrayIcon(bool newValue)
void setAutoSaveEnabled(bool newValue)
void saveGlobal()
Asynchronous, saves the global settings.
static void registerHandler(const std::function< void()> &, void *owner)
Register a function to be called when the UI needs to be retranslated.
void setCheckUpdates(bool newValue)
static Settings & getInstance()
Returns the singleton instance.
bool getCloseToTray() const
void setCloseToTray(bool newValue)
QString getTranslation() const
void setStatusChangeNotificationEnabled(bool newValue)
bool getAutoSaveEnabled() const
Recursively blocks all signals from an object and its children.
void setTranslation(const QString &newValue)
size_t getMaxAutoAcceptSize() const
void setSpellCheckingEnabled(bool newValue)
void setAutoAwayTime(int newValue)
Sets how long the user may stay idle, before online status is set to "away".
bool getLightTrayIcon() const