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

@ -983,14 +983,20 @@ void MainWindowViewer::setUpShortcutsManagement()
//actions holder
QObject * orphanActions = new QObject;
QList<QAction *> allActions;
QList<QAction *> tmpList;
editShortcutsDialog->addActionsGroup(tr("Comics"),QIcon(":/images/shortcuts_group_comics.png"),
QList<QAction *>()
tmpList = QList<QAction *>()
<< openAction
<< openFolderAction
<< saveImageAction
<< openPreviousComicAction
<< openNextComicAction);
allActions << tmpList;
//keys without actions (General)
QAction * toggleFullScreenAction = new QAction(tr("Toggle fullscreen mode"),orphanActions);
toggleFullScreenAction->setData(TOGGLE_FULL_SCREEN_ACTION_Y);
@ -1001,7 +1007,7 @@ void MainWindowViewer::setUpShortcutsManagement()
toggleToolbarsAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(TOGGLE_TOOL_BARS_ACTION_Y));
editShortcutsDialog->addActionsGroup(tr("General"),QIcon(":/images/shortcuts_group_general.png"),
QList<QAction *>()
tmpList = QList<QAction *>()
<< optionsAction
<< helpAboutAction
<< showShorcutsAction
@ -1013,6 +1019,8 @@ void MainWindowViewer::setUpShortcutsManagement()
<< toggleToolbarsAction
<< showEditShortcutsAction);
allActions << tmpList;
//keys without actions (MGlass)
QAction * sizeUpMglassAction = new QAction(tr("Size up magnifying glass"),orphanActions);
sizeUpMglassAction->setData(SIZE_UP_MGLASS_ACTION_Y);
@ -1031,20 +1039,22 @@ void MainWindowViewer::setUpShortcutsManagement()
zoomOutMglassAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ZOOM_OUT_MGLASS_ACTION_Y));
editShortcutsDialog->addActionsGroup(tr("Magnifiying glass"),QIcon(":/images/shortcuts_group_mglass.png"),
QList<QAction *>()
tmpList = QList<QAction *>()
<< showMagnifyingGlassAction
<< sizeUpMglassAction
<< sizeDownMglassAction
<< zoomInMglassAction
<< zoomOutMglassAction);
allActions << tmpList;
//keys without actions
QAction * toggleFitToScreenAction = new QAction(tr("Toggle between fit to width and fit to height"),orphanActions);
toggleFitToScreenAction->setData(CHANGE_FIT_ACTION_Y);
toggleFitToScreenAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(CHANGE_FIT_ACTION_Y));
editShortcutsDialog->addActionsGroup(tr("Page adjustement"),QIcon(":/images/shortcuts_group_page.png"),
QList<QAction *>()
tmpList = QList<QAction *>()
<< adjustHeightAction
<< adjustWidthAction
<< toggleFitToScreenAction
@ -1053,6 +1063,8 @@ void MainWindowViewer::setUpShortcutsManagement()
<< doublePageAction
<< adjustToFullSizeAction);
allActions << tmpList;
QAction * autoScrollForwardAction = new QAction(tr("Autoscroll down"),orphanActions);
autoScrollForwardAction->setData(AUTO_SCROLL_FORWARD_ACTION_Y);
autoScrollForwardAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(AUTO_SCROLL_FORWARD_ACTION_Y));
@ -1086,7 +1098,7 @@ void MainWindowViewer::setUpShortcutsManagement()
goToLastPageAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(GO_TO_LAST_PAGE_ACTION_Y));
editShortcutsDialog->addActionsGroup(tr("Reading"),QIcon(":/images/shortcuts_group_reading.png"),
QList<QAction *>()
tmpList = QList<QAction *>()
<< nextAction
<< prevAction
<< setBookmarkAction
@ -1101,6 +1113,10 @@ void MainWindowViewer::setUpShortcutsManagement()
<< goToLastPageAction
<< goToPageAction);
allActions << tmpList;
ShortcutsManager::getShortcutsManager().registerActions(allActions);
}
void MainWindowViewer::changeFit()