mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 15:37:26 -06:00
Made changes for clean up and fix the problem that a new ramdon port is set every time a setting is saved.
This commit is contained in:
committed by
sledgehammer999
parent
7a99eb8e23
commit
75e28bb3e6
@@ -138,6 +138,8 @@ options_imp::options_imp(QWidget *parent):
|
||||
// General tab
|
||||
connect(comboI18n, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton()));
|
||||
connect(checkAltRowColors, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||
//add checkbox for random port
|
||||
connect(checkRandomPort, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||
connect(checkShowSystray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||
connect(checkCloseToSystray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||
connect(checkMinimizeToSysTray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||
@@ -367,6 +369,8 @@ void options_imp::saveOptions() {
|
||||
// General preferences
|
||||
pref.setLocale(locale);
|
||||
pref.setAlternatingRowColors(checkAltRowColors->isChecked());
|
||||
//set random port
|
||||
pref.setRandomPort(checkRandomPort->isChecked());
|
||||
pref.setSystrayIntegration(systrayIntegration());
|
||||
pref.setTrayIconStyle(TrayIcon::Style(comboTrayIcon->currentIndex()));
|
||||
pref.setCloseToTray(closeToTray());
|
||||
@@ -540,6 +544,8 @@ void options_imp::loadOptions() {
|
||||
const Preferences pref;
|
||||
setLocale(pref.getLocale());
|
||||
checkAltRowColors->setChecked(pref.useAlternatingRowColors());
|
||||
//get random port
|
||||
checkRandomPort->setChecked(pref.useRandomPort());
|
||||
checkShowSystray->setChecked(pref.systrayIntegration());
|
||||
checkShowSplash->setChecked(!pref.isSlashScreenDisabled());
|
||||
if (checkShowSystray->isChecked()) {
|
||||
@@ -792,6 +798,7 @@ void options_imp::on_randomButton_clicked() {
|
||||
spinPort->setValue(rand() % 64512 + 1024);
|
||||
}
|
||||
|
||||
|
||||
int options_imp::getEncryptionSetting() const {
|
||||
return comboEncryption->currentIndex();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user