#include <KStandardDirs>
#include <KDebug>
#include <KFileItem>
+#include <kdeversion.h>
+#include <KUrlLabel>
+#include <KRun>
+
+#ifdef USE_NEPOMUK
+#if KDE_IS_VERSION(4,6,0)
+#include <Nepomuk/Variant>
+#include <Nepomuk/Resource>
+#include <Nepomuk/ResourceManager>
+#include <Nepomuk/Vocabulary/NIE>
+#endif
+#endif
+
#include <QDir>
m_view.marker_delete->setIcon(KIcon("trash-empty"));
m_view.marker_delete->setToolTip(i18n("Delete marker"));
+ // Check for Nepomuk metadata
+#ifdef USE_NEPOMUK
+#if KDE_IS_VERSION(4,6,0)
+ if (!url.isEmpty()) {
+ Nepomuk::ResourceManager::instance()->init();
+ Nepomuk::Resource res( url.path() );
+ // Check if file has a license
+ if (res.hasProperty(Nepomuk::Vocabulary::NIE::license())) {
+ QGridLayout *l = static_cast<QGridLayout *>(layout());
+ QString ltype = res.property(Nepomuk::Vocabulary::NIE::licenseType()).toString();
+ 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 &)));
+ }
+ }
+ else m_view.clip_license->setHidden(true);
+ }
+ else m_view.clip_license->setHidden(true);
+#else
+ m_view.clip_license->setHidden(true);
+#endif
+#else
+ m_view.clip_license->setHidden(true);
+#endif
+
slotFillMarkersList();
connect(m_view.marker_new, SIGNAL(clicked()), this, SLOT(slotAddMarker()));
connect(m_view.marker_edit, SIGNAL(clicked()), this, SLOT(slotEditMarker()));
connect(this, SIGNAL(accepted()), this, SLOT(slotApplyProperties()));
connect(m_view.buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(slotApplyProperties()));
m_view.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
- //adjustSize();
+ adjustSize();
}
if (m_proxyContainer) delete m_proxyContainer;
}
+void ClipProperties::slotOpenUrl(const QString &url)
+{
+ new KRun(KUrl(url), this);
+}
+
#include "clipproperties.moc"
void slotApplyProperties();
void slotModified();
void slotDeleteProxy();
+ void slotOpenUrl(const QString &url);
private:
Ui::ClipProperties_UI m_view;
KUrl url = clip->fileURL();
#ifdef USE_NEPOMUK
- if (!url.isEmpty() && KdenliveSettings::activate_nepomuk()) {
+ if (!url.isEmpty() && KdenliveSettings::activate_nepomuk() && clip->getProperty("description").isEmpty()) {
// if file has Nepomuk comment, use it
Nepomuk::Resource f(url.path());
QString annotation = f.description();
- if (!annotation.isEmpty()) item->setText(1, annotation);
+ if (!annotation.isEmpty()) {
+ item->setText(1, annotation);
+ clip->setProperty("description", annotation);
+ }
item->setText(2, QString::number(f.rating()));
}
#endif
licenseName = "Creative Commons 0";
else if (licenseUrl.endsWith("/publicdomain"))
licenseName = "Public Domain";
- item_license->setText(i18n("License: %1", licenseName));
+ else licenseName = i18n("Unknown");
+ item_license->setText(licenseName);
item_license->setUrl(licenseUrl);
}
<rect>
<x>0</x>
<y>0</y>
- <width>280</width>
- <height>503</height>
+ <width>298</width>
+ <height>512</height>
</rect>
</property>
<property name="windowTitle">
<string>Clip Properties</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
- <item row="7" column="1" colspan="2">
- <spacer name="verticalSpacer_4">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
+ <item row="0" column="0" colspan="4">
+ <widget class="QLabel" name="clip_thumb">
+ <property name="text">
+ <string>Image preview</string>
</property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>17</height>
- </size>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
</property>
- </spacer>
+ </widget>
</item>
<item row="1" column="0" colspan="4">
<widget class="QLabel" name="label_path">
</property>
</widget>
</item>
- <item row="8" column="0" colspan="4">
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Apply|QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- <item row="0" column="0" colspan="4">
- <widget class="QLabel" name="clip_thumb">
- <property name="text">
- <string>Image preview</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignCenter</set>
- </property>
- </widget>
- </item>
- <item row="6" column="0" colspan="4">
+ <item row="7" column="0" colspan="4">
<widget class="QTabWidget" name="tabWidget">
<property name="tabPosition">
<enum>QTabWidget::South</enum>
</widget>
</widget>
</item>
+ <item row="8" column="1" colspan="2">
+ <spacer name="verticalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="9" column="0" colspan="4">
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Apply|QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0" colspan="4">
+ <widget class="KUrlLabel" name="clip_license">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
<customwidgets>
- <customwidget>
- <class>KIntSpinBox</class>
- <extends>QSpinBox</extends>
- <header>knuminput.h</header>
- </customwidget>
<customwidget>
<class>KDoubleNumInput</class>
<extends>QWidget</extends>
<header>knuminput.h</header>
</customwidget>
<customwidget>
- <class>KLineEdit</class>
- <extends>QLineEdit</extends>
- <header>klineedit.h</header>
+ <class>KColorButton</class>
+ <extends>QPushButton</extends>
+ <header>kcolorbutton.h</header>
</customwidget>
<customwidget>
<class>KComboBox</class>
<header>kcombobox.h</header>
</customwidget>
<customwidget>
- <class>KColorButton</class>
- <extends>QPushButton</extends>
- <header>kcolorbutton.h</header>
+ <class>KLineEdit</class>
+ <extends>QLineEdit</extends>
+ <header>klineedit.h</header>
+ </customwidget>
+ <customwidget>
+ <class>KUrlLabel</class>
+ <extends>QLabel</extends>
+ <header>kurllabel.h</header>
</customwidget>
<customwidget>
<class>KRestrictedLine</class>
<extends>KLineEdit</extends>
<header>krestrictedline.h</header>
</customwidget>
+ <customwidget>
+ <class>KIntSpinBox</class>
+ <extends>QSpinBox</extends>
+ <header>knuminput.h</header>
+ </customwidget>
</customwidgets>
<resources/>
<connections>
</property>
</spacer>
</item>
- <item row="12" column="1" colspan="3">
+ <item row="13" column="1" colspan="3">
<widget class="QPushButton" name="button_import">
<property name="text">
<string>Import</string>
</property>
</widget>
</item>
- <item row="12" column="0">
+ <item row="13" column="0">
<widget class="QPushButton" name="button_preview">
<property name="text">
<string>Preview</string>
</column>
</widget>
</item>
- <item row="10" column="0" colspan="4">
- <widget class="KUrlLabel" name="item_license">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="11" column="0">
+ <item row="12" column="0">
<widget class="QCheckBox" name="sound_autoplay">
<property name="text">
<string>Auto play</string>
</property>
</widget>
</item>
+ <item row="11" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>License</string>
+ </property>
+ </widget>
+ </item>
+ <item row="11" column="1" colspan="3">
+ <widget class="KUrlLabel" name="item_license">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>