Sketcher: Declare tr function for DrawSketchHandler

This commit is contained in:
Kacper Donat
2025-06-28 20:15:43 +02:00
parent ed14e6b24f
commit 4ac445afe7
26 changed files with 181 additions and 179 deletions

View File

@@ -23,8 +23,8 @@
#ifndef SKETCHERGUI_DrawSketchHandler_H
#define SKETCHERGUI_DrawSketchHandler_H
#include <QCursor>
#include <QPixmap>
#include <QCoreApplication>
#include <Inventor/SbString.h>
@@ -142,6 +142,8 @@ private:
*/
class SketcherGuiExport DrawSketchHandler: public Gui::ToolHandler
{
Q_DECLARE_TR_FUNCTIONS(DrawSketchHandler)
public:
DrawSketchHandler();
virtual ~DrawSketchHandler();
@@ -162,10 +164,11 @@ public:
return false;
}
virtual std::list<Gui::InputHint> getToolHints() const
std::list<Gui::InputHint> getToolHints() const override
{
return {};
}
void quit() override;
friend class ViewProviderSketch;

View File

@@ -93,8 +93,7 @@ private:
using State = std::pair<ConstructionMethod, SelectMode>;
using enum Gui::InputHint::UserInput;
const auto switchHint =
Gui::InputHint {.message = QObject::tr("%1 switch mode"), .sequences = {KeyM}};
const Gui::InputHint switchModeHint {tr("%1 switch mode"), {KeyM}};
return Gui::lookupHints<State>(
{constructionMethod(), state()},
@@ -103,40 +102,40 @@ private:
{.state = {ConstructionMethod::Center, SelectMode::SeekFirst},
.hints =
{
{QObject::tr("%1 pick arc center"), {MouseLeft}},
switchHint,
{tr("%1 pick arc center"), {MouseLeft}},
switchModeHint,
}},
{.state = {ConstructionMethod::Center, SelectMode::SeekSecond},
.hints =
{
{QObject::tr("%1 pick arc start point"), {MouseLeft}},
switchHint,
{tr("%1 pick arc start point"), {MouseLeft}},
switchModeHint,
}},
{.state = {ConstructionMethod::Center, SelectMode::SeekThird},
.hints =
{
{QObject::tr("%1 pick arc end point"), {MouseLeft}},
switchHint,
{tr("%1 pick arc end point"), {MouseLeft}},
switchModeHint,
}},
// ThreeRim method
{.state = {ConstructionMethod::ThreeRim, SelectMode::SeekFirst},
.hints =
{
{QObject::tr("%1 pick first arc point"), {MouseLeft}},
switchHint,
{tr("%1 pick first arc point"), {MouseLeft}},
switchModeHint,
}},
{.state = {ConstructionMethod::ThreeRim, SelectMode::SeekSecond},
.hints =
{
{QObject::tr("%1 pick second arc point"), {MouseLeft}},
switchHint,
{tr("%1 pick second arc point"), {MouseLeft}},
switchModeHint,
}},
{.state = {ConstructionMethod::ThreeRim, SelectMode::SeekThird},
.hints =
{
{QObject::tr("%1 pick third arc point"), {MouseLeft}},
switchHint,
{tr("%1 pick third arc point"), {MouseLeft}},
switchModeHint,
}},
});
}
@@ -390,7 +389,7 @@ private:
QString getToolWidgetText() const override
{
return QString(QObject::tr("Arc parameters"));
return QString(tr("Arc parameters"));
}
bool canGoToNextMode() override

View File

@@ -415,22 +415,22 @@ private:
{.state = STATUS_SEEK_First,
.hints =
{
{QObject::tr("%1 pick ellipse center"), {MouseLeft}},
{tr("%1 pick ellipse center"), {MouseLeft}},
}},
{.state = STATUS_SEEK_Second,
.hints =
{
{QObject::tr("%1 pick axis point"), {MouseLeft}},
{tr("%1 pick axis point"), {MouseLeft}},
}},
{.state = STATUS_SEEK_Third,
.hints =
{
{QObject::tr("%1 pick arc start point"), {MouseLeft}},
{tr("%1 pick arc start point"), {MouseLeft}},
}},
{.state = STATUS_SEEK_Fourth,
.hints =
{
{QObject::tr("%1 pick arc end point"), {MouseLeft}},
{tr("%1 pick arc end point"), {MouseLeft}},
}},
});
}

View File

@@ -414,22 +414,22 @@ private:
{.state = STATUS_SEEK_First,
.hints =
{
{QObject::tr("%1 pick center point"), {MouseLeft}},
{tr("%1 pick center point"), {MouseLeft}},
}},
{.state = STATUS_SEEK_Second,
.hints =
{
{QObject::tr("%1 pick axis point"), {MouseLeft}},
{tr("%1 pick axis point"), {MouseLeft}},
}},
{.state = STATUS_SEEK_Third,
.hints =
{
{QObject::tr("%1 pick arc start point"), {MouseLeft}},
{tr("%1 pick arc start point"), {MouseLeft}},
}},
{.state = STATUS_SEEK_Fourth,
.hints =
{
{QObject::tr("%1 pick arc end point"), {MouseLeft}},
{tr("%1 pick arc end point"), {MouseLeft}},
}},
});
}

View File

@@ -344,22 +344,22 @@ private:
{.state = STATUS_SEEK_First,
.hints =
{
{QObject::tr("%1 pick focus point"), {MouseLeft}},
{tr("%1 pick focus point"), {MouseLeft}},
}},
{.state = STATUS_SEEK_Second,
.hints =
{
{QObject::tr("%1 pick axis point"), {MouseLeft}},
{tr("%1 pick axis point"), {MouseLeft}},
}},
{.state = STATUS_SEEK_Third,
.hints =
{
{QObject::tr("%1 pick starting point"), {MouseLeft}},
{tr("%1 pick starting point"), {MouseLeft}},
}},
{.state = STATUS_SEEK_Fourth,
.hints =
{
{QObject::tr("%1 pick end point"), {MouseLeft}},
{tr("%1 pick end point"), {MouseLeft}},
}},
});
}

View File

@@ -97,30 +97,29 @@ public:
{
using enum Gui::InputHint::UserInput;
return Gui::lookupHints<SelectMode>(
state(),
{
{.state = SelectMode::SeekFirst,
.hints =
{
{QObject::tr("%1 pick slot center"), {MouseLeft}},
}},
{.state = SelectMode::SeekSecond,
.hints =
{
{QObject::tr("%1 pick slot radius"), {MouseLeft}},
}},
{.state = SelectMode::SeekThird,
.hints =
{
{QObject::tr("%1 pick slot angle"), {MouseLeft}},
}},
{.state = SelectMode::SeekFourth,
.hints =
{
{QObject::tr("%1 pick slot width"), {MouseLeft}},
}},
});
return Gui::lookupHints<SelectMode>(state(),
{
{.state = SelectMode::SeekFirst,
.hints =
{
{tr("%1 pick slot center"), {MouseLeft}},
}},
{.state = SelectMode::SeekSecond,
.hints =
{
{tr("%1 pick slot radius"), {MouseLeft}},
}},
{.state = SelectMode::SeekThird,
.hints =
{
{tr("%1 pick slot angle"), {MouseLeft}},
}},
{.state = SelectMode::SeekFourth,
.hints =
{
{tr("%1 pick slot width"), {MouseLeft}},
}},
});
}
private:
@@ -297,7 +296,7 @@ private:
QString getToolWidgetText() const override
{
return QString(QObject::tr("Arc Slot parameters"));
return QString(tr("Arc Slot parameters"));
}
bool canGoToNextMode() override

View File

@@ -409,8 +409,7 @@ private:
using State = std::pair<ConstructionMethod, SelectMode>;
using enum Gui::InputHint::UserInput;
const auto switchHint =
Gui::InputHint {.message = QObject::tr("%1 switch mode"), .sequences = {KeyM}};
const Gui::InputHint switchModeHint {tr("%1 switch mode"), {KeyM}};
return Gui::lookupHints<State>(
{constructionMethod(), state()},
@@ -419,30 +418,30 @@ private:
{.state = {ConstructionMethod::ControlPoints, SelectMode::SeekFirst},
.hints =
{
{QObject::tr("%1 pick first control point"), {MouseLeft}},
switchHint,
{tr("%1 pick first control point"), {MouseLeft}},
switchModeHint,
}},
{.state = {ConstructionMethod::ControlPoints, SelectMode::SeekSecond},
.hints =
{
{QObject::tr("%1 pick next control point"), {MouseLeft}},
{QObject::tr("%1 finish B-spline"), {MouseRight}},
switchHint,
{tr("%1 pick next control point"), {MouseLeft}},
{tr("%1 finish B-spline"), {MouseRight}},
switchModeHint,
}},
// Knots method
{.state = {ConstructionMethod::Knots, SelectMode::SeekFirst},
.hints =
{
{QObject::tr("%1 pick first knot"), {MouseLeft}},
switchHint,
{tr("%1 pick first knot"), {MouseLeft}},
switchModeHint,
}},
{.state = {ConstructionMethod::Knots, SelectMode::SeekSecond},
.hints =
{
{QObject::tr("%1 pick next knot"), {MouseLeft}},
{QObject::tr("%1 finish B-spline"), {MouseRight}},
switchHint,
{tr("%1 pick next knot"), {MouseLeft}},
{tr("%1 finish B-spline"), {MouseRight}},
switchModeHint,
}},
});
}
@@ -489,7 +488,7 @@ private:
QString getToolWidgetText() const override
{
return QString(QObject::tr("B-spline parameters"));
return QString(tr("B-spline parameters"));
}
bool canGoToNextMode() override

View File

@@ -223,8 +223,10 @@ private:
public:
std::list<Gui::InputHint> getToolHints() const override
{
return {{QObject::tr("%1 pick sketch to copy", "Sketcher CarbonCopy: hint"),
{Gui::InputHint::UserInput::MouseLeft}}};
return {
{tr("%1 pick sketch to copy", "Sketcher CarbonCopy: hint"),
{Gui::InputHint::UserInput::MouseLeft}},
};
}
};

View File

@@ -83,7 +83,7 @@ private:
using State = std::pair<ConstructionMethod, SelectMode>;
using enum Gui::InputHint::UserInput;
const Gui::InputHint switchModeHint = {QObject::tr("%1 switch mode"), {KeyM}};
const Gui::InputHint switchModeHint = {tr("%1 switch mode"), {KeyM}};
return Gui::lookupHints<State>(
{constructionMethod(), state()},
@@ -92,13 +92,13 @@ private:
{.state = {ConstructionMethod::Center, SelectMode::SeekFirst},
.hints =
{
{QObject::tr("%1 pick circle center"), {MouseLeft}},
{tr("%1 pick circle center"), {MouseLeft}},
switchModeHint,
}},
{.state = {ConstructionMethod::Center, SelectMode::SeekSecond},
.hints =
{
{QObject::tr("%1 pick rim point"), {MouseLeft}},
{tr("%1 pick rim point"), {MouseLeft}},
switchModeHint,
}},
@@ -106,19 +106,19 @@ private:
{.state = {ConstructionMethod::ThreeRim, SelectMode::SeekFirst},
.hints =
{
{QObject::tr("%1 pick first rim point"), {MouseLeft}},
{tr("%1 pick first rim point"), {MouseLeft}},
switchModeHint,
}},
{.state = {ConstructionMethod::ThreeRim, SelectMode::SeekSecond},
.hints =
{
{QObject::tr("%1 pick second rim point"), {MouseLeft}},
{tr("%1 pick second rim point"), {MouseLeft}},
switchModeHint,
}},
{.state = {ConstructionMethod::ThreeRim, SelectMode::SeekThird},
.hints =
{
{QObject::tr("%1 pick third rim point"), {MouseLeft}},
{tr("%1 pick third rim point"), {MouseLeft}},
switchModeHint,
}},
});
@@ -307,7 +307,7 @@ private:
QString getToolWidgetText() const override
{
return QString(QObject::tr("Circle parameters"));
return QString(tr("Circle parameters"));
}
bool canGoToNextMode() override

View File

@@ -89,7 +89,7 @@ private:
using State = std::pair<ConstructionMethod, SelectMode>;
using enum Gui::InputHint::UserInput;
const Gui::InputHint switchModeHint {QObject::tr("%1 switch mode"), {KeyM}};
const Gui::InputHint switchModeHint {tr("%1 switch mode"), {KeyM}};
return Gui::lookupHints<State>(
{constructionMethod(), state()},
@@ -98,19 +98,19 @@ private:
{.state = {ConstructionMethod::Center, SelectMode::SeekFirst},
.hints =
{
{QObject::tr("%1 pick ellipse center"), {MouseLeft}},
{tr("%1 pick ellipse center"), {MouseLeft}},
switchModeHint,
}},
{.state = {ConstructionMethod::Center, SelectMode::SeekSecond},
.hints =
{
{QObject::tr("%1 pick axis endpoint"), {MouseLeft}},
{tr("%1 pick axis endpoint"), {MouseLeft}},
switchModeHint,
}},
{.state = {ConstructionMethod::Center, SelectMode::SeekThird},
.hints =
{
{QObject::tr("%1 pick minor axis endpoint"), {MouseLeft}},
{tr("%1 pick minor axis endpoint"), {MouseLeft}},
switchModeHint,
}},
@@ -118,19 +118,19 @@ private:
{.state = {ConstructionMethod::ThreeRim, SelectMode::SeekFirst},
.hints =
{
{QObject::tr("%1 pick first rim point"), {MouseLeft}},
{tr("%1 pick first rim point"), {MouseLeft}},
switchModeHint,
}},
{.state = {ConstructionMethod::ThreeRim, SelectMode::SeekSecond},
.hints =
{
{QObject::tr("%1 pick second rim point"), {MouseLeft}},
{tr("%1 pick second rim point"), {MouseLeft}},
switchModeHint,
}},
{.state = {ConstructionMethod::ThreeRim, SelectMode::SeekThird},
.hints =
{
{QObject::tr("%1 pick third rim point"), {MouseLeft}},
{tr("%1 pick third rim point"), {MouseLeft}},
switchModeHint,
}},
});
@@ -325,7 +325,7 @@ private:
QString getToolWidgetText() const override
{
return QString(QObject::tr("Ellipse parameters"));
return QString(tr("Ellipse parameters"));
}
bool canGoToNextMode() override

View File

@@ -384,14 +384,12 @@ public:
{.state = STATUS_SEEK_First,
.hints =
{
{QObject::tr("%1 pick edge to extend", "Sketcher Extend: hint"),
{MouseLeft}},
{tr("%1 pick edge to extend", "Sketcher Extend: hint"), {MouseLeft}},
}},
{.state = STATUS_SEEK_Second,
.hints =
{
{QObject::tr("%1 set extension length", "Sketcher Extend: hint"),
{MouseLeft}},
{tr("%1 set extension length", "Sketcher Extend: hint"), {MouseLeft}},
}},
});
}

View File

@@ -248,8 +248,10 @@ private:
public:
std::list<Gui::InputHint> getToolHints() const override
{
return {{QObject::tr("%1 pick external geometry", "Sketcher External: hint"),
{Gui::InputHint::UserInput::MouseLeft}}};
return {
{tr("%1 pick external geometry", "Sketcher External: hint"),
{Gui::InputHint::UserInput::MouseLeft}},
};
}
};

View File

@@ -277,16 +277,14 @@ private:
catch (const Base::CADKernelError& e) {
if (e.getTranslatable()) {
Gui::TranslatedUserError(sketchgui,
QObject::tr("CAD Kernel Error"),
QObject::tr(e.getMessage().c_str()));
tr("CAD Kernel Error"),
tr(e.getMessage().c_str()));
}
Gui::Selection().clearSelection();
Gui::Command::abortCommand();
}
catch (const Base::ValueError& e) {
Gui::TranslatedUserError(sketchgui,
QObject::tr("Value Error"),
QObject::tr(e.getMessage().c_str()));
Gui::TranslatedUserError(sketchgui, tr("Value Error"), tr(e.getMessage().c_str()));
Gui::Selection().clearSelection();
Gui::Command::abortCommand();
}
@@ -347,7 +345,7 @@ private:
QString getToolWidgetText() const override
{
return QString(QObject::tr("Fillet/Chamfer parameters"));
return QString(tr("Fillet/Chamfer parameters"));
}
bool canGoToNextMode() override
@@ -418,16 +416,16 @@ public:
return Gui::lookupHints<SelectMode>(
state(),
{{.state = SelectMode::SeekFirst,
.hints = {{QObject::tr("%1 pick first edge or point",
"Sketcher Fillet/Chamfer: hint"),
{MouseLeft}}}},
{.state = SelectMode::SeekSecond,
.hints = {{QObject::tr("%1 pick second edge", "Sketcher Fillet/Chamfer: hint"),
{MouseLeft}}}},
{.state = SelectMode::End,
.hints = {{QObject::tr("%1 create fillet", "Sketcher Fillet/Chamfer: hint"),
{MouseLeft}}}}});
{
{.state = SelectMode::SeekFirst,
.hints = {{tr("%1 pick first edge or point", "Sketcher Fillet/Chamfer: hint"),
{MouseLeft}}}},
{.state = SelectMode::SeekSecond,
.hints = {{tr("%1 pick second edge", "Sketcher Fillet/Chamfer: hint"),
{MouseLeft}}}},
{.state = SelectMode::End,
.hints = {{tr("%1 create fillet", "Sketcher Fillet/Chamfer: hint"), {MouseLeft}}}},
});
}
};

View File

@@ -214,7 +214,7 @@ private:
QString getToolWidgetText() const override
{
return QString(QObject::tr("Line parameters"));
return QString(tr("Line parameters"));
}
bool canGoToNextMode() override
@@ -261,8 +261,7 @@ private:
using State = std::pair<ConstructionMethod, SelectMode>;
using enum Gui::InputHint::UserInput;
const auto switchHint =
Gui::InputHint {.message = QObject::tr("%1 switch mode"), .sequences = {KeyM}};
const Gui::InputHint switchModeHint {tr("%1 switch mode"), {KeyM}};
return Gui::lookupHints<State>(
{constructionMethod(), state()},
@@ -271,42 +270,42 @@ private:
{.state = {ConstructionMethod::OnePointLengthAngle, SelectMode::SeekFirst},
.hints =
{
{QObject::tr("%1 pick first point"), {MouseLeft}},
switchHint,
{tr("%1 pick first point"), {MouseLeft}},
switchModeHint,
}},
{.state = {ConstructionMethod::OnePointLengthAngle, SelectMode::SeekSecond},
.hints =
{
{QObject::tr("%1 pick second point"), {MouseLeft}},
switchHint,
{tr("%1 pick second point"), {MouseLeft}},
switchModeHint,
}},
// OnePointWidthHeight method
{.state = {ConstructionMethod::OnePointWidthHeight, SelectMode::SeekFirst},
.hints =
{
{QObject::tr("%1 pick first point"), {MouseLeft}},
switchHint,
{tr("%1 pick first point"), {MouseLeft}},
switchModeHint,
}},
{.state = {ConstructionMethod::OnePointWidthHeight, SelectMode::SeekSecond},
.hints =
{
{QObject::tr("%1 pick second point"), {MouseLeft}},
switchHint,
{tr("%1 pick second point"), {MouseLeft}},
switchModeHint,
}},
// TwoPoints method
{.state = {ConstructionMethod::TwoPoints, SelectMode::SeekFirst},
.hints =
{
{QObject::tr("%1 pick first point"), {MouseLeft}},
switchHint,
{tr("%1 pick first point"), {MouseLeft}},
switchModeHint,
}},
{.state = {ConstructionMethod::TwoPoints, SelectMode::SeekSecond},
.hints =
{
{QObject::tr("%1 pick second point"), {MouseLeft}},
switchHint,
{tr("%1 pick second point"), {MouseLeft}},
switchModeHint,
}},
});
}

View File

@@ -776,14 +776,14 @@ private:
{.state = STATUS_SEEK_First,
.hints =
{
{QObject::tr("%1 pick first point"), {MouseLeft}},
{tr("%1 pick first point"), {MouseLeft}},
}},
{.state = STATUS_SEEK_Second,
.hints =
{
{QObject::tr("%1 pick next point"), {MouseLeft}},
{QObject::tr("%1 finish"), {MouseRight}},
{QObject::tr("%1 switch mode"), {KeyM}},
{tr("%1 pick next point"), {MouseLeft}},
{tr("%1 finish"), {MouseRight}},
{tr("%1 switch mode"), {KeyM}},
}},
});
// clang-format on

View File

@@ -179,7 +179,7 @@ private:
QString getToolWidgetText() const override
{
return QString(QObject::tr("Offset parameters"));
return QString(tr("Offset parameters"));
}
void activated() override
@@ -196,8 +196,9 @@ public:
{
using enum Gui::InputHint::UserInput;
return {{QObject::tr("%1 set offset direction and distance", "Sketcher Offset: hint"),
{MouseLeft}}};
return {
{tr("%1 set offset direction and distance", "Sketcher Offset: hint"), {MouseLeft}},
};
}
private:

View File

@@ -66,7 +66,9 @@ private:
std::list<Gui::InputHint> getToolHints() const override
{
using enum Gui::InputHint::UserInput;
return {{QObject::tr("%1 place a point", "Sketcher Point: hint"), {MouseLeft}}};
return {
{tr("%1 place a point", "Sketcher Point: hint"), {MouseLeft}},
};
}
void updateDataAndDrawToPosition(Base::Vector2d onSketchPos) override

View File

@@ -200,7 +200,7 @@ private:
QString getToolWidgetText() const override
{
return QString(QObject::tr("Polygon parameters"));
return QString(tr("Polygon parameters"));
}
bool canGoToNextMode() override
@@ -273,15 +273,15 @@ private:
{.state = SelectMode::SeekFirst,
.hints =
{
{QObject::tr("%1 pick polygon center"), {MouseLeft}},
{QObject::tr("%1/%2 increase / decrease number of sides"), {KeyU, KeyJ}},
{tr("%1 pick polygon center"), {MouseLeft}},
{tr("%1/%2 increase / decrease number of sides"), {KeyU, KeyJ}},
}},
{.state = SelectMode::SeekSecond,
.hints =
{
{QObject::tr("%1 pick rotation and size"), {MouseMove}},
{QObject::tr("%1 confirm"), {MouseLeft}},
{QObject::tr("%1/%2 increase / decrease number of sides"), {KeyU, KeyJ}},
{tr("%1 pick rotation and size"), {MouseMove}},
{tr("%1 confirm"), {MouseLeft}},
{tr("%1/%2 increase / decrease number of sides"), {KeyU, KeyJ}},
}},
});
}

View File

@@ -114,8 +114,7 @@ private:
using State = std::pair<ConstructionMethod, SelectMode>;
using enum Gui::InputHint::UserInput;
const Gui::InputHint switchHint {.message = QObject::tr("%1 switch mode"),
.sequences = {KeyM}};
const Gui::InputHint switchHint {.message = tr("%1 switch mode"), .sequences = {KeyM}};
return Gui::lookupHints<State>(
{constructionMethod(), state()},
@@ -124,25 +123,25 @@ private:
{.state = {ConstructionMethod::Diagonal, SelectMode::SeekFirst},
.hints =
{
{QObject::tr("%1 pick first corner"), {MouseLeft}},
{tr("%1 pick first corner"), {MouseLeft}},
switchHint,
}},
{.state = {ConstructionMethod::Diagonal, SelectMode::SeekSecond},
.hints =
{
{QObject::tr("%1 pick opposite corner"), {MouseLeft}},
{tr("%1 pick opposite corner"), {MouseLeft}},
switchHint,
}},
{.state = {ConstructionMethod::Diagonal, SelectMode::SeekThird},
.hints =
{
{QObject::tr("%1 set corner radius or frame thickness"), {MouseMove}},
{tr("%1 set corner radius or frame thickness"), {MouseMove}},
switchHint,
}},
{.state = {ConstructionMethod::Diagonal, SelectMode::SeekFourth},
.hints =
{
{QObject::tr("%1 set frame thickness"), {MouseMove}},
{tr("%1 set frame thickness"), {MouseMove}},
switchHint,
}},
@@ -150,25 +149,25 @@ private:
{.state = {ConstructionMethod::CenterAndCorner, SelectMode::SeekFirst},
.hints =
{
{QObject::tr("%1 pick center"), {MouseLeft}},
{tr("%1 pick center"), {MouseLeft}},
switchHint,
}},
{.state = {ConstructionMethod::CenterAndCorner, SelectMode::SeekSecond},
.hints =
{
{QObject::tr("%1 pick corner"), {MouseLeft}},
{tr("%1 pick corner"), {MouseLeft}},
switchHint,
}},
{.state = {ConstructionMethod::CenterAndCorner, SelectMode::SeekThird},
.hints =
{
{QObject::tr("%1 set corner radius or frame thickness"), {MouseMove}},
{tr("%1 set corner radius or frame thickness"), {MouseMove}},
switchHint,
}},
{.state = {ConstructionMethod::CenterAndCorner, SelectMode::SeekFourth},
.hints =
{
{QObject::tr("%1 set frame thickness"), {MouseMove}},
{tr("%1 set frame thickness"), {MouseMove}},
switchHint,
}},
@@ -176,25 +175,25 @@ private:
{.state = {ConstructionMethod::ThreePoints, SelectMode::SeekFirst},
.hints =
{
{QObject::tr("%1 pick first corner"), {MouseLeft}},
{tr("%1 pick first corner"), {MouseLeft}},
switchHint,
}},
{.state = {ConstructionMethod::ThreePoints, SelectMode::SeekSecond},
.hints =
{
{QObject::tr("%1 pick second corner"), {MouseLeft}},
{tr("%1 pick second corner"), {MouseLeft}},
switchHint,
}},
{.state = {ConstructionMethod::ThreePoints, SelectMode::SeekThird},
.hints =
{
{QObject::tr("%1 pick third corner"), {MouseLeft}},
{tr("%1 pick third corner"), {MouseLeft}},
switchHint,
}},
{.state = {ConstructionMethod::ThreePoints, SelectMode::SeekFourth},
.hints =
{
{QObject::tr("%1 set corner radius or frame thickness"), {MouseMove}},
{tr("%1 set corner radius or frame thickness"), {MouseMove}},
switchHint,
}},
@@ -202,25 +201,25 @@ private:
{.state = {ConstructionMethod::CenterAnd3Points, SelectMode::SeekFirst},
.hints =
{
{QObject::tr("%1 pick center"), {MouseLeft}},
{tr("%1 pick center"), {MouseLeft}},
switchHint,
}},
{.state = {ConstructionMethod::CenterAnd3Points, SelectMode::SeekSecond},
.hints =
{
{QObject::tr("%1 pick first corner"), {MouseLeft}},
{tr("%1 pick first corner"), {MouseLeft}},
switchHint,
}},
{.state = {ConstructionMethod::CenterAnd3Points, SelectMode::SeekThird},
.hints =
{
{QObject::tr("%1 pick second corner"), {MouseLeft}},
{tr("%1 pick second corner"), {MouseLeft}},
switchHint,
}},
{.state = {ConstructionMethod::CenterAnd3Points, SelectMode::SeekFourth},
.hints =
{
{QObject::tr("%1 set corner radius or frame thickness"), {MouseMove}},
{tr("%1 set corner radius or frame thickness"), {MouseMove}},
switchHint,
}},
});
@@ -704,7 +703,7 @@ private:
QString getToolWidgetText() const override
{
return QString(QObject::tr("Rectangle parameters"));
return QString(tr("Rectangle parameters"));
}
void angleSnappingControl() override

View File

@@ -93,19 +93,17 @@ public:
{.state = SelectMode::SeekFirst,
.hints =
{
{QObject::tr("%1 pick center point", "Sketcher Rotate: hint"),
{MouseLeft}},
{tr("%1 pick center point", "Sketcher Rotate: hint"), {MouseLeft}},
}},
{.state = SelectMode::SeekSecond,
.hints =
{
{QObject::tr("%1 set start angle", "Sketcher Rotate: hint"), {MouseLeft}},
{tr("%1 set start angle", "Sketcher Rotate: hint"), {MouseLeft}},
}},
{.state = SelectMode::SeekThird,
.hints =
{
{QObject::tr("%1 set rotation angle", "Sketcher Rotate: hint"),
{MouseLeft}},
{tr("%1 set rotation angle", "Sketcher Rotate: hint"), {MouseLeft}},
}},
});
}
@@ -202,7 +200,7 @@ private:
QString getToolWidgetText() const override
{
return QString(QObject::tr("Rotate parameters"));
return QString(tr("Rotate parameters"));
}
void activated() override

View File

@@ -143,12 +143,12 @@ public:
{.state = SelectMode::SeekFirst,
.hints =
{
{QObject::tr("%1 pick reference point"), {MouseLeft}},
{tr("%1 pick reference point"), {MouseLeft}},
}},
{.state = SelectMode::SeekSecond,
.hints =
{
{QObject::tr("%1 set scale factor"), {MouseLeft}},
{tr("%1 set scale factor"), {MouseLeft}},
}},
});
}
@@ -211,7 +211,7 @@ private:
QString getToolWidgetText() const override
{
return QString(QObject::tr("Scale parameters"));
return QString(tr("Scale parameters"));
}
void activated() override

View File

@@ -91,17 +91,17 @@ private:
{.state = SelectMode::SeekFirst,
.hints =
{
{QObject::tr("%1 pick slot start point"), {MouseLeft}},
{tr("%1 pick slot start point"), {MouseLeft}},
}},
{.state = SelectMode::SeekSecond,
.hints =
{
{QObject::tr("%1 pick slot end point"), {MouseLeft}},
{tr("%1 pick slot end point"), {MouseLeft}},
}},
{.state = SelectMode::SeekThird,
.hints =
{
{QObject::tr("%1 pick slot width"), {MouseLeft}},
{tr("%1 pick slot width"), {MouseLeft}},
}},
});
}

View File

@@ -200,8 +200,10 @@ private:
public:
std::list<Gui::InputHint> getToolHints() const override
{
return {{QObject::tr("%1 pick location on edge to split", "Sketcher Splitting: hint"),
{Gui::InputHint::UserInput::MouseLeft}}};
return {
{tr("%1 pick location on edge to split", "Sketcher Splitting: hint"),
{Gui::InputHint::UserInput::MouseLeft}},
};
}
};

View File

@@ -191,7 +191,7 @@ private:
QString getToolWidgetText() const override
{
return QString(QObject::tr("Symmetry parameters"));
return QString(tr("Symmetry parameters"));
}
void activated() override
@@ -221,7 +221,8 @@ public:
using enum Gui::InputHint::UserInput;
return {
{QObject::tr("%1 pick axis, edge, or point", "Sketcher Symmetry: hint"), {MouseLeft}}};
{tr("%1 pick axis, edge, or point", "Sketcher Symmetry: hint"), {MouseLeft}},
};
}
void deleteOriginalGeos()

View File

@@ -172,7 +172,7 @@ private:
QString getToolWidgetText() const override
{
return QString(QObject::tr("Translate parameters"));
return QString(tr("Translate parameters"));
}
void onButtonPressed(Base::Vector2d onSketchPos) override
@@ -435,15 +435,13 @@ public:
return Gui::lookupHints<SelectMode>(
state(),
{{.state = SelectMode::SeekFirst,
.hints = {{QObject::tr("%1 pick reference point", "Sketcher Translate: hint"),
{MouseLeft}}}},
.hints = {{tr("%1 pick reference point", "Sketcher Translate: hint"), {MouseLeft}}}},
{.state = SelectMode::SeekSecond,
.hints = {{QObject::tr("%1 set translation vector", "Sketcher Translate: hint"),
.hints = {{tr("%1 set translation vector", "Sketcher Translate: hint"),
{MouseLeft}}}},
{.state = SelectMode::SeekThird,
.hints = {
{QObject::tr("%1 set second translation vector", "Sketcher Translate: hint"),
{MouseLeft}}}}});
.hints = {{tr("%1 set second translation vector", "Sketcher Translate: hint"),
{MouseLeft}}}}});
}
};

View File

@@ -212,8 +212,10 @@ private:
public:
std::list<Gui::InputHint> getToolHints() const override
{
return {{QObject::tr("%1 pick edge to trim", "Sketcher Trimming: hint"),
{Gui::InputHint::UserInput::MouseLeft}}};
return {
{tr("%1 pick edge to trim", "Sketcher Trimming: hint"),
{Gui::InputHint::UserInput::MouseLeft}},
};
}
};