From c11062bb1ae808d6831751464750949556cad4f3 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Thu, 16 Aug 2012 10:10:22 +0200 Subject: [PATCH 01/13] added 3 translations --- Sankore_3.1.pro | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Sankore_3.1.pro b/Sankore_3.1.pro index 73ddad26..952415cb 100644 --- a/Sankore_3.1.pro +++ b/Sankore_3.1.pro @@ -327,6 +327,25 @@ macx { TRANSLATION_ca.path = "$$RESOURCES_DIR/ca.lproj" QMAKE_BUNDLE_DATA += TRANSLATION_ca } + + exists(resources/i18n/sankore_el.qm) { + TRANSLATION_el.files = resources/i18n/sankore_el.qm \ + resources/i18n/Localizable.strings + TRANSLATION_el.path = "$$RESOURCES_DIR/el.lproj" + QMAKE_BUNDLE_DATA += TRANSLATION_el + } + exists(resources/i18n/sankore_tr.qm) { + TRANSLATION_tr.files = resources/i18n/sankore_tr.qm \ + resources/i18n/Localizable.strings + TRANSLATION_tr.path = "$$RESOURCES_DIR/tr.lproj" + QMAKE_BUNDLE_DATA += TRANSLATION_tr + } + exists(resources/i18n/sankore_cz.qm) { + TRANSLATION_cz.files = resources/i18n/sankore_cz.qm \ + resources/i18n/Localizable.strings + TRANSLATION_cz.path = "$$RESOURCES_DIR/cz.lproj" + QMAKE_BUNDLE_DATA += TRANSLATION_cz + } QMAKE_BUNDLE_DATA += UB_ETC \ UB_LIBRARY \ @@ -391,7 +410,10 @@ TRANSLATIONS = resources/i18n/sankore_en.ts \ resources/i18n/sankore_pt.ts \ resources/i18n/sankore_sk.ts \ resources/i18n/sankore_bg.ts \ - resources/i18n/sankore_ca.ts + resources/i18n/sankore_ca.ts \ + resources/i18n/sankore_el.ts \ + resources/i18n/sankore_tr.ts \ + resources/i18n/sankore_cz.ts INSTALLS = UB_ETC \ UB_I18N \ From 64bce6a14be1d3201e0b9632f7afb44e37d0ba18 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Thu, 16 Aug 2012 10:14:37 +0200 Subject: [PATCH 02/13] fixed language code --- Sankore_3.1.pro | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sankore_3.1.pro b/Sankore_3.1.pro index 952415cb..0f8e569e 100644 --- a/Sankore_3.1.pro +++ b/Sankore_3.1.pro @@ -340,11 +340,11 @@ macx { TRANSLATION_tr.path = "$$RESOURCES_DIR/tr.lproj" QMAKE_BUNDLE_DATA += TRANSLATION_tr } - exists(resources/i18n/sankore_cz.qm) { - TRANSLATION_cz.files = resources/i18n/sankore_cz.qm \ + exists(resources/i18n/sankore_cs.qm) { + TRANSLATION_cs.files = resources/i18n/sankore_cs.qm \ resources/i18n/Localizable.strings - TRANSLATION_cz.path = "$$RESOURCES_DIR/cz.lproj" - QMAKE_BUNDLE_DATA += TRANSLATION_cz + TRANSLATION_cs.path = "$$RESOURCES_DIR/cs.lproj" + QMAKE_BUNDLE_DATA += TRANSLATION_cs } QMAKE_BUNDLE_DATA += UB_ETC \ @@ -413,7 +413,7 @@ TRANSLATIONS = resources/i18n/sankore_en.ts \ resources/i18n/sankore_ca.ts \ resources/i18n/sankore_el.ts \ resources/i18n/sankore_tr.ts \ - resources/i18n/sankore_cz.ts + resources/i18n/sankore_cs.ts INSTALLS = UB_ETC \ UB_I18N \ From 4d982d1eac563506f908cc218c9c9211cb0c1407 Mon Sep 17 00:00:00 2001 From: shibakaneki Date: Thu, 16 Aug 2012 10:33:12 +0200 Subject: [PATCH 03/13] Did a better implementation for the tool management --- src/board/UBBoardView.cpp | 30 +----------------------------- src/board/UBBoardView.h | 2 -- src/board/UBDrawingController.cpp | 5 ++++- 3 files changed, 5 insertions(+), 32 deletions(-) diff --git a/src/board/UBBoardView.cpp b/src/board/UBBoardView.cpp index 92686ef3..7597d81e 100644 --- a/src/board/UBBoardView.cpp +++ b/src/board/UBBoardView.cpp @@ -106,8 +106,7 @@ UBBoardView::~UBBoardView () { delete suspendedMousePressEvent; } -void -UBBoardView::init () +void UBBoardView::init () { connect (UBSettings::settings ()->boardPenPressureSensitive, SIGNAL (changed (QVariant)), this, SLOT (settingChanged (QVariant))); @@ -144,8 +143,6 @@ UBBoardView::init () movingItem = NULL; mWidgetMoved = false; - - connectToStylusPalette(); } UBGraphicsScene* @@ -1441,28 +1438,3 @@ UBBoardView::setToolCursor (int tool) controlViewport->setCursor (UBResources::resources ()->penCursor); } } - -void UBBoardView::connectToStylusPalette() -{ - connect(UBApplication::mainWindow->actionPen, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool))); - connect(UBApplication::mainWindow->actionEraser, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool))); - connect(UBApplication::mainWindow->actionMarker, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool))); - connect(UBApplication::mainWindow->actionPointer, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool))); - connect(UBApplication::mainWindow->actionPlay, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool))); - connect(UBApplication::mainWindow->actionZoomIn, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool))); - connect(UBApplication::mainWindow->actionZoomOut, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool))); - connect(UBApplication::mainWindow->actionCapture, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool))); - connect(UBApplication::mainWindow->actionHand, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool))); - connect(UBApplication::mainWindow->actionLine, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool))); - connect(UBApplication::mainWindow->actionText, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool))); - connect(UBApplication::mainWindow->actionSelector, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool))); -} - -void UBBoardView::onTriggeredAction(bool checked) -{ - Q_UNUSED(checked); - QList it = scene()->selectedItems(); - foreach(QGraphicsItem* i, it){ - i->setSelected(false); - } -} diff --git a/src/board/UBBoardView.h b/src/board/UBBoardView.h index f25a788a..34cf7fc7 100644 --- a/src/board/UBBoardView.h +++ b/src/board/UBBoardView.h @@ -94,7 +94,6 @@ class UBBoardView : public QGraphicsView private: void init(); - void connectToStylusPalette(); inline bool shouldDisplayItem(QGraphicsItem *item) { @@ -152,7 +151,6 @@ class UBBoardView : public QGraphicsView private slots: void settingChanged(QVariant newValue); - void onTriggeredAction(bool checked); public slots: diff --git a/src/board/UBDrawingController.cpp b/src/board/UBDrawingController.cpp index 7398ca41..a539bc19 100644 --- a/src/board/UBDrawingController.cpp +++ b/src/board/UBDrawingController.cpp @@ -18,8 +18,10 @@ #include "core/UBSettings.h" #include "core/UBApplication.h" -#include "gui/UBMainWindow.h" +#include "domain/UBGraphicsScene.h" +#include "board/UBBoardController.h" +#include "gui/UBMainWindow.h" #include "core/memcheck.h" UBDrawingController* UBDrawingController::sDrawingController = 0; @@ -87,6 +89,7 @@ void UBDrawingController::setStylusTool(int tool) { if (tool != mStylusTool) { + UBApplication::boardController->activeScene()->deselectAllItems(); if (mStylusTool == UBStylusTool::Pen || mStylusTool == UBStylusTool::Marker || mStylusTool == UBStylusTool::Line) { From c3fde72746f8fede29e8a42342bac0ed1767eb90 Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Thu, 16 Aug 2012 11:34:29 +0300 Subject: [PATCH 04/13] Items deselected before deleting from scene. (Fix for Sankore-972). --- src/domain/UBGraphicsScene.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 97659ec1..5608b620 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -2351,6 +2351,7 @@ void UBGraphicsScene::keyReleaseEvent(QKeyEvent * keyEvent) default: { + item->setSelected(false); UBGraphicsItem *ubgi = dynamic_cast(item); if (0 != ubgi) ubgi->remove(); From ac1c9314ad62440160cee114013d56e97ca85a44 Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Thu, 16 Aug 2012 11:57:28 +0300 Subject: [PATCH 05/13] Fixed adding of found audio files to document. Improved recognition of song's title. Some code removed from header. --- src/board/UBBoardController.cpp | 2 +- src/domain/UBGraphicsMediaItem.cpp | 12 ++++++++++++ src/domain/UBGraphicsMediaItem.h | 11 +---------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index 25416aa5..525b7e5d 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -1102,7 +1102,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri QUuid uuid = QUuid::createUuid(); QUrl url = QUrl::fromLocalFile(UBPersistenceManager::persistenceManager() - ->addVideoFileToDocument(selectedDocument(), sourceUrl, pData, uuid)); + ->addAudioFileToDocument(selectedDocument(), sourceUrl, pData, uuid)); audioMediaItem = mActiveScene->addMedia(url, false, pPos); diff --git a/src/domain/UBGraphicsMediaItem.cpp b/src/domain/UBGraphicsMediaItem.cpp index 8e2778e5..b02c89b4 100644 --- a/src/domain/UBGraphicsMediaItem.cpp +++ b/src/domain/UBGraphicsMediaItem.cpp @@ -178,6 +178,18 @@ QVariant UBGraphicsMediaItem::itemChange(GraphicsItemChange change, const QVaria return UBGraphicsProxyWidget::itemChange(change, value); } + +void UBGraphicsMediaItem::setSourceUrl(const QUrl &pSourceUrl) +{ + UBAudioPresentationWidget* pAudioWidget = dynamic_cast(mAudioWidget); + if (pAudioWidget) + { + pAudioWidget->setTitle(UBFileSystemUtils::lastPathComponent(pSourceUrl.toString())); + } + + UBItem::setSourceUrl(pSourceUrl); +} + void UBGraphicsMediaItem::clearSource() { QString path = mediaFileUrl().toLocalFile(); diff --git a/src/domain/UBGraphicsMediaItem.h b/src/domain/UBGraphicsMediaItem.h index 1ab0870d..308fbea9 100644 --- a/src/domain/UBGraphicsMediaItem.h +++ b/src/domain/UBGraphicsMediaItem.h @@ -97,16 +97,7 @@ public: virtual void copyItemParameters(UBItem *copy) const; - virtual void setSourceUrl(const QUrl &pSourceUrl) - { - UBAudioPresentationWidget* pAudioWidget = dynamic_cast(mAudioWidget); - if (pAudioWidget) - { - pAudioWidget->setTitle(UBFileSystemUtils::lastPathComponent(pSourceUrl.toLocalFile())); - } - - UBItem::setSourceUrl(pSourceUrl); - } + virtual void setSourceUrl(const QUrl &pSourceUrl); public slots: From 21ac264c9985aa8454f3358e7d32f8fbe9faa4e2 Mon Sep 17 00:00:00 2001 From: Ilia Ryabokon Date: Thu, 16 Aug 2012 12:05:55 +0300 Subject: [PATCH 06/13] Sankore 831 - delete annotations on the scene --- src/domain/UBGraphicsScene.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 97659ec1..c5925f6f 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -1270,7 +1270,7 @@ void UBGraphicsScene::clearAnnotations() while (itItems.hasNext()) { QGraphicsItem* item = itItems.next(); - UBGraphicsPolygonItem* pi = qgraphicsitem_cast(item); + UBGraphicsStrokesGroup* pi = qgraphicsitem_cast(item); if (pi) { removeItem(item); From 070d03401c98d738a4cff6a79426e6bee7cf0d0a Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Thu, 16 Aug 2012 12:37:55 +0300 Subject: [PATCH 07/13] A small correction for audio item design... strange, it was good on windows and linux, but works not the same on mac. --- src/domain/UBGraphicsMediaItem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/domain/UBGraphicsMediaItem.cpp b/src/domain/UBGraphicsMediaItem.cpp index b02c89b4..10818e56 100644 --- a/src/domain/UBGraphicsMediaItem.cpp +++ b/src/domain/UBGraphicsMediaItem.cpp @@ -42,7 +42,7 @@ void UBAudioPresentationWidget::paintEvent(QPaintEvent *event) mask_img.fill(0xff); QPainter mask_painter(&mask_img); mask_painter.setBrush(QBrush( QColor(0, 0, 0))); - mask_painter.drawRoundedRect(1,1, width()-3, height()-3, height()/5, height()/5); + mask_painter.drawRoundedRect(1,1, width()-2, height()-2, height()/5, height()/5); setMask(QBitmap::fromImage(mask_img)); From 0b8014ee11356fb557dcefee2b6a8aed26a118a1 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Thu, 16 Aug 2012 15:24:19 +0200 Subject: [PATCH 08/13] fixed issue 994 --- src/gui/UBFeaturesWidget.cpp | 23 ++++++++++++++--------- src/gui/UBFeaturesWidget.h | 1 + 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/gui/UBFeaturesWidget.cpp b/src/gui/UBFeaturesWidget.cpp index d221950b..4d067c8c 100644 --- a/src/gui/UBFeaturesWidget.cpp +++ b/src/gui/UBFeaturesWidget.cpp @@ -107,7 +107,7 @@ void UBFeaturesWidget::currentSelected(const QModelIndex ¤t) QString objName = sender()->objectName(); if (objName.isEmpty()) { - qWarning() << "incorrrect sender"; + qWarning() << "incorrect sender"; } else if (objName == objNamePathList) { //Calling to reset the model for listView. Maybe separate function needed controller->searchStarted("", centralWidget->listView()); @@ -478,12 +478,12 @@ UBFeaturesCentralWidget::UBFeaturesCentralWidget(QWidget *parent) : QWidget(pare //Used to show search bar on the search widget webView = new UBFeaturesWebView(this); - //filling stackwidget - mStackedWidget->addWidget(mNavigator); - mStackedWidget->addWidget(mFeatureProperties); - mStackedWidget->addWidget(webView); - mStackedWidget->setCurrentIndex(MainList); - mStackedWidget->setContentsMargins(0, 0, 0, 0); + //filling stackwidget + mStackedWidget->addWidget(mNavigator); + mStackedWidget->addWidget(mFeatureProperties); + mStackedWidget->addWidget(webView); + mStackedWidget->setCurrentIndex(MainList); + mStackedWidget->setContentsMargins(0, 0, 0, 0); mAdditionalDataContainer = new QStackedWidget(this); @@ -542,7 +542,7 @@ void UBFeaturesCentralWidget::setPropertiesThumbnail(const QPixmap &pix) UBFeature UBFeaturesCentralWidget::getCurElementFromProperties() { - return mFeatureProperties->getCurrentElement(); + return mFeatureProperties->getCurrentElement(); } void UBFeaturesCentralWidget::showAdditionalData(AddWidget pWidgetType, AddWidgetState pState) @@ -732,7 +732,7 @@ UBFeaturesWebView::UBFeaturesWebView(QWidget* parent, const char* name):QWidget( mpView->setObjectName("SearchEngineView"); mpSankoreAPI = new UBWidgetUniboardAPI(UBApplication::boardController->activeScene()); mpView->page()->mainFrame()->addToJavaScriptWindowObject("sankore", mpSankoreAPI); - + connect(mpView->page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(javaScriptWindowObjectCleared())); mpWebSettings = QWebSettings::globalSettings(); mpWebSettings->setAttribute(QWebSettings::JavaEnabled, true); mpWebSettings->setAttribute(QWebSettings::PluginsEnabled, true); @@ -767,6 +767,11 @@ UBFeaturesWebView::~UBFeaturesWebView() } } +void UBFeaturesWebView::javaScriptWindowObjectCleared() +{ + mpView->page()->mainFrame()->addToJavaScriptWindowObject("sankore", mpSankoreAPI); +} + void UBFeaturesWebView::showElement(const UBFeature &elem) { QString qsWidgetName; diff --git a/src/gui/UBFeaturesWidget.h b/src/gui/UBFeaturesWidget.h index 5a1b987e..a1fb87e0 100644 --- a/src/gui/UBFeaturesWidget.h +++ b/src/gui/UBFeaturesWidget.h @@ -288,6 +288,7 @@ public: private slots: void onLoadFinished(bool ok); + void javaScriptWindowObjectCleared(); private: QWebView* mpView; From 16a9d0d7d0e77ca0f6f8a03fec9b31187e83b137 Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Thu, 16 Aug 2012 18:04:13 +0300 Subject: [PATCH 09/13] Exporting to CFF mechanism was appended by storing warnings about exporting items content. If warnings was appeared - dialog with warnings details appeared. Each warning is a separate QTextEdit. That mechanism is general for UBExportAdaptor and can be simple implemented and used in any import or export adaptor. --- plugins/cffadaptor/src/UBCFFAdaptor.cpp | 16 ++++++- plugins/cffadaptor/src/UBCFFAdaptor.h | 7 ++++ plugins/cffadaptor/src/UBCFFConstants.h | 1 + src/adaptors/UBExportAdaptor.cpp | 11 +++++ src/adaptors/UBExportAdaptor.h | 2 + src/adaptors/UBExportCFF.cpp | 1 + src/gui/UBMessagesDialog.cpp | 56 +++++++++++++++++++++++++ src/gui/UBMessagesDialog.h | 37 ++++++++++++++++ src/gui/gui.pri | 6 ++- 9 files changed, 134 insertions(+), 3 deletions(-) create mode 100644 src/gui/UBMessagesDialog.cpp create mode 100644 src/gui/UBMessagesDialog.h diff --git a/plugins/cffadaptor/src/UBCFFAdaptor.cpp b/plugins/cffadaptor/src/UBCFFAdaptor.cpp index ed59738c..e9dae78f 100644 --- a/plugins/cffadaptor/src/UBCFFAdaptor.cpp +++ b/plugins/cffadaptor/src/UBCFFAdaptor.cpp @@ -47,7 +47,12 @@ bool UBCFFAdaptor::convertUBZToIWB(const QString &from, const QString &to) qDebug() << "The convertrer class is invalid, stopping conversion. Error message" << tmpConvertrer.lastErrStr(); return false; } - if (!tmpConvertrer.parse()) { + + bool bParceRes = tmpConvertrer.parse(); + + mConversionMessages << tmpConvertrer.getMessages(); + + if (!bParceRes) { return false; } @@ -299,6 +304,12 @@ bool UBCFFAdaptor::deleteDir(const QString& pDirPath) const return dir.rmdir(pDirPath); } + +QList UBCFFAdaptor::getConversionMessages() +{ + return mConversionMessages; +} + bool UBCFFAdaptor::freeDir(const QString &dir) { bool result = true; @@ -1110,6 +1121,9 @@ bool UBCFFAdaptor::UBToCFFConverter::setContentFromUBZ(const QDomElement &ubzEle } }else { + addLastExportError(QObject::tr("Element ID = ") + QString("%1 \r\n").arg(ubzElement.attribute(aUBZUuid)) + + QString("Source file = ") + QString("%1 \r\n").arg(ubzElement.attribute(aUBZSource)) + + QObject::tr("Content is not supported in destination format.")); bRet = false; } diff --git a/plugins/cffadaptor/src/UBCFFAdaptor.h b/plugins/cffadaptor/src/UBCFFAdaptor.h index 385df3cc..d9891460 100644 --- a/plugins/cffadaptor/src/UBCFFAdaptor.h +++ b/plugins/cffadaptor/src/UBCFFAdaptor.h @@ -20,6 +20,7 @@ public: bool convertUBZToIWB(const QString &from, const QString &to); bool deleteDir(const QString& pDirPath) const; + QList getConversionMessages(); private: QString uncompressZip(const QString &zipFile); @@ -33,6 +34,7 @@ private: private: QStringList tmpDirs; + QList mConversionMessages; private: @@ -46,8 +48,12 @@ private: bool isValid() const; QString lastErrStr() const {return errorStr;} bool parse(); + QList getMessages() {return mExportErrorList;} private: + + void addLastExportError(QString error) {mExportErrorList.append(error);} + void fillNamespaces(); bool parseMetadata(); @@ -119,6 +125,7 @@ private: QString contentIWBFileName() const; private: + QList mExportErrorList; QMap iwbSVGItemsAttributes; QDomDocument *mDataModel; //model for reading indata QXmlStreamWriter *mIWBContentWriter; //stream to write outdata diff --git a/plugins/cffadaptor/src/UBCFFConstants.h b/plugins/cffadaptor/src/UBCFFConstants.h index 9d7707ee..3243f72f 100644 --- a/plugins/cffadaptor/src/UBCFFConstants.h +++ b/plugins/cffadaptor/src/UBCFFConstants.h @@ -74,6 +74,7 @@ const QString aRef = "ref"; // as reference for applying additional attributes const QString aSVGHref = "xlink:href"; // reference to file const QString aIWBHref = "ref"; // reference to element ID const QString aUBZHref = "href"; +const QString aUBZSource = "source"; const QString aSrc = "src"; const QString aSVGRequiredExtension = "requiredExtensions"; diff --git a/src/adaptors/UBExportAdaptor.cpp b/src/adaptors/UBExportAdaptor.cpp index 63843bb2..ffa5b8de 100644 --- a/src/adaptors/UBExportAdaptor.cpp +++ b/src/adaptors/UBExportAdaptor.cpp @@ -24,6 +24,7 @@ #include "core/UBApplication.h" #include "gui/UBMainWindow.h" +#include "gui/UBMessagesDialog.h" #include "core/memcheck.h" @@ -103,3 +104,13 @@ QString UBExportAdaptor::askForDirName(UBDocumentProxy* pDocument, const QString return dirname; } + +void UBExportAdaptor::showErrorsList(QList errorsList) +{ + if (errorsList.count()) + { + UBMessagesDialog *dialog = new UBMessagesDialog(tr("Warnings during export was appeared"), UBApplication::mainWindow); + dialog->setMessages(errorsList); + dialog->show(); + } +} \ No newline at end of file diff --git a/src/adaptors/UBExportAdaptor.h b/src/adaptors/UBExportAdaptor.h index edffaaf5..9051d496 100644 --- a/src/adaptors/UBExportAdaptor.h +++ b/src/adaptors/UBExportAdaptor.h @@ -46,6 +46,8 @@ class UBExportAdaptor : public QObject QString askForFileName(UBDocumentProxy* pDocument, const QString& pDialogTitle); QString askForDirName(UBDocumentProxy* pDocument, const QString& pDialogTitle); + void showErrorsList(QList errorsList); + bool mIsVerbose; }; diff --git a/src/adaptors/UBExportCFF.cpp b/src/adaptors/UBExportCFF.cpp index bc97a730..8691fdf7 100644 --- a/src/adaptors/UBExportCFF.cpp +++ b/src/adaptors/UBExportCFF.cpp @@ -52,6 +52,7 @@ void UBExportCFF::persist(UBDocumentProxy* pDocument) if (mIsVerbose) UBApplication::showMessage(tr("Export failed.")); + showErrorsList(toIWBExporter.getConversionMessages()); QApplication::restoreOverrideCursor(); diff --git a/src/gui/UBMessagesDialog.cpp b/src/gui/UBMessagesDialog.cpp new file mode 100644 index 00000000..22828d36 --- /dev/null +++ b/src/gui/UBMessagesDialog.cpp @@ -0,0 +1,56 @@ +/* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +#include "UBMessagesDialog.h" + +UBMessagesDialog::UBMessagesDialog(QString windowTitle, QWidget *parent) +: QWidget(parent) +{ + resize(400, 0); + + setWindowTitle(windowTitle); + setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint); + +} + +void UBMessagesDialog::setMessages(const QList messages) +{ + mMessages = messages; + + if (mMessages.count()) + { + QVBoxLayout *messagesLayout = new QVBoxLayout(this); + foreach (QString message, mMessages) + { + QTextEdit *messageBox = new QTextEdit(this); + messageBox->setMinimumHeight(55); + messageBox->setReadOnly(true); + messageBox->setFocusPolicy(Qt::NoFocus); + messageBox->setText(message); + messagesLayout->addWidget(messageBox); + } + QPushButton *closeButton = new QPushButton(tr("Close"), this); + connect(closeButton, SIGNAL(clicked(bool)), this, SLOT(dispose())); + + messagesLayout->addWidget(closeButton); + + setLayout(messagesLayout); + } +} + +void UBMessagesDialog::dispose() +{ + delete this; +} \ No newline at end of file diff --git a/src/gui/UBMessagesDialog.h b/src/gui/UBMessagesDialog.h new file mode 100644 index 00000000..d5d3efaa --- /dev/null +++ b/src/gui/UBMessagesDialog.h @@ -0,0 +1,37 @@ +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef UB_MESSAGES_DIALOG_H_ +#define UB_MESSAGES_DIALOG_H_ + +#include + +class UBMessagesDialog : public QWidget +{ + Q_OBJECT + +public: + UBMessagesDialog(QString windowTitle, QWidget *parent = NULL); + void setMessages(const QList messages); + + private slots: + void dispose(); + +private: + QList mMessages; + int mMessagesFontSize; +}; + +#endif UB_MESSAGES_DIALOG_H_ \ No newline at end of file diff --git a/src/gui/gui.pri b/src/gui/gui.pri index 52939d44..61583d04 100644 --- a/src/gui/gui.pri +++ b/src/gui/gui.pri @@ -50,7 +50,8 @@ HEADERS += src/gui/UBThumbnailView.h \ src/gui/UBFeaturesActionBar.h \ src/gui/UBDockTeacherGuideWidget.h \ src/gui/UBTeacherGuideWidget.h \ - src/gui/UBTeacherGuideWidgetsTools.h + src/gui/UBTeacherGuideWidgetsTools.h \ + src/gui/UBMessagesDialog.h SOURCES += src/gui/UBThumbnailView.cpp \ src/gui/UBFloatingPalette.cpp \ @@ -103,7 +104,8 @@ SOURCES += src/gui/UBThumbnailView.cpp \ src/gui/UBFeaturesActionBar.cpp \ src/gui/UBDockTeacherGuideWidget.cpp \ src/gui/UBTeacherGuideWidget.cpp \ - src/gui/UBTeacherGuideWidgetsTools.cpp + src/gui/UBTeacherGuideWidgetsTools.cpp \ + src/gui/UBMessagesDialog.cpp win32 { From 1e93409dcf668e964fe1417898db70f4203704eb Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Thu, 16 Aug 2012 18:35:57 +0300 Subject: [PATCH 10/13] Zoom palette is on top now. --- src/board/UBBoardPaletteManager.cpp | 2 ++ src/gui/UBZoomPalette.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index 1468e753..7c19320a 100644 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -269,6 +269,8 @@ void UBBoardPaletteManager::setupPalettes() mZoomPalette = new UBZoomPalette(mContainer); + mStylusPalette->stackUnder(mZoomPalette); + QList backgroundsActions; backgroundsActions << UBApplication::mainWindow->actionPlainLightBackground; diff --git a/src/gui/UBZoomPalette.cpp b/src/gui/UBZoomPalette.cpp index 352c706e..4a039f81 100644 --- a/src/gui/UBZoomPalette.cpp +++ b/src/gui/UBZoomPalette.cpp @@ -109,5 +109,6 @@ void UBZoomPalette::refreshPalette() else { show(); + raise(); } } From dc4bb2eb454d8883eae598b640c670364d3ce0dc Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Thu, 16 Aug 2012 19:17:38 +0300 Subject: [PATCH 11/13] Mask was removed from AudioPresentationWidget. Border is 2px now. --- src/domain/UBGraphicsMediaItem.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/domain/UBGraphicsMediaItem.cpp b/src/domain/UBGraphicsMediaItem.cpp index 10818e56..76bbbd53 100644 --- a/src/domain/UBGraphicsMediaItem.cpp +++ b/src/domain/UBGraphicsMediaItem.cpp @@ -36,15 +36,13 @@ void UBAudioPresentationWidget::paintEvent(QPaintEvent *event) { QPainter painter(this); painter.fillRect(rect(), QBrush(Qt::white)); - painter.drawRoundedRect(1,1, width()-2, height()-2, height()/5, height()/5); - - QImage mask_img(size(), QImage::Format_Mono); - mask_img.fill(0xff); - QPainter mask_painter(&mask_img); - mask_painter.setBrush(QBrush( QColor(0, 0, 0))); - mask_painter.drawRoundedRect(1,1, width()-2, height()-2, height()/5, height()/5); + + QPen borderPen; + borderPen.setWidth(2); + borderPen.setColor(QColor(Qt::black)); - setMask(QBitmap::fromImage(mask_img)); + painter.setPen(borderPen); + painter.drawRect(0,0, width(), height()); if (QString() != mTitle) { From 77629223da3f8f37171ea1641db55bb336327f98 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Fri, 17 Aug 2012 09:00:46 +0200 Subject: [PATCH 12/13] fixed issue with add item palette that doesn't appears on desktop and web mode --- src/board/UBBoardPaletteManager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index 1468e753..1b3328b8 100644 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -677,6 +677,10 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is { case eUBDockPaletteWidget_BOARD: { + // On Application start up the mAddItemPalette isn't initialized yet + if(mAddItemPalette){ + mAddItemPalette->setParent(UBApplication::boardController->controlContainer()); + } mLeftPalette->assignParent(mContainer); mRightPalette->assignParent(mContainer); mRightPalette->stackUnder(mStylusPalette); @@ -710,6 +714,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is case eUBDockPaletteWidget_DESKTOP: { + mAddItemPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); mLeftPalette->assignParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); mRightPalette->assignParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); mRightPalette->lower(); @@ -745,7 +750,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is mRightPalette->setAdditionalVOffset(30); #endif - if( !isInit ) + if(!isInit) UBApplication::applicationController->uninotesController()->TransparentWidgetResized(); if (mWebToolsCurrentPalette) @@ -755,6 +760,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is case eUBDockPaletteWidget_WEB: { + mAddItemPalette->setParent(UBApplication::mainWindow); if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) { // tmp variable? From 508f79aae6dc3cfa47d2b7ead4f6b5759961762a Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Fri, 17 Aug 2012 10:12:11 +0200 Subject: [PATCH 13/13] localized some labels --- src/board/UBFeaturesController.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/board/UBFeaturesController.cpp b/src/board/UBFeaturesController.cpp index e2d7fa80..117fb932 100644 --- a/src/board/UBFeaturesController.cpp +++ b/src/board/UBFeaturesController.cpp @@ -263,17 +263,17 @@ UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) : trashDirectoryPath = QUrl::fromLocalFile(UBSettings::userTrashDirPath()); rootElement = UBFeature(QString(), QImage( ":images/libpalette/home.png" ), "root", QUrl()); - audiosElement = UBFeature( rootPath, QImage(":images/libpalette/AudiosCategory.svg"), "Audios" , mUserAudioDirectoryPath, FEATURE_CATEGORY); - moviesElement = UBFeature( rootPath, QImage(":images/libpalette/MoviesCategory.svg"), "Movies" , mUserVideoDirectoryPath, FEATURE_CATEGORY); - picturesElement = UBFeature( rootPath, QImage(":images/libpalette/PicturesCategory.svg"), "Pictures" , mUserPicturesDirectoryPath, FEATURE_CATEGORY); - flashElement = UBFeature( rootPath, QImage(":images/libpalette/FlashCategory.svg"), "Animations" , mUserAnimationDirectoryPath, FEATURE_CATEGORY); - interactElement = UBFeature( rootPath, QImage(":images/libpalette/InteractivesCategory.svg"), "Interactivities" , mLibInteractiveDirectoryPath, FEATURE_CATEGORY); - applicationsElement = UBFeature( rootPath, QImage(":images/libpalette/ApplicationsCategory.svg"), "Applications" , mUserInteractiveDirectoryPath, FEATURE_CATEGORY); - shapesElement = UBFeature( rootPath, QImage(":images/libpalette/ShapesCategory.svg"), "Shapes" , mLibShapesDirectoryPath, FEATURE_CATEGORY ); - favoriteElement = UBFeature( rootPath, QImage(":images/libpalette/FavoritesCategory.svg"), "Favorites", QUrl("favorites"), FEATURE_FAVORITE ); - webSearchElement = UBFeature( rootPath, QImage(":images/libpalette/WebSearchCategory.svg"), "Web search", mLibSearchDirectoryPath, FEATURE_CATEGORY); - - trashElement = UBFeature( rootPath, QImage(":images/libpalette/TrashCategory.svg"), "Trash", trashDirectoryPath, FEATURE_TRASH ); + audiosElement = UBFeature( rootPath, QImage(":images/libpalette/AudiosCategory.svg"), tr("Audios") , mUserAudioDirectoryPath, FEATURE_CATEGORY); + moviesElement = UBFeature( rootPath, QImage(":images/libpalette/MoviesCategory.svg"), tr("Movies") , mUserVideoDirectoryPath, FEATURE_CATEGORY); + picturesElement = UBFeature( rootPath, QImage(":images/libpalette/PicturesCategory.svg"), tr("Pictures") , mUserPicturesDirectoryPath, FEATURE_CATEGORY); + flashElement = UBFeature( rootPath, QImage(":images/libpalette/FlashCategory.svg"), tr("Animations") , mUserAnimationDirectoryPath, FEATURE_CATEGORY); + interactElement = UBFeature( rootPath, QImage(":images/libpalette/InteractivesCategory.svg"), tr("Interactivities") , mLibInteractiveDirectoryPath, FEATURE_CATEGORY); + applicationsElement = UBFeature( rootPath, QImage(":images/libpalette/ApplicationsCategory.svg"), tr("Applications") , mUserInteractiveDirectoryPath, FEATURE_CATEGORY); + shapesElement = UBFeature( rootPath, QImage(":images/libpalette/ShapesCategory.svg"), tr("Shapes") , mLibShapesDirectoryPath, FEATURE_CATEGORY ); + favoriteElement = UBFeature( rootPath, QImage(":images/libpalette/FavoritesCategory.svg"), tr("Favorites"), QUrl("favorites"), FEATURE_FAVORITE ); + webSearchElement = UBFeature( rootPath, QImage(":images/libpalette/WebSearchCategory.svg"), tr("Web search"), mLibSearchDirectoryPath, FEATURE_CATEGORY); + + trashElement = UBFeature( rootPath, QImage(":images/libpalette/TrashCategory.svg"), tr("Trash"), trashDirectoryPath, FEATURE_TRASH ); featuresList = new QList ();