preferencesAboutTextFull
shibakaneki 13 years ago
parent 5c0d14b7de
commit 38ee9bf8b6
  1. 93
      src/gui/UBTeacherBarWidget.cpp
  2. 14
      src/gui/UBTeacherBarWidget.h

@ -25,6 +25,7 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
, mpDurationLabel(NULL) , mpDurationLabel(NULL)
, mpTitle(NULL) , mpTitle(NULL)
, mpAction1(NULL) , mpAction1(NULL)
, mpMediaLabel(NULL)
, mpDropMediaZone(NULL) , mpDropMediaZone(NULL)
, mpContainer(NULL) , mpContainer(NULL)
, mpContainerLayout(NULL) , mpContainerLayout(NULL)
@ -32,7 +33,13 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
, mpDuration2(NULL) , mpDuration2(NULL)
, mpDuration3(NULL) , mpDuration3(NULL)
, mpDurationButtons(NULL) , mpDurationButtons(NULL)
, mpActionLabel(NULL)
, mpActions(NULL) , mpActions(NULL)
, mpActionButton(NULL)
, mpCommentLabel(NULL)
, mpComments(NULL)
, mpLinkLabel(NULL)
, mpLinks(NULL)
{ {
setObjectName(name); setObjectName(name);
mName = "TeacherBarWidget"; mName = "TeacherBarWidget";
@ -60,15 +67,13 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
mpTitle = new QLineEdit(mpContainer); mpTitle = new QLineEdit(mpContainer);
mpTitle->setObjectName("DockPaletteWidgetLineEdit"); mpTitle->setObjectName("DockPaletteWidgetLineEdit");
connect(mpTitle, SIGNAL(textChanged(const QString&)), this, SLOT(onTitleTextChanged(const QString&))); connect(mpTitle, SIGNAL(textChanged(const QString&)), this, SLOT(onTitleTextChanged(const QString&)));
mpTitleLayout = new QHBoxLayout(); mpLayout->addWidget(mpTitleLabel, 0);
mpTitleLayout->addWidget(mpTitleLabel, 0); mpLayout->addWidget(mpTitle, 0);
mpTitleLayout->addWidget(mpTitle, 1);
mpLayout->addLayout(mpTitleLayout);
// Duration // Duration
mpDurationLabel = new QLabel(tr("Duration"), mpContainer); mpDurationLabel = new QLabel(tr("Duration"), mpContainer);
mpLayout->addWidget(mpDurationLabel, 0);
mpDurationLayout = new QHBoxLayout(); mpDurationLayout = new QHBoxLayout();
mpDurationLayout->addWidget(mpDurationLabel, 1);
mpDuration1 = new QCheckBox(this); mpDuration1 = new QCheckBox(this);
mpDuration1->setIcon(QIcon(":images/duration1.png")); mpDuration1->setIcon(QIcon(":images/duration1.png"));
mpDurationLayout->addWidget(mpDuration1, 0); mpDurationLayout->addWidget(mpDuration1, 0);
@ -82,35 +87,88 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
mpDurationButtons->addButton(mpDuration1); mpDurationButtons->addButton(mpDuration1);
mpDurationButtons->addButton(mpDuration2); mpDurationButtons->addButton(mpDuration2);
mpDurationButtons->addButton(mpDuration3); mpDurationButtons->addButton(mpDuration3);
mpLayout->addLayout(mpDurationLayout); mpLayout->addLayout(mpDurationLayout, 0);
// Actions // Actions
mpActionLabel = new QLabel(tr("Actions"), this);
mpLayout->addWidget(mpActionLabel, 0);
mpActions = new UBWidgetList(this); mpActions = new UBWidgetList(this);
mpActions->setEmptyText(tr("Add actions")); mpActions->setEmptyText(tr("Add actions"));
mpLayout->addWidget(mpActions); mpLayout->addWidget(mpActions, 1);
mpActionButton = new QPushButton(this);
mpActionButton->setObjectName("DockPaletteWidgetButton");
mpActionButton->setText(tr("Add action"));
mpLayout->addWidget(mpActionButton, 0);
// Media // Media
mpMediaLabel = new QLabel(tr("Media"), this);
mpLayout->addWidget(mpMediaLabel, 0);
mpDropMediaZone = new UBTeacherBarDropMediaZone(); mpDropMediaZone = new UBTeacherBarDropMediaZone();
mpLayout->addWidget(mpDropMediaZone); mpLayout->addWidget(mpDropMediaZone, 1);
populateCombos(); // Links
mpLinkLabel = new QLabel(tr("Links"), this);
mpLayout->addWidget(mpLinkLabel, 0);
mpLinks = new UBWidgetList(this);
mpLayout->addWidget(mpLinks, 1);
mpLinkButton = new QPushButton(tr("Add link"), this);
mpLinkButton->setObjectName("DockPaletteWidgetButton");
mpLayout->addWidget(mpLinkButton);
// Comments
mpCommentLabel = new QLabel(tr("Comments"), this);
mpLayout->addWidget(mpCommentLabel, 0);
mpComments = new QTextEdit(this);
mpComments->setObjectName("DockPaletteWidgetBox");
mpComments->setStyleSheet("background:white;");
mpLayout->addWidget(mpComments, 1);
connect(UBApplication::boardController, SIGNAL(activeSceneWillChange()), this, SLOT(saveContent())); connect(UBApplication::boardController, SIGNAL(activeSceneWillChange()), this, SLOT(saveContent()));
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(mpActionButton, SIGNAL(clicked()), this, SLOT(onActionButton()));
connect(mpLinkButton, SIGNAL(clicked()), this, SLOT(onLinkButton()));
} }
UBTeacherBarWidget::~UBTeacherBarWidget() UBTeacherBarWidget::~UBTeacherBarWidget()
{ {
if(NULL != mpComments){
delete mpComments;
mpComments = NULL;
}
if(NULL != mpCommentLabel){
delete mpCommentLabel;
mpCommentLabel = NULL;
}
if(NULL != mpLinks){
delete mpLinks;
mpLinks = NULL;
}
if(NULL != mpLinkLabel){
delete mpLinkLabel;
mpLinkLabel = NULL;
}
if(NULL != mpDropMediaZone){ if(NULL != mpDropMediaZone){
delete mpDropMediaZone; delete mpDropMediaZone;
mpDropMediaZone = NULL; mpDropMediaZone = NULL;
} }
if(NULL != mpMediaLabel){
delete mpMediaLabel;
mpMediaLabel = NULL;
}
if(NULL != mpActionButton){
delete mpActionButton;
mpActionButton = NULL;
}
if(NULL != mpAction1){ if(NULL != mpAction1){
delete mpAction1; delete mpAction1;
mpAction1 = NULL; mpAction1 = NULL;
} }
if(NULL != mpActionLabel){
delete mpActionLabel;
mpActionLabel = NULL;
}
if(NULL != mpDurationLabel){ if(NULL != mpDurationLabel){
delete mpDurationLabel; delete mpDurationLabel;
mpDurationLabel = NULL; mpDurationLabel = NULL;
@ -161,11 +219,6 @@ UBTeacherBarWidget::~UBTeacherBarWidget()
} }
} }
void UBTeacherBarWidget::populateCombos()
{
}
void UBTeacherBarWidget::onValueChanged() void UBTeacherBarWidget::onValueChanged()
{ {
if( mpTitle->text() == "" if( mpTitle->text() == ""
@ -202,6 +255,16 @@ void UBTeacherBarWidget::onTitleTextChanged(const QString& text)
mpTitle->setToolTip(text); mpTitle->setToolTip(text);
} }
void UBTeacherBarWidget::onActionButton()
{
}
void UBTeacherBarWidget::onLinkButton()
{
}
UBTeacherStudentAction::UBTeacherStudentAction(int actionNumber, QWidget *parent, const char *name):QWidget(parent) UBTeacherStudentAction::UBTeacherStudentAction(int actionNumber, QWidget *parent, const char *name):QWidget(parent)
, mpActionLabel(NULL) , mpActionLabel(NULL)
, mpTeacherLabel(NULL) , mpTeacherLabel(NULL)

@ -12,7 +12,7 @@ class UBMediaPlayer;
#include <QCheckBox> #include <QCheckBox>
#include <QTabWidget> #include <QTabWidget>
#include <QButtonGroup> #include <QButtonGroup>
#include <QPushButton>
#include "customWidgets/UBWidgetList.h" #include "customWidgets/UBWidgetList.h"
#include "UBDockPaletteWidget.h" #include "UBDockPaletteWidget.h"
@ -77,10 +77,10 @@ private slots:
void loadContent(); void loadContent();
void onValueChanged(); void onValueChanged();
void onTitleTextChanged(const QString& text); void onTitleTextChanged(const QString& text);
void onActionButton();
void onLinkButton();
private: private:
void populateCombos();
QVBoxLayout* mpLayout; QVBoxLayout* mpLayout;
QHBoxLayout* mpTitleLayout; QHBoxLayout* mpTitleLayout;
QHBoxLayout* mpDurationLayout; QHBoxLayout* mpDurationLayout;
@ -88,6 +88,7 @@ private:
QLabel* mpDurationLabel; QLabel* mpDurationLabel;
QLineEdit* mpTitle; QLineEdit* mpTitle;
UBTeacherStudentAction* mpAction1; UBTeacherStudentAction* mpAction1;
QLabel* mpMediaLabel;
UBTeacherBarDropMediaZone* mpDropMediaZone; UBTeacherBarDropMediaZone* mpDropMediaZone;
QWidget* mpContainer; QWidget* mpContainer;
QVBoxLayout* mpContainerLayout; QVBoxLayout* mpContainerLayout;
@ -95,7 +96,14 @@ private:
QCheckBox* mpDuration2; QCheckBox* mpDuration2;
QCheckBox* mpDuration3; QCheckBox* mpDuration3;
QButtonGroup* mpDurationButtons; QButtonGroup* mpDurationButtons;
QLabel* mpActionLabel;
UBWidgetList* mpActions; UBWidgetList* mpActions;
QPushButton* mpActionButton;
QLabel* mpLinkLabel;
UBWidgetList* mpLinks;
QPushButton* mpLinkButton;
QLabel* mpCommentLabel;
QTextEdit* mpComments;
}; };
#endif // UBTEACHERBARWIDGET_H #endif // UBTEACHERBARWIDGET_H

Loading…
Cancel
Save