Commit cf662842 authored by Aleksei Kanash's avatar Aleksei Kanash

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

parent f849bea3
......@@ -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();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment