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"
|
2025-07-09 07:44:09 +00:00
|
|
|
#include "config/ServerConfig.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:
|
2025-03-10 03:15:32 +00:00
|
|
|
ServerConfigDialog(QWidget *parent, ServerConfig &config);
|
2025-04-28 01:27:48 +00:00
|
|
|
~ServerConfigDialog() override;
|
2024-07-02 19:07:06 +00:00
|
|
|
bool addClient(const QString &clientName);
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2025-05-31 15:35:37 +00:00
|
|
|
public Q_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)
|
|
|
|
|
{
|
2025-09-01 13:30:34 +00:00
|
|
|
m_message = message;
|
2024-10-17 18:04:35 +00:00
|
|
|
}
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2025-05-31 15:35:37 +00:00
|
|
|
protected Q_SLOTS:
|
2024-07-02 19:07:06 +00:00
|
|
|
void onScreenRemoved();
|
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();
|
2026-03-26 23:20:16 +00:00
|
|
|
void listHotkeysSelectionChanged(const QItemSelection &selected, [[maybe_unused]] const QItemSelection &deselected);
|
2025-02-01 14:54:01 +00:00
|
|
|
|
|
|
|
|
void addAction();
|
|
|
|
|
void editAction();
|
|
|
|
|
void removeAction();
|
2026-03-26 23:20:16 +00:00
|
|
|
void listActionsSelectionChanged(const QItemSelection &selected, [[maybe_unused]] const QItemSelection &deselected);
|
2025-02-01 14:54:01 +00:00
|
|
|
|
2025-02-01 17:41:08 +00:00
|
|
|
void toggleSwitchDoubleTap(bool enable);
|
|
|
|
|
void setSwitchDoubleTap(int within);
|
|
|
|
|
|
|
|
|
|
void toggleSwitchDelay(bool enable);
|
|
|
|
|
void setSwitchDelay(int delay);
|
|
|
|
|
|
2025-11-24 23:35:32 +00:00
|
|
|
void toggleDefaultLockToScreenState(bool state);
|
2025-02-01 17:41:08 +00:00
|
|
|
void toggleLockToScreen(bool disabled);
|
|
|
|
|
void toggleWin32Foreground(bool enabled);
|
|
|
|
|
|
2025-02-01 15:56:07 +00:00
|
|
|
void toggleClipboard(bool enabled);
|
2025-02-01 17:41:08 +00:00
|
|
|
void setClipboardLimit(int limit);
|
|
|
|
|
|
2025-02-01 15:56:07 +00:00
|
|
|
void toggleHeartbeat(bool enabled);
|
2025-02-01 17:41:08 +00:00
|
|
|
void setHeartbeat(int rate);
|
|
|
|
|
|
|
|
|
|
void toggleRelativeMouseMoves(bool enabled);
|
|
|
|
|
void toggleProtocol();
|
|
|
|
|
|
|
|
|
|
void setSwitchCornerSize(int size);
|
|
|
|
|
void toggleCornerBottomLeft(bool enable);
|
|
|
|
|
void toggleCornerTopLeft(bool enable);
|
|
|
|
|
void toggleCornerBottomRight(bool enable);
|
|
|
|
|
void toggleCornerTopRight(bool enable);
|
|
|
|
|
|
|
|
|
|
void toggleExternalConfig(bool enable = false);
|
|
|
|
|
bool browseConfigFile();
|
2025-02-01 15:56:07 +00:00
|
|
|
|
2024-10-17 18:04:35 +00:00
|
|
|
ServerConfig &serverConfig()
|
|
|
|
|
{
|
2025-09-01 13:30:34 +00:00
|
|
|
return m_serverConfig;
|
2024-10-17 18:04:35 +00:00
|
|
|
}
|
|
|
|
|
void setOriginalServerConfig(const ServerConfig &s)
|
|
|
|
|
{
|
2025-09-01 13:30:34 +00:00
|
|
|
m_originalServerConfig = s;
|
2024-07-22 16:48:02 +00:00
|
|
|
}
|
2024-10-17 18:04:35 +00:00
|
|
|
ScreenSetupModel &model()
|
|
|
|
|
{
|
2025-09-01 13:30:34 +00:00
|
|
|
return m_screenSetupModel;
|
2024-10-17 18:04:35 +00:00
|
|
|
}
|
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;
|
2025-09-01 13:30:34 +00:00
|
|
|
QString m_message = "";
|
|
|
|
|
ServerConfig &m_originalServerConfig;
|
2026-03-04 02:47:44 +00:00
|
|
|
NetworkProtocol m_originalProtocol;
|
2025-09-01 13:30:34 +00:00
|
|
|
bool m_originalServerConfigIsExternal;
|
|
|
|
|
QString m_originalServerConfigUsesExternalFile;
|
|
|
|
|
ServerConfig m_serverConfig;
|
2025-09-09 15:37:37 +00:00
|
|
|
ScreenSetupModel m_screenSetupModel;
|
2021-08-20 12:22:07 +00:00
|
|
|
|
2025-05-31 15:35:37 +00:00
|
|
|
private Q_SLOTS:
|
2024-07-02 19:07:06 +00:00
|
|
|
void onChange();
|
2012-06-10 16:50:54 +00:00
|
|
|
};
|