From: Stephan Witt Date: Sat, 5 Aug 2023 22:28:50 +0000 (+0200) Subject: #12626 disable Ok button of shortcut editor when LFUN is empty X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d656e01172a3f1189cc70386132d3d5221121d3d;p=features.git #12626 disable Ok button of shortcut editor when LFUN is empty --- diff --git a/src/frontends/qt/GuiPrefs.cpp b/src/frontends/qt/GuiPrefs.cpp index 62ee81404d..9836086a92 100644 --- a/src/frontends/qt/GuiPrefs.cpp +++ b/src/frontends/qt/GuiPrefs.cpp @@ -2793,6 +2793,14 @@ GuiShortcutDialog::GuiShortcutDialog(QWidget * parent) : QDialog(parent) Ui::shortcutUi::setupUi(this); QDialog::setModal(true); lfunLE->setValidator(new NoNewLineValidator(lfunLE)); + on_lfunLE_textChanged(); +} + + +void GuiShortcutDialog::on_lfunLE_textChanged() +{ + QPushButton * ok = buttonBox->button(QDialogButtonBox::Ok); + ok->setEnabled(!lfunLE->text().isEmpty()); } diff --git a/src/frontends/qt/GuiPrefs.h b/src/frontends/qt/GuiPrefs.h index 9c25793877..767b6a9c5f 100644 --- a/src/frontends/qt/GuiPrefs.h +++ b/src/frontends/qt/GuiPrefs.h @@ -459,8 +459,13 @@ public Q_SLOTS: class GuiShortcutDialog : public QDialog, public Ui::shortcutUi { + Q_OBJECT public: GuiShortcutDialog(QWidget * parent); + +public Q_SLOTS: + void on_lfunLE_textChanged(); + };