mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Add functionality to clear the openrecent list
This commit is contained in:
parent
c850cc5b55
commit
6b19a3093c
@ -68,6 +68,7 @@ using namespace YACReader;
|
|||||||
//openRecent
|
//openRecent
|
||||||
QStringList openRecentList() { return settings->value("recentFiles").toStringList(); }
|
QStringList openRecentList() { return settings->value("recentFiles").toStringList(); }
|
||||||
void updateOpenRecentList (QString path);
|
void updateOpenRecentList (QString path);
|
||||||
|
void clearOpenRecentList() { settings->remove("recentFiles"); }
|
||||||
|
|
||||||
//Old fitmodes
|
//Old fitmodes
|
||||||
/*
|
/*
|
||||||
|
@ -228,6 +228,10 @@ void MainWindowViewer::createActions()
|
|||||||
recentFilesActionList.append(recentFileAction);
|
recentFilesActionList.append(recentFileAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearRecentFilesAction = new QAction(tr("Clear"),this);
|
||||||
|
clearRecentFilesAction->setToolTip(tr("Clear openrecent list"));
|
||||||
|
connect(clearRecentFilesAction, &QAction::triggered, this, &MainWindowViewer::clearRecentFiles);
|
||||||
|
|
||||||
saveImageAction = new QAction(tr("Save"),this);
|
saveImageAction = new QAction(tr("Save"),this);
|
||||||
saveImageAction->setIcon(QIcon(":/images/viewer_toolbar/save.png"));
|
saveImageAction->setIcon(QIcon(":/images/viewer_toolbar/save.png"));
|
||||||
saveImageAction->setToolTip(tr("Save current page"));
|
saveImageAction->setToolTip(tr("Save current page"));
|
||||||
@ -514,6 +518,8 @@ void MainWindowViewer::createToolBars()
|
|||||||
#else
|
#else
|
||||||
QMenu * recentmenu = new QMenu("Open recent");
|
QMenu * recentmenu = new QMenu("Open recent");
|
||||||
recentmenu->addActions(recentFilesActionList);
|
recentmenu->addActions(recentFilesActionList);
|
||||||
|
recentmenu->addSeparator();
|
||||||
|
recentmenu->addAction(clearRecentFilesAction);
|
||||||
refreshRecentFilesActionList();
|
refreshRecentFilesActionList();
|
||||||
|
|
||||||
QToolButton * tb = new QToolButton();
|
QToolButton * tb = new QToolButton();
|
||||||
@ -683,6 +689,13 @@ void MainWindowViewer::refreshRecentFilesActionList()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindowViewer::clearRecentFiles()
|
||||||
|
{
|
||||||
|
qDebug() << "clear triggered";
|
||||||
|
Configuration::getConfiguration().clearOpenRecentList();
|
||||||
|
refreshRecentFilesActionList();
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindowViewer::openRecent()
|
void MainWindowViewer::openRecent()
|
||||||
{
|
{
|
||||||
QAction *action = qobject_cast<QAction *>(sender());
|
QAction *action = qobject_cast<QAction *>(sender());
|
||||||
|
@ -106,6 +106,7 @@ class EditShortcutsDialog;
|
|||||||
QAction *openAction;
|
QAction *openAction;
|
||||||
QAction *openFolderAction;
|
QAction *openFolderAction;
|
||||||
QList<QAction*> recentFilesActionList;
|
QList<QAction*> recentFilesActionList;
|
||||||
|
QAction *clearRecentFilesAction;
|
||||||
QAction *saveImageAction;
|
QAction *saveImageAction;
|
||||||
QAction *openPreviousComicAction;
|
QAction *openPreviousComicAction;
|
||||||
QAction *openNextComicAction;
|
QAction *openNextComicAction;
|
||||||
@ -148,6 +149,7 @@ class EditShortcutsDialog;
|
|||||||
void createActions();
|
void createActions();
|
||||||
void createToolBars();
|
void createToolBars();
|
||||||
void refreshRecentFilesActionList();
|
void refreshRecentFilesActionList();
|
||||||
|
void clearRecentFiles();
|
||||||
void getSiblingComics(QString path,QString currentComic);
|
void getSiblingComics(QString path,QString currentComic);
|
||||||
|
|
||||||
//! Manejadores de evento:
|
//! Manejadores de evento:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user