+ m_view.show_thumbs->setChecked(KdenliveSettings::showslideshowthumbs());
+
+ connect(m_view.folder_url, SIGNAL(textChanged(QString)), this, SLOT(parseFolder()));
+ connect(m_view.image_type, SIGNAL(currentIndexChanged(int)), this, SLOT(parseFolder()));
+ connect(m_view.pattern_url, SIGNAL(textChanged(QString)), this, SLOT(parseFolder()));
+
+ connect(m_view.show_thumbs, SIGNAL(stateChanged(int)), this, SLOT(slotEnableThumbs(int)));
+ connect(m_view.slide_fade, SIGNAL(stateChanged(int)), this, SLOT(slotEnableLuma(int)));
+ connect(m_view.luma_fade, SIGNAL(stateChanged(int)), this, SLOT(slotEnableLumaFile(int)));
+
+ //WARNING: keep in sync with clipproperties.cpp
+ m_view.image_type->addItem("JPG (*.jpg)", "jpg");
+ m_view.image_type->addItem("JPEG (*.jpeg)", "jpeg");
+ m_view.image_type->addItem("PNG (*.png)", "png");
+ m_view.image_type->addItem("BMP (*.bmp)", "bmp");
+ m_view.image_type->addItem("GIF (*.gif)", "gif");
+ m_view.image_type->addItem("TGA (*.tga)", "tga");
+ m_view.image_type->addItem("TIF (*.tif)", "tif");
+ m_view.image_type->addItem("TIFF (*.tiff)", "tiff");
+ m_view.image_type->addItem("Open EXR (*.exr)", "exr");
+ m_view.animation->addItem(i18n("None"), QString());
+ m_view.animation->addItem(i18n("Pan"), "Pan");
+ m_view.animation->addItem(i18n("Pan, low-pass"), "Pan, low-pass");
+ m_view.animation->addItem(i18n("Pan and zoom"), "Pan and zoom");
+ m_view.animation->addItem(i18n("Pan and zoom, low-pass"), "Pan and zoom, low-pass");
+ m_view.animation->addItem(i18n("Zoom"), "Zoom");
+ m_view.animation->addItem(i18n("Zoom, low-pass"), "Zoom, low-pass");
+
+ m_view.clip_duration->setInputMask(m_timecode.mask());
+ m_view.luma_duration->setInputMask(m_timecode.mask());
+ m_view.luma_duration->setText(m_timecode.getTimecodeFromFrames(int(ceil(m_timecode.fps()))));
+ m_view.folder_url->setUrl(QDir::homePath());
+
+ m_view.clip_duration_format->addItem(i18n("hh:mm:ss:ff"));
+ m_view.clip_duration_format->addItem(i18n("Frames"));
+ connect(m_view.clip_duration_format, SIGNAL(activated(int)), this, SLOT(slotUpdateDurationFormat(int)));
+ m_view.clip_duration_frames->setHidden(true);
+ m_view.luma_duration_frames->setHidden(true);
+ m_view.method_mime->setChecked(KdenliveSettings::slideshowbymime());
+ connect(m_view.method_mime, SIGNAL(toggled(bool)), this, SLOT(slotMethodChanged(bool)));
+ slotMethodChanged(m_view.method_mime->isChecked());
+
+
+ // Check for Kdenlive installed luma files
+ QStringList filters;
+ filters << "*.pgm" << "*.png";
+
+ QStringList customLumas = KGlobal::dirs()->findDirs("appdata", "lumas");
+ foreach(const QString & folder, customLumas) {
+ QStringList filesnames = QDir(folder).entryList(filters, QDir::Files);
+ foreach(const QString & fname, filesnames) {
+ QString filePath = KUrl(folder).path(KUrl::AddTrailingSlash) + fname;
+ m_view.luma_file->addItem(KIcon(filePath), fname, filePath);
+ }
+ }
+
+ // Check for MLT lumas
+ QString profilePath = KdenliveSettings::mltpath();
+ QString folder = profilePath.section('/', 0, -3);
+ folder.append("/lumas/PAL"); // TODO: cleanup the PAL / NTSC mess in luma files
+ QDir lumafolder(folder);
+ QStringList filesnames = lumafolder.entryList(filters, QDir::Files);
+ foreach(const QString & fname, filesnames) {
+ QString filePath = KUrl(folder).path(KUrl::AddTrailingSlash) + fname;
+ m_view.luma_file->addItem(KIcon(filePath), fname, filePath);
+ }
+
+ //adjustSize();
+}
+
+SlideshowClip::~SlideshowClip()
+{
+ delete m_thumbJob;
+}
+
+void SlideshowClip::slotEnableLuma(int state)
+{
+ bool enable = false;
+ if (state == Qt::Checked) enable = true;
+ m_view.luma_duration->setEnabled(enable);
+ m_view.luma_duration_frames->setEnabled(enable);
+ m_view.luma_fade->setEnabled(enable);
+ if (enable) {
+ m_view.luma_file->setEnabled(m_view.luma_fade->isChecked());
+ } else m_view.luma_file->setEnabled(false);
+ m_view.label_softness->setEnabled(m_view.luma_fade->isChecked() && enable);
+ m_view.luma_softness->setEnabled(m_view.label_softness->isEnabled());
+}
+
+void SlideshowClip::slotEnableThumbs(int state)
+{
+ if (state == Qt::Checked) {
+ KdenliveSettings::setShowslideshowthumbs(true);
+ slotGenerateThumbs();
+ } else {
+ KdenliveSettings::setShowslideshowthumbs(false);
+ if (m_thumbJob) {
+ disconnect(m_thumbJob, SIGNAL(gotPreview(KFileItem,QPixmap)), this, SLOT(slotSetPixmap(KFileItem,QPixmap)));
+ m_thumbJob->kill();
+ m_thumbJob = NULL;
+ }
+ }
+