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

first zero page teacher guide implementation

parent 0eed7eef
......@@ -111,8 +111,8 @@ else
LAST_COMMITED_VERSION="`git describe $(git rev-list --tags --max-count=1)`"
if [ "v$VERSION" != "$LAST_COMMITED_VERSION" ]; then
echo creating a tag with the version $VERSION
# git tag -a "v$VERSION" -m "Generating setup for v$VERSION"
# git push origin --tags
git tag -a "v$VERSION" -m "Generating setup for v$VERSION"
git push origin --tags
fi
fi
......@@ -353,4 +353,4 @@ cd $RELEASE_DIR
rm ../../../install/linux/Open-Sankore.tar.gz
tar cvzf ../../../install/linux/Open-Sankore.tar.gz Open-Sankore.$VERSION -C .
notify-send "Open-Sankore" "tar.gz Build done"
\ No newline at end of file
notify-send "Open-Sankore" "tar.gz Build done"
This diff is collapsed.
......@@ -254,8 +254,7 @@ UBTGAdaptableText#UBTGPresentationComment
border : none;
}
QFrame#UBTGEditionSeparator,
QFrame#UBTGPresentationSepartor
QFrame#UBTGSeparator
{
background-color: #cccccc;
}
......@@ -41,8 +41,6 @@
#include "core/UBApplication.h"
#include "QFile"
#include <QDomDocument>
#include "core/memcheck.h"
//#include "qtlogger.h"
......
......@@ -97,7 +97,7 @@ void UBMetadataDcSubsetAdaptor::persist(UBDocumentProxy* proxy)
xmlWriter.writeTextElement(nsDc, "title", proxy->metaData(UBSettings::documentName).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");
// introduced in UB 4.2
......@@ -108,8 +108,7 @@ void UBMetadataDcSubsetAdaptor::persist(UBDocumentProxy* proxy)
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri, "size", QString("%1x%2").arg(width).arg(height));
// 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
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionTitle,proxy->metaData(UBSettings::sessionTitle).toString());
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionTarget,proxy->metaData(UBSettings::sessionTarget).toString());
......@@ -278,13 +277,21 @@ QMap<QString, QVariant> UBMetadataDcSubsetAdaptor::load(QString pPath)
metadata.insert(UBSettings::documentSize, QVariant(docSize));
}
if (!updatedAtFound)
{
metadata.insert(UBSettings::documentUpdatedAt, date + "T00:00:00Z");
// this is necessary to update the old files date
QString dateString = metadata.value(UBSettings::documentDate).toString();
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));
return metadata;
}
......@@ -239,7 +239,9 @@ UBDocumentProxy* UBPersistenceManager::createDocument(const QString& pGroupName,
}
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);
......
......@@ -509,7 +509,6 @@ void UBDocumentController::openSelectedItem()
if (proxy && isOKToOpenDocument(proxy))
{
//mBoardController->setActiveDocumentScene(proxy, thumb->sceneIndex());
UBApplication::applicationController->showBoard();
}
}
......@@ -1639,4 +1638,4 @@ int UBDocumentController::getSelectedItemIndex()
return thumb->sceneIndex();
}
else return -1;
}
\ No newline at end of file
}
......@@ -34,7 +34,6 @@ class UBDocumentGroupTreeItem;
class UBDocumentProxyTreeItem;
class UBMainWindow;
class UBDocumentToolsPalette;
//class UBKeyboardPalette;
class UBDocumentController : public QObject
{
......@@ -77,8 +76,6 @@ class UBDocumentController : public QObject
void paste();
void focusChanged(QWidget *old, QWidget *current);
// void showKeyboard(bool show);
protected:
virtual void setupViews();
virtual void setupToolbar();
......
......@@ -295,13 +295,18 @@ QString UBDocumentProxy::sessionAuthors()
return QString();
}
QString UBDocumentProxy::documentDate()
QDateTime UBDocumentProxy::documentDate()
{
if(mMetaDatas.contains(UBSettings::documentDate)){
return metaData(UBSettings::documentDate).toString();
}else{
return QString();
}
if(mMetaDatas.contains(UBSettings::documentDate))
return UBStringUtils::fromUtcIsoDate(metaData(UBSettings::documentDate).toString());
return QDateTime::currentDateTime();
}
QDateTime UBDocumentProxy::lastUpdate()
{
if(mMetaDatas.contains(UBSettings::documentUpdatedAt))
return UBStringUtils::fromUtcIsoDate(metaData(UBSettings::documentUpdatedAt).toString());
return QDateTime().currentDateTime();
}
bool UBDocumentProxy::isModified() const
......
......@@ -59,7 +59,9 @@ class UBDocumentProxy : public QObject
QString sessionTopic();
void setSessionAuthor(const QString& authors);
QString sessionAuthors();
QString documentDate();
QDateTime documentDate();
QDateTime lastUpdate();
QSize defaultDocumentSize() const;
......
......@@ -105,6 +105,11 @@ QString UBStringUtils::toUtcIsoDateTime(const QDateTime& dateTime)
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
static QString toCanonicalUuid(const QUuid& uuid);
static QString toUtcIsoDateTime(const QDateTime& dateTime);
static QDateTime fromUtcIsoDate(const QString& dateString);
};
......
This diff is collapsed.
......@@ -21,10 +21,17 @@ class QHeaderView;
class QLabel;
class QVBoxLayout;
class QPushButton;
class UBDocumentProxy;
#include "UBTeacherGuideWidgetsTools.h"
#include "UBTGWidgetTreeDelegate.h"
typedef enum
{
tUBTGZeroPageMode_EDITION,
tUBTGZeroPageMode_PRESENTATION
}tUBTGZeroPageMode;
/***************************************************************************
* class UBTeacherGuideEditionWidget *
***************************************************************************/
......@@ -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 *
......@@ -114,6 +187,7 @@ public slots:
void connectToStylusPalette();
private:
UBTeacherGuidePageZeroEditionWidget* mpPageZeroEditonWidget;
UBTeacherGuideEditionWidget* mpEditionWidget;
UBTeacherGuidePresentationWidget* mpPresentationWidget;
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