Sayonara Player
Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
Library::GenreViewContextMenu Class Reference

Context Menu for the tree view. Notification of the tree view action is done by using a bool setting listener to Set::Lib_GenreTree So there's not signal for it. Everything else can be accessed using the methods of Gui::ContextMenu. More...

#include <GenreViewContextMenu.h>

Inheritance diagram for Library::GenreViewContextMenu:
Gui::ContextMenu Gui::WidgetTemplate< QMenu > Gui::WidgetTemplateParent

Public Types

enum  Entry {
  EntryNone =0,
  EntryNew =(1<<0),
  EntryEdit =(1<<1),
  EntryUndo =(1<<2),
  EntrySave =(1<<3),
  EntrySaveAs =(1<<4),
  EntryRename =(1<<5),
  EntryDelete =(1<<6),
  EntryOpen =(1<<7),
  EntryDefault =(1<<8)
}
 The Entry enum.
 

Public Slots

void show_action (ContextMenu::Entry entry, bool visible)
 show/hide specific action More...
 
void show_actions (ContextMenuEntries entries)
 show actions defined by ContextMenuEntry mask. Hide other actions More...
 
void show_all ()
 show all actions
 
void add_preference_action (PreferenceAction *action)
 

Signals

void sig_new ()
 
void sig_edit ()
 
void sig_undo ()
 
void sig_save ()
 
void sig_save_as ()
 
void sig_rename ()
 
void sig_delete ()
 
void sig_open ()
 
void sig_default ()
 

Public Member Functions

 GenreViewContextMenu (QWidget *parent=nullptr)
 
void register_action (QAction *action)
 register a custom action More...
 
bool has_actions ()
 query, if there are visible actions More...
 
ContextMenuEntries get_entries () const
 get all visible entries More...
 

Protected Member Functions

void language_changed () override
 
void showEvent (QShowEvent *e) override
 
void skin_changed () override
 

Detailed Description

Context Menu for the tree view. Notification of the tree view action is done by using a bool setting listener to Set::Lib_GenreTree So there's not signal for it. Everything else can be accessed using the methods of Gui::ContextMenu.

Member Function Documentation

◆ get_entries()

ContextMenuEntries Gui::ContextMenu::get_entries ( ) const
inherited

get all visible entries

Returns
ContextMenuEntry mask

◆ has_actions()

bool Gui::ContextMenu::has_actions ( )
inherited

query, if there are visible actions

Returns
true, if at least one action is visible. false else

◆ register_action()

void Gui::ContextMenu::register_action ( QAction *  action)
inherited

register a custom action

Parameters
actionthe action. You have to set up the connection manually

◆ show_action

void Gui::ContextMenu::show_action ( ContextMenu::Entry  entry,
bool  visible 
)
slotinherited

show/hide specific action

Parameters
entrythe entry of interes
visibleshow/hide

◆ show_actions

void Gui::ContextMenu::show_actions ( ContextMenuEntries  entries)
slotinherited

show actions defined by ContextMenuEntry mask. Hide other actions

Parameters
maskof ContextMenu::Entry