Esempio n. 1
0
void SCPresenterViewInterface::setPreviewSize(const QSize &size)
{
    m_previewSize = size;
    m_canvas->setFixedSize(size);

    // set the thumbnail for next page preview
    Q_ASSERT(m_activePage != -1);
    KoPAPage *nextPage = 0;
    if (m_activePage != m_pages.count() - 1) {
        nextPage = m_pages.at(m_activePage + 1);
    }
    else {
        nextPage = m_pages.at(m_activePage);
    }
    m_nextSlidePreview->setPixmap(nextPage->thumbnail(m_previewSize));
}
Esempio n. 2
0
void SCPresenterViewInterface::setActivePage(int pageIndex)
{
    SCPresenterViewBaseInterface::setActivePage(pageIndex);

    Q_ASSERT(pageIndex >= 0 && pageIndex < m_pages.size());
    KoPAPage *page = m_pages.at(pageIndex);
    int pageCount = dynamic_cast<SCEndOfSlideShowPage *>(m_pages.last()) ?
            m_pages.count() - 1 : m_pages.count();

    // set the thumbnail for next page preview
    KoPAPage *nextPage = 0;
    if (pageIndex != pageCount) {
        nextPage = m_pages.at(pageIndex + 1);
        m_nextSlidePreview->setPixmap(nextPage->thumbnail(m_previewSize));
    }
    else { // End of presentation, just a black pixmap for the next slide preview
        QPixmap pixmap(m_previewSize);
        pixmap.fill(Qt::black);
        m_nextSlidePreview->setPixmap(pixmap);
    }

    // update the label
    m_currentSlideLabel->setText(pageIndex != pageCount ? 
            i18n("Current Slide %1 of %2", pageIndex + 1, pageCount) : 
            i18n("End of Slide Show"));

    // set the presentation notes
    SCPage *prPage = dynamic_cast<SCPage *>(page);
    Q_ASSERT(prPage);
    SCNotes *pageNotes = prPage->pageNotes();
    KShape *textShape = pageNotes->textShape();
    KTextShapeData *textShapeData = qobject_cast<KTextShapeData *>(textShape->userData());
    Q_ASSERT(textShapeData);
    QTextDocument *document = textShapeData->document()->clone(m_notesTextEdit);
    m_notesTextEdit->setDocument(document);
}