Commit fccd4d5e authored by Lasse Holmstedt's avatar Lasse Holmstedt
Browse files

QML Inspector: Disabled rubberband selection tool

It was not very useful without being able to e.g. move things around.
parent 05f2fd66
......@@ -45,7 +45,8 @@ QmlToolbar::QmlToolbar(QWidget *parent)
addSeparator();
addAction(ui->select);
addAction(ui->selectMarquee);
// disabled because multi selection does not do anything useful without design mode
//addAction(ui->selectMarquee);
addSeparator();
addAction(ui->zoom);
addAction(ui->colorPicker);
......
......@@ -222,9 +222,10 @@ void QDeclarativeDesignView::keyReleaseEvent(QKeyEvent *event)
case Qt::Key_V:
data->_q_changeToSingleSelectTool();
break;
case Qt::Key_M:
data->_q_changeToMarqueeSelectTool();
break;
// disabled because multiselection does not do anything useful without design mode
// case Qt::Key_M:
// data->_q_changeToMarqueeSelectTool();
// break;
case Qt::Key_I:
data->_q_changeToColorPickerTool();
break;
......
......@@ -62,7 +62,6 @@ QmlInspectorToolbar::QmlInspectorToolbar(QObject *parent) :
m_reloadAction(0),
m_playAction(0),
m_selectAction(0),
m_selectMarqueeAction(0),
m_zoomAction(0),
m_colorPickerAction(0),
m_toQmlAction(0),
......@@ -95,7 +94,6 @@ void QmlInspectorToolbar::setEnabled(bool value)
m_reloadAction->setEnabled(value);
m_playAction->setEnabled(value);
m_selectAction->setEnabled(value);
m_selectMarqueeAction->setEnabled(value);
m_zoomAction->setEnabled(value);
m_colorPickerAction->setEnabled(value);
//m_toQmlAction->setEnabled(value);
......@@ -134,13 +132,6 @@ void QmlInspectorToolbar::activateSelectTool()
m_emitSignals = true;
}
void QmlInspectorToolbar::activateMarqueeSelectTool()
{
m_emitSignals = false;
activateMarqueeSelectToolOnClick();
m_emitSignals = true;
}
void QmlInspectorToolbar::activateZoomTool()
{
m_emitSignals = false;
......@@ -193,7 +184,6 @@ void QmlInspectorToolbar::createActions(const Core::Context &context)
m_reloadAction = new QAction(QIcon(QLatin1String(":/qml/images/reload.png")), tr("Reload"), this);
m_playAction = new QAction(m_pauseIcon, tr("Play/Pause Animations"), this);
m_selectAction = new QAction(QIcon(QLatin1String(":/qml/images/select-small.png")), tr("Select"), this);
m_selectMarqueeAction = new QAction(QIcon(QLatin1String(":/qml/images/select-marquee-small.png")), tr("Select (Marquee)"), this);
m_zoomAction = new QAction(QIcon(QLatin1String(":/qml/images/zoom-small.png")), tr("Zoom"), this);
m_colorPickerAction = new QAction(QIcon(QLatin1String(":/qml/images/color-picker-small.png")), tr("Color Picker"), this);
m_toQmlAction = new QAction(QIcon(QLatin1String(":/qml/images/to-qml-small.png")), tr("Live Preview Changes in QML Viewer"), this);
......@@ -201,7 +191,6 @@ void QmlInspectorToolbar::createActions(const Core::Context &context)
m_observerModeAction->setCheckable(true);
m_observerModeAction->setChecked(false);
m_selectAction->setCheckable(true);
m_selectMarqueeAction->setCheckable(true);
m_zoomAction->setCheckable(true);
m_colorPickerAction->setCheckable(true);
......@@ -212,7 +201,6 @@ void QmlInspectorToolbar::createActions(const Core::Context &context)
am->registerAction(m_reloadAction, QmlJSInspector::Constants::RELOAD_ACTION, context);
am->registerAction(m_playAction, QmlJSInspector::Constants::PLAY_ACTION, context);
am->registerAction(m_selectAction, QmlJSInspector::Constants::SELECT_ACTION, context);
am->registerAction(m_selectMarqueeAction, QmlJSInspector::Constants::SELECT_MARQUEE_ACTION, context);
am->registerAction(m_zoomAction, QmlJSInspector::Constants::ZOOM_ACTION, context);
am->registerAction(m_colorPickerAction, QmlJSInspector::Constants::COLOR_PICKER_ACTION, context);
am->registerAction(m_toQmlAction, QmlJSInspector::Constants::TO_QML_ACTION, context);
......@@ -269,7 +257,6 @@ void QmlInspectorToolbar::createActions(const Core::Context &context)
//configBarLayout->addWidget(createToolButton(am->command(QmlJSInspector::Constants::PAUSE_ACTION)->action()));
configBarLayout->addWidget(createToolButton(am->command(QmlJSInspector::Constants::SELECT_ACTION)->action()));
configBarLayout->addWidget(createToolButton(am->command(QmlJSInspector::Constants::SELECT_MARQUEE_ACTION)->action()));
configBarLayout->addWidget(createToolButton(am->command(QmlJSInspector::Constants::ZOOM_ACTION)->action()));
configBarLayout->addWidget(createToolButton(am->command(QmlJSInspector::Constants::COLOR_PICKER_ACTION)->action()));
......@@ -299,7 +286,6 @@ void QmlInspectorToolbar::createActions(const Core::Context &context)
connect(m_zoomAction, SIGNAL(triggered()), SLOT(activateZoomOnClick()));
connect(m_colorPickerAction, SIGNAL(triggered()), SLOT(activateColorPickerOnClick()));
connect(m_selectAction, SIGNAL(triggered()), SLOT(activateSelectToolOnClick()));
connect(m_selectMarqueeAction, SIGNAL(triggered()), SLOT(activateMarqueeSelectToolOnClick()));
//connect(m_toQmlAction, SIGNAL(triggered()), SLOT(activateToQml()));
connect(m_fromQmlAction, SIGNAL(triggered()), SLOT(activateFromQml()));
......@@ -347,7 +333,6 @@ void QmlInspectorToolbar::activateDesignModeOnClick()
m_reloadAction->setEnabled(true);
m_playAction->setEnabled(checked);
m_selectAction->setEnabled(checked);
m_selectMarqueeAction->setEnabled(checked);
m_zoomAction->setEnabled(checked);
m_colorPickerAction->setEnabled(checked);
......@@ -391,7 +376,6 @@ void QmlInspectorToolbar::activateColorPickerOnClick()
{
m_zoomAction->setChecked(false);
m_selectAction->setChecked(false);
m_selectMarqueeAction->setChecked(false);
m_colorPickerAction->setChecked(true);
if (m_activeTool != ColorPickerMode) {
......@@ -404,7 +388,6 @@ void QmlInspectorToolbar::activateColorPickerOnClick()
void QmlInspectorToolbar::activateSelectToolOnClick()
{
m_zoomAction->setChecked(false);
m_selectMarqueeAction->setChecked(false);
m_colorPickerAction->setChecked(false);
m_selectAction->setChecked(true);
......@@ -415,24 +398,9 @@ void QmlInspectorToolbar::activateSelectToolOnClick()
}
}
void QmlInspectorToolbar::activateMarqueeSelectToolOnClick()
{
m_zoomAction->setChecked(false);
m_selectAction->setChecked(false);
m_colorPickerAction->setChecked(false);
m_selectMarqueeAction->setChecked(true);
if (m_activeTool != MarqueeSelectionToolMode) {
m_activeTool = MarqueeSelectionToolMode;
if (m_emitSignals)
emit marqueeSelectToolSelected();
}
}
void QmlInspectorToolbar::activateZoomOnClick()
{
m_selectAction->setChecked(false);
m_selectMarqueeAction->setChecked(false);
m_colorPickerAction->setChecked(false);
m_zoomAction->setChecked(true);
......
......@@ -76,7 +76,6 @@ public slots:
void activateColorPicker();
void activateSelectTool();
void activateMarqueeSelectTool();
void activateZoomTool();
void setAnimationSpeed(qreal slowdownFactor);
void setDesignModeBehavior(bool inDesignMode);
......@@ -91,7 +90,6 @@ signals:
void reloadSelected();
void colorPickerSelected();
void selectToolSelected();
void marqueeSelectToolSelected();
void zoomToolSelected();
void applyChangesToQmlFileSelected();
......@@ -102,7 +100,6 @@ private slots:
void activatePlayOnClick();
void activateColorPickerOnClick();
void activateSelectToolOnClick();
void activateMarqueeSelectToolOnClick();
void activateZoomOnClick();
void changeToDefaultAnimSpeed();
......@@ -122,7 +119,6 @@ private:
QAction *m_reloadAction;
QAction *m_playAction;
QAction *m_selectAction;
QAction *m_selectMarqueeAction;
QAction *m_zoomAction;
QAction *m_colorPickerAction;
QAction *m_toQmlAction;
......
......@@ -590,13 +590,11 @@ void InspectorUi::setupToolbar(bool doConnect)
connect(m_toolbar, SIGNAL(colorPickerSelected()), m_clientProxy, SLOT(changeToColorPickerTool()));
connect(m_toolbar, SIGNAL(zoomToolSelected()), m_clientProxy, SLOT(changeToZoomTool()));
connect(m_toolbar, SIGNAL(selectToolSelected()), m_clientProxy, SLOT(changeToSelectTool()));
connect(m_toolbar, SIGNAL(marqueeSelectToolSelected()), m_clientProxy, SLOT(changeToSelectMarqueeTool()));
connect(m_toolbar, SIGNAL(applyChangesFromQmlFileTriggered(bool)), this, SLOT(setApplyChangesToQmlObserver(bool)));
connect(this, SIGNAL(livePreviewActivated(bool)), m_toolbar, SLOT(setLivePreviewChecked(bool)));
connect(m_clientProxy, SIGNAL(colorPickerActivated()), m_toolbar, SLOT(activateColorPicker()));
connect(m_clientProxy, SIGNAL(selectToolActivated()), m_toolbar, SLOT(activateSelectTool()));
connect(m_clientProxy, SIGNAL(selectMarqueeToolActivated()), m_toolbar, SLOT(activateMarqueeSelectTool()));
connect(m_clientProxy, SIGNAL(zoomToolActivated()), m_toolbar, SLOT(activateZoomTool()));
connect(m_clientProxy, SIGNAL(designModeBehaviorChanged(bool)), m_toolbar, SLOT(setDesignModeBehavior(bool)));
connect(m_clientProxy, SIGNAL(selectedColorChanged(QColor)), m_toolbar, SLOT(setSelectedColor(QColor)));
......@@ -613,13 +611,11 @@ void InspectorUi::setupToolbar(bool doConnect)
disconnect(m_toolbar, SIGNAL(colorPickerSelected()), m_clientProxy, SLOT(changeToColorPickerTool()));
disconnect(m_toolbar, SIGNAL(zoomToolSelected()), m_clientProxy, SLOT(changeToZoomTool()));
disconnect(m_toolbar, SIGNAL(selectToolSelected()), m_clientProxy, SLOT(changeToSelectTool()));
disconnect(m_toolbar, SIGNAL(marqueeSelectToolSelected()), m_clientProxy, SLOT(changeToSelectMarqueeTool()));
disconnect(m_toolbar, SIGNAL(applyChangesFromQmlFileTriggered(bool)), this, SLOT(setApplyChangesToQmlObserver(bool)));
disconnect(this, SIGNAL(livePreviewActivated(bool)), m_toolbar, SLOT(setLivePreviewChecked(bool)));
disconnect(m_clientProxy, SIGNAL(colorPickerActivated()), m_toolbar, SLOT(activateColorPicker()));
disconnect(m_clientProxy, SIGNAL(selectToolActivated()), m_toolbar, SLOT(activateSelectTool()));
disconnect(m_clientProxy, SIGNAL(selectMarqueeToolActivated()), m_toolbar, SLOT(activateMarqueeSelectTool()));
disconnect(m_clientProxy, SIGNAL(zoomToolActivated()), m_toolbar, SLOT(activateZoomTool()));
disconnect(m_clientProxy, SIGNAL(designModeBehaviorChanged(bool)), m_toolbar, SLOT(setDesignModeBehavior(bool)));
disconnect(m_clientProxy, SIGNAL(selectedColorChanged(QColor)), m_toolbar, SLOT(setSelectedColor(QColor)));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment