added toque on page thumbnail depending if the teacherguide is filled out or not

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent 5bb5444b61
commit 931e099e5d
  1. BIN
      resources/images/toque.png
  2. 1
      resources/sankore.qrc
  3. 23
      src/document/UBDocumentController.cpp
  4. 32
      src/gui/UBDocumentNavigator.cpp
  5. 4
      src/gui/UBTeacherGuideWidget.cpp

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

@ -365,5 +365,6 @@
<file>images/teacherGuide/pencil.svg</file> <file>images/teacherGuide/pencil.svg</file>
<file>images/duplicateDisabled.svg</file> <file>images/duplicateDisabled.svg</file>
<file>images/teacherGuide/flash_24x24.svg</file> <file>images/teacherGuide/flash_24x24.svg</file>
<file>images/toque.png</file>
</qresource> </qresource>
</RCC> </RCC>

@ -363,25 +363,18 @@ void UBDocumentController::setupViews()
connect(mDocumentUI->thumbnailWidget, SIGNAL(sceneDropped(UBDocumentProxy*, int, int)), this, SLOT(moveSceneToIndex ( UBDocumentProxy*, int, int))); connect(mDocumentUI->thumbnailWidget, SIGNAL(sceneDropped(UBDocumentProxy*, int, int)), this, SLOT(moveSceneToIndex ( UBDocumentProxy*, int, int)));
connect(mDocumentUI->thumbnailWidget, SIGNAL(resized()), this, SLOT(thumbnailViewResized())); connect(mDocumentUI->thumbnailWidget, SIGNAL(resized()), this, SLOT(thumbnailViewResized()));
connect(mDocumentUI->thumbnailWidget, SIGNAL(mouseDoubleClick(QGraphicsItem*, int)), connect(mDocumentUI->thumbnailWidget, SIGNAL(mouseDoubleClick(QGraphicsItem*, int)), this, SLOT(pageDoubleClicked(QGraphicsItem*, int)));
this, SLOT(pageDoubleClicked(QGraphicsItem*, int))); connect(mDocumentUI->thumbnailWidget, SIGNAL(mouseClick(QGraphicsItem*, int)), this, SLOT(pageClicked(QGraphicsItem*, int)));
connect(mDocumentUI->thumbnailWidget, SIGNAL(mouseClick(QGraphicsItem*, int)),
this, SLOT(pageClicked(QGraphicsItem*, int)));
connect(mDocumentUI->thumbnailWidget->scene(), SIGNAL(selectionChanged()), connect(mDocumentUI->thumbnailWidget->scene(), SIGNAL(selectionChanged()), this, SLOT(pageSelectionChanged()));
this, SLOT(pageSelectionChanged()));
connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentCreated(UBDocumentProxy*)), connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentCreated(UBDocumentProxy*)), this, SLOT(addDocumentInTree(UBDocumentProxy*)));
this, SLOT(addDocumentInTree(UBDocumentProxy*)));
connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentMetadataChanged(UBDocumentProxy*)), connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentMetadataChanged(UBDocumentProxy*)), this, SLOT(updateDocumentInTree(UBDocumentProxy*)));
this, SLOT(updateDocumentInTree(UBDocumentProxy*)));
connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentSceneCreated(UBDocumentProxy*, int)), connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentSceneCreated(UBDocumentProxy*, int)), this, SLOT(documentSceneChanged(UBDocumentProxy*, int)));
this, SLOT(documentSceneChanged(UBDocumentProxy*, int)));
connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentSceneWillBeDeleted(UBDocumentProxy*, int)), connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentSceneWillBeDeleted(UBDocumentProxy*, int)), this, SLOT(documentSceneChanged(UBDocumentProxy*, int)));
this, SLOT(documentSceneChanged(UBDocumentProxy*, int)));
mDocumentUI->thumbnailWidget->setBackgroundBrush(UBSettings::documentViewLightColor); mDocumentUI->thumbnailWidget->setBackgroundBrush(UBSettings::documentViewLightColor);
@ -996,7 +989,7 @@ void UBDocumentController::addFolderOfImages()
if (importedImageNumber == 0) if (importedImageNumber == 0)
{ {
showMessage(tr("Folder does not contain any image files!")); showMessage(tr("Folder does not contain any image files"));
UBApplication::applicationController->showDocument(); UBApplication::applicationController->showDocument();
} }
else else

@ -69,6 +69,9 @@ UBDocumentNavigator::~UBDocumentNavigator()
} }
} }
#include "gui/UBDockTeacherGuideWidget.h"
#include "gui/UBTeacherGuideWidget.h"
/** /**
* \brief Generate the thumbnails * \brief Generate the thumbnails
*/ */
@ -84,9 +87,30 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
for(int i = 0; i < source->selectedDocument()->pageCount(); i++) for(int i = 0; i < source->selectedDocument()->pageCount(); i++)
{ {
const QPixmap* pix = source->pageAt(i); const QPixmap* pix = source->pageAt(i);
UBSceneThumbnailNavigPixmap* pixmapItem = new UBSceneThumbnailNavigPixmap(*pix, source->selectedDocument(), i); QPixmap result(pix->width(),pix->height());
int pageIndex = UBDocumentContainer::pageFromSceneIndex(i); int pageIndex = UBDocumentContainer::pageFromSceneIndex(i);
QPainter composePainter;
composePainter.begin(&result);
composePainter.drawPixmap(QPoint(0,0),*pix);
if(pageIndex == UBApplication::boardController->currentPage() &&
((pageIndex == 0 && UBSettings::settings()->teacherGuidePageZeroActivated->get().toBool()) ||
(pageIndex && UBSettings::settings()->teacherGuideLessonPagesActivated->get().toBool()))
) {
if(UBApplication::boardController->paletteManager()->teacherGuideDockWidget()->teacherGuideWidget()->isModified()){
QPixmap toque(":images/toque.png");
composePainter.setOpacity(0.6);
composePainter.drawPixmap(QPoint(pix->width() - toque.width(),0),toque);
}
}
composePainter.end();
UBSceneThumbnailNavigPixmap* pixmapItem = new UBSceneThumbnailNavigPixmap(result, source->selectedDocument(), i);
QString label = pageIndex == 0 ? tr("Title page") : tr("Page %0").arg(pageIndex); QString label = pageIndex == 0 ? tr("Title page") : tr("Page %0").arg(pageIndex);
UBThumbnailTextItem *labelItem = new UBThumbnailTextItem(label); UBThumbnailTextItem *labelItem = new UBThumbnailTextItem(label);
@ -104,7 +128,7 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
void UBDocumentNavigator::onScrollToSelectedPage(int index) void UBDocumentNavigator::onScrollToSelectedPage(int index)
{ {
qDebug() << "Selection in widet: " << index; qDebug() << "Selection in widget: " << index;
int c = 0; int c = 0;
foreach(UBImgTextThumbnailElement el, mThumbsWithLabels) foreach(UBImgTextThumbnailElement el, mThumbsWithLabels)
{ {
@ -118,7 +142,6 @@ void UBDocumentNavigator::onScrollToSelectedPage(int index)
} }
c++; c++;
} }
// centerOn(mThumbsWithLabels[index].getThumbnail());
} }
/** /**
@ -131,8 +154,7 @@ void UBDocumentNavigator::updateSpecificThumbnail(int iPage)
//UBGraphicsScene* pScene = UBApplication::boardController->activeScene(); //UBGraphicsScene* pScene = UBApplication::boardController->activeScene();
const QPixmap* pix = UBApplication::boardController->pageAt(iPage); const QPixmap* pix = UBApplication::boardController->pageAt(iPage);
UBSceneThumbnailNavigPixmap* newItem = new UBSceneThumbnailNavigPixmap(*pix, UBSceneThumbnailNavigPixmap* newItem = new UBSceneThumbnailNavigPixmap(*pix, UBApplication::boardController->selectedDocument(), iPage);
UBApplication::boardController->selectedDocument(), iPage);
// Get the old thumbnail // Get the old thumbnail
UBSceneThumbnailNavigPixmap* oldItem = mThumbsWithLabels.at(iPage).getThumbnail(); UBSceneThumbnailNavigPixmap* oldItem = mThumbsWithLabels.at(iPage).getThumbnail();

@ -1152,9 +1152,7 @@ bool UBTeacherGuidePageZeroWidget::isModified()
void UBTeacherGuidePageZeroWidget::resizeEvent(QResizeEvent* ev) void UBTeacherGuidePageZeroWidget::resizeEvent(QResizeEvent* ev)
{ {
emit resized(); emit resized();
/* mpScrollArea->resize(width(), height()); QWidget::resizeEvent(ev);
mpContainerWidget->resize(width(), height());
*/ QWidget::resizeEvent(ev);
} }
/*************************************************************************** /***************************************************************************

Loading…
Cancel
Save