diff --git a/resources/forms/mainWindow.ui b/resources/forms/mainWindow.ui index 6e4b8080773a650712091849e24643814f4783ef..eaf78339ad1a6d1a16d5479e3184a2c9e475c536 100644 --- a/resources/forms/mainWindow.ui +++ b/resources/forms/mainWindow.ui @@ -69,7 +69,6 @@ <addaction name="actionForward"/> <addaction name="separator"/> <addaction name="actionErase"/> - <addaction name="actionGroupItems"/> <addaction name="actionBoard"/> <addaction name="actionWeb"/> <addaction name="actionDocument"/> @@ -1561,25 +1560,6 @@ <string>Ctrl+H</string> </property> </action> - <action name="actionGroupItems"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="icon"> - <iconset resource="../OpenBoard.qrc"> - <normaloff>:/images/toolbar/group.png</normaloff> - <normalon>:/images/toolbar/ungroup.png</normalon>:/images/toolbar/group.png</iconset> - </property> - <property name="text"> - <string>Group</string> - </property> - <property name="toolTip"> - <string>Group items</string> - </property> - </action> <action name="actionPlay"> <property name="checkable"> <bool>true</bool> diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index 3868c79190c418a663e5f6d8d237242e1c9a1f83..ae78a5afb886cbccfc368647e30d95f11e8b8ffb 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -154,8 +154,6 @@ void UBBoardController::init() setActiveDocumentScene(doc); - connect(UBApplication::mainWindow->actionGroupItems, SIGNAL(triggered()), this, SLOT(groupButtonClicked())); - undoRedoStateChange(true); } @@ -978,35 +976,6 @@ void UBBoardController::lastScene() updateActionStates(); } -void UBBoardController::groupButtonClicked() -{ - QAction *groupAction = UBApplication::mainWindow->actionGroupItems; - QList<QGraphicsItem*> selItems = activeScene()->selectedItems(); - if (!selItems.count()) { - qDebug() << "Got grouping request when there is no any selected item on the scene"; - return; - } - - if (groupAction->text() == mActionGroupText) { //The only way to get information from item, considering using smth else - UBGraphicsGroupContainerItem *groupItem = activeScene()->createGroup(selItems); - groupItem->setSelected(true); - UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector); - - } - else if (groupAction->text() == mActionUngroupText) { - //Considering one selected item and it's a group - if (selItems.count() > 1) - { - qDebug() << "can't make sense of ungrouping more then one item. Grouping action should be performed for that purpose"; - return; - } - UBGraphicsGroupContainerItem *currentGroup = dynamic_cast<UBGraphicsGroupContainerItem*>(selItems.first()); - if (currentGroup) { - currentGroup->destroy(); - } - } -} - void UBBoardController::downloadURL(const QUrl& url, QString contentSourceUrl, const QPointF& pPos, const QSize& pSize, bool isBackground, bool internalData) { qDebug() << "something has been dropped on the board! Url is: " << url.toString(); diff --git a/src/board/UBBoardController.h b/src/board/UBBoardController.h index 38a04b67e614b79e5539a89ed80e6c5c5acc2b31..b346cb45505c68056372d0abbe2c126dc842c0c5 100644 --- a/src/board/UBBoardController.h +++ b/src/board/UBBoardController.h @@ -213,7 +213,6 @@ class UBBoardController : public UBDocumentContainer void nextScene(); void firstScene(); void lastScene(); - void groupButtonClicked(); void downloadURL(const QUrl& url, QString contentSourceUrl = QString(), const QPointF& pPos = QPointF(0.0, 0.0), const QSize& pSize = QSize(), bool isBackground = false, bool internalData = false); UBItem *downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl contentUrl, QString pHeader, QByteArray pData, QPointF pPos, QSize pSize, diff --git a/src/core/UBApplicationController.cpp b/src/core/UBApplicationController.cpp index b3c81afae00d9f2447cefce027d5df9d1a3797e7..3bcdfb1ac051523d859be3d0affa755bc2e76b2c 100644 --- a/src/core/UBApplicationController.cpp +++ b/src/core/UBApplicationController.cpp @@ -383,7 +383,6 @@ void UBApplicationController::showBoard() emit mainModeChanged(Board); UBApplication::boardController->freezeW3CWidgets(false); - UBApplication::boardController->activeScene()->updateGroupButtonState(); } diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index ed3df20a25744cd13dc659845cdce4c8a9f04fde..dc40829edc0725f9870840d417503c1d4376303b 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -340,7 +340,6 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent, bool enableUndoRedoSta // Just for debug. Do not delete please // connect(this, SIGNAL(selectionChanged()), this, SLOT(selectionChangedProcessing())); - connect(this, SIGNAL(selectionChanged()), this, SLOT(updateGroupButtonState())); connect(UBApplication::undoStack.data(), SIGNAL(indexChanged(int)), this, SLOT(updateSelectionFrameWrapper(int))); } @@ -364,35 +363,6 @@ void UBGraphicsScene::selectionChangedProcessing() } } -void UBGraphicsScene::updateGroupButtonState() -{ - - UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController()->stylusTool(); - if (UBStylusTool::Selector != currentTool && UBStylusTool::Play != currentTool) - return; - - QAction *groupAction = UBApplication::mainWindow->actionGroupItems; - QList<QGraphicsItem*> selItems = selectedItems(); - int selCount = selItems.count(); - - if (selCount < 1) { - groupAction->setEnabled(false); - groupAction->setText(UBApplication::app()->boardController->actionGroupText()); - - } else if (selCount == 1) { - if (selItems.first()->type() == UBGraphicsGroupContainerItem::Type) { - groupAction->setEnabled(true); - groupAction->setText(UBApplication::app()->boardController->actionUngroupText()); - } else { - groupAction->setEnabled(false); - } - - } else if (selCount > 1) { - groupAction->setEnabled(true); - groupAction->setText(UBApplication::app()->boardController->actionGroupText()); - } -} - bool UBGraphicsScene::inputDevicePress(const QPointF& scenePos, const qreal& pressure) { bool accepted = false; diff --git a/src/domain/UBGraphicsScene.h b/src/domain/UBGraphicsScene.h index 015873165bdf5aae2fbbd7fbd267133419187fd0..7a59512c1c4ee928255abd4754ab2105c7f0ddbb 100644 --- a/src/domain/UBGraphicsScene.h +++ b/src/domain/UBGraphicsScene.h @@ -340,7 +340,6 @@ public slots: void setToolCursor(int tool); void selectionChangedProcessing(); - void updateGroupButtonState(); void moveMagnifier(); void moveMagnifier(QPoint newPos, bool forceGrab = false); void closeMagnifier();