Gerrit: added ability to save path for applying patches

Change-Id: I3cc8f1d19784145a7fbf19c321ccbc079847fbc2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Petar Perisin
2013-03-26 20:02:06 +02:00
parent 42547062af
commit 83d51b2691
11 changed files with 224 additions and 40 deletions

View File

@@ -84,8 +84,10 @@ GerritOptionsWidget::GerritOptionsWidget(QWidget *parent)
, m_hostLineEdit(new QLineEdit(this))
, m_userLineEdit(new QLineEdit(this))
, m_sshChooser(new Utils::PathChooser)
, m_repositoryChooser(new Utils::PathChooser)
, m_portSpinBox(new QSpinBox(this))
, m_httpsCheckBox(new QCheckBox(tr("HTTPS")))
, m_promptPathCheckBox(new QCheckBox(tr("Always prompt for repository folder")))
{
QFormLayout *formLayout = new QFormLayout(this);
formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
@@ -94,6 +96,11 @@ GerritOptionsWidget::GerritOptionsWidget(QWidget *parent)
m_sshChooser->setExpectedKind(Utils::PathChooser::ExistingCommand);
m_sshChooser->setCommandVersionArguments(QStringList(QLatin1String("-V")));
formLayout->addRow(tr("&ssh:"), m_sshChooser);
formLayout->addRow(tr("&Repository:"), m_repositoryChooser);
m_repositoryChooser->setToolTip(tr("Default repository where patches will be applied."));
formLayout->addRow(tr("Pr&ompt:"), m_promptPathCheckBox);
m_promptPathCheckBox->setToolTip(tr("If checked, user will always be\n"
"asked to confirm the repository path."));
m_portSpinBox->setMinimum(1);
m_portSpinBox->setMaximum(65535);
formLayout->addRow(tr("&Port:"), m_portSpinBox);
@@ -110,8 +117,10 @@ GerritParameters GerritOptionsWidget::parameters() const
result.host = m_hostLineEdit->text().trimmed();
result.user = m_userLineEdit->text().trimmed();
result.ssh = m_sshChooser->path();
result.repositoryPath = m_repositoryChooser->path();
result.port = m_portSpinBox->value();
result.https = m_httpsCheckBox->isChecked();
result.promptPath = m_promptPathCheckBox->isChecked();
return result;
}
@@ -120,8 +129,10 @@ void GerritOptionsWidget::setParameters(const GerritParameters &p)
m_hostLineEdit->setText(p.host);
m_userLineEdit->setText(p.user);
m_sshChooser->setPath(p.ssh);
m_repositoryChooser->setPath(p.repositoryPath);
m_portSpinBox->setValue(p.port);
m_httpsCheckBox->setChecked(p.https);
m_promptPathCheckBox->setChecked(p.promptPath);
}
} // namespace Internal