summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@digia.com>2013-11-01 11:57:59 +0100
committerTobias Hunger <tobias.hunger@digia.com>2013-11-04 14:48:40 +0100
commit92008f4b6a9bdfd390eed925d92437bf36e77b88 (patch)
treec81e6b6b07387e76795250b4866b087418612063
parentfaf387b17964ed3304f834f58baa28202a0f4a71 (diff)
downloadqt-creator-92008f4b6a9bdfd390eed925d92437bf36e77b88.tar.gz
Project Mode: Show run settings for projects without build settings
Open the "Run" view by default when switching targets in projects without build settings. The build settings view is not what the user wants in that case. Change-Id: I14b5d32fa3fdfef1ba7d4f9f6af383d28021baa8 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
-rw-r--r--src/plugins/projectexplorer/targetselector.cpp4
-rw-r--r--src/plugins/projectexplorer/targetselector.h2
-rw-r--r--src/plugins/projectexplorer/targetsettingspanel.cpp8
-rw-r--r--src/plugins/projectexplorer/targetsettingswidget.cpp4
-rw-r--r--src/plugins/projectexplorer/targetsettingswidget.h2
5 files changed, 10 insertions, 10 deletions
diff --git a/src/plugins/projectexplorer/targetselector.cpp b/src/plugins/projectexplorer/targetselector.cpp
index d09f83f562..6a9ecd4c95 100644
--- a/src/plugins/projectexplorer/targetselector.cpp
+++ b/src/plugins/projectexplorer/targetselector.cpp
@@ -116,13 +116,13 @@ void TargetSelector::menuAboutToHide()
updateButtons();
}
-void TargetSelector::insertTarget(int index, const QString &name)
+void TargetSelector::insertTarget(int index, int subIndex, const QString &name)
{
QTC_ASSERT(index >= 0 && index <= m_targets.count(), return);
Target target;
target.name = name;
- target.currentSubIndex = 0;
+ target.currentSubIndex = subIndex;
m_targets.insert(index, target);
diff --git a/src/plugins/projectexplorer/targetselector.h b/src/plugins/projectexplorer/targetselector.h
index f882cbf7f4..7abe969682 100644
--- a/src/plugins/projectexplorer/targetselector.h
+++ b/src/plugins/projectexplorer/targetselector.h
@@ -67,7 +67,7 @@ public:
void setTargetMenu(QMenu *menu);
public:
- void insertTarget(int index, const QString &name);
+ void insertTarget(int index, int subIndex, const QString &name);
void renameTarget(int index, const QString &name);
void removeTarget(int index);
void setCurrentIndex(int index);
diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp
index 95a99377a0..780398e302 100644
--- a/src/plugins/projectexplorer/targetsettingspanel.cpp
+++ b/src/plugins/projectexplorer/targetsettingspanel.cpp
@@ -181,9 +181,7 @@ void TargetSettingsPanelWidget::setupUi()
// Now set the correct target
int index = m_targets.indexOf(m_project->activeTarget());
m_selector->setCurrentIndex(index);
- m_selector->setCurrentSubIndex(0);
-
- currentTargetChanged(index, 0);
+ currentTargetChanged(index, m_selector->currentSubIndex());
connect(m_selector, SIGNAL(currentChanged(int,int)),
this, SLOT(currentTargetChanged(int,int)));
@@ -488,7 +486,9 @@ void TargetSettingsPanelWidget::targetAdded(ProjectExplorer::Target *target)
if (m_targets.count() == pos ||
m_targets.at(pos)->displayName() > target->displayName()) {
m_targets.insert(pos, target);
- m_selector->insertTarget(pos, target->displayName());
+ m_selector->insertTarget(pos, m_project->hasActiveBuildSettings() ? 0 : 1,
+ target->displayName());
+
break;
}
}
diff --git a/src/plugins/projectexplorer/targetsettingswidget.cpp b/src/plugins/projectexplorer/targetsettingswidget.cpp
index 88c53616a0..a83e228c97 100644
--- a/src/plugins/projectexplorer/targetsettingswidget.cpp
+++ b/src/plugins/projectexplorer/targetsettingswidget.cpp
@@ -83,9 +83,9 @@ TargetSettingsWidget::~TargetSettingsWidget()
delete ui;
}
-void TargetSettingsWidget::insertTarget(int index, const QString &name)
+void TargetSettingsWidget::insertTarget(int index, int subIndex, const QString &name)
{
- m_targetSelector->insertTarget(index, name);
+ m_targetSelector->insertTarget(index, subIndex, name);
}
void TargetSettingsWidget::renameTarget(int index, const QString &name)
diff --git a/src/plugins/projectexplorer/targetsettingswidget.h b/src/plugins/projectexplorer/targetsettingswidget.h
index 1b678c4a20..808e62a93e 100644
--- a/src/plugins/projectexplorer/targetsettingswidget.h
+++ b/src/plugins/projectexplorer/targetsettingswidget.h
@@ -62,7 +62,7 @@ public:
int currentSubIndex() const;
public:
- void insertTarget(int index, const QString &name);
+ void insertTarget(int index, int subIndex, const QString &name);
void renameTarget(int index, const QString &name);
void removeTarget(int index);
void setCurrentIndex(int index);