|
|
|
@ -7,6 +7,7 @@ |
|
|
|
|
#include "document/UBDocumentProxy.h" |
|
|
|
|
|
|
|
|
|
#include "board/UBBoardController.h" |
|
|
|
|
#include "board/UBBoardPaletteManager.h" |
|
|
|
|
|
|
|
|
|
UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDockPaletteWidget(parent) |
|
|
|
|
, mpLayout(NULL) |
|
|
|
@ -119,6 +120,17 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock |
|
|
|
|
|
|
|
|
|
connect(UBApplication::boardController, SIGNAL(activeSceneWillChange()), this, SLOT(saveContent())); |
|
|
|
|
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(loadContent())); |
|
|
|
|
connect(mpTitle, SIGNAL(textChanged(QString)), this, SLOT(onValueChanged())); |
|
|
|
|
connect(mpPhasis, SIGNAL(currentIndexChanged(int)), this, SLOT(onValueChanged())); |
|
|
|
|
connect(mpDuration, SIGNAL(currentIndexChanged(int)), this, SLOT(onValueChanged())); |
|
|
|
|
connect(mpEquipment, SIGNAL(textChanged(QString)), this, SLOT(onValueChanged())); |
|
|
|
|
connect(mpActivity, SIGNAL(currentIndexChanged(int)), this, SLOT(onValueChanged())); |
|
|
|
|
connect(mpAction1->teacher(), SIGNAL(textChanged()), this, SLOT(onValueChanged())); |
|
|
|
|
connect(mpAction1->student(), SIGNAL(textChanged()), this, SLOT(onValueChanged())); |
|
|
|
|
connect(mpAction2->teacher(), SIGNAL(textChanged()), this, SLOT(onValueChanged())); |
|
|
|
|
connect(mpAction2->student(), SIGNAL(textChanged()), this, SLOT(onValueChanged())); |
|
|
|
|
connect(mpAction3->teacher(), SIGNAL(textChanged()), this, SLOT(onValueChanged())); |
|
|
|
|
connect(mpAction3->student(), SIGNAL(textChanged()), this, SLOT(onValueChanged())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
UBTeacherBarWidget::~UBTeacherBarWidget() |
|
|
|
@ -228,17 +240,17 @@ UBTeacherBarWidget::~UBTeacherBarWidget() |
|
|
|
|
void UBTeacherBarWidget::populateCombos() |
|
|
|
|
{ |
|
|
|
|
QStringList qslPhasis; |
|
|
|
|
qslPhasis << tr("I discover") << tr("I experiment") << tr("I train myself") << tr("I play") << tr("I memorize"); |
|
|
|
|
qslPhasis << tr("") << tr("I discover") << tr("I experiment") << tr("I train myself") << tr("I play") << tr("I memorize"); |
|
|
|
|
mpPhasis->insertItems(0, qslPhasis); |
|
|
|
|
mpPhasis->setCurrentIndex(0); |
|
|
|
|
|
|
|
|
|
QStringList qslDuration; |
|
|
|
|
qslDuration << tr("Short") << tr("Middle") << tr("Long"); |
|
|
|
|
qslDuration << tr("") << tr("Short") << tr("Middle") << tr("Long"); |
|
|
|
|
mpDuration->insertItems(0, qslDuration); |
|
|
|
|
mpDuration->setCurrentIndex(0); |
|
|
|
|
|
|
|
|
|
QStringList qslActivity; |
|
|
|
|
qslActivity << tr("Alone") << tr("By Group") << tr("All together"); |
|
|
|
|
qslActivity << tr("") << tr("Alone") << tr("By Group") << tr("All together"); |
|
|
|
|
mpActivity->insertItems(0, qslActivity); |
|
|
|
|
mpActivity->setCurrentIndex(0); |
|
|
|
|
} |
|
|
|
@ -276,6 +288,33 @@ void UBTeacherBarWidget::loadContent() |
|
|
|
|
mpAction3->setStudentText(nextInfos.action3Student); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UBTeacherBarWidget::onValueChanged() |
|
|
|
|
{ |
|
|
|
|
if( mpTitle->text() == "" |
|
|
|
|
&& mpDuration->currentIndex() == 0 |
|
|
|
|
&& mpPhasis->currentIndex() == 0 |
|
|
|
|
&& mpEquipment->text() == "" |
|
|
|
|
&& mpActivity->currentIndex() == 0 |
|
|
|
|
&& mpAction1->teacherText() == "" |
|
|
|
|
&& mpAction1->studentText() == "" |
|
|
|
|
&& mpAction2->teacherText() == "" |
|
|
|
|
&& mpAction2->studentText() == "" |
|
|
|
|
&& mpAction3->teacherText() == "" |
|
|
|
|
&& mpAction3->studentText() == "") |
|
|
|
|
{ |
|
|
|
|
mIconToLeft = QPixmap(":images/teacher_open_disabled.png"); |
|
|
|
|
mIconToRight = QPixmap(":images/teacher_close_disabled.png"); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
mIconToLeft = QPixmap(":images/teacher_open.png"); |
|
|
|
|
mIconToRight = QPixmap(":images/teacher_close.png"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TODO: refresh the icon
|
|
|
|
|
UBApplication::boardController->paletteManager()->refreshPalettes(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
UBTeacherStudentAction::UBTeacherStudentAction(int actionNumber, QWidget *parent, const char *name):QWidget(parent) |
|
|
|
|
, mpActionLabel(NULL) |
|
|
|
|
, mpTeacherLabel(NULL) |
|
|
|
@ -381,3 +420,13 @@ void UBTeacherStudentAction::setStudentText(QString text) |
|
|
|
|
{ |
|
|
|
|
mpStudent->setText(text); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QTextEdit* UBTeacherStudentAction::teacher() |
|
|
|
|
{ |
|
|
|
|
return mpTeacher; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QTextEdit* UBTeacherStudentAction::student() |
|
|
|
|
{ |
|
|
|
|
return mpStudent; |
|
|
|
|
} |
|
|
|
|