context menu key sequence fix

This commit is contained in:
Rafael 2016-04-03 09:33:32 +02:00
parent 3d9b4009cb
commit 3d664ca4ef

View file

@ -175,14 +175,14 @@ void SavegameWidget::contextMenuEvent(QContextMenuEvent *ev)
contextMenu.addSeparator(); contextMenu.addSeparator();
if (!ui->cbSelected->isChecked()) { contextMenu.addAction(tr("Select"), this, SLOT(savegameSelected())); } if (!ui->cbSelected->isChecked()) { contextMenu.addAction(tr("Select"), this, SLOT(savegameSelected())); }
if (ui->cbSelected->isChecked()) { contextMenu.addAction(tr("Deselect"), this, SLOT(savegameSelected())); } if (ui->cbSelected->isChecked()) { contextMenu.addAction(tr("Deselect"), this, SLOT(savegameSelected())); }
contextMenu.addAction(tr("Select all"), this, SLOT(selectAllWidgets()), QKeySequence::fromString(tr("Ctrl+S"))); contextMenu.addAction(tr("Select all"), this, SLOT(selectAllWidgets()), QKeySequence::fromString("Ctrl+S"));
contextMenu.addAction(tr("Deselect all"), this, SLOT(deselectAllWidgets()), QKeySequence::fromString(tr("Shift+S"))); contextMenu.addAction(tr("Deselect all"), this, SLOT(deselectAllWidgets()), QKeySequence::fromString("Shift+S"));
} }
else else
{ {
contextMenu.addSeparator(); contextMenu.addSeparator();
contextMenu.addAction(tr("Select"), this, SLOT(savegameSelected())); contextMenu.addAction(tr("Select"), this, SLOT(savegameSelected()));
contextMenu.addAction(tr("Select all"), this, SLOT(selectAllWidgets()), QKeySequence::fromString(tr("Ctrl+S"))); contextMenu.addAction(tr("Select all"), this, SLOT(selectAllWidgets()), QKeySequence::fromString("Ctrl+S"));
} }
contextMenu.exec(ev->globalPos()); contextMenu.exec(ev->globalPos());
setStyleSheet(styleSheet()); // fix multi highlight bug setStyleSheet(styleSheet()); // fix multi highlight bug