MCPcopy Create free account
hub / github.com/YACReader/yacreader / setUpShortcutsManagement

Method setUpShortcutsManagement

YACReaderLibrary/library_window_actions.cpp:544–651  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

542}
543
544void LibraryWindowActions::setUpShortcutsManagement(EditShortcutsDialog *editShortcutsDialog)
545{
546 // Set up icon mapping for theme changes
547 QMap<QString, std::function<QIcon(const Theme &)>> iconMapping;
548 iconMapping["Comics"] = [](const Theme &t) { return t.shortcutsIcons.comicsIcon; };
549 iconMapping["Folders"] = [](const Theme &t) { return t.shortcutsIcons.foldersIcon; };
550 iconMapping["Lists"] = [](const Theme &t) { return t.shortcutsIcons.foldersIcon; }; // TODO change icon
551 iconMapping["General"] = [](const Theme &t) { return t.shortcutsIcons.generalIcon; };
552 iconMapping["Libraries"] = [](const Theme &t) { return t.shortcutsIcons.librariesIcon; };
553 iconMapping["Visualization"] = [](const Theme &t) { return t.shortcutsIcons.visualizationIcon; };
554 editShortcutsDialog->setGroupIconMapping(iconMapping);
555
556 QList<QAction *> allActions;
557 QList<QAction *> tmpList;
558
559 // Get current theme for initial icons
560 const auto &theme = ThemeManager::instance().getCurrentTheme();
561
562 editShortcutsDialog->addActionsGroup("Comics", theme.shortcutsIcons.comicsIcon,
563 tmpList = QList<QAction *>()
564 << openComicAction
565 << saveCoversToAction
566 << setAsReadAction
567 << setAsNonReadAction
568 << setMangaAction
569 << setNormalAction
570 << openContainingFolderComicAction
571 << resetComicRatingAction
572 << selectAllComicsAction
573 << editSelectedComicsAction
574 << asignOrderAction
575 << deleteMetadataAction
576 << deleteComicsAction
577 << getInfoAction);
578
579 allActions << tmpList;
580
581 editShortcutsDialog->addActionsGroup("Folders", theme.shortcutsIcons.foldersIcon,
582 tmpList = QList<QAction *>()
583 << addFolderAction
584 << deleteFolderAction
585 << setRootIndexAction
586 << expandAllNodesAction
587 << colapseAllNodesAction
588 << openContainingFolderAction
589 << setFolderAsNotCompletedAction
590 << setFolderAsCompletedAction
591 << setFolderAsReadAction
592 << setFolderAsUnreadAction
593 << setFolderAsMangaAction
594 << setFolderAsNormalAction
595 << updateCurrentFolderAction
596 << rescanXMLFromCurrentFolderAction
597 << setFolderCoverAction
598 << deleteCustomFolderCoverAction);
599 allActions << tmpList;
600
601 editShortcutsDialog->addActionsGroup("Lists", theme.shortcutsIcons.foldersIcon, // TODO change icon

Callers 1

doDialogsMethod · 0.45

Calls 3

setGroupIconMappingMethod · 0.80
registerActionsMethod · 0.80
addActionsGroupMethod · 0.45

Tested by

no test coverage detected