Button "Stop using tool".

--HG--
branch : develop
This commit is contained in:
dismine 2014-10-24 21:49:59 +03:00
parent 5679158b56
commit b4a0006835
3 changed files with 26 additions and 12 deletions

View File

@ -1018,6 +1018,7 @@ void MainWindow::CancelTool()
case Tool::Arrow: case Tool::Arrow:
ui->actionArrowTool->setChecked(false); ui->actionArrowTool->setChecked(false);
helpLabel->setText(""); helpLabel->setText("");
ui->actionStopTool->setEnabled(true);
break; break;
case Tool::SinglePoint: case Tool::SinglePoint:
Q_UNREACHABLE(); Q_UNREACHABLE();
@ -1145,6 +1146,7 @@ void MainWindow::ArrowTool()
{ {
CancelTool(); CancelTool();
ui->actionArrowTool->setChecked(true); ui->actionArrowTool->setChecked(true);
ui->actionStopTool->setEnabled(false);
tool = Tool::Arrow; tool = Tool::Arrow;
QCursor cur(Qt::ArrowCursor); QCursor cur(Qt::ArrowCursor);
ui->view->setCursor(cur); ui->view->setCursor(cur);
@ -1152,15 +1154,6 @@ void MainWindow::ArrowTool()
ui->view->setShowToolOptions(true); ui->view->setShowToolOptions(true);
} }
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ActionAroowTool set arrow tool. Cansel tool what was before.
*/
void MainWindow::ActionAroowTool()
{
ArrowTool();
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/** /**
* @brief keyPressEvent handle key press events. * @brief keyPressEvent handle key press events.
@ -2097,7 +2090,8 @@ void MainWindow::CreateActions()
{ {
ui->setupUi(this); ui->setupUi(this);
connect(ui->actionArrowTool, &QAction::triggered, this, &MainWindow::ActionAroowTool); connect(ui->actionStopTool, &QAction::triggered, this, &MainWindow::ArrowTool);
connect(ui->actionArrowTool, &QAction::triggered, this, &MainWindow::ArrowTool);
connect(ui->actionDraw, &QAction::triggered, this, &MainWindow::ActionDraw); connect(ui->actionDraw, &QAction::triggered, this, &MainWindow::ActionDraw);
connect(ui->actionDetails, &QAction::triggered, this, &MainWindow::ActionDetails); connect(ui->actionDetails, &QAction::triggered, this, &MainWindow::ActionDetails);
connect(ui->actionNewDraw, &QAction::triggered, this, &MainWindow::ActionNewPP); connect(ui->actionNewDraw, &QAction::triggered, this, &MainWindow::ActionNewPP);

View File

@ -59,8 +59,8 @@ public:
void ReopenFilesAfterCrash(); void ReopenFilesAfterCrash();
public slots: public slots:
void mouseMove(const QPointF &scenePos); void mouseMove(const QPointF &scenePos);
void ArrowTool();
void ActionAroowTool();
void ActionDraw(bool checked); void ActionDraw(bool checked);
void ActionDetails(bool checked); void ActionDetails(bool checked);
void ActionNewPP(); void ActionNewPP();
@ -206,7 +206,6 @@ private:
void ToolBarTools(); void ToolBarTools();
void InitToolButtons(); void InitToolButtons();
void CancelTool(); void CancelTool();
void ArrowTool();
void SetEnableWidgets(bool enable); void SetEnableWidgets(bool enable);
void SetEnableTool(bool enable); void SetEnableTool(bool enable);
void SaveCurrentScene(); void SaveCurrentScene();

View File

@ -864,6 +864,9 @@
</attribute> </attribute>
</widget> </widget>
<widget class="QToolBar" name="toolBarTools"> <widget class="QToolBar" name="toolBarTools">
<property name="enabled">
<bool>true</bool>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Toolbar tools</string> <string>Toolbar tools</string>
</property> </property>
@ -877,6 +880,7 @@
<addaction name="actionZoomOut"/> <addaction name="actionZoomOut"/>
<addaction name="actionZoomOriginal"/> <addaction name="actionZoomOriginal"/>
<addaction name="actionZoomFitBest"/> <addaction name="actionZoomFitBest"/>
<addaction name="actionStopTool"/>
</widget> </widget>
<widget class="QDockWidget" name="dockWidgetToolOptions"> <widget class="QDockWidget" name="dockWidgetToolOptions">
<property name="minimumSize"> <property name="minimumSize">
@ -1217,6 +1221,23 @@
<string>Ctrl+=</string> <string>Ctrl+=</string>
</property> </property>
</action> </action>
<action name="actionStopTool">
<property name="checkable">
<bool>false</bool>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="icon">
<iconset theme="process-stop"/>
</property>
<property name="text">
<string>Stop</string>
</property>
<property name="toolTip">
<string>Stop using tool</string>
</property>
</action>
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<customwidgets> <customwidgets>