updated the parents in the teacher bar

preferencesAboutTextFull
shibakaneki 13 years ago
parent e954a077a5
commit 17f0fa9b8e
  1. 33
      src/gui/UBTeacherBarWidget.cpp
  2. 2
      src/gui/UBTeacherBarWidget.h

@ -42,6 +42,7 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
, mpLinks(NULL) , mpLinks(NULL)
, mpLinkButton(NULL) , mpLinkButton(NULL)
, mpLinkLayout(NULL) , mpLinkLayout(NULL)
, mpStackWidget(NULL)
{ {
setObjectName(name); setObjectName(name);
mName = "TeacherBarWidget"; mName = "TeacherBarWidget";
@ -88,19 +89,19 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
mpDuration3 = new QCheckBox(this); mpDuration3 = new QCheckBox(this);
mpDuration3->setIcon(QIcon(":images/duration3.png")); mpDuration3->setIcon(QIcon(":images/duration3.png"));
mpDurationLayout->addWidget(mpDuration3, 0); mpDurationLayout->addWidget(mpDuration3, 0);
mpDurationButtons = new QButtonGroup(this); mpDurationButtons = new QButtonGroup(mpContainer);
mpDurationButtons->addButton(mpDuration1); mpDurationButtons->addButton(mpDuration1);
mpDurationButtons->addButton(mpDuration2); mpDurationButtons->addButton(mpDuration2);
mpDurationButtons->addButton(mpDuration3); mpDurationButtons->addButton(mpDuration3);
mpLayout->addLayout(mpDurationLayout, 0); mpLayout->addLayout(mpDurationLayout, 0);
// Actions // Actions
mpActionLabel = new QLabel(tr("Actions"), this); mpActionLabel = new QLabel(tr("Actions"), mpContainer);
mpLayout->addWidget(mpActionLabel, 0); mpLayout->addWidget(mpActionLabel, 0);
mpActions = new UBWidgetList(this); mpActions = new UBWidgetList(mpContainer);
mpActions->setEmptyText(tr("Add actions")); mpActions->setEmptyText(tr("Add actions"));
mpLayout->addWidget(mpActions, 1); mpLayout->addWidget(mpActions, 1);
mpActionButton = new QPushButton(this); mpActionButton = new QPushButton(mpContainer);
mpActionButton->setObjectName("DockPaletteWidgetButton"); mpActionButton->setObjectName("DockPaletteWidgetButton");
mpActionButton->setText(tr("Add action")); mpActionButton->setText(tr("Add action"));
mpActionLayout = new QHBoxLayout(); mpActionLayout = new QHBoxLayout();
@ -109,17 +110,17 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
mpLayout->addLayout(mpActionLayout, 0); mpLayout->addLayout(mpActionLayout, 0);
// Media // Media
mpMediaLabel = new QLabel(tr("Media"), this); mpMediaLabel = new QLabel(tr("Media"), mpContainer);
mpLayout->addWidget(mpMediaLabel, 0); mpLayout->addWidget(mpMediaLabel, 0);
mpDropMediaZone = new UBTeacherBarDropMediaZone(this); mpDropMediaZone = new UBTeacherBarDropMediaZone(mpContainer);
mpLayout->addWidget(mpDropMediaZone, 1); mpLayout->addWidget(mpDropMediaZone, 1);
// Links // Links
mpLinkLabel = new QLabel(tr("Links"), this); mpLinkLabel = new QLabel(tr("Links"), mpContainer);
mpLayout->addWidget(mpLinkLabel, 0); mpLayout->addWidget(mpLinkLabel, 0);
mpLinks = new UBWidgetList(this); mpLinks = new UBWidgetList(mpContainer);
mpLayout->addWidget(mpLinks, 1); mpLayout->addWidget(mpLinks, 1);
mpLinkButton = new QPushButton(tr("Add link"), this); mpLinkButton = new QPushButton(tr("Add link"), mpContainer);
mpLinkButton->setObjectName("DockPaletteWidgetButton"); mpLinkButton->setObjectName("DockPaletteWidgetButton");
mpLinkLayout = new QHBoxLayout(); mpLinkLayout = new QHBoxLayout();
mpLinkLayout->addWidget(mpLinkButton, 0); mpLinkLayout->addWidget(mpLinkButton, 0);
@ -127,7 +128,7 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
mpLayout->addLayout(mpLinkLayout, 0); mpLayout->addLayout(mpLinkLayout, 0);
// Comments // Comments
mpCommentLabel = new QLabel(tr("Comments"), this); mpCommentLabel = new QLabel(tr("Comments"), mpContainer);
mpLayout->addWidget(mpCommentLabel, 0); mpLayout->addWidget(mpCommentLabel, 0);
mpComments = new QTextEdit(this); mpComments = new QTextEdit(this);
mpComments->setObjectName("DockPaletteWidgetBox"); mpComments->setObjectName("DockPaletteWidgetBox");
@ -236,6 +237,10 @@ UBTeacherBarWidget::~UBTeacherBarWidget()
delete mpContainerLayout; delete mpContainerLayout;
mpContainerLayout = NULL; mpContainerLayout = NULL;
} }
if(NULL != mpStackWidget){
delete mpStackWidget;
mpStackWidget = NULL;
}
} }
void UBTeacherBarWidget::onValueChanged() void UBTeacherBarWidget::onValueChanged()
@ -311,7 +316,7 @@ void UBTeacherBarWidget::loadContent()
for(int i=0; i<nextInfos.actions.size(); i++){ for(int i=0; i<nextInfos.actions.size(); i++){
QStringList qslAction = nextInfos.actions.at(i).split(";"); QStringList qslAction = nextInfos.actions.at(i).split(";");
if(qslAction.size() >= 2){ if(qslAction.size() >= 2){
UBTeacherStudentAction* pAction = new UBTeacherStudentAction(this); UBTeacherStudentAction* pAction = new UBTeacherStudentAction(mpContainer);
pAction->setComboValue(qslAction.at(0).toInt()); pAction->setComboValue(qslAction.at(0).toInt());
pAction->setText(qslAction.at(1)); pAction->setText(qslAction.at(1));
mActionList << pAction; mActionList << pAction;
@ -325,7 +330,7 @@ void UBTeacherBarWidget::loadContent()
for(int j=0; j<nextInfos.urls.size(); j++){ for(int j=0; j<nextInfos.urls.size(); j++){
QString qsUrl = nextInfos.urls.at(j); QString qsUrl = nextInfos.urls.at(j);
if("" != qsUrl){ if("" != qsUrl){
UBUrlWidget* pLink = new UBUrlWidget(this); UBUrlWidget* pLink = new UBUrlWidget(mpContainer);
pLink->setUrl(qsUrl); pLink->setUrl(qsUrl);
mUrlList << pLink; mUrlList << pLink;
mpLinks->addWidget(pLink); mpLinks->addWidget(pLink);
@ -344,14 +349,14 @@ void UBTeacherBarWidget::onTitleTextChanged(const QString& text)
void UBTeacherBarWidget::onActionButton() void UBTeacherBarWidget::onActionButton()
{ {
UBTeacherStudentAction* pAction = new UBTeacherStudentAction(this); UBTeacherStudentAction* pAction = new UBTeacherStudentAction(mpContainer);
mActionList << pAction; mActionList << pAction;
mpActions->addWidget(pAction); mpActions->addWidget(pAction);
} }
void UBTeacherBarWidget::onLinkButton() void UBTeacherBarWidget::onLinkButton()
{ {
UBUrlWidget* pUrl = new UBUrlWidget(this); UBUrlWidget* pUrl = new UBUrlWidget(mpContainer);
mUrlList << pUrl; mUrlList << pUrl;
mpLinks->addWidget(pUrl); mpLinks->addWidget(pUrl);
} }

@ -14,6 +14,7 @@ class UBMediaPlayer;
#include <QButtonGroup> #include <QButtonGroup>
#include <QPushButton> #include <QPushButton>
#include <QComboBox> #include <QComboBox>
#include <QStackedWidget>
#include "UBDockPaletteWidget.h" #include "UBDockPaletteWidget.h"
#include "customWidgets/UBWidgetList.h" #include "customWidgets/UBWidgetList.h"
@ -118,6 +119,7 @@ private:
QHBoxLayout* mpLinkLayout; QHBoxLayout* mpLinkLayout;
QLabel* mpCommentLabel; QLabel* mpCommentLabel;
QTextEdit* mpComments; QTextEdit* mpComments;
QStackedWidget* mpStackWidget;
QVector<UBTeacherStudentAction*> mActionList; QVector<UBTeacherStudentAction*> mActionList;
QVector<UBUrlWidget*> mUrlList; QVector<UBUrlWidget*> mUrlList;

Loading…
Cancel
Save