Skip to content
Snippets Groups Projects
Commit 0ae3d29a authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

Git: Simplify button enabling conditions in branches


Change-Id: I6484dd62eac80e1e4aba00890926e7dfb542f0be
Reviewed-by: default avatarPetar Perisin <petar.perisin@gmail.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 7517a340
No related branches found
No related tags found
No related merge requests found
...@@ -104,14 +104,15 @@ void BranchDialog::enableButtons() ...@@ -104,14 +104,15 @@ void BranchDialog::enableButtons()
const bool currentSelected = hasSelection && idx == m_model->currentBranch(); const bool currentSelected = hasSelection && idx == m_model->currentBranch();
const bool isLocal = m_model->isLocal(idx); const bool isLocal = m_model->isLocal(idx);
const bool isLeaf = m_model->isLeaf(idx); const bool isLeaf = m_model->isLeaf(idx);
const bool hasActions = hasSelection && isLeaf;
m_ui->removeButton->setEnabled(hasSelection && !currentSelected && isLocal && isLeaf);
m_ui->renameButton->setEnabled(hasSelection && isLocal && isLeaf); m_ui->removeButton->setEnabled(hasActions && !currentSelected && isLocal);
m_ui->logButton->setEnabled(hasSelection && isLeaf); m_ui->renameButton->setEnabled(hasActions && isLocal);
m_ui->diffButton->setEnabled(hasSelection && isLeaf); m_ui->logButton->setEnabled(hasActions);
m_ui->checkoutButton->setEnabled(hasSelection && !currentSelected && isLeaf); m_ui->diffButton->setEnabled(hasActions);
m_ui->rebaseButton->setEnabled(hasSelection && !currentSelected && isLeaf); m_ui->checkoutButton->setEnabled(hasActions && !currentSelected);
m_ui->mergeButton->setEnabled(hasSelection && !currentSelected && isLeaf); m_ui->rebaseButton->setEnabled(hasActions && !currentSelected);
m_ui->mergeButton->setEnabled(hasActions && !currentSelected);
} }
void BranchDialog::refresh() void BranchDialog::refresh()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment