diff --git a/mainwindow.cpp b/mainwindow.cpp index e2442322a..4832383bd 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -13,6 +13,8 @@ #include "dialogs/newsequencedialog.h" #include "dialogs/exportdialog.h" +#include "ui_timeline.h" + #include #include #include @@ -321,7 +323,44 @@ void MainWindow::on_actionPlay_Pause_triggered() void MainWindow::on_actionCrash_triggered() { - // intentionally tries to crash the program - mostly used for debugging - Timeline* temp; - temp->snapped = true; + if (QMessageBox::warning(this, "Are you sure you want to crash?", "WARNING: This is a debugging function designed to crash the program. Olive WILL crash and any unsaved progress WILL be lost. Are you sure you wish to do this?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { + // intentionally tries to crash the program - mostly used for debugging + Timeline* temp = NULL; + temp->snapped = true; + } +} + +void MainWindow::on_actionEdit_Tool_triggered() +{ + if (panel_timeline->focused()) panel_timeline->ui->toolEditButton->click(); +} + +void MainWindow::on_actionToggle_Snapping_triggered() +{ + if (panel_timeline->focused()) panel_timeline->ui->snappingButton->click(); +} + +void MainWindow::on_actionPointer_Tool_triggered() +{ + if (panel_timeline->focused()) panel_timeline->ui->toolArrowButton->click(); +} + +void MainWindow::on_actionRazor_Tool_triggered() +{ + if (panel_timeline->focused()) panel_timeline->ui->toolRazorButton->click(); +} + +void MainWindow::on_actionRipple_Tool_triggered() +{ + if (panel_timeline->focused()) panel_timeline->ui->toolRippleButton->click(); +} + +void MainWindow::on_actionRolling_Tool_triggered() +{ + if (panel_timeline->focused()) panel_timeline->ui->toolRollingButton->click(); +} + +void MainWindow::on_actionSlip_Tool_triggered() +{ + if (panel_timeline->focused()) panel_timeline->ui->toolSlipButton->click(); } diff --git a/mainwindow.h b/mainwindow.h index 3d74f69e6..11109de08 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -87,6 +87,20 @@ private slots: void on_actionCrash_triggered(); + void on_actionEdit_Tool_triggered(); + + void on_actionToggle_Snapping_triggered(); + + void on_actionPointer_Tool_triggered(); + + void on_actionRazor_Tool_triggered(); + + void on_actionRipple_Tool_triggered(); + + void on_actionRolling_Tool_triggered(); + + void on_actionSlip_Tool_triggered(); + private: Ui::MainWindow *ui; void setup_layout(); diff --git a/mainwindow.ui b/mainwindow.ui index 4acd10e05..df5dd8dce 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -24,7 +24,7 @@ 0 0 653 - 17 + 34 @@ -84,7 +84,6 @@ &Help - @@ -104,11 +103,30 @@ + + + &Tools + + + + + + + + + + + + + + + + @@ -367,6 +385,67 @@ Crash + + + Pointer Tool + + + V + + + + + Edit Tool + + + X + + + + + Razor Tool + + + C + + + + + Ripple Tool + + + B + + + + + Rolling Tool + + + N + + + + + Preferences + + + Ctrl+. + + + + + Toggle Snapping + + + S + + + + + Slip Tool + + diff --git a/olive.pro.user b/olive.pro.user index 946790bd8..5b75310a5 100644 --- a/olive.pro.user +++ b/olive.pro.user @@ -1,318 +1,336 @@ - - - - - - EnvironmentId - {3af06612-75ce-48d7-b444-7dc372f1566d} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.11.0 MSVC2017 64bit - Desktop Qt 5.11.0 MSVC2017 64bit - qt.qt5.5110.win64_msvc2017_64_kit - 0 - 0 - 0 - - C:/Users/Matt/Documents/temp - - - true - qmake - - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Make - - Qt4ProjectManager.MakeStep - - false - - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - true - Make - - Qt4ProjectManager.MakeStep - - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - true - - - C:/Users/Matt/Desktop/build-olive-Desktop_Qt_5_11_0_MSVC2017_64bit-Release - - - true - qmake - - QtProjectManager.QMakeBuildStep - false - - false - false - false - - - true - Make - - Qt4ProjectManager.MakeStep - - false - - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - true - Make - - Qt4ProjectManager.MakeStep - - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - true - - - C:/Users/Matt/Desktop/build-olive-Desktop_Qt_5_11_0_MSVC2017_64bit-Profile - - - true - qmake - - QtProjectManager.QMakeBuildStep - true - - false - true - false - - - true - Make - - Qt4ProjectManager.MakeStep - - false - - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - true - Make - - Qt4ProjectManager.MakeStep - - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - true - - 3 - - - 0 - Deploy - - ProjectExplorer.BuildSteps.Deploy - - 1 - Deploy Configuration - - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - olive - - Qt4ProjectManager.Qt4RunConfiguration:C:/Users/Matt/Desktop/olive/olive.pro - true - - olive.pro - false - - C:/Users/Matt/Documents/temp - 3768 - false - true - false - false - true - - 1 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.FileVersion - 18 - - - Version - 18 - - + + + + + + EnvironmentId + {be57d5b1-e5ae-4026-9f48-bb6e01f50d4e} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 2 + true + true + 1 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.5.1 GCC 64bit + Desktop Qt 5.5.1 GCC 64bit + qt.55.gcc_64_kit + 0 + 0 + 0 + + /home/matt/Documents/build-olive-Desktop_Qt_5_5_1_GCC_64bit-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/matt/build-olive-Desktop_Qt_5_5_1_GCC_64bit-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + /home/matt/build-olive-Desktop_Qt_5_5_1_GCC_64bit-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy Configuration + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + olive + + Qt4ProjectManager.Qt4RunConfiguration:/home/matt/olive/olive.pro + true + + olive.pro + false + + /home/matt/Documents/build-olive-Desktop_Qt_5_5_1_GCC_64bit-Debug + 3768 + false + true + false + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 18 + + + Version + 18 + + diff --git a/panels/timeline.cpp b/panels/timeline.cpp index 687633d48..ed6565099 100644 --- a/panels/timeline.cpp +++ b/panels/timeline.cpp @@ -19,7 +19,7 @@ Timeline::Timeline(QWidget *parent) : QDockWidget(parent), ui(new Ui::Timeline) -{ +{ selecting = moving_init = moving_proc = splitting = importing = playing = trim_in = snapped = false; snapping = true; last_frame = playhead = snap_point = cursor_frame = cursor_track = 0; diff --git a/panels/timeline.h b/panels/timeline.h index 13d0785b2..8327158b6 100644 --- a/panels/timeline.h +++ b/panels/timeline.h @@ -132,6 +132,7 @@ public: // ripple void ripple(long ripple_point, long ripple_length); + Ui::Timeline *ui; public slots: void repaint_timeline(); @@ -155,7 +156,6 @@ private slots: void on_snappingButton_toggled(bool checked); private: - Ui::Timeline *ui; QVector tool_buttons; void decheck_tool_buttons(QObject* sender); void set_tool(int tool);