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

preferencesAboutTextFull
shibakaneki 13 years ago
commit 40be502737
  1. 2
      Sankore_3.1.pro
  2. 19
      buildDebianPackage
  3. 0
      release.linux.sh
  4. 10
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/index.html
  5. 20
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/js/languages.js
  6. 19
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/js/script.js
  7. 8
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/js/translation/en.js
  8. 8
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/js/translation/fr.js
  9. 8
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/js/translation/ru.js
  10. 5
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/nbproject/private/private.properties
  11. 4
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/nbproject/private/private.xml
  12. 7
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/nbproject/project.properties
  13. 9
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/nbproject/project.xml
  14. 97
      src/adaptors/UBExportFullPDF.cpp
  15. 7
      src/adaptors/UBExportFullPDF.h
  16. 1
      src/adaptors/UBExportPDF.cpp
  17. 3
      src/board/UBBoardPaletteManager.cpp
  18. 1
      src/core/UBApplicationController.cpp

@ -13,7 +13,7 @@ linux-g++-64 {
VERSION_MAJ = 1
VERSION_MIN = 40
VERSION_TYPE = b # a = alpha, b = beta, r = release, other => error
VERSION_PATCH = 02
VERSION_PATCH = 03
VERSION = "$${VERSION_MAJ}.$${VERSION_MIN}.$${VERSION_TYPE}.$${VERSION_PATCH}"
VERSION = $$replace(VERSION, "\\.r", "")

@ -49,8 +49,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
@ -192,6 +192,9 @@ CONTROL_FILE="$BASE_WORKING_DIR/DEBIAN/control"
CHANGE_LOG_TEXT="changelog.txt"
ARCHITECTURE=`uname -i`
if [ "$ARCHITECTURE" == "x86_64" ]; then
ARCHITECTURE="amd64"
fi
echo "Open-Sankore ($VERSION) $ARCHITECTURE; urgency=low" > "$CHANGE_LOG_FILE"
echo >> "$CHANGE_LOG_FILE"
@ -206,8 +209,8 @@ echo "Priority: optional" >> "$CONTROL_FILE"
echo "Architecture: $ARCHITECTURE" >> "$CONTROL_FILE"
echo "Essential: no" >> "$CONTROL_FILE"
echo "Installed-Size: `du -s $SANKORE_PACKAGE_DIRECTORY | awk '{ print $1 }'`" >> "$CONTROL_FILE"
echo "Maintainer: Claudio VALERIO <claudio@open-sankore.org>" >> "$CONTROL_FILE"
echo "Homepage: http://www.open-sankore.org" >> "$CONTROL_FILE"
echo "Maintainer: Open-Sankoré Developers team <dev@open-sankore.org>" >> "$CONTROL_FILE"
echo "Homepage: http://dev.open-sankore.org" >> "$CONTROL_FILE"
echo -n "Depends: " >> "$CONTROL_FILE"
unset tab
declare -a tab
@ -223,6 +226,10 @@ for l in `objdump -p $SANKORE_PACKAGE_DIRECTORY/Open-Sankore | grep NEEDED | awk
done;
done;
#additional dependencies
tab[$count]="gtk2-engines-pixbuf"
((count++))
for ((i=0;i<${#tab[@]};i++)); do
if [ $i -ne "0" ]; then
echo -n ", " >> "$CONTROL_FILE"
@ -254,10 +261,10 @@ chmod 755 "$BASE_WORKING_DIR/DEBIAN/postint"
mkdir -p "install/linux"
sudo chown -R root:root $BASE_WORKING_DIR
fakeroot chown -R root:root $BASE_WORKING_DIR
dpkg -b "$BASE_WORKING_DIR" install/linux/Open-Sankore_${VERSION}_$ARCHITECTURE.deb
notify-send "Open-Sankore" "Package built"
#clean up mess
#sudo rm -rf $BASE_WORKING_DIR
#fakeroot rm -rf $BASE_WORKING_DIR

@ -10,6 +10,14 @@
<script type="text/javascript" src="js/script.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var lang = ""; //locale language
if(window.sankore){
lang = sankore.locale().substr(0,2);
} else
lang = "en";
$("<script type='text/javascript' src='js/translation/" + lang + ".js'>").appendTo("head");
if((typeof sankoreLang) == "undefined")
$("<script type='text/javascript' src='js/translation/en.js'>").appendTo("head");
start();
//here you can put your code
if(window.sankore)
@ -41,6 +49,6 @@
</div>
</div>
<div style="width: 100%; height: 25px;"></div>
</body>
</html>

@ -1,20 +0,0 @@
var sankoreLang = {
"en":{
"short_desc": "Place the pictures in ascending order.",
"display":"Display",
"edit":"Edit",
"add":"Add new block"
},
"ru":{
"short_desc": "Расположите картинки в порядке возрастания цифр.",
"display":"Показать",
"edit":"Изменить",
"add":"Добавить новый блок"
},
"fr":{
"short_desc": "Placez les photos dans l'ordre croissant.",
"display":"D'affichage",
"edit":"Modifier",
"add":"Ajouter nouveau bloc"
}
};

@ -1,19 +1,8 @@
var lang = ""; //locale language
//main function
function start(){
if(window.sankore){
try{
lang = sankore.locale().substr(0,2);
sankoreLang[lang].edit;
} catch(e){
lang = "en";
}
} else
lang = "en";
$("#display_text").text(sankoreLang[lang].display);
$("#edit_text").text(sankoreLang[lang].edit);
$("#display_text").text(sankoreLang.display);
$("#edit_text").text(sankoreLang.edit);
if(window.sankore){
if(sankore.preference("odr_des_imgs","")){
@ -114,7 +103,7 @@ function start(){
// }, 1);
$("<div class='add_block'>" + sankoreLang[lang].add + "</div>").appendTo("body");
$("<div class='add_block'>" + sankoreLang.add + "</div>").appendTo("body");
}
}
});
@ -251,7 +240,7 @@ function showExample(){
var imgs_container = $("<div class='imgs_cont'>").appendTo(container);
var number = $("<div class='number_cont'>1</div>").appendTo(sub_container);
var text = $("<div class='text_cont'>" + sankoreLang[lang].short_desc + "</div>").appendTo(sub_container);
var text = $("<div class='text_cont'>" + sankoreLang.short_desc + "</div>").appendTo(sub_container);
$("<input type='hidden' value='1*2*3*4*5*'/>").appendTo(imgs_container);

@ -0,0 +1,8 @@
var sankoreLang = {
short_desc: "Place the pictures in ascending order.",
display:"Display",
edit:"Edit",
add:"Add new block"
};

@ -0,0 +1,8 @@
var sankoreLang = {
short_desc: "Placez les photos dans l'ordre croissant.",
display:"D'affichage",
edit:"Modifier",
add:"Ajouter nouveau bloc"
};

@ -0,0 +1,8 @@
var sankoreLang = {
short_desc: "Расположите картинки в порядке возрастания цифр.",
display:"Показать",
edit:"Изменить",
add:"Добавить новый блок"
};

@ -1,5 +0,0 @@
copy.src.files=false
copy.src.target=
index.file=index.html
run.as=LOCAL
url=http://localhost/Ordonner_des_images/

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
</project-private>

@ -1,7 +0,0 @@
include.path=${php.global.include.path}
php.version=PHP_5
source.encoding=UTF-8
src.dir=.
tags.asp=false
tags.short=true
web.root=.

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.php.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/php-project/1">
<name>Ordonner_des_images.wgt</name>
</data>
</configuration>
</project>

@ -46,7 +46,10 @@ using namespace merge_lib;
UBExportFullPDF::UBExportFullPDF(QObject *parent)
: UBExportAdaptor(parent)
{
// NOOP
//need to calculate screen resolution
QDesktopWidget* desktop = UBApplication::desktop();
int dpiCommon = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2;
mScaleFactor = 72.0f / dpiCommon;
}
@ -56,7 +59,7 @@ UBExportFullPDF::~UBExportFullPDF()
}
void UBExportFullPDF::saveOverlayPdf(UBDocumentProxy* pDocumentProxy, QString filename)
void UBExportFullPDF::saveOverlayPdf(UBDocumentProxy* pDocumentProxy, const QString& filename)
{
if (!pDocumentProxy || filename.length() == 0 || pDocumentProxy->pageCount() == 0)
return;
@ -70,9 +73,6 @@ void UBExportFullPDF::saveOverlayPdf(UBDocumentProxy* pDocumentProxy, QString fi
pdfPrinter.setOutputFileName(filename);
pdfPrinter.setFullPage(true);
const qreal margin = UBSettings::settings()->pdfMargin->get().toDouble() * pdfPrinter.resolution() / 25.4;
mMargin = margin;
QPainter* pdfPainter = 0;
for(int pageIndex = 0 ; pageIndex < pDocumentProxy->pageCount(); pageIndex++)
@ -87,54 +87,20 @@ void UBExportFullPDF::saveOverlayPdf(UBDocumentProxy* pDocumentProxy, QString fi
scene->setRenderingQuality(UBItem::RenderingQualityHigh);
scene->setRenderingContext(UBGraphicsScene::PdfExport);
UBGraphicsPDFItem *pdfItem = qgraphicsitem_cast<UBGraphicsPDFItem*>(scene->backgroundObject());
if (pdfItem)
{
QSizeF sceneItemsBound = scene->itemsBoundingRect().size();
qreal ratio = (qreal)pdfPrinter.resolution() / 72.0;
QSizeF scaled = sceneItemsBound * ratio;
pdfPrinter.setPaperSize(scaled, QPrinter::DevicePixel);
if (pageIndex != 0)
pdfPrinter.newPage();
if (!pdfPainter)
pdfPainter = new QPainter(&pdfPrinter);
//render to PDF
scene->render(pdfPainter, QRectF(0, 0, sceneItemsBound.width() * ratio
, sceneItemsBound.height() * ratio), scene->itemsBoundingRect());
mHasPDFBackgrounds = true;
}
else
{
if (UBSettings::settings()->pdfPageFormat->get().toString() == "Letter")
pdfPrinter.setPageSize(QPrinter::Letter);
else
pdfPrinter.setPageSize(QPrinter::A4);
QSize pageSize = scene->nominalSize();
QSize docSize = pDocumentProxy->defaultDocumentSize();
if(docSize.width() > docSize.height())
{
pdfPrinter.setOrientation(QPrinter::Landscape);
}
UBGraphicsPDFItem *pdfItem = qgraphicsitem_cast<UBGraphicsPDFItem*>(scene->backgroundObject());
if (pageIndex != 0)
pdfPrinter.newPage();
if (pdfItem) mHasPDFBackgrounds = true;
pdfPrinter.setPaperSize(QSizeF(pageSize.width()*mScaleFactor, pageSize.height()*mScaleFactor), QPrinter::Point);
mDefaultPageRect = pdfPrinter.paperRect();
QRectF paperRect = mDefaultPageRect.adjusted(margin, margin, -margin, -margin);
QRectF normalized = scene->normalizedSceneRect(paperRect.width() / paperRect.height());
if (!pdfPainter) pdfPainter = new QPainter(&pdfPrinter);
if (!pdfPainter)
pdfPainter = new QPainter(&pdfPrinter);
if (pageIndex != 0) pdfPrinter.newPage();
//render to PDF
scene->render(pdfPainter, paperRect, normalized);
}
//render to PDF
scene->render(pdfPainter);
//restore screen rendering quality
scene->setRenderingContext(UBGraphicsScene::Screen);
@ -144,8 +110,7 @@ void UBExportFullPDF::saveOverlayPdf(UBDocumentProxy* pDocumentProxy, QString fi
scene->setBackground(isDark, isCrossed);
}
if (pdfPainter)
delete pdfPainter;
if (pdfPainter) delete pdfPainter;
}
@ -171,12 +136,10 @@ void UBExportFullPDF::persist(UBDocumentProxy* pDocumentProxy)
}
void UBExportFullPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, QString filename)
void UBExportFullPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, const QString& filename)
{
QFile file(filename);
if (file.exists())
file.remove();
if (file.exists()) file.remove();
QString overlayName = filename;
overlayName.replace(".pdf", "_overlay.pdf");
@ -209,31 +172,27 @@ void UBExportFullPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, QString
UBGraphicsScene* scene = UBPersistenceManager::persistenceManager()->loadDocumentScene(pDocumentProxy, pageIndex);
UBGraphicsPDFItem *pdfItem = qgraphicsitem_cast<UBGraphicsPDFItem*>(scene->backgroundObject());
if (pdfItem)
QSize pageSize = scene->nominalSize();
if (pdfItem)
{
QString pdfName = UBPersistenceManager::objectDirectory + "/" + pdfItem->fileUuid().toString() + ".pdf";
QString backgroundPath = pDocumentProxy->persistencePath() + "/" + pdfName;
QPointF boudingRectBottomLeft = scene->itemsBoundingRect().bottomLeft();
QPointF pdfItemBottomLeft = pdfItem->sceneBoundingRect().bottomLeft();
QPointF offset = pdfItemBottomLeft - boudingRectBottomLeft;
qDebug() << "scene->itemsBoundingRect()" << scene->itemsBoundingRect();
qDebug() << "pdfItem->boundingRect()" << pdfItem->boundingRect();
qDebug() << "pdfItem->sceneBoundingRect()" << pdfItem->sceneBoundingRect();
qDebug() << offset;
TransformationDescription baseTrans(offset.x(), offset.y() * -1, 1, 0);
//TransformationDescription baseTrans(0, 0, 1, 0);
TransformationDescription overlayTrans(0, 0, 1, 0);
MergePageDescription pageDescription(scene->itemsBoundingRect().width(),
scene->itemsBoundingRect().height(),
MergePageDescription pageDescription(pageSize.width() * mScaleFactor,
pageSize.height() * mScaleFactor,
pdfItem->pageNumber(),
QFile::encodeName(backgroundPath).constData(),
baseTrans,
TransformationDescription(),
pageIndex + 1,
overlayTrans,
TransformationDescription(),
false, false);
mergeInfo.push_back(pageDescription);
@ -242,12 +201,8 @@ void UBExportFullPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, QString
}
else
{
QRectF paperRect = mDefaultPageRect.adjusted(mMargin, mMargin, -mMargin, -mMargin);
QRectF normalized = scene->normalizedSceneRect(paperRect.width() / paperRect.height());
MergePageDescription pageDescription(normalized.width(),
normalized.height(),
MergePageDescription pageDescription(pageSize.width() * mScaleFactor,
pageSize.height() * mScaleFactor,
0,
"",
TransformationDescription(),

@ -33,14 +33,13 @@ class UBExportFullPDF : public UBExportAdaptor
virtual QString exportExtention();
virtual void persist(UBDocumentProxy* pDocument);
virtual void persistsDocument(UBDocumentProxy* pDocument, QString filename);
virtual void persistsDocument(UBDocumentProxy* pDocument, const QString& filename);
protected:
void saveOverlayPdf(UBDocumentProxy* pDocumentProxy, QString filename);
void saveOverlayPdf(UBDocumentProxy* pDocumentProxy, const QString& filename);
private:
QRect mDefaultPageRect;
int mMargin;
float mScaleFactor;
bool mHasPDFBackgrounds;
};

@ -101,7 +101,6 @@ void UBExportPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, const QStrin
//setting page size to appropriate value
pdfPrinter.setPaperSize(QSizeF(pageSize.width()*scaleFactor, pageSize.height()*scaleFactor), QPrinter::Point);
pdfPrinter.setOrientation((pageSize.width() > pageSize.height())? QPrinter::Landscape : QPrinter::Portrait);
if(painterNeedsBegin) painterNeedsBegin = !pdfPainter.begin(&pdfPrinter);
//render to PDF
scene->render(&pdfPainter);

@ -822,8 +822,7 @@ void UBBoardPaletteManager::addItem(const QPixmap& pPixmap, const QPointF& pos,
void UBBoardPaletteManager::addItemToCurrentPage()
{
UBApplication::applicationController->showBoard();
UBApplication::applicationController->hideDesktop();
UBApplication::applicationController->showBoard();
mAddItemPalette->hide();
if(mPixmap.isNull())
UBApplication::boardController->downloadURL(mItemUrl);

@ -347,6 +347,7 @@ void UBApplicationController::showBoard()
if (UBApplication::boardController)
UBApplication::boardController->show();
mIsShowingDesktop = false;
UBPlatformUtils::setDesktopMode(false);
mUninoteController->hideWindow();

Loading…
Cancel
Save