|
|
@ -43,6 +43,8 @@ |
|
|
|
#include "document/UBDocumentProxy.h" |
|
|
|
#include "document/UBDocumentProxy.h" |
|
|
|
#include "document/UBDocumentController.h" |
|
|
|
#include "document/UBDocumentController.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "domain/UBGraphicsTextItem.h" |
|
|
|
|
|
|
|
|
|
|
|
#define UBTG_SEPARATOR_FIXED_HEIGHT 3 |
|
|
|
#define UBTG_SEPARATOR_FIXED_HEIGHT 3 |
|
|
|
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
typedef enum
|
|
|
@ -193,6 +195,8 @@ QDomElement* UBTeacherGuideEditionWidget::save(QDomElement* parentElement) |
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherGuideEditionWidget::onActiveSceneChanged() |
|
|
|
void UBTeacherGuideEditionWidget::onActiveSceneChanged() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
load(UBSvgSubsetAdaptor::sTeacherGuideNode); |
|
|
|
|
|
|
|
qDebug() << "UBSvgSubsetAdaptor::sTeacherGuideNode " << UBSvgSubsetAdaptor::sTeacherGuideNode; |
|
|
|
mpPageNumberLabel->setText(tr("Page: %0").arg(UBApplication::boardController->currentPage())); |
|
|
|
mpPageNumberLabel->setText(tr("Page: %0").arg(UBApplication::boardController->currentPage())); |
|
|
|
UBDocumentProxy* documentProxy = UBApplication::boardController->activeDocument(); |
|
|
|
UBDocumentProxy* documentProxy = UBApplication::boardController->activeDocument(); |
|
|
|
if(mpDocumentTitle) |
|
|
|
if(mpDocumentTitle) |
|
|
@ -565,8 +569,10 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons |
|
|
|
, mpLicenceBox(NULL) |
|
|
|
, mpLicenceBox(NULL) |
|
|
|
, mpLicenceIcon(NULL) |
|
|
|
, mpLicenceIcon(NULL) |
|
|
|
, mpLicenceLayout(NULL) |
|
|
|
, mpLicenceLayout(NULL) |
|
|
|
|
|
|
|
, mpSceneItemSessionTitle(NULL) |
|
|
|
{ |
|
|
|
{ |
|
|
|
setObjectName(name); |
|
|
|
setObjectName(name); |
|
|
|
|
|
|
|
QString chapterStyle("QLabel {font-size:16px; font-weight:bold;}"); |
|
|
|
|
|
|
|
|
|
|
|
mpLayout = new QVBoxLayout(this); |
|
|
|
mpLayout = new QVBoxLayout(this); |
|
|
|
mpPageNumberLabel = new QLabel(this); |
|
|
|
mpPageNumberLabel = new QLabel(this); |
|
|
@ -586,7 +592,6 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons |
|
|
|
|
|
|
|
|
|
|
|
mpSessionTitle = new UBTGAdaptableText(0,this,"UBTGSessionTitle"); |
|
|
|
mpSessionTitle = new UBTGAdaptableText(0,this,"UBTGSessionTitle"); |
|
|
|
mpSessionTitle->setPlaceHolderText(tr("Type session title here ...")); |
|
|
|
mpSessionTitle->setPlaceHolderText(tr("Type session title here ...")); |
|
|
|
//mpSessionTitle->setObjectName("UBTGSessionTitle");
|
|
|
|
|
|
|
|
mpButtonTitleLayout->addWidget(mpSessionTitle); |
|
|
|
mpButtonTitleLayout->addWidget(mpSessionTitle); |
|
|
|
|
|
|
|
|
|
|
|
mpLayout->addLayout(mpButtonTitleLayout); |
|
|
|
mpLayout->addLayout(mpButtonTitleLayout); |
|
|
@ -599,6 +604,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons |
|
|
|
mpAuthorsLabel = new QLabel(this); |
|
|
|
mpAuthorsLabel = new QLabel(this); |
|
|
|
mpAuthorsLabel->setObjectName("UBTGZeroPageEditionModeTitle"); |
|
|
|
mpAuthorsLabel->setObjectName("UBTGZeroPageEditionModeTitle"); |
|
|
|
mpAuthorsLabel->setText(tr("Author(s)")); |
|
|
|
mpAuthorsLabel->setText(tr("Author(s)")); |
|
|
|
|
|
|
|
mpAuthorsLabel->setStyleSheet(chapterStyle); |
|
|
|
mpLayout->addWidget(mpAuthorsLabel); |
|
|
|
mpLayout->addWidget(mpAuthorsLabel); |
|
|
|
|
|
|
|
|
|
|
|
mpAuthors = new UBTGAdaptableText(0,this); |
|
|
|
mpAuthors = new UBTGAdaptableText(0,this); |
|
|
@ -622,6 +628,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons |
|
|
|
mpGoalsLabel = new QLabel(this); |
|
|
|
mpGoalsLabel = new QLabel(this); |
|
|
|
mpGoalsLabel->setObjectName("UBTGZeroPageEditionModeTitle"); |
|
|
|
mpGoalsLabel->setObjectName("UBTGZeroPageEditionModeTitle"); |
|
|
|
mpGoalsLabel->setText(tr("Goal(s)")); |
|
|
|
mpGoalsLabel->setText(tr("Goal(s)")); |
|
|
|
|
|
|
|
mpGoalsLabel->setStyleSheet(chapterStyle); |
|
|
|
mpLayout->addWidget(mpGoalsLabel); |
|
|
|
mpLayout->addWidget(mpGoalsLabel); |
|
|
|
|
|
|
|
|
|
|
|
mpGoals = new UBTGAdaptableText(0,this); |
|
|
|
mpGoals = new UBTGAdaptableText(0,this); |
|
|
@ -637,11 +644,13 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons |
|
|
|
mpIndexLabel = new QLabel(this); |
|
|
|
mpIndexLabel = new QLabel(this); |
|
|
|
mpIndexLabel->setObjectName("UBTGZeroPageEditionModeTitle"); |
|
|
|
mpIndexLabel->setObjectName("UBTGZeroPageEditionModeTitle"); |
|
|
|
mpIndexLabel->setText(tr("Resource indexing")); |
|
|
|
mpIndexLabel->setText(tr("Resource indexing")); |
|
|
|
|
|
|
|
mpIndexLabel->setStyleSheet(chapterStyle); |
|
|
|
mpLayout->addWidget(mpIndexLabel); |
|
|
|
mpLayout->addWidget(mpIndexLabel); |
|
|
|
|
|
|
|
|
|
|
|
mpKeywordsLabel = new QLabel(this); |
|
|
|
mpKeywordsLabel = new QLabel(this); |
|
|
|
mpKeywordsLabel->setObjectName("UBTGZeroPageItemLabel"); |
|
|
|
mpKeywordsLabel->setObjectName("UBTGZeroPageItemLabel"); |
|
|
|
mpKeywordsLabel->setText(tr("Keywords:")); |
|
|
|
mpKeywordsLabel->setText(tr("Keywords:")); |
|
|
|
|
|
|
|
mpKeywordsLabel->setStyleSheet(chapterStyle); |
|
|
|
mpLayout->addWidget(mpKeywordsLabel); |
|
|
|
mpLayout->addWidget(mpKeywordsLabel); |
|
|
|
mpKeywords = new UBTGAdaptableText(0,this); |
|
|
|
mpKeywords = new UBTGAdaptableText(0,this); |
|
|
|
mpKeywords->setPlaceHolderText(tr("Type keywords here ...")); |
|
|
|
mpKeywords->setPlaceHolderText(tr("Type keywords here ...")); |
|
|
@ -650,6 +659,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons |
|
|
|
mpSchoolLevelItemLabel = new QLabel(this); |
|
|
|
mpSchoolLevelItemLabel = new QLabel(this); |
|
|
|
mpSchoolLevelItemLabel->setObjectName("UBTGZeroPageItemLabel"); |
|
|
|
mpSchoolLevelItemLabel->setObjectName("UBTGZeroPageItemLabel"); |
|
|
|
mpSchoolLevelItemLabel->setText(tr("Level:")); |
|
|
|
mpSchoolLevelItemLabel->setText(tr("Level:")); |
|
|
|
|
|
|
|
mpSchoolLevelItemLabel->setStyleSheet(chapterStyle); |
|
|
|
mpLayout->addWidget(mpSchoolLevelItemLabel); |
|
|
|
mpLayout->addWidget(mpSchoolLevelItemLabel); |
|
|
|
mpSchoolLevelBox = new QComboBox(this); |
|
|
|
mpSchoolLevelBox = new QComboBox(this); |
|
|
|
mpSchoolLevelBox->setObjectName("DockPaletteWidgetComboBox"); |
|
|
|
mpSchoolLevelBox->setObjectName("DockPaletteWidgetComboBox"); |
|
|
@ -661,6 +671,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons |
|
|
|
mpSchoolBranchItemLabel = new QLabel(this); |
|
|
|
mpSchoolBranchItemLabel = new QLabel(this); |
|
|
|
mpSchoolBranchItemLabel->setObjectName("UBTGZeroPageItemLabel"); |
|
|
|
mpSchoolBranchItemLabel->setObjectName("UBTGZeroPageItemLabel"); |
|
|
|
mpSchoolBranchItemLabel->setText(tr("Branch:")); |
|
|
|
mpSchoolBranchItemLabel->setText(tr("Branch:")); |
|
|
|
|
|
|
|
mpSchoolBranchItemLabel->setStyleSheet(chapterStyle); |
|
|
|
mpLayout->addWidget(mpSchoolBranchItemLabel); |
|
|
|
mpLayout->addWidget(mpSchoolBranchItemLabel); |
|
|
|
mpSchoolBranchBox = new QComboBox(this); |
|
|
|
mpSchoolBranchBox = new QComboBox(this); |
|
|
|
mpSchoolBranchBox->setObjectName("DockPaletteWidgetComboBox"); |
|
|
|
mpSchoolBranchBox->setObjectName("DockPaletteWidgetComboBox"); |
|
|
@ -671,6 +682,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons |
|
|
|
mpSchoolTypeItemLabel = new QLabel(this); |
|
|
|
mpSchoolTypeItemLabel = new QLabel(this); |
|
|
|
mpSchoolTypeItemLabel->setObjectName("UBTGZeroPageItemLabel"); |
|
|
|
mpSchoolTypeItemLabel->setObjectName("UBTGZeroPageItemLabel"); |
|
|
|
mpSchoolTypeItemLabel->setText(tr("Type:")); |
|
|
|
mpSchoolTypeItemLabel->setText(tr("Type:")); |
|
|
|
|
|
|
|
mpSchoolTypeItemLabel->setStyleSheet(chapterStyle); |
|
|
|
mpLayout->addWidget(mpSchoolTypeItemLabel); |
|
|
|
mpLayout->addWidget(mpSchoolTypeItemLabel); |
|
|
|
mpSchoolTypeBox = new QComboBox(this); |
|
|
|
mpSchoolTypeBox = new QComboBox(this); |
|
|
|
mpSchoolTypeBox->setObjectName("DockPaletteWidgetComboBox"); |
|
|
|
mpSchoolTypeBox->setObjectName("DockPaletteWidgetComboBox"); |
|
|
@ -685,7 +697,8 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons |
|
|
|
|
|
|
|
|
|
|
|
mpLicenceLabel = new QLabel(this); |
|
|
|
mpLicenceLabel = new QLabel(this); |
|
|
|
mpLicenceLabel->setObjectName("UBTGZeroPageItemLabel"); |
|
|
|
mpLicenceLabel->setObjectName("UBTGZeroPageItemLabel"); |
|
|
|
mpLicenceLabel->setText(tr("Licence:")); |
|
|
|
mpLicenceLabel->setText(tr("Licence")); |
|
|
|
|
|
|
|
mpLicenceLabel->setStyleSheet(chapterStyle); |
|
|
|
mpLayout->addWidget(mpLicenceLabel); |
|
|
|
mpLayout->addWidget(mpLicenceLabel); |
|
|
|
mpLicenceBox = new QComboBox(this); |
|
|
|
mpLicenceBox = new QComboBox(this); |
|
|
|
mpLicenceBox->setObjectName("DockPaletteWidgetComboBox"); |
|
|
|
mpLicenceBox->setObjectName("DockPaletteWidgetComboBox"); |
|
|
@ -697,6 +710,8 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons |
|
|
|
mpLicenceLayout->addWidget(mpLicenceValueLabel); |
|
|
|
mpLicenceLayout->addWidget(mpLicenceValueLabel); |
|
|
|
mpLayout->addLayout(mpLicenceLayout); |
|
|
|
mpLayout->addLayout(mpLicenceLayout); |
|
|
|
mpLayout->addStretch(1); |
|
|
|
mpLayout->addStretch(1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setLayout(mpLayout); |
|
|
|
connect(UBApplication::boardController,SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged())); |
|
|
|
connect(UBApplication::boardController,SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged())); |
|
|
|
fillComboBoxes(); |
|
|
|
fillComboBoxes(); |
|
|
|
} |
|
|
|
} |
|
|
@ -810,10 +825,11 @@ void UBTeacherGuidePageZeroWidget::onActiveSceneChanged() |
|
|
|
UBDocumentProxy* documentProxy = UBApplication::boardController->activeDocument(); |
|
|
|
UBDocumentProxy* documentProxy = UBApplication::boardController->activeDocument(); |
|
|
|
if(documentProxy && UBApplication::boardController->currentPage() == 0){ |
|
|
|
if(documentProxy && UBApplication::boardController->currentPage() == 0){ |
|
|
|
QDateTime creationDate = documentProxy->documentDate(); |
|
|
|
QDateTime creationDate = documentProxy->documentDate(); |
|
|
|
mpCreationLabel->setText(tr("Created the: ") + creationDate.toString(Qt::SystemLocaleShortDate)); |
|
|
|
mpCreationLabel->setText(tr("Created the:\n") + creationDate.toString(Qt::SystemLocaleShortDate)); |
|
|
|
QDateTime updatedDate = documentProxy->lastUpdate(); |
|
|
|
QDateTime updatedDate = documentProxy->lastUpdate(); |
|
|
|
mpLastModifiedLabel->setText(tr("Updated the: ") + updatedDate.toString(Qt::SystemLocaleShortDate)); |
|
|
|
mpLastModifiedLabel->setText(tr("Updated the:\n") + updatedDate.toString(Qt::SystemLocaleShortDate)); |
|
|
|
loadData(); |
|
|
|
loadData(); |
|
|
|
|
|
|
|
UBApplication::boardController->activeScene()->textForObjectName(mpSessionTitle->text()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -860,12 +876,18 @@ void UBTeacherGuidePageZeroWidget::persistData() |
|
|
|
void UBTeacherGuidePageZeroWidget::switchToMode(tUBTGZeroPageMode mode) |
|
|
|
void UBTeacherGuidePageZeroWidget::switchToMode(tUBTGZeroPageMode mode) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(mode == tUBTGZeroPageMode_EDITION){ |
|
|
|
if(mode == tUBTGZeroPageMode_EDITION){ |
|
|
|
|
|
|
|
QString inputStyleSheet("QTextEdit { background: white; border-radius: 10px; border: 2px;}"); |
|
|
|
mpModePushButton->hide(); |
|
|
|
mpModePushButton->hide(); |
|
|
|
mpSessionTitle->setReadOnly(false); |
|
|
|
mpSessionTitle->setReadOnly(false); |
|
|
|
mpSessionTitle->setObjectName("UBTGEditionModeSessionTitle"); |
|
|
|
mpSessionTitle->setStyleSheet(inputStyleSheet); |
|
|
|
|
|
|
|
QFont titleFont(QApplication::font().family(),11,-1); |
|
|
|
|
|
|
|
mpSessionTitle->document()->setDefaultFont(titleFont); |
|
|
|
mpAuthors->setReadOnly(false); |
|
|
|
mpAuthors->setReadOnly(false); |
|
|
|
|
|
|
|
mpAuthors->setStyleSheet(inputStyleSheet); |
|
|
|
mpGoals->setReadOnly(false); |
|
|
|
mpGoals->setReadOnly(false); |
|
|
|
|
|
|
|
mpGoals->setStyleSheet(inputStyleSheet); |
|
|
|
mpKeywords->setReadOnly(false); |
|
|
|
mpKeywords->setReadOnly(false); |
|
|
|
|
|
|
|
mpKeywords->setStyleSheet(inputStyleSheet); |
|
|
|
mpSchoolLevelValueLabel->hide(); |
|
|
|
mpSchoolLevelValueLabel->hide(); |
|
|
|
mpSchoolLevelBox->show(); |
|
|
|
mpSchoolLevelBox->show(); |
|
|
|
mpSchoolBranchValueLabel->hide(); |
|
|
|
mpSchoolBranchValueLabel->hide(); |
|
|
@ -877,12 +899,23 @@ void UBTeacherGuidePageZeroWidget::switchToMode(tUBTGZeroPageMode mode) |
|
|
|
mpLicenceBox->show(); |
|
|
|
mpLicenceBox->show(); |
|
|
|
} |
|
|
|
} |
|
|
|
else{ |
|
|
|
else{ |
|
|
|
|
|
|
|
QString inputStyleSheet("QTextEdit { background: transparent; border: none;}"); |
|
|
|
mpModePushButton->show(); |
|
|
|
mpModePushButton->show(); |
|
|
|
mpSessionTitle->setReadOnly(true); |
|
|
|
mpSessionTitle->setReadOnly(true); |
|
|
|
mpSessionTitle->setObjectName("UBTGPresentationSessionTitle"); |
|
|
|
UBApplication::boardController->activeScene()->textForObjectName(mpSessionTitle->text()); |
|
|
|
|
|
|
|
mpSessionTitle->setStyleSheet(inputStyleSheet); |
|
|
|
|
|
|
|
mpSessionTitle->setTextColor(QColor(Qt::black)); |
|
|
|
|
|
|
|
QFont titleFont(QApplication::font().family(),14,1); |
|
|
|
|
|
|
|
mpSessionTitle->document()->setDefaultFont(titleFont); |
|
|
|
mpAuthors->setReadOnly(true); |
|
|
|
mpAuthors->setReadOnly(true); |
|
|
|
|
|
|
|
mpAuthors->setStyleSheet(inputStyleSheet); |
|
|
|
|
|
|
|
mpAuthors->setTextColor(QColor(Qt::black)); |
|
|
|
mpGoals->setReadOnly(true); |
|
|
|
mpGoals->setReadOnly(true); |
|
|
|
|
|
|
|
mpGoals->setStyleSheet(inputStyleSheet); |
|
|
|
|
|
|
|
mpGoals->setTextColor(QColor(Qt::black)); |
|
|
|
mpKeywords->setReadOnly(true); |
|
|
|
mpKeywords->setReadOnly(true); |
|
|
|
|
|
|
|
mpKeywords->setStyleSheet(inputStyleSheet); |
|
|
|
|
|
|
|
mpKeywords->setTextColor(QColor(Qt::black)); |
|
|
|
mpSchoolLevelValueLabel->setText(mpSchoolLevelBox->currentText()); |
|
|
|
mpSchoolLevelValueLabel->setText(mpSchoolLevelBox->currentText()); |
|
|
|
mpSchoolLevelValueLabel->show(); |
|
|
|
mpSchoolLevelValueLabel->show(); |
|
|
|
mpSchoolLevelBox->hide(); |
|
|
|
mpSchoolLevelBox->hide(); |
|
|
@ -902,6 +935,7 @@ void UBTeacherGuidePageZeroWidget::switchToMode(tUBTGZeroPageMode mode) |
|
|
|
mpLicenceBox->hide(); |
|
|
|
mpLicenceBox->hide(); |
|
|
|
persistData(); |
|
|
|
persistData(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
update(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QVector<tUBGEElementNode*> UBTeacherGuidePageZeroWidget::getData() |
|
|
|
QVector<tUBGEElementNode*> UBTeacherGuidePageZeroWidget::getData() |
|
|
|