object selection on board remain unchanged after an automatic saving

preferencesAboutTextFull
-f 11 years ago
parent 92167aab77
commit 2c1a2c953d
  1. 7
      src/board/UBBoardController.cpp
  2. 2
      src/board/UBBoardController.h
  3. 5
      src/core/UBPersistenceManager.cpp
  4. 2
      src/core/UBPersistenceManager.h

@ -397,12 +397,11 @@ void UBBoardController::stopScript()
void UBBoardController::saveData(SaveFlags fls)
{
bool verbose = fls | sf_showProgress;
if (verbose) {
UBApplication::showMessage("Saving document...");
}
if (mActiveScene && mActiveScene->isModified()) {
persistCurrentScene();
persistCurrentScene(true);
}
if (verbose) {
UBApplication::showMessage("Document has just been saved...");
@ -1891,14 +1890,14 @@ void UBBoardController::show()
UBApplication::mainWindow->actionLibrary->setChecked(false);
}
void UBBoardController::persistCurrentScene()
void UBBoardController::persistCurrentScene(bool isAnAutomaticBackup)
{
if(UBPersistenceManager::persistenceManager()
&& selectedDocument() && mActiveScene && mActiveSceneIndex != mDeletingSceneIndex
&& (mActiveSceneIndex >= 0) && mActiveSceneIndex != mMovingSceneIndex
&& (mActiveScene->isModified()))
{
UBPersistenceManager::persistenceManager()->persistDocumentScene(selectedDocument(), mActiveScene, mActiveSceneIndex);
UBPersistenceManager::persistenceManager()->persistDocumentScene(selectedDocument(), mActiveScene, mActiveSceneIndex, isAnAutomaticBackup);
updatePage(mActiveSceneIndex);
}
}

@ -156,7 +156,7 @@ class UBBoardController : public UBDocumentContainer
return mSystemScaleFactor;
}
qreal currentZoom();
void persistCurrentScene();
void persistCurrentScene(bool isAnAutomaticBackup = false);
void showNewVersionAvailable(bool automatic, const UBVersion &installedVersion, const UBSoftwareUpdate &softwareUpdate);
void setBoxing(QRect displayRect);
void setToolbarTexts();

@ -665,11 +665,12 @@ UBGraphicsScene* UBPersistenceManager::loadDocumentScene(UBDocumentProxy* proxy,
}
}
void UBPersistenceManager::persistDocumentScene(UBDocumentProxy* pDocumentProxy, UBGraphicsScene* pScene, const int pSceneIndex)
void UBPersistenceManager::persistDocumentScene(UBDocumentProxy* pDocumentProxy, UBGraphicsScene* pScene, const int pSceneIndex, bool isAnAutomaticBackup)
{
checkIfDocumentRepositoryExists();
pScene->deselectAllItems();
if(!isAnAutomaticBackup)
pScene->deselectAllItems();
generatePathIfNeeded(pDocumentProxy);

@ -73,7 +73,7 @@ class UBPersistenceManager : public QObject
virtual void duplicateDocumentScene(UBDocumentProxy* pDocumentProxy, int index);
virtual void persistDocumentScene(UBDocumentProxy* pDocumentProxy,
UBGraphicsScene* pScene, const int pSceneIndex);
UBGraphicsScene* pScene, const int pSceneIndex, bool isAnAutomaticBackup = false);
virtual UBGraphicsScene* createDocumentSceneAt(UBDocumentProxy* pDocumentProxy, int index, bool useUndoRedoStack = true);

Loading…
Cancel
Save