]> git.sesse.net Git - kdenlive/blob - src/transitionsettings.cpp
function for changing transitions
[kdenlive] / src / transitionsettings.cpp
1 /***************************************************************************
2                           effecstackedit.h  -  description
3                              -------------------
4     begin                : Mar 15 2008
5     copyright            : (C) 2008 by Marco Gittler
6     email                : g.marco@freenet.de
7  ***************************************************************************/
8
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17
18 #include "transitionsettings.h"
19 #include "transition.h"
20 #include <KDebug>
21
22 TransitionSettings::TransitionSettings(EffectsList *transitions, QWidget* parent): QWidget(parent) {
23     ui.setupUi(this);
24     setEnabled(false);
25     m_transitions = transitions;
26     ui.listWidget->addItems(transitions->effectNames());
27     kDebug() << transitions->effectNames().size() << " -" << transitions->size();
28     connect(ui.listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(slotTransitionChanged()));
29 }
30
31 void TransitionSettings::slotTransitionChanged() {
32     QDomElement e = m_usedTransition->toXML();
33     QDomElement newElement = e.cloneNode().toElement();
34     newElement.setAttribute("type", ui.listWidget->currentItem()->text());
35     emit transitionUpdated(e, newElement);
36 }
37
38 void TransitionSettings::slotTransitionItemSelected(Transition* t) {
39     setEnabled(t != NULL);
40     m_usedTransition = t;
41 }
42