forked from qt-creator/qt-creator
QmlJSInspector: Reposition the Tool Bar
Change-Id: I529f976e90fef1670e65b650525b6f31e8b8f397 Reviewed-by: Kai Koehne <kai.koehne@nokia.com> Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -126,7 +126,8 @@ public:
|
||||
|
||||
DebuggerLanguages m_supportedLanguages;
|
||||
|
||||
QStackedWidget *m_toolBarStack;
|
||||
QWidget *m_debugToolBar;
|
||||
QHBoxLayout *m_debugToolBarLayout;
|
||||
|
||||
QHash<DebuggerLanguage, Context> m_contextsForLanguage;
|
||||
|
||||
@@ -151,7 +152,8 @@ DebuggerMainWindowPrivate::DebuggerMainWindowPrivate(DebuggerMainWindow *mw)
|
||||
: q(mw)
|
||||
, m_resizeEventFilter(this)
|
||||
, m_supportedLanguages(AnyLanguage)
|
||||
, m_toolBarStack(new QStackedWidget)
|
||||
, m_debugToolBar(new QWidget)
|
||||
, m_debugToolBarLayout(new QHBoxLayout(m_debugToolBar))
|
||||
, m_inDebugMode(false)
|
||||
, m_changingUI(false)
|
||||
, m_previousDebugLanguages(AnyLanguage)
|
||||
@@ -163,7 +165,10 @@ DebuggerMainWindowPrivate::DebuggerMainWindowPrivate(DebuggerMainWindow *mw)
|
||||
, m_previousRunConfiguration(0)
|
||||
, m_engine(0)
|
||||
{
|
||||
m_debugToolBarLayout->setMargin(0);
|
||||
m_debugToolBarLayout->setSpacing(0);
|
||||
createViewsMenuItems();
|
||||
addLanguage(AnyLanguage, Context());
|
||||
addLanguage(CppLanguage, Context(C_CPPDEBUGGER));
|
||||
addLanguage(QmlLanguage, Context(C_QMLDEBUGGER));
|
||||
}
|
||||
@@ -367,8 +372,10 @@ void DebuggerMainWindowPrivate::activateQmlCppLayout()
|
||||
{
|
||||
Context qmlCppContext = m_contextsForLanguage.value(QmlLanguage);
|
||||
qmlCppContext.add(m_contextsForLanguage.value(CppLanguage));
|
||||
if (m_toolBars.value(QmlLanguage))
|
||||
m_toolBarStack->setCurrentWidget(m_toolBars.value(QmlLanguage));
|
||||
if (m_toolBars.value(QmlLanguage)) {
|
||||
m_toolBars.value(QmlLanguage)->show();
|
||||
m_debugToolBarLayout->insertWidget(1, m_toolBars.value(QmlLanguage));
|
||||
}
|
||||
|
||||
if (m_previousDebugLanguages & QmlLanguage) {
|
||||
m_dockWidgetActiveStateQmlCpp = q->saveSettings();
|
||||
@@ -387,7 +394,10 @@ void DebuggerMainWindowPrivate::activateCppLayout()
|
||||
{
|
||||
Context qmlCppContext = m_contextsForLanguage.value(QmlLanguage);
|
||||
qmlCppContext.add(m_contextsForLanguage.value(CppLanguage));
|
||||
m_toolBarStack->setCurrentWidget(m_toolBars.value(CppLanguage));
|
||||
if (m_toolBars.value(QmlLanguage)) {
|
||||
m_toolBars.value(QmlLanguage)->hide();
|
||||
m_debugToolBarLayout->removeWidget(m_toolBars.value(QmlLanguage));
|
||||
}
|
||||
|
||||
if (m_previousDebugLanguages & QmlLanguage) {
|
||||
m_dockWidgetActiveStateQmlCpp = q->saveSettings();
|
||||
@@ -408,7 +418,12 @@ void DebuggerMainWindow::setToolBar(DebuggerLanguage language, QWidget *widget)
|
||||
{
|
||||
Q_ASSERT(d->m_toolBars.contains(language));
|
||||
d->m_toolBars[language] = widget;
|
||||
d->m_toolBarStack->addWidget(widget);
|
||||
if (language == CppLanguage)
|
||||
d->m_debugToolBarLayout->addWidget(widget);
|
||||
|
||||
//Add widget at the end
|
||||
if (language == AnyLanguage)
|
||||
d->m_debugToolBarLayout->insertWidget(-1, widget, 10);
|
||||
}
|
||||
|
||||
QDockWidget *DebuggerMainWindow::dockWidget(const QString &objectName) const
|
||||
@@ -507,7 +522,7 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
|
||||
QHBoxLayout *debugToolBarLayout = new QHBoxLayout(debugToolBar);
|
||||
debugToolBarLayout->setMargin(0);
|
||||
debugToolBarLayout->setSpacing(0);
|
||||
debugToolBarLayout->addWidget(d->m_toolBarStack);
|
||||
debugToolBarLayout->addWidget(d->m_debugToolBar);
|
||||
debugToolBarLayout->addWidget(new Utils::StyledSeparator);
|
||||
|
||||
QDockWidget *dock = new QDockWidget(DebuggerMainWindowPrivate::tr("Debugger Toolbar"));
|
||||
|
@@ -2341,6 +2341,8 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
|
||||
m_attachToRemoteServerAction->setEnabled(true);
|
||||
m_attachToRemoteProcessAction->setEnabled(true);
|
||||
|
||||
m_threadBox->setEnabled(state == InferiorStopOk);
|
||||
|
||||
const bool isCore = engine->startParameters().startMode == AttachCore;
|
||||
const bool stopped = state == InferiorStopOk;
|
||||
const bool detachable = stopped && !isCore;
|
||||
@@ -3455,9 +3457,9 @@ void DebuggerPluginPrivate::extensionsInitialized()
|
||||
|
||||
hbox->addWidget(m_threadBox);
|
||||
hbox->addSpacerItem(new QSpacerItem(4, 0));
|
||||
hbox->addWidget(m_statusLabel, 10);
|
||||
|
||||
m_mainWindow->setToolBar(CppLanguage, toolbarContainer);
|
||||
m_mainWindow->setToolBar(AnyLanguage, m_statusLabel);
|
||||
|
||||
connect(action(EnableReverseDebugging),
|
||||
SIGNAL(valueChanged(QVariant)),
|
||||
|
@@ -268,7 +268,7 @@ bool QmlCppEngine::acceptsBreakpoint(BreakpointModelId id) const
|
||||
|
||||
void QmlCppEngine::selectThread(int index)
|
||||
{
|
||||
d->m_cppEngine->selectThread(index);
|
||||
d->m_activeEngine->selectThread(index);
|
||||
}
|
||||
|
||||
void QmlCppEngine::assignValueInDebugger(const WatchData *data,
|
||||
|
@@ -202,9 +202,7 @@ void QmlJsInspectorToolBar::createActions()
|
||||
am->registerAction(m_fromQmlAction, Constants::FROM_QML_ACTION, context);
|
||||
am->registerAction(m_showAppOnTopAction, Constants::SHOW_APP_ON_TOP_ACTION, context);
|
||||
|
||||
m_barWidget = new Utils::StyledBar;
|
||||
m_barWidget->setSingleRow(true);
|
||||
m_barWidget->setProperty("topBorder", true);
|
||||
m_barWidget = new QWidget;
|
||||
|
||||
QMenu *playSpeedMenu = new QMenu(m_barWidget);
|
||||
m_playSpeedMenuActions = new QActionGroup(this);
|
||||
@@ -239,19 +237,7 @@ void QmlJsInspectorToolBar::createActions()
|
||||
toolBarLayout->setMargin(0);
|
||||
toolBarLayout->setSpacing(5);
|
||||
|
||||
m_operateByInstructionButton = toolButton(am->command(Debugger::Constants::OPERATE_BY_INSTRUCTION)->action());
|
||||
|
||||
// Add generic debugging controls
|
||||
toolBarLayout->addWidget(toolButton(Debugger::DebuggerPlugin::visibleDebugAction()));
|
||||
toolBarLayout->addWidget(toolButton(am->command(Debugger::Constants::STOP)->action()));
|
||||
toolBarLayout->addWidget(toolButton(am->command(Debugger::Constants::NEXT)->action()));
|
||||
toolBarLayout->addWidget(toolButton(am->command(Debugger::Constants::STEP)->action()));
|
||||
toolBarLayout->addWidget(toolButton(am->command(Debugger::Constants::STEPOUT)->action()));
|
||||
toolBarLayout->addWidget(m_operateByInstructionButton);
|
||||
toolBarLayout->addStretch(1);
|
||||
|
||||
// QML Helpers
|
||||
toolBarLayout->addWidget(new Utils::StyledSeparator);
|
||||
toolBarLayout->addWidget(toolButton(am->command(Constants::FROM_QML_ACTION)->action()));
|
||||
toolBarLayout->addWidget(toolButton(am->command(Constants::SHOW_APP_ON_TOP_ACTION)->action()));
|
||||
m_playButton = toolButton(am->command(Constants::PLAY_ACTION)->action());
|
||||
@@ -262,6 +248,7 @@ void QmlJsInspectorToolBar::createActions()
|
||||
toolBarLayout->addWidget(new Utils::StyledSeparator);
|
||||
toolBarLayout->addWidget(toolButton(am->command(Constants::SELECT_ACTION)->action()));
|
||||
toolBarLayout->addWidget(toolButton(am->command(Constants::ZOOM_ACTION)->action()));
|
||||
toolBarLayout->addWidget(new Utils::StyledSeparator);
|
||||
|
||||
connect(m_fromQmlAction, SIGNAL(triggered()), SLOT(activateFromQml()));
|
||||
connect(m_showAppOnTopAction, SIGNAL(triggered()), SLOT(showAppOnTopClick()));
|
||||
@@ -269,11 +256,6 @@ void QmlJsInspectorToolBar::createActions()
|
||||
connect(m_selectAction, SIGNAL(triggered(bool)), SLOT(selectToolTriggered(bool)));
|
||||
connect(m_zoomAction, SIGNAL(triggered(bool)), SLOT(zoomToolTriggered(bool)));
|
||||
|
||||
Debugger::DebuggerMainWindow *mw = Debugger::DebuggerPlugin::mainWindow();
|
||||
activeDebugLanguagesChanged(mw->activeDebugLanguages());
|
||||
connect(mw, SIGNAL(activeDebugLanguagesChanged(Debugger::DebuggerLanguages)),
|
||||
this, SLOT(activeDebugLanguagesChanged(Debugger::DebuggerLanguages)));
|
||||
|
||||
readSettings();
|
||||
connect(Core::ICore::instance(),
|
||||
SIGNAL(saveSettingsRequested()), SLOT(writeSettings()));
|
||||
@@ -358,11 +340,6 @@ void QmlJsInspectorToolBar::activateFromQml()
|
||||
emit applyChangesFromQmlFileTriggered(m_fromQmlAction->isChecked());
|
||||
}
|
||||
|
||||
void QmlJsInspectorToolBar::activeDebugLanguagesChanged(Debugger::DebuggerLanguages languages)
|
||||
{
|
||||
m_operateByInstructionButton->setVisible(languages & Debugger::CppLanguage);
|
||||
}
|
||||
|
||||
void QmlJsInspectorToolBar::updateDesignModeActions(DesignTool activeTool)
|
||||
{
|
||||
m_activeTool = activeTool;
|
||||
|
@@ -113,13 +113,9 @@ private slots:
|
||||
|
||||
void updatePlayAction();
|
||||
|
||||
void activeDebugLanguagesChanged(Debugger::DebuggerLanguages languages);
|
||||
|
||||
private:
|
||||
void updateDesignModeActions(DesignTool activeTool);
|
||||
|
||||
QToolButton *m_operateByInstructionButton;
|
||||
|
||||
Utils::SavedAction *m_fromQmlAction;
|
||||
QAction *m_playAction;
|
||||
QAction *m_selectAction;
|
||||
@@ -140,7 +136,7 @@ private:
|
||||
bool m_designModeActive;
|
||||
DesignTool m_activeTool;
|
||||
|
||||
Utils::StyledBar *m_barWidget;
|
||||
QWidget *m_barWidget;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
Reference in New Issue
Block a user