// complete the keyChangeRequest void CAcceleratorSettingsPage::completeKeyChangeRequest(BtShortcutsEditor* shortcutsEditor, const QString& keys) { // check the BtShortcutsEditor's for shortcut conflicts // Either clear the conflicts and set the new shortcut or do nothing. QList<BtShortcutsEditor*> list = getShortcutsEditorListForGroup(shortcutsEditor); QString conflicts = findConflictsWithKeys(keys, list); if (!conflicts.isEmpty()) { QString message = QObject::tr("This shortcut conflicts with the shortcut for the following actions:"); message.append("\n"); message.append(conflicts); QMessageBox msgBox(this); msgBox.setIcon(QMessageBox::Question); msgBox.setText(message); msgBox.setInformativeText(QObject::tr("Do you want to clear the conflicting shortcuts and continue?")); msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); msgBox.setDefaultButton(QMessageBox::Yes); int ret = msgBox.exec(); if ( ret == QMessageBox::Yes) { clearConflictsWithKeys(keys,list); shortcutsEditor->changeShortcutInDialog(keys); } } else { shortcutsEditor->changeShortcutInDialog(keys); } }
// complete the keyChangeRequest void CAcceleratorSettingsPage::completeKeyChangeRequest(BtShortcutsEditor* shortcutsEditor, const QString& keys) { // check the BtShortcutsEditor's for shortcut conflicts // Either clear the conflicts and set the new shortcut or do nothing. QList<BtShortcutsEditor*> list = getShortcutsEditorListForGroup(shortcutsEditor); QString conflicts = findConflictsWithKeys(keys, list); if (!conflicts.isEmpty()) { QString message = QObject::tr("This shortcut conflicts with the shortcut for the following actions:"); message.append("<br/><br/>"); message.append(conflicts); if (message::showQuestion(this, QObject::tr("Do you want to clear the conflicting shortcuts and continue?"), message, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes) { clearConflictsWithKeys(keys, list); shortcutsEditor->changeShortcutInDialog(keys); } } else { shortcutsEditor->changeShortcutInDialog(keys); } }