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

@ -16,6 +16,8 @@ class ShortcutsManager
private:
ShortcutsManager();
QMap<QString,QKeySequence> defaultShorcuts;
QList<QAction *> actions; //all actions registered, used for checking conflicts
void initDefaultShorcuts();
public:
static ShortcutsManager & getShortcutsManager()
@ -27,6 +29,8 @@ public:
void resetToDefaults();
QString getShortcut(const QString & name);
void saveShortcut(QAction * action);
void registerActions(const QList<QAction *> & actions);
bool checkConflicts(const QKeySequence &shortcut, const QAction *dest);
};
//ACTION NAMES YACReaderLibrary