}
}
unknownPB->setEnabled(!unknown_branches_.isEmpty());
+ bool const have_sel =
+ !branchesTW->selectedItems().isEmpty();
+ removePB->setEnabled(have_sel);
+ renamePB->setEnabled(have_sel);
// emit signal
changed();
}
docstring newname;
docstring const oldname = qstring_to_ucs4(sel_branch);
bool success = false;
- if (Alert::askForText(newname, _("Enter new branch name"))) {
+ if (Alert::askForText(newname, _("Enter new branch name"), oldname)) {
+ if (newname.empty() || oldname == newname)
+ return;
if (branchlist_.find(newname)) {
docstring text = support::bformat(
_("A branch with the name \"%1$s\" already exists.\n"
}
+void GuiBranches::on_branchesTW_itemSelectionChanged()
+{
+ bool const have_sel =
+ !branchesTW->selectedItems().isEmpty();
+ removePB->setEnabled(have_sel);
+ renamePB->setEnabled(have_sel);
+}
+
+
void GuiBranches::toggleBranch(QTreeWidgetItem * item)
{
if (item == 0)
void on_renamePB_pressed();
void on_activatePB_pressed();
void on_branchesTW_itemDoubleClicked(QTreeWidgetItem *, int);
+ void on_branchesTW_itemSelectionChanged();
void on_colorPB_clicked();
void on_unknownPB_pressed();
void addUnknown();