fixed (workaround) issue on deleting working page

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent af82e62a0b
commit 472905d047
  1. 6
      src/board/UBBoardController.cpp
  2. 1
      src/board/UBBoardController.h

@ -94,6 +94,7 @@ UBBoardController::UBBoardController(UBMainWindow* mainWindow)
, mSystemScaleFactor(1.0) , mSystemScaleFactor(1.0)
, mCleanupDone(false) , mCleanupDone(false)
, mCacheWidgetIsEnabled(false) , mCacheWidgetIsEnabled(false)
, mDeletingSceneIndex(-1)
{ {
mZoomFactor = UBSettings::settings()->boardZoomFactor->get().toDouble(); mZoomFactor = UBSettings::settings()->boardZoomFactor->get().toDouble();
@ -670,6 +671,7 @@ void UBBoardController::deleteScene(int nIndex)
{ {
if (selectedDocument()->pageCount()>=2) if (selectedDocument()->pageCount()>=2)
{ {
mDeletingSceneIndex = nIndex;
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
persistCurrentScene(); persistCurrentScene();
showMessage(tr("Delete page %1 from document").arg(nIndex), true); showMessage(tr("Delete page %1 from document").arg(nIndex), true);
@ -679,12 +681,12 @@ void UBBoardController::deleteScene(int nIndex)
deletePages(scIndexes); deletePages(scIndexes);
selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime())); selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime()));
if (nIndex >= pageCount()) if (nIndex >= pageCount())
nIndex = pageCount()-1; nIndex = pageCount()-1;
setActiveDocumentScene(nIndex); setActiveDocumentScene(nIndex);
showMessage(tr("Page %1 deleted").arg(nIndex)); showMessage(tr("Page %1 deleted").arg(nIndex));
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
mDeletingSceneIndex = -1;
} }
} }
@ -1781,7 +1783,7 @@ void UBBoardController::show()
void UBBoardController::persistCurrentScene() void UBBoardController::persistCurrentScene()
{ {
if(UBPersistenceManager::persistenceManager() if(UBPersistenceManager::persistenceManager()
&& selectedDocument() && mActiveScene && selectedDocument() && mActiveScene && mActiveSceneIndex != mDeletingSceneIndex
&& (mActiveSceneIndex >= 0) && (mActiveSceneIndex >= 0)
&& (mActiveScene->isModified() || (UBApplication::boardController->paletteManager()->teacherGuideDockWidget() && UBApplication::boardController->paletteManager()->teacherGuideDockWidget()->teacherGuideWidget()->isModified()))) && (mActiveScene->isModified() || (UBApplication::boardController->paletteManager()->teacherGuideDockWidget() && UBApplication::boardController->paletteManager()->teacherGuideDockWidget()->teacherGuideWidget()->isModified())))
{ {

@ -280,6 +280,7 @@ class UBBoardController : public UBDocumentContainer
QMap<QAction*, QPair<QString, QString> > mActionTexts; QMap<QAction*, QPair<QString, QString> > mActionTexts;
bool mCacheWidgetIsEnabled; bool mCacheWidgetIsEnabled;
QGraphicsItem* mLastCreatedItem; QGraphicsItem* mLastCreatedItem;
int mDeletingSceneIndex;
private slots: private slots:
void stylusToolDoubleClicked(int tool); void stylusToolDoubleClicked(int tool);

Loading…
Cancel
Save