Did some modification on the teacher bar

preferencesAboutTextFull
shibakaneki 13 years ago
parent b824051438
commit 23f2cef57d
  1. BIN
      resources/images/duration1.png
  2. BIN
      resources/images/duration2.png
  3. BIN
      resources/images/duration3.png
  4. 3
      resources/sankore.qrc
  5. 193
      src/gui/UBTeacherBarWidget.cpp
  6. 18
      src/gui/UBTeacherBarWidget.h

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -338,5 +338,8 @@
<file>images/download_close.png</file> <file>images/download_close.png</file>
<file>images/download_open.png</file> <file>images/download_open.png</file>
<file>images/tab_mask.png</file> <file>images/tab_mask.png</file>
<file>images/duration1.png</file>
<file>images/duration2.png</file>
<file>images/duration3.png</file>
</qresource> </qresource>
</RCC> </RCC>

@ -15,26 +15,20 @@
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)
, mpPhasisLayout(NULL)
, mpDurationLayout(NULL) , mpDurationLayout(NULL)
, mpEquipmentLayout(NULL)
, mpActivityLayout(NULL)
, mpTitleLabel(NULL) , mpTitleLabel(NULL)
, mpPhasisLabel(NULL)
, mpDurationLabel(NULL) , mpDurationLabel(NULL)
, mpEquipmentLabel(NULL)
, mpActivityLabel(NULL)
, mpTitle(NULL) , mpTitle(NULL)
, mpEquipment(NULL)
, mpPhasis(NULL)
, mpDuration(NULL)
, mpActivity(NULL)
, mpAction1(NULL) , mpAction1(NULL)
, mpAction2(NULL) , mpAction2(NULL)
, mpAction3(NULL) , mpAction3(NULL)
, mpDropMediaZone(NULL) , mpDropMediaZone(NULL)
, mpContainer(NULL) , mpContainer(NULL)
, mpContainerLayout(NULL) , mpContainerLayout(NULL)
, mpDuration1(NULL)
, mpDuration2(NULL)
, mpDuration3(NULL)
, mpDurationButtons(NULL)
{ {
setObjectName(name); setObjectName(name);
mName = "TeacherBarWidget"; mName = "TeacherBarWidget";
@ -69,51 +63,26 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
mpTitleLayout->addWidget(mpTitle, 1); mpTitleLayout->addWidget(mpTitle, 1);
mpLayout->addLayout(mpTitleLayout); mpLayout->addLayout(mpTitleLayout);
// Phasis
mpPhasisLabel = new QLabel(tr("Phasis"), mpContainer);
mpPhasisLabel->setMinimumWidth(LABEL_MINWIDHT);
mpPhasisLabel->setAlignment(Qt::AlignRight);
mpPhasis = new QComboBox(mpContainer);
mpPhasis->setObjectName("DockPaletteWidgetComboBox");
mpPhasisLayout = new QHBoxLayout();
mpPhasisLayout->addWidget(mpPhasisLabel, 0);
mpPhasisLayout->addWidget(mpPhasis, 1);
mpLayout->addLayout(mpPhasisLayout);
// Duration // Duration
mpDurationLabel = new QLabel(tr("Duration"), mpContainer); mpDurationLabel = new QLabel(tr("Duration"), mpContainer);
mpDurationLabel->setMinimumWidth(LABEL_MINWIDHT); mpDurationLabel->setMinimumWidth(LABEL_MINWIDHT);
mpDurationLabel->setAlignment(Qt::AlignRight);
mpDuration = new QComboBox(mpContainer);
mpDuration->setObjectName("DockPaletteWidgetComboBox");
mpDurationLayout = new QHBoxLayout(); mpDurationLayout = new QHBoxLayout();
mpDurationLayout->addWidget(mpDurationLabel, 0); mpDurationLayout->addWidget(mpDurationLabel, 1);
mpDurationLayout->addWidget(mpDuration, 1); mpDuration1 = new QCheckBox(this);
mpDuration1->setIcon(QIcon(":images/duration1.png"));
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(this);
mpDurationButtons->addButton(mpDuration1);
mpDurationButtons->addButton(mpDuration2);
mpDurationButtons->addButton(mpDuration3);
mpLayout->addLayout(mpDurationLayout); mpLayout->addLayout(mpDurationLayout);
// Equipment
mpEquipmentLabel = new QLabel(tr("Equipment"), mpContainer);
mpEquipmentLabel->setMinimumWidth(LABEL_MINWIDHT);
mpEquipmentLabel->setAlignment(Qt::AlignRight);
mpEquipment = new QLineEdit(mpContainer);
mpEquipment->setObjectName("DockPaletteWidgetLineEdit");
connect(mpEquipment, SIGNAL(textChanged(const QString&)), this, SLOT(onEquipmentTextChanged(const QString&)));
mpEquipmentLayout = new QHBoxLayout();
mpEquipmentLayout->addWidget(mpEquipmentLabel, 0);
mpEquipmentLayout->addWidget(mpEquipment, 1);
mpLayout->addLayout(mpEquipmentLayout);
// Activity
mpActivityLabel = new QLabel(tr("Activity"), mpContainer);
mpActivityLabel->setMinimumWidth(LABEL_MINWIDHT);
mpActivityLabel->setAlignment(Qt::AlignRight);
mpActivity = new QComboBox(mpContainer);
mpActivity->setObjectName("DockPaletteWidgetComboBox");
mpActivityLayout = new QHBoxLayout();
mpActivityLayout->addWidget(mpActivityLabel, 0);
mpActivityLayout->addWidget(mpActivity, 1);
mpLayout->addLayout(mpActivityLayout);
// Actions // Actions
mpAction1 = new UBTeacherStudentAction(1, mpContainer); mpAction1 = new UBTeacherStudentAction(1, mpContainer);
mpAction2 = new UBTeacherStudentAction(2, mpContainer); mpAction2 = new UBTeacherStudentAction(2, mpContainer);
@ -133,10 +102,6 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(loadContent())); connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(loadContent()));
connect(UBApplication::mainWindow->actionQuit, SIGNAL(triggered()), this, SLOT(saveContent())); connect(UBApplication::mainWindow->actionQuit, SIGNAL(triggered()), this, SLOT(saveContent()));
connect(mpTitle, SIGNAL(textChanged(QString)), this, SLOT(onValueChanged())); 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->teacher(), SIGNAL(textChanged()), this, SLOT(onValueChanged()));
connect(mpAction1->student(), SIGNAL(textChanged()), this, SLOT(onValueChanged())); connect(mpAction1->student(), SIGNAL(textChanged()), this, SLOT(onValueChanged()));
connect(mpAction2->teacher(), SIGNAL(textChanged()), this, SLOT(onValueChanged())); connect(mpAction2->teacher(), SIGNAL(textChanged()), this, SLOT(onValueChanged()));
@ -147,108 +112,67 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
UBTeacherBarWidget::~UBTeacherBarWidget() UBTeacherBarWidget::~UBTeacherBarWidget()
{ {
if(NULL != mpDropMediaZone) if(NULL != mpDropMediaZone){
{
delete mpDropMediaZone; delete mpDropMediaZone;
mpDropMediaZone = NULL; mpDropMediaZone = NULL;
} }
if(NULL != mpAction3) if(NULL != mpAction3){
{
delete mpAction3; delete mpAction3;
mpAction3 = NULL; mpAction3 = NULL;
} }
if(NULL != mpAction2) if(NULL != mpAction2){
{
delete mpAction2; delete mpAction2;
mpAction2 = NULL; mpAction2 = NULL;
} }
if(NULL != mpAction1) if(NULL != mpAction1){
{
delete mpAction1; delete mpAction1;
mpAction1 = NULL; mpAction1 = NULL;
} }
if(NULL != mpActivityLabel) if(NULL != mpDurationLabel){
{ delete mpDurationLabel;
delete mpActivityLabel; mpDurationLabel = NULL;
mpActivityLabel = NULL;
}
if(NULL != mpActivity)
{
delete mpActivity;
mpActivity = NULL;
}
if(NULL != mpActivityLayout)
{
delete mpActivityLayout;
mpActivityLayout = NULL;
}
if(NULL != mpEquipmentLabel)
{
delete mpEquipmentLabel;
mpEquipmentLabel = NULL;
} }
if(NULL != mpEquipment) if(NULL != mpDuration1){
{ delete mpDuration1;
delete mpEquipment; mpDuration1 = NULL;
mpEquipment = NULL;
} }
if(NULL != mpEquipmentLayout) if(NULL != mpDuration2){
{ delete mpDuration2;
delete mpEquipmentLayout; mpDuration2 = NULL;
mpEquipmentLayout = NULL;
} }
if(NULL != mpDurationLabel) if(NULL != mpDuration3){
{ delete mpDuration3;
delete mpDurationLabel; mpDuration3 = NULL;
mpDurationLabel = NULL;
} }
if(NULL != mpDuration) if(NULL != mpDurationButtons){
{ delete mpDurationButtons;
delete mpDuration; mpDurationButtons = NULL;
mpDuration = NULL;
} }
if(NULL != mpDurationLayout) if(NULL != mpDurationLayout){
{
delete mpDurationLayout; delete mpDurationLayout;
mpDurationLayout = NULL; mpDurationLayout = NULL;
} }
if(NULL != mpPhasisLabel) if(NULL != mpTitleLabel){
{
delete mpPhasisLabel;
mpPhasisLabel = NULL;
}
if(NULL != mpPhasisLayout)
{
delete mpPhasisLayout;
mpPhasisLayout = NULL;
}
if(NULL != mpTitleLabel)
{
delete mpTitleLabel; delete mpTitleLabel;
mpTitleLabel = NULL; mpTitleLabel = NULL;
} }
if(NULL != mpTitle) if(NULL != mpTitle){
{
delete mpTitle; delete mpTitle;
mpTitle = NULL; mpTitle = NULL;
} }
if(NULL != mpTitleLayout) if(NULL != mpTitleLayout){
{
delete mpTitleLayout; delete mpTitleLayout;
mpTitleLayout = NULL; mpTitleLayout = NULL;
} }
if(NULL != mpLayout) if(NULL != mpLayout){
{
delete mpLayout; delete mpLayout;
mpLayout = NULL; mpLayout = NULL;
} }
if(NULL != mpContainer) if(NULL != mpContainer){
{
delete mpContainer; delete mpContainer;
mpContainer = NULL; mpContainer = NULL;
} }
if(NULL != mpContainerLayout) if(NULL != mpContainerLayout){
{
delete mpContainerLayout; delete mpContainerLayout;
mpContainerLayout = NULL; mpContainerLayout = NULL;
} }
@ -256,29 +180,12 @@ UBTeacherBarWidget::~UBTeacherBarWidget()
void UBTeacherBarWidget::populateCombos() void UBTeacherBarWidget::populateCombos()
{ {
QStringList qslPhasis;
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("") << tr("Short") << tr("Middle") << tr("Long");
mpDuration->insertItems(0, qslDuration);
mpDuration->setCurrentIndex(0);
QStringList qslActivity;
qslActivity << tr("") << tr("Alone") << tr("By Group") << tr("All together");
mpActivity->insertItems(0, qslActivity);
mpActivity->setCurrentIndex(0);
} }
void UBTeacherBarWidget::onValueChanged() void UBTeacherBarWidget::onValueChanged()
{ {
if( mpTitle->text() == "" if( mpTitle->text() == ""
&& mpDuration->currentIndex() == 0
&& mpPhasis->currentIndex() == 0
&& mpEquipment->text() == ""
&& mpActivity->currentIndex() == 0
&& mpAction1->teacherText() == "" && mpAction1->teacherText() == ""
&& mpAction1->studentText() == "" && mpAction1->studentText() == ""
&& mpAction2->teacherText() == "" && mpAction2->teacherText() == ""
@ -302,10 +209,6 @@ void UBTeacherBarWidget::saveContent()
{ {
sTeacherBarInfos infos; sTeacherBarInfos infos;
infos.title = mpTitle->text(); 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.action1Master = mpAction1->teacherText();
infos.action1Student = mpAction1->studentText(); infos.action1Student = mpAction1->studentText();
infos.action2Master = mpAction2->teacherText(); infos.action2Master = mpAction2->teacherText();
@ -319,10 +222,6 @@ 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());
mpTitle->setText(nextInfos.title); 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->setTeacherText(nextInfos.action1Master);
mpAction1->setStudentText(nextInfos.action1Student); mpAction1->setStudentText(nextInfos.action1Student);
mpAction2->setTeacherText(nextInfos.action2Master); mpAction2->setTeacherText(nextInfos.action2Master);
@ -338,7 +237,7 @@ void UBTeacherBarWidget::onTitleTextChanged(const QString& text)
void UBTeacherBarWidget::onEquipmentTextChanged(const QString& text) void UBTeacherBarWidget::onEquipmentTextChanged(const QString& text)
{ {
mpEquipment->setToolTip(text);
} }
UBTeacherStudentAction::UBTeacherStudentAction(int actionNumber, QWidget *parent, const char *name):QWidget(parent) UBTeacherStudentAction::UBTeacherStudentAction(int actionNumber, QWidget *parent, const char *name):QWidget(parent)

@ -10,7 +10,9 @@ class UBVideoPlayer;
#include <QLabel> #include <QLabel>
#include <QTextEdit> #include <QTextEdit>
#include <QLineEdit> #include <QLineEdit>
#include <QComboBox> #include <QCheckBox>
#include <QTabWidget>
#include <QButtonGroup>
#include "UBDockPaletteWidget.h" #include "UBDockPaletteWidget.h"
@ -85,26 +87,20 @@ private:
QVBoxLayout* mpLayout; QVBoxLayout* mpLayout;
QHBoxLayout* mpTitleLayout; QHBoxLayout* mpTitleLayout;
QHBoxLayout* mpPhasisLayout;
QHBoxLayout* mpDurationLayout; QHBoxLayout* mpDurationLayout;
QHBoxLayout* mpEquipmentLayout;
QHBoxLayout* mpActivityLayout;
QLabel* mpTitleLabel; QLabel* mpTitleLabel;
QLabel* mpPhasisLabel;
QLabel* mpDurationLabel; QLabel* mpDurationLabel;
QLabel* mpEquipmentLabel;
QLabel* mpActivityLabel;
QLineEdit* mpTitle; QLineEdit* mpTitle;
QLineEdit* mpEquipment;
QComboBox* mpPhasis;
QComboBox* mpDuration;
QComboBox* mpActivity;
UBTeacherStudentAction* mpAction1; UBTeacherStudentAction* mpAction1;
UBTeacherStudentAction* mpAction2; UBTeacherStudentAction* mpAction2;
UBTeacherStudentAction* mpAction3; UBTeacherStudentAction* mpAction3;
UBTeacherBarDropMediaZone* mpDropMediaZone; UBTeacherBarDropMediaZone* mpDropMediaZone;
QWidget* mpContainer; QWidget* mpContainer;
QVBoxLayout* mpContainerLayout; QVBoxLayout* mpContainerLayout;
QCheckBox* mpDuration1;
QCheckBox* mpDuration2;
QCheckBox* mpDuration3;
QButtonGroup* mpDurationButtons;
}; };
#endif // UBTEACHERBARWIDGET_H #endif // UBTEACHERBARWIDGET_H

Loading…
Cancel
Save