Olive
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Slots | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
MenuHelper Class Reference

#include <menuhelper.h>

Inheritance diagram for MenuHelper:

Public Slots

void toggle_bool_action ()
 Sets a QAction's Boolean reference to the opposite of its current value. More...
 
void set_titlesafe_from_menu ()
 Set Title/Action Safe Area from QAction. More...
 
void set_autoscroll ()
 Set Autoscroll setting from QAction. More...
 
void menu_click_button ()
 Clicks a QPushButton referenced by a QAction when triggered. More...
 
void set_timecode_view ()
 Sets the current timecode setting. More...
 
void open_recent_from_menu ()
 Calls open_recent() in Olive::Global using the index from a QAction. More...
 
void create_effect_paste_action (QMenu *menu)
 Create a "Paste" action on the specified menu that's enabled only if the clipboard contains effects. More...
 

Public Member Functions

void InitializeSharedMenus ()
 
void make_new_menu (QMenu *parent)
 Creates a menu of new items that can be created. More...
 
void make_inout_menu (QMenu *parent)
 Creates a menu of options for working with in/out points. More...
 
void make_clip_functions_menu (QMenu *parent)
 Creates a menu of clip functions. More...
 
void make_edit_functions_menu (QMenu *parent, bool objects_are_selected=true)
 Creates standard edit menu (cut, copy, paste, etc.) More...
 
void set_bool_action_checked (QAction *a)
 Sets the checked state of a menu item based on a Boolean variable. More...
 
void set_int_action_checked (QAction *a, const int &i)
 Sets the checked state of a menu item based on an integer variable. More...
 
void set_button_action_checked (QAction *a)
 Sets the checked state of a menu item based on a QPushButton. More...
 
void Retranslate ()
 

Static Public Member Functions

static Menucreate_submenu (QMenuBar *parent, const QObject *receiver=nullptr, const char *member=nullptr)
 
static Menucreate_submenu (QMenu *parent)
 
static QAction * create_menu_action (QWidget *parent, const char *id, const QObject *receiver=nullptr, const char *member=nullptr, const QKeySequence &shortcut=0)
 

Private Attributes

QAction * new_project_
 
QAction * new_sequence_
 
QAction * new_folder_
 
QAction * set_in_point_
 
QAction * set_out_point_
 
QAction * reset_in_point_
 
QAction * reset_out_point_
 
QAction * clear_inout_point
 
QAction * add_default_transition_
 
QAction * link_unlink_
 
QAction * enable_disable_
 
QAction * nest_
 
QAction * cut_
 
QAction * copy_
 
QAction * paste_
 
QAction * paste_insert_
 
QAction * duplicate_
 
QAction * delete_
 
QAction * ripple_delete_
 
QAction * split_
 

Member Function Documentation

void MenuHelper::create_effect_paste_action ( QMenu *  menu)
slot

Create a "Paste" action on the specified menu that's enabled only if the clipboard contains effects.

Parameters
menuMenu to add action to
QAction * MenuHelper::create_menu_action ( QWidget *  parent,
const char *  id,
const QObject *  receiver = nullptr,
const char *  member = nullptr,
const QKeySequence &  shortcut = 0 
)
static
Menu * MenuHelper::create_submenu ( QMenuBar *  parent,
const QObject *  receiver = nullptr,
const char *  member = nullptr 
)
static
Menu * MenuHelper::create_submenu ( QMenu *  parent)
static
void MenuHelper::InitializeSharedMenus ( )
void MenuHelper::make_clip_functions_menu ( QMenu *  parent)

Creates a menu of clip functions.

Adds a set of clip functions including:

  • Add Default Transition
  • Link/Unlink
  • Enable/Disable
  • Nest
Parameters
parentThe menu to add items to.
void MenuHelper::make_edit_functions_menu ( QMenu *  parent,
bool  objects_are_selected = true 
)

Creates standard edit menu (cut, copy, paste, etc.)

Parameters
parentThe menu to add items to.
objects_are_selectedSome extra functions may be hidden in the event no clip is actually selected. Set this to FALSE to hide those functions.
void MenuHelper::make_inout_menu ( QMenu *  parent)

Creates a menu of options for working with in/out points.

Adds a set of options for working with sequence/footage in/out points, e.g. setting in/out points, clearing in/out points, etc.

Parameters
parentThe menu to add items to.
void MenuHelper::make_new_menu ( QMenu *  parent)

Creates a menu of new items that can be created.

Adds the full set of creatable items to a QMenu (e.g. new project, new sequence, new folder, etc.)

Parameters
parentThe menu to add items to.
void MenuHelper::menu_click_button ( )
slot

Clicks a QPushButton referenced by a QAction when triggered.

Some menu items function largely as a proxy to a QPushButton. Assuming the QAction's data variable is a pointer to a QPushButton, this triggers a click() event on that QPushButton.

void MenuHelper::open_recent_from_menu ( )
slot

Calls open_recent() in Olive::Global using the index from a QAction.

Assumes the sender() is a QAction with an integer as its data variable. The data variable is an index of the internal auto-recovery project list.

void MenuHelper::Retranslate ( )
void MenuHelper::set_autoscroll ( )
slot

Set Autoscroll setting from QAction.

Assumes the sender() is a QAction with an integer as its data variable. The data variable should be AUTOSCROLL_NO_SCROLL, AUTOSCROLL_PAGE_SCROLL (default) or AUTOSCROLL_SMOOTH_SCROLL.

void MenuHelper::set_bool_action_checked ( QAction *  a)

Sets the checked state of a menu item based on a Boolean variable.

Many menu items simply toggle a Boolean variable. This is a convenience function, assuming the QAction's data variable is a pointer to a Boolean variable, that sets the checked state of the QAction to the enabled state of the Boolean. Used heavily in functions like toolMenu_About_To_Be_Shown()

Parameters
aThe QAction to set the checked state of.
void MenuHelper::set_button_action_checked ( QAction *  a)

Sets the checked state of a menu item based on a QPushButton.

Some menu items function largely as a proxy to a QPushButton. Assuming the QAction's data variable is a pointer to a QPushButton, this sets a QAction's checked state to the checked state of the QPushButton.

Parameters
a
void MenuHelper::set_int_action_checked ( QAction *  a,
const int &  i 
)

Sets the checked state of a menu item based on an integer variable.

Many menu items simply set a variable to a particular integer. This is a convenience function, assuming the QAction's data variable is an integer to set a variable to, that sets the checked state of the QAction to whether the QAction's integer equals the integer variable. Used heavily in functions like viewMenu_About_To_Be_Shown()

Parameters
aThe QAction to set the checked state of
iThe integer variable to compare the QAction's integer to
void MenuHelper::set_timecode_view ( )
slot

Sets the current timecode setting.

Assumes the sender() is a QAction with an integer as its data variable. The data variable should be AUTOSCROLL_NO_AUTOSCROLL, AUTOSCROLL_PAGE_AUTOSCROLL (default) or AUTOSCROLL_SMOOTH_AUTOSCROLL.

void MenuHelper::set_titlesafe_from_menu ( )
slot

Set Title/Action Safe Area from QAction.

A receiver for several Title/Action Safe Area setting items. Assumes the sender() is a QAction with a data variable as a double. The double can be the following values:

  • NaN (qSNaN()) - Disable Title/Action Safe Area
  • 0 - Enable Title/Action Safe Area, default aspect ratio (match current active Sequence's aspect ratio).
  • Negative Value - Enable Title/Action Safe Area, any negative number assumes a custom aspect ratio. Will ask the user to enter an aspect ratio and will use the result.
  • Positive Value - Enable Title/Action Safe Area, use value as the aspect ratio.
void MenuHelper::toggle_bool_action ( )
slot

Sets a QAction's Boolean reference to the opposite of its current value.

Many menu items simply toggle a Boolean variable. This is a convenience function, assuming the QAction's data variable is a pointer to a Boolean variable, that sets the Boolean variable to the opposite of its current value.

Member Data Documentation

QAction* MenuHelper::add_default_transition_
private
QAction* MenuHelper::clear_inout_point
private
QAction* MenuHelper::copy_
private
QAction* MenuHelper::cut_
private
QAction* MenuHelper::delete_
private
QAction* MenuHelper::duplicate_
private
QAction* MenuHelper::enable_disable_
private
QAction* MenuHelper::link_unlink_
private
QAction* MenuHelper::nest_
private
QAction* MenuHelper::new_folder_
private
QAction* MenuHelper::new_project_
private
QAction* MenuHelper::new_sequence_
private
QAction* MenuHelper::paste_
private
QAction* MenuHelper::paste_insert_
private
QAction* MenuHelper::reset_in_point_
private
QAction* MenuHelper::reset_out_point_
private
QAction* MenuHelper::ripple_delete_
private
QAction* MenuHelper::set_in_point_
private
QAction* MenuHelper::set_out_point_
private
QAction* MenuHelper::split_
private

The documentation for this class was generated from the following files: