Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit fa91274a authored by Nicolas Carion's avatar Nicolas Carion

Add an asset panel widget and start to clean references to old effectstack code

parent f6cf8896
......@@ -4,6 +4,7 @@ set(kdenlive_SRCS
assets/assetlist/view/assetlistwidget.cpp
assets/assetlist/model/assetfilter.cpp
assets/assetlist/model/assettreemodel.cpp
assets/assetpanel.cpp
assets/model/assetparametermodel.cpp
assets/view/assetparameterview.cpp
assets/view/widgets/abstractparamwidget.cpp
......
/***************************************************************************
* Copyright (C) 2017 by Nicolas Carion *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "assetpanel.hpp"
#include "effects/effectstack/model/effectstackmodel.cpp"
#include "kdenlivesettings.h"
#include "model/assetparametermodel.hpp"
#include "view/assetparameterview.hpp"
#include <KColorScheme>
#include <KColorUtils>
#include <QApplication>
AssetPanel::AssetPanel(QWidget *parent)
: QScrollArea(parent)
, m_lay(new QVBoxLayout(this))
, m_transitionWidget(new AssetParameterView(this))
{
m_lay->addWidget(m_transitionWidget);
m_transitionWidget->setVisible(false);
}
void AssetPanel::showTransition(std::shared_ptr<AssetParameterModel> transitionModel)
{
clear();
m_transitionWidget->setVisible(true);
m_transitionWidget->setModel(transitionModel);
}
void AssetPanel::showEffectStack(std::shared_ptr<EffectStackModel> effectsModel)
{
clear();
}
void AssetPanel::clear()
{
m_transitionWidget->setVisible(false);
m_transitionWidget->unsetModel();
}
void AssetPanel::updatePalette()
{
QString styleSheet = getStyleSheet();
setStyleSheet(styleSheet);
m_transitionWidget->setStyleSheet(styleSheet);
}
// static
const QString AssetPanel::getStyleSheet()
{
KColorScheme scheme(QApplication::palette().currentColorGroup(), KColorScheme::View, KSharedConfig::openConfig(KdenliveSettings::colortheme()));
QColor selected_bg = scheme.decoration(KColorScheme::FocusColor).color();
QColor hgh = KColorUtils::mix(QApplication::palette().window().color(), selected_bg, 0.2);
QColor hover_bg = scheme.decoration(KColorScheme::HoverColor).color();
QColor light_bg = scheme.shade(KColorScheme::LightShade);
QColor alt_bg = scheme.background(KColorScheme::NormalBackground).color();
QString stylesheet;
// effect background
stylesheet.append(QStringLiteral("QFrame#decoframe {border-top-left-radius:5px;border-top-right-radius:5px;border-bottom:2px solid "
"palette(mid);border-top:1px solid palette(light);} QFrame#decoframe[active=\"true\"] {background: %1;}")
.arg(hgh.name()));
// effect in group background
stylesheet.append(
QStringLiteral("QFrame#decoframesub {border-top:1px solid palette(light);} QFrame#decoframesub[active=\"true\"] {background: %1;}").arg(hgh.name()));
// group background
stylesheet.append(QStringLiteral(
"QFrame#decoframegroup {border-top-left-radius:5px;border-top-right-radius:5px;border:2px solid palette(dark);margin:0px;margin-top:2px;} "));
// effect title bar
stylesheet.append(QStringLiteral("QFrame#frame {margin-bottom:2px;border-top-left-radius:5px;border-top-right-radius:5px;} QFrame#frame[target=\"true\"] "
"{background: palette(highlight);}"));
// group effect title bar
stylesheet.append(QStringLiteral("QFrame#framegroup {border-top-left-radius:2px;border-top-right-radius:2px;background: palette(dark);} "
"QFrame#framegroup[target=\"true\"] {background: palette(highlight);} "));
// draggable effect bar content
stylesheet.append(QStringLiteral("QProgressBar::chunk:horizontal {background: palette(button);border-top-left-radius: 4px;border-bottom-left-radius: 4px;} "
"QProgressBar::chunk:horizontal#dragOnly {background: %1;border-top-left-radius: 4px;border-bottom-left-radius: 4px;} "
"QProgressBar::chunk:horizontal:hover {background: %2;}")
.arg(alt_bg.name(), selected_bg.name()));
// draggable effect bar
stylesheet.append(QStringLiteral("QProgressBar:horizontal {border: 1px solid palette(dark);border-top-left-radius: 4px;border-bottom-left-radius: "
"4px;border-right:0px;background:%3;padding: 0px;text-align:left center} QProgressBar:horizontal:disabled {border: 1px "
"solid palette(button)} QProgressBar:horizontal#dragOnly {background: %3} QProgressBar:horizontal[inTimeline=\"true\"] { "
"border: 1px solid %1;border-right: 0px;background: %2;padding: 0px;text-align:left center } "
"QProgressBar::chunk:horizontal[inTimeline=\"true\"] {background: %1;}")
.arg(hover_bg.name(), light_bg.name(), alt_bg.name()));
// spin box for draggable widget
stylesheet.append(
QStringLiteral("QAbstractSpinBox#dragBox {border: 1px solid palette(dark);border-top-right-radius: 4px;border-bottom-right-radius: "
"4px;padding-right:0px;} QAbstractSpinBox::down-button#dragBox {width:0px;padding:0px;} QAbstractSpinBox:disabled#dragBox {border: 1px "
"solid palette(button);} QAbstractSpinBox::up-button#dragBox {width:0px;padding:0px;} QAbstractSpinBox[inTimeline=\"true\"]#dragBox { "
"border: 1px solid %1;} QAbstractSpinBox:hover#dragBox {border: 1px solid %2;} ")
.arg(hover_bg.name(), selected_bg.name()));
// group editable labels
stylesheet.append(QStringLiteral("MyEditableLabel { background-color: transparent; color: palette(bright-text); border-radius: 2px;border: 1px solid "
"transparent;} MyEditableLabel:hover {border: 1px solid palette(highlight);} "));
// transparent qcombobox
stylesheet.append(QStringLiteral("QComboBox { background-color: transparent;} "));
return stylesheet;
}
/***************************************************************************
* Copyright (C) 2017 by Nicolas Carion *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef ASSETPANEL_H
#define ASSETPANEL_H
#include <QScrollArea>
#include <QVBoxLayout>
#include <memory>
/** @brief This class is the widget that provides interaction with the asset currently selected.
That is, it either displays an effectStack or the parameters of a transition
*/
class AssetParameterModel;
class AssetParameterView;
class EffectStackModel;
class AssetPanel : public QScrollArea
{
Q_OBJECT
public:
AssetPanel(QWidget *parent);
/* @brief Shows the parameters of the given transition model */
void showTransition(std::shared_ptr<AssetParameterModel> transition_model);
/* @brief Shows the parameters of the given effect stack model */
void showEffectStack(std::shared_ptr<EffectStackModel> effectsModel);
/* @brief Clear the panel so that it doesn't display anything */
void clear();
/* @brief This method should be called when the style changes */
void updatePalette();
protected:
/** @brief Return the stylesheet used to display the panel (based on current palette). */
static const QString getStyleSheet();
QVBoxLayout *m_lay;
AssetParameterView *m_transitionWidget;
};
#endif
......@@ -40,20 +40,10 @@ AssetParameterView::AssetParameterView(QWidget *parent)
void AssetParameterView::setModel(std::shared_ptr<AssetParameterModel> model)
{
if (m_model) {
// if a model is already there, we have to disconnect signals first
disconnect(m_model.get(), &AssetParameterModel::dataChanged, this, &AssetParameterView::refresh);
}
unsetModel();
m_model = model;
connect(m_model.get(), &AssetParameterModel::dataChanged, this, &AssetParameterView::refresh);
// clear layout
m_widgets.clear();
QLayoutItem *child;
while ((child = m_lay->takeAt(0)) != nullptr) {
delete child;
}
for (int i = 0; i < model->rowCount(); ++i) {
QModelIndex index = model->index(i, 0);
......@@ -65,6 +55,24 @@ void AssetParameterView::setModel(std::shared_ptr<AssetParameterModel> model)
m_lay->addStretch();
}
void AssetParameterView::unsetModel()
{
if (m_model) {
// if a model is already there, we have to disconnect signals first
disconnect(m_model.get(), &AssetParameterModel::dataChanged, this, &AssetParameterView::refresh);
}
// clear layout
m_widgets.clear();
QLayoutItem *child;
while ((child = m_lay->takeAt(0)) != nullptr) {
delete child;
}
// Release ownership of smart pointer
m_model.reset();
}
void AssetParameterView::refresh(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
{
Q_UNUSED(roles);
......
......@@ -45,6 +45,9 @@ public:
/** Sets the model to be displayed by current view */
void setModel(std::shared_ptr<AssetParameterModel> model);
/** Set the widget to display no model (this yield ownership on the smart-ptr)*/
void unsetModel();
protected:
/** @brief This is a handler for the dataChanged slot of the model.
It basically instructs the widgets in the given range to be refreshed */
......
......@@ -80,7 +80,7 @@ public:
virtual ProjectFolder *folder(const QString &id) = 0;
virtual ProjectClip *clipAt(int ix) = 0;
/** @brief Recursively disable/enable bin effects. */
virtual void disableEffects(bool disable) = 0;
virtual void setBinEffectsEnabled(bool enabled) = 0;
/** @brief Returns the clip's id. */
const QString &clipId() const;
......
......@@ -627,7 +627,7 @@ Bin::Bin(QWidget *parent)
pCore->window()->actionCollection()->addAction(QStringLiteral("bin_view_mode_icon"), iconViewAction);
QAction *disableEffects = new QAction(i18n("Disable Bin Effects"), this);
connect(disableEffects, &QAction::triggered, this, &Bin::slotDisableEffects);
connect(disableEffects, &QAction::triggered, [this](bool disable) { this->setBinEffectsEnabled(!disable); });
disableEffects->setIcon(KoIconUtils::themedIcon(QStringLiteral("favorite")));
disableEffects->setData("disable_bin_effects");
disableEffects->setCheckable(true);
......@@ -1273,7 +1273,7 @@ void Bin::setDocument(KdenliveDoc *project)
// connect(m_itemModel, SIGNAL(updateCurrentItem()), this, SLOT(autoSelect()));
slotInitView(nullptr);
bool binEffectsDisabled = getDocumentProperty(QStringLiteral("disablebineffects")).toInt() == 1;
setBinEffectsDisabledStatus(binEffectsDisabled);
setBinEffectsEnabled(!binEffectsDisabled);
autoSelect();
}
......@@ -3599,25 +3599,19 @@ void Bin::showSlideshowWidget(ProjectClip *clip)
delete dia;
}
void Bin::slotDisableEffects(bool disable)
{
m_itemModel->getRootFolder()->disableEffects(disable);
pCore->projectManager()->disableBinEffects(disable);
m_monitor->refreshMonitorIfActive();
}
void Bin::setBinEffectsDisabledStatus(bool disabled)
void Bin::setBinEffectsEnabled(bool enabled)
{
QAction *disableEffects = pCore->window()->actionCollection()->action(QStringLiteral("disable_bin_effects"));
if (disableEffects) {
if (disabled == disableEffects->isChecked()) {
if (enabled == disableEffects->isChecked()) {
return;
}
disableEffects->blockSignals(true);
disableEffects->setChecked(disabled);
disableEffects->setChecked(enabled);
disableEffects->blockSignals(false);
}
pCore->projectManager()->disableBinEffects(disabled);
m_itemModel->setBinEffectsEnabled(enabled);
pCore->projectManager()->disableBinEffects(!enabled);
}
void Bin::slotRenameItem()
......
......@@ -290,8 +290,10 @@ public:
void emitMessage(const QString &, int, MessageType);
void rebuildMenu();
void refreshIcons();
/** @brief Update status of disable effects action (when loading a document). */
void setBinEffectsDisabledStatus(bool disabled);
/** @brief This function change the global enabled state of the bin effects
*/
void setBinEffectsEnabled(bool enabled);
void requestAudioThumbs(const QString &id, long duration);
/** @brief Proxy status for the project changed, update. */
......@@ -366,8 +368,6 @@ private slots:
void slotZoomView(bool zoomIn);
/** @brief Widget gained focus, make sure we display effects for master clip. */
void slotGotFocus();
/** @brief Dis/Enable all bin effects. */
void slotDisableEffects(bool disable);
/** @brief Rename a Bin Item. */
void slotRenameItem();
void slotCreateAudioThumbs();
......
......@@ -1228,9 +1228,9 @@ bool ProjectClip::isSplittable() const
return (m_clipType == AV || m_clipType == Playlist);
}
void ProjectClip::disableEffects(bool disable)
void ProjectClip::setBinEffectsEnabled(bool enabled)
{
ClipController::disableEffects(disable);
ClipController::setBinEffectsEnabled(enabled);
}
void ProjectClip::registerTimelineClip(std::weak_ptr<TimelineModel> timeline, int clipId)
......
......@@ -25,7 +25,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "abstractprojectitem.h"
#include "definitions.h"
#include "effects/effectstack/model/effectstackmodel.hpp"
#include "mltcontroller/clipcontroller.h"
#include "timeline2/model/timelinemodel.hpp"
......@@ -135,7 +134,7 @@ public:
Mlt::Producer *thumbProducer();
/** @brief Recursively disable/enable bin effects. */
void disableEffects(bool disable) override;
void setBinEffectsEnabled(bool enabled) override;
/** @brief Set properties on this clip. TODO: should we store all in MLT or use extra m_properties ?. */
void setProperties(const QMap<QString, QString> &properties, bool refreshPanel = false);
......
......@@ -111,11 +111,11 @@ ProjectClip *ProjectFolder::clipAt(int index)
return nullptr;
}
void ProjectFolder::disableEffects(bool disable)
void ProjectFolder::setBinEffectsEnabled(bool enabled)
{
for (int i = 0; i < childCount(); ++i) {
AbstractProjectItem *item = static_cast<AbstractProjectItem *>(child(i));
item->disableEffects(disable);
item->setBinEffectsEnabled(enabled);
}
}
......
......@@ -63,7 +63,7 @@ public:
ProjectFolder *folder(const QString &id) override;
/** @brief Recursively disable/enable bin effects. */
void disableEffects(bool disable) override;
void setBinEffectsEnabled(bool enabled) override;
/** @brief Calls AbstractProjectItem::setCurrent and blank the bin monitor. */
void setCurrent(bool current, bool notify = true) override;
......
......@@ -67,7 +67,7 @@ ProjectClip *ProjectFolderUp::clipAt(int index)
return nullptr;
}
void ProjectFolderUp::disableEffects(bool)
void ProjectFolderUp::setBinEffectsEnabled(bool)
{
}
......
......@@ -67,7 +67,7 @@ public:
ProjectClip *clipAt(int index) override;
/** @brief Recursively disable/enable bin effects. */
void disableEffects(bool disable) override;
void setBinEffectsEnabled(bool enabled) override;
/** @brief Returns an xml description of the folder. */
QDomElement toXml(QDomDocument &document, bool includeMeta = false) override;
......
......@@ -262,6 +262,11 @@ ProjectFolder *ProjectItemModel::getFolderByBinId(const QString &binId)
return static_cast<AbstractProjectItem *>(rootItem)->folder(binId);
}
void ProjectItemModel::setBinEffectsEnabled(bool enabled)
{
return static_cast<AbstractProjectItem *>(rootItem)->setBinEffectsEnabled(enabled);
}
QStringList ProjectItemModel::getEnclosingFolderInfo(const QModelIndex &index) const
{
QStringList noInfo;
......
......@@ -52,6 +52,10 @@ public:
*/
ProjectFolder *getFolderByBinId(const QString &binId);
/** @brief This function change the global enabled state of the bin effects
*/
void setBinEffectsEnabled(bool enabled);
/** @brief Returns some info about the folder containing the given index */
QStringList getEnclosingFolderInfo(const QModelIndex &index) const;
......
......@@ -88,7 +88,7 @@ ProjectFolder *ProjectSubClip::folder(const QString &id)
return nullptr;
}
void ProjectSubClip::disableEffects(bool)
void ProjectSubClip::setBinEffectsEnabled(bool)
{
}
......
......@@ -56,7 +56,7 @@ public:
ProjectSubClip *subClip(int in, int out);
ProjectClip *clipAt(int ix) override;
/** @brief Recursively disable/enable bin effects. */
void disableEffects(bool disable) override;
void setBinEffectsEnabled(bool enabled) override;
QDomElement toXml(QDomDocument &document, bool includeMeta = false) override;
/** @brief Returns the clip's duration. */
......
......@@ -27,7 +27,7 @@ EffectItemModel::EffectItemModel(const QList<QVariant> &data, Mlt::Properties *e
: TreeItem(data, static_cast<AbstractTreeModel *>(stack))
, AssetParameterModel(effect, xml, effectId)
, m_enabled(true)
, m_timelineEffectsEnabled(true)
, m_effectStackEnabled(true)
{
}
......@@ -67,15 +67,15 @@ void EffectItemModel::setEnabled(bool enabled)
updateEnable();
}
void EffectItemModel::setTimelineEffectsEnabled(bool enabled)
void EffectItemModel::setEffectStackEnabled(bool enabled)
{
m_timelineEffectsEnabled = enabled;
m_effectStackEnabled = enabled;
updateEnable();
}
bool EffectItemModel::isEnabled() const
{
return m_enabled && m_timelineEffectsEnabled;
return m_enabled && m_effectStackEnabled;
}
void EffectItemModel::updateEnable()
......
......@@ -45,8 +45,8 @@ public:
/* @brief This function change the individual enabled state of the effect */
void setEnabled(bool enabled);
/* @brief This function change the global (timeline-wise) enabled state of the effect */
void setTimelineEffectsEnabled(bool enabled);
/* @brief This function change the global (effectstack-wise) enabled state of the effect */
void setEffectStackEnabled(bool enabled);
/* @brief Returns whether the effect is enabled */
bool isEnabled() const;
......@@ -60,7 +60,7 @@ protected:
void updateEnable();
bool m_enabled;
bool m_timelineEffectsEnabled;
bool m_effectStackEnabled;
};
#endif
......@@ -24,7 +24,7 @@
EffectStackModel::EffectStackModel(std::weak_ptr<Mlt::Service> service)
: AbstractTreeModel()
, m_service(service)
, m_timelineEffectsEnabled(true)
, m_effectStackEnabled(true)
{
}
......@@ -36,16 +36,16 @@ std::shared_ptr<EffectStackModel> EffectStackModel::construct(std::weak_ptr<Mlt:
void EffectStackModel::appendEffect(const QString &effectId)
{
auto effect = EffectItemModel::construct(effectId, this);
effect->setTimelineEffectsEnabled(m_timelineEffectsEnabled);
effect->setEffectStackEnabled(m_effectStackEnabled);
rootItem->appendChild(effect);
}
void EffectStackModel::setTimelineEffectsEnabled(bool enabled)
void EffectStackModel::setEffectStackEnabled(bool enabled)
{
m_timelineEffectsEnabled = enabled;
m_effectStackEnabled = enabled;
// Recursively updates children states
for (int i = 0; i < rootItem->childCount(); ++i) {
static_cast<EffectItemModel *>(rootItem->child(i))->setTimelineEffectsEnabled(enabled);
static_cast<EffectItemModel *>(rootItem->child(i))->setEffectStackEnabled(enabled);
}
}
......@@ -45,12 +45,12 @@ public:
/* @brief This function change the global (timeline-wise) enabled state of the effects
*/
void setTimelineEffectsEnabled(bool enabled);
void setEffectStackEnabled(bool enabled);
protected:
std::weak_ptr<Mlt::Service> m_service;
bool m_timelineEffectsEnabled;
bool m_effectStackEnabled;
};
#endif
......@@ -18,7 +18,7 @@
***************************************************************************/
#include "mainwindow.h"
#include "assets/view/assetparameterview.hpp"
#include "assets/assetpanel.hpp"
#include "bin/generators/generators.h"
#include "bin/projectclip.h"
#include "core.h"
......@@ -146,7 +146,7 @@ static QString defaultStyle(const char *fallback = nullptr)
MainWindow::MainWindow(QWidget *parent)
: KXmlGuiWindow(parent)
, m_effectStack(nullptr)
, m_assetPanel(nullptr)
, m_exitCode(EXIT_SUCCESS)
, m_effectList(nullptr)
, m_transitionList(nullptr)
......@@ -305,20 +305,18 @@ void MainWindow::init()
spectrumDock->close();
m_projectBinDock = addDock(i18n("Project Bin"), QStringLiteral("project_bin"), pCore->bin());
m_effectStack = new EffectStackView2(m_projectMonitor, this);
// TODO REFAC: remove, this is just a hack to avoid floating parentless widget
addDock("Properties_old", QStringLiteral("effect_stack2"), m_effectStack);
// TODO REFAC delete this
auto trans = TransitionsRepository::get()->getTransition(QStringLiteral("wipe"));
auto transxml = TransitionsRepository::get()->getXml(QStringLiteral("wipe"));
std::shared_ptr<AssetParameterModel> model = std::make_shared<AssetParameterModel>(trans, transxml, QStringLiteral("wipe"));
auto *propertiesWidget = new AssetParameterView(this);
// END delete
propertiesWidget->setModel(model);
m_assetPanel = new AssetPanel(this);
qDebug() << "===================================================== creating listview" << model->rowCount();
// m_effectStackDock = addDock(i18n("Properties"), QStringLiteral("effect_stack"), m_effectStack);
m_effectStackDock = addDock(i18n("Properties"), QStringLiteral("effect_stack"), propertiesWidget);
m_assetPanel->showTransition(model);
m_effectStackDock = addDock(i18n("Properties"), QStringLiteral("effect_stack"), m_assetPanel);
m_effectList = new EffectsListView();
// m_effectListDock = addDock(i18n("Effects"), QStringLiteral("effect_list"), m_effectList);
......@@ -635,9 +633,8 @@ void MainWindow::slotThemeChanged(const QString &theme)
QPalette plt = palette();
KdenliveSettings::setColortheme(theme);
if (m_effectStack) {
m_effectStack->updatePalette();
m_effectStack->transitionConfig()->updatePalette();
if (m_assetPanel) {
m_assetPanel->updatePalette();
}
if (m_effectList) {
m_effectList->updatePalette();
......@@ -676,15 +673,9 @@ void MainWindow::slotThemeChanged(const QString &theme)
if (pCore->monitorManager()) {
pCore->monitorManager()->refreshIcons();
}
if (m_effectStack && m_effectStack->transitionConfig()) {
m_effectStack->transitionConfig()->refreshIcons();
}
if (m_effectList) {
m_effectList->refreshIcons();
}
if (m_effectStack) {
m_effectStack->refreshIcons();
}
if (pCore->projectManager() && pCore->projectManager()->currentTimeline()) {
pCore->projectManager()->currentTimeline()->refreshIcons();
}
......@@ -729,15 +720,12 @@ void MainWindow::slotReloadTheme()
MainWindow::~MainWindow()
{
delete m_audioSpectrum;
m_effectStack->slotClipItemSelected(nullptr, m_projectMonitor);
m_effectStack->slotTransitionItemSelected(nullptr, 0, QPoint(), false);
if (m_projectMonitor) {
m_projectMonitor->stop();
}
if (m_clipMonitor) {
m_clipMonitor->stop();
}
delete m_effectStack;
delete m_projectMonitor;
delete m_clipMonitor;
delete m_shortcutRemoveFocus;
......@@ -847,6 +835,8 @@ void MainWindow::slotFullScreen()
void MainWindow::slotAddEffect(const QDomElement &effect)
{
// TODO refac : reimplement
/*
if (effect.isNull()) {
qCDebug(KDENLIVE_LOG) << "--- ERROR, TRYING TO APPEND nullptr EFFECT";
return;
......@@ -868,6 +858,7 @@ void MainWindow::slotAddEffect(const QDomElement &effect)
// No clip selected
m_messageLabel->setMessage(i18n("Select a clip if you want to apply an effect"), ErrorMessage);
}
*/
}
void MainWindow::slotUpdateClip(const QString &id, bool reload)
......@@ -1965,7 +1956,6 @@ void MainWindow::connectDocument()
connect(project, &KdenliveDoc::reloadEffects, this, &MainWindow::slotReloadEffects);
KdenliveSettings::setProject_fps(pCore->getCurrentFps());
m_clipMonitorDock->raise();
m_effectStack->transitionConfig()->updateProjectFormat();
// TODO REFAC: reconnect to new timeline
/*
......@@ -2074,7 +2064,7 @@ void MainWindow::connectDocument()
connect(m_projectMonitor, &Monitor::durationChanged, this, &MainWindow::slotUpdateProjectDuration);
pCore->monitorManager()->setDocument(project);
// TOD REFAC: fix
// TODO REFAC: fix
// trackView->updateProfile(1.0);
// Init document zone
// m_projectMonitor->slotZoneMoved(trackView->inPoint(), trackView->outPoint());
......@@ -2251,7 +2241,8 @@ void MainWindow::slotDeleteItem()
QWidget *widget = QApplication::focusWidget();
while ((widget != nullptr) && widget != this) {
if (widget == m_effectStackDock) {
m_effectStack->deleteCurrentEffect();