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. 3
      src/core/UBPersistenceManager.cpp
  4. 2
      src/core/UBPersistenceManager.h

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

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

@ -665,10 +665,11 @@ 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(); checkIfDocumentRepositoryExists();
if(!isAnAutomaticBackup)
pScene->deselectAllItems(); pScene->deselectAllItems();
generatePathIfNeeded(pDocumentProxy); generatePathIfNeeded(pDocumentProxy);

@ -73,7 +73,7 @@ class UBPersistenceManager : public QObject
virtual void duplicateDocumentScene(UBDocumentProxy* pDocumentProxy, int index); virtual void duplicateDocumentScene(UBDocumentProxy* pDocumentProxy, int index);
virtual void persistDocumentScene(UBDocumentProxy* pDocumentProxy, 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); virtual UBGraphicsScene* createDocumentSceneAt(UBDocumentProxy* pDocumentProxy, int index, bool useUndoRedoStack = true);

Loading…
Cancel
Save