Commit a10dc593 authored by dt's avatar dt

Switching to the output mode now always gives focus to the output mode.

Annoying
parent bb3e6b72
......@@ -63,6 +63,7 @@
#include "editormanager/ieditorfactory.h"
#include "baseview.h"
#include "basefilewizard.h"
#include "ioutputpane.h"
#include <coreplugin/findplaceholder.h>
#include <utils/pathchooser.h>
......@@ -302,6 +303,9 @@ bool MainWindow::init(QString *errorMessage)
outputModeWidget->layout()->addWidget(new Core::FindToolBarPlaceHolder(m_outputMode));
outputModeWidget->setFocusProxy(oph);
connect(m_modeManager, SIGNAL(currentModeChanged(Core::IMode*)),
this, SLOT(modeChanged(Core::IMode*)), Qt::QueuedConnection);
m_outputMode->setContext(m_globalContext);
pm->addObject(m_outputMode);
pm->addObject(m_generalSettings);
......@@ -317,6 +321,16 @@ bool MainWindow::init(QString *errorMessage)
return true;
}
void MainWindow::modeChanged(Core::IMode *mode)
{
if (mode == m_outputMode) {
int idx = OutputPaneManager::instance()->m_widgetComboBox->itemData(OutputPaneManager::instance()->m_widgetComboBox->currentIndex()).toInt();
IOutputPane *out = OutputPaneManager::instance()->m_pageMap.value(idx);
if (out && out->canFocus())
out->setFocus();
}
}
void MainWindow::extensionsInitialized()
{
m_editorManager->init();
......
......@@ -64,6 +64,7 @@ class UniqueIDManager;
class VariableManager;
class VCSManager;
class ViewManagerInterface;
class IMode;
namespace Internal {
......@@ -153,6 +154,7 @@ private slots:
void updateFocusWidget(QWidget *old, QWidget *now);
void setSidebarVisible(bool visible);
void destroyVersionDialog();
void modeChanged(Core::IMode *mode);
private:
void updateContextObject(IContext *context);
......
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