#include <KColorScheme>
#include <KNotification>
#include <KStartupInfo>
-// #include <knewstuff2/engine.h>
#include <QDomDocument>
#include <QItemDelegate>
RenderWidget::RenderWidget(const QString &projectfolder, QWidget * parent) :
QDialog(parent),
m_projectFolder(projectfolder),
- m_blockProcessing(false)
+ m_blockProcessing(false),
+ m_autoAudio(false)
{
m_view.setupUi(this);
setWindowTitle(i18n("Rendering"));
m_view.errorLabel->setPalette(p);
m_view.errorLabel->setHidden(true);
+ connect(m_view.export_audio, SIGNAL(stateChanged(int)), this, SLOT(slotUpdateAudioLabel(int)));
+ m_view.export_audio->setCheckState(Qt::PartiallyChecked);
+
parseProfiles();
parseScriptFiles();
KMessageBox::sorry(this, i18n("Cannot find the melt program required for rendering (part of Mlt)"));
return;
}
- if (m_view.play_after->isChecked() && KdenliveSettings::defaultplayerapp().isEmpty())
+ if (m_view.play_after->isChecked() && KdenliveSettings::defaultplayerapp().isEmpty()) {
KMessageBox::sorry(this, i18n("Cannot play video after rendering because the default video player application is not set.\nPlease define it in Kdenlive settings dialog."));
+ }
QString chapterFile;
if (m_view.create_chapter->isChecked()) chapterFile = m_view.out_file->url().path() + ".dvdchapter";
else if (m_view.scanning_list->currentIndex() == 2) renderArgs.append(" progressive=0");
// disable audio if requested
- if (!m_view.export_audio->isChecked())
+ if (m_view.export_audio->checkState() == Qt::Unchecked || (m_view.export_audio->checkState() == Qt::PartiallyChecked && !m_autoAudio))
renderArgs.append(" an=1 ");
// Check if the rendering profile is different from project profile,
} else m_view.errorLabel->setHidden(true);
}
+void RenderWidget::slotEnableAudio(bool enable)
+{
+ m_autoAudio = enable;
+ if (m_view.export_audio->checkState() == Qt::PartiallyChecked) m_view.export_audio->setText(m_autoAudio ? i18n("Export audio (on)") : i18n("Export audio (off)"));
+}
+
void RenderWidget::slotUpdateRescaleWidth(int val)
{
KdenliveSettings::setDefaultrescalewidth(val);
if (m_view.rescale_keep->isChecked()) slotUpdateRescaleWidth(m_view.rescale_width->value());
}
+void RenderWidget::slotUpdateAudioLabel(int ix)
+{
+ if (ix == Qt::PartiallyChecked)
+ m_view.export_audio->setText(m_autoAudio ? i18n("Export audio (on)") : i18n("Export audio (off)"));
+ else
+ m_view.export_audio->setText(i18n("Audio export"));
+}
\ No newline at end of file