Confirmation to clear/restore shortcuts
This commit is contained in:
parent
0ce38ea88e
commit
599ef0ae62
2 changed files with 13 additions and 7 deletions
|
@ -26,30 +26,36 @@ ShortcutsTab::~ShortcutsTab()
|
|||
|
||||
void ShortcutsTab::resetShortcuts()
|
||||
{
|
||||
settingsCache->shortcuts().resetAllShortcuts();
|
||||
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()
|
||||
{
|
||||
{
|
||||
QList<SequenceEdit*> edits = this->findChildren<SequenceEdit*>();
|
||||
for(int i= 0; i < edits.length(); ++i)
|
||||
{
|
||||
edits.at(i)->refreshShortcut();
|
||||
}
|
||||
QMessageBox::information(this,tr("Shortcuts reset"),tr("All shortcuts have been reset"));
|
||||
}
|
||||
|
||||
void ShortcutsTab::clearShortcuts()
|
||||
{
|
||||
settingsCache->shortcuts().clearAllShortcuts();
|
||||
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()
|
||||
{
|
||||
{
|
||||
QList<SequenceEdit*> edits = this->findChildren<SequenceEdit*>();
|
||||
for(int i= 0; i < edits.length(); ++i)
|
||||
{
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue