Improved switching between documents. Removed useless calls, some logic changes.

preferencesAboutTextFull
Aleksei Kanash 12 years ago
parent f849bea388
commit cf66284212
  1. 5
      src/board/UBBoardController.cpp
  2. 1
      src/board/UBBoardController.h
  3. 10
      src/gui/UBDocumentNavigator.cpp
  4. 1
      src/gui/UBPageNavigationWidget.cpp

@ -452,6 +452,7 @@ void UBBoardController::addScene()
setActiveDocumentScene(mActiveDocument, mActiveSceneIndex + 1);
QApplication::restoreOverrideCursor();
emit newPageAdded();
}
@ -1179,11 +1180,11 @@ void UBBoardController::setActiveDocumentScene(UBDocumentProxy* pDocumentProxy,
if(documentChange)
{
emit activeDocumentChanged();
// Notify the navigator palette that the document has changed
emit setDocOnPageNavigator(pDocumentProxy);
UBGraphicsTextItem::lastUsedTextColor = QColor();
}
// Notify the navigator palette that the document has changed
emit setDocOnPageNavigator(pDocumentProxy);
if (sceneChange)
{

@ -215,6 +215,7 @@ class UBBoardController : public QObject
void stopScript();
signals:
void newPageAdded();
void activeSceneWillBePersisted();
void activeSceneWillChange();
void activeSceneChanged();

@ -55,10 +55,11 @@ UBDocumentNavigator::UBDocumentNavigator(QWidget *parent, const char *name):QGra
setFrameShadow(QFrame::Plain);
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(addNewPage()));
connect(UBApplication::boardController, SIGNAL(setDocOnPageNavigator(UBDocumentProxy*)), this, SLOT(generateThumbnails()));
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(generateThumbnails()));
connect(UBApplication::boardController, SIGNAL(newPageAdded()), this, SLOT(addNewPage()));
connect(mScene, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
connect(UBApplication::boardController, SIGNAL(documentReorganized(int)), this, SLOT(onMovedToIndex(int)));
connect(UBApplication::boardController, SIGNAL(scrollToSelectedPage()), this, SLOT(onScrollToSelectedPage()));
}
/**
@ -150,10 +151,11 @@ void UBDocumentNavigator::updateSpecificThumbnail(int iPage)
if(UBApplication::boardController)
{
UBApplication::boardController->persistCurrentScene();
}else
{
UBThumbnailAdaptor::persistScene(mCrntDoc->persistencePath(), pScene, iPage);
}
UBThumbnailAdaptor::persistScene(mCrntDoc->persistencePath(), pScene, iPage);
// Load it
QPixmap pix = UBThumbnailAdaptor::load(mCrntDoc, iPage);
UBSceneThumbnailNavigPixmap* pixmapItem = new UBSceneThumbnailNavigPixmap(pix, mCrntDoc, iPage);

@ -115,7 +115,6 @@ void UBPageNavigationWidget::setDocument(UBDocumentProxy *document)
if(mNavigator->currentDoc() != document)
{
mNavigator->setDocument(document);
UBApplication::boardController->notifyPageChanged();
}
}

Loading…
Cancel
Save