refactor: SettingsDialog, use standard object names

This commit is contained in:
sithlord48 2025-02-26 22:16:54 -05:00 committed by Nick Bolton
parent 63744ddbd6
commit 088d69fec8
2 changed files with 292 additions and 285 deletions

View file

@ -36,21 +36,21 @@ SettingsDialog::SettingsDialog(
ui->setupUi(this); ui->setupUi(this);
ui->m_pComboBoxTlsKeyLength->setItemIcon(0, QIcon::fromTheme(QIcon::ThemeIcon::SecurityLow)); ui->comboTlsKeyLength->setItemIcon(0, QIcon::fromTheme(QIcon::ThemeIcon::SecurityLow));
ui->m_pComboBoxTlsKeyLength->setItemIcon(1, QIcon::fromTheme(QStringLiteral("security-medium"))); ui->comboTlsKeyLength->setItemIcon(1, QIcon::fromTheme(QStringLiteral("security-medium")));
ui->m_pComboBoxTlsKeyLength->setItemIcon(2, QIcon::fromTheme(QIcon::ThemeIcon::SecurityHigh)); ui->comboTlsKeyLength->setItemIcon(2, QIcon::fromTheme(QIcon::ThemeIcon::SecurityHigh));
ui->m_pPushButtonTlsRegenCert->setIcon(QIcon::fromTheme(QIcon::ThemeIcon::ViewRefresh)); ui->btnTlsRegenCert->setIcon(QIcon::fromTheme(QIcon::ThemeIcon::ViewRefresh));
ui->m_pPushButtonTlsCertPath->setIcon(QIcon::fromTheme(QIcon::ThemeIcon::DocumentOpen)); ui->btnTlsCertPath->setIcon(QIcon::fromTheme(QIcon::ThemeIcon::DocumentOpen));
ui->m_pButtonBrowseLog->setIcon(QIcon::fromTheme(QIcon::ThemeIcon::DocumentOpen)); ui->btnBrowseLog->setIcon(QIcon::fromTheme(QIcon::ThemeIcon::DocumentOpen));
ui->rb_icon_mono->setIcon(QIcon::fromTheme(QStringLiteral("deskflow-symbolic"))); ui->rbIconMono->setIcon(QIcon::fromTheme(QStringLiteral("deskflow-symbolic")));
ui->rb_icon_colorful->setIcon(QIcon::fromTheme(QStringLiteral("deskflow"))); ui->rbIconColorful->setIcon(QIcon::fromTheme(QStringLiteral("deskflow")));
// force the first tab, since qt creator sets the active tab as the last one // force the first tab, since qt creator sets the active tab as the last one
// the developer was looking at, and it's easy to accidentally save that. // the developer was looking at, and it's easy to accidentally save that.
ui->m_pTabWidget->setCurrentIndex(0); ui->tabWidget->setCurrentIndex(0);
loadFromConfig(); loadFromConfig();
m_wasOriginallySystemScope = m_appConfig.isActiveScopeSystem(); m_wasOriginallySystemScope = m_appConfig.isActiveScopeSystem();
@ -71,15 +71,15 @@ void SettingsDialog::initConnections()
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &SettingsDialog::accept); connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &SettingsDialog::accept);
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &SettingsDialog::reject); connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &SettingsDialog::reject);
connect(ui->m_pCheckBoxEnableTls, &QCheckBox::toggled, this, &SettingsDialog::updateTlsControlsEnabled); connect(ui->cbEnableTls, &QCheckBox::toggled, this, &SettingsDialog::updateTlsControlsEnabled);
connect(ui->m_pCheckBoxServiceEnabled, &QCheckBox::toggled, this, &SettingsDialog::updateControls); connect(ui->cbServiceEnabled, &QCheckBox::toggled, this, &SettingsDialog::updateControls);
connect(ui->m_pPushButtonTlsRegenCert, &QPushButton::clicked, this, &SettingsDialog::regenCertificates); connect(ui->btnTlsRegenCert, &QPushButton::clicked, this, &SettingsDialog::regenCertificates);
connect(ui->m_pPushButtonTlsCertPath, &QPushButton::clicked, this, &SettingsDialog::browseCertificatePath); connect(ui->btnTlsCertPath, &QPushButton::clicked, this, &SettingsDialog::browseCertificatePath);
connect(ui->m_pButtonBrowseLog, &QPushButton::clicked, this, &SettingsDialog::browseLogPath); connect(ui->btnBrowseLog, &QPushButton::clicked, this, &SettingsDialog::browseLogPath);
connect(ui->m_pCheckBoxLogToFile, &QCheckBox::toggled, this, &SettingsDialog::setLogToFile); connect(ui->cbLogToFile, &QCheckBox::toggled, this, &SettingsDialog::setLogToFile);
// We only need to test the System scoped Radio as they are connected // We only need to test the System scoped Radio as they are connected
connect(ui->m_pRadioSystemScope, &QRadioButton::toggled, this, &SettingsDialog::setSystemScope); connect(ui->rbScopeSystem, &QRadioButton::toggled, this, &SettingsDialog::setSystemScope);
} }
void SettingsDialog::regenCertificates() void SettingsDialog::regenCertificates()
@ -92,12 +92,12 @@ void SettingsDialog::regenCertificates()
void SettingsDialog::browseCertificatePath() void SettingsDialog::browseCertificatePath()
{ {
QString fileName = QFileDialog::getSaveFileName( QString fileName = QFileDialog::getSaveFileName(
this, tr("Select a TLS certificate to use..."), ui->m_pLineEditTlsCertPath->text(), "Cert (*.pem)", nullptr, this, tr("Select a TLS certificate to use..."), ui->lineTlsCertPath->text(), "Cert (*.pem)", nullptr,
QFileDialog::DontConfirmOverwrite QFileDialog::DontConfirmOverwrite
); );
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
ui->m_pLineEditTlsCertPath->setText(fileName); ui->lineTlsCertPath->setText(fileName);
if (QFile(fileName).exists()) { if (QFile(fileName).exists()) {
updateKeyLengthOnFile(fileName); updateKeyLengthOnFile(fileName);
@ -109,20 +109,17 @@ void SettingsDialog::browseCertificatePath()
void SettingsDialog::browseLogPath() void SettingsDialog::browseLogPath()
{ {
QString fileName = QFileDialog::getSaveFileName( QString fileName =
this, tr("Save log file to..."), ui->m_pLineEditLogFilename->text(), "Logs (*.log *.txt)" QFileDialog::getSaveFileName(this, tr("Save log file to..."), ui->lineLogFilename->text(), "Logs (*.log *.txt)");
);
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
ui->m_pLineEditLogFilename->setText(fileName); ui->lineLogFilename->setText(fileName);
} }
} }
void SettingsDialog::setLogToFile(bool logToFile) void SettingsDialog::setLogToFile(bool logToFile)
{ {
ui->m_pLabelLogPath->setEnabled(logToFile); ui->widgetLogFilename->setEnabled(logToFile);
ui->m_pLineEditLogFilename->setEnabled(logToFile);
ui->m_pButtonBrowseLog->setEnabled(logToFile);
} }
void SettingsDialog::setSystemScope(bool systemScope) void SettingsDialog::setSystemScope(bool systemScope)
@ -152,25 +149,25 @@ void SettingsDialog::showReadOnlyMessage()
void SettingsDialog::accept() void SettingsDialog::accept()
{ {
m_appConfig.setLoadFromSystemScope(ui->m_pRadioSystemScope->isChecked()); m_appConfig.setLoadFromSystemScope(ui->rbScopeSystem->isChecked());
m_appConfig.setPort(ui->m_pSpinBoxPort->value()); m_appConfig.setPort(ui->sbPort->value());
m_appConfig.setNetworkInterface(ui->m_pLineEditInterface->text()); m_appConfig.setNetworkInterface(ui->lineInterface->text());
m_appConfig.setLogLevel(ui->m_pComboLogLevel->currentIndex()); m_appConfig.setLogLevel(ui->comboLogLevel->currentIndex());
m_appConfig.setLogToFile(ui->m_pCheckBoxLogToFile->isChecked()); m_appConfig.setLogToFile(ui->cbLogToFile->isChecked());
m_appConfig.setLogFilename(ui->m_pLineEditLogFilename->text()); m_appConfig.setLogFilename(ui->lineLogFilename->text());
m_appConfig.setElevateMode(static_cast<ElevateMode>(ui->m_pComboElevate->currentIndex())); m_appConfig.setElevateMode(static_cast<ElevateMode>(ui->comboElevate->currentIndex()));
m_appConfig.setAutoHide(ui->m_pCheckBoxAutoHide->isChecked()); m_appConfig.setAutoHide(ui->cbAutoHide->isChecked());
m_appConfig.setEnableUpdateCheck(ui->m_pCheckBoxAutoUpdate->isChecked()); m_appConfig.setEnableUpdateCheck(ui->cbAutoUpdate->isChecked());
m_appConfig.setPreventSleep(ui->m_pCheckBoxPreventSleep->isChecked()); m_appConfig.setPreventSleep(ui->cbPreventSleep->isChecked());
m_appConfig.setTlsCertPath(ui->m_pLineEditTlsCertPath->text()); m_appConfig.setTlsCertPath(ui->lineTlsCertPath->text());
m_appConfig.setTlsKeyLength(ui->m_pComboBoxTlsKeyLength->currentText().toInt()); m_appConfig.setTlsKeyLength(ui->comboTlsKeyLength->currentText().toInt());
m_appConfig.setTlsEnabled(ui->m_pCheckBoxEnableTls->isChecked()); m_appConfig.setTlsEnabled(ui->cbEnableTls->isChecked());
m_appConfig.setLanguageSync(ui->m_pCheckBoxLanguageSync->isChecked()); m_appConfig.setLanguageSync(ui->cbLanguageSync->isChecked());
m_appConfig.setInvertScrollDirection(ui->m_pCheckBoxScrollDirection->isChecked()); m_appConfig.setInvertScrollDirection(ui->cbScrollDirection->isChecked());
m_appConfig.setEnableService(ui->m_pCheckBoxServiceEnabled->isChecked()); m_appConfig.setEnableService(ui->cbServiceEnabled->isChecked());
m_appConfig.setCloseToTray(ui->m_pCheckBoxCloseToTray->isChecked()); m_appConfig.setCloseToTray(ui->cbCloseToTray->isChecked());
m_appConfig.setColorfulTrayIcon(ui->rb_icon_colorful->isChecked()); m_appConfig.setColorfulTrayIcon(ui->rbIconColorful->isChecked());
m_appConfig.setRequireClientCerts(ui->chkRequireClientCert->isChecked()); m_appConfig.setRequireClientCerts(ui->cbRequireClientCert->isChecked());
QDialog::accept(); QDialog::accept();
} }
@ -188,35 +185,35 @@ void SettingsDialog::reject()
void SettingsDialog::loadFromConfig() void SettingsDialog::loadFromConfig()
{ {
ui->m_pSpinBoxPort->setValue(m_appConfig.port()); ui->sbPort->setValue(m_appConfig.port());
ui->m_pLineEditInterface->setText(m_appConfig.networkInterface()); ui->lineInterface->setText(m_appConfig.networkInterface());
ui->m_pComboLogLevel->setCurrentIndex(m_appConfig.logLevel()); ui->comboLogLevel->setCurrentIndex(m_appConfig.logLevel());
ui->m_pCheckBoxLogToFile->setChecked(m_appConfig.logToFile()); ui->cbLogToFile->setChecked(m_appConfig.logToFile());
ui->m_pLineEditLogFilename->setText(m_appConfig.logFilename()); ui->lineLogFilename->setText(m_appConfig.logFilename());
ui->m_pCheckBoxAutoHide->setChecked(m_appConfig.autoHide()); ui->cbAutoHide->setChecked(m_appConfig.autoHide());
ui->m_pCheckBoxPreventSleep->setChecked(m_appConfig.preventSleep()); ui->cbPreventSleep->setChecked(m_appConfig.preventSleep());
ui->m_pCheckBoxLanguageSync->setChecked(m_appConfig.languageSync()); ui->cbLanguageSync->setChecked(m_appConfig.languageSync());
ui->m_pCheckBoxScrollDirection->setChecked(m_appConfig.invertScrollDirection()); ui->cbScrollDirection->setChecked(m_appConfig.invertScrollDirection());
ui->m_pCheckBoxServiceEnabled->setChecked(m_appConfig.enableService()); ui->cbServiceEnabled->setChecked(m_appConfig.enableService());
ui->m_pCheckBoxCloseToTray->setChecked(m_appConfig.closeToTray()); ui->cbCloseToTray->setChecked(m_appConfig.closeToTray());
ui->m_pComboElevate->setCurrentIndex(static_cast<int>(m_appConfig.elevateMode())); ui->comboElevate->setCurrentIndex(static_cast<int>(m_appConfig.elevateMode()));
if (m_appConfig.enableUpdateCheck().has_value()) { if (m_appConfig.enableUpdateCheck().has_value()) {
ui->m_pCheckBoxAutoUpdate->setChecked(m_appConfig.enableUpdateCheck().value()); ui->cbAutoUpdate->setChecked(m_appConfig.enableUpdateCheck().value());
} else { } else {
ui->m_pCheckBoxAutoUpdate->setChecked(false); ui->cbAutoUpdate->setChecked(false);
} }
if (m_appConfig.isActiveScopeSystem()) { if (m_appConfig.isActiveScopeSystem()) {
ui->m_pRadioSystemScope->setChecked(true); ui->rbScopeSystem->setChecked(true);
} else { } else {
ui->m_pRadioUserScope->setChecked(true); ui->rbScopeUser->setChecked(true);
} }
if (m_appConfig.colorfulTrayIcon()) if (m_appConfig.colorfulTrayIcon())
ui->rb_icon_colorful->setChecked(true); ui->rbIconColorful->setChecked(true);
else else
ui->rb_icon_mono->setChecked(true); ui->rbIconMono->setChecked(true);
qDebug() << "load from config done"; qDebug() << "load from config done";
updateTlsControls(); updateTlsControls();
@ -229,38 +226,38 @@ void SettingsDialog::updateTlsControls()
updateKeyLengthOnFile(m_appConfig.tlsCertPath()); updateKeyLengthOnFile(m_appConfig.tlsCertPath());
} else { } else {
const auto keyLengthText = QString::number(m_appConfig.tlsKeyLength()); const auto keyLengthText = QString::number(m_appConfig.tlsKeyLength());
ui->m_pComboBoxTlsKeyLength->setCurrentIndex(ui->m_pComboBoxTlsKeyLength->findText(keyLengthText)); ui->comboTlsKeyLength->setCurrentIndex(ui->comboTlsKeyLength->findText(keyLengthText));
} }
const auto tlsEnabled = m_tlsUtility.isEnabled(); const auto tlsEnabled = m_tlsUtility.isEnabled();
const auto writable = m_appConfig.isActiveScopeWritable(); const auto writable = m_appConfig.isActiveScopeWritable();
const auto enabled = writable && tlsEnabled; const auto enabled = writable && tlsEnabled;
ui->m_pLineEditTlsCertPath->setText(m_appConfig.tlsCertPath()); ui->lineTlsCertPath->setText(m_appConfig.tlsCertPath());
ui->chkRequireClientCert->setChecked(m_appConfig.requireClientCerts()); ui->cbRequireClientCert->setChecked(m_appConfig.requireClientCerts());
ui->m_pCheckBoxEnableTls->setChecked(tlsEnabled); ui->cbEnableTls->setChecked(tlsEnabled);
ui->m_pCheckBoxEnableTls->setEnabled(writable); ui->cbEnableTls->setEnabled(writable);
ui->m_pComboBoxTlsKeyLength->setEnabled(enabled); ui->comboTlsKeyLength->setEnabled(enabled);
ui->widgetTlsCert->setEnabled(enabled); ui->widgetTlsCert->setEnabled(enabled);
ui->m_pLabelTlsKeyLength->setEnabled(enabled); ui->lblTlsKeyLength->setEnabled(enabled);
ui->m_pPushButtonTlsRegenCert->setEnabled(enabled); ui->btnTlsRegenCert->setEnabled(enabled);
ui->chkRequireClientCert->setEnabled(enabled); ui->cbRequireClientCert->setEnabled(enabled);
} }
void SettingsDialog::updateTlsControlsEnabled() void SettingsDialog::updateTlsControlsEnabled()
{ {
const auto writable = m_appConfig.isActiveScopeWritable(); const auto writable = m_appConfig.isActiveScopeWritable();
const auto clientMode = m_appConfig.clientGroupChecked(); const auto clientMode = m_appConfig.clientGroupChecked();
const auto tlsChecked = ui->m_pCheckBoxEnableTls->isChecked(); const auto tlsChecked = ui->cbEnableTls->isChecked();
auto enabled = writable && tlsChecked && !clientMode; auto enabled = writable && tlsChecked && !clientMode;
ui->m_pLabelTlsKeyLength->setEnabled(enabled); ui->lblTlsKeyLength->setEnabled(enabled);
ui->m_pComboBoxTlsKeyLength->setEnabled(enabled); ui->comboTlsKeyLength->setEnabled(enabled);
ui->m_pLabelTlsCert->setEnabled(enabled); ui->lblTlsCert->setEnabled(enabled);
ui->widgetTlsCert->setEnabled(enabled); ui->widgetTlsCert->setEnabled(enabled);
ui->m_pPushButtonTlsRegenCert->setEnabled(enabled); ui->btnTlsRegenCert->setEnabled(enabled);
ui->chkRequireClientCert->setEnabled(enabled); ui->cbRequireClientCert->setEnabled(enabled);
} }
bool SettingsDialog::isClientMode() const bool SettingsDialog::isClientMode() const
@ -276,8 +273,8 @@ void SettingsDialog::updateKeyLengthOnFile(const QString &path)
} }
auto length = ssl.getCertKeyLength(path); auto length = ssl.getCertKeyLength(path);
auto index = ui->m_pComboBoxTlsKeyLength->findText(QString::number(length)); auto index = ui->comboTlsKeyLength->findText(QString::number(length));
ui->m_pComboBoxTlsKeyLength->setCurrentIndex(index); ui->comboTlsKeyLength->setCurrentIndex(index);
m_appConfig.setTlsKeyLength(length); m_appConfig.setTlsKeyLength(length);
} }
@ -289,34 +286,31 @@ void SettingsDialog::updateControls()
#else #else
// service not supported on unix yet, so always disable. // service not supported on unix yet, so always disable.
const auto serviceAvailable = false; const auto serviceAvailable = false;
ui->m_pGroupService->setTitle("Service (Windows only)"); ui->groupService->setTitle("Service (Windows only)");
#endif #endif
const bool writable = m_appConfig.isActiveScopeWritable(); const bool writable = m_appConfig.isActiveScopeWritable();
const bool serviceChecked = ui->m_pCheckBoxServiceEnabled->isChecked(); const bool serviceChecked = ui->cbServiceEnabled->isChecked();
const bool logToFile = ui->m_pCheckBoxLogToFile->isChecked(); const bool logToFile = ui->cbLogToFile->isChecked();
ui->m_pSpinBoxPort->setEnabled(writable); ui->sbPort->setEnabled(writable);
ui->m_pLineEditInterface->setEnabled(writable); ui->lineInterface->setEnabled(writable);
ui->m_pComboLogLevel->setEnabled(writable); ui->comboLogLevel->setEnabled(writable);
ui->m_pCheckBoxLogToFile->setEnabled(writable); ui->cbLogToFile->setEnabled(writable);
ui->m_pCheckBoxAutoHide->setEnabled(writable); ui->cbAutoHide->setEnabled(writable);
ui->m_pCheckBoxAutoUpdate->setEnabled(writable); ui->cbAutoUpdate->setEnabled(writable);
ui->m_pCheckBoxPreventSleep->setEnabled(writable); ui->cbPreventSleep->setEnabled(writable);
ui->m_pLineEditTlsCertPath->setEnabled(writable); ui->lineTlsCertPath->setEnabled(writable);
ui->m_pComboBoxTlsKeyLength->setEnabled(writable); ui->comboTlsKeyLength->setEnabled(writable);
ui->m_pCheckBoxCloseToTray->setEnabled(writable); ui->cbCloseToTray->setEnabled(writable);
ui->m_pCheckBoxServiceEnabled->setEnabled(writable && serviceAvailable); ui->cbServiceEnabled->setEnabled(writable && serviceAvailable);
ui->m_pLabelElevate->setEnabled(writable && serviceChecked && serviceAvailable); ui->widgetElevate->setEnabled(writable && serviceChecked && serviceAvailable);
ui->m_pComboElevate->setEnabled(writable && serviceChecked && serviceAvailable);
ui->m_pCheckBoxLanguageSync->setEnabled(writable && isClientMode()); ui->cbLanguageSync->setEnabled(writable && isClientMode());
ui->m_pCheckBoxScrollDirection->setEnabled(writable && isClientMode()); ui->cbScrollDirection->setEnabled(writable && isClientMode());
ui->m_pLabelLogPath->setEnabled(writable && logToFile); ui->widgetLogFilename->setEnabled(writable && logToFile);
ui->m_pLineEditLogFilename->setEnabled(writable && logToFile);
ui->m_pButtonBrowseLog->setEnabled(writable && logToFile);
updateTlsControls(); updateTlsControls();
} }

View file

@ -21,14 +21,11 @@
<number>20</number> <number>20</number>
</property> </property>
<item> <item>
<widget class="QTabWidget" name="m_pTabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="tabPosition"> <property name="tabPosition">
<enum>QTabWidget::TabPosition::North</enum> <enum>QTabWidget::TabPosition::North</enum>
</property> </property>
<property name="currentIndex"> <widget class="QWidget" name="tabRegular">
<number>0</number>
</property>
<widget class="QWidget" name="m_pTabRegular">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -43,7 +40,7 @@
<number>15</number> <number>15</number>
</property> </property>
<item> <item>
<widget class="QGroupBox" name="m_pGroupBasics"> <widget class="QGroupBox" name="groupBasics">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -55,21 +52,21 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<widget class="QCheckBox" name="m_pCheckBoxPreventSleep"> <widget class="QCheckBox" name="cbPreventSleep">
<property name="text"> <property name="text">
<string>Prevent this computer from going to sleep</string> <string>Prevent this computer from going to sleep</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="m_pCheckBoxLanguageSync"> <widget class="QCheckBox" name="cbLanguageSync">
<property name="text"> <property name="text">
<string>Use server's keyboard language on this computer (client mode)</string> <string>Use server's keyboard language on this computer (client mode)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="m_pCheckBoxScrollDirection"> <widget class="QCheckBox" name="cbScrollDirection">
<property name="text"> <property name="text">
<string>Invert scroll direction on this computer (client mode)</string> <string>Invert scroll direction on this computer (client mode)</string>
</property> </property>
@ -79,7 +76,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="m_pGroupApp"> <widget class="QGroupBox" name="groupApp">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -91,21 +88,21 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="QVBoxLayout" name="verticalLayout_5">
<item> <item>
<widget class="QCheckBox" name="m_pCheckBoxAutoUpdate"> <widget class="QCheckBox" name="cbAutoUpdate">
<property name="text"> <property name="text">
<string>Check for updates on startup </string> <string>Check for updates on startup </string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="m_pCheckBoxCloseToTray"> <widget class="QCheckBox" name="cbCloseToTray">
<property name="text"> <property name="text">
<string>Leave app running in notification area when the window is closed</string> <string>Leave app running in notification area when the window is closed</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="m_pCheckBoxAutoHide"> <widget class="QCheckBox" name="cbAutoHide">
<property name="text"> <property name="text">
<string>Hide the window when the app starts</string> <string>Hide the window when the app starts</string>
</property> </property>
@ -121,14 +118,14 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QRadioButton" name="rb_icon_colorful"> <widget class="QRadioButton" name="rbIconColorful">
<property name="text"> <property name="text">
<string>Colorful</string> <string>Colorful</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QRadioButton" name="rb_icon_mono"> <widget class="QRadioButton" name="rbIconMono">
<property name="text"> <property name="text">
<string>Monocolor</string> <string>Monocolor</string>
</property> </property>
@ -140,7 +137,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="m_pGroupSecurity"> <widget class="QGroupBox" name="groupSecurity">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -166,7 +163,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QCheckBox" name="m_pCheckBoxEnableTls"> <widget class="QCheckBox" name="cbEnableTls">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -189,7 +186,7 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QLabel" name="m_pLabelTlsKeyLength"> <widget class="QLabel" name="lblTlsKeyLength">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -202,7 +199,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="m_pComboBoxTlsKeyLength"> <widget class="QComboBox" name="comboTlsKeyLength">
<property name="currentText"> <property name="currentText">
<string>1024</string> <string>1024</string>
</property> </property>
@ -232,7 +229,7 @@
<number>1</number> <number>1</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="m_pLabelTlsCert"> <widget class="QLabel" name="lblTlsCert">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -261,7 +258,7 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="m_pLineEditTlsCertPath"> <widget class="QLineEdit" name="lineTlsCertPath">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
@ -271,7 +268,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="m_pPushButtonTlsCertPath"> <widget class="QPushButton" name="btnTlsCertPath">
<property name="cursor"> <property name="cursor">
<cursorShape>PointingHandCursor</cursorShape> <cursorShape>PointingHandCursor</cursorShape>
</property> </property>
@ -305,7 +302,7 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="m_pPushButtonTlsRegenCert"> <widget class="QPushButton" name="btnTlsRegenCert">
<property name="text"> <property name="text">
<string>Regenerate certificate</string> <string>Regenerate certificate</string>
</property> </property>
@ -314,7 +311,7 @@
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="chkRequireClientCert"> <widget class="QCheckBox" name="cbRequireClientCert">
<property name="text"> <property name="text">
<string>Require client certificates</string> <string>Require client certificates</string>
</property> </property>
@ -325,7 +322,7 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="m_pTabAdvanced"> <widget class="QWidget" name="tabAdvanced">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -340,7 +337,7 @@
<number>15</number> <number>15</number>
</property> </property>
<item> <item>
<widget class="QGroupBox" name="m_pGroupNetworking"> <widget class="QGroupBox" name="groupNetworking">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -357,7 +354,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="m_pLabel_20"> <widget class="QLabel" name="lblPort">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -370,7 +367,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QSpinBox" name="m_pSpinBoxPort"> <widget class="QSpinBox" name="sbPort">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -389,7 +386,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="m_pLabel_21"> <widget class="QLabel" name="lblNetworkIp">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -402,7 +399,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="m_pLineEditInterface"> <widget class="QLineEdit" name="lineInterface">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -414,7 +411,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="m_pGroupLogs"> <widget class="QGroupBox" name="groupLogs">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -448,14 +445,14 @@
</spacer> </spacer>
</item> </item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QCheckBox" name="m_pCheckBoxLogToFile"> <widget class="QCheckBox" name="cbLogToFile">
<property name="text"> <property name="text">
<string>Log to file</string> <string>Log to file</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="3"> <item row="0" column="3">
<widget class="QComboBox" name="m_pComboLogLevel"> <widget class="QComboBox" name="comboLogLevel">
<item> <item>
<property name="text"> <property name="text">
<string>Info</string> <string>Info</string>
@ -479,7 +476,7 @@
</widget> </widget>
</item> </item>
<item row="0" column="2"> <item row="0" column="2">
<widget class="QLabel" name="m_pLabel_3"> <widget class="QLabel" name="lblLogLevel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -498,15 +495,22 @@
</widget> </widget>
</item> </item>
<item row="1" column="0" colspan="4"> <item row="1" column="0" colspan="4">
<widget class="QWidget" name="widgetLogFilename" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="spacing"> <property name="spacing">
<number>3</number> <number>3</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>1</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="m_pLabelLogPath"> <widget class="QLabel" name="labelLogPath">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -535,9 +539,9 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="m_pLineEditLogFilename"> <widget class="QLineEdit" name="lineLogFilename">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>true</bool>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@ -548,9 +552,9 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="m_pButtonBrowseLog"> <widget class="QPushButton" name="btnBrowseLog">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>true</bool>
</property> </property>
<property name="cursor"> <property name="cursor">
<cursorShape>PointingHandCursor</cursorShape> <cursorShape>PointingHandCursor</cursorShape>
@ -564,12 +568,13 @@
</widget> </widget>
</item> </item>
</layout> </layout>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="m_pGroupService"> <widget class="QGroupBox" name="groupService">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -580,10 +585,38 @@
<string>Service</string> <string>Service</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QCheckBox" name="cbServiceEnabled">
<property name="toolTip">
<string>Whether to launch the server or client process through the Windows background
service or direct from the GUI.</string>
</property>
<property name="whatsThis">
<string>
&lt;p&gt;The background service is only available on Windows.&lt;/p&gt;
&lt;p&gt;The Windows background service is used to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Start the server or client automatically when the computer starts.&lt;/li&gt;
&lt;li&gt;Run the server or client in an elevated mode (e.g. on login screen, UAC dialogs, etc).&lt;/li&gt;
&lt;/ul&gt;
</string>
</property>
<property name="text">
<string>Use background service (daemon)</string>
</property>
</widget>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QWidget" name="widgetElevate" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_9"> <layout class="QHBoxLayout" name="horizontalLayout_9">
<item> <item>
<widget class="QLabel" name="m_pLabelElevate"> <widget class="QLabel" name="lblElevate">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -596,7 +629,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="m_pComboElevate"> <widget class="QComboBox" name="comboElevate">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -646,33 +679,13 @@
</widget> </widget>
</item> </item>
</layout> </layout>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="m_pCheckBoxServiceEnabled">
<property name="toolTip">
<string>Whether to launch the server or client process through the Windows background
service or direct from the GUI.</string>
</property>
<property name="whatsThis">
<string>
&lt;p&gt;The background service is only available on Windows.&lt;/p&gt;
&lt;p&gt;The Windows background service is used to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Start the server or client automatically when the computer starts.&lt;/li&gt;
&lt;li&gt;Run the server or client in an elevated mode (e.g. on login screen, UAC dialogs, etc).&lt;/li&gt;
&lt;/ul&gt;
</string>
</property>
<property name="text">
<string>Use background service (daemon)</string>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="m_pGroupScope"> <widget class="QGroupBox" name="groupScope">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -684,7 +697,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>
<widget class="QRadioButton" name="m_pRadioUserScope"> <widget class="QRadioButton" name="rbScopeUser">
<property name="text"> <property name="text">
<string>Current user</string> <string>Current user</string>
</property> </property>
@ -694,7 +707,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QRadioButton" name="m_pRadioSystemScope"> <widget class="QRadioButton" name="rbScopeSystem">
<property name="text"> <property name="text">
<string>All users</string> <string>All users</string>
</property> </property>
@ -723,20 +736,20 @@
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>m_pSpinBoxPort</tabstop> <tabstop>sbPort</tabstop>
<tabstop>m_pLineEditInterface</tabstop> <tabstop>lineInterface</tabstop>
<tabstop>m_pCheckBoxEnableTls</tabstop> <tabstop>cbEnableTls</tabstop>
<tabstop>m_pComboBoxTlsKeyLength</tabstop> <tabstop>comboTlsKeyLength</tabstop>
<tabstop>m_pLineEditTlsCertPath</tabstop> <tabstop>lineTlsCertPath</tabstop>
<tabstop>m_pPushButtonTlsCertPath</tabstop> <tabstop>btnTlsCertPath</tabstop>
<tabstop>m_pPushButtonTlsRegenCert</tabstop> <tabstop>btnTlsRegenCert</tabstop>
<tabstop>m_pCheckBoxLogToFile</tabstop> <tabstop>cbLogToFile</tabstop>
<tabstop>m_pComboLogLevel</tabstop> <tabstop>comboLogLevel</tabstop>
<tabstop>m_pLineEditLogFilename</tabstop> <tabstop>lineLogFilename</tabstop>
<tabstop>m_pButtonBrowseLog</tabstop> <tabstop>btnBrowseLog</tabstop>
<tabstop>m_pRadioUserScope</tabstop> <tabstop>rbScopeUser</tabstop>
<tabstop>m_pRadioSystemScope</tabstop> <tabstop>rbScopeSystem</tabstop>
<tabstop>m_pComboElevate</tabstop> <tabstop>comboElevate</tabstop>
</tabstops> </tabstops>
<resources/> <resources/>
<connections/> <connections/>