Commit cea17292 authored by Ivan Ilin's avatar Ivan Ilin

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

parents 023550e6 c408dec5
......@@ -50,3 +50,8 @@ Thumbs.db
###############
build
install
# Translation files #
#####################
*.qm
......@@ -433,6 +433,8 @@
<dict>
<key>Path</key>
<string></string>
<key>Path Type</key>
<integer>2</integer>
<key>Status</key>
<false/>
</dict>
......
......@@ -166,7 +166,7 @@ macx {
UB_THIRDPARTY_INTERACTIVE.path = "$$RESOURCES_DIR/library/interactive"
UB_MACX_ICNS.files = $$files(resources/macx/*.icns)
UB_MACX_ICNS.path = "$$RESOURCES_DIR"
UB_MACX_EXTRAS.files = "resources/macx/Save PDF to Uniboard.workflow"
UB_MACX_EXTRAS.files = "resources/macx/Save PDF to Open-Sankore.workflow"
UB_MACX_EXTRAS.path = "$$RESOURCES_DIR"
UB_I18N.path = $$DESTDIR/i18n # not used
......
......@@ -22,6 +22,7 @@ rm -rf install
QT_PATH="/usr/local/Trolltech/Qt-4.7.3"
PLUGINS_PATH="$QT_PATH/plugins"
QMAKE_PATH="$QT_PATH/bin/qmake"
LRELEASES="/usr/local/Trolltech/Qt-4.7.3/bin/lrelease"
if [ ! -e "$QMAKE_PATH" ]; then
echo "qmake command not found at $QMAKE_PATH"
......@@ -38,6 +39,8 @@ $QMAKE_PATH -spec linux-g++
make -j 4 release-install
$LRELEASES "Sankore_3.1.pro"
VERSION=`cat build/linux/release/version`
if [ ! -f build/linux/release/version ]; then
echo "version not found"
......
......@@ -14,14 +14,16 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# ---------------------------------------------------------------------
BASE_TROLLTECH_DIRECTORY=/usr/local/Trolltech/Qt-4.7.3
# Executables
QMAKE="/usr/local/Trolltech/Qt-4.7.3/bin/qmake"
MACDEPLOYQT=/usr/local/Trolltech/Qt-4.7.3/bin/macdeployqt
QMAKE=$BASE_TROLLTECH_DIRECTORY/bin/qmake
MACDEPLOYQT=$BASE_TROLLTECH_DIRECTORY/bin/macdeployqt
DMGUTIL="`pwd`/../Sankore-ThirdParty/refnum/dmgutil/dmgutil.pl"
DSYMUTIL=/usr/bin/dsymutil
STRIP=/usr/bin/strip
PLISTBUDDY=/usr/libexec/PlistBuddy
ICEBERG=/usr/local/bin/freeze
LRELEASE=$BASE_TROLLTECH_DIRECTORY/bin/lrelease
# Directories
BUILD_DIR="build/macx/release"
......@@ -69,7 +71,7 @@ checkExecutable "$DSYMUTIL"
checkExecutable "$STRIP"
checkExecutable "$PLISTBUDDY"
checkExecutable "$ICEBERG"
checkExecutable "$LRELEASE"
# delete the build directory
notify "Cleaning ..."
......@@ -86,6 +88,8 @@ $QMAKE_CMD
notify "Compiling ..."
make -j4 release
$LRELEASE "Sankore_3.1.pro"
VERSION=`cat "$BUILD_DIR/version"`
if [ ! -f "$BUILD_DIR/version" ]; then
echo "version not found"
......@@ -99,9 +103,9 @@ else
fi
fi
#if [ $? != 0 ]; then
# abort "compilation failed"
#fi
if [ $? != 0 ]; then
abort "compilation failed"
fi
NAME="Open-Sankore"
......@@ -135,7 +139,10 @@ $DSYMUTIL "$APP/Contents/MacOS/Open-Sankore" -o "$DSYM"
$STRIP -S "$APP/Contents/MacOS/Open-Sankore"
if [ "$1" == "pkg" ]; then
ICEBERG_CONFIG_FILE="Open-Sankore.packproj"
BASE_ICEBERG_CONFIG_FILE="Open-Sankore.packproj"
#copy the standard file for working with
ICEBERG_CONFIG_FILE="Open-Sankore-working.packproj"
cp -r $BASE_ICEBERG_CONFIG_FILE $ICEBERG_CONFIG_FILE
# set version information
$PLISTBUDDY -c "Set :Hierarchy:Attributes:Settings:Description:International:IFPkgDescriptionVersion $VERSION" "$ICEBERG_CONFIG_FILE"
$PLISTBUDDY -c "Set :Hierarchy:Attributes:Settings:Display\ Information:CFBundleShortVersionString $VERSION" "$ICEBERG_CONFIG_FILE"
......@@ -149,6 +156,10 @@ if [ "$1" == "pkg" ]; then
mkdir -p "${PRODUCT_DIR}"
fi
$ICEBERG $ICEBERG_CONFIG_FILE
#clean up mess
rm -rf $ICEBERG_CONFIG_FILE
exit 0
fi
......
......@@ -23,6 +23,7 @@ set VS_BIN=%PROGRAMS_FILE_PATH%\Microsoft Visual Studio 9.0\VC\bin
set WIN_SDK_BIN=%PROGRAMS_FILE_PATH%\Microsoft SDKs\Windows\v6.0A\Bin
set INNO_EXE=%PROGRAMS_FILE_PATH%\Inno Setup 5\iscc.exe
set BUILD_DIR=build\win32\release
set LRELEASE=%QT_DIR%\bin\lrelease
set PATH=%QT_BIN%;%PATH%;%WIN_SDK_BIN%;%GIT_BIN%
......@@ -41,6 +42,8 @@ set EDITION=MNEMIS_EDITION
"%QT_BIN%\qmake.exe" "DEFINES+=%EDITION%"
%LRELEASE% Sankore_3.1.pro
set /p VERSION= < build\win32\release\version
git rev-list --tags --max-count=1 > tmp
set /p LAST_TAG= < tmp
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:ub="http://uniboard.mnemis.com/widgets"
id="http://uniboard.mnemis.com/widgets/webbrowser"
version="1.1"
width="900"
height="500"
ub:resizable="true">
<name>Choisir</name>
<author href="http://www.getuniboard.com"
email="info@mnemis.com">Mnemis SA</author>
<description>Choisir widget</description>
<content src="index.html"/>
</widget>
body{
width: 100%;
padding: 0;
height: auto;
background-color: white;
margin: 0;
}
.disclaimer{
width: 90%;
height: 50px;
position: absolute;
left: 0;
bottom: 0;
margin-left: 1px;
margin-right: 1px;
margin-bottom: 0px;
padding: 5px;
text-align: center;
background-color: #BBBBBB;
-webkit-border-top-left-radius: 15px;
-webkit-border-top-right-radius: 15px;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
border: solid 4px #EEEEEE;
border-bottom: none;
z-index: 10;
}
.search{
width: 90%;
position: absolute;
top: 0;
left: 0;
margin-left: 1px;
margin-right: 1px;
margin-top: 0px;
padding: 5px;
background-color: #BBBBBB;
-webkit-border-bottom-left-radius: 15px;
-webkit-border-bottom-right-radius: 15px;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
border: solid 4px #EEEEEE;
border-top: none;
z-index: 10;
}
.togglePages{
padding: 0;
position: absolute;
bottom: -14px;
left: 43%;
width: 15%;
height: 10px;
background-color: #666;
-webkit-border-bottom-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
-webkit-box-shadow: #dadada -1px 0 4px;
box-shadow: #dadada -1px 0 4px;
cursor: pointer;
}
.toggleIcon{
width: 14px;
height: 10px;
background-image: url(../images/trgUp.png);
}
.searchInput{
margin: 10px 5px 10px 5px;
padding: 2px;
padding-left: 8px;
padding-right:8px;
float: left;
width: 60%;
border-radius: 15px;
border-style: none;
}
.searchButton{
width: 32px;
height: 32px;
margin: 5px 5px;
background-image: url(../images/search.png);
float: left;
cursor: pointer;
}
.subSearch{
margin: 0;
float: left;
}
#subSearchInput{
width: 100%;
float: left;
}
#subSearchFilter{
width: 100%;
float: left;
display: none;
}
.searchResult{
width: 98%;
padding: 3px;
background-color:#123456;
}
.imgContainer{
float: left;
padding: 3px;
margin: 3px;
text-align: center;
overflow: hidden;
font-size: small;
font-family: Verdana,Arial,Helvetica,sans-serif;
border: 1px solid #666;
border-radius: 5px;
-webkit-box-shadow: #dadada -1px 0 4px;
-webkit-border-radius: 5px;
box-shadow: #666 -1px 0 4px;
}
.resultFooter{
float: left;
margin: 5px;
padding: 3px;
width: 100%;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-weight: bold;
font-size: x-large;
}
#branding{
position: absolute;
top: 0;
left: 10px;
z-index: 2;
}
.filterContainer{
float: left;
margin: 2px;
padding: 2px;
font-size: 14px;
}
.filterSelect{
border-style:none;
-webkit-border-top-right-radius: 15px;
-webkit-border-bottom-right-radius: 15px;
-moz-border-radius-topright: 15px;
-moz-border-radius-bottomright: 15px;
border-top-right-radius: 15px;
}
span{
font-family: Verdana,Arial,Helvetica,sans-serif;
color: #666;
}
[draggable] {
-webkit-user-select: none;
user-select: none;
}
.toggleFilters{
margin: 0;
padding: 0;
background-position: center;
background-image: url(../images/down.png);
position: absolute;
bottom: 2px;
right: 2px;
width: 20px;
height: 20px;
cursor: pointer;
}
\ No newline at end of file
This diff is collapsed.
......@@ -55,7 +55,7 @@
<key>CFBundleIconFile</key>
<string>Uniboard.icns</string>
<key>CFBundleIdentifier</key>
<string>com.sankore.open-sankore</string>
<string>org.eduxia.open-sankore</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
......
......@@ -3,16 +3,16 @@
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>com.mnemis.pdfworkflow.savepdftouniboard</string>
<string>com.eduxia.pdfworkflow.savepdftoopensankore</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Save PDF to Uniboard</string>
<string>Save PDF to Open-Sankoré</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>UniB</string>
<string>EduX</string>
</dict>
</plist>
......@@ -55,7 +55,7 @@
<key>ActionParameters</key>
<dict>
<key>COMMAND_STRING</key>
<string>open -b com.mnemis.Uniboard "$1"</string>
<string>open -b org.eduxia.open-sankore "$1"</string>
<key>CheckedForUserDefaultShell</key>
<true/>
<key>inputMethod</key>
......
Binary files a/resources/macx/Save PDF to Uniboard.workflow/Contents/Resources/Spanish.lproj/InfoPlist.strings and /dev/null differ
Binary files a/resources/macx/Save PDF to Uniboard.workflow/Contents/Resources/fi.lproj/InfoPlist.strings and /dev/null differ
Binary files a/resources/macx/Save PDF to Uniboard.workflow/Contents/Resources/no.lproj/InfoPlist.strings and /dev/null differ
Binary files a/resources/macx/Save PDF to Uniboard.workflow/Contents/Resources/pt.lproj/InfoPlist.strings and /dev/null differ
Binary files a/resources/macx/Save PDF to Uniboard.workflow/Contents/Resources/sv.lproj/InfoPlist.strings and /dev/null differ
Binary files a/resources/macx/Save PDF to Uniboard.workflow/Contents/Resources/zh_CN.lproj/InfoPlist.strings and /dev/null differ
Binary files a/resources/macx/Save PDF to Uniboard.workflow/Contents/Resources/zh_TW.lproj/InfoPlist.strings and /dev/null differ
......@@ -63,11 +63,6 @@ UBDocumentPublisher::UBDocumentPublisher(UBDocumentProxy* pDocument, QObject *pa
UBDocumentPublisher::~UBDocumentPublisher()
{
if(mSourceDocument){
delete mSourceDocument;
mSourceDocument = NULL;
}
if(mPublishingDocument){
delete mPublishingDocument;
mPublishingDocument = NULL;
......
......@@ -643,15 +643,22 @@ QString UBApplication::globalStyleSheet()
QString UBApplication::urlFromHtml(QString html)
{
qDebug() << "HTML: " << html.remove(QRegExp("[\\0]"));
QString url;
QDomDocument domDoc;
domDoc.setContent(html.remove(QRegExp("[\\0]")));
QDomElement rootElem = domDoc.documentElement();
// QUICKFIX: Here we have to check rootElem. Sometimes it can be a <meta> tag
// In such a case we will not be able to retrieve the src value
if(rootElem.tagName().toLower().contains("meta")){
qDebug() << rootElem.firstChildElement().tagName();
// In that case we get the next element
url = rootElem.firstChildElement().attribute("src");
}else{
url = rootElem.attribute("src");
}
qDebug() << "The URL is: " << url;
return url;
}
......
......@@ -48,8 +48,8 @@ void UBPlatformUtils::init()
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *currentPath = [[NSBundle mainBundle] pathForResource:@"Save PDF to Sankore" ofType:@"workflow"];
NSString *installedPath = [[[@"~/Library/PDF Services" stringByExpandingTildeInPath] stringByAppendingPathComponent:@"Save PDF to Sankore"] stringByAppendingPathExtension:@"workflow"];
NSString *currentPath = [[NSBundle mainBundle] pathForResource:@"Save PDF to Open-Sankore" ofType:@"workflow"];
NSString *installedPath = [[[@"~/Library/PDF Services" stringByExpandingTildeInPath] stringByAppendingPathComponent:@"Save PDF to Open-Sankore"] stringByAppendingPathExtension:@"workflow"];
NSString *currentVersion = bundleShortVersion([NSBundle bundleWithPath:currentPath]);
NSString *installedVersion = bundleShortVersion([NSBundle bundleWithPath:installedPath]);
......@@ -57,16 +57,17 @@ void UBPlatformUtils::init()
{
NSFileManager *fileManager = [NSFileManager defaultManager];
[fileManager removeFileAtPath:installedPath handler:nil];
// removing the old version of the script named Save PDF to Uniboard
[fileManager removeFileAtPath:[[[@"~/Library/PDF Services" stringByExpandingTildeInPath] stringByAppendingPathComponent:@"Save PDF to Uniboard"] stringByAppendingPathExtension:@"workflow"] handler:nil];
[fileManager createDirectoryAtPath:[installedPath stringByDeletingLastPathComponent] attributes:nil];
BOOL copyOK = [fileManager copyPath:currentPath toPath:installedPath handler:nil];
if (!copyOK)
{
qWarning("Could not install the 'Save PDF to Sankore' workflow");
qWarning("Could not install the 'Save PDF to Open-Sankoré workflow");
}
}
[pool drain];
}
......
......@@ -478,9 +478,8 @@ void UBPathScene::dropEvent(QGraphicsSceneDragDropEvent *event)
}
bAccept = true;
}
else if(NULL != event->mimeData() && event->mimeData()->hasUrls()){
QList<QUrl> urls = event->mimeData()->urls();
}else if(NULL != pMimeData && pMimeData->hasUrls()){
QList<QUrl> urls = pMimeData->urls();
foreach(QUrl eachUrl, urls){
QString sUrl = eachUrl.toString();
if(!sUrl.startsWith("uniboardTool://") && !sUrl.startsWith("file://") && !sUrl.startsWith("/")){
......@@ -503,11 +502,10 @@ void UBPathScene::dropEvent(QGraphicsSceneDragDropEvent *event)
}
}
bAccept = true;
}
else if(NULL != event->mimeData() && event->mimeData()->hasText()){
}else if(NULL != pMimeData && pMimeData->hasText()){
// The user can only drop an Url in this location so if the text is not an Url,
// we discard it.
QString qsTxt = event->mimeData()->text().remove(QRegExp("[\\0]"));
QString qsTxt = pMimeData->text().remove(QRegExp("[\\0]"));
if(qsTxt.startsWith("http")){
// Show the download palette if it is hidden
UBApplication::boardController->paletteManager()->startDownloads();
......@@ -524,6 +522,27 @@ void UBPathScene::dropEvent(QGraphicsSceneDragDropEvent *event)
UBDownloadManager::downloadManager()->addFileToDownload(desc);
bAccept = true;
}
}else if(NULL != pMimeData && pMimeData->hasHtml()){
QString html = pMimeData->html();
QString url = UBApplication::urlFromHtml(html);
if("" != url)
{
bAccept = true;
// Show the download palette if it is hidden
UBApplication::boardController->paletteManager()->startDownloads();
// Add the dropped url to the download list
sDownloadFileDesc desc;
desc.currentSize = 0;
desc.id = 0;
desc.isBackground = false;
desc.modal = false;
desc.name = QFileInfo(url).fileName();
desc.totalSize = 0;
desc.url = url;
UBDownloadManager::downloadManager()->addFileToDownload(desc);
}
}
if(bAccept){
event->accept();
......
......@@ -364,10 +364,16 @@ void UBLibraryWidget::dropEvent(QDropEvent *event)
QList<QUrl> urlList = pMimeData->urls();
for (int i = 0; i < urlList.size() && i < 32; ++i){
QString filePath;
QString crntPath = urlList.at(i).toString();
#ifdef Q_WS_MACX
filePath = QUrl(urlList.at(i)).toString();
#else
filePath = QUrl(urlList.at(i).path()).toLocalFile();
if(crntPath.startsWith("file:") || crntPath.startsWith("/")){
filePath = QUrl(crntPath).toLocalFile();
}else{
filePath = crntPath;
}
#endif
mLibraryController->importItemOnLibrary(filePath);
bDropAccepted = true;
......@@ -379,6 +385,7 @@ void UBLibraryWidget::dropEvent(QDropEvent *event)
else if (pMimeData->hasHtml()){
qDebug() << "hasHtml";
QString html = pMimeData->html();
qDebug() << html;
QString url = UBApplication::urlFromHtml(html);
if("" != url)
{
......
......@@ -77,7 +77,7 @@ UBUpdateDlg::UBUpdateDlg(QWidget *parent, int nbFiles, const QString& bkpPath)
mLayout->addWidget(mpDlgBttn);
mpDlgBttn->button(QDialogButtonBox::Ok)->setText(tr("Update"));
mpDlgBttn->button(QDialogButtonBox::Cancel)->setText("Remind me later");
mpDlgBttn->button(QDialogButtonBox::Cancel)->setText(tr("Remind me later"));
QObject::connect(mBrowseBttn, SIGNAL(clicked()), this, SLOT(onBrowse()));
QObject::connect(mpDlgBttn, SIGNAL(accepted()), this, SLOT(onUpdate()));
......
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