forked from qt-creator/qt-creator
Add a way to query the VCS used from the ProjectWizardPage
Change-Id: Ice0fe952d03bea6dd95dbd48d2228a64d524400e Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
@@ -252,8 +252,10 @@ ProjectWizardPage::ProjectWizardPage(QWidget *parent) :
|
||||
m_ui->setupUi(this);
|
||||
m_ui->vcsManageButton->setText(Core::ICore::msgShowOptionsDialog());
|
||||
connect(m_ui->projectComboBox, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(slotProjectChanged(int)));
|
||||
connect(m_ui->vcsManageButton, SIGNAL(clicked()), this, SLOT(slotManageVcs()));
|
||||
this, SLOT(projectChanged(int)));
|
||||
connect(m_ui->addToVersionControlComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
this, &ProjectWizardPage::versionControlChanged);
|
||||
connect(m_ui->vcsManageButton, &QAbstractButton::clicked, this, &ProjectWizardPage::manageVcs);
|
||||
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Summary"));
|
||||
|
||||
connect(Core::VcsManager::instance(), SIGNAL(configurationChanged(const IVersionControl*)),
|
||||
@@ -447,6 +449,14 @@ void ProjectWizardPage::setVersionControlIndex(int idx)
|
||||
m_ui->addToVersionControlComboBox->setCurrentIndex(idx);
|
||||
}
|
||||
|
||||
IVersionControl *ProjectWizardPage::currentVersionControl()
|
||||
{
|
||||
int index = m_ui->addToVersionControlComboBox->currentIndex() - 1; // Subtract "<None>"
|
||||
if (index < 0 || index > m_activeVersionControls.count())
|
||||
return 0; // <None>
|
||||
return m_activeVersionControls.at(index);
|
||||
}
|
||||
|
||||
void ProjectWizardPage::setFiles(const QStringList &fileNames)
|
||||
{
|
||||
m_commonDirectory = Utils::commonPath(fileNames);
|
||||
@@ -491,14 +501,14 @@ void ProjectWizardPage::setProjectToolTip(const QString &tt)
|
||||
m_ui->projectLabel->setToolTip(tt);
|
||||
}
|
||||
|
||||
void ProjectWizardPage::slotProjectChanged(int index)
|
||||
void ProjectWizardPage::projectChanged(int index)
|
||||
{
|
||||
setProjectToolTip(index >= 0 && index < m_projectToolTips.size() ?
|
||||
m_projectToolTips.at(index) : QString());
|
||||
emit projectNodeChanged();
|
||||
}
|
||||
|
||||
void ProjectWizardPage::slotManageVcs()
|
||||
void ProjectWizardPage::manageVcs()
|
||||
{
|
||||
Core::ICore::showOptionsDialog(VcsBase::Constants::VCS_SETTINGS_CATEGORY,
|
||||
VcsBase::Constants::VCS_COMMON_SETTINGS_ID,
|
||||
|
||||
@@ -67,6 +67,7 @@ public:
|
||||
|
||||
int versionControlIndex() const;
|
||||
void setVersionControlIndex(int);
|
||||
Core::IVersionControl *currentVersionControl();
|
||||
|
||||
// Returns the common path
|
||||
void setFiles(const QStringList &files);
|
||||
@@ -79,13 +80,14 @@ public:
|
||||
|
||||
signals:
|
||||
void projectNodeChanged();
|
||||
void versionControlChanged(int);
|
||||
|
||||
public slots:
|
||||
void initializeVersionControls();
|
||||
|
||||
private slots:
|
||||
void slotProjectChanged(int);
|
||||
void slotManageVcs();
|
||||
void projectChanged(int);
|
||||
void manageVcs();
|
||||
|
||||
private:
|
||||
void setAdditionalInfo(const QString &text);
|
||||
|
||||
Reference in New Issue
Block a user