Keyboard shortcuts for each tool.

This commit is contained in:
Roman Telezhynskyi 2023-10-24 14:27:41 +03:00
parent 434a1d0acf
commit 3bbab78d4d
5 changed files with 363 additions and 58 deletions

View File

@ -98,7 +98,6 @@ VValentinaShortcutManager::VValentinaShortcutManager(QObject *parent)
{QKeySequence(Qt::ControlModifier QKEY_SEQUENCE_OP Qt::Key_H).toString()},
{}});
AddShortcut({VShortcutAction::Quit, KeyBindingsToStringList(QKeySequence::Quit), {}});
AddShortcut({VShortcutAction::LastTool, {QKeySequence(Qt::Key_L).toString()}, {}});
AddShortcut({VShortcutAction::CurveDetails, {QKeySequence(Qt::Key_F2).toString()}, {}});
AddShortcut({VShortcutAction::FinalMeasurements,
{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::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
}

View File

@ -191,6 +191,7 @@
#include "dialogs/vwidgetbackgroundimages.h"
#include "dialogs/vwidgetdetails.h"
#include "dialogs/vwidgetgroups.h"
#include "qtpreprocessorsupport.h"
#include "ui_mainwindow.h"
#include "vabstractapplication.h"
#include "vabstractshortcutmanager.h"
@ -3320,55 +3321,71 @@ void MainWindow::InitToolButtons()
// 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.");
connect(ui->actionEndLineTool, &QAction::triggered, this, &MainWindow::ToolEndLine);
connect(ui->actionLineTool, &QAction::triggered, this, &MainWindow::ToolLine);
connect(ui->actionAlongLineTool, &QAction::triggered, this, &MainWindow::ToolAlongLine);
connect(ui->actionShoulderPointTool, &QAction::triggered, this, &MainWindow::ToolShoulderPoint);
connect(ui->actionNormalTool, &QAction::triggered, this, &MainWindow::ToolNormal);
connect(ui->actionBisectorTool, &QAction::triggered, this, &MainWindow::ToolBisector);
connect(ui->actionLineIntersectTool, &QAction::triggered, this, &MainWindow::ToolLineIntersect);
connect(ui->actionSplineTool, &QAction::triggered, this, &MainWindow::ToolSpline);
connect(ui->actionCubicBezierTool, &QAction::triggered, this, &MainWindow::ToolCubicBezier);
connect(ui->actionArcTool, &QAction::triggered, this, &MainWindow::ToolArc);
connect(ui->actionSplinePathTool, &QAction::triggered, this, &MainWindow::ToolSplinePath);
connect(ui->actionCubicBezierPathTool, &QAction::triggered, this, &MainWindow::ToolCubicBezierPath);
connect(ui->actionPointOfContactTool, &QAction::triggered, this, &MainWindow::ToolPointOfContact);
connect(ui->actionNewDetailTool, &QAction::triggered, this, &MainWindow::ToolDetail);
connect(ui->actionInternalPathTool, &QAction::triggered, this, &MainWindow::ToolPiecePath);
connect(ui->actionHeightTool, &QAction::triggered, this, &MainWindow::ToolHeight);
connect(ui->actionTriangleTool, &QAction::triggered, this, &MainWindow::ToolTriangle);
connect(ui->actionPointOfIntersectionTool, &QAction::triggered, this, &MainWindow::ToolPointOfIntersection);
connect(ui->actionSplineCutPointTool, &QAction::triggered, this, &MainWindow::ToolCutSpline);
connect(ui->actionSplinePathCutPointTool, &QAction::triggered, this, &MainWindow::ToolCutSplinePath);
connect(ui->actionUnionDetailsTool, &QAction::triggered, this, &MainWindow::ToolUnionDetails);
connect(ui->actionDuplicateDetailTool, &QAction::triggered, this, &MainWindow::ToolDuplicateDetail);
connect(ui->actionArcCutPointTool, &QAction::triggered, this, &MainWindow::ToolCutArc);
connect(ui->actionLineIntersectAxisTool, &QAction::triggered, this, &MainWindow::ToolLineIntersectAxis);
connect(ui->actionCurveIntersectAxisTool, &QAction::triggered, this, &MainWindow::ToolCurveIntersectAxis);
connect(ui->actionArcIntersectAxisTool, &QAction::triggered, this, &MainWindow::ToolArcIntersectAxis);
connect(ui->actionLayoutSettings, &QAction::triggered, this, &MainWindow::ToolLayoutSettings);
connect(ui->actionPointOfIntersectionArcsTool, &QAction::triggered, this, &MainWindow::ToolPointOfIntersectionArcs);
connect(ui->actionPointOfIntersectionCirclesTool, &QAction::triggered, this,
auto InitToolButton = [this](VShortcutAction type, QAction *action, void (MainWindow::*slotFunction)(bool))
{
m_shortcutActions.insert(type, action);
connect(action, &QAction::triggered, this, slotFunction);
};
InitToolButton(VShortcutAction::ToolEndLine, ui->actionEndLineTool, &MainWindow::ToolEndLine);
InitToolButton(VShortcutAction::ToolLine, ui->actionLineTool, &MainWindow::ToolLine);
InitToolButton(VShortcutAction::ToolAlongLine, ui->actionAlongLineTool, &MainWindow::ToolAlongLine);
InitToolButton(VShortcutAction::ToolShoulderPoint, ui->actionShoulderPointTool, &MainWindow::ToolShoulderPoint);
InitToolButton(VShortcutAction::ToolNormal, ui->actionNormalTool, &MainWindow::ToolNormal);
InitToolButton(VShortcutAction::ToolBisector, ui->actionBisectorTool, &MainWindow::ToolBisector);
InitToolButton(VShortcutAction::ToolLineIntersect, ui->actionLineIntersectTool, &MainWindow::ToolLineIntersect);
InitToolButton(VShortcutAction::ToolSpline, ui->actionSplineTool, &MainWindow::ToolSpline);
InitToolButton(VShortcutAction::ToolCubicBezier, ui->actionCubicBezierTool, &MainWindow::ToolCubicBezier);
InitToolButton(VShortcutAction::ToolArc, ui->actionArcTool, &MainWindow::ToolArc);
InitToolButton(VShortcutAction::ToolSplinePath, ui->actionSplinePathTool, &MainWindow::ToolSplinePath);
InitToolButton(VShortcutAction::ToolCubicBezierPath, ui->actionCubicBezierPathTool,
&MainWindow::ToolCubicBezierPath);
InitToolButton(VShortcutAction::ToolPointOfContact, ui->actionPointOfContactTool, &MainWindow::ToolPointOfContact);
InitToolButton(VShortcutAction::ToolPiece, ui->actionNewDetailTool, &MainWindow::ToolDetail);
InitToolButton(VShortcutAction::ToolPiecePath, ui->actionInternalPathTool, &MainWindow::ToolPiecePath);
InitToolButton(VShortcutAction::ToolHeight, ui->actionHeightTool, &MainWindow::ToolHeight);
InitToolButton(VShortcutAction::ToolTriangle, ui->actionTriangleTool, &MainWindow::ToolTriangle);
InitToolButton(VShortcutAction::ToolPointOfIntersection, ui->actionPointOfIntersectionTool,
&MainWindow::ToolPointOfIntersection);
InitToolButton(VShortcutAction::ToolCutSpline, ui->actionSplineCutPointTool, &MainWindow::ToolCutSpline);
InitToolButton(VShortcutAction::ToolCutSplinePath, ui->actionSplinePathCutPointTool,
&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);
connect(ui->actionIntersectionCurvesTool, &QAction::triggered, this, &MainWindow::ToolPointOfIntersectionCurves);
connect(ui->actionPointFromCircleAndTangentTool, &QAction::triggered, this,
InitToolButton(VShortcutAction::ToolPointOfIntersectionCurves, ui->actionIntersectionCurvesTool,
&MainWindow::ToolPointOfIntersectionCurves);
InitToolButton(VShortcutAction::ToolPointFromCircleAndTangent, ui->actionPointFromCircleAndTangentTool,
&MainWindow::ToolPointFromCircleAndTangent);
connect(ui->actionPointFromArcAndTangentTool, &QAction::triggered, this, &MainWindow::ToolPointFromArcAndTangent);
connect(ui->actionArcWithLengthTool, &QAction::triggered, this, &MainWindow::ToolArcWithLength);
connect(ui->actionTrueDartsTool, &QAction::triggered, this, &MainWindow::ToolTrueDarts);
connect(ui->actionGroupTool, &QAction::triggered, this, &MainWindow::ToolGroup);
connect(ui->actionRotationTool, &QAction::triggered, this, &MainWindow::ToolRotation);
connect(ui->actionFlippingByLineTool, &QAction::triggered, this, &MainWindow::ToolFlippingByLine);
connect(ui->actionFlippingByAxisTool, &QAction::triggered, this, &MainWindow::ToolFlippingByAxis);
connect(ui->actionMoveTool, &QAction::triggered, this, &MainWindow::ToolMove);
connect(ui->actionMidpointTool, &QAction::triggered, this, &MainWindow::ToolMidpoint);
connect(ui->actionExportDraw, &QAction::triggered, this, &MainWindow::ExportDrawAs);
connect(ui->actionLayoutExportAs, &QAction::triggered, this, &MainWindow::ExportLayoutAs);
connect(ui->actionDetailExportAs, &QAction::triggered, this, &MainWindow::ExportDetailsAs);
connect(ui->actionEllipticalArcTool, &QAction::triggered, this, &MainWindow::ToolEllipticalArc);
connect(ui->actionPinTool, &QAction::triggered, this, &MainWindow::ToolPin);
connect(ui->actionInsertNodeTool, &QAction::triggered, this, &MainWindow::ToolInsertNode);
connect(ui->actionPlaceLabelTool, &QAction::triggered, this, &MainWindow::ToolPlaceLabel);
InitToolButton(VShortcutAction::ToolPointFromArcAndTangent, ui->actionPointFromArcAndTangentTool,
&MainWindow::ToolPointFromArcAndTangent);
InitToolButton(VShortcutAction::ToolArcWithLength, ui->actionArcWithLengthTool, &MainWindow::ToolArcWithLength);
InitToolButton(VShortcutAction::ToolTrueDarts, ui->actionTrueDartsTool, &MainWindow::ToolTrueDarts);
InitToolButton(VShortcutAction::ToolGroup, ui->actionGroupTool, &MainWindow::ToolGroup);
InitToolButton(VShortcutAction::ToolRotation, ui->actionRotationTool, &MainWindow::ToolRotation);
InitToolButton(VShortcutAction::ToolFlippingByLine, ui->actionFlippingByLineTool, &MainWindow::ToolFlippingByLine);
InitToolButton(VShortcutAction::ToolFlippingByAxis, ui->actionFlippingByAxisTool, &MainWindow::ToolFlippingByAxis);
InitToolButton(VShortcutAction::ToolMove, ui->actionMoveTool, &MainWindow::ToolMove);
InitToolButton(VShortcutAction::ToolMidpoint, ui->actionMidpointTool, &MainWindow::ToolMidpoint);
InitToolButton(VShortcutAction::ExportDrawAs, ui->actionExportDraw, &MainWindow::ExportDrawAs);
InitToolButton(VShortcutAction::ExportLayoutAs, ui->actionLayoutExportAs, &MainWindow::ExportLayoutAs);
InitToolButton(VShortcutAction::ExportDetailsAs, ui->actionDetailExportAs, &MainWindow::ExportDetailsAs);
InitToolButton(VShortcutAction::ToolEllipticalArc, ui->actionEllipticalArcTool, &MainWindow::ToolEllipticalArc);
InitToolButton(VShortcutAction::ToolPin, ui->actionPinTool, &MainWindow::ToolPin);
InitToolButton(VShortcutAction::ToolInsertNode, ui->actionInsertNodeTool, &MainWindow::ToolInsertNode);
InitToolButton(VShortcutAction::ToolPlaceLabel, ui->actionPlaceLabelTool, &MainWindow::ToolPlaceLabel);
}
//---------------------------------------------------------------------------------------------------------------------
@ -6634,8 +6651,10 @@ void MainWindow::CreateMeasurements()
#endif
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::ExportDrawAs()
void MainWindow::ExportDrawAs(bool checked)
{
Q_UNUSED(checked)
auto Uncheck = qScopeGuard([this] { ui->actionExportDraw->setChecked(false); });
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); });
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); });
QVector<DetailForLayout> detailsInLayout = SortDetailsForLayout(pattern->DataPieces());

View File

@ -140,9 +140,9 @@ private slots:
#if defined(Q_OS_MAC)
void CreateMeasurements();
#endif
void ExportDrawAs();
void ExportLayoutAs();
void ExportDetailsAs();
void ExportDrawAs(bool checked);
void ExportLayoutAs(bool checked);
void ExportDetailsAs(bool checked);
void ArrowTool(bool checked);
void ToolEndLine(bool checked);

View File

@ -107,7 +107,7 @@ auto VAbstractShortcutManager::GetShortcutsList() const -> QList<VAbstractShortc
//---------------------------------------------------------------------------------------------------------------------
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)
{
@ -181,6 +181,100 @@ auto VAbstractShortcutManager::ShortcutActionToString(VShortcutAction type) -> Q
return "findnext"_L1;
case VShortcutAction::FindPrevious:
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:
Q_UNREACHABLE();
break;
@ -193,7 +287,7 @@ auto VAbstractShortcutManager::ShortcutActionToString(VShortcutAction type) -> Q
//---------------------------------------------------------------------------------------------------------------------
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)
{
@ -267,6 +361,100 @@ auto VAbstractShortcutManager::ReadableName(VShortcutAction type) -> QString
return tr("Find next match", "shortcut for action");
case VShortcutAction::FindPrevious:
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:
Q_UNREACHABLE(); //-V501
break;

View File

@ -82,6 +82,53 @@ enum class VShortcutAction
RegexMatchUnicodeProperties,
FindNext,
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
};