moved undostack to its own source file

This commit is contained in:
itsmattkc
2019-03-14 10:53:50 +11:00
parent c6a4b9e8d6
commit c73fc78087
37 changed files with 212 additions and 172 deletions
+1
View File
@@ -35,6 +35,7 @@
#include "project/media.h"
#include "panels/project.h"
#include "undo/undo.h"
#include "undo/undostack.h"
MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
QDialog(parent),
+1
View File
@@ -23,6 +23,7 @@
#include "panels/panels.h"
#include "panels/project.h"
#include "timeline/sequence.h"
#include "undo/undostack.h"
#include "undo/undo.h"
#include "timeline/clip.h"
#include "panels/timeline.h"
+6
View File
@@ -544,6 +544,12 @@ void PreferencesDialog::setup_ui() {
use_software_fallbacks_checkbox->setChecked(olive::CurrentConfig.use_software_fallback);
general_layout->addWidget(use_software_fallbacks_checkbox, row, 0, 1, 4);
row++;
// General -> Default Sequence Settings
QPushButton* default_sequence_settings = new QPushButton(tr("Default Sequence Settings"));
general_layout->addWidget(default_sequence_settings);
tabWidget->addTab(general_tab, tr("General"));
// Behavior
+10
View File
@@ -34,6 +34,8 @@
#include <QDoubleSpinBox>
#include <QSpinBox>
#include "timeline/sequence.h"
class KeySequenceEditor : public QKeySequenceEdit {
Q_OBJECT
public:
@@ -72,6 +74,13 @@ private:
// used to delete previews
// type can be: 't' for thumbnails, 'w' for waveforms, or 1 for all
/**
* @brief Delete disk cached preview files (thumbnails, waveforms, etc.)
*
* @param type
*
* The types of previews to
*/
void delete_previews(char type);
QLineEdit* custom_css_fn;
@@ -94,6 +103,7 @@ private:
QSpinBox* waveform_res_spinbox;
QCheckBox* add_default_effects_to_clips;
QComboBox* ui_style;
Sequence sequence_settings;
QVector<QAction*> key_shortcut_actions;
QVector<QTreeWidgetItem*> key_shortcut_items;
+5 -5
View File
@@ -20,16 +20,16 @@
#include "replaceclipmediadialog.h"
#include "panels/panels.h"
#include "rendering/cacher.h"
#include "undo/undo.h"
#include <QVBoxLayout>
#include <QLabel>
#include <QPushButton>
#include <QMessageBox>
#include "panels/panels.h"
#include "undo/undostack.h"
#include "rendering/cacher.h"
#include "undo/undo.h"
ReplaceClipMediaDialog::ReplaceClipMediaDialog(QWidget *parent, Media* old_media) :
QDialog(parent),
media(old_media)
+1
View File
@@ -32,6 +32,7 @@
#include "panels/panels.h"
#include "panels/timeline.h"
#include "undo/undo.h"
#include "undo/undostack.h"
#include "effects/effect.h"
#include "project/media.h"
+16 -14
View File
@@ -20,6 +20,19 @@
#include "effect.h"
#include <QCheckBox>
#include <QGridLayout>
#include <QXmlStreamReader>
#include <QXmlStreamWriter>
#include <QMessageBox>
#include <QOpenGLContext>
#include <QDir>
#include <QPainter>
#include <QtMath>
#include <QMenu>
#include <QApplication>
#include <QFileDialog>
#include "panels/panels.h"
#include "panels/viewer.h"
#include "ui/viewerwidget.h"
@@ -39,6 +52,7 @@
#include "project/clipboard.h"
#include "global/config.h"
#include "transition.h"
#include "undo/undostack.h"
#include "effects/internal/transformeffect.h"
#include "effects/internal/texteffect.h"
@@ -54,19 +68,6 @@
#include "effects/internal/fillleftrighteffect.h"
#include "effects/internal/frei0reffect.h"
#include <QCheckBox>
#include <QGridLayout>
#include <QXmlStreamReader>
#include <QXmlStreamWriter>
#include <QMessageBox>
#include <QOpenGLContext>
#include <QDir>
#include <QPainter>
#include <QtMath>
#include <QMenu>
#include <QApplication>
#include <QFileDialog>
QVector<EffectMeta> effects;
EffectPtr Effect::Create(Clip* c, const EffectMeta* em) {
@@ -295,7 +296,7 @@ Effect::Effect(Clip* c, const EffectMeta *em) :
}
}
} else if (reader.name() == "shader" && reader.isStartElement()) {
SetFlags(Flags() & ShaderFlag);
SetFlags(Flags() | ShaderFlag);
const QXmlStreamAttributes& attributes = reader.attributes();
for (int i=0;i<attributes.size();i++) {
const QXmlStreamAttribute& attr = attributes.at(i);
@@ -855,6 +856,7 @@ void Effect::process_shader(double timecode, GLTextureCoords&, int iteration) {
case EffectField::EFFECT_FIELD_STRING:
case EffectField::EFFECT_FIELD_FONT:
case EffectField::EFFECT_FIELD_FILE:
case EffectField::EFFECT_FIELD_UI:
break;
}
}
+1
View File
@@ -27,6 +27,7 @@
#include "effects/keyframe.h"
#include "undo/undo.h"
#include "undo/undostack.h"
class EffectRow;
class ComboAction;
-10
View File
@@ -46,16 +46,6 @@ EffectGizmo::EffectGizmo(Effect *parent, int type) :
color = Qt::white;
}
void EffectGizmo::set_previous_value() {
// TODO address this
/*
if (x_field1 != nullptr) static_cast<LabelSlider*>(x_field1->ui_element)->set_previous_value();
if (y_field1 != nullptr) static_cast<LabelSlider*>(y_field1->ui_element)->set_previous_value();
if (x_field2 != nullptr) static_cast<LabelSlider*>(x_field2->ui_element)->set_previous_value();
if (y_field2 != nullptr) static_cast<LabelSlider*>(y_field2->ui_element)->set_previous_value();
*/
}
int EffectGizmo::get_point_count() {
return world_pos.size();
}
-2
View File
@@ -57,8 +57,6 @@ public:
DoubleField* y_field2;
double y_field_multi2;
void set_previous_value();
QColor color;
int get_point_count();
+1
View File
@@ -25,6 +25,7 @@
#include <QMessageBox>
#include "undo/undo.h"
#include "undo/undostack.h"
#include "timeline/clip.h"
#include "timeline/sequence.h"
#include "panels/panels.h"
+1 -1
View File
@@ -25,7 +25,7 @@
#include "global/debug.h"
CornerPinEffect::CornerPinEffect(Clip* c, const EffectMeta *em) : Effect(c, em) {
SetFlags(Effect::CoordsFlag & Effect::ShaderFlag);
SetFlags(Effect::CoordsFlag | Effect::ShaderFlag);
EffectRow* top_left = new EffectRow(this, tr("Top Left"));
top_left_x = new DoubleField(top_left, "topleftx");
+1
View File
@@ -24,6 +24,7 @@
#include "effectfields.h"
#include "undo/undo.h"
#include "undo/undostack.h"
#include "panels/panels.h"
EffectKeyframe::EffectKeyframe()
+13 -12
View File
@@ -20,15 +20,16 @@
#include "global/global.h"
#include <QMessageBox>
#include <QFileDialog>
#include <QAction>
#include <QApplication>
#include <QDebug>
#include "panels/panels.h"
#include "global/path.h"
#include "global/config.h"
#include "rendering/audio.h"
#include "dialogs/demonotice.h"
#include "dialogs/preferencesdialog.h"
#include "dialogs/exportdialog.h"
@@ -36,18 +37,11 @@
#include "dialogs/aboutdialog.h"
#include "dialogs/speeddialog.h"
#include "dialogs/actionsearch.h"
#include "timeline/sequence.h"
#include "ui/mediaiconservice.h"
#include "ui/mainwindow.h"
#include "ui/updatenotification.h"
#include <QMessageBox>
#include <QFileDialog>
#include <QAction>
#include <QApplication>
#include <QDebug>
#include "undo/undostack.h"
std::unique_ptr<OliveGlobal> olive::Global;
QString olive::ActiveProjectFilename;
@@ -56,9 +50,12 @@ QString olive::AppName;
OliveGlobal::OliveGlobal() {
// sets current app name
QString version_id;
// if available, append the current Git hash (defined by `qmake` and the Makefile)
#ifdef GITHASH
version_id = QString(" | %1").arg(GITHASH);
#endif
olive::AppName = QString("Olive (March 2019 | Alpha%1)").arg(version_id);
// set the file filter used in all file dialogs pertaining to Olive project files.
@@ -146,6 +143,9 @@ void OliveGlobal::load_translation_from_config() {
void OliveGlobal::new_project() {
if (can_close_project()) {
// clear graph editor
panel_graph_editor->set_row(nullptr);
// clear effects panel
panel_effect_controls->Clear(true);
@@ -288,6 +288,7 @@ void OliveGlobal::open_preferences() {
void OliveGlobal::set_sequence(SequencePtr s)
{
panel_graph_editor->set_row(nullptr);
panel_effect_controls->Clear(true);
olive::ActiveSequence = s;
+4 -2
View File
@@ -171,7 +171,8 @@ SOURCES += \
effects/fields/buttonfield.cpp \
ui/effectui.cpp \
effects/transition.cpp \
ui/styling.cpp
ui/styling.cpp \
undo/undostack.cpp
HEADERS += \
ui/mainwindow.h \
@@ -296,7 +297,8 @@ HEADERS += \
effects/fields/colorfield.h \
effects/fields/combofield.h \
effects/transition.h \
ui/styling.h
ui/styling.h \
undo/undostack.h
FORMS +=
+1
View File
@@ -39,6 +39,7 @@
#include "ui/collapsiblewidget.h"
#include "timeline/sequence.h"
#include "undo/undo.h"
#include "undo/undostack.h"
#include "panels/project.h"
#include "panels/timeline.h"
#include "panels/viewer.h"
+6
View File
@@ -25,6 +25,7 @@
#include "rendering/renderfunctions.h"
#include "project/previewgenerator.h"
#include "undo/undo.h"
#include "undo/undostack.h"
#include "ui/mainwindow.h"
#include "global/config.h"
#include "rendering/cacher.h"
@@ -606,7 +607,9 @@ void Project::delete_selected_media() {
// remove
if (remove) {
panel_graph_editor->set_row(nullptr);
panel_effect_controls->Clear(true);
if (olive::ActiveSequence != nullptr) olive::ActiveSequence->selections.clear();
// remove media and parents
@@ -1015,6 +1018,9 @@ void Project::delete_clips_using_selected_media() {
}
void Project::clear() {
// clear graph editor
panel_graph_editor->set_row(nullptr);
// clear effects cache
panel_effect_controls->Clear(true);
+5
View File
@@ -37,6 +37,7 @@
#include "ui/flowlayout.h"
#include "ui/cursors.h"
#include "ui/mainwindow.h"
#include "undo/undostack.h"
#include "global/debug.h"
#include <QTime>
@@ -450,6 +451,7 @@ void Timeline::nest() {
create_ghosts_from_media(olive::ActiveSequence.get(), earliest_point, media_list);
add_clips_from_ghosts(ca, olive::ActiveSequence.get());
panel_graph_editor->set_row(nullptr);
panel_effect_controls->Clear(true);
olive::ActiveSequence->selections.clear();
@@ -680,6 +682,7 @@ void Timeline::toggle_enable_on_selected_clips() {
void Timeline::delete_selection(QVector<Selection>& selections, bool ripple_delete) {
if (selections.size() > 0) {
panel_graph_editor->set_row(nullptr);
panel_effect_controls->Clear(true);
ComboAction* ca = new ComboAction();
@@ -1014,6 +1017,8 @@ bool selection_contains_transition(const Selection& s, Clip* c, int type) {
void Timeline::delete_areas_and_relink(ComboAction* ca, QVector<Selection>& areas, bool deselect_areas) {
clean_up_selections(areas);
panel_graph_editor->set_row(nullptr);
panel_effect_controls->Clear(true);
QVector<int> pre_clips;
+8 -3
View File
@@ -31,6 +31,7 @@
#include "project/footage.h"
#include "project/media.h"
#include "undo/undo.h"
#include "undo/undostack.h"
#include "ui/audiomonitor.h"
#include "rendering/renderfunctions.h"
#include "ui/viewercontainer.h"
@@ -852,9 +853,13 @@ void Viewer::clean_created_seq() {
if (created_sequence) {
// TODO delete undo commands referencing this sequence to avoid crashes
/*for (int i=0;i<undo_stack.count();i++) {
undo_stack.command(i)
}*/
/*
for (int i=0;i<olive::UndoStack.count();i++) {
const QUndoCommand* oa = olive::UndoStack.command(i);
if (typeid(*oa) == typeid(SetTimelineInOutCommand)) {
}
}
*/
seq.reset();
created_sequence = false;
+1
View File
@@ -31,6 +31,7 @@ extern "C" {
#include "footage.h"
#include "timeline/sequence.h"
#include "undo/undo.h"
#include "undo/undostack.h"
#include "global/config.h"
#include "panels/viewer.h"
#include "panels/project.h"
+9 -9
View File
@@ -20,6 +20,14 @@
#include "sourcescommon.h"
#include <QProcess>
#include <QMenu>
#include <QAbstractItemView>
#include <QMimeData>
#include <QMessageBox>
#include <QDesktopServices>
#include <QDebug>
#include "ui/menuhelper.h"
#include "panels/panels.h"
#include "project/media.h"
@@ -36,15 +44,7 @@
#include "ui/viewerwidget.h"
#include "project/proxygenerator.h"
#include "ui/mainwindow.h"
#include <QProcess>
#include <QMenu>
#include <QAbstractItemView>
#include <QMimeData>
#include <QMessageBox>
#include <QDesktopServices>
#include <QDebug>
#include "undo/undostack.h"
SourcesCommon::SourcesCommon(Project* parent) :
editing_item(nullptr),
+8 -7
View File
@@ -22,6 +22,7 @@
#include "global/config.h"
#include "undo/undo.h"
#include "undo/undostack.h"
#include "ui/mainwindow.h"
#include "timeline/sequence.h"
#include "timeline/clip.h"
@@ -59,11 +60,11 @@ void set_marker_internal(Sequence* seq, const QVector<int>& clips) {
// if (config.set_name_with_marker) is false (set above), ask for a marker name
if (!add_marker) {
QInputDialog d(olive::MainWindow);
QInputDialog d(olive::MainWindow);
d.setWindowTitle(QCoreApplication::translate("Marker", "Set Marker"));
d.setLabelText(clips.size() > 0
? QCoreApplication::translate("Marker", "Set clip marker name:")
: QCoreApplication::translate("Marker", "Set sequence marker name:"));
? QCoreApplication::translate("Marker", "Set clip marker name:")
: QCoreApplication::translate("Marker", "Set sequence marker name:"));
d.setInputMode(QInputDialog::TextInput);
add_marker = (d.exec() == QDialog::Accepted);
marker_name = d.textValue();
@@ -78,10 +79,10 @@ void set_marker_internal(Sequence* seq, const QVector<int>& clips) {
// add a marker action for each clip
foreach (int i, clips) {
ClipPtr c = seq->clips.at(i);
ClipPtr c = seq->clips.at(i);
ca->append(new AddMarkerAction(&c->get_markers(),
seq->playhead - c->timeline_in() + c->clip_in(),
marker_name));
seq->playhead - c->timeline_in() + c->clip_in(),
marker_name));
}
} else {
@@ -110,7 +111,7 @@ void set_marker_internal(Sequence* seq, const QVector<int>& clips) {
// push action
olive::UndoStack.push(ca);
olive::UndoStack.push(ca);
// redraw UI for new markers
update_ui(false);
+2 -2
View File
@@ -31,8 +31,8 @@ class Sequence;
using SequencePtr = std::shared_ptr<Sequence>;
struct Marker {
long frame;
QString name;
long frame;
QString name;
};
void draw_marker(QPainter& p, int x, int y, int bottom, bool selected);
+7 -6
View File
@@ -25,12 +25,13 @@
#include "panels/panels.h"
#include "global/debug.h"
Sequence::Sequence() {
playhead = 0;
using_workarea = false;
workarea_in = 0;
workarea_out = 0;
wrapper_sequence = false;
Sequence::Sequence() :
playhead(0),
using_workarea(false),
workarea_in(0),
workarea_out(0),
wrapper_sequence(false)
{
}
Sequence::~Sequence() {}
+1
View File
@@ -20,6 +20,7 @@
#include "checkboxex.h"
#include "undo/undostack.h"
#include "undo/undo.h"
CheckboxEx::CheckboxEx(QWidget* parent) : QCheckBox(parent) {
+1
View File
@@ -33,6 +33,7 @@
#include "timeline/sequence.h"
#include "ui/keyframedrawing.h"
#include "undo/undo.h"
#include "undo/undostack.h"
#include "effects/effect.h"
#include "timeline/clip.h"
#include "ui/rectangleselect.h"
+5 -4
View File
@@ -20,6 +20,10 @@
#include "keyframeview.h"
#include <QMouseEvent>
#include <QtMath>
#include <QMenu>
#include "effects/effect.h"
#include "ui/collapsiblewidget.h"
#include "panels/panels.h"
@@ -27,6 +31,7 @@
#include "panels/timeline.h"
#include "ui/timelineheader.h"
#include "undo/undo.h"
#include "undo/undostack.h"
#include "panels/viewer.h"
#include "ui/viewerwidget.h"
#include "timeline/sequence.h"
@@ -38,10 +43,6 @@
#include "effects/keyframe.h"
#include "ui/graphview.h"
#include <QMouseEvent>
#include <QtMath>
#include <QMenu>
KeyframeView::KeyframeView(QWidget *parent) :
QWidget(parent),
visible_in(0),
+22 -30
View File
@@ -20,35 +20,6 @@
#include "mainwindow.h"
#include "global/global.h"
#include "ui/menuhelper.h"
#include "project/projectelements.h"
#include "timeline/clip.h"
#include "global/config.h"
#include "global/path.h"
#include "global/debug.h"
#include "project/proxygenerator.h"
#include "project/projectfilter.h"
#include "ui/sourcetable.h"
#include "ui/viewerwidget.h"
#include "ui/sourceiconview.h"
#include "ui/timelineheader.h"
#include "ui/icons.h"
#include "ui/cursors.h"
#include "ui/focusfilter.h"
#include "panels/panels.h"
#include "dialogs/debugdialog.h"
#include "rendering/audio.h"
#include "rendering/renderfunctions.h"
#include <QStyleFactory>
#include <QMessageBox>
#include <QFileDialog>
@@ -65,7 +36,27 @@
#include <QPushButton>
#include <QTranslator>
Q_DECLARE_METATYPE(ClipPtr);
#include "global/global.h"
#include "ui/menuhelper.h"
#include "project/projectelements.h"
#include "timeline/clip.h"
#include "global/config.h"
#include "global/path.h"
#include "global/debug.h"
#include "project/proxygenerator.h"
#include "project/projectfilter.h"
#include "ui/sourcetable.h"
#include "ui/viewerwidget.h"
#include "ui/sourceiconview.h"
#include "ui/timelineheader.h"
#include "ui/icons.h"
#include "ui/cursors.h"
#include "ui/focusfilter.h"
#include "panels/panels.h"
#include "dialogs/debugdialog.h"
#include "rendering/audio.h"
#include "rendering/renderfunctions.h"
#include "undo/undostack.h"
MainWindow* olive::MainWindow;
@@ -982,6 +973,7 @@ void MainWindow::closeEvent(QCloseEvent *e) {
// stop proxy generator thread
olive::proxy_generator.cancel();
panel_graph_editor->set_row(nullptr);
panel_effect_controls->Clear(true);
olive::Global->set_sequence(nullptr);
+13 -7
View File
@@ -122,15 +122,21 @@ void MenuHelper::make_clip_functions_menu(QMenu *parent) {
parent->addAction(nest_);
}
void MenuHelper::make_edit_functions_menu(QMenu *parent) {
parent->addAction(cut_);
parent->addAction(copy_);
void MenuHelper::make_edit_functions_menu(QMenu *parent, bool objects_are_selected) {
if (objects_are_selected) {
parent->addAction(cut_);
parent->addAction(copy_);
}
parent->addAction(paste_);
parent->addAction(paste_insert_);
parent->addAction(duplicate_);
parent->addAction(delete_);
parent->addAction(ripple_delete_);
parent->addAction(split_);
if (objects_are_selected) {
parent->addAction(duplicate_);
parent->addAction(delete_);
parent->addAction(ripple_delete_);
parent->addAction(split_);
}
}
void MenuHelper::set_bool_action_checked(QAction *a) {
+6 -1
View File
@@ -75,8 +75,13 @@ public:
* @param parent
*
* The menu to add items to.
*
* @param objects_are_selected
*
* Some extra functions may be hidden in the event no clip is actually selected. Set this to **FALSE** to hide those
* functions.
*/
void make_edit_functions_menu(QMenu* parent);
void make_edit_functions_menu(QMenu* parent, bool objects_are_selected = true);
/**
* @brief Sets the checked state of a menu item based on a Boolean variable.
+8 -7
View File
@@ -20,6 +20,13 @@
#include "timelineheader.h"
#include <QPainter>
#include <QMouseEvent>
#include <QScrollBar>
#include <QtMath>
#include <QMenu>
#include <QAction>
#include "mainwindow.h"
#include "panels/panels.h"
#include "panels/timeline.h"
@@ -31,13 +38,7 @@
#include "global/global.h"
#include "ui/menuhelper.h"
#include "global/debug.h"
#include <QPainter>
#include <QMouseEvent>
#include <QScrollBar>
#include <QtMath>
#include <QMenu>
#include <QAction>
#include "undo/undostack.h"
#define CLICK_RANGE 5
#define PLAYHEAD_SIZE 6
+30 -37
View File
@@ -20,32 +20,6 @@
#include "timelinewidget.h"
#include "global/global.h"
#include "panels/panels.h"
#include "project/projectelements.h"
#include "rendering/audio.h"
#include "global/config.h"
#include "ui/sourcetable.h"
#include "ui/sourceiconview.h"
#include "undo/undo.h"
#include "ui/viewerwidget.h"
#include "ui/resizablescrollbar.h"
#include "dialogs/newsequencedialog.h"
#include "mainwindow.h"
#include "ui/rectangleselect.h"
#include "rendering/renderfunctions.h"
#include "ui/cursors.h"
#include "ui/menuhelper.h"
#include "ui/focusfilter.h"
#include "dialogs/clippropertiesdialog.h"
#include "global/debug.h"
#include "effects/effect.h"
#include "effects/internal/solideffect.h"
#include "effects/internal/texteffect.h"
#include <QPainter>
#include <QColor>
#include <QMouseEvent>
@@ -61,6 +35,30 @@
#include <QInputDialog>
#include <QStatusBar>
#include "global/global.h"
#include "panels/panels.h"
#include "project/projectelements.h"
#include "rendering/audio.h"
#include "global/config.h"
#include "ui/sourcetable.h"
#include "ui/sourceiconview.h"
#include "undo/undo.h"
#include "undo/undostack.h"
#include "ui/viewerwidget.h"
#include "ui/resizablescrollbar.h"
#include "dialogs/newsequencedialog.h"
#include "mainwindow.h"
#include "ui/rectangleselect.h"
#include "rendering/renderfunctions.h"
#include "ui/cursors.h"
#include "ui/menuhelper.h"
#include "ui/focusfilter.h"
#include "dialogs/clippropertiesdialog.h"
#include "global/debug.h"
#include "effects/effect.h"
#include "effects/internal/solideffect.h"
#include "effects/internal/texteffect.h"
#define MAX_TEXT_WIDTH 20
#define TRANSITION_BETWEEN_RANGE 40
@@ -90,8 +88,6 @@ void TimelineWidget::show_context_menu(const QPoint& pos) {
QMenu menu(this);
// TODO replace with Olive::MenuHelper::make_edit_functions_menu() without losing functionality
QAction* undoAction = menu.addAction(tr("&Undo"));
QAction* redoAction = menu.addAction(tr("&Redo"));
connect(undoAction, SIGNAL(triggered(bool)), olive::Global.get(), SLOT(undo()));
@@ -103,13 +99,7 @@ void TimelineWidget::show_context_menu(const QPoint& pos) {
// collect all the selected clips
QVector<Clip*> selected_clips = olive::ActiveSequence->SelectedClips();
if (!selected_clips.isEmpty()) {
// clips are selected
menu.addAction(tr("C&ut"), &olive::FocusFilter, SLOT(cut()));
menu.addAction(tr("Cop&y"), &olive::FocusFilter, SLOT(copy()));
}
menu.addAction(tr("&Paste"), olive::Global.get(), SLOT(paste()));
olive::MenuHelper.make_edit_functions_menu(&menu, !selected_clips.isEmpty());
if (selected_clips.isEmpty()) {
// no clips are selected
@@ -119,7 +109,7 @@ void TimelineWidget::show_context_menu(const QPoint& pos) {
panel_timeline->cursor_track = getTrackFromScreenPoint(pos.y());
if (panel_timeline->can_ripple_empty_space(panel_timeline->cursor_frame, panel_timeline->cursor_track)) {
QAction* ripple_delete_action = menu.addAction(tr("R&ipple Delete"));
QAction* ripple_delete_action = menu.addAction(tr("R&ipple Delete Empty Space"));
connect(ripple_delete_action, SIGNAL(triggered(bool)), panel_timeline, SLOT(ripple_delete_empty_space()));
}
@@ -128,7 +118,9 @@ void TimelineWidget::show_context_menu(const QPoint& pos) {
}
if (!selected_clips.isEmpty()) {
menu.addSeparator();
menu.addAction(tr("&Speed/Duration"), olive::Global.get(), SLOT(open_speed_dialog()));
QAction* autoscaleAction = menu.addAction(tr("Auto-s&cale"), this, SLOT(toggle_autoscale()));
@@ -277,9 +269,10 @@ void TimelineWidget::dragEnterEvent(QDragEnterEvent *event) {
panel_project->process_file_list(file_list);
for (int i=0;i<panel_project->last_imported_media.size();i++) {
Footage* f = panel_project->last_imported_media.at(i)->to_footage();
// waits for media to have a duration
// TODO would be much nicer if this was multithreaded
Footage* f = panel_project->last_imported_media.at(i)->to_footage();
f->ready_lock.lock();
f->ready_lock.unlock();
-4
View File
@@ -326,10 +326,6 @@ void ViewerWidget::mousePressEvent(QMouseEvent* event) {
gizmo_y_mvmt = 0;
selected_gizmo = get_gizmo_from_mouse(event->pos().x(), event->pos().y());
if (selected_gizmo != nullptr) {
selected_gizmo->set_previous_value();
}
}
dragging = true;
}
+5 -5
View File
@@ -42,8 +42,6 @@
#include "project/previewgenerator.h"
#include "ui/mainwindow.h"
QUndoStack olive::UndoStack;
MoveClipAction::MoveClipAction(Clip *c, long iin, long iout, long iclip_in, int itrack, bool irelative) {
clip = c;
@@ -354,6 +352,7 @@ AddClipCommand::~AddClipCommand() {}
void AddClipCommand::doUndo() {
// clear effects panel
panel_graph_editor->set_row(nullptr);
panel_effect_controls->Clear(true);
for (int i=0;i<clips.size();i++) {
@@ -842,12 +841,13 @@ void EditSequenceCommand::doRedo() {
}
void EditSequenceCommand::update() {
// update tooltip
// TODO/FIXME: this is a lousy way to do this, Media should have a separate fuctionn for updating the tooltip
// Update sequence's tooltip
item->update_tooltip();
for (int i=0;i<seq->clips.size();i++) {
if (seq->clips.at(i) != nullptr) seq->clips.at(i)->refresh();
if (seq->clips.at(i) != nullptr) {
seq->clips.at(i)->refresh();
}
}
if (olive::ActiveSequence == seq) {
-4
View File
@@ -53,10 +53,6 @@ struct EffectMeta;
class EffectRow;
class EffectField;
namespace olive {
extern QUndoStack UndoStack;
}
class OliveAction : public QUndoCommand {
public:
OliveAction(bool iset_window_modified = true);
+3
View File
@@ -0,0 +1,3 @@
#include "undostack.h"
QUndoStack olive::UndoStack;
+10
View File
@@ -0,0 +1,10 @@
#ifndef UNDOSTACK_H
#define UNDOSTACK_H
#include <QUndoStack>
namespace olive {
extern QUndoStack UndoStack;
}
#endif // UNDOSTACK_H