When trying to play a monitor that is hidden, display an info message allowing to show the monitor.

Fixes #762
parent d722dc28
......@@ -3715,9 +3715,16 @@ void MainWindow::slotChangeStyle(QAction *a)
KdenliveSettings::setWidgetstyle(style);
doChangeStyle();
// Monitor refresh is necessary
if (pCore->monitorManager()->isActive(Kdenlive::ClipMonitor)) {
raiseMonitor(pCore->monitorManager()->isActive(Kdenlive::ClipMonitor));
}
void MainWindow::raiseMonitor(bool clipMonitor)
{
if (clipMonitor) {
m_clipMonitorDock->show();
m_clipMonitorDock->raise();
} else {
m_projectMonitorDock->show();
m_projectMonitorDock->raise();
}
}
......
......@@ -131,6 +131,9 @@ public:
/** @brief Returns true if the timeline widget is visible */
bool timelineVisible() const;
/** @brief Raise (show) the clip or project monitor */
void raiseMonitor(bool clipMonitor);
protected:
/** @brief Closes the window.
......
......@@ -154,6 +154,7 @@ bool MonitorManager::activateMonitor(Kdenlive::MonitorId name)
m_clipMonitor->parentWidget()->raise();
}
if (!m_clipMonitor->isVisible()) {
pCore->displayMessage(i18n("Do you want to <a href=\"#clipmonitor\">show the clip monitor</a> to view timeline?"), MessageType::InformationMessage);
m_activeMonitor = m_projectMonitor;
return false;
}
......@@ -165,6 +166,7 @@ bool MonitorManager::activateMonitor(Kdenlive::MonitorId name)
m_projectMonitor->parentWidget()->raise();
}
if (!m_projectMonitor->isVisible()) {
pCore->displayMessage(i18n("Do you want to <a href=\"#projectmonitor\">show the project monitor</a> to view timeline?"), MessageType::InformationMessage);
m_activeMonitor = m_clipMonitor;
return false;
}
......
......@@ -23,6 +23,8 @@
#include "statusbarmessagelabel.h"
#include "kdenlivesettings.h"
#include "core.h"
#include "mainwindow.h"
#include <KNotification>
#include <kcolorscheme.h>
......@@ -220,7 +222,7 @@ bool StatusBarMessageLabel::slotMessageTimeout()
iconName = "dialog-information";
m_pixmap->setCursor(Qt::ArrowCursor);
QPropertyAnimation *anim = new QPropertyAnimation(this, "color", this);
anim->setDuration(1500);
anim->setDuration(3000);
anim->setEasingCurve(QEasingCurve::InOutQuad);
anim->setKeyValueAt(0.2, parentWidget()->palette().highlight().color());
anim->setEndValue(parentWidget()->palette().window().color());
......@@ -247,7 +249,7 @@ bool StatusBarMessageLabel::slotMessageTimeout()
anim->setStartValue(bgColor);
anim->setEndValue(bgColor);
anim->setEasingCurve(QEasingCurve::OutCubic);
anim->setDuration(1500);
anim->setDuration(3000);
anim->start(QPropertyAnimation::DeleteWhenStopped);
break;
}
......@@ -281,6 +283,18 @@ void StatusBarMessageLabel::resizeEvent(QResizeEvent *event)
void StatusBarMessageLabel::slotShowJobLog(const QString &text)
{
// Special actions
if (text.startsWith(QLatin1Char('#'))) {
if (text == QLatin1String("#projectmonitor")) {
// Raise project monitor
pCore->window()->raiseMonitor(false);
return;
} else if (text == QLatin1String("#clipmonitor")) {
// Raise project monitor
pCore->window()->raiseMonitor(true);
return;
}
}
QDialog d(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
QWidget *mainWidget = new QWidget(this);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment