}
-bool GuiBranches::eventFilter(QObject * obj, QEvent * event)
+bool GuiBranches::eventFilter(QObject * obj, QEvent * event)
{
QEvent::Type etype = event->type();
- if (etype == QEvent::KeyPress
+ if (etype == QEvent::KeyPress
&& obj == newBranchLE
&& addBranchPB->isEnabled()) {
QKeyEvent * keyEvent = static_cast<QKeyEvent *>(event);
if (!sel_branch.isEmpty()) {
docstring newname;
docstring const oldname = qstring_to_ucs4(sel_branch);
- bool success = false;
if (Alert::askForText(newname, _("Enter new branch name"), oldname)) {
if (newname.empty() || oldname == newname)
return;
+ bool success = false;
if (branchlist_.find(newname)) {
docstring text = support::bformat(
_("A branch with the name \"%1$s\" already exists.\n"
updateView();
if (!success)
- Alert::error(_("Renaming failed"),
+ Alert::error(_("Renaming failed"),
_("The branch could not be renamed."));
else
// emit signal
{
QList<QListWidgetItem *> selItems =
undef_->branchesLW->selectedItems();
-
+
QList<QListWidgetItem *>::const_iterator it = selItems.begin();
for (; it != selItems.end() ; ++it) {
QListWidgetItem const * new_branch = *it;