X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiBranches.cpp;h=ab91587098bc2c4f3d28ea2df73d0eb7325df729;hb=b7f6b979d0f889f08e735f35378bb20ba3788b4b;hp=9445a1656770efe9369e2b09906c809717cfac54;hpb=612109bb6e5e61ba3c3693696f329eac3a288b5b;p=lyx.git diff --git a/src/frontends/qt4/GuiBranches.cpp b/src/frontends/qt4/GuiBranches.cpp index 9445a16567..ab91587098 100644 --- a/src/frontends/qt4/GuiBranches.cpp +++ b/src/frontends/qt4/GuiBranches.cpp @@ -80,10 +80,10 @@ GuiBranches::GuiBranches(QWidget * parent) } -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(event); @@ -206,10 +206,10 @@ void GuiBranches::on_renamePB_pressed() 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" @@ -224,7 +224,7 @@ void GuiBranches::on_renamePB_pressed() updateView(); if (!success) - Alert::error(_("Renaming failed"), + Alert::error(_("Renaming failed"), _("The branch could not be renamed.")); else // emit signal @@ -352,7 +352,7 @@ void GuiBranches::addUnknown() { QList selItems = undef_->branchesLW->selectedItems(); - + QList::const_iterator it = selItems.begin(); for (; it != selItems.end() ; ++it) { QListWidgetItem const * new_branch = *it;