2012-06-10 16:50:54 +00:00
|
|
|
/*
|
2024-09-17 19:00:25 +00:00
|
|
|
* Deskflow -- mouse and keyboard sharing utility
|
2025-02-01 13:49:38 +00:00
|
|
|
* SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello <sithlord48@gmail.com>
|
2025-01-24 00:11:17 +00:00
|
|
|
* SPDX-FileCopyrightText: (C) 2012 - 2016 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-10-06 13:03:26 +00:00
|
|
|
#pragma once
|
2012-06-10 16:50:54 +00:00
|
|
|
|
|
|
|
|
#include "ScreenSetupModel.h"
|
|
|
|
|
#include "ServerConfig.h"
|
2024-08-07 14:05:18 +00:00
|
|
|
#include "gui/config/AppConfig.h"
|
2012-06-10 16:50:54 +00:00
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
|
2025-02-01 14:54:01 +00:00
|
|
|
class QItemSelection;
|
|
|
|
|
|
2024-10-18 23:52:32 +00:00
|
|
|
namespace Ui {
|
|
|
|
|
class ServerConfigDialog;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class ServerConfigDialog : public QDialog
|
2024-10-17 18:04:35 +00:00
|
|
|
{
|
2024-07-02 19:07:06 +00:00
|
|
|
Q_OBJECT
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
public:
|
2024-10-17 18:04:35 +00:00
|
|
|
ServerConfigDialog(QWidget *parent, ServerConfig &config, AppConfig &appConfig);
|
2024-10-18 23:52:32 +00:00
|
|
|
~ServerConfigDialog();
|
2024-07-02 19:07:06 +00:00
|
|
|
bool addClient(const QString &clientName);
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
public slots:
|
2024-08-07 14:05:18 +00:00
|
|
|
void accept() override;
|
2024-07-02 19:07:06 +00:00
|
|
|
void reject() override;
|
2024-10-17 18:04:35 +00:00
|
|
|
void message(const QString &message)
|
|
|
|
|
{
|
|
|
|
|
m_Message = message;
|
|
|
|
|
}
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
protected slots:
|
|
|
|
|
void onScreenRemoved();
|
|
|
|
|
void on_m_pCheckBoxUseExternalConfig_toggled(bool checked = false);
|
|
|
|
|
bool on_m_pButtonBrowseConfigFile_clicked();
|
2017-01-30 14:45:30 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
protected:
|
2025-02-01 13:49:38 +00:00
|
|
|
void addClient();
|
2024-07-02 19:07:06 +00:00
|
|
|
bool addComputer(const QString &clientName, bool doSilent);
|
2025-02-01 14:54:01 +00:00
|
|
|
|
|
|
|
|
void addHotkey();
|
|
|
|
|
void editHotkey();
|
|
|
|
|
void removeHotkey();
|
|
|
|
|
void listHotkeysSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
|
|
|
|
|
|
|
|
|
|
void addAction();
|
|
|
|
|
void editAction();
|
|
|
|
|
void removeAction();
|
|
|
|
|
void listActionsSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
|
|
|
|
|
|
2025-02-01 15:56:07 +00:00
|
|
|
void toggleClipboard(bool enabled);
|
|
|
|
|
void toggleHeartbeat(bool enabled);
|
|
|
|
|
|
2024-10-17 18:04:35 +00:00
|
|
|
ServerConfig &serverConfig()
|
|
|
|
|
{
|
|
|
|
|
return m_ServerConfig;
|
|
|
|
|
}
|
|
|
|
|
void setOriginalServerConfig(const ServerConfig &s)
|
|
|
|
|
{
|
2024-07-22 16:48:02 +00:00
|
|
|
m_OriginalServerConfig = s;
|
|
|
|
|
}
|
2024-10-17 18:04:35 +00:00
|
|
|
ScreenSetupModel &model()
|
|
|
|
|
{
|
|
|
|
|
return m_ScreenSetupModel;
|
|
|
|
|
}
|
|
|
|
|
AppConfig &appConfig()
|
|
|
|
|
{
|
|
|
|
|
return m_appConfig;
|
|
|
|
|
}
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
private:
|
2024-10-18 23:52:32 +00:00
|
|
|
std::unique_ptr<Ui::ServerConfigDialog> ui;
|
2024-07-22 16:48:02 +00:00
|
|
|
ServerConfig &m_OriginalServerConfig;
|
2024-07-02 19:07:06 +00:00
|
|
|
ServerConfig m_ServerConfig;
|
2024-07-22 16:48:02 +00:00
|
|
|
bool m_OriginalServerConfigIsExternal;
|
|
|
|
|
QString m_OriginalServerConfigUsesExternalFile;
|
2024-07-02 19:07:06 +00:00
|
|
|
ScreenSetupModel m_ScreenSetupModel;
|
|
|
|
|
QString m_Message;
|
2024-07-04 09:14:54 +00:00
|
|
|
AppConfig &m_appConfig;
|
2021-08-20 12:22:07 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
private slots:
|
|
|
|
|
void onChange();
|
2012-06-10 16:50:54 +00:00
|
|
|
};
|