Commit b447369b authored by shibakaneki's avatar shibakaneki

Resolved an issue related to the teacherbar

parent 2b619b22
......@@ -1072,7 +1072,8 @@ void UBPersistenceManager::persistTeacherBar(UBDocumentProxy* pDocumentProxy, in
if(f.open(QIODevice::WriteOnly))
{
QDomElement rootElem = domDoc.documentElement();
QDomNode teacherBarNode = domDoc.namedItem("teacherBar");
QDomNode teacherBarNode = rootElem.namedItem("teacherBar");
if(teacherBarNode.isNull())
{
// Create the element
......@@ -1120,6 +1121,7 @@ sTeacherBarInfos UBPersistenceManager::getTeacherBarInfos(UBDocumentProxy* pDocu
QDomDocument domDoc;
if(domDoc.setContent(f.readAll()))
{
qDebug() << domDoc.toString();
QDomElement rootElem = domDoc.documentElement();
QDomNode teacherBarNode = rootElem.namedItem("teacherBar");
......
#include "UBTeacherBarWidget.h"
#include "UBTeacherBarWidget.h"
#include "core/UBApplication.h"
#include "core/UBPersistenceManager.h"
......@@ -259,6 +259,7 @@ void UBTeacherBarWidget::saveContent()
{
sTeacherBarInfos infos;
infos.title = mpTitle->text();
qDebug() << "Title read: " << infos.title;
infos.phasis = mpPhasis->currentIndex();
infos.Duration = mpDuration->currentIndex();
infos.material = mpEquipment->text();
......@@ -276,6 +277,7 @@ void UBTeacherBarWidget::loadContent()
{
sTeacherBarInfos nextInfos = UBPersistenceManager::persistenceManager()->getTeacherBarInfos(UBApplication::boardController->activeDocument(), UBApplication::boardController->activeSceneIndex());
mpTitle->setText(nextInfos.title);
qDebug() << "Title loaded: " << nextInfos.title << ", Title set: " << mpTitle->text();
mpPhasis->setCurrentIndex(nextInfos.phasis);
mpDuration->setCurrentIndex(nextInfos.Duration);
mpEquipment->setText(nextInfos.material);
......
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