Skip to content

Commit

Permalink
Sketcher: move icons to tools subdirectory
Browse files Browse the repository at this point in the history
Add the icon path to the workbench's `InitGui.py`.
  • Loading branch information
vocx-fc authored and yorikvanhavre committed Oct 1, 2020
1 parent a2f8ea9 commit 7f9c582
Show file tree
Hide file tree
Showing 18 changed files with 41 additions and 30 deletions.
38 changes: 23 additions & 15 deletions src/Mod/Sketcher/Gui/CommandSketcherTools.cpp
Expand Up @@ -132,7 +132,7 @@ void CmdSketcherCloseShape::activated(int iMsg)
int GeoIdLast=-1;

// undo command open
openCommand("add coincident constraint");
openCommand("Add coincident constraint");
// go through the selected subelements
for (unsigned int i=0; i<(SubNames.size()-1); i++ ) {
// only handle edges
Expand Down Expand Up @@ -234,7 +234,7 @@ void CmdSketcherConnect::activated(int iMsg)
Sketcher::SketchObject* Obj = static_cast<Sketcher::SketchObject*>(selection[0].getObject());

// undo command open
openCommand("add coincident constraint");
openCommand("Add coincident constraint");

// go through the selected subelements
for (unsigned int i=0; i<(SubNames.size()-1); i++ ) {
Expand Down Expand Up @@ -1042,13 +1042,18 @@ void CmdSketcherSymmetry::activated(int iMsg)

if ( geoids == 0 || (geoids == 1 && LastGeoId>=0 && !lastvertexoraxis) ) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("A symmetric construction requires at least two geometric elements, the last geometric element being the reference for the symmetry construction."));
QObject::tr("A symmetric construction requires "
"at least two geometric elements, "
"the last geometric element being the reference "
"for the symmetry construction."));
return;
}

if ( lastgeotype == invalid ) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("The last element must be a point or a line serving as reference for the symmetry construction."));
QObject::tr("The last element must be a point "
"or a line serving as reference "
"for the symmetry construction."));
return;
}

Expand Down Expand Up @@ -1106,6 +1111,7 @@ class SketcherCopy : public Gui::Command {
virtual void activate() = 0;
};

// TODO: replace XPM cursor with SVG file
static const char *cursor_createcopy[]={
"32 32 3 1",
"+ c white",
Expand Down Expand Up @@ -1350,7 +1356,7 @@ void SketcherCopy::activate(SketcherCopy::Op op)

if (geoids < 1) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("A copy requires at least one selected non-external geometric element"));
QObject::tr("A copy requires at least one selected non-external geometric element"));
return;
}

Expand All @@ -1375,23 +1381,24 @@ void SketcherCopy::activate(SketcherCopy::Op op)
}

// Ask the user if he wants to clone or to simple copy
/*int ret = QMessageBox::question(Gui::getMainWindow(), QObject::tr("Dimensional/Geometric constraints"),
* QObject::tr("Do you want to clone the object, i.e. substitute dimensional constraints by geometric constraints?"),
* QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel);
* // use an equality constraint
* if (ret == QMessageBox::Yes) {
* clone = true;
}
else if (ret == QMessageBox::Cancel) {
/*
int ret = QMessageBox::question(Gui::getMainWindow(), QObject::tr("Dimensional/Geometric constraints"),
QObject::tr("Do you want to clone the object, i.e. substitute dimensional constraints by geometric constraints?"),
QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel);
// use an equality constraint
if (ret == QMessageBox::Yes) {
clone = true;
}
else if (ret == QMessageBox::Cancel) {
// do nothing
return;
}*/
}
*/

ActivateAcceleratorHandler(getActiveGuiDocument(),new DrawSketchHandlerCopy(geoIdList, LastGeoId, LastPointPos, geoids, op));
}



class CmdSketcherCopy : public SketcherCopy
{
public:
Expand Down Expand Up @@ -1622,6 +1629,7 @@ bool CmdSketcherCompCopy::isActive(void)
}


// TODO: replace XPM cursor with SVG file
/* XPM */
static const char *cursor_createrectangulararray[]={
"32 32 3 1",
Expand Down
32 changes: 17 additions & 15 deletions src/Mod/Sketcher/Gui/Resources/Sketcher.qrc
Expand Up @@ -61,10 +61,6 @@
<qresource>
<file>icons/Sketcher_CarbonCopy.svg</file>
<file>icons/Sketcher_CarbonCopy_Constr.svg</file>
<file>icons/Sketcher_Clone.svg</file>
<file>icons/Sketcher_CloseShape.svg</file>
<file>icons/Sketcher_ConnectLines.svg</file>
<file>icons/Sketcher_Copy.svg</file>
</qresource>
<qresource>
<file>icons/geometry/Sketcher_Conics.svg</file>
Expand Down Expand Up @@ -167,7 +163,6 @@
<file>icons/Sketcher_MapSketch.svg</file>
<file>icons/Sketcher_MergeSketch.svg</file>
<file>icons/Sketcher_MirrorSketch.svg</file>
<file>icons/Sketcher_Move.svg</file>
<file>icons/Sketcher_NewSketch.svg</file>
<file alias="icons/preferences-sketcher.svg">icons/Sketcher_NewSketch.svg</file>
</qresource>
Expand All @@ -193,20 +188,27 @@
<file>icons/pointers/Sketcher_Pointer_Slot.svg</file>
<file>icons/pointers/Sketcher_Pointer_Trimming.svg</file>
</qresource>
<qresource>
<file>icons/tools/Sketcher_Clone.svg</file>
<file>icons/tools/Sketcher_CloseShape.svg</file>
<file>icons/tools/Sketcher_ConnectLines.svg</file>
<file>icons/tools/Sketcher_Copy.svg</file>
<file>icons/tools/Sketcher_Move.svg</file>
<file>icons/tools/Sketcher_RectangularArray.svg</file>
<file>icons/tools/Sketcher_SelectConflictingConstraints.svg</file>
<file>icons/tools/Sketcher_SelectConstraints.svg</file>
<file>icons/tools/Sketcher_SelectElementsAssociatedWithConstraints.svg</file>
<file>icons/tools/Sketcher_SelectElementsWithDoFs.svg</file>
<file>icons/tools/Sketcher_SelectHorizontalAxis.svg</file>
<file>icons/tools/Sketcher_SelectOrigin.svg</file>
<file>icons/tools/Sketcher_SelectRedundantConstraints.svg</file>
<file>icons/tools/Sketcher_SelectVerticalAxis.svg</file>
<file>icons/tools/Sketcher_Symmetry.svg</file>
</qresource>
<qresource>
<file>icons/Sketcher_ProfilesHexagon1.svg</file>
<file>icons/Sketcher_RectangularArray.svg</file>
<file>icons/Sketcher_SelectConflictingConstraints.svg</file>
<file>icons/Sketcher_SelectConstraints.svg</file>
<file>icons/Sketcher_SelectElementsAssociatedWithConstraints.svg</file>
<file>icons/Sketcher_SelectElementsWithDoFs.svg</file>
<file>icons/Sketcher_SelectHorizontalAxis.svg</file>
<file>icons/Sketcher_SelectOrigin.svg</file>
<file>icons/Sketcher_SelectRedundantConstraints.svg</file>
<file>icons/Sketcher_SelectVerticalAxis.svg</file>
<file>icons/Sketcher_Sketch.svg</file>
<file>icons/Sketcher_SwitchVirtualSpace.svg</file>
<file>icons/Sketcher_Symmetry.svg</file>
<file>icons/Sketcher_ToggleActiveConstraint.svg</file>
<file>icons/Sketcher_ToggleConstraint.svg</file>
<file>icons/Sketcher_Toggle_Constraint_Driven.svg</file>
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Sketcher/InitGui.py
Expand Up @@ -48,6 +48,7 @@ def Initialize(self):
# Gui.addIconPath(":/icons/obsolete")
Gui.addIconPath(":/icons/pointers")
Gui.addIconPath(":/icons/splines")
Gui.addIconPath(":/icons/tools")
try:
import Profiles
except ImportError:
Expand Down

0 comments on commit 7f9c582

Please sign in to comment.