ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidget * parent) :
- QDialog(parent),
- m_clip(clip),
- m_tc(tc),
- m_fps(fps),
- m_count(0),
- m_clipNeedsRefresh(false),
- m_clipNeedsReLoad(false)
+ QDialog(parent)
+ , m_clip(clip)
+ , m_tc(tc)
+ , m_fps(fps)
+ , m_count(0)
+ , m_clipNeedsRefresh(false)
+ , m_clipNeedsReLoad(false)
+ , m_proxyContainer(NULL)
{
setAttribute(Qt::WA_DeleteOnClose, true);
setFont(KGlobalSettings::toolBarFont());
connect(m_view.clip_full_luma, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
// Check for Metadata
- QMap<QString, QString> meta = m_clip->metadata();
- QMap<QString, QString>::const_iterator i = meta.constBegin();
+ QMap<QString, QStringList> meta = m_clip->metadata();
+ QMap<QString, QStringList>::const_iterator i = meta.constBegin();
while (i != meta.constEnd()) {
- QTreeWidgetItem *metaitem = new QTreeWidgetItem(m_view.metadata_list);
+ QStringList values = i.value();
+ QString parentName;
+ QString iconName;
+ if (values.count() > 1 && !values.at(1).isEmpty()) parentName = values.at(1);
+ else {
+ if (KdenliveSettings::ffmpegpath().endsWith("avconv")) {
+ parentName = i18n("Libav");
+ iconName = "meta_libav.png";
+ }
+ else {
+ parentName = i18n("FFmpeg");
+ iconName = "meta_ffmpeg.png";
+ }
+ }
+ QTreeWidgetItem *parent = NULL;
+ QList <QTreeWidgetItem *> matches = m_view.metadata_list->findItems(parentName, Qt::MatchExactly);
+ if (!matches.isEmpty()) parent = matches.at(0);
+ else {
+ if (parentName == "Magic Lantern") iconName = "meta_magiclantern.png";
+ parent = new QTreeWidgetItem(m_view.metadata_list, QStringList() << parentName);
+ if (!iconName.isEmpty()) {
+ KIcon icon(KStandardDirs::locate("appdata", iconName));
+ parent->setIcon(0, icon);
+ }
+ }
+ QTreeWidgetItem *metaitem = NULL;
+ if (parent) {
+ metaitem = new QTreeWidgetItem(parent);
+ parent->setExpanded(true);
+ }
+ else metaitem = new QTreeWidgetItem(m_view.metadata_list);
metaitem->setText(0, i.key()); //i18n(i.key().section('.', 2, 3).toUtf8().data()));
- metaitem->setText(1, i.value());
+ metaitem->setText(1, values.at(0));
++i;
}
m_view.clip_license->setText(i18n("License: %1", res.property(Nepomuk::Vocabulary::NIE::license()).toString()));
if (ltype.startsWith("http")) {
m_view.clip_license->setUrl(ltype);
- connect(m_view.clip_license, SIGNAL(leftClickedUrl(const QString &)), this, SLOT(slotOpenUrl(const QString &)));
+ connect(m_view.clip_license, SIGNAL(leftClickedUrl(QString)), this, SLOT(slotOpenUrl(QString)));
}
}
else m_view.clip_license->setHidden(true);
connect(m_view.marker_delete, SIGNAL(clicked()), this, SLOT(slotDeleteMarker()));
connect(m_view.marker_save, SIGNAL(clicked()), this, SLOT(slotSaveMarkers()));
connect(m_view.marker_load, SIGNAL(clicked()), this, SLOT(slotLoadMarkers()));
- connect(m_view.markers_list, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(slotEditMarker()));
+ connect(m_view.markers_list, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(slotEditMarker()));
connect(m_view.analysis_delete, SIGNAL(clicked()), this, SLOT(slotDeleteAnalysis()));
connect(m_view.analysis_save, SIGNAL(clicked()), this, SLOT(slotSaveAnalysis()));