refactor: SettingsDialog, no longer need coreProccess in the settings dialog
This commit is contained in:
parent
094cbadf91
commit
690d6a67ef
3 changed files with 5 additions and 9 deletions
|
|
@ -499,7 +499,7 @@ void MainWindow::openGetNewVersionUrl() const
|
||||||
|
|
||||||
void MainWindow::openSettings()
|
void MainWindow::openSettings()
|
||||||
{
|
{
|
||||||
auto dialog = SettingsDialog(this, m_serverConfig, m_coreProcess);
|
auto dialog = SettingsDialog(this, m_serverConfig);
|
||||||
|
|
||||||
if (dialog.exec() == QDialog::Accepted) {
|
if (dialog.exec() == QDialog::Accepted) {
|
||||||
Settings::save();
|
Settings::save();
|
||||||
|
|
|
||||||
|
|
@ -23,11 +23,10 @@
|
||||||
|
|
||||||
using namespace deskflow::gui;
|
using namespace deskflow::gui;
|
||||||
|
|
||||||
SettingsDialog::SettingsDialog(QWidget *parent, const IServerConfig &serverConfig, const CoreProcess &coreProcess)
|
SettingsDialog::SettingsDialog(QWidget *parent, const IServerConfig &serverConfig)
|
||||||
: QDialog(parent),
|
: QDialog(parent),
|
||||||
ui{std::make_unique<Ui::SettingsDialog>()},
|
ui{std::make_unique<Ui::SettingsDialog>()},
|
||||||
m_serverConfig(serverConfig),
|
m_serverConfig(serverConfig)
|
||||||
m_coreProcess(coreProcess)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
@ -269,7 +268,7 @@ void SettingsDialog::updateTlsControlsEnabled()
|
||||||
|
|
||||||
bool SettingsDialog::isClientMode() const
|
bool SettingsDialog::isClientMode() const
|
||||||
{
|
{
|
||||||
return m_coreProcess.mode() == Settings::CoreMode::Client;
|
return Settings::value(Settings::Core::CoreMode) == Settings::CoreMode::Client;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsDialog::updateKeyLengthOnFile(const QString &path)
|
void SettingsDialog::updateKeyLengthOnFile(const QString &path)
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
#include "gui/config/IServerConfig.h"
|
#include "gui/config/IServerConfig.h"
|
||||||
#include "gui/core/CoreProcess.h"
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class SettingsDialog;
|
class SettingsDialog;
|
||||||
|
|
@ -19,13 +18,12 @@ class SettingsDialog;
|
||||||
class SettingsDialog : public QDialog
|
class SettingsDialog : public QDialog
|
||||||
{
|
{
|
||||||
using IServerConfig = deskflow::gui::IServerConfig;
|
using IServerConfig = deskflow::gui::IServerConfig;
|
||||||
using CoreProcess = deskflow::gui::CoreProcess;
|
|
||||||
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void extracted();
|
void extracted();
|
||||||
SettingsDialog(QWidget *parent, const IServerConfig &serverConfig, const CoreProcess &coreProcess);
|
SettingsDialog(QWidget *parent, const IServerConfig &serverConfig);
|
||||||
~SettingsDialog() override;
|
~SettingsDialog() override;
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
|
|
@ -65,5 +63,4 @@ private:
|
||||||
|
|
||||||
std::unique_ptr<Ui::SettingsDialog> ui;
|
std::unique_ptr<Ui::SettingsDialog> ui;
|
||||||
const IServerConfig &m_serverConfig;
|
const IServerConfig &m_serverConfig;
|
||||||
const CoreProcess &m_coreProcess;
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue