mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
added 'Add to...' context submenu and addToFavoritesAction
This commit is contained in:
parent
b80c72f70d
commit
4ca873e058
@ -179,7 +179,14 @@ void GridComicsView::setViewActions(const QList<QAction *> &actions)
|
|||||||
|
|
||||||
ctxt->setContextProperty("deleteComicsAction",actions[17]);
|
ctxt->setContextProperty("deleteComicsAction",actions[17]);
|
||||||
|
|
||||||
ctxt->setContextProperty("toggleFullScreenAction",actions[19]);
|
QAction * tmpAction = actions[19];
|
||||||
|
QMenu * menu = tmpAction->menu();
|
||||||
|
if(menu)
|
||||||
|
{
|
||||||
|
ctxt->setContextProperty("addToFavoritesAction",menu->actions().at(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
ctxt->setContextProperty("toggleFullScreenAction",actions[21]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
QLOG_ERROR() << "setViewActions invoked with the wrong number of actions";
|
QLOG_ERROR() << "setViewActions invoked with the wrong number of actions";
|
||||||
|
@ -760,6 +760,18 @@ void LibraryWindow::createActions()
|
|||||||
renameListAction->setToolTip(tr("Rename any selected labels or lists"));
|
renameListAction->setToolTip(tr("Rename any selected labels or lists"));
|
||||||
renameListAction->setIcon(QIcon(":/images/renameListIcon.png"));
|
renameListAction->setIcon(QIcon(":/images/renameListIcon.png"));
|
||||||
|
|
||||||
|
//--
|
||||||
|
addToMenuAction = new QAction(tr("Add to..."), this);
|
||||||
|
|
||||||
|
addToFavoritesAction = new QAction(tr("Favorites"), this);
|
||||||
|
addToFavoritesAction->setData(ADD_TO_FAVORITES_ACTION_YL);
|
||||||
|
addToFavoritesAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ADD_TO_FAVORITES_ACTION_YL));
|
||||||
|
addToFavoritesAction->setToolTip(tr("Add selected comics to favorites list"));
|
||||||
|
addToFavoritesAction->setIcon(QIcon(":/images/lists/default_1.png"));
|
||||||
|
|
||||||
|
QMenu * menu = new QMenu(this);
|
||||||
|
menu->addAction(addToFavoritesAction);
|
||||||
|
addToMenuAction->setMenu(menu);
|
||||||
//disable actions
|
//disable actions
|
||||||
disableAllActions();
|
disableAllActions();
|
||||||
}
|
}
|
||||||
@ -926,7 +938,9 @@ void LibraryWindow::createMenus()
|
|||||||
<< setAsReadAction
|
<< setAsReadAction
|
||||||
<< setAsNonReadAction
|
<< setAsNonReadAction
|
||||||
<< YACReader::createSeparator()
|
<< YACReader::createSeparator()
|
||||||
<< deleteComicsAction;
|
<< deleteComicsAction
|
||||||
|
<< YACReader::createSeparator()
|
||||||
|
<< addToMenuAction;
|
||||||
|
|
||||||
viewActions << openComicAction
|
viewActions << openComicAction
|
||||||
<< YACReader::createSeparator()
|
<< YACReader::createSeparator()
|
||||||
@ -946,6 +960,8 @@ void LibraryWindow::createMenus()
|
|||||||
<< showHideMarksAction
|
<< showHideMarksAction
|
||||||
<< YACReader::createSeparator()
|
<< YACReader::createSeparator()
|
||||||
<< deleteComicsAction
|
<< deleteComicsAction
|
||||||
|
<< YACReader::createSeparator()
|
||||||
|
<< addToMenuAction
|
||||||
|
|
||||||
#ifndef Q_OS_MAC
|
#ifndef Q_OS_MAC
|
||||||
<< YACReader::createSeparator()
|
<< YACReader::createSeparator()
|
||||||
|
@ -217,8 +217,8 @@ private:
|
|||||||
QAction * addLabelAction;
|
QAction * addLabelAction;
|
||||||
QAction * renameListAction;
|
QAction * renameListAction;
|
||||||
//--
|
//--
|
||||||
//QAction * expandAllNodesRLAction;
|
QAction * addToMenuAction;
|
||||||
//QAction * colapseAllNodesRLAction;
|
QAction * addToFavoritesAction;
|
||||||
|
|
||||||
QList<QAction *> itemActions;
|
QList<QAction *> itemActions;
|
||||||
QList<QAction *> viewActions;
|
QList<QAction *> viewActions;
|
||||||
|
@ -121,6 +121,13 @@ Rectangle {
|
|||||||
MenuItem { text: "Show or hide read marks"; enabled: true; iconSource:"qrc:///images/showMarks.png"; onTriggered: showHideMarksAction.trigger() }
|
MenuItem { text: "Show or hide read marks"; enabled: true; iconSource:"qrc:///images/showMarks.png"; onTriggered: showHideMarksAction.trigger() }
|
||||||
MenuSeparator{}
|
MenuSeparator{}
|
||||||
MenuItem { text: "Delete selected comics"; enabled: true; iconSource:"qrc:///images/trash.png"; onTriggered: deleteComicsAction.trigger() }
|
MenuItem { text: "Delete selected comics"; enabled: true; iconSource:"qrc:///images/trash.png"; onTriggered: deleteComicsAction.trigger() }
|
||||||
|
MenuSeparator{}
|
||||||
|
Menu {
|
||||||
|
id: addToMenu
|
||||||
|
title: "Add to..."
|
||||||
|
MenuItem { text: "Favorites"; enabled: true; iconSource:"qrc:///images/lists/default_1.png"; onTriggered: addToFavoritesAction.trigger() }
|
||||||
|
}
|
||||||
|
|
||||||
MenuSeparator{}
|
MenuSeparator{}
|
||||||
MenuItem { text: "Fullscreen mode on/off"; onTriggered: toggleFullScreenAction.trigger() }
|
MenuItem { text: "Fullscreen mode on/off"; onTriggered: toggleFullScreenAction.trigger() }
|
||||||
//MenuItem { text: "Show details"; onTriggered: cell.state = 'Details';
|
//MenuItem { text: "Show details"; onTriggered: cell.state = 'Details';
|
||||||
|
@ -79,6 +79,7 @@ public:
|
|||||||
#define REMOVE_READING_LIST_ACTION_YL "REMOVE_READING_LIST_ACTION_YL"
|
#define REMOVE_READING_LIST_ACTION_YL "REMOVE_READING_LIST_ACTION_YL"
|
||||||
#define ADD_LABEL_ACTION_YL "ADD_LABEL_ACTION_YL"
|
#define ADD_LABEL_ACTION_YL "ADD_LABEL_ACTION_YL"
|
||||||
#define RENAME_LIST_ACTION_YL "RENAME_LIST_ACTION_YL"
|
#define RENAME_LIST_ACTION_YL "RENAME_LIST_ACTION_YL"
|
||||||
|
#define ADD_TO_FAVORITES_ACTION_YL "ADD_TO_FAVORITES_ACTION_YL"
|
||||||
//COMMANDS YACReaderLibrary
|
//COMMANDS YACReaderLibrary
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user