2012-06-10 16:50:54 +00:00
|
|
|
/*
|
2024-09-17 19:00:25 +00:00
|
|
|
* Deskflow -- mouse and keyboard sharing utility
|
2025-02-25 00:28:21 +00:00
|
|
|
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
2025-01-24 00:11:17 +00:00
|
|
|
* SPDX-FileCopyrightText: (C) 2012 Symless Ltd.
|
|
|
|
|
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
2012-06-10 16:50:54 +00:00
|
|
|
*/
|
|
|
|
|
|
2024-07-22 16:48:02 +00:00
|
|
|
#pragma once
|
2024-11-07 04:28:57 +00:00
|
|
|
#include <QDialog>
|
2021-04-13 10:23:22 +00:00
|
|
|
|
2024-08-08 17:41:59 +00:00
|
|
|
#include "gui/config/IServerConfig.h"
|
|
|
|
|
#include "gui/core/CoreProcess.h"
|
2024-07-22 16:48:02 +00:00
|
|
|
|
2024-11-07 04:28:57 +00:00
|
|
|
namespace Ui {
|
|
|
|
|
class SettingsDialog;
|
|
|
|
|
}
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-11-07 04:28:57 +00:00
|
|
|
class SettingsDialog : public QDialog
|
2024-10-17 18:04:35 +00:00
|
|
|
{
|
2024-09-17 19:00:25 +00:00
|
|
|
using IServerConfig = deskflow::gui::IServerConfig;
|
|
|
|
|
using CoreProcess = deskflow::gui::CoreProcess;
|
2024-08-08 17:41:59 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2024-08-12 15:39:18 +00:00
|
|
|
void extracted();
|
2025-03-10 03:07:01 +00:00
|
|
|
SettingsDialog(QWidget *parent, const IServerConfig &serverConfig, const CoreProcess &coreProcess);
|
2024-11-07 04:28:57 +00:00
|
|
|
~SettingsDialog() override;
|
2024-07-02 19:07:06 +00:00
|
|
|
|
2025-05-31 15:35:37 +00:00
|
|
|
Q_SIGNALS:
|
2024-08-12 15:39:18 +00:00
|
|
|
void shown();
|
|
|
|
|
|
2025-10-27 22:03:48 +00:00
|
|
|
protected:
|
|
|
|
|
void changeEvent(QEvent *e) override;
|
|
|
|
|
|
2024-08-08 17:41:59 +00:00
|
|
|
private:
|
2025-05-20 02:19:19 +00:00
|
|
|
void initConnections() const;
|
2025-02-25 00:54:25 +00:00
|
|
|
void regenCertificates();
|
|
|
|
|
void browseCertificatePath();
|
|
|
|
|
void browseLogPath();
|
|
|
|
|
void setLogToFile(bool logToFile);
|
2024-07-02 19:07:06 +00:00
|
|
|
void accept() override;
|
2024-08-12 15:39:18 +00:00
|
|
|
void showEvent(QShowEvent *event) override;
|
|
|
|
|
bool isClientMode() const;
|
|
|
|
|
void updateTlsControls();
|
|
|
|
|
void updateTlsControlsEnabled();
|
|
|
|
|
void showReadOnlyMessage();
|
2025-10-27 22:03:48 +00:00
|
|
|
void updateText();
|
2024-07-02 19:07:06 +00:00
|
|
|
|
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 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
|
|
|
|
2025-03-19 13:53:22 +00:00
|
|
|
/// @brief updates the setting vaule for key size.
|
2025-05-20 02:19:19 +00:00
|
|
|
void updateRequestedKeySize() const;
|
2025-03-19 13:53:22 +00:00
|
|
|
|
2025-08-25 14:07:42 +00:00
|
|
|
/// @brief update if the log level warning is shown
|
|
|
|
|
void logLevelChanged();
|
|
|
|
|
|
2024-11-07 04:28:57 +00:00
|
|
|
std::unique_ptr<Ui::SettingsDialog> ui;
|
2024-08-08 17:41:59 +00:00
|
|
|
const IServerConfig &m_serverConfig;
|
|
|
|
|
const CoreProcess &m_coreProcess;
|
2012-06-10 16:50:54 +00:00
|
|
|
};
|