commit d656e01172a3f1189cc70386132d3d5221121d3d Author: Stephan Witt <sw...@lyx.org> Date: Sun Aug 6 00:28:50 2023 +0200
#12626 disable Ok button of shortcut editor when LFUN is empty --- src/frontends/qt/GuiPrefs.cpp | 8 ++++++++ src/frontends/qt/GuiPrefs.h | 5 +++++ 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/src/frontends/qt/GuiPrefs.cpp b/src/frontends/qt/GuiPrefs.cpp index 62ee814..9836086 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 9c25793..767b6a9 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(); + }; -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs