addtrackcommand.cpp
changetrackcommand.cpp
movegroupcommand.cpp
+ dvdwizardvob.cpp
dvdwizard.cpp
)
DvdWizard::DvdWizard(const QString &url, const QString &profile, QWidget *parent): QWizard(parent), m_profile(profile) {
//setPixmap(QWizard::WatermarkPixmap, QPixmap(KStandardDirs::locate("appdata", "banner.png")));
setAttribute(Qt::WA_DeleteOnClose);
- QWizardPage *page1 = new QWizardPage;
- page1->setTitle(i18n("Select Files For Your Dvd"));
- m_vob.setupUi(page1);
- addPage(page1);
- m_vob.intro_vob->setEnabled(false);
- m_vob.vob_1->setFilter("video/mpeg");
- m_vob.intro_vob->setFilter("video/mpeg");
- connect(m_vob.use_intro, SIGNAL(toggled(bool)), m_vob.intro_vob, SLOT(setEnabled(bool)));
- connect(m_vob.vob_1, SIGNAL(textChanged(const QString &)), this, SLOT(slotCheckVobList(const QString &)));
- if (!url.isEmpty()) m_vob.vob_1->setPath(url);
+ m_pageVob = new DvdWizardVob(this);
+ m_pageVob->setTitle(i18n("Select Files For Your Dvd"));
+ addPage(m_pageVob);
+
+ if (!url.isEmpty()) m_pageVob->setUrl(url);
m_width = 720;
if (m_profile.startsWith("dv_pal")) m_height = 576;
}
}
-void DvdWizard::slotCheckVobList(const QString &text) {
- QList<KUrlRequester *> allUrls = m_vob.vob_list->findChildren<KUrlRequester *>();
- int count = allUrls.count();
- kDebug() << "// FOUND " << count << " URLS";
- if (count == 1) {
- if (text.isEmpty()) return;
- // insert second urlrequester
- KUrlRequester *vob = new KUrlRequester(this);
- vob->setFilter("video/mpeg");
- m_vob.vob_list->layout()->addWidget(vob);
- connect(vob, SIGNAL(textChanged(const QString &)), this, SLOT(slotCheckVobList(const QString &)));
- } else if (text.isEmpty()) {
- if (allUrls.at(count - 1)->url().path().isEmpty() && allUrls.at(count - 2)->url().path().isEmpty()) {
- // The last 2 urlrequesters are empty, remove last one
- KUrlRequester *vob = allUrls.takeLast();
- delete vob;
- }
- } else {
- if (allUrls.at(count - 1)->url().path().isEmpty()) return;
- KUrlRequester *vob = new KUrlRequester(this);
- vob->setFilter("video/mpeg");
- m_vob.vob_list->layout()->addWidget(vob);
- connect(vob, SIGNAL(textChanged(const QString &)), this, SLOT(slotCheckVobList(const QString &)));
- }
-}
-
void DvdWizard::buildColor() {
m_color->setBrush(m_menu.background_color->color());
}
post.appendChild(call);
pgc2.appendChild(post);
}
- QList<KUrlRequester *> allUrls = m_vob.vob_list->findChildren<KUrlRequester *>();
- for (int i = 0; i < allUrls.count(); i++) {
- if (!allUrls.at(i)->url().path().isEmpty()) {
+
+ QStringList voburls = m_pageVob->selectedUrls();
+ for (int i = 0; i < voburls.count(); i++) {
+ if (!voburls.at(i).isEmpty()) {
// Add vob entry
QDomElement vob = dvddoc.createElement("vob");
- vob.setAttribute("file", allUrls.at(i)->url().path());
+ vob.setAttribute("file", voburls.at(i));
pgc2.appendChild(vob);
}
}
#include <KDebug>
#include <KTemporaryFile>
-#include "ui_dvdwizardvob_ui.h"
+#include "dvdwizardvob.h"
#include "ui_dvdwizardmenu_ui.h"
#include "ui_dvdwizardiso_ui.h"
#include "ui_dvdwizardstatus_ui.h"
virtual ~DvdWizard();
private:
- Ui::DvdWizardVob_UI m_vob;
+ DvdWizardVob *m_pageVob;
Ui::DvdWizardMenu_UI m_menu;
Ui::DvdWizardIso_UI m_iso;
Ui::DvdWizardStatus_UI m_status;
KTemporaryFile m_authorFile;
private slots:
- void slotCheckVobList(const QString &text);
void buildButton();
void buildColor();
void buildImage();
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2009 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
+ ***************************************************************************/
+
+#include <KUrlRequester>
+#include <KDebug>
+
+#include "dvdwizardvob.h"
+
+DvdWizardVob::DvdWizardVob(QWidget *parent): QWizardPage(parent) {
+ m_view.setupUi(this);
+ m_view.intro_vob->setEnabled(false);
+ m_view.vob_1->setFilter("video/mpeg");
+ m_view.intro_vob->setFilter("video/mpeg");
+ connect(m_view.use_intro, SIGNAL(toggled(bool)), m_view.intro_vob, SLOT(setEnabled(bool)));
+ connect(m_view.vob_1, SIGNAL(textChanged(const QString &)), this, SLOT(slotCheckVobList(const QString &)));
+
+}
+
+DvdWizardVob::~DvdWizardVob() {
+ QList<KUrlRequester *> allUrls = m_view.vob_list->findChildren<KUrlRequester *>();
+ qDeleteAll(allUrls);
+}
+
+// virtual
+
+bool DvdWizardVob::isComplete() const {
+ if (m_view.vob_1->url().path().isEmpty()) return false;
+ if (QFile::exists(m_view.vob_1->url().path())) return true;
+ return false;
+}
+
+void DvdWizardVob::setUrl(const QString &url) {
+ m_view.vob_1->setPath(url);
+}
+
+QStringList DvdWizardVob::selectedUrls() const {
+ QStringList result;
+ QList<KUrlRequester *> allUrls = m_view.vob_list->findChildren<KUrlRequester *>();
+ for (int i = 0; i < allUrls.count(); i++) {
+ if (!allUrls.at(i)->url().path().isEmpty()) {
+ result.append(allUrls.at(i)->url().path());
+ }
+ }
+}
+
+void DvdWizardVob::slotCheckVobList(const QString &text) {
+ emit completeChanged();
+ QList<KUrlRequester *> allUrls = m_view.vob_list->findChildren<KUrlRequester *>();
+ int count = allUrls.count();
+ kDebug() << "// FOUND " << count << " URLS";
+ if (count == 1) {
+ if (text.isEmpty()) return;
+ // insert second urlrequester
+ KUrlRequester *vob = new KUrlRequester(this);
+ vob->setFilter("video/mpeg");
+ m_view.vob_list->layout()->addWidget(vob);
+ connect(vob, SIGNAL(textChanged(const QString &)), this, SLOT(slotCheckVobList(const QString &)));
+ } else if (text.isEmpty()) {
+ if (allUrls.at(count - 1)->url().path().isEmpty() && allUrls.at(count - 2)->url().path().isEmpty()) {
+ // The last 2 urlrequesters are empty, remove last one
+ KUrlRequester *vob = allUrls.takeLast();
+ delete vob;
+ }
+ } else {
+ if (allUrls.at(count - 1)->url().path().isEmpty()) return;
+ KUrlRequester *vob = new KUrlRequester(this);
+ vob->setFilter("video/mpeg");
+ m_view.vob_list->layout()->addWidget(vob);
+ connect(vob, SIGNAL(textChanged(const QString &)), this, SLOT(slotCheckVobList(const QString &)));
+ }
+}
+
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2009 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
+ ***************************************************************************/
+
+
+#ifndef DVDWIZARDVOB_H
+#define DVDWIZARDVOB_H
+
+#include <QWizardPage>
+
+#include "ui_dvdwizardvob_ui.h"
+
+class DvdWizardVob : public QWizardPage {
+ Q_OBJECT
+
+public:
+ DvdWizardVob(QWidget * parent = 0);
+ virtual ~DvdWizardVob();
+ virtual bool isComplete() const;
+ QStringList selectedUrls() const;
+ void setUrl(const QString &url);
+
+private:
+ Ui::DvdWizardVob_UI m_view;
+
+private slots:
+ void slotCheckVobList(const QString &text);
+};
+
+#endif
+
collection->addAction("monitor_loop_zone", m_loopZone);
connect(m_loopZone, SIGNAL(triggered(bool)), m_monitorManager, SLOT(slotLoopZone()));
- KAction *dvdWizard = collection->addAction("dvd_wizard");
- dvdWizard->setText(i18n("Dvd Wizard"));
+ KAction *dvdWizard = new KAction(KIcon("media-optical"), i18n("Dvd Wizard"), this);
+ collection->addAction("dvd_wizard", dvdWizard);
connect(dvdWizard, SIGNAL(triggered(bool)), this, SLOT(slotDvdWizard()));
KAction *markIn = collection->addAction("mark_in");