|
|
@ -243,9 +243,7 @@ UBTeacherBarWidget::~UBTeacherBarWidget() |
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarWidget::onValueChanged() |
|
|
|
void UBTeacherBarWidget::onValueChanged() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( mpTitle->text() == "" |
|
|
|
if( mpTitle->text() == "") |
|
|
|
&& mpAction1->teacherText() == "" |
|
|
|
|
|
|
|
&& mpAction1->studentText() == "") |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
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"); |
|
|
@ -279,7 +277,9 @@ void UBTeacherBarWidget::onTitleTextChanged(const QString& text) |
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarWidget::onActionButton() |
|
|
|
void UBTeacherBarWidget::onActionButton() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
UBTeacherStudentAction* pAction = new UBTeacherStudentAction(this); |
|
|
|
|
|
|
|
mActionList << pAction; |
|
|
|
|
|
|
|
mpActions->addWidget(pAction); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarWidget::onLinkButton() |
|
|
|
void UBTeacherBarWidget::onLinkButton() |
|
|
@ -287,126 +287,74 @@ void UBTeacherBarWidget::onLinkButton() |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBTeacherStudentAction::UBTeacherStudentAction(int actionNumber, QWidget *parent, const char *name):QWidget(parent) |
|
|
|
UBTeacherStudentAction::UBTeacherStudentAction(QWidget *parent, const char *name):QWidget(parent) |
|
|
|
, mpActionLabel(NULL) |
|
|
|
, mpText(NULL) |
|
|
|
, mpTeacherLabel(NULL) |
|
|
|
, mpLayout(NULL) |
|
|
|
, mpStudentLabel(NULL) |
|
|
|
, mpComboLayout(NULL) |
|
|
|
, mpTeacher(NULL) |
|
|
|
, mpCombo(NULL) |
|
|
|
, mpStudent(NULL) |
|
|
|
|
|
|
|
, mpLayout(NULL) |
|
|
|
|
|
|
|
, mpTeacherLayout(NULL) |
|
|
|
|
|
|
|
, mpStudentLayout(NULL) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
setObjectName(name); |
|
|
|
setObjectName(name); |
|
|
|
mActionNumber = actionNumber; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setAttribute(Qt::WA_StyledBackground, true); |
|
|
|
setAttribute(Qt::WA_StyledBackground, true); |
|
|
|
setStyleSheet(UBApplication::globalStyleSheet()); |
|
|
|
setStyleSheet(UBApplication::globalStyleSheet()); |
|
|
|
|
|
|
|
|
|
|
|
// Create the GUI
|
|
|
|
// Create the GUI
|
|
|
|
mpLayout = new QVBoxLayout(this); |
|
|
|
mpLayout = new QHBoxLayout(this); |
|
|
|
setLayout(mpLayout); |
|
|
|
setLayout(mpLayout); |
|
|
|
|
|
|
|
|
|
|
|
mpActionLabel = new QLabel(tr("Action %0").arg(mActionNumber), this); |
|
|
|
mpComboLayout = new QVBoxLayout(); |
|
|
|
mpLayout->addWidget(mpActionLabel, 0); |
|
|
|
|
|
|
|
|
|
|
|
mpCombo = new QComboBox(this); |
|
|
|
|
|
|
|
mpCombo->addItem(tr("Teacher")); |
|
|
|
|
|
|
|
mpCombo->addItem(tr("Student")); |
|
|
|
|
|
|
|
mpComboLayout->addWidget(0); |
|
|
|
|
|
|
|
mpComboLayout->addStretch(1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mpLayout->addLayout(mpComboLayout, 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mpText = new QTextEdit(this); |
|
|
|
|
|
|
|
mpLayout->addWidget(mpText, 1); |
|
|
|
|
|
|
|
|
|
|
|
mpTeacherLayout = new QHBoxLayout(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mpTeacherLabel = new QLabel(tr("Teacher"), this); |
|
|
|
|
|
|
|
mpTeacherLabel->setAlignment(Qt::AlignTop); |
|
|
|
|
|
|
|
mpTeacher = new QTextEdit(this); |
|
|
|
|
|
|
|
mpTeacher->setObjectName("TeacherStudentBox"); |
|
|
|
|
|
|
|
mpTeacher->setStyleSheet("background-color:#FF9F6D"); |
|
|
|
|
|
|
|
mpTeacherLayout->addWidget(mpTeacherLabel, 0); |
|
|
|
|
|
|
|
mpTeacherLayout->addWidget(mpTeacher, 1); |
|
|
|
|
|
|
|
mpLayout->addLayout(mpTeacherLayout, 1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mpStudentLayout = new QHBoxLayout(); |
|
|
|
|
|
|
|
mpStudentLabel = new QLabel(tr("Student"), this); |
|
|
|
|
|
|
|
mpStudentLabel->setAlignment(Qt::AlignTop); |
|
|
|
|
|
|
|
mpStudent = new QTextEdit(this); |
|
|
|
|
|
|
|
mpStudent->setObjectName("TeacherStudentBox"); |
|
|
|
|
|
|
|
mpStudent->setStyleSheet("background-color:#06E983"); |
|
|
|
|
|
|
|
mpStudentLayout->addWidget(mpStudentLabel, 0); |
|
|
|
|
|
|
|
mpStudentLayout->addWidget(mpStudent, 1); |
|
|
|
|
|
|
|
mpLayout->addLayout(mpStudentLayout, 1); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBTeacherStudentAction::~UBTeacherStudentAction() |
|
|
|
UBTeacherStudentAction::~UBTeacherStudentAction() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(NULL != mpActionLabel) |
|
|
|
if(NULL != mpCombo){ |
|
|
|
{ |
|
|
|
delete mpCombo; |
|
|
|
delete mpActionLabel; |
|
|
|
mpCombo = NULL; |
|
|
|
mpActionLabel = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpTeacherLabel) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
delete mpTeacherLabel; |
|
|
|
|
|
|
|
mpTeacherLabel = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpTeacher) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
delete mpTeacher; |
|
|
|
|
|
|
|
mpTeacher = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpTeacherLayout) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
delete mpTeacherLayout; |
|
|
|
|
|
|
|
mpTeacherLayout = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(NULL != mpStudentLabel) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
delete mpStudentLabel; |
|
|
|
|
|
|
|
mpStudentLabel = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if(NULL != mpStudent) |
|
|
|
if(NULL != mpText){ |
|
|
|
{ |
|
|
|
delete mpText; |
|
|
|
delete mpStudent; |
|
|
|
mpText = NULL; |
|
|
|
mpStudent = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if(NULL != mpStudentLayout) |
|
|
|
if(NULL != mpComboLayout){ |
|
|
|
{ |
|
|
|
delete mpComboLayout; |
|
|
|
delete mpStudentLayout; |
|
|
|
mpComboLayout = NULL; |
|
|
|
mpStudentLayout = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if(NULL != mpLayout) |
|
|
|
if(NULL != mpLayout){ |
|
|
|
{ |
|
|
|
|
|
|
|
delete mpLayout; |
|
|
|
delete mpLayout; |
|
|
|
mpLayout = NULL; |
|
|
|
mpLayout = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString UBTeacherStudentAction::teacherText() |
|
|
|
QString UBTeacherStudentAction::text() |
|
|
|
{ |
|
|
|
{ |
|
|
|
return mpTeacher->document()->toPlainText(); |
|
|
|
QString str; |
|
|
|
} |
|
|
|
if(NULL != mpText){ |
|
|
|
|
|
|
|
str = mpText->document()->toPlainText(); |
|
|
|
QString UBTeacherStudentAction::studentText() |
|
|
|
} |
|
|
|
{ |
|
|
|
return str; |
|
|
|
return mpStudent->document()->toPlainText(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherStudentAction::setTeacherText(QString text) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mpTeacher->setText(text); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherStudentAction::setStudentText(QString text) |
|
|
|
QString UBTeacherStudentAction::comboValue() |
|
|
|
{ |
|
|
|
{ |
|
|
|
mpStudent->setText(text); |
|
|
|
QString str; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QTextEdit* UBTeacherStudentAction::teacher() |
|
|
|
// TODO : Implement this method
|
|
|
|
{ |
|
|
|
|
|
|
|
return mpTeacher; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QTextEdit* UBTeacherStudentAction::student() |
|
|
|
return str; |
|
|
|
{ |
|
|
|
|
|
|
|
return mpStudent; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UBTeacherBarDropMediaZone::UBTeacherBarDropMediaZone(QWidget *parent, const char *name):QWidget(parent) |
|
|
|
UBTeacherBarDropMediaZone::UBTeacherBarDropMediaZone(QWidget *parent, const char *name):QWidget(parent) |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|