KColorScheme scheme2(p.currentColorGroup(), KColorScheme::Window, KSharedConfig::openConfig(KdenliveSettings::colortheme()));
QColor normal_bg2 = scheme2.background(KColorScheme::NormalBackground).color();
- QString stylesheet(QString("QLineEdit#title { background-color: transparent;} QFrame#decoframe {border-radius:5px;border:0px solid %1;background:%6;} QFrame#decoframegroup {border-radius:5px;border:1px solid %1;background:%6;} QFrame:hover#decoframe {background:%7;} QFrame#decoframe[active=\"true\"] {background:%5;} QFrame#decoframegroup[active=\"true\"] {background:%5;} QFrame#frame[active=\"true\"] {background:%3;} QProgressBar::chunk:horizontal {background: %6;border-top-left-radius: 4px;border-bottom-left-radius: 4px;} QProgressBar::chunk:horizontal#dragOnly {background: %5;border-top-left-radius: 4px;border-bottom-left-radius: 4px;} QProgressBar::chunk:horizontal:hover {background: %3;}\
+ QString stylesheet(QString("MyEditableLabel { background-color: transparent;} QFrame#decoframe {border-radius:5px;border:0px solid %1;background:%6;} QFrame#decoframegroup {border-radius:5px;border:1px solid %1;background:%6;} QFrame:hover#decoframe {background:%7;} QFrame#decoframe[active=\"true\"] {background:%5;} QFrame#decoframegroup[active=\"true\"] {background:%5;} QFrame#frame[active=\"true\"] {background:%3;} QProgressBar::chunk:horizontal {background: %6;border-top-left-radius: 4px;border-bottom-left-radius: 4px;} QProgressBar::chunk:horizontal#dragOnly {background: %5;border-top-left-radius: 4px;border-bottom-left-radius: 4px;} QProgressBar::chunk:horizontal:hover {background: %3;}\
QProgressBar:horizontal {border: 1px solid %1;border-top-left-radius: 4px;border-bottom-left-radius: 4px;border-right:0px;background:%5;padding: 0px;text-align:left center}\
QProgressBar:horizontal:disabled {border: 1px solid %6} QProgressBar:horizontal#dragOnly {background: %5}\
QProgressBar:horizontal[inTimeline=\"true\"] { border: 1px solid %2;border-right: 0px;background: %4;padding: 0px;text-align:left center } QProgressBar::chunk:horizontal[inTimeline=\"true\"] {background: %2;}\
m_info.groupIndex = ix;
}
+void CollapsibleEffect::setGroupName(const QString &groupName)
+{
+ m_info.groupName = groupName;
+}
QString CollapsibleEffect::infoString() const
{
}
}
}
-
-
bool isGroup() const;
int effectIndex() const;
void setGroupIndex(int ix);
+ void setGroupName(const QString &groupName);
void removeGroup(int ix, QVBoxLayout *layout);
QString infoString() const;
bool isActive() const;
#include <QDragEnterEvent>
#include <QDropEvent>
+
#include <KDebug>
#include <KGlobalSettings>
#include <KLocale>
#include <KUrlRequester>
#include <KColorScheme>
+MyEditableLabel::MyEditableLabel(QWidget * parent):
+ QLineEdit(parent)
+{
+ setFrame(false);
+ setReadOnly(true);
+}
+
+void MyEditableLabel::mouseDoubleClickEvent ( QMouseEvent * e )
+{
+ setReadOnly(false);
+ selectAll();
+}
-CollapsibleGroup::CollapsibleGroup(int ix, bool firstGroup, bool lastGroup, QWidget * parent) :
+
+CollapsibleGroup::CollapsibleGroup(int ix, bool firstGroup, bool lastGroup, QString groupName, QWidget * parent) :
AbstractCollapsibleWidget(parent),
m_index(ix)
{
setupUi(this);
setFont(KGlobalSettings::smallestReadableFont());
-
+ QHBoxLayout *l = static_cast <QHBoxLayout *>(frame->layout());
+ m_title = new MyEditableLabel(this);
+ l->insertWidget(4, m_title);
+ m_title->setText(groupName.isEmpty() ? i18n("Effect Group") : groupName);
+ connect(m_title, SIGNAL(editingFinished()), this, SLOT(slotRenameGroup()));
buttonUp->setIcon(KIcon("kdenlive-up"));
buttonUp->setToolTip(i18n("Move effect up"));
buttonDown->setIcon(KIcon("kdenlive-down"));
m_menu->addAction(KIcon("view-refresh"), i18n("Reset effect"), this, SLOT(slotResetEffect()));
m_menu->addAction(KIcon("document-save"), i18n("Save effect"), this, SLOT(slotSaveEffect()));
- title->setText(i18n("Effect Group"));
effecticon->setPixmap(KIcon("folder").pixmap(16,16));
m_menu->addAction(KIcon("list-remove"), i18n("Ungroup"), this, SLOT(slotUnGroup()));
setAcceptDrops(true);
void CollapsibleGroup::slotEnable(bool enable)
{
- title->setEnabled(enable);
+ m_title->setEnabled(enable);
enabledBox->blockSignals(true);
enabledBox->setChecked(enable);
enabledBox->blockSignals(false);
event->accept();
}
+void CollapsibleGroup::slotRenameGroup()
+{
+ m_title->setReadOnly(true);
+ if (m_title->text().isEmpty()) m_title->setText(i18n("Effect Group"));
+ QList <CollapsibleEffect*> effects = findChildren<CollapsibleEffect*>();
+ for (int j = 0; j < effects.count(); j++) {
+ effects.at(j)->setGroupName(m_title->text());
+ }
+ emit groupRenamed(this);
+}
+
+QList <CollapsibleEffect*> CollapsibleGroup::effects()
+{
+ QList <CollapsibleEffect*> result = findChildren<CollapsibleEffect*>();
+ return result;
+}
+
+
#include <QDomElement>
#include <QToolButton>
+#include <QLineEdit>
class QFrame;
+class MyEditableLabel : public QLineEdit
+{
+ Q_OBJECT
+
+public:
+ MyEditableLabel(QWidget * parent = 0);
+
+protected:
+ virtual void mouseDoubleClickEvent( QMouseEvent *e);
+};
+
/**)
* @class CollapsibleEffect
Q_OBJECT
public:
- CollapsibleGroup(int ix, bool firstGroup, bool lastGroup, QWidget * parent = 0);
+ CollapsibleGroup(int ix, bool firstGroup, bool lastGroup, QString groupName = QString(), QWidget * parent = 0);
~CollapsibleGroup();
void updateTimecodeFormat();
void setActive(bool activate);
bool isActive() const;
void addGroupEffect(CollapsibleEffect *effect);
void removeGroup(int ix, QVBoxLayout *layout);
+ QList <CollapsibleEffect*> effects();
public slots:
void slotEnable(bool enable);
void slotSaveEffect();
void slotResetEffect();
void slotUnGroup();
+ void slotRenameGroup();
private:
//QList <CollapsibleEffect *> m_subParamWidgets;
EffectInfo m_info;
int m_index;
void updateGroupIndex(int groupIndex);
+ MyEditableLabel *m_title;
protected:
virtual void mouseDoubleClickEvent ( QMouseEvent * event );
void moveEffect(int current_pos, int new_pos, int groupIndex);
void addEffect(QDomElement e);
void unGroup(CollapsibleGroup *);
+ void groupRenamed(CollapsibleGroup *);
};
effecstackview.cpp2 - description
-------------------
begin : Feb 15 2008
- copyright : (C) 2008 by Marco Gittler
- email : g.marco@freenet.de
+ copyright : (C) 2008 by Marco Gittler (g.marco@freenet.de)
+ copyright : (C) 2012 by Jean-Baptiste Mardelle (jb@kdenlive.org)
***************************************************************************/
/***************************************************************************
}
if (group == NULL) {
- group = new CollapsibleGroup(effectInfo.groupIndex, i == 0, i == m_currentEffectList.count() - 1, m_ui.container->widget());
- if (!effectInfo.groupName.isEmpty()) group->title->setText(effectInfo.groupName);
+ group = new CollapsibleGroup(effectInfo.groupIndex, i == 0, i == m_currentEffectList.count() - 1, effectInfo.groupName, m_ui.container->widget());
connect(group, SIGNAL(moveEffect(int,int,int)), this, SLOT(slotMoveEffect(int,int,int)));
connect(group, SIGNAL(unGroup(CollapsibleGroup*)), this , SLOT(slotUnGroup(CollapsibleGroup*)));
+ connect(group, SIGNAL(groupRenamed(CollapsibleGroup *)), this, SLOT(slotRenameGroup(CollapsibleGroup*)));
vbox1->addWidget(group);
}
if (effectInfo.groupIndex >= m_groupIndex) m_groupIndex = effectInfo.groupIndex + 1;
}
}
- CollapsibleGroup *group = new CollapsibleGroup(m_groupIndex, ix == 1, ix == m_currentEffectList.count() - 2, m_ui.container->widget());
+ CollapsibleGroup *group = new CollapsibleGroup(m_groupIndex, ix == 1, ix == m_currentEffectList.count() - 2, QString(), m_ui.container->widget());
m_groupIndex++;
connect(group, SIGNAL(moveEffect(int,int,int)), this , SLOT(slotMoveEffect(int,int,int)));
connect(group, SIGNAL(unGroup(CollapsibleGroup*)), this , SLOT(slotUnGroup(CollapsibleGroup*)));
+ connect(group, SIGNAL(groupRenamed(CollapsibleGroup *)), this , SLOT(slotRenameGroup(CollapsibleGroup*)));
l->insertWidget(groupPos, group);
group->addGroupEffect(effectToMove);
}
group->deleteLater();
}
+void EffectStackView2::slotRenameGroup(CollapsibleGroup *group)
+{
+ QList <CollapsibleEffect*> effects = group->effects();
+ for (int i = 0; i < effects.count(); i++) {
+ QDomElement origin = effects.at(i)->effect();
+ QDomElement changed = origin.cloneNode().toElement();
+ changed.setAttribute("kdenlive_info", effects.at(i)->infoString());
+ if (m_effectMetaInfo.trackMode) {
+ emit updateEffect(NULL, m_trackindex, origin, changed, effects.at(i)->effectIndex());
+ } else {
+ emit updateEffect(m_clipref, -1, origin, changed, effects.at(i)->effectIndex());
+ }
+ }
+}
+
#include "effectstackview2.moc"
effecstackview2.h - description
-------------------
begin : Feb 15 2008
- copyright : (C) 2008 by Marco Gittler
- email : g.marco@freenet.de
+ copyright : (C) 2008 by Marco Gittler (g.marco@freenet.de)
+ copyright : (C) 2012 by Jean-Baptiste Mardelle (jb@kdenlive.org)
***************************************************************************/
/***************************************************************************
/** @brief Display additionnal effect info */
void slotShowComments();
+
+ /** @brief An effect group was renamed, update effects info */
+ void slotRenameGroup(CollapsibleGroup *group);
signals:
void removeEffect(ClipItem*, int, QDomElement);
#include "trackview.h"
#include "customtrackview.h"
#include "effectslistview.h"
-#include "effectstackview.h"
#include "effectstack/effectstackview2.h"
#include "transitionsettings.h"
#include "renderwidget.h"
</property>
</widget>
</item>
- <item>
- <widget class="QLineEdit" name="title">
- <property name="frame">
- <bool>false</bool>
- </property>
- <property name="readOnly">
- <bool>true</bool>
- </property>
- </widget>
- </item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">