aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/projectexplorer/projectwindow.cpp13
-rw-r--r--src/plugins/projectexplorer/projectwindow.h1
-rw-r--r--src/plugins/projectexplorer/targetsettingspanel.cpp10
-rw-r--r--src/plugins/projectexplorer/targetsettingspanel.h3
4 files changed, 25 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp
index d4fbada62e..7cffc0f268 100644
--- a/src/plugins/projectexplorer/projectwindow.cpp
+++ b/src/plugins/projectexplorer/projectwindow.cpp
@@ -229,7 +229,8 @@ void PanelsWidget::addPanelWidget(IPropertiesPanel *panel, int row)
ProjectWindow::ProjectWindow(QWidget *parent)
: QWidget(parent),
- m_currentWidget(0)
+ m_currentWidget(0),
+ m_previousTargetSubIndex(-1)
{
ProjectExplorer::SessionManager *session = ProjectExplorerPlugin::instance()->session();
@@ -375,11 +376,19 @@ void ProjectWindow::showProperties(int index, int subIndex)
// Set up custom panels again:
int pos = 0;
IPanelFactory *fac = 0;
+ // remember previous sub index state of target settings page
+ if (TargetSettingsPanelWidget *previousPanelWidget
+ = qobject_cast<TargetSettingsPanelWidget*>(m_currentWidget)) {
+ m_previousTargetSubIndex = previousPanelWidget->currentSubIndex();
+ }
if (project->supportedTargetIds().count() > 1) {
if (subIndex == 0) {
// Targets page
removeCurrentWidget();
- m_currentWidget = new TargetSettingsPanelWidget(project);
+ TargetSettingsPanelWidget *panelWidget = new TargetSettingsPanelWidget(project);
+ if (m_previousTargetSubIndex >= 0)
+ panelWidget->setCurrentSubIndex(m_previousTargetSubIndex);
+ m_currentWidget = panelWidget;
m_centralWidget->addWidget(m_currentWidget);
m_centralWidget->setCurrentWidget(m_currentWidget);
}
diff --git a/src/plugins/projectexplorer/projectwindow.h b/src/plugins/projectexplorer/projectwindow.h
index b4bf4fc948..512e7cafe6 100644
--- a/src/plugins/projectexplorer/projectwindow.h
+++ b/src/plugins/projectexplorer/projectwindow.h
@@ -94,6 +94,7 @@ private:
QStackedWidget *m_centralWidget;
QWidget *m_currentWidget;
QList<ProjectExplorer::Project *> m_tabIndexToProject;
+ int m_previousTargetSubIndex;
};
} // namespace Internal
diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp
index b40c86f2c2..6de64ac273 100644
--- a/src/plugins/projectexplorer/targetsettingspanel.cpp
+++ b/src/plugins/projectexplorer/targetsettingspanel.cpp
@@ -285,3 +285,13 @@ void TargetSettingsPanelWidget::updateTargetAddAndRemoveButtons()
m_selector->setAddButtonEnabled(!m_addMenu->actions().isEmpty());
m_selector->setRemoveButtonEnabled(m_project->targets().count() > 1);
}
+
+int TargetSettingsPanelWidget::currentSubIndex() const
+{
+ return m_selector->currentSubIndex();
+}
+
+void TargetSettingsPanelWidget::setCurrentSubIndex(int subIndex)
+{
+ m_selector->setCurrentSubIndex(subIndex);
+}
diff --git a/src/plugins/projectexplorer/targetsettingspanel.h b/src/plugins/projectexplorer/targetsettingspanel.h
index 874263b936..8e01f5c99e 100644
--- a/src/plugins/projectexplorer/targetsettingspanel.h
+++ b/src/plugins/projectexplorer/targetsettingspanel.h
@@ -57,6 +57,9 @@ public:
void setupUi();
+ int currentSubIndex() const;
+ void setCurrentSubIndex(int subIndex);
+
private slots:
void currentTargetChanged(int targetIndex, int subIndex);
void removeTarget();