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

Made debugger menu items disabled in QML inspector mode

parent 7d423d5f
...@@ -163,6 +163,7 @@ DebuggerSettings *DebuggerSettings::instance() ...@@ -163,6 +163,7 @@ DebuggerSettings *DebuggerSettings::instance()
item->setText(tr("Operate by Instruction")); item->setText(tr("Operate by Instruction"));
item->setCheckable(true); item->setCheckable(true);
item->setDefaultValue(false); item->setDefaultValue(false);
item->setSettingsKey(debugModeGroup, QLatin1String("OperateByInstruction"));
item->setIcon(QIcon(":/debugger/images/SingleInstructionMode.png")); item->setIcon(QIcon(":/debugger/images/SingleInstructionMode.png"));
item->setToolTip(tr("This switches the debugger to instruction-wise " item->setToolTip(tr("This switches the debugger to instruction-wise "
"operation mode. In this mode, stepping operates on single " "operation mode. In this mode, stepping operates on single "
......
...@@ -466,6 +466,10 @@ void DebuggerManager::init() ...@@ -466,6 +466,10 @@ void DebuggerManager::init()
connect(this, SIGNAL(emitShowOutput(int, QString)), connect(this, SIGNAL(emitShowOutput(int, QString)),
d->m_outputWindow, SLOT(showOutput(int, QString)), Qt::QueuedConnection); d->m_outputWindow, SLOT(showOutput(int, QString)), Qt::QueuedConnection);
// UI Switcher
connect(DebuggerUISwitcher::instance(), SIGNAL(languageChanged(QString)),
this, SLOT(languageChanged(QString)));
// Tooltip // Tooltip
//QTreeView *tooltipView = qobject_cast<QTreeView *>(d->m_tooltipWindow); //QTreeView *tooltipView = qobject_cast<QTreeView *>(d->m_tooltipWindow);
//tooltipView->setModel(d->m_watchHandler->model(TooltipsWatch)); //tooltipView->setModel(d->m_watchHandler->model(TooltipsWatch));
...@@ -1925,6 +1929,14 @@ void DebuggerManager::fontSettingsChanged(const TextEditor::FontSettings &settin ...@@ -1925,6 +1929,14 @@ void DebuggerManager::fontSettingsChanged(const TextEditor::FontSettings &settin
changeFontSize(d->m_threadsWindow, size); changeFontSize(d->m_threadsWindow, size);
} }
// only update necessary menu items on language change
void DebuggerManager::languageChanged(const QString &debuggerLanguage)
{
const bool debuggerIsCPP = (debuggerLanguage == Constants::LANG_CPP);
d->m_actions.reverseDirectionAction->setEnabled(debuggerIsCPP);
theDebuggerAction(OperateByInstruction)->setEnabled(debuggerIsCPP);
}
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// //
// AbstractDebuggerEngine // AbstractDebuggerEngine
......
...@@ -280,6 +280,7 @@ public slots: // FIXME ...@@ -280,6 +280,7 @@ public slots: // FIXME
void reloadFullStack(); void reloadFullStack();
void operateByInstructionTriggered(); void operateByInstructionTriggered();
void startFailed(); void startFailed();
void languageChanged(const QString &debuggerLanguage);
private: private:
Internal::ModulesHandler *modulesHandler() const; Internal::ModulesHandler *modulesHandler() const;
......
...@@ -126,7 +126,6 @@ int DebuggerUISwitcher::activeLanguageId() const ...@@ -126,7 +126,6 @@ int DebuggerUISwitcher::activeLanguageId() const
{ {
return d->m_activeLanguage; return d->m_activeLanguage;
} }
void DebuggerUISwitcher::modeChanged(Core::IMode *mode) void DebuggerUISwitcher::modeChanged(Core::IMode *mode)
{ {
d->m_isActiveMode = (mode->id() == Debugger::Constants::MODE_DEBUG); d->m_isActiveMode = (mode->id() == Debugger::Constants::MODE_DEBUG);
......
...@@ -650,6 +650,8 @@ QmlJSTextEditor::QmlJSTextEditor(QWidget *parent) : ...@@ -650,6 +650,8 @@ QmlJSTextEditor::QmlJSTextEditor(QWidget *parent) :
connect(m_semanticHighlighter, SIGNAL(changed(QmlJSEditor::Internal::SemanticInfo)), connect(m_semanticHighlighter, SIGNAL(changed(QmlJSEditor::Internal::SemanticInfo)),
this, SLOT(updateSemanticInfo(QmlJSEditor::Internal::SemanticInfo))); this, SLOT(updateSemanticInfo(QmlJSEditor::Internal::SemanticInfo)));
setRequestMarkEnabled(false);
} }
QmlJSTextEditor::~QmlJSTextEditor() QmlJSTextEditor::~QmlJSTextEditor()
......
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