Commit 599ef0ae authored by marco's avatar marco
Browse files

Confirmation to clear/restore shortcuts

parent 0ce38ea8
......@@ -26,7 +26,11 @@ ShortcutsTab::~ShortcutsTab()
void ShortcutsTab::resetShortcuts()
{
if(QMessageBox::question(this,tr("Restore all default shortcuts"),
tr("Do you really want to restore all default shortcuts?")) == QMessageBox::Yes)
{
settingsCache->shortcuts().resetAllShortcuts();
}
}
void ShortcutsTab::refreshEdits()
......@@ -36,12 +40,15 @@ void ShortcutsTab::refreshEdits()
{
edits.at(i)->refreshShortcut();
}
QMessageBox::information(this,tr("Shortcuts reset"),tr("All shortcuts have been reset"));
}
void ShortcutsTab::clearShortcuts()
{
if(QMessageBox::question(this,tr("Clear all default shortcuts"),
tr("Do you really want to clear all shortcuts?")) == QMessageBox::Yes)
{
settingsCache->shortcuts().clearAllShortcuts();
}
}
void ShortcutsTab::afterClear()
......@@ -51,5 +58,4 @@ void ShortcutsTab::afterClear()
{
edits.at(i)->clear();
}
QMessageBox::information(this,tr("Shortcuts reset"),tr("All shortcuts have been cleared"));
}
......@@ -1581,7 +1581,7 @@ public:
tabWidget->setTabText(tabWidget->indexOf(tab_3), QApplication::translate("shortcutsTab", "Draw | Move | View | Gameplay", 0));
tabWidget->setTabText(tabWidget->indexOf(tab_4), QApplication::translate("shortcutsTab","Counters", 0));
faqLabel->setText(QString("<a href='%1'>%2</a>").arg(WIKI).arg(QApplication::translate("shortcutsTab","How to set custom shortcuts",0)));
btnResetAll->setText(QApplication::translate("shortcutsTab","Reset all shortcuts",0));
btnResetAll->setText(QApplication::translate("shortcutsTab","Restore all default shortcuts",0));
btnClearAll->setText(QApplication::translate("shortcutsTab","Clear all shortcuts",0));
} // retranslateUi
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment