|
|
@ -17,23 +17,18 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include "customWidgets/UBDraggableLabel.h" |
|
|
|
#include "customWidgets/UBDraggableLabel.h" |
|
|
|
#include "customWidgets/UBMediaWidget.h" |
|
|
|
#include "customWidgets/UBMediaWidget.h" |
|
|
|
|
|
|
|
#include "customWidgets/UBGlobals.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "core/memcheck.h" |
|
|
|
#include "core/memcheck.h" |
|
|
|
|
|
|
|
|
|
|
|
UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDockPaletteWidget(parent) |
|
|
|
UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDockPaletteWidget(parent) |
|
|
|
, mpLayout(NULL) |
|
|
|
, mpLayout(NULL) |
|
|
|
, mpTitleLayout(NULL) |
|
|
|
, mpTitleLayout(NULL) |
|
|
|
, mpDurationLayout(NULL) |
|
|
|
|
|
|
|
, mpTitleLabel(NULL) |
|
|
|
, mpTitleLabel(NULL) |
|
|
|
, mpDurationLabel(NULL) |
|
|
|
|
|
|
|
, mpTitle(NULL) |
|
|
|
, mpTitle(NULL) |
|
|
|
, mpMediaLabel(NULL) |
|
|
|
, mpMediaLabel(NULL) |
|
|
|
, mpContainer(NULL) |
|
|
|
, mpContainer(NULL) |
|
|
|
, mpContainerLayout(NULL) |
|
|
|
, mpContainerLayout(NULL) |
|
|
|
, mpDuration1(NULL) |
|
|
|
|
|
|
|
, mpDuration2(NULL) |
|
|
|
|
|
|
|
, mpDuration3(NULL) |
|
|
|
|
|
|
|
, mpDurationButtons(NULL) |
|
|
|
|
|
|
|
, mpActionLabel(NULL) |
|
|
|
, mpActionLabel(NULL) |
|
|
|
, mpActions(NULL) |
|
|
|
, mpActions(NULL) |
|
|
|
, mpActionButton(NULL) |
|
|
|
, mpActionButton(NULL) |
|
|
@ -47,6 +42,8 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock |
|
|
|
, mpStackWidget(NULL) |
|
|
|
, mpStackWidget(NULL) |
|
|
|
, mpPreview(NULL) |
|
|
|
, mpPreview(NULL) |
|
|
|
, mpMediaContainer(NULL) |
|
|
|
, mpMediaContainer(NULL) |
|
|
|
|
|
|
|
, mpDocPreviewWidget(NULL) |
|
|
|
|
|
|
|
, mpDocEditWidget(NULL) |
|
|
|
{ |
|
|
|
{ |
|
|
|
setObjectName(name); |
|
|
|
setObjectName(name); |
|
|
|
mName = "TeacherBarWidget"; |
|
|
|
mName = "TeacherBarWidget"; |
|
|
@ -68,11 +65,15 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock |
|
|
|
mpContainer->setObjectName("DockPaletteWidgetBox"); |
|
|
|
mpContainer->setObjectName("DockPaletteWidgetBox"); |
|
|
|
|
|
|
|
|
|
|
|
mpPreview = new UBTeacherBarPreviewWidget(this); |
|
|
|
mpPreview = new UBTeacherBarPreviewWidget(this); |
|
|
|
|
|
|
|
mpDocPreviewWidget = new UBTBDocumentPreviewWidget(this); |
|
|
|
|
|
|
|
mpDocEditWidget = new UBTBDocumentEditWidget(this); |
|
|
|
|
|
|
|
|
|
|
|
mpStackWidget = new QStackedWidget(this); |
|
|
|
mpStackWidget = new QStackedWidget(this); |
|
|
|
mpContainerLayout->addWidget(mpStackWidget); |
|
|
|
mpContainerLayout->addWidget(mpStackWidget); |
|
|
|
mpStackWidget->addWidget(mpContainer); |
|
|
|
mpStackWidget->addWidget(mpContainer); |
|
|
|
mpStackWidget->addWidget(mpPreview); |
|
|
|
mpStackWidget->addWidget(mpPreview); |
|
|
|
|
|
|
|
mpStackWidget->addWidget(mpDocPreviewWidget); |
|
|
|
|
|
|
|
mpStackWidget->addWidget(mpDocEditWidget); |
|
|
|
|
|
|
|
|
|
|
|
mpLayout = new QVBoxLayout(mpContainer); |
|
|
|
mpLayout = new QVBoxLayout(mpContainer); |
|
|
|
mpContainer->setLayout(mpLayout); |
|
|
|
mpContainer->setLayout(mpLayout); |
|
|
@ -85,26 +86,6 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock |
|
|
|
mpLayout->addWidget(mpTitleLabel, 0); |
|
|
|
mpLayout->addWidget(mpTitleLabel, 0); |
|
|
|
mpLayout->addWidget(mpTitle, 0); |
|
|
|
mpLayout->addWidget(mpTitle, 0); |
|
|
|
|
|
|
|
|
|
|
|
// Duration
|
|
|
|
|
|
|
|
mpDurationLabel = new QLabel(tr("Duration"), mpContainer); |
|
|
|
|
|
|
|
mpLayout->addWidget(mpDurationLabel, 0); |
|
|
|
|
|
|
|
mpDurationLayout = new QHBoxLayout(); |
|
|
|
|
|
|
|
mpDuration1 = new QCheckBox(this); |
|
|
|
|
|
|
|
mpDuration1->setIcon(QIcon(":images/duration1.png")); |
|
|
|
|
|
|
|
mpDuration1->setChecked(true); |
|
|
|
|
|
|
|
mpDurationLayout->addWidget(mpDuration1, 0); |
|
|
|
|
|
|
|
mpDuration2 = new QCheckBox(this); |
|
|
|
|
|
|
|
mpDuration2->setIcon(QIcon(":images/duration2.png")); |
|
|
|
|
|
|
|
mpDurationLayout->addWidget(mpDuration2, 0); |
|
|
|
|
|
|
|
mpDuration3 = new QCheckBox(this); |
|
|
|
|
|
|
|
mpDuration3->setIcon(QIcon(":images/duration3.png")); |
|
|
|
|
|
|
|
mpDurationLayout->addWidget(mpDuration3, 0); |
|
|
|
|
|
|
|
mpDurationButtons = new QButtonGroup(mpContainer); |
|
|
|
|
|
|
|
mpDurationButtons->addButton(mpDuration1); |
|
|
|
|
|
|
|
mpDurationButtons->addButton(mpDuration2); |
|
|
|
|
|
|
|
mpDurationButtons->addButton(mpDuration3); |
|
|
|
|
|
|
|
mpLayout->addLayout(mpDurationLayout, 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Actions
|
|
|
|
// Actions
|
|
|
|
mpActionLabel = new QLabel(tr("Actions"), mpContainer); |
|
|
|
mpActionLabel = new QLabel(tr("Actions"), mpContainer); |
|
|
|
mpLayout->addWidget(mpActionLabel, 0); |
|
|
|
mpLayout->addWidget(mpActionLabel, 0); |
|
|
@ -154,110 +135,35 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock |
|
|
|
connect(mpLinkButton, SIGNAL(clicked()), this, SLOT(onLinkButton())); |
|
|
|
connect(mpLinkButton, SIGNAL(clicked()), this, SLOT(onLinkButton())); |
|
|
|
connect(mpPreview, SIGNAL(showEditMode()), this, SLOT(onShowEditMode())); |
|
|
|
connect(mpPreview, SIGNAL(showEditMode()), this, SLOT(onShowEditMode())); |
|
|
|
connect(mpMediaContainer, SIGNAL(mediaDropped(QString)), this, SLOT(onMediaDropped(QString))); |
|
|
|
connect(mpMediaContainer, SIGNAL(mediaDropped(QString)), this, SLOT(onMediaDropped(QString))); |
|
|
|
|
|
|
|
connect(mpDocPreviewWidget, SIGNAL(onEditClicked()), this, SLOT(onTBStateChanged(eTeacherBarState))); |
|
|
|
|
|
|
|
connect(mpDocPreviewWidget, SIGNAL(onPageViewClicked()), this, SLOT(onTBStateChanged(eTeacherBarState))); |
|
|
|
|
|
|
|
connect(mpDocEditWidget, SIGNAL(onPageViewClicked()), this, SLOT(onTBStateChanged(eTeacherBarState))); |
|
|
|
|
|
|
|
connect(mpDocEditWidget, SIGNAL(onPreviewClicked()), this, SLOT(onTBStateChanged(eTeacherBarState))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBTeacherBarWidget::~UBTeacherBarWidget() |
|
|
|
UBTeacherBarWidget::~UBTeacherBarWidget() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(NULL != mpMediaContainer){ |
|
|
|
DELETEPTR(mpDocPreviewWidget); |
|
|
|
delete mpMediaContainer; |
|
|
|
DELETEPTR(mpDocEditWidget); |
|
|
|
mpMediaContainer = NULL; |
|
|
|
DELETEPTR(mpMediaContainer); |
|
|
|
} |
|
|
|
DELETEPTR(mpComments); |
|
|
|
if(NULL != mpComments){ |
|
|
|
DELETEPTR(mpCommentLabel); |
|
|
|
delete mpComments; |
|
|
|
DELETEPTR(mpLinks); |
|
|
|
mpComments = NULL; |
|
|
|
DELETEPTR(mpLinkLabel); |
|
|
|
} |
|
|
|
DELETEPTR(mpLinkButton); |
|
|
|
if(NULL != mpCommentLabel){ |
|
|
|
DELETEPTR(mpLinkLayout); |
|
|
|
delete mpCommentLabel; |
|
|
|
DELETEPTR(mpMediaLabel); |
|
|
|
mpCommentLabel = NULL; |
|
|
|
DELETEPTR(mpActionButton); |
|
|
|
} |
|
|
|
DELETEPTR(mpActionLayout); |
|
|
|
if(NULL != mpLinks){ |
|
|
|
DELETEPTR(mpActionLabel); |
|
|
|
delete mpLinks; |
|
|
|
DELETEPTR(mpTitleLabel); |
|
|
|
mpLinks = NULL; |
|
|
|
DELETEPTR(mpTitle); |
|
|
|
} |
|
|
|
DELETEPTR(mpTitleLayout); |
|
|
|
if(NULL != mpLinkLabel){ |
|
|
|
DELETEPTR(mpLayout); |
|
|
|
delete mpLinkLabel; |
|
|
|
DELETEPTR(mpContainer); |
|
|
|
mpLinkLabel = NULL; |
|
|
|
DELETEPTR(mpContainerLayout); |
|
|
|
} |
|
|
|
DELETEPTR(mpPreview); |
|
|
|
if(NULL != mpLinkButton){ |
|
|
|
DELETEPTR(mpStackWidget); |
|
|
|
delete mpLinkButton; |
|
|
|
|
|
|
|
mpLinkButton = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpLinkLayout){ |
|
|
|
|
|
|
|
delete mpLinkLayout; |
|
|
|
|
|
|
|
mpLinkLayout = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpMediaLabel){ |
|
|
|
|
|
|
|
delete mpMediaLabel; |
|
|
|
|
|
|
|
mpMediaLabel = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpActionButton){ |
|
|
|
|
|
|
|
delete mpActionButton; |
|
|
|
|
|
|
|
mpActionButton = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpActionLayout){ |
|
|
|
|
|
|
|
delete mpActionLayout; |
|
|
|
|
|
|
|
mpActionLayout = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpActionLabel){ |
|
|
|
|
|
|
|
delete mpActionLabel; |
|
|
|
|
|
|
|
mpActionLabel = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpDurationLabel){ |
|
|
|
|
|
|
|
delete mpDurationLabel; |
|
|
|
|
|
|
|
mpDurationLabel = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpDuration1){ |
|
|
|
|
|
|
|
delete mpDuration1; |
|
|
|
|
|
|
|
mpDuration1 = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpDuration2){ |
|
|
|
|
|
|
|
delete mpDuration2; |
|
|
|
|
|
|
|
mpDuration2 = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpDuration3){ |
|
|
|
|
|
|
|
delete mpDuration3; |
|
|
|
|
|
|
|
mpDuration3 = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpDurationButtons){ |
|
|
|
|
|
|
|
delete mpDurationButtons; |
|
|
|
|
|
|
|
mpDurationButtons = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpDurationLayout){ |
|
|
|
|
|
|
|
delete mpDurationLayout; |
|
|
|
|
|
|
|
mpDurationLayout = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpTitleLabel){ |
|
|
|
|
|
|
|
delete mpTitleLabel; |
|
|
|
|
|
|
|
mpTitleLabel = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpTitle){ |
|
|
|
|
|
|
|
delete mpTitle; |
|
|
|
|
|
|
|
mpTitle = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpTitleLayout){ |
|
|
|
|
|
|
|
delete mpTitleLayout; |
|
|
|
|
|
|
|
mpTitleLayout = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpLayout){ |
|
|
|
|
|
|
|
delete mpLayout; |
|
|
|
|
|
|
|
mpLayout = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpContainer){ |
|
|
|
|
|
|
|
delete mpContainer; |
|
|
|
|
|
|
|
mpContainer = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpContainerLayout){ |
|
|
|
|
|
|
|
delete mpContainerLayout; |
|
|
|
|
|
|
|
mpContainerLayout = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpPreview){ |
|
|
|
|
|
|
|
delete mpPreview; |
|
|
|
|
|
|
|
mpPreview = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpStackWidget){ |
|
|
|
|
|
|
|
delete mpStackWidget; |
|
|
|
|
|
|
|
mpStackWidget = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarWidget::onValueChanged() |
|
|
|
void UBTeacherBarWidget::onValueChanged() |
|
|
@ -281,14 +187,7 @@ void UBTeacherBarWidget::saveContent() |
|
|
|
sTeacherBarInfos infos; |
|
|
|
sTeacherBarInfos infos; |
|
|
|
// Title
|
|
|
|
// Title
|
|
|
|
infos.title = mpTitle->text(); |
|
|
|
infos.title = mpTitle->text(); |
|
|
|
// Duration
|
|
|
|
|
|
|
|
if(mpDuration1->isChecked()){ |
|
|
|
|
|
|
|
infos.Duration = eDuration_Quarter; |
|
|
|
|
|
|
|
}else if(mpDuration2->isChecked()){ |
|
|
|
|
|
|
|
infos.Duration = eDuration_Half; |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
infos.Duration = eDuration_ThreeQuarter; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// Actions
|
|
|
|
// Actions
|
|
|
|
for(int i=0; i<mActionList.size(); i++){ |
|
|
|
for(int i=0; i<mActionList.size(); i++){ |
|
|
|
infos.actions << QString("%0;%1").arg(mActionList.at(i)->comboValue()).arg(mActionList.at(i)->text()); |
|
|
|
infos.actions << QString("%0;%1").arg(mActionList.at(i)->comboValue()).arg(mActionList.at(i)->text()); |
|
|
@ -316,17 +215,7 @@ void UBTeacherBarWidget::loadContent() |
|
|
|
sTeacherBarInfos nextInfos = UBPersistenceManager::persistenceManager()->getTeacherBarInfos(UBApplication::boardController->activeDocument(), UBApplication::boardController->activeSceneIndex()); |
|
|
|
sTeacherBarInfos nextInfos = UBPersistenceManager::persistenceManager()->getTeacherBarInfos(UBApplication::boardController->activeDocument(), UBApplication::boardController->activeSceneIndex()); |
|
|
|
// Title
|
|
|
|
// Title
|
|
|
|
mpTitle->setText(nextInfos.title); |
|
|
|
mpTitle->setText(nextInfos.title); |
|
|
|
// Duration
|
|
|
|
|
|
|
|
switch(nextInfos.Duration){ |
|
|
|
|
|
|
|
case eDuration_Quarter: mpDuration1->setChecked(true); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case eDuration_Half: mpDuration2->setChecked(true); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case eDuration_ThreeQuarter: mpDuration3->setChecked(true); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: mpDuration1->setChecked(true); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// Actions
|
|
|
|
// Actions
|
|
|
|
for(int i=0; i<nextInfos.actions.size(); i++){ |
|
|
|
for(int i=0; i<nextInfos.actions.size(); i++){ |
|
|
|
QStringList qslAction = nextInfos.actions.at(i).split(";"); |
|
|
|
QStringList qslAction = nextInfos.actions.at(i).split(";"); |
|
|
@ -372,13 +261,6 @@ void UBTeacherBarWidget::loadContent() |
|
|
|
mpPreview->mediaViewer()->loadMedia(nextInfos.medias); |
|
|
|
mpPreview->mediaViewer()->loadMedia(nextInfos.medias); |
|
|
|
|
|
|
|
|
|
|
|
mpStackWidget->setCurrentWidget(mpPreview); |
|
|
|
mpStackWidget->setCurrentWidget(mpPreview); |
|
|
|
if(mpDuration1->isChecked()){ |
|
|
|
|
|
|
|
mpPreview->setDuration(eDuration_Quarter); |
|
|
|
|
|
|
|
}else if(mpDuration2->isChecked()){ |
|
|
|
|
|
|
|
mpPreview->setDuration(eDuration_Half); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
mpPreview->setDuration(eDuration_ThreeQuarter); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
mpPreview->clean(); |
|
|
|
mpPreview->clean(); |
|
|
|
|
|
|
|
|
|
|
|
// Add the actions
|
|
|
|
// Add the actions
|
|
|
@ -498,6 +380,24 @@ void UBTeacherBarWidget::onMediaDropped(const QString &url) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarWidget::onTBStateChanged(eTeacherBarState state) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
switch(state){ |
|
|
|
|
|
|
|
case eTeacherBarState_DocumentEdit: |
|
|
|
|
|
|
|
mpStackWidget->setCurrentWidget(mpDocEditWidget); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case eTeacherBarState_DocumentPreview: |
|
|
|
|
|
|
|
mpStackWidget->setCurrentWidget(mpDocPreviewWidget); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case eTeacherBarState_PageEdit: |
|
|
|
|
|
|
|
mpStackWidget->setCurrentWidget(mpContainer); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case eTeacherBarState_PagePreview: |
|
|
|
|
|
|
|
mpStackWidget->setCurrentWidget(mpPreview); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------------------------
|
|
|
|
// ---------------------------------------------------------------------------------------------
|
|
|
|
UBTeacherStudentAction::UBTeacherStudentAction(QWidget *parent, const char *name):QWidget(parent) |
|
|
|
UBTeacherStudentAction::UBTeacherStudentAction(QWidget *parent, const char *name):QWidget(parent) |
|
|
|
, mpText(NULL) |
|
|
|
, mpText(NULL) |
|
|
@ -536,22 +436,10 @@ UBTeacherStudentAction::UBTeacherStudentAction(QWidget *parent, const char *name |
|
|
|
|
|
|
|
|
|
|
|
UBTeacherStudentAction::~UBTeacherStudentAction() |
|
|
|
UBTeacherStudentAction::~UBTeacherStudentAction() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(NULL != mpCombo){ |
|
|
|
DELETEPTR(mpCombo); |
|
|
|
delete mpCombo; |
|
|
|
DELETEPTR(mpText); |
|
|
|
mpCombo = NULL; |
|
|
|
DELETEPTR(mpComboLayout); |
|
|
|
} |
|
|
|
DELETEPTR(mpLayout); |
|
|
|
if(NULL != mpText){ |
|
|
|
|
|
|
|
delete mpText; |
|
|
|
|
|
|
|
mpText = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpComboLayout){ |
|
|
|
|
|
|
|
delete mpComboLayout; |
|
|
|
|
|
|
|
mpComboLayout = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpLayout){ |
|
|
|
|
|
|
|
delete mpLayout; |
|
|
|
|
|
|
|
mpLayout = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString UBTeacherStudentAction::text() |
|
|
|
QString UBTeacherStudentAction::text() |
|
|
@ -623,34 +511,13 @@ UBUrlWidget::UBUrlWidget(QWidget *parent, const char *name):QWidget(parent) |
|
|
|
|
|
|
|
|
|
|
|
UBUrlWidget::~UBUrlWidget() |
|
|
|
UBUrlWidget::~UBUrlWidget() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(NULL != mpTitle){ |
|
|
|
DELETEPTR(mpTitle); |
|
|
|
delete mpTitle; |
|
|
|
DELETEPTR(mpTitleLabel); |
|
|
|
mpTitle = NULL; |
|
|
|
DELETEPTR(mpUrlLabel); |
|
|
|
} |
|
|
|
DELETEPTR(mpUrl); |
|
|
|
if(NULL != mpTitleLabel){ |
|
|
|
DELETEPTR(mpTitleLayout); |
|
|
|
delete mpTitleLabel; |
|
|
|
DELETEPTR(mpLabelLayout); |
|
|
|
mpTitleLabel = NULL; |
|
|
|
DELETEPTR(mpLayout); |
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpUrlLabel){ |
|
|
|
|
|
|
|
delete mpUrlLabel; |
|
|
|
|
|
|
|
mpUrlLabel = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpUrl){ |
|
|
|
|
|
|
|
delete mpUrl; |
|
|
|
|
|
|
|
mpUrl = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpTitleLayout){ |
|
|
|
|
|
|
|
delete mpTitleLayout; |
|
|
|
|
|
|
|
mpTitleLayout = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpLabelLayout){ |
|
|
|
|
|
|
|
delete mpLabelLayout; |
|
|
|
|
|
|
|
mpLabelLayout = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpLayout){ |
|
|
|
|
|
|
|
delete mpLayout; |
|
|
|
|
|
|
|
mpLayout = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString UBUrlWidget::url() |
|
|
|
QString UBUrlWidget::url() |
|
|
@ -683,6 +550,7 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(QWidget *parent, const char |
|
|
|
, mpCommentsLabel(NULL) |
|
|
|
, mpCommentsLabel(NULL) |
|
|
|
, mpComments(NULL) |
|
|
|
, mpComments(NULL) |
|
|
|
, mpLinksLabel(NULL) |
|
|
|
, mpLinksLabel(NULL) |
|
|
|
|
|
|
|
, mpContentContainer(NULL) |
|
|
|
{ |
|
|
|
{ |
|
|
|
setObjectName(name); |
|
|
|
setObjectName(name); |
|
|
|
|
|
|
|
|
|
|
@ -702,7 +570,9 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(QWidget *parent, const char |
|
|
|
mTitleDurationLayout.addWidget(mpDuration, 1); |
|
|
|
mTitleDurationLayout.addWidget(mpDuration, 1); |
|
|
|
mLayout.addLayout(&mTitleDurationLayout, 0); |
|
|
|
mLayout.addLayout(&mTitleDurationLayout, 0); |
|
|
|
|
|
|
|
|
|
|
|
mLayout.addWidget(&mMediaViewer, 1); |
|
|
|
mpContentContainer = new UBTBPreviewContainer(this); |
|
|
|
|
|
|
|
mLayout.addWidget(mpContentContainer, 1); |
|
|
|
|
|
|
|
//mLayout.addWidget(&mMediaViewer, 1);
|
|
|
|
// The next line is disgusting. This is a quickfix that must be reworked later
|
|
|
|
// The next line is disgusting. This is a quickfix that must be reworked later
|
|
|
|
mMediaViewer.setContentsMargins(-9, -9, -9, -9); |
|
|
|
mMediaViewer.setContentsMargins(-9, -9, -9, -9); |
|
|
|
|
|
|
|
|
|
|
@ -722,38 +592,15 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(QWidget *parent, const char |
|
|
|
|
|
|
|
|
|
|
|
UBTeacherBarPreviewWidget::~UBTeacherBarPreviewWidget() |
|
|
|
UBTeacherBarPreviewWidget::~UBTeacherBarPreviewWidget() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(NULL != mpLinksLabel){ |
|
|
|
DELETEPTR(mpLinksLabel); |
|
|
|
delete mpLinksLabel; |
|
|
|
DELETEPTR(mpComments); |
|
|
|
mpLinksLabel = NULL; |
|
|
|
DELETEPTR(mpTitle); |
|
|
|
} |
|
|
|
DELETEPTR(mpDuration); |
|
|
|
if(NULL != mpComments){ |
|
|
|
DELETEPTR(mpActionsLabel); |
|
|
|
delete mpComments; |
|
|
|
DELETEPTR(mpMediaLabel); |
|
|
|
mpComments = NULL; |
|
|
|
DELETEPTR(mpCommentsLabel); |
|
|
|
} |
|
|
|
DELETEPTR(mpContentContainer); |
|
|
|
if(NULL != mpTitle){ |
|
|
|
DELETEPTR(mpEditButton); |
|
|
|
delete mpTitle; |
|
|
|
|
|
|
|
mpTitle = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpDuration){ |
|
|
|
|
|
|
|
delete mpDuration; |
|
|
|
|
|
|
|
mpDuration = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpActionsLabel){ |
|
|
|
|
|
|
|
delete mpActionsLabel; |
|
|
|
|
|
|
|
mpActionsLabel = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpMediaLabel){ |
|
|
|
|
|
|
|
delete mpMediaLabel; |
|
|
|
|
|
|
|
mpMediaLabel = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpCommentsLabel){ |
|
|
|
|
|
|
|
delete mpCommentsLabel; |
|
|
|
|
|
|
|
mpCommentsLabel = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpEditButton){ |
|
|
|
|
|
|
|
delete mpEditButton; |
|
|
|
|
|
|
|
mpEditButton = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarPreviewWidget::onEdit() |
|
|
|
void UBTeacherBarPreviewWidget::onEdit() |
|
|
@ -807,6 +654,13 @@ void UBTeacherBarPreviewWidget::setComments(const QString &comments) |
|
|
|
void UBTeacherBarPreviewWidget::clean() |
|
|
|
void UBTeacherBarPreviewWidget::clean() |
|
|
|
{ |
|
|
|
{ |
|
|
|
mMediaViewer.cleanMedia(); |
|
|
|
mMediaViewer.cleanMedia(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach(QWidget* eachWidget, mStoredWidgets){ |
|
|
|
|
|
|
|
delete eachWidget; |
|
|
|
|
|
|
|
eachWidget = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
mStoredWidgets.clear(); |
|
|
|
|
|
|
|
|
|
|
|
hideElements(); |
|
|
|
hideElements(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -883,11 +737,7 @@ UBTeacherBarPreviewMedia::UBTeacherBarPreviewMedia(QWidget* parent, const char* |
|
|
|
|
|
|
|
|
|
|
|
UBTeacherBarPreviewMedia::~UBTeacherBarPreviewMedia() |
|
|
|
UBTeacherBarPreviewMedia::~UBTeacherBarPreviewMedia() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(mWidget){ |
|
|
|
DELETEPTR(mWidget); |
|
|
|
delete mWidget; |
|
|
|
|
|
|
|
mWidget = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarPreviewMedia::cleanMedia() |
|
|
|
void UBTeacherBarPreviewMedia::cleanMedia() |
|
|
@ -1119,3 +969,97 @@ QWidget* UBTBMediaContainer::generateMediaWidget(const QString& url) |
|
|
|
|
|
|
|
|
|
|
|
return pW; |
|
|
|
return pW; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
UBTBPreviewContainer::UBTBPreviewContainer(QWidget *parent, const char *name):UBWidgetList(parent) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
setObjectName(name); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UBTBPreviewContainer::~UBTBPreviewContainer() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
UBTBDocumentEditWidget::UBTBDocumentEditWidget(QWidget *parent, const char *name):QWidget(parent) |
|
|
|
|
|
|
|
, mpPageViewButton(NULL) |
|
|
|
|
|
|
|
, mpPreviewButton(NULL) |
|
|
|
|
|
|
|
, mpTitleLabel(NULL) |
|
|
|
|
|
|
|
, mpTitle(NULL) |
|
|
|
|
|
|
|
, mpTargetLabel(NULL) |
|
|
|
|
|
|
|
, mpTarget(NULL) |
|
|
|
|
|
|
|
, mpMetadataLabel(NULL) |
|
|
|
|
|
|
|
, mpLicenseLabel(NULL) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
setObjectName(name); |
|
|
|
|
|
|
|
setLayout(&mLayout); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mpPageViewButton = new QPushButton(tr("Page View"), this); |
|
|
|
|
|
|
|
mPageLayout.addStretch(1); |
|
|
|
|
|
|
|
mPageLayout.addWidget(mpPageViewButton, 0); |
|
|
|
|
|
|
|
mPageLayout.addStretch(1); |
|
|
|
|
|
|
|
mLayout.addLayout(&mPageLayout); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mpTitleLabel = new QLabel(tr("Session Title:"), this); |
|
|
|
|
|
|
|
mpTitleLabel->setAlignment(Qt::AlignLeft); |
|
|
|
|
|
|
|
mLayout.addWidget(mpTitleLabel); |
|
|
|
|
|
|
|
mpTitle = new QLineEdit(this); |
|
|
|
|
|
|
|
mLayout.addWidget(mpTitle); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mpPreviewButton = new QPushButton(tr("Preview"), this); |
|
|
|
|
|
|
|
mPreviewLayout.addStretch(1); |
|
|
|
|
|
|
|
mPreviewLayout.addWidget(mpPreviewButton, 0); |
|
|
|
|
|
|
|
mPreviewLayout.addStretch(1); |
|
|
|
|
|
|
|
mLayout.addLayout(&mPreviewLayout); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connect(mpPageViewButton, SIGNAL(clicked()), this, SIGNAL(onPageViewClicked())); |
|
|
|
|
|
|
|
connect(mpPreviewButton, SIGNAL(clicked()), this, SIGNAL(onPreviewClicked())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UBTBDocumentEditWidget::~UBTBDocumentEditWidget() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DELETEPTR(mpTitleLabel); |
|
|
|
|
|
|
|
DELETEPTR(mpTitle); |
|
|
|
|
|
|
|
DELETEPTR(mpTargetLabel); |
|
|
|
|
|
|
|
DELETEPTR(mpTarget); |
|
|
|
|
|
|
|
DELETEPTR(mpMetadataLabel); |
|
|
|
|
|
|
|
DELETEPTR(mpLicenseLabel); |
|
|
|
|
|
|
|
DELETEPTR(mpPageViewButton); |
|
|
|
|
|
|
|
DELETEPTR(mpPreviewButton); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
UBTBDocumentPreviewWidget::UBTBDocumentPreviewWidget(QWidget *parent, const char *name):QWidget(parent) |
|
|
|
|
|
|
|
, mpPageViewButton(NULL) |
|
|
|
|
|
|
|
, mpEditButton(NULL) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
setObjectName(name); |
|
|
|
|
|
|
|
setLayout(&mLayout); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mpPageViewButton = new QPushButton(tr("Page View"), this); |
|
|
|
|
|
|
|
mPageLayout.addStretch(1); |
|
|
|
|
|
|
|
mPageLayout.addWidget(mpPageViewButton, 0); |
|
|
|
|
|
|
|
mPageLayout.addStretch(1); |
|
|
|
|
|
|
|
mLayout.addLayout(&mPageLayout); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO : Add the elements here
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mpEditButton = new QPushButton(tr("Edit"), this); |
|
|
|
|
|
|
|
mPreviewLayout.addStretch(1); |
|
|
|
|
|
|
|
mPreviewLayout.addWidget(mpEditButton, 0); |
|
|
|
|
|
|
|
mPreviewLayout.addStretch(1); |
|
|
|
|
|
|
|
mLayout.addLayout(&mPreviewLayout); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connect(mpPageViewButton, SIGNAL(clicked()), this, SIGNAL(onPageViewClicked())); |
|
|
|
|
|
|
|
connect(mpEditButton, SIGNAL(clicked()), this, SIGNAL(onEditClicked())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UBTBDocumentPreviewWidget::~UBTBDocumentPreviewWidget() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DELETEPTR(mpPageViewButton); |
|
|
|
|
|
|
|
DELETEPTR(mpEditButton); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|