forked from qt-creator/qt-creator
VCS: Use better terms on checkout wizard for DVCS
Change-Id: I9064c71787dbfb1eee6f8f473df39dda23a1252a Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
3eac49d9c3
commit
f0147ba19f
@@ -48,6 +48,7 @@ CloneWizard::CloneWizard(QObject *parent)
|
||||
m_icon(QIcon(QLatin1String(":/bazaar/images/bazaar.png")))
|
||||
{
|
||||
setId(QLatin1String(VcsBase::Constants::VCS_ID_BAZAAR));
|
||||
setCustomLabels(tr("Cloning"), tr("Cloning started..."));
|
||||
}
|
||||
|
||||
QIcon CloneWizard::icon() const
|
||||
|
||||
@@ -46,6 +46,7 @@ CloneWizard::CloneWizard(QObject *parent) :
|
||||
VcsBase::BaseCheckoutWizard(parent)
|
||||
{
|
||||
setId(QLatin1String(VcsBase::Constants::VCS_ID_GIT));
|
||||
setCustomLabels(tr("Cloning"), tr("Cloning started..."));
|
||||
}
|
||||
|
||||
QIcon CloneWizard::icon() const
|
||||
|
||||
@@ -45,6 +45,7 @@ CloneWizard::CloneWizard(QObject *parent)
|
||||
m_icon(QIcon(QLatin1String(":/mercurial/images/hg.png")))
|
||||
{
|
||||
setId(QLatin1String(Constants::VCS_ID_MERCURIAL));
|
||||
setCustomLabels(tr("Cloning"), tr("Cloning started..."));
|
||||
}
|
||||
|
||||
QIcon CloneWizard::icon() const
|
||||
|
||||
@@ -72,6 +72,8 @@ public:
|
||||
QList<QWizardPage *> parameterPages;
|
||||
QString checkoutPath;
|
||||
QString id;
|
||||
QString progressTitle;
|
||||
QString startedStatus;
|
||||
};
|
||||
|
||||
void BaseCheckoutWizardPrivate::clear()
|
||||
@@ -130,6 +132,10 @@ void BaseCheckoutWizard::runWizard(const QString &path, QWidget *parent, const Q
|
||||
// Create dialog and launch
|
||||
d->parameterPages = createParameterPages(path);
|
||||
Internal::CheckoutWizardDialog dialog(d->parameterPages, parent);
|
||||
if (!d->progressTitle.isEmpty())
|
||||
dialog.setTitle(d->progressTitle);
|
||||
if (!d->startedStatus.isEmpty())
|
||||
dialog.setStartedStatus(d->startedStatus);
|
||||
d->dialog = &dialog;
|
||||
connect(&dialog, SIGNAL(progressPageShown()), this, SLOT(slotProgressPageShown()));
|
||||
dialog.setWindowTitle(displayName());
|
||||
@@ -212,6 +218,12 @@ QString BaseCheckoutWizard::openProject(const QString &path, QString *errorMessa
|
||||
return projectFile;
|
||||
}
|
||||
|
||||
void BaseCheckoutWizard::setCustomLabels(const QString &progressTitle, const QString &startedStatus)
|
||||
{
|
||||
d->progressTitle = progressTitle;
|
||||
d->startedStatus = startedStatus;
|
||||
}
|
||||
|
||||
void BaseCheckoutWizard::slotProgressPageShown()
|
||||
{
|
||||
Command *command = createCommand(d->parameterPages, &(d->checkoutPath));
|
||||
|
||||
@@ -72,6 +72,7 @@ public:
|
||||
static QString openProject(const QString &path, QString *errorMessage);
|
||||
|
||||
protected:
|
||||
void setCustomLabels(const QString &progressTitle, const QString &startedStatus);
|
||||
virtual QList<QWizardPage *> createParameterPages(const QString &path) = 0;
|
||||
virtual Command *createCommand(const QList<QWizardPage *> ¶meterPages,
|
||||
QString *checkoutPath) = 0;
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
<string>The path in which the directory containing the checkout will be created.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Checkout path:</string>
|
||||
<string>Path:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -107,7 +107,7 @@
|
||||
<string>The local directory that will contain the code after the checkout.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Checkout directory:</string>
|
||||
<string>Directory:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -53,6 +53,7 @@ namespace Internal {
|
||||
CheckoutProgressWizardPage::CheckoutProgressWizardPage(QWidget *parent) :
|
||||
QWizardPage(parent),
|
||||
ui(new Ui::CheckoutProgressWizardPage),
|
||||
m_startedStatus(tr("Checkout started...")),
|
||||
m_state(Idle)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
@@ -66,6 +67,11 @@ CheckoutProgressWizardPage::~CheckoutProgressWizardPage()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void CheckoutProgressWizardPage::setStartedStatus(const QString &startedStatus)
|
||||
{
|
||||
m_startedStatus = startedStatus;
|
||||
}
|
||||
|
||||
void CheckoutProgressWizardPage::start(Command *command)
|
||||
{
|
||||
if (!command) {
|
||||
@@ -80,7 +86,7 @@ void CheckoutProgressWizardPage::start(Command *command)
|
||||
connect(command, SIGNAL(finished(bool,int,QVariant)), this, SLOT(slotFinished(bool,int,QVariant)));
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
ui->logPlainTextEdit->clear();
|
||||
ui->statusLabel->setText(tr("Checkout started..."));
|
||||
ui->statusLabel->setText(m_startedStatus);
|
||||
ui->statusLabel->setPalette(QPalette());
|
||||
m_state = Running;
|
||||
command->execute();
|
||||
|
||||
@@ -50,6 +50,7 @@ public:
|
||||
explicit CheckoutProgressWizardPage(QWidget *parent = 0);
|
||||
~CheckoutProgressWizardPage();
|
||||
|
||||
void setStartedStatus(const QString &startedStatus);
|
||||
void start(Command *command);
|
||||
|
||||
virtual bool isComplete() const;
|
||||
@@ -69,6 +70,7 @@ private:
|
||||
Ui::CheckoutProgressWizardPage *ui;
|
||||
|
||||
Command *m_command;
|
||||
QString m_startedStatus;
|
||||
QString m_error;
|
||||
|
||||
State m_state;
|
||||
|
||||
@@ -61,6 +61,16 @@ CheckoutWizardDialog::CheckoutWizardDialog(const QList<QWizardPage *> ¶meter
|
||||
Core::BaseFileWizard::setupWizard(this);
|
||||
}
|
||||
|
||||
void CheckoutWizardDialog::setTitle(const QString &title)
|
||||
{
|
||||
m_progressPage->setTitle(title);
|
||||
}
|
||||
|
||||
void CheckoutWizardDialog::setStartedStatus(const QString &title)
|
||||
{
|
||||
m_progressPage->setStartedStatus(title);
|
||||
}
|
||||
|
||||
void CheckoutWizardDialog::slotPageChanged(int id)
|
||||
{
|
||||
if (id == m_progressPageId)
|
||||
|
||||
@@ -48,6 +48,8 @@ public:
|
||||
explicit CheckoutWizardDialog(const QList<QWizardPage *> ¶meterPages,
|
||||
QWidget *parent = 0);
|
||||
|
||||
void setTitle(const QString &title);
|
||||
void setStartedStatus(const QString &title);
|
||||
void start(VcsBase::Command *command);
|
||||
|
||||
signals:
|
||||
|
||||
Reference in New Issue
Block a user