![]() |
OpenMS
2.6.0
|
Manages recent files opened by the user and provides a QMenu to go with it. More...
#include <OpenMS/VISUAL/RecentFilesMenu.h>
Public Slots | |
| void | add (const String &filename) |
| put a new recent file at the top (removing any duplicates in other positions); will update the QMenu More... | |
Signals | |
| void | recentFileClicked (const String &filename) |
| when a recent file action item from the getMenu() was clicked More... | |
Public Member Functions | |
| RecentFilesMenu (int max_entries=15) | |
| C'tor. More... | |
| void | set (const QStringList &initial) |
| sets a list of recent files (up to max_entries many – see C'tor) More... | |
| QMenu * | getMenu () |
| get a menu-pointer to an internal member which always contains the up-to-date recent items More... | |
| const QStringList & | get () const |
| current list of recent files (most recent first) More... | |
Private Slots | |
| void | itemClicked_ () |
| invoked by the QAction when it was clicked; emits recentFileClicked(String filename) More... | |
Private Member Functions | |
| void | sync_ () |
| updates the menu by synching text and and visibility of actions using the current list of recent files More... | |
Private Attributes | |
| QMenu | recent_menu_ |
| holds the menu and the filenames (as QActions) More... | |
| int | max_entries_ |
| maximum of entries; adding more will delete the oldest one More... | |
| QStringList | recent_files_ |
| list of the recently opened files actions (menu entries) More... | |
| std::vector< QAction * > | recent_actions_ |
| .. and the actions to go with it More... | |
Manages recent files opened by the user and provides a QMenu to go with it.
| RecentFilesMenu | ( | int | max_entries = 15 | ) |
C'tor.
|
slot |
put a new recent file at the top (removing any duplicates in other positions); will update the QMenu
Referenced by TOPPViewBase::addRecentFile_().
| const QStringList& get | ( | ) | const |
current list of recent files (most recent first)
Referenced by TOPPViewBase::savePreferences().
| QMenu* getMenu | ( | ) |
get a menu-pointer to an internal member which always contains the up-to-date recent items
|
privateslot |
invoked by the QAction when it was clicked; emits recentFileClicked(String filename)
|
signal |
when a recent file action item from the getMenu() was clicked
Referenced by TOPPViewBase::TOPPViewBase().
| void set | ( | const QStringList & | initial | ) |
sets a list of recent files (up to max_entries many – see C'tor)
Referenced by TOPPViewBase::loadPreferences().
|
private |
updates the menu by synching text and and visibility of actions using the current list of recent files
|
private |
maximum of entries; adding more will delete the oldest one
|
private |
.. and the actions to go with it
|
private |
list of the recently opened files actions (menu entries)
|
private |
holds the menu and the filenames (as QActions)
1.8.16