#include <QDomDocument>
#include <QTreeWidgetItem>
#include <QHeaderView>
+#include <unistd.h>
DvdTreeWidget::DvdTreeWidget(QWidget *parent) :
QTreeWidget(parent)
m_installCheck(true)
{
m_view.setupUi(this);
- m_view.intro_vob->setEnabled(false);
- m_view.intro_vob->setFilter("video/mpeg");
m_view.button_add->setIcon(KIcon("list-add"));
m_view.button_delete->setIcon(KIcon("list-remove"));
m_view.button_up->setIcon(KIcon("go-up"));
connect(m_vobList, SIGNAL(addClips(QList<QUrl>)), this, SLOT(slotAddVobList(QList<QUrl>)));
connect(m_vobList, SIGNAL(addNewClip()), this, SLOT(slotAddVobFile()));
-
- connect(m_view.use_intro, SIGNAL(toggled(bool)), m_view.intro_vob, SLOT(setEnabled(bool)));
connect(m_view.button_add, SIGNAL(clicked()), this, SLOT(slotAddVobFile()));
connect(m_view.button_delete, SIGNAL(clicked()), this, SLOT(slotDeleteVobFile()));
connect(m_view.button_up, SIGNAL(clicked()), this, SLOT(slotItemUp()));
m_warnMessage->setCloseButtonVisible(false);
m_warnMessage->addAction(m_transcodeAction);
QGridLayout *s = static_cast <QGridLayout*> (layout());
- s->addWidget(m_warnMessage, 3, 0, 1, -1);
+ s->addWidget(m_warnMessage, 2, 0, 1, -1);
m_warnMessage->hide();
m_view.button_transcode->setHidden(true);
#else
item->setData(1, Qt::UserRole, playTime);
int standard = -1;
int aspect = profile.dar() * 100;
- if (profile.height() == 576) {
+ if (profile.height() == 576 && profile.fps() == 25.0) {
if (aspect > 150) standard = 1;
else standard = 0;
}
- else if (profile.height() == 480) {
+ else if (profile.height() == 480 && qAbs(profile.fps() - 30000.0 / 1001) < 0.2) {
if (aspect > 150) standard = 3;
else standard = 2;
}
default:
standardName = i18n("Unknown");
}
+ standardName.append(QString(" | %1x%2, %3fps").arg(profile.width()).arg(profile.height()).arg(profile.fps()));
item->setData(0, Qt::UserRole, standardName);
item->setData(0, Qt::UserRole + 1, standard);
item->setData(0, Qt::UserRole + 2, QSize(profile.dar() * profile.height(), profile.height()));
QStringList result;
QString path;
int max = m_vobList->topLevelItemCount();
- for (int i = 0; i < max; i++) {
+ int i = 0;
+ if (m_view.use_intro->isChecked()) {
+ // First movie is only for intro
+ i = 1;
+ }
+ for (; i < max; i++) {
QTreeWidgetItem *item = m_vobList->topLevelItem(i);
if (item) result.append(item->text(0));
}
return result;
}
-
-QString DvdWizardVob::introMovie() const
+const QString DvdWizardVob::introMovie() const
{
- if (!m_view.use_intro->isChecked()) return QString();
- return m_view.intro_vob->url().path();
+ QString url;
+ if (m_view.use_intro->isChecked() && m_vobList->topLevelItemCount() > 0) url = m_vobList->topLevelItem(0)->text(0);
+ return url;
}
-void DvdWizardVob::setIntroMovie(const QString& path)
+void DvdWizardVob::setUseIntroMovie(bool use)
{
- m_view.intro_vob->setUrl(KUrl(path));
- m_view.use_intro->setChecked(path.isEmpty() == false);
+ m_view.use_intro->setChecked(use);
}
-
void DvdWizardVob::slotCheckVobList()
{
emit completeChanged();
void DvdWizardVob::slotTranscodeFiles()
{
// Find transcoding infos related to selected DVD profile
- KSharedConfigPtr config = KSharedConfig::openConfig("kdenlivetranscodingrc");
+ KSharedConfigPtr config = KSharedConfig::openConfig("kdenlivetranscodingrc", KConfig::CascadeConfig);
KConfigGroup transConfig(config, "Transcoding");
// read the entries
QString profileEasyName;
}
ClipTranscode *d = new ClipTranscode(KUrl::List () << KUrl(item->text(0)), params.section(';', 0, 0), postParams, i18n("Transcoding to DVD format"), true, this);
connect(d, SIGNAL(transcodedClip(KUrl,KUrl)), this, SLOT(slotTranscodedClip(KUrl, KUrl)));
+ d->slotStartTransCode();
d->show();
+
}
}
}
void DvdWizardVob::slotTranscodedClip(KUrl src, KUrl transcoded)
{
+ if (transcoded.isEmpty()) {
+ // Transcoding canceled or failed
+ m_transcodeAction->setEnabled(true);
+ return;
+ }
int max = m_vobList->topLevelItemCount();
for (int i = 0; i < max; i++) {
QTreeWidgetItem *item = m_vobList->topLevelItem(i);