1 /***************************************************************************
2 * Copyright (C) 2007 by Jorge Cuadrado *
3 * kuadrosxx@gmail.com *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
21 #include "timelinewidget.h"
23 #include "layermanager.h"
24 #include "framestable.h"
26 #include <QStackedWidget>
27 #include <QTreeWidget>
28 #include <QHeaderView>
32 #include <dgui/iconloader.h>
33 #include <dgui/imagebutton.h>
35 #include <dcore/debug.h>
37 #include "ui_frames.h"
38 #include "ui_layers.h"
39 #include "ui_scenes.h"
44 struct TimeLineWidget::Private
55 TimeLineWidget::Event
createEvent(TimeLineWidget
*tl
, TimeLineWidget::Action action
)
58 event
.action
= Action(action
);
59 event
.scene
= tl
->scene();
60 event
.layer
= tl
->layer();
61 event
.frame
= tl
->frame();
70 TimeLineWidget::TimeLineWidget(QWidget
* parent
)
71 : QSplitter(Qt::Horizontal
, parent
), d(new Private
)
73 QWidget
*scenesWidget
= new QWidget
;
74 d
->scenes
.setupUi(scenesWidget
);
75 addWidget(scenesWidget
);
77 QWidget
*layersWidget
= new QWidget
;
78 d
->layers
.setupUi(layersWidget
);
79 addWidget(layersWidget
);
81 QWidget
*framesWidget
= new QWidget
;
82 d
->frames
.setupUi(framesWidget
);
83 addWidget(framesWidget
);
85 d
->scenes
.container
->setHeaderLabels(QStringList() << tr("Scene"));
86 connect(d
->scenes
.container
, SIGNAL(itemClicked( QTreeWidgetItem
*, int)), this, SLOT(onItemClicked(QTreeWidgetItem
*, int)));
88 connect(d
->scenes
.container
, SIGNAL(itemChanged( QTreeWidgetItem
*, int)), this, SLOT(onItemChanged(QTreeWidgetItem
*, int)));
90 connect(&d
->actions
, SIGNAL(buttonClicked(int)), this, SLOT(onButtonClicked(int)));
92 connect(&d
->timer
, SIGNAL(timeout()), this, SLOT(nextFrame()));
96 setSizes(QList
<int>() << 100 << 200 << 800);
104 TimeLineWidget::~TimeLineWidget()
111 * Obtiene la posición de la escena actualmente seleccionada.
113 int TimeLineWidget::scene()
115 if(d
->scenes
.container
->topLevelItemCount() == 0)
118 return d
->scenes
.container
->indexOfTopLevelItem(d
->scenes
.container
->currentItem());
123 * Obtiene la posición del layer actualmente seleccionad0.
125 int TimeLineWidget::layer()
127 const LayerManager
*layers
= layerManager(scene());
131 if( layers
->rowCount() == 0 )
135 if(layers
->currentRow() == -1)
139 return layers
->visualRow(layers
->currentRow());
146 * Obtiene la posición del frame actualmente seleccionado.
148 int TimeLineWidget::frame()
150 FramesTable
*frames
= framesTable(scene());
153 if(frames
->columnCount() == 0)
158 if(frames
->currentColumn() == -1)
163 return frames
->visualColumn(frames
->currentColumn());
170 * Inserta una escena el la posición @p position y con el nombre @p name.
172 void TimeLineWidget::insertScene(int position
, const QString
&name
)
174 if ( position
< 0 || position
> d
->scenes
.container
->topLevelItemCount())
179 LayerManager
*layerManager
= new LayerManager( d
->layers
.container
);
181 connect(layerManager
, SIGNAL(layerRenamed(int, const QString
&)), this, SLOT(onLayerRenamed(int , const QString
&)));
182 connect(layerManager
, SIGNAL(layerLocked(int, bool)), this, SLOT(onLayerLocked(int , bool)));
183 connect(layerManager
, SIGNAL(layerVisibilityChanged(int, bool)), this, SLOT(onLayerVisibilityChanged(int , bool)));
185 layerManager
->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn
);
187 FramesTable
*framesTable
= new FramesTable();
189 connect(framesTable
, SIGNAL(frameSelected(int , int)), this, SLOT(onFrameSelected(int , int )));
190 connect(framesTable
, SIGNAL(layerSelected(int)), this, SLOT(onLayerSelected(int)));
191 connect(framesTable
, SIGNAL(requestInsertFrame(int, int)), this, SLOT(onRequestInsertFrame(int, int)));
192 connect(framesTable
, SIGNAL(requestRemoveFrame(int, int)), this, SLOT(onRequestRemoveFrame(int, int)));
194 connect(framesTable
, SIGNAL(requestCopyFrame(int, int)), this, SLOT(onRequestCopyFrame(int, int)));
195 connect(framesTable
, SIGNAL(requestPasteFrame(int, int)), this, SLOT(onRequestPasteFrame(int, int)));
196 connect(framesTable
, SIGNAL(requestCutFrame(int, int)), this, SLOT(onRequestCutFrame(int, int)));
198 connect(framesTable
, SIGNAL(requestChangeFrameVisibility(int, int, bool)), this, SLOT(onRequestChangeFrameVisibility(int, int, bool)));
199 connect(framesTable
, SIGNAL(requestLockFrame(int, int, bool)), this, SLOT(onRequestLockFrame(int, int, bool)));
201 connect(framesTable
, SIGNAL(requestExpandFrame(int, int, int)), this, SLOT(onRequestExpandFrame(int, int, int)));
203 framesTable
->setItemSize( 10, 20);
204 layerManager
->setRowHeight( 20 );
206 connect(layerManager
->verticalScrollBar(), SIGNAL(valueChanged (int)), framesTable
->verticalScrollBar(), SLOT(setValue(int)));
207 connect(framesTable
->verticalScrollBar(), SIGNAL(valueChanged (int)), layerManager
->verticalScrollBar(), SLOT(setValue(int)));
210 d
->frames
.container
->insertWidget(position
, framesTable
);
211 d
->layers
.container
->insertWidget(position
, layerManager
);
213 QTreeWidgetItem
*newScene
= new QTreeWidgetItem
;
214 newScene
->setFlags(Qt::ItemIsEditable
| Qt::ItemIsSelectable
| Qt::ItemIsEnabled
);
215 newScene
->setText(0, name
);
216 d
->scenes
.container
->insertTopLevelItem(position
, newScene
);
222 * Elimina la escena que esta en la posición @p position.
224 void TimeLineWidget::removeScene(int position
)
226 if ( position
>= 0 && position
< d
->frames
.container
->count() && position
< d
->layers
.container
->count() )
228 QWidget
*w
= d
->frames
.container
->widget(position
);
229 d
->frames
.container
->removeWidget(w
);
232 w
= d
->layers
.container
->widget(position
);
233 d
->layers
.container
->removeWidget(w
);
236 delete d
->scenes
.container
->topLevelItem(position
);
243 * Cambia el nombre de la escena que esta en la posición @p position a @p name.
245 void TimeLineWidget::renameScene(int position
, const QString
&name
)
247 if(position
< 0 || position
>= d
->scenes
.container
->topLevelItemCount() ) return;
248 d
->scenes
.container
->topLevelItem(position
)->setText(0, name
);
253 * Mueve la escena de la posición @p from a la posición @p to.
255 void TimeLineWidget::moveScene(int from
, int to
)
264 for(int i
= from
; i
< to
; i
++)
266 d
->scenes
.container
->insertTopLevelItem(i
, d
->scenes
.container
->takeTopLevelItem(i
+1) );
268 d
->frames
.container
->insertWidget(i
, d
->frames
.container
->widget(i
+1));
270 d
->layers
.container
->insertWidget(i
, d
->layers
.container
->widget(i
+1));
276 * Selecciona la escena que esta en la posición @p position.
278 void TimeLineWidget::setScene(int position
)
280 QTreeWidgetItem
*item
= d
->scenes
.container
->topLevelItem ( position
);
283 d
->scenes
.container
->setCurrentItem(item
);
286 d
->frames
.container
->setCurrentIndex(position
);
287 d
->layers
.container
->setCurrentIndex(position
);
293 * Cierra todas las escenas.
295 void TimeLineWidget::closeAllScenes()
297 while(d
->frames
.container
->currentWidget())
299 delete d
->frames
.container
->currentWidget();
302 while(d
->layers
.container
->currentWidget())
304 delete d
->layers
.container
->currentWidget();
306 d
->scenes
.container
->clear();
311 * Inserta un layer en la posición @p position de la escena @p scenePos, con el nombre @p name.
313 void TimeLineWidget::insertLayer(int scenePos
, int position
, const QString
&name
)
315 LayerManager
*layerManager
= this->layerManager(scenePos
);
318 layerManager
->insertLayer(position
, name
);
321 FramesTable
*fst
= framesTable( scenePos
);
324 fst
->insertLayer(position
, name
);
330 * Inserta un layer de audio en la posición @p position de la escena @p scenePos, con el nombre @p name y la posición del frame donde inicia el audio.
332 void TimeLineWidget::insertAudioLayer(int scenePos
, int position
, const QString
&name
, int startFrame
)
334 LayerManager
*layerManager
= this->layerManager(scenePos
);
337 layerManager
->insertSoundLayer(position
, name
);
340 FramesTable
*fst
= framesTable( scenePos
);
343 fst
->insertSoundLayer(position
, name
);
344 for(int i
= startFrame
; i
< fst
->columnCount(); i
++)
346 fst
->insertFrame(position
, i
, tr(" "));
353 * Elimina el layer que esta en la posicion @p position de la escena @p scenePos.
355 void TimeLineWidget::removeLayer(int scenePos
, int position
)
357 LayerManager
*layerManager
= this->layerManager(scenePos
);
360 layerManager
->removeLayer(position
);
363 FramesTable
*fst
= framesTable( scenePos
);
366 fst
->removeLayer(position
);
372 * Cambia el nombre del layer que se encuentra en la posicion @p layerPos de la escena @p scenePos, por @p name.
374 void TimeLineWidget::renameLayer(int scenePos
, int layerPos
, const QString
&name
)
376 LayerManager
*layerManager
= this->layerManager(scenePos
);
379 layerManager
->renameLayer(layerPos
, name
);
385 * Cambia el estado de visibilidad del layer que esta en la posición @p position de la escena @p scenePos, si @p isVisible es verdadero muestra el layer como visible y si es falso lo muestra como no visible.
387 void TimeLineWidget::setLayerVisibility(int scenePos
, int position
, bool isVisible
)
389 LayerManager
*layerManager
= this->layerManager(scenePos
);
390 layerManager
->blockSignals(true);
393 QTableWidgetItem
*item
= layerManager
->item(layerManager
->visualRow(position
), 2);
396 item
->setCheckState(Qt::Checked
);
400 item
->setCheckState(Qt::Unchecked
);
404 layerManager
->blockSignals(false);
409 * Cambia el estado de bloqueo del layer que esta en la posición @p position de la escena @p scenePos, si @p locked es verdadero muestra el layer como bloqueado y si es falso lo muestra como desbloqueado.
411 void TimeLineWidget::setLayerLocked(int scenePos
, int position
, bool locked
)
413 LayerManager
*layerManager
= this->layerManager(scenePos
);
414 layerManager
->blockSignals(true);
417 QTableWidgetItem
*item
= layerManager
->item(layerManager
->visualRow( position
), 1);
420 item
->setCheckState(Qt::Checked
);
424 item
->setCheckState(Qt::Unchecked
);
427 layerManager
->blockSignals(false);
432 * Mueve el layer de la posición @p from a la posición @p to.
434 void TimeLineWidget::moveLayer(int scenePos
, int from
, int to
)
436 LayerManager
*layerManager
= this->layerManager( scenePos
);
439 layerManager
->moveLayer( from
, to
);
442 FramesTable
*framesTable
= this->framesTable( scenePos
);
445 framesTable
->moveLayer(from
, to
);
451 * Selecciona el layer que esta en la posición @p position, de la escena @p scenePos.
453 void TimeLineWidget::setLayer(int scenePos
, int position
)
457 LayerManager
*layerManager
= this->layerManager( scenePos
);
460 layerManager
->setCurrentCell(layerManager
->verticalHeader()->logicalIndex(position
) , 0);
466 * Inserta un frame en la posición @p position, del layer @p layerPos de la escena @p scenePos, con nombre @p name.
468 void TimeLineWidget::insertFrame(int scenePos
, int layerPos
, int position
, const QString
&name
)
470 FramesTable
*framesTable
= this->framesTable( scenePos
);
473 framesTable
->insertFrame(layerPos
, position
, name
);
479 * Elimina el frame que se encuentra en la posición @p position, del layer @p layerPos de la escena @p scenePos.
481 void TimeLineWidget::removeFrame(int scenePos
, int layerPos
, int position
)
483 FramesTable
*framesTable
= this->framesTable( scenePos
);
486 framesTable
->removeFrame( layerPos
, position
);
492 * Cambia el nombre del frame que se encuentra en la posición @p position, del layer @p layerPos de la escena @p scenePos, por @p name.
494 void TimeLineWidget::renameFrame(int scenePos
, int layerPos
, int position
, const QString
&name
)
499 FramesTable
*framesTable
= this->framesTable( scenePos
);
502 // framesTable->renameFrame( layerPos, position );
503 //TODO: poner nombre en el item
509 * Mueve el frame de la posición @p from a la posición @p to.
511 void TimeLineWidget::moveFrame(int scenePos
, int layerPos
, int from
, int to
)
513 FramesTable
*framesTable
= this->framesTable( scenePos
);
516 framesTable
->moveFrame(layerPos
, from
, to
);
522 * Selecciona el frame que se encuentra en la posición @p position, del layer @p layerPos de la escena @p scenePos.
524 void TimeLineWidget::setFrame(int scenePos
, int layerPos
, int position
)
526 setLayer(scenePos
, layerPos
);
528 FramesTable
*framesTable
= this->framesTable( scenePos
);
531 framesTable
->setCurrentCell( framesTable
->visualRow(layerPos
), position
);
537 * Cambia el estado de visibilidad del frame que se encuentra en la posición @p position, del layer @p layerPos de la escena @p scenePos por @p isVisible, si es verdadero el frame se mostrara como visible, de lo contrario se mostrara como no visible.
539 void TimeLineWidget::setFrameVisibility(int scenePos
, int layerPos
, int position
, bool isVisible
)
541 FramesTable
*framesTable
= this->framesTable( scenePos
);
544 framesTable
->setFrameVisibility(layerPos
, position
, isVisible
);
550 * Cambia el estado de bloqueo del frame que se encuentra en la posición @p position, del layer @p layerPos de la escena @p scenePos por @p locked, si es verdadero el frame se mostrara como bloqueado, de lo contrario se mostrara como desbloqueado.
552 void TimeLineWidget::setFrameLocked(int scenePos
, int layerPos
, int position
, bool locked
)
554 FramesTable
*framesTable
= this->framesTable( scenePos
);
557 framesTable
->lockFrame(layerPos
, position
, locked
);
563 * Agrupa los frames desde la posición @p from hasta la posición @p to.
565 void TimeLineWidget::groupFrames(int scenePos
, int layerPos
, int from
, int to
)
567 FramesTable
*framesTable
= this->framesTable( scenePos
);
570 framesTable
->groupFrames(layerPos
, from
, to
);
576 * Aumenta la duración del frame que se encuentra en la posición @p position, del layer @p layerPos de la escena @p scenePos a @p size.
578 void TimeLineWidget::expandFrame(int scenePos
, int layerPos
, int position
, int size
)
580 FramesTable
*framesTable
= this->framesTable( scenePos
);
583 framesTable
->expandFrame(layerPos
, position
, size
);
589 * Destruye el grupo de frames que se encuentra en la posición @p position, del layer @p layerPos de la escena @p scenePos.
591 void TimeLineWidget::destroyGroupFrames(int scenePos
, int layerPos
, int position
, int size
)
593 FramesTable
*framesTable
= this->framesTable( scenePos
);
596 framesTable
->destroyGroupFrames(layerPos
, position
, size
);
603 void TimeLineWidget::playScene()
605 if(d
->timer
.isActive ())
608 d
->scenes
.play
->setIcon(DGui::IconLoader::self()->load("media-playback-start.svg"));
612 int scenePos
= scene();
614 FramesTable
*framesTable
= this->framesTable( scenePos
);
620 for(int i
= 0; i
< framesTable
->rowCount(); i
++)
622 int lastFrame
= framesTable
->lastFrameByLayer(i
);
624 if(maxFrames
< lastFrame
&& !framesTable
->isSoundLayer(i
))
626 maxFrames
= lastFrame
;
631 setFrame(scenePos
, layer
, frame());
632 d
->scenes
.play
->setIcon(DGui::IconLoader::self()->load("media-playback-pause.svg"));
640 void TimeLineWidget::onItemClicked(QTreeWidgetItem
*item
, int)
642 int index
= d
->scenes
.container
->indexOfTopLevelItem(item
);
643 d
->frames
.container
->setCurrentIndex(index
);
644 d
->layers
.container
->setCurrentIndex(index
);
650 void TimeLineWidget::onItemChanged(QTreeWidgetItem
*item
, int column
)
653 event
.scene
= d
->scenes
.container
->indexOfTopLevelItem(item
);
654 event
.action
= RenameScene
;
655 event
.data
= item
->text(column
);
656 emit
postEvent(event
);
662 void TimeLineWidget::onFrameSelected(int layerPosition
, int framePosition
)
664 // int lastFrame = 0;
666 emit
frameSelected(d
->frames
.container
->currentIndex(), layerPosition
, framePosition
);
667 setLayer(d
->frames
.container
->currentIndex(), layerPosition
);
673 void TimeLineWidget::onLayerSelected(int layerPosition
)
675 setLayer(d
->frames
.container
->currentIndex(), layerPosition
);
681 void TimeLineWidget::onLayerRenamed(int layerPosition
, const QString
&newName
)
684 event
.scene
= d
->layers
.container
->currentIndex();
685 event
.layer
= layerPosition
;
686 event
.action
= RenameLayer
;
687 event
.data
= newName
;
689 emit
postEvent(event
);
695 void TimeLineWidget::onLayerLocked(int layerPosition
, bool locked
)
698 event
.scene
= d
->layers
.container
->currentIndex();
699 event
.layer
= layerPosition
;
700 event
.action
= LockLayer
;
703 emit
postEvent(event
);
709 void TimeLineWidget::onLayerVisibilityChanged(int layerPosition
, bool isVisible
)
712 event
.scene
= d
->layers
.container
->currentIndex();
713 event
.layer
= layerPosition
;
714 event
.action
= ChangeLayerVisibility
;
715 event
.data
= isVisible
;
717 emit
postEvent(event
);
723 void TimeLineWidget::onButtonClicked(int action
)
725 Event e
= d
->createEvent(this, Action(action
));
727 if(e
.action
== InsertFrame
)
731 FramesTable
*frames
= framesTable(scene());
734 lastFrame
= frames
->lastFrameByLayer(e
.layer
);
739 if(lastFrame
< e
.frame
)
741 for(int i
= lastFrame
+1; i
< frame
+1; i
++)
761 void TimeLineWidget::onRequestInsertFrame(int layerPosition
, int framePosition
)
763 Event e
= d
->createEvent(this, InsertFrame
);
767 FramesTable
*frames
= framesTable(scene());
770 lastFrame
= frames
->lastFrameByLayer(e
.layer
);
775 if(lastFrame
< e
.frame
)
777 for(int i
= lastFrame
+1; i
< frame
+1; i
++)
795 void TimeLineWidget::onRequestRemoveFrame(int layerPosition
, int framePosition
)
798 event
.scene
= d
->layers
.container
->currentIndex();
799 event
.layer
= layerPosition
;
800 event
.frame
= framePosition
;
801 event
.action
= RemoveFrame
;
803 emit
postEvent(event
);
809 void TimeLineWidget::onRequestCopyFrame(int layerPosition
, int framePosition
)
812 event
.scene
= d
->layers
.container
->currentIndex();
813 event
.layer
= layerPosition
;
814 event
.frame
= framePosition
;
815 event
.action
= CopyFrame
;
817 emit
postEvent(event
);
823 void TimeLineWidget::onRequestPasteFrame(int layerPosition
, int framePosition
)
825 Event e
= d
->createEvent(this, PasteFrame
);
829 FramesTable
*frames
= framesTable(scene());
832 lastFrame
= frames
->lastFrameByLayer(e
.layer
);
837 if(lastFrame
< e
.frame
)
839 for(int i
= lastFrame
+1; i
< frame
+1; i
++)
854 event.scene = d->layers.container->currentIndex();
855 event.layer = layerPosition;
856 event.frame = framePosition;
857 event.action = PasteFrame;
859 emit postEvent(event);*/
865 void TimeLineWidget::onRequestCutFrame(int layerPosition
, int framePosition
)
868 event
.scene
= d
->layers
.container
->currentIndex();
869 event
.layer
= layerPosition
;
870 event
.frame
= framePosition
;
871 event
.action
= CutFrame
;
873 emit
postEvent(event
);
879 void TimeLineWidget::onRequestLockFrame(int layerPosition
, int framePosition
, bool locked
)
882 event
.scene
= d
->layers
.container
->currentIndex();
883 event
.layer
= layerPosition
;
884 event
.frame
= framePosition
;
885 event
.action
= LockFrame
;
888 emit
postEvent(event
);
894 void TimeLineWidget::onRequestChangeFrameVisibility(int layerPosition
, int framePosition
, bool visibility
)
897 event
.scene
= d
->layers
.container
->currentIndex();
898 event
.layer
= layerPosition
;
899 event
.frame
= framePosition
;
900 event
.action
= ChangeFrameVisibility
;
901 event
.data
= visibility
;
903 emit
postEvent(event
);
909 void TimeLineWidget::onRequestExpandFrame(int layerPosition
, int framePosition
, int size
)
912 event
.scene
= d
->layers
.container
->currentIndex();
913 event
.layer
= layerPosition
;
914 event
.frame
= framePosition
;
915 event
.action
= ExpandFrame
;
919 emit
postEvent(event
);
925 void TimeLineWidget::nextFrame()
927 int scenePos
= scene();
928 int layerPos
= layer();
929 int framePos
= frame();
931 FramesTable
*framesTable
= this->framesTable(scenePos
);
935 if(framePos
< framesTable
->lastFrameByLayer(layerPos
))
937 setFrame(scenePos
, layerPos
, framePos
+1);
941 setFrame(scenePos
, layerPos
, 0);
942 d
->scenes
.play
->setIcon(DGui::IconLoader::self()->load("media-playback-start.svg"));
951 LayerManager
*TimeLineWidget::layerManager(int sceneIndex
)
953 return qobject_cast
<LayerManager
*>(d
->layers
.container
->widget(sceneIndex
));
959 FramesTable
*TimeLineWidget::framesTable(int sceneIndex
)
961 return qobject_cast
<FramesTable
*>(d
->frames
.container
->widget(sceneIndex
));
967 void TimeLineWidget::setupButtons()
969 d
->scenes
.insert
->setIcon(DGui::IconLoader::self()->load("list-add.svg"));
970 d
->scenes
.insert
->setToolTip(tr("Insert a scene"));
972 d
->scenes
.remove
->setIcon(DGui::IconLoader::self()->load("list-remove.svg"));
973 d
->scenes
.remove
->setToolTip(tr("Remove the scene"));
975 d
->scenes
.up
->setIcon(DGui::IconLoader::self()->load("go-up.svg"));
976 d
->scenes
.up
->setToolTip(tr("Move up scene"));
978 d
->scenes
.down
->setIcon(DGui::IconLoader::self()->load("go-down.svg"));
979 d
->scenes
.down
->setToolTip(tr("Move down scene"));
981 d
->scenes
.play
->setIcon(DGui::IconLoader::self()->load("media-playback-start.svg"));
982 d
->scenes
.play
->setToolTip(tr("Play scene"));
984 connect(d
->scenes
.play
, SIGNAL(clicked()), this, SLOT(playScene()));
986 d
->layers
.insert
->setIcon(DGui::IconLoader::self()->load("add-layer.svg"));
987 d
->layers
.insert
->setToolTip(tr("Insert a layer"));
989 d
->layers
.remove
->setIcon(DGui::IconLoader::self()->load("list-remove.svg"));
990 d
->layers
.remove
->setToolTip(tr("Remove the layer"));
992 d
->layers
.up
->setIcon(DGui::IconLoader::self()->load("go-up.svg"));
993 d
->layers
.up
->setToolTip(tr("Move up layer"));
995 d
->layers
.down
->setIcon(DGui::IconLoader::self()->load("go-down.svg"));
996 d
->layers
.down
->setToolTip(tr("Move down layer"));
998 d
->frames
.insert
->setIcon(DGui::IconLoader::self()->load("list-add.svg"));
999 d
->frames
.insert
->setToolTip(tr("Insert a frame"));
1001 d
->frames
.remove
->setIcon(DGui::IconLoader::self()->load("list-remove.svg"));
1002 d
->frames
.remove
->setToolTip(tr("Remove the frame"));
1004 d
->frames
.up
->setIcon(DGui::IconLoader::self()->load("go-previous.svg"));
1005 d
->frames
.up
->setToolTip(tr("Move up frame"));
1007 d
->frames
.down
->setIcon(DGui::IconLoader::self()->load("go-next.svg"));
1008 d
->frames
.down
->setToolTip(tr("Move down frame"));
1010 d
->actions
.addButton(d
->scenes
.insert
, InsertScene
);
1011 d
->actions
.addButton(d
->scenes
.remove
, RemoveScene
);
1012 d
->actions
.addButton(d
->scenes
.up
, MoveSceneUp
);
1013 d
->actions
.addButton(d
->scenes
.down
, MoveSceneDown
);
1015 d
->actions
.addButton(d
->layers
.insert
, InsertLayer
);
1016 d
->actions
.addButton(d
->layers
.remove
, RemoveLayer
);
1017 d
->actions
.addButton(d
->layers
.up
, MoveLayerUp
);
1018 d
->actions
.addButton(d
->layers
.down
, MoveLayerDown
);
1020 d
->actions
.addButton(d
->frames
.insert
, InsertFrame
);
1021 d
->actions
.addButton(d
->frames
.remove
, RemoveFrame
);
1022 d
->actions
.addButton(d
->frames
.up
, MoveFrameUp
);
1023 d
->actions
.addButton(d
->frames
.down
, MoveFrameDown
);