2012-06-10 16:50:54 +00:00
|
|
|
/*
|
|
|
|
|
* synergy -- mouse and keyboard sharing utility
|
2024-07-22 16:48:02 +00:00
|
|
|
* Copyright (C) 2012 Symless Ltd.
|
2012-06-10 16:50:54 +00:00
|
|
|
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
2024-07-02 19:07:06 +00:00
|
|
|
*
|
2012-06-10 16:50:54 +00:00
|
|
|
* This package is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
2015-05-03 02:33:52 +00:00
|
|
|
* found in the file LICENSE that should have accompanied this file.
|
2024-07-02 19:07:06 +00:00
|
|
|
*
|
2012-06-10 16:50:54 +00:00
|
|
|
* This package is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2024-07-22 16:48:02 +00:00
|
|
|
#pragma once
|
2012-06-10 16:50:54 +00:00
|
|
|
|
|
|
|
|
#include "ui_SettingsDialogBase.h"
|
2021-04-13 10:23:22 +00:00
|
|
|
|
2024-08-09 08:08:29 +00:00
|
|
|
#include "gui/config/IAppConfig.h"
|
2024-08-08 17:41:59 +00:00
|
|
|
#include "gui/config/IServerConfig.h"
|
|
|
|
|
#include "gui/core/CoreProcess.h"
|
2024-08-07 14:05:18 +00:00
|
|
|
#include "gui/core/CoreTool.h"
|
|
|
|
|
#include "gui/tls/TlsUtility.h"
|
2024-08-09 08:08:29 +00:00
|
|
|
#include "gui/validators/ValidationError.h"
|
2024-07-26 22:53:52 +00:00
|
|
|
#include "license/License.h"
|
2024-07-22 16:48:02 +00:00
|
|
|
|
|
|
|
|
#include <QDialog>
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
class SettingsDialog : public QDialog, public Ui::SettingsDialogBase {
|
2024-08-09 08:08:29 +00:00
|
|
|
using IAppConfig = synergy::gui::IAppConfig;
|
2024-08-08 17:41:59 +00:00
|
|
|
using IServerConfig = synergy::gui::IServerConfig;
|
|
|
|
|
using CoreProcess = synergy::gui::CoreProcess;
|
|
|
|
|
using License = synergy::license::License;
|
|
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2024-07-26 22:53:52 +00:00
|
|
|
SettingsDialog(
|
2024-08-09 08:08:29 +00:00
|
|
|
QWidget *parent, IAppConfig &appConfig, const IServerConfig &serverConfig,
|
|
|
|
|
const License &license, const CoreProcess &coreProcess);
|
2024-07-02 19:07:06 +00:00
|
|
|
|
2024-08-08 17:41:59 +00:00
|
|
|
private slots:
|
2024-08-09 08:08:29 +00:00
|
|
|
void on_m_pCheckBoxEnableTls_clicked(bool checked);
|
2024-08-08 17:41:59 +00:00
|
|
|
void on_m_pCheckBoxLogToFile_stateChanged(int);
|
|
|
|
|
void on_m_pButtonBrowseLog_clicked();
|
|
|
|
|
void on_m_pRadioSystemScope_toggled(bool checked);
|
2024-08-09 08:08:29 +00:00
|
|
|
void on_m_pPushButtonTlsCertPath_clicked();
|
|
|
|
|
void on_m_pComboBoxTlsKeyLength_currentIndexChanged(int index);
|
|
|
|
|
void on_m_pPushButtonTlsRegenCert_clicked();
|
2024-08-08 17:41:59 +00:00
|
|
|
void on_m_pCheckBoxServiceEnabled_toggled(bool checked);
|
|
|
|
|
|
|
|
|
|
private:
|
2024-07-02 19:07:06 +00:00
|
|
|
void accept() override;
|
|
|
|
|
void reject() override;
|
|
|
|
|
|
2024-07-22 16:48:02 +00:00
|
|
|
/// @brief Load all settings.
|
2024-07-02 19:07:06 +00:00
|
|
|
void loadFromConfig();
|
|
|
|
|
|
2024-07-22 16:48:02 +00:00
|
|
|
/// @brief Enables or disables the TLS regenerate button.
|
|
|
|
|
void updateTlsRegenerateButton();
|
2024-07-02 19:07:06 +00:00
|
|
|
|
2024-07-22 16:48:02 +00:00
|
|
|
/// @brief Updates the key length value based on the loaded file.
|
2024-07-02 19:07:06 +00:00
|
|
|
void updateKeyLengthOnFile(const QString &path);
|
|
|
|
|
|
2024-07-22 16:48:02 +00:00
|
|
|
/// @brief Enables controls when they should be.
|
2024-08-08 17:41:59 +00:00
|
|
|
void updateControls();
|
2024-07-02 19:07:06 +00:00
|
|
|
|
|
|
|
|
bool isClientMode() const;
|
2024-07-22 16:48:02 +00:00
|
|
|
void updateTlsControls();
|
|
|
|
|
void updateTlsControlsEnabled();
|
2024-07-02 19:07:06 +00:00
|
|
|
|
2024-08-07 14:05:18 +00:00
|
|
|
[[no_unique_address]] CoreTool m_coreTool;
|
2024-08-01 00:13:01 +00:00
|
|
|
validators::ValidationError *m_pScreenNameError;
|
2024-07-02 19:07:06 +00:00
|
|
|
|
|
|
|
|
/// @brief Stores settings scope at start of settings dialog
|
2024-08-08 17:41:59 +00:00
|
|
|
/// This is necessary to restore state if user changes
|
2024-07-02 19:07:06 +00:00
|
|
|
/// the scope and doesn't save changes
|
2024-08-03 00:17:29 +00:00
|
|
|
bool m_wasOriginallySystemScope = false;
|
2024-07-02 19:07:06 +00:00
|
|
|
|
2024-08-09 08:08:29 +00:00
|
|
|
IAppConfig &m_appConfig;
|
2024-08-08 17:41:59 +00:00
|
|
|
const IServerConfig &m_serverConfig;
|
|
|
|
|
const License &m_license;
|
|
|
|
|
const CoreProcess &m_coreProcess;
|
|
|
|
|
synergy::gui::TlsUtility m_tlsUtility;
|
2012-06-10 16:50:54 +00:00
|
|
|
};
|