| 1989 | } |
| 1990 | |
| 1991 | void UBDocumentController::selectDocument(std::shared_ptr<UBDocumentProxy> proxy, bool setAsCurrentDocument, const bool onImport, const bool editMode) |
| 1992 | { |
| 1993 | if (proxy==NULL) |
| 1994 | { |
| 1995 | setDocument(NULL); |
| 1996 | return; |
| 1997 | } |
| 1998 | |
| 1999 | if (setAsCurrentDocument) |
| 2000 | { |
| 2001 | UBPersistenceManager::persistenceManager()->mDocumentTreeStructureModel->setCurrentDocument(proxy); |
| 2002 | QModelIndex indexCurrentDoc = UBPersistenceManager::persistenceManager()->mDocumentTreeStructureModel->indexForProxy(proxy); |
| 2003 | if (indexCurrentDoc.isValid()) |
| 2004 | { |
| 2005 | mDocumentUI->documentTreeView->setSelectedAndExpanded(indexCurrentDoc, true, editMode); |
| 2006 | } |
| 2007 | else |
| 2008 | { |
| 2009 | qWarning() << "an issue occured while trying to select current index in document tree"; |
| 2010 | } |
| 2011 | } |
| 2012 | |
| 2013 | setDocument(proxy, true); |
| 2014 | } |
| 2015 | |
| 2016 | void UBDocumentController::createNewDocumentGroup() |
| 2017 | { |
no test coverage detected