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

#include <mainwindow.h>

Inheritance diagram for MainWindow:

Public Slots

void toggle_full_screen ()
 Toggles full screen mode. More...
 

Signals

void finished_first_paint ()
 Signal emitted once when the main window has finished initializing. More...
 

Public Member Functions

 MainWindow (QWidget *parent)
 
virtual ~MainWindow () override
 
void updateTitle ()
 Update window title. More...
 
void load_shortcuts (const QString &fn)
 Load shortcut file. More...
 
void save_shortcuts (const QString &fn)
 Save shortcut file. More...
 
bool load_css_from_file (const QString &fn)
 Load a CSS/QSS style from file to customize Olive's interface. More...
 
void Restyle ()
 Set application's QStyle based on values from Config. More...
 

Protected Member Functions

virtual void closeEvent (QCloseEvent *) override
 Close event. More...
 
virtual void paintEvent (QPaintEvent *) override
 Paint event. More...
 
virtual void changeEvent (QEvent *e) override
 Change event. More...
 

Private Slots

void maximize_panel ()
 Maximizes the currently hovered panel. More...
 
void reset_layout ()
 Reset panel layout to default. More...
 
void fileMenu_About_To_Be_Shown ()
 Function to prepare File menu. More...
 
void editMenu_About_To_Be_Shown ()
 Function to prepare Edit menu. More...
 
void windowMenu_About_To_Be_Shown ()
 Function to prepare Window menu. More...
 
void playbackMenu_About_To_Be_Shown ()
 Function to prepare Playback menu. More...
 
void viewMenu_About_To_Be_Shown ()
 Function to prepare View menu. More...
 
void toolMenu_About_To_Be_Shown ()
 Function to prepare Tools menu. More...
 
void toggle_panel_visibility ()
 Toggle whether a panel is visible or not. More...
 
void set_panels_locked (bool locked)
 Set panel lock. More...
 

Private Member Functions

void setup_layout (bool reset)
 Internal function for setting the panel layout to a predetermined preset. More...
 
void setup_menus ()
 Initialize menu bar menus and items. More...
 
void Retranslate ()
 

Private Attributes

QMenu * file_menu
 
QMenu * new_menu
 
QAction * open_project
 
QMenu * open_recent
 
QAction * open_action
 
QAction * clear_open_recent_action
 
QAction * save_project
 
QAction * save_project_as
 
QAction * import_action
 
QAction * export_action
 
QAction * exit_action
 
QMenu * edit_menu
 
QAction * undo_action
 
QAction * redo_action
 
QAction * select_all_action
 
QAction * deselect_all_action
 
QAction * ripple_to_in_point_
 
QAction * ripple_to_out_point_
 
QAction * edit_to_in_point_
 
QAction * edit_to_out_point_
 
QAction * delete_inout_point_
 
QAction * ripple_delete_inout_point_
 
QAction * setedit_marker_
 
QMenu * view_menu
 
QAction * zoom_in_
 
QAction * zoom_out_
 
QAction * increase_track_height_
 
QAction * decrease_track_height_
 
QAction * track_lines
 
QAction * frames_action
 
QAction * drop_frame_action
 
QAction * nondrop_frame_action
 
QAction * milliseconds_action
 
QAction * no_autoscroll
 
QAction * page_autoscroll
 
QAction * smooth_autoscroll
 
QMenu * title_safe_area_menu
 
QAction * title_safe_off
 
QAction * title_safe_default
 
QAction * title_safe_43
 
QAction * title_safe_169
 
QAction * title_safe_custom
 
QAction * full_screen
 
QAction * full_screen_viewer_
 
QAction * show_all
 
QMenu * playback_menu
 
QAction * go_to_start_
 
QAction * previous_frame_
 
QAction * playpause_
 
QAction * play_in_to_out_
 
QAction * next_frame_
 
QAction * go_to_end_
 
QAction * go_to_prev_cut_
 
QAction * go_to_next_cut_
 
QAction * go_to_in_point_
 
QAction * go_to_out_point_
 
QAction * shuttle_left_
 
QAction * shuttle_stop_
 
QAction * shuttle_right_
 
QAction * loop_action_
 
QMenu * window_menu
 
QAction * window_project_action
 
QAction * window_effectcontrols_action
 
QAction * window_timeline_action
 
QAction * window_graph_editor_action
 
QAction * window_footageviewer_action
 
QAction * window_sequenceviewer_action
 
QAction * maximize_panel_
 
QAction * lock_panels_
 
QAction * reset_default_layout_
 
QMenu * tools_menu
 
QAction * pointer_tool_action
 
QAction * edit_tool_action
 
QAction * ripple_tool_action
 
QAction * razor_tool_action
 
QAction * slip_tool_action
 
QAction * slide_tool_action
 
QAction * hand_tool_action
 
QAction * transition_tool_action
 
QAction * snap_toggle
 
QAction * rectified_waveforms
 
QAction * autocut_silence_
 
QAction * preferences_action_
 
QAction * clear_undo_action_
 
QMenu * help_menu
 
QAction * action_search_
 
QAction * debug_log_
 
QAction * about_action_
 
QByteArray temp_panel_state
 
bool first_show
 

Constructor & Destructor Documentation

MainWindow::MainWindow ( QWidget *  parent)
explicit
MainWindow::~MainWindow ( )
overridevirtual

Member Function Documentation

void MainWindow::changeEvent ( QEvent *  e)
overrideprotectedvirtual

Change event.

Overridden to handle language changes (e->type() == QEvent::LanguageChange) by calling Retranslate().

See documentation for QWidget::changeEvent() for more information.

Parameters
e
Returns
void MainWindow::closeEvent ( QCloseEvent *  e)
overrideprotectedvirtual

Close event.

Confirms whether the project can be closed, and if so performs various clean-up functions before the application exits. It's preferable to call clean-up functions here rather than in the destructor because this will get called first.

void MainWindow::editMenu_About_To_Be_Shown ( )
privateslot

Function to prepare Edit menu.

Primarily used to set the enabled state on Undo and Redo depending if there are undos/redos available.

void MainWindow::fileMenu_About_To_Be_Shown ( )
privateslot

Function to prepare File menu.

Primarily used to populate the Open Recent Projects menu.

void MainWindow::finished_first_paint ( )
signal

Signal emitted once when the main window has finished initializing.

Emitted the first time paintEvent runs. Connect this to functions that must be completed post-initialization.

bool MainWindow::load_css_from_file ( const QString &  fn)

Load a CSS/QSS style from file to customize Olive's interface.

Parameters
fnURL to load the CSS file from.
Returns

TRUE if CSS was successfully loaded.

void MainWindow::load_shortcuts ( const QString &  fn)

Load shortcut file.

Loads a shortcut configuration from file and sets Olive to use them.

Parameters
fnURL of the shortcut file to be loaded
void MainWindow::maximize_panel ( )
privateslot

Maximizes the currently hovered panel.

Saves the current state of the panels/dock widgets and removes all except the currently hovered panel, effectively maximizing the panel to the entire window.

void MainWindow::paintEvent ( QPaintEvent *  event)
overrideprotectedvirtual

Paint event.

Overridden to provide the finished_first_paint() signal.

Set up the dock widget layout on the main window

For some reason, Qt didn't like this in the constructor. It would lead to several geometry issues with HiDPI on Windows, and also seemed to break QMainWindow::restoreState() which is why it took so long to implement saving/restoring panel layouts. Putting it in showEvent() didn't help either, nor did putting it in changeEvent() (QEvent::type() == QEvent::Polish). This is the only place it's functioned as expected.

Signal that window has finished loading.

void MainWindow::playbackMenu_About_To_Be_Shown ( )
privateslot

Function to prepare Playback menu.

Primarily used to set the checked state on the "Loop" item.

void MainWindow::reset_layout ( )
privateslot

Reset panel layout to default.

Resets the current panel layout to default. Doesn't save the current layout.

void MainWindow::Restyle ( )

Set application's QStyle based on values from Config.

void MainWindow::Retranslate ( )
private
void MainWindow::save_shortcuts ( const QString &  fn)

Save shortcut file.

Saves the current shortcut configuration to file. Only saves shortcuts that have been changed from default.

Parameters
fnURL to save the shortcut file to.
void MainWindow::set_panels_locked ( bool  locked)
privateslot

Set panel lock.

Parameters
lockedIf TRUE prevents panels from being moved around. Defaults to FALSE.
void MainWindow::setup_layout ( bool  reset)
private

Internal function for setting the panel layout to a predetermined preset.

Resets layout to default and optionally loads a layout from file. If loading from file, this function will always load from get_config_path() + "/layout".

Parameters
resetTRUE if this function should just reset the current layout. FALSE if it should load from the aforementioned layout file.
void MainWindow::setup_menus ( )
private

Initialize menu bar menus and items.

Internal initialization function for all menus and menu items in the main window. Called once from the MainWindow() constructor.

void MainWindow::toggle_full_screen ( )
slot

Toggles full screen mode.

Toggles the main window between full screen and windowed modes.

void MainWindow::toggle_panel_visibility ( )
privateslot

Toggle whether a panel is visible or not.

Assumes the sender() QAction has a pointer to a QDockWidget in its data variable. Casts it and toggles its visibility.

void MainWindow::toolMenu_About_To_Be_Shown ( )
privateslot

Function to prepare Tools menu.

Primarily used to set the checked state on various settings available from the Tools menu.

void MainWindow::updateTitle ( )

Update window title.

Updates the window title to reflect the current project filename. Call if the project filename changes.

NOTE: It's recommended to use update_project_filename() from Olive::Global to update the filename completely instead of calling this function directly (update_project_filename() calls this function in the process).

void MainWindow::viewMenu_About_To_Be_Shown ( )
privateslot

Function to prepare View menu.

Primarily used to set the checked state of various options in the view menu (e.g. title safe area, timecode units, etc.)

void MainWindow::windowMenu_About_To_Be_Shown ( )
privateslot

Function to prepare Window menu.

Primarily used to set the checked state of menu items corresponding to the panels that are currently visible.

Member Data Documentation

QAction* MainWindow::about_action_
private
QAction* MainWindow::action_search_
private
QAction* MainWindow::autocut_silence_
private
QAction* MainWindow::clear_open_recent_action
private
QAction* MainWindow::clear_undo_action_
private
QAction* MainWindow::debug_log_
private
QAction* MainWindow::decrease_track_height_
private
QAction* MainWindow::delete_inout_point_
private
QAction* MainWindow::deselect_all_action
private
QAction* MainWindow::drop_frame_action
private
QMenu* MainWindow::edit_menu
private
QAction* MainWindow::edit_to_in_point_
private
QAction* MainWindow::edit_to_out_point_
private
QAction* MainWindow::edit_tool_action
private
QAction* MainWindow::exit_action
private
QAction* MainWindow::export_action
private
QMenu* MainWindow::file_menu
private
bool MainWindow::first_show
private
QAction* MainWindow::frames_action
private
QAction* MainWindow::full_screen
private
QAction* MainWindow::full_screen_viewer_
private
QAction* MainWindow::go_to_end_
private
QAction* MainWindow::go_to_in_point_
private
QAction* MainWindow::go_to_next_cut_
private
QAction* MainWindow::go_to_out_point_
private
QAction* MainWindow::go_to_prev_cut_
private
QAction* MainWindow::go_to_start_
private
QAction* MainWindow::hand_tool_action
private
QMenu* MainWindow::help_menu
private
QAction* MainWindow::import_action
private
QAction* MainWindow::increase_track_height_
private
QAction* MainWindow::lock_panels_
private
QAction* MainWindow::loop_action_
private
QAction* MainWindow::maximize_panel_
private
QAction* MainWindow::milliseconds_action
private
QMenu* MainWindow::new_menu
private
QAction* MainWindow::next_frame_
private
QAction* MainWindow::no_autoscroll
private
QAction* MainWindow::nondrop_frame_action
private
QAction* MainWindow::open_action
private
QAction* MainWindow::open_project
private
QMenu* MainWindow::open_recent
private
QAction* MainWindow::page_autoscroll
private
QAction* MainWindow::play_in_to_out_
private
QMenu* MainWindow::playback_menu
private
QAction* MainWindow::playpause_
private
QAction* MainWindow::pointer_tool_action
private
QAction* MainWindow::preferences_action_
private
QAction* MainWindow::previous_frame_
private
QAction* MainWindow::razor_tool_action
private
QAction* MainWindow::rectified_waveforms
private
QAction* MainWindow::redo_action
private
QAction* MainWindow::reset_default_layout_
private
QAction* MainWindow::ripple_delete_inout_point_
private
QAction* MainWindow::ripple_to_in_point_
private
QAction* MainWindow::ripple_to_out_point_
private
QAction* MainWindow::ripple_tool_action
private
QAction* MainWindow::save_project
private
QAction* MainWindow::save_project_as
private
QAction* MainWindow::select_all_action
private
QAction* MainWindow::setedit_marker_
private
QAction* MainWindow::show_all
private
QAction* MainWindow::shuttle_left_
private
QAction* MainWindow::shuttle_right_
private
QAction* MainWindow::shuttle_stop_
private
QAction* MainWindow::slide_tool_action
private
QAction* MainWindow::slip_tool_action
private
QAction* MainWindow::smooth_autoscroll
private
QAction* MainWindow::snap_toggle
private
QByteArray MainWindow::temp_panel_state
private
QAction* MainWindow::title_safe_169
private
QAction* MainWindow::title_safe_43
private
QMenu* MainWindow::title_safe_area_menu
private
QAction* MainWindow::title_safe_custom
private
QAction* MainWindow::title_safe_default
private
QAction* MainWindow::title_safe_off
private
QMenu* MainWindow::tools_menu
private
QAction* MainWindow::track_lines
private
QAction* MainWindow::transition_tool_action
private
QAction* MainWindow::undo_action
private
QMenu* MainWindow::view_menu
private
QAction* MainWindow::window_effectcontrols_action
private
QAction* MainWindow::window_footageviewer_action
private
QAction* MainWindow::window_graph_editor_action
private
QMenu* MainWindow::window_menu
private
QAction* MainWindow::window_project_action
private
QAction* MainWindow::window_sequenceviewer_action
private
QAction* MainWindow::window_timeline_action
private
QAction* MainWindow::zoom_in_
private
QAction* MainWindow::zoom_out_
private

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