]> git.sesse.net Git - kdenlive/blob - src/dvdwizardvob.cpp
0d99f697a53446f0011383503aea5296b32f08dd
[kdenlive] / src / dvdwizardvob.cpp
1 /***************************************************************************
2  *   Copyright (C) 2009 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This program is distributed in the hope that it will be useful,       *
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
18  ***************************************************************************/
19
20 #include "dvdwizardvob.h"
21 #include "kthumb.h"
22 #include "timecode.h"
23 #include "cliptranscode.h"
24
25 #include <mlt++/Mlt.h>
26
27 #include <KUrlRequester>
28 #include <KDebug>
29 #include <KStandardDirs>
30 #include <KFileItem>
31 #include <KFileDialog>
32
33 #include <QHBoxLayout>
34 #include <QDomDocument>
35 #include <QTreeWidgetItem>
36 #include <QHeaderView>
37
38 DvdTreeWidget::DvdTreeWidget(QWidget *parent) :
39         QTreeWidget(parent)
40 {
41     setAcceptDrops(true);
42 }
43
44 void DvdTreeWidget::dragEnterEvent(QDragEnterEvent * event ) {
45     if (event->mimeData()->hasUrls()) {
46         event->setDropAction(Qt::CopyAction);
47         event->setAccepted(true);
48     }
49     else QTreeWidget::dragEnterEvent(event);
50 }
51
52 void DvdTreeWidget::dragMoveEvent(QDragMoveEvent * event) {
53        event->acceptProposedAction();
54 }
55
56 void DvdTreeWidget::mouseDoubleClickEvent( QMouseEvent * )
57 {
58     emit addNewClip();
59 }
60
61 void DvdTreeWidget::dropEvent(QDropEvent * event ) {
62     QList<QUrl> clips = event->mimeData()->urls();
63     event->accept();
64     emit addClips(clips);
65 }
66
67 DvdWizardVob::DvdWizardVob(QWidget *parent) :
68         QWizardPage(parent),
69         m_installCheck(true)
70 {
71     m_view.setupUi(this);
72     m_view.button_add->setIcon(KIcon("list-add"));
73     m_view.button_delete->setIcon(KIcon("list-remove"));
74     m_view.button_up->setIcon(KIcon("go-up"));
75     m_view.button_down->setIcon(KIcon("go-down"));
76     m_vobList = new DvdTreeWidget(this);
77     QVBoxLayout *lay1 = new QVBoxLayout;
78     lay1->addWidget(m_vobList);
79     m_view.list_frame->setLayout(lay1);
80     m_vobList->setColumnCount(3);
81     m_vobList->setHeaderHidden(true);
82
83     connect(m_vobList, SIGNAL(addClips(QList<QUrl>)), this, SLOT(slotAddVobList(QList<QUrl>)));
84     connect(m_vobList, SIGNAL(addNewClip()), this, SLOT(slotAddVobFile()));
85     connect(m_view.button_add, SIGNAL(clicked()), this, SLOT(slotAddVobFile()));
86     connect(m_view.button_delete, SIGNAL(clicked()), this, SLOT(slotDeleteVobFile()));
87     connect(m_view.button_up, SIGNAL(clicked()), this, SLOT(slotItemUp()));
88     connect(m_view.button_down, SIGNAL(clicked()), this, SLOT(slotItemDown()));
89     connect(m_vobList, SIGNAL(itemSelectionChanged()), this, SLOT(slotCheckVobList()));
90     
91     m_vobList->setIconSize(QSize(60, 45));
92
93     if (KStandardDirs::findExe("dvdauthor").isEmpty()) m_errorMessage.append(i18n("<strong>Program %1 is required for the DVD wizard.</strong>", i18n("dvdauthor")));
94     if (KStandardDirs::findExe("mkisofs").isEmpty() && KStandardDirs::findExe("genisoimage").isEmpty()) m_errorMessage.append(i18n("<strong>Program %1 or %2 is required for the DVD wizard.</strong>", i18n("mkisofs"), i18n("genisoimage")));
95     if (m_errorMessage.isEmpty()) m_view.error_message->setVisible(false);
96     else {
97         m_view.error_message->setText(m_errorMessage);
98         m_installCheck = false;
99     }
100
101     m_view.dvd_profile->addItems(QStringList() << i18n("PAL 4:3") << i18n("PAL 16:9") << i18n("NTSC 4:3") << i18n("NTSC 16:9"));
102
103     connect(m_view.dvd_profile, SIGNAL(activated(int)), this, SLOT(slotCheckProfiles()));
104     m_vobList->header()->setStretchLastSection(false);
105     m_vobList->header()->setResizeMode(0, QHeaderView::Stretch);
106     m_vobList->header()->setResizeMode(1, QHeaderView::Custom);
107     m_vobList->header()->setResizeMode(2, QHeaderView::Custom);
108
109     m_capacityBar = new KCapacityBar(KCapacityBar::DrawTextInline, this);
110     QHBoxLayout *lay = new QHBoxLayout;
111     lay->addWidget(m_capacityBar);
112     m_view.size_box->setLayout(lay);
113
114     m_vobList->setItemDelegate(new DvdViewDelegate(m_vobList));
115     m_transcodeAction = new QAction(i18n("Transcode"), this);
116     connect(m_transcodeAction, SIGNAL(triggered()), this, SLOT(slotTranscodeFiles()));
117
118 #if KDE_IS_VERSION(4,7,0)
119     m_warnMessage = new KMessageWidget;
120     m_warnMessage->setMessageType(KMessageWidget::Warning);
121     m_warnMessage->setText(i18n("Your clips do not match selected DVD format, transcoding required."));
122     m_warnMessage->setCloseButtonVisible(false);
123     m_warnMessage->addAction(m_transcodeAction);
124     QGridLayout *s =  static_cast <QGridLayout*> (layout());
125     s->addWidget(m_warnMessage, 3, 0, 1, -1);
126     m_warnMessage->hide();
127     m_view.button_transcode->setHidden(true);
128 #else
129     m_view.button_transcode->setDefaultAction(m_transcodeAction);
130     m_view.button_transcode->setEnabled(false);
131 #endif
132     
133     slotCheckVobList();
134 }
135
136 DvdWizardVob::~DvdWizardVob()
137 {
138     delete m_capacityBar;
139 }
140
141 void DvdWizardVob::slotCheckProfiles()
142 {
143     bool conflict = false;
144     int comboProfile = m_view.dvd_profile->currentIndex();
145     for (int i = 0; i < m_vobList->topLevelItemCount(); i++) {
146         QTreeWidgetItem *item = m_vobList->topLevelItem(i);
147         if (item->data(0, Qt::UserRole + 1).toInt() != comboProfile) {
148             conflict = true;
149             break;
150         }
151     }
152     m_transcodeAction->setEnabled(conflict);
153     if (conflict) {
154         showProfileError();
155     }
156     else {
157 #if KDE_IS_VERSION(4,7,0)      
158         m_warnMessage->animatedHide();
159 #else
160         if (m_installCheck) m_view.error_message->setVisible(false);
161 #endif
162     }
163 }
164
165 void DvdWizardVob::slotAddVobList(QList <QUrl>list)
166 {
167     foreach (const QUrl url, list) {
168         slotAddVobFile(KUrl(url), QString(), false);
169     }
170     slotCheckVobList();
171     slotCheckProfiles();
172 }
173
174 void DvdWizardVob::slotAddVobFile(KUrl url, const QString &chapters, bool checkFormats)
175 {
176     if (url.isEmpty()) url = KFileDialog::getOpenUrl(KUrl("kfiledialog:///projectfolder"), "video/mpeg", this, i18n("Add new video file"));
177     if (url.isEmpty()) return;
178     QFile f(url.path());
179     qint64 fileSize = f.size();
180
181     Mlt::Profile profile;
182     profile.set_explicit(false);
183     QTreeWidgetItem *item = new QTreeWidgetItem(m_vobList, QStringList() << url.path() << QString() << KIO::convertSize(fileSize));
184     item->setData(2, Qt::UserRole, fileSize);
185     item->setData(0, Qt::DecorationRole, KIcon("video-x-generic").pixmap(60, 45));
186     item->setToolTip(0, url.path());
187
188     QString resource = url.path();
189     resource.prepend("avformat:");
190     Mlt::Producer *producer = new Mlt::Producer(profile, resource.toUtf8().data());
191     if (producer && producer->is_valid() && !producer->is_blank()) {
192         //Mlt::Frame *frame = producer->get_frame();
193         //delete frame;
194         profile.from_producer(*producer);
195         int width = 45.0 * profile.dar();
196         int swidth = 45.0 * profile.width() / profile.height();
197         if (width % 2 == 1) width++;
198         item->setData(0, Qt::DecorationRole, QPixmap::fromImage(KThumb::getFrame(producer, 0, swidth, width, 45)));
199         int playTime = producer->get_playtime();
200         item->setText(1, Timecode::getStringTimecode(playTime, profile.fps()));
201         item->setData(1, Qt::UserRole, playTime);
202         int standard = -1;
203         int aspect = profile.dar() * 100;
204         if (profile.height() == 576) {
205             if (aspect > 150) standard = 1;
206             else standard = 0;
207         }
208         else if (profile.height() == 480) {
209             if (aspect > 150) standard = 3;
210             else standard = 2;
211         }
212         QString standardName;
213         switch (standard) {
214           case 3:
215               standardName = i18n("NTSC 16:9");
216               break;
217           case 2:
218               standardName = i18n("NTSC 4:3");
219               break;
220           case 1:
221               standardName = i18n("PAL 16:9");
222               break;
223           case 0:
224               standardName = i18n("PAL 4:3");
225               break;
226           default:
227               standardName = i18n("Unknown");
228         }
229         item->setData(0, Qt::UserRole, standardName);
230         item->setData(0, Qt::UserRole + 1, standard);
231         item->setData(0, Qt::UserRole + 2, QSize(profile.dar() * profile.height(), profile.height()));
232         if (m_vobList->topLevelItemCount() == 1) {
233             // This is the first added movie, auto select DVD format
234             if (standard >= 0) {
235                 m_view.dvd_profile->blockSignals(true);
236                 m_view.dvd_profile->setCurrentIndex(standard);
237                 m_view.dvd_profile->blockSignals(false);
238             }
239         }
240         
241     }
242     else {
243         // Cannot load movie, reject
244         showError(i18n("The clip %1 is invalid.", url.fileName()));
245     }
246     if (producer) delete producer;
247
248     if (chapters.isEmpty() == false) {
249         item->setData(1, Qt::UserRole + 1, chapters);
250     }
251     else if (QFile::exists(url.path() + ".dvdchapter")) {
252         // insert chapters as children
253         QFile file(url.path() + ".dvdchapter");
254         if (file.open(QIODevice::ReadOnly)) {
255             QDomDocument doc;
256             if (doc.setContent(&file) == false) {
257                 file.close();
258                 return;
259             }
260             file.close();
261             QDomNodeList chapters = doc.elementsByTagName("chapter");
262             QStringList chaptersList;
263             for (int j = 0; j < chapters.count(); j++) {
264                 chaptersList.append(QString::number(chapters.at(j).toElement().attribute("time").toInt()));
265             }
266             item->setData(1, Qt::UserRole + 1, chaptersList.join(";"));
267         }
268     } else // Explicitly add a chapter at 00:00:00:00
269         item->setData(1, Qt::UserRole + 1, "0");
270
271     if (checkFormats) {
272         slotCheckVobList();
273         slotCheckProfiles();
274     }
275 }
276
277 void DvdWizardVob::slotDeleteVobFile()
278 {
279     QTreeWidgetItem *item = m_vobList->currentItem();
280     if (item == NULL) return;
281     delete item;
282     slotCheckVobList();
283     slotCheckProfiles();
284 }
285
286
287 // virtual
288 bool DvdWizardVob::isComplete() const
289 {
290     if (!m_installCheck) return false;
291     if (m_vobList->topLevelItemCount() == 0) return false;
292     return true;
293 }
294
295 void DvdWizardVob::setUrl(const QString &url)
296 {
297     slotAddVobFile(KUrl(url));
298 }
299
300 QStringList DvdWizardVob::selectedUrls() const
301 {
302     QStringList result;
303     QString path;
304     int max = m_vobList->topLevelItemCount();
305     int i = 0;
306     if (m_view.use_intro->isChecked()) {
307         // First movie is only for intro
308         i = 1;
309     }
310     for (; i < max; i++) {
311         QTreeWidgetItem *item = m_vobList->topLevelItem(i);
312         if (item) result.append(item->text(0));
313     }
314     return result;
315 }
316
317
318 QStringList DvdWizardVob::durations() const
319 {
320     QStringList result;
321     QString path;
322     int max = m_vobList->topLevelItemCount();
323     for (int i = 0; i < max; i++) {
324         QTreeWidgetItem *item = m_vobList->topLevelItem(i);
325         if (item) result.append(QString::number(item->data(1, Qt::UserRole).toInt()));
326     }
327     return result;
328 }
329
330 QStringList DvdWizardVob::chapters() const
331 {
332     QStringList result;
333     QString path;
334     int max = m_vobList->topLevelItemCount();
335     for (int i = 0; i < max; i++) {
336         QTreeWidgetItem *item = m_vobList->topLevelItem(i);
337         if (item) {
338             result.append(item->data(1, Qt::UserRole + 1).toString());
339         }
340     }
341     return result;
342 }
343
344 void DvdWizardVob::updateChapters(QMap <QString, QString> chaptersdata)
345 {
346     int max = m_vobList->topLevelItemCount();
347     for (int i = 0; i < max; i++) {
348         QTreeWidgetItem *item = m_vobList->topLevelItem(i);
349         if (chaptersdata.contains(item->text(0))) item->setData(1, Qt::UserRole + 1, chaptersdata.value(item->text(0)));
350     }
351 }
352
353 int DvdWizardVob::duration(int ix) const
354 {
355     int result = -1;
356     QTreeWidgetItem *item = m_vobList->topLevelItem(ix);
357     if (item) {
358         result = item->data(1, Qt::UserRole).toInt();
359     }
360     return result;
361 }
362
363 const QString DvdWizardVob::introMovie() const
364 {
365     QString url;
366     if (m_view.use_intro->isChecked() && m_vobList->topLevelItemCount() > 0) url = m_vobList->topLevelItem(0)->text(0);
367     return url;
368 }
369
370 void DvdWizardVob::setUseIntroMovie(bool use)
371 {
372     m_view.use_intro->setChecked(use);
373 }
374
375 void DvdWizardVob::slotCheckVobList()
376 {
377     emit completeChanged();
378     int max = m_vobList->topLevelItemCount();
379     QTreeWidgetItem *item = m_vobList->currentItem();
380     bool hasItem = true;
381     if (item == NULL) hasItem = false;
382     m_view.button_delete->setEnabled(hasItem);
383     if (hasItem && m_vobList->indexOfTopLevelItem(item) == 0) m_view.button_up->setEnabled(false);
384     else m_view.button_up->setEnabled(hasItem);
385     if (hasItem && m_vobList->indexOfTopLevelItem(item) == max - 1) m_view.button_down->setEnabled(false);
386     else m_view.button_down->setEnabled(hasItem);
387
388     qint64 totalSize = 0;
389     for (int i = 0; i < max; i++) {
390         item = m_vobList->topLevelItem(i);
391         if (item) totalSize += (qint64) item->data(2, Qt::UserRole).toInt();
392     }
393
394     qint64 maxSize = (qint64) 47000 * 100000;
395     m_capacityBar->setValue(100 * totalSize / maxSize);
396     m_capacityBar->setText(KIO::convertSize(totalSize));
397 }
398
399 void DvdWizardVob::slotItemUp()
400 {
401     QTreeWidgetItem *item = m_vobList->currentItem();
402     if (item == NULL) return;
403     int index = m_vobList->indexOfTopLevelItem(item);
404     if (index == 0) return;
405     m_vobList->insertTopLevelItem(index - 1, m_vobList->takeTopLevelItem(index));
406 }
407
408 void DvdWizardVob::slotItemDown()
409 {
410     int max = m_vobList->topLevelItemCount();
411     QTreeWidgetItem *item = m_vobList->currentItem();
412     if (item == NULL) return;
413     int index = m_vobList->indexOfTopLevelItem(item);
414     if (index == max - 1) return;
415     m_vobList->insertTopLevelItem(index + 1, m_vobList->takeTopLevelItem(index));
416 }
417
418 DVDFORMAT DvdWizardVob::dvdFormat() const
419 {
420     return (DVDFORMAT) m_view.dvd_profile->currentIndex();
421 }
422
423 const QString DvdWizardVob::dvdProfile() const
424 {
425     QString profile;
426     switch (m_view.dvd_profile->currentIndex()) {
427         case PAL_WIDE:
428             profile = "dv_pal_wide";
429             break;
430         case NTSC:
431             profile = "dv_ntsc";
432             break;
433         case NTSC_WIDE:
434             profile = "dv_ntsc_wide";
435             break;
436         default:
437             profile = "dv_pal";
438     }
439     return profile;
440 }
441
442 //static
443 QString DvdWizardVob::getDvdProfile(DVDFORMAT format)
444 {
445     QString profile;
446     switch (format) {
447         case PAL_WIDE:
448             profile = "dv_pal_wide";
449             break;
450         case NTSC:
451             profile = "dv_ntsc";
452             break;
453         case NTSC_WIDE:
454             profile = "dv_ntsc_wide";
455             break;
456         default:
457             profile = "dv_pal";
458     }
459     return profile;
460 }
461
462 void DvdWizardVob::setProfile(const QString& profile)
463 {
464     if (profile == "dv_pal_wide") m_view.dvd_profile->setCurrentIndex(PAL_WIDE);
465     else if (profile == "dv_ntsc") m_view.dvd_profile->setCurrentIndex(NTSC);
466     else if (profile == "dv_ntsc_wide") m_view.dvd_profile->setCurrentIndex(NTSC_WIDE);
467     else m_view.dvd_profile->setCurrentIndex(PAL);
468 }
469
470 void DvdWizardVob::clear()
471 {
472     m_vobList->clear();
473 }
474
475 void DvdWizardVob::slotTranscodeFiles()
476 {
477     // Find transcoding infos related to selected DVD profile
478     KSharedConfigPtr config = KSharedConfig::openConfig("kdenlivetranscodingrc", KConfig::CascadeConfig);
479     KConfigGroup transConfig(config, "Transcoding");
480     // read the entries
481     QString profileEasyName;
482     QSize destSize;
483     QSize finalSize;
484     switch (m_view.dvd_profile->currentIndex()) {
485         case PAL_WIDE:
486             profileEasyName = "DVD PAL 16:9";
487             destSize = QSize(1024, 576);
488             finalSize = QSize(720, 576);
489             break;
490         case NTSC:
491             profileEasyName = "DVD NTSC 4:3";
492             destSize = QSize(640, 480);
493             finalSize = QSize(720, 480);
494             break;
495         case NTSC_WIDE:
496             profileEasyName = "DVD NTSC 16:9";
497             destSize = QSize(853, 480);
498             finalSize = QSize(720, 480);
499             break;
500         default:
501             profileEasyName = "DVD PAL 4:3";
502             destSize = QSize(768, 576);
503             finalSize = QSize(720, 576);
504     }
505     QString params = transConfig.readEntry(profileEasyName);    
506   
507     // Transcode files that do not match selected profile
508     int max = m_vobList->topLevelItemCount();
509     int format = m_view.dvd_profile->currentIndex();
510     for (int i = 0; i < max; i++) {
511         QTreeWidgetItem *item = m_vobList->topLevelItem(i);
512         if (item->data(0, Qt::UserRole + 1).toInt() != format) {
513             // File needs to be transcoded
514             m_transcodeAction->setEnabled(false);
515             QSize original = item->data(0, Qt::UserRole + 2).toSize();
516             double input_aspect= (double) original.width() / original.height();
517             QStringList postParams;
518             if (input_aspect > (double) destSize.width() / destSize.height()) {
519                 // letterboxing
520                 int conv_height = (int) (destSize.width() / input_aspect);
521                 int conv_pad = (int) (((double) (destSize.height() - conv_height)) / 2.0);
522                 if (conv_pad %2 == 1) conv_pad --;
523                 postParams << "-vf" << QString("scale=%1:%2,pad=%3:%4:0:%5,setdar=%6").arg(finalSize.width()).arg(destSize.height() - 2 * conv_pad).arg(finalSize.width()).arg(finalSize.height()).arg(conv_pad).arg(input_aspect);
524             } else {
525                 // pillarboxing
526                 int conv_width = (int) (destSize.height() * input_aspect);
527                 int conv_pad = (int) (((double) (destSize.width() - conv_width)) / destSize.width() * finalSize.width() / 2.0);
528                 if (conv_pad %2 == 1) conv_pad --;
529                 postParams << "-vf" << QString("scale=%1:%2,pad=%3:%4:%5:0,setdar=%6").arg(finalSize.width() - 2 * conv_pad).arg(destSize.height()).arg(finalSize.width()).arg(finalSize.height()).arg(conv_pad).arg(input_aspect);
530             }
531             ClipTranscode *d = new ClipTranscode(KUrl::List () << KUrl(item->text(0)), params.section(';', 0, 0), postParams, i18n("Transcoding to DVD format"), true, this);
532             connect(d, SIGNAL(transcodedClip(KUrl,KUrl)), this, SLOT(slotTranscodedClip(KUrl, KUrl)));
533             d->show();
534         }
535     }
536 }
537
538 void DvdWizardVob::slotTranscodedClip(KUrl src, KUrl transcoded)
539 {
540     int max = m_vobList->topLevelItemCount();
541     for (int i = 0; i < max; i++) {
542         QTreeWidgetItem *item = m_vobList->topLevelItem(i);
543         if (KUrl(item->text(0)).path() == src.path()) {
544             // Replace movie with transcoded version
545             item->setText(0, transcoded.path());
546
547             QFile f(transcoded.path());
548             qint64 fileSize = f.size();
549
550             Mlt::Profile profile;
551             profile.set_explicit(false);
552             item->setText(2, KIO::convertSize(fileSize));
553             item->setData(2, Qt::UserRole, fileSize);
554             item->setData(0, Qt::DecorationRole, KIcon("video-x-generic").pixmap(60, 45));
555             item->setToolTip(0, transcoded.path());
556
557             QString resource = transcoded.path();
558             resource.prepend("avformat:");
559             Mlt::Producer *producer = new Mlt::Producer(profile, resource.toUtf8().data());
560             if (producer && producer->is_valid() && !producer->is_blank()) {
561                 profile.from_producer(*producer);
562                 int width = 45.0 * profile.dar();
563                 int swidth = 45.0 * profile.width() / profile.height();
564                 if (width % 2 == 1) width++;
565                 item->setData(0, Qt::DecorationRole, QPixmap::fromImage(KThumb::getFrame(producer, 0, swidth, width, 45)));
566                 int playTime = producer->get_playtime();
567                 item->setText(1, Timecode::getStringTimecode(playTime, profile.fps()));
568                 item->setData(1, Qt::UserRole, playTime);
569                 int standard = -1;
570                 int aspect = profile.dar() * 100;
571                 if (profile.height() == 576) {
572                     if (aspect > 150) standard = 1;
573                     else standard = 0;
574                 }
575                 else if (profile.height() == 480) {
576                     if (aspect > 150) standard = 3;
577                     else standard = 2;
578                 }
579                 QString standardName;
580                 switch (standard) {
581                   case 3:
582                       standardName = i18n("NTSC 16:9");
583                       break;
584                   case 2:
585                       standardName = i18n("NTSC 4:3");
586                       break;
587                   case 1:
588                       standardName = i18n("PAL 16:9");
589                       break;
590                   case 0:
591                       standardName = i18n("PAL 4:3");
592                       break;
593                   default:
594                       standardName = i18n("Unknown");
595                 }
596                 item->setData(0, Qt::UserRole, standardName);
597                 item->setData(0, Qt::UserRole + 1, standard);
598                 item->setData(0, Qt::UserRole + 2, QSize(profile.dar() * profile.height(), profile.height()));
599             }
600             else {
601                 // Cannot load movie, reject
602                 showError(i18n("The clip %1 is invalid.", transcoded.fileName()));
603             }
604             if (producer) delete producer;
605             slotCheckVobList();
606             slotCheckProfiles();
607             break;
608         }
609     }
610 }
611
612 void DvdWizardVob::showProfileError()
613 {
614 #if KDE_IS_VERSION(4,7,0)
615     m_warnMessage->setText(i18n("Your clips do not match selected DVD format, transcoding required."));
616     m_warnMessage->setCloseButtonVisible(false);
617     m_warnMessage->addAction(m_transcodeAction);
618     m_warnMessage->animatedShow();
619 #else
620     m_view.error_message->setText(i18n("Your clips do not match selected DVD format, transcoding required."));
621     m_view.error_message->setVisible(true);
622 #endif
623 }
624
625 void DvdWizardVob::showError(const QString error)
626 {
627 #if KDE_IS_VERSION(4,7,0)
628     m_warnMessage->setText(error);
629     m_warnMessage->setCloseButtonVisible(true);
630     m_warnMessage->removeAction(m_transcodeAction);
631     m_warnMessage->animatedShow();
632 #else
633     m_view.error_message->setText(error);
634     m_view.error_message->setVisible(true);
635 #endif    
636 }