Olive
mainwindow.h
Go to the documentation of this file.
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;
207 
208  // view menu actions
209  QAction* track_lines;
210  QAction* frames_action;
214  QAction* no_autoscroll;
215  QAction* page_autoscroll;
217  QAction* title_safe_off;
219  QAction* title_safe_43;
220  QAction* title_safe_169;
222  QAction* full_screen;
223  QAction* show_all;
224 
225  // tool menu actions
234  QAction* snap_toggle;
248  QAction* loop_action;
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
260 };
261 
262 namespace olive {
263  extern MainWindow* MainWindow;
264 }
265 
266 #endif // MAINWINDOW_H
QByteArray temp_panel_state
Definition: mainwindow.h:256
void updateTitle()
Update window title.
Definition: mainwindow.cpp:741
QAction * seek_also_selects
Definition: mainwindow.h:249
QAction * edit_tool_also_seeks
Definition: mainwindow.h:236
QMenu * window_menu
Definition: mainwindow.h:202
QAction * snap_toggle
Definition: mainwindow.h:234
void fileMenu_About_To_Be_Shown()
Function to prepare File menu.
Definition: mainwindow.cpp:922
QAction * undo_action
Definition: mainwindow.h:252
void windowMenu_About_To_Be_Shown()
Function to prepare Window menu.
Definition: mainwindow.cpp:840
QMenu * open_recent
Definition: mainwindow.h:205
void toggle_full_screen()
Toggles full screen mode.
Definition: mainwindow.cpp:940
QAction * enable_drag_files_to_timeline
Definition: mainwindow.h:241
QAction * title_safe_169
Definition: mainwindow.h:220
QAction * title_safe_custom
Definition: mainwindow.h:221
QAction * title_safe_off
Definition: mainwindow.h:217
QAction * razor_tool_action
Definition: mainwindow.h:229
QAction * title_safe_default
Definition: mainwindow.h:218
virtual void closeEvent(QCloseEvent *) override
Close event.
Definition: mainwindow.cpp:748
void load_shortcuts(const QString &fn)
Load shortcut file.
Definition: mainwindow.cpp:297
QAction * edit_tool_action
Definition: mainwindow.h:227
Definition: timeline.h:85
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:328
void editMenu_About_To_Be_Shown()
Function to prepare Edit menu.
Definition: mainwindow.cpp:339
void viewMenu_About_To_Be_Shown()
Function to prepare View menu.
Definition: mainwindow.cpp:854
bool first_show
Definition: mainwindow.h:259
Definition: debugdialog.h:39
QAction * page_autoscroll
Definition: mainwindow.h:215
QAction * selecting_also_seeks
Definition: mainwindow.h:235
QAction * scroll_wheel_zooms
Definition: mainwindow.h:239
QAction * frames_action
Definition: mainwindow.h:210
QAction * slip_tool_action
Definition: mainwindow.h:230
QAction * pointer_tool_action
Definition: mainwindow.h:226
MainWindow(QWidget *parent)
Definition: mainwindow.cpp:101
QAction * enable_seek_to_import
Definition: mainwindow.h:243
virtual void paintEvent(QPaintEvent *) override
Paint event.
Definition: mainwindow.cpp:797
QAction * slide_tool_action
Definition: mainwindow.h:231
Definition: effectcontrols.h:51
QAction * seek_to_end_of_pastes
Definition: mainwindow.h:238
QAction * enable_audio_scrubbing
Definition: mainwindow.h:244
Definition: project.h:53
void setup_menus()
Initialize menu bar menus and items.
Definition: mainwindow.cpp:344
QAction * edit_tool_selects_links
Definition: mainwindow.h:237
MainWindow * MainWindow
Definition: mainwindow.cpp:69
void toolMenu_About_To_Be_Shown()
Function to prepare Tools menu.
Definition: mainwindow.cpp:881
QAction * drop_frame_action
Definition: mainwindow.h:211
void toggle_panel_visibility()
Toggle whether a panel is visible or not.
Definition: mainwindow.cpp:912
QAction * set_name_and_marker
Definition: mainwindow.h:247
void maximize_panel()
Maximizes the currently hovered panel.
Definition: mainwindow.cpp:812
QAction * smooth_autoscroll
Definition: mainwindow.h:216
QAction * nondrop_frame_action
Definition: mainwindow.h:212
QAction * track_lines
Definition: mainwindow.h:209
void reset_layout()
Reset panel layout to default.
Definition: mainwindow.cpp:806
QAction * transition_tool_action
Definition: mainwindow.h:233
void playbackMenu_About_To_Be_Shown()
Function to prepare Playback menu.
Definition: mainwindow.cpp:850
QAction * rectified_waveforms
Definition: mainwindow.h:240
QAction * no_autoscroll
Definition: mainwindow.h:214
QAction * enable_drop_on_media_to_replace
Definition: mainwindow.h:245
QAction * ripple_tool_action
Definition: mainwindow.h:228
QAction * hand_tool_action
Definition: mainwindow.h:232
virtual ~MainWindow() override
Definition: mainwindow.cpp:242
QAction * enable_hover_focus
Definition: mainwindow.h:246
QAction * redo_action
Definition: mainwindow.h:253
Definition: viewer.h:43
void setup_layout(bool reset)
Internal function for setting the panel layout to a predetermined preset.
Definition: mainwindow.cpp:73
Definition: mainwindow.h:31
QAction * loop_action
Definition: mainwindow.h:248
QAction * full_screen
Definition: mainwindow.h:222
void save_shortcuts(const QString &fn)
Save shortcut file.
Definition: mainwindow.cpp:311
QAction * clear_open_recent_action
Definition: mainwindow.h:206
QAction * title_safe_43
Definition: mainwindow.h:219
QAction * show_all
Definition: mainwindow.h:223
QAction * milliseconds_action
Definition: mainwindow.h:213
QAction * autoscale_by_default
Definition: mainwindow.h:242