Commit f4b1079d authored by Craig Watson's avatar Craig Watson

Revert "Revert changes pushed to wrong branch"

This reverts commit 4aa0ee61.
parent 4aa0ee61
......@@ -28,10 +28,15 @@ VERSION_RC = $$replace(VERSION_RC, "r", "240") # 0xF0
QT += webkit
QT += svg
QT += network
QT += phonon
QT += xml
QT += script
QT += xmlpatterns
QT += uitools
QT += multimedia
QT += webkitwidgets
QT += multimediawidgets
QT += printsupport
QT += core
INCLUDEPATH += src
......@@ -59,9 +64,10 @@ include(src/pdf-merger/pdfMerger.pri)
DEPENDPATH += $$THIRD_PARTY_PATH/quazip/
INCLUDEPATH += $$THIRD_PARTY_PATH/quazip/
include($$THIRD_PARTY_PATH/quazip/quazip.pri)
DEPENDPATH += $$THIRD_PARTY_PATH/trolltech/singleapplication
INCLUDEPATH += $$THIRD_PARTY_PATH/trolltech/singleapplication
include($$THIRD_PARTY_PATH/trolltech/singleapplication/qtsingleapplication.pri)
DEPENDPATH += $$THIRD_PARTY_PATH/qt/singleapplication
INCLUDEPATH += $$THIRD_PARTY_PATH/qt/singleapplication
include($$THIRD_PARTY_PATH/qt/singleapplication/qtsingleapplication.pri)
include($$THIRD_PARTY_PATH/qt/lockedfile/qtlockedfile.pri)
FORMS += resources/forms/mainWindow.ui \
resources/forms/preferences.ui \
......
****************************
* TEST OpenBoard *
* under Win32 (Windows 7) *
* *
****************************
======================|====================|
Modules | Status |
======================|====================|
Network Manager | web OK |
----------------------|--------------------|
the video media |.avi not working |
| .mp4 works in small|
| format |
----------------------|--------------------|
audio | OK |
----------------------|--------------------|
| |
----------------------|--------------------|
| |
----------------------|--------------------|
| |
----------------------|--------------------|
This diff is collapsed.
......@@ -23,7 +23,7 @@
*/
#include <QFileDialog>
#include "UBExportAdaptor.h"
......@@ -125,4 +125,4 @@ void UBExportAdaptor::showErrorsList(QList<QString> errorsList)
dialog->setMessages(errorsList);
dialog->show();
}
}
\ No newline at end of file
}
......@@ -29,6 +29,7 @@
#include <QtCore>
#include <QtSvg>
#include <QPrinter>
#include "core/UBApplication.h"
#include "core/UBSettings.h"
......
......@@ -29,6 +29,7 @@
#include <QtCore>
#include <QtSvg>
#include <QPrinter>
#include "core/UBApplication.h"
#include "core/UBSettings.h"
......
......@@ -29,6 +29,7 @@
#include <QtGui>
#include <QtXml>
#include <QDesktopWidget>
#include "core/UBSettings.h"
#include "core/UBApplication.h"
......
......@@ -30,6 +30,7 @@
#include <QtCore>
#include <QtXml>
#include <QGraphicsTextItem>
#include <QDomElement>
#include "domain/UBGraphicsSvgItem.h"
#include "domain/UBGraphicsPixmapItem.h"
......@@ -329,7 +330,7 @@ QUuid UBSvgSubsetAdaptor::sceneUuid(UBDocumentProxy* proxy, const int pageIndex)
UBGraphicsScene* UBSvgSubsetAdaptor::loadScene(UBDocumentProxy* proxy, const QByteArray& pArray)
{
UBSvgSubsetReader reader(proxy, UBTextTools::cleanHtmlCData(QString(pArray)).toAscii());
UBSvgSubsetReader reader(proxy, UBTextTools::cleanHtmlCData(QString(pArray)).toLatin1());
return reader.loadScene();
}
......@@ -1335,7 +1336,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistGroupToDom(QGraphicsItem *gro
QUuid uuid = UBGraphicsScene::getPersonalUuid(groupItem);
if (!uuid.isNull()) {
QDomElement curGroupElement = groupDomDocument->createElement(tGroup);
curGroupElement.setAttribute(aId, uuid);
curGroupElement.setAttribute(aId, uuid.toString());
UBGraphicsGroupContainerItem* group = dynamic_cast<UBGraphicsGroupContainerItem*>(groupItem);
if(group && group->Delegate()){
if(group->Delegate()->isLocked())
......@@ -1351,7 +1352,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistGroupToDom(QGraphicsItem *gro
persistGroupToDom(item, curParent, groupDomDocument);
else {
QDomElement curSubElement = groupDomDocument->createElement(tElement);
curSubElement.setAttribute(aId, tmpUuid);
curSubElement.setAttribute(aId, tmpUuid.toString());
curGroupElement.appendChild(curSubElement);
}
}
......@@ -1990,9 +1991,9 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::audioItemToLinkedAudio(UBGraphicsMed
graphicsItemToSvg(audioItem);
if (audioItem->mediaObject()->state() == Phonon::PausedState && audioItem->mediaObject()->remainingTime() > 0)
if (audioItem->mediaObject()->state() == QMediaPlayer::PausedState && (audioItem->mediaObject()->duration() - audioItem->mediaObject()->position()) > 0)
{
qint64 pos = audioItem->mediaObject()->currentTime();
qint64 pos = audioItem->mediaObject()->position();
mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "position", QString("%1").arg(pos));
}
......@@ -2019,9 +2020,9 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::videoItemToLinkedVideo(UBGraphicsMed
graphicsItemToSvg(videoItem);
if (videoItem->mediaObject()->state() == Phonon::PausedState && videoItem->mediaObject()->remainingTime() > 0)
if (videoItem->mediaObject()->state() == QMediaPlayer::PausedState && (videoItem->mediaObject()->duration() - videoItem->mediaObject()->position()) > 0)
{
qint64 pos = videoItem->mediaObject()->currentTime();
qint64 pos = videoItem->mediaObject()->position();
mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "position", QString("%1").arg(pos));
}
......@@ -2139,7 +2140,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetReader::graphicsItemFromSvg(QGraphicsItem* g
{
if (!svgX.isNull() && !svgY.isNull())
{
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
gItem->setPos(svgX.toString().toFloat(), svgY.toString().toFloat());
#endif
}
......
......@@ -30,6 +30,7 @@
#include <QtGui>
#include <QtXml>
#include <QGraphicsItem>
#include "frameworks/UBGeometryUtils.h"
......
......@@ -95,7 +95,7 @@ const QPixmap* UBThumbnailAdaptor::get(UBDocumentProxy* proxy, int pageIndex)
if (file.exists())
{
//Warning. Works only with modified Qt
#ifdef Q_WS_X11
#ifdef Q_OS_LINUX
pix->load(fileName, 0, Qt::AutoColor);
#else
pix->load(fileName, 0, Qt::AutoColor, false);
......
......@@ -24,7 +24,7 @@
#include <QPushButton>
#include "UBDocumentPublisher.h"
......
......@@ -30,6 +30,13 @@
#include <QtGui>
#include <QtNetwork>
#include <QDialog>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QDialogButtonBox>
#include <QLabel>
#include <QLineEdit>
#include <QTextEdit>
typedef struct
{
......
......@@ -30,6 +30,7 @@
#include <QtGui>
#include <QtWebKit>
#include <QWebView>
class UBLibraryAPI : public QObject
{
......
......@@ -59,7 +59,7 @@ UBW3CWidgetAPI::~UBW3CWidgetAPI()
QString UBW3CWidgetAPI::uuid()
{
if (mGraphicsW3CWidget)
return mGraphicsW3CWidget->uuid();
return mGraphicsW3CWidget->uuid().toString();
else
return "";
}
......
......@@ -23,7 +23,7 @@
*/
#include <QWebFrame>
#include "UBWidgetMessageAPI.h"
......
......@@ -514,7 +514,7 @@ void UBWidgetUniboardAPI::ProcessDropEvent(QGraphicsSceneDragDropEvent *event)
QString str = "test string";
QMimeData mimeData;
mimeData.setData(tMimeText, str.toAscii());
mimeData.setData(tMimeText, str.toLatin1());
sDownloadFileDesc desc;
desc.dest = sDownloadFileDesc::graphicsWidget;
......@@ -556,7 +556,7 @@ void UBWidgetUniboardAPI::ProcessDropEvent(QGraphicsSceneDragDropEvent *event)
}
qDebug() << destFileName;
QString mimeText = createMimeText(downloaded, contentType, destFileName);
dropMimeData->setData(tMimeText, mimeText.toAscii());
dropMimeData->setData(tMimeText, mimeText.toLatin1());
event->setMimeData(dropMimeData);
}
......@@ -588,7 +588,7 @@ void UBWidgetUniboardAPI::onDownloadFinished(bool pSuccess, sDownloadFileDesc de
}
}
QString destFileName = objDir + QUuid::createUuid() + "." + extention;
QString destFileName = objDir + QUuid::createUuid().toString() + "." + extention;
QFile destFile(destFileName);
if (!destFile.open(QIODevice::WriteOnly)) {
......@@ -606,7 +606,7 @@ void UBWidgetUniboardAPI::onDownloadFinished(bool pSuccess, sDownloadFileDesc de
QMimeData dropMimeData;
QString mimeText = createMimeText(true, contentType, destFileName);
dropMimeData.setData(tMimeText, mimeText.toAscii());
dropMimeData.setData(tMimeText, mimeText.toLatin1());
destFile.close();
......
......@@ -86,7 +86,7 @@
#include "core/memcheck.h"
#ifdef Q_WS_X11
#ifdef Q_OS_LINUX
#include <QProcess>
bool onboardIsAlreadyRunning = true;
#endif
......@@ -165,7 +165,7 @@ void UBBoardController::init()
UBBoardController::~UBBoardController()
{
#ifdef Q_WS_X11
#ifdef Q_OS_LINUX
if(!onboardIsAlreadyRunning){
QProcess newProcess;
newProcess.startDetached("killall onboard");
......@@ -828,7 +828,7 @@ void UBBoardController::showKeyboard(bool show)
if(show)
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
#ifdef Q_WS_X11
#ifdef Q_OS_LINUX
static bool isFirstTime = true;
if(isFirstTime){
QProcess isAlreadyRunningProcess;
......@@ -2411,7 +2411,7 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint
}
}
else{
#ifdef Q_WS_MACX
#ifdef Q_OS_OSX
// With Safari, in 95% of the drops, the mime datas are hidden in Apple Web Archive pasteboard type.
// This is due to the way Safari is working so we have to dig into the pasteboard in order to retrieve
// the data.
......
......@@ -31,6 +31,9 @@
#include <QtGui>
#include <QObject>
#include <QHBoxLayout>
#include <QUndoCommand>
#include "document/UBDocumentContainer.h"
#include "core/UBApplicationController.h"
......
......@@ -225,7 +225,7 @@ void UBBoardPaletteManager::setupPalettes()
if (UBPlatformUtils::hasVirtualKeyboard())
{
mKeyboardPalette = new UBKeyboardPalette(0);
#ifndef Q_WS_WIN
#ifndef Q_OS_WIN
connect(mKeyboardPalette, SIGNAL(closed()), mKeyboardPalette, SLOT(onDeactivated()));
#endif
}
......@@ -677,7 +677,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
mLeftPalette->setVisible(leftPaletteVisible);
mRightPalette->setVisible(rightPaletteVisible);
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if (rightPaletteVisible)
mRightPalette->setAdditionalVOffset(0);
#endif
......@@ -702,24 +702,24 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
if(mKeyboardPalette->m_isVisible)
{
mKeyboardPalette->hide();
#ifndef Q_WS_X11
#ifndef Q_OS_LINUX
mKeyboardPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
#else
mKeyboardPalette->setParent(0);
#endif
#ifdef Q_WS_MAC
#ifdef Q_OS_OSX
mKeyboardPalette->setWindowFlags(Qt::Dialog | Qt::Popup | Qt::FramelessWindowHint);
#endif
mKeyboardPalette->show();
}
else
// In linux keyboard in desktop mode have to allways be with null parent
#ifdef Q_WS_X11
#ifdef Q_OS_LINUX
mKeyboardPalette->setParent(0);
#else
mKeyboardPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
#endif //Q_WS_X11
#ifdef Q_WS_MAC
#endif //Q_OS_LINUX
#ifdef Q_OS_OSX
mKeyboardPalette->setWindowFlags(Qt::Dialog | Qt::Popup | Qt::FramelessWindowHint);
#endif
......@@ -727,7 +727,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
mLeftPalette->setVisible(leftPaletteVisible);
mRightPalette->setVisible(rightPaletteVisible);
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if (rightPaletteVisible && UBSettings::settings()->appToolBarPositionedAtTop->get().toBool())
mRightPalette->setAdditionalVOffset(30);
#endif
......
......@@ -55,7 +55,7 @@
#include "board/UBBoardController.h"
#include "board/UBBoardPaletteManager.h"
#ifdef Q_WS_MAC
#ifdef Q_OS_OSX
#include "core/UBApplicationController.h"
#include "desktop/UBDesktopAnnotationController.h"
#endif
......@@ -366,7 +366,7 @@ void UBBoardView::tabletEvent (QTabletEvent * event)
}
bool acceptEvent = true;
#ifdef Q_WS_MAC
#ifdef Q_OS_OSX
//Work around #1388. After selecting annotation tool in desktop mode, annotation view appears on top when
//using Mac OS X. In this case tablet event should send mouse event so as to let user interact with
//stylus palette.
......@@ -750,13 +750,13 @@ void UBBoardView::handleItemMousePress(QMouseEvent *event)
if (itemShouldReceiveMousePressEvent(movingItem)){
QGraphicsView::mousePressEvent (event);
QGraphicsItem* item = determineItemToPress(scene()->itemAt(this->mapToScene(event->posF().toPoint()), transform()));
QGraphicsItem* item = determineItemToPress(scene()->itemAt(this->mapToScene(event->localPos().toPoint()), transform()));
//use QGraphicsView::transform() to use not deprecated QGraphicsScene::itemAt() method
if (item && (item->type() == QGraphicsProxyWidget::Type) && item->parentObject() && item->parentObject()->type() != QGraphicsProxyWidget::Type)
{
//Clean up children
QList<QGraphicsItem*> children = item->children();
QList<QGraphicsItem*> children = item->childItems();
for( QList<QGraphicsItem*>::iterator it = children.begin(); it != children.end(); ++it )
if ((*it)->pos().x() < 0 || (*it)->pos().y() < 0)
......@@ -865,7 +865,7 @@ void UBBoardView::setMultiselection(bool enable)
}
// work around for handling tablet events on MAC OS with Qt 4.8.0 and above
#if defined(Q_WS_MACX)
#if defined(Q_OS_OSX)
bool UBBoardView::directTabletEvent(QEvent *event)
{
QTabletEvent *tEvent = static_cast<QTabletEvent *>(event);
......@@ -905,7 +905,7 @@ QWidget *UBBoardView::widgetForTabletEvent(QWidget *w, const QPoint &pos)
QWidget *childAtPos = NULL;
QList<QObject *> childs = w->children();
QList<QObject *> childs = w->childItems();
foreach(QObject *child, childs)
{
QWidget *childWidget = qobject_cast<QWidget *>(child);
......@@ -972,7 +972,7 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
}
mMouseDownPos = event->pos ();
movingItem = scene()->itemAt(this->mapToScene(event->posF().toPoint()));
movingItem = scene()->itemAt(this->mapToScene(event->localPos().toPoint()), QTransform());
if (event->button () == Qt::LeftButton && isInteractive())
{
......@@ -993,7 +993,7 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
case UBStylusTool::Hand :
viewport()->setCursor(QCursor (Qt::ClosedHandCursor));
mPreviousPoint = event->posF();
mPreviousPoint = event->localPos();
event->accept();
break;
......@@ -1107,7 +1107,7 @@ void UBBoardView::mouseMoveEvent (QMouseEvent *event)
if (!mMouseButtonIsPressed && !mTabletStylusIsPressed) {
break;
}
QPointF eventPosition = event->posF ();
QPointF eventPosition = event->localPos();
qreal dx = eventPosition.x () - mPreviousPoint.x ();
qreal dy = eventPosition.y () - mPreviousPoint.y ();
mController->handScroll (dx, dy);
......@@ -1230,7 +1230,7 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event)
graphicsItem->Delegate()->commitUndoStep();
bool bReleaseIsNeed = true;
if (movingItem != determineItemToPress(scene()->itemAt(this->mapToScene(event->posF().toPoint()))))
if (movingItem != determineItemToPress(scene()->itemAt(this->mapToScene(event->localPos().toPoint()), QTransform())))
{
movingItem = NULL;
bReleaseIsNeed = false;
......@@ -1299,7 +1299,7 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event)
graphicsItem->Delegate()->commitUndoStep();
bool bReleaseIsNeed = true;
if (movingItem != determineItemToPress(scene()->itemAt(this->mapToScene(event->posF().toPoint()))))
if (movingItem != determineItemToPress(scene()->itemAt(this->mapToScene(event->localPos().toPoint()), QTransform())))
{
movingItem = NULL;
bReleaseIsNeed = false;
......@@ -1475,7 +1475,7 @@ void UBBoardView::wheelEvent (QWheelEvent *wheelEvent)
QPointF scenePos = mapToScene(wheelEvent->pos());
QList<QGraphicsItem *> itemsList = scene()->items(scenePos);
QBool isSelectedAndMouseHower = itemsList.contains(selItem);
bool isSelectedAndMouseHower = itemsList.contains(selItem);
if(isSelectedAndMouseHower)
{
QGraphicsView::wheelEvent(wheelEvent);
......
......@@ -30,6 +30,9 @@
#define CONTROLVIEW_OBJ_NAME "ControlView"
#include <QtGui>
#include <QGraphicsView>
#include <QRubberBand>
#include "core/UB.h"
#include "domain/UBGraphicsDelegateFrame.h"
......@@ -60,7 +63,7 @@ public:
void setMultiselection(bool enable);
bool isMultipleSelectionEnabled() { return mMultipleSelectionIsEnabled; }
// work around for handling tablet events on MAC OS with Qt 4.8.0 and above
#if defined(Q_WS_MACX)
#if defined(Q_OS_OSX)
bool directTabletEvent(QEvent *event);
QWidget *widgetForTabletEvent(QWidget *w, const QPoint &pos);
#endif
......
......@@ -346,7 +346,6 @@ UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) :
scanFS();
featuresModel = new UBFeaturesModel(featuresList, this);
featuresModel->setSupportedDragActions(Qt::CopyAction | Qt::MoveAction);
featuresProxyModel = new UBFeaturesProxyModel(this);
featuresProxyModel->setFilterFixedString(rootPath);
......
......@@ -43,6 +43,7 @@
#include <QThread>
#include <QMutex>
#include <QWaitCondition>
#include <QListView>
class UBFeaturesModel;
class UBFeaturesItemDelegate;
......
......@@ -29,6 +29,7 @@
#define UB_H_
#include <QtGui>
#include <QGraphicsItem>
#define UB_MAX_ZOOM 9
......
......@@ -31,8 +31,9 @@
#include <QtWebKit>
#include <QtXml>
#include <QFontDatabase>
#include <QStyleFactory>
#if defined(Q_WS_MACX)
#if defined(Q_OS_OSX)
#include <Carbon/Carbon.h>
#endif
......@@ -84,13 +85,13 @@ const QString UBApplication::mimeTypeUniboardPage = QString("application/vnd.mne
const QString UBApplication::mimeTypeUniboardPageItem = QString("application/vnd.mnemis-uniboard-page-item");
const QString UBApplication::mimeTypeUniboardPageThumbnail = QString("application/vnd.mnemis-uniboard-thumbnail");
#ifdef Q_WS_MAC
#ifdef Q_OS_OSX
bool bIsMinimized = false;
#endif
QObject* UBApplication::staticMemoryCleaner = 0;
#if defined(Q_WS_MAC)
#if defined(Q_OS_OSX)
static OSStatus ub_appleEventProcessor(const AppleEvent *ae, AppleEvent *event, long handlerRefCon)
{
Q_UNUSED(event);
......@@ -153,11 +154,11 @@ UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSing
connect(settings->appToolBarDisplayText, SIGNAL(changed(QVariant)), this, SLOT(toolBarDisplayTextChanged(QVariant)));
updateProtoActionsState();
#ifndef Q_WS_MAC
#ifndef Q_OS_OSX
setWindowIcon(QIcon(":/images/OpenBoard.png"));
#endif
setStyle(new UBStyle()); // Style is owned and deleted by the application
setStyle("fusion");
QString css = UBFileSystemUtils::readTextFile(UBPlatformUtils::applicationResourcesDirectory() + "/etc/"+ qApp->applicationName()+".css");
if (css.length() > 0)
......@@ -337,7 +338,7 @@ int UBApplication::exec(const QString& pFileToImport)
connect(mainWindow->actionDesktop, SIGNAL(triggered(bool)), applicationController, SLOT(showDesktop(bool)));
connect(mainWindow->actionDesktop, SIGNAL(triggered(bool)), this, SLOT(stopScript()));
#ifndef Q_WS_MAC
#ifndef Q_OS_OSX
connect(mainWindow->actionHideApplication, SIGNAL(triggered()), mainWindow, SLOT(showMinimized()));
#else
connect(mainWindow->actionHideApplication, SIGNAL(triggered()), this, SLOT(showMinimized()));
......@@ -367,7 +368,7 @@ int UBApplication::exec(const QString& pFileToImport)
if (pFileToImport.length() > 0)
UBApplication::applicationController->importFile(pFileToImport);
#if defined(Q_WS_MAC)
#if defined(Q_OS_OSX)
static AEEventHandlerUPP ub_proc_ae_handlerUPP = AEEventHandlerUPP(ub_appleEventProcessor);
AEInstallEventHandler(kCoreEventClass, kAEReopenApplication, ub_proc_ae_handlerUPP, SRefCon(UBApplication::applicationController), true);
#endif
......@@ -389,7 +390,7 @@ void UBApplication::onScreenCountChanged(int newCount)
mainWindow->actionMultiScreen->setEnabled(displayManager.numScreens() > 1);
}
#ifdef Q_WS_MAC
#ifdef Q_OS_OSX
void UBApplication::showMinimized()
{
mainWindow->hide();
......@@ -538,7 +539,7 @@ void UBApplication::decorateActionMenu(QAction* action)
menu->addSeparator();
#ifndef Q_WS_X11 // No Podcast on Linux yet
#ifndef Q_OS_LINUX // No Podcast on Linux yet
menu->addAction(mainWindow->actionPodcast);
mainWindow->actionPodcast->setText(tr("Podcast"));
#endif
......@@ -589,7 +590,7 @@ bool UBApplication::eventFilter(QObject *obj, QEvent *event)
{
QFileOpenEvent *fileToOpenEvent = static_cast<QFileOpenEvent *>(event);
#if defined(Q_WS_MACX)
#if defined(Q_OS_OSX)
ProcessSerialNumber psn;
GetCurrentProcess(&psn);
SetFrontProcess(&psn);
......@@ -610,7 +611,7 @@ bool UBApplication::eventFilter(QObject *obj, QEvent *event)
boardController->controlView()->setMultiselection(false);
}
#ifdef Q_WS_MAC
#ifdef Q_OS_OSX
if (bIsMinimized && event->type() == QEvent::ApplicationActivate){
if (mainWindow->isHidden()) mainWindow->show();
bIsMinimized = false;
......@@ -650,39 +651,6 @@ void UBApplication::cleanup()
documentController = NULL;
}
void UBStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
bool enabled, const QString& text, QPalette::ColorRole textRole) const
{
if (text.isEmpty())
return;
QPen savedPen;
if (textRole != QPalette::NoRole)
{
savedPen = painter->pen();
painter->setPen(QPen(pal.brush(textRole), savedPen.widthF()));
}
if (!enabled)
{
QPen pen = painter->pen();
QColor half = pen.color();
half.setRed(half.red() / 2);
half.setGreen(half.green() / 2);
half.setBlue(half.blue() / 2);
painter->setPen(half);
painter->drawText(rect, alignment, text);
painter->setPen(pen);
}
painter->drawText(rect, alignment, text);
if (textRole != QPalette::NoRole)
painter->setPen(savedPen);
}
QString UBApplication::urlFromHtml(QString html)
{
QString _html;
......
......@@ -29,6 +29,9 @@
#define UBAPPLICATION_H_
#include <QtGui>
#include <QUndoStack>
#include <QToolBar>
#include <QMenu>
#include "qtsingleapplication.h"
......@@ -121,7 +124,7 @@ class UBApplication : public QtSingleApplication
private slots:
void closing();
#ifdef Q_WS_MAC
#ifdef Q_OS_OSX
void showMinimized();
#endif
void onScreenCountChanged(int newCount);
......@@ -134,7 +137,7 @@ class UBApplication : public QtSingleApplication
QString checkLanguageAvailabilityForSankore(QString& language);
protected:
#if defined(Q_WS_MACX) && !defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_OSX) && !defined(QT_MAC_USE_COCOA)
bool macEventFilter(EventHandlerCallRef caller, EventRef event);
#endif
......@@ -144,29 +147,4 @@ class UBApplication : public QtSingleApplication
};
class UBStyle : public QPlastiqueStyle
{
public:
UBStyle()
: QPlastiqueStyle()
{
// NOOP
}
virtual ~UBStyle()
{
// NOOP
}
/*
* redefined to be more cocoa like on texts
*/
virtual void drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
bool enabled, const QString& text, QPalette::ColorRole textRole) const;
};
#endif /* UBAPPLICATION_H_ */
......@@ -22,7 +22,9 @@
* along with OpenBoard. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QScriptValue>
#include <QScriptEngine>
#include <QUrl>
#include "UBApplicationController.h"
......@@ -65,7 +67,7 @@
#include "ui_mainWindow.h"
#ifdef Q_WS_MAC
#ifdef Q_OS_OSX
#include <Carbon/Carbon.h>
#endif
......@@ -86,7 +88,6 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView,
, mAutomaticCheckForUpdates(false)
, mCheckingForUpdates(false)
, mIsShowingDesktop(false)
, mHttp(0)
{
mDisplayManager = new UBDisplayManager(this);
......@@ -121,7 +122,7 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView,
QTimer::singleShot (1000, this, SLOT (checkAtLaunch()));
#ifdef Q_WS_X11
#ifdef Q_OS_LINUX
mMainWindow->setStyleSheet("QToolButton { font-size: 11px}");
#endif
......@@ -137,7 +138,6 @@ UBApplicationController::~UBApplicationController()
delete mBlackScene;
delete mMirror;
if (mHttp) delete mHttp;
delete(mOpenSankoreImporter);
mOpenSankoreImporter = NULL;
......@@ -478,45 +478,53 @@ void UBApplicationController::showDesktop(bool dontSwitchFrontProcess)
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
}
void UBApplicationController::checkUpdate(QString urlString)
{
if(mHttp)
mHttp->deleteLater();
QUrl url(urlString);
mHttp = new QHttp(url.host());
connect(mHttp, SIGNAL(requestFinished(int,bool)), this, SLOT(updateRequestFinished(int,bool)));
connect(mHttp, SIGNAL(responseHeaderReceived(QHttpResponseHeader)), this, SLOT(updateHeaderReceived(QHttpResponseHeader)));
mHttp->get(url.path());
//connect(networkAccessManager, &QNetworkAccessManager::finished,
// this, &UBApplicationController::updateRequestFinished);
connect(networkAccessManager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(updateRequestFinished(QNetworkReply*)));
networkAccessManager->get(QNetworkRequest(QUrl(urlString)));
}
void UBApplicationController::updateHeaderReceived(QHttpResponseHeader header)
void UBApplicationController::updateRequestFinished(QNetworkReply * reply)
{
if(header.statusCode() == 302 && header.hasKey("Location")){
mHttp->close();
checkUpdate(header.value("Location"));
if (reply->error()) {
qWarning() << "HTTP Error";
return;
}
// Check if we are being redirected. If so, call checkUpdate again
QVariant redirect_target = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
}
if (!redirect_target.isNull()) {
// The returned URL might be relative. resolved() creates an absolute url from it
QUrl redirect_url(reply->url().resolved(redirect_target.toUrl()));
void UBApplicationController::updateRequestFinished(int id, bool error)
{
if (error){
qWarning() << "http command id" << id << "return an error";
}
else{
QString responseString = QString(mHttp->readAll());
qDebug() << responseString;
if (!responseString.isEmpty() && responseString.contains("version") && responseString.contains("url")){
mHttp->close();
mHttp->deleteLater();
mHttp = 0;
downloadJsonFinished(responseString);
}
}
}
checkUpdate(redirect_url.toString());
return;
}
// No error and no redirect => we read the whole response
QString responseString = QString(reply->readAll());
qDebug() << responseString;
if (!responseString.isEmpty() &&
responseString.contains("version") &&
responseString.contains("url")) {
reply->close();
reply->deleteLater();
downloadJsonFinished(responseString);
}
}
void UBApplicationController::downloadJsonFinished(QString currentJson)
......
......@@ -29,8 +29,6 @@
#define UBAPPLICATIONCONTROLLER_H_
#include <QtGui>
#include <QFtp>
#include <QHttpResponseHeader>
class UBBoardView;
......@@ -146,8 +144,7 @@ class UBApplicationController : public QObject
void checkAtLaunch();
private slots:
void updateRequestFinished(int id, bool error);
void updateHeaderReceived(QHttpResponseHeader header);
void updateRequestFinished(QNetworkReply * reply);
protected:
......@@ -186,7 +183,6 @@ class UBApplicationController : public QObject
QNetworkAccessManager *networkAccessManager;
void downloadJsonFinished(QString updateString);
QHttp* mHttp;
};
#endif /* UBAPPLICATIONCONTROLLER_H_ */
......@@ -41,6 +41,8 @@
#include "core/memcheck.h"
#include "qdesktopwidget.h"
UBDisplayManager::UBDisplayManager(QObject *parent)
: QObject(parent)
, mControlScreenIndex(-1)
......@@ -55,8 +57,8 @@ UBDisplayManager::UBDisplayManager(QObject *parent)
initScreenIndexes();
connect(mDesktop, SIGNAL(resized(int)), this, SLOT(adjustScreens(int)));
connect(mDesktop, SIGNAL(workAreaResized(int)), this, SLOT(adjustScreens(int)));
connect(mDesktop, &QDesktopWidget::resized, this, &UBDisplayManager::adjustScreens);
connect(mDesktop, &QDesktopWidget::workAreaResized, this, &UBDisplayManager::adjustScreens);
}
......
......@@ -32,6 +32,7 @@
class UBBlackoutWidget;
class UBBoardView;
class QDesktopWidget;
class UBDisplayManager : public QObject
{
......
......@@ -168,7 +168,7 @@ UBDocumentProxy* UBDocumentManager::importFile(const QFile& pFile, const QString
foreach(UBGraphicsItem* page, pages)
{
UBApplication::showMessage(tr("Inserting page %1 of %2").arg(++nPage).arg(pages.size()), true);
#ifdef Q_WS_MACX
#ifdef Q_OS_OSX
//Workaround for issue 912
QApplication::processEvents();
#endif
......
......@@ -77,7 +77,7 @@ void UBAsyncLocalFileDownloader::run()
if (mDesc.originalSrcUrl.isEmpty())
mDesc.originalSrcUrl = mDesc.srcUrl;
QString uuid = QUuid::createUuid();
QString uuid = QUuid::createUuid().toString();
UBPersistenceManager::persistenceManager()->addFileToDocument(UBApplication::boardController->selectedDocument(),
mDesc.srcUrl,
destDirectory,
......@@ -399,8 +399,7 @@ void UBDownloadManager::startFileDownload(sDownloadFileDesc desc)
connect(http, SIGNAL(downloadFinished(int, bool, QUrl, QUrl, QString, QByteArray, QPointF, QSize, bool)), this, SLOT(onDownloadFinished(int, bool, QUrl, QUrl, QString, QByteArray, QPointF, QSize, bool)));
//the desc.srcUrl is encoded. So we have to decode it before.
QUrl url;
url.setEncodedUrl(desc.srcUrl.toUtf8());
QUrl url = QUrl::fromEncoded(desc.srcUrl.toUtf8());
// We send here the request and store its reply in order to be able to cancel it if needed
mDownloads[desc.id] = dynamic_cast<QObject *>(http->get(url, desc.pos, desc.size, desc.isBackground));
}
......
......@@ -50,9 +50,9 @@ UBOpenSankoreImporter::UBOpenSankoreImporter(QWidget* mainWidget, QObject *paren
void UBOpenSankoreImporter::onProceedClicked()
{
QProcess newProcess;
#ifdef Q_WS_X11
#ifdef Q_OS_LINUX
newProcess.startDetached(qApp->applicationDirPath()+"/Importer/OpenBoardImporter");
#elif defined Q_WS_MACX
#elif defined Q_OS_OSX
newProcess.startDetached(qApp->applicationDirPath()+"/../Resources/OpenBoardImporter.app/Contents/MacOS/OpenBoardImporter");
#else
// Windows does not allows to run easily an exe located in a subdirectory when the main
......
......@@ -596,7 +596,7 @@ void UBPersistenceManager::duplicateDocumentScene(UBDocumentProxy* proxy, int in
UBGraphicsPixmapItem* pixmapItem = qgraphicsitem_cast<UBGraphicsPixmapItem*>(item);
if(pixmapItem){
QString source = proxy->persistencePath() + "/" + UBPersistenceManager::imageDirectory + "/" + pixmapItem->uuid() + ".png";
QString source = proxy->persistencePath() + "/" + UBPersistenceManager::imageDirectory + "/" + pixmapItem->uuid().toString() + ".png";
QString destination = source;
QUuid newUuid = QUuid::createUuid();
QString fileName = QFileInfo(source).completeBaseName();
......@@ -608,7 +608,7 @@ void UBPersistenceManager::duplicateDocumentScene(UBDocumentProxy* proxy, int in
UBGraphicsSvgItem* svgItem = qgraphicsitem_cast<UBGraphicsSvgItem*>(item);
if(svgItem){
QString source = proxy->persistencePath() + "/" + UBPersistenceManager::imageDirectory + "/" + svgItem->uuid() + ".svg";
QString source = proxy->persistencePath() + "/" + UBPersistenceManager::imageDirectory + "/" + svgItem->uuid().toString() + ".svg";
QString destination = source;
QUuid newUuid = QUuid::createUuid();
QString fileName = QFileInfo(source).completeBaseName();
......
......@@ -44,6 +44,8 @@
#include "core/memcheck.h"
#include "qdesktopwidget.h"
qreal UBPreferencesController::sSliderRatio = 10.0;
qreal UBPreferencesController::sMinPenWidth = 0.5;
qreal UBPreferencesController::sMaxPenWidth = 50.0;
......@@ -78,7 +80,7 @@ UBPreferencesController::UBPreferencesController(QWidget *parent)
mPreferencesUI = new Ui::preferencesDialog(); // deleted in
mPreferencesUI->setupUi(mPreferencesWindow);
adjustScreens(1);
connect(mDesktop, SIGNAL(screenCountChanged(int)), this, SLOT(adjustScreens(int)));
connect(mDesktop, &QDesktopWidget::screenCountChanged, this, &UBPreferencesController::adjustScreens);
wire();
}
......
......@@ -29,6 +29,7 @@
#define UBPREFERENCESCONTROLLER_H_
#include <QtGui>
#include <QDialog>
class UBColorPicker;
class UBApplication;
......
......@@ -306,7 +306,7 @@ void UBSettings::init()
bool defaultShowPageImmediatelyOnMirroredScreen = true;
#if defined(Q_WS_X11)
#if defined(Q_OS_LINUX)
// screen duplication is very slow on X11
defaultShowPageImmediatelyOnMirroredScreen = false;
#endif
......@@ -334,22 +334,22 @@ void UBSettings::init()
int defaultRefreshRateInFramePerSecond = 8;
#if defined(Q_WS_X11)
#if defined(Q_OS_LINUX)
// screen duplication is very slow on X11
defaultRefreshRateInFramePerSecond = 2;
#endif
mirroringRefreshRateInFps = new UBSetting(this, "Mirroring", "RefreshRateInFramePerSecond", QVariant(defaultRefreshRateInFramePerSecond));
lastImportFilePath = new UBSetting(this, "Import", "LastImportFilePath", QVariant(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)));
lastImportFolderPath = new UBSetting(this, "Import", "LastImportFolderPath", QVariant(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)));
lastExportFilePath = new UBSetting(this, "Export", "LastExportFilePath", QVariant(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)));
lastExportDirPath = new UBSetting(this, "Export", "LastExportDirPath", QVariant(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)));
lastImportToLibraryPath = new UBSetting(this, "Library", "LastImportToLibraryPath", QVariant(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)));
lastImportFilePath = new UBSetting(this, "Import", "LastImportFilePath", QVariant(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)));
lastImportFolderPath = new UBSetting(this, "Import", "LastImportFolderPath", QVariant(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)));
lastExportFilePath = new UBSetting(this, "Export", "LastExportFilePath", QVariant(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)));
lastExportDirPath = new UBSetting(this, "Export", "LastExportDirPath", QVariant(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)));
lastImportToLibraryPath = new UBSetting(this, "Library", "LastImportToLibraryPath", QVariant(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)));
lastPicturePath = new UBSetting(this, "Library", "LastPicturePath", QVariant(QDesktopServices::storageLocation(QDesktopServices::PicturesLocation)));
lastWidgetPath = new UBSetting(this, "Library", "LastWidgetPath", QVariant(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)));
lastVideoPath = new UBSetting(this, "Library", "LastVideoPath", QVariant(QDesktopServices::storageLocation(QDesktopServices::MoviesLocation)));
lastPicturePath = new UBSetting(this, "Library", "LastPicturePath", QVariant(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation)));
lastWidgetPath = new UBSetting(this, "Library", "LastWidgetPath", QVariant(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)));
lastVideoPath = new UBSetting(this, "Library", "LastVideoPath", QVariant(QStandardPaths::writableLocation(QStandardPaths::MoviesLocation)));
appOnlineUserName = new UBSetting(this, "App", "OnlineUserName", "");
......@@ -790,7 +790,7 @@ QString UBSettings::userDataDirectory()
qCritical() << "Impossible to create datadirpath " << dataDirPath;
}
dataDirPath = UBFileSystemUtils::normalizeFilePath(QDesktopServices::storageLocation(QDesktopServices::DataLocation));
dataDirPath = UBFileSystemUtils::normalizeFilePath(QStandardPaths::writableLocation(QStandardPaths::DataLocation));
dataDirPath.replace(qApp->organizationName() + "/", "");
}
return dataDirPath;
......@@ -811,7 +811,7 @@ QString UBSettings::userImageDirectory()
qCritical() << "failed to create image directory " << imageDirectory;
}
imageDirectory = QDesktopServices::storageLocation(QDesktopServices::PicturesLocation) + "/" + qApp->applicationName();
imageDirectory = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) + "/" + qApp->applicationName();
checkDirectory(imageDirectory);
}
return imageDirectory;
......@@ -832,10 +832,10 @@ QString UBSettings::userVideoDirectory()
}
videoDirectory = QDesktopServices::storageLocation(QDesktopServices::MoviesLocation);
videoDirectory = QStandardPaths::writableLocation(QStandardPaths::MoviesLocation);
if(videoDirectory.isEmpty())
videoDirectory = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation) + "/" + tr("My Movies");
videoDirectory = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + "/" + tr("My Movies");
else
videoDirectory = videoDirectory + "/" + qApp->applicationName();
......@@ -858,7 +858,7 @@ QString UBSettings::userAudioDirectory()
qCritical() << "failed to create image directory " << audioDirectory;
}
audioDirectory = QDesktopServices::storageLocation(QDesktopServices::MusicLocation) + "/" + qApp->applicationName();
audioDirectory = QStandardPaths::writableLocation(QStandardPaths::MusicLocation) + "/" + qApp->applicationName();
checkDirectory(audioDirectory);
}
return audioDirectory;
......@@ -879,7 +879,7 @@ QString UBSettings::userPodcastRecordingDirectory()
qCritical() << "failed to create dir " << dirPath;
}
dirPath = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation);
dirPath = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
checkDirectory(dirPath);
}
return dirPath;
......@@ -1246,13 +1246,13 @@ QString UBSettings::replaceWildcard(QString& path)
QString result(path);
if (result.startsWith("{Documents}")) {
result = result.replace("{Documents}", QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation));
result = result.replace("{Documents}", QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
}
else if(result.startsWith("{Home}")) {
result = result.replace("{Home}", QDesktopServices::storageLocation(QDesktopServices::HomeLocation));
result = result.replace("{Home}", QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
}
else if(result.startsWith("{Desktop}")) {
result = result.replace("{Desktop}", QDesktopServices::storageLocation(QDesktopServices::DesktopLocation));
result = result.replace("{Desktop}", QStandardPaths::writableLocation(QStandardPaths::DesktopLocation));
}
if(result.contains("{UserLoginName}") && UBPlatformUtils::osUserLoginName().length() > 0) {
......
......@@ -45,21 +45,21 @@
#endif
*/
void ub_message_output(QtMsgType type, const char *msg) {
void ub_message_output(QtMsgType type, const QMessageLogContext& context, const QString& msg) {
// We must temporarily remove the handler to avoid the infinite recursion of
// ub_message_output -> qt_message_output -> ub_message_output -> qt_message_output ...
QtMsgHandler previousHandler = qInstallMsgHandler(0);
QtMessageHandler previousHandler = qInstallMessageHandler(0);
#if defined(QT_NO_DEBUG)
// Suppress qDebug output in release builds
if (type != QtDebugMsg)
{
qt_message_output(type, msg);
qt_message_output(type, context, msg);
}
#else
// Default output in debug builds
qt_message_output(type, msg);
qt_message_output(type, context, msg);
#endif
if (UBApplication::app() && UBApplication::app()->isVerbose()) {
......@@ -77,7 +77,7 @@ void ub_message_output(QtMsgType type, const char *msg) {
}
}
qInstallMsgHandler(previousHandler);
qInstallMessageHandler(previousHandler);
}
int main(int argc, char *argv[])
......@@ -93,25 +93,19 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE(OpenBoard);
qInstallMsgHandler(ub_message_output);
qInstallMessageHandler(ub_message_output);
#if defined(Q_WS_X11)
/*
* setGraphicsSystem is obsolete in Qt5, made redundant by the QPA framework.
* TODO: check if this works ok, if not, explore how to use QPA framework
#if defined(Q_OS_LINUX)
qDebug() << "Setting GraphicsSystem to raster";
QApplication::setGraphicsSystem("raster");
#endif
*/
UBApplication app("OpenBoard", argc, argv);
//BUGFIX:
//when importing a OpenBoard file that contains a non standard character
//the codecForLocale or the codecForCString is used to convert the file path
//into a const char*. This is why in french windows setup the codec name shouldn't be
//set to UTF-8. For example, setting UTF-8, will convert "Haïti" into "HaÂ-ti.
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
//QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
QStringList args = app.arguments();
QString dumpPath = UBSettings::userDataDirectory() + "/log";
......@@ -138,7 +132,7 @@ int main(int argc, char *argv[])
}
}
app.initialize(false);
//app.initialize(false); // should not be needed anymore
QObject::connect(&app, SIGNAL(messageReceived(const QString&)), &app, SLOT(handleOpenMessage(const QString&)));
......
......@@ -24,6 +24,9 @@
#include <QApplication>
#include <QDesktopWidget>
#include <QStyle>
#include "UBCustomCaptureWindow.h"
......
......@@ -29,6 +29,9 @@
#define UBCUSTOMCAPTUREWINDOW_H_
#include <QtGui>
#include <QDialog>
#include <QRubberBand>
/**
* This class is used to do the custom capture of Uninotes
**/
......
......@@ -80,7 +80,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB
mTransparentDrawingView = new UBBoardView(UBApplication::boardController, static_cast<QWidget*>(0), false, true); // deleted in UBDesktopAnnotationController::destructor
mTransparentDrawingView->setAttribute(Qt::WA_TranslucentBackground, true);
#ifdef Q_WS_MAC
#ifdef Q_OS_OSX
mTransparentDrawingView->setAttribute(Qt::WA_MacNoShadow, true);
#endif
mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Window);
......@@ -109,7 +109,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB
connect( UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(keyboardActivated(bool)),
mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool)));
#ifdef Q_WS_X11
#ifdef Q_OS_LINUX
connect(UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask()));
connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(refreshMask()));
connect(mDesktopPalette,SIGNAL(refreshMask()), this, SLOT(refreshMask()));
......@@ -162,7 +162,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB
connect(&mHoldTimerMarker, SIGNAL(timeout()), this, SLOT(markerActionReleased()));
connect(&mHoldTimerEraser, SIGNAL(timeout()), this, SLOT(eraserActionReleased()));
#ifdef Q_WS_X11
#ifdef Q_OS_LINUX
connect(mDesktopPalette, SIGNAL(moving()), this, SLOT(refreshMask()));
connect(UBApplication::boardController->paletteManager()->rightPalette(), SIGNAL(resized()), this, SLOT(refreshMask()));
connect(UBApplication::boardController->paletteManager()->addItemPalette(), SIGNAL(closed()), this, SLOT(refreshMask()));
......@@ -331,7 +331,7 @@ void UBDesktopAnnotationController::showWindow()
UBDrawingController::drawingController()->setStylusTool(mDesktopStylusTool);
#ifndef Q_WS_X11
#ifndef Q_OS_LINUX
mTransparentDrawingView->showFullScreen();
#else
// this is necessary to avoid unity to hide the panels
......@@ -341,7 +341,7 @@ void UBDesktopAnnotationController::showWindow()
mDesktopPalette->appear();
#ifdef Q_WS_X11
#ifdef Q_OS_LINUX
updateMask(true);
#endif
}
......@@ -375,18 +375,18 @@ void UBDesktopAnnotationController::updateBackground()
|| UBDrawingController::drawingController()->stylusTool() == UBStylusTool::Selector)
{
newBrush = QBrush(Qt::transparent);
#ifdef Q_WS_X11
#ifdef Q_OS_LINUX
updateMask(true);
#endif
}
else
{
#if defined(Q_WS_MAC)
#if defined(Q_OS_OSX)
newBrush = QBrush(QColor(127, 127, 127, 15));
#else
newBrush = QBrush(QColor(127, 127, 127, 1));
#endif
#ifdef Q_WS_X11
#ifdef Q_OS_LINUX
updateMask(false);
#endif
}
......@@ -430,7 +430,7 @@ void UBDesktopAnnotationController::customCapture()
UBCustomCaptureWindow customCaptureWindow(mDesktopPalette);
// need to show the window before execute it to avoid some glitch on windows.
#ifndef Q_WS_WIN // Working only without this call on win32 desktop mode
#ifndef Q_OS_WIN // Working only without this call on win32 desktop mode
customCaptureWindow.show();
#endif
......@@ -901,7 +901,7 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent)
p.drawRect(tabsPalette);
}
#ifdef Q_WS_X11
#ifdef Q_OS_LINUX
//Rquiered only for compiz wm
//TODO. Window manager detection screen
......
......@@ -171,7 +171,7 @@ void UBDesktopPalette::minimizeMe(eMinimizedLocation location)
adjustSizeAndPosition();
#ifdef Q_WS_X11
#ifdef Q_OS_LINUX
emit refreshMask();
#endif
}
......@@ -201,7 +201,7 @@ void UBDesktopPalette::maximizeMe()
// Notify that the maximization has been done
emit maximized();
#ifdef Q_WS_X11
#ifdef Q_OS_LINUX
emit refreshMask();
#endif
}
......
......@@ -55,9 +55,9 @@ class UBDesktopPalette : public UBActionPalette
void windowClick();
void screenClick();
#ifdef Q_WS_X11
//#ifdef Q_OS_LINUX //TODO: check why this produces an error on linux if uncommented
void refreshMask();
#endif
//#endif
public slots:
......
......@@ -24,6 +24,7 @@
#include <QDialog>
#include "UBWindowCapture.h"
#include "UBDesktopAnnotationController.h"
......
......@@ -355,7 +355,7 @@ void UBDocumentController::setupViews()
}
}
#ifdef Q_WS_MAC
#ifdef Q_OS_OSX
mMainWindow->actionDelete->setShortcut(QKeySequence(Qt::Key_Backspace));
#endif
......@@ -394,7 +394,7 @@ void UBDocumentController::setupViews()
mDocumentUI->thumbnailWidget->setBackgroundBrush(UBSettings::documentViewLightColor);
#ifdef Q_WS_MACX
#ifdef Q_OS_OSX
mMessageWindow = new UBMessageWindow(NULL);
#else
mMessageWindow = new UBMessageWindow(mDocumentUI->thumbnailWidget);
......@@ -1452,7 +1452,7 @@ void UBDocumentController::showMessage(const QString& message, bool showSpinning
QRect newSize = mDocumentUI->thumbnailWidget->geometry();
#ifdef Q_WS_MACX
#ifdef Q_OS_OSX
QPoint point(newSize.left() + margin, newSize.bottom() - mMessageWindow->height() - margin);
mMessageWindow->move(mDocumentUI->thumbnailWidget->mapToGlobal(point));
#else
......
......@@ -29,6 +29,7 @@
#define UBDOCUMENTCONTROLLER_H_
#include <QtGui>
#include <QTreeWidgetItem>
#include "document/UBDocumentContainer.h"
namespace Ui
......
......@@ -832,9 +832,10 @@ void UBGraphicsDelegateFrame::positionHandles()
}
resetTransform();
translate(center.x(), center.y());
rotate(-angle);
translate(-center.x(), -center.y());
setTransform(QTransform::fromTranslate(center.x(), center.y()), true);
setTransform(QTransform().rotate(-angle), true);
setTransform(QTransform::fromTranslate(-center.x(), -center.y()), true);
//TODO: combine these transforms into one
mBottomRightResizeGripSvgItem->setParentItem(this);
mBottomResizeGripSvgItem->setParentItem(this);
......
......@@ -297,7 +297,7 @@ QVariant UBGraphicsGroupContainerItem::itemChange(GraphicsItemChange change, con
{
QVariant newValue = Delegate()->itemChange(change, value);
foreach(QGraphicsItem *child, children())
foreach(QGraphicsItem *child, childItems())
{
UBGraphicsItem *item = dynamic_cast<UBGraphicsItem*>(child);
if (item)
......
......@@ -771,7 +771,7 @@ void UBGraphicsItemDelegate::updateButtons(bool showUpdated)
qreal topXTitleBar = topX + (1.6 * mFrameWidth * mAntiScaleRatio);
qreal topYTitleBar = topY + frameButtonHeight *mAntiScaleRatio;
#ifndef Q_WS_X11
#ifndef Q_OS_LINUX
topYTitleBar += 5;
#endif
......@@ -792,7 +792,7 @@ void UBGraphicsItemDelegate::updateButtons(bool showUpdated)
button->setParentItem(mFrame);
button->setPos(topXTitleBar + (k++ * (frameButtonHeight + 5)), topYTitleBar);
button->setTransform(tr);
button->scale(0.8,0.8);
button->setTransform(QTransform::fromScale(0.8, 0.8), true);
}
else if(button->getSection() == Qt::NoSection){
++l;
......@@ -1442,7 +1442,7 @@ void DelegateMediaControl::seekToMousePos(QPointF mousePos)
&& mDelegate->mediaObject() && mDelegate->mediaObject()->isSeekable())
{
qint64 tickPos = (mTotalTimeInMs/length)* (mouseX - minX);
mDelegate->mediaObject()->seek(tickPos);
mDelegate->mediaObject()->setPosition(tickPos);
//OSX is a bit lazy
updateTicker(tickPos);
......
......@@ -49,7 +49,13 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
{
update();
mMediaObject = new Phonon::MediaObject(this);
//mMediaObject = new Phonon::MediaObject(this);
mMediaObject = new QMediaPlayer(this);
//playlist = new QMediaPlaylist;
//mMediaObject->setPlaylist(playlist);
QString mediaPath = pMediaFileUrl.toString();
if ("" == mediaPath)
......@@ -59,10 +65,23 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
{
mMediaType = mediaType_Video;
mAudioOutput = new Phonon::AudioOutput(Phonon::VideoCategory, this);
mMediaObject->setTickInterval(50);
mVideoWidget = new Phonon::VideoWidget(); // owned and destructed by the scene ...
Phonon::createPath(mMediaObject, mVideoWidget);
//mAudioOutput = new Phonon::AudioOutput(Phonon::VideoCategory, this);
QAudioFormat format; // to define
format.setByteOrder(QAudioFormat::LittleEndian);
format.setSampleType(QAudioFormat::UnSignedInt);
//mAudioOutput = new QAudioOutput(format, this);
mAudioOutput = new QMediaPlayer;
//mMediaObject->setTickInterval(50);
mMediaObject->setPosition(50);
//mVideoWidget = new Phonon::VideoWidget(); // owned and destructed by the scene ...
mVideoWidget = new QVideoWidget(); // owned and destructed by the scene ...
//Phonon::createPath(mMediaObject, mVideoWidget);
mMediaObject->setVideoOutput(mVideoWidget);
if(mVideoWidget->sizeHint() == QSize(1,1)){
mVideoWidget->resize(320,240);
......@@ -72,11 +91,19 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
haveLinkedImage = true;
}
else if (mediaPath.toLower().contains("audios")){
else if (mediaPath.toLower().contains("audios"))
{
mMediaType = mediaType_Audio;
mAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
mMediaObject->setTickInterval(1000);
QAudioFormat format;
format.setByteOrder(QAudioFormat::LittleEndian);
format.setSampleType(QAudioFormat::UnSignedInt);
// mAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
//mAudioOutput = new QMediaPlayer(format, this);
mAudioOutput = new QMediaPlayer;
//mMediaObject->setTickInterval(1000);
mAudioWidget = new QWidget();
mAudioWidget->resize(320,26);
mAudioWidget->setMinimumSize(150,26);
......@@ -84,16 +111,17 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
haveLinkedImage = false;
}
Phonon::createPath(mMediaObject, mAudioOutput);
//Phonon::createPath(mMediaObject, mAudioOutput);
//mSource = Phonon::MediaSource(pMediaFileUrl);
//mMediaObject->setCurrentSource(mSource);
mMediaObject->setMedia(pMediaFileUrl);
mSource = Phonon::MediaSource(pMediaFileUrl);
mMediaObject->setCurrentSource(mSource);
// we should create delegate after media objects because delegate uses his properties at creation.
setDelegate(new UBGraphicsMediaItemDelegate(this, mMediaObject));
// delegate should be created earler because we setWidget calls resize event for graphics proxy widgt.
// resize uses delegate.
if (mediaType_Video == mMediaType)
......@@ -159,7 +187,11 @@ QVariant UBGraphicsMediaItem::itemChange(GraphicsItemChange change, const QVaria
absoluteMediaFilename = mMediaFileUrl.toLocalFile();
if (absoluteMediaFilename.length() > 0)
mMediaObject->setCurrentSource(Phonon::MediaSource(absoluteMediaFilename));
//mMediaObject->setCurrentSource(QMediaSource(absoluteMediaFilename));
mMediaObject->setMedia(QUrl::fromLocalFile(absoluteMediaFilename));
}
}
......@@ -203,7 +235,9 @@ void UBGraphicsMediaItem::hasMediaChanged(bool hasMedia)
{
if(hasMedia && mMediaObject->isSeekable())
{
mMediaObject->seek(mInitialPos);
//mMediaObject->seek(mInitialPos);
mMediaObject->setPosition(mInitialPos);
UBGraphicsMediaItemDelegate *med = dynamic_cast<UBGraphicsMediaItemDelegate *>(Delegate());
if (med)
med->updateTicker(initialPos());
......@@ -318,7 +352,8 @@ void UBGraphicsMediaItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
QPointF eventPos = mapFromScene( event->scenePos());
QPointF translation = eventPos - mouseMovePos;
translate(translation.x(), translation.y());
//translate(translation.x(), translation.y());
setPos(translation.x(), translation.y());
}
mMouseMovePos = event->scenePos();
......
......@@ -28,10 +28,20 @@
#ifndef UBGRAPHICSMEDIAITEM_H
#define UBGRAPHICSMEDIAITEM_H
#include <QtWidgets/QGraphicsView>
#include "UBGraphicsProxyWidget.h"
#include <phonon/AudioOutput>
#include <phonon/MediaObject>
#include <phonon/VideoWidget>
//#include <phonon/AudioOutput>
//#include <phonon/MediaObject>
//#include <phonon/VideoWidget>
#include <QAudioOutput>
#include <QMediaObject>
#include <QMediaPlayer>
#include <QMediaService>
#include <QtMultimediaWidgets/QVideoWidget>
#include <QtMultimedia/QVideoFrame>
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
#include "frameworks/UBFileSystemUtils.h"
......@@ -63,7 +73,9 @@ public:
virtual void mediaFileUrl(QUrl url){mMediaFileUrl=url;}
Phonon::MediaObject* mediaObject() const
//Phonon::MediaObject* mediaObject() const
QMediaPlayer* mediaObject() const
{
return mMediaObject;
}
......@@ -80,7 +92,9 @@ public:
return mMuted;
}
Phonon::VideoWidget* videoWidget() const
// Phonon::VideoWidget* videoWidget() const
QVideoWidget* videoWidget() const
{
return mVideoWidget;
}
......@@ -115,10 +129,18 @@ protected:
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
virtual void clearSource();
Phonon::MediaObject *mMediaObject;
Phonon::VideoWidget *mVideoWidget;
Phonon::AudioOutput *mAudioOutput;
Phonon::MediaSource mSource;
//Phonon::MediaObject *mMediaObject;
//Phonon::VideoWidget *mVideoWidget;
//Phonon::AudioOutput *mAudioOutput;
//Phonon::MediaSource mSource;
QMediaPlayer *mMediaObject;
QMediaPlaylist *playlist;
QVideoWidget *mVideoWidget;
// QAudioOutput *mAudioOutput;
QMediaPlayer *mAudioOutput;
QMediaService *mSource;
QWidget *mAudioWidget;
private:
......
......@@ -43,7 +43,7 @@
#include "core/memcheck.h"
UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pDelegated, Phonon::MediaObject* pMedia, QObject * parent)
UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pDelegated, QMediaPlayer* pMedia, QObject * parent)
: UBGraphicsItemDelegate(pDelegated, parent, GF_COMMON
| GF_RESPECT_RATIO
| GF_TOOLBAR_USED
......@@ -56,11 +56,22 @@ UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pD
QPalette palette;
palette.setBrush ( QPalette::Light, Qt::darkGray );
mMedia->setTickInterval(50);
connect(mMedia, SIGNAL(stateChanged (Phonon::State, Phonon::State)), this, SLOT(mediaStateChanged (Phonon::State, Phonon::State)));
connect(mMedia, SIGNAL(finished()), this, SLOT(updatePlayPauseState()));
connect(mMedia, SIGNAL(tick(qint64)), this, SLOT(updateTicker(qint64)));
connect(mMedia, SIGNAL(totalTimeChanged(qint64)), this, SLOT(totalTimeChanged(qint64)));
mMedia->setNotifyInterval(50);
connect(mMedia, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),
this, SLOT(mediaStatusChanged(QMediaPlayer::MediaStatus)));
connect(mMedia, SIGNAL(stateChanged(QMediaPlayer::State)),
this, SLOT(mediaStateChanged(QMediaPlayer::State)));
connect(mMedia, static_cast<void(QMediaPlayer::*)(QMediaPlayer::Error)>(&QMediaPlayer::error),
this, &UBGraphicsMediaItemDelegate::mediaError);
connect(mMedia, SIGNAL(positionChanged(qint64)),
this, SLOT(updateTicker(qint64)));
connect(mMedia, SIGNAL(durationChanged(qint64)),
this, SLOT(totalTimeChanged(qint64)));
if (delegated()->hasLinkedImage())
{
......@@ -95,10 +106,12 @@ void UBGraphicsMediaItemDelegate::buildButtons()
{
if(!mPlayPauseButton){
mPlayPauseButton = new DelegateButton(":/images/play.svg", mDelegated, mToolBarItem, Qt::TitleBarArea);
connect(mPlayPauseButton, SIGNAL(clicked(bool)), this, SLOT(togglePlayPause()));
connect(mPlayPauseButton, SIGNAL(clicked(bool)),
this, SLOT(togglePlayPause()));
mStopButton = new DelegateButton(":/images/stop.svg", mDelegated, mToolBarItem, Qt::TitleBarArea);
connect(mStopButton, SIGNAL(clicked(bool)), mMedia, SLOT(stop()));
connect(mStopButton, SIGNAL(clicked(bool)),
mMedia, SLOT(stop()));
mMediaControl = new DelegateMediaControl(delegated(), mToolBarItem);
mMediaControl->setFlag(QGraphicsItem::ItemIsSelectable, true);
......@@ -109,8 +122,10 @@ void UBGraphicsMediaItemDelegate::buildButtons()
else
mMuteButton = new DelegateButton(":/images/soundOn.svg", mDelegated, mToolBarItem, Qt::TitleBarArea);
connect(mMuteButton, SIGNAL(clicked(bool)), delegated(), SLOT(toggleMute()));
connect(mMuteButton, SIGNAL(clicked(bool)), this, SLOT(toggleMute())); // for changing button image
connect(mMuteButton, SIGNAL(clicked(bool)),
delegated(), SLOT(toggleMute()));
connect(mMuteButton, SIGNAL(clicked(bool)),
this, SLOT(toggleMute())); // for changing button image
mToolBarButtons << mPlayPauseButton << mStopButton << mMuteButton;
......@@ -120,10 +135,17 @@ void UBGraphicsMediaItemDelegate::buildButtons()
if (mToolBarShowTimer)
{
connect(mPlayPauseButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start()));
connect(mStopButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start()));
connect(mMediaControl, SIGNAL(used()), mToolBarShowTimer, SLOT(start()));
connect(mMuteButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start()));
connect(mPlayPauseButton, SIGNAL(clicked(bool)),
mToolBarShowTimer, SLOT(start()));
connect(mStopButton, SIGNAL(clicked(bool)),
mToolBarShowTimer, SLOT(start()));
connect(mMediaControl, SIGNAL(used()),
mToolBarShowTimer, SLOT(start()));
connect(mMuteButton, SIGNAL(clicked(bool)),
mToolBarShowTimer, SLOT(start()));
}
......@@ -195,55 +217,82 @@ UBGraphicsMediaItem* UBGraphicsMediaItemDelegate::delegated()
return dynamic_cast<UBGraphicsMediaItem*>(mDelegated);
}
void UBGraphicsMediaItemDelegate::togglePlayPause()
{
if (delegated() && delegated()->mediaObject()) {
Phonon::MediaObject* media = delegated()->mediaObject();
if (media->state() == Phonon::StoppedState) {
QMediaPlayer * media = delegated()->mediaObject();
if (media->state() == QMediaPlayer::StoppedState)
media->play();
} else if (media->state() == Phonon::PlayingState) {
if (media->remainingTime() <= 0) {
else if (media->state() == QMediaPlayer::PlayingState) {
if ((media->duration() - media->position()) <= 0) {
media->stop();
media->play();
} else {
}
else {
media->pause();
if(delegated()->scene())
delegated()->scene()->setModified(true);
}
} else if (media->state() == Phonon::PausedState) {
if (media->remainingTime() <= 0) {
}
else if (media->state() == QMediaPlayer::PausedState) {
if ((media->duration() - media->position()) <= 0)
media->stop();
}
media->play();
} else if ( media->state() == Phonon::LoadingState ) {
delegated()->mediaObject()->setCurrentSource(delegated()->mediaFileUrl());
}
else if ( media->mediaStatus() == QMediaPlayer::LoadingMedia) {
delegated()->mediaObject()->setMedia(delegated()->mediaFileUrl());
media->play();
} else if (media->state() == Phonon::ErrorState){
qDebug() << "Error appeared." << media->errorString();
}
else if (media->error())
qDebug() << "Error appeared." << media->errorString();
}
}
void UBGraphicsMediaItemDelegate::mediaStateChanged ( Phonon::State newstate, Phonon::State oldstate )
void UBGraphicsMediaItemDelegate::mediaStatusChanged(QMediaPlayer::MediaStatus status)
{
Q_UNUSED(newstate);
Q_UNUSED(oldstate);
// Possible statuses are: UnknownMediaStatus, NoMedia, LoadingMedia, LoadedMedia,
// StalledMedia, BufferingMedia, BufferedMedia, EndOfMedia, InvalidMedia
if (oldstate == Phonon::LoadingState)
{
mMediaControl->totalTimeChanged(delegated()->mediaObject()->totalTime());
}
if (status == QMediaPlayer::LoadedMedia)
mMediaControl->totalTimeChanged(delegated()->mediaObject()->duration());
// in most cases, the only necessary action is to update the play/pause state
updatePlayPauseState();
}
void UBGraphicsMediaItemDelegate::mediaStateChanged(QMediaPlayer::State state)
{
// Possible states are StoppedState, PlayingState and PausedState
// updatePlayPauseState handles this functionality
updatePlayPauseState();
}
void UBGraphicsMediaItemDelegate::mediaError(QMediaPlayer::Error error)
{
// Possible errors are NoError, ResourceError, FormatError, NetworkError, AccessDeniedError,
// ServiceMissingError
Q_UNUSED(error);
qDebug() << "Error appeared." << mMedia->errorString();
}
void UBGraphicsMediaItemDelegate::updatePlayPauseState()
{
Phonon::MediaObject* media = delegated()->mediaObject();
QMediaPlayer * media = delegated()->mediaObject();
if (media->state() == Phonon::PlayingState)
if (media->state() == QMediaPlayer::PlayingState)
mPlayPauseButton->setFileName(":/images/pause.svg");
else
mPlayPauseButton->setFileName(":/images/play.svg");
......@@ -252,8 +301,8 @@ void UBGraphicsMediaItemDelegate::updatePlayPauseState()
void UBGraphicsMediaItemDelegate::updateTicker(qint64 time)
{
Phonon::MediaObject* media = delegated()->mediaObject();
mMediaControl->totalTimeChanged(media->totalTime());
QMediaPlayer* media = delegated()->mediaObject();
mMediaControl->totalTimeChanged(media->duration());
mMediaControl->updateTicker(time);
}
......
......@@ -29,8 +29,8 @@
#define UBGRAPHICSMEDIAITEMDELEGATE_H_
#include <QtGui>
#include <phonon/MediaObject>
#include <QTimer>
#include <QtMultimedia>
#include "core/UB.h"
#include "UBGraphicsItemDelegate.h"
......@@ -43,12 +43,12 @@ class UBGraphicsMediaItemDelegate : public UBGraphicsItemDelegate
Q_OBJECT
public:
UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pDelegated, Phonon::MediaObject* pMedia, QObject * parent = 0);
UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pDelegated, QMediaPlayer* pMedia, QObject * parent = 0);
virtual ~UBGraphicsMediaItemDelegate();
virtual void positionHandles();
bool mousePressEvent(QGraphicsSceneMouseEvent *event);
bool mousePressEvent(QGraphicsSceneMouseEvent* event);
public slots:
......@@ -61,14 +61,18 @@ class UBGraphicsMediaItemDelegate : public UBGraphicsItemDelegate
void togglePlayPause();
void mediaStateChanged ( Phonon::State newstate, Phonon::State oldstate );
void updatePlayPauseState();
void totalTimeChanged(qint64 newTotalTime);
void hideToolBar();
void mediaStatusChanged(QMediaPlayer::MediaStatus status);
void mediaStateChanged(QMediaPlayer::State state);
void mediaError(QMediaPlayer::Error error);
protected:
virtual void buildButtons();
......@@ -77,11 +81,11 @@ class UBGraphicsMediaItemDelegate : public UBGraphicsItemDelegate
DelegateButton* mPlayPauseButton;
DelegateButton* mStopButton;
DelegateButton* mMuteButton;
DelegateMediaControl *mMediaControl;
DelegateMediaControl* mMediaControl;
Phonon::MediaObject* mMedia;
QMediaPlayer* mMedia; // mMedia belongs to the associated UBGraphicsMediaItem (mDelegated)
QTimer *mToolBarShowTimer;
QTimer* mToolBarShowTimer;
int m_iToolBarShowingInterval;
};
......
......@@ -1264,7 +1264,7 @@ UBGraphicsPixmapItem* UBGraphicsScene::addPixmap(const QPixmap& pPixmap, QGraphi
UBApplication::undoStack->push(uc);
}
pixmapItem->scale(pScaleFactor, pScaleFactor);
pixmapItem->setTransform(QTransform::fromScale(pScaleFactor, pScaleFactor), true);
if (pUseAnimation)
{
......@@ -1340,7 +1340,7 @@ UBGraphicsMediaItem* UBGraphicsScene::addMedia(const QUrl& pMediaFileUrl, bool s
if (!shouldPlayAsap)
{
mediaItem->mediaObject()->pause();
mediaItem->mediaObject()->seek(0);
mediaItem->mediaObject()->setPosition(0);
}
setDocumentUpdated();
......@@ -1403,7 +1403,7 @@ void UBGraphicsScene::addGraphicsWidget(UBGraphicsWidgetItem* graphicsWidget, co
qreal ssf = 1 / UBApplication::boardController->systemScaleFactor();
graphicsWidget->scale(ssf, ssf);
graphicsWidget->setTransform(QTransform::fromScale(ssf, ssf), true);
graphicsWidget->setPos(QPointF(pPos.x() - graphicsWidget->boundingRect().width() / 2,
pPos.y() - graphicsWidget->boundingRect().height() / 2));
......@@ -1530,7 +1530,7 @@ UBGraphicsSvgItem* UBGraphicsScene::addSvg(const QUrl& pSvgFileUrl, const QPoint
svgItem->setFlag(QGraphicsItem::ItemIsSelectable, true);
qreal sscale = 1 / UBApplication::boardController->systemScaleFactor();
svgItem->scale(sscale, sscale);
svgItem->setTransform(QTransform::fromScale(sscale, sscale), true);
QPointF half(svgItem->boundingRect().width() / 2, svgItem->boundingRect().height() / 2);
svgItem->setPos(pPos - half);
......@@ -1860,7 +1860,7 @@ QGraphicsItem* UBGraphicsScene::scaleToFitDocumentSize(QGraphicsItem* item, bool
{
qreal ratio = qMin(maxWidth / size.width(), maxHeight / size.height());
item->scale(ratio, ratio);
item->setTransform(QTransform::fromScale(ratio, ratio), true);
if(center)
{
......
......@@ -27,6 +27,7 @@
#include <QtNetwork>
#include <QtXml>
#include <QWebFrame>
#include "UBGraphicsWidgetItem.h"
#include "UBGraphicsScene.h"
......@@ -121,7 +122,8 @@ void UBGraphicsWidgetItem::initialize()
page()->setPalette(palette);
page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
connect(page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(javaScriptWindowObjectCleared()));
connect(page()->mainFrame(), &QWebFrame::javaScriptWindowObjectCleared,
this, &UBGraphicsWidgetItem::javaScriptWindowObjectCleared);
connect(page(), SIGNAL(geometryChangeRequested(const QRect&)), this, SLOT(geometryChangeRequested(const QRect&)));
connect(this, SIGNAL(loadFinished(bool)), this, SLOT(mainFrameLoadFinished (bool)));
connect(page()->mainFrame(), SIGNAL(initialLayoutCompleted()), this, SLOT(initialLayoutCompleted()));
......
......@@ -31,6 +31,7 @@
#include <QtGui>
#include <QtWebKit>
#include <QDomElement>
#include <QGraphicsWebView>
#include "core/UB.h"
......
......@@ -157,7 +157,7 @@ void UBSelectionFrame::mousePressEvent(QGraphicsSceneMouseEvent *event)
mLastTranslateOffset = QPointF();
mRotationAngle = 0;
if (scene()->itemAt(event->scenePos()) == mRotateButton) {
if (scene()->itemAt(event->scenePos(), transform()) == mRotateButton) {
mOperationMode = om_rotating;
} else {
mOperationMode = om_moving;
......
......@@ -29,6 +29,7 @@
#define UBABSTRACTUNDOCOMMAND_H_
#include <QtGui>
#include <QUndoCommand>
#include <core/UB.h>
class UBUndoCommand : public QUndoCommand
......
......@@ -53,7 +53,7 @@ QByteArray UBBase32::decode(const QString& base32String)
for (i = 0, index = 0, offset = 0; i < base32String.length(); i++)
{
QChar ch = base32String.at(i);
char lookup = ch.toAscii() - '0';
char lookup = ch.toLatin1() - '0';
/* Skip chars outside the lookup table */
if (lookup < 0 || lookup >= 80)
......
......@@ -29,6 +29,8 @@
#define UBCOREGRAPHICSSCENE_H_
#include <QtGui>
#include <QGraphicsScene>
#include <QGraphicsItem>
class UBCoreGraphicsScene : public QGraphicsScene
{
......
......@@ -92,13 +92,13 @@ QString UBCryptoUtils::symetricEncrypt(const QString& clear)
free(ciphertext);
return QString::fromAscii(cipheredData.toBase64());
return QString::fromLatin1(cipheredData.toBase64());
}
QString UBCryptoUtils::symetricDecrypt(const QString& encrypted)
{
QByteArray encryptedData = QByteArray::fromBase64(encrypted.toAscii());
QByteArray encryptedData = QByteArray::fromBase64(encrypted.toLatin1());
int encryptedLength = encryptedData.length();
int paddingLength = 0;
......@@ -132,10 +132,10 @@ void UBCryptoUtils::aesInit()
{
int i, nrounds = 5;
unsigned char key[32], iv[32];
unsigned char *key_data = (unsigned char *)sAESKey.toAscii().data();
unsigned char *key_data = (unsigned char *)sAESKey.toLatin1().data();
int key_data_len = sAESKey.length();
i = EVP_BytesToKey(EVP_aes_256_cbc(), EVP_sha1(), (unsigned char *)sAESSalt.toAscii().data(), key_data,
i = EVP_BytesToKey(EVP_aes_256_cbc(), EVP_sha1(), (unsigned char *)sAESSalt.toLatin1().data(), key_data,
key_data_len, nrounds, key, iv);
if (i != 32)
......
......@@ -57,7 +57,7 @@ UBFileSystemUtils::~UBFileSystemUtils()
QString UBFileSystemUtils::removeLocalFilePrefix(QString input)
{
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if(input.startsWith("file:///"))
return input.mid(8);
else
......@@ -130,12 +130,12 @@ bool UBFileSystemUtils::deleteFile(const QString &path)
QString UBFileSystemUtils::defaultTempDirPath()
{
return QDesktopServices::storageLocation(QDesktopServices::TempLocation) + "/" + defaultTempDirName();
return QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/" + defaultTempDirName();
}
QString UBFileSystemUtils::createTempDir(const QString& templateString, bool autoDeleteOnExit)
{
QString appTempDir = QDesktopServices::storageLocation(QDesktopServices::TempLocation)
QString appTempDir = QStandardPaths::writableLocation(QStandardPaths::TempLocation)
+ "/" + templateString;
int index = 0;
......@@ -200,7 +200,7 @@ void UBFileSystemUtils::deleteAllTempDirCreatedDuringSession()
void UBFileSystemUtils::cleanupGhostTempFolders(const QString& templateString)
{
QDir dir(QDesktopServices::storageLocation(QDesktopServices::TempLocation));
QDir dir(QStandardPaths::writableLocation(QStandardPaths::TempLocation));
foreach (QFileInfo dirContent, dir.entryInfoList(QDir::Dirs
| QDir::NoDotAndDotDot | QDir::Hidden , QDir::Name))
{
......
......@@ -204,7 +204,7 @@ public:
static QString urlFromClipboard();
static QStringList availableTranslations();
#ifdef Q_WS_MAC
#ifdef Q_OS_OSX
static void SetMacLocaleByIdentifier(const QString& id);
#endif
};
......
......@@ -28,6 +28,7 @@
#include "UBPlatformUtils.h"
#include <QtGui>
#include <QApplication>
#include <unistd.h>
#include <X11/Xlib.h>
......@@ -98,7 +99,7 @@ void UBPlatformUtils::bringPreviousProcessToFront()
QString UBPlatformUtils::osUserLoginName()
{
char *user = getenv("USER");
return QString::fromAscii(user);
return QString::fromLatin1(user);
}
QString UBPlatformUtils::computerName()
......@@ -108,7 +109,7 @@ QString UBPlatformUtils::computerName()
// if the name is longer than 255 the name is truncated but os doesn't ensure
// that the last character returned is a null character
if(!gethostname(hostname,255))
return QString::fromAscii(hostname);
return QString::fromLatin1(hostname);
else
return "NOT FOUND";
}
......
......@@ -45,7 +45,7 @@
setStyleSheet(style);\
}
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
#define WARNINGS_DISABLE __pragma(warning(push, 0));
#define WARNINGS_ENABLE __pragma(warning(pop));
......@@ -58,7 +58,7 @@
#define THIRD_PARTY_WARNINGS_DISABLE __pragma(warning(push));
#endif //#ifdef NO_THIRD_PARTY_WARNINGS
#else //#ifdef Q_WS_WIN
#else //#ifdef Q_OS_WIN
#define WARNINGS_DISABLE _Pragma("GCC diagnostic push"); \
_Pragma("GCC diagnostic ignored \"-Wunused-parameter\""); \
......@@ -76,7 +76,7 @@ _Pragma("GCC diagnostic ignored \"-Wsign-compare\"");
#endif //#ifdef NO_THIRD_PARTY_WARNINGS
#endif //#ifdef Q_WS_WIN
#endif //#ifdef Q_OS_WIN
// anyway on any OS
#define THIRD_PARTY_WARNINGS_ENABLE WARNINGS_ENABLE
......
......@@ -23,7 +23,8 @@
*/
#include <QLayout>
#include <QAction>
#include "UBActionPalette.h"
......@@ -103,8 +104,10 @@ UBActionPaletteButton* UBActionPalette::createPaletteButton(QAction* action, QWi
mMapActionToButton[action] = button;
connect(button, SIGNAL(clicked()), this, SLOT(buttonClicked()));
connect(action, SIGNAL(changed()), this, SLOT(actionChanged()));
connect(button, &UBActionPaletteButton::clicked,
this, &UBActionPalette::buttonClicked);
connect(action, &QAction::changed,
this, &UBActionPalette::actionChanged);
return button;
}
......
......@@ -31,6 +31,8 @@
#include <QtGui>
#include <QPoint>
#include <QButtonGroup>
#include <QToolButton>
#include "UBFloatingPalette.h"
class UBActionPaletteButton;
......
......@@ -29,6 +29,7 @@
#define UBCIRCLEFRAME_H_
#include <QtGui>
#include <QFrame>
class UBCircleFrame : public QFrame
{
......
......@@ -29,6 +29,7 @@
#define UBCOLORPICKER_H_
#include <QtGui>
#include <QFrame>
class UBColorPicker : public QFrame
{
......
......@@ -654,9 +654,9 @@ void UBTabDockPalette::paintEvent(QPaintEvent *)
}
painter.save();
QPixmap transparencyPix(":/images/tab_mask.png");
//QPixmap transparencyPix(":/images/tab_mask.png");
if (dock->mCurrentTab != i) {
iconPixmap.setAlphaChannel(transparencyPix);
//iconPixmap.setAlphaChannel(transparencyPix); // deprecated; removed for now, to be re-implemented
QColor color(0x7F, 0x7F, 0x7F, 0x3F);
painter.setBrush(QBrush(color));
}
......
......@@ -190,7 +190,8 @@ void UBDocumentThumbnailWidget::dragMoveEvent(QDragMoveEvent *event)
if (!mDropCaretRectItem && selectedItems().count() < mGraphicItems.count())
{
mDropCaretRectItem = new QGraphicsRectItem(0, scene());
mDropCaretRectItem = new QGraphicsRectItem(0);
scene()->addItem(mDropCaretRectItem);
mDropCaretRectItem->setPen(QPen(Qt::darkGray));
mDropCaretRectItem->setBrush(QBrush(Qt::lightGray));
}
......
......@@ -29,6 +29,7 @@
#define UBDOCUMENTTREEWIDGET_H_
#include <QtGui>
#include <QTreeWidget>
class UBDocumentProxy;
class UBDocumentProxyTreeItem;
......
......@@ -61,8 +61,8 @@ UBDownloadWidget::UBDownloadWidget(QWidget *parent, const char *name):QWidget(pa
mpTree->setRootIsDecorated(false);
mpTree->setColumnCount(2);
mpTree->header()->setStretchLastSection(false);
mpTree->header()->setResizeMode(eItemColumn_Desc, QHeaderView::Stretch);
mpTree->header()->setResizeMode(eItemColumn_Close, QHeaderView::Custom);
mpTree->header()->setSectionResizeMode(eItemColumn_Desc, QHeaderView::Stretch);
mpTree->header()->setSectionResizeMode(eItemColumn_Close, QHeaderView::Custom);
mpTree->resizeColumnToContents(eItemColumn_Close);
mpTree->header()->close();
mpLayout->addWidget(mpTree, 1);
......
......@@ -23,7 +23,8 @@
*/
#include <QButtonGroup>
#include <QAction>
#include "UBFeaturesActionBar.h"
#include "core/memcheck.h"
......
......@@ -31,6 +31,9 @@
#include <QWidget>
#include <QToolButton>
#include <QDropEvent>
#include <QLineEdit>
#include <QLayout>
#include "board/UBFeaturesController.h"
#define BUTTON_SIZE 24
......
......@@ -27,6 +27,8 @@
#include <QDomDocument>
#include <QWebView>
#include <QWebFrame>
#include <QWidget>
#include "UBFeaturesWidget.h"
#include "gui/UBThumbnailWidget.h"
......@@ -267,8 +269,8 @@ void UBFeaturesWidget::onDisplayMetadata( QMap<QString,QString> metadata )
{
QString previewImageUrl = ":images/libpalette/notFound.png";
QString widgetsUrl = QUrl::fromEncoded(metadata["Url"].toAscii()).toString()/*metadata.value("Url", QString())*/;
QString widgetsThumbsUrl = QUrl::fromEncoded(metadata["thumbnailUrl"].toAscii()).toString();
QString widgetsUrl = QUrl::fromEncoded(metadata["Url"].toLatin1()).toString()/*metadata.value("Url", QString())*/;
QString widgetsThumbsUrl = QUrl::fromEncoded(metadata["thumbnailUrl"].toLatin1()).toString();
QString strType = UBFileSystemUtils::mimeTypeFromFileName(widgetsUrl);
UBMimeType::Enum thumbType = UBFileSystemUtils::mimeTypeFromString(strType);
......@@ -440,7 +442,7 @@ void UBFeaturesListView::dragMoveEvent( QDragMoveEvent *event )
void UBFeaturesListView::dropEvent( QDropEvent *event )
{
QWidget *eventSource = event->source();
QObject *eventSource = event->source();
if (eventSource && eventSource->objectName() == UBFeaturesWidget::objNameFeatureList) {
event->setDropAction( Qt::MoveAction );
}
......@@ -1172,7 +1174,7 @@ QMimeData* UBFeaturesModel::mimeData(const QModelIndexList &indexes) const
if (!typeData.isNull()) {
typeData += UBFeaturesController::featureTypeSplitter();
}
typeData += QString::number(element.getType()).toAscii();
typeData += QString::number(element.getType()).toLatin1();
}
}
......
......@@ -41,6 +41,10 @@
#include <QGraphicsLinearLayout>
#include <QStackedWidget>
#include <QDropEvent>
#include <QPushButton>
#include <QProgressBar>
#include <QLabel>
#include <QTreeWidget>
#include "UBDockPaletteWidget.h"
#include "core/UBSettings.h"
......@@ -393,6 +397,8 @@ public:
void moveData(const UBFeature &source, const UBFeature &destination, Qt::DropAction action, bool deleteManualy = false);
Qt::DropActions supportedDropActions() const { return Qt::MoveAction | Qt::CopyAction; }
Qt::DropActions supportedDragActions() const { return Qt::MoveAction | Qt::CopyAction; }
// void setFeaturesList(QList <UBFeature> *flist ) { featuresList = flist; }
public slots:
......
......@@ -54,11 +54,11 @@ UBFloatingPalette::UBFloatingPalette(Qt::Corner position, QWidget *parent)
{
// standalone window
// !!!! Should be included into Windows after QT recompilation
#ifndef Q_WS_WIN
#ifndef Q_OS_WIN
setAttribute(Qt::WA_TranslucentBackground);
setAttribute(Qt::WA_MacAlwaysShowToolWindow);
#endif
#ifdef Q_WS_MAC
#ifdef Q_OS_OSX
setAttribute(Qt::WA_MacAlwaysShowToolWindow);
setAttribute(Qt::WA_MacNonActivatingToolWindow);
setAttribute(Qt::WA_MacNoShadow);
......
......@@ -79,11 +79,11 @@ UBMagnifier::UBMagnifier(QWidget *parent, bool isInteractive)
{
// standalone window
// !!!! Should be included into Windows after QT recompilation
#ifndef Q_WS_WIN
#ifndef Q_OS_WIN
// setAttribute(Qt::WA_TranslucentBackground);
setAttribute(Qt::WA_MacAlwaysShowToolWindow);
#endif
#ifdef Q_WS_MAC
#ifdef Q_OS_OSX
setAttribute(Qt::WA_MacAlwaysShowToolWindow);
setAttribute(Qt::WA_MacNonActivatingToolWindow);
setAttribute(Qt::WA_MacNoShadow);
......
......@@ -29,6 +29,7 @@
#define UBMAGNIFIER_H
#include <QtGui>
#include <QWidget>
class UBMagnifierParams
{
......
......@@ -26,6 +26,8 @@
#include <QtGui>
#include <QToolTip>
#include <QStackedLayout>
#include "UBMainWindow.h"
#include "core/UBApplication.h"
......@@ -34,7 +36,7 @@
#include "core/UBDisplayManager.h"
// work around for handling tablet events on MAC OS with Qt 4.8.0 and above
#if defined(Q_WS_MACX)
#if defined(Q_OS_OSX)
#include "board/UBBoardView.h"
#endif
......@@ -62,10 +64,10 @@ UBMainWindow::UBMainWindow(QWidget *parent, Qt::WindowFlags flags)
mStackedLayout = new QStackedLayout(centralWidget);
setCentralWidget(centralWidget);
#ifdef Q_WS_MAC
#ifdef Q_OS_OSX
actionPreferences->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Comma));
actionQuit->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
#elif defined(Q_WS_WIN)
#elif defined(Q_OS_WIN)
actionPreferences->setShortcut(QKeySequence(Qt::ALT + Qt::Key_Return));
// this code, because it unusable, system key combination can`t be triggered, even we add it manually
actionQuit->setShortcut(QKeySequence(Qt::ALT + Qt::Key_F4));
......@@ -148,7 +150,7 @@ void UBMainWindow::closeEvent(QCloseEvent *event)
}
// work around for handling tablet events on MAC OS with Qt 4.8.0 and above
#if defined(Q_WS_MACX)
#if defined(Q_OS_OSX)
bool UBMainWindow::event(QEvent *event)
{
bool bRes = QMainWindow::event(event);
......@@ -199,7 +201,7 @@ bool UBMainWindow::yesNoQuestion(QString windowTitle, QString text)
messageBox.addButton(tr("No"),QMessageBox::NoRole);
messageBox.setIcon(QMessageBox::Question);
#ifdef Q_WS_X11
#ifdef Q_OS_LINUX
// to avoid to be handled by x11. This allows us to keep to the back all the windows manager stuff like palette, toolbar ...
messageBox.setWindowFlags(Qt::Dialog | Qt::X11BypassWindowManagerHint);
#else
......
......@@ -30,7 +30,7 @@
#include <QMainWindow>
#include <QWidget>
#include <QWebView>
#include <QtWebKitWidgets/QWebView>
#include <QMessageBox>
#include "UBDownloadWidget.h"
......@@ -88,7 +88,7 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow
private:
// work around for handling tablet events on MAC OS with Qt 4.8.0 and above
#if defined(Q_WS_MACX)
#if defined(Q_OS_OSX)
bool event(QEvent *event);
#endif
UBDownloadWidget* mpDownloadWidget;
......
......@@ -44,7 +44,7 @@ UBMessageWindow::UBMessageWindow(QWidget *parent)
mLayout->setContentsMargins(radius() + 15, 4, radius() + 15, 4);
#ifdef Q_WS_MAC
#ifdef Q_OS_OSX
mLayout->setContentsMargins(radius() + 15, 8, radius() + 15, 10);
#endif
......
......@@ -29,6 +29,8 @@
#define UBMESSAGEWINDOW_H_
#include <QtGui>
#include <QHBoxLayout>
#include <QLabel>
#include "UBFloatingPalette.h"
......
......@@ -23,7 +23,9 @@
*/
#include <QLayout>
#include <QTextEdit>
#include <QPushButton>
#include "UBMessagesDialog.h"
......@@ -65,4 +67,4 @@ void UBMessagesDialog::setMessages(const QList<QString> messages)
void UBMessagesDialog::dispose()
{
delete this;
}
\ No newline at end of file
}
......@@ -29,6 +29,7 @@
#define UB_MESSAGES_DIALOG_H_
#include <QtGui>
#include <QWidget>
class UBMessagesDialog : public QWidget
{
......@@ -46,4 +47,4 @@ private:
int mMessagesFontSize;
};
#endif /* UB_MESSAGES_DIALOG_H_ */
\ No newline at end of file
#endif /* UB_MESSAGES_DIALOG_H_ */
......@@ -23,7 +23,7 @@
*/
#include <QApplication>
#include "UBMousePressFilter.h"
......
......@@ -28,10 +28,10 @@
#include "UBRubberBand.h"
#include <QtGui>
#include <QtGui/QPlastiqueStyle>
#include <QStyleFactory>
#include <QStyle>
#ifdef Q_WS_MAC
#ifdef Q_OS_OSX
#include <QtGui/QMacStyle>
#endif
......@@ -50,11 +50,11 @@ UBRubberBand::UBRubberBand(Shape s, QWidget * p)
{
customStyle = NULL;
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
customStyle = new QWindowsXPStyle();
#elif defined(Q_WS_MAC)
#elif defined(Q_OS_OSX)
customStyle = new QMacStyle();
#elif defined(Q_WS_X11)
#elif defined(Q_OS_LINUX)
customStyle = QStyleFactory::create("oxygen");
#endif
......
......@@ -24,6 +24,7 @@
#include <QDesktopWidget>
#include "UBScreenMirror.h"
......@@ -32,7 +33,7 @@
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
#if defined(Q_WS_MAC)
#if defined(Q_OS_OSX)
#include <ApplicationServices/ApplicationServices.h>
#endif
......
......@@ -29,6 +29,7 @@
#define UBSCREENMIRROR_H_
#include <QtGui>
#include <QWidget>
class UBScreenMirror : public QWidget
{
......
......@@ -64,7 +64,7 @@ void UBSpinningWheel::paintEvent(QPaintEvent *event)
pen.setCapStyle(Qt::RoundCap);
painter.setPen(pen);
painter.rotate(30 * (mPosition % 12));
painter.rotate(30 * (mPosition.loadAcquire() % 12));
for(int i = 0; i < 12; i++)
{
......
......@@ -26,6 +26,7 @@
#include <QString>
#include <QCursor>
#include <QGraphicsRectItem>
#include "UBThumbnailWidget.h"
#include "UBRubberBand.h"
......@@ -242,9 +243,10 @@ void UBThumbnailWidget::mousePressEvent(QMouseEvent *event)
option.initFrom(&rubberBand);
mPrevLassoRect = QRect();
mLassoRectItem = new QGraphicsRectItem(0, scene());
mLassoRectItem = new QGraphicsRectItem(0);
scene()->addItem(mLassoRectItem);
#ifdef Q_WS_MAC
#ifdef Q_OS_OSX
// The following code must stay in synch with <Qt installation folder>\src\gui\styles\qmacstyle_mac.mm
QColor strokeColor;
strokeColor.setHsvF(0, 0, 0.86, 1.0);
......@@ -772,7 +774,7 @@ UBSceneThumbnailNavigPixmap::UBSceneThumbnailNavigPixmap(const QPixmap& pix, UBD
, bCanMoveDown(false)
{
if(0 <= UBDocumentContainer::pageFromSceneIndex(pSceneIndex)){
setAcceptsHoverEvents(true);
setAcceptHoverEvents(true);
setFlag(QGraphicsItem::ItemIsSelectable, true);
}
}
......
......@@ -26,6 +26,9 @@
#include <QtGui>
#include <QWebView>
#include <QWebFrame>
#include "UBToolWidget.h"
#include "api/UBWidgetUniboardAPI.h"
#include "api/UBW3CWidgetAPI.h"
......@@ -115,7 +118,8 @@ void UBToolWidget::initialize()
setFixedSize(mToolWidget->boundingRect().width() + mContentMargin * 2, mToolWidget->boundingRect().height() + mContentMargin * 2);
connect(mWebView->page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(javaScriptWindowObjectCleared()));
connect(mWebView->page()->mainFrame(), &QWebFrame::javaScriptWindowObjectCleared,
this, &UBToolWidget::javaScriptWindowObjectCleared);
mWebView->load(mToolWidget->mainHtml());
......
......@@ -29,6 +29,7 @@
#define UBTOOLWIDGET_H_
#include <QtGui>
#include <QWidget>
class UBGraphicsWidgetItem;
class QWidget;
......
......@@ -28,6 +28,8 @@
#include "UBToolbarButtonGroup.h"
#include <QtGui>
#include <QLayout>
#include <QStyleOption>
#include "core/UBApplication.h"
#include "core/UBSettings.h"
......
......@@ -30,6 +30,10 @@
#include <QtGui>
#include <QWidget>
#include <QToolBar>
#include <QToolButton>
#include <QActionGroup>
class UBToolbarButtonGroup : public QWidget
{
......
......@@ -29,6 +29,7 @@
#define UBWIDGETMIRROR_H_
#include <QtGui>
#include <QWidget>
class UBWidgetMirror : public QWidget
{
......
......@@ -28,6 +28,7 @@
#include "UBZoomPalette.h"
#include <QtGui>
#include <QPushButton>
#include <math.h>
#include "core/UBApplication.h"
......
......@@ -29,6 +29,8 @@
#include <QtGui>
#include <QtNetwork>
#include <QMessageBox>
#include <QPushButton>
#include "core/UBApplication.h"
#include "core/UBApplicationController.h"
......@@ -115,7 +117,7 @@ void UBNetworkAccessManager::authenticationRequired(QNetworkReply *reply, QAuthe
passwordDialog.iconLabel->setPixmap(mainWindow->style()->standardIcon(QStyle::SP_MessageBoxQuestion, 0, mainWindow).pixmap(32, 32));
QString introMessage = tr("<qt>Enter username and password for \"%1\" at %2</qt>");
introMessage = introMessage.arg(Qt::escape(reply->url().toString())).arg(Qt::escape(reply->url().toString()));
introMessage = introMessage.arg((reply->url().toString()).toHtmlEscaped()).arg((reply->url().toString()).toHtmlEscaped());
passwordDialog.introLabel->setText(introMessage);
passwordDialog.introLabel->setWordWrap(true);
......
......@@ -78,12 +78,12 @@ double Utils::stringToDouble(const std::string & s )
std::string Utils::uIntToStr(unsigned int integer)
{
return std::string(QString::number(integer).toAscii());
return std::string(QString::number(integer).toLatin1());
}
std::string Utils::doubleToStr(double doubleValue)
{
return std::string(QString::number(doubleValue).toAscii());
return std::string(QString::number(doubleValue).toLatin1());
}
int Utils::_stringToInt(const std::string & str) //throw ConvertException
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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