Commit b334e961 authored by Anatoly Mihalchenko's avatar Anatoly Mihalchenko

Merge branch 'master' of github.com:Sankore/Sankore-3.1

Conflicts:
	src/board/UBBoardPaletteManager.cpp
parents f145ebd2 cc3c31c3
resources/images/teacher_close.png

855 Bytes | W: | H:

resources/images/teacher_close.png

1.02 KB | W: | H:

resources/images/teacher_close.png
resources/images/teacher_close.png
resources/images/teacher_close.png
resources/images/teacher_close.png
  • 2-up
  • Swipe
  • Onion skin
resources/images/teacher_open.png

842 Bytes | W: | H:

resources/images/teacher_open.png

1.01 KB | W: | H:

resources/images/teacher_open.png
resources/images/teacher_open.png
resources/images/teacher_open.png
resources/images/teacher_open.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -332,5 +332,7 @@
<file>images/moveUpDisabled.svg</file>
<file>images/teacher_close.png</file>
<file>images/teacher_open.png</file>
<file>images/teacher_close_disabled.png</file>
<file>images/teacher_open_disabled.png</file>
</qresource>
</RCC>
......@@ -894,3 +894,9 @@ void UBBoardPaletteManager::connectToDocumentController()
{
emit connectToDocController();
}
void UBBoardPaletteManager::refreshPalettes()
{
mRightPalette->update();
mLeftPalette->update();
}
\ No newline at end of file
......@@ -56,6 +56,7 @@ class UBBoardPaletteManager : public QObject
void showVirtualKeyboard(bool show = true);
void initPalettesPosAtStartup();
void connectToDocumentController();
void refreshPalettes();
UBKeyboardPalette *mKeyboardPalette;
// UBRightPalette* createDesktopRightPalette(QWidget* parent);
......
#include "UBTeacherBarWidget.h"
#include "core/UBApplication.h"
#include "core/UBPersistenceManager.h"
#include "document/UBDocumentController.h"
#include "document/UBDocumentProxy.h"
#include "board/UBBoardController.h"
#include "board/UBBoardPaletteManager.h"
UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDockPaletteWidget(parent)
, mpLayout(NULL)
......@@ -110,6 +117,20 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
mpLayout->addWidget(mpAction3);
populateCombos();
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()
......@@ -219,18 +240,44 @@ 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);
QStringList qslDuration;
qslDuration << tr("Short") << tr("Middle") << tr("Long");
qslDuration << tr("") << tr("Short") << tr("Middle") << tr("Long");
mpDuration->insertItems(0, qslDuration);
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);
}
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");
}
UBApplication::boardController->paletteManager()->refreshPalettes();
}
UBTeacherStudentAction::UBTeacherStudentAction(int actionNumber, QWidget *parent, const char *name):QWidget(parent)
, mpActionLabel(NULL)
, mpTeacherLabel(NULL)
......@@ -327,3 +374,22 @@ QString UBTeacherStudentAction::studentText()
return mpStudent->document()->toPlainText();
}
void UBTeacherStudentAction::setTeacherText(QString text)
{
mpTeacher->setText(text);
}
void UBTeacherStudentAction::setStudentText(QString text)
{
mpStudent->setText(text);
}
QTextEdit* UBTeacherStudentAction::teacher()
{
return mpTeacher;
}
QTextEdit* UBTeacherStudentAction::student()
{
return mpStudent;
}
......@@ -20,6 +20,10 @@ public:
~UBTeacherStudentAction();
QString teacherText();
QString studentText();
void setTeacherText(QString text);
void setStudentText(QString text);
QTextEdit* teacher();
QTextEdit* student();
private:
int mActionNumber;
......@@ -39,6 +43,11 @@ public:
UBTeacherBarWidget(QWidget* parent=0, const char* name="UBTeacherBarWidget");
~UBTeacherBarWidget();
private slots:
void saveContent();
void loadContent();
void onValueChanged();
private:
void populateCombos();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment