Partial backup of the teacherbar rework

preferencesAboutTextFull
shibakaneki 13 years ago
parent 9ec9128412
commit b994977227
  1. 15
      src/gui/UBTBPageEditWidget.cpp
  2. 3
      src/gui/UBTBPageEditWidget.h
  3. 2
      src/gui/UBTeacherBarWidget.cpp

@ -94,8 +94,8 @@ UBTBPageEditWidget::UBTBPageEditWidget(UBTeacherBarDataMgr *pDataMgr, QWidget *p
mPagePreviewLayout.addStretch(1); mPagePreviewLayout.addStretch(1);
mLayout.addLayout(&mPagePreviewLayout, 0); mLayout.addLayout(&mPagePreviewLayout, 0);
connect(mpTitle, SIGNAL(textChanged(QString)), this, SLOT(onValueChanged())); connect(mpTitle, SIGNAL(textChanged(QString)), this, SLOT(onTitleChanged()));
connect(mpComments, SIGNAL(textChanged()), this, SLOT(onValueChanged())); connect(mpComments, SIGNAL(textChanged()), this, SLOT(onCommentsChanged()));
connect(mpActionButton, SIGNAL(clicked()), this, SLOT(onActionButton())); connect(mpActionButton, SIGNAL(clicked()), this, SLOT(onActionButton()));
connect(mpLinkButton, SIGNAL(clicked()), this, SLOT(onLinkButton())); connect(mpLinkButton, SIGNAL(clicked()), this, SLOT(onLinkButton()));
connect(mpDocumentEditbutton, SIGNAL(clicked()), this, SLOT(onDocumentEditClicked())); connect(mpDocumentEditbutton, SIGNAL(clicked()), this, SLOT(onDocumentEditClicked()));
@ -119,9 +119,14 @@ UBTBPageEditWidget::~UBTBPageEditWidget()
DELETEPTR(mpTitle); DELETEPTR(mpTitle);
} }
void UBTBPageEditWidget::onValueChanged() void UBTBPageEditWidget::onTitleChanged()
{ {
mpDataMgr->setPageTitle(mpTitle->text()); mpDataMgr->setPageTitle(mpTitle->text());
emit valueChanged();
}
void UBTBPageEditWidget::onCommentsChanged()
{
mpDataMgr->setComments(mpComments->document()->toPlainText()); mpDataMgr->setComments(mpComments->document()->toPlainText());
emit valueChanged(); emit valueChanged();
} }
@ -185,7 +190,6 @@ void UBTBPageEditWidget::saveFields()
void UBTBPageEditWidget::updateFields() void UBTBPageEditWidget::updateFields()
{ {
mpTitle->setText(mpDataMgr->pageTitle()); mpTitle->setText(mpDataMgr->pageTitle());
qDebug() << "mpComments will become: " << mpDataMgr->comments();
foreach(sAction action, *mpDataMgr->actions()){ foreach(sAction action, *mpDataMgr->actions()){
UBTeacherStudentAction* pAction = new UBTeacherStudentAction(this); UBTeacherStudentAction* pAction = new UBTeacherStudentAction(this);
@ -205,8 +209,7 @@ void UBTBPageEditWidget::updateFields()
// TODO: add the medias // TODO: add the medias
qDebug() << "mpComments will become: " << mpDataMgr->comments(); mpComments->document()->setPlainText(mpDataMgr->comments());
mpComments->setPlainText(mpDataMgr->comments());
} }
void UBTBPageEditWidget::clearFields() void UBTBPageEditWidget::clearFields()

@ -97,7 +97,8 @@ signals:
void changeTBState(eTeacherBarState state); void changeTBState(eTeacherBarState state);
private slots: private slots:
void onValueChanged(); void onTitleChanged();
void onCommentsChanged();
void onActionButton(); void onActionButton();
void onLinkButton(); void onLinkButton();
void onMediaDropped(const QString& url); void onMediaDropped(const QString& url);

@ -104,8 +104,6 @@ void UBTeacherBarWidget::loadContent()
// Update the datas // Update the datas
mData.loadContent(); mData.loadContent();
qDebug() << mData.comments();
// Update the fields // Update the fields
mpPageEditWidget->updateFields(); mpPageEditWidget->updateFields();
mpPreview->updateFields(); mpPreview->updateFields();

Loading…
Cancel
Save