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