Keyboard shortcuts for each tool.
This commit is contained in:
parent
434a1d0acf
commit
3bbab78d4d
|
@ -98,7 +98,6 @@ VValentinaShortcutManager::VValentinaShortcutManager(QObject *parent)
|
||||||
{QKeySequence(Qt::ControlModifier QKEY_SEQUENCE_OP Qt::Key_H).toString()},
|
{QKeySequence(Qt::ControlModifier QKEY_SEQUENCE_OP Qt::Key_H).toString()},
|
||||||
{}});
|
{}});
|
||||||
AddShortcut({VShortcutAction::Quit, KeyBindingsToStringList(QKeySequence::Quit), {}});
|
AddShortcut({VShortcutAction::Quit, KeyBindingsToStringList(QKeySequence::Quit), {}});
|
||||||
AddShortcut({VShortcutAction::LastTool, {QKeySequence(Qt::Key_L).toString()}, {}});
|
|
||||||
AddShortcut({VShortcutAction::CurveDetails, {QKeySequence(Qt::Key_F2).toString()}, {}});
|
AddShortcut({VShortcutAction::CurveDetails, {QKeySequence(Qt::Key_F2).toString()}, {}});
|
||||||
AddShortcut({VShortcutAction::FinalMeasurements,
|
AddShortcut({VShortcutAction::FinalMeasurements,
|
||||||
{QKeySequence(Qt::ControlModifier QKEY_SEQUENCE_OP Qt::Key_I).toString()},
|
{QKeySequence(Qt::ControlModifier QKEY_SEQUENCE_OP Qt::Key_I).toString()},
|
||||||
|
@ -119,6 +118,54 @@ VValentinaShortcutManager::VValentinaShortcutManager(QObject *parent)
|
||||||
AddShortcut({VShortcutAction::FindNext, {QKeySequence(Qt::Key_F3).toString()}, {}});
|
AddShortcut({VShortcutAction::FindNext, {QKeySequence(Qt::Key_F3).toString()}, {}});
|
||||||
AddShortcut(
|
AddShortcut(
|
||||||
{VShortcutAction::FindPrevious, {QKeySequence(Qt::ShiftModifier QKEY_SEQUENCE_OP Qt::Key_F3).toString()}, {}});
|
{VShortcutAction::FindPrevious, {QKeySequence(Qt::ShiftModifier QKEY_SEQUENCE_OP Qt::Key_F3).toString()}, {}});
|
||||||
|
AddShortcut({VShortcutAction::LastTool, {QKeySequence(Qt::Key_L).toString()}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolEndLine, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolLine, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolAlongLine, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolShoulderPoint, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolNormal, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolBisector, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolLineIntersect, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolSpline, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolCubicBezier, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolArc, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolSplinePath, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolCubicBezierPath, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolPointOfContact, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolPiece, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolPiecePath, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolHeight, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolTriangle, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolPointOfIntersection, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolCutSpline, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolCutSplinePath, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolUnionDetails, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolDuplicateDetail, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolCutArc, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolLineIntersectAxis, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolCurveIntersectAxis, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolArcIntersectAxis, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::LayoutSettings, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolPointOfIntersectionArcs, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolPointOfIntersectionCircles, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolPointOfIntersectionCurves, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolPointFromCircleAndTangent, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolPointFromArcAndTangent, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolArcWithLength, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolTrueDarts, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolGroup, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolRotation, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolFlippingByLine, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolFlippingByAxis, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolMove, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolMidpoint, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ExportDrawAs, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ExportLayoutAs, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ExportDetailsAs, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolEllipticalArc, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolPin, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolInsertNode, {}, {}});
|
||||||
|
AddShortcut({VShortcutAction::ToolPlaceLabel, {}, {}});
|
||||||
|
|
||||||
QT_WARNING_POP
|
QT_WARNING_POP
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,6 +191,7 @@
|
||||||
#include "dialogs/vwidgetbackgroundimages.h"
|
#include "dialogs/vwidgetbackgroundimages.h"
|
||||||
#include "dialogs/vwidgetdetails.h"
|
#include "dialogs/vwidgetdetails.h"
|
||||||
#include "dialogs/vwidgetgroups.h"
|
#include "dialogs/vwidgetgroups.h"
|
||||||
|
#include "qtpreprocessorsupport.h"
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include "vabstractapplication.h"
|
#include "vabstractapplication.h"
|
||||||
#include "vabstractshortcutmanager.h"
|
#include "vabstractshortcutmanager.h"
|
||||||
|
@ -3320,55 +3321,71 @@ void MainWindow::InitToolButtons()
|
||||||
// This check helps to find missed tools
|
// This check helps to find missed tools
|
||||||
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 59, "Check if all tools were connected.");
|
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 59, "Check if all tools were connected.");
|
||||||
|
|
||||||
connect(ui->actionEndLineTool, &QAction::triggered, this, &MainWindow::ToolEndLine);
|
auto InitToolButton = [this](VShortcutAction type, QAction *action, void (MainWindow::*slotFunction)(bool))
|
||||||
connect(ui->actionLineTool, &QAction::triggered, this, &MainWindow::ToolLine);
|
{
|
||||||
connect(ui->actionAlongLineTool, &QAction::triggered, this, &MainWindow::ToolAlongLine);
|
m_shortcutActions.insert(type, action);
|
||||||
connect(ui->actionShoulderPointTool, &QAction::triggered, this, &MainWindow::ToolShoulderPoint);
|
connect(action, &QAction::triggered, this, slotFunction);
|
||||||
connect(ui->actionNormalTool, &QAction::triggered, this, &MainWindow::ToolNormal);
|
};
|
||||||
connect(ui->actionBisectorTool, &QAction::triggered, this, &MainWindow::ToolBisector);
|
|
||||||
connect(ui->actionLineIntersectTool, &QAction::triggered, this, &MainWindow::ToolLineIntersect);
|
InitToolButton(VShortcutAction::ToolEndLine, ui->actionEndLineTool, &MainWindow::ToolEndLine);
|
||||||
connect(ui->actionSplineTool, &QAction::triggered, this, &MainWindow::ToolSpline);
|
InitToolButton(VShortcutAction::ToolLine, ui->actionLineTool, &MainWindow::ToolLine);
|
||||||
connect(ui->actionCubicBezierTool, &QAction::triggered, this, &MainWindow::ToolCubicBezier);
|
InitToolButton(VShortcutAction::ToolAlongLine, ui->actionAlongLineTool, &MainWindow::ToolAlongLine);
|
||||||
connect(ui->actionArcTool, &QAction::triggered, this, &MainWindow::ToolArc);
|
InitToolButton(VShortcutAction::ToolShoulderPoint, ui->actionShoulderPointTool, &MainWindow::ToolShoulderPoint);
|
||||||
connect(ui->actionSplinePathTool, &QAction::triggered, this, &MainWindow::ToolSplinePath);
|
InitToolButton(VShortcutAction::ToolNormal, ui->actionNormalTool, &MainWindow::ToolNormal);
|
||||||
connect(ui->actionCubicBezierPathTool, &QAction::triggered, this, &MainWindow::ToolCubicBezierPath);
|
InitToolButton(VShortcutAction::ToolBisector, ui->actionBisectorTool, &MainWindow::ToolBisector);
|
||||||
connect(ui->actionPointOfContactTool, &QAction::triggered, this, &MainWindow::ToolPointOfContact);
|
InitToolButton(VShortcutAction::ToolLineIntersect, ui->actionLineIntersectTool, &MainWindow::ToolLineIntersect);
|
||||||
connect(ui->actionNewDetailTool, &QAction::triggered, this, &MainWindow::ToolDetail);
|
InitToolButton(VShortcutAction::ToolSpline, ui->actionSplineTool, &MainWindow::ToolSpline);
|
||||||
connect(ui->actionInternalPathTool, &QAction::triggered, this, &MainWindow::ToolPiecePath);
|
InitToolButton(VShortcutAction::ToolCubicBezier, ui->actionCubicBezierTool, &MainWindow::ToolCubicBezier);
|
||||||
connect(ui->actionHeightTool, &QAction::triggered, this, &MainWindow::ToolHeight);
|
InitToolButton(VShortcutAction::ToolArc, ui->actionArcTool, &MainWindow::ToolArc);
|
||||||
connect(ui->actionTriangleTool, &QAction::triggered, this, &MainWindow::ToolTriangle);
|
InitToolButton(VShortcutAction::ToolSplinePath, ui->actionSplinePathTool, &MainWindow::ToolSplinePath);
|
||||||
connect(ui->actionPointOfIntersectionTool, &QAction::triggered, this, &MainWindow::ToolPointOfIntersection);
|
InitToolButton(VShortcutAction::ToolCubicBezierPath, ui->actionCubicBezierPathTool,
|
||||||
connect(ui->actionSplineCutPointTool, &QAction::triggered, this, &MainWindow::ToolCutSpline);
|
&MainWindow::ToolCubicBezierPath);
|
||||||
connect(ui->actionSplinePathCutPointTool, &QAction::triggered, this, &MainWindow::ToolCutSplinePath);
|
InitToolButton(VShortcutAction::ToolPointOfContact, ui->actionPointOfContactTool, &MainWindow::ToolPointOfContact);
|
||||||
connect(ui->actionUnionDetailsTool, &QAction::triggered, this, &MainWindow::ToolUnionDetails);
|
InitToolButton(VShortcutAction::ToolPiece, ui->actionNewDetailTool, &MainWindow::ToolDetail);
|
||||||
connect(ui->actionDuplicateDetailTool, &QAction::triggered, this, &MainWindow::ToolDuplicateDetail);
|
InitToolButton(VShortcutAction::ToolPiecePath, ui->actionInternalPathTool, &MainWindow::ToolPiecePath);
|
||||||
connect(ui->actionArcCutPointTool, &QAction::triggered, this, &MainWindow::ToolCutArc);
|
InitToolButton(VShortcutAction::ToolHeight, ui->actionHeightTool, &MainWindow::ToolHeight);
|
||||||
connect(ui->actionLineIntersectAxisTool, &QAction::triggered, this, &MainWindow::ToolLineIntersectAxis);
|
InitToolButton(VShortcutAction::ToolTriangle, ui->actionTriangleTool, &MainWindow::ToolTriangle);
|
||||||
connect(ui->actionCurveIntersectAxisTool, &QAction::triggered, this, &MainWindow::ToolCurveIntersectAxis);
|
InitToolButton(VShortcutAction::ToolPointOfIntersection, ui->actionPointOfIntersectionTool,
|
||||||
connect(ui->actionArcIntersectAxisTool, &QAction::triggered, this, &MainWindow::ToolArcIntersectAxis);
|
&MainWindow::ToolPointOfIntersection);
|
||||||
connect(ui->actionLayoutSettings, &QAction::triggered, this, &MainWindow::ToolLayoutSettings);
|
InitToolButton(VShortcutAction::ToolCutSpline, ui->actionSplineCutPointTool, &MainWindow::ToolCutSpline);
|
||||||
connect(ui->actionPointOfIntersectionArcsTool, &QAction::triggered, this, &MainWindow::ToolPointOfIntersectionArcs);
|
InitToolButton(VShortcutAction::ToolCutSplinePath, ui->actionSplinePathCutPointTool,
|
||||||
connect(ui->actionPointOfIntersectionCirclesTool, &QAction::triggered, this,
|
&MainWindow::ToolCutSplinePath);
|
||||||
|
InitToolButton(VShortcutAction::ToolUnionDetails, ui->actionUnionDetailsTool, &MainWindow::ToolUnionDetails);
|
||||||
|
InitToolButton(VShortcutAction::ToolDuplicateDetail, ui->actionDuplicateDetailTool,
|
||||||
|
&MainWindow::ToolDuplicateDetail);
|
||||||
|
InitToolButton(VShortcutAction::ToolCutArc, ui->actionArcCutPointTool, &MainWindow::ToolCutArc);
|
||||||
|
InitToolButton(VShortcutAction::ToolLineIntersectAxis, ui->actionLineIntersectAxisTool,
|
||||||
|
&MainWindow::ToolLineIntersectAxis);
|
||||||
|
InitToolButton(VShortcutAction::ToolCurveIntersectAxis, ui->actionCurveIntersectAxisTool,
|
||||||
|
&MainWindow::ToolCurveIntersectAxis);
|
||||||
|
InitToolButton(VShortcutAction::ToolArcIntersectAxis, ui->actionArcIntersectAxisTool,
|
||||||
|
&MainWindow::ToolArcIntersectAxis);
|
||||||
|
InitToolButton(VShortcutAction::LayoutSettings, ui->actionLayoutSettings, &MainWindow::ToolLayoutSettings);
|
||||||
|
InitToolButton(VShortcutAction::ToolPointOfIntersectionArcs, ui->actionPointOfIntersectionArcsTool,
|
||||||
|
&MainWindow::ToolPointOfIntersectionArcs);
|
||||||
|
InitToolButton(VShortcutAction::ToolPointOfIntersectionCircles, ui->actionPointOfIntersectionCirclesTool,
|
||||||
&MainWindow::ToolPointOfIntersectionCircles);
|
&MainWindow::ToolPointOfIntersectionCircles);
|
||||||
connect(ui->actionIntersectionCurvesTool, &QAction::triggered, this, &MainWindow::ToolPointOfIntersectionCurves);
|
InitToolButton(VShortcutAction::ToolPointOfIntersectionCurves, ui->actionIntersectionCurvesTool,
|
||||||
connect(ui->actionPointFromCircleAndTangentTool, &QAction::triggered, this,
|
&MainWindow::ToolPointOfIntersectionCurves);
|
||||||
|
InitToolButton(VShortcutAction::ToolPointFromCircleAndTangent, ui->actionPointFromCircleAndTangentTool,
|
||||||
&MainWindow::ToolPointFromCircleAndTangent);
|
&MainWindow::ToolPointFromCircleAndTangent);
|
||||||
connect(ui->actionPointFromArcAndTangentTool, &QAction::triggered, this, &MainWindow::ToolPointFromArcAndTangent);
|
InitToolButton(VShortcutAction::ToolPointFromArcAndTangent, ui->actionPointFromArcAndTangentTool,
|
||||||
connect(ui->actionArcWithLengthTool, &QAction::triggered, this, &MainWindow::ToolArcWithLength);
|
&MainWindow::ToolPointFromArcAndTangent);
|
||||||
connect(ui->actionTrueDartsTool, &QAction::triggered, this, &MainWindow::ToolTrueDarts);
|
InitToolButton(VShortcutAction::ToolArcWithLength, ui->actionArcWithLengthTool, &MainWindow::ToolArcWithLength);
|
||||||
connect(ui->actionGroupTool, &QAction::triggered, this, &MainWindow::ToolGroup);
|
InitToolButton(VShortcutAction::ToolTrueDarts, ui->actionTrueDartsTool, &MainWindow::ToolTrueDarts);
|
||||||
connect(ui->actionRotationTool, &QAction::triggered, this, &MainWindow::ToolRotation);
|
InitToolButton(VShortcutAction::ToolGroup, ui->actionGroupTool, &MainWindow::ToolGroup);
|
||||||
connect(ui->actionFlippingByLineTool, &QAction::triggered, this, &MainWindow::ToolFlippingByLine);
|
InitToolButton(VShortcutAction::ToolRotation, ui->actionRotationTool, &MainWindow::ToolRotation);
|
||||||
connect(ui->actionFlippingByAxisTool, &QAction::triggered, this, &MainWindow::ToolFlippingByAxis);
|
InitToolButton(VShortcutAction::ToolFlippingByLine, ui->actionFlippingByLineTool, &MainWindow::ToolFlippingByLine);
|
||||||
connect(ui->actionMoveTool, &QAction::triggered, this, &MainWindow::ToolMove);
|
InitToolButton(VShortcutAction::ToolFlippingByAxis, ui->actionFlippingByAxisTool, &MainWindow::ToolFlippingByAxis);
|
||||||
connect(ui->actionMidpointTool, &QAction::triggered, this, &MainWindow::ToolMidpoint);
|
InitToolButton(VShortcutAction::ToolMove, ui->actionMoveTool, &MainWindow::ToolMove);
|
||||||
connect(ui->actionExportDraw, &QAction::triggered, this, &MainWindow::ExportDrawAs);
|
InitToolButton(VShortcutAction::ToolMidpoint, ui->actionMidpointTool, &MainWindow::ToolMidpoint);
|
||||||
connect(ui->actionLayoutExportAs, &QAction::triggered, this, &MainWindow::ExportLayoutAs);
|
InitToolButton(VShortcutAction::ExportDrawAs, ui->actionExportDraw, &MainWindow::ExportDrawAs);
|
||||||
connect(ui->actionDetailExportAs, &QAction::triggered, this, &MainWindow::ExportDetailsAs);
|
InitToolButton(VShortcutAction::ExportLayoutAs, ui->actionLayoutExportAs, &MainWindow::ExportLayoutAs);
|
||||||
connect(ui->actionEllipticalArcTool, &QAction::triggered, this, &MainWindow::ToolEllipticalArc);
|
InitToolButton(VShortcutAction::ExportDetailsAs, ui->actionDetailExportAs, &MainWindow::ExportDetailsAs);
|
||||||
connect(ui->actionPinTool, &QAction::triggered, this, &MainWindow::ToolPin);
|
InitToolButton(VShortcutAction::ToolEllipticalArc, ui->actionEllipticalArcTool, &MainWindow::ToolEllipticalArc);
|
||||||
connect(ui->actionInsertNodeTool, &QAction::triggered, this, &MainWindow::ToolInsertNode);
|
InitToolButton(VShortcutAction::ToolPin, ui->actionPinTool, &MainWindow::ToolPin);
|
||||||
connect(ui->actionPlaceLabelTool, &QAction::triggered, this, &MainWindow::ToolPlaceLabel);
|
InitToolButton(VShortcutAction::ToolInsertNode, ui->actionInsertNodeTool, &MainWindow::ToolInsertNode);
|
||||||
|
InitToolButton(VShortcutAction::ToolPlaceLabel, ui->actionPlaceLabelTool, &MainWindow::ToolPlaceLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -6634,8 +6651,10 @@ void MainWindow::CreateMeasurements()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void MainWindow::ExportDrawAs()
|
void MainWindow::ExportDrawAs(bool checked)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(checked)
|
||||||
|
|
||||||
auto Uncheck = qScopeGuard([this] { ui->actionExportDraw->setChecked(false); });
|
auto Uncheck = qScopeGuard([this] { ui->actionExportDraw->setChecked(false); });
|
||||||
|
|
||||||
QString filters(tr("Scalable Vector Graphics files") + QStringLiteral("(*.svg)"));
|
QString filters(tr("Scalable Vector Graphics files") + QStringLiteral("(*.svg)"));
|
||||||
|
@ -6658,8 +6677,10 @@ void MainWindow::ExportDrawAs()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void MainWindow::ExportLayoutAs()
|
void MainWindow::ExportLayoutAs(bool checked)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(checked)
|
||||||
|
|
||||||
auto Uncheck = qScopeGuard([this] { ui->actionLayoutExportAs->setChecked(false); });
|
auto Uncheck = qScopeGuard([this] { ui->actionLayoutExportAs->setChecked(false); });
|
||||||
|
|
||||||
if (m_layoutSettings->IsLayoutStale())
|
if (m_layoutSettings->IsLayoutStale())
|
||||||
|
@ -6694,8 +6715,10 @@ void MainWindow::ExportLayoutAs()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void MainWindow::ExportDetailsAs()
|
void MainWindow::ExportDetailsAs(bool checked)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(checked)
|
||||||
|
|
||||||
auto Uncheck = qScopeGuard([this] { ui->actionDetailExportAs->setChecked(false); });
|
auto Uncheck = qScopeGuard([this] { ui->actionDetailExportAs->setChecked(false); });
|
||||||
|
|
||||||
QVector<DetailForLayout> detailsInLayout = SortDetailsForLayout(pattern->DataPieces());
|
QVector<DetailForLayout> detailsInLayout = SortDetailsForLayout(pattern->DataPieces());
|
||||||
|
|
|
@ -140,9 +140,9 @@ private slots:
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MAC)
|
||||||
void CreateMeasurements();
|
void CreateMeasurements();
|
||||||
#endif
|
#endif
|
||||||
void ExportDrawAs();
|
void ExportDrawAs(bool checked);
|
||||||
void ExportLayoutAs();
|
void ExportLayoutAs(bool checked);
|
||||||
void ExportDetailsAs();
|
void ExportDetailsAs(bool checked);
|
||||||
|
|
||||||
void ArrowTool(bool checked);
|
void ArrowTool(bool checked);
|
||||||
void ToolEndLine(bool checked);
|
void ToolEndLine(bool checked);
|
||||||
|
|
|
@ -107,7 +107,7 @@ auto VAbstractShortcutManager::GetShortcutsList() const -> QList<VAbstractShortc
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
auto VAbstractShortcutManager::ShortcutActionToString(VShortcutAction type) -> QString
|
auto VAbstractShortcutManager::ShortcutActionToString(VShortcutAction type) -> QString
|
||||||
{
|
{
|
||||||
Q_STATIC_ASSERT_X(static_cast<int>(VShortcutAction::LAST_ONE_DO_NOT_USE) == 35, "Convert all actions.");
|
Q_STATIC_ASSERT_X(static_cast<int>(VShortcutAction::LAST_ONE_DO_NOT_USE) == 82, "Convert all actions.");
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
@ -181,6 +181,100 @@ auto VAbstractShortcutManager::ShortcutActionToString(VShortcutAction type) -> Q
|
||||||
return "findnext"_L1;
|
return "findnext"_L1;
|
||||||
case VShortcutAction::FindPrevious:
|
case VShortcutAction::FindPrevious:
|
||||||
return "findprevious"_L1;
|
return "findprevious"_L1;
|
||||||
|
case VShortcutAction::ToolEndLine:
|
||||||
|
return "toolendline"_L1;
|
||||||
|
case VShortcutAction::ToolLine:
|
||||||
|
return "toolline"_L1;
|
||||||
|
case VShortcutAction::ToolAlongLine:
|
||||||
|
return "toolalongline"_L1;
|
||||||
|
case VShortcutAction::ToolShoulderPoint:
|
||||||
|
return "toolshoulderpoint"_L1;
|
||||||
|
case VShortcutAction::ToolNormal:
|
||||||
|
return "toolnormal"_L1;
|
||||||
|
case VShortcutAction::ToolBisector:
|
||||||
|
return "toolbisector"_L1;
|
||||||
|
case VShortcutAction::ToolLineIntersect:
|
||||||
|
return "toolLineintersect"_L1;
|
||||||
|
case VShortcutAction::ToolSpline:
|
||||||
|
return "toolspline"_L1;
|
||||||
|
case VShortcutAction::ToolCubicBezier:
|
||||||
|
return "toolcubicbezier"_L1;
|
||||||
|
case VShortcutAction::ToolArc:
|
||||||
|
return "toolarc"_L1;
|
||||||
|
case VShortcutAction::ToolSplinePath:
|
||||||
|
return "toolsplinepath"_L1;
|
||||||
|
case VShortcutAction::ToolCubicBezierPath:
|
||||||
|
return "toolcubicbezierpath"_L1;
|
||||||
|
case VShortcutAction::ToolPointOfContact:
|
||||||
|
return "toolpointofcontact"_L1;
|
||||||
|
case VShortcutAction::ToolPiece:
|
||||||
|
return "toolpiece"_L1;
|
||||||
|
case VShortcutAction::ToolPiecePath:
|
||||||
|
return "toolpiecepath"_L1;
|
||||||
|
case VShortcutAction::ToolHeight:
|
||||||
|
return "toolheight"_L1;
|
||||||
|
case VShortcutAction::ToolTriangle:
|
||||||
|
return "tooltriangle"_L1;
|
||||||
|
case VShortcutAction::ToolPointOfIntersection:
|
||||||
|
return "toolpointofintersection"_L1;
|
||||||
|
case VShortcutAction::ToolCutSpline:
|
||||||
|
return "toolcutspline"_L1;
|
||||||
|
case VShortcutAction::ToolCutSplinePath:
|
||||||
|
return "toolcutsplinepath"_L1;
|
||||||
|
case VShortcutAction::ToolUnionDetails:
|
||||||
|
return "tooluniondetails"_L1;
|
||||||
|
case VShortcutAction::ToolDuplicateDetail:
|
||||||
|
return "toolduplicatedetail"_L1;
|
||||||
|
case VShortcutAction::ToolCutArc:
|
||||||
|
return "toolcutarc"_L1;
|
||||||
|
case VShortcutAction::ToolLineIntersectAxis:
|
||||||
|
return "toollineintersectaxis"_L1;
|
||||||
|
case VShortcutAction::ToolCurveIntersectAxis:
|
||||||
|
return "toolcurveintersectaxis"_L1;
|
||||||
|
case VShortcutAction::ToolArcIntersectAxis:
|
||||||
|
return "toolarcintersectaxis"_L1;
|
||||||
|
case VShortcutAction::LayoutSettings:
|
||||||
|
return "layoutsettings"_L1;
|
||||||
|
case VShortcutAction::ToolPointOfIntersectionArcs:
|
||||||
|
return "toolpointofintersectionarcs"_L1;
|
||||||
|
case VShortcutAction::ToolPointOfIntersectionCircles:
|
||||||
|
return "toolpointofintersectioncircles"_L1;
|
||||||
|
case VShortcutAction::ToolPointOfIntersectionCurves:
|
||||||
|
return "toolpointofintersectioncurves"_L1;
|
||||||
|
case VShortcutAction::ToolPointFromCircleAndTangent:
|
||||||
|
return "toolpointfromcircleandtangent"_L1;
|
||||||
|
case VShortcutAction::ToolPointFromArcAndTangent:
|
||||||
|
return "toolpointfromarcandtangent"_L1;
|
||||||
|
case VShortcutAction::ToolArcWithLength:
|
||||||
|
return "toolarcwithlength"_L1;
|
||||||
|
case VShortcutAction::ToolTrueDarts:
|
||||||
|
return "tooltruedarts"_L1;
|
||||||
|
case VShortcutAction::ToolGroup:
|
||||||
|
return "toolgroup"_L1;
|
||||||
|
case VShortcutAction::ToolRotation:
|
||||||
|
return "toolrotation"_L1;
|
||||||
|
case VShortcutAction::ToolFlippingByLine:
|
||||||
|
return "toolflippingbyline"_L1;
|
||||||
|
case VShortcutAction::ToolFlippingByAxis:
|
||||||
|
return "toolflippingfyaxis"_L1;
|
||||||
|
case VShortcutAction::ToolMove:
|
||||||
|
return "toolmove"_L1;
|
||||||
|
case VShortcutAction::ToolMidpoint:
|
||||||
|
return "toolmidpoint"_L1;
|
||||||
|
case VShortcutAction::ExportDrawAs:
|
||||||
|
return "exportdrawas"_L1;
|
||||||
|
case VShortcutAction::ExportLayoutAs:
|
||||||
|
return "exportlayoutas"_L1;
|
||||||
|
case VShortcutAction::ExportDetailsAs:
|
||||||
|
return "exportdetailsas"_L1;
|
||||||
|
case VShortcutAction::ToolEllipticalArc:
|
||||||
|
return "toolellipticalarc"_L1;
|
||||||
|
case VShortcutAction::ToolPin:
|
||||||
|
return "toolpin"_L1;
|
||||||
|
case VShortcutAction::ToolInsertNode:
|
||||||
|
return "toolinsertnode"_L1;
|
||||||
|
case VShortcutAction::ToolPlaceLabel:
|
||||||
|
return "toolplacelabel"_L1;
|
||||||
case VShortcutAction::LAST_ONE_DO_NOT_USE:
|
case VShortcutAction::LAST_ONE_DO_NOT_USE:
|
||||||
Q_UNREACHABLE();
|
Q_UNREACHABLE();
|
||||||
break;
|
break;
|
||||||
|
@ -193,7 +287,7 @@ auto VAbstractShortcutManager::ShortcutActionToString(VShortcutAction type) -> Q
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
auto VAbstractShortcutManager::ReadableName(VShortcutAction type) -> QString
|
auto VAbstractShortcutManager::ReadableName(VShortcutAction type) -> QString
|
||||||
{
|
{
|
||||||
Q_STATIC_ASSERT_X(static_cast<int>(VShortcutAction::LAST_ONE_DO_NOT_USE) == 35, "Translate all actions.");
|
Q_STATIC_ASSERT_X(static_cast<int>(VShortcutAction::LAST_ONE_DO_NOT_USE) == 82, "Translate all actions.");
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
@ -267,6 +361,100 @@ auto VAbstractShortcutManager::ReadableName(VShortcutAction type) -> QString
|
||||||
return tr("Find next match", "shortcut for action");
|
return tr("Find next match", "shortcut for action");
|
||||||
case VShortcutAction::FindPrevious:
|
case VShortcutAction::FindPrevious:
|
||||||
return tr("Find previus match", "shortcut for action");
|
return tr("Find previus match", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolEndLine:
|
||||||
|
return tr("Tool 'Point at distance and angle'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolLine:
|
||||||
|
return tr("Tool 'Line between points'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolAlongLine:
|
||||||
|
return tr("Tool 'Point at distance along line'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolShoulderPoint:
|
||||||
|
return tr("Tool 'Special point on shoulder'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolNormal:
|
||||||
|
return tr("Tool 'Point along perpendicular'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolBisector:
|
||||||
|
return tr("Tool 'Point along bisector'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolLineIntersect:
|
||||||
|
return tr("Tool 'Point at line intersection'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolSpline:
|
||||||
|
return tr("Tool 'Simple curve'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolCubicBezier:
|
||||||
|
return tr("Tool 'Curve which uses point as control handle'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolArc:
|
||||||
|
return tr("Tool 'Arc'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolSplinePath:
|
||||||
|
return tr("Tool 'Curved path'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolCubicBezierPath:
|
||||||
|
return tr("Tool 'Curved path which uses point as control handle'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolPointOfContact:
|
||||||
|
return tr("Tool 'Point of intersection circle and segment'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolPiece:
|
||||||
|
return tr("Tool 'Workpiece tool'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolPiecePath:
|
||||||
|
return tr("Tool 'Internal path tool'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolHeight:
|
||||||
|
return tr("Tool 'Perpendicular point along line'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolTriangle:
|
||||||
|
return tr("Tool 'Triangle'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolPointOfIntersection:
|
||||||
|
return tr("Tool 'Point from X and Y of two other points'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolCutSpline:
|
||||||
|
return tr("Tool 'Segmenting a simple curve'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolCutSplinePath:
|
||||||
|
return tr("Tool 'Segment a curved path'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolUnionDetails:
|
||||||
|
return tr("Tool 'Piece union'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolDuplicateDetail:
|
||||||
|
return tr("Tool 'Duplicate piece'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolCutArc:
|
||||||
|
return tr("Tool 'Segment an arc'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolLineIntersectAxis:
|
||||||
|
return tr("Tool 'Point of intersection line and axis'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolCurveIntersectAxis:
|
||||||
|
return tr("Tool 'Point of intersection curve and axis'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolArcIntersectAxis:
|
||||||
|
return tr("Tool 'Point of intersection arc and axis'", "shortcut for action");
|
||||||
|
case VShortcutAction::LayoutSettings:
|
||||||
|
return tr("Layout settings", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolPointOfIntersectionArcs:
|
||||||
|
return tr("Tool 'Point of intersection arcs'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolPointOfIntersectionCircles:
|
||||||
|
return tr("Tool 'Point of intersection circles'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolPointOfIntersectionCurves:
|
||||||
|
return tr("Tool 'Point intersection curves'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolPointFromCircleAndTangent:
|
||||||
|
return tr("Tool 'Point from circle and tangent'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolPointFromArcAndTangent:
|
||||||
|
return tr("Tool 'Point from arc and tangent'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolArcWithLength:
|
||||||
|
return tr("Tool 'Arc with given length'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolTrueDarts:
|
||||||
|
return tr("Tool 'True darts'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolGroup:
|
||||||
|
return tr("Tool 'Visibility group'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolRotation:
|
||||||
|
return tr("Tool 'Rotate objects'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolFlippingByLine:
|
||||||
|
return tr("Tool 'Flipping objects by line'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolFlippingByAxis:
|
||||||
|
return tr("Tool 'Flipping objects by axis'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolMove:
|
||||||
|
return tr("Tool 'Move objects'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolMidpoint:
|
||||||
|
return tr("Tool 'Midpoint between two points'", "shortcut for action");
|
||||||
|
case VShortcutAction::ExportDrawAs:
|
||||||
|
return tr("Export draw as", "shortcut for action");
|
||||||
|
case VShortcutAction::ExportLayoutAs:
|
||||||
|
return tr("Export layout as", "shortcut for action");
|
||||||
|
case VShortcutAction::ExportDetailsAs:
|
||||||
|
return tr("Export details as", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolEllipticalArc:
|
||||||
|
return tr("Tool 'Elliptical Arc'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolPin:
|
||||||
|
return tr("Tool 'Pin'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolInsertNode:
|
||||||
|
return tr("Tool 'Insert node'", "shortcut for action");
|
||||||
|
case VShortcutAction::ToolPlaceLabel:
|
||||||
|
return tr("Tool 'Place label'", "shortcut for action");
|
||||||
case VShortcutAction::LAST_ONE_DO_NOT_USE:
|
case VShortcutAction::LAST_ONE_DO_NOT_USE:
|
||||||
Q_UNREACHABLE(); //-V501
|
Q_UNREACHABLE(); //-V501
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -82,6 +82,53 @@ enum class VShortcutAction
|
||||||
RegexMatchUnicodeProperties,
|
RegexMatchUnicodeProperties,
|
||||||
FindNext,
|
FindNext,
|
||||||
FindPrevious,
|
FindPrevious,
|
||||||
|
ToolEndLine,
|
||||||
|
ToolLine,
|
||||||
|
ToolAlongLine,
|
||||||
|
ToolShoulderPoint,
|
||||||
|
ToolNormal,
|
||||||
|
ToolBisector,
|
||||||
|
ToolLineIntersect,
|
||||||
|
ToolSpline,
|
||||||
|
ToolCubicBezier,
|
||||||
|
ToolArc,
|
||||||
|
ToolSplinePath,
|
||||||
|
ToolCubicBezierPath,
|
||||||
|
ToolPointOfContact,
|
||||||
|
ToolPiece,
|
||||||
|
ToolPiecePath,
|
||||||
|
ToolHeight,
|
||||||
|
ToolTriangle,
|
||||||
|
ToolPointOfIntersection,
|
||||||
|
ToolCutSpline,
|
||||||
|
ToolCutSplinePath,
|
||||||
|
ToolUnionDetails,
|
||||||
|
ToolDuplicateDetail,
|
||||||
|
ToolCutArc,
|
||||||
|
ToolLineIntersectAxis,
|
||||||
|
ToolCurveIntersectAxis,
|
||||||
|
ToolArcIntersectAxis,
|
||||||
|
LayoutSettings,
|
||||||
|
ToolPointOfIntersectionArcs,
|
||||||
|
ToolPointOfIntersectionCircles,
|
||||||
|
ToolPointOfIntersectionCurves,
|
||||||
|
ToolPointFromCircleAndTangent,
|
||||||
|
ToolPointFromArcAndTangent,
|
||||||
|
ToolArcWithLength,
|
||||||
|
ToolTrueDarts,
|
||||||
|
ToolGroup,
|
||||||
|
ToolRotation,
|
||||||
|
ToolFlippingByLine,
|
||||||
|
ToolFlippingByAxis,
|
||||||
|
ToolMove,
|
||||||
|
ToolMidpoint,
|
||||||
|
ExportDrawAs,
|
||||||
|
ExportLayoutAs,
|
||||||
|
ExportDetailsAs,
|
||||||
|
ToolEllipticalArc,
|
||||||
|
ToolPin,
|
||||||
|
ToolInsertNode,
|
||||||
|
ToolPlaceLabel,
|
||||||
LAST_ONE_DO_NOT_USE
|
LAST_ONE_DO_NOT_USE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user