Commit a10dc593 authored by dt's avatar dt
Browse files

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

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