Commit 22bd3e08 authored by shibakaneki's avatar shibakaneki

Merge branch 'master' of github.com:Sankore/Sankore-3.1

parents 0d517aad 2a1a6ebf
......@@ -443,7 +443,6 @@ bool UBCFFAdaptor::UBToCFFConverter::parseMetadata()
QSize tmpSize = getSVGDimentions(nextInElement.text());
if (!tmpSize.isNull()) {
mSVGSize = tmpSize;
mViewbox.setRect(0,0, tmpSize.width(), tmpSize.height());
} else {
qDebug() << "can't interpret svg section size";
errorStr = "InterpretSvgSizeError";
......@@ -487,6 +486,11 @@ bool UBCFFAdaptor::UBToCFFConverter::parseContent() {
}
if (QRect() == mViewbox)
{
mViewbox.setRect(0,0, mSVGSize.width(), mSVGSize.height());
}
svgDocumentSection.setAttribute(aIWBViewBox, rectToIWBAttr(mViewbox));
svgDocumentSection.setAttribute(aWidth, QString("%1").arg(mViewbox.width()));
svgDocumentSection.setAttribute(aHeight, QString("%1").arg(mViewbox.height()));
......@@ -639,30 +643,29 @@ QDomElement UBCFFAdaptor::UBToCFFConverter::parseSvgPageSection(const QDomElemen
void UBCFFAdaptor::UBToCFFConverter::writeQDomElementToXML(const QDomNode &node)
{
if (!node.isNull()){
if (node.isText())
if (!node.isNull())
if (node.isText())
{
mIWBContentWriter->writeCharacters(node.nodeValue());
}
else
{
mIWBContentWriter->writeStartElement(node.namespaceURI(), node.toElement().tagName());
for (int i = 0; i < node.toElement().attributes().count(); i++)
{
mIWBContentWriter->writeCharacters(node.nodeValue());
QDomAttr attr = node.toElement().attributes().item(i).toAttr();
mIWBContentWriter->writeAttribute(attr.name(), attr.value());
}
else
QDomNode child = node.firstChild();
while(!child.isNull())
{
mIWBContentWriter->writeStartElement(node.namespaceURI(), node.toElement().tagName());
for (int i = 0; i < node.toElement().attributes().count(); i++)
{
QDomAttr attr = node.toElement().attributes().item(i).toAttr();
mIWBContentWriter->writeAttribute(attr.name(), attr.value());
}
QDomNode child = node.firstChild();
while(!child.isNull())
{
writeQDomElementToXML(child);
child = child.nextSibling();
}
mIWBContentWriter->writeEndElement();
writeQDomElementToXML(child);
child = child.nextSibling();
}
}
mIWBContentWriter->writeEndElement();
}
}
bool UBCFFAdaptor::UBToCFFConverter::writeExtendedIwbSection()
......@@ -1025,8 +1028,6 @@ void UBCFFAdaptor::UBToCFFConverter::setCoordinatesFromUBZ(const QDomElement &ub
item.setRect(0,0, width, height);
item.setTransform(tr);
item.setTransformOriginPoint(item.boundingRect().center());
item.setRotation(-alpha);
QMatrix sceneMatrix = item.sceneMatrix();
......@@ -1107,6 +1108,9 @@ bool UBCFFAdaptor::UBToCFFConverter::setContentFromUBZ(const QDomElement &ubzEle
svgElement.setAttribute(aSVGRequiredExtension, svgRequiredExtensionPrefix+fePng);
}
}
}else
{
bRet = false;
}
if (!bRet)
......@@ -1142,7 +1146,6 @@ void UBCFFAdaptor::UBToCFFConverter::setCFFTextFromHTMLTextNode(const QDomElemen
QDomNode spanNode = htmlPNode.firstChild();
while (!spanNode.isNull())
{
if (spanNode.isText())
......@@ -1153,7 +1156,10 @@ void UBCFFAdaptor::UBToCFFConverter::setCFFTextFromHTMLTextNode(const QDomElemen
else
if (spanNode.isElement())
{
QDomElement pElementIwb;
QDomElement spanElement = textDoc.createElementNS(svgIWBNS,svgIWBNSPrefix + ":" + tIWBTspan);
setCommonAttributesFromUBZ(htmlPNode.toElement(), pElementIwb, spanElement);
if (spanNode.hasAttributes())
{
int attrCount = spanNode.attributes().count();
......@@ -1196,6 +1202,8 @@ QString UBCFFAdaptor::UBToCFFConverter::ubzAttrNameToCFFAttrName(QString cffAttr
QString sRet = cffAttrName;
if (QString("color") == cffAttrName)
sRet = QString("fill");
if (QString("align") == cffAttrName)
sRet = QString("text-align");
return sRet;
}
......
......@@ -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);
......
......@@ -470,14 +470,12 @@ void UBPreferencesController::toolbarOrientationVertical(bool checked)
{
UBSettings* settings = UBSettings::settings();
settings->appToolBarOrientationVertical->set(checked);
//settings->appToolBarOrientationVertical->set(true);
}
void UBPreferencesController::toolbarOrientationHorizontal(bool checked)
{
UBSettings* settings = UBSettings::settings();
settings->appToolBarOrientationVertical->set(!checked);
//settings->appToolBarOrientationVertical->set(false);
}
UBBrushPropertiesFrame::UBBrushPropertiesFrame(QFrame* owner, const QList<QColor>& lightBackgroundColors,
......
......@@ -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