2011-04-20 15:48:35 +02:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2012-01-26 18:33:46 +01:00
|
|
|
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
2011-04-20 15:48:35 +02:00
|
|
|
**
|
2011-11-02 15:59:12 +01:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2011-04-20 15:48:35 +02:00
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
|
|
|
|
** This file may be used under the terms of the GNU Lesser General Public
|
|
|
|
|
** License version 2.1 as published by the Free Software Foundation and
|
|
|
|
|
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
|
|
|
|
** Please review the following information to ensure the GNU Lesser General
|
|
|
|
|
** Public License version 2.1 requirements will be met:
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
|
|
|
|
** Other Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
|
**
|
|
|
|
|
** If you have questions regarding the use of this file, please contact
|
2011-11-02 15:59:12 +01:00
|
|
|
** Nokia at qt-info@nokia.com.
|
2011-04-20 15:48:35 +02:00
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "vcsconfigurationpage.h"
|
|
|
|
|
|
|
|
|
|
#include "vcsbaseconstants.h"
|
|
|
|
|
|
|
|
|
|
#include "ui_vcsconfigurationpage.h"
|
|
|
|
|
|
|
|
|
|
#include <coreplugin/dialogs/iwizard.h>
|
|
|
|
|
#include <coreplugin/icore.h>
|
|
|
|
|
#include <coreplugin/iversioncontrol.h>
|
|
|
|
|
|
2012-01-12 11:32:45 +01:00
|
|
|
#include <utils/qtcassert.h>
|
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
namespace VcsBase {
|
2011-11-23 15:15:01 +00:00
|
|
|
namespace Internal {
|
2011-04-20 15:48:35 +02:00
|
|
|
|
|
|
|
|
class VcsConfigurationPagePrivate
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
VcsConfigurationPagePrivate() :
|
|
|
|
|
m_ui(new Ui::VcsConfigurationPage)
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
~VcsConfigurationPagePrivate()
|
|
|
|
|
{
|
|
|
|
|
delete m_ui;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Ui::VcsConfigurationPage *m_ui;
|
|
|
|
|
const Core::IVersionControl *m_versionControl;
|
|
|
|
|
};
|
|
|
|
|
|
2011-11-23 15:15:01 +00:00
|
|
|
} // namespace Internal
|
|
|
|
|
|
2011-04-20 15:48:35 +02:00
|
|
|
VcsConfigurationPage::VcsConfigurationPage(const Core::IVersionControl *vc, QWidget *parent) :
|
|
|
|
|
QWizardPage(parent),
|
2011-11-23 15:15:01 +00:00
|
|
|
d(new Internal::VcsConfigurationPagePrivate)
|
2011-04-20 15:48:35 +02:00
|
|
|
{
|
2012-01-12 11:32:45 +01:00
|
|
|
QTC_CHECK(vc);
|
2011-04-20 15:48:35 +02:00
|
|
|
setTitle(tr("Configuration"));
|
|
|
|
|
setSubTitle(tr("Please configure <b>%1</b> now.").arg(vc->displayName()));
|
|
|
|
|
|
2011-09-07 14:26:11 +02:00
|
|
|
d->m_versionControl = vc;
|
2011-04-20 15:48:35 +02:00
|
|
|
|
2011-09-07 14:26:11 +02:00
|
|
|
connect(d->m_versionControl, SIGNAL(configurationChanged()),
|
2011-04-20 15:48:35 +02:00
|
|
|
this, SIGNAL(completeChanged()));
|
|
|
|
|
|
2011-09-07 14:26:11 +02:00
|
|
|
d->m_ui->setupUi(this);
|
2011-04-20 15:48:35 +02:00
|
|
|
|
2011-09-07 14:26:11 +02:00
|
|
|
connect(d->m_ui->configureButton, SIGNAL(clicked()),
|
2011-04-20 15:48:35 +02:00
|
|
|
this, SLOT(openConfiguration()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
VcsConfigurationPage::~VcsConfigurationPage()
|
|
|
|
|
{
|
2011-09-07 14:26:11 +02:00
|
|
|
delete d->m_ui;
|
2011-04-20 15:48:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool VcsConfigurationPage::isComplete() const
|
|
|
|
|
{
|
2011-09-07 14:26:11 +02:00
|
|
|
return d->m_versionControl->isConfigured();
|
2011-04-20 15:48:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void VcsConfigurationPage::openConfiguration()
|
|
|
|
|
{
|
2012-01-31 10:57:10 +01:00
|
|
|
Core::ICore::showOptionsDialog(QLatin1String(VcsBase::Constants::VCS_SETTINGS_CATEGORY),
|
|
|
|
|
d->m_versionControl->id().toString());
|
2011-04-20 15:48:35 +02:00
|
|
|
}
|
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
} // namespace VcsBase
|