fixed the focus behavior after deletion

preferencesAboutTextFull
Clément Fauconnier 6 years ago
parent 5ed13efe0b
commit 38fe327e80
  1. 20
      src/document/UBDocumentController.cpp

@ -1298,7 +1298,6 @@ void UBDocumentTreeView::setSelectedAndExpanded(const QModelIndex &pIndex, bool
selectionModel()->select(proxy->mapFromSource(indexCurrentDoc), QItemSelectionModel::Rows | sel); selectionModel()->select(proxy->mapFromSource(indexCurrentDoc), QItemSelectionModel::Rows | sel);
while (indexCurrentDoc.parent().isValid()) { while (indexCurrentDoc.parent().isValid()) {
setExpanded(indexCurrentDoc.parent(), pExpand); setExpanded(indexCurrentDoc.parent(), pExpand);
indexCurrentDoc = indexCurrentDoc.parent(); indexCurrentDoc = indexCurrentDoc.parent();
@ -1680,7 +1679,7 @@ void UBDocumentController::selectDocument(UBDocumentProxy* proxy, bool setAsCurr
if (proxy != mBoardController->selectedDocument()) // only if wanted Document is different from document actually on Board, // ALTI/AOU - 20140217 if (proxy != mBoardController->selectedDocument()) // only if wanted Document is different from document actually on Board, // ALTI/AOU - 20140217
{ {
//issue 1629 - NNE - 20131105 : When set a current document, change in the board controller //issue 1629 - NNE - 20131105 : When set a current document, change in the board controller
mBoardController->setActiveDocumentScene(proxy, 0, false, onImport); mBoardController->setActiveDocumentScene(proxy, 0, true, onImport);
} }
} }
@ -2278,7 +2277,6 @@ void UBDocumentController::deleteMultipleItems(QModelIndexList indexes, UBDocume
break; break;
} }
} }
updateActions();
} }
void UBDocumentController::deleteSingleItem(QModelIndex currentIndex, UBDocumentTreeModel* docModel) void UBDocumentController::deleteSingleItem(QModelIndex currentIndex, UBDocumentTreeModel* docModel)
@ -2341,7 +2339,6 @@ void UBDocumentController::deleteSingleItem(QModelIndex currentIndex, UBDocument
break; break;
} }
} }
updateActions();
} }
//N/C - NNE - 20140410 //N/C - NNE - 20140410
@ -2377,12 +2374,7 @@ void UBDocumentController::moveIndexesToTrash(const QModelIndexList &list, UBDoc
if (proxy) if (proxy)
{ {
setDocument(proxy); selectDocument(proxy,true);
UBApplication::boardController->setActiveDocumentScene(proxy,0,true);
docModel->setCurrentDocument(proxy);
selectionModel->select(sibling, QItemSelectionModel::ClearAndSelect);
deleteCurrentScene = false; deleteCurrentScene = false;
} }
@ -2396,11 +2388,7 @@ void UBDocumentController::moveIndexesToTrash(const QModelIndexList &list, UBDoc
if (proxy) if (proxy)
{ {
setDocument(proxy); selectDocument(proxy,true);
UBApplication::boardController->setActiveDocumentScene(proxy,0,true);
docModel->setCurrentDocument(proxy);
selectionModel->select(sibling, QItemSelectionModel::ClearAndSelect);
deleteCurrentScene = false; deleteCurrentScene = false;
} }
@ -2410,7 +2398,7 @@ void UBDocumentController::moveIndexesToTrash(const QModelIndexList &list, UBDoc
else else
{ {
UBDocumentProxy* proxy = docModel->proxyForIndex(currentScene); UBDocumentProxy* proxy = docModel->proxyForIndex(currentScene);
setDocument(proxy); selectDocument(proxy, true);
} }
docModel->moveIndexes(list, docModel->trashIndex()); docModel->moveIndexes(list, docModel->trashIndex());

Loading…
Cancel
Save