stored zero page informations

preferencesAboutTextFull
Claudio Valerio 13 years ago
parent bd2feb05e6
commit c6e990454c
  1. 2
      src/adaptors/UBMetadataDcSubsetAdaptor.cpp
  2. 1
      src/document/UBDocumentController.cpp
  3. 106
      src/document/UBDocumentProxy.cpp
  4. 14
      src/document/UBDocumentProxy.h
  5. 16
      src/gui/UBTeacherGuideWidget.cpp
  6. 2
      src/gui/UBTeacherGuideWidget.h
  7. 1
      src/gui/UBTeacherGuideWidgetsTools.cpp

@ -118,7 +118,6 @@ void UBMetadataDcSubsetAdaptor::persist(UBDocumentProxy* proxy)
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionBranch,proxy->metaData(UBSettings::sessionBranch).toString()); xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionBranch,proxy->metaData(UBSettings::sessionBranch).toString());
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionType,proxy->metaData(UBSettings::sessionType).toString()); xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionType,proxy->metaData(UBSettings::sessionType).toString());
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionLicence,proxy->metaData(UBSettings::sessionLicence).toString()); xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionLicence,proxy->metaData(UBSettings::sessionLicence).toString());
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionAuthors,proxy->metaData(UBSettings::sessionAuthors).toString());
xmlWriter.writeEndElement(); //dc:Description xmlWriter.writeEndElement(); //dc:Description
xmlWriter.writeEndElement(); //RDF xmlWriter.writeEndElement(); //RDF
@ -299,7 +298,6 @@ QMap<QString, QVariant> UBMetadataDcSubsetAdaptor::load(QString pPath)
metadata.insert(UBSettings::documentDate, QVariant(date)); metadata.insert(UBSettings::documentDate, QVariant(date));
return metadata; return metadata;
} }

@ -12,6 +12,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "UBDocumentController.h" #include "UBDocumentController.h"
#include <QtCore> #include <QtCore>

@ -50,13 +50,15 @@ void UBDocumentProxy::init()
setDefaultDocumentSize(UBSettings::settings()->pageSize->get().toSize()); setDefaultDocumentSize(UBSettings::settings()->pageSize->get().toSize());
setSessionTitle(""); //teacherGuide metadata
setSessionTarget(""); setMetaData(UBSettings::sessionTitle,"");
setSessionLicence(""); setMetaData(UBSettings::sessionAuthors,"");
setSessionKeywords(""); setMetaData(UBSettings::sessionGoals,"");
setSessionLevel(""); setMetaData(UBSettings::sessionKeywords,"");
setSessionTopic(""); setMetaData(UBSettings::sessionGradeLevel,"");
setSessionAuthor(""); setMetaData(UBSettings::sessionBranch,"");
setMetaData(UBSettings::sessionType,"");
setMetaData(UBSettings::sessionLicence,"");
} }
@ -204,96 +206,6 @@ void UBDocumentProxy::setUuid(const QUuid& uuid)
UBSettings::uniboardDocumentNamespaceUri + "/" + UBStringUtils::toCanonicalUuid(uuid)); UBSettings::uniboardDocumentNamespaceUri + "/" + UBStringUtils::toCanonicalUuid(uuid));
} }
QString UBDocumentProxy::sessionTitle() const
{
if(mMetaDatas.contains(UBSettings::sessionTitle))
return metaData(UBSettings::sessionTitle).toString();
else
return QString();
}
void UBDocumentProxy::setSessionTitle(const QString & sessionTitle)
{
setMetaData(UBSettings::sessionTitle,QVariant(sessionTitle));
}
QString UBDocumentProxy::sessionTarget() const
{
if(mMetaDatas.contains(UBSettings::sessionTarget))
return metaData(UBSettings::sessionTarget).toString();
else
return QString();
}
void UBDocumentProxy::setSessionTarget(const QString & sessionTarget)
{
setMetaData(UBSettings::sessionTarget,QVariant(sessionTarget));
}
QString UBDocumentProxy::sessionLicence() const
{
if(mMetaDatas.contains(UBSettings::sessionLicence))
return metaData(UBSettings::sessionLicence).toString();
else
return QString();
}
void UBDocumentProxy::setSessionLicence(const QString & sessionLicence)
{
setMetaData(UBSettings::sessionLicence,QVariant(sessionLicence));
}
void UBDocumentProxy::setSessionKeywords(const QString &kw)
{
setMetaData(UBSettings::sessionKeywords,QVariant(kw));
}
QString UBDocumentProxy::sessionKeywords()
{
if(mMetaDatas.contains(UBSettings::sessionKeywords))
return metaData(UBSettings::sessionKeywords).toString();
else
return QString();
}
void UBDocumentProxy::setSessionLevel(const QString &level)
{
setMetaData(UBSettings::sessionLevel,QVariant(level));
}
QString UBDocumentProxy::sessionLevel()
{
if(mMetaDatas.contains(UBSettings::sessionLevel))
return metaData(UBSettings::sessionLevel).toString();
else
return QString();
}
void UBDocumentProxy::setSessionTopic(const QString &topic)
{
setMetaData(UBSettings::sessionTopic,QVariant(topic));
}
QString UBDocumentProxy::sessionTopic()
{
if(mMetaDatas.contains(UBSettings::sessionTopic))
return metaData(UBSettings::sessionTopic).toString();
else
return QString();
}
void UBDocumentProxy::setSessionAuthor(const QString &authors)
{
setMetaData(UBSettings::sessionAuthors,QVariant(authors));
}
QString UBDocumentProxy::sessionAuthors()
{
if(mMetaDatas.contains(UBSettings::sessionAuthors))
return metaData(UBSettings::sessionAuthors).toString();
else
return QString();
}
QDateTime UBDocumentProxy::documentDate() QDateTime UBDocumentProxy::documentDate()
{ {

@ -45,20 +45,6 @@ class UBDocumentProxy : public QObject
QString name() const; QString name() const;
QString groupName() const; QString groupName() const;
QString sessionTitle() const;
void setSessionTitle(const QString& sessionTitle);
QString sessionTarget() const;
void setSessionTarget(const QString& sessionTarget);
QString sessionLicence() const;
void setSessionLicence(const QString& sessionLicence);
void setSessionKeywords(const QString& kw);
QString sessionKeywords();
void setSessionLevel(const QString& level);
QString sessionLevel();
void setSessionTopic(const QString& topic);
QString sessionTopic();
void setSessionAuthor(const QString& authors);
QString sessionAuthors();
QDateTime documentDate(); QDateTime documentDate();
QDateTime lastUpdate(); QDateTime lastUpdate();

@ -43,6 +43,15 @@
#define UBTG_SEPARATOR_FIXED_HEIGHT 3 #define UBTG_SEPARATOR_FIXED_HEIGHT 3
typedef enum
{
eUBTGAddSubItemWidgetType_None,
eUBTGAddSubItemWidgetType_Action ,
eUBTGAddSubItemWidgetType_Media,
eUBTGAddSubItemWidgetType_Url
}eUBTGAddSubItemWidgetType;
/*************************************************************************** /***************************************************************************
* class UBTeacherGuideEditionWidget * * class UBTeacherGuideEditionWidget *
@ -61,7 +70,6 @@ UBTeacherGuideEditionWidget::UBTeacherGuideEditionWidget(QWidget *parent, const
, mpAddAnActionItem(NULL) , mpAddAnActionItem(NULL)
, mpAddAMediaItem(NULL) , mpAddAMediaItem(NULL)
, mpAddALinkItem(NULL) , mpAddALinkItem(NULL)
, mpTreeDelegate(NULL)
{ {
setObjectName(name); setObjectName(name);
@ -94,10 +102,7 @@ UBTeacherGuideEditionWidget::UBTeacherGuideEditionWidget(QWidget *parent, const
mpTreeWidget = new QTreeWidget(this); mpTreeWidget = new QTreeWidget(this);
mpLayout->addWidget(mpTreeWidget); mpLayout->addWidget(mpTreeWidget);
mpTreeDelegate = new UBTGWidgetTreeDelegate();
mpRootWidgetItem = mpTreeWidget->invisibleRootItem(); mpRootWidgetItem = mpTreeWidget->invisibleRootItem();
//mpTreeWidget->setItemDelegate(mpTreeDelegate);
mpTreeWidget->setRootIsDecorated(false); mpTreeWidget->setRootIsDecorated(false);
mpTreeWidget->setIndentation(0); mpTreeWidget->setIndentation(0);
mpTreeWidget->setDropIndicatorShown(false); mpTreeWidget->setDropIndicatorShown(false);
@ -131,7 +136,6 @@ UBTeacherGuideEditionWidget::~UBTeacherGuideEditionWidget()
DELETEPTR(mpAddAnActionItem); DELETEPTR(mpAddAnActionItem);
DELETEPTR(mpAddAMediaItem); DELETEPTR(mpAddAMediaItem);
DELETEPTR(mpAddALinkItem); DELETEPTR(mpAddALinkItem);
DELETEPTR(mpTreeDelegate);
DELETEPTR(mpTreeWidget) DELETEPTR(mpTreeWidget)
DELETEPTR(mpLayout); DELETEPTR(mpLayout);
} }
@ -755,7 +759,6 @@ void UBTeacherGuidePageZeroWidget::onActiveSceneChanged()
mpCreationLabel->setText(tr("Created the: ") + creationDate.toString(Qt::SystemLocaleShortDate)); mpCreationLabel->setText(tr("Created the: ") + creationDate.toString(Qt::SystemLocaleShortDate));
QDateTime updatedDate = documentProxy->lastUpdate(); QDateTime updatedDate = documentProxy->lastUpdate();
mpLastModifiedLabel->setText(tr("Updated the: ") + updatedDate.toString(Qt::SystemLocaleShortDate)); mpLastModifiedLabel->setText(tr("Updated the: ") + updatedDate.toString(Qt::SystemLocaleShortDate));
persistData();
loadData(); loadData();
} }
} }
@ -768,7 +771,6 @@ void UBTeacherGuidePageZeroWidget::hideEvent ( QHideEvent * event )
void UBTeacherGuidePageZeroWidget::loadData() void UBTeacherGuidePageZeroWidget::loadData()
{ {
UBDocumentProxy* documentProxy = UBApplication::boardController->activeDocument(); UBDocumentProxy* documentProxy = UBApplication::boardController->activeDocument();
mpSessionTitle->setText(documentProxy->metaData(UBSettings::sessionTitle).toString()); mpSessionTitle->setText(documentProxy->metaData(UBSettings::sessionTitle).toString());
mpAuthors->setText(documentProxy->metaData(UBSettings::sessionAuthors).toString()); mpAuthors->setText(documentProxy->metaData(UBSettings::sessionAuthors).toString());

@ -24,7 +24,6 @@ class QPushButton;
class UBDocumentProxy; class UBDocumentProxy;
#include "UBTeacherGuideWidgetsTools.h" #include "UBTeacherGuideWidgetsTools.h"
#include "UBTGWidgetTreeDelegate.h"
typedef enum typedef enum
{ {
@ -64,7 +63,6 @@ private:
UBAddItem* mpAddAnActionItem; UBAddItem* mpAddAnActionItem;
UBAddItem* mpAddAMediaItem; UBAddItem* mpAddAMediaItem;
UBAddItem* mpAddALinkItem; UBAddItem* mpAddALinkItem;
UBTGWidgetTreeDelegate* mpTreeDelegate;
}; };

@ -24,7 +24,6 @@
#include <QApplication> #include <QApplication>
#include "UBTeacherGuideWidgetsTools.h" #include "UBTeacherGuideWidgetsTools.h"
#include "UBTGWidgetTreeDelegate.h"
#include "core/UBPersistenceManager.h" #include "core/UBPersistenceManager.h"

Loading…
Cancel
Save