Qt4: Prevent selecting all in pick-one menus
This commit is contained in:
@@ -502,6 +502,9 @@ void NetHackQtMenuWindow::keyPressEvent(QKeyEvent* event)
|
|||||||
|
|
||||||
void NetHackQtMenuWindow::All()
|
void NetHackQtMenuWindow::All()
|
||||||
{
|
{
|
||||||
|
if (how != PICK_ANY)
|
||||||
|
return;
|
||||||
|
|
||||||
for (int i=0; i<itemcount; i++) {
|
for (int i=0; i<itemcount; i++) {
|
||||||
QTableWidgetItem *count = table->item(i, 0);
|
QTableWidgetItem *count = table->item(i, 0);
|
||||||
if (count != NULL) count->setText("");
|
if (count != NULL) count->setText("");
|
||||||
@@ -512,6 +515,9 @@ void NetHackQtMenuWindow::All()
|
|||||||
}
|
}
|
||||||
void NetHackQtMenuWindow::ChooseNone()
|
void NetHackQtMenuWindow::ChooseNone()
|
||||||
{
|
{
|
||||||
|
if (how != PICK_ANY)
|
||||||
|
return;
|
||||||
|
|
||||||
for (int i=0; i<itemcount; i++) {
|
for (int i=0; i<itemcount; i++) {
|
||||||
QTableWidgetItem *count = table->item(i, 0);
|
QTableWidgetItem *count = table->item(i, 0);
|
||||||
if (count != NULL) count->setText("");
|
if (count != NULL) count->setText("");
|
||||||
@@ -522,6 +528,9 @@ void NetHackQtMenuWindow::ChooseNone()
|
|||||||
}
|
}
|
||||||
void NetHackQtMenuWindow::Invert()
|
void NetHackQtMenuWindow::Invert()
|
||||||
{
|
{
|
||||||
|
if (how != PICK_ANY)
|
||||||
|
return;
|
||||||
|
|
||||||
for (int i=0; i<itemcount; i++) {
|
for (int i=0; i<itemcount; i++) {
|
||||||
QTableWidgetItem *count = table->item(i, 0);
|
QTableWidgetItem *count = table->item(i, 0);
|
||||||
if (count != NULL) count->setText("");
|
if (count != NULL) count->setText("");
|
||||||
@@ -532,6 +541,9 @@ void NetHackQtMenuWindow::Invert()
|
|||||||
}
|
}
|
||||||
void NetHackQtMenuWindow::Search()
|
void NetHackQtMenuWindow::Search()
|
||||||
{
|
{
|
||||||
|
if (how != PICK_NONE)
|
||||||
|
return;
|
||||||
|
|
||||||
NetHackQtStringRequestor requestor(this, "Search for:");
|
NetHackQtStringRequestor requestor(this, "Search for:");
|
||||||
char line[256];
|
char line[256];
|
||||||
if (requestor.Get(line)) {
|
if (requestor.Get(line)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user