summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <jb@kdenlive.org>2016-11-20 15:48:52 (GMT)
committerJean-Baptiste Mardelle <jb@kdenlive.org>2016-11-20 16:05:59 (GMT)
commit8be12207b3024594b2651dd4f0ae485be2edd8a6 (patch)
tree8a53047803561f6eecab36669066f75ecc708edf
parentb992f5962a6e09a4dd0ef6cee90db0b83a0a1f08 (diff)
Display warning when rendering using proxy clipy
CCBUG: 372660
-rw-r--r--src/dialogs/renderwidget.cpp33
-rw-r--r--src/dialogs/renderwidget.h11
-rw-r--r--src/mainwindow.cpp6
-rw-r--r--src/ui/renderwidget_ui.ui17
4 files changed, 53 insertions, 14 deletions
diff --git a/src/dialogs/renderwidget.cpp b/src/dialogs/renderwidget.cpp
index a2f028b..c367ae1 100644
--- a/src/dialogs/renderwidget.cpp
+++ b/src/dialogs/renderwidget.cpp
@@ -209,7 +209,7 @@ RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, const
m_view.tc_type->setEnabled(false);
m_view.checkTwoPass->setEnabled(false);
m_view.proxy_render->setHidden(!enableProxy);
-
+ connect(m_view.proxy_render, &QCheckBox::toggled, this, &RenderWidget::slotProxyWarn);
KColorScheme scheme(palette().currentColorGroup(), KColorScheme::Window, KSharedConfig::openConfig(KdenliveSettings::colortheme()));
QColor bg = scheme.background(KColorScheme::NegativeBackground).color();
m_view.errorBox->setStyleSheet(QStringLiteral("QGroupBox { background-color: rgb(%1, %2, %3); border-radius: 5px;}; ").arg(bg.red()).arg(bg.green()).arg(bg.blue()));
@@ -1565,11 +1565,11 @@ void RenderWidget::refreshParams()
}
if (!item || item->isHidden() || extension.isEmpty()) {
if (!item)
- errorMessage(i18n("No matching profile"));
+ errorMessage(ProfileError, i18n("No matching profile"));
else if (!item->parent()) // category
;
else if (extension.isEmpty()) {
- errorMessage(i18n("Invalid profile"));
+ errorMessage(ProfileError, i18n("Invalid profile"));
}
m_view.advanced_params->clear();
m_view.buttonRender->setEnabled(false);
@@ -1577,7 +1577,7 @@ void RenderWidget::refreshParams()
return;
}
QString params = item->data(0, ParamsRole).toString();
- errorMessage(item->data(0, ErrorRole).toString());
+ errorMessage(ProfileError, item->data(0, ErrorRole).toString());
m_view.advanced_params->setPlainText(params);
if (params.contains(QStringLiteral(" s=")) || params.startsWith(QLatin1String("s=")) || params.contains("%dv_standard")) {
// profile has a fixed size, do not allow resize
@@ -2394,12 +2394,24 @@ void RenderWidget::slotPlayRendering(QTreeWidgetItem *item, int)
new KRun(QUrl::fromLocalFile(item->text(1)), this);
}
-void RenderWidget::errorMessage(const QString &message)
+void RenderWidget::errorMessage(RenderError type, const QString &message)
{
- if (!message.isEmpty()) {
+ QString fullMessage;
+ m_errorMessages.insert(type, message);
+ QMapIterator<int, QString> i(m_errorMessages);
+ while (i.hasNext()) {
+ i.next();
+ if (!i.value().isEmpty()) {
+ if (!fullMessage.isEmpty())
+ fullMessage.append(QStringLiteral("\n"));
+ fullMessage.append(i.value());
+ }
+ }
+ if (!fullMessage.isEmpty()) {
+ m_infoMessage->hide();
m_infoMessage->setMessageType(KMessageWidget::Warning);
- m_infoMessage->setText(message);
- m_infoMessage->animatedShow();
+ m_infoMessage->setText(fullMessage);
+ m_infoMessage->show();
}
else {
if (m_view.tabWidget->currentIndex() == 0 && m_infoMessage->isVisible()) {
@@ -2567,3 +2579,8 @@ void RenderWidget::checkCodecs()
delete consumer;
}
}
+
+void RenderWidget::slotProxyWarn(bool enableProxy)
+{
+ errorMessage(ProxyWarning, enableProxy ? i18n("Rendering using low quality proxy") : QString());
+}
diff --git a/src/dialogs/renderwidget.h b/src/dialogs/renderwidget.h
index ced88c0..6bde708 100644
--- a/src/dialogs/renderwidget.h
+++ b/src/dialogs/renderwidget.h
@@ -134,8 +134,14 @@ public:
bool proxyRendering();
/** @brief Returns true if the stem audio export checkbox is set. */
bool isStemAudioExportEnabled() const;
+ enum RenderError {
+ CompositeError = 0,
+ ProfileError = 1,
+ ProxyWarning = 2
+ };
+
/** @brief Display warning message in render widget. */
- void errorMessage(const QString &message);
+ void errorMessage(RenderError type, const QString &message);
protected:
virtual QSize sizeHint() const;
@@ -189,6 +195,8 @@ private slots:
void adjustQuality(int videoQuality);
/** @brief Show updated command parameter in tooltip. */
void adjustSpeed(int videoQuality);
+ /** @brief Display warning on proxy rendering. */
+ void slotProxyWarn(bool enableProxy);
private:
Ui::RenderWidget_UI m_view;
@@ -199,6 +207,7 @@ private:
bool m_blockProcessing;
QString m_renderer;
KMessageWidget *m_infoMessage;
+ QMap<int, QString>m_errorMessages;
void parseMltPresets();
void parseProfiles(const QString &selectedProfile = QString());
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 00ec65f..a904832 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1773,7 +1773,7 @@ void MainWindow::slotRenderProject()
m_renderWidget->setRenderProfile(project->getRenderProperties());
}
if (m_compositeAction->currentAction())
- m_renderWidget->errorMessage(m_compositeAction->currentAction()->data().toInt() == 1 ? i18n("Rendering using low quality track compositing") : QString());
+ m_renderWidget->errorMessage(RenderWidget::CompositeError, m_compositeAction->currentAction()->data().toInt() == 1 ? i18n("Rendering using low quality track compositing") : QString());
}
slotCheckRenderStatus();
m_renderWidget->show();
@@ -3965,7 +3965,7 @@ void MainWindow::slotUpdateCompositing(QAction *compose)
int mode = compose->data().toInt();
pCore->projectManager()->currentTimeline()->switchComposite(mode);
if (m_renderWidget)
- m_renderWidget->errorMessage(mode == 1 ? i18n("Rendering using low quality track compositing") : QString());
+ m_renderWidget->errorMessage(RenderWidget::CompositeError, mode == 1 ? i18n("Rendering using low quality track compositing") : QString());
}
}
@@ -3979,7 +3979,7 @@ void MainWindow::slotUpdateCompositeAction(int mode)
}
}
if (m_renderWidget)
- m_renderWidget->errorMessage(mode == 1 ? i18n("Rendering using low quality track compositing") : QString());
+ m_renderWidget->errorMessage(RenderWidget::CompositeError, mode == 1 ? i18n("Rendering using low quality track compositing") : QString());
}
void MainWindow::showMenuBar(bool show)
diff --git a/src/ui/renderwidget_ui.ui b/src/ui/renderwidget_ui.ui
index 2d267b3..536962a 100644
--- a/src/ui/renderwidget_ui.ui
+++ b/src/ui/renderwidget_ui.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>1176</width>
- <height>672</height>
+ <width>1504</width>
+ <height>816</height>
</rect>
</property>
<property name="windowTitle">
@@ -745,6 +745,19 @@
</property>
</widget>
</item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
</item>