diff --git a/JournalDesModifications.pdf b/JournalDesModifications.pdf index 577818a4..79f01f9d 100644 Binary files a/JournalDesModifications.pdf and b/JournalDesModifications.pdf differ diff --git a/ReleaseNotes.pdf b/ReleaseNotes.pdf index 0f4885f3..220a99a7 100644 Binary files a/ReleaseNotes.pdf and b/ReleaseNotes.pdf differ diff --git a/Sankore_3.1.pro b/Sankore_3.1.pro index c08d5dec..ce2ac094 100644 --- a/Sankore_3.1.pro +++ b/Sankore_3.1.pro @@ -11,7 +11,7 @@ CONFIG += debug_and_release \ VERSION_MAJ = 2 VERSION_MIN = 00 VERSION_TYPE = b # a = alpha, b = beta, r = release, other => error -VERSION_PATCH = 05 +VERSION_PATCH = 06 VERSION = "$${VERSION_MAJ}.$${VERSION_MIN}.$${VERSION_TYPE}.$${VERSION_PATCH}" VERSION = $$replace(VERSION, "\\.r", "") diff --git a/resources/library/applications/Grapheur.wgt/Grapheur.xhtml b/resources/library/applications/Grapheur.wgt/Grapheur.xhtml index 3a94a9d3..bfca757c 100644 --- a/resources/library/applications/Grapheur.wgt/Grapheur.xhtml +++ b/resources/library/applications/Grapheur.wgt/Grapheur.xhtml @@ -218,7 +218,6 @@ return true; }); $("label[for*='checkAire']").text(sankoreLang[lang].draw); - $("label[for*='checkMaJ']").text(sankoreLang[lang].auto_update); $("#menuOptions td").eq(0).html(sankoreLang[lang].widget); $("#menuOptions h3").eq(0).text(sankoreLang[lang].widget_options); $("#menuOptions2D h3").eq(0).text(sankoreLang[lang].options + " 2D"); @@ -1033,13 +1032,10 @@ Control options:

Save a widget options in cookies or load an options from cookies or delete a registered options. -

-


Cookies are disabled. You cannot save an options...

You are using the last version of this widget.
-
diff --git a/resources/library/applications/Sel video.wgt/css/main.css b/resources/library/applications/Sel video.wgt/css/main.css index 63b2c7b5..43d6ee71 100644 --- a/resources/library/applications/Sel video.wgt/css/main.css +++ b/resources/library/applications/Sel video.wgt/css/main.css @@ -1,7 +1,6 @@ body{ - margin-top:10px; - margin-left:10px; + margin: 0; font-family:Arial, Sans-serif; font-size:15px; color:#444; @@ -104,7 +103,6 @@ body{ } #embeded-content{ - border:1px solid rgb(230,230,230); position:relative; z-index:3; float:left; diff --git a/resources/library/applications/Sel video.wgt/index.html b/resources/library/applications/Sel video.wgt/index.html index e7a51830..752b7f58 100644 --- a/resources/library/applications/Sel video.wgt/index.html +++ b/resources/library/applications/Sel video.wgt/index.html @@ -143,7 +143,7 @@ top:($("#embeded-content").children(":first").height()-35)/2 }); - adaptWidgetSize(5, 13); + adaptWidgetSize(3, 0); return false; }; diff --git a/resources/library/interactivities/Contraste.wgt/locales/fr/scripts/blackYellow.js b/resources/library/interactivities/Contraste.wgt/locales/fr/scripts/blackYellow.js index 34de0859..3fbfd9aa 100644 --- a/resources/library/interactivities/Contraste.wgt/locales/fr/scripts/blackYellow.js +++ b/resources/library/interactivities/Contraste.wgt/locales/fr/scripts/blackYellow.js @@ -326,6 +326,15 @@ function init(){ $(".closeItem").live("click", function(){ if(!shadowOver){ $(this).parent().remove(); + if($(".editContainer").size() > 0){ + var prev = $(".editContainer:first"); + if((prev.position().left == 54) && (prev.position().top != 60)) + prev.css("top", "60px"); + var prevBottom = prev.position().top + prev.height(), + prevLeft = prev.position().left; + if(prev.next().length) + recursionCall(prevBottom, prevLeft, prev.next()); + } } }); @@ -339,8 +348,7 @@ function init(){ }) function recursionCall(prevBottom, prevLeft, curr){ - var curTop = curr.position().top, - curHeight = curr.height(), + var curHeight = curr.height(), curLeft = curr.position().left; if(prevLeft == curLeft){ if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) @@ -351,7 +359,7 @@ function init(){ if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px"); else - curr.css("top", "60px"); + curr.css("top", "60px").css("left", prevLeft + 255 + "px"); } prevBottom = curr.position().top + curr.height(), prevLeft = curr.position().left; @@ -364,7 +372,20 @@ function init(){ popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); $(window).resize(function(){ - //$("#leftDiv,#rightDiv,#shadowDiv").css("height", $(window).height()); + if($("#wgt_edit").hasClass("selected")){ + if($(".editContainer").size() > 1){ + var prev = $(".editContainer:first"), + prevBottom = prev.position().top + prev.height(), + prevLeft = prev.position().left; + recursionCall(prevBottom, prevLeft, prev.next()); + } + } else { + var tmp_array = []; + $(".readyTask").each(function(){ + tmp_array.push($(this)); + }); + orderItems(tmp_array); + } popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%"); popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); }); @@ -564,4 +585,4 @@ function changeStyle(val){ } if($("#wgt_edit").hasClass("selected")) $(document).enableTextSelect(); -} \ No newline at end of file +} diff --git a/resources/library/interactivities/Contraste.wgt/locales/ru/scripts/blackYellow.js b/resources/library/interactivities/Contraste.wgt/locales/ru/scripts/blackYellow.js index fce0a9af..fc0eb152 100644 --- a/resources/library/interactivities/Contraste.wgt/locales/ru/scripts/blackYellow.js +++ b/resources/library/interactivities/Contraste.wgt/locales/ru/scripts/blackYellow.js @@ -326,6 +326,15 @@ function init(){ $(".closeItem").live("click", function(){ if(!shadowOver){ $(this).parent().remove(); + if($(".editContainer").size() > 0){ + var prev = $(".editContainer:first"); + if((prev.position().left == 54) && (prev.position().top != 60)) + prev.css("top", "60px"); + var prevBottom = prev.position().top + prev.height(), + prevLeft = prev.position().left; + if(prev.next().length) + recursionCall(prevBottom, prevLeft, prev.next()); + } } }); @@ -339,8 +348,7 @@ function init(){ }) function recursionCall(prevBottom, prevLeft, curr){ - var curTop = curr.position().top, - curHeight = curr.height(), + var curHeight = curr.height(), curLeft = curr.position().left; if(prevLeft == curLeft){ if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) @@ -351,7 +359,7 @@ function init(){ if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px"); else - curr.css("top", "60px"); + curr.css("top", "60px").css("left", prevLeft + 255 + "px"); } prevBottom = curr.position().top + curr.height(), prevLeft = curr.position().left; @@ -364,7 +372,20 @@ function init(){ popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); $(window).resize(function(){ - //$("#leftDiv,#rightDiv,#shadowDiv").css("height", $(window).height()); + if($("#wgt_edit").hasClass("selected")){ + if($(".editContainer").size() > 1){ + var prev = $(".editContainer:first"), + prevBottom = prev.position().top + prev.height(), + prevLeft = prev.position().left; + recursionCall(prevBottom, prevLeft, prev.next()); + } + } else { + var tmp_array = []; + $(".readyTask").each(function(){ + tmp_array.push($(this)); + }); + orderItems(tmp_array); + } popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%"); popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); }); @@ -564,4 +585,4 @@ function changeStyle(val){ } if($("#wgt_edit").hasClass("selected")) $(document).enableTextSelect(); -} \ No newline at end of file +} diff --git a/resources/library/interactivities/Contraste.wgt/scripts/blackYellow.js b/resources/library/interactivities/Contraste.wgt/scripts/blackYellow.js index 27035aaf..89e6df3f 100644 --- a/resources/library/interactivities/Contraste.wgt/scripts/blackYellow.js +++ b/resources/library/interactivities/Contraste.wgt/scripts/blackYellow.js @@ -326,6 +326,15 @@ function init(){ $(".closeItem").live("click", function(){ if(!shadowOver){ $(this).parent().remove(); + if($(".editContainer").size() > 0){ + var prev = $(".editContainer:first"); + if((prev.position().left == 54) && (prev.position().top != 60)) + prev.css("top", "60px"); + var prevBottom = prev.position().top + prev.height(), + prevLeft = prev.position().left; + if(prev.next().length) + recursionCall(prevBottom, prevLeft, prev.next()); + } } }); @@ -339,8 +348,7 @@ function init(){ }) function recursionCall(prevBottom, prevLeft, curr){ - var curTop = curr.position().top, - curHeight = curr.height(), + var curHeight = curr.height(), curLeft = curr.position().left; if(prevLeft == curLeft){ if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) @@ -351,7 +359,7 @@ function init(){ if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px"); else - curr.css("top", "60px"); + curr.css("top", "60px").css("left", prevLeft + 255 + "px"); } prevBottom = curr.position().top + curr.height(), prevLeft = curr.position().left; @@ -364,7 +372,20 @@ function init(){ popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); $(window).resize(function(){ - //$("#leftDiv,#rightDiv,#shadowDiv").css("height", $(window).height()); + if($("#wgt_edit").hasClass("selected")){ + if($(".editContainer").size() > 1){ + var prev = $(".editContainer:first"), + prevBottom = prev.position().top + prev.height(), + prevLeft = prev.position().left; + recursionCall(prevBottom, prevLeft, prev.next()); + } + } else { + var tmp_array = []; + $(".readyTask").each(function(){ + tmp_array.push($(this)); + }); + orderItems(tmp_array); + } popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%"); popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); }); diff --git a/resources/library/interactivities/Ordre phrase.wgt/styles/of_puppets.css b/resources/library/interactivities/Ordre phrase.wgt/styles/of_puppets.css index 6589dcef..401a2bea 100644 --- a/resources/library/interactivities/Ordre phrase.wgt/styles/of_puppets.css +++ b/resources/library/interactivities/Ordre phrase.wgt/styles/of_puppets.css @@ -33,7 +33,6 @@ body{ font: 28px tahoma; text-align: center; cursor: pointer; - text-transform: uppercase; overflow: hidden; } diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index 5c55521c..2652bb15 100644 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -710,9 +710,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is mLeftPalette->assignParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); mRightPalette->assignParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); mStylusPalette->raise(); - // Maybe threre is a reason to keep that functions but with them right palette in desktop mode is not interactable - // mRightPalette->lower(); - // mLeftPalette->lower(); + if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) { diff --git a/src/board/UBBoardView.cpp b/src/board/UBBoardView.cpp index b90869eb..ed75f550 100644 --- a/src/board/UBBoardView.cpp +++ b/src/board/UBBoardView.cpp @@ -55,6 +55,8 @@ #include "document/UBDocumentProxy.h" +#include "tools/UBGraphicsRuler.h" +#include "tools/UBGraphicsCurtainItem.h" #include "tools/UBGraphicsCompass.h" #include "tools/UBGraphicsCache.h" #include "tools/UBGraphicsTriangle.h" @@ -73,6 +75,7 @@ UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent, bool , mIsDragInProgress(false) , mMultipleSelectionIsEnabled(false) , isControl(pIsControl) +, mRubberBandInPlayMode(false) //enables rubberband with play tool { init (); @@ -433,6 +436,15 @@ bool UBBoardView::itemHaveParentWithType(QGraphicsItem *item, int type) return itemHaveParentWithType(item->parentItem(), type); } +bool UBBoardView::isUBItem(QGraphicsItem *item) +{ + if ((UBGraphicsItemType::UserTypesCount > item->type()) && (item->type() > QGraphicsItem::UserType)) + return true; + else + { + return false; + } +} void UBBoardView::handleItemsSelection(QGraphicsItem *item) { @@ -504,6 +516,13 @@ Here we determines cases when items should to get mouse press event at pressing switch(item->type()) { + case UBGraphicsProtractor::Type: + case UBGraphicsRuler::Type: + case UBGraphicsTriangle::Type: + case UBGraphicsCompass::Type: + case UBGraphicsCache::Type: + return true; + case UBGraphicsDelegateFrame::Type: case QGraphicsSvgItem::Type: return true; @@ -550,10 +569,7 @@ Here we determines cases when items should to get mouse press event at pressing break; } - if ((UBGraphicsItemType::UserTypesCount > item->type()) && (item->type() > QGraphicsItem::UserType)) - return true; - else - return false; + return !isUBItem(item); // standard behavior of QGraphicsScene for not UB items. UB items should be managed upper. } bool UBBoardView::itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item) @@ -609,6 +625,7 @@ bool UBBoardView::itemShouldBeMoved(QGraphicsItem *item) switch(item->type()) { + case UBGraphicsCurtainItem::Type: case UBGraphicsGroupContainerItem::Type: return true; @@ -1004,38 +1021,41 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event) return; } - if (!movingItem && (mMouseButtonIsPressed || mTabletStylusIsPressed) && mUBRubberBand && mUBRubberBand->isVisible()) { - - QRect bandRect(mMouseDownPos, event->pos()); + if (currentTool != UBStylusTool::Play || mRubberBandInPlayMode) { - bandRect = bandRect.normalized(); + if (!movingItem && (mMouseButtonIsPressed || mTabletStylusIsPressed) && mUBRubberBand && mUBRubberBand->isVisible()) { - mUBRubberBand->setGeometry(bandRect); + QRect bandRect(mMouseDownPos, event->pos()); - QList rubberItems = items(bandRect); - foreach (QGraphicsItem *item, mJustSelectedItems) { - if (!rubberItems.contains(item)) { - item->setSelected(false); - mJustSelectedItems.remove(item); - } - } - - if (currentTool == UBStylusTool::Selector) - foreach (QGraphicsItem *item, items(bandRect)) { + bandRect = bandRect.normalized(); - if (item->type() == UBGraphicsW3CWidgetItem::Type - || item->type() == UBGraphicsPixmapItem::Type - || item->type() == UBGraphicsMediaItem::Type - || item->type() == UBGraphicsSvgItem::Type - || item->type() == UBGraphicsTextItem::Type - || item->type() == UBGraphicsStrokesGroup::Type - || item->type() == UBGraphicsGroupContainerItem::Type) { + mUBRubberBand->setGeometry(bandRect); - if (!mJustSelectedItems.contains(item)) { - item->setSelected(true); - mJustSelectedItems.insert(item); + QList rubberItems = items(bandRect); + foreach (QGraphicsItem *item, mJustSelectedItems) { + if (!rubberItems.contains(item)) { + item->setSelected(false); + mJustSelectedItems.remove(item); } } + + if (currentTool == UBStylusTool::Selector) + foreach (QGraphicsItem *item, items(bandRect)) { + + if (item->type() == UBGraphicsW3CWidgetItem::Type + || item->type() == UBGraphicsPixmapItem::Type + || item->type() == UBGraphicsMediaItem::Type + || item->type() == UBGraphicsSvgItem::Type + || item->type() == UBGraphicsTextItem::Type + || item->type() == UBGraphicsStrokesGroup::Type + || item->type() == UBGraphicsGroupContainerItem::Type) { + + if (!mJustSelectedItems.contains(item)) { + item->setSelected(true); + mJustSelectedItems.insert(item); + } + } + } } } @@ -1102,7 +1122,8 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event) } else { - if (QGraphicsSvgItem::Type != movingItem->type() && + if (isUBItem(movingItem) && + QGraphicsSvgItem::Type != movingItem->type() && UBGraphicsDelegateFrame::Type != movingItem->type() && UBToolWidget::Type != movingItem->type() && UBGraphicsCache::Type != movingItem->type() && diff --git a/src/board/UBBoardView.h b/src/board/UBBoardView.h index 1aae71ba..5c486a30 100644 --- a/src/board/UBBoardView.h +++ b/src/board/UBBoardView.h @@ -57,6 +57,7 @@ class UBBoardView : public QGraphicsView protected: bool itemIsLocked(QGraphicsItem *item); + bool isUBItem(QGraphicsItem *item); // we should to determine items who is not UB and use general scene behavior for them. void handleItemsSelection(QGraphicsItem *item); bool itemShouldReceiveMousePressEvent(QGraphicsItem *item); bool itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item); @@ -153,6 +154,7 @@ class UBBoardView : public QGraphicsView bool mIsDragInProgress; bool mMultipleSelectionIsEnabled; bool isControl; + bool mRubberBandInPlayMode; static bool hasSelectedParents(QGraphicsItem * item); diff --git a/src/board/UBFeaturesController.cpp b/src/board/UBFeaturesController.cpp index b13b7312..6c777e73 100644 --- a/src/board/UBFeaturesController.cpp +++ b/src/board/UBFeaturesController.cpp @@ -20,10 +20,22 @@ #include "gui/UBFeaturesWidget.h" const QString UBFeaturesController::virtualRootName = "root"; +const QString UBFeaturesController::rootPath = "/" + virtualRootName; + +const QString UBFeaturesController::appPath = rootPath + "/Applications"; +const QString UBFeaturesController::audiosPath = rootPath + "/Audios"; +const QString UBFeaturesController::moviesPath = rootPath + "/Movies"; +const QString UBFeaturesController::picturesPath = rootPath + "/Pictures"; +const QString UBFeaturesController::flashPath = rootPath + "/Animations"; +const QString UBFeaturesController::interactPath = rootPath + "/Interactivities"; +const QString UBFeaturesController::shapesPath = rootPath + "/Shapes"; +const QString UBFeaturesController::trashPath = rootPath + "/Trash"; +const QString UBFeaturesController::favoritePath = rootPath + "/Favorites"; +const QString UBFeaturesController::webSearchPath = rootPath + "/Web search"; + void UBFeaturesComputingThread::scanFS(const QUrl & currentPath, const QString & currVirtualPath, const QSet &pFavoriteSet) { - Q_ASSERT(QFileInfo(currentPath.toLocalFile()).exists()); QFileInfoList fileInfoList = UBFileSystemUtils::allElementsInDirectory(currentPath.toLocalFile()); @@ -43,7 +55,7 @@ void UBFeaturesComputingThread::scanFS(const QUrl & currentPath, const QString & if ( fullFileName.contains(".thumbnail.")) continue; - UBFeature testFeature(currVirtualPath, icon, fileName, QUrl::fromLocalFile(fullFileName), featureType); + UBFeature testFeature(currVirtualPath + "/" + fileName, icon, fileName, QUrl::fromLocalFile(fullFileName), featureType); emit sendFeature(testFeature); emit featureSent(); @@ -51,7 +63,7 @@ void UBFeaturesComputingThread::scanFS(const QUrl & currentPath, const QString & if ( pFavoriteSet.find(QUrl::fromLocalFile(fullFileName)) != pFavoriteSet.end()) { //TODO send favoritePath from the controller or make favoritePath public and static - emit sendFeature(UBFeature( "/root/Favorites", icon, fileName, QUrl::fromLocalFile(fullFileName), featureType)); + emit sendFeature(UBFeature( UBFeaturesController::favoritePath + "/" + fileName, icon, fileName, QUrl::fromLocalFile(fullFileName), featureType)); } if (featureType == FEATURE_FOLDER) { @@ -60,16 +72,16 @@ void UBFeaturesComputingThread::scanFS(const QUrl & currentPath, const QString & } } -void UBFeaturesComputingThread::scanAll(QList > pScanningData, const QSet &pFavoriteSet) +void UBFeaturesComputingThread::scanAll(QList > pScanningData, const QSet &pFavoriteSet) { for (int i = 0; i < pScanningData.count(); i++) { if (abort) { return; } - QPair curPair = pScanningData.at(i); + QPair curPair = pScanningData.at(i); - emit scanCategory(UBFeaturesController::categoryNameForVirtualPath(curPair.second)); - scanFS(curPair.first, curPair.second, pFavoriteSet); + emit scanCategory(curPair.second.getDisplayName()); + scanFS(curPair.first, curPair.second.getFullVirtualPath(), pFavoriteSet); } } @@ -96,11 +108,11 @@ int UBFeaturesComputingThread::featuresCount(const QUrl &pPath) return noItems; } -int UBFeaturesComputingThread::featuresCountAll(QList > pScanningData) +int UBFeaturesComputingThread::featuresCountAll(QList > pScanningData) { int noItems = 0; for (int i = 0; i < pScanningData.count(); i++) { - QPair curPair = pScanningData.at(i); + QPair curPair = pScanningData.at(i); noItems += featuresCount(curPair.first); } @@ -114,7 +126,7 @@ QThread(parent) abort = false; } -void UBFeaturesComputingThread::compute(const QList > &pScanningData, QSet *pFavoritesSet) +void UBFeaturesComputingThread::compute(const QList > &pScanningData, QSet *pFavoritesSet) { QMutexLocker curLocker(&mMutex); @@ -135,7 +147,7 @@ void UBFeaturesComputingThread::run() qDebug() << "Custom thread started execution"; mMutex.lock(); - QList > searchData = mScanningData; + QList > searchData = mScanningData; QSet favoriteSet = mFavoriteSet; mMutex.unlock(); @@ -182,14 +194,42 @@ UBFeaturesComputingThread::~UBFeaturesComputingThread() } UBFeature::UBFeature(const QString &url, const QImage &icon, const QString &name, const QUrl &realPath, UBFeatureElementType type) -: virtualDir(url), mThumbnail(icon), mName(name), mPath(realPath), elementType(type) + : mThumbnail(icon), mDisplayName(name), mPath(realPath), elementType(type) { + mName = getNameFromVirtualPath(url); + virtualDir = getVirtualDirFromVirtualPath(url); } UBFeature::~UBFeature() { } +QString UBFeature::getNameFromVirtualPath(const QString &pVirtPath) +{ + QString result; + int slashPos = pVirtPath.lastIndexOf("/"); + if (slashPos != -1) { + result = pVirtPath.right(pVirtPath.count() - slashPos - 1); + } else { + qDebug() << "UBFeature: incorrect virtual path parameter specified"; + } + + return result; +} + +QString UBFeature::getVirtualDirFromVirtualPath(const QString &pVirtPath) +{ + QString result; + int slashPos = pVirtPath.lastIndexOf("/"); + if (slashPos != -1) { + result = pVirtPath.left(slashPos); + } else { + qDebug() << "UBFeature: incorrect virtual path parameter specified"; + } + + return result; +} + QString UBFeature::getUrl() const { if ( elementType == FEATURE_INTERNAL ) @@ -233,20 +273,6 @@ UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) : ,featuresList(0) ,mLastItemOffsetIndex(0) { - //Initializing virtual structure of the list - rootPath = "/" + virtualRootName; - - appPath = rootPath + "/Applications"; - audiosPath = rootPath + "/Audios"; - moviesPath = rootPath + "/Movies"; - picturesPath = rootPath + "/Pictures"; - flashPath = rootPath + "/Animations"; - interactPath = rootPath + "/Interactivities"; - shapesPath = rootPath + "/Shapes"; - trashPath = rootPath + "/Trash"; - favoritePath = rootPath + "/Favorites"; - webSearchPath = rootPath + "/Web search"; - //Initializing physical directories from UBSettings mUserAudioDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->userAudioDirectory()); mUserVideoDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->userVideoDirectory()); @@ -264,18 +290,18 @@ UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) : mLibSearchDirectoryPath =QUrl::fromLocalFile(UBSettings::settings()->userSearchDirectory()); trashDirectoryPath = QUrl::fromLocalFile(UBSettings::userTrashDirPath()); - rootElement = UBFeature(QString(), QImage( ":images/libpalette/home.png" ), "root", QUrl()); - 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); + rootElement = UBFeature(rootPath, QImage( ":images/libpalette/home.png" ), "root", QUrl()); + audiosElement = UBFeature( audiosPath, QImage(":images/libpalette/AudiosCategory.svg"), tr("Audios") , mUserAudioDirectoryPath, FEATURE_CATEGORY); + moviesElement = UBFeature( moviesPath, QImage(":images/libpalette/MoviesCategory.svg"), tr("Movies") , mUserVideoDirectoryPath, FEATURE_CATEGORY); + picturesElement = UBFeature( picturesPath, QImage(":images/libpalette/PicturesCategory.svg"), tr("Pictures") , mUserPicturesDirectoryPath, FEATURE_CATEGORY); + flashElement = UBFeature( flashPath, QImage(":images/libpalette/FlashCategory.svg"), tr("Animations") , mUserAnimationDirectoryPath, FEATURE_CATEGORY); + interactElement = UBFeature( interactPath, QImage(":images/libpalette/InteractivesCategory.svg"), tr("Interactivities") , mLibInteractiveDirectoryPath, FEATURE_CATEGORY); + applicationsElement = UBFeature( appPath, QImage(":images/libpalette/ApplicationsCategory.svg"), tr("Applications") , mUserInteractiveDirectoryPath, FEATURE_CATEGORY); + shapesElement = UBFeature( shapesPath, QImage(":images/libpalette/ShapesCategory.svg"), tr("Shapes") , mLibShapesDirectoryPath, FEATURE_CATEGORY ); + favoriteElement = UBFeature( favoritePath, QImage(":images/libpalette/FavoritesCategory.svg"), tr("Favorites"), QUrl("favorites"), FEATURE_FAVORITE ); + webSearchElement = UBFeature( webSearchPath, QImage(":images/libpalette/WebSearchCategory.svg"), tr("Web search"), mLibSearchDirectoryPath, FEATURE_CATEGORY); - trashElement = UBFeature( rootPath, QImage(":images/libpalette/TrashCategory.svg"), tr("Trash"), trashDirectoryPath, FEATURE_TRASH ); + trashElement = UBFeature( trashPath, QImage(":images/libpalette/TrashCategory.svg"), tr("Trash"), trashDirectoryPath, FEATURE_TRASH); featuresList = new QList (); @@ -312,24 +338,24 @@ UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) : void UBFeaturesController::startThread() { - QList > computingData; + QList > computingData; - computingData << QPair(mLibAudiosDirectoryPath, audiosPath) - << QPair(mLibVideosDirectoryPath, moviesPath) - << QPair(mLibAnimationsDirectoryPath, flashPath) - << QPair(mLibPicturesDirectoryPath, picturesPath) + computingData << QPair(mLibAudiosDirectoryPath, audiosElement) + << QPair(mLibVideosDirectoryPath, moviesElement) + << QPair(mLibAnimationsDirectoryPath, flashElement) + << QPair(mLibPicturesDirectoryPath, picturesElement) - << QPair(mUserInteractiveDirectoryPath, appPath) - << QPair(mUserAudioDirectoryPath, audiosPath) - << QPair(mUserPicturesDirectoryPath, picturesPath) - << QPair(mUserVideoDirectoryPath, moviesPath) - << QPair(mUserAnimationDirectoryPath, flashPath) + << QPair(mUserInteractiveDirectoryPath, applicationsElement) + << QPair(mUserAudioDirectoryPath, audiosElement) + << QPair(mUserPicturesDirectoryPath, picturesElement) + << QPair(mUserVideoDirectoryPath, moviesElement) + << QPair(mUserAnimationDirectoryPath, flashElement) - << QPair(mLibApplicationsDirectoryPath, appPath) - << QPair(mLibShapesDirectoryPath, shapesPath) - << QPair(mLibInteractiveDirectoryPath, interactPath) - << QPair(trashDirectoryPath, trashPath) - << QPair(mLibSearchDirectoryPath, rootPath + "/" + "Web search"); + << QPair(mLibApplicationsDirectoryPath, applicationsElement) + << QPair(mLibShapesDirectoryPath, shapesElement) + << QPair(mLibInteractiveDirectoryPath, interactElement) + << QPair(trashDirectoryPath, trashElement) + << QPair(mLibSearchDirectoryPath, webSearchElement); mCThread.compute(computingData, favoriteSet); } @@ -340,7 +366,7 @@ void UBFeaturesController::createNpApiFeature(const QString &str) QString widgetName = QFileInfo(str).fileName(); - featuresModel->addItem(UBFeature(QString(appPath+"/Web"), QImage(UBGraphicsWidgetItem::iconFilePath(QUrl::fromLocalFile(str))), widgetName, QUrl::fromLocalFile(str), FEATURE_INTERACTIVE)); + featuresModel->addItem(UBFeature(QString(appPath + "/Web/" + widgetName), QImage(UBGraphicsWidgetItem::iconFilePath(QUrl::fromLocalFile(str))), widgetName, QUrl::fromLocalFile(str), FEATURE_INTERACTIVE)); } void UBFeaturesController::scanFS() @@ -365,9 +391,9 @@ void UBFeaturesController::scanFS() QList tools = UBToolsManager::manager()->allTools(); foreach (UBToolsManager::UBToolDescriptor tool, tools) { - featuresList->append(UBFeature(appPath, tool.icon.toImage(), tool.label, QUrl(tool.id), FEATURE_INTERNAL)); + featuresList->append(UBFeature(appPath + "/" + tool.label, tool.icon.toImage(), tool.label, QUrl(tool.id), FEATURE_INTERNAL)); if (favoriteSet->find(QUrl(tool.id)) != favoriteSet->end()) { - featuresList->append(UBFeature(favoritePath, tool.icon.toImage(), tool.label, QUrl(tool.id), FEATURE_INTERNAL)); + featuresList->append(UBFeature(favoritePath + "/" + tool.label, tool.icon.toImage(), tool.label, QUrl(tool.id), FEATURE_INTERNAL)); } } } @@ -386,12 +412,12 @@ void UBFeaturesController::fileSystemScan(const QUrl & currentPath, const QStrin if ( fullFileName.contains(".thumbnail.")) continue; - UBFeature testFeature(currVirtualPath, icon, fileName, QUrl::fromLocalFile(fullFileName), featureType); + UBFeature testFeature(currVirtualPath + "/" + fileName, icon, fileName, QUrl::fromLocalFile(fullFileName), featureType); featuresList->append(testFeature); if ( favoriteSet->find( QUrl::fromLocalFile( fullFileName ) ) != favoriteSet->end() ) { - featuresList->append( UBFeature( favoritePath, icon, fileName, QUrl::fromLocalFile( fullFileName ), featureType ) ); + featuresList->append( UBFeature( favoritePath + "/" + fileName, icon, fileName, QUrl::fromLocalFile( fullFileName ), featureType ) ); } if (featureType == FEATURE_FOLDER) { @@ -466,7 +492,7 @@ void UBFeaturesController::addToFavorite( const QUrl &path ) QFileInfo fileInfo( filePath ); QString fileName = fileInfo.fileName(); UBFeatureElementType type = fileTypeFromUrl(fileInfo.absoluteFilePath()); - UBFeature elem(favoritePath, getIcon(filePath, type), fileName, path, fileTypeFromUrl(filePath) ); + UBFeature elem(favoritePath + "/" + fileName, getIcon(filePath, type), fileName, path, fileTypeFromUrl(filePath) ); favoriteSet->insert( path ); saveFavoriteList(); @@ -631,7 +657,7 @@ void UBFeaturesController::importImage( const QImage &image, const UBFeature &de image.save(filePath); QImage thumb = createThumbnail( filePath ); - UBFeature resultItem = UBFeature( dest.getFullVirtualPath(), thumb, mFileName, + UBFeature resultItem = UBFeature( dest.getFullVirtualPath() + "/" + mFileName, thumb, mFileName, QUrl::fromLocalFile( filePath ), FEATURE_ITEM ); featuresModel->addItem(resultItem); @@ -671,10 +697,10 @@ void UBFeaturesController::addNewFolder(QString name) if(!QFileInfo(path).exists()) { QDir().mkpath(path); } - UBFeature newFeatureFolder = UBFeature( currentElement.getFullVirtualPath(), QImage(":images/libpalette/folder.svg"), + UBFeature newFeatureFolder = UBFeature( currentElement.getFullVirtualPath() + "/" + name, QImage(":images/libpalette/folder.svg"), name, QUrl::fromLocalFile( path ), FEATURE_FOLDER ); - featuresModel->addItem( newFeatureFolder ); + featuresModel->addItem(newFeatureFolder); featuresProxyModel->invalidate(); } @@ -710,9 +736,9 @@ UBFeature UBFeaturesController::getDestinationFeatureForUrl( const QUrl &url ) void UBFeaturesController::addDownloadedFile(const QUrl &sourceUrl, const QByteArray &pData) { - UBFeature dest = getDestinationFeatureForUrl( sourceUrl ); + UBFeature dest = getDestinationFeatureForUrl(sourceUrl); - if ( dest == UBFeature() ) + if (dest == UBFeature()) return; QString fileName = QFileInfo( sourceUrl.toString() ).fileName(); @@ -724,7 +750,7 @@ void UBFeaturesController::addDownloadedFile(const QUrl &sourceUrl, const QByteA file.write(pData); file.close(); - UBFeature downloadedFeature = UBFeature( dest.getFullVirtualPath(), getIcon( filePath ), + UBFeature downloadedFeature = UBFeature(dest.getFullVirtualPath() + "/" + fileName, getIcon( filePath ), fileName, QUrl::fromLocalFile(filePath), FEATURE_ITEM); if (downloadedFeature != UBFeature()) { featuresModel->addItem(downloadedFeature); @@ -742,7 +768,7 @@ UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeatu Q_ASSERT( QFileInfo( sourcePath ).exists() ); - UBFeature possibleDest = getDestinationFeatureForUrl( url ); + UBFeature possibleDest = getDestinationFeatureForUrl(url); UBFeature dest = destination; @@ -767,7 +793,7 @@ UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeatu UBFeatureElementType type = FEATURE_ITEM; if ( UBFileSystemUtils::mimeTypeFromFileName( newFullPath ).contains("application") ) type = FEATURE_INTERACTIVE; - UBFeature newElement( destVirtualPath, thumb, name, QUrl::fromLocalFile( newFullPath ), type ); + UBFeature newElement( destVirtualPath + "/" + name, thumb, name, QUrl::fromLocalFile( newFullPath ), type ); return newElement; } @@ -861,7 +887,7 @@ UBFeature UBFeaturesController::copyItemToFolder( const QUrl &url, const UBFeatu UBFeatureElementType type = FEATURE_ITEM; if (UBFileSystemUtils::mimeTypeFromFileName(newFullPath).contains("application")) type = FEATURE_INTERACTIVE; - UBFeature newElement( destVirtualPath, thumb, name, QUrl::fromLocalFile( newFullPath ), type ); + UBFeature newElement( destVirtualPath + "/" + name, thumb, name, QUrl::fromLocalFile( newFullPath ), type ); return newElement; } @@ -899,7 +925,7 @@ void UBFeaturesController::moveExternalData(const QUrl &url, const UBFeature &de Q_ASSERT(QFileInfo(newFullPath).exists()); QImage thumb = getIcon(newFullPath, type); - UBFeature newElement(destVirtualPath, thumb, name, QUrl::fromLocalFile(newFullPath), type); + UBFeature newElement(destVirtualPath + "/" + name, thumb, name, QUrl::fromLocalFile(newFullPath), type); featuresModel->addItem(newElement); } diff --git a/src/board/UBFeaturesController.h b/src/board/UBFeaturesController.h index 6d57e5d4..b48f3d62 100644 --- a/src/board/UBFeaturesController.h +++ b/src/board/UBFeaturesController.h @@ -33,7 +33,7 @@ class UBFeaturesComputingThread : public QThread public: explicit UBFeaturesComputingThread(QObject *parent = 0); virtual ~UBFeaturesComputingThread(); - void compute(const QList > &pScanningData, QSet *pFavoritesSet); + void compute(const QList > &pScanningData, QSet *pFavoritesSet); protected: void run(); @@ -51,16 +51,16 @@ public slots: private: void scanFS(const QUrl & currentPath, const QString & currVirtualPath, const QSet &pFavoriteSet); - void scanAll(QList > pScanningData, const QSet &pFavoriteSet); + void scanAll(QList > pScanningData, const QSet &pFavoriteSet); int featuresCount(const QUrl &pPath); - int featuresCountAll(QList > pScanningData); + int featuresCountAll(QList > pScanningData); private: QMutex mMutex; QWaitCondition mWaitCondition; QUrl mScanningPath; QString mScanningVirtualPath; - QList > mScanningData; + QList > mScanningData; QSet mFavoriteSet; bool restart; bool abort; @@ -94,6 +94,7 @@ public: // UBFeature(); virtual ~UBFeature(); QString getName() const { return mName; } + QString getDisplayName() const {return mDisplayName;} QImage getThumbnail() const {return mThumbnail;} QString getVirtualPath() const { return virtualDir; } //QString getPath() const { return mPath; }; @@ -112,11 +113,17 @@ public: const QMap & getMetadata() const { return metadata; } void setMetadata( const QMap &data ) { metadata = data; } + +private: + QString getNameFromVirtualPath(const QString &pVirtPath); + QString getVirtualDirFromVirtualPath(const QString &pVirtPath); + private: QString virtualDir; QString virtualPath; QImage mThumbnail; QString mName; + QString mDisplayName; QUrl mPath; UBFeatureElementType elementType; QMap metadata; @@ -182,6 +189,19 @@ public: void assignFeaturesListVeiw(UBFeaturesListView *pList); void assignPathListView(UBFeaturesListView *pList); +public: + static const QString rootPath; + static const QString audiosPath; + static const QString moviesPath; + static const QString picturesPath; + static const QString appPath; + static const QString flashPath; + static const QString shapesPath; + static const QString interactPath; + static const QString trashPath; + static const QString favoritePath; + static const QString webSearchPath; + signals: void maxFilesCountEvaluated(int pLimit); void scanStarted(); @@ -235,17 +255,7 @@ private: QUrl trashDirectoryPath; QUrl mLibSearchDirectoryPath; - QString rootPath; - QString audiosPath; - QString moviesPath; - QString picturesPath; - QString appPath; - QString flashPath; - QString shapesPath; - QString interactPath; - QString trashPath; - QString favoritePath; - QString webSearchPath; + int mLastItemOffsetIndex; UBFeature currentElement; diff --git a/src/core/UBApplication.cpp b/src/core/UBApplication.cpp index 75591e73..d3aed832 100644 --- a/src/core/UBApplication.cpp +++ b/src/core/UBApplication.cpp @@ -233,7 +233,7 @@ void UBApplication::setupTranslator(QString forcedLanguage) mApplicationTranslator = new QTranslator(this); mQtGuiTranslator = new QTranslator(this); - mApplicationTranslator->load(UBPlatformUtils::translationPath(QString("sankore_"),language)); + mApplicationTranslator->load(UBPlatformUtils::translationPath(QString("sankore_"),language)); installTranslator(mApplicationTranslator); diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 16b1cf69..e86dca46 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -66,8 +66,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) , mDesktopStylusTool(UBDrawingController::drawingController()->stylusTool()) { - mTransparentDrawingView = new UBBoardView(UBApplication::boardController, static_cast(NULL), true); // deleted in UBDesktopAnnotationController::destructor - + mTransparentDrawingView = new UBBoardView(UBApplication::boardController, static_cast(0), true); // deleted in UBDesktopAnnotationController::destructor mTransparentDrawingView->setAttribute(Qt::WA_TranslucentBackground, true); #ifdef Q_WS_MAC mTransparentDrawingView->setAttribute(Qt::WA_MacNoShadow, true); @@ -87,7 +86,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) mTransparentDrawingView->setScene(mTransparentDrawingScene); mTransparentDrawingScene->setDrawingMode(true); - mDesktopPalette = new UBDesktopPalette(mTransparentDrawingView); + mDesktopPalette = new UBDesktopPalette(NULL); // FIX #633: The palette must be 'floating' in order to stay on top of the library palette if (UBPlatformUtils::hasVirtualKeyboard()) { @@ -102,9 +101,15 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) } connect(mDesktopPalette, SIGNAL(uniboardClick()), this, SLOT(goToUniboard())); + connect(mDesktopPalette, SIGNAL(uniboardClick()), this, SLOT(onToolClicked())); connect(mDesktopPalette, SIGNAL(customClick()), this, SLOT(customCapture())); + connect(mDesktopPalette, SIGNAL(customClick()), this, SLOT(onToolClicked())); connect(mDesktopPalette, SIGNAL(windowClick()), this, SLOT(windowCapture())); + connect(mDesktopPalette, SIGNAL(windowClick()), this, SLOT(onToolClicked())); connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(screenCapture())); + connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(onToolClicked())); + connect(UBApplication::mainWindow->actionPointer, SIGNAL(triggered()), this, SLOT(onToolClicked())); + connect(UBApplication::mainWindow->actionSelector, SIGNAL(triggered()), this, SLOT(onToolClicked())); connect(mDesktopPalette, SIGNAL(maximized()), this, SLOT(onDesktopPaletteMaximized())); connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), this, SLOT(onDesktopPaletteMinimize())); @@ -114,13 +119,13 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) connect(UBDrawingController::drawingController(), SIGNAL(stylusToolChanged(int)), this, SLOT(stylusToolChanged(int))); // Add the desktop associated palettes - mDesktopPenPalette = new UBDesktopPenPalette(mTransparentDrawingView); + mDesktopPenPalette = new UBDesktopPenPalette(NULL); // FIX #633: The palette must be 'floating' in order to stay on top of the library palette connect(mDesktopPalette, SIGNAL(maximized()), mDesktopPenPalette, SLOT(onParentMaximized())); connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), mDesktopPenPalette, SLOT(onParentMinimized())); - mDesktopMarkerPalette = new UBDesktopMarkerPalette(mTransparentDrawingView); - mDesktopEraserPalette = new UBDesktopEraserPalette(mTransparentDrawingView); + mDesktopMarkerPalette = new UBDesktopMarkerPalette(NULL); // FIX #633: The palette must be 'floating' in order to stay on top of the library palette + mDesktopEraserPalette = new UBDesktopEraserPalette(NULL); // FIX #633: The palette must be 'floating' in order to stay on top of the library palette mDesktopPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor); mDesktopPenPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor); @@ -149,6 +154,12 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) connect(UBApplication::boardController->paletteManager()->rightPalette(), SIGNAL(resized()), this, SLOT(refreshMask())); #endif onDesktopPaletteMaximized(); + + // FIX #633: Ensure that these palettes stay on top of the other elements + mDesktopEraserPalette->raise(); + mDesktopMarkerPalette->raise(); + mDesktopPenPalette->raise(); + mDesktopPalette->raise(); } UBDesktopAnnotationController::~UBDesktopAnnotationController() @@ -238,11 +249,7 @@ void UBDesktopAnnotationController::setAssociatedPalettePosition(UBActionPalette if(act->objectName() == actionName) { int iAction = actions.indexOf(act); - yPen = iAction * mDesktopPalette->buttonSize().height(); - - // Add the borders - yPen += (iAction) * (mDesktopPalette->border() + 4); // 4 has been set after some experiment. We must determine why this value is good - + yPen = iAction * (mDesktopPalette->buttonSize().height() + 2 * mDesktopPalette->border() +6); // This is the mysterious value (6) break; } } @@ -382,6 +389,7 @@ void UBDesktopAnnotationController::hideWindow() void UBDesktopAnnotationController::goToUniboard() { + onToolClicked(); hideWindow(); UBPlatformUtils::setDesktopMode(false); @@ -397,6 +405,7 @@ void UBDesktopAnnotationController::goToUniboard() void UBDesktopAnnotationController::customCapture() { + onToolClicked(); mIsFullyTransparent = true; updateBackground(); @@ -424,6 +433,7 @@ void UBDesktopAnnotationController::customCapture() void UBDesktopAnnotationController::windowCapture() { + onToolClicked(); mIsFullyTransparent = true; updateBackground(); @@ -453,6 +463,7 @@ void UBDesktopAnnotationController::windowCapture() void UBDesktopAnnotationController::screenCapture() { + onToolClicked(); mIsFullyTransparent = true; updateBackground(); @@ -539,7 +550,6 @@ void UBDesktopAnnotationController::penActionPressed() */ void UBDesktopAnnotationController::penActionReleased() { - qDebug() << "penActionReleased()"; mHoldTimerPen.stop(); if(mPendingPenButtonPressed) { @@ -594,7 +604,6 @@ void UBDesktopAnnotationController::eraserActionPressed() */ void UBDesktopAnnotationController::eraserActionReleased() { - qDebug() << "eraserActionReleased()"; mHoldTimerEraser.stop(); if(mPendingEraserButtonPressed) { @@ -651,7 +660,6 @@ void UBDesktopAnnotationController::markerActionPressed() */ void UBDesktopAnnotationController::markerActionReleased() { - qDebug() << "markerActionReleased()"; mHoldTimerMarker.stop(); if(mPendingMarkerButtonPressed) { @@ -930,3 +938,9 @@ void UBDesktopAnnotationController::refreshMask() updateMask(true); } } + +void UBDesktopAnnotationController::onToolClicked(){ + mDesktopEraserPalette->hide(); + mDesktopMarkerPalette->hide(); + mDesktopPenPalette->hide(); +} diff --git a/src/desktop/UBDesktopAnnotationController.h b/src/desktop/UBDesktopAnnotationController.h index 207db94b..c98b2466 100644 --- a/src/desktop/UBDesktopAnnotationController.h +++ b/src/desktop/UBDesktopAnnotationController.h @@ -111,6 +111,7 @@ class UBDesktopAnnotationController : public QObject void onDesktopPaletteMinimize(); void onTransparentWidgetResized(); void refreshMask(); + void onToolClicked(); private: void setAssociatedPalettePosition(UBActionPalette* palette, const QString& actionName); diff --git a/src/gui/UBFeaturesWidget.cpp b/src/gui/UBFeaturesWidget.cpp index 78b4725e..ee052027 100644 --- a/src/gui/UBFeaturesWidget.cpp +++ b/src/gui/UBFeaturesWidget.cpp @@ -259,7 +259,7 @@ void UBFeaturesWidget::onDisplayMetadata( QMap metadata ) }break; } - UBFeature feature( QString(), QImage(previewImageUrl), QString(), metadata["Url"], FEATURE_ITEM ); + UBFeature feature( "/root", QImage(previewImageUrl), QString(), metadata["Url"], FEATURE_ITEM ); feature.setMetadata( metadata ); centralWidget->showElement(feature, UBFeaturesCentralWidget::FeaturePropertiesList); @@ -676,7 +676,7 @@ UBFeaturesProgressInfo::UBFeaturesProgressInfo(QWidget *parent) : void UBFeaturesProgressInfo::setCommmonInfoText(const QString &str) { - mProgressBar->setFormat(str + tr(" load") + "(%p%)"); + mProgressBar->setFormat(tr("Loading ") + str + " (%p%)"); } void UBFeaturesProgressInfo::setDetailedInfoText(const QString &str) @@ -1080,7 +1080,7 @@ QVariant UBFeaturesModel::data(const QModelIndex &index, int role) const return QVariant(); if (role == Qt::DisplayRole) { - return featuresList->at(index.row()).getName(); + return featuresList->at(index.row()).getDisplayName(); } else if (role == Qt::DecorationRole) { @@ -1311,7 +1311,7 @@ void UBFeaturesModel::moveData(const UBFeature &source, const UBFeature &destina } } - UBFeature newElement( destVirtualPath, sourceIcon, name, QUrl::fromLocalFile(destFullPath), sourceType ); + UBFeature newElement( destVirtualPath + "/" + name, sourceIcon, name, QUrl::fromLocalFile(destFullPath), sourceType ); addItem(newElement); if (deleteManualy) { diff --git a/src/gui/UBPropertyPalette.cpp b/src/gui/UBPropertyPalette.cpp index 8d587c99..643f87a7 100644 --- a/src/gui/UBPropertyPalette.cpp +++ b/src/gui/UBPropertyPalette.cpp @@ -25,6 +25,7 @@ UBPropertyPalette::UBPropertyPalette(QWidget *parent, const char *name):UBAction { setObjectName(name); mbGrip = false; + setMaximumHeight(MAX_HEIGHT); } /** @@ -35,6 +36,7 @@ UBPropertyPalette::UBPropertyPalette(QWidget *parent, const char *name):UBAction UBPropertyPalette::UBPropertyPalette(Qt::Orientation orientation, QWidget *parent):UBActionPalette(orientation, parent) { mbGrip = false; + setMaximumHeight(MAX_HEIGHT); } /** diff --git a/src/gui/UBPropertyPalette.h b/src/gui/UBPropertyPalette.h index 777e976e..47bacf13 100644 --- a/src/gui/UBPropertyPalette.h +++ b/src/gui/UBPropertyPalette.h @@ -20,6 +20,8 @@ #include "UBActionPalette.h" +#define MAX_HEIGHT 20 + class UBPropertyPalette : public UBActionPalette { Q_OBJECT diff --git a/src/gui/UBTeacherGuideWidget.cpp b/src/gui/UBTeacherGuideWidget.cpp index 7de10dbf..ca73ec76 100644 --- a/src/gui/UBTeacherGuideWidget.cpp +++ b/src/gui/UBTeacherGuideWidget.cpp @@ -685,6 +685,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons mpSessionTitle = new UBTGAdaptableText(0, this, "UBTGSessionTitle"); mpSessionTitle->setPlaceHolderText(tr("Type session title here ...")); mpButtonTitleLayout->addWidget(mpSessionTitle); + connect(this, SIGNAL(resized()), mpSessionTitle, SLOT(onTextChanged())); mpLayout->addLayout(mpButtonTitleLayout); @@ -703,6 +704,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons mpAuthors->setObjectName("UBTGZeroPageInputText"); mpAuthors->setPlaceHolderText(tr("Type authors here ...")); mpLayout->addWidget(mpAuthors); + connect(this, SIGNAL(resized()), mpAuthors, SLOT(onTextChanged())); mpCreationLabel = new QLabel(this); mpCreationLabel->setObjectName("UBTGZeroPageDateLabel"); @@ -727,6 +729,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons mpObjectives->setObjectName("UBTGZeroPageInputText"); mpObjectives->setPlaceHolderText(tr("Type objectives here...")); mpLayout->addWidget(mpObjectives); + connect(this, SIGNAL(resized()), mpObjectives, SLOT(onTextChanged())); mpSeparatorObjectives = new QFrame(this); mpSeparatorObjectives->setFixedHeight(UBTG_SEPARATOR_FIXED_HEIGHT); @@ -747,6 +750,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons mpKeywords = new UBTGAdaptableText(0, this); mpKeywords->setPlaceHolderText(tr("Type keywords here ...")); mpLayout->addWidget(mpKeywords); + connect(this, SIGNAL(resized()), mpKeywords, SLOT(onTextChanged())); mpSchoolLevelItemLabel = new QLabel(this); mpSchoolLevelItemLabel->setObjectName("UBTGZeroPageItemLabel"); @@ -1122,6 +1126,12 @@ bool UBTeacherGuidePageZeroWidget::isModified() return result; } +void UBTeacherGuidePageZeroWidget::resizeEvent(QResizeEvent* ev){ + emit resized(); + + QWidget::resizeEvent(ev); +} + /*************************************************************************** * class UBTeacherGuideWidget * ***************************************************************************/ @@ -1238,3 +1248,4 @@ bool UBTeacherGuideWidget::isModified() else return mpEditionWidget->isModified(); } + diff --git a/src/gui/UBTeacherGuideWidget.h b/src/gui/UBTeacherGuideWidget.h index 1d165f13..a970807e 100644 --- a/src/gui/UBTeacherGuideWidget.h +++ b/src/gui/UBTeacherGuideWidget.h @@ -136,11 +136,16 @@ public: QVector getData(); bool isModified(); +signals: + void resized(); public slots: void onActiveSceneChanged(); void switchToMode(tUBTGZeroPageMode mode = tUBTGZeroPageMode_EDITION); +protected: + void resizeEvent(QResizeEvent* ev); + private: void fillComboBoxes(); void loadData(); diff --git a/src/gui/UBTeacherGuideWidgetsTools.cpp b/src/gui/UBTeacherGuideWidgetsTools.cpp index d9c88efd..6300c65b 100644 --- a/src/gui/UBTeacherGuideWidgetsTools.cpp +++ b/src/gui/UBTeacherGuideWidgetsTools.cpp @@ -174,6 +174,7 @@ void UBTGAdaptableText::showEvent(QShowEvent* e) if(!mIsUpdatingSize && mHasPlaceHolder && toPlainText().isEmpty()) setPlainText(mPlaceHolderText); else + // If the teacherguide is collapsed, don't updated the size. Or set the size as the expanded size onTextChanged(); } @@ -188,9 +189,12 @@ QString UBTGAdaptableText::text() void UBTGAdaptableText::onTextChanged() { + //qDebug() << ">> onTextChanged CALLED!"; qreal documentSize = document()->size().height(); - if(height() == documentSize + mBottomMargin) - return; + //qDebug() << ">> documentSize: " << documentSize << ", height: " << height(); + if(height() == documentSize + mBottomMargin){ + return; + } mIsUpdatingSize = true; @@ -208,6 +212,7 @@ void UBTGAdaptableText::onTextChanged() setFocus(); } mIsUpdatingSize = false; + } void UBTGAdaptableText::setInitialText(const QString& text) { diff --git a/src/gui/UBThumbnailWidget.cpp b/src/gui/UBThumbnailWidget.cpp index 24f7442f..3057761b 100644 --- a/src/gui/UBThumbnailWidget.cpp +++ b/src/gui/UBThumbnailWidget.cpp @@ -12,11 +12,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ +#include #include #include #include "UBThumbnailWidget.h" #include "UBRubberBand.h" +#include "UBMainWindow.h" #include "board/UBBoardController.h" @@ -858,7 +860,9 @@ void UBSceneThumbnailNavigPixmap::updateButtonsState() void UBSceneThumbnailNavigPixmap::deletePage() { - UBApplication::boardController->deleteScene(sceneIndex()); + if(UBApplication::mainWindow->yesNoQuestion(QObject::tr("Remove Page"), QObject::tr("Are you sure you want to remove 1 page from the selected document '%0'?").arg(UBApplication::documentController->selectedDocument()->metaData(UBSettings::documentName).toString()))){ + UBApplication::boardController->deleteScene(sceneIndex()); + } } void UBSceneThumbnailNavigPixmap::duplicatePage() diff --git a/src/web/UBWebController.cpp b/src/web/UBWebController.cpp index ee69e3d3..9ad0861e 100644 --- a/src/web/UBWebController.cpp +++ b/src/web/UBWebController.cpp @@ -733,6 +733,7 @@ bool UBWebController::isEduMedia(const QUrl& pUrl) void UBWebController::loadUrl(const QUrl& url) { + bool webBrowserAlreadyInstanciated = dynamic_cast(mStackedWidget->widget(WebBrowser)) != NULL; UBApplication::applicationController->showInternet(); if (UBSettings::settings()->webUseExternalBrowser->get().toBool()) { @@ -740,8 +741,6 @@ void UBWebController::loadUrl(const QUrl& url) } else { - bool webBrowserAlreadyInstanciated = mStackedWidget->widget(WebBrowser) != NULL; - if (!webBrowserAlreadyInstanciated) { (*mCurrentWebBrowser)->loadUrl(url); } diff --git a/src/web/browser/WBBrowserWindow.cpp b/src/web/browser/WBBrowserWindow.cpp index 83d41992..cb89dd09 100644 --- a/src/web/browser/WBBrowserWindow.cpp +++ b/src/web/browser/WBBrowserWindow.cpp @@ -270,28 +270,6 @@ void WBBrowserWindow::setupToolBarForTutorial() if (tb && tb->menu()) tb->setMenu(NULL); } -// mTabWidget->addWebAction(mUniboardMainWindow->actionWebReload, QWebPage::Reload); -// mTabWidget->addWebAction(mUniboardMainWindow->actionStopLoading, QWebPage::Stop); - -// mWebToolBar->insertWidget(mUniboardMainWindow->actionWebBigger, mTabWidget->lineEditStack()); - -// mSearchToolBar = new WBToolbarSearch(mWebToolBar); - -// mSearchAction = mWebToolBar->insertWidget(mUniboardMainWindow->actionWebBigger, mSearchToolBar); - -// connect(mSearchToolBar, SIGNAL(search(const QUrl&)), SLOT(loadUrl(const QUrl&))); - -// mChaseWidget = new WBChaseWidget(this); -// mWebToolBar->insertWidget(mUniboardMainWindow->actionWebBigger, mChaseWidget); - -// mWebToolBar->insertSeparator(mUniboardMainWindow->actionWebBigger); - -// connect(mUniboardMainWindow->actionHome, SIGNAL(triggered()), this , SLOT(slotHome())); - -// connect(mUniboardMainWindow->actionBookmarks, SIGNAL(triggered()), this , SLOT(bookmarks())); -// connect(mUniboardMainWindow->actionAddBookmark, SIGNAL(triggered()), this , SLOT(addBookmark())); -// connect(mUniboardMainWindow->actionWebBigger, SIGNAL(triggered()), this , SLOT(slotViewZoomIn())); -// connect(mUniboardMainWindow->actionWebSmaller, SIGNAL(triggered()), this , SLOT(slotViewZoomOut())); mWebToolBar->show(); } @@ -662,4 +640,4 @@ void WBBrowserWindow::openActionUrl(QAction *action) history->goToItem(history->backItems(-1*offset).first()); else if (offset > 0) history->goToItem(history->forwardItems(history->count() - offset + 1).back()); - } \ No newline at end of file + }