diff --git a/src/gui/src/ScreenSettingsDialog.cpp b/src/gui/src/ScreenSettingsDialog.cpp index c919357ab..206f07939 100644 --- a/src/gui/src/ScreenSettingsDialog.cpp +++ b/src/gui/src/ScreenSettingsDialog.cpp @@ -16,6 +16,8 @@ * along with this program. If not, see . */ +#include "validators/ScreenNameValidator.h" +#include "validators/AliasValidator.h" #include "ScreenSettingsDialog.h" #include "Screen.h" @@ -31,12 +33,10 @@ ScreenSettingsDialog::ScreenSettingsDialog(QWidget* parent, Screen* pScreen,cons setupUi(this); m_pLineEditName->setText(m_pScreen->name()); - m_NameValidator = std::make_unique(m_pLineEditName, m_pLabelNameError, pScreens); - m_pLineEditName->setValidator(m_NameValidator.get()); + m_pLineEditName->setValidator(new validators::ScreenNameValidator(m_pLineEditName, m_pLabelNameError, pScreens)); m_pLineEditName->selectAll(); - m_AliasValidator = std::make_unique(m_pLineEditAlias, m_pLabelAliasError); - m_pLineEditAlias->setValidator(m_AliasValidator.get()); + m_pLineEditAlias->setValidator(new validators::AliasValidator(m_pLineEditAlias, m_pLabelAliasError)); for (int i = 0; i < m_pScreen->aliases().count(); i++) new QListWidgetItem(m_pScreen->aliases()[i], m_pListAliases); @@ -57,6 +57,8 @@ ScreenSettingsDialog::ScreenSettingsDialog(QWidget* parent, Screen* pScreen,cons m_pCheckBoxNumLock->setChecked(m_pScreen->fix(Screen::NumLock)); m_pCheckBoxScrollLock->setChecked(m_pScreen->fix(Screen::ScrollLock)); m_pCheckBoxXTest->setChecked(m_pScreen->fix(Screen::XTest)); + + resize(400, 625); } void ScreenSettingsDialog::accept() diff --git a/src/gui/src/ScreenSettingsDialog.h b/src/gui/src/ScreenSettingsDialog.h index 3153d9399..ff0eb7beb 100644 --- a/src/gui/src/ScreenSettingsDialog.h +++ b/src/gui/src/ScreenSettingsDialog.h @@ -22,8 +22,6 @@ #include #include -#include "validators/ScreenNameValidator.h" -#include "validators/AliasValidator.h" #include "ui_ScreenSettingsDialogBase.h" @@ -51,8 +49,6 @@ class ScreenSettingsDialog : public QDialog, public Ui::ScreenSettingsDialogBase private: Screen* m_pScreen; - std::unique_ptr m_NameValidator; - std::unique_ptr m_AliasValidator; }; diff --git a/src/gui/src/ScreenSettingsDialogBase.ui b/src/gui/src/ScreenSettingsDialogBase.ui index 729d1085e..dbff2c99a 100644 --- a/src/gui/src/ScreenSettingsDialogBase.ui +++ b/src/gui/src/ScreenSettingsDialogBase.ui @@ -6,16 +6,49 @@ 0 0 - 442 - 607 + 491 + 751 + + + 0 + 0 + + + + + 400 + 600 + + Computer settings + + 6 + + + 11 + + + 12 + + + 11 + + + 6 + + + + 0 + 0 + + 0 @@ -26,12 +59,27 @@ + + 13 + + + 13 + + + 13 + + + 13 + + + 14 + - Computer &name: + Computer &name m_pLineEditName @@ -84,15 +132,52 @@ font-weight: bold; + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + true - + QGroupBox::title{ + left: -5px; + top: -3px; +} &Modifier keys @@ -101,16 +186,88 @@ font-weight: bold; false - - 3 + + 8 - - + + 8 + + + 0 + + + 8 + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + - &Ctrl: + Al&t - m_pComboBoxCtrl + m_pComboBoxAlt + + + + + + + 3 + + + + Shift + + + + + Ctrl + + + + + Alt + + + + + Meta + + + + + Super + + + + + None + + + + + + + + S&uper + + + m_pComboBoxSuper @@ -151,13 +308,82 @@ font-weight: bold; - - + + + + 1 + + + + Shift + + + + + Ctrl + + + + + Alt + + + + + Meta + + + + + Super + + + + + None + + + + + + - S&uper: + &Ctrl - m_pComboBoxSuper + m_pComboBoxCtrl + + + + + + + + 40 + 16777215 + + + + &Shift + + + m_pComboBoxShift + + + + + + + + 40 + 16777215 + + + + M&eta + + + m_pComboBoxMeta @@ -195,16 +421,6 @@ font-weight: bold; - - - - Al&t: - - - m_pComboBoxAlt - - - @@ -242,136 +458,170 @@ font-weight: bold; - - - - - 40 - 16777215 - - + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + true + + + + QGroupBox::title{ + left: -5px; + top: -3px; +} + + + &Dead corners defaults + + + false + + + + 10 + + + 13 + + + 10 + + + 9 + + + - &Shift: - - - m_pComboBoxShift + Bottom-left - - + + + + Top-right + + + + + + + Top-left + + + + + + + Bottom-right + + + + + + + + + + 0 + 0 + + + + Corner si&ze + + + m_pSpinBoxSwitchCornerSize + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 8 + 20 + + + + + + + + + 0 + 0 + + + + + 55 + 0 + + + + + + + + Qt::Vertical 20 - 40 + 9 - - - - - 40 - 16777215 - - - - M&eta: - - - m_pComboBoxMeta - - - - - - - 1 - - - - Shift - - - - - Ctrl - - - - - Alt - - - - - Meta - - - - - Super - - - - - None - - - - - - - - 3 - - - - Shift - - - - - Ctrl - - - - - Alt - - - - - Meta - - - - - Super - - - - - None - - - - - - + + Qt::Horizontal - - QSizePolicy::Fixed - - 30 + 40 20 @@ -381,72 +631,178 @@ font-weight: bold; - - - - - true - - - - false - - - - A&liases - - - false - - - + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + true + + + + QGroupBox::title{ + left: -5px; + top: -3px; +} + + + &Fixes + + + false + + + + 13 + + + 13 + + + 6 + + + 13 + + + + + Fix SCROLL LOCK key + + + + + + + Fix CAPS LOCK key + + + + + + + Fix XTest for Xinerama + + + false + + + + + + + Fix NUM LOCK key + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + true + + + + 0 + 0 + + + + + 0 + 0 + + + + + false + + + + QGroupBox::title{ + left: -5px; + top: -3px; +} + + + A&liases + + + false + + + + 0 + + + + + 0 + + + 0 + + + + + 168 + 20 + + + + margin-right: 7px; + 255 - - - - false - - - &Add - - - - - - - Qt::Vertical - - - - 20 - 126 - - - - - - - - QAbstractItemView::ExtendedSelection - - - - - - - false - - - &Remove - - - - + color: #EC4C47; @@ -457,137 +813,85 @@ font-weight: bold; - - - - - - - - - - - - - - true - - - - &Dead corners - - - false - - - - - - Top-left + + true - - - - Top-right + + + + Qt::Vertical - - - - - - Bottom-left + + QSizePolicy::Fixed - - - - - - Bottom-right + + + 20 + 3 + - + - - + + + + 0 + + + 0 + - - - Corner Si&ze: - - - m_pSpinBoxSwitchCornerSize - - - - - + Qt::Horizontal + + QSizePolicy::Fixed + - 40 + 117 20 - + + + false + + + + 0 + 0 + + + + + 43 + 20 + + + + Qt::LeftToRight + + + QPushButton#m_pButtonAddAlias{ +left: 30px; +} + + + &Add + + - - - - - - - - true - - - - &Fixes - - - false - - - - - - Fix CAPS LOCK key - - - - - - - Fix NUM LOCK key - - - - - - - Fix SCROLL LOCK key - - - - - - - Fix XTest for Xinerama - - - false - - - - - + + Qt::Vertical @@ -600,19 +904,128 @@ font-weight: bold; - - - + + + + + 3 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 65 + + + + margin-right: 7px; + + + QAbstractItemView::ExtendedSelection + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 3 + + + + + + + + 2 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + false + + + &Remove + + + + + + + + + Qt::Vertical + + + QSizePolicy::Preferred + + + + 20 + 5 + + + + + + + + - + Qt::Vertical + + QSizePolicy::Fixed + 20 - 40 + 10 @@ -627,6 +1040,22 @@ font-weight: bold; + + + + Qt::Vertical + + + QSizePolicy::Preferred + + + + 20 + 8 + + + + diff --git a/src/gui/src/SettingsDialog.cpp b/src/gui/src/SettingsDialog.cpp index 87af94aa2..f1f2ae87f 100644 --- a/src/gui/src/SettingsDialog.cpp +++ b/src/gui/src/SettingsDialog.cpp @@ -16,6 +16,7 @@ * along with this program. If not, see . */ #include "SettingsDialog.h" +#include "validators/ScreenNameValidator.h" #include "CoreInterface.h" #include "SynergyLocale.h" @@ -52,8 +53,7 @@ SettingsDialog::SettingsDialog(QWidget* parent, AppConfig& config) : enableControls(appConfig().isWritable()); const auto& serveConfig = m_pMainWindow->serverConfig(); - m_ScreenNameValidator = std::make_unique(m_pLineEditScreenName, m_pLabelNameError, (&serveConfig.screens())); - m_pLineEditScreenName->setValidator(m_ScreenNameValidator.get()); + m_pLineEditScreenName->setValidator(new validators::ScreenNameValidator(m_pLineEditScreenName, m_pLabelNameError, (&serveConfig.screens()))); connect(m_pLineEditLogFilename, SIGNAL(textChanged(QString)), this, SLOT(onChange())); connect(m_pComboLogLevel, SIGNAL(currentIndexChanged(int)), this, SLOT(onChange())); diff --git a/src/gui/src/SettingsDialog.h b/src/gui/src/SettingsDialog.h index 7c8f4fc4b..6ea7ea354 100644 --- a/src/gui/src/SettingsDialog.h +++ b/src/gui/src/SettingsDialog.h @@ -23,7 +23,7 @@ #include #include #include "ui_SettingsDialogBase.h" -#include "validators/ScreenNameValidator.h" + #include "SynergyLocale.h" #include "CoreInterface.h" @@ -70,7 +70,6 @@ class SettingsDialog : public QDialog, public Ui::SettingsDialogBase SynergyLocale m_Locale; CoreInterface m_CoreInterface; BonjourWindows* m_pBonjourWindows; - std::unique_ptr m_ScreenNameValidator; /// @brief Stores settings scope at start of settings dialog /// This is neccessary to restore state if user changes diff --git a/src/gui/src/SetupWizard.cpp b/src/gui/src/SetupWizard.cpp index 5c9187ee3..16998fbbd 100644 --- a/src/gui/src/SetupWizard.cpp +++ b/src/gui/src/SetupWizard.cpp @@ -25,8 +25,7 @@ SetupWizard::SetupWizard(MainWindow& mainWindow) : setupUi(this); m_pLineEditName->setText(m_MainWindow.appConfig().screenName()); - m_ScreenNameValidator = std::make_unique(m_pLineEditName, label_ErrorMessage); - m_pLineEditName->setValidator(m_ScreenNameValidator.get()); + m_pLineEditName->setValidator(new validators::ScreenNameValidator(m_pLineEditName, label_ErrorMessage)); connect(m_pButtonApply, SIGNAL(clicked()), this, SLOT(accept())); connect(m_pLineEditName, SIGNAL(textEdited(QString)), this, SLOT(onNameChanged())); diff --git a/src/gui/src/SetupWizard.h b/src/gui/src/SetupWizard.h index 17a2c2c9f..eb4622f29 100644 --- a/src/gui/src/SetupWizard.h +++ b/src/gui/src/SetupWizard.h @@ -19,7 +19,6 @@ #include #include "ui_SetupWizardBase.h" #include -#include "validators/ScreenNameValidator.h" class MainWindow; @@ -36,7 +35,6 @@ protected: private: MainWindow& m_MainWindow; - std::unique_ptr m_ScreenNameValidator; private slots: void onNameChanged();