OpenMS  2.8.0
Classes | Public Slots | Public Member Functions | Private Member Functions | Private Attributes | List of all members
TOPPViewMenu Class Reference

The file menu items for TOPPView. More...

#include <OpenMS/VISUAL/TOPPViewMenu.h>

Inheritance diagram for TOPPViewMenu:
[legend]
Collaboration diagram for TOPPViewMenu:
[legend]

Classes

struct  ActionRequirement_
 

Public Slots

void update (const FS_TV status, const LayerDataBase::DataType layer_type)
 enable/disable entries according to a given state of TOPPViewBase More...
 

Public Member Functions

 TOPPViewMenu (TOPPViewBase *const parent, EnhancedWorkspace *const ws, RecentFilesMenu *const recent_files)
 Constructor which connects slots/signals of this class with the objects given as arguments. More...
 
void addWindowToggle (QAction *const window_toggle)
 add a menu entry at 'Windows -> [Windowname]' to allow hiding/showing a TOPPView subwindow (e.g. Log, Layers, Filters, ...) More...
 

Private Member Functions

QAction * addAction_ (QAction *action, const TV_STATUS req, const FS_LAYER layer_set=FS_LAYER())
 
QAction * addAction_ (QAction *action, const FS_TV req, const FS_LAYER layer_set=FS_LAYER())
 overload for multiple requirements More...
 

Private Attributes

std::vector< ActionRequirement_menu_items_
 holds all actions which have a set of requirements, i.e. depend on the state of TOPPViewBase More...
 
QMenu * m_windows_
 the windows submenu (holds all windows added via addWindowToggle()) More...
 

Detailed Description

The file menu items for TOPPView.

Constructor & Destructor Documentation

◆ TOPPViewMenu()

TOPPViewMenu ( TOPPViewBase *const  parent,
EnhancedWorkspace *const  ws,
RecentFilesMenu *const  recent_files 
)

Constructor which connects slots/signals of this class with the objects given as arguments.

Parameters
parentBase class which actually shows the menu (as part of a QMainWindow)
wsWorkspace to connect some signals to
recent_filesA submenu for recent files which will be integrated as part of 'File -> Recent files'

Member Function Documentation

◆ addAction_() [1/2]

QAction* addAction_ ( QAction *  action,
const FS_TV  req,
const FS_LAYER  layer_set = FS_LAYER() 
)
private

overload for multiple requirements

◆ addAction_() [2/2]

QAction* addAction_ ( QAction *  action,
const TV_STATUS  req,
const FS_LAYER  layer_set = FS_LAYER() 
)
private

fills menu_items_ members with ActionRequirements and returns the just created object Only use this for items which depend on the state of TOPPViewBase, e.g. close() can only work if something is open. But open() is always allowed.

◆ addWindowToggle()

void addWindowToggle ( QAction *const  window_toggle)

add a menu entry at 'Windows -> [Windowname]' to allow hiding/showing a TOPPView subwindow (e.g. Log, Layers, Filters, ...)

Referenced by TOPPViewBase::TOPPViewBase().

◆ update

void update ( const FS_TV  status,
const LayerDataBase::DataType  layer_type 
)
slot

enable/disable entries according to a given state of TOPPViewBase

Referenced by TOPPViewBase::updateMenu().

Member Data Documentation

◆ m_windows_

QMenu* m_windows_
private

the windows submenu (holds all windows added via addWindowToggle())

◆ menu_items_

std::vector<ActionRequirement_> menu_items_
private

holds all actions which have a set of requirements, i.e. depend on the state of TOPPViewBase