forked from qt-creator/qt-creator
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: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
committed by
Henning Gründl
parent
945832ce9b
commit
66af0f4dab
@@ -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()
|
||||
|
@@ -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,6 +687,7 @@ void OutputPaneManager::setCurrentIndex(int idx)
|
||||
OutputPaneData &data = g_outputPanes[idx];
|
||||
IOutputPane *pane = data.pane;
|
||||
data.button->show();
|
||||
if (OutputPanePlaceHolder::isCurrentVisible())
|
||||
pane->visibilityChanged(true);
|
||||
|
||||
bool canNavigate = pane->canNavigate();
|
||||
@@ -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()
|
||||
|
Reference in New Issue
Block a user