From 23f2cef57de33e68e8fb974d0654f0004b5ad75f Mon Sep 17 00:00:00 2001 From: shibakaneki Date: Tue, 3 Jan 2012 14:47:04 +0100 Subject: [PATCH] Did some modification on the teacher bar --- resources/images/duration1.png | Bin 0 -> 1164 bytes resources/images/duration2.png | Bin 0 -> 1178 bytes resources/images/duration3.png | Bin 0 -> 1338 bytes resources/sankore.qrc | 3 + src/gui/UBTeacherBarWidget.cpp | 193 ++++++++------------------------- src/gui/UBTeacherBarWidget.h | 18 ++- 6 files changed, 56 insertions(+), 158 deletions(-) create mode 100644 resources/images/duration1.png create mode 100644 resources/images/duration2.png create mode 100644 resources/images/duration3.png diff --git a/resources/images/duration1.png b/resources/images/duration1.png new file mode 100644 index 0000000000000000000000000000000000000000..e05ffa8ee03484d3fc8a798b9e7597f7eaa1ac0d GIT binary patch literal 1164 zcmV;71atd|P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iySz z4F?R!(zz7?000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000B$Nkl&*br zt7RoS*Yr6z_2A~p%c=q(jE|NYZ94$yqoR2&7qJ6`Vne8p1A|uXw+i5&t|qe4U@|*a z$*ZAMVEz^`0a$iXDFA?z+xc|o!k>}x!IfuL?)O+U{}h<6#JpYlU8~f^dQVIby}t7F zz#~AUv>Bkwj)%7+0`$7PmYokJvIFI$PEQ%;8-NA7%pZh4G<&<^Vc){TCoK)O0uUqr z0%))H%I-^(r~U0U--}0&Th5rd-e>Z6XPjVO521G3I|JOPI0D3k*M-CMq1oGIW@7Z1 zNOi+bZFJss_=d-#t+y-z5Jk>})4RQePTxdivgN#$2pF%1Ja0#xkPLdq%K{*3`$1fy z_aX1#{pYRScrZV!CE$&#Qh_IK?5a03|}{BTEE+g9zA=DDpRqUV(Lq0IVAUNJ<1CX#`+dA^^)q z02Uzoy+O_a;l< z1;iiSu97+-4cxY3-ZB7Pid2udVvGXneyPs(SHR$vuykmulEwyz6f18J9Y6sH)5qql z^z*=!9mWp?fDVMIgOg>9b_|#;Rnk@!fC3mrkIu6DDK5wEcgYmHUu@RdUAJEb7R~1K eV;$>Qmh=~BJur+Rvz`V30000Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iySz z4F@6=1hm=!000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000B^NklmD2IJKmNqq;L8UUw$!R9^~_w{P|? zGzZ|uZf^iE1i%Ntook#cT3PV3S`WBz}SS-f8TKZkVRIU#^TO9rNeD2XB zK-|)n0eIE;@oGeXRP8Zt(-r0X57{~m4=`^95K_zhV`$%D^oHH0(8n)MtEvFRH@^m; zyVNtgUoD32tv=J*r_atBIpa+-KX+LR=A{rS(#B-~FN=-BZy>b>tgN&_i zOsj>?_g>T3RIp=M5dbmCnbmr=7xI{9XXc#^N+Mvo6!v*F@`Sj}IQ<|1Vs0ORPV~cN z47~r^(f^PLnAF?BN6cZElm$S1`)<7fIBYYzNl`$GfKljFi5A0XUI60CKd4s#dmYBX z>>VLH0*0V-C9Q^`d;olU2XNfT_=o_+g2%0Q0EcZxx3o}_MnEqp(PcH$O9IeI3xKma zrjrD~MiBrT2|yDq08$pFi3FgY769k9_gMG559xw&qTI=S^)55ha&P~ZV4*+3Dn9w=^Pbf2yua!3MiIACPmjKLb)qGDR zGhe8Mw&0PNnPtZTY--JXdyLy$c=2<*&^Wngf_?zoS~1_8;I~~-&M#-IEC6DmG@u0t z%?Wq s1bx@$2q5UZIGF=RNnf3P(vv9HUq!8q0QEr*YXATM07*qoM6N<$f`fen1^@s6 literal 0 HcmV?d00001 diff --git a/resources/images/duration3.png b/resources/images/duration3.png new file mode 100644 index 0000000000000000000000000000000000000000..9280a6421ebe27461f8043180d4ed2b2e2fdc4f7 GIT binary patch literal 1338 zcmV-A1;zS_P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iySz z4F@-Q*-$Y6000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000D)Nkl=0T^xQBzs&Zf~;mnqK00IcM&! z-`CIG<@N9xoVEF6Q78(!RHV4Ac7J+sxG(gjlIw5MIhxY^^v$pSpN_59X_nn_~bnYbqKD8A-A~wn=3P7g!J!%86+)R6fQXrH7 zFI1|Sner9{kQw>A)e0c&pu2Ntgxm!5K;>FDQ9XqKbg3P{N+anK1d!SAc+?JHxtaFx zH%j~jxSUsTBY_<&V8)Yl3aJo(D$}XieD!lokiU;Xhzzpd`~-(I3#PnVJB4tkz{>&Nuj z(eBV^Qm&_^K6v5Vwa|wz*Ih3A2QRK3qFN4Wh4?jMymO z|FwZCnUAJ~K*Y?HcfaZhCHvW2u13b~4eKVVXQh#J6`Kl0eK;wk3m5G*Nj-5V48)l* w5KG)hnl@@tzgbO;k1EN5e>(e2&!lnv3z>$(?+sp-)Bpeg07*qoM6N<$f*>kfH~;_u literal 0 HcmV?d00001 diff --git a/resources/sankore.qrc b/resources/sankore.qrc index c0ff2a69..8601be9f 100644 --- a/resources/sankore.qrc +++ b/resources/sankore.qrc @@ -338,5 +338,8 @@ images/download_close.png images/download_open.png images/tab_mask.png + images/duration1.png + images/duration2.png + images/duration3.png diff --git a/src/gui/UBTeacherBarWidget.cpp b/src/gui/UBTeacherBarWidget.cpp index ec0cbcce..bf454bf2 100644 --- a/src/gui/UBTeacherBarWidget.cpp +++ b/src/gui/UBTeacherBarWidget.cpp @@ -15,26 +15,20 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDockPaletteWidget(parent) , mpLayout(NULL) , mpTitleLayout(NULL) - , mpPhasisLayout(NULL) , mpDurationLayout(NULL) - , mpEquipmentLayout(NULL) - , mpActivityLayout(NULL) , mpTitleLabel(NULL) - , mpPhasisLabel(NULL) , mpDurationLabel(NULL) - , mpEquipmentLabel(NULL) - , mpActivityLabel(NULL) , mpTitle(NULL) - , mpEquipment(NULL) - , mpPhasis(NULL) - , mpDuration(NULL) - , mpActivity(NULL) , mpAction1(NULL) , mpAction2(NULL) , mpAction3(NULL) , mpDropMediaZone(NULL) , mpContainer(NULL) , mpContainerLayout(NULL) + , mpDuration1(NULL) + , mpDuration2(NULL) + , mpDuration3(NULL) + , mpDurationButtons(NULL) { setObjectName(name); mName = "TeacherBarWidget"; @@ -69,51 +63,26 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock mpTitleLayout->addWidget(mpTitle, 1); 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 mpDurationLabel = new QLabel(tr("Duration"), mpContainer); mpDurationLabel->setMinimumWidth(LABEL_MINWIDHT); - mpDurationLabel->setAlignment(Qt::AlignRight); - mpDuration = new QComboBox(mpContainer); - mpDuration->setObjectName("DockPaletteWidgetComboBox"); mpDurationLayout = new QHBoxLayout(); - mpDurationLayout->addWidget(mpDurationLabel, 0); - mpDurationLayout->addWidget(mpDuration, 1); + mpDurationLayout->addWidget(mpDurationLabel, 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); - // 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 mpAction1 = new UBTeacherStudentAction(1, 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::mainWindow->actionQuit, SIGNAL(triggered()), this, SLOT(saveContent())); 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())); @@ -147,108 +112,67 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock UBTeacherBarWidget::~UBTeacherBarWidget() { - if(NULL != mpDropMediaZone) - { + if(NULL != mpDropMediaZone){ delete mpDropMediaZone; mpDropMediaZone = NULL; } - if(NULL != mpAction3) - { + if(NULL != mpAction3){ delete mpAction3; mpAction3 = NULL; } - if(NULL != mpAction2) - { + if(NULL != mpAction2){ delete mpAction2; mpAction2 = NULL; } - if(NULL != mpAction1) - { + if(NULL != mpAction1){ delete mpAction1; mpAction1 = NULL; } - if(NULL != mpActivityLabel) - { - delete mpActivityLabel; - 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 != mpDurationLabel){ + delete mpDurationLabel; + mpDurationLabel = NULL; } - if(NULL != mpEquipment) - { - delete mpEquipment; - mpEquipment = NULL; + if(NULL != mpDuration1){ + delete mpDuration1; + mpDuration1 = NULL; } - if(NULL != mpEquipmentLayout) - { - delete mpEquipmentLayout; - mpEquipmentLayout = NULL; + if(NULL != mpDuration2){ + delete mpDuration2; + mpDuration2 = NULL; } - if(NULL != mpDurationLabel) - { - delete mpDurationLabel; - mpDurationLabel = NULL; + if(NULL != mpDuration3){ + delete mpDuration3; + mpDuration3 = NULL; } - if(NULL != mpDuration) - { - delete mpDuration; - mpDuration = NULL; + if(NULL != mpDurationButtons){ + delete mpDurationButtons; + mpDurationButtons = NULL; } - if(NULL != mpDurationLayout) - { + if(NULL != mpDurationLayout){ delete mpDurationLayout; mpDurationLayout = NULL; } - if(NULL != mpPhasisLabel) - { - delete mpPhasisLabel; - mpPhasisLabel = NULL; - } - if(NULL != mpPhasisLayout) - { - delete mpPhasisLayout; - mpPhasisLayout = NULL; - } - if(NULL != mpTitleLabel) - { + if(NULL != mpTitleLabel){ delete mpTitleLabel; mpTitleLabel = NULL; } - if(NULL != mpTitle) - { + if(NULL != mpTitle){ delete mpTitle; mpTitle = NULL; } - if(NULL != mpTitleLayout) - { + if(NULL != mpTitleLayout){ delete mpTitleLayout; mpTitleLayout = NULL; } - if(NULL != mpLayout) - { + if(NULL != mpLayout){ delete mpLayout; mpLayout = NULL; } - if(NULL != mpContainer) - { + if(NULL != mpContainer){ delete mpContainer; mpContainer = NULL; } - if(NULL != mpContainerLayout) - { + if(NULL != mpContainerLayout){ delete mpContainerLayout; mpContainerLayout = NULL; } @@ -256,29 +180,12 @@ UBTeacherBarWidget::~UBTeacherBarWidget() 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() { if( mpTitle->text() == "" - && mpDuration->currentIndex() == 0 - && mpPhasis->currentIndex() == 0 - && mpEquipment->text() == "" - && mpActivity->currentIndex() == 0 && mpAction1->teacherText() == "" && mpAction1->studentText() == "" && mpAction2->teacherText() == "" @@ -302,10 +209,6 @@ 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(); @@ -319,10 +222,6 @@ 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); @@ -338,7 +237,7 @@ void UBTeacherBarWidget::onTitleTextChanged(const QString& text) void UBTeacherBarWidget::onEquipmentTextChanged(const QString& text) { - mpEquipment->setToolTip(text); + } UBTeacherStudentAction::UBTeacherStudentAction(int actionNumber, QWidget *parent, const char *name):QWidget(parent) diff --git a/src/gui/UBTeacherBarWidget.h b/src/gui/UBTeacherBarWidget.h index 585e7f8a..ec7946fb 100644 --- a/src/gui/UBTeacherBarWidget.h +++ b/src/gui/UBTeacherBarWidget.h @@ -10,7 +10,9 @@ class UBVideoPlayer; #include #include #include -#include +#include +#include +#include #include "UBDockPaletteWidget.h" @@ -85,26 +87,20 @@ private: QVBoxLayout* mpLayout; QHBoxLayout* mpTitleLayout; - QHBoxLayout* mpPhasisLayout; QHBoxLayout* mpDurationLayout; - QHBoxLayout* mpEquipmentLayout; - QHBoxLayout* mpActivityLayout; QLabel* mpTitleLabel; - QLabel* mpPhasisLabel; QLabel* mpDurationLabel; - QLabel* mpEquipmentLabel; - QLabel* mpActivityLabel; QLineEdit* mpTitle; - QLineEdit* mpEquipment; - QComboBox* mpPhasis; - QComboBox* mpDuration; - QComboBox* mpActivity; UBTeacherStudentAction* mpAction1; UBTeacherStudentAction* mpAction2; UBTeacherStudentAction* mpAction3; UBTeacherBarDropMediaZone* mpDropMediaZone; QWidget* mpContainer; QVBoxLayout* mpContainerLayout; + QCheckBox* mpDuration1; + QCheckBox* mpDuration2; + QCheckBox* mpDuration3; + QButtonGroup* mpDurationButtons; }; #endif // UBTEACHERBARWIDGET_H