|
|
@ -1,6 +1,12 @@ |
|
|
|
#include "UBTeacherBarWidget.h" |
|
|
|
#include "UBTeacherBarWidget.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "core/UBApplication.h" |
|
|
|
#include "core/UBApplication.h" |
|
|
|
|
|
|
|
#include "core/UBPersistenceManager.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "document/UBDocumentController.h" |
|
|
|
|
|
|
|
#include "document/UBDocumentProxy.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "board/UBBoardController.h" |
|
|
|
|
|
|
|
|
|
|
|
UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDockPaletteWidget(parent) |
|
|
|
UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDockPaletteWidget(parent) |
|
|
|
, mpLayout(NULL) |
|
|
|
, mpLayout(NULL) |
|
|
@ -110,6 +116,9 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock |
|
|
|
mpLayout->addWidget(mpAction3); |
|
|
|
mpLayout->addWidget(mpAction3); |
|
|
|
|
|
|
|
|
|
|
|
populateCombos(); |
|
|
|
populateCombos(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connect(UBApplication::boardController, SIGNAL(activeSceneWillChange()), this, SLOT(saveContent())); |
|
|
|
|
|
|
|
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(loadContent())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBTeacherBarWidget::~UBTeacherBarWidget() |
|
|
|
UBTeacherBarWidget::~UBTeacherBarWidget() |
|
|
@ -221,14 +230,50 @@ void UBTeacherBarWidget::populateCombos() |
|
|
|
QStringList qslPhasis; |
|
|
|
QStringList qslPhasis; |
|
|
|
qslPhasis << tr("I discover") << tr("I experiment") << tr("I train myself") << tr("I play") << tr("I memorize"); |
|
|
|
qslPhasis << tr("I discover") << tr("I experiment") << tr("I train myself") << tr("I play") << tr("I memorize"); |
|
|
|
mpPhasis->insertItems(0, qslPhasis); |
|
|
|
mpPhasis->insertItems(0, qslPhasis); |
|
|
|
|
|
|
|
mpPhasis->setCurrentIndex(0); |
|
|
|
|
|
|
|
|
|
|
|
QStringList qslDuration; |
|
|
|
QStringList qslDuration; |
|
|
|
qslDuration << tr("Short") << tr("Middle") << tr("Long"); |
|
|
|
qslDuration << tr("Short") << tr("Middle") << tr("Long"); |
|
|
|
mpDuration->insertItems(0, qslDuration); |
|
|
|
mpDuration->insertItems(0, qslDuration); |
|
|
|
|
|
|
|
mpDuration->setCurrentIndex(0); |
|
|
|
|
|
|
|
|
|
|
|
QStringList qslActivity; |
|
|
|
QStringList qslActivity; |
|
|
|
qslActivity << tr("Alone") << tr("By Group") << tr("All together"); |
|
|
|
qslActivity << tr("Alone") << tr("By Group") << tr("All together"); |
|
|
|
mpActivity->insertItems(0, qslActivity); |
|
|
|
mpActivity->insertItems(0, qslActivity); |
|
|
|
|
|
|
|
mpActivity->setCurrentIndex(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarWidget::saveContent() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
sTeacherBarInfos infos; |
|
|
|
|
|
|
|
infos.title = mpTitle->text(); |
|
|
|
|
|
|
|
infos.phasis = mpPhasis->currentIndex(); |
|
|
|
|
|
|
|
infos.Duration = mpDuration->currentIndex(); |
|
|
|
|
|
|
|
infos.material = mpEquipment->text(); |
|
|
|
|
|
|
|
infos.activity = mpActivity->currentIndex(); |
|
|
|
|
|
|
|
infos.action1Master = mpAction1->teacherText(); |
|
|
|
|
|
|
|
infos.action1Student = mpAction1->studentText(); |
|
|
|
|
|
|
|
infos.action2Master = mpAction2->teacherText(); |
|
|
|
|
|
|
|
infos.action2Student = mpAction2->studentText(); |
|
|
|
|
|
|
|
infos.action3Master = mpAction3->teacherText(); |
|
|
|
|
|
|
|
infos.action3Student = mpAction3->studentText(); |
|
|
|
|
|
|
|
UBPersistenceManager::persistenceManager()->persistTeacherBar(UBApplication::boardController->activeDocument(), UBApplication::boardController->activeSceneIndex(), infos); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarWidget::loadContent() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
sTeacherBarInfos nextInfos = UBPersistenceManager::persistenceManager()->getTeacherBarInfos(UBApplication::boardController->activeDocument(), UBApplication::boardController->activeSceneIndex()); |
|
|
|
|
|
|
|
mpTitle->setText(nextInfos.title); |
|
|
|
|
|
|
|
mpPhasis->setCurrentIndex(nextInfos.phasis); |
|
|
|
|
|
|
|
mpDuration->setCurrentIndex(nextInfos.Duration); |
|
|
|
|
|
|
|
mpEquipment->setText(nextInfos.material); |
|
|
|
|
|
|
|
mpActivity->setCurrentIndex(nextInfos.activity); |
|
|
|
|
|
|
|
mpAction1->setTeacherText(nextInfos.action1Master); |
|
|
|
|
|
|
|
mpAction1->setStudentText(nextInfos.action1Student); |
|
|
|
|
|
|
|
mpAction2->setTeacherText(nextInfos.action2Master); |
|
|
|
|
|
|
|
mpAction2->setStudentText(nextInfos.action2Student); |
|
|
|
|
|
|
|
mpAction3->setTeacherText(nextInfos.action3Master); |
|
|
|
|
|
|
|
mpAction3->setStudentText(nextInfos.action3Student); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBTeacherStudentAction::UBTeacherStudentAction(int actionNumber, QWidget *parent, const char *name):QWidget(parent) |
|
|
|
UBTeacherStudentAction::UBTeacherStudentAction(int actionNumber, QWidget *parent, const char *name):QWidget(parent) |
|
|
@ -327,3 +372,12 @@ QString UBTeacherStudentAction::studentText() |
|
|
|
return mpStudent->document()->toPlainText(); |
|
|
|
return mpStudent->document()->toPlainText(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherStudentAction::setTeacherText(QString text) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mpTeacher->setText(text); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherStudentAction::setStudentText(QString text) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mpStudent->setText(text); |
|
|
|
|
|
|
|
} |
|
|
|