Commit 8c228443 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Add a way to query the VCS used from the ProjectWizardPage



Change-Id: Ice0fe952d03bea6dd95dbd48d2228a64d524400e
Reviewed-by: default avatarDaniel Teske <daniel.teske@theqtcompany.com>
parent a2ebc8ad
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment