| 
									
										
										
										
											2010-11-01 17:03:46 +01:00
										 |  |  | /**************************************************************************
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** This file is part of Qt Creator | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-01-11 16:28:15 +01:00
										 |  |  | ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). | 
					
						
							| 
									
										
										
										
											2010-11-01 17:03:46 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | ** Contact: Nokia Corporation (info@qt.nokia.com) | 
					
						
							| 
									
										
										
										
											2010-11-01 17:03:46 +01:00
										 |  |  | ** | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** GNU Lesser General Public License Usage | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | ** 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.
 | 
					
						
							| 
									
										
										
										
											2010-11-01 17:03:46 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2010-12-17 16:01:08 +01:00
										 |  |  | ** In addition, as a special exception, Nokia gives you certain additional | 
					
						
							| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | ** rights. These rights are described in the Nokia Qt LGPL Exception | 
					
						
							| 
									
										
										
										
											2010-12-17 16:01:08 +01:00
										 |  |  | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | ** Other Usage | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Alternatively, this file may be used in accordance with the terms and | 
					
						
							|  |  |  | ** conditions contained in a signed written agreement between you and Nokia. | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2010-12-17 16:01:08 +01:00
										 |  |  | ** If you have questions regarding the use of this file, please contact | 
					
						
							|  |  |  | ** Nokia at qt-info@nokia.com. | 
					
						
							| 
									
										
										
										
											2010-11-01 17:03:46 +01:00
										 |  |  | ** | 
					
						
							|  |  |  | **************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | #include "qmltoolbar.h"
 | 
					
						
							|  |  |  | #include "toolbarcolorbox.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-24 12:30:21 +01:00
										 |  |  | #include <QtGui/QLabel>
 | 
					
						
							|  |  |  | #include <QtGui/QIcon>
 | 
					
						
							|  |  |  | #include <QtGui/QAction>
 | 
					
						
							|  |  |  | #include <QtGui/QMenu>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QtCore/QDebug>
 | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-09-22 09:59:18 +02:00
										 |  |  | namespace QmlJSDebugger { | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-22 14:23:57 +01:00
										 |  |  | QmlToolBar::QmlToolBar(QWidget *parent) | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  |     : QToolBar(parent) | 
					
						
							|  |  |  |     , m_emitSignals(true) | 
					
						
							| 
									
										
										
										
											2011-03-16 19:59:49 +01:00
										 |  |  |     , m_paused(false) | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  |     , m_animationSpeed(1.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-12-01 11:46:49 +01: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); | 
					
						
							| 
									
										
										
										
											2010-12-01 11:46:49 +01:00
										 |  |  |     ui->selectMarquee = new QAction(QIcon(QLatin1String(":/qml/images/select-marquee-24.png")), | 
					
						
							|  |  |  |                                     tr("Select (Marquee)"), this); | 
					
						
							| 
									
										
										
										
											2010-08-02 10:46:48 +02:00
										 |  |  |     ui->zoom = new QAction(QIcon(QLatin1String(":/qml/images/zoom-24.png")), tr("Zoom"), this); | 
					
						
							| 
									
										
										
										
											2010-12-01 11:46:49 +01:00
										 |  |  |     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); | 
					
						
							| 
									
										
										
										
											2011-03-16 19:59:49 +01:00
										 |  |  |     ui->playSpeedMenuActions = new QActionGroup(this); | 
					
						
							|  |  |  |     ui->playSpeedMenuActions->setExclusive(true); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     QAction *speedAction = playSpeedMenu->addAction(tr("1x"), this, SLOT(changeAnimationSpeed())); | 
					
						
							|  |  |  |     speedAction->setCheckable(true); | 
					
						
							|  |  |  |     speedAction->setChecked(true); | 
					
						
							|  |  |  |     speedAction->setData(1.0f); | 
					
						
							|  |  |  |     ui->playSpeedMenuActions->addAction(speedAction); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     speedAction = playSpeedMenu->addAction(tr("0.5x"), this, SLOT(changeAnimationSpeed())); | 
					
						
							|  |  |  |     speedAction->setCheckable(true); | 
					
						
							|  |  |  |     speedAction->setData(2.0f); | 
					
						
							|  |  |  |     ui->playSpeedMenuActions->addAction(speedAction); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     speedAction = playSpeedMenu->addAction(tr("0.25x"), this, SLOT(changeAnimationSpeed())); | 
					
						
							|  |  |  |     speedAction->setCheckable(true); | 
					
						
							|  |  |  |     speedAction->setData(4.0f); | 
					
						
							|  |  |  |     ui->playSpeedMenuActions->addAction(speedAction); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     speedAction = playSpeedMenu->addAction(tr("0.125x"), this, SLOT(changeAnimationSpeed())); | 
					
						
							|  |  |  |     speedAction->setCheckable(true); | 
					
						
							|  |  |  |     speedAction->setData(8.0f); | 
					
						
							|  |  |  |     ui->playSpeedMenuActions->addAction(speedAction); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     speedAction = playSpeedMenu->addAction(tr("0.1x"), this, SLOT(changeAnimationSpeed())); | 
					
						
							|  |  |  |     speedAction->setCheckable(true); | 
					
						
							|  |  |  |     speedAction->setData(10.0f); | 
					
						
							|  |  |  |     ui->playSpeedMenuActions->addAction(speedAction); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  |     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())); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-22 14:23:57 +01:00
										 |  |  | QmlToolBar::~QmlToolBar() | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     delete ui; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-22 14:23:57 +01:00
										 |  |  | void QmlToolBar::activateColorPicker() | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     m_emitSignals = false; | 
					
						
							|  |  |  |     activateColorPickerOnClick(); | 
					
						
							|  |  |  |     m_emitSignals = true; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-22 14:23:57 +01:00
										 |  |  | void QmlToolBar::activateSelectTool() | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     m_emitSignals = false; | 
					
						
							|  |  |  |     activateSelectToolOnClick(); | 
					
						
							|  |  |  |     m_emitSignals = true; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-22 14:23:57 +01:00
										 |  |  | void QmlToolBar::activateMarqueeSelectTool() | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     m_emitSignals = false; | 
					
						
							|  |  |  |     activateMarqueeSelectToolOnClick(); | 
					
						
							|  |  |  |     m_emitSignals = true; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-22 14:23:57 +01:00
										 |  |  | void QmlToolBar::activateZoom() | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     m_emitSignals = false; | 
					
						
							|  |  |  |     activateZoomOnClick(); | 
					
						
							|  |  |  |     m_emitSignals = true; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-16 19:59:49 +01:00
										 |  |  | void QmlToolBar::setAnimationSpeed(qreal slowDownFactor) | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-03-16 19:59:49 +01:00
										 |  |  |     if (m_animationSpeed == slowDownFactor) | 
					
						
							|  |  |  |         return; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  |     m_emitSignals = false; | 
					
						
							| 
									
										
										
										
											2011-03-16 19:59:49 +01:00
										 |  |  |     m_animationSpeed = slowDownFactor; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     foreach (QAction *action, ui->playSpeedMenuActions->actions()) { | 
					
						
							|  |  |  |         if (action->data().toReal() == slowDownFactor) { | 
					
						
							|  |  |  |             action->setChecked(true); | 
					
						
							|  |  |  |             break; | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     m_emitSignals = true; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-22 10:37:14 +01:00
										 |  |  | void QmlToolBar::setAnimationPaused(bool paused) | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-03-16 19:59:49 +01:00
										 |  |  |     if (m_paused == paused) | 
					
						
							|  |  |  |         return; | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-16 19:59:49 +01:00
										 |  |  |     m_paused = paused; | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  |     updatePlayAction(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-16 19:59:49 +01:00
										 |  |  | void QmlToolBar::changeAnimationSpeed() | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-03-16 19:59:49 +01:00
										 |  |  |     QAction *action = qobject_cast<QAction*>(sender()); | 
					
						
							|  |  |  |     m_animationSpeed = action->data().toReal(); | 
					
						
							|  |  |  |     emit animationSpeedChanged(m_animationSpeed); | 
					
						
							| 
									
										
										
										
											2010-08-24 18:40:57 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-22 14:23:57 +01:00
										 |  |  | void QmlToolBar::setDesignModeBehavior(bool inDesignMode) | 
					
						
							| 
									
										
										
										
											2010-07-12 12:02:35 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     m_emitSignals = false; | 
					
						
							|  |  |  |     ui->designmode->setChecked(inDesignMode); | 
					
						
							|  |  |  |     setDesignModeBehaviorOnClick(inDesignMode); | 
					
						
							|  |  |  |     m_emitSignals = true; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-22 14:23:57 +01:00
										 |  |  | void QmlToolBar::setDesignModeBehaviorOnClick(bool checked) | 
					
						
							| 
									
										
										
										
											2010-07-12 12:02:35 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     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); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-22 14:23:57 +01:00
										 |  |  | void QmlToolBar::setColorBoxColor(const QColor &color) | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     ui->colorBox->setColor(color); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-22 14:23:57 +01:00
										 |  |  | void QmlToolBar::activatePlayOnClick() | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-03-16 19:59:49 +01:00
										 |  |  |     m_paused = !m_paused; | 
					
						
							| 
									
										
										
										
											2011-03-22 10:37:14 +01:00
										 |  |  |     emit animationPausedChanged(m_paused); | 
					
						
							| 
									
										
										
										
											2011-03-16 19:59:49 +01:00
										 |  |  |     updatePlayAction(); | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-22 14:23:57 +01:00
										 |  |  | void QmlToolBar::updatePlayAction() | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-03-16 19:59:49 +01:00
										 |  |  |     ui->play->setIcon(m_paused ? ui->playIcon : ui->pauseIcon); | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-22 14:23:57 +01:00
										 |  |  | void QmlToolBar::activateColorPickerOnClick() | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     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(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-22 14:23:57 +01:00
										 |  |  | void QmlToolBar::activateSelectToolOnClick() | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     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(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-22 14:23:57 +01:00
										 |  |  | void QmlToolBar::activateMarqueeSelectToolOnClick() | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     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(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-22 14:23:57 +01:00
										 |  |  | void QmlToolBar::activateZoomOnClick() | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     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(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-22 14:23:57 +01:00
										 |  |  | void QmlToolBar::activateFromQml() | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     if (m_emitSignals) | 
					
						
							|  |  |  |         emit applyChangesFromQmlFileSelected(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-22 14:23:57 +01:00
										 |  |  | void QmlToolBar::activateToQml() | 
					
						
							| 
									
										
										
										
											2010-07-08 14:00:33 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     if (m_emitSignals) | 
					
						
							|  |  |  |         emit applyChangesToQmlFileSelected(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-09 16:59:43 +01:00
										 |  |  | } // namespace QmlJSDebugger
 |