ProjectWizard: Add button to take you to VCS configuration

This makes setting up VCS more discoverable.
This commit is contained in:
Tobias Hunger
2011-04-15 16:39:22 +02:00
parent fea13a449c
commit 672f44d026
3 changed files with 52 additions and 24 deletions

View File

@@ -33,6 +33,9 @@
#include "projectwizardpage.h" #include "projectwizardpage.h"
#include "ui_projectwizardpage.h" #include "ui_projectwizardpage.h"
#include <coreplugin/coreimpl.h>
#include <vcsbase/vcsbaseconstants.h>
#include <QtCore/QDir> #include <QtCore/QDir>
#include <QtCore/QTextStream> #include <QtCore/QTextStream>
@@ -54,6 +57,7 @@ ProjectWizardPage::ProjectWizardPage(QWidget *parent) :
m_ui->setupUi(this); m_ui->setupUi(this);
connect(m_ui->projectComboBox, SIGNAL(currentIndexChanged(int)), connect(m_ui->projectComboBox, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotProjectChanged(int))); this, SLOT(slotProjectChanged(int)));
connect(m_ui->vcsManageButton, SIGNAL(clicked()), this, SLOT(slotManageVcs()));
setProperty("shortTitle", tr("Summary")); setProperty("shortTitle", tr("Summary"));
} }
@@ -157,3 +161,10 @@ void ProjectWizardPage::slotProjectChanged(int index)
setProjectToolTip(index >= 0 && index < m_projectToolTips.size() ? setProjectToolTip(index >= 0 && index < m_projectToolTips.size() ?
m_projectToolTips.at(index) : QString()); m_projectToolTips.at(index) : QString());
} }
void ProjectWizardPage::slotManageVcs()
{
Core::ICore *core = Core::ICore::instance();
core->showOptionsDialog(VCSBase::Constants::VCS_SETTINGS_CATEGORY,
VCSBase::Constants::VCS_COMMON_SETTINGS_ID);
}

View File

@@ -72,6 +72,7 @@ protected:
private slots: private slots:
void slotProjectChanged(int); void slotProjectChanged(int);
void slotManageVcs();
private: private:
inline void setProjectToolTip(const QString &); inline void setProjectToolTip(const QString &);

View File

@@ -2,15 +2,20 @@
<ui version="4.0"> <ui version="4.0">
<class>ProjectExplorer::Internal::WizardPage</class> <class>ProjectExplorer::Internal::WizardPage</class>
<widget class="QWizardPage" name="ProjectExplorer::Internal::WizardPage"> <widget class="QWizardPage" name="ProjectExplorer::Internal::WizardPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>307</width>
<height>241</height>
</rect>
</property>
<property name="title"> <property name="title">
<string>Project Management</string> <string>Project Management</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QFormLayout" name="formLayout"> <layout class="QGridLayout" name="gridLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="projectLabel"> <widget class="QLabel" name="projectLabel">
<property name="enabled"> <property name="enabled">
@@ -37,6 +42,16 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1" colspan="2">
<widget class="QLabel" name="additionalInfo">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="addToVersionControlLabel"> <widget class="QLabel" name="addToVersionControlLabel">
<property name="text"> <property name="text">
@@ -57,13 +72,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="2" column="2">
<widget class="QLabel" name="additionalInfo"> <widget class="QPushButton" name="vcsManageButton">
<property name="text"> <property name="text">
<string/> <string>Manage</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
@@ -104,26 +116,30 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>218</width> <width>289</width>
<height>83</height> <height>131</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <widget class="QLabel" name="filesLabel">
<item> <property name="geometry">
<widget class="QLabel" name="filesLabel"> <rect>
<property name="text"> <x>9</x>
<string>The following files will be added: <y>9</y>
<width>154</width>
<height>65</height>
</rect>
</property>
<property name="text">
<string>The following files will be added:
</string> </string>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property> </property>
</widget> </widget>
</item>
</layout>
</widget> </widget>
</widget> </widget>
</item> </item>