widgets/monitor_ui.ui
widgets/colorclip_ui.ui
widgets/configmisc_ui.ui
+ widgets/effectlist_ui.ui
)
set(kdenlive_SRCS
clipmanager.cpp
effectslist.cpp
initeffects.cpp
+ effectslistview.cpp
)
kde4_add_kcfg_files(kdenlive_SRCS GENERATE_MOC kdenlivesettings.kcfgc )
return list;
}
+QString EffectsList::getInfo(QString effectName)
+{
+ QString info;
+ QDomElement effect = getEffectByName(effectName);
+ QDomNode namenode = effect.elementsByTagName("description").item(0);
+ if (!namenode.isNull()) info = i18n(qstrdup(namenode.toElement().text().toUtf8()));
+ namenode = effect.elementsByTagName("author").item(0);
+ if (!namenode.isNull()) info.append(i18n("<br><b>Author:</b> ") + i18n(qstrdup(namenode.toElement().text().toUtf8())));
+ return info;
+}
/** Returns an XML version of this Effect.*/
QDomElement getEffectByName(const QString & name);
QStringList effectNames();
+ QString getInfo(QString effectName);
};
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
+ ***************************************************************************/
+
+
+#include <KDebug>
+#include <KLocale>
+
+#include "effectslistview.h"
+
+EffectsListView::EffectsListView(EffectsList *audioEffectList, EffectsList *videoEffectList, EffectsList *customEffectList, QWidget *parent)
+ : QWidget(parent), m_audioList(audioEffectList), m_videoList(videoEffectList), m_customList(customEffectList)
+{
+ ui.setupUi(this);
+ initList();
+ connect(ui.video_button, SIGNAL(released()), this, SLOT(initList()));
+ connect(ui.audio_button, SIGNAL(released()), this, SLOT(initList()));
+ connect(ui.custom_button, SIGNAL(released()), this, SLOT(initList()));
+ connect(ui.effectlist, SIGNAL(itemSelectionChanged()), this, SLOT(slotDisplayInfo()));
+}
+
+void EffectsListView::initList()
+{
+ QStringList names;
+ if (ui.video_button->isChecked()) {
+ names = m_videoList->effectNames();
+ }
+ else if (ui.audio_button->isChecked()) {
+ names = m_audioList->effectNames();
+ }
+ if (ui.custom_button->isChecked()) {
+ names = m_customList->effectNames();
+ }
+ ui.effectlist->clear();
+ ui.effectlist->addItems(names);
+}
+
+void EffectsListView::slotDisplayInfo()
+{
+ QString info;
+ if (ui.video_button->isChecked()) {
+ info = m_videoList->getInfo(ui.effectlist->currentItem()->text());
+ }
+ else if (ui.audio_button->isChecked()) {
+ info = m_audioList->getInfo(ui.effectlist->currentItem()->text());
+ }
+ if (ui.custom_button->isChecked()) {
+ info = m_customList->getInfo(ui.effectlist->currentItem()->text());
+ }
+ ui.infopanel->setText(info);
+}
+
+KListWidget *EffectsListView::listView()
+{
+ return ui.effectlist;
+}
+
+#include "effectslistview.moc"
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
+ ***************************************************************************/
+
+
+#ifndef EFFECTLISTVIEW_H
+#define EFFECTLISTVIEW_H
+
+#include <KIcon>
+
+#include "ui_effectlist_ui.h"
+#include "effectslist.h"
+
+class EffectsListView : public QWidget
+{
+ Q_OBJECT
+
+ public:
+ EffectsListView(EffectsList *audioEffectList, EffectsList *videoEffectList, EffectsList *customEffectList, QWidget *parent=0);
+ KListWidget *listView();
+
+ private:
+ Ui::EffectList_UI ui;
+ EffectsList *m_audioList;
+ EffectsList *m_videoList;
+ EffectsList *m_customList;
+
+ private slots:
+ void initList();
+ void slotDisplayInfo();
+
+ public slots:
+
+};
+
+#endif
effectListDock = new QDockWidget(i18n("Effect List"), this);
effectListDock->setObjectName("effect_list");
- m_effectList = new KListWidget(this);
+ m_effectList = new EffectsListView(&m_audioEffects, &m_videoEffects, &m_customEffects);
+
+ //m_effectList = new KListWidget(this);
effectListDock->setWidget(m_effectList);
addDockWidget(Qt::TopDockWidgetArea, effectListDock);
m_monitorManager->initMonitors(m_clipMonitor, m_projectMonitor);
setAutoSaveSettings();
- fillEffectsList();
newFile();
}
}
}
-void MainWindow::fillEffectsList()
-{
- QStringList videoEffects = m_videoEffects.effectNames();
- m_effectList->addItems(videoEffects);
-}
-
void MainWindow::slotRaiseMonitor(bool clipMonitor)
{
if (clipMonitor) clipMonitorDock->raise();
#include "trackview.h"
#include "customtrackview.h"
#include "effectslist.h"
+#include "effectslistview.h"
class MainWindow : public KXmlGuiWindow
{
private:
KTabWidget* m_timelineArea;
void setupActions();
- void fillEffectsList();
QString fileName;
KdenliveDoc *m_activeDocument;
MonitorManager *m_monitorManager;
ProjectList *m_projectList;
QDockWidget *effectListDock;
- KListWidget *m_effectList;
+ EffectsListView *m_effectList;
+ //KListWidget *m_effectList;
QDockWidget *effectStackDock;
KListWidget *effectStack;
--- /dev/null
+<ui version="4.0" >
+ <class>EffectList_UI</class>
+ <widget class="QWidget" name="EffectList_UI" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>260</width>
+ <height>256</height>
+ </rect>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" colspan="2" >
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <widget class="QRadioButton" name="video_button" >
+ <property name="text" >
+ <string>Video</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="audio_button" >
+ <property name="text" >
+ <string>Audio</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="custom_button" >
+ <property name="text" >
+ <string>Custom</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <widget class="KListWidget" name="effectlist" />
+ </item>
+ <item row="1" column="1" >
+ <widget class="QTextEdit" name="infopanel" >
+ <property name="frameShape" >
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Sunken</enum>
+ </property>
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>KListWidget</class>
+ <extends>QListWidget</extends>
+ <header>klistwidget.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>