From 9b133fa4bc3086b617115465c35ac7410c52fc40 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Mon, 3 Sep 2012 14:55:58 +0200 Subject: [PATCH 1/5] fixed issue 1084 --- src/gui/UBTeacherGuideWidget.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/UBTeacherGuideWidget.cpp b/src/gui/UBTeacherGuideWidget.cpp index ca73ec76..77bebf96 100644 --- a/src/gui/UBTeacherGuideWidget.cpp +++ b/src/gui/UBTeacherGuideWidget.cpp @@ -895,9 +895,9 @@ void UBTeacherGuidePageZeroWidget::fillComboBoxes() parametersFile.close(); QStringList licences; - licences << tr("Attribution CC BY") + licences << tr("Attribution-ShareAlike CC BY-SA") + << tr("Attribution CC BY") << tr("Attribution-NoDerivs CC BY-ND") - << tr("Attribution-ShareAlike CC BY-SA") << tr("Attribution-NonCommercial CC BY-NC") << tr("Attribution-NonCommercial-NoDerivs CC BY-NC-ND") << tr("Attribution-NonCommercial-ShareAlike CC BY-NC-SA") @@ -905,9 +905,9 @@ void UBTeacherGuidePageZeroWidget::fillComboBoxes() << tr("Copyright"); mpLicenceBox->addItems(licences); QStringList licenceIconList; - licenceIconList << ":images/licenses/ccby.png" + licenceIconList << ":images/licenses/ccbysa.png" + << ":images/licenses/ccby.png" << ":images/licenses/ccbynd.png" - << ":images/licenses/ccbysa.png" << ":images/licenses/ccbync.png" << ":images/licenses/ccbyncnd.png" << ":images/licenses/ccbyncsa.png"; From 218071207cc7e719e5fc8dba64d197588538d3d7 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Mon, 3 Sep 2012 15:59:49 +0200 Subject: [PATCH 2/5] resizable title page first draft achieved --- src/gui/UBTeacherGuideWidget.cpp | 74 ++++++++++++++++++++------------ src/gui/UBTeacherGuideWidget.h | 7 ++- 2 files changed, 52 insertions(+), 29 deletions(-) diff --git a/src/gui/UBTeacherGuideWidget.cpp b/src/gui/UBTeacherGuideWidget.cpp index 77bebf96..a18edc4e 100644 --- a/src/gui/UBTeacherGuideWidget.cpp +++ b/src/gui/UBTeacherGuideWidget.cpp @@ -20,7 +20,7 @@ #include #include #include - +#include #include "UBTeacherGuideWidget.h" @@ -632,8 +632,11 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons QWidget(parent) , mpLayout(NULL) , mpButtonTitleLayout(NULL) + , mpContainerWidgetLayout(NULL) , mpModePushButton(NULL) , mpPageNumberLabel(NULL) + , mpScrollArea(NULL) + , mpContainerWidget(NULL) , mpSessionTitle(NULL) , mpSeparatorSessionTitle(NULL) , mpAuthorsLabel(NULL) @@ -673,6 +676,18 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons mpPageNumberLabel->setText(tr("Title page")); mpLayout->addWidget(mpPageNumberLabel); + + mpScrollArea = new QScrollArea(); + mpContainerWidget = new QWidget(); + mpContainerWidgetLayout = new QVBoxLayout(); + + + mpLayout->addWidget(mpScrollArea); + mpScrollArea->setWidget(mpContainerWidget); + mpScrollArea->setWidgetResizable(true); + mpContainerWidget->setLayout(mpContainerWidgetLayout); + + mpButtonTitleLayout = new QHBoxLayout(0); mpModePushButton = new QPushButton(this); @@ -687,129 +702,129 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons mpButtonTitleLayout->addWidget(mpSessionTitle); connect(this, SIGNAL(resized()), mpSessionTitle, SLOT(onTextChanged())); - mpLayout->addLayout(mpButtonTitleLayout); + mpContainerWidgetLayout->addLayout(mpButtonTitleLayout); mpSeparatorSessionTitle = new QFrame(this); mpSeparatorSessionTitle->setFixedHeight(UBTG_SEPARATOR_FIXED_HEIGHT); mpSeparatorSessionTitle->setObjectName("UBTGSeparator"); - mpLayout->addWidget(mpSeparatorSessionTitle); + mpContainerWidgetLayout->addWidget(mpSeparatorSessionTitle); mpAuthorsLabel = new QLabel(this); mpAuthorsLabel->setObjectName("UBTGZeroPageEditionModeTitle"); mpAuthorsLabel->setText(tr("Author(s)")); mpAuthorsLabel->setStyleSheet(chapterStyle); - mpLayout->addWidget(mpAuthorsLabel); + mpContainerWidgetLayout->addWidget(mpAuthorsLabel); mpAuthors = new UBTGAdaptableText(0, this); mpAuthors->setObjectName("UBTGZeroPageInputText"); mpAuthors->setPlaceHolderText(tr("Type authors here ...")); - mpLayout->addWidget(mpAuthors); + mpContainerWidgetLayout->addWidget(mpAuthors); connect(this, SIGNAL(resized()), mpAuthors, SLOT(onTextChanged())); mpCreationLabel = new QLabel(this); mpCreationLabel->setObjectName("UBTGZeroPageDateLabel"); - mpLayout->addWidget(mpCreationLabel); + mpContainerWidgetLayout->addWidget(mpCreationLabel); mpLastModifiedLabel = new QLabel(this); mpLastModifiedLabel->setObjectName("UBTGZeroPageDateLabel"); - mpLayout->addWidget(mpLastModifiedLabel); + mpContainerWidgetLayout->addWidget(mpLastModifiedLabel); mpSeparatorAuthors = new QFrame(this); mpSeparatorAuthors->setFixedHeight(UBTG_SEPARATOR_FIXED_HEIGHT); mpSeparatorAuthors->setObjectName("UBTGSeparator"); - mpLayout->addWidget(mpSeparatorAuthors); + mpContainerWidgetLayout->addWidget(mpSeparatorAuthors); mpObjectivesLabel = new QLabel(this); mpObjectivesLabel->setObjectName("UBTGZeroPageEditionModeTitle"); mpObjectivesLabel->setText(tr("Objective(s)")); mpObjectivesLabel->setStyleSheet(chapterStyle); - mpLayout->addWidget(mpObjectivesLabel); + mpContainerWidgetLayout->addWidget(mpObjectivesLabel); mpObjectives = new UBTGAdaptableText(0, this); mpObjectives->setObjectName("UBTGZeroPageInputText"); mpObjectives->setPlaceHolderText(tr("Type objectives here...")); - mpLayout->addWidget(mpObjectives); + mpContainerWidgetLayout->addWidget(mpObjectives); connect(this, SIGNAL(resized()), mpObjectives, SLOT(onTextChanged())); mpSeparatorObjectives = new QFrame(this); mpSeparatorObjectives->setFixedHeight(UBTG_SEPARATOR_FIXED_HEIGHT); mpSeparatorObjectives->setObjectName("UBTGSeparator"); - mpLayout->addWidget(mpSeparatorObjectives); + mpContainerWidgetLayout->addWidget(mpSeparatorObjectives); mpIndexLabel = new QLabel(this); mpIndexLabel->setObjectName("UBTGZeroPageEditionModeTitle"); mpIndexLabel->setText(tr("Resource indexing")); mpIndexLabel->setStyleSheet(chapterStyle); - mpLayout->addWidget(mpIndexLabel); + mpContainerWidgetLayout->addWidget(mpIndexLabel); mpKeywordsLabel = new QLabel(this); mpKeywordsLabel->setObjectName("UBTGZeroPageItemLabel"); mpKeywordsLabel->setText(tr("Keywords:")); mpKeywordsLabel->setStyleSheet(chapterStyle); - mpLayout->addWidget(mpKeywordsLabel); + mpContainerWidgetLayout->addWidget(mpKeywordsLabel); mpKeywords = new UBTGAdaptableText(0, this); mpKeywords->setPlaceHolderText(tr("Type keywords here ...")); - mpLayout->addWidget(mpKeywords); + mpContainerWidgetLayout->addWidget(mpKeywords); connect(this, SIGNAL(resized()), mpKeywords, SLOT(onTextChanged())); mpSchoolLevelItemLabel = new QLabel(this); mpSchoolLevelItemLabel->setObjectName("UBTGZeroPageItemLabel"); mpSchoolLevelItemLabel->setText(tr("Level:")); mpSchoolLevelItemLabel->setStyleSheet(chapterStyle); - mpLayout->addWidget(mpSchoolLevelItemLabel); + mpContainerWidgetLayout->addWidget(mpSchoolLevelItemLabel); mpSchoolLevelBox = new QComboBox(this); mpSchoolLevelBox->setMinimumHeight(22); mpSchoolLevelBox->setObjectName("DockPaletteWidgetComboBox"); connect(mpSchoolLevelBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(onSchoolLevelChanged(QString))); - mpLayout->addWidget(mpSchoolLevelBox); + mpContainerWidgetLayout->addWidget(mpSchoolLevelBox); mpSchoolLevelValueLabel = new QLabel(this); - mpLayout->addWidget(mpSchoolLevelValueLabel); + mpContainerWidgetLayout->addWidget(mpSchoolLevelValueLabel); mpSchoolSubjectsItemLabel = new QLabel(this); mpSchoolSubjectsItemLabel->setObjectName("UBTGZeroPageItemLabel"); mpSchoolSubjectsItemLabel->setText(tr("Subjects:")); mpSchoolSubjectsItemLabel->setStyleSheet(chapterStyle); - mpLayout->addWidget(mpSchoolSubjectsItemLabel); + mpContainerWidgetLayout->addWidget(mpSchoolSubjectsItemLabel); mpSchoolSubjectsBox = new QComboBox(this); mpSchoolSubjectsBox->setMinimumHeight(22); mpSchoolSubjectsBox->setObjectName("DockPaletteWidgetComboBox"); - mpLayout->addWidget(mpSchoolSubjectsBox); + mpContainerWidgetLayout->addWidget(mpSchoolSubjectsBox); mpSchoolSubjectsValueLabel = new QLabel(this); - mpLayout->addWidget(mpSchoolSubjectsValueLabel); + mpContainerWidgetLayout->addWidget(mpSchoolSubjectsValueLabel); mpSchoolTypeItemLabel = new QLabel(this); mpSchoolTypeItemLabel->setObjectName("UBTGZeroPageItemLabel"); mpSchoolTypeItemLabel->setText(tr("Type:")); mpSchoolTypeItemLabel->setStyleSheet(chapterStyle); - mpLayout->addWidget(mpSchoolTypeItemLabel); + mpContainerWidgetLayout->addWidget(mpSchoolTypeItemLabel); mpSchoolTypeBox = new QComboBox(this); mpSchoolTypeBox->setMinimumHeight(22); mpSchoolTypeBox->setObjectName("DockPaletteWidgetComboBox"); - mpLayout->addWidget(mpSchoolTypeBox); + mpContainerWidgetLayout->addWidget(mpSchoolTypeBox); mpSchoolTypeValueLabel = new QLabel(this); - mpLayout->addWidget(mpSchoolTypeValueLabel); + mpContainerWidgetLayout->addWidget(mpSchoolTypeValueLabel); mpSeparatorIndex = new QFrame(this); mpSeparatorIndex->setFixedHeight(UBTG_SEPARATOR_FIXED_HEIGHT); mpSeparatorIndex->setObjectName("UBTGSeparator"); - mpLayout->addWidget(mpSeparatorIndex); + mpContainerWidgetLayout->addWidget(mpSeparatorIndex); mpLicenceLabel = new QLabel(this); mpLicenceLabel->setObjectName("UBTGZeroPageItemLabel"); mpLicenceLabel->setText(tr("Licence")); mpLicenceLabel->setStyleSheet(chapterStyle); - mpLayout->addWidget(mpLicenceLabel); + mpContainerWidgetLayout->addWidget(mpLicenceLabel); mpLicenceBox = new QComboBox(this); mpLicenceBox->setMinimumHeight(22); mpLicenceBox->setObjectName("DockPaletteWidgetComboBox"); - mpLayout->addWidget(mpLicenceBox); + mpContainerWidgetLayout->addWidget(mpLicenceBox); mpLicenceLayout = new QHBoxLayout(0); mpLicenceIcon = new QLabel(this); mpLicenceLayout->addWidget(mpLicenceIcon); mpLicenceValueLabel = new QLabel(this); mpLicenceLayout->addWidget(mpLicenceValueLabel); - mpLayout->addLayout(mpLicenceLayout); - mpLayout->addStretch(1); + mpContainerWidgetLayout->addLayout(mpLicenceLayout); + mpContainerWidgetLayout->addStretch(1); connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged())); fillComboBoxes(); @@ -845,6 +860,9 @@ UBTeacherGuidePageZeroWidget::~UBTeacherGuidePageZeroWidget() DELETEPTR(mpModePushButton); DELETEPTR(mpLicenceLayout); DELETEPTR(mpButtonTitleLayout); + DELETEPTR(mpContainerWidgetLayout); + DELETEPTR(mpContainerWidget); + DELETEPTR(mpScrollArea); DELETEPTR(mpLayout); } diff --git a/src/gui/UBTeacherGuideWidget.h b/src/gui/UBTeacherGuideWidget.h index a970807e..60e5ab04 100644 --- a/src/gui/UBTeacherGuideWidget.h +++ b/src/gui/UBTeacherGuideWidget.h @@ -23,7 +23,7 @@ class QVBoxLayout; class QPushButton; class UBDocumentProxy; class UBGraphicsTextItem; - +class QScrollArea; #include "UBTeacherGuideWidgetsTools.h" @@ -155,8 +155,13 @@ private: QVBoxLayout* mpLayout; QHBoxLayout* mpButtonTitleLayout; + QVBoxLayout* mpContainerWidgetLayout; QPushButton* mpModePushButton; QLabel* mpPageNumberLabel; + + QScrollArea* mpScrollArea; + QWidget* mpContainerWidget; + UBTGAdaptableText* mpSessionTitle; QFrame* mpSeparatorSessionTitle; From 5bb5444b61697b9e6161e66ba4a86a25e612a70c Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Tue, 4 Sep 2012 13:23:52 +0200 Subject: [PATCH 3/5] fixed issue for resizing on title page --- src/gui/UBTeacherGuideWidget.cpp | 21 ++++++++++++++------- src/gui/UBTeacherGuideWidget.h | 2 ++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/gui/UBTeacherGuideWidget.cpp b/src/gui/UBTeacherGuideWidget.cpp index a18edc4e..77c692a5 100644 --- a/src/gui/UBTeacherGuideWidget.cpp +++ b/src/gui/UBTeacherGuideWidget.cpp @@ -676,18 +676,16 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons mpPageNumberLabel->setText(tr("Title page")); mpLayout->addWidget(mpPageNumberLabel); - mpScrollArea = new QScrollArea(); mpContainerWidget = new QWidget(); mpContainerWidgetLayout = new QVBoxLayout(); - mpLayout->addWidget(mpScrollArea); mpScrollArea->setWidget(mpContainerWidget); mpScrollArea->setWidgetResizable(true); + mpScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); mpContainerWidget->setLayout(mpContainerWidgetLayout); - mpButtonTitleLayout = new QHBoxLayout(0); mpModePushButton = new QPushButton(this); @@ -774,6 +772,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons mpContainerWidgetLayout->addWidget(mpSchoolLevelItemLabel); mpSchoolLevelBox = new QComboBox(this); mpSchoolLevelBox->setMinimumHeight(22); + mpSchoolLevelBox->setMinimumWidth(LOWER_RESIZE_WIDTH); mpSchoolLevelBox->setObjectName("DockPaletteWidgetComboBox"); connect(mpSchoolLevelBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(onSchoolLevelChanged(QString))); mpContainerWidgetLayout->addWidget(mpSchoolLevelBox); @@ -787,6 +786,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons mpContainerWidgetLayout->addWidget(mpSchoolSubjectsItemLabel); mpSchoolSubjectsBox = new QComboBox(this); mpSchoolSubjectsBox->setMinimumHeight(22); + mpSchoolSubjectsBox->setMinimumWidth(LOWER_RESIZE_WIDTH); mpSchoolSubjectsBox->setObjectName("DockPaletteWidgetComboBox"); mpContainerWidgetLayout->addWidget(mpSchoolSubjectsBox); mpSchoolSubjectsValueLabel = new QLabel(this); @@ -799,6 +799,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons mpContainerWidgetLayout->addWidget(mpSchoolTypeItemLabel); mpSchoolTypeBox = new QComboBox(this); mpSchoolTypeBox->setMinimumHeight(22); + mpSchoolTypeBox->setMinimumWidth(LOWER_RESIZE_WIDTH); mpSchoolTypeBox->setObjectName("DockPaletteWidgetComboBox"); mpContainerWidgetLayout->addWidget(mpSchoolTypeBox); mpSchoolTypeValueLabel = new QLabel(this); @@ -816,12 +817,15 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons mpContainerWidgetLayout->addWidget(mpLicenceLabel); mpLicenceBox = new QComboBox(this); mpLicenceBox->setMinimumHeight(22); + mpLicenceBox->setMinimumWidth(LOWER_RESIZE_WIDTH); mpLicenceBox->setObjectName("DockPaletteWidgetComboBox"); mpContainerWidgetLayout->addWidget(mpLicenceBox); mpLicenceLayout = new QHBoxLayout(0); mpLicenceIcon = new QLabel(this); + mpLicenceIcon->setMinimumWidth(LOWER_RESIZE_WIDTH/2); mpLicenceLayout->addWidget(mpLicenceIcon); mpLicenceValueLabel = new QLabel(this); + mpLicenceValueLabel->setMinimumWidth(LOWER_RESIZE_WIDTH/2); mpLicenceLayout->addWidget(mpLicenceValueLabel); mpContainerWidgetLayout->addLayout(mpLicenceLayout); mpContainerWidgetLayout->addStretch(1); @@ -941,7 +945,8 @@ void UBTeacherGuidePageZeroWidget::onSchoolLevelChanged(QString schoolLevel) mpSchoolSubjectsItemLabel->setEnabled(true); mpSchoolSubjectsBox->setEnabled(true); mpSchoolSubjectsBox->addItems(subjects); - } else { + } + else { mpSchoolSubjectsItemLabel->setDisabled(true); mpSchoolSubjectsBox->setDisabled(true); } @@ -1144,10 +1149,12 @@ bool UBTeacherGuidePageZeroWidget::isModified() return result; } -void UBTeacherGuidePageZeroWidget::resizeEvent(QResizeEvent* ev){ +void UBTeacherGuidePageZeroWidget::resizeEvent(QResizeEvent* ev) +{ emit resized(); - - QWidget::resizeEvent(ev); +/* mpScrollArea->resize(width(), height()); + mpContainerWidget->resize(width(), height()); +*/ QWidget::resizeEvent(ev); } /*************************************************************************** diff --git a/src/gui/UBTeacherGuideWidget.h b/src/gui/UBTeacherGuideWidget.h index 60e5ab04..87cd081b 100644 --- a/src/gui/UBTeacherGuideWidget.h +++ b/src/gui/UBTeacherGuideWidget.h @@ -35,6 +35,8 @@ typedef enum tUBTGZeroPageMode_PRESENTATION }tUBTGZeroPageMode; +#define LOWER_RESIZE_WIDTH 50 + /*************************************************************************** * class UBTeacherGuideEditionWidget * ***************************************************************************/ From 931e099e5d4afedfaeb128a6d7d05e596e17f302 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Wed, 5 Sep 2012 11:13:54 +0200 Subject: [PATCH 4/5] added toque on page thumbnail depending if the teacherguide is filled out or not --- resources/images/toque.png | Bin 0 -> 3423 bytes resources/sankore.qrc | 1 + src/document/UBDocumentController.cpp | 23 ++++++----------- src/gui/UBDocumentNavigator.cpp | 34 +++++++++++++++++++++----- src/gui/UBTeacherGuideWidget.cpp | 4 +-- 5 files changed, 38 insertions(+), 24 deletions(-) create mode 100644 resources/images/toque.png diff --git a/resources/images/toque.png b/resources/images/toque.png new file mode 100644 index 0000000000000000000000000000000000000000..a976e147507342f478265ea2db06db82baec4d84 GIT binary patch literal 3423 zcmV-l4WROgP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyq- z1~woi87a5`01V$rL_t(|+U=X!avN8E#=p~jdPjpG36i2H3le3CBDGUgG?HaYlh~@* z)k9)Q5^*!2@!iejFACh`P#^2M z{u!PR_pgBSBH;2zUDE-ybi9SyG5{*Woab10_|5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images/teacherGuide/pencil.svg images/duplicateDisabled.svg images/teacherGuide/flash_24x24.svg + images/toque.png diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index 4be9ee0f..24d76fd6 100755 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -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(resized()), this, SLOT(thumbnailViewResized())); - connect(mDocumentUI->thumbnailWidget, SIGNAL(mouseDoubleClick(QGraphicsItem*, int)), - this, SLOT(pageDoubleClicked(QGraphicsItem*, int))); - connect(mDocumentUI->thumbnailWidget, SIGNAL(mouseClick(QGraphicsItem*, int)), - this, SLOT(pageClicked(QGraphicsItem*, int))); + connect(mDocumentUI->thumbnailWidget, SIGNAL(mouseDoubleClick(QGraphicsItem*, int)), this, SLOT(pageDoubleClicked(QGraphicsItem*, int))); + connect(mDocumentUI->thumbnailWidget, SIGNAL(mouseClick(QGraphicsItem*, int)), this, SLOT(pageClicked(QGraphicsItem*, int))); - connect(mDocumentUI->thumbnailWidget->scene(), SIGNAL(selectionChanged()), - this, SLOT(pageSelectionChanged())); + connect(mDocumentUI->thumbnailWidget->scene(), SIGNAL(selectionChanged()), this, SLOT(pageSelectionChanged())); - connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentCreated(UBDocumentProxy*)), - this, SLOT(addDocumentInTree(UBDocumentProxy*))); + connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentCreated(UBDocumentProxy*)), this, SLOT(addDocumentInTree(UBDocumentProxy*))); - connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentMetadataChanged(UBDocumentProxy*)), - this, SLOT(updateDocumentInTree(UBDocumentProxy*))); + connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentMetadataChanged(UBDocumentProxy*)), this, SLOT(updateDocumentInTree(UBDocumentProxy*))); - connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentSceneCreated(UBDocumentProxy*, int)), - this, SLOT(documentSceneChanged(UBDocumentProxy*, int))); + connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentSceneCreated(UBDocumentProxy*, int)), this, SLOT(documentSceneChanged(UBDocumentProxy*, int))); - connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentSceneWillBeDeleted(UBDocumentProxy*, int)), - this, SLOT(documentSceneChanged(UBDocumentProxy*, int))); + connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentSceneWillBeDeleted(UBDocumentProxy*, int)), this, SLOT(documentSceneChanged(UBDocumentProxy*, int))); mDocumentUI->thumbnailWidget->setBackgroundBrush(UBSettings::documentViewLightColor); @@ -996,7 +989,7 @@ void UBDocumentController::addFolderOfImages() if (importedImageNumber == 0) { - showMessage(tr("Folder does not contain any image files!")); + showMessage(tr("Folder does not contain any image files")); UBApplication::applicationController->showDocument(); } else diff --git a/src/gui/UBDocumentNavigator.cpp b/src/gui/UBDocumentNavigator.cpp index e2de9970..90b45615 100644 --- a/src/gui/UBDocumentNavigator.cpp +++ b/src/gui/UBDocumentNavigator.cpp @@ -69,6 +69,9 @@ UBDocumentNavigator::~UBDocumentNavigator() } } +#include "gui/UBDockTeacherGuideWidget.h" +#include "gui/UBTeacherGuideWidget.h" + /** * \brief Generate the thumbnails */ @@ -84,10 +87,31 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source) for(int i = 0; i < source->selectedDocument()->pageCount(); 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); - QString label = pageIndex == 0 ? tr("Title page") : tr("Page %0").arg(pageIndex); + + 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); UBThumbnailTextItem *labelItem = new UBThumbnailTextItem(label); UBImgTextThumbnailElement thumbWithText(pixmapItem, labelItem); @@ -104,7 +128,7 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source) void UBDocumentNavigator::onScrollToSelectedPage(int index) { - qDebug() << "Selection in widet: " << index; + qDebug() << "Selection in widget: " << index; int c = 0; foreach(UBImgTextThumbnailElement el, mThumbsWithLabels) { @@ -118,7 +142,6 @@ void UBDocumentNavigator::onScrollToSelectedPage(int index) } c++; } -// centerOn(mThumbsWithLabels[index].getThumbnail()); } /** @@ -131,8 +154,7 @@ void UBDocumentNavigator::updateSpecificThumbnail(int iPage) //UBGraphicsScene* pScene = UBApplication::boardController->activeScene(); const QPixmap* pix = UBApplication::boardController->pageAt(iPage); - UBSceneThumbnailNavigPixmap* newItem = new UBSceneThumbnailNavigPixmap(*pix, - UBApplication::boardController->selectedDocument(), iPage); + UBSceneThumbnailNavigPixmap* newItem = new UBSceneThumbnailNavigPixmap(*pix, UBApplication::boardController->selectedDocument(), iPage); // Get the old thumbnail UBSceneThumbnailNavigPixmap* oldItem = mThumbsWithLabels.at(iPage).getThumbnail(); diff --git a/src/gui/UBTeacherGuideWidget.cpp b/src/gui/UBTeacherGuideWidget.cpp index 77c692a5..ffe11cbd 100644 --- a/src/gui/UBTeacherGuideWidget.cpp +++ b/src/gui/UBTeacherGuideWidget.cpp @@ -1152,9 +1152,7 @@ bool UBTeacherGuidePageZeroWidget::isModified() void UBTeacherGuidePageZeroWidget::resizeEvent(QResizeEvent* ev) { emit resized(); -/* mpScrollArea->resize(width(), height()); - mpContainerWidget->resize(width(), height()); -*/ QWidget::resizeEvent(ev); + QWidget::resizeEvent(ev); } /*************************************************************************** From a726171f1b90b7005b803acf45950ae5d0cfe8c9 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Thu, 6 Sep 2012 15:03:23 +0200 Subject: [PATCH 5/5] add the possibility to set maximum number of character --- src/gui/UBTeacherGuideWidget.cpp | 1 + src/gui/UBTeacherGuideWidgetsTools.cpp | 14 ++++++++++++++ src/gui/UBTeacherGuideWidgetsTools.h | 2 ++ 3 files changed, 17 insertions(+) diff --git a/src/gui/UBTeacherGuideWidget.cpp b/src/gui/UBTeacherGuideWidget.cpp index ffe11cbd..679da6a8 100644 --- a/src/gui/UBTeacherGuideWidget.cpp +++ b/src/gui/UBTeacherGuideWidget.cpp @@ -697,6 +697,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons mpSessionTitle = new UBTGAdaptableText(0, this, "UBTGSessionTitle"); mpSessionTitle->setPlaceHolderText(tr("Type session title here ...")); + mpSessionTitle->setMaximumLength(1000); mpButtonTitleLayout->addWidget(mpSessionTitle); connect(this, SIGNAL(resized()), mpSessionTitle, SLOT(onTextChanged())); diff --git a/src/gui/UBTeacherGuideWidgetsTools.cpp b/src/gui/UBTeacherGuideWidgetsTools.cpp index 6300c65b..4456b243 100644 --- a/src/gui/UBTeacherGuideWidgetsTools.cpp +++ b/src/gui/UBTeacherGuideWidgetsTools.cpp @@ -120,6 +120,7 @@ UBTGAdaptableText::UBTGAdaptableText(QTreeWidgetItem* widget, QWidget* parent, c , mMinimumHeight(0) , mHasPlaceHolder(false) , mIsUpdatingSize(false) + , mMaximumLength(0) { setObjectName(name); connect(this,SIGNAL(textChanged()),this,SLOT(onTextChanged())); @@ -131,6 +132,11 @@ UBTGAdaptableText::UBTGAdaptableText(QTreeWidgetItem* widget, QWidget* parent, c } +void UBTGAdaptableText::setMaximumLength(int length) +{ + mMaximumLength = length; +} + void UBTGAdaptableText::setPlaceHolderText(QString text) { mHasPlaceHolder = true; @@ -166,6 +172,12 @@ void UBTGAdaptableText::keyReleaseEvent(QKeyEvent* e) setTextColor(QColor(Qt::lightGray)); setPlainText(mPlaceHolderText); } + if(mMaximumLength && toPlainText().length()>mMaximumLength){ + setPlainText(toPlainText().left(mMaximumLength)); + QTextCursor tc(document()); + tc.setPosition(mMaximumLength); + setTextCursor(tc); + } } void UBTGAdaptableText::showEvent(QShowEvent* e) @@ -212,8 +224,10 @@ void UBTGAdaptableText::onTextChanged() setFocus(); } mIsUpdatingSize = false; + } + void UBTGAdaptableText::setInitialText(const QString& text) { setText(text); diff --git a/src/gui/UBTeacherGuideWidgetsTools.h b/src/gui/UBTeacherGuideWidgetsTools.h index e4ee8c53..2f87ccfd 100644 --- a/src/gui/UBTeacherGuideWidgetsTools.h +++ b/src/gui/UBTeacherGuideWidgetsTools.h @@ -97,6 +97,7 @@ public: void setPlaceHolderText(QString text); QString text(); void setInitialText(const QString& text); + void setMaximumLength(int length); public slots: void onTextChanged(); @@ -113,6 +114,7 @@ private: bool mHasPlaceHolder; QString mPlaceHolderText; bool mIsUpdatingSize; + int mMaximumLength; };