refactor: SettingsDialog, no longer need coreProccess in the settings dialog
This commit is contained in:
committed by
Chris Rizzitello
parent
094cbadf91
commit
690d6a67ef
@ -499,7 +499,7 @@ void MainWindow::openGetNewVersionUrl() const
|
||||
|
||||
void MainWindow::openSettings()
|
||||
{
|
||||
auto dialog = SettingsDialog(this, m_serverConfig, m_coreProcess);
|
||||
auto dialog = SettingsDialog(this, m_serverConfig);
|
||||
|
||||
if (dialog.exec() == QDialog::Accepted) {
|
||||
Settings::save();
|
||||
|
||||
@ -23,11 +23,10 @@
|
||||
|
||||
using namespace deskflow::gui;
|
||||
|
||||
SettingsDialog::SettingsDialog(QWidget *parent, const IServerConfig &serverConfig, const CoreProcess &coreProcess)
|
||||
SettingsDialog::SettingsDialog(QWidget *parent, const IServerConfig &serverConfig)
|
||||
: QDialog(parent),
|
||||
ui{std::make_unique<Ui::SettingsDialog>()},
|
||||
m_serverConfig(serverConfig),
|
||||
m_coreProcess(coreProcess)
|
||||
m_serverConfig(serverConfig)
|
||||
{
|
||||
|
||||
ui->setupUi(this);
|
||||
@ -269,7 +268,7 @@ void SettingsDialog::updateTlsControlsEnabled()
|
||||
|
||||
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)
|
||||
|
||||
@ -10,7 +10,6 @@
|
||||
#include <QDialog>
|
||||
|
||||
#include "gui/config/IServerConfig.h"
|
||||
#include "gui/core/CoreProcess.h"
|
||||
|
||||
namespace Ui {
|
||||
class SettingsDialog;
|
||||
@ -19,13 +18,12 @@ class SettingsDialog;
|
||||
class SettingsDialog : public QDialog
|
||||
{
|
||||
using IServerConfig = deskflow::gui::IServerConfig;
|
||||
using CoreProcess = deskflow::gui::CoreProcess;
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
void extracted();
|
||||
SettingsDialog(QWidget *parent, const IServerConfig &serverConfig, const CoreProcess &coreProcess);
|
||||
SettingsDialog(QWidget *parent, const IServerConfig &serverConfig);
|
||||
~SettingsDialog() override;
|
||||
|
||||
Q_SIGNALS:
|
||||
@ -65,5 +63,4 @@ private:
|
||||
|
||||
std::unique_ptr<Ui::SettingsDialog> ui;
|
||||
const IServerConfig &m_serverConfig;
|
||||
const CoreProcess &m_coreProcess;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user