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()
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
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;
QString pdfFilename = pdfFileName(pFile);
......@@ -159,7 +159,7 @@ UBDocumentProxy* UBImportVirtualPrinter::importFile(const QFile& pFile, const QS
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));
......@@ -170,7 +170,7 @@ UBDocumentProxy* UBImportVirtualPrinter::importFile(const QFile& pFile, const QS
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;
QString pdfFilename = pdfFileName(pFile);
......@@ -183,7 +183,7 @@ bool UBImportVirtualPrinter::addFileToDocument(UBDocumentProxy* pDocument, const
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));
......
......@@ -204,7 +204,7 @@ QMap<QString, QVariant> UBMetadataDcSubsetAdaptor::load(QString pPath)
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()
if (mXmlReader.hasError())
{
qWarning() << "error parsing uniboard file " << mXmlReader.errorString();
qWarning() << "error parsing Sankore file " << mXmlReader.errorString();
}
if (scene)
......@@ -2576,31 +2576,16 @@ UBGraphicsTriangle* UBSvgSubsetAdaptor::UBSvgSubsetReader::triangleFromSvg()
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 svgY = mXmlReader.attributes().value("y");
QStringRef svgWidth = mXmlReader.attributes().value("width");
QStringRef svgHeight = mXmlReader.attributes().value("height");
UBGraphicsTriangle::UBGraphicsTriangleOrientation orientation =
UBGraphicsTriangle::orientationFromStr((mXmlReader.attributes().value("orientation")));
QStringRef orientationStringRef = mXmlReader.attributes().value("orientation");
UBGraphicsTriangle::UBGraphicsTriangleOrientation orientation = UBGraphicsTriangle::orientationFromStr(orientationStringRef);
if (!svgX.isNull() && !svgY.isNull() && !svgWidth.isNull() && !svgHeight.isNull())
{
triangle->setRect(svgX.toString().toFloat(), svgY.toString().toFloat()
, svgWidth.toString().toFloat(), svgHeight.toString().toFloat(),
orientation);
triangle->setRect(svgX.toString().toFloat(), svgY.toString().toFloat(), svgWidth.toString().toFloat(), svgHeight.toString().toFloat(), orientation);
}
triangle->setVisible(true);
......
......@@ -28,7 +28,7 @@ UBWebPublisher::~UBWebPublisher()
QString UBWebPublisher::exportName()
{
return tr("Publish Document on Uniboard Web");
return tr("Publish Document on Sankore Web");
}
......
......@@ -10,74 +10,56 @@
class UBDocumentProxy;
class UBServerXMLHttpRequest;
class UBGraphicsW3CWidgetItem;
class QWebView;
class UBDocumentPublisher : public UBAbstractPublisher
{
Q_OBJECT;
public:
public:
explicit UBDocumentPublisher(UBDocumentProxy* sourceDocument, QObject *parent = 0);
virtual ~UBDocumentPublisher();
void publish();
protected:
signals:
// not needed as we do not publish svg file anymore
//virtual void rasterizePDF();
//virtual void rasterizeSVGImages();
//virtual void updateSVGForWidget(int sceneIndex);
void loginDone();
virtual void updateGoogleMapApiKey();
protected:
virtual void updateGoogleMapApiKey();
virtual void rasterizeScenes();
virtual void upgradeDocumentForPublishing();
virtual void generateWidgetPropertyScript(UBGraphicsW3CWidgetItem *widgetItem, int pageNumber);
void sendZipToUniboardWeb(const QString& zipFile, const QUuid& publishingUuid);
private slots:
void postDocument(const QUuid& tokenUuid, const QString& encryptedBase64Token);
void uploadProgress(qint64, qint64);
void postZipUploadResponse(bool, const QByteArray&);
private:
UBDocumentProxy *mSourceDocument;
UBDocumentProxy *mPublishingDocument;
UBServerXMLHttpRequest* mUploadRequest;
private slots:
QString mTitle;
QString mAuthor;
QString mDescription;
QString mEMail;
bool mAttachPDF;
bool mAttachUBZ;
void onFinished(QNetworkReply* reply);
void onLinkClicked(const QUrl& url);
void onLoadFinished(bool result);
QUrl mPublishingUrl;
QString mPublishingServiceUrl;
QUuid mAuthenticationUuid;
QString mAuthenticationBase64Token;
private:
};
void init();
void sendUbw();
QString getBase64Of(QString stringToEncode);
QWebView* mpWebView;
QHBoxLayout* mpLayout;
QNetworkAccessManager* mpNetworkMgr;
QNetworkCookieJar* mpCookieJar;
QString mUsername;
QString mPassword;
QString mCrlf;
bool bCookieSet;
class UBDocumentPublishingDialog : public QDialog, public Ui::documentPublishingDialog
{
Q_OBJECT;
void buildUbwFile();
QString mTmpZipFile;
public:
UBDocumentPublishingDialog(QWidget *parent = 0);
~UBDocumentPublishingDialog(){}
private slots:
void updateUIState(const QString& string);
UBDocumentProxy *mSourceDocument;
UBDocumentProxy *mPublishingDocument;
};
#endif // UBDOCUMENTPUBLISHER_H
......@@ -956,7 +956,7 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
}
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"))
......
......@@ -152,7 +152,7 @@ void UBBoardPaletteManager::setupPalettes()
addItemActions << UBApplication::mainWindow->actionAddItemToCurrentPage;
addItemActions << UBApplication::mainWindow->actionAddItemToNewPage;
addItemActions << UBApplication::mainWindow->actionAddItemToLibrary;
//addItemActions << UBApplication::mainWindow->actionShareItemOnWeb;
addItemActions << UBApplication::mainWindow->actionShareItemOnWeb;
mAddItemPalette = new UBActionPalette(addItemActions, Qt::Horizontal, 0);
mAddItemPalette->setButtonIconSize(QSize(128, 128));
......@@ -306,7 +306,7 @@ void UBBoardPaletteManager::connectPalettes()
connect(UBApplication::mainWindow->actionAddItemToCurrentPage, SIGNAL(triggered()), this, SLOT(addItemToCurrentPage()));
connect(UBApplication::mainWindow->actionAddItemToNewPage, SIGNAL(triggered()), this, SLOT(addItemToNewPage()));
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->actionEraseAnnotations, SIGNAL(triggered()), mErasePalette, SLOT(close()));
......
......@@ -53,7 +53,6 @@ UBApplicationController* UBApplication::applicationController = 0;
UBBoardController* UBApplication::boardController = 0;
UBWebController* UBApplication::webController = 0;
UBDocumentController* UBApplication::documentController = 0;
//UBSoftwareUpdateController* UBApplication::softwareUpdateController = 0;
UniboardSankoreTransition* UBApplication::mUniboardSankoreTransition = 0;
UBMainWindow* UBApplication::mainWindow = 0;
......@@ -91,8 +90,7 @@ static OSStatus ub_appleEventProcessor(const AppleEvent *ae, AppleEvent *event,
#endif
UBApplication::UBApplication(const QString &id, int &argc, char **argv)
: QtSingleApplication(id, argc, argv),
UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSingleApplication(id, argc, argv),
mPreferencesController(NULL)
{
......@@ -343,6 +341,10 @@ void UBApplication::showDocument()
applicationController->showDocument();
}
void UBApplication::showSankoreWebDocument()
{
applicationController->showSankoreWebDocument();
}
int UBApplication::toolBarHeight()
{
......
......@@ -88,6 +88,7 @@ class UBApplication : public QtSingleApplication
void showBoard();
void showInternet();
void showDocument();
void showSankoreWebDocument();
void toolBarPositionChanged(QVariant topOrBottom);
void toolBarDisplayTextChanged(QVariant display);
......
......@@ -87,11 +87,10 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView, UBBo
, this, SLOT(addCapturedPixmap(const QPixmap &, bool, const QUrl&)));
networkAccessManager = new QNetworkAccessManager (this);
connect (networkAccessManager, SIGNAL (finished (QNetworkReply*)), this, SLOT (downloadJsonFinished (QNetworkReply*)));
QTimer::singleShot (1000, this, SLOT (checkUpdateAtLaunch()));
#ifdef Q_WS_X11
// mMainWindow->setStyleSheet("QToolButton { font-size: 11px}");
mMainWindow->setStyleSheet("QToolButton { font-size: 11px}");
#endif
}
......@@ -397,6 +396,32 @@ void UBApplicationController::showDocument()
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)
{
......
......@@ -53,6 +53,8 @@ class UBApplicationController : public QObject
void showDocument();
void showSankoreWebDocument();
void showMessage(const QString& message, bool showSpinningWheel);
void importFile(const QString& pFilePath);
......@@ -69,7 +71,7 @@ class UBApplicationController : public QObject
enum MainMode
{
Board = 0, Internet, Document, Tutorial, ParaschoolEditor
Board = 0, Internet, Document, Tutorial, ParaschoolEditor, WebDocument
};
MainMode displayMode()
......
......@@ -29,6 +29,7 @@
#include "UBPersistenceManager.h"
#include "core/memcheck.h"
#include "../adaptors/UBExportWeb.h"
UBDocumentManager* UBDocumentManager::sDocumentManager = 0;
......@@ -53,9 +54,12 @@ UBDocumentManager::UBDocumentManager(QObject *parent)
UBExportFullPDF* exportFullPdf = new UBExportFullPDF(this);
mExportAdaptors.append(exportFullPdf);
UBExportDocument* exportDocument = new UBExportDocument(this);
mExportAdaptors.append(exportDocument);
// UBExportWeb* exportWeb = new UBExportWeb(this);
// mExportAdaptors.append(exportWeb);
UBWebPublisher* webPublished = new UBWebPublisher(this);
mExportAdaptors.append(webPublished);
UBImportDocument* documentImport = new UBImportDocument(this);
mImportAdaptors.append(documentImport);
......
......@@ -1000,7 +1000,7 @@ void UBPersistenceManager::checkIfDocumentRepositoryExists()
QMessageBox::question(
QApplication::activeWindow(),
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);
UBApplication::quit();
......
......@@ -1446,7 +1446,7 @@ bool UBDocumentController::isOKToOpenDocument(UBDocumentProxy* proxy)
else
{
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(docVersion),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)
......
......@@ -46,8 +46,8 @@ void UBPlatformUtils::init()
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *currentPath = [[NSBundle mainBundle] pathForResource:@"Save PDF to Uniboard" ofType:@"workflow"];
NSString *installedPath = [[[@"~/Library/PDF Services" stringByExpandingTildeInPath] stringByAppendingPathComponent:@"Save PDF to Uniboard"] stringByAppendingPathExtension:@"workflow"];
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 *currentVersion = bundleShortVersion([NSBundle bundleWithPath:currentPath]);
NSString *installedVersion = bundleShortVersion([NSBundle bundleWithPath:installedPath]);
......@@ -59,7 +59,7 @@ void UBPlatformUtils::init()
BOOL copyOK = [fileManager copyPath:currentPath toPath:installedPath handler:nil];
if (!copyOK)
{
qWarning("Could not install the 'Save PDF to Uniboard' workflow");
qWarning("Could not install the 'Save PDF to Sankore' workflow");
}
}
......
......@@ -14,6 +14,7 @@ UBMainWindow::UBMainWindow(QWidget *parent, Qt::WindowFlags flags)
, mBoardWidget(0)
, mWebWidget(0)
, mDocumentsWidget(0)
, mSankoreWebDocumentWidget(0)
{
Ui::MainWindow::setupUi(this);
......@@ -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)
{
QMainWindow::keyPressEvent(event);
......
......@@ -5,6 +5,7 @@
#include <QMainWindow>
#include <QWidget>
#include <QWebView>
class QStackedLayout;
......@@ -27,6 +28,9 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow
void addDocumentsWidget(QWidget *pWidget);
void switchToDocumentsWidget();
void addSankoreWebDocumentWidget(QWebView* pWidget);
void switchToSankoreWebDocumentWidget();
public slots:
void onExportDone();
......@@ -45,6 +49,7 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow
QWidget *mBoardWidget;
QWidget *mWebWidget;
QWidget *mDocumentsWidget;
QWebView* mSankoreWebDocumentWidget;
};
......
......@@ -338,7 +338,7 @@ void UBPodcastController::start()
}
else
{
videoFileName = mPodcastRecordingPath + "/" + tr("Uniboard Cast") + "." + mVideoEncoder->videoFileExtension();
videoFileName = mPodcastRecordingPath + "/" + tr("Sankore Cast") + "." + mVideoEncoder->videoFileExtension();
}
videoFileName = UBFileSystemUtils::nextAvailableFileName(videoFileName, " ");
......
......@@ -9,7 +9,7 @@ class UBAbstractDrawRuler : public QObject
{
Q_OBJECT
public:
public:
UBAbstractDrawRuler();
~UBAbstractDrawRuler();
......@@ -18,7 +18,8 @@ class UBAbstractDrawRuler : public QObject
virtual void StartLine(const QPointF& position, qreal width);
virtual void DrawLine(const QPointF& position, qreal width);
virtual void EndLine();
protected:
protected:
void paint();
......
......@@ -13,6 +13,7 @@
#include "board/UBBoardController.h"
#include "board/UBDrawingController.h"
#include "core/memcheck.h"
......@@ -30,6 +31,8 @@ UBGraphicsProtractor::UBGraphicsProtractor()
, mResizeSvgItem(0)
, mMarkerSvgItem(0)
{
sFillTransparency = 127;
sDrawTransparency = 192;
create(*this);
......@@ -125,7 +128,7 @@ QPainterPath UBGraphicsProtractor::shape() const
qreal centerY = center.y();
buttonPath.addRect(resizeButtonRect().adjusted(centerX, centerY, centerX, centerY));
if(!resizeButtonRect().contains(markerRect))
if (!resizeButtonRect().contains(markerRect))
{
buttonPath.addRect(markerRect.adjusted(centerX - markerRect.left() * 2 - markerRect.width(), centerY
, centerX - markerRect.left() * 2 - markerRect.width(), centerY));
......@@ -166,7 +169,7 @@ void UBGraphicsProtractor::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
qreal angle = startLine.angleTo(currentLine);
qreal scaleFactor = currentLine.length()/startLine.length();
switch(mCurrentTool)
switch (mCurrentTool)
{
case Rotate :
prepareGeometryChange();
......@@ -186,9 +189,9 @@ void UBGraphicsProtractor::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
case MoveMarker :
mCurrentAngle += angle;
if((int)mCurrentAngle % 360 > 270)
if ((int)mCurrentAngle % 360 > 270)
mCurrentAngle = 0;
else if((int)mCurrentAngle % 360 >= 180)
else if ((int)mCurrentAngle % 360 >= 180)
mCurrentAngle = 180;
mPreviousMousePos = currentPoint;
......@@ -203,7 +206,7 @@ void UBGraphicsProtractor::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
break;
}
if(mCurrentTool != Move)
if (mCurrentTool != Move)
event->accept();
}
......@@ -211,7 +214,7 @@ void UBGraphicsProtractor::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
void UBGraphicsProtractor::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
switch(mCurrentTool)
switch (mCurrentTool)
{
case Reset :
setStartAngle(0);
......@@ -286,7 +289,7 @@ void UBGraphicsProtractor::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
update();
}
if(currentTool == Move)
if (currentTool == Move)
setCursor(Qt::SizeAllCursor);
else
setCursor(Qt::ArrowCursor);
......@@ -305,7 +308,7 @@ QRectF UBGraphicsProtractor::resetButtonRect () const
{
qreal antiSc = antiScale();
if(buttonSizeReference().width() * antiSc <= buttonSizeReference().width() * 15)
if (buttonSizeReference().width() * antiSc <= buttonSizeReference().width() * 15)
return QRectF(-buttonSizeReference().width() * 7, -buttonSizeReference().height() * antiSc / 2,
buttonSizeReference().width() * antiSc, buttonSizeReference().height() * antiSc);
else
......@@ -334,7 +337,7 @@ QRectF UBGraphicsProtractor::resizeButtonRect () const
{
qreal antiSc = antiScale();
if(buttonSizeReference().width() * antiSc <= buttonSizeReference().width() * 15)
if (buttonSizeReference().width() * antiSc <= buttonSizeReference().width() * 15)
return QRectF(buttonSizeReference().width() * 8, -buttonSizeReference().height() * antiSc / 2,
buttonSizeReference().width() * antiSc, buttonSizeReference().height() * antiSc);
else
......@@ -370,12 +373,12 @@ void UBGraphicsProtractor::paintGraduations(QPainter *painter)
QPointF center = rect().center();
painter->drawArc(QRectF(center.x() - rad/2, center.y() - rad/2, rad, rad), mStartAngle*16, mSpan*16);
for(int angle = 1; angle < mSpan; angle++)
for (int angle = 1; angle < mSpan; angle++)
{
int graduationLength = (0 == angle % 10) ? tenDegreeGraduationLength : ((0 == angle % 5) ? fiveDegreeGraduationLength : oneDegreeGraduationLength);
qreal co = cos(((qreal)angle + mStartAngle) * PI/180);
qreal si = sin(((qreal)angle + mStartAngle) * PI/180);
if(0 == angle % 90)
if (0 == angle % 90)
painter->drawLine(QLineF(QPointF(center.x(), center.y()), QPointF(center.x() + co*tenDegreeGraduationLength, center.y() - si*tenDegreeGraduationLength)));
//external arc
......@@ -415,7 +418,7 @@ void UBGraphicsProtractor::paintButtons(QPainter *painter)
{
Q_UNUSED(painter);
if(mShowButtons)
if (mShowButtons)
{
qreal antiSc = antiScale();
......@@ -495,7 +498,7 @@ void UBGraphicsProtractor::paintAngleMarker(QPainter *painter)
qreal angle = mCurrentAngle - (int)(mCurrentAngle/360)*360;
if(angle != 0)
if (angle != 0)
{
QString ang = QString("%1").arg(angle,0, 'f', 1);
QFont font2 = painter->font();
......@@ -528,17 +531,17 @@ UBGraphicsProtractor::Tool UBGraphicsProtractor::toolFromPos(QPointF pos)
t.rotate(mCurrentAngle);
QPointF p2 = t.map(pos);
if(resizeButtonRect().contains(p1))
if (resizeButtonRect().contains(p1))
return Resize;
else if(closeButtonRect().contains(p1))
else if (closeButtonRect().contains(p1))
return Close;
else if(resetButtonRect().contains(p1))
else if (resetButtonRect().contains(p1))
return Reset;
else if(rotateButtonRect().contains(p1))
else if (rotateButtonRect().contains(p1))
return Rotate;
else if(markerButtonRect().contains(p2))
else if (markerButtonRect().contains(p2))
return MoveMarker;
else if(line.length() <= radius())
else if (line.length() <= radius())
return Move;
else
return None;
......@@ -584,7 +587,9 @@ UBItem* UBGraphicsProtractor::deepCopy() const
void UBGraphicsProtractor::rotateAroundTopLeftOrigin(qreal angle)
{}
{
Q_UNUSED(angle);
}
QPointF UBGraphicsProtractor::topLeftOrigin() const
{
......
......@@ -58,6 +58,7 @@ class UBGraphicsProtractor : public UBAbstractDrawRuler, public QGraphicsEllipse
virtual void hoverMoveEvent (QGraphicsSceneHoverEvent *event);
virtual QPainterPath shape() const;
QRectF boundingRect() const;
private:
// Helpers
void paintGraduations (QPainter *painter);
......@@ -94,6 +95,9 @@ class UBGraphicsProtractor : public UBAbstractDrawRuler, public QGraphicsEllipse
virtual void rotateAroundTopLeftOrigin(qreal angle);
virtual QPointF topLeftOrigin() const;
int sFillTransparency;
int sDrawTransparency;
};
#endif /* UBGRAPHICSPROTRACTOR_H_ */
......@@ -151,7 +151,7 @@ void WBWebPage::handleUnsupportedContent(QNetworkReply *reply)
if (isPDF)
{
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);
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