From a41462f34716ae3e14864f13bc8007f44f5227a8 Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Tue, 28 Aug 2012 14:27:00 +0300 Subject: [PATCH 01/11] Fixed behavior for Tools and W3C_tools. Fixed creation of transparent drawing view. --- src/board/UBBoardView.cpp | 16 ++++++++++++++-- src/desktop/UBDesktopAnnotationController.cpp | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/board/UBBoardView.cpp b/src/board/UBBoardView.cpp index 483e955b..b90869eb 100644 --- a/src/board/UBBoardView.cpp +++ b/src/board/UBBoardView.cpp @@ -533,7 +533,12 @@ Here we determines cases when items should to get mouse press event at pressing return false; break; + case UBToolWidget::Type: + return true; + case QGraphicsWebView::Type: + return true; + case UBGraphicsWidgetItem::Type: if (currentTool == UBStylusTool::Selector && item->parentItem() && item->parentItem()->isSelected()) return true; @@ -541,10 +546,14 @@ Here we determines cases when items should to get mouse press event at pressing return true; if (currentTool == UBStylusTool::Play) return true; + return false; break; } - return false; + if ((UBGraphicsItemType::UserTypesCount > item->type()) && (item->type() > QGraphicsItem::UserType)) + return true; + else + return false; } bool UBBoardView::itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item) @@ -556,9 +565,11 @@ bool UBBoardView::itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item) return false; UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController()->stylusTool(); - + switch(item->type()) { + case QGraphicsWebView::Type: + return false; case UBGraphicsPixmapItem::Type: case UBGraphicsTextItem::Type: case UBGraphicsWidgetItem::Type: @@ -1094,6 +1105,7 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event) if (QGraphicsSvgItem::Type != movingItem->type() && UBGraphicsDelegateFrame::Type != movingItem->type() && UBToolWidget::Type != movingItem->type() && + UBGraphicsCache::Type != movingItem->type() && QGraphicsWebView::Type != movingItem->type() && // for W3C widgets as Tools. !(!isMultipleSelectionEnabled() && movingItem->parentItem() && UBGraphicsWidgetItem::Type == movingItem->type() && UBGraphicsGroupContainerItem::Type == movingItem->parentItem()->type())) { diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 6aaa2812..16b1cf69 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -66,7 +66,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) , mDesktopStylusTool(UBDrawingController::drawingController()->stylusTool()) { - mTransparentDrawingView = new UBBoardView(UBApplication::boardController, NULL, true); // deleted in UBDesktopAnnotationController::destructor + mTransparentDrawingView = new UBBoardView(UBApplication::boardController, static_cast(NULL), true); // deleted in UBDesktopAnnotationController::destructor mTransparentDrawingView->setAttribute(Qt::WA_TranslucentBackground, true); #ifdef Q_WS_MAC From af3e7ef5c3011a389298a8a7fb63c48b8857aa73 Mon Sep 17 00:00:00 2001 From: shibakaneki Date: Tue, 28 Aug 2012 13:46:22 +0200 Subject: [PATCH 02/11] Fixed issue 280 --- src/desktop/UBDesktopAnnotationController.cpp | 17 ++++++++++++++--- src/desktop/UBDesktopAnnotationController.h | 1 + 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index ddfce593..28987757 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -102,9 +102,13 @@ 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(mDesktopPalette, SIGNAL(maximized()), this, SLOT(onDesktopPaletteMaximized())); connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), this, SLOT(onDesktopPaletteMinimize())); @@ -382,6 +386,7 @@ void UBDesktopAnnotationController::hideWindow() void UBDesktopAnnotationController::goToUniboard() { + onToolClicked(); hideWindow(); UBPlatformUtils::setDesktopMode(false); @@ -397,6 +402,7 @@ void UBDesktopAnnotationController::goToUniboard() void UBDesktopAnnotationController::customCapture() { + onToolClicked(); mIsFullyTransparent = true; updateBackground(); @@ -424,6 +430,7 @@ void UBDesktopAnnotationController::customCapture() void UBDesktopAnnotationController::windowCapture() { + onToolClicked(); mIsFullyTransparent = true; updateBackground(); @@ -453,6 +460,7 @@ void UBDesktopAnnotationController::windowCapture() void UBDesktopAnnotationController::screenCapture() { + onToolClicked(); mIsFullyTransparent = true; updateBackground(); @@ -539,7 +547,6 @@ void UBDesktopAnnotationController::penActionPressed() */ void UBDesktopAnnotationController::penActionReleased() { - qDebug() << "penActionReleased()"; mHoldTimerPen.stop(); if(mPendingPenButtonPressed) { @@ -594,7 +601,6 @@ void UBDesktopAnnotationController::eraserActionPressed() */ void UBDesktopAnnotationController::eraserActionReleased() { - qDebug() << "eraserActionReleased()"; mHoldTimerEraser.stop(); if(mPendingEraserButtonPressed) { @@ -651,7 +657,6 @@ void UBDesktopAnnotationController::markerActionPressed() */ void UBDesktopAnnotationController::markerActionReleased() { - qDebug() << "markerActionReleased()"; mHoldTimerMarker.stop(); if(mPendingMarkerButtonPressed) { @@ -930,3 +935,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); From a591d30cc6815bb746000c5cf61a5732d161926d Mon Sep 17 00:00:00 2001 From: shibakaneki Date: Tue, 28 Aug 2012 14:45:55 +0200 Subject: [PATCH 03/11] Corrected a small issue --- src/desktop/UBDesktopAnnotationController.cpp | 1 + src/desktop/UBDesktopPalette.cpp | 2 ++ src/desktop/UBDesktopPalette.h | 1 + 3 files changed, 4 insertions(+) diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 28987757..165e8fcb 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -109,6 +109,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) connect(mDesktopPalette, SIGNAL(windowClick()), this, SLOT(onToolClicked())); connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(screenCapture())); connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(onToolClicked())); + connect(mDesktopPalette, SIGNAL(pointerClick()), this, SLOT(onToolClicked())); connect(mDesktopPalette, SIGNAL(maximized()), this, SLOT(onDesktopPaletteMaximized())); connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), this, SLOT(onDesktopPaletteMinimize())); diff --git a/src/desktop/UBDesktopPalette.cpp b/src/desktop/UBDesktopPalette.cpp index 2b3902b2..558f70e1 100644 --- a/src/desktop/UBDesktopPalette.cpp +++ b/src/desktop/UBDesktopPalette.cpp @@ -39,6 +39,8 @@ UBDesktopPalette::UBDesktopPalette(QWidget *parent) actions << UBApplication::mainWindow->actionSelector; actions << UBApplication::mainWindow->actionPointer; + connect(UBApplication::mainWindow->actionPointer, SIGNAL(triggered()), this, SIGNAL(pointerClick())); + if (UBPlatformUtils::hasVirtualKeyboard()) actions << UBApplication::mainWindow->actionVirtualKeyboard; diff --git a/src/desktop/UBDesktopPalette.h b/src/desktop/UBDesktopPalette.h index cd22d43e..359c43f1 100644 --- a/src/desktop/UBDesktopPalette.h +++ b/src/desktop/UBDesktopPalette.h @@ -33,6 +33,7 @@ class UBDesktopPalette : public UBActionPalette void customClick(); void windowClick(); void screenClick(); + void pointerClick(); #ifdef Q_WS_X11 void refreshMask(); From 3a2967924b7b713a60f778187e481d3128a9a4c3 Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Tue, 28 Aug 2012 15:50:20 +0300 Subject: [PATCH 04/11] Fixed determining of supported file formats for CFF. --- plugins/cffadaptor/src/UBCFFAdaptor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/cffadaptor/src/UBCFFAdaptor.cpp b/plugins/cffadaptor/src/UBCFFAdaptor.cpp index 68ec3ff9..10a8aca5 100644 --- a/plugins/cffadaptor/src/UBCFFAdaptor.cpp +++ b/plugins/cffadaptor/src/UBCFFAdaptor.cpp @@ -858,7 +858,7 @@ bool UBCFFAdaptor::UBToCFFConverter::itIsSupportedFormat(const QString &format) QStringList tsl = format.split(".", QString::SkipEmptyParts); if (0 < tsl.count()) - bRet = cffSupportedFileFormats.contains(tsl.at(tsl.count()-1)); + bRet = cffSupportedFileFormats.contains(tsl.at(tsl.count()-1).toLower()); else bRet = false; From dae012bb38fb3af68eacb06440ed00c0811c5296 Mon Sep 17 00:00:00 2001 From: shibakaneki Date: Tue, 28 Aug 2012 14:58:11 +0200 Subject: [PATCH 05/11] Corrected another small issue --- src/desktop/UBDesktopAnnotationController.cpp | 1 + src/desktop/UBDesktopPalette.cpp | 1 + src/desktop/UBDesktopPalette.h | 1 + 3 files changed, 3 insertions(+) diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 165e8fcb..f431f55e 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -110,6 +110,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(screenCapture())); connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(onToolClicked())); connect(mDesktopPalette, SIGNAL(pointerClick()), this, SLOT(onToolClicked())); + connect(mDesktopPalette, SIGNAL(arrowClick()), this, SLOT(onToolClicked())); connect(mDesktopPalette, SIGNAL(maximized()), this, SLOT(onDesktopPaletteMaximized())); connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), this, SLOT(onDesktopPaletteMinimize())); diff --git a/src/desktop/UBDesktopPalette.cpp b/src/desktop/UBDesktopPalette.cpp index 558f70e1..2ec3f3dc 100644 --- a/src/desktop/UBDesktopPalette.cpp +++ b/src/desktop/UBDesktopPalette.cpp @@ -40,6 +40,7 @@ UBDesktopPalette::UBDesktopPalette(QWidget *parent) actions << UBApplication::mainWindow->actionPointer; connect(UBApplication::mainWindow->actionPointer, SIGNAL(triggered()), this, SIGNAL(pointerClick())); + connect(UBApplication::mainWindow->actionSelector, SIGNAL(triggered()), this, SIGNAL(arrowClicked())); if (UBPlatformUtils::hasVirtualKeyboard()) actions << UBApplication::mainWindow->actionVirtualKeyboard; diff --git a/src/desktop/UBDesktopPalette.h b/src/desktop/UBDesktopPalette.h index 359c43f1..79553087 100644 --- a/src/desktop/UBDesktopPalette.h +++ b/src/desktop/UBDesktopPalette.h @@ -34,6 +34,7 @@ class UBDesktopPalette : public UBActionPalette void windowClick(); void screenClick(); void pointerClick(); + void arrowClicked(); #ifdef Q_WS_X11 void refreshMask(); From 3ef2b22340eb536d343528e9e04660717869018e Mon Sep 17 00:00:00 2001 From: Didier Date: Tue, 28 Aug 2012 15:00:38 +0200 Subject: [PATCH 06/11] Fixed a signal issue --- src/desktop/UBDesktopAnnotationController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index f431f55e..db32c695 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -110,7 +110,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(screenCapture())); connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(onToolClicked())); connect(mDesktopPalette, SIGNAL(pointerClick()), this, SLOT(onToolClicked())); - connect(mDesktopPalette, SIGNAL(arrowClick()), this, SLOT(onToolClicked())); + connect(mDesktopPalette, SIGNAL(arrowClicked()), this, SLOT(onToolClicked())); connect(mDesktopPalette, SIGNAL(maximized()), this, SLOT(onDesktopPaletteMaximized())); connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), this, SLOT(onDesktopPaletteMinimize())); From 3fb1e75c6b448caa8eb4edeab24347f4eaebf51b Mon Sep 17 00:00:00 2001 From: shibakaneki Date: Tue, 28 Aug 2012 15:09:43 +0200 Subject: [PATCH 07/11] Did a better implementation of this fix --- src/desktop/UBDesktopAnnotationController.cpp | 4 ++-- src/desktop/UBDesktopPalette.cpp | 3 --- src/desktop/UBDesktopPalette.h | 2 -- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index db32c695..9e5003c6 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -109,8 +109,8 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) connect(mDesktopPalette, SIGNAL(windowClick()), this, SLOT(onToolClicked())); connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(screenCapture())); connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(onToolClicked())); - connect(mDesktopPalette, SIGNAL(pointerClick()), this, SLOT(onToolClicked())); - connect(mDesktopPalette, SIGNAL(arrowClicked()), 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())); diff --git a/src/desktop/UBDesktopPalette.cpp b/src/desktop/UBDesktopPalette.cpp index 2ec3f3dc..2b3902b2 100644 --- a/src/desktop/UBDesktopPalette.cpp +++ b/src/desktop/UBDesktopPalette.cpp @@ -39,9 +39,6 @@ UBDesktopPalette::UBDesktopPalette(QWidget *parent) actions << UBApplication::mainWindow->actionSelector; actions << UBApplication::mainWindow->actionPointer; - connect(UBApplication::mainWindow->actionPointer, SIGNAL(triggered()), this, SIGNAL(pointerClick())); - connect(UBApplication::mainWindow->actionSelector, SIGNAL(triggered()), this, SIGNAL(arrowClicked())); - if (UBPlatformUtils::hasVirtualKeyboard()) actions << UBApplication::mainWindow->actionVirtualKeyboard; diff --git a/src/desktop/UBDesktopPalette.h b/src/desktop/UBDesktopPalette.h index 79553087..cd22d43e 100644 --- a/src/desktop/UBDesktopPalette.h +++ b/src/desktop/UBDesktopPalette.h @@ -33,8 +33,6 @@ class UBDesktopPalette : public UBActionPalette void customClick(); void windowClick(); void screenClick(); - void pointerClick(); - void arrowClicked(); #ifdef Q_WS_X11 void refreshMask(); From d9be3652f5b1eebb46a7c90590ecfa41bc027849 Mon Sep 17 00:00:00 2001 From: Anatoly Mihalchenko Date: Tue, 28 Aug 2012 17:08:18 +0300 Subject: [PATCH 08/11] SANKORE-985 shutdown after emptying the trashbin --- src/document/UBDocumentController.cpp | 91 ++++++++++++++++++--------- 1 file changed, 62 insertions(+), 29 deletions(-) diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index dbe0707b..4be9ee0f 100755 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -551,8 +551,11 @@ void UBDocumentController::deleteSelectedItem() { if(UBApplication::mainWindow->yesNoQuestion(tr("Remove Document"), tr("Are you sure you want to remove the document '%1'?").arg(proxyTi->proxy()->metaData(UBSettings::documentName).toString()))) { - if (proxyTi->parent() == mTrashTi) + if (proxyTi->parent() != mTrashTi) { + // We have to move document into Trash + // Select another document for processing + // This is for Board, where this document can be selected int index = proxyTi->parent()->indexOfChild(proxyTi); index --; @@ -560,7 +563,7 @@ void UBDocumentController::deleteSelectedItem() { if (proxyTi->proxy() == mBoardController->selectedDocument()) { - selectDocument(((UBDocumentProxyTreeItem*)proxyTi->parent()->child(index))->proxy()); + selectDocument(((UBDocumentProxyTreeItem*)proxyTi->parent()->child(index))->proxy(), true); } else proxyTi->parent()->child(index)->setSelected(true); @@ -569,7 +572,7 @@ void UBDocumentController::deleteSelectedItem() { if (proxyTi->proxy() == mBoardController->selectedDocument()) { - selectDocument(((UBDocumentProxyTreeItem*)proxyTi->parent()->child(1))->proxy()); + selectDocument(((UBDocumentProxyTreeItem*)proxyTi->parent()->child(1))->proxy(), true); } else proxyTi->parent()->child(1)->setSelected(true); @@ -578,30 +581,36 @@ void UBDocumentController::deleteSelectedItem() { if (proxyTi->proxy() == mBoardController->selectedDocument()) { + bool documentFound = false; for (int i = 0; i < mDocumentUI->documentTreeWidget->topLevelItemCount(); i++) { QTreeWidgetItem* item = mDocumentUI->documentTreeWidget->topLevelItem(i); UBDocumentGroupTreeItem* groupItem = dynamic_cast(item); - if (groupItem != selectedDocumentGroupTreeItem() && groupItem->childCount() > 0) + if (!groupItem->isTrashFolder()) { - selectDocument(((UBDocumentProxyTreeItem*)groupItem->child(0))->proxy()); - break; + for(int j=0; jchildCount(); j++) + { + if (((UBDocumentProxyTreeItem*)groupItem->child(j))->proxy() != mBoardController->selectedDocument()) + { + selectDocument(((UBDocumentProxyTreeItem*)groupItem->child(0))->proxy(), true); + documentFound = true; + break; + } + } } + if (documentFound) + break; + } + if (!documentFound) + { + UBDocumentProxy *document = UBPersistenceManager::persistenceManager()->createDocument(groupTi->groupName()); + selectDocument(document, true); } } else proxyTi->parent()->setSelected(true); } - proxyTi->parent()->removeChild(proxyTi); - - UBPersistenceManager::persistenceManager()->deleteDocument(proxyTi->proxy()); - - reloadThumbnails(); - } - else - { - // Move document to trash QString oldGroupName = proxyTi->proxy()->metaData(UBSettings::documentGroupName).toString(); proxyTi->proxy()->setMetaData(UBSettings::documentGroupName, UBSettings::trashedDocumentGroupNamePrefix + oldGroupName); UBPersistenceManager::persistenceManager()->persistDocumentMetadata(proxyTi->proxy()); @@ -610,6 +619,14 @@ void UBDocumentController::deleteSelectedItem() mTrashTi->addChild(proxyTi); proxyTi->setFlags(proxyTi->flags() ^ Qt::ItemIsEditable); } + else + { + // We have to physical delete document + // No action with selection required - document from Trash cant be selected in Board + + proxyTi->parent()->removeChild(proxyTi); + UBPersistenceManager::persistenceManager()->deleteDocument(proxyTi->proxy()); + } } } else if (groupTi) @@ -661,20 +678,6 @@ void UBDocumentController::deleteSelectedItem() } } - if (changeCurrentDocument) - { - for (int i = 0; i < mDocumentUI->documentTreeWidget->topLevelItemCount(); i++) - { - QTreeWidgetItem* item = mDocumentUI->documentTreeWidget->topLevelItem(i); - UBDocumentGroupTreeItem* groupItem = dynamic_cast(item); - if (groupItem != groupTi && groupItem->childCount() > 0) - { - selectDocument(((UBDocumentProxyTreeItem*)groupItem->child(0))->proxy()); - break; - } - } - } - QList toBeDeleted; for (int i = 0; i < groupTi->childCount(); i++) @@ -712,6 +715,36 @@ void UBDocumentController::deleteSelectedItem() } } + if (changeCurrentDocument) + { + bool documentFound = false; + for (int i = 0; i < mDocumentUI->documentTreeWidget->topLevelItemCount(); i++) + { + QTreeWidgetItem* item = mDocumentUI->documentTreeWidget->topLevelItem(i); + UBDocumentGroupTreeItem* groupItem = dynamic_cast(item); + if (!groupItem->isTrashFolder() && groupItem != groupTi) + { + for(int j=0; jchildCount(); j++) + { + if (((UBDocumentProxyTreeItem*)groupItem->child(j))->proxy() != mBoardController->selectedDocument()) + { + selectDocument(((UBDocumentProxyTreeItem*)groupItem->child(0))->proxy(), true); + documentFound = true; + break; + } + } + } + if (documentFound) + break; + } + if (!documentFound) + { + UBDocumentProxy *document = UBPersistenceManager::persistenceManager()->createDocument( UBSettings::defaultDocumentGroupName ); + selectDocument(document, true); + } + } + + reloadThumbnails(); QApplication::restoreOverrideCursor(); From 30b4a3f2db1ae588d5b9d02c2f1770d80e4fdffb Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Wed, 29 Aug 2012 09:38:41 +0300 Subject: [PATCH 09/11] Improved behavior of interacts with items on board. --- src/board/UBBoardView.cpp | 27 ++++++++++++++++++++++----- src/board/UBBoardView.h | 1 + 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/board/UBBoardView.cpp b/src/board/UBBoardView.cpp index b90869eb..9dab0121 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" @@ -433,6 +435,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 +515,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 +568,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 +624,7 @@ bool UBBoardView::itemShouldBeMoved(QGraphicsItem *item) switch(item->type()) { + case UBGraphicsCurtainItem::Type: case UBGraphicsGroupContainerItem::Type: return true; @@ -1102,7 +1118,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..0794d76c 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); From dc69855ea235314310d94881cd0d96d67c87a991 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Wed, 29 Aug 2012 14:25:18 +0200 Subject: [PATCH 10/11] upgraded version --- Sankore_3.1.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", "") From 38847278d43d46355ca0010cb965e304fe9665d0 Mon Sep 17 00:00:00 2001 From: maximXbs Date: Wed, 29 Aug 2012 15:17:04 +0200 Subject: [PATCH 11/11] Some display fixes in 'Sel video' widget --- resources/library/applications/Sel video.wgt/css/main.css | 4 +--- resources/library/applications/Sel video.wgt/index.html | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) 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; };