|
|
@ -52,14 +52,16 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock |
|
|
|
mpStackWidget->addWidget(mpDocEditWidget); |
|
|
|
mpStackWidget->addWidget(mpDocEditWidget); |
|
|
|
|
|
|
|
|
|
|
|
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::mainWindow->actionQuit, SIGNAL(triggered()), this, SLOT(saveContent())); |
|
|
|
connect(UBApplication::mainWindow->actionQuit, SIGNAL(triggered()), this, SLOT(saveContent())); |
|
|
|
|
|
|
|
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(loadContentInfos())); |
|
|
|
|
|
|
|
connect(UBApplication::boardController, SIGNAL(activeDocumentChanged()), this, SLOT(onActiveDocumentChanged())); |
|
|
|
|
|
|
|
|
|
|
|
connect(mpPreview, SIGNAL(showEditMode()), this, SLOT(onShowEditMode())); |
|
|
|
connect(mpPreview, SIGNAL(showEditMode()), this, SLOT(onShowEditMode())); |
|
|
|
connect(mpDocPreviewWidget, SIGNAL(changeTBState(eTeacherBarState)), this, SLOT(onTBStateChanged(eTeacherBarState))); |
|
|
|
connect(mpDocPreviewWidget, SIGNAL(changeTBState(eTeacherBarState)), this, SLOT(onTBStateChanged(eTeacherBarState))); |
|
|
|
connect(mpDocEditWidget, SIGNAL(changeTBState(eTeacherBarState)), this, SLOT(onTBStateChanged(eTeacherBarState))); |
|
|
|
connect(mpDocEditWidget, SIGNAL(changeTBState(eTeacherBarState)), this, SLOT(onTBStateChanged(eTeacherBarState))); |
|
|
|
connect(mpPageEditWidget, SIGNAL(changeTBState(eTeacherBarState)), this, SLOT(onTBStateChanged(eTeacherBarState))); |
|
|
|
connect(mpPageEditWidget, SIGNAL(changeTBState(eTeacherBarState)), this, SLOT(onTBStateChanged(eTeacherBarState))); |
|
|
|
connect(mpPageEditWidget, SIGNAL(valueChanged()), this, SLOT(onValueChanged())); |
|
|
|
connect(mpPageEditWidget, SIGNAL(valueChanged()), this, SLOT(onValueChanged())); |
|
|
|
|
|
|
|
connect(mpDocEditWidget, SIGNAL(valueChanged()), this, SLOT(onValueChanged())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBTeacherBarWidget::~UBTeacherBarWidget() |
|
|
|
UBTeacherBarWidget::~UBTeacherBarWidget() |
|
|
@ -71,6 +73,11 @@ UBTeacherBarWidget::~UBTeacherBarWidget() |
|
|
|
DELETEPTR(mpStackWidget); |
|
|
|
DELETEPTR(mpStackWidget); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarWidget::onActiveDocumentChanged() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
loadContent(true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarWidget::onValueChanged() |
|
|
|
void UBTeacherBarWidget::onValueChanged() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(isEmpty()) |
|
|
|
if(isEmpty()) |
|
|
@ -93,22 +100,31 @@ void UBTeacherBarWidget::saveContent() |
|
|
|
mData.saveContent(); |
|
|
|
mData.saveContent(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarWidget::loadContent() |
|
|
|
void UBTeacherBarWidget::loadContentInfos() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
loadContent(false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarWidget::loadContent(bool docChanged) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Clear the old datas
|
|
|
|
// Clear the old datas
|
|
|
|
mpPageEditWidget->clearFields(); |
|
|
|
mpPageEditWidget->clearFields(); |
|
|
|
mpPreview->clearFields(); |
|
|
|
mpPreview->clearFields(); |
|
|
|
|
|
|
|
if(docChanged){ |
|
|
|
mpDocEditWidget->clearFields(); |
|
|
|
mpDocEditWidget->clearFields(); |
|
|
|
mpDocPreviewWidget->clearFields(); |
|
|
|
mpDocPreviewWidget->clearFields(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Update the datas
|
|
|
|
// Update the datas
|
|
|
|
mData.loadContent(); |
|
|
|
mData.loadContent(docChanged); |
|
|
|
|
|
|
|
|
|
|
|
// Update the fields
|
|
|
|
// Update the fields
|
|
|
|
mpPageEditWidget->updateFields(); |
|
|
|
mpPageEditWidget->updateFields(); |
|
|
|
mpPreview->updateFields(); |
|
|
|
mpPreview->updateFields(); |
|
|
|
|
|
|
|
if(docChanged){ |
|
|
|
mpDocEditWidget->updateFields(); |
|
|
|
mpDocEditWidget->updateFields(); |
|
|
|
mpDocPreviewWidget->updateFields(); |
|
|
|
mpDocPreviewWidget->updateFields(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(!isEmpty()){ |
|
|
|
if(!isEmpty()){ |
|
|
|
onTBStateChanged(eTeacherBarState_PagePreview); |
|
|
|
onTBStateChanged(eTeacherBarState_PagePreview); |
|
|
@ -127,9 +143,7 @@ bool UBTeacherBarWidget::isEmpty() |
|
|
|
mData.urls()->empty() && |
|
|
|
mData.urls()->empty() && |
|
|
|
mData.actions()->empty() && |
|
|
|
mData.actions()->empty() && |
|
|
|
mData.medias()->empty() && |
|
|
|
mData.medias()->empty() && |
|
|
|
mData.comments() == "" && |
|
|
|
mData.comments() == ""; |
|
|
|
mData.sessionTarget() == "" && |
|
|
|
|
|
|
|
mData.sessionTitle() == ""; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarWidget::onShowEditMode() |
|
|
|
void UBTeacherBarWidget::onShowEditMode() |
|
|
|