Old group button has been removed

preferencesAboutTextFull
Ilia Ryabokon 11 years ago
parent 241ddb92a1
commit e9f6f397e4
  1. 20
      resources/forms/mainWindow.ui
  2. 31
      src/board/UBBoardController.cpp
  3. 1
      src/board/UBBoardController.h
  4. 1
      src/core/UBApplicationController.cpp
  5. 30
      src/domain/UBGraphicsScene.cpp
  6. 1
      src/domain/UBGraphicsScene.h

@ -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>

@ -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();

@ -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,

@ -383,7 +383,6 @@ void UBApplicationController::showBoard()
emit mainModeChanged(Board);
UBApplication::boardController->freezeW3CWidgets(false);
UBApplication::boardController->activeScene()->updateGroupButtonState();
}

@ -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;

@ -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();

Loading…
Cancel
Save