mirror of
https://github.com/YACReader/yacreader
synced 2025-06-03 17:18:23 -04:00
Add a skeleton open recent menu
This commit is contained in:
parent
9d9ec41736
commit
f1eada4a94
@ -218,6 +218,15 @@ void MainWindowViewer::createActions()
|
||||
openFolderAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPEN_FOLDER_ACTION_Y));
|
||||
connect(openFolderAction, SIGNAL(triggered()), this, SLOT(openFolder()));
|
||||
|
||||
QAction* recentFileAction = 0;
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
recentFileAction = new QAction(this);
|
||||
recentFileAction->setVisible(false);
|
||||
//QObject::connect(recentFileAction, SIGNAL(triggered()), this, SLOT(openRecent()));
|
||||
recentFilesActionList.append(recentFileAction);
|
||||
}
|
||||
|
||||
saveImageAction = new QAction(tr("Save"),this);
|
||||
saveImageAction->setIcon(QIcon(":/images/viewer_toolbar/save.png"));
|
||||
saveImageAction->setToolTip(tr("Save current page"));
|
||||
@ -502,9 +511,13 @@ void MainWindowViewer::createToolBars()
|
||||
comicToolBar->addAction(openAction);
|
||||
comicToolBar->addAction(openFolderAction);
|
||||
#else
|
||||
QMenu * recentmenu = new QMenu("Open recent");
|
||||
recentmenu->addActions(recentFilesActionList);
|
||||
|
||||
QToolButton * tb = new QToolButton();
|
||||
tb->addAction(openAction);
|
||||
tb->addAction(openFolderAction);
|
||||
tb->addAction(recentmenu->menuAction());
|
||||
tb->setPopupMode(QToolButton::MenuButtonPopup);
|
||||
tb->setDefaultAction(openAction);
|
||||
|
||||
|
@ -104,6 +104,7 @@ class EditShortcutsDialog;
|
||||
//! Actions
|
||||
QAction *openAction;
|
||||
QAction *openFolderAction;
|
||||
QList<QAction*> recentFilesActionList;
|
||||
QAction *saveImageAction;
|
||||
QAction *openPreviousComicAction;
|
||||
QAction *openNextComicAction;
|
||||
|
Loading…
x
Reference in New Issue
Block a user