Commit bfd3c05b authored by Didier's avatar Didier

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

Conflicts:
	src/adaptors/UBSvgSubsetAdaptor.cpp
parents caed6ffe 73804c68
...@@ -99,5 +99,5 @@ QString UBExportDocument::exportExtention() ...@@ -99,5 +99,5 @@ QString UBExportDocument::exportExtention()
QString UBExportDocument::exportName() QString UBExportDocument::exportName()
{ {
return tr("Export to Uniboard Format"); return tr("Export to Sankore Format");
} }
...@@ -132,7 +132,7 @@ void UBImportVirtualPrinter::cleanUp(const QFile& pFile, const QString& pPdfFile ...@@ -132,7 +132,7 @@ void UBImportVirtualPrinter::cleanUp(const QFile& pFile, const QString& pPdfFile
UBDocumentProxy* UBImportVirtualPrinter::importFile(const QFile& pFile, const QString& pGroup) UBDocumentProxy* UBImportVirtualPrinter::importFile(const QFile& pFile, const QString& pGroup)
{ {
UBApplication::showMessage(tr("Importing Uniboard printer file ...")); UBApplication::showMessage(tr("Importing Sankore printer file ..."));
UBDocumentProxy *document = 0; UBDocumentProxy *document = 0;
QString pdfFilename = pdfFileName(pFile); QString pdfFilename = pdfFileName(pFile);
...@@ -159,7 +159,7 @@ UBDocumentProxy* UBImportVirtualPrinter::importFile(const QFile& pFile, const QS ...@@ -159,7 +159,7 @@ UBDocumentProxy* UBImportVirtualPrinter::importFile(const QFile& pFile, const QS
if (!document) if (!document)
{ {
UBApplication::showMessage(tr("Error while importing Uniboard printer file.")); UBApplication::showMessage(tr("Error while importing Sankore printer file."));
} }
cleanUp(pFile, pdfFilename, emfFileNames(pFile)); cleanUp(pFile, pdfFilename, emfFileNames(pFile));
...@@ -170,7 +170,7 @@ UBDocumentProxy* UBImportVirtualPrinter::importFile(const QFile& pFile, const QS ...@@ -170,7 +170,7 @@ UBDocumentProxy* UBImportVirtualPrinter::importFile(const QFile& pFile, const QS
bool UBImportVirtualPrinter::addFileToDocument(UBDocumentProxy* pDocument, const QFile& pFile) bool UBImportVirtualPrinter::addFileToDocument(UBDocumentProxy* pDocument, const QFile& pFile)
{ {
UBApplication::showMessage(tr("Importing Uniboard printer file ...")); UBApplication::showMessage(tr("Importing Sankore printer file ..."));
bool result = false; bool result = false;
QString pdfFilename = pdfFileName(pFile); QString pdfFilename = pdfFileName(pFile);
...@@ -183,7 +183,7 @@ bool UBImportVirtualPrinter::addFileToDocument(UBDocumentProxy* pDocument, const ...@@ -183,7 +183,7 @@ bool UBImportVirtualPrinter::addFileToDocument(UBDocumentProxy* pDocument, const
if (!result) if (!result)
{ {
UBApplication::showMessage(tr("Error while importing Uniboard printer file.")); UBApplication::showMessage(tr("Error while importing Sankore printer file."));
} }
cleanUp(pFile, pdfFilename, emfFileNames(pFile)); cleanUp(pFile, pdfFilename, emfFileNames(pFile));
......
...@@ -204,7 +204,7 @@ QMap<QString, QVariant> UBMetadataDcSubsetAdaptor::load(QString pPath) ...@@ -204,7 +204,7 @@ QMap<QString, QVariant> UBMetadataDcSubsetAdaptor::load(QString pPath)
if (xml.hasError()) if (xml.hasError())
{ {
qWarning() << "error parsing uniboard metadata.rdf file " << xml.errorString(); qWarning() << "error parsing sankore metadata.rdf file " << xml.errorString();
} }
} }
......
...@@ -781,7 +781,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene() ...@@ -781,7 +781,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
if (mXmlReader.hasError()) if (mXmlReader.hasError())
{ {
qWarning() << "error parsing uniboard file " << mXmlReader.errorString(); qWarning() << "error parsing Sankore file " << mXmlReader.errorString();
} }
if (scene) if (scene)
...@@ -2576,31 +2576,16 @@ UBGraphicsTriangle* UBSvgSubsetAdaptor::UBSvgSubsetReader::triangleFromSvg() ...@@ -2576,31 +2576,16 @@ UBGraphicsTriangle* UBSvgSubsetAdaptor::UBSvgSubsetReader::triangleFromSvg()
graphicsItemFromSvg(triangle); graphicsItemFromSvg(triangle);
//QStringRef angle = mXmlReader.attributes().value(mNamespaceUri, "angle");
//if (!angle.isNull())
//{
// protractor->setAngle(angle.toString().toFloat());
//}
//QStringRef markerAngle = mXmlReader.attributes().value(mNamespaceUri, "marker-angle");
//if (!markerAngle.isNull())
//{
// protractor->setMarkerAngle(markerAngle.toString().toFloat());
//}
QStringRef svgX = mXmlReader.attributes().value("x"); QStringRef svgX = mXmlReader.attributes().value("x");
QStringRef svgY = mXmlReader.attributes().value("y"); QStringRef svgY = mXmlReader.attributes().value("y");
QStringRef svgWidth = mXmlReader.attributes().value("width"); QStringRef svgWidth = mXmlReader.attributes().value("width");
QStringRef svgHeight = mXmlReader.attributes().value("height"); QStringRef svgHeight = mXmlReader.attributes().value("height");
QStringRef orientationStringRef = mXmlReader.attributes().value("orientation");
UBGraphicsTriangle::UBGraphicsTriangleOrientation orientation = UBGraphicsTriangle::UBGraphicsTriangleOrientation orientation = UBGraphicsTriangle::orientationFromStr(orientationStringRef);
UBGraphicsTriangle::orientationFromStr((mXmlReader.attributes().value("orientation")));
if (!svgX.isNull() && !svgY.isNull() && !svgWidth.isNull() && !svgHeight.isNull()) if (!svgX.isNull() && !svgY.isNull() && !svgWidth.isNull() && !svgHeight.isNull())
{ {
triangle->setRect(svgX.toString().toFloat(), svgY.toString().toFloat() triangle->setRect(svgX.toString().toFloat(), svgY.toString().toFloat(), svgWidth.toString().toFloat(), svgHeight.toString().toFloat(), orientation);
, svgWidth.toString().toFloat(), svgHeight.toString().toFloat(),
orientation);
} }
triangle->setVisible(true); triangle->setVisible(true);
......
...@@ -28,7 +28,7 @@ UBWebPublisher::~UBWebPublisher() ...@@ -28,7 +28,7 @@ UBWebPublisher::~UBWebPublisher()
QString UBWebPublisher::exportName() QString UBWebPublisher::exportName()
{ {
return tr("Publish Document on Uniboard Web"); return tr("Publish Document on Sankore Web");
} }
......
...@@ -10,74 +10,56 @@ ...@@ -10,74 +10,56 @@
class UBDocumentProxy; class UBDocumentProxy;
class UBServerXMLHttpRequest; class UBServerXMLHttpRequest;
class UBGraphicsW3CWidgetItem; class UBGraphicsW3CWidgetItem;
class QWebView;
class UBDocumentPublisher : public UBAbstractPublisher class UBDocumentPublisher : public UBAbstractPublisher
{ {
Q_OBJECT; Q_OBJECT;
public: public:
explicit UBDocumentPublisher(UBDocumentProxy* sourceDocument, QObject *parent = 0); explicit UBDocumentPublisher(UBDocumentProxy* sourceDocument, QObject *parent = 0);
virtual ~UBDocumentPublisher(); virtual ~UBDocumentPublisher();
void publish(); void publish();
protected: signals:
// not needed as we do not publish svg file anymore void loginDone();
//virtual void rasterizePDF();
//virtual void rasterizeSVGImages();
//virtual void updateSVGForWidget(int sceneIndex);
virtual void updateGoogleMapApiKey(); protected:
virtual void rasterizeScenes(); virtual void updateGoogleMapApiKey();
virtual void rasterizeScenes();
virtual void upgradeDocumentForPublishing();
virtual void generateWidgetPropertyScript(UBGraphicsW3CWidgetItem *widgetItem, int pageNumber);
virtual void upgradeDocumentForPublishing(); private slots:
virtual void generateWidgetPropertyScript(UBGraphicsW3CWidgetItem *widgetItem, int pageNumber); void onFinished(QNetworkReply* reply);
void onLinkClicked(const QUrl& url);
void onLoadFinished(bool result);
void sendZipToUniboardWeb(const QString& zipFile, const QUuid& publishingUuid);
private slots: private:
void postDocument(const QUuid& tokenUuid, const QString& encryptedBase64Token); void init();
void uploadProgress(qint64, qint64); void sendUbw();
void postZipUploadResponse(bool, const QByteArray&); QString getBase64Of(QString stringToEncode);
private: QWebView* mpWebView;
QHBoxLayout* mpLayout;
QNetworkAccessManager* mpNetworkMgr;
QNetworkCookieJar* mpCookieJar;
QString mUsername;
QString mPassword;
QString mCrlf;
bool bCookieSet;
UBDocumentProxy *mSourceDocument; void buildUbwFile();
UBDocumentProxy *mPublishingDocument; QString mTmpZipFile;
UBServerXMLHttpRequest* mUploadRequest; UBDocumentProxy *mSourceDocument;
UBDocumentProxy *mPublishingDocument;
QString mTitle;
QString mAuthor;
QString mDescription;
QString mEMail;
bool mAttachPDF;
bool mAttachUBZ;
QUrl mPublishingUrl;
QString mPublishingServiceUrl;
QUuid mAuthenticationUuid;
QString mAuthenticationBase64Token;
};
class UBDocumentPublishingDialog : public QDialog, public Ui::documentPublishingDialog
{
Q_OBJECT;
public:
UBDocumentPublishingDialog(QWidget *parent = 0);
~UBDocumentPublishingDialog(){}
private slots:
void updateUIState(const QString& string);
}; };
#endif // UBDOCUMENTPUBLISHER_H #endif // UBDOCUMENTPUBLISHER_H
...@@ -956,7 +956,7 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString ...@@ -956,7 +956,7 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
} }
else else
{ {
UBApplication::showMessage(tr("Flash is not supported on Uniboard Linux")); UBApplication::showMessage(tr("Flash is not supported on Sankore Linux"));
} }
} }
else if (mimeType.startsWith("application/pdf")) else if (mimeType.startsWith("application/pdf"))
......
...@@ -152,7 +152,7 @@ void UBBoardPaletteManager::setupPalettes() ...@@ -152,7 +152,7 @@ void UBBoardPaletteManager::setupPalettes()
addItemActions << UBApplication::mainWindow->actionAddItemToCurrentPage; addItemActions << UBApplication::mainWindow->actionAddItemToCurrentPage;
addItemActions << UBApplication::mainWindow->actionAddItemToNewPage; addItemActions << UBApplication::mainWindow->actionAddItemToNewPage;
addItemActions << UBApplication::mainWindow->actionAddItemToLibrary; addItemActions << UBApplication::mainWindow->actionAddItemToLibrary;
//addItemActions << UBApplication::mainWindow->actionShareItemOnWeb; addItemActions << UBApplication::mainWindow->actionShareItemOnWeb;
mAddItemPalette = new UBActionPalette(addItemActions, Qt::Horizontal, 0); mAddItemPalette = new UBActionPalette(addItemActions, Qt::Horizontal, 0);
mAddItemPalette->setButtonIconSize(QSize(128, 128)); mAddItemPalette->setButtonIconSize(QSize(128, 128));
...@@ -306,7 +306,7 @@ void UBBoardPaletteManager::connectPalettes() ...@@ -306,7 +306,7 @@ void UBBoardPaletteManager::connectPalettes()
connect(UBApplication::mainWindow->actionAddItemToCurrentPage, SIGNAL(triggered()), this, SLOT(addItemToCurrentPage())); connect(UBApplication::mainWindow->actionAddItemToCurrentPage, SIGNAL(triggered()), this, SLOT(addItemToCurrentPage()));
connect(UBApplication::mainWindow->actionAddItemToNewPage, SIGNAL(triggered()), this, SLOT(addItemToNewPage())); connect(UBApplication::mainWindow->actionAddItemToNewPage, SIGNAL(triggered()), this, SLOT(addItemToNewPage()));
connect(UBApplication::mainWindow->actionAddItemToLibrary, SIGNAL(triggered()), this, SLOT(addItemToLibrary())); connect(UBApplication::mainWindow->actionAddItemToLibrary, SIGNAL(triggered()), this, SLOT(addItemToLibrary()));
//connect(UBApplication::mainWindow->actionShareItemOnWeb, SIGNAL(triggered()), this, SLOT(shareItemOnWeb())); connect(UBApplication::mainWindow->actionShareItemOnWeb, SIGNAL(triggered()), this, SLOT(shareItemOnWeb()));
connect(UBApplication::mainWindow->actionEraseItems, SIGNAL(triggered()), mErasePalette, SLOT(close())); connect(UBApplication::mainWindow->actionEraseItems, SIGNAL(triggered()), mErasePalette, SLOT(close()));
connect(UBApplication::mainWindow->actionEraseAnnotations, SIGNAL(triggered()), mErasePalette, SLOT(close())); connect(UBApplication::mainWindow->actionEraseAnnotations, SIGNAL(triggered()), mErasePalette, SLOT(close()));
......
...@@ -53,7 +53,6 @@ UBApplicationController* UBApplication::applicationController = 0; ...@@ -53,7 +53,6 @@ UBApplicationController* UBApplication::applicationController = 0;
UBBoardController* UBApplication::boardController = 0; UBBoardController* UBApplication::boardController = 0;
UBWebController* UBApplication::webController = 0; UBWebController* UBApplication::webController = 0;
UBDocumentController* UBApplication::documentController = 0; UBDocumentController* UBApplication::documentController = 0;
//UBSoftwareUpdateController* UBApplication::softwareUpdateController = 0;
UniboardSankoreTransition* UBApplication::mUniboardSankoreTransition = 0; UniboardSankoreTransition* UBApplication::mUniboardSankoreTransition = 0;
UBMainWindow* UBApplication::mainWindow = 0; UBMainWindow* UBApplication::mainWindow = 0;
...@@ -91,9 +90,8 @@ static OSStatus ub_appleEventProcessor(const AppleEvent *ae, AppleEvent *event, ...@@ -91,9 +90,8 @@ static OSStatus ub_appleEventProcessor(const AppleEvent *ae, AppleEvent *event,
#endif #endif
UBApplication::UBApplication(const QString &id, int &argc, char **argv) UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSingleApplication(id, argc, argv),
: QtSingleApplication(id, argc, argv), mPreferencesController(NULL)
mPreferencesController(NULL)
{ {
staticMemoryCleaner = new QObject(0); // deleted in UBApplication destructor staticMemoryCleaner = new QObject(0); // deleted in UBApplication destructor
...@@ -186,11 +184,11 @@ UBApplication::~UBApplication() ...@@ -186,11 +184,11 @@ UBApplication::~UBApplication()
delete mUniboardSankoreTransition; delete mUniboardSankoreTransition;
mUniboardSankoreTransition = 0; mUniboardSankoreTransition = 0;
if (mPreferencesController) if (mPreferencesController)
{ {
delete mPreferencesController; delete mPreferencesController;
mPreferencesController = 0; mPreferencesController = 0;
} }
} }
int UBApplication::exec(const QString& pFileToImport) int UBApplication::exec(const QString& pFileToImport)
...@@ -343,6 +341,10 @@ void UBApplication::showDocument() ...@@ -343,6 +341,10 @@ void UBApplication::showDocument()
applicationController->showDocument(); applicationController->showDocument();
} }
void UBApplication::showSankoreWebDocument()
{
applicationController->showSankoreWebDocument();
}
int UBApplication::toolBarHeight() int UBApplication::toolBarHeight()
{ {
......
...@@ -88,6 +88,7 @@ class UBApplication : public QtSingleApplication ...@@ -88,6 +88,7 @@ class UBApplication : public QtSingleApplication
void showBoard(); void showBoard();
void showInternet(); void showInternet();
void showDocument(); void showDocument();
void showSankoreWebDocument();
void toolBarPositionChanged(QVariant topOrBottom); void toolBarPositionChanged(QVariant topOrBottom);
void toolBarDisplayTextChanged(QVariant display); void toolBarDisplayTextChanged(QVariant display);
......
...@@ -87,11 +87,10 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView, UBBo ...@@ -87,11 +87,10 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView, UBBo
, this, SLOT(addCapturedPixmap(const QPixmap &, bool, const QUrl&))); , this, SLOT(addCapturedPixmap(const QPixmap &, bool, const QUrl&)));
networkAccessManager = new QNetworkAccessManager (this); networkAccessManager = new QNetworkAccessManager (this);
connect (networkAccessManager, SIGNAL (finished (QNetworkReply*)), this, SLOT (downloadJsonFinished (QNetworkReply*)));
QTimer::singleShot (1000, this, SLOT (checkUpdateAtLaunch())); QTimer::singleShot (1000, this, SLOT (checkUpdateAtLaunch()));
#ifdef Q_WS_X11 #ifdef Q_WS_X11
// mMainWindow->setStyleSheet("QToolButton { font-size: 11px}"); mMainWindow->setStyleSheet("QToolButton { font-size: 11px}");
#endif #endif
} }
...@@ -326,7 +325,7 @@ void UBApplicationController::showBoard() ...@@ -326,7 +325,7 @@ void UBApplicationController::showBoard()
if (UBApplication::boardController) if (UBApplication::boardController)
UBApplication::boardController->show(); UBApplication::boardController->show();
UBPlatformUtils::setDesktopMode(false); UBPlatformUtils::setDesktopMode(false);
mUninoteController->hideWindow(); mUninoteController->hideWindow();
mMainWindow->show(); mMainWindow->show();
...@@ -397,6 +396,32 @@ void UBApplicationController::showDocument() ...@@ -397,6 +396,32 @@ void UBApplicationController::showDocument()
emit mainModeChanged(Document); emit mainModeChanged(Document);
} }
void UBApplicationController::showSankoreWebDocument()
{
mMainWindow->webToolBar->hide();
mMainWindow->boardToolBar->hide();
mMainWindow->tutorialToolBar->hide();
mMainWindow->documentToolBar->show();
mMainMode = WebDocument;
adaptToolBar();
mirroringEnabled(false);
mMainWindow->switchToSankoreWebDocumentWidget();
UBApplication::documentController->hide();
mMainWindow->show();
mUninoteController->hideWindow();
emit mainModeChanged(WebDocument);
}
void UBApplicationController::showDesktop(bool dontSwitchFrontProcess) void UBApplicationController::showDesktop(bool dontSwitchFrontProcess)
{ {
......
...@@ -53,6 +53,8 @@ class UBApplicationController : public QObject ...@@ -53,6 +53,8 @@ class UBApplicationController : public QObject
void showDocument(); void showDocument();
void showSankoreWebDocument();
void showMessage(const QString& message, bool showSpinningWheel); void showMessage(const QString& message, bool showSpinningWheel);
void importFile(const QString& pFilePath); void importFile(const QString& pFilePath);
...@@ -69,7 +71,7 @@ class UBApplicationController : public QObject ...@@ -69,7 +71,7 @@ class UBApplicationController : public QObject
enum MainMode enum MainMode
{ {
Board = 0, Internet, Document, Tutorial, ParaschoolEditor Board = 0, Internet, Document, Tutorial, ParaschoolEditor, WebDocument
}; };
MainMode displayMode() MainMode displayMode()
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "UBPersistenceManager.h" #include "UBPersistenceManager.h"
#include "core/memcheck.h" #include "core/memcheck.h"
#include "../adaptors/UBExportWeb.h"
UBDocumentManager* UBDocumentManager::sDocumentManager = 0; UBDocumentManager* UBDocumentManager::sDocumentManager = 0;
...@@ -53,9 +54,12 @@ UBDocumentManager::UBDocumentManager(QObject *parent) ...@@ -53,9 +54,12 @@ UBDocumentManager::UBDocumentManager(QObject *parent)
UBExportFullPDF* exportFullPdf = new UBExportFullPDF(this); UBExportFullPDF* exportFullPdf = new UBExportFullPDF(this);
mExportAdaptors.append(exportFullPdf); mExportAdaptors.append(exportFullPdf);
UBExportDocument* exportDocument = new UBExportDocument(this); UBExportDocument* exportDocument = new UBExportDocument(this);
mExportAdaptors.append(exportDocument); mExportAdaptors.append(exportDocument);
// UBExportWeb* exportWeb = new UBExportWeb(this);
// mExportAdaptors.append(exportWeb);
UBWebPublisher* webPublished = new UBWebPublisher(this);
mExportAdaptors.append(webPublished);
UBImportDocument* documentImport = new UBImportDocument(this); UBImportDocument* documentImport = new UBImportDocument(this);
mImportAdaptors.append(documentImport); mImportAdaptors.append(documentImport);
......
...@@ -1000,7 +1000,7 @@ void UBPersistenceManager::checkIfDocumentRepositoryExists() ...@@ -1000,7 +1000,7 @@ void UBPersistenceManager::checkIfDocumentRepositoryExists()
QMessageBox::question( QMessageBox::question(
QApplication::activeWindow(), QApplication::activeWindow(),
tr("Document Repository Loss"), tr("Document Repository Loss"),
tr("Uniboard has lost access to the document repository '%1'. Unfortunately the application must shut down to avoid data corruption. Latest changes may be lost as well.").arg(humanPath), tr("Sankore has lost access to the document repository '%1'. Unfortunately the application must shut down to avoid data corruption. Latest changes may be lost as well.").arg(humanPath),
QMessageBox::Yes); QMessageBox::Yes);
UBApplication::quit(); UBApplication::quit();
......
...@@ -1446,7 +1446,7 @@ bool UBDocumentController::isOKToOpenDocument(UBDocumentProxy* proxy) ...@@ -1446,7 +1446,7 @@ bool UBDocumentController::isOKToOpenDocument(UBDocumentProxy* proxy)
else else
{ {
if (QMessageBox::question( 0, tr("Open Document"), if (QMessageBox::question( 0, tr("Open Document"),
tr("The document '%1' has been generated with a newer version of Uniboard (%2). By opening it, you may lose some information. Do you want to proceed?") tr("The document '%1' has been generated with a newer version of Sankore (%2). By opening it, you may lose some information. Do you want to proceed?")
.arg(proxy->metaData(UBSettings::documentName).toString()) .arg(proxy->metaData(UBSettings::documentName).toString())
.arg(docVersion), .arg(docVersion),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)
......
...@@ -33,10 +33,10 @@ class UBDocumentController : public QObject ...@@ -33,10 +33,10 @@ class UBDocumentController : public QObject
QWidget* controlView(); QWidget* controlView();
UBDocumentProxyTreeItem* findDocument(UBDocumentProxy* proxy); UBDocumentProxyTreeItem* findDocument(UBDocumentProxy* proxy);
bool addFileToDocument(UBDocumentProxy* document); bool addFileToDocument(UBDocumentProxy* document);
UBDocumentProxy* getCurrentDocument(); UBDocumentProxy* getCurrentDocument();
signals: signals:
void refreshThumbnails(); void refreshThumbnails();
void exportDone(); void exportDone();
public slots: public slots:
...@@ -91,7 +91,7 @@ class UBDocumentController : public QObject ...@@ -91,7 +91,7 @@ class UBDocumentController : public QObject
UBDocumentToolsPalette *mToolsPalette; UBDocumentToolsPalette *mToolsPalette;
bool mToolsPalettePositionned; bool mToolsPalettePositionned;
UBDocumentGroupTreeItem* mTrashTi; UBDocumentGroupTreeItem* mTrashTi;
UBDocumentProxy* mCurrentDocument; UBDocumentProxy* mCurrentDocument;
private slots: private slots:
void documentZoomSliderValueChanged (int value); void documentZoomSliderValueChanged (int value);
......
...@@ -46,8 +46,8 @@ void UBPlatformUtils::init() ...@@ -46,8 +46,8 @@ void UBPlatformUtils::init()
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *currentPath = [[NSBundle mainBundle] pathForResource:@"Save PDF to Uniboard" ofType:@"workflow"]; NSString *currentPath = [[NSBundle mainBundle] pathForResource:@"Save PDF to Sankore" ofType:@"workflow"];
NSString *installedPath = [[[@"~/Library/PDF Services" stringByExpandingTildeInPath] stringByAppendingPathComponent:@"Save PDF to Uniboard"] stringByAppendingPathExtension:@"workflow"]; NSString *installedPath = [[[@"~/Library/PDF Services" stringByExpandingTildeInPath] stringByAppendingPathComponent:@"Save PDF to Sankore"] stringByAppendingPathExtension:@"workflow"];
NSString *currentVersion = bundleShortVersion([NSBundle bundleWithPath:currentPath]); NSString *currentVersion = bundleShortVersion([NSBundle bundleWithPath:currentPath]);
NSString *installedVersion = bundleShortVersion([NSBundle bundleWithPath:installedPath]); NSString *installedVersion = bundleShortVersion([NSBundle bundleWithPath:installedPath]);
...@@ -59,7 +59,7 @@ void UBPlatformUtils::init() ...@@ -59,7 +59,7 @@ void UBPlatformUtils::init()
BOOL copyOK = [fileManager copyPath:currentPath toPath:installedPath handler:nil]; BOOL copyOK = [fileManager copyPath:currentPath toPath:installedPath handler:nil];
if (!copyOK) if (!copyOK)
{ {
qWarning("Could not install the 'Save PDF to Uniboard' workflow"); qWarning("Could not install the 'Save PDF to Sankore' workflow");
} }
} }
...@@ -364,25 +364,25 @@ KEYBT* createKeyBt(const UCKeyboardLayout* keyLayout, int vkk) ...@@ -364,25 +364,25 @@ KEYBT* createKeyBt(const UCKeyboardLayout* keyLayout, int vkk)
void UBPlatformUtils::initializeKeyboardLayouts() void UBPlatformUtils::initializeKeyboardLayouts()
{ {
CFStringRef keys[] = { kTISPropertyInputSourceCategory, kTISPropertyInputSourceIsEnableCapable, kTISPropertyInputSourceIsSelectCapable }; CFStringRef keys[] = { kTISPropertyInputSourceCategory, kTISPropertyInputSourceIsEnableCapable, kTISPropertyInputSourceIsSelectCapable };
const void* values[] = { kTISCategoryKeyboardInputSource, kCFBooleanTrue, kCFBooleanTrue }; const void* values[] = { kTISCategoryKeyboardInputSource, kCFBooleanTrue, kCFBooleanTrue };
CFDictionaryRef dict = CFDictionaryCreate(NULL, (const void **)keys, (const void **)values, 3, NULL, NULL); CFDictionaryRef dict = CFDictionaryCreate(NULL, (const void **)keys, (const void **)values, 3, NULL, NULL);
CFArrayRef kbds = TISCreateInputSourceList(dict, false); CFArrayRef kbds = TISCreateInputSourceList(dict, false);
int count = CFArrayGetCount(kbds); int count = CFArrayGetCount(kbds);
QList<UBKeyboardLocale*> result; QList<UBKeyboardLocale*> result;
for(int i=0; i<count; i++) for(int i=0; i<count; i++)
{ {
TISInputSourceRef keyLayoutRef = (TISInputSourceRef)CFArrayGetValueAtIndex(kbds, i); TISInputSourceRef keyLayoutRef = (TISInputSourceRef)CFArrayGetValueAtIndex(kbds, i);
if (keyLayoutRef==NULL) if (keyLayoutRef==NULL)
continue; continue;
CFDataRef ref = (CFDataRef) TISGetInputSourceProperty(keyLayoutRef, CFDataRef ref = (CFDataRef) TISGetInputSourceProperty(keyLayoutRef,
kTISPropertyUnicodeKeyLayoutData); kTISPropertyUnicodeKeyLayoutData);
if (ref==NULL) if (ref==NULL)
continue; continue;
const UCKeyboardLayout* keyLayout = (const UCKeyboardLayout*) CFDataGetBytePtr(ref); const UCKeyboardLayout* keyLayout = (const UCKeyboardLayout*) CFDataGetBytePtr(ref);
if (keyLayoutRef==NULL) if (keyLayoutRef==NULL)
continue; continue;
...@@ -438,12 +438,12 @@ void UBPlatformUtils::initializeKeyboardLayouts() ...@@ -438,12 +438,12 @@ void UBPlatformUtils::initializeKeyboardLayouts()
keybt[44] = createKeyBt(keyLayout, 43); keybt[44] = createKeyBt(keyLayout, 43);
keybt[45] = createKeyBt(keyLayout, 47); keybt[45] = createKeyBt(keyLayout, 47);
keybt[46] = createKeyBt(keyLayout, 44); keybt[46] = createKeyBt(keyLayout, 44);
CFStringRef sr = (CFStringRef) TISGetInputSourceProperty(keyLayoutRef, kTISPropertyInputSourceID); CFStringRef sr = (CFStringRef) TISGetInputSourceProperty(keyLayoutRef, kTISPropertyInputSourceID);
QString ID = QStringFromStringRef(sr); QString ID = QStringFromStringRef(sr);
sr = (CFStringRef) TISGetInputSourceProperty(keyLayoutRef, kTISPropertyLocalizedName); sr = (CFStringRef) TISGetInputSourceProperty(keyLayoutRef, kTISPropertyLocalizedName);
QString fullName = QStringFromStringRef(sr); QString fullName = QStringFromStringRef(sr);
CFArrayRef langs = (CFArrayRef) TISGetInputSourceProperty(keyLayoutRef, CFArrayRef langs = (CFArrayRef) TISGetInputSourceProperty(keyLayoutRef,
...@@ -455,13 +455,13 @@ void UBPlatformUtils::initializeKeyboardLayouts() ...@@ -455,13 +455,13 @@ void UBPlatformUtils::initializeKeyboardLayouts()
CFStringRef langRef = (CFStringRef)CFArrayGetValueAtIndex(langs, 0); CFStringRef langRef = (CFStringRef)CFArrayGetValueAtIndex(langs, 0);
name = QStringFromStringRef(langRef); name = QStringFromStringRef(langRef);
} }
//IconRef iconRef = (IconRef)TISGetInputSourceProperty(kTISPropertyIconRef, //IconRef iconRef = (IconRef)TISGetInputSourceProperty(kTISPropertyIconRef,
// kTISPropertyInputSourceLanguages); // kTISPropertyInputSourceLanguages);
result.append(new UBKeyboardLocale(fullName, name, ID, NULL, keybt)); result.append(new UBKeyboardLocale(fullName, name, ID, NULL, keybt));
} }
if (result.size()==0) if (result.size()==0)
{ {
nKeyboardLayouts = 0; nKeyboardLayouts = 0;
......
...@@ -14,6 +14,7 @@ UBMainWindow::UBMainWindow(QWidget *parent, Qt::WindowFlags flags) ...@@ -14,6 +14,7 @@ UBMainWindow::UBMainWindow(QWidget *parent, Qt::WindowFlags flags)
, mBoardWidget(0) , mBoardWidget(0)
, mWebWidget(0) , mWebWidget(0)
, mDocumentsWidget(0) , mDocumentsWidget(0)
, mSankoreWebDocumentWidget(0)
{ {
Ui::MainWindow::setupUi(this); Ui::MainWindow::setupUi(this);
...@@ -91,6 +92,19 @@ void UBMainWindow::switchToDocumentsWidget() ...@@ -91,6 +92,19 @@ void UBMainWindow::switchToDocumentsWidget()
} }
} }
void UBMainWindow::addSankoreWebDocumentWidget(QWebView* pWidget)
{
if(!mSankoreWebDocumentWidget){
mSankoreWebDocumentWidget = pWidget;
mStackedLayout->addWidget(mSankoreWebDocumentWidget);
}
}
void UBMainWindow::switchToSankoreWebDocumentWidget()
{
if(mSankoreWebDocumentWidget)
mStackedLayout->setCurrentWidget(mSankoreWebDocumentWidget);
}
void UBMainWindow::keyPressEvent(QKeyEvent *event) void UBMainWindow::keyPressEvent(QKeyEvent *event)
{ {
QMainWindow::keyPressEvent(event); QMainWindow::keyPressEvent(event);
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <QMainWindow> #include <QMainWindow>
#include <QWidget> #include <QWidget>
#include <QWebView>
class QStackedLayout; class QStackedLayout;
...@@ -27,6 +28,9 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow ...@@ -27,6 +28,9 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow
void addDocumentsWidget(QWidget *pWidget); void addDocumentsWidget(QWidget *pWidget);
void switchToDocumentsWidget(); void switchToDocumentsWidget();
void addSankoreWebDocumentWidget(QWebView* pWidget);
void switchToSankoreWebDocumentWidget();
public slots: public slots:
void onExportDone(); void onExportDone();
...@@ -45,6 +49,7 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow ...@@ -45,6 +49,7 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow
QWidget *mBoardWidget; QWidget *mBoardWidget;
QWidget *mWebWidget; QWidget *mWebWidget;
QWidget *mDocumentsWidget; QWidget *mDocumentsWidget;
QWebView* mSankoreWebDocumentWidget;
}; };
......
...@@ -338,7 +338,7 @@ void UBPodcastController::start() ...@@ -338,7 +338,7 @@ void UBPodcastController::start()
} }
else else
{ {
videoFileName = mPodcastRecordingPath + "/" + tr("Uniboard Cast") + "." + mVideoEncoder->videoFileExtension(); videoFileName = mPodcastRecordingPath + "/" + tr("Sankore Cast") + "." + mVideoEncoder->videoFileExtension();
} }
videoFileName = UBFileSystemUtils::nextAvailableFileName(videoFileName, " "); videoFileName = UBFileSystemUtils::nextAvailableFileName(videoFileName, " ");
......
...@@ -7,68 +7,69 @@ class QGraphicsSvgItem; ...@@ -7,68 +7,69 @@ class QGraphicsSvgItem;
class UBAbstractDrawRuler : public QObject class UBAbstractDrawRuler : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
UBAbstractDrawRuler(); UBAbstractDrawRuler();
~UBAbstractDrawRuler(); ~UBAbstractDrawRuler();
void create(QGraphicsItem& item); void create(QGraphicsItem& item);
virtual void StartLine(const QPointF& position, qreal width); virtual void StartLine(const QPointF& position, qreal width);
virtual void DrawLine(const QPointF& position, qreal width); virtual void DrawLine(const QPointF& position, qreal width);
virtual void EndLine(); virtual void EndLine();
protected:
protected:
void paint();
void paint();
virtual UBGraphicsScene* scene() const = 0;
virtual UBGraphicsScene* scene() const = 0;
virtual void rotateAroundTopLeftOrigin(qreal angle) = 0;
virtual void rotateAroundTopLeftOrigin(qreal angle) = 0;
virtual QPointF topLeftOrigin() const = 0;
virtual QRectF resizeButtonRect() const = 0; virtual QPointF topLeftOrigin() const = 0;
virtual QRectF closeButtonRect() const = 0; virtual QRectF resizeButtonRect() const = 0;
virtual QRectF rotateButtonRect() const = 0; virtual QRectF closeButtonRect() const = 0;
virtual QRectF rotateButtonRect() const = 0;
void updateResizeCursor(QGraphicsItem &item);
void updateResizeCursor(QGraphicsItem &item);
bool mResizing;
bool mRotating; bool mResizing;
bool mShowButtons; bool mRotating;
QGraphicsSvgItem* mCloseSvgItem; bool mShowButtons;
QGraphicsSvgItem* mRotateSvgItem; QGraphicsSvgItem* mCloseSvgItem;
QCursor mResizeCursor; QGraphicsSvgItem* mRotateSvgItem;
qreal mAntiScaleRatio; QCursor mResizeCursor;
qreal mAntiScaleRatio;
QPointF startDrawPosition;
QPointF startDrawPosition;
QCursor moveCursor() const;
QCursor resizeCursor() const; QCursor moveCursor() const;
QCursor rotateCursor() const; QCursor resizeCursor() const;
QCursor closeCursor() const; QCursor rotateCursor() const;
QCursor drawRulerLineCursor() const; QCursor closeCursor() const;
QCursor drawRulerLineCursor() const;
QColor drawColor() const;
QColor middleFillColor() const; QColor drawColor() const;
QColor edgeFillColor() const; QColor middleFillColor() const;
QFont font() const; QColor edgeFillColor() const;
QFont font() const;
static const QColor sLightBackgroundEdgeFillColor;
static const QColor sLightBackgroundMiddleFillColor; static const QColor sLightBackgroundEdgeFillColor;
static const QColor sLightBackgroundDrawColor; static const QColor sLightBackgroundMiddleFillColor;
static const QColor sDarkBackgroundEdgeFillColor; static const QColor sLightBackgroundDrawColor;
static const QColor sDarkBackgroundMiddleFillColor; static const QColor sDarkBackgroundEdgeFillColor;
static const QColor sDarkBackgroundDrawColor; static const QColor sDarkBackgroundMiddleFillColor;
static const QColor sDarkBackgroundDrawColor;
static const int sLeftEdgeMargin = 10;
static const int sMinLength = 150; static const int sLeftEdgeMargin = 10;
static const int sDegreeToQtAngleUnit = 16; static const int sMinLength = 150;
static const int sRotationRadius = 15; static const int sDegreeToQtAngleUnit = 16;
static const int sPixelsPerMillimeter = 5; static const int sRotationRadius = 15;
static const int sFillTransparency = 127; static const int sPixelsPerMillimeter = 5;
static const int sDrawTransparency = 192; static const int sFillTransparency = 127;
static const int sRoundingRadius = sLeftEdgeMargin / 2; static const int sDrawTransparency = 192;
static const int sRoundingRadius = sLeftEdgeMargin / 2;
}; };
......
This diff is collapsed.
...@@ -58,6 +58,7 @@ class UBGraphicsProtractor : public UBAbstractDrawRuler, public QGraphicsEllipse ...@@ -58,6 +58,7 @@ class UBGraphicsProtractor : public UBAbstractDrawRuler, public QGraphicsEllipse
virtual void hoverMoveEvent (QGraphicsSceneHoverEvent *event); virtual void hoverMoveEvent (QGraphicsSceneHoverEvent *event);
virtual QPainterPath shape() const; virtual QPainterPath shape() const;
QRectF boundingRect() const; QRectF boundingRect() const;
private: private:
// Helpers // Helpers
void paintGraduations (QPainter *painter); void paintGraduations (QPainter *painter);
...@@ -90,10 +91,13 @@ class UBGraphicsProtractor : public UBAbstractDrawRuler, public QGraphicsEllipse ...@@ -90,10 +91,13 @@ class UBGraphicsProtractor : public UBAbstractDrawRuler, public QGraphicsEllipse
QGraphicsSvgItem* mResizeSvgItem; QGraphicsSvgItem* mResizeSvgItem;
QGraphicsSvgItem* mMarkerSvgItem; QGraphicsSvgItem* mMarkerSvgItem;
static const QRectF sDefaultRect; static const QRectF sDefaultRect;
virtual void rotateAroundTopLeftOrigin(qreal angle);
virtual QPointF topLeftOrigin() const;
virtual void rotateAroundTopLeftOrigin(qreal angle); int sFillTransparency;
virtual QPointF topLeftOrigin() const; int sDrawTransparency;
}; };
#endif /* UBGRAPHICSPROTRACTOR_H_ */ #endif /* UBGRAPHICSPROTRACTOR_H_ */
...@@ -151,7 +151,7 @@ void WBWebPage::handleUnsupportedContent(QNetworkReply *reply) ...@@ -151,7 +151,7 @@ void WBWebPage::handleUnsupportedContent(QNetworkReply *reply)
if (isPDF) if (isPDF)
{ {
QMessageBox messageBox(mainWindow()); QMessageBox messageBox(mainWindow());
messageBox.setText(tr("Download PDF Document: would you prefer to download the PDF file or add it to the current Uniboard document?")); messageBox.setText(tr("Download PDF Document: would you prefer to download the PDF file or add it to the current Sankore document?"));
messageBox.addButton(tr("Download"), QMessageBox::AcceptRole); messageBox.addButton(tr("Download"), QMessageBox::AcceptRole);
QAbstractButton *addButton = QAbstractButton *addButton =
......
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