diff options
author | Henning Gruendl <henning.gruendl@qt.io> | 2023-04-28 13:51:34 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@qt.io> | 2023-04-28 14:02:46 +0000 |
commit | e7fcc5b0487a13b9988a687891e45960894cc77c (patch) | |
tree | 3246d97a3a85a71ebd7192eb2b6f17b6bdd6d02f | |
parent | faa081927bbc11bab90c6d34e667087fd32dc4c9 (diff) |
OutputPane: Add setting to restore previous pane
Add a setting to store the previously used output pane index to be able
to restore it on startup.
Task-number: QDS-9647
Change-Id: I2ef277e8d4c79a6d0b017e5422ad639b56b2140b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
-rw-r--r-- | src/plugins/coreplugin/outputpane.cpp | 4 | ||||
-rw-r--r-- | src/plugins/coreplugin/outputpanemanager.cpp | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/plugins/coreplugin/outputpane.cpp b/src/plugins/coreplugin/outputpane.cpp index 67e57448aa..81473320bb 100644 --- a/src/plugins/coreplugin/outputpane.cpp +++ b/src/plugins/coreplugin/outputpane.cpp @@ -183,6 +183,10 @@ void OutputPanePlaceHolder::showEvent(QShowEvent *) d->m_initialized = true; setHeight(Internal::OutputPaneManager::outputPaneHeightSetting()); } + if (OutputPanePlaceHolderPrivate::m_current == this) { + Internal::OutputPaneManager *om = Internal::OutputPaneManager::instance(); + om->updateStatusButtons(true); + } } OutputPanePlaceHolder *OutputPanePlaceHolder::getCurrent() diff --git a/src/plugins/coreplugin/outputpanemanager.cpp b/src/plugins/coreplugin/outputpanemanager.cpp index a249686f9e..e9390cb11d 100644 --- a/src/plugins/coreplugin/outputpanemanager.cpp +++ b/src/plugins/coreplugin/outputpanemanager.cpp @@ -575,7 +575,12 @@ void OutputPaneManager::readSettings() } settings->endArray(); - m_outputPaneHeightSetting = settings->value(QLatin1String("OutputPanePlaceHolder/Height"), 0).toInt(); + m_outputPaneHeightSetting + = settings->value(QLatin1String("OutputPanePlaceHolder/Height"), 0).toInt(); + const int currentIdx + = settings->value(QLatin1String("OutputPanePlaceHolder/CurrentIndex"), 0).toInt(); + if (QTC_GUARD(currentIdx >= 0 && currentIdx < g_outputPanes.size())) + setCurrentIndex(currentIdx); } void OutputPaneManager::slotNext() @@ -682,7 +687,8 @@ void OutputPaneManager::setCurrentIndex(int idx) OutputPaneData &data = g_outputPanes[idx]; IOutputPane *pane = data.pane; data.button->show(); - pane->visibilityChanged(true); + if (OutputPanePlaceHolder::isCurrentVisible()) + pane->visibilityChanged(true); bool canNavigate = pane->canNavigate(); m_prevAction->setEnabled(canNavigate && pane->canPrevious()); @@ -737,6 +743,7 @@ void OutputPaneManager::saveSettings() const if (OutputPanePlaceHolder *curr = OutputPanePlaceHolder::getCurrent()) heightSetting = curr->nonMaximizedSize(); settings->setValue(QLatin1String("OutputPanePlaceHolder/Height"), heightSetting); + settings->setValue(QLatin1String("OutputPanePlaceHolder/CurrentIndex"), currentIndex()); } void OutputPaneManager::clearPage() |