Fix for a document's page duplication. Teacher bar's info wasn't quite correct. This is also related to ticket #409 part 2.

preferencesAboutTextFull
Anatoly Mihalchenko 13 years ago
parent 525e706fda
commit c5155aee56
  1. 5
      src/board/UBBoardPaletteManager.cpp
  2. 1
      src/board/UBBoardPaletteManager.h
  3. 8
      src/core/UBPersistenceManager.cpp
  4. 2
      src/document/UBDocumentController.cpp

@ -1062,3 +1062,8 @@ void UBBoardPaletteManager::ForceTeacherBarToSaveData()
{
mpTeacherBarWidget->saveContent();
}
void UBBoardPaletteManager::ForceTeacherBarToLoadData()
{
mpTeacherBarWidget->loadContent();
}

@ -67,6 +67,7 @@ class UBBoardPaletteManager : public QObject
void stopDownloads();
QRect GetFreeRectGlobalCoords() const;
void ForceTeacherBarToSaveData();
void ForceTeacherBarToLoadData();
signals:
void connectToDocController();

@ -488,8 +488,12 @@ void UBPersistenceManager::duplicateDocumentScene(UBDocumentProxy* proxy, int in
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()
UBMetadataDcSubsetAdaptor::persist(proxy);
mDocumentUI->thumbnailWidget->selectItemAt(selectedSceneIndexes.last() + offset);
}
//necessary due to architectural peculiarities
if(paletteMan) paletteMan->ForceTeacherBarToLoadData();
}
else
{

Loading…
Cancel
Save