]> git.sesse.net Git - kdenlive/blob - src/monitorscenecontrolwidget.cpp
When adding an existing kdenlive title clip to the project , detach embedded images:
[kdenlive] / src / monitorscenecontrolwidget.cpp
1 /***************************************************************************
2  *   Copyright (C) 2010 by Till Theato (root@ttill.de)                     *
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This program is distributed in the hope that it will be useful,       *
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
18  ***************************************************************************/
19
20 #include "monitorscenecontrolwidget.h"
21 #include "monitorscene.h"
22 #include "kdenlivesettings.h"
23
24
25 MonitorSceneControlWidget::MonitorSceneControlWidget(MonitorScene* scene, QWidget* parent) :
26         QWidget(parent),
27         m_scene(scene)
28 {
29     m_ui.setupUi(this);
30
31     m_buttonConfig = new QToolButton();
32     m_buttonConfig->setCheckable(true);
33     m_buttonConfig->setAutoRaise(true);
34     m_buttonConfig->setIcon(KIcon("system-run"));
35     m_buttonConfig->setToolTip(i18n("Show/Hide Settings"));
36     this->setHidden(true);
37
38     m_ui.buttonShowScene->setIcon(KIcon("video-display"));
39     m_ui.buttonShowScene->setToolTip(i18n("Show monitor scene"));
40     m_ui.buttonDirectUpdate->setIcon(KIcon("transform-scale"));
41     m_ui.buttonDirectUpdate->setToolTip(i18n("Update parameters while monitor scene changes"));
42     m_ui.buttonDirectUpdate->setChecked(KdenliveSettings::monitorscene_directupdate());
43
44     m_ui.buttonZoomFit->setIcon(KIcon("zoom-fit-best"));
45     m_ui.buttonZoomFit->setToolTip(i18n("Fit zoom to monitor size"));
46     m_ui.buttonZoomOriginal->setIcon(KIcon("zoom-original"));
47     m_ui.buttonZoomOriginal->setToolTip(i18n("Original size"));
48     m_ui.buttonZoomIn->setIcon(KIcon("zoom-in"));
49     m_ui.buttonZoomIn->setToolTip(i18n("Zoom in"));
50     m_ui.buttonZoomOut->setIcon(KIcon("zoom-out"));
51     m_ui.buttonZoomOut->setToolTip(i18n("Zoom out"));
52
53     connect(m_buttonConfig, SIGNAL(toggled(bool)), this, SLOT(setVisible(bool)));
54
55     connect(m_ui.sliderZoom, SIGNAL(valueChanged(int)), m_scene, SLOT(slotZoom(int)));
56     connect(m_scene, SIGNAL(zoomChanged(int)), m_ui.sliderZoom, SLOT(setValue(int)));
57     connect(m_ui.buttonZoomFit,      SIGNAL(clicked()), m_scene, SLOT(slotZoomFit()));
58     connect(m_ui.buttonZoomOriginal, SIGNAL(clicked()), m_scene, SLOT(slotZoomOriginal()));
59     connect(m_ui.buttonZoomIn,       SIGNAL(clicked()), m_scene, SLOT(slotZoomIn()));
60     connect(m_ui.buttonZoomOut,      SIGNAL(clicked()), m_scene, SLOT(slotZoomOut()));
61     m_scene->slotZoomFit();
62
63     connect(m_ui.buttonShowScene, SIGNAL(toggled(bool)), this, SIGNAL(showScene(bool)));
64     connect(m_ui.buttonDirectUpdate, SIGNAL(toggled(bool)), this, SLOT(slotSetDirectUpdate(bool)));
65 }
66
67 MonitorSceneControlWidget::~MonitorSceneControlWidget()
68 {
69     delete m_buttonConfig;
70 }
71
72 QToolButton *MonitorSceneControlWidget::getShowHideButton()
73 {
74     return m_buttonConfig;
75 }
76
77 void MonitorSceneControlWidget::slotSetDirectUpdate(bool directUpdate)
78 {
79     KdenliveSettings::setMonitorscene_directupdate(directUpdate);
80 }
81
82
83 #include "monitorscenecontrolwidget.moc"