improvements and moved many behavioral tools menu items to preferences

This commit is contained in:
itsmattkc
2019-03-24 18:28:01 +11:00
15 changed files with 609 additions and 161 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ Config::Config()
hover_focus(false),
project_view_type(olive::PROJECT_VIEW_TREE),
set_name_with_marker(true),
show_project_toolbar(false),
show_project_toolbar(true),
previous_queue_size(3),
previous_queue_type(olive::FRAME_QUEUE_TYPE_FRAMES),
upcoming_queue_size(0.5),
+36 -6
View File
@@ -39,6 +39,7 @@
#include "dialogs/speeddialog.h"
#include "dialogs/actionsearch.h"
#include "dialogs/loaddialog.h"
#include "dialogs/autocutsilencedialog.h"
#include "project/loadthread.h"
#include "timeline/sequence.h"
#include "ui/mediaiconservice.h"
@@ -301,12 +302,7 @@ bool OliveGlobal::can_close_project() {
}
void OliveGlobal::open_export_dialog() {
if (olive::ActiveSequence == nullptr) {
QMessageBox::information(olive::MainWindow,
tr("No active sequence"),
tr("Please open the sequence you wish to export."),
QMessageBox::Ok);
} else {
if (CheckForActiveSequence()) {
ExportDialog e(olive::MainWindow);
e.exec();
}
@@ -377,6 +373,22 @@ void OliveGlobal::OpenProjectWorker(const QString& fn, bool autorecovery) {
olive::UndoStack.clear();
}
bool OliveGlobal::CheckForActiveSequence(bool show_msg)
{
if (olive::ActiveSequence == nullptr) {
if (show_msg) {
QMessageBox::information(olive::MainWindow,
tr("No active sequence"),
tr("Please open the sequence to perform this action."),
QMessageBox::Ok);
}
return false;
}
return true;
}
void OliveGlobal::undo() {
// workaround to prevent crash (and also users should never need to do this)
if (!panel_timeline->importing) {
@@ -426,6 +438,24 @@ void OliveGlobal::open_speed_dialog() {
}
}
void OliveGlobal::open_autocut_silence_dialog() {
if (CheckForActiveSequence()) {
QVector<Clip*> selected_clips = olive::ActiveSequence->SelectedClips();
if (selected_clips.isEmpty()) {
QMessageBox::critical(olive::MainWindow,
tr("No clips selected"),
tr("Select the clips you wish to auto-cut"),
QMessageBox::Ok);
} else {
AutoCutSilenceDialog s(olive::MainWindow, selected_clips);
s.exec();
}
}
}
void OliveGlobal::clear_undo_stack() {
olive::UndoStack.clear();
}
+17
View File
@@ -275,6 +275,11 @@ public slots:
*/
void open_speed_dialog();
/**
* @brief Open the auto-cut silence dialog.
*/
void open_autocut_silence_dialog();
/**
* @brief Open the Action Search overlay.
*/
@@ -340,6 +345,18 @@ private:
*/
void OpenProjectWorker(const QString& fn, bool autorecovery);
/**
* @brief Returns whether a Sequence is currently active or not, and optionally displays a messagebox if not
*
* Checks whether a Sequence is active and can display a messagebox if not to inform users to make one active in
* order to perform said action.
*
* @return
*
* TRUE if there is an active Sequence, FALSE if not.
*/
bool CheckForActiveSequence(bool show_msg = true);
/**
* @brief Create a LoadDialog and start a LoadThread to load data from a project
*