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)
, mCleanupDone(false)
, mCacheWidgetIsEnabled(false)
, mDeletingSceneIndex(-1)
{
mZoomFactor = UBSettings::settings()->boardZoomFactor->get().toDouble();
@ -670,6 +671,7 @@ void UBBoardController::deleteScene(int nIndex)
{
if (selectedDocument()->pageCount()>=2)
{
mDeletingSceneIndex = nIndex;
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
persistCurrentScene();
showMessage(tr("Delete page %1 from document").arg(nIndex), true);
@ -679,12 +681,12 @@ void UBBoardController::deleteScene(int nIndex)
deletePages(scIndexes);
selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime()));
if (nIndex >= pageCount())
nIndex = pageCount()-1;
setActiveDocumentScene(nIndex);
showMessage(tr("Page %1 deleted").arg(nIndex));
QApplication::restoreOverrideCursor();
mDeletingSceneIndex = -1;
}
}
@ -1781,7 +1783,7 @@ void UBBoardController::show()
void UBBoardController::persistCurrentScene()
{
if(UBPersistenceManager::persistenceManager()
&& selectedDocument() && mActiveScene
&& selectedDocument() && mActiveScene && mActiveSceneIndex != mDeletingSceneIndex
&& (mActiveSceneIndex >= 0)
&& (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;
bool mCacheWidgetIsEnabled;
QGraphicsItem* mLastCreatedItem;
int mDeletingSceneIndex;
private slots:
void stylusToolDoubleClicked(int tool);

Loading…
Cancel
Save