forked from qt-creator/qt-creator
Git: Hide remote in Push to Gerrit dialog if there is only 1
Change-Id: Id4b701e16f6edc74b2ad19b5255d84ceca5ec216 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
e844bee1da
commit
9228587b8e
@@ -115,12 +115,16 @@ GerritPushDialog::GerritPushDialog(const QString &workingDir, QWidget *parent) :
|
||||
m_ui->remoteComboBox->setCurrentIndex(currIndex);
|
||||
++currIndex;
|
||||
}
|
||||
if (m_ui->remoteComboBox->count() < 1)
|
||||
const int remoteCount = m_ui->remoteComboBox->count();
|
||||
if (remoteCount < 1) {
|
||||
reject();
|
||||
|
||||
m_ui->remoteComboBox->setEnabled(m_ui->remoteComboBox->count() != 1);
|
||||
|
||||
connect(m_ui->remoteComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setRemoteBranches()));
|
||||
return;
|
||||
} else if (remoteCount == 1) {
|
||||
m_ui->remoteLabel->hide();
|
||||
m_ui->remoteComboBox->hide();
|
||||
} else {
|
||||
connect(m_ui->remoteComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setRemoteBranches()));
|
||||
}
|
||||
connect(m_ui->branchComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setChangeRange()));
|
||||
setRemoteBranches();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user