#include <KIO/NetAccess>
#include <KColorScheme>
#include <KNotification>
+#include <KStartupInfo>
// #include <knewstuff2/engine.h>
#include <QDomDocument>
#include <QListWidgetItem>
#include <QHeaderView>
#include <QMenu>
-#include <QProcess>
#include <QInputDialog>
+#include <QProcess>
+#include <QDBusConnectionInterface>
+#include <QDBusInterface>
const int GroupRole = Qt::UserRole;
const int ExtensionRole = GroupRole + 1;
if (m_renderer.isEmpty()) m_renderer = "kdenlive_render";
}
+ QDBusConnectionInterface* interface = QDBusConnection::sessionBus().interface();
+ if (!interface || !interface->isServiceRegistered("org.kde.ksmserver")) {
+ m_view.shutdown->setEnabled(false);
+ }
+
focusFirstVisibleItem();
}
}
if (url != 0) {
QListWidgetItem *item = m_view.size_list->currentItem();
+ if (!item) {
+ m_view.buttonStart->setEnabled(false);
+ return;
+ }
QString extension = item->data(ExtensionRole).toString();
url = filenameWithExtension(url, extension);
m_view.out_file->setUrl(url);
if (m_view.open_dvd->isChecked()) {
renderItem->setData(0, Qt::UserRole, group);
if (renderArgs.contains("profile=")) {
- // rendering profile contains an MLT profile, so pass it to the running jog item, useful for dvd
+ // rendering profile contains an MLT profile, so pass it to the running jog item, useful for dvd
QString prof = renderArgs.section("profile=", 1, 1);
prof = prof.section(' ', 0, 0);
kDebug() << "// render profile: " << prof;
} else {
if (group == "websites" && m_view.open_browser->isChecked()) {
renderItem->setData(0, Qt::UserRole, group);
- // pass the url
+ // pass the url
QString url = m_view.size_list->currentItem()->data(ExtraRole).toString();
renderItem->setData(0, Qt::UserRole + 1, url);
}
void RenderWidget::checkRenderStatus()
{
+ // check if we have a job waiting to render
if (m_blockProcessing) return;
QTreeWidgetItem *item = m_view.running_jobs->topLevelItem(0);
while (item) {
item = m_view.running_jobs->itemBelow(item);
}
item = m_view.running_jobs->topLevelItem(0);
+ bool waitingJob = false;
while (item) {
if (item->data(1, Qt::UserRole + 2).toInt() == WAITINGJOB) {
item->setData(1, Qt::UserRole + 1, QTime::currentTime());
+ waitingJob = true;
if (item->data(1, Qt::UserRole + 4).isNull()) {
// Normal render process
if (QProcess::startDetached(m_renderer, item->data(1, Qt::UserRole + 3).toStringList()) == false) {
}
item = m_view.running_jobs->itemBelow(item);
}
+ if (waitingJob == false && m_view.shutdown->isChecked()) emit shutdown();
}
int RenderWidget::waitingJobsCount() const
const QStringList acodecsList = KdenliveSettings::audiocodecs();
bool replaceVorbisCodec = false;
if (!acodecsList.contains("vorbis") && acodecsList.contains("libvorbis")) replaceVorbisCodec = true;
+ bool replaceLibfaacCodec = false;
+ if (!acodecsList.contains("libfaac") && acodecsList.contains("aac")) replaceLibfaacCodec = true;
if (editable || groups.count() == 0) {
// replace vorbis with libvorbis
params = params.replace("vorbis", "libvorbis");
}
-
+ if (replaceLibfaacCodec && params.contains("acodec=libfaac")) {
+ // replace libfaac with aac
+ params = params.replace("libfaac", "aac");
+ }
QString category = profile.attribute("category", i18n("Custom"));
QString dest = profile.attribute("destinationid");
// replace vorbis with libvorbis
params = params.replace("vorbis", "libvorbis");
}
+ if (replaceLibfaacCodec && params.contains("acodec=libfaac")) {
+ // replace libfaac with aac
+ params = params.replace("libfaac", "aac");
+ }
+
prof_extension = profileElement.attribute("extension");
if (!prof_extension.isEmpty()) extension = prof_extension;
item = new QListWidgetItem(profileName, m_view.size_list);
void RenderWidget::slotPlayRendering(QTreeWidgetItem *item, int)
{
if (KdenliveSettings::defaultplayerapp().isEmpty() || item->data(1, Qt::UserRole + 2).toInt() != FINISHEDJOB) return;
- QProcess::startDetached(KdenliveSettings::defaultplayerapp(), QStringList() << item->text(1));
+ const QByteArray startId = KStartupInfo::createNewStartupId();
+ const QString command = KdenliveSettings::defaultplayerapp() + ' ' + item->text(1);
+ KRun::runCommand(command, KdenliveSettings::defaultplayerapp(), KdenliveSettings::defaultplayerapp(), this, startId);
}