]> git.lyx.org Git - features.git/commitdiff
#12626 disable Ok button of shortcut editor when LFUN is empty
authorStephan Witt <switt@lyx.org>
Sat, 5 Aug 2023 22:28:50 +0000 (00:28 +0200)
committerStephan Witt <switt@lyx.org>
Sat, 5 Aug 2023 22:28:50 +0000 (00:28 +0200)
src/frontends/qt/GuiPrefs.cpp
src/frontends/qt/GuiPrefs.h

index 62ee81404d1083711a7dcb2e1341d9026597c524..9836086a9282db067dd1f2b2d11376ab698c5910 100644 (file)
@@ -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());
 }
 
 
index 9c25793877cd9f1799bcaabcfbcd0689b5a00ecc..767b6a9c5fb5462edb1e7faad2148f9e7e113f3d 100644 (file)
@@ -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();
+
 };