aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/coreplugin/fancyactionbar.cpp
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2010-03-30 12:27:29 +0200
committermae <qt-info@nokia.com>2010-03-30 12:27:57 +0200
commited74fdd5cebf13b308051e8ca40db2310f1990de (patch)
treec25e27c77055f0d56de3e3cff39e877cfc8e295a /src/plugins/coreplugin/fancyactionbar.cpp
parentb74e80dc9095bf43294c4758783a602bab2e9548 (diff)
Have your debug button back
Diffstat (limited to 'src/plugins/coreplugin/fancyactionbar.cpp')
-rw-r--r--src/plugins/coreplugin/fancyactionbar.cpp52
1 files changed, 0 insertions, 52 deletions
diff --git a/src/plugins/coreplugin/fancyactionbar.cpp b/src/plugins/coreplugin/fancyactionbar.cpp
index b15a67b01d..3e54c85cc2 100644
--- a/src/plugins/coreplugin/fancyactionbar.cpp
+++ b/src/plugins/coreplugin/fancyactionbar.cpp
@@ -264,31 +264,8 @@ FancyActionBar::FancyActionBar(QWidget *parent)
spacerLayout->setSpacing(0);
setLayout(spacerLayout);
setContentsMargins(0,2,0,0);
-
- m_runButton = m_debugButton = 0;
- m_inDebugMode = false;
-
- connect(Core::ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)),
- this, SLOT(modeChanged(Core::IMode*)));
-
-#ifdef Q_WS_MAC
- qApp->installEventFilter(this);
-#endif
-
}
-#ifdef Q_WS_MAC
-bool FancyActionBar::eventFilter(QObject *, QEvent *e)
-{
- if (e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease) {
- if (static_cast<QKeyEvent *>(e)->key() == Qt::Key_Alt)
- updateRunDebug();
- } else if (e->type() == QEvent::WindowDeactivate)
- updateRunDebug();
- return false;
-}
-#endif
-
void FancyActionBar::addProjectSelector(QAction *action)
{
FancyToolButton* toolButton = new FancyToolButton(this);
@@ -300,40 +277,11 @@ void FancyActionBar::addProjectSelector(QAction *action)
void FancyActionBar::insertAction(int index, QAction *action)
{
FancyToolButton *toolButton = new FancyToolButton(this);
- if (action->objectName() == QLatin1String("ProjectExplorer.Run"))
- m_runButton = toolButton;
- if (action->objectName() == QLatin1String("ProjectExplorer.Debug"))
- m_debugButton = toolButton;
-
toolButton->setDefaultAction(action);
connect(action, SIGNAL(changed()), toolButton, SLOT(actionChanged()));
m_actionsLayout->insertWidget(index, toolButton);
}
-void FancyActionBar::modeChanged(Core::IMode *mode)
-{
- m_inDebugMode = (mode->id() == QLatin1String("Debugger.Mode.Debug"));
- updateRunDebug();
-}
-
-void FancyActionBar::updateRunDebug()
-{
- if (!m_runButton || !m_debugButton)
- return;
-
- bool doDebug = m_inDebugMode;
-#ifdef Q_WS_MAC
- if (QApplication::keyboardModifiers() && Qt::AltModifier)
- doDebug = !doDebug;
-#endif
-
- layout()->setEnabled(false);
- m_runButton->forceVisible(!doDebug);
- m_debugButton->forceVisible(doDebug);
- layout()->setEnabled(true);
-
-}
-
QLayout *FancyActionBar::actionsLayout() const
{
return m_actionsLayout;