|
|
@ -43,6 +43,7 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock |
|
|
|
, mpLinkButton(NULL) |
|
|
|
, mpLinkButton(NULL) |
|
|
|
, mpLinkLayout(NULL) |
|
|
|
, mpLinkLayout(NULL) |
|
|
|
, mpStackWidget(NULL) |
|
|
|
, mpStackWidget(NULL) |
|
|
|
|
|
|
|
, mpPreview(NULL) |
|
|
|
{ |
|
|
|
{ |
|
|
|
setObjectName(name); |
|
|
|
setObjectName(name); |
|
|
|
mName = "TeacherBarWidget"; |
|
|
|
mName = "TeacherBarWidget"; |
|
|
@ -63,9 +64,12 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock |
|
|
|
mpContainer = new QWidget(this); |
|
|
|
mpContainer = new QWidget(this); |
|
|
|
mpContainer->setObjectName("DockPaletteWidgetBox"); |
|
|
|
mpContainer->setObjectName("DockPaletteWidgetBox"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mpPreview = new UBTeacherBarPreviewWidget(this); |
|
|
|
|
|
|
|
|
|
|
|
mpStackWidget = new QStackedWidget(this); |
|
|
|
mpStackWidget = new QStackedWidget(this); |
|
|
|
mpContainerLayout->addWidget(mpStackWidget); |
|
|
|
mpContainerLayout->addWidget(mpStackWidget); |
|
|
|
mpStackWidget->addWidget(mpContainer); |
|
|
|
mpStackWidget->addWidget(mpContainer); |
|
|
|
|
|
|
|
mpStackWidget->addWidget(mpPreview); |
|
|
|
|
|
|
|
|
|
|
|
mpLayout = new QVBoxLayout(mpContainer); |
|
|
|
mpLayout = new QVBoxLayout(mpContainer); |
|
|
|
mpContainer->setLayout(mpLayout); |
|
|
|
mpContainer->setLayout(mpLayout); |
|
|
@ -144,6 +148,7 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock |
|
|
|
connect(mpTitle, SIGNAL(textChanged(QString)), this, SLOT(onValueChanged())); |
|
|
|
connect(mpTitle, SIGNAL(textChanged(QString)), this, SLOT(onValueChanged())); |
|
|
|
connect(mpActionButton, SIGNAL(clicked()), this, SLOT(onActionButton())); |
|
|
|
connect(mpActionButton, SIGNAL(clicked()), this, SLOT(onActionButton())); |
|
|
|
connect(mpLinkButton, SIGNAL(clicked()), this, SLOT(onLinkButton())); |
|
|
|
connect(mpLinkButton, SIGNAL(clicked()), this, SLOT(onLinkButton())); |
|
|
|
|
|
|
|
connect(mpPreview, SIGNAL(showEditMode()), this, SLOT(onShowEditMode())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBTeacherBarWidget::~UBTeacherBarWidget() |
|
|
|
UBTeacherBarWidget::~UBTeacherBarWidget() |
|
|
@ -240,6 +245,10 @@ UBTeacherBarWidget::~UBTeacherBarWidget() |
|
|
|
delete mpContainerLayout; |
|
|
|
delete mpContainerLayout; |
|
|
|
mpContainerLayout = NULL; |
|
|
|
mpContainerLayout = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpPreview){ |
|
|
|
|
|
|
|
delete mpPreview; |
|
|
|
|
|
|
|
mpPreview = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
if(NULL != mpStackWidget){ |
|
|
|
if(NULL != mpStackWidget){ |
|
|
|
delete mpStackWidget; |
|
|
|
delete mpStackWidget; |
|
|
|
mpStackWidget = NULL; |
|
|
|
mpStackWidget = NULL; |
|
|
@ -248,11 +257,7 @@ UBTeacherBarWidget::~UBTeacherBarWidget() |
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarWidget::onValueChanged() |
|
|
|
void UBTeacherBarWidget::onValueChanged() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( mpTitle->text() == "" && |
|
|
|
if(isEmpty()) |
|
|
|
mpLinks->empty() && |
|
|
|
|
|
|
|
mpActions->empty() && |
|
|
|
|
|
|
|
mpDropMediaZone->empty() && |
|
|
|
|
|
|
|
mpComments->document()->toPlainText() == "") |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
mIconToLeft = QPixmap(":images/teacher_open_disabled.png"); |
|
|
|
mIconToLeft = QPixmap(":images/teacher_open_disabled.png"); |
|
|
|
mIconToRight = QPixmap(":images/teacher_close_disabled.png"); |
|
|
|
mIconToRight = QPixmap(":images/teacher_close_disabled.png"); |
|
|
@ -345,6 +350,19 @@ void UBTeacherBarWidget::loadContent() |
|
|
|
if(NULL != mpComments){ |
|
|
|
if(NULL != mpComments){ |
|
|
|
mpComments->document()->setPlainText(nextInfos.comments); |
|
|
|
mpComments->document()->setPlainText(nextInfos.comments); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!isEmpty()){ |
|
|
|
|
|
|
|
mpStackWidget->setCurrentWidget(mpPreview); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool UBTeacherBarWidget::isEmpty() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return mpTitle->text() == "" && |
|
|
|
|
|
|
|
mpLinks->empty() && |
|
|
|
|
|
|
|
mpActions->empty() && |
|
|
|
|
|
|
|
mpDropMediaZone->empty() && |
|
|
|
|
|
|
|
mpComments->document()->toPlainText() == ""; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarWidget::onTitleTextChanged(const QString& text) |
|
|
|
void UBTeacherBarWidget::onTitleTextChanged(const QString& text) |
|
|
@ -385,6 +403,11 @@ void UBTeacherBarWidget::clearWidgetLists() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarWidget::onShowEditMode() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mpStackWidget->setCurrentWidget(mpContainer); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------------------------
|
|
|
|
// ---------------------------------------------------------------------------------------------
|
|
|
|
UBTeacherStudentAction::UBTeacherStudentAction(QWidget *parent, const char *name):QWidget(parent) |
|
|
|
UBTeacherStudentAction::UBTeacherStudentAction(QWidget *parent, const char *name):QWidget(parent) |
|
|
|
, mpText(NULL) |
|
|
|
, mpText(NULL) |
|
|
@ -650,3 +673,45 @@ void UBUrlWidget::setUrl(const QString &url) |
|
|
|
mpUrl->setText(url); |
|
|
|
mpUrl->setText(url); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(QWidget *parent, const char *name):QWidget(parent) |
|
|
|
|
|
|
|
, mpLayout(NULL) |
|
|
|
|
|
|
|
, mpEditButton(NULL) |
|
|
|
|
|
|
|
, mpEditLayout(NULL) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
setObjectName(name); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mpLayout = new QVBoxLayout(this); |
|
|
|
|
|
|
|
setLayout(mpLayout); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mpEditButton = new QPushButton(tr("Edit infos"), this); |
|
|
|
|
|
|
|
mpEditLayout = new QHBoxLayout(); |
|
|
|
|
|
|
|
mpEditLayout->addStretch(1); |
|
|
|
|
|
|
|
mpEditLayout->addWidget(mpEditButton, 0); |
|
|
|
|
|
|
|
mpEditLayout->addStretch(1); |
|
|
|
|
|
|
|
mpLayout->addLayout(mpEditLayout); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connect(mpEditButton, SIGNAL(clicked()), this, SLOT(onEdit())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UBTeacherBarPreviewWidget::~UBTeacherBarPreviewWidget() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if(NULL != mpEditButton){ |
|
|
|
|
|
|
|
delete mpEditButton; |
|
|
|
|
|
|
|
mpEditButton = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpEditLayout){ |
|
|
|
|
|
|
|
delete mpEditLayout; |
|
|
|
|
|
|
|
mpEditLayout = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpLayout){ |
|
|
|
|
|
|
|
delete mpLayout; |
|
|
|
|
|
|
|
mpLayout = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarPreviewWidget::onEdit() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
emit showEditMode(); |
|
|
|
|
|
|
|
} |
|
|
|