From 5776387eb0ae92edd8d204501b135c248e0a06c4 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Fri, 18 Jan 2019 00:32:57 +1100 Subject: [PATCH] added naming for media and sequence viewer --- mainwindow.cpp | 2 +- mainwindow.ui | 973 ---------------------------------------------- panels/panels.cpp | 17 +- panels/viewer.cpp | 25 +- panels/viewer.h | 2 + 5 files changed, 31 insertions(+), 988 deletions(-) delete mode 100644 mainwindow.ui diff --git a/mainwindow.cpp b/mainwindow.cpp index 8b51f868a..5328600eb 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -774,7 +774,7 @@ void MainWindow::setup_menus() { window_graph_editor_action->setCheckable(true); window_graph_editor_action->setData(reinterpret_cast(panel_graph_editor)); - QAction* window_footageviewer_action = window_menu->addAction(tr("Footage Viewer"), this, SLOT(toggle_panel_visibility())); + QAction* window_footageviewer_action = window_menu->addAction(tr("Media Viewer"), this, SLOT(toggle_panel_visibility())); window_footageviewer_action->setProperty("id", "panelfootageviewer"); window_footageviewer_action->setCheckable(true); window_footageviewer_action->setData(reinterpret_cast(panel_footage_viewer)); diff --git a/mainwindow.ui b/mainwindow.ui deleted file mode 100644 index 1daae80cf..000000000 --- a/mainwindow.ui +++ /dev/null @@ -1,973 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 653 - 394 - - - - MainWindow - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - 0 - 0 - 653 - 16 - - - - - &File - - - - &New - - - - - - - - - Open Recent - - - - - - - - - - - - - - - - - &Edit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - &Window - - - - - - - - - - - - - &Help - - - - - - &View - - - - Title/Action Safe Area - - - - - - - - - - - - - - - - - - - - - - - - - - - &Playback - - - - - - - - - - - - - &Tools - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - &Open Project - - - Ctrl+O - - - - - &Save Project - - - Ctrl+S - - - - - Save Project &As - - - Ctrl+Shift+S - - - - - &Import... - - - Ctrl+I - - - - - &Export... - - - Ctrl+M - - - - - E&xit - - - - - About... - - - - - &Undo - - - Ctrl+Z - - - - - &Redo - - - Ctrl+Shift+Z - - - - - Cu&t - - - Ctrl+X - - - - - Cop&y - - - Ctrl+C - - - - - &Paste - - - Ctrl+V - - - - - Paste Insert - - - Ctrl+Shift+V - - - - - Delete - - - Del - - - - - Select &All - - - Ctrl+A - - - - - true - - - Track Lines - - - - - Project... - - - Ctrl+N - - - - - Sequence... - - - Ctrl+Shift+N - - - - - Zoom In - - - = - - - - - Zoom Out - - - - - - - - - true - - - true - - - Project - - - - - true - - - true - - - Effect Controls - - - - - true - - - true - - - Sequence Viewer - - - - - true - - - true - - - Timeline - - - - - Ripple Delete - - - Shift+Del - - - - - Split at Playhead - - - Ctrl+K - - - - - Deselect All - - - - - Go to Start - - - Home - - - - - Reset to default layout - - - - - Previous Frame - - - Left - - - - - Play/Pause - - - Space - - - - - Next Frame - - - Right - - - - - Go to End - - - End - - - - - Crash - - - false - - - - - Pointer Tool - - - V - - - - - Edit Tool - - - X - - - - - Razor Tool - - - C - - - - - Ripple Tool - - - B - - - - - Rolling Tool - - - N - - - false - - - - - Preferences - - - Ctrl+. - - - - - true - - - Snapping - - - Snapping - - - S - - - - - Slip Tool - - - Y - - - - - Go to Previous Cut - - - Up - - - - - Go to Next Cut - - - Down - - - - - true - - - Edit Tool Also Seeks - - - - - Increase Track Height - - - Ctrl+= - - - - - Decrease Track Height - - - Ctrl+- - - - - - true - - - Frames - - - - - true - - - Drop-Frame - - - - - true - - - Non-Drop Frame - - - - - true - - - Edit Tool Selects Links - - - - - Duplicate - - - Ctrl+D - - - - - true - - - Selecting Also Seeks - - - - - true - - - Seek to the End of Pastes - - - - - Add Default Transition - - - Ctrl+Shift+D - - - - - Slide Tool - - - U - - - - - Folder - - - - - Clear Recent List - - - - - true - - - Scroll Wheel Zooms - - - - - Link/Unlink - - - Ctrl+L - - - - - Ripple to In Point - - - Q - - - - - Ripple to Out Point - - - W - - - - - Set In Point - - - I - - - - - Set Out Point - - - O - - - - - Clear In/Out - - - G - - - - - Delete In/Out - - - ; - - - - - Ripple Delete In/Out - - - ' - - - - - true - - - Rectified Waveforms - - - - - true - - - Default - - - - - true - - - Off - - - - - true - - - 4:3 - - - - - true - - - 16:9 - - - - - true - - - Custom - - - - - true - - - Enable Drag Files to Timeline - - - - - true - - - Auto-scale by Default - - - - - Set/Edit Marker - - - M - - - - - Enable/Disable Clip - - - Shift+E - - - - - true - - - Enable Seek to Import - - - - - true - - - Audio Scrubbing - - - - - Transition Tool - - - T - - - - - Edit to In Point - - - Ctrl+Alt+Q - - - - - Edit to Out Point - - - Ctrl+Alt+W - - - - - Nest - - - - - Toggle Show All - - - \ - - - - - true - - - Enable Drop File on Media to Replace - - - - - true - - - Footage Viewer - - - - - true - - - No Auto-scroll - - - - - true - - - Page Auto-scroll - - - - - true - - - Smooth Auto-scroll - - - - - true - - - Milliseconds - - - - - true - - - Enable Hover Focus for Zooming - - - - - true - - - Full Screen - - - F11 - - - - - Hand Tool - - - H - - - - - true - - - Graph Editor - - - - - - - diff --git a/panels/panels.cpp b/panels/panels.cpp index f067cb25d..ddd283679 100644 --- a/panels/panels.cpp +++ b/panels/panels.cpp @@ -12,6 +12,7 @@ #include "debug.h" #include +#include Project* panel_project = 0; EffectControls* panel_effect_controls = 0; @@ -125,9 +126,9 @@ QDockWidget *get_focused_panel() { w = panel_footage_viewer; } else if (panel_timeline->underMouse()) { w = panel_timeline; - } else if (panel_graph_editor->view_is_under_mouse()) { - w = panel_graph_editor; - } + } else if (panel_graph_editor->view_is_under_mouse()) { + w = panel_graph_editor; + } } if (w == nullptr) { if (panel_project->is_focused()) { @@ -140,9 +141,9 @@ QDockWidget *get_focused_panel() { w = panel_footage_viewer; } else if (panel_timeline->focused()) { w = panel_timeline; - } else if (panel_graph_editor->view_is_focused()) { - w = panel_graph_editor; - } + } else if (panel_graph_editor->view_is_focused()) { + w = panel_graph_editor; + } } return w; } @@ -151,12 +152,14 @@ void alloc_panels(QWidget* parent) { // TODO maybe replace these with non-pointers later on? panel_sequence_viewer = new Viewer(parent); panel_sequence_viewer->setObjectName("seq_viewer"); + panel_sequence_viewer->set_panel_name(QCoreApplication::translate("Viewer", "Sequence Viewer")); panel_footage_viewer = new Viewer(parent); panel_footage_viewer->setObjectName("footage_viewer"); + panel_footage_viewer->set_panel_name(QCoreApplication::translate("Viewer", "Media Viewer")); panel_project = new Project(parent); panel_project->setObjectName("proj_root"); panel_effect_controls = new EffectControls(parent); - init_effects(); + init_effects(); panel_effect_controls->setObjectName("fx_controls"); panel_timeline = new Timeline(parent); panel_timeline->setObjectName("timeline"); diff --git a/panels/viewer.cpp b/panels/viewer.cpp index c1bdfab2c..b10ec30cd 100644 --- a/panels/viewer.cpp +++ b/panels/viewer.cpp @@ -43,9 +43,8 @@ Viewer::Viewer(QWidget *parent) : media(nullptr), seq(nullptr), created_sequence(false), - cue_recording_internal(false), - panel_name(tr("Viewer: ")), - minimum_zoom(1.0) + minimum_zoom(1.0), + cue_recording_internal(false) { setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); @@ -488,6 +487,21 @@ void Viewer::set_zoom(bool in) { } } +void Viewer::set_panel_name(const QString &n) { + panel_name = n; + update_window_title(); +} + +void Viewer::update_window_title() { + QString name; + if (seq == nullptr) { + name = tr("(none)"); + } else { + name = seq->name; + } + setWindowTitle(QString("%1: %2").arg(panel_name, name)); +} + void Viewer::set_zoom_value(double d) { headers->update_zoom(d); if (viewer_widget->waveform) { @@ -781,14 +795,11 @@ void Viewer::set_sequence(bool main, Sequence *s) { update_end_timecode(); viewer_container->adjust(); - - setWindowTitle(panel_name + seq->name); } else { update_playhead_timecode(0); update_end_timecode(); - - setWindowTitle(panel_name + tr("(none)")); } + update_window_title(); update_header_zoom(); diff --git a/panels/viewer.h b/panels/viewer.h index acb187559..38c563bc0 100644 --- a/panels/viewer.h +++ b/panels/viewer.h @@ -45,6 +45,7 @@ public: void set_in_point(); void set_out_point(); void set_zoom(bool in); + void set_panel_name(const QString& n); // playback functions void seek(long p); @@ -91,6 +92,7 @@ private slots: void resize_move(double d); private: + void update_window_title(); void clean_created_seq(); void set_sequence(bool main, Sequence* s); bool main_sequence;