Display warning when rendering using proxy clipy

CCBUG: 372660
parent b992f596
......@@ -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());
}
......@@ -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());
......
......@@ -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)
......
......@@ -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>
......
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