forked from qt-creator/qt-creator
Debugger: Add view menu to toolbar
Change-Id: I8783ce66d28626e9a484d6aa729fccd07bbda0b8 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -57,6 +57,7 @@
|
|||||||
|
|
||||||
#include <QDockWidget>
|
#include <QDockWidget>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
#include <QToolButton>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
@@ -113,6 +114,7 @@ public:
|
|||||||
DebuggerLanguages m_supportedLanguages;
|
DebuggerLanguages m_supportedLanguages;
|
||||||
|
|
||||||
QWidget *m_debugToolBar;
|
QWidget *m_debugToolBar;
|
||||||
|
QToolButton *m_viewButton;
|
||||||
QHBoxLayout *m_debugToolBarLayout;
|
QHBoxLayout *m_debugToolBarLayout;
|
||||||
|
|
||||||
QHash<DebuggerLanguage, Context> m_contextsForLanguage;
|
QHash<DebuggerLanguage, Context> m_contextsForLanguage;
|
||||||
@@ -500,6 +502,12 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
|
|||||||
documentAndRightPane->setStretchFactor(0, 1);
|
documentAndRightPane->setStretchFactor(0, 1);
|
||||||
documentAndRightPane->setStretchFactor(1, 0);
|
documentAndRightPane->setStretchFactor(1, 0);
|
||||||
|
|
||||||
|
d->m_viewButton = new QToolButton();
|
||||||
|
// FIXME: Use real thing after string freeze.
|
||||||
|
QString hackyName = QCoreApplication::translate("Core::Internal::MainWindow", "&Views");
|
||||||
|
hackyName.replace(QLatin1Char('&'), QString());
|
||||||
|
d->m_viewButton->setText(hackyName);
|
||||||
|
|
||||||
Utils::StyledBar *debugToolBar = new Utils::StyledBar;
|
Utils::StyledBar *debugToolBar = new Utils::StyledBar;
|
||||||
debugToolBar->setProperty("topBorder", true);
|
debugToolBar->setProperty("topBorder", true);
|
||||||
QHBoxLayout *debugToolBarLayout = new QHBoxLayout(debugToolBar);
|
QHBoxLayout *debugToolBarLayout = new QHBoxLayout(debugToolBar);
|
||||||
@@ -507,6 +515,9 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
|
|||||||
debugToolBarLayout->setSpacing(0);
|
debugToolBarLayout->setSpacing(0);
|
||||||
debugToolBarLayout->addWidget(d->m_debugToolBar);
|
debugToolBarLayout->addWidget(d->m_debugToolBar);
|
||||||
debugToolBarLayout->addWidget(new Utils::StyledSeparator);
|
debugToolBarLayout->addWidget(new Utils::StyledSeparator);
|
||||||
|
debugToolBarLayout->addWidget(d->m_viewButton);
|
||||||
|
|
||||||
|
connect(d->m_viewButton, SIGNAL(clicked()), this, SLOT(showViewsMenu()));
|
||||||
|
|
||||||
QDockWidget *dock = new QDockWidget(DebuggerMainWindowPrivate::tr("Debugger Toolbar"));
|
QDockWidget *dock = new QDockWidget(DebuggerMainWindowPrivate::tr("Debugger Toolbar"));
|
||||||
dock->setObjectName(QLatin1String("Debugger Toolbar"));
|
dock->setObjectName(QLatin1String("Debugger Toolbar"));
|
||||||
@@ -569,6 +580,13 @@ void DebuggerMainWindow::writeSettings() const
|
|||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DebuggerMainWindow::showViewsMenu()
|
||||||
|
{
|
||||||
|
QMenu *menu = createPopupMenu();
|
||||||
|
menu->exec(d->m_viewButton->mapToGlobal(QPoint()));
|
||||||
|
delete menu;
|
||||||
|
}
|
||||||
|
|
||||||
void DebuggerMainWindow::readSettings()
|
void DebuggerMainWindow::readSettings()
|
||||||
{
|
{
|
||||||
QSettings *settings = ICore::settings();
|
QSettings *settings = ICore::settings();
|
||||||
|
|||||||
@@ -95,6 +95,9 @@ public:
|
|||||||
void readSettings();
|
void readSettings();
|
||||||
void writeSettings() const;
|
void writeSettings() const;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void showViewsMenu();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class Internal::DebuggerMainWindowPrivate;
|
friend class Internal::DebuggerMainWindowPrivate;
|
||||||
Internal::DebuggerMainWindowPrivate *d;
|
Internal::DebuggerMainWindowPrivate *d;
|
||||||
|
|||||||
@@ -1253,6 +1253,7 @@ public:
|
|||||||
QIcon m_locationMarkIcon;
|
QIcon m_locationMarkIcon;
|
||||||
|
|
||||||
StatusLabel *m_statusLabel;
|
StatusLabel *m_statusLabel;
|
||||||
|
QMenu *m_viewMenu;
|
||||||
QComboBox *m_threadBox;
|
QComboBox *m_threadBox;
|
||||||
|
|
||||||
BaseWindow *m_breakWindow;
|
BaseWindow *m_breakWindow;
|
||||||
|
|||||||
Reference in New Issue
Block a user