diff --git a/YACReader/YACReader.pri b/YACReader/YACReader.pri index f4c3788d..4d7da37b 100644 --- a/YACReader/YACReader.pri +++ b/YACReader/YACReader.pri @@ -134,6 +134,7 @@ SOURCES += $$PWD/../common/comic.cpp \ include($$PWD/../custom_widgets/custom_widgets_yacreader.pri) include($$PWD/../compressed_archive/wrapper.pri) +include($$PWD/../shortcuts_management/shortcuts_management.pri) RESOURCES += $$PWD/yacreader_images.qrc \ $$PWD/yacreader_files.qrc diff --git a/YACReader/YACReader.pro b/YACReader/YACReader.pro index 24a05ce0..e8746938 100644 --- a/YACReader/YACReader.pro +++ b/YACReader/YACReader.pro @@ -6,7 +6,7 @@ TARGET = YACReader DEPENDPATH += . \ release -DEFINES += NOMINMAX +DEFINES += NOMINMAX YACREADER unix:!macx{ QMAKE_CXXFLAGS += -std=c++11 diff --git a/YACReader/magnifying_glass.cpp b/YACReader/magnifying_glass.cpp index 0ff09aa7..c86f202e 100644 --- a/YACReader/magnifying_glass.cpp +++ b/YACReader/magnifying_glass.cpp @@ -1,6 +1,7 @@ #include "magnifying_glass.h" #include "viewer.h" #include "configuration.h" +#include "shortcuts_manager.h" #include @@ -244,26 +245,48 @@ void MagnifyingGlass::widthDown() void MagnifyingGlass::keyPressEvent(QKeyEvent *event) { bool validKey = false; - switch (event->key()) - { - case Qt::Key_Plus: - sizeUp(); - validKey = true; - break; - case Qt::Key_Minus: - sizeDown(); - validKey = true; - break; - case Qt::Key_Underscore: - zoomOut(); - validKey = true; - break; - case Qt::Key_Asterisk: - zoomIn(); - validKey = true; - break; - } - updateImage(); + + int _key = event->key(); + Qt::KeyboardModifiers modifiers = event->modifiers(); + + if(modifiers & Qt::ShiftModifier) + _key |= Qt::SHIFT; + if (modifiers & Qt::ControlModifier) + _key |= Qt::CTRL; + if (modifiers & Qt::MetaModifier) + _key |= Qt::META; + if (modifiers & Qt::AltModifier) + _key |= Qt::ALT; + + QKeySequence key(_key); + + if (key == ShortcutsManager::getShortcutsManager().getShortcut(SIZE_UP_MGLASS_ACTION_Y)) + { + sizeUp(); + validKey = true; + } + + else if (key == ShortcutsManager::getShortcutsManager().getShortcut(SIZE_DOWN_MGLASS_ACTION_Y)) + { + sizeDown(); + validKey = true; + } + + else if (key == ShortcutsManager::getShortcutsManager().getShortcut(ZOOM_IN_MGLASS_ACTION_Y)) + { + zoomIn(); + validKey = true; + } + + else if (key == ShortcutsManager::getShortcutsManager().getShortcut(ZOOM_OUT_MGLASS_ACTION_Y)) + { + zoomOut(); + validKey = true; + } + if(validKey) + { + updateImage(); event->setAccepted(true); + } } diff --git a/YACReader/main_window_viewer.cpp b/YACReader/main_window_viewer.cpp index ee3d148e..e262d31b 100644 --- a/YACReader/main_window_viewer.cpp +++ b/YACReader/main_window_viewer.cpp @@ -17,6 +17,8 @@ #include "yacreader_local_client.h" #include "yacreader_global.h" +#include "edit_shortcuts_dialog.h" +#include "shortcuts_manager.h" #include #include @@ -87,19 +89,19 @@ MainWindowViewer::~MainWindowViewer() delete openNextComicAction; delete prevAction; delete nextAction; - delete adjustHeight; - delete adjustWidth; + delete adjustHeightAction; + delete adjustWidthAction; delete leftRotationAction; delete rightRotationAction; delete doublePageAction; - delete goToPage; + delete goToPageAction; delete optionsAction; delete helpAboutAction; - delete showMagnifyingGlass; - delete setBookmark; - delete showBookmarks; + delete showMagnifyingGlassAction; + delete setBookmarkAction; + delete showBookmarksAction; delete showShorcutsAction; - delete showInfo; + delete showInfoAction; delete closeAction; delete showDictionaryAction; delete alwaysOnTopAction; @@ -163,8 +165,12 @@ void MainWindowViewer::setupUI() optionsDialog->restoreOptions(settings); shortcutsDialog = new ShortcutsDialog(this); + editShortcutsDialog = new EditShortcutsDialog(this); + connect(optionsDialog,SIGNAL(editShortcuts()),editShortcutsDialog,SLOT(show())); createActions(); + setUpShortcutsManagement(); + createToolBars(); setWindowTitle("YACReader"); @@ -240,181 +246,216 @@ void MainWindowViewer::openFromArgv() void MainWindowViewer::createActions() { - openAction = new QAction(tr("&Open"),this); - openAction->setShortcut(tr("O")); - openAction->setIcon(QIcon(":/images/viewer_toolbar/open.png")); - openAction->setToolTip(tr("Open a comic")); - connect(openAction, SIGNAL(triggered()), this, SLOT(open())); + openAction = new QAction(tr("&Open"),this); + openAction->setIcon(QIcon(":/images/viewer_toolbar/open.png")); + openAction->setToolTip(tr("Open a comic")); + openAction->setData(OPEN_ACTION_Y); + openAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPEN_ACTION_Y)); + connect(openAction, SIGNAL(triggered()), this, SLOT(open())); - openFolderAction = new QAction(tr("Open Folder"),this); - openFolderAction->setShortcut(tr("Ctrl+O")); - openFolderAction->setIcon(QIcon(":/images/viewer_toolbar/openFolder.png")); - openFolderAction->setToolTip(tr("Open image folder")); - connect(openFolderAction, SIGNAL(triggered()), this, SLOT(openFolder())); + openFolderAction = new QAction(tr("Open Folder"),this); + openFolderAction->setIcon(QIcon(":/images/viewer_toolbar/openFolder.png")); + openFolderAction->setToolTip(tr("Open image folder")); + openFolderAction->setData(OPEN_FOLDER_ACTION_Y); + openFolderAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPEN_FOLDER_ACTION_Y)); + connect(openFolderAction, SIGNAL(triggered()), this, SLOT(openFolder())); - saveImageAction = new QAction(tr("Save"),this); - saveImageAction->setIcon(QIcon(":/images/viewer_toolbar/save.png")); - saveImageAction->setToolTip(tr("Save current page")); - saveImageAction->setDisabled(true); - connect(saveImageAction,SIGNAL(triggered()),this,SLOT(saveImage())); + saveImageAction = new QAction(tr("Save"),this); + saveImageAction->setIcon(QIcon(":/images/viewer_toolbar/save.png")); + saveImageAction->setToolTip(tr("Save current page")); + saveImageAction->setDisabled(true); + saveImageAction->setData(SAVE_IMAGE_ACTION_Y); + saveImageAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SAVE_IMAGE_ACTION_Y)); + connect(saveImageAction,SIGNAL(triggered()),this,SLOT(saveImage())); - openPreviousComicAction = new QAction(tr("Previous Comic"),this); - openPreviousComicAction->setIcon(QIcon(":/images/viewer_toolbar/openPrevious.png")); - openPreviousComicAction->setShortcut(Qt::CTRL + Qt::Key_Left); - openPreviousComicAction->setToolTip(tr("Open previous comic")); - openPreviousComicAction->setDisabled(true); - connect(openPreviousComicAction,SIGNAL(triggered()),this,SLOT(openPreviousComic())); + openPreviousComicAction = new QAction(tr("Previous Comic"),this); + openPreviousComicAction->setIcon(QIcon(":/images/viewer_toolbar/openPrevious.png")); + openPreviousComicAction->setToolTip(tr("Open previous comic")); + openPreviousComicAction->setDisabled(true); + openPreviousComicAction->setData(OPEN_PREVIOUS_COMIC_ACTION_Y); + openPreviousComicAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPEN_PREVIOUS_COMIC_ACTION_Y)); + connect(openPreviousComicAction,SIGNAL(triggered()),this,SLOT(openPreviousComic())); - openNextComicAction = new QAction(tr("Next Comic"),this); - openNextComicAction->setIcon(QIcon(":/images/viewer_toolbar/openNext.png")); - openNextComicAction->setShortcut(Qt::CTRL + Qt::Key_Right); - openNextComicAction->setToolTip(tr("Open next comic")); - openNextComicAction->setDisabled(true); - connect(openNextComicAction,SIGNAL(triggered()),this,SLOT(openNextComic())); + openNextComicAction = new QAction(tr("Next Comic"),this); + openNextComicAction->setIcon(QIcon(":/images/viewer_toolbar/openNext.png")); + openNextComicAction->setToolTip(tr("Open next comic")); + openNextComicAction->setDisabled(true); + openNextComicAction->setData(OPEN_NEXT_COMIC_ACTION_Y); + openNextComicAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPEN_NEXT_COMIC_ACTION_Y)); + connect(openNextComicAction,SIGNAL(triggered()),this,SLOT(openNextComic())); - prevAction = new QAction(tr("&Previous"),this); - prevAction->setIcon(QIcon(":/images/viewer_toolbar/previous.png")); - prevAction->setShortcut(Qt::Key_Left); - prevAction->setShortcutContext(Qt::WidgetShortcut); - prevAction->setToolTip(tr("Go to previous page")); - prevAction->setDisabled(true); - connect(prevAction, SIGNAL(triggered()),viewer,SLOT(prev())); + prevAction = new QAction(tr("&Previous"),this); + prevAction->setIcon(QIcon(":/images/viewer_toolbar/previous.png")); + prevAction->setShortcutContext(Qt::WidgetShortcut); + prevAction->setToolTip(tr("Go to previous page")); + prevAction->setDisabled(true); + prevAction->setData(PREV_ACTION_Y); + prevAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(PREV_ACTION_Y)); + connect(prevAction, SIGNAL(triggered()),viewer,SLOT(prev())); - nextAction = new QAction(tr("&Next"),this); - nextAction->setIcon(QIcon(":/images/viewer_toolbar/next.png")); - nextAction->setShortcut(Qt::Key_Right); - nextAction->setShortcutContext(Qt::WidgetShortcut); - nextAction->setToolTip(tr("Go to next page")); + nextAction = new QAction(tr("&Next"),this); + nextAction->setIcon(QIcon(":/images/viewer_toolbar/next.png")); + nextAction->setShortcutContext(Qt::WidgetShortcut); + nextAction->setToolTip(tr("Go to next page")); nextAction->setDisabled(true); + nextAction->setData(NEXT_ACTION_Y); + nextAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(NEXT_ACTION_Y)); connect(nextAction, SIGNAL(triggered()),viewer,SLOT(next())); - adjustHeight = new QAction(tr("Fit Height"),this); - adjustHeight->setIcon(QIcon(":/images/viewer_toolbar/toHeight.png")); + adjustHeightAction = new QAction(tr("Fit Height"),this); + adjustHeightAction->setIcon(QIcon(":/images/viewer_toolbar/toHeight.png")); //adjustWidth->setCheckable(true); - adjustHeight->setDisabled(true); - adjustHeight->setChecked(Configuration::getConfiguration().getAdjustToWidth()); - adjustHeight->setToolTip(tr("Fit image to height")); + adjustHeightAction->setDisabled(true); + adjustHeightAction->setChecked(Configuration::getConfiguration().getAdjustToWidth()); + adjustHeightAction->setToolTip(tr("Fit image to height")); //adjustWidth->setIcon(QIcon(":/images/fitWidth.png")); - connect(adjustHeight, SIGNAL(triggered()),this,SLOT(fitToHeight())); + adjustHeightAction->setData(ADJUST_HEIGHT_ACTION_Y); + adjustHeightAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ADJUST_HEIGHT_ACTION_Y)); + connect(adjustHeightAction, SIGNAL(triggered()),this,SLOT(fitToHeight())); - adjustWidth = new QAction(tr("Fit Width"),this); - adjustWidth->setIcon(QIcon(":/images/viewer_toolbar/toWidth.png")); + adjustWidthAction = new QAction(tr("Fit Width"),this); + adjustWidthAction->setIcon(QIcon(":/images/viewer_toolbar/toWidth.png")); //adjustWidth->setCheckable(true); - adjustWidth->setDisabled(true); - adjustWidth->setChecked(Configuration::getConfiguration().getAdjustToWidth()); - adjustWidth->setToolTip(tr("Fit image to width")); + adjustWidthAction->setDisabled(true); + adjustWidthAction->setChecked(Configuration::getConfiguration().getAdjustToWidth()); + adjustWidthAction->setToolTip(tr("Fit image to width")); //adjustWidth->setIcon(QIcon(":/images/fitWidth.png")); - connect(adjustWidth, SIGNAL(triggered()),this,SLOT(fitToWidth())); + adjustWidthAction->setData(ADJUST_WIDTH_ACTION_Y); + adjustWidthAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ADJUST_WIDTH_ACTION_Y)); + connect(adjustWidthAction, SIGNAL(triggered()),this,SLOT(fitToWidth())); leftRotationAction = new QAction(tr("Rotate image to the left"),this); - leftRotationAction->setShortcut(tr("L")); leftRotationAction->setIcon(QIcon(":/images/viewer_toolbar/rotateL.png")); leftRotationAction->setDisabled(true); + leftRotationAction->setData(LEFT_ROTATION_ACTION_Y); + leftRotationAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(LEFT_ROTATION_ACTION_Y)); connect(leftRotationAction, SIGNAL(triggered()),viewer,SLOT(rotateLeft())); rightRotationAction = new QAction(tr("Rotate image to the right"),this); - rightRotationAction->setShortcut(tr("R")); rightRotationAction->setIcon(QIcon(":/images/viewer_toolbar/rotateR.png")); rightRotationAction->setDisabled(true); + rightRotationAction->setData(RIGHT_ROTATION_ACTION_Y); + rightRotationAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(RIGHT_ROTATION_ACTION_Y)); connect(rightRotationAction, SIGNAL(triggered()),viewer,SLOT(rotateRight())); doublePageAction = new QAction(tr("Double page mode"),this); doublePageAction->setToolTip(tr("Switch to double page mode")); - doublePageAction->setShortcut(tr("D")); doublePageAction->setIcon(QIcon(":/images/viewer_toolbar/doublePage.png")); doublePageAction->setDisabled(true); doublePageAction->setCheckable(true); doublePageAction->setChecked(Configuration::getConfiguration().getDoublePage()); + doublePageAction->setData(DOUBLE_PAGE_ACTION_Y); + doublePageAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(DOUBLE_PAGE_ACTION_Y)); connect(doublePageAction, SIGNAL(triggered()),viewer,SLOT(doublePageSwitch())); - goToPage = new QAction(tr("Go To"),this); - goToPage->setShortcut(tr("G")); - goToPage->setIcon(QIcon(":/images/viewer_toolbar/goto.png")); - goToPage->setDisabled(true); - goToPage->setToolTip(tr("Go to page ...")); - connect(goToPage, SIGNAL(triggered()),viewer,SLOT(showGoToDialog())); + goToPageAction = new QAction(tr("Go To"),this); + goToPageAction->setIcon(QIcon(":/images/viewer_toolbar/goto.png")); + goToPageAction->setDisabled(true); + goToPageAction->setToolTip(tr("Go to page ...")); + goToPageAction->setData(GO_TO_PAGE_ACTION_Y); + goToPageAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(GO_TO_PAGE_ACTION_Y)); + connect(goToPageAction, SIGNAL(triggered()),viewer,SLOT(showGoToDialog())); optionsAction = new QAction(tr("Options"),this); - optionsAction->setShortcut(tr("C")); optionsAction->setToolTip(tr("YACReader options")); + optionsAction->setData(OPTIONS_ACTION_Y); + optionsAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPTIONS_ACTION_Y)); optionsAction->setIcon(QIcon(":/images/viewer_toolbar/options.png")); connect(optionsAction, SIGNAL(triggered()),optionsDialog,SLOT(show())); helpAboutAction = new QAction(tr("Help"),this); helpAboutAction->setToolTip(tr("Help, About YACReader")); - helpAboutAction->setShortcut(Qt::Key_F1); helpAboutAction->setIcon(QIcon(":/images/viewer_toolbar/help.png")); + helpAboutAction->setData(HELP_ABOUT_ACTION_Y); + helpAboutAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(HELP_ABOUT_ACTION_Y)); connect(helpAboutAction, SIGNAL(triggered()),had,SLOT(show())); - showMagnifyingGlass = new QAction(tr("Magnifying glass"),this); - showMagnifyingGlass->setToolTip(tr("Switch Magnifying glass")); - showMagnifyingGlass->setShortcut(tr("Z")); - showMagnifyingGlass->setIcon(QIcon(":/images/viewer_toolbar/magnifyingGlass.png")); - showMagnifyingGlass->setDisabled(true); - showMagnifyingGlass->setCheckable(true); - connect(showMagnifyingGlass, SIGNAL(triggered()),viewer,SLOT(magnifyingGlassSwitch())); + showMagnifyingGlassAction = new QAction(tr("Magnifying glass"),this); + showMagnifyingGlassAction->setToolTip(tr("Switch Magnifying glass")); + showMagnifyingGlassAction->setIcon(QIcon(":/images/viewer_toolbar/magnifyingGlass.png")); + showMagnifyingGlassAction->setDisabled(true); + showMagnifyingGlassAction->setCheckable(true); + showMagnifyingGlassAction->setData(SHOW_MAGNIFYING_GLASS_ACTION_Y); + showMagnifyingGlassAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_MAGNIFYING_GLASS_ACTION_Y)); + connect(showMagnifyingGlassAction, SIGNAL(triggered()),viewer,SLOT(magnifyingGlassSwitch())); - setBookmark = new QAction(tr("Set bookmark"),this); - setBookmark->setToolTip(tr("Set a bookmark on the current page")); - setBookmark->setShortcut(Qt::CTRL+Qt::Key_M); - setBookmark->setIcon(QIcon(":/images/viewer_toolbar/bookmark.png")); - setBookmark->setDisabled(true); - setBookmark->setCheckable(true); - connect(setBookmark,SIGNAL(triggered (bool)),viewer,SLOT(setBookmark(bool))); - connect(viewer,SIGNAL(pageAvailable(bool)),setBookmark,SLOT(setEnabled(bool))); - connect(viewer,SIGNAL(pageIsBookmark(bool)),setBookmark,SLOT(setChecked(bool))); + setBookmarkAction = new QAction(tr("Set bookmark"),this); + setBookmarkAction->setToolTip(tr("Set a bookmark on the current page")); + setBookmarkAction->setIcon(QIcon(":/images/viewer_toolbar/bookmark.png")); + setBookmarkAction->setDisabled(true); + setBookmarkAction->setCheckable(true); + setBookmarkAction->setData(SET_BOOKMARK_ACTION_Y); + setBookmarkAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SET_BOOKMARK_ACTION_Y)); + connect(setBookmarkAction,SIGNAL(triggered (bool)),viewer,SLOT(setBookmarkAction(bool))); + connect(viewer,SIGNAL(pageAvailable(bool)),setBookmarkAction,SLOT(setEnabled(bool))); + connect(viewer,SIGNAL(pageIsBookmark(bool)),setBookmarkAction,SLOT(setChecked(bool))); - showBookmarks = new QAction(tr("Show bookmarks"),this); - showBookmarks->setToolTip(tr("Show the bookmarks of the current comic")); - showBookmarks->setShortcut(tr("M")); - showBookmarks->setIcon(QIcon(":/images/viewer_toolbar/showBookmarks.png")); - showBookmarks->setDisabled(true); - connect(showBookmarks, SIGNAL(triggered()),viewer->getBookmarksDialog(),SLOT(show())); + showBookmarksAction = new QAction(tr("Show bookmarks"),this); + showBookmarksAction->setToolTip(tr("Show the bookmarks of the current comic")); + showBookmarksAction->setIcon(QIcon(":/images/viewer_toolbar/showBookmarks.png")); + showBookmarksAction->setDisabled(true); + showBookmarksAction->setData(SHOW_BOOKMARKS_ACTION_Y); + showBookmarksAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_BOOKMARKS_ACTION_Y)); + connect(showBookmarksAction, SIGNAL(triggered()),viewer->getBookmarksDialog(),SLOT(show())); showShorcutsAction = new QAction(tr("Show keyboard shortcuts"), this ); showShorcutsAction->setIcon(QIcon(":/images/viewer_toolbar/shortcuts.png")); + showShorcutsAction->setData(SHOW_SHORCUTS_ACTION_Y); + showShorcutsAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_SHORCUTS_ACTION_Y)); connect(showShorcutsAction, SIGNAL(triggered()),shortcutsDialog,SLOT(show())); - showInfo = new QAction(tr("Show Info"),this); - showInfo->setShortcut(tr("I")); - showInfo->setIcon(QIcon(":/images/viewer_toolbar/info.png")); - showInfo->setDisabled(true); - connect(showInfo, SIGNAL(triggered()),viewer,SLOT(informationSwitch())); + showInfoAction = new QAction(tr("Show Info"),this); + showInfoAction->setIcon(QIcon(":/images/viewer_toolbar/info.png")); + showInfoAction->setDisabled(true); + showInfoAction->setData(SHOW_INFO_ACTION_Y); + showInfoAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_INFO_ACTION_Y)); + connect(showInfoAction, SIGNAL(triggered()),viewer,SLOT(informationSwitch())); closeAction = new QAction(tr("Close"),this); - closeAction->setShortcut(Qt::Key_Escape); closeAction->setIcon(QIcon(":/images/viewer_toolbar/close.png")); + closeAction->setData(CLOSE_ACTION_Y); + closeAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(CLOSE_ACTION_Y)); connect(closeAction,SIGNAL(triggered()),this,SLOT(close())); showDictionaryAction = new QAction(tr("Show Dictionary"),this); - showDictionaryAction->setShortcut(Qt::Key_T); showDictionaryAction->setIcon(QIcon(":/images/viewer_toolbar/translator.png")); //showDictionaryAction->setCheckable(true); showDictionaryAction->setDisabled(true); + showDictionaryAction->setData(SHOW_DICTIONARY_ACTION_Y); + showDictionaryAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_DICTIONARY_ACTION_Y)); connect(showDictionaryAction,SIGNAL(triggered()),viewer,SLOT(translatorSwitch())); + //deprecated alwaysOnTopAction = new QAction(tr("Always on top"),this); - alwaysOnTopAction->setShortcut(Qt::Key_Q); alwaysOnTopAction->setIcon(QIcon(":/images/alwaysOnTop.png")); alwaysOnTopAction->setCheckable(true); alwaysOnTopAction->setDisabled(true); alwaysOnTopAction->setChecked(Configuration::getConfiguration().getAlwaysOnTop()); + alwaysOnTopAction->setData(ALWAYS_ON_TOP_ACTION_Y); + alwaysOnTopAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ALWAYS_ON_TOP_ACTION_Y)); connect(alwaysOnTopAction,SIGNAL(triggered()),this,SLOT(alwaysOnTopSwitch())); adjustToFullSizeAction = new QAction(tr("Show full size"),this); - adjustToFullSizeAction->setShortcut(Qt::Key_W); adjustToFullSizeAction->setIcon(QIcon(":/images/viewer_toolbar/full.png")); adjustToFullSizeAction->setCheckable(true); adjustToFullSizeAction->setDisabled(true); adjustToFullSizeAction->setChecked(Configuration::getConfiguration().getAdjustToFullSize()); + adjustToFullSizeAction->setData(ADJUST_TO_FULL_SIZE_ACTION_Y); + adjustToFullSizeAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ADJUST_TO_FULL_SIZE_ACTION_Y)); connect(adjustToFullSizeAction,SIGNAL(triggered()),this,SLOT(adjustToFullSizeSwitch())); showFlowAction = new QAction(tr("Show go to flow"),this); - showFlowAction->setShortcut(Qt::Key_S); showFlowAction->setIcon(QIcon(":/images/viewer_toolbar/flow.png")); showFlowAction->setDisabled(true); + showFlowAction->setData(SHOW_FLOW_ACTION_Y); + showFlowAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_FLOW_ACTION_Y)); connect(showFlowAction,SIGNAL(triggered()),viewer,SLOT(goToFlowSwitch())); + + showEditShortcutsAction = new QAction(tr("Edit shortcuts"),this); + showEditShortcutsAction->setData(SHOW_EDIT_SHORTCUTS_ACTION_Y); + showEditShortcutsAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_EDIT_SHORTCUTS_ACTION_Y)); + connect(showEditShortcutsAction,SIGNAL(triggered()),editShortcutsDialog,SLOT(show())); } void MainWindowViewer::createToolBars() @@ -445,7 +486,7 @@ void MainWindowViewer::createToolBars() #endif comicToolBar->addAction(prevAction); comicToolBar->addAction(nextAction); - comicToolBar->addAction(goToPage); + comicToolBar->addAction(goToPageAction); //#ifndef Q_OS_MAC // comicToolBar->addSeparator(); @@ -486,7 +527,7 @@ void MainWindowViewer::createToolBars() ); menu->addAction(sliderAction); QToolButton * tb2 = new QToolButton(); - tb2->addAction(adjustWidth); + tb2->addAction(adjustWidthAction); tb2->setMenu(menu); connect(sliderAction,SIGNAL(fitToWidthRatioChanged(float)),viewer,SLOT(updateFitToWidthRatio(float))); @@ -495,9 +536,9 @@ void MainWindowViewer::createToolBars() //tb2->addAction(); tb2->setPopupMode(QToolButton::MenuButtonPopup); - tb2->setDefaultAction(adjustWidth); + tb2->setDefaultAction(adjustWidthAction); comicToolBar->addWidget(tb2); - comicToolBar->addAction(adjustHeight); + comicToolBar->addAction(adjustHeightAction); comicToolBar->addAction(adjustToFullSizeAction); comicToolBar->addAction(leftRotationAction); comicToolBar->addAction(rightRotationAction); @@ -508,15 +549,15 @@ void MainWindowViewer::createToolBars() #else comicToolBar->addSeparator(); #endif - comicToolBar->addAction(showMagnifyingGlass); + comicToolBar->addAction(showMagnifyingGlassAction); #ifdef Q_OS_MAC comicToolBar->addWidget(new MacToolBarSeparator); #else comicToolBar->addSeparator(); #endif - comicToolBar->addAction(setBookmark); - comicToolBar->addAction(showBookmarks); + comicToolBar->addAction(setBookmarkAction); + comicToolBar->addAction(showBookmarksAction); #ifdef Q_OS_MAC comicToolBar->addWidget(new MacToolBarSeparator); @@ -525,7 +566,7 @@ void MainWindowViewer::createToolBars() #endif comicToolBar->addAction(showDictionaryAction); comicToolBar->addAction(showFlowAction); - comicToolBar->addAction(showInfo); + comicToolBar->addAction(showInfoAction); #ifdef Q_OS_MAC comicToolBar->addWidget(new MacToolBarSeparator); @@ -551,27 +592,28 @@ void MainWindowViewer::createToolBars() viewer->addAction(prevAction); viewer->addAction(nextAction); - viewer->addAction(goToPage); - viewer->addAction(adjustHeight); - viewer->addAction(adjustWidth); + viewer->addAction(goToPageAction); + viewer->addAction(adjustHeightAction); + viewer->addAction(adjustWidthAction); viewer->addAction(adjustToFullSizeAction); viewer->addAction(leftRotationAction); viewer->addAction(rightRotationAction); YACReader::addSperator(viewer); - viewer->addAction(showMagnifyingGlass); + viewer->addAction(showMagnifyingGlassAction); YACReader::addSperator(viewer); - viewer->addAction(setBookmark); - viewer->addAction(showBookmarks); + viewer->addAction(setBookmarkAction); + viewer->addAction(showBookmarksAction); YACReader::addSperator(viewer); viewer->addAction(showDictionaryAction); viewer->addAction(showFlowAction); - viewer->addAction(showInfo); + viewer->addAction(showInfoAction); YACReader::addSperator(viewer); viewer->addAction(showShorcutsAction); + viewer->addAction(showEditShortcutsAction); viewer->addAction(optionsAction); viewer->addAction(helpAboutAction); YACReader::addSperator(viewer); @@ -740,18 +782,18 @@ void MainWindowViewer::enableActions() saveImageAction->setDisabled(false); prevAction->setDisabled(false); nextAction->setDisabled(false); - adjustHeight->setDisabled(false); - adjustWidth->setDisabled(false); - goToPage->setDisabled(false); + adjustHeightAction->setDisabled(false); + adjustWidthAction->setDisabled(false); + goToPageAction->setDisabled(false); //alwaysOnTopAction->setDisabled(false); leftRotationAction->setDisabled(false); rightRotationAction->setDisabled(false); - showMagnifyingGlass->setDisabled(false); + showMagnifyingGlassAction->setDisabled(false); doublePageAction->setDisabled(false); adjustToFullSizeAction->setDisabled(false); //setBookmark->setDisabled(false); - showBookmarks->setDisabled(false); - showInfo->setDisabled(false); //TODO enable goTo and showInfo (or update) when numPages emited + showBookmarksAction->setDisabled(false); + showInfoAction->setDisabled(false); //TODO enable goTo and showInfo (or update) when numPages emited showDictionaryAction->setDisabled(false); showFlowAction->setDisabled(false); } @@ -760,18 +802,18 @@ void MainWindowViewer::disableActions() saveImageAction->setDisabled(true); prevAction->setDisabled(true); nextAction->setDisabled(true); - adjustHeight->setDisabled(true); - adjustWidth->setDisabled(true); - goToPage->setDisabled(true); + adjustHeightAction->setDisabled(true); + adjustWidthAction->setDisabled(true); + goToPageAction->setDisabled(true); //alwaysOnTopAction->setDisabled(true); leftRotationAction->setDisabled(true); rightRotationAction->setDisabled(true); - showMagnifyingGlass->setDisabled(true); + showMagnifyingGlassAction->setDisabled(true); doublePageAction->setDisabled(true); adjustToFullSizeAction->setDisabled(true); - setBookmark->setDisabled(true); - showBookmarks->setDisabled(true); - showInfo->setDisabled(true); //TODO enable goTo and showInfo (or update) when numPages emited + setBookmarkAction->setDisabled(true); + showBookmarksAction->setDisabled(true); + showInfoAction->setDisabled(true); //TODO enable goTo and showInfo (or update) when numPages emited openPreviousComicAction->setDisabled(true); openNextComicAction->setDisabled(true); showDictionaryAction->setDisabled(true); @@ -780,28 +822,38 @@ void MainWindowViewer::disableActions() void MainWindowViewer::keyPressEvent(QKeyEvent *event) { - //TODO remove unused keys - switch (event->key()) - { - case Qt::Key_Escape: - this->close(); - break; - case Qt::Key_F: - toggleFullScreen(); - break; - case Qt::Key_H: - toggleToolBars(); - break; - case Qt::Key_O: - open(); - break; - case Qt::Key_A: - changeFit(); - break; - default: - QWidget::keyPressEvent(event); - break; - } + //TODO remove unused keys + int _key = event->key(); + Qt::KeyboardModifiers modifiers = event->modifiers(); + + if(modifiers & Qt::ShiftModifier) + _key |= Qt::SHIFT; + if (modifiers & Qt::ControlModifier) + _key |= Qt::CTRL; + if (modifiers & Qt::MetaModifier) + _key |= Qt::META; + if (modifiers & Qt::AltModifier) + _key |= Qt::ALT; + + QKeySequence key(_key); + + if (key == ShortcutsManager::getShortcutsManager().getShortcut(TOGGLE_FULL_SCREEN_ACTION_Y)) + { + toggleFullScreen(); + event->accept(); + } + else if (key == ShortcutsManager::getShortcutsManager().getShortcut(TOGGLE_TOOL_BARS_ACTION_Y)) + { + toggleToolBars(); + event->accept(); + } + else if (key == ShortcutsManager::getShortcutsManager().getShortcut(CHANGE_FIT_ACTION_Y)) + { + changeFit(); + event->accept(); + } + else + QWidget::keyPressEvent(event); } void MainWindowViewer::mouseDoubleClickEvent ( QMouseEvent * event ) @@ -900,7 +952,7 @@ void MainWindowViewer::checkNewVersion() QTimer * tT = new QTimer; tT->setSingleShot(true); connect(tT, SIGNAL(timeout()), versionChecker, SLOT(get())); - //versionChecker->get(); //TODÓ + //versionChecker->get(); //TOD� tT->start(100); conf.setLastVersionCheck(current); @@ -926,6 +978,131 @@ void MainWindowViewer::processReset() disableActions(); } +void MainWindowViewer::setUpShortcutsManagement() +{ + //actions holder + QObject * orphanActions = new QObject; + + editShortcutsDialog->addActionsGroup(tr("Comics"),QIcon(":/images/openInYACReader.png"), + QList() + << openAction + << openFolderAction + << saveImageAction + << openPreviousComicAction + << openNextComicAction); + + //keys without actions (General) + QAction * toggleFullScreenAction = new QAction(tr("Toggle fullscreen mode"),orphanActions); + toggleFullScreenAction->setData(TOGGLE_FULL_SCREEN_ACTION_Y); + toggleFullScreenAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(TOGGLE_FULL_SCREEN_ACTION_Y)); + + QAction * toggleToolbarsAction = new QAction(tr("Hide/show toolbar"),orphanActions); + toggleToolbarsAction->setData(TOGGLE_TOOL_BARS_ACTION_Y); + toggleToolbarsAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(TOGGLE_TOOL_BARS_ACTION_Y)); + + editShortcutsDialog->addActionsGroup(tr("General"),QIcon(), + QList() + << optionsAction + << helpAboutAction + << showShorcutsAction + << showInfoAction + << closeAction + << showDictionaryAction + << showFlowAction + << toggleFullScreenAction + << toggleToolbarsAction + << showEditShortcutsAction); + + //keys without actions (MGlass) + QAction * sizeUpMglassAction = new QAction(tr("Size up magnifying glass"),orphanActions); + sizeUpMglassAction->setData(SIZE_UP_MGLASS_ACTION_Y); + sizeUpMglassAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SIZE_UP_MGLASS_ACTION_Y)); + + QAction * sizeDownMglassAction = new QAction(tr("Size down magnifying glass"),orphanActions); + sizeDownMglassAction->setData(SIZE_DOWN_MGLASS_ACTION_Y); + sizeDownMglassAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SIZE_DOWN_MGLASS_ACTION_Y)); + + QAction * zoomInMglassAction = new QAction(tr("Zoom in magnifying glass"),orphanActions); + zoomInMglassAction->setData(ZOOM_IN_MGLASS_ACTION_Y); + zoomInMglassAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ZOOM_IN_MGLASS_ACTION_Y)); + + QAction * zoomOutMglassAction = new QAction(tr("Zoom out magnifying glass"),orphanActions); + zoomOutMglassAction->setData(ZOOM_OUT_MGLASS_ACTION_Y); + zoomOutMglassAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ZOOM_OUT_MGLASS_ACTION_Y)); + + editShortcutsDialog->addActionsGroup(tr("Magnifiying glass"),QIcon(), + QList() + << showMagnifyingGlassAction + << sizeUpMglassAction + << sizeDownMglassAction + << zoomInMglassAction + << zoomOutMglassAction); + + //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(), + QList() + << adjustHeightAction + << adjustWidthAction + << toggleFitToScreenAction + << leftRotationAction + << rightRotationAction + << doublePageAction + << adjustToFullSizeAction); + + 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)); + + QAction * autoScrollBackwardAction = new QAction(tr("Autoscroll up"),orphanActions); + autoScrollBackwardAction->setData(AUTO_SCROLL_BACKWARD_ACTION_Y); + autoScrollBackwardAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(AUTO_SCROLL_BACKWARD_ACTION_Y)); + + QAction * moveDownAction = new QAction(tr("Move down"),orphanActions); + moveDownAction->setData(MOVE_DOWN_ACTION_Y); + moveDownAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(MOVE_DOWN_ACTION_Y)); + + QAction * moveUpAction = new QAction(tr("Move up"),orphanActions); + moveUpAction->setData(MOVE_UP_ACTION_Y); + moveUpAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(MOVE_UP_ACTION_Y)); + + QAction * moveLeftAction = new QAction(tr("Move left"),orphanActions); + moveLeftAction->setData(MOVE_LEFT_ACTION_Y); + moveLeftAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(MOVE_LEFT_ACTION_Y)); + + QAction * moveRightAction = new QAction(tr("Move right"),orphanActions); + moveRightAction->setData(MOVE_RIGHT_ACTION_Y); + moveRightAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(MOVE_RIGHT_ACTION_Y)); + + QAction * goToFirstPageAction = new QAction(tr("Go to the first page"),orphanActions); + goToFirstPageAction->setData(GO_TO_FIRST_PAGE_ACTION_Y); + goToFirstPageAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(GO_TO_FIRST_PAGE_ACTION_Y)); + + QAction * goToLastPageAction = new QAction(tr("Go to the last page"),orphanActions); + goToLastPageAction->setData(GO_TO_LAST_PAGE_ACTION_Y); + goToLastPageAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(GO_TO_LAST_PAGE_ACTION_Y)); + + editShortcutsDialog->addActionsGroup(tr("Reading"),QIcon(), + QList() + << nextAction + << prevAction + << setBookmarkAction + << showBookmarksAction + << autoScrollForwardAction + << autoScrollBackwardAction + << moveDownAction + << moveUpAction + << moveLeftAction + << moveRightAction + << goToFirstPageAction + << goToLastPageAction + << goToPageAction); + +} + void MainWindowViewer::changeFit() { Configuration & conf = Configuration::getConfiguration(); diff --git a/YACReader/main_window_viewer.h b/YACReader/main_window_viewer.h index 6b33c434..fedd1ca4 100644 --- a/YACReader/main_window_viewer.h +++ b/YACReader/main_window_viewer.h @@ -18,6 +18,7 @@ class HelpAboutDialog; class HttpVersionChecker; class ShortcutsDialog; class YACReaderSliderAction; +class EditShortcutsDialog; class MainWindowViewer : public QMainWindow { @@ -51,6 +52,7 @@ class YACReaderSliderAction; void fitToHeight(); void checkNewVersion(); void processReset(); + void setUpShortcutsManagement(); /*void viewComic(); void prev(); void next(); @@ -71,6 +73,7 @@ class YACReaderSliderAction; OptionsDialog * optionsDialog; HelpAboutDialog * had; ShortcutsDialog * shortcutsDialog; + EditShortcutsDialog * editShortcutsDialog; //! ToolBars QToolBar *comicToolBar; @@ -83,17 +86,17 @@ class YACReaderSliderAction; QAction *openNextComicAction; QAction *nextAction; QAction *prevAction; - QAction *adjustWidth; - QAction *adjustHeight; - QAction *goToPage; + QAction *adjustWidthAction; + QAction *adjustHeightAction; + QAction *goToPageAction; QAction *optionsAction; QAction *helpAboutAction; - QAction *showMagnifyingGlass; - QAction *setBookmark; - QAction *showBookmarks; + QAction *showMagnifyingGlassAction; + QAction *setBookmarkAction; + QAction *showBookmarksAction; QAction *leftRotationAction; QAction *rightRotationAction; - QAction *showInfo; + QAction *showInfoAction; QAction *closeAction; QAction *doublePageAction; QAction *showShorcutsAction; @@ -102,6 +105,8 @@ class YACReaderSliderAction; QAction *adjustToFullSizeAction; QAction *showFlowAction; + QAction *showEditShortcutsAction; + YACReaderSliderAction * sliderAction; HttpVersionChecker * versionChecker; @@ -115,8 +120,8 @@ class YACReaderSliderAction; void getSiblingComics(QString path,QString currentComic); //! Manejadores de evento: - void keyPressEvent(QKeyEvent *event); - //void resizeEvent(QResizeEvent * event); + void keyPressEvent(QKeyEvent *event); + //void resizeEvent(QResizeEvent * event); void mouseDoubleClickEvent ( QMouseEvent * event ); void dropEvent(QDropEvent *event); void dragEnterEvent(QDragEnterEvent *event); diff --git a/YACReader/options_dialog.cpp b/YACReader/options_dialog.cpp index 83a2de20..37d25792 100644 --- a/YACReader/options_dialog.cpp +++ b/YACReader/options_dialog.cpp @@ -113,6 +113,7 @@ OptionsDialog::OptionsDialog(QWidget * parent) layoutGeneral->addWidget(slideSizeBox); layoutGeneral->addWidget(fitBox); layoutGeneral->addWidget(colorBox); + layoutGeneral->addWidget(shortcutsBox); layoutGeneral->addStretch(); layoutFlow->addWidget(sw); layoutFlow->addWidget(gl); diff --git a/YACReader/viewer.cpp b/YACReader/viewer.cpp index d90c0f95..10812be8 100644 --- a/YACReader/viewer.cpp +++ b/YACReader/viewer.cpp @@ -12,6 +12,8 @@ #include "page_label_widget.h" #include "notifications_label_widget.h" #include "comic_db.h" +#include "shortcuts_manager.h" + #include @@ -367,62 +369,72 @@ void Viewer::scrollUp() void Viewer::keyPressEvent(QKeyEvent *event) { - if(render->hasLoadedComic()) - { - if(goToFlow->isVisible() && event->key()!=Qt::Key_S) - QCoreApplication::sendEvent(goToFlow,event); - else - switch (event->key()) - { - case Qt::Key_Space: - posByStep = height()/numScrollSteps; - nextPos=verticalScrollBar()->sliderPosition()+static_cast((height()*0.80)); - scrollDown(); - break; - case Qt::Key_B: - posByStep = height()/numScrollSteps; - nextPos=verticalScrollBar()->sliderPosition()-static_cast((height()*0.80)); - scrollUp(); - break; - case Qt::Key_S: - goToFlowSwitch(); - break; - case Qt::Key_T: - translatorSwitch(); - break; - case Qt::Key_Down: - /*if(verticalScrollBar()->sliderPosition()==verticalScrollBar()->maximum()) - next(); - else*/ - QAbstractScrollArea::keyPressEvent(event); - emit backgroundChanges(); - break; - case Qt::Key_Up: - /*if(verticalScrollBar()->sliderPosition()==verticalScrollBar()->minimum()) - prev(); - else*/ - QAbstractScrollArea::keyPressEvent(event); - emit backgroundChanges(); - break; - case Qt::Key_Home: - goTo(0); - break; - case Qt::Key_End: - goTo(this->render->numPages()-1); - break; - default: - QAbstractScrollArea::keyPressEvent(event); - break; - } - if(mglass->isVisible()) - switch(event->key()) - { - case Qt::Key_Plus: case Qt::Key_Minus: case Qt::Key_Underscore: case Qt::Key_Asterisk: - QCoreApplication::sendEvent(mglass,event); - } - } - else - QAbstractScrollArea::keyPressEvent(event); + if(render->hasLoadedComic()) + { + int _key = event->key(); + Qt::KeyboardModifiers modifiers = event->modifiers(); + + if(modifiers & Qt::ShiftModifier) + _key |= Qt::SHIFT; + if (modifiers & Qt::ControlModifier) + _key |= Qt::CTRL; + if (modifiers & Qt::MetaModifier) + _key |= Qt::META; + if (modifiers & Qt::AltModifier) + _key |= Qt::ALT; + + QKeySequence key(_key); + /*if(goToFlow->isVisible() && event->key()!=Qt::Key_S) + QCoreApplication::sendEvent(goToFlow,event); + else*/ + + if (key == ShortcutsManager::getShortcutsManager().getShortcut(AUTO_SCROLL_FORWARD_ACTION_Y)) + { + posByStep = height()/numScrollSteps; + nextPos=verticalScrollBar()->sliderPosition()+static_cast((height()*0.80)); + scrollDown(); + } + + else if (key == ShortcutsManager::getShortcutsManager().getShortcut(AUTO_SCROLL_BACKWARD_ACTION_Y)) + { + posByStep = height()/numScrollSteps; + nextPos=verticalScrollBar()->sliderPosition()-static_cast((height()*0.80)); + scrollUp(); + } + + else if (key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_DOWN_ACTION_Y) || + key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_UP_ACTION_Y) || + key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_LEFT_ACTION_Y) || + key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_RIGHT_ACTION_Y)) + { + QAbstractScrollArea::keyPressEvent(event); + emit backgroundChanges(); + } + + else if (key == ShortcutsManager::getShortcutsManager().getShortcut(GO_TO_FIRST_PAGE_ACTION_Y)) + { + goTo(0); + } + + else if (key == ShortcutsManager::getShortcutsManager().getShortcut(GO_TO_LAST_PAGE_ACTION_Y)) + { + goTo(this->render->numPages()-1); + } + + else + QAbstractScrollArea::keyPressEvent(event); + + if(mglass->isVisible() && (key == ShortcutsManager::getShortcutsManager().getShortcut(SIZE_UP_MGLASS_ACTION_Y) || + key == ShortcutsManager::getShortcutsManager().getShortcut(SIZE_DOWN_MGLASS_ACTION_Y) || + key == ShortcutsManager::getShortcutsManager().getShortcut(ZOOM_IN_MGLASS_ACTION_Y) || + key == ShortcutsManager::getShortcutsManager().getShortcut(ZOOM_OUT_MGLASS_ACTION_Y))) + { + QCoreApplication::sendEvent(mglass,event); + } + + } + else + QAbstractScrollArea::keyPressEvent(event); } void Viewer::wheelEvent(QWheelEvent * event) diff --git a/YACReader/yacreader_images.qrc b/YACReader/yacreader_images.qrc index 3defdcfa..def5653a 100644 --- a/YACReader/yacreader_images.qrc +++ b/YACReader/yacreader_images.qrc @@ -73,5 +73,7 @@ ../images/dropDownArrow.png ../images/translatorSearch.png ../images/speaker.png + ../images/clear_shortcut.png + ../images/accept_shortcut.png diff --git a/YACReaderLibrary/YACReaderLibrary.pro b/YACReaderLibrary/YACReaderLibrary.pro index 88275787..7a396a70 100644 --- a/YACReaderLibrary/YACReaderLibrary.pro +++ b/YACReaderLibrary/YACReaderLibrary.pro @@ -13,7 +13,7 @@ INCLUDEPATH += ../common \ ./comic_vine \ ./comic_vine/model -DEFINES += SERVER_RELEASE NOMINMAX +DEFINES += SERVER_RELEASE NOMINMAX YACREADER_LIBRARY win32 { diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index 1aa167fd..686afd9e 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -65,7 +65,7 @@ #include "comics_view_transition.h" #include "empty_folder_widget.h" -#include "shortcuts_dialog.h" +#include "edit_shortcuts_dialog.h" #include "shortcuts_manager.h" #include "QsLog.h" @@ -273,7 +273,7 @@ void LibraryWindow::doDialogs() optionsDialog = new OptionsDialog(this); optionsDialog->restoreOptions(settings); - shortcutsDialog = new ShortcutsDialog(this); + editShortcutsDialog = new EditShortcutsDialog(this); setUpShortcutsManagement(); #ifdef SERVER_RELEASE @@ -297,7 +297,7 @@ void LibraryWindow::doDialogs() void LibraryWindow::setUpShortcutsManagement() { - shortcutsDialog->addActionsGroup("Comics",QIcon(":/images/openInYACReader.png"), + editShortcutsDialog->addActionsGroup("Comics",QIcon(":/images/openInYACReader.png"), QList() << openComicAction << setAsReadAction @@ -310,7 +310,7 @@ void LibraryWindow::setUpShortcutsManagement() << deleteComicsAction << getInfoAction); - shortcutsDialog->addActionsGroup("Folders",QIcon(), + editShortcutsDialog->addActionsGroup("Folders",QIcon(), QList() << setRootIndexAction << expandAllNodesAction @@ -321,15 +321,16 @@ void LibraryWindow::setUpShortcutsManagement() << setFolderAsReadAction << setFolderAsUnreadAction); - shortcutsDialog->addActionsGroup("General",QIcon(), + editShortcutsDialog->addActionsGroup("General",QIcon(), QList() << backAction << forwardAction << helpAboutAction << optionsAction - << serverConfigAction); + << serverConfigAction + << showEditShortcutsAction); - shortcutsDialog->addActionsGroup("Libraries",QIcon(), + editShortcutsDialog->addActionsGroup("Libraries",QIcon(), QList() << createLibraryAction << openLibraryAction @@ -341,7 +342,7 @@ void LibraryWindow::setUpShortcutsManagement() << renameLibraryAction << removeLibraryAction); - shortcutsDialog->addActionsGroup("Visualization",QIcon(), + editShortcutsDialog->addActionsGroup("Visualization",QIcon(), QList() << showHideMarksAction << toggleFullScreenAction @@ -635,6 +636,11 @@ void LibraryWindow::createActions() getInfoAction->setIcon(QIcon(":/images/getInfo.png")); //------------------------------------------------------------------------- + showEditShortcutsAction = new QAction(tr("Edit shortcuts"),this); + showEditShortcutsAction->setData(SHOW_EDIT_SHORTCUTS_ACTION_YL); + showEditShortcutsAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_EDIT_SHORTCUTS_ACTION_YL)); + showEditShortcutsAction->setShortcutContext(Qt::ApplicationShortcut); + addAction(showEditShortcutsAction); //disable actions disableAllActions(); } @@ -772,7 +778,6 @@ void LibraryWindow::createToolBars() editInfoToolBar->addWidget(new QToolBarStretch()); editInfoToolBar->addAction(hideComicViewAction); - } void LibraryWindow::createMenus() @@ -973,7 +978,7 @@ void LibraryWindow::createConnections() connect(serverConfigAction, SIGNAL(triggered()), serverConfigDialog, SLOT(show())); #endif connect(optionsDialog, SIGNAL(optionsChanged()),this,SLOT(reloadOptions())); - connect(optionsDialog, SIGNAL(editShortcuts()),shortcutsDialog,SLOT(show())); + connect(optionsDialog, SIGNAL(editShortcuts()),editShortcutsDialog,SLOT(show())); //Folders filter //connect(clearFoldersFilter,SIGNAL(clicked()),foldersFilter,SLOT(clear())); @@ -1007,6 +1012,8 @@ void LibraryWindow::createConnections() connect(dmCV,SIGNAL(isEmpty()),this,SLOT(showEmptyFolderView())); connect(emptyFolderWidget,SIGNAL(subfolderSelected(QModelIndex,int)),this,SLOT(selectSubfolder(QModelIndex,int))); + + connect(showEditShortcutsAction,SIGNAL(triggered()),editShortcutsDialog,SLOT(show())); } void LibraryWindow::loadLibrary(const QString & name) diff --git a/YACReaderLibrary/library_window.h b/YACReaderLibrary/library_window.h index d44ec840..b7761820 100644 --- a/YACReaderLibrary/library_window.h +++ b/YACReaderLibrary/library_window.h @@ -54,7 +54,7 @@ class ClassicComicsView; class GridComicsView; class ComicsViewTransition; class EmptyFolderWidget; -class ShortcutsDialog; +class EditShortcutsDialog; #include "comic_db.h" @@ -77,7 +77,7 @@ private: RenameLibraryDialog * renameLibraryDialog; PropertiesDialog * propertiesDialog; ComicVineDialog * comicVineDialog; - ShortcutsDialog * shortcutsDialog; + EditShortcutsDialog * editShortcutsDialog; //YACReaderSocialDialog * socialDialog; bool fullscreen; bool importedCovers; //if true, the library is read only (not updates,open comic or properties) @@ -173,6 +173,8 @@ private: QAction * deleteComicsAction; QAction * hideComicViewAction; + QAction *showEditShortcutsAction; + QList itemActions; QList viewActions; diff --git a/YACReaderLibrary/options_dialog.cpp b/YACReaderLibrary/options_dialog.cpp index 2ab02678..98794977 100644 --- a/YACReaderLibrary/options_dialog.cpp +++ b/YACReaderLibrary/options_dialog.cpp @@ -40,23 +40,15 @@ OptionsDialog::OptionsDialog(QWidget * parent) flowLayout->addWidget(gl); flowLayout->addLayout(switchFlowType); - QVBoxLayout * shortcutsLayout = new QVBoxLayout(); - QPushButton * shortcutsButton = new QPushButton(tr("Edit shortcuts")); - shortcutsLayout->addWidget(shortcutsButton); - - sw->hide(); QWidget * comicFlowW = new QWidget; comicFlowW->setLayout(flowLayout); - QGroupBox *generalBox = new QGroupBox(tr("Shortcuts")); - generalBox->setLayout(shortcutsLayout); - generalLayout->addWidget(generalBox); - generalLayout->addStretch(); - QWidget * generalW = new QWidget; generalW->setLayout(generalLayout); + generalLayout->addWidget(shortcutsBox); + generalLayout->addStretch(); tabWidget->addTab(comicFlowW,tr("Comic Flow")); tabWidget->addTab(generalW,tr("General")); @@ -71,7 +63,6 @@ OptionsDialog::OptionsDialog(QWidget * parent) this->layout()->setSizeConstraint(QLayout::SetFixedSize); - connect(shortcutsButton,SIGNAL(clicked()),this,SIGNAL(editShortcuts())); } diff --git a/YACReaderLibrary/options_dialog.h b/YACReaderLibrary/options_dialog.h index d597f686..d42a9ead 100644 --- a/YACReaderLibrary/options_dialog.h +++ b/YACReaderLibrary/options_dialog.h @@ -12,8 +12,6 @@ class OptionsDialog : public YACReaderOptionsDialog Q_OBJECT public: OptionsDialog(QWidget * parent = 0); -signals: - void editShortcuts(); }; diff --git a/custom_widgets/yacreader_options_dialog.cpp b/custom_widgets/yacreader_options_dialog.cpp index f9fcae64..c89b44dc 100644 --- a/custom_widgets/yacreader_options_dialog.cpp +++ b/custom_widgets/yacreader_options_dialog.cpp @@ -10,6 +10,7 @@ #include #include #include +#include YACReaderOptionsDialog::YACReaderOptionsDialog(QWidget * parent) :QDialog(parent) @@ -23,6 +24,16 @@ YACReaderOptionsDialog::YACReaderOptionsDialog(QWidget * parent) cancel->setDefault(true); + + QVBoxLayout * shortcutsLayout = new QVBoxLayout(); + QPushButton * shortcutsButton = new QPushButton(tr("Edit shortcuts")); + shortcutsLayout->addWidget(shortcutsButton); + + shortcutsBox = new QGroupBox(tr("Shortcuts")); + shortcutsBox->setLayout(shortcutsLayout); + + connect(shortcutsButton,SIGNAL(clicked()),this,SIGNAL(editShortcuts())); + connect(accept,SIGNAL(clicked()),this,SLOT(saveOptions())); connect(cancel,SIGNAL(clicked()),this,SLOT(restoreOptions())); //TODO fix this connect(cancel,SIGNAL(clicked()),this,SLOT(close())); diff --git a/custom_widgets/yacreader_options_dialog.h b/custom_widgets/yacreader_options_dialog.h index 67a08230..9b347ae8 100644 --- a/custom_widgets/yacreader_options_dialog.h +++ b/custom_widgets/yacreader_options_dialog.h @@ -8,6 +8,7 @@ class YACReaderGLFlowConfigWidget; class QCheckBox; class QPushButton; class QSettings; +class QGroupBox; class YACReaderOptionsDialog : public QDialog { @@ -20,6 +21,8 @@ protected: QPushButton * accept; QPushButton * cancel; + QGroupBox * shortcutsBox; + QSettings * settings; QSettings * previousSettings; @@ -56,6 +59,7 @@ protected slots: signals: void optionsChanged(); + void editShortcuts(); }; -#endif // YACREADER_OPTIONS_DIALOG_H \ No newline at end of file +#endif // YACREADER_OPTIONS_DIALOG_H diff --git a/images/accept_shortcut.png b/images/accept_shortcut.png index 4d2b852d..dc0017b9 100644 Binary files a/images/accept_shortcut.png and b/images/accept_shortcut.png differ diff --git a/images/clear_shortcut.png b/images/clear_shortcut.png index e7d21020..1ffbf449 100644 Binary files a/images/clear_shortcut.png and b/images/clear_shortcut.png differ diff --git a/shortcuts_management/shortcuts_dialog.cpp b/shortcuts_management/edit_shortcuts_dialog.cpp similarity index 86% rename from shortcuts_management/shortcuts_dialog.cpp rename to shortcuts_management/edit_shortcuts_dialog.cpp index d48c87d8..3ae1e7e1 100644 --- a/shortcuts_management/shortcuts_dialog.cpp +++ b/shortcuts_management/edit_shortcuts_dialog.cpp @@ -1,4 +1,4 @@ -#include "shortcuts_dialog.h" +#include "edit_shortcuts_dialog.h" #include "actions_groups_model.h" #include "actions_shortcuts_model.h" @@ -14,7 +14,7 @@ #include "QsLog.h" -ShortcutsDialog::ShortcutsDialog(QWidget *parent) : +EditShortcutsDialog::EditShortcutsDialog(QWidget *parent) : QDialog(parent) { QPushButton * resetButton = new QPushButton(tr("Restore defaults"),this); @@ -64,19 +64,19 @@ ShortcutsDialog::ShortcutsDialog(QWidget *parent) : setModal(true); } -void ShortcutsDialog::addActionsGroup(const QString &name, const QIcon &ico, QList &group) +void EditShortcutsDialog::addActionsGroup(const QString &name, const QIcon &ico, QList &group) { //TODO //groups model add groupsModel->addActionsGroup(ActionsGroup(name,ico,group)); } -void ShortcutsDialog::resetToDefaults() +void EditShortcutsDialog::resetToDefaults() { } -void ShortcutsDialog::loadShortcuts(const QModelIndex &mi,const QModelIndex &mi2) +void EditShortcutsDialog::loadShortcuts(const QModelIndex &mi,const QModelIndex &mi2) { actionsModel->addActions(groupsModel->getActions(mi)); } diff --git a/shortcuts_management/shortcuts_dialog.h b/shortcuts_management/edit_shortcuts_dialog.h similarity index 70% rename from shortcuts_management/shortcuts_dialog.h rename to shortcuts_management/edit_shortcuts_dialog.h index d63c9bcd..0ba29413 100644 --- a/shortcuts_management/shortcuts_dialog.h +++ b/shortcuts_management/edit_shortcuts_dialog.h @@ -1,5 +1,5 @@ -#ifndef SHORTCUTS_DIALOG_H -#define SHORTCUTS_DIALOG_H +#ifndef EDIT_SHORTCUTS_DIALOG_H +#define EDIT_SHORTCUTS_DIALOG_H #include #include @@ -10,11 +10,11 @@ class QTableView; class ActionsGroupsModel; class ActionsShortcutsModel; -class ShortcutsDialog : public QDialog +class EditShortcutsDialog : public QDialog { Q_OBJECT public: - explicit ShortcutsDialog(QWidget * parent = 0); + explicit EditShortcutsDialog(QWidget * parent = 0); void addActionsGroup(const QString & name, const QIcon & ico, QList & group); signals: @@ -29,4 +29,4 @@ protected: ActionsShortcutsModel * actionsModel; }; -#endif // SHORTCUTS_DIALOG_H +#endif // EDIT_SHORTCUTS_DIALOG_H diff --git a/shortcuts_management/shortcuts_management.pri b/shortcuts_management/shortcuts_management.pri index e85a6912..d12f8fa0 100644 --- a/shortcuts_management/shortcuts_management.pri +++ b/shortcuts_management/shortcuts_management.pri @@ -2,14 +2,14 @@ INCLUDEPATH += $$PWD DEPENDPATH += $$PWD HEADERS += \ - $$PWD/shortcuts_dialog.h \ + $$PWD/edit_shortcuts_dialog.h \ $$PWD/actions_groups_model.h \ $$PWD/actions_shortcuts_model.h \ $$PWD/edit_shortcut_item_delegate.h \ $$PWD/shortcuts_manager.h SOURCES += \ - $$PWD/shortcuts_dialog.cpp \ + $$PWD/edit_shortcuts_dialog.cpp \ $$PWD/actions_groups_model.cpp \ $$PWD/actions_shortcuts_model.cpp \ $$PWD/edit_shortcut_item_delegate.cpp \ diff --git a/shortcuts_management/shortcuts_manager.cpp b/shortcuts_management/shortcuts_manager.cpp index eca6e45b..d7bb4375 100644 --- a/shortcuts_management/shortcuts_manager.cpp +++ b/shortcuts_management/shortcuts_manager.cpp @@ -11,6 +11,8 @@ ShortcutsManager::ShortcutsManager() void ShortcutsManager::initDefaultShorcuts() { +#ifdef YACREADER_LIBRARY + //ACTIONS defaultShorcuts.insert(CREATE_LIBRARY_ACTION_YL,Qt::Key_A); defaultShorcuts.insert(OPEN_LIBRARY_ACTION_YL,Qt::Key_O); defaultShorcuts.insert(UPDATE_LIBRARY_ACTION_YL,Qt::Key_U); @@ -25,6 +27,50 @@ void ShortcutsManager::initDefaultShorcuts() defaultShorcuts.insert(OPTIONS_ACTION_YL,Qt::Key_C); defaultShorcuts.insert(SERVER_CONFIG_ACTION_YL,Qt::Key_S); defaultShorcuts.insert(TOGGLE_COMICS_VIEW_ACTION_YL,Qt::Key_V); + + //COMMANDS (used in keypressevent) +#else + defaultShorcuts.insert(OPEN_ACTION_Y, Qt::Key_O); + defaultShorcuts.insert(OPEN_FOLDER_ACTION_Y, Qt::CTRL | Qt::Key_O); + defaultShorcuts.insert(OPEN_PREVIOUS_COMIC_ACTION_Y, Qt::CTRL | Qt::Key_Left); + defaultShorcuts.insert(OPEN_NEXT_COMIC_ACTION_Y, Qt::CTRL | Qt::Key_Right); + defaultShorcuts.insert(PREV_ACTION_Y, Qt::Key_Left); + defaultShorcuts.insert(NEXT_ACTION_Y, Qt::Key_Right); + defaultShorcuts.insert(LEFT_ROTATION_ACTION_Y, Qt::Key_L); + defaultShorcuts.insert(RIGHT_ROTATION_ACTION_Y, Qt::Key_R); + defaultShorcuts.insert(DOUBLE_PAGE_ACTION_Y, Qt::Key_D); + defaultShorcuts.insert(GO_TO_PAGE_ACTION_Y, Qt::Key_G); + defaultShorcuts.insert(OPTIONS_ACTION_Y, Qt::Key_C); + defaultShorcuts.insert(HELP_ABOUT_ACTION_Y, Qt::Key_F1); + defaultShorcuts.insert(SHOW_MAGNIFYING_GLASS_ACTION_Y, Qt::Key_Z); + defaultShorcuts.insert(SET_BOOKMARK_ACTION_Y, Qt::CTRL | Qt::Key_M); + defaultShorcuts.insert(SHOW_BOOKMARKS_ACTION_Y, Qt::Key_M); + defaultShorcuts.insert(SHOW_INFO_ACTION_Y, Qt::Key_I); + defaultShorcuts.insert(CLOSE_ACTION_Y, Qt::Key_Escape); + defaultShorcuts.insert(SHOW_DICTIONARY_ACTION_Y, Qt::Key_T); + defaultShorcuts.insert(ALWAYS_ON_TOP_ACTION_Y, Qt::Key_Q); //deprecated + defaultShorcuts.insert(ADJUST_TO_FULL_SIZE_ACTION_Y, Qt::Key_W); + defaultShorcuts.insert(SHOW_FLOW_ACTION_Y, Qt::Key_S); + + //main_window_viewer + defaultShorcuts.insert(TOGGLE_FULL_SCREEN_ACTION_Y, Qt::Key_F); + defaultShorcuts.insert(TOGGLE_TOOL_BARS_ACTION_Y, Qt::Key_H); + defaultShorcuts.insert(CHANGE_FIT_ACTION_Y, Qt::Key_A); + //viewer + defaultShorcuts.insert(AUTO_SCROLL_FORWARD_ACTION_Y, Qt::Key_Space); + defaultShorcuts.insert(AUTO_SCROLL_BACKWARD_ACTION_Y, Qt::Key_B); + defaultShorcuts.insert(MOVE_DOWN_ACTION_Y, Qt::Key_Down); + defaultShorcuts.insert(MOVE_UP_ACTION_Y, Qt::Key_Up); + defaultShorcuts.insert(GO_TO_FIRST_PAGE_ACTION_Y, Qt::Key_Home); + defaultShorcuts.insert(GO_TO_LAST_PAGE_ACTION_Y, Qt::Key_End); + //mglass + defaultShorcuts.insert(SIZE_UP_MGLASS_ACTION_Y, Qt::Key_Plus); + defaultShorcuts.insert(SIZE_DOWN_MGLASS_ACTION_Y, Qt::Key_Minus); + defaultShorcuts.insert(ZOOM_IN_MGLASS_ACTION_Y, Qt::Key_Asterisk); + defaultShorcuts.insert(ZOOM_OUT_MGLASS_ACTION_Y, Qt::Key_Underscore); + +#endif + } void ShortcutsManager::resetToDefaults() diff --git a/shortcuts_management/shortcuts_manager.h b/shortcuts_management/shortcuts_manager.h index a44d641b..6fd2f5c5 100644 --- a/shortcuts_management/shortcuts_manager.h +++ b/shortcuts_management/shortcuts_manager.h @@ -67,7 +67,57 @@ public: #define DELETE_COMICS_ACTION_YL "DELETE_COMICS_ACTION_YL" #define HIDE_COMIC_VIEW_ACTION_YL "HIDE_COMIC_VIEW_ACTION_YL" #define GET_INFO_ACTION_YL "GET_INFO_ACTION_YL" +#define SHOW_EDIT_SHORTCUTS_ACTION_YL "SHOW_EDIT_SHORTCUTS_ACTION_YL" + +//COMMANDS YACReaderLibrary +//ACTION NAMES YACReader +#define OPEN_ACTION_Y "OPEN_ACTION_Y" +#define OPEN_FOLDER_ACTION_Y "OPEN_FOLDER_ACTION_Y" +#define SAVE_IMAGE_ACTION_Y "SAVE_IMAGE_ACTION_Y" +#define OPEN_PREVIOUS_COMIC_ACTION_Y "OPEN_PREVIOUS_COMIC_ACTION_Y" +#define OPEN_NEXT_COMIC_ACTION_Y "OPEN_NEXT_COMIC_ACTION_Y" +#define PREV_ACTION_Y "PREV_ACTION_Y" +#define NEXT_ACTION_Y "NEXT_ACTION_Y" +#define ADJUST_HEIGHT_ACTION_Y "ADJUST_HEIGHT_Y" +#define ADJUST_WIDTH_ACTION_Y "ADJUST_WIDTH_Y" +#define LEFT_ROTATION_ACTION_Y "LEFT_ROTATION_ACTION_Y" +#define RIGHT_ROTATION_ACTION_Y "RIGHT_ROTATION_ACTION_Y" +#define DOUBLE_PAGE_ACTION_Y "DOUBLE_PAGE_ACTION_Y" +#define GO_TO_PAGE_ACTION_Y "GO_TO_PAGE_ACTION_Y" +#define OPTIONS_ACTION_Y "OPTIONS_ACTION_Y" +#define HELP_ABOUT_ACTION_Y "HELP_ABOUT_ACTION_Y" +#define SHOW_MAGNIFYING_GLASS_ACTION_Y "SHOW_MAGNIFYING_GLASS_ACTION_Y" +#define SET_BOOKMARK_ACTION_Y "SET_BOOKMARK_ACTION_Y" +#define SHOW_BOOKMARKS_ACTION_Y "SHOW_BOOKMARKS_ACTION_Y" +#define SHOW_SHORCUTS_ACTION_Y "SHOW_SHORCUTS_ACTION_Y" +#define SHOW_INFO_ACTION_Y "SHOW_INFO_ACTION_Y" +#define CLOSE_ACTION_Y "CLOSE_ACTION_Y" +#define SHOW_DICTIONARY_ACTION_Y "SHOW_DICTIONARY_ACTION_Y" +#define ALWAYS_ON_TOP_ACTION_Y "ALWAYS_ON_TOP_ACTION_Y" +#define ADJUST_TO_FULL_SIZE_ACTION_Y "ADJUST_TO_FULL_SIZE_ACTION_Y" +#define SHOW_FLOW_ACTION_Y "SHOW_FLOW_ACTION_Y" +#define SHOW_EDIT_SHORTCUTS_ACTION_Y "SHOW_EDIT_SHORTCUTS_ACTION_Y" + +//COMMANDS YACReader +//main_viewer_window +#define TOGGLE_FULL_SCREEN_ACTION_Y "TOGGLE_FULL_SCREEN_ACTION_Y" +#define TOGGLE_TOOL_BARS_ACTION_Y "TOGGLE_TOOL_BARS_ACTION_Y" +#define CHANGE_FIT_ACTION_Y "CHANGE_FIT_ACTION_Y" +//viewer +#define AUTO_SCROLL_FORWARD_ACTION_Y "AUTO_SCROLL_FORWARD_ACTION_Y" +#define AUTO_SCROLL_BACKWARD_ACTION_Y "AUTO_SCROLL_BACKWARD_ACTION_Y" +#define MOVE_DOWN_ACTION_Y "MOVE_DOWN_ACTION_Y" +#define MOVE_UP_ACTION_Y "MOVE_UP_ACTION_Y" +#define MOVE_LEFT_ACTION_Y "MOVE_LEFT_ACTION_Y" +#define MOVE_RIGHT_ACTION_Y "MOVE_RIGHT_ACTION_Y" +#define GO_TO_FIRST_PAGE_ACTION_Y "GO_TO_FIRST_PAGE_ACTION_Y" +#define GO_TO_LAST_PAGE_ACTION_Y "GO_TO_LAST_PAGE_ACTION_Y" +//mglass +#define SIZE_UP_MGLASS_ACTION_Y "SIZE_UP_MGLASS_ACTION_Y" +#define SIZE_DOWN_MGLASS_ACTION_Y "SIZE_DOWN_MGLASS_ACTION_Y" +#define ZOOM_IN_MGLASS_ACTION_Y "ZOOM_IN_MGLASS_ACTION_Y" +#define ZOOM_OUT_MGLASS_ACTION_Y "ZOOM_OUT_MGLASS_ACTION_Y" #endif // SHORTCUTS_MANAGER_H