diff --git a/src/plugins/git/gerrit/gerritpushdialog.cpp b/src/plugins/git/gerrit/gerritpushdialog.cpp index df58cda6c68..bbb647980ee 100644 --- a/src/plugins/git/gerrit/gerritpushdialog.cpp +++ b/src/plugins/git/gerrit/gerritpushdialog.cpp @@ -121,15 +121,7 @@ void GerritPushDialog::initRemoteBranches() QStringList remotes = m_remoteBranches.keys(); remotes.removeDuplicates(); m_ui->remoteComboBox->addItems(remotes); - const int remoteCount = m_ui->remoteComboBox->count(); - if (remoteCount < 1) { - return; - } else if (remoteCount == 1) { - m_ui->remoteLabel->hide(); - m_ui->remoteComboBox->hide(); - } else { - connect(m_ui->remoteComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setRemoteBranches())); - } + m_ui->remoteComboBox->setEnabled(remotes.count() > 1); } GerritPushDialog::GerritPushDialog(const QString &workingDir, const QString &reviewerList, QWidget *parent) : @@ -141,8 +133,7 @@ GerritPushDialog::GerritPushDialog(const QString &workingDir, const QString &rev m_client = GitPlugin::instance()->gitClient(); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); m_ui->setupUi(this); - m_ui->repositoryLabel->setText(tr("Local repository: %1").arg( - QDir::toNativeSeparators(workingDir))); + m_ui->repositoryLabel->setText(QDir::toNativeSeparators(workingDir)); PushItemDelegate *delegate = new PushItemDelegate(m_ui->commitView); delegate->setParent(this); @@ -153,10 +144,11 @@ GerritPushDialog::GerritPushDialog(const QString &workingDir, const QString &rev return; m_ui->localBranchComboBox->init(workingDir); - connect(m_ui->localBranchComboBox, SIGNAL(currentIndexChanged(int)), - this, SLOT(updateCommits(int))); + connect(m_ui->localBranchComboBox, static_cast(&QComboBox::currentIndexChanged), + this, &GerritPushDialog::updateCommits); - connect(m_ui->targetBranchComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setChangeRange())); + connect(m_ui->targetBranchComboBox, static_cast(&QComboBox::currentIndexChanged), + this, &GerritPushDialog::setChangeRange); updateCommits(m_ui->localBranchComboBox->currentIndex()); setRemoteBranches(); @@ -166,6 +158,9 @@ GerritPushDialog::GerritPushDialog(const QString &workingDir, const QString &rev m_ui->reviewersLineEdit->setValidator(noSpaceValidator); m_ui->topicLineEdit->setValidator(noSpaceValidator); + connect(m_ui->remoteComboBox, static_cast(&QComboBox::currentIndexChanged), + this, &GerritPushDialog::setRemoteBranches); + m_isValid = true; } diff --git a/src/plugins/git/gerrit/gerritpushdialog.ui b/src/plugins/git/gerrit/gerritpushdialog.ui index bc0f4c50bff..692cc3a316a 100644 --- a/src/plugins/git/gerrit/gerritpushdialog.ui +++ b/src/plugins/git/gerrit/gerritpushdialog.ui @@ -7,162 +7,43 @@ 0 0 600 - 520 + 410 Push to Gerrit - - - - - 10 - - - 3 - - - 3 - - - 3 - - - - - <b>Local repository:</b> - - - - + + + - - - - Destination: + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 6 + + + + + + + + &Reviewers: + + + reviewersLineEdit - - - QFormLayout::AllNonFixedFieldsGrow - - - - - &Local branch: - - - localBranchComboBox - - - - - - - - - - R&emote: - - - remoteComboBox - - - - - - - - - - Target &branch: - - - targetBranchComboBox - - - - - - - - - - &Topic: - - - topicLineEdit - - - - - - - - - - &Draft - - - - - - - Number of commits - - - - - - - - &Push up to commit: - - - - - - Pushes the selected commit and all dependent commits. - - - - - - - - - - - - - 75 - true - - - - &Reviewers: - - - reviewersLineEdit - - - - - - - Comma-separated list of reviewers. - -Reviewers can be specified by nickname or email address. Spaces not allowed. - -Partial names can be used if they are unambiguous. - - - - - - + Qt::Vertical @@ -175,7 +56,7 @@ Partial names can be used if they are unambiguous. - + Qt::Horizontal @@ -185,6 +66,127 @@ Partial names can be used if they are unambiguous. + + + + + + + + + &Draft + + + + + + + + + Pushes the selected commit and all dependent commits. + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 6 + + + + + + + + &Topic: + + + topicLineEdit + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 6 + + + + + + + + Push: + + + localBranchComboBox + + + + + + + Commits: + + + + + + + Local repository + + + + + + + + + + To: + + + remoteComboBox + + + + + + + + + + Number of commits + + + + + + + Comma-separated list of reviewers. + +Reviewers can be specified by nickname or email address. Spaces not allowed. + +Partial names can be used if they are unambiguous. + + +