added shortcuts conflicts detection

This commit is contained in:
Luis Ángel San Martín
2014-07-22 22:02:06 +02:00
parent 2712ef89b2
commit eb095bcdaf
8 changed files with 78 additions and 14 deletions

View File

@ -11,6 +11,7 @@
#include <QPushButton>
#include <QHeaderView>
#include <QLabel>
#include <QMessageBox>
#include "QsLog.h"
@ -59,6 +60,7 @@ EditShortcutsDialog::EditShortcutsDialog(QWidget *parent) :
connect(resetButton,SIGNAL(clicked()),this,SLOT(resetToDefaults()));
connect(actionsGroupsListView->selectionModel(),SIGNAL(currentChanged(QModelIndex,QModelIndex)),this,SLOT(loadShortcuts(QModelIndex,QModelIndex))); //clicked(QModelIndex) doesn't work :S
connect(actionsModel,SIGNAL(conflict(QString)),this,SLOT(processConflict(QString)));
#ifdef Q_OS_MAC
setFixedSize(760,500);
@ -86,3 +88,8 @@ void EditShortcutsDialog::loadShortcuts(const QModelIndex &mi,const QModelIndex
{
actionsModel->addActions(groupsModel->getActions(mi));
}
void EditShortcutsDialog::processConflict(const QString &shortcutInConflict)
{
QMessageBox::warning(this,tr("Shortcut in use"), QString(tr("The shortcut \"%1\" is already assigned to other function")).arg(shortcutInConflict));
}