| 
									
										
										
										
											2010-11-01 17:03:46 +01:00
										 |  |  | /**************************************************************************
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** This file is part of Qt Creator | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Contact: Nokia Corporation (qt-info@nokia.com) | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Commercial Usage | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Licensees holding valid Qt Commercial licenses may use this file in | 
					
						
							|  |  |  | ** accordance with the Qt Commercial License Agreement provided with the | 
					
						
							|  |  |  | ** Software or, alternatively, in accordance with the terms contained in | 
					
						
							|  |  |  | ** a written agreement between you and Nokia. | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** GNU Lesser General Public License Usage | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Alternatively, this file may be used under the terms of the GNU Lesser | 
					
						
							|  |  |  | ** General Public License version 2.1 as published by the Free Software | 
					
						
							|  |  |  | ** Foundation and appearing in the file LICENSE.LGPL included in the | 
					
						
							|  |  |  | ** packaging of this file.  Please review the following information to | 
					
						
							|  |  |  | ** ensure the GNU Lesser General Public License version 2.1 requirements | 
					
						
							|  |  |  | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** If you are unsure which license is appropriate for your use, please | 
					
						
							|  |  |  | ** contact the sales department at http://qt.nokia.com/contact.
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | **************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | #include <QLabel>
 | 
					
						
							|  |  |  | #include <QIcon>
 | 
					
						
							|  |  |  | #include <QAction>
 | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  | #include <QMenu>
 | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "qmltoolbar.h"
 | 
					
						
							|  |  |  | #include "toolbarcolorbox.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QDebug>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-09-22 09:59:18 +02:00
										 |  |  | namespace QmlJSDebugger { | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  | QmlToolbar::QmlToolbar(QWidget *parent) | 
					
						
							|  |  |  |     : QToolBar(parent) | 
					
						
							|  |  |  |     , m_emitSignals(true) | 
					
						
							|  |  |  |     , m_isRunning(false) | 
					
						
							|  |  |  |     , m_animationSpeed(1.0f) | 
					
						
							|  |  |  |     , m_previousAnimationSpeed(0.0f) | 
					
						
							|  |  |  |     , ui(new Ui) | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  |     ui->playIcon = QIcon(QLatin1String(":/qml/images/play-24.png")); | 
					
						
							|  |  |  |     ui->pauseIcon = QIcon(QLatin1String(":/qml/images/pause-24.png")); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-24 16:30:24 +02:00
										 |  |  |     ui->designmode = new QAction(QIcon(QLatin1String(":/qml/images/observermode-24.png")), tr("Observer Mode"), this); | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  |     ui->play = new QAction(ui->pauseIcon, tr("Play/Pause Animations"), this); | 
					
						
							| 
									
										
										
										
											2010-08-02 10:46:48 +02:00
										 |  |  |     ui->select = new QAction(QIcon(QLatin1String(":/qml/images/select-24.png")), tr("Select"), this); | 
					
						
							|  |  |  |     ui->selectMarquee = new QAction(QIcon(QLatin1String(":/qml/images/select-marquee-24.png")), tr("Select (Marquee)"), this); | 
					
						
							|  |  |  |     ui->zoom = new QAction(QIcon(QLatin1String(":/qml/images/zoom-24.png")), tr("Zoom"), this); | 
					
						
							|  |  |  |     ui->colorPicker = new QAction(QIcon(QLatin1String(":/qml/images/color-picker-24.png")), tr("Color Picker"), this); | 
					
						
							|  |  |  |     ui->toQml = new QAction(QIcon(QLatin1String(":/qml/images/to-qml-24.png")), tr("Apply Changes to QML Viewer"), this); | 
					
						
							|  |  |  |     ui->fromQml = new QAction(QIcon(QLatin1String(":/qml/images/from-qml-24.png")), tr("Apply Changes to Document"), this); | 
					
						
							| 
									
										
										
										
											2010-07-12 12:02:35 +02:00
										 |  |  |     ui->designmode->setCheckable(true); | 
					
						
							|  |  |  |     ui->designmode->setChecked(false); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  |     ui->play->setCheckable(false); | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  |     ui->select->setCheckable(true); | 
					
						
							|  |  |  |     ui->selectMarquee->setCheckable(true); | 
					
						
							|  |  |  |     ui->zoom->setCheckable(true); | 
					
						
							|  |  |  |     ui->colorPicker->setCheckable(true); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     setWindowTitle(tr("Tools")); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-12 12:02:35 +02:00
										 |  |  |     addAction(ui->designmode); | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  |     addAction(ui->play); | 
					
						
							|  |  |  |     addSeparator(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     addAction(ui->select); | 
					
						
							| 
									
										
										
										
											2010-08-26 16:31:06 +02:00
										 |  |  |     // disabled because multi selection does not do anything useful without design mode
 | 
					
						
							|  |  |  |     //addAction(ui->selectMarquee);
 | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  |     addSeparator(); | 
					
						
							|  |  |  |     addAction(ui->zoom); | 
					
						
							|  |  |  |     addAction(ui->colorPicker); | 
					
						
							| 
									
										
										
										
											2010-07-30 11:48:05 +02:00
										 |  |  |     //addAction(ui->fromQml);
 | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     ui->colorBox = new ToolBarColorBox(this); | 
					
						
							|  |  |  |     ui->colorBox->setMinimumSize(24, 24); | 
					
						
							|  |  |  |     ui->colorBox->setMaximumSize(28, 28); | 
					
						
							|  |  |  |     ui->colorBox->setColor(Qt::black); | 
					
						
							|  |  |  |     addWidget(ui->colorBox); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     setWindowFlags(Qt::Tool); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  |     QMenu *playSpeedMenu = new QMenu(this); | 
					
						
							|  |  |  |     QActionGroup *playSpeedMenuActions = new QActionGroup(this); | 
					
						
							|  |  |  |     playSpeedMenuActions->setExclusive(true); | 
					
						
							|  |  |  |     playSpeedMenu->addAction(tr("Animation Speed")); | 
					
						
							|  |  |  |     playSpeedMenu->addSeparator(); | 
					
						
							|  |  |  |     ui->defaultAnimSpeedAction = playSpeedMenu->addAction(tr("1x"), this, SLOT(changeToDefaultAnimSpeed())); | 
					
						
							|  |  |  |     ui->defaultAnimSpeedAction->setCheckable(true); | 
					
						
							|  |  |  |     ui->defaultAnimSpeedAction->setChecked(true); | 
					
						
							|  |  |  |     playSpeedMenuActions->addAction(ui->defaultAnimSpeedAction); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ui->halfAnimSpeedAction = playSpeedMenu->addAction(tr("0.5x"), this, SLOT(changeToHalfAnimSpeed())); | 
					
						
							|  |  |  |     ui->halfAnimSpeedAction->setCheckable(true); | 
					
						
							|  |  |  |     playSpeedMenuActions->addAction(ui->halfAnimSpeedAction); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ui->fourthAnimSpeedAction = playSpeedMenu->addAction(tr("0.25x"), this, SLOT(changeToFourthAnimSpeed())); | 
					
						
							|  |  |  |     ui->fourthAnimSpeedAction->setCheckable(true); | 
					
						
							|  |  |  |     playSpeedMenuActions->addAction(ui->fourthAnimSpeedAction); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ui->eighthAnimSpeedAction = playSpeedMenu->addAction(tr("0.125x"), this, SLOT(changeToEighthAnimSpeed())); | 
					
						
							|  |  |  |     ui->eighthAnimSpeedAction->setCheckable(true); | 
					
						
							|  |  |  |     playSpeedMenuActions->addAction(ui->eighthAnimSpeedAction); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ui->tenthAnimSpeedAction = playSpeedMenu->addAction(tr("0.1x"), this, SLOT(changeToTenthAnimSpeed())); | 
					
						
							|  |  |  |     ui->tenthAnimSpeedAction->setCheckable(true); | 
					
						
							|  |  |  |     playSpeedMenuActions->addAction(ui->tenthAnimSpeedAction); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ui->menuPauseAction = playSpeedMenu->addAction(tr("Pause"), this, SLOT(updatePauseAction())); | 
					
						
							|  |  |  |     ui->menuPauseAction->setCheckable(true); | 
					
						
							|  |  |  |     ui->menuPauseAction->setIcon(ui->pauseIcon); | 
					
						
							|  |  |  |     playSpeedMenuActions->addAction(ui->menuPauseAction); | 
					
						
							|  |  |  |     ui->play->setMenu(playSpeedMenu); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-12 12:02:35 +02:00
										 |  |  |     connect(ui->designmode, SIGNAL(toggled(bool)), SLOT(setDesignModeBehaviorOnClick(bool))); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  |     connect(ui->colorPicker, SIGNAL(triggered()), SLOT(activateColorPickerOnClick())); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     connect(ui->play, SIGNAL(triggered()), SLOT(activatePlayOnClick())); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     connect(ui->zoom, SIGNAL(triggered()), SLOT(activateZoomOnClick())); | 
					
						
							|  |  |  |     connect(ui->colorPicker, SIGNAL(triggered()), SLOT(activateColorPickerOnClick())); | 
					
						
							|  |  |  |     connect(ui->select, SIGNAL(triggered()), SLOT(activateSelectToolOnClick())); | 
					
						
							|  |  |  |     connect(ui->selectMarquee, SIGNAL(triggered()), SLOT(activateMarqueeSelectToolOnClick())); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     connect(ui->toQml, SIGNAL(triggered()), SLOT(activateToQml())); | 
					
						
							|  |  |  |     connect(ui->fromQml, SIGNAL(triggered()), SLOT(activateFromQml())); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | QmlToolbar::~QmlToolbar() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     delete ui; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void QmlToolbar::activateColorPicker() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_emitSignals = false; | 
					
						
							|  |  |  |     activateColorPickerOnClick(); | 
					
						
							|  |  |  |     m_emitSignals = true; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void QmlToolbar::activateSelectTool() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_emitSignals = false; | 
					
						
							|  |  |  |     activateSelectToolOnClick(); | 
					
						
							|  |  |  |     m_emitSignals = true; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void QmlToolbar::activateMarqueeSelectTool() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_emitSignals = false; | 
					
						
							|  |  |  |     activateMarqueeSelectToolOnClick(); | 
					
						
							|  |  |  |     m_emitSignals = true; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void QmlToolbar::activateZoom() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_emitSignals = false; | 
					
						
							|  |  |  |     activateZoomOnClick(); | 
					
						
							|  |  |  |     m_emitSignals = true; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  | void QmlToolbar::setAnimationSpeed(qreal slowdownFactor) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_emitSignals = false; | 
					
						
							|  |  |  |     if (slowdownFactor != 0) { | 
					
						
							|  |  |  |         m_animationSpeed = slowdownFactor; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if (slowdownFactor == 1.0f) { | 
					
						
							|  |  |  |             ui->defaultAnimSpeedAction->setChecked(true); | 
					
						
							|  |  |  |         } else if (slowdownFactor == 2.0f) { | 
					
						
							|  |  |  |             ui->halfAnimSpeedAction->setChecked(true); | 
					
						
							|  |  |  |         } else if (slowdownFactor == 4.0f) { | 
					
						
							|  |  |  |             ui->fourthAnimSpeedAction->setChecked(true); | 
					
						
							|  |  |  |         } else if (slowdownFactor == 8.0f) { | 
					
						
							|  |  |  |             ui->eighthAnimSpeedAction->setChecked(true); | 
					
						
							|  |  |  |         } else if (slowdownFactor == 10.0f) { | 
					
						
							|  |  |  |             ui->tenthAnimSpeedAction->setChecked(true); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         updatePlayAction(); | 
					
						
							|  |  |  |     } else { | 
					
						
							|  |  |  |         ui->menuPauseAction->setChecked(true); | 
					
						
							|  |  |  |         updatePauseAction(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     m_emitSignals = true; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void QmlToolbar::changeToDefaultAnimSpeed() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_animationSpeed = 1.0f; | 
					
						
							|  |  |  |     updatePlayAction(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void QmlToolbar::changeToHalfAnimSpeed() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_animationSpeed = 2.0f; | 
					
						
							|  |  |  |     updatePlayAction(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void QmlToolbar::changeToFourthAnimSpeed() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_animationSpeed = 4.0f; | 
					
						
							|  |  |  |     updatePlayAction(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void QmlToolbar::changeToEighthAnimSpeed() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_animationSpeed = 8.0f; | 
					
						
							|  |  |  |     updatePlayAction(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void QmlToolbar::changeToTenthAnimSpeed() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_animationSpeed = 10.0f; | 
					
						
							|  |  |  |     updatePlayAction(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-12 12:02:35 +02:00
										 |  |  | void QmlToolbar::setDesignModeBehavior(bool inDesignMode) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_emitSignals = false; | 
					
						
							|  |  |  |     ui->designmode->setChecked(inDesignMode); | 
					
						
							|  |  |  |     setDesignModeBehaviorOnClick(inDesignMode); | 
					
						
							|  |  |  |     m_emitSignals = true; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void QmlToolbar::setDesignModeBehaviorOnClick(bool checked) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     ui->play->setEnabled(checked); | 
					
						
							|  |  |  |     ui->select->setEnabled(checked); | 
					
						
							|  |  |  |     ui->selectMarquee->setEnabled(checked); | 
					
						
							|  |  |  |     ui->zoom->setEnabled(checked); | 
					
						
							|  |  |  |     ui->colorPicker->setEnabled(checked); | 
					
						
							|  |  |  |     ui->toQml->setEnabled(checked); | 
					
						
							|  |  |  |     ui->fromQml->setEnabled(checked); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (m_emitSignals) | 
					
						
							|  |  |  |         emit designModeBehaviorChanged(checked); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | void QmlToolbar::setColorBoxColor(const QColor &color) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     ui->colorBox->setColor(color); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void QmlToolbar::activatePlayOnClick() | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  |     if (m_isRunning) { | 
					
						
							|  |  |  |         updatePauseAction(); | 
					
						
							|  |  |  |     } else { | 
					
						
							|  |  |  |         updatePlayAction(); | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  | void QmlToolbar::updatePlayAction() | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  |     m_isRunning = true; | 
					
						
							|  |  |  |     ui->play->setIcon(ui->pauseIcon); | 
					
						
							|  |  |  |     if (m_animationSpeed != m_previousAnimationSpeed) | 
					
						
							|  |  |  |         m_previousAnimationSpeed = m_animationSpeed; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (m_emitSignals) | 
					
						
							|  |  |  |         emit animationSpeedChanged(m_animationSpeed); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void QmlToolbar::updatePauseAction() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_isRunning = false; | 
					
						
							|  |  |  |     ui->play->setIcon(ui->playIcon); | 
					
						
							|  |  |  |     if (m_emitSignals) | 
					
						
							|  |  |  |         emit animationSpeedChanged(0.0f); | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void QmlToolbar::activateColorPickerOnClick() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     ui->zoom->setChecked(false); | 
					
						
							|  |  |  |     ui->select->setChecked(false); | 
					
						
							|  |  |  |     ui->selectMarquee->setChecked(false); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ui->colorPicker->setChecked(true); | 
					
						
							|  |  |  |     if (m_activeTool != Constants::ColorPickerMode) { | 
					
						
							|  |  |  |         m_activeTool = Constants::ColorPickerMode; | 
					
						
							|  |  |  |         if (m_emitSignals) | 
					
						
							|  |  |  |             emit colorPickerSelected(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void QmlToolbar::activateSelectToolOnClick() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     ui->zoom->setChecked(false); | 
					
						
							|  |  |  |     ui->selectMarquee->setChecked(false); | 
					
						
							|  |  |  |     ui->colorPicker->setChecked(false); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ui->select->setChecked(true); | 
					
						
							|  |  |  |     if (m_activeTool != Constants::SelectionToolMode) { | 
					
						
							|  |  |  |         m_activeTool = Constants::SelectionToolMode; | 
					
						
							|  |  |  |         if (m_emitSignals) | 
					
						
							|  |  |  |             emit selectToolSelected(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void QmlToolbar::activateMarqueeSelectToolOnClick() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     ui->zoom->setChecked(false); | 
					
						
							|  |  |  |     ui->select->setChecked(false); | 
					
						
							|  |  |  |     ui->colorPicker->setChecked(false); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ui->selectMarquee->setChecked(true); | 
					
						
							|  |  |  |     if (m_activeTool != Constants::MarqueeSelectionToolMode) { | 
					
						
							|  |  |  |         m_activeTool = Constants::MarqueeSelectionToolMode; | 
					
						
							|  |  |  |         if (m_emitSignals) | 
					
						
							|  |  |  |             emit marqueeSelectToolSelected(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void QmlToolbar::activateZoomOnClick() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     ui->select->setChecked(false); | 
					
						
							|  |  |  |     ui->selectMarquee->setChecked(false); | 
					
						
							|  |  |  |     ui->colorPicker->setChecked(false); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ui->zoom->setChecked(true); | 
					
						
							|  |  |  |     if (m_activeTool != Constants::ZoomMode) { | 
					
						
							|  |  |  |         m_activeTool = Constants::ZoomMode; | 
					
						
							|  |  |  |         if (m_emitSignals) | 
					
						
							|  |  |  |             emit zoomToolSelected(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void QmlToolbar::activateFromQml() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     if (m_emitSignals) | 
					
						
							|  |  |  |         emit applyChangesFromQmlFileSelected(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void QmlToolbar::activateToQml() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     if (m_emitSignals) | 
					
						
							|  |  |  |         emit applyChangesToQmlFileSelected(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |