Olive
mainwindow.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 MAINWINDOW_H
22 #define MAINWINDOW_H
23 
24 #include <QMainWindow>
25 
26 class Project;
27 class EffectControls;
28 class Viewer;
29 class Timeline;
30 
31 class MainWindow : public QMainWindow {
32  Q_OBJECT
33 public:
34  explicit MainWindow(QWidget *parent);
35  virtual ~MainWindow() override;
36 
45  void updateTitle();
46 
57  void load_shortcuts(const QString &fn);
58 
68  void save_shortcuts(const QString &fn);
69 
77  void load_css_from_file(const QString& fn);
78 
79 public slots:
85  void toggle_full_screen();
86 
87 signals:
93  void finished_first_paint();
94 
95 protected:
103  virtual void closeEvent(QCloseEvent *) override;
104 
110  virtual void paintEvent(QPaintEvent *) override;
111 
112 private slots:
119  void maximize_panel();
120 
126  void reset_layout();
127 
134 
141 
148 
155 
163 
170 
178 
179 private:
191  void setup_layout(bool reset);
192 
199  void setup_menus();
200 
201  // menu bar menus
202  QMenu* window_menu;
203 
204  // file menu actions
205  QMenu* open_recent;
206  QAction* clear_open_recent_action;
207 
208  // view menu actions
209  QAction* track_lines;
210  QAction* frames_action;
211  QAction* drop_frame_action;
212  QAction* nondrop_frame_action;
213  QAction* milliseconds_action;
214  QAction* no_autoscroll;
215  QAction* page_autoscroll;
216  QAction* smooth_autoscroll;
217  QAction* title_safe_off;
218  QAction* title_safe_default;
219  QAction* title_safe_43;
220  QAction* title_safe_169;
221  QAction* title_safe_custom;
222  QAction* full_screen;
223  QAction* show_all;
224 
225  // tool menu actions
226  QAction* pointer_tool_action;
227  QAction* edit_tool_action;
228  QAction* ripple_tool_action;
229  QAction* razor_tool_action;
230  QAction* slip_tool_action;
231  QAction* slide_tool_action;
232  QAction* hand_tool_action;
233  QAction* transition_tool_action;
234  QAction* snap_toggle;
235  QAction* selecting_also_seeks;
236  QAction* edit_tool_also_seeks;
237  QAction* edit_tool_selects_links;
238  QAction* seek_to_end_of_pastes;
239  QAction* scroll_wheel_zooms;
240  QAction* rectified_waveforms;
241  QAction* enable_drag_files_to_timeline;
242  QAction* autoscale_by_default;
243  QAction* enable_seek_to_import;
244  QAction* enable_audio_scrubbing;
245  QAction* enable_drop_on_media_to_replace;
246  QAction* enable_hover_focus;
247  QAction* set_name_and_marker;
248  QAction* loop_action;
249  QAction* seek_also_selects;
250 
251  // edit menu actions
252  QAction* undo_action;
253  QAction* redo_action;
254 
255  // used to store the panel state when one panel is maximized
256  QByteArray temp_panel_state;
257 
258  // used in paintEvent() to determine the first paintEvent() performed
259  bool first_show;
260 };
261 
262 namespace Olive {
263  extern MainWindow* MainWindow;
264 }
265 
266 #endif // MAINWINDOW_H
void updateTitle()
Update window title.
Definition: mainwindow.cpp:753
void fileMenu_About_To_Be_Shown()
Function to prepare File menu.
Definition: mainwindow.cpp:934
void windowMenu_About_To_Be_Shown()
Function to prepare Window menu.
Definition: mainwindow.cpp:852
void toggle_full_screen()
Toggles full screen mode.
Definition: mainwindow.cpp:952
virtual void closeEvent(QCloseEvent *) override
Close event.
Definition: mainwindow.cpp:760
void load_shortcuts(const QString &fn)
Load shortcut file.
Definition: mainwindow.cpp:309
Definition: timeline.h:91
void finished_first_paint()
Signal emitted once when the main window has finished initializing.
void load_css_from_file(const QString &fn)
Load a CSS/QSS style from file to customize Olive's interface.
Definition: mainwindow.cpp:340
void editMenu_About_To_Be_Shown()
Function to prepare Edit menu.
Definition: mainwindow.cpp:351
void viewMenu_About_To_Be_Shown()
Function to prepare View menu.
Definition: mainwindow.cpp:866
virtual void paintEvent(QPaintEvent *) override
Paint event.
Definition: mainwindow.cpp:809
Definition: effectcontrols.h:52
Definition: project.h:60
void setup_menus()
Initialize menu bar menus and items.
Definition: mainwindow.cpp:356
void toolMenu_About_To_Be_Shown()
Function to prepare Tools menu.
Definition: mainwindow.cpp:893
void toggle_panel_visibility()
Toggle whether a panel is visible or not.
Definition: mainwindow.cpp:924
void maximize_panel()
Maximizes the currently hovered panel.
Definition: mainwindow.cpp:824
void reset_layout()
Reset panel layout to default.
Definition: mainwindow.cpp:818
void playbackMenu_About_To_Be_Shown()
Function to prepare Playback menu.
Definition: mainwindow.cpp:862
Definition: viewer.h:45
void setup_layout(bool reset)
Internal function for setting the panel layout to a predetermined preset.
Definition: mainwindow.cpp:71
Definition: mainwindow.h:31
void save_shortcuts(const QString &fn)
Save shortcut file.
Definition: mainwindow.cpp:323