From 18d24f9d375519496c1ac31339e432b2b8b0eb30 Mon Sep 17 00:00:00 2001 From: shibakaneki Date: Thu, 20 Oct 2011 09:45:00 +0200 Subject: [PATCH 1/2] Finished the teacher bar --- resources/images/teacher_close.png | Bin 855 -> 1043 bytes resources/images/teacher_close_disabled.png | Bin 0 -> 1043 bytes resources/images/teacher_open.png | Bin 842 -> 1034 bytes resources/images/teacher_open_disabled.png | Bin 0 -> 1030 bytes resources/sankore.qrc | 2 + src/board/UBBoardPaletteManager.cpp | 6 +++ src/board/UBBoardPaletteManager.h | 1 + src/gui/UBTeacherBarWidget.cpp | 55 ++++++++++++++++++-- src/gui/UBTeacherBarWidget.h | 3 ++ 9 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 resources/images/teacher_close_disabled.png create mode 100644 resources/images/teacher_open_disabled.png diff --git a/resources/images/teacher_close.png b/resources/images/teacher_close.png index d81f1de50f3d3d52ae34229874cf794e93703f4f..bee2ea0d948eb65c3d538ec6f28c3c00ea3f82d5 100644 GIT binary patch delta 974 zcmV;<12O#929pSoHwpg${{a7>y{D6rKp=k;4G$4n!3pvJ00WarL_t(Y$F-MBPa9Vh z$A9hJ! zcxG-FCXTFPFovG((fsxMpL@5(qpa3yHMX{%U|H7n1V<&5 zQdpM7*47iYx3_ODD5a!aE)$7F*xvqSY+89)G7^bUE|ha2>IF7}9kH00AO5r&6 zSWd*#r$1fD-syD6<)*Oh&PaRLB8G!LtNWNYl+qxkSGbcbU?k+|FGBdI6C@=v$Hz+e4bM2-hfyG>^^(J?#?c)#u-8g zlv4eqg4MZznJn}I!Rxof_I!We=j5b+onRp63&dhCdN5EtDwUo1s#v^5#v2a`p%AjzgB zxulDf0YV6b5Q91yV{m_a9+60tVzD?>zY7V|;TlpxDc@ybzQCc?#|9=mR0-VCJ*?30YJrzwL?(i4*&oF07*qoM6N<$g4(_3O8@`> delta 784 zcmV+r1MmEk2-gOXHwhsC767=|^I5l%Kp=k(2P6TV;_hnz00P%ZL_t(Y$F-NgO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Ogwk=KU}Jm68jAFqeMY@0>^PcRfb{7-N+0`&rkm zjd@=Erzq-iT@%Kb?D26kv$?tT^G!fsO!~fWZ*Fe=cpESP>AJOI6!o&)l1b02ubk%y zg5Y|Eb8yhzVN-3#UtJt>9#>Q_WtCbfyZQG_= ztx_tLMpi3F38Pdh4b<-MA6!^4J!)?9`8=zutK7Z&HO*!dW6bq{LI@TYAMoVKGQD0% zqtUqV{Dr`DI?c0ZKakJo2?BqlNQMFng#v49YxsVLUT^fV916^2GIToat4|8IYy*Yo z6-|iIL0|6c>jEwf`8HtxZw`l9CkUw3{v--R9z0keo6QaxfPNl_0vpF|-n{vpo%inv z0w1L$uIo~%RCxGsk$gUXxxyq#_4ZZ?6AN8nVFdx z=I0kE6mn-&YJdcI|KTrQzT9SacbCxj(OROl1|&*CsgTg<^e^^$5qo=ob9B^Ta&nSN z<=#NC2H1M>imlBpTFoPb5GbYkP6bQ%6K0CgO9XE}oDDCIV-61b>uh}dE9T~^ePD5X zoQa7df`qW!Ma!6P76cP_`s)AqC^>9tbP6nWb`ynRNEF35j&-VVVXi{?-VC*x%e!|q zs>MCDjCt)Enr(s7f>i3iucDApDc@&ywlb*xpeVML;_;&;ob(v7amb6eEsp&ZIwj92 z>UO(yIvt`YCY#Ok=+P2V%HfTjBoU6S2*ZG8^OztA0YMzcv|24%trkgQ$mMcmGS20V zowwV3TMjvDWNE!VRiu<8m9j{uGdPZeWm#yQ8UdJ5XT)YpBF<@en*kEbR@^_1TuP2G3s2}1<$XD1l0=K<_ z%gVqb0n4&3-PTH}ey)|$XFf>Aoc|nL1k+lPBuQVu^z_uPr#%=W#MQR95dE13gAgF+ z=NJAtub-~{1fKiOnAGI3H};rsrK>((64tKaAY|1a&vh8YRAXy^a{ N002ovPDHLkV1g&Y>iPfx literal 0 HcmV?d00001 diff --git a/resources/images/teacher_open.png b/resources/images/teacher_open.png index 9ab587699af5ae90ea3c0b06482d5f7dcbb968bc..17469cc79ec9e6aa7f694d92459b597e2e45ecd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qBo8E3mMzK%rn0 zi^awRjWKlgx~#6Qv%0#*M(xA!kXBfhMXk2M&Q6nBt;X%!bL4V)VzKBb&;Z*zEh?1? ze^(spA8IHi&|0IEMoGxr3TbsA3_~_Iw`jH6G#XpjcAiWoeW+LitgXLgW#w0D@82PW zKq&<%w1SW4L+msRLcyQa(c$5`?*8zdC6mbvfvIGY`MY=U2YuSD7Fq^;a!)Wj1tIX) zTggsGqb-Q2<8>zpf`D$P6;dZ-8=K7)6+zw(UVEhN@3@7Xl>DX@9^6nZFXG?ZOIdgdc7XqZWrGVD3wasb`Ei@ z%|;442m@jfNx$#WZtvoGePHNXr_-U+=@5p7R4RqmdVC$mwZ~$qN3)fr^ZH1UQWDFG z5RWH_#bQJvk^SV214b=UQIB*=Fm-E&UcXNe1V}0O%Sa)m#2ABhM%RqEJbhC#byJf` z4bXZRHz5R4%ENLo47(+%E^4VHh9;BWv8)4}t(N!zZ9ry0@*hb$w4jJRa{Z zFMsiq*47roSuoi{wVz$#x~}awl~}#rnCJ)oU#csMpJ+*`8~^|S07*qoM6N<$f?F)w A_y7O^ literal 0 HcmV?d00001 diff --git a/resources/sankore.qrc b/resources/sankore.qrc index 0fff05c3..4c7162ef 100644 --- a/resources/sankore.qrc +++ b/resources/sankore.qrc @@ -332,5 +332,7 @@ images/moveUpDisabled.svg images/teacher_close.png images/teacher_open.png + images/teacher_close_disabled.png + images/teacher_open_disabled.png diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index 14006a5e..94c28397 100755 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -734,3 +734,9 @@ void UBBoardPaletteManager::connectToDocumentController() { emit connectToDocController(); } + +void UBBoardPaletteManager::refreshPalettes() +{ + mRightPalette->update(); + mLeftPalette->update(); +} diff --git a/src/board/UBBoardPaletteManager.h b/src/board/UBBoardPaletteManager.h index f2313a71..1399898a 100644 --- a/src/board/UBBoardPaletteManager.h +++ b/src/board/UBBoardPaletteManager.h @@ -51,6 +51,7 @@ class UBBoardPaletteManager : public QObject void showVirtualKeyboard(bool show = true); void initPalettesPosAtStartup(); void connectToDocumentController(); + void refreshPalettes(); UBKeyboardPalette *mKeyboardPalette; UBRightPalette* createDesktopRightPalette(QWidget* parent); diff --git a/src/gui/UBTeacherBarWidget.cpp b/src/gui/UBTeacherBarWidget.cpp index ca505470..2644cb0f 100644 --- a/src/gui/UBTeacherBarWidget.cpp +++ b/src/gui/UBTeacherBarWidget.cpp @@ -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; +} diff --git a/src/gui/UBTeacherBarWidget.h b/src/gui/UBTeacherBarWidget.h index 7e2744ec..555b6ef6 100644 --- a/src/gui/UBTeacherBarWidget.h +++ b/src/gui/UBTeacherBarWidget.h @@ -22,6 +22,8 @@ public: QString studentText(); void setTeacherText(QString text); void setStudentText(QString text); + QTextEdit* teacher(); + QTextEdit* student(); private: int mActionNumber; @@ -45,6 +47,7 @@ public: private slots: void saveContent(); void loadContent(); + void onValueChanged(); private: void populateCombos(); From cc3c31c3a6bafe5faef00cc767ab8cdd19fb5174 Mon Sep 17 00:00:00 2001 From: shibakaneki Date: Thu, 20 Oct 2011 11:18:12 +0200 Subject: [PATCH 2/2] merged conflicts (>_<#) --- src/board/UBBoardPaletteManager.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index 3338582e..fb907b52 100755 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -162,20 +162,20 @@ void UBBoardPaletteManager::setupDockPaletteWidgets() mpPageNavigWidget = new UBPageNavigationWidget(); mpPageNavigWidget->registerMode(eUBDockPaletteWidget_BOARD); - connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpPageNavigWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); - + connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpPageNavigWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); + mpLibWidget = new UBLibWidget(); mpLibWidget ->registerMode(eUBDockPaletteWidget_BOARD); mpLibWidget ->registerMode(eUBDockPaletteWidget_DESKTOP); - connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpLibWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); + connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpLibWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); // mpCachePropWidget = new UBCachePropertiesWidget(); // mpCachePropWidget->registerMode(eUBDockPaletteWidget_BOARD); -// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpCachePropWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); +// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpCachePropWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); // mpTeacherBarWidget = new UBTeacherBarWidget(); // mpTeacherBarWidget->registerMode(eUBDockPaletteWidget_BOARD); -// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpTeacherBarWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); +// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpTeacherBarWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); //------------------------------------------------// // Add the dock palettes @@ -196,7 +196,7 @@ void UBBoardPaletteManager::setupDockPaletteWidgets() mRightPalette->addTabWidget(mpLibWidget); // // ??? -// mRightPalette->registerWidget(mpCachePropWidget); +// mRightPalette->registerWidget(mpCachePropWidget); // mRightPalette->addTabWidget(mpCachePropWidget); // // ???