Olive
menuhelper.h
1 /***
2 
3  Olive - Non-Linear Video Editor
4  Copyright (C) 2019 Olive Team
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 ***/
20 
21 #ifndef MENUHELPER_H
22 #define MENUHELPER_H
23 
24 #include <QObject>
25 #include <QMenu>
26 
27 class MenuHelper : public QObject {
28  Q_OBJECT
29 public:
40  void make_new_menu(QMenu* parent);
41 
52  void make_inout_menu(QMenu* parent);
53 
67  void make_clip_functions_menu(QMenu* parent);
68 
76  void make_edit_functions_menu(QMenu* parent);
77 
89  void set_bool_action_checked(QAction* a);
90 
107  void set_int_action_checked(QAction* a, const int& i);
108 
117  void set_button_action_checked(QAction* a);
118 
119 public slots:
120 
127  void toggle_bool_action();
128 
141 
148  void set_autoscroll();
149 
156  void menu_click_button();
157 
164  void set_timecode_view();
165 
172  void open_recent_from_menu();
173 
174 private slots:
175 
176 
177 };
178 
179 namespace Olive {
183  extern MenuHelper MenuHelper;
184 }
185 
186 #endif // MENUHELPER_H
void open_recent_from_menu()
Calls open_recent() in Olive::Global using the index from a QAction.
Definition: menuhelper.cpp:170
void set_bool_action_checked(QAction *a)
Sets the checked state of a menu item based on a Boolean variable.
Definition: menuhelper.cpp:72
void set_button_action_checked(QAction *a)
Sets the checked state of a menu item based on a QPushButton.
Definition: menuhelper.cpp:86
void set_int_action_checked(QAction *a, const int &i)
Sets the checked state of a menu item based on an integer variable.
Definition: menuhelper.cpp:79
void toggle_bool_action()
Sets a QAction's Boolean reference to the opposite of its current value.
Definition: menuhelper.cpp:90
void make_new_menu(QMenu *parent)
Creates a menu of new items that can be created.
Definition: menuhelper.cpp:38
void set_timecode_view()
Sets the current timecode setting.
Definition: menuhelper.cpp:164
void make_inout_menu(QMenu *parent)
Creates a menu of options for working with in/out points.
Definition: menuhelper.cpp:45
void make_edit_functions_menu(QMenu *parent)
Creates standard edit menu (cut, copy, paste, etc.)
Definition: menuhelper.cpp:61
void menu_click_button()
Clicks a QPushButton referenced by a QAction when triggered.
Definition: menuhelper.cpp:160
void set_autoscroll()
Set Autoscroll setting from QAction.
Definition: menuhelper.cpp:155
Definition: menuhelper.h:27
void make_clip_functions_menu(QMenu *parent)
Creates a menu of clip functions.
Definition: menuhelper.cpp:54
void set_titlesafe_from_menu()
Set Title/Action Safe Area from QAction.
Definition: menuhelper.cpp:97