From 4e7dac2f60259a2f8554d2acfae868e38eed2992 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Wed, 25 Jul 2012 10:21:40 +0200 Subject: [PATCH] Changed page 0 with title page --- src/document/UBDocumentController.cpp | 6 +++++- src/gui/UBDocumentNavigator.cpp | 4 +++- src/gui/UBPageNavigationWidget.cpp | 2 -- src/gui/UBTeacherGuideWidget.cpp | 5 ++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index 7adbc6fd..a4e59fd4 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -1624,7 +1624,11 @@ void UBDocumentController::refreshDocumentThumbnailsView(UBDocumentContainer*) } items << pixmapItem; - labels << tr("Page %1").arg(pageFromSceneIndex(i)); + int pageIndex = pageFromSceneIndex(i); + if(pageIndex) + labels << tr("Page %1").arg(pageIndex); + else + labels << tr("Title page"); itemsPath.append(QUrl::fromLocalFile(proxy->persistencePath() + QString("/pages/%1").arg(UBDocumentContainer::pageFromSceneIndex(i)))); } diff --git a/src/gui/UBDocumentNavigator.cpp b/src/gui/UBDocumentNavigator.cpp index ce726365..f4026d11 100644 --- a/src/gui/UBDocumentNavigator.cpp +++ b/src/gui/UBDocumentNavigator.cpp @@ -86,7 +86,9 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source) { const QPixmap* pix = source->pageAt(i); UBSceneThumbnailNavigPixmap* pixmapItem = new UBSceneThumbnailNavigPixmap(*pix, source->selectedDocument(), i); - UBThumbnailTextItem *labelItem = new UBThumbnailTextItem(tr("Page %0").arg(UBDocumentContainer::pageFromSceneIndex(i))); + int pageIndex = UBDocumentContainer::pageFromSceneIndex(i); + QString label = pageIndex == 0 ? tr("Title page") : tr("Page %0").arg(pageIndex); + UBThumbnailTextItem *labelItem = new UBThumbnailTextItem(label); UBImgTextThumbnailElement thumbWithText(pixmapItem, labelItem); thumbWithText.setBorder(border()); diff --git a/src/gui/UBPageNavigationWidget.cpp b/src/gui/UBPageNavigationWidget.cpp index 0cd9a7ab..7bb61d0d 100644 --- a/src/gui/UBPageNavigationWidget.cpp +++ b/src/gui/UBPageNavigationWidget.cpp @@ -74,8 +74,6 @@ UBPageNavigationWidget::UBPageNavigationWidget(QWidget *parent, const char *name mTimeFormat = mTimeFormat.remove(":s"); mTimerID = startTimer(1000); - //connect(mNavigator, SIGNAL(changeCurrentPage()), this, SLOT(changeCurrentPage())); - //connect(UBApplication::boardController, SIGNAL(setDocOnPageNavigator(UBDocumentProxy*)), this, SLOT(onSetDocOnPageNavigator(UBDocumentProxy*))); } /** diff --git a/src/gui/UBTeacherGuideWidget.cpp b/src/gui/UBTeacherGuideWidget.cpp index 592242fd..193a8dfa 100644 --- a/src/gui/UBTeacherGuideWidget.cpp +++ b/src/gui/UBTeacherGuideWidget.cpp @@ -135,7 +135,6 @@ UBTeacherGuideEditionWidget::UBTeacherGuideEditionWidget(QWidget *parent, const if(UBSettings::settings()->teacherGuideLessonPagesActivated->get().toBool()){ UBSvgSubsetAdaptor::addElementToBeStored(QString("teacherGuide"),this); - //connect(UBApplication::boardController,SIGNAL(activeDocumentChanged()),this,SLOT(onActiveDocumentChanged())); connect(UBApplication::boardController,SIGNAL(documentSet(UBDocumentProxy*)),this,SLOT(onActiveDocumentChanged())); } } @@ -198,7 +197,7 @@ QVector UBTeacherGuideEditionWidget::save(int pageIndex) tIDataStorage* data = new tIDataStorage(); data->name = "teacherGuide"; data->type = eElementType_START; - data->attributes.insert("version","1.50"); + data->attributes.insert("version","2.00"); result << data; data = new tIDataStorage(); @@ -635,7 +634,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons mpPageNumberLabel = new QLabel(this); mpPageNumberLabel->setAlignment(Qt::AlignRight); mpPageNumberLabel->setObjectName("UBTGPageNumberLabel"); - mpPageNumberLabel->setText(tr("Page 0")); + mpPageNumberLabel->setText(tr("Title page")); mpLayout->addWidget(mpPageNumberLabel); mpButtonTitleLayout = new QHBoxLayout(0);