Commit 4e578d95 authored by Lasse Holmstedt's avatar Lasse Holmstedt
Browse files

setting menu item visiblity in debuggeruiswitcher

parent f9a9dd7d
......@@ -1251,6 +1251,7 @@ void DebuggerPlugin::languageChanged(const QString &language)
m_attachCoreAction->setVisible(debuggerIsCPP);
m_startRemoteAction->setVisible(debuggerIsCPP);
m_detachAction->setVisible(debuggerIsCPP);
}
void DebuggerPlugin::writeSettings() const
......
......@@ -6,7 +6,7 @@
#include <utils/savedaction.h>
#include <utils/styledbar.h>
#include <coreplugin/actionmanager/command.h>
#include <debugger/debuggerconstants.h>
#include <debugger/debuggeractions.h>
......@@ -73,6 +73,8 @@ struct DebuggerUISwitcherPrivate {
Core::ActionContainer *m_viewsMenu;
Core::ActionContainer *m_debugMenu;
QMultiHash< int, Core::Command *> m_menuCommands;
static DebuggerUISwitcher *m_instance;
};
......@@ -119,9 +121,11 @@ DebuggerUISwitcher::~DebuggerUISwitcher()
delete d;
}
void DebuggerUISwitcher::addMenuAction(Core::Command *command, const QString &langName,
const QString &group)
{
d->m_debugMenu->addAction(command, group);
m_menuCommands.insert(d->m_languages.indexOf(langName), command);
d->m_menuCommands.insert(d->m_languages.indexOf(langName), command);
}
void DebuggerUISwitcher::setActiveLanguage(const QString &langName)
......@@ -270,8 +274,9 @@ void DebuggerUISwitcher::changeDebuggerUI(const QString &langName)
menuitem.second->setVisible(false);
}
}
d->m_languageMenu->menu()->setTitle(tr("Language") + " (" + langName + ")");
QHashIterator<int, Core::Command *> iter(m_menuCommands);
QHashIterator<int, Core::Command *> iter(d->m_menuCommands);
while (iter.hasNext()) {
iter.next();
bool active = (iter.key() == langId);
......
......@@ -89,7 +89,6 @@ private:
QWidget *createMainWindow(Core::BaseMode *mode);
DebuggerUISwitcherPrivate *d;
QMultiHash< int, Core::Command *> m_menuCommands;
Utils::SavedAction *m_changeLanguageAction;
};
......
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