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->setupUi(this);
|
||||||
m_ui->vcsManageButton->setText(Core::ICore::msgShowOptionsDialog());
|
m_ui->vcsManageButton->setText(Core::ICore::msgShowOptionsDialog());
|
||||||
connect(m_ui->projectComboBox, SIGNAL(currentIndexChanged(int)),
|
connect(m_ui->projectComboBox, SIGNAL(currentIndexChanged(int)),
|
||||||
this, SLOT(slotProjectChanged(int)));
|
this, SLOT(projectChanged(int)));
|
||||||
connect(m_ui->vcsManageButton, SIGNAL(clicked()), this, SLOT(slotManageVcs()));
|
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"));
|
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Summary"));
|
||||||
|
|
||||||
connect(Core::VcsManager::instance(), SIGNAL(configurationChanged(const IVersionControl*)),
|
connect(Core::VcsManager::instance(), SIGNAL(configurationChanged(const IVersionControl*)),
|
||||||
@@ -447,6 +449,14 @@ void ProjectWizardPage::setVersionControlIndex(int idx)
|
|||||||
m_ui->addToVersionControlComboBox->setCurrentIndex(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)
|
void ProjectWizardPage::setFiles(const QStringList &fileNames)
|
||||||
{
|
{
|
||||||
m_commonDirectory = Utils::commonPath(fileNames);
|
m_commonDirectory = Utils::commonPath(fileNames);
|
||||||
@@ -491,14 +501,14 @@ void ProjectWizardPage::setProjectToolTip(const QString &tt)
|
|||||||
m_ui->projectLabel->setToolTip(tt);
|
m_ui->projectLabel->setToolTip(tt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectWizardPage::slotProjectChanged(int index)
|
void ProjectWizardPage::projectChanged(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());
|
||||||
emit projectNodeChanged();
|
emit projectNodeChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectWizardPage::slotManageVcs()
|
void ProjectWizardPage::manageVcs()
|
||||||
{
|
{
|
||||||
Core::ICore::showOptionsDialog(VcsBase::Constants::VCS_SETTINGS_CATEGORY,
|
Core::ICore::showOptionsDialog(VcsBase::Constants::VCS_SETTINGS_CATEGORY,
|
||||||
VcsBase::Constants::VCS_COMMON_SETTINGS_ID,
|
VcsBase::Constants::VCS_COMMON_SETTINGS_ID,
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ public:
|
|||||||
|
|
||||||
int versionControlIndex() const;
|
int versionControlIndex() const;
|
||||||
void setVersionControlIndex(int);
|
void setVersionControlIndex(int);
|
||||||
|
Core::IVersionControl *currentVersionControl();
|
||||||
|
|
||||||
// Returns the common path
|
// Returns the common path
|
||||||
void setFiles(const QStringList &files);
|
void setFiles(const QStringList &files);
|
||||||
@@ -79,13 +80,14 @@ public:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void projectNodeChanged();
|
void projectNodeChanged();
|
||||||
|
void versionControlChanged(int);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void initializeVersionControls();
|
void initializeVersionControls();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void slotProjectChanged(int);
|
void projectChanged(int);
|
||||||
void slotManageVcs();
|
void manageVcs();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setAdditionalInfo(const QString &text);
|
void setAdditionalInfo(const QString &text);
|
||||||
|
|||||||
Reference in New Issue
Block a user