+ m_view.image_size->setText(props.value("frame_size"));
+ if (props.contains("transparency"))
+ m_view.image_transparency->setChecked(props.value("transparency").toInt());
+ connect(m_view.image_transparency, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
+ int width = 180.0 * KdenliveSettings::project_display_ratio();
+ if (width % 2 == 1) width++;
+ m_view.clip_thumb->setPixmap(QPixmap(url.path()).scaled(QSize(width, 180), Qt::KeepAspectRatio));
+ } else if (t == COLOR) {
+ m_view.clip_path->setEnabled(false);
+ m_view.tabWidget->removeTab(METATAB);
+ m_view.tabWidget->removeTab(IMAGETAB);
+ m_view.tabWidget->removeTab(SLIDETAB);
+ m_view.tabWidget->removeTab(AUDIOTAB);
+ m_view.tabWidget->removeTab(VIDEOTAB);
+ m_view.clip_thumb->setHidden(true);
+ m_view.clip_color->setColor(QColor('#' + props.value("colour").right(8).left(6)));
+ connect(m_view.clip_color, SIGNAL(changed(QColor)), this, SLOT(slotModified()));
+ } else if (t == SLIDESHOW) {
+ if (url.fileName().startsWith(".all.")) {
+ // the image sequence is defined by mimetype
+ m_view.clip_path->setText(url.directory());
+ } else {
+ // the image sequence is defined by pattern
+ m_view.slide_type_label->setHidden(true);
+ m_view.image_type->setHidden(true);
+ m_view.clip_path->setText(url.path());
+ }
+
+ m_view.tabWidget->removeTab(METATAB);
+ m_view.tabWidget->removeTab(IMAGETAB);
+ m_view.tabWidget->removeTab(COLORTAB);
+ m_view.tabWidget->removeTab(AUDIOTAB);
+ m_view.tabWidget->removeTab(VIDEOTAB);
+
+ //WARNING: Keep in sync with slideshowclip.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.slide_loop->setChecked(props.value("loop").toInt());
+ m_view.slide_crop->setChecked(props.value("crop").toInt());
+ m_view.slide_fade->setChecked(props.value("fade").toInt());
+ m_view.luma_softness->setValue(props.value("softness").toInt());
+ if (!props.value("animation").isEmpty())
+ m_view.animation->setCurrentItem(props.value("animation"));
+ else
+ m_view.animation->setCurrentIndex(0);
+ QString path = props.value("resource");
+ QString ext = path.section('.', -1);
+ for (int i = 0; i < m_view.image_type->count(); i++) {
+ if (m_view.image_type->itemData(i).toString() == ext) {
+ m_view.image_type->setCurrentIndex(i);
+ break;
+ }
+ }
+ m_view.slide_duration->setText(tc.getTimecodeFromFrames(props.value("ttl").toInt()));
+
+ m_view.slide_duration_format->addItem(i18n("hh:mm:ss:ff"));
+ m_view.slide_duration_format->addItem(i18n("Frames"));
+ connect(m_view.slide_duration_format, SIGNAL(activated(int)), this, SLOT(slotUpdateDurationFormat(int)));
+ m_view.slide_duration_frames->setHidden(true);
+ m_view.luma_duration_frames->setHidden(true);
+
+ parseFolder();
+
+ m_view.luma_duration->setText(tc.getTimecodeFromFrames(props.value("luma_duration").toInt()));
+ QString lumaFile = props.value("luma_file");
+
+ // 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);
+ }
+
+ if (!lumaFile.isEmpty()) {
+ m_view.slide_luma->setChecked(true);
+ m_view.luma_file->setCurrentIndex(m_view.luma_file->findData(lumaFile));
+ } else m_view.luma_file->setEnabled(false);
+ slotEnableLuma(m_view.slide_fade->checkState());
+ slotEnableLumaFile(m_view.slide_luma->checkState());
+
+ connect(m_view.slide_fade, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
+ connect(m_view.slide_luma, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
+ connect(m_view.slide_loop, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
+ connect(m_view.slide_crop, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
+ connect(m_view.slide_duration, SIGNAL(textChanged(QString)), this, SLOT(slotModified()));
+ connect(m_view.slide_duration_frames, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
+ connect(m_view.luma_duration, SIGNAL(textChanged(QString)), this, SLOT(slotModified()));
+ connect(m_view.luma_softness, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
+ connect(m_view.luma_file, SIGNAL(currentIndexChanged(int)), this, SLOT(slotModified()));
+ connect(m_view.animation, SIGNAL(currentIndexChanged(int)), this, SLOT(slotModified()));
+
+
+ connect(m_view.slide_fade, SIGNAL(stateChanged(int)), this, SLOT(slotEnableLuma(int)));
+ connect(m_view.slide_luma, SIGNAL(stateChanged(int)), this, SLOT(slotEnableLumaFile(int)));
+ connect(m_view.image_type, SIGNAL(currentIndexChanged(int)), this, SLOT(parseFolder()));
+
+ } else if (t != AUDIO) {
+ m_view.tabWidget->removeTab(IMAGETAB);
+ m_view.tabWidget->removeTab(SLIDETAB);
+ m_view.tabWidget->removeTab(COLORTAB);
+
+ PropertiesViewDelegate *del1 = new PropertiesViewDelegate(this);
+ PropertiesViewDelegate *del2 = new PropertiesViewDelegate(this);
+ m_view.clip_vproperties->setItemDelegate(del1);
+ m_view.clip_aproperties->setItemDelegate(del2);
+ m_view.clip_aproperties->setStyleSheet(QString("QTreeWidget { background-color: transparent;}"));
+ m_view.clip_vproperties->setStyleSheet(QString("QTreeWidget { background-color: transparent;}"));
+