|
|
@ -1,9 +1,14 @@ |
|
|
|
|
|
|
|
#include "UBTeacherBarDataMgr.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "core/UBApplication.h" |
|
|
|
#include "core/UBApplication.h" |
|
|
|
#include "core/UBPersistenceManager.h" |
|
|
|
#include "core/UBPersistenceManager.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "board/UBBoardController.h" |
|
|
|
#include "board/UBBoardController.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "customWidgets/UBGlobals.h" |
|
|
|
#include "customWidgets/UBGlobals.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "UBTeacherBarDataMgr.h" |
|
|
|
#include "adaptors/UBMetadataDcSubsetAdaptor.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UBTeacherBarDataMgr::UBTeacherBarDataMgr() |
|
|
|
UBTeacherBarDataMgr::UBTeacherBarDataMgr() |
|
|
|
{ |
|
|
|
{ |
|
|
@ -47,30 +52,32 @@ void UBTeacherBarDataMgr::saveContent() |
|
|
|
// Comments
|
|
|
|
// Comments
|
|
|
|
infos.comments = mComments; |
|
|
|
infos.comments = mComments; |
|
|
|
|
|
|
|
|
|
|
|
UBPersistenceManager::persistenceManager()->persistTeacherBar(UBApplication::boardController->activeDocument(), UBApplication::boardController->activeSceneIndex(), infos); |
|
|
|
UBDocumentProxy* documentProxy = UBApplication::boardController->activeDocument(); |
|
|
|
|
|
|
|
if(documentProxy){ |
|
|
|
|
|
|
|
UBPersistenceManager::persistenceManager()->persistTeacherBar(documentProxy, UBApplication::boardController->activeSceneIndex(), infos); |
|
|
|
|
|
|
|
|
|
|
|
// TODO: Store the document metadata somewhere
|
|
|
|
documentProxy->setSessionTitle(mSessionTitle); |
|
|
|
// Session Title
|
|
|
|
documentProxy->setSessionTarget(mSessionTarget); |
|
|
|
//... = mSessionTitle;
|
|
|
|
documentProxy->setSessionLicence(mSessionLicence); |
|
|
|
// Session Target
|
|
|
|
|
|
|
|
//... = mSessionTarget;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UBMetadataDcSubsetAdaptor::persist(documentProxy); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarDataMgr::loadContent(bool docChanged) |
|
|
|
void UBTeacherBarDataMgr::loadContent(bool docChanged) |
|
|
|
{ |
|
|
|
{ |
|
|
|
clearLists(); |
|
|
|
clearLists(); |
|
|
|
|
|
|
|
UBDocumentProxy* documentProxy = UBApplication::boardController->activeDocument(); |
|
|
|
|
|
|
|
|
|
|
|
sTeacherBarInfos nextInfos = UBPersistenceManager::persistenceManager()->getTeacherBarInfos(UBApplication::boardController->activeDocument(), UBApplication::boardController->activeSceneIndex()); |
|
|
|
sTeacherBarInfos nextInfos = UBPersistenceManager::persistenceManager()->getTeacherBarInfos(documentProxy, UBApplication::boardController->activeSceneIndex()); |
|
|
|
|
|
|
|
if(true/*docChanged*/){ |
|
|
|
if(docChanged){ |
|
|
|
mSessionTitle = documentProxy->sessionTitle(); |
|
|
|
// TODO: Read these information from the metadata file
|
|
|
|
mSessionTarget = documentProxy->sessionTarget(); |
|
|
|
|
|
|
|
mSessionLicence = documentProxy->sessionLicence(); |
|
|
|
// Session Title
|
|
|
|
|
|
|
|
//mSessionTitle = ...;
|
|
|
|
|
|
|
|
// Session Target
|
|
|
|
|
|
|
|
//mSessionTarget = ...;
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Page Title
|
|
|
|
// Page Title
|
|
|
|
mPageTitle = nextInfos.title; |
|
|
|
mPageTitle = nextInfos.title; |
|
|
|
// Actions
|
|
|
|
// Actions
|
|
|
|