forked from qt-creator/qt-creator
setting menu item visiblity in debuggeruiswitcher
This commit is contained in:
@@ -258,7 +258,7 @@ public slots:
|
|||||||
public slots: // FIXME
|
public slots: // FIXME
|
||||||
void showDebuggerOutput(const QString &msg)
|
void showDebuggerOutput(const QString &msg)
|
||||||
{ showDebuggerOutput(LogDebug, msg); }
|
{ showDebuggerOutput(LogDebug, msg); }
|
||||||
void ensureLogVisible();
|
void ensureLogVisible();
|
||||||
|
|
||||||
//private slots: // FIXME
|
//private slots: // FIXME
|
||||||
void showDebuggerOutput(int channel, const QString &msg);
|
void showDebuggerOutput(int channel, const QString &msg);
|
||||||
|
|||||||
@@ -1251,6 +1251,7 @@ void DebuggerPlugin::languageChanged(const QString &language)
|
|||||||
m_attachCoreAction->setVisible(debuggerIsCPP);
|
m_attachCoreAction->setVisible(debuggerIsCPP);
|
||||||
m_startRemoteAction->setVisible(debuggerIsCPP);
|
m_startRemoteAction->setVisible(debuggerIsCPP);
|
||||||
m_detachAction->setVisible(debuggerIsCPP);
|
m_detachAction->setVisible(debuggerIsCPP);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerPlugin::writeSettings() const
|
void DebuggerPlugin::writeSettings() const
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#include <utils/savedaction.h>
|
#include <utils/savedaction.h>
|
||||||
#include <utils/styledbar.h>
|
#include <utils/styledbar.h>
|
||||||
|
#include <coreplugin/actionmanager/command.h>
|
||||||
#include <debugger/debuggerconstants.h>
|
#include <debugger/debuggerconstants.h>
|
||||||
#include <debugger/debuggeractions.h>
|
#include <debugger/debuggeractions.h>
|
||||||
|
|
||||||
@@ -73,6 +73,8 @@ struct DebuggerUISwitcherPrivate {
|
|||||||
Core::ActionContainer *m_viewsMenu;
|
Core::ActionContainer *m_viewsMenu;
|
||||||
Core::ActionContainer *m_debugMenu;
|
Core::ActionContainer *m_debugMenu;
|
||||||
|
|
||||||
|
QMultiHash< int, Core::Command *> m_menuCommands;
|
||||||
|
|
||||||
static DebuggerUISwitcher *m_instance;
|
static DebuggerUISwitcher *m_instance;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -119,9 +121,11 @@ DebuggerUISwitcher::~DebuggerUISwitcher()
|
|||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DebuggerUISwitcher::addMenuAction(Core::Command *command, const QString &langName,
|
||||||
|
const QString &group)
|
||||||
{
|
{
|
||||||
d->m_debugMenu->addAction(command, 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)
|
void DebuggerUISwitcher::setActiveLanguage(const QString &langName)
|
||||||
@@ -270,8 +274,9 @@ void DebuggerUISwitcher::changeDebuggerUI(const QString &langName)
|
|||||||
menuitem.second->setVisible(false);
|
menuitem.second->setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
d->m_languageMenu->menu()->setTitle(tr("Language") + " (" + langName + ")");
|
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()) {
|
while (iter.hasNext()) {
|
||||||
iter.next();
|
iter.next();
|
||||||
bool active = (iter.key() == langId);
|
bool active = (iter.key() == langId);
|
||||||
|
|||||||
@@ -89,7 +89,6 @@ private:
|
|||||||
QWidget *createMainWindow(Core::BaseMode *mode);
|
QWidget *createMainWindow(Core::BaseMode *mode);
|
||||||
|
|
||||||
DebuggerUISwitcherPrivate *d;
|
DebuggerUISwitcherPrivate *d;
|
||||||
QMultiHash< int, Core::Command *> m_menuCommands;
|
|
||||||
Utils::SavedAction *m_changeLanguageAction;
|
Utils::SavedAction *m_changeLanguageAction;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user