Exemplo n.º 1
0
QString SrcDestDialog::getRepositoryString() const
{
    if (m_ui->defaultButton->isChecked()) {
        QUrl repoUrl(getRepoUrl());
        if (m_ui->promptForCredentials->isChecked() && !repoUrl.scheme().isEmpty() && repoUrl.scheme() != QLatin1String("file")) {
            QScopedPointer<AuthenticationDialog> authDialog(new AuthenticationDialog(repoUrl.userName(), repoUrl.password()));
            authDialog->setPasswordEnabled(repoUrl.scheme() != QLatin1String("ssh"));
            if (authDialog->exec()== 0)
                return repoUrl.toString();

            QString user = authDialog->getUserName();
            if (user.isEmpty())
                return repoUrl.toString();
            if (user != repoUrl.userName())
                repoUrl.setUserName(user);

            QString pass = authDialog->getPassword();
            if (!pass.isEmpty() && pass != repoUrl.password())
                repoUrl.setPassword(pass);
        }
        return repoUrl.toString();
    }
    if (m_ui->localButton->isChecked())
        return m_ui->localPathChooser->path();
    return m_ui->urlLineEdit->text();
}
Exemplo n.º 2
0
SrcDestDialog::SrcDestDialog(Direction dir, QWidget *parent) :
    QDialog(parent),
    m_ui(new Ui::SrcDestDialog),
    m_direction(dir)
{
    m_ui->setupUi(this);
    m_ui->localPathChooser->setExpectedKind(Utils::PathChooser::ExistingDirectory);
    m_ui->localPathChooser->setHistoryCompleter(QLatin1String("Hg.SourceDir.History"));
    QUrl repoUrl(getRepoUrl());
    if (repoUrl.isEmpty())
        return;
    if (!repoUrl.password().isEmpty())
        repoUrl.setPassword(QLatin1String("***"));
    m_ui->defaultPath->setText(repoUrl.toString());
    m_ui->promptForCredentials->setChecked(!repoUrl.scheme().isEmpty() && repoUrl.scheme() != QLatin1String("file"));
}
Exemplo n.º 3
0
std::string ZDvidUrl::getInfoUrl() const
{
  return GetFullUrl(getRepoUrl(), "info");
}
Exemplo n.º 4
0
std::string ZDvidUrl::getInstanceUrl() const
{
  return GetFullUrl(getRepoUrl(), "instance");
}
Exemplo n.º 5
0
std::string ZDvidUrl::getInstanceUrl() const
{
  return getRepoUrl() + "/instance";
}