Commit c5155aee authored by Anatoly Mihalchenko's avatar Anatoly Mihalchenko

Fix for a document's page duplication. Teacher bar's info wasn't quite...

Fix for a document's page duplication. Teacher bar's info wasn't quite correct. This is also related to ticket #409 part 2.
parent 525e706f
...@@ -1062,3 +1062,8 @@ void UBBoardPaletteManager::ForceTeacherBarToSaveData() ...@@ -1062,3 +1062,8 @@ void UBBoardPaletteManager::ForceTeacherBarToSaveData()
{ {
mpTeacherBarWidget->saveContent(); mpTeacherBarWidget->saveContent();
} }
void UBBoardPaletteManager::ForceTeacherBarToLoadData()
{
mpTeacherBarWidget->loadContent();
}
...@@ -67,6 +67,7 @@ class UBBoardPaletteManager : public QObject ...@@ -67,6 +67,7 @@ class UBBoardPaletteManager : public QObject
void stopDownloads(); void stopDownloads();
QRect GetFreeRectGlobalCoords() const; QRect GetFreeRectGlobalCoords() const;
void ForceTeacherBarToSaveData(); void ForceTeacherBarToSaveData();
void ForceTeacherBarToLoadData();
signals: signals:
void connectToDocController(); void connectToDocController();
......
...@@ -488,8 +488,12 @@ void UBPersistenceManager::duplicateDocumentScene(UBDocumentProxy* proxy, int in ...@@ -488,8 +488,12 @@ void UBPersistenceManager::duplicateDocumentScene(UBDocumentProxy* proxy, int in
proxy->incPageCount(); proxy->incPageCount();
emit documentSceneCreated(proxy, index + 1); //due to architectural peculiarity we need to save teacher bar info, otherwise we'll see not exactly what we expect
sTeacherBarInfos properInfo = getTeacherBarInfos(proxy, index + 1);
//after the call below
emit documentSceneCreated(proxy, index + 1);
//restoring info
persistTeacherBar(proxy, index + 1, properInfo);
} }
......
...@@ -574,6 +574,8 @@ void UBDocumentController::duplicateSelectedItem() ...@@ -574,6 +574,8 @@ void UBDocumentController::duplicateSelectedItem()
UBMetadataDcSubsetAdaptor::persist(proxy); UBMetadataDcSubsetAdaptor::persist(proxy);
mDocumentUI->thumbnailWidget->selectItemAt(selectedSceneIndexes.last() + offset); mDocumentUI->thumbnailWidget->selectItemAt(selectedSceneIndexes.last() + offset);
} }
//necessary due to architectural peculiarities
if(paletteMan) paletteMan->ForceTeacherBarToLoadData();
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment