Commit 0981b138 authored by Claudio Valerio's avatar Claudio Valerio

first zero page teacher guide implementation

parent 0eed7eef
...@@ -111,8 +111,8 @@ else ...@@ -111,8 +111,8 @@ else
LAST_COMMITED_VERSION="`git describe $(git rev-list --tags --max-count=1)`" LAST_COMMITED_VERSION="`git describe $(git rev-list --tags --max-count=1)`"
if [ "v$VERSION" != "$LAST_COMMITED_VERSION" ]; then if [ "v$VERSION" != "$LAST_COMMITED_VERSION" ]; then
echo creating a tag with the version $VERSION echo creating a tag with the version $VERSION
# git tag -a "v$VERSION" -m "Generating setup for v$VERSION" git tag -a "v$VERSION" -m "Generating setup for v$VERSION"
# git push origin --tags git push origin --tags
fi fi
fi fi
...@@ -353,4 +353,4 @@ cd $RELEASE_DIR ...@@ -353,4 +353,4 @@ cd $RELEASE_DIR
rm ../../../install/linux/Open-Sankore.tar.gz rm ../../../install/linux/Open-Sankore.tar.gz
tar cvzf ../../../install/linux/Open-Sankore.tar.gz Open-Sankore.$VERSION -C . tar cvzf ../../../install/linux/Open-Sankore.tar.gz Open-Sankore.$VERSION -C .
notify-send "Open-Sankore" "tar.gz Build done" notify-send "Open-Sankore" "tar.gz Build done"
\ No newline at end of file
This diff is collapsed.
...@@ -254,8 +254,7 @@ UBTGAdaptableText#UBTGPresentationComment ...@@ -254,8 +254,7 @@ UBTGAdaptableText#UBTGPresentationComment
border : none; border : none;
} }
QFrame#UBTGEditionSeparator, QFrame#UBTGSeparator
QFrame#UBTGPresentationSepartor
{ {
background-color: #cccccc; background-color: #cccccc;
} }
...@@ -41,8 +41,6 @@ ...@@ -41,8 +41,6 @@
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "QFile" #include "QFile"
#include <QDomDocument>
#include "core/memcheck.h" #include "core/memcheck.h"
//#include "qtlogger.h" //#include "qtlogger.h"
......
...@@ -97,7 +97,7 @@ void UBMetadataDcSubsetAdaptor::persist(UBDocumentProxy* proxy) ...@@ -97,7 +97,7 @@ void UBMetadataDcSubsetAdaptor::persist(UBDocumentProxy* proxy)
xmlWriter.writeTextElement(nsDc, "title", proxy->metaData(UBSettings::documentName).toString()); xmlWriter.writeTextElement(nsDc, "title", proxy->metaData(UBSettings::documentName).toString());
xmlWriter.writeTextElement(nsDc, "type", proxy->metaData(UBSettings::documentGroupName).toString()); xmlWriter.writeTextElement(nsDc, "type", proxy->metaData(UBSettings::documentGroupName).toString());
xmlWriter.writeTextElement(nsDc, "date", QDate::currentDate().toString("yyyy-MM-dd")); xmlWriter.writeTextElement(nsDc, "date", proxy->metaData(UBSettings::documentDate).toString());
xmlWriter.writeTextElement(nsDc, "format", "image/svg+xml"); xmlWriter.writeTextElement(nsDc, "format", "image/svg+xml");
// introduced in UB 4.2 // introduced in UB 4.2
...@@ -108,8 +108,7 @@ void UBMetadataDcSubsetAdaptor::persist(UBDocumentProxy* proxy) ...@@ -108,8 +108,7 @@ void UBMetadataDcSubsetAdaptor::persist(UBDocumentProxy* proxy)
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri, "size", QString("%1x%2").arg(width).arg(height)); xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri, "size", QString("%1x%2").arg(width).arg(height));
// introduced in UB 4.4 // introduced in UB 4.4
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri, "updated-at", proxy->metaData(UBSettings::documentUpdatedAt).toString()); xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri, "updated-at", UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTimeUtc()));
// introduced in OpenSankore 1.40.00 // introduced in OpenSankore 1.40.00
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionTitle,proxy->metaData(UBSettings::sessionTitle).toString()); xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionTitle,proxy->metaData(UBSettings::sessionTitle).toString());
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionTarget,proxy->metaData(UBSettings::sessionTarget).toString()); xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionTarget,proxy->metaData(UBSettings::sessionTarget).toString());
...@@ -278,13 +277,21 @@ QMap<QString, QVariant> UBMetadataDcSubsetAdaptor::load(QString pPath) ...@@ -278,13 +277,21 @@ QMap<QString, QVariant> UBMetadataDcSubsetAdaptor::load(QString pPath)
metadata.insert(UBSettings::documentSize, QVariant(docSize)); metadata.insert(UBSettings::documentSize, QVariant(docSize));
} }
if (!updatedAtFound) // this is necessary to update the old files date
{ QString dateString = metadata.value(UBSettings::documentDate).toString();
metadata.insert(UBSettings::documentUpdatedAt, date + "T00:00:00Z"); if(dateString.length() < 10){
metadata.remove(UBSettings::documentDate);
metadata.insert(UBSettings::documentDate,dateString+"T00:00:00Z");
}
if (!updatedAtFound) {
metadata.insert(UBSettings::documentUpdatedAt, dateString);
} }
metadata.insert(UBSettings::documentDate, QVariant(date)); metadata.insert(UBSettings::documentDate, QVariant(date));
return metadata; return metadata;
} }
...@@ -239,7 +239,9 @@ UBDocumentProxy* UBPersistenceManager::createDocument(const QString& pGroupName, ...@@ -239,7 +239,9 @@ UBDocumentProxy* UBPersistenceManager::createDocument(const QString& pGroupName,
} }
doc->setMetaData(UBSettings::documentVersion, UBSettings::currentFileVersion); doc->setMetaData(UBSettings::documentVersion, UBSettings::currentFileVersion);
doc->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime())); QString currentDate = UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime());
doc->setMetaData(UBSettings::documentUpdatedAt,currentDate);
doc->setMetaData(UBSettings::documentDate,currentDate);
if (withEmptyPage) createDocumentSceneAt(doc, 0); if (withEmptyPage) createDocumentSceneAt(doc, 0);
......
...@@ -509,7 +509,6 @@ void UBDocumentController::openSelectedItem() ...@@ -509,7 +509,6 @@ void UBDocumentController::openSelectedItem()
if (proxy && isOKToOpenDocument(proxy)) if (proxy && isOKToOpenDocument(proxy))
{ {
//mBoardController->setActiveDocumentScene(proxy, thumb->sceneIndex());
UBApplication::applicationController->showBoard(); UBApplication::applicationController->showBoard();
} }
} }
...@@ -1639,4 +1638,4 @@ int UBDocumentController::getSelectedItemIndex() ...@@ -1639,4 +1638,4 @@ int UBDocumentController::getSelectedItemIndex()
return thumb->sceneIndex(); return thumb->sceneIndex();
} }
else return -1; else return -1;
} }
\ No newline at end of file
...@@ -34,7 +34,6 @@ class UBDocumentGroupTreeItem; ...@@ -34,7 +34,6 @@ class UBDocumentGroupTreeItem;
class UBDocumentProxyTreeItem; class UBDocumentProxyTreeItem;
class UBMainWindow; class UBMainWindow;
class UBDocumentToolsPalette; class UBDocumentToolsPalette;
//class UBKeyboardPalette;
class UBDocumentController : public QObject class UBDocumentController : public QObject
{ {
...@@ -77,8 +76,6 @@ class UBDocumentController : public QObject ...@@ -77,8 +76,6 @@ class UBDocumentController : public QObject
void paste(); void paste();
void focusChanged(QWidget *old, QWidget *current); void focusChanged(QWidget *old, QWidget *current);
// void showKeyboard(bool show);
protected: protected:
virtual void setupViews(); virtual void setupViews();
virtual void setupToolbar(); virtual void setupToolbar();
......
...@@ -295,13 +295,18 @@ QString UBDocumentProxy::sessionAuthors() ...@@ -295,13 +295,18 @@ QString UBDocumentProxy::sessionAuthors()
return QString(); return QString();
} }
QString UBDocumentProxy::documentDate() QDateTime UBDocumentProxy::documentDate()
{ {
if(mMetaDatas.contains(UBSettings::documentDate)){ if(mMetaDatas.contains(UBSettings::documentDate))
return metaData(UBSettings::documentDate).toString(); return UBStringUtils::fromUtcIsoDate(metaData(UBSettings::documentDate).toString());
}else{ return QDateTime::currentDateTime();
return QString(); }
}
QDateTime UBDocumentProxy::lastUpdate()
{
if(mMetaDatas.contains(UBSettings::documentUpdatedAt))
return UBStringUtils::fromUtcIsoDate(metaData(UBSettings::documentUpdatedAt).toString());
return QDateTime().currentDateTime();
} }
bool UBDocumentProxy::isModified() const bool UBDocumentProxy::isModified() const
......
...@@ -59,7 +59,9 @@ class UBDocumentProxy : public QObject ...@@ -59,7 +59,9 @@ class UBDocumentProxy : public QObject
QString sessionTopic(); QString sessionTopic();
void setSessionAuthor(const QString& authors); void setSessionAuthor(const QString& authors);
QString sessionAuthors(); QString sessionAuthors();
QString documentDate(); QDateTime documentDate();
QDateTime lastUpdate();
QSize defaultDocumentSize() const; QSize defaultDocumentSize() const;
......
...@@ -105,6 +105,11 @@ QString UBStringUtils::toUtcIsoDateTime(const QDateTime& dateTime) ...@@ -105,6 +105,11 @@ QString UBStringUtils::toUtcIsoDateTime(const QDateTime& dateTime)
return dateTime.toUTC().toString(Qt::ISODate) + "Z"; return dateTime.toUTC().toString(Qt::ISODate) + "Z";
} }
QDateTime UBStringUtils::fromUtcIsoDate(const QString& dateString)
{
return QDateTime::fromString(dateString,Qt::ISODate).toLocalTime();
}
...@@ -33,6 +33,7 @@ class UBStringUtils ...@@ -33,6 +33,7 @@ class UBStringUtils
static QString toCanonicalUuid(const QUuid& uuid); static QString toCanonicalUuid(const QUuid& uuid);
static QString toUtcIsoDateTime(const QDateTime& dateTime); static QString toUtcIsoDateTime(const QDateTime& dateTime);
static QDateTime fromUtcIsoDate(const QString& dateString);
}; };
......
This diff is collapsed.
...@@ -21,10 +21,17 @@ class QHeaderView; ...@@ -21,10 +21,17 @@ class QHeaderView;
class QLabel; class QLabel;
class QVBoxLayout; class QVBoxLayout;
class QPushButton; class QPushButton;
class UBDocumentProxy;
#include "UBTeacherGuideWidgetsTools.h" #include "UBTeacherGuideWidgetsTools.h"
#include "UBTGWidgetTreeDelegate.h" #include "UBTGWidgetTreeDelegate.h"
typedef enum
{
tUBTGZeroPageMode_EDITION,
tUBTGZeroPageMode_PRESENTATION
}tUBTGZeroPageMode;
/*************************************************************************** /***************************************************************************
* class UBTeacherGuideEditionWidget * * class UBTeacherGuideEditionWidget *
***************************************************************************/ ***************************************************************************/
...@@ -95,7 +102,73 @@ private: ...@@ -95,7 +102,73 @@ private:
}; };
/***************************************************************************
* class UBTeacherGuidePageZeroPresentationWidget *
***************************************************************************/
class UBTeacherGuidePageZeroEditionWidget : public QWidget
{
Q_OBJECT
public:
explicit UBTeacherGuidePageZeroEditionWidget(QWidget* parent, const char* name = "UBTeacherGuidePageZeroEditionWidget");
~UBTeacherGuidePageZeroEditionWidget();
QVector<tUBGEElementNode*> getData();
public slots:
void onActiveSceneChanged();
void switchToMode(tUBTGZeroPageMode mode = tUBTGZeroPageMode_EDITION);
private:
void fillComboBoxes();
QVBoxLayout* mpLayout;
QHBoxLayout* mpButtonTitleLayout;
QPushButton* mpModePushButton;
QLabel* mpPageNumberLabel;
UBTGAdaptableText* mpSessionTitle;
QFrame* mpSeparatorSessionTitle;
QLabel* mpAuthorsLabel;
UBTGAdaptableText* mpAuthors;
QFrame* mpSeparatorAuthors;
QLabel* mpCreationLabel;
QLabel* mpLastModifiedLabel;
QLabel* mpGoalsLabel;
UBTGAdaptableText* mpGoals;
QFrame* mpSeparatorGoals;
QLabel* mpIndexLabel;
QLabel* mpKeywordsLabel;
UBTGAdaptableText* mpKeywords;
QLabel* mpSchoolLevelItemLabel;
QComboBox* mpSchoolLevelBox;
QLabel* mpSchoolLevelValueLabel;
QLabel* mpSchoolBranchItemLabel;
QComboBox* mpSchoolBranchBox;
QLabel* mpSchoolBranchValueLabel;
QLabel* mpSchoolTypeItemLabel;
QComboBox* mpSchoolTypeBox;
QLabel* mpSchoolTypeValueLabel;
QFrame* mpSeparatorIndex;
QLabel* mpLicenceLabel;
QComboBox* mpLicenceBox;
QLabel* mpLicenceValueLabel;
QLabel* mpLicenceIcon;
QHBoxLayout* mpLicenceLayout;
QMap<QString,QString> mGradeLevelsMap;
QMap<QString,QStringList> mSubjects;
private slots:
void onSchoolLevelChanged(QString schoolLevel);
};
/*************************************************************************** /***************************************************************************
* class UBTeacherGuideWidget * * class UBTeacherGuideWidget *
...@@ -114,6 +187,7 @@ public slots: ...@@ -114,6 +187,7 @@ public slots:
void connectToStylusPalette(); void connectToStylusPalette();
private: private:
UBTeacherGuidePageZeroEditionWidget* mpPageZeroEditonWidget;
UBTeacherGuideEditionWidget* mpEditionWidget; UBTeacherGuideEditionWidget* mpEditionWidget;
UBTeacherGuidePresentationWidget* mpPresentationWidget; UBTeacherGuidePresentationWidget* mpPresentationWidget;
QVector<tUBGEElementNode*>mCurrentData; QVector<tUBGEElementNode*>mCurrentData;
......
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