connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotPageChanged(int)));
connect(m_status.button_start, SIGNAL(clicked()), this, SLOT(slotGenerate()));
connect(m_status.button_abort, SIGNAL(clicked()), this, SLOT(slotAbort()));
- connect(m_status.button_save, SIGNAL(clicked()), this, SLOT(slotSave()));
connect(m_status.button_preview, SIGNAL(clicked()), this, SLOT(slotPreview()));
QString programName("k3b");
m_status.button_burn->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
m_status.button_preview->setIcon(KIcon("media-playback-start"));
+ // TODO: uncomment after 0.7.4 release (i18n change)
+ /*setButtonText(QWizard::CustomButton1, i19n("Load"));
+ setButtonText(QWizard::CustomButton2, i19n("Save"));*/
+ button(QWizard::CustomButton1)->setIcon(KIcon("document-open"));
+ button(QWizard::CustomButton2)->setIcon(KIcon("document-save"));
+ connect(button(QWizard::CustomButton1), SIGNAL(clicked()), this, SLOT(slotLoad()));
+ connect(button(QWizard::CustomButton2), SIGNAL(clicked()), this, SLOT(slotSave()));
+ setOption(QWizard::HaveCustomButton1, true);
+ setOption(QWizard::HaveCustomButton2, true);
+ QList<QWizard::WizardButton> layout;
+ layout << QWizard::CustomButton1 << QWizard::CustomButton2 << QWizard::Stretch << QWizard::BackButton << QWizard::NextButton << QWizard::CancelButton << QWizard::FinishButton;
+ setButtonLayout(layout);
}
DvdWizard::~DvdWizard()
void DvdWizard::slotPageChanged(int page)
{
//kDebug() << "// PAGE CHGD: " << page << ", ID: " << visitedPages();
- if (page == 1) {
- m_pageChapters->setVobFiles(m_pageVob->isPal(), m_pageVob->selectedUrls(), m_pageVob->durations());
+ if (page == 0) {
+ // Update chapters that were modified in page 1
+ m_pageVob->updateChapters(m_pageChapters->chaptersData());
+ } else if (page == 1) {
+ m_pageChapters->setVobFiles(m_pageVob->isPal(), m_pageVob->selectedUrls(), m_pageVob->durations(), m_pageVob->chapters());
} else if (page == 2) {
m_pageMenu->setTargets(m_pageChapters->selectedTitles(), m_pageChapters->selectedTargets());
m_pageMenu->changeProfile(m_pageVob->isPal());
void DvdWizard::generateDvd()
{
+ m_status.error_box->setHidden(true);
KTemporaryFile temp1;
temp1.setSuffix(".png");
//temp1.setAutoRemove(false);
m_creationLog.clear();
m_dvdauthor = new QProcess(this);
connect(m_dvdauthor, SIGNAL(finished(int , QProcess::ExitStatus)), this, SLOT(slotRenderFinished(int, QProcess::ExitStatus)));
+ connect(m_dvdauthor, SIGNAL(readyReadStandardOutput()), this, SLOT(slotShowRenderInfo()));
m_dvdauthor->setProcessChannelMode(QProcess::MergedChannels);
m_dvdauthor->start("dvdauthor", args);
m_status.button_abort->setEnabled(true);
}
+void DvdWizard::slotShowRenderInfo()
+{
+ QString log = QString(m_dvdauthor->readAll());
+ m_status.error_log->setText(log);
+ m_status.error_box->setHidden(false);
+}
+
void DvdWizard::slotRenderFinished(int exitCode, QProcess::ExitStatus status)
{
QListWidgetItem *authitem = m_status.job_progress->item(3);
if (status == QProcess::CrashExit || exitCode != 0) {
- QByteArray result = m_dvdauthor->readAllStandardError();
+ QString result(m_dvdauthor->readAllStandardError());
+ result.append("<br><b>");
+
+ //TODO: uncomment after 0.7.4 release (i18n change)
+ //result.append(i19n("DVDAuthor process crashed."));
m_status.error_log->setText(result);
m_status.error_box->setHidden(false);
kDebug() << "DVDAuthor process crashed";
}
m_mkiso = new QProcess(this);
connect(m_mkiso, SIGNAL(finished(int , QProcess::ExitStatus)), this, SLOT(slotIsoFinished(int, QProcess::ExitStatus)));
+ connect(m_mkiso, SIGNAL(readyReadStandardOutput()), this, SLOT(slotShowIsoInfo()));
m_mkiso->setProcessChannelMode(QProcess::MergedChannels);
QListWidgetItem *isoitem = m_status.job_progress->item(4);
isoitem->setIcon(KIcon("system-run"));
}
+void DvdWizard::slotShowIsoInfo()
+{
+ QString log = QString(m_mkiso->readAll());
+ m_status.error_log->setText(log);
+ m_status.error_box->setHidden(false);
+}
+
void DvdWizard::slotIsoFinished(int exitCode, QProcess::ExitStatus status)
{
QListWidgetItem *isoitem = m_status.job_progress->item(4);
if (status == QProcess::CrashExit || exitCode != 0) {
- QByteArray result = m_mkiso->readAllStandardError();
+ QString result(m_mkiso->readAllStandardError());
+ result.append("<br><b>");
+ //TODO: uncomment after 0.7.4 release (i18n change)
+ // result.append(i19n("ISO creation process crashed."));
m_status.error_log->setText(result);
m_status.error_box->setHidden(false);
m_mkiso->close();
if (KIO::NetAccess::exists(KUrl(m_status.iso_image->url().path()), KIO::NetAccess::SourceSide, this))
warnMessage.append(i18n("Image file %1 already exists. Overwrite?", m_status.iso_image->url().path()));
- if (!warnMessage.isEmpty() && KMessageBox::questionYesNo(this, warnMessage) == KMessageBox::Yes) {
+ if (warnMessage.isEmpty() || KMessageBox::questionYesNo(this, warnMessage) == KMessageBox::Yes) {
KIO::NetAccess::del(KUrl(m_status.tmp_folder->url().path() + "/DVD"), this);
QTimer::singleShot(300, this, SLOT(generateDvd()));
m_status.button_preview->setEnabled(false);
void DvdWizard::slotSave()
{
- KMessageBox::sorry(this, "Not implemented yet");
- return;
- KUrl url = KFileDialog::getSaveUrl(KUrl(), "*.kdvd", this, i18n("Save DVD Project"));
+ KUrl url = KFileDialog::getSaveUrl(KUrl("kfiledialog:///projectfolder"), "*.kdvd", this, i18n("Save DVD Project"));
if (url.isEmpty()) return;
+
+ if (currentId() == 0) m_pageChapters->setVobFiles(m_pageVob->isPal(), m_pageVob->selectedUrls(), m_pageVob->durations(), m_pageVob->chapters());
+
QDomDocument doc;
QDomElement dvdproject = doc.createElement("dvdproject");
QString profile;
else profile = "dv_ntsc";
if (m_pageVob->isWide()) profile.append("_wide");
dvdproject.setAttribute("profile", profile);
- doc.appendChild(dvdproject);
- //for (int i = 0; i <
+ dvdproject.setAttribute("tmp_folder", m_status.tmp_folder->text());
+ dvdproject.setAttribute("iso_image", m_status.iso_image->text());
+
+ dvdproject.setAttribute("intro_movie", m_pageVob->introMovie());
+ doc.appendChild(dvdproject);
+ QDomElement menu = m_pageMenu->toXml();
+ if (!menu.isNull()) dvdproject.appendChild(doc.importNode(menu, true));
+ QDomElement chaps = m_pageChapters->toXml();
+ if (!chaps.isNull()) dvdproject.appendChild(doc.importNode(chaps, true));
+
+ QFile file(url.path());
+ if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ kWarning() << "////// ERROR writing to file: " << url.path();
+ KMessageBox::error(this, i18n("Cannot write to file %1", url.path()));
+ return;
+ }
+
+ file.write(doc.toString().toUtf8());
+ if (file.error() != QFile::NoError) {
+ KMessageBox::error(this, i18n("Cannot write to file %1", url.path()));
+ }
+ file.close();
}
+void DvdWizard::slotLoad()
+{
+ KUrl url = KFileDialog::getOpenUrl(KUrl("kfiledialog:///projectfolder"), "*.kdvd");
+ if (url.isEmpty()) return;
+ QDomDocument doc;
+ QFile file(url.path());
+ doc.setContent(&file, false);
+ file.close();
+ QDomElement dvdproject = doc.documentElement();
+ if (dvdproject.tagName() != "dvdproject") {
+ KMessageBox::error(this, i18n("File %1 is not a Kdenlive project file.", url.path()));
+ return;
+ }
+
+ QString profile = dvdproject.attribute("profile");
+ m_pageVob->setProfile(profile);
+
+ m_status.tmp_folder->setPath(dvdproject.attribute("tmp_folder"));
+ m_status.iso_image->setPath(dvdproject.attribute("iso_image"));
+ m_pageVob->setIntroMovie(dvdproject.attribute("intro_movie"));
+
+ QDomNodeList vobs = doc.elementsByTagName("vob");
+ m_pageVob->clear();
+ for (int i = 0; i < vobs.count(); i++) {
+ QDomElement e = vobs.at(i).toElement();
+ m_pageVob->slotAddVobFile(KUrl(e.attribute("file")), e.attribute("chapters"));
+ }
+ m_pageMenu->loadXml(dvdproject.firstChildElement("menu"));
+}
void slotBurn();
void slotGenerate();
void slotAbort();
+ void slotLoad();
void slotSave();
+ void slotShowRenderInfo();
+ void slotShowIsoInfo();
};
#endif
connect(m_view.vob_list, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateChaptersList()));
connect(m_view.button_add, SIGNAL(clicked()), this, SLOT(slotAddChapter()));
connect(m_view.button_delete, SIGNAL(clicked()), this, SLOT(slotRemoveChapter()));
- connect(m_view.button_save, SIGNAL(clicked()), this, SLOT(slotSaveChapter()));
connect(m_view.chapters_list, SIGNAL(itemSelectionChanged()), this, SLOT(slotGoToChapter()));
// Build monitor for chapters
m_view.chapters_list->addItems(chaptersString);
bool modified = m_view.vob_list->itemData(m_view.vob_list->currentIndex(), Qt::UserRole + 2).toInt();
- m_view.button_save->setEnabled(modified);
}
void DvdWizardChapters::slotAddChapter()
m_view.vob_list->setItemData(m_view.vob_list->currentIndex(), 1, Qt::UserRole + 2);
m_view.chapters_list->clear();
m_view.chapters_list->addItems(chaptersString);
- m_view.button_save->setEnabled(true);
}
void DvdWizardChapters::slotRemoveChapter()
}
m_view.chapters_list->clear();
m_view.chapters_list->addItems(chaptersString);
- m_view.button_save->setEnabled(true);
}
void DvdWizardChapters::slotGoToChapter()
m_monitor->setTimePos(m_view.chapters_list->currentItem()->text() + ":00");
}
-void DvdWizardChapters::slotGetChaptersList(int ix)
-{
- QString url = m_view.vob_list->itemText(ix);
- if (QFile::exists(url + ".dvdchapter")) {
- // insert chapters as children
- QFile file(url + ".dvdchapter");
- if (file.open(QIODevice::ReadOnly)) {
- QDomDocument doc;
- doc.setContent(&file);
- file.close();
- QDomNodeList chapters = doc.elementsByTagName("chapter");
- QStringList chaptersList;
- for (int j = 0; j < chapters.count(); j++) {
- chaptersList.append(QString::number(chapters.at(j).toElement().attribute("time").toInt()));
- }
- m_view.vob_list->setItemData(ix, chaptersList, Qt::UserRole + 1);
- }
- }
-}
-
-void DvdWizardChapters::setVobFiles(bool isPal, const QStringList movies, const QStringList durations)
+void DvdWizardChapters::setVobFiles(bool isPal, const QStringList movies, const QStringList durations, const QStringList chapters)
{
m_isPal = isPal;
if (m_isPal) m_tc.setFormat(25);
m_manager->resetProfiles(m_tc);
m_monitor->resetProfile();
- if (m_view.vob_list->count() == movies.count()) {
- bool equal = true;
- for (int i = 0; i < movies.count(); i++) {
- if (movies.at(i) != m_view.vob_list->itemText(i)) {
- equal = false;
- break;
- }
- }
- if (equal) return;
- }
m_view.vob_list->clear();
for (int i = 0; i < movies.count(); i++) {
m_view.vob_list->addItem(movies.at(i), durations.at(i));
- slotGetChaptersList(i);
+ m_view.vob_list->setItemData(i, chapters.at(i).split(';'), Qt::UserRole + 1);
}
slotUpdateChaptersList();
}
+QMap <QString, QString> DvdWizardChapters::chaptersData() const
+{
+ QMap <QString, QString> result;
+ int max = m_view.vob_list->count();
+ for (int i = 0; i < max; i++) {
+ QString chapters = m_view.vob_list->itemData(i, Qt::UserRole + 1).toStringList().join(";");
+ result.insert(m_view.vob_list->itemText(i), chapters);
+ }
+ return result;
+}
+
QStringList DvdWizardChapters::selectedTitles() const
{
QStringList result;
return result;
}
-void DvdWizardChapters::slotSaveChapter()
+
+QDomElement DvdWizardChapters::toXml() const
{
QDomDocument doc;
- QDomElement chapters = doc.createElement("chapters");
- chapters.setAttribute("fps", m_tc.fps());
- doc.appendChild(chapters);
-
- QStringList chaptersList = m_view.vob_list->itemData(m_view.vob_list->currentIndex(), Qt::UserRole + 1).toStringList();
-
- for (int i = 0; i < chaptersList.count(); i++) {
- QDomElement chapter = doc.createElement("chapter");
- chapters.appendChild(chapter);
- chapter.setAttribute("title", i18n("Chapter %1", i));
- chapter.setAttribute("time", chaptersList.at(i));
- }
- // save chapters file
- QFile file(m_view.vob_list->currentText() + ".dvdchapter");
- if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
- kWarning() << "////// ERROR writing DVD CHAPTER file: " << m_view.vob_list->currentText() + ".dvdchapter";
- } else {
- file.write(doc.toString().toUtf8());
- if (file.error() != QFile::NoError)
- kWarning() << "////// ERROR writing DVD CHAPTER file: " << m_view.vob_list->currentText() + ".dvdchapter";
- else {
- m_view.vob_list->setItemData(m_view.vob_list->currentIndex(), 0, Qt::UserRole + 2);
- m_view.button_save->setEnabled(false);
- }
- file.close();
+ QDomElement xml = doc.createElement("xml");
+ doc.appendChild(xml);
+ for (int i = 0; i < m_view.vob_list->count(); i++) {
+ QDomElement vob = doc.createElement("vob");
+ vob.setAttribute("file", m_view.vob_list->itemText(i));
+ vob.setAttribute("chapters", m_view.vob_list->itemData(i, Qt::UserRole + 1).toStringList().join(";"));
+ xml.appendChild(vob);
}
+ return doc.documentElement();
}
virtual ~DvdWizardChapters();
virtual bool isComplete() const;
void changeProfile(bool isPal);
- void slotGetChaptersList(int ix);
void setPal(bool isPal);
- void setVobFiles(bool isPal, const QStringList movies, const QStringList durations);
+ void setVobFiles(bool isPal, const QStringList movies, const QStringList durations, const QStringList chapters);
QStringList selectedTitles() const;
QStringList selectedTargets() const;
QStringList chapters(int ix) const;
+ QDomElement toXml() const;
+ QMap <QString, QString> chaptersData() const;
private:
Ui::DvdWizardChapters_UI m_view;
void slotAddChapter();
void slotRemoveChapter();
void slotGoToChapter();
- void slotSaveChapter();
};
#endif
{
return m_isPal;
}
+
+QDomElement DvdWizardMenu::toXml() const
+{
+ QDomDocument doc;
+ if (!m_view.create_menu->isChecked()) return doc.documentElement();
+ QDomElement xml = doc.createElement("menu");
+ doc.appendChild(xml);
+ if (m_view.background_list->currentIndex() == 0) {
+ // Color bg
+ xml.setAttribute("background_color", m_view.background_color->color().name());
+ } else if (m_view.background_list->currentIndex() == 1) {
+ // Image bg
+ xml.setAttribute("background_image", m_view.background_image->text());
+ } else {
+ // Video bg
+ xml.setAttribute("background_video", m_view.background_image->text());
+ }
+ xml.setAttribute("text_color", m_view.text_color->color().name());
+ xml.setAttribute("selected_color", m_view.selected_color->color().name());
+ xml.setAttribute("highlighted_color", m_view.highlighted_color->color().name());
+
+ QList<QGraphicsItem *> list = m_scene->items();
+ int buttonCount = 0;
+
+ for (int i = 0; i < list.count(); i++) {
+ if (list.at(i)->type() == QGraphicsItem::UserType + 1) {
+ buttonCount++;
+ DvdButton *button = static_cast < DvdButton* >(list.at(i));
+ QDomElement xmlbutton = doc.createElement("button");
+ xmlbutton.setAttribute("target", button->target());
+ xmlbutton.setAttribute("command", button->command());
+ xmlbutton.setAttribute("backtomenu", button->backMenu());
+ xmlbutton.setAttribute("posx", button->pos().x());
+ xmlbutton.setAttribute("posy", button->pos().y());
+ xmlbutton.setAttribute("text", button->toPlainText());
+ QFont font = button->font();
+ xmlbutton.setAttribute("font_size", font.pixelSize());
+ xmlbutton.setAttribute("font_family", font.family());
+ xml.appendChild(xmlbutton);
+ }
+ }
+ return doc.documentElement();
+}
+
+
+void DvdWizardMenu::loadXml(QDomElement xml)
+{
+ kDebug() << "// LOADING MENU";
+ if (xml.isNull()) return;
+ kDebug() << "// LOADING MENU 1";
+ m_view.create_menu->setChecked(true) ;
+ if (xml.hasAttribute("background_color")) {
+ m_view.background_list->setCurrentIndex(0);
+ m_view.background_color->setColor(xml.attribute("background_color"));
+ } else if (xml.hasAttribute("background_image")) {
+ m_view.background_list->setCurrentIndex(1);
+ m_view.background_image->setPath(xml.attribute("background_image"));
+ } else if (xml.hasAttribute("background_video")) {
+ m_view.background_list->setCurrentIndex(2);
+ m_view.background_image->setPath(xml.attribute("background_video"));
+ }
+
+ m_view.text_color->setColor(xml.attribute("text_color"));
+ m_view.selected_color->setColor(xml.attribute("selected_color"));
+ m_view.highlighted_color->setColor(xml.attribute("highlighted_color"));
+
+ QDomNodeList buttons = xml.elementsByTagName("button");
+ kDebug() << "// LOADING MENU 2" << buttons.count();
+
+ if (buttons.count() > 0) {
+ // Clear existing buttons
+ QList<QGraphicsItem *> list = m_scene->items();
+
+ for (int i = 0; i < list.count(); i++) {
+ if (list.at(i)->type() == QGraphicsItem::UserType + 1) {
+ delete list.at(i);
+ i--;
+ }
+ }
+ }
+
+ for (int i = 0; i < buttons.count(); i++) {
+ QDomElement e = buttons.at(i).toElement();
+ // create menu button
+ DvdButton *button = new DvdButton(e.attribute("text"));
+ QFont font(e.attribute("font_family"));
+ font.setPixelSize(e.attribute("font_size").toInt());
+ font.setStyleStrategy(QFont::NoAntialias);
+ button->setFont(font);
+ button->setTarget(e.attribute("target").toInt(), e.attribute("command"));
+ button->setBackMenu(e.attribute("backtomenu").toInt());
+ button->setDefaultTextColor(m_view.text_color->color());
+ button->setZValue(4);
+ button->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
+ QRectF r = button->sceneBoundingRect();
+ m_scene->addItem(button);
+ button->setPos(e.attribute("posx").toDouble(), e.attribute("posy").toDouble());
+
+ }
+}
+
#include <QGraphicsTextItem>
#include <QGraphicsPixmapItem>
#include <QGraphicsRectItem>
+#include <QDomElement>
#include <KDebug>
QString menuMoviePath() const;
bool isPalMenu() const;
void changeProfile(bool isPal);
+ QDomElement toXml() const;
+ void loadXml(QDomElement xml);
private:
Ui::DvdWizardMenu_UI m_view;
}
-void DvdWizardVob::slotAddVobFile(KUrl url)
+void DvdWizardVob::slotAddVobFile(KUrl url, const QString &chapters)
{
if (url.isEmpty()) url = KFileDialog::getOpenUrl(KUrl("kfiledialog:///projectfolder"), "video/mpeg", this, i18n("Add new video file"));
if (url.isEmpty()) return;
QFile f(url.path());
qint64 fileSize = f.size();
QString profilename;
- if (m_view.dvd_profile->currentIndex() == 0) profilename = "dv_pal";
- else profilename = "dv_ntsc";
- Mlt::Profile profile((char*) profilename.data());
+ switch (m_view.dvd_profile->currentIndex()) {
+ case 1:
+ profilename = "dv_pal_wide";
+ break;
+ case 2:
+ profilename = "dv_ntsc";
+ break;
+ case 3:
+ profilename = "dv_ntsc_wide";
+ break;
+ default:
+ profilename = "dv_pal";
+ break;
+ }
+
+ char *tmp = (char*) qstrdup(profilename.toUtf8().data());
+ Mlt::Profile profile(tmp);
+ delete[] tmp;
QTreeWidgetItem *item = new QTreeWidgetItem(m_view.vobs_list, QStringList() << url.path() << QString() << KIO::convertSize(fileSize));
item->setData(0, Qt::UserRole, fileSize);
item->setIcon(0, KIcon("video-x-generic"));
QPixmap pix(60, 45);
- char *tmp = (char *) qstrdup(url.path().toUtf8().data());
+ tmp = (char *) qstrdup(url.path().toUtf8().data());
Mlt::Producer *producer = new Mlt::Producer(profile, tmp);
delete[] tmp;
}
delete producer;
+ if (chapters.isEmpty() == false) {
+ item->setData(1, Qt::UserRole + 1, chapters);
+ } else if (QFile::exists(url.path() + ".dvdchapter")) {
+ // insert chapters as children
+ QFile file(url.path() + ".dvdchapter");
+ if (file.open(QIODevice::ReadOnly)) {
+ QDomDocument doc;
+ doc.setContent(&file);
+ file.close();
+ QDomNodeList chapters = doc.elementsByTagName("chapter");
+ QStringList chaptersList;
+ for (int j = 0; j < chapters.count(); j++) {
+ chaptersList.append(QString::number(chapters.at(j).toElement().attribute("time").toInt()));
+ }
+ item->setData(1, Qt::UserRole + 1, chaptersList.join(";"));
+ }
+ }
+
slotCheckVobList();
}
{
int max = m_view.vobs_list->topLevelItemCount();
QString profilename;
- if (m_view.dvd_profile->currentIndex() == 0) profilename = "dv_pal";
- else profilename = "dv_ntsc";
- Mlt::Profile profile((char*) profilename.data());
+ switch (m_view.dvd_profile->currentIndex()) {
+ case 1:
+ profilename = "dv_pal_wide";
+ break;
+ case 2:
+ profilename = "dv_ntsc";
+ break;
+ case 3:
+ profilename = "dv_ntsc_wide";
+ break;
+ default:
+ profilename = "dv_pal";
+ break;
+ }
+
+ char *tmp = (char*) qstrdup(profilename.toUtf8().data());
+ Mlt::Profile profile(tmp);
+ delete[] tmp;
QPixmap pix(180, 135);
for (int i = 0; i < max; i++) {
QTreeWidgetItem *item = m_view.vobs_list->topLevelItem(i);
- char *tmp = (char *) qstrdup(item->text(0).toUtf8().data());
+ tmp = (char *) qstrdup(item->text(0).toUtf8().data());
Mlt::Producer *producer = new Mlt::Producer(profile, tmp);
delete[] tmp;
return result;
}
+QStringList DvdWizardVob::chapters() const
+{
+ QStringList result;
+ QString path;
+ int max = m_view.vobs_list->topLevelItemCount();
+ for (int i = 0; i < max; i++) {
+ QTreeWidgetItem *item = m_view.vobs_list->topLevelItem(i);
+ if (item) result.append(item->data(1, Qt::UserRole + 1).toString());
+ }
+ return result;
+}
+
+void DvdWizardVob::updateChapters(QMap <QString, QString> chaptersdata)
+{
+ int max = m_view.vobs_list->topLevelItemCount();
+ for (int i = 0; i < max; i++) {
+ QTreeWidgetItem *item = m_view.vobs_list->topLevelItem(i);
+ item->setData(1, Qt::UserRole + 1, chaptersdata.value(item->text(0)));
+ }
+}
+
int DvdWizardVob::duration(int ix) const
{
int result = -1;
return m_view.intro_vob->url().path();
}
+void DvdWizardVob::setIntroMovie(const QString path)
+{
+ m_view.intro_vob->setPath(path);
+ m_view.use_intro->setChecked(path.isEmpty() == false);
+}
+
+
void DvdWizardVob::slotCheckVobList()
{
emit completeChanged();
return (m_view.dvd_profile->currentIndex() == 1 || m_view.dvd_profile->currentIndex() == 3);
}
+void DvdWizardVob::setProfile(const QString profile)
+{
+ if (profile == "dv_pal") m_view.dvd_profile->setCurrentIndex(0);
+ else if (profile == "dv_pal_wide") m_view.dvd_profile->setCurrentIndex(1);
+ else if (profile == "dv_ntsc") m_view.dvd_profile->setCurrentIndex(2);
+ else if (profile == "dv_ntsc_wide") m_view.dvd_profile->setCurrentIndex(3);
+}
-
+void DvdWizardVob::clear()
+{
+ m_view.vobs_list->clear();
+}
\ No newline at end of file
bool isWide() const;
int duration(int ix) const;
QStringList durations() const;
+ QStringList chapters() const;
+ void setProfile(const QString profile);
+ void clear();
+ void updateChapters(QMap <QString, QString> chaptersdata);
+ void setIntroMovie(const QString path);
private:
Ui::DvdWizardVob_UI m_view;
KCapacityBar *m_capacityBar;
#endif
+public slots:
+ void slotAddVobFile(KUrl url = KUrl(), const QString &chapters = QString());
+
private slots:
void slotCheckVobList();
- void slotAddVobFile(KUrl url = KUrl());
void slotDeleteVobFile();
void slotItemUp();
void slotItemDown();
void MainWindow::parseProfiles(const QString &mltPath)
{
- //kdDebug()<<" + + YOUR MLT INSTALL WAS FOUND IN: "<< MLT_PREFIX <<endl;
+ // kDebug()<<" + + YOUR MLT INSTALL WAS FOUND IN: "<< MLT_PREFIX <<endl;
//KdenliveSettings::setDefaulttmpfolder();
if (!mltPath.isEmpty()) {
}
}
-void MainWindow::slotMaximizeCurrent(bool show)
+void MainWindow::slotMaximizeCurrent(bool /*show*/)
{
//TODO: is there a way to maximize current widget?
//if (show == true)