From 0a47a6fd3d2d68866d36e3ee041df8f33dc19f7e Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 17 Jan 2022 11:22:13 -0800 Subject: [PATCH] Qt vs #repeat For Qt's extended command selector, gray out the button for "repeat" because picking it just causes the '#' command that led to that to be repeated, bringing the extended command selector up again. It can be chosen by typing "rep" but at each keystroke the grayed out button is visible so having that behave differently from what was probably expected should not come as a surprise. --- win/Qt/qt_xcmd.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/win/Qt/qt_xcmd.cpp b/win/Qt/qt_xcmd.cpp index 11e8e6fe1..1f61512db 100644 --- a/win/Qt/qt_xcmd.cpp +++ b/win/Qt/qt_xcmd.cpp @@ -302,6 +302,13 @@ NetHackQtExtCmdRequestor::NetHackQtExtCmdRequestor(QWidget *parent) : pb->setMaximumSize(pb->minimumSize()); // i+butoffset is value that will be passed to the click handler group->addButton(pb, i + butoffset); + // gray out "repeat" because picking it would just repeat the "#" + // that caused us to be called rather than whatever came before; + // it can still be chosen by typing "rep" but appears grayed out + // while in the process so having it not behave usefully shouldn't + // come as much of a surprise + if (btn_lbl == "repeat") + pb->setEnabled(false); /* * by column: xcmd_by_row==false, the default * 0..R-1 down first column, R..2*R-1 down second column, ...