|
|
@ -11,6 +11,14 @@ UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QW |
|
|
|
, mpMetadataLabel(NULL) |
|
|
|
, mpMetadataLabel(NULL) |
|
|
|
, mpLicenseLabel(NULL) |
|
|
|
, mpLicenseLabel(NULL) |
|
|
|
, mpLicenseCombox(NULL) |
|
|
|
, mpLicenseCombox(NULL) |
|
|
|
|
|
|
|
, mpKeywords(NULL) |
|
|
|
|
|
|
|
, mpLevel(NULL) |
|
|
|
|
|
|
|
, mpTopic(NULL) |
|
|
|
|
|
|
|
, mpAuthor(NULL) |
|
|
|
|
|
|
|
, mpKeywordLabel(NULL) |
|
|
|
|
|
|
|
, mpLevelLabel(NULL) |
|
|
|
|
|
|
|
, mpTopicLabel(NULL) |
|
|
|
|
|
|
|
, mpAuthorLabel(NULL) |
|
|
|
{ |
|
|
|
{ |
|
|
|
setObjectName(name); |
|
|
|
setObjectName(name); |
|
|
|
|
|
|
|
|
|
|
@ -27,7 +35,7 @@ UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QW |
|
|
|
// Title
|
|
|
|
// Title
|
|
|
|
mpTitleLabel = new QLabel(tr("Session Title"), mpContainer); |
|
|
|
mpTitleLabel = new QLabel(tr("Session Title"), mpContainer); |
|
|
|
mpTitleLabel->setAlignment(Qt::AlignLeft); |
|
|
|
mpTitleLabel->setAlignment(Qt::AlignLeft); |
|
|
|
//mpTitleLabel->setObjectName("UBTeacherBarPreviewSubtitle");
|
|
|
|
mpTitleLabel->setObjectName("UBTeacherBarPreviewSubtitle"); |
|
|
|
mContainerLayout.addWidget(mpTitleLabel, 0); |
|
|
|
mContainerLayout.addWidget(mpTitleLabel, 0); |
|
|
|
mpTitle = new QLineEdit(mpContainer); |
|
|
|
mpTitle = new QLineEdit(mpContainer); |
|
|
|
mpTitle->setObjectName("DockPaletteWidgetLineEdit"); |
|
|
|
mpTitle->setObjectName("DockPaletteWidgetLineEdit"); |
|
|
@ -36,7 +44,7 @@ UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QW |
|
|
|
|
|
|
|
|
|
|
|
// Target
|
|
|
|
// Target
|
|
|
|
mpTargetLabel = new QLabel(tr("Session Target"), mpContainer); |
|
|
|
mpTargetLabel = new QLabel(tr("Session Target"), mpContainer); |
|
|
|
//mpTargetLabel->setObjectName("UBTeacherBarPreviewSubtitle");
|
|
|
|
mpTargetLabel->setObjectName("UBTeacherBarPreviewSubtitle"); |
|
|
|
mContainerLayout.addWidget(mpTargetLabel, 0); |
|
|
|
mContainerLayout.addWidget(mpTargetLabel, 0); |
|
|
|
mpTarget = new QTextEdit(mpContainer); |
|
|
|
mpTarget = new QTextEdit(mpContainer); |
|
|
|
mpTarget->setObjectName("UBTeacherBarTargetBox"); |
|
|
|
mpTarget->setObjectName("UBTeacherBarTargetBox"); |
|
|
@ -45,15 +53,42 @@ UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QW |
|
|
|
|
|
|
|
|
|
|
|
// Metadata
|
|
|
|
// Metadata
|
|
|
|
mpMetadataLabel = new QLabel(tr("Metadata"), mpContainer); |
|
|
|
mpMetadataLabel = new QLabel(tr("Metadata"), mpContainer); |
|
|
|
|
|
|
|
mpMetadataLabel->setObjectName("UBTeacherBarPreviewSubtitle"); |
|
|
|
mpMetadataLabel->setAlignment(Qt::AlignLeft); |
|
|
|
mpMetadataLabel->setAlignment(Qt::AlignLeft); |
|
|
|
//mpMetadataLabel->setObjectName("UBTeacherBarPreviewSubtitle");
|
|
|
|
|
|
|
|
mContainerLayout.addWidget(mpMetadataLabel, 0); |
|
|
|
mContainerLayout.addWidget(mpMetadataLabel, 0); |
|
|
|
|
|
|
|
mpKeywords = new QLineEdit(this); |
|
|
|
|
|
|
|
mpKeywords->setObjectName("DockPaletteWidgetLineEdit"); |
|
|
|
|
|
|
|
mpLevel = new QComboBox(this); |
|
|
|
|
|
|
|
mpLevel->setObjectName("DockPaletteWidgetComboBox"); |
|
|
|
|
|
|
|
mpTopic = new QComboBox(this); |
|
|
|
|
|
|
|
mpTopic->setObjectName("DockPaletteWidgetComboBox"); |
|
|
|
|
|
|
|
mpAuthor = new QLineEdit(this); |
|
|
|
|
|
|
|
mpAuthor->setObjectName("DockPaletteWidgetLineEdit"); |
|
|
|
|
|
|
|
mpKeywordLabel = new QLabel(tr("Keywords:"), this); |
|
|
|
|
|
|
|
mpLevelLabel = new QLabel(tr("Level:"), this); |
|
|
|
|
|
|
|
mpTopicLabel = new QLabel(tr("Topic:"), this); |
|
|
|
|
|
|
|
mpAuthorLabel = new QLabel(tr("Author"), this); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mKeywordLayout.addWidget(mpKeywordLabel, 0); |
|
|
|
|
|
|
|
mKeywordLayout.addWidget(mpKeywords, 1); |
|
|
|
|
|
|
|
mLevelLayout.addWidget(mpLevelLabel, 0); |
|
|
|
|
|
|
|
mLevelLayout.addWidget(mpLevel, 1); |
|
|
|
|
|
|
|
mTopicLayout.addWidget(mpTopicLabel, 0); |
|
|
|
|
|
|
|
mTopicLayout.addWidget(mpTopic, 1); |
|
|
|
|
|
|
|
mAuthorLayout.addWidget(mpAuthorLabel, 0); |
|
|
|
|
|
|
|
mAuthorLayout.addWidget(mpAuthor, 1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mContainerLayout.addLayout(&mKeywordLayout, 0); |
|
|
|
|
|
|
|
mContainerLayout.addLayout(&mLevelLayout, 0); |
|
|
|
|
|
|
|
mContainerLayout.addLayout(&mTopicLayout, 0); |
|
|
|
|
|
|
|
mContainerLayout.addLayout(&mAuthorLayout, 0); |
|
|
|
|
|
|
|
|
|
|
|
mContainerLayout.addWidget(&mLicenseSeparator); |
|
|
|
mContainerLayout.addWidget(&mLicenseSeparator); |
|
|
|
|
|
|
|
|
|
|
|
// License
|
|
|
|
// License
|
|
|
|
mpLicenseLabel = new QLabel(tr("License"), mpContainer); |
|
|
|
mpLicenseLabel = new QLabel(tr("License"), mpContainer); |
|
|
|
mpLicenseLabel->setAlignment(Qt::AlignLeft); |
|
|
|
mpLicenseLabel->setAlignment(Qt::AlignLeft); |
|
|
|
//mpLicenseLabel->setObjectName("UBTeacherBarPreviewSubtitle");
|
|
|
|
mpLicenseLabel->setObjectName("UBTeacherBarPreviewSubtitle"); |
|
|
|
mContainerLayout.addWidget(mpLicenseLabel, 0); |
|
|
|
mContainerLayout.addWidget(mpLicenseLabel, 0); |
|
|
|
mpLicenseCombox = new QComboBox(this); |
|
|
|
mpLicenseCombox = new QComboBox(this); |
|
|
|
mpLicenseCombox->setObjectName("DockPaletteWidgetComboBox"); |
|
|
|
mpLicenseCombox->setObjectName("DockPaletteWidgetComboBox"); |
|
|
@ -81,6 +116,10 @@ UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QW |
|
|
|
connect(mpTitle, SIGNAL(textChanged(QString)), this, SLOT(onSessionTitleChanged())); |
|
|
|
connect(mpTitle, SIGNAL(textChanged(QString)), this, SLOT(onSessionTitleChanged())); |
|
|
|
connect(mpTarget, SIGNAL(textChanged()), this, SLOT(onSessionTargetChanged())); |
|
|
|
connect(mpTarget, SIGNAL(textChanged()), this, SLOT(onSessionTargetChanged())); |
|
|
|
connect(mpLicenseCombox, SIGNAL(currentIndexChanged(int)), this, SLOT(onLicenseCurrentIndexChanged(int))); |
|
|
|
connect(mpLicenseCombox, SIGNAL(currentIndexChanged(int)), this, SLOT(onLicenseCurrentIndexChanged(int))); |
|
|
|
|
|
|
|
connect(mpKeywords, SIGNAL(textChanged(QString)), this, SLOT(onKeywordChanged(QString))); |
|
|
|
|
|
|
|
connect(mpLevel, SIGNAL(currentIndexChanged(QString)), this, SLOT(onLevelChanged(QString))); |
|
|
|
|
|
|
|
connect(mpTopic, SIGNAL(currentIndexChanged(QString)), this, SLOT(onTopicChanged(QString))); |
|
|
|
|
|
|
|
connect(mpAuthor, SIGNAL(textChanged(QString)), this, SLOT(onAuthorChanged(QString))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBTBDocumentEditWidget::~UBTBDocumentEditWidget() |
|
|
|
UBTBDocumentEditWidget::~UBTBDocumentEditWidget() |
|
|
@ -90,6 +129,14 @@ UBTBDocumentEditWidget::~UBTBDocumentEditWidget() |
|
|
|
DELETEPTR(mpTargetLabel); |
|
|
|
DELETEPTR(mpTargetLabel); |
|
|
|
DELETEPTR(mpTarget); |
|
|
|
DELETEPTR(mpTarget); |
|
|
|
DELETEPTR(mpMetadataLabel); |
|
|
|
DELETEPTR(mpMetadataLabel); |
|
|
|
|
|
|
|
DELETEPTR(mpKeywordLabel); |
|
|
|
|
|
|
|
DELETEPTR(mpLevelLabel); |
|
|
|
|
|
|
|
DELETEPTR(mpTopicLabel); |
|
|
|
|
|
|
|
DELETEPTR(mpAuthorLabel); |
|
|
|
|
|
|
|
DELETEPTR(mpKeywords); |
|
|
|
|
|
|
|
DELETEPTR(mpLevel); |
|
|
|
|
|
|
|
DELETEPTR(mpTopic); |
|
|
|
|
|
|
|
DELETEPTR(mpAuthor); |
|
|
|
DELETEPTR(mpLicenseLabel); |
|
|
|
DELETEPTR(mpLicenseLabel); |
|
|
|
DELETEPTR(mpLicenseCombox); |
|
|
|
DELETEPTR(mpLicenseCombox); |
|
|
|
DELETEPTR(mpPageViewButton); |
|
|
|
DELETEPTR(mpPageViewButton); |
|
|
@ -128,6 +175,10 @@ void UBTBDocumentEditWidget::updateFields() |
|
|
|
{ |
|
|
|
{ |
|
|
|
mpTitle->setText(mpDataMgr->sessionTitle()); |
|
|
|
mpTitle->setText(mpDataMgr->sessionTitle()); |
|
|
|
mpTarget->setPlainText(mpDataMgr->sessionTarget()); |
|
|
|
mpTarget->setPlainText(mpDataMgr->sessionTarget()); |
|
|
|
|
|
|
|
mpKeywords->setText(mpDataMgr->keywords()); |
|
|
|
|
|
|
|
// TODO: retrieve the level
|
|
|
|
|
|
|
|
// TODO retrieve the topic
|
|
|
|
|
|
|
|
mpAuthor->setText(mpDataMgr->authors()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBTBDocumentEditWidget::clearFields() |
|
|
|
void UBTBDocumentEditWidget::clearFields() |
|
|
@ -136,4 +187,26 @@ void UBTBDocumentEditWidget::clearFields() |
|
|
|
mpTarget->setPlainText(""); |
|
|
|
mpTarget->setPlainText(""); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTBDocumentEditWidget::onKeywordChanged(const QString &kw) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mpDataMgr->setKeywords(kw); |
|
|
|
|
|
|
|
emit valueChanged(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTBDocumentEditWidget::onLevelChanged(const QString &level) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mpDataMgr->setLevel(level); |
|
|
|
|
|
|
|
emit valueChanged(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTBDocumentEditWidget::onTopicChanged(const QString &topic) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mpDataMgr->setTopic(topic); |
|
|
|
|
|
|
|
emit valueChanged(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTBDocumentEditWidget::onAuthorChanged(const QString &authors) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mpDataMgr->setAuthors(authors); |
|
|
|
|
|
|
|
emit valueChanged(); |
|
|
|
|
|
|
|
} |
|
|
|