Merge branch 'master' into bugfix/path-ellipsis-cmdsForEdge

This commit is contained in:
mlampert
2021-02-12 09:38:47 -08:00
committed by GitHub
114 changed files with 8317 additions and 4175 deletions
+4
View File
@@ -5297,6 +5297,10 @@ How do you want to proceed?</source>
<source>Expression...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Auto expand</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Gui::PropertyEditor::PropertyModel</name>
+8 -1
View File
@@ -38,7 +38,9 @@ using namespace Gui::TaskView;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
TaskDialog::TaskDialog()
: QObject(0), pos(North), escapeButton(true)
: QObject(nullptr), pos(North)
, escapeButton(true)
, autoCloseTransaction(false)
{
}
@@ -84,6 +86,11 @@ void TaskDialog::closed()
}
void TaskDialog::autoClosedOnTransactionChange()
{
}
void TaskDialog::clicked(int)
{
+13
View File
@@ -75,6 +75,15 @@ public:
return escapeButton;
}
/// Defines whether a task dialog must be closed if the document changed the
/// active transaction.
void setAutoCloseOnTransactionChange(bool on) {
autoCloseTransaction = on;
}
bool isAutoCloseOnTransactionChange() const {
return autoCloseTransaction;
}
const std::string& getDocumentName() const
{ return documentName; }
void setDocumentName(const std::string& doc)
@@ -105,6 +114,9 @@ public:
virtual void open();
/// is called by the framework when the dialog is closed
virtual void closed();
/// is called by the framework when the dialog is automatically closed due to
/// changing the active transaction
virtual void autoClosedOnTransactionChange();
/// is called by the framework if a button is clicked which has no accept or reject role
virtual void clicked(int);
/// is called by the framework if the dialog is accepted (Ok)
@@ -129,6 +141,7 @@ protected:
private:
std::string documentName;
bool escapeButton;
bool autoCloseTransaction;
};
} //namespace TaskView
+10
View File
@@ -532,12 +532,22 @@ void TaskView::slotDeletedDocument()
void TaskView::slotUndoDocument(const App::Document&)
{
if (ActiveDialog && ActiveDialog->isAutoCloseOnTransactionChange()) {
ActiveDialog->autoClosedOnTransactionChange();
removeDialog();
}
if (!ActiveDialog)
updateWatcher();
}
void TaskView::slotRedoDocument(const App::Document&)
{
if (ActiveDialog && ActiveDialog->isAutoCloseOnTransactionChange()) {
ActiveDialog->autoClosedOnTransactionChange();
removeDialog();
}
if (!ActiveDialog)
updateWatcher();
}
@@ -46,6 +46,7 @@
<file>icons/Reinforcement_workbench_icon.svg</file>
<file>icons/Reporting_workbench_icon.svg</file>
<file>icons/Render_workbench_icon.svg</file>
<file>icons/Rocket_workbench_icon.svg</file>
<file>icons/sheetmetal_workbench_icon.svg</file>
<file>icons/slic3r-tools_workbench_icon.svg</file>
<file>icons/Ship_workbench_icon.svg</file>
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
id="svg2086"
version="1.1"
viewBox="0 0 16.933333 16.933334"
height="64"
width="64">
<defs
id="defs2080" />
<metadata
id="metadata2083">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1">
<path
id="path2655"
d="M 1.3229166,8.4666666 3.96875,6.6145832 H 15.875 v 1.8520834"
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
id="path2657"
d="M 5.2916667,6.6145833 V 8.4666667"
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
id="path2659"
d="m 11.90625,6.6145832 2.05787,-3.9687499 h 1.646296 v 3.9687499"
style="fill:none;stroke:#000000;stroke-width:0.404157px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
id="path2655-5"
d="M 1.3229166,8.4666666 3.96875,10.31875 H 15.875 V 8.4666666"
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
id="path2657-3"
d="M 5.2916667,10.31875 V 8.4666667"
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
id="path2659-1"
d="m 12.170833,10.31875 1.910879,3.704167 h 1.528704 V 10.31875"
style="fill:none;stroke:#000000;stroke-width:0.37625px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
transform="scale(0.26458333)"
id="path2692"
d="m 50.900726,24.445457 c 0,-0.0173 1.001378,-2.034446 2.225284,-4.482552 l 2.225284,-4.451103 h 1.562788 1.562788 v 4.482552 4.482552 h -3.788072 c -2.083439,0 -3.788072,-0.01415 -3.788072,-0.03145 z"
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.0631345" />
<path
transform="scale(0.26458333)"
id="path2694"
d="m 53.12601,44.016926 c -1.223906,-2.448107 -2.225284,-4.465255 -2.225284,-4.482552 0,-0.0173 1.704633,-0.03145 3.788072,-0.03145 h 3.788072 v 4.482552 4.482552 h -1.562788 -1.562788 z"
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.0631345" />
<path
transform="scale(0.26458333)"
id="path2696"
d="m 10.161089,34.957785 -4.2163088,-2.95807 4.1847418,-2.928522 c 2.301608,-1.610688 4.220255,-2.949865 4.26366,-2.975949 0.06291,-0.03781 0.07892,1.157043 0.07892,5.890945 0,3.266105 -0.02131,5.936413 -0.04735,5.934019 -0.02604,-0.0024 -1.94469,-1.335485 -4.26366,-2.962423 z"
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.0631345" />
<path
id="path2702"
d="M 4.2333333,6.3499999 H 15.875"
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
id="path2704"
d="M 4.2333333,10.583333 H 15.875"
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
id="path2706"
d="M 15.875,6.3499999 V 10.583333"
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
transform="scale(0.26458333)"
id="path2708"
d="m 50.74289,44.481769 c -1.527856,-2.11964 -2.78739,-3.879721 -2.798964,-3.911291 -0.0123,-0.03354 0.683231,-0.0574 1.673304,-0.0574 h 1.694349 l 1.941148,3.88291 c 1.067631,2.1356 1.941148,3.897054 1.941148,3.914341 0,0.01729 -0.37644,0.03006 -0.836533,0.02838 l -0.836533,-0.003 -2.777919,-3.85389 z"
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.0631345" />
<path
transform="scale(0.26458333)"
id="path2710"
d="m 47.124858,23.351831 c 0.04537,-0.06321 1.412949,-1.824661 3.039055,-3.914342 l 2.956557,-3.799418 h 1.036702 c 0.570186,0 1.036703,0.01414 1.036703,0.03143 0,0.01729 -0.873517,1.778741 -1.941148,3.914341 l -1.941148,3.882909 h -2.13461 c -2.052483,0 -2.131435,-0.0044 -2.052111,-0.114922 z"
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.0631345" />
<path
transform="scale(0.26458333)"
id="path2712"
d="m 14.86518,38.247808 -0.332967,-0.240892 -0.01427,-6.000531 -0.01427,-6.000531 0.326038,-0.22783 0.326037,-0.227831 h 2.151993 2.151993 v 6.47129 6.471289 l -2.13079,-0.002 -2.130791,-0.002 z"
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.0631345" />
<path
transform="scale(0.26458333)"
id="path2714"
d="m 20.533015,32.021483 v -6.47129 h 19.477004 19.477004 v 6.47129 6.471289 H 40.010019 20.533015 Z"
style="fill:#ffffff;stroke:#ff0000;stroke-width:0.0631345" />
<path
transform="scale(0.26458333)"
id="path2716"
d="m 53.62519,52.145615 c -0.03184,-0.06077 -1.21454,-2.354918 -2.628214,-5.098113 -1.413674,-2.743196 -2.753099,-5.335658 -2.976501,-5.761027 -0.329763,-0.627885 -0.385075,-0.773033 -0.29398,-0.771462 0.06962,0.0012 0.273297,0.234823 0.536657,0.615562 0.233448,0.337494 1.49908,2.105179 2.812514,3.928189 l 2.388063,3.314563 h 0.880856 c 0.635669,0 0.894911,0.02197 0.931345,0.07892 0.03804,0.05946 0.415609,0.07892 1.531012,0.07892 h 1.480525 v 1.862469 1.862469 h -2.30219 c -2.128414,0 -2.306559,-0.0083 -2.360087,-0.110486 z"
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.0631345" />
<path
transform="scale(0.26458333)"
id="path2718"
d="m 46.745477,23.400296 c 0.01218,-0.03655 1.484797,-2.891043 3.272473,-6.343315 l 3.250321,-6.276857 2.478031,-0.0017 2.47803,-0.0017 v 2.335978 2.335977 h -1.454075 c -1.105068,0 -1.461324,0.01894 -1.48427,0.07892 -0.02292,0.05991 -0.292361,0.07453 -1.118657,0.0607 l -1.088462,-0.01822 -2.998891,3.861565 c -1.649389,2.123862 -3.008076,3.900616 -3.019303,3.948344 -0.01123,0.04773 -0.09172,0.08678 -0.178881,0.08678 -0.08716,0 -0.1485,-0.02991 -0.136316,-0.06646 z"
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.0631345" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.4 KiB

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS><TS version="2.0">
<!DOCTYPE TS><TS version="1.1">
<context>
<name>AddonInstaller</name>
<message>
<location filename="../../addonmanager_workers.py" line="536"/>
<location filename="addonmanager_workers.py" line="536"/>
<source>Installed location</source>
<translation type="unfinished"></translation>
</message>
@@ -11,267 +11,267 @@
<context>
<name>AddonsInstaller</name>
<message>
<location filename="../../addonmanager_macro.py" line="157"/>
<location filename="addonmanager_macro.py" line="157"/>
<source>Unable to fetch the code of this macro.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_macro.py" line="163"/>
<location filename="addonmanager_macro.py" line="164"/>
<source>Unable to retrieve a description for this macro.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.py" line="80"/>
<location filename="AddonManager.py" line="86"/>
<source>The addons that can be installed here are not officially part of FreeCAD, and are not reviewed by the FreeCAD team. Make sure you know what you are installing!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.py" line="200"/>
<location filename="AddonManager.py" line="200"/>
<source>Addon manager</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.py" line="202"/>
<location filename="AddonManager.py" line="205"/>
<source>You must restart FreeCAD for changes to take effect. Press Ok to restart FreeCAD now, or Cancel to restart later.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.py" line="244"/>
<location filename="AddonManager.py" line="244"/>
<source>Checking for updates...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.py" line="262"/>
<location filename="AddonManager.py" line="263"/>
<source>Apply</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.py" line="262"/>
<location filename="AddonManager.py" line="264"/>
<source>update(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.py" line="267"/>
<location filename="AddonManager.py" line="267"/>
<source>No update available</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.py" line="432"/>
<location filename="AddonManager.py" line="434"/>
<source>Macro successfully installed. The macro is now available from the Macros dialog.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.py" line="436"/>
<location filename="AddonManager.py" line="436"/>
<source>Unable to install</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.py" line="494"/>
<location filename="AddonManager.py" line="495"/>
<source>Addon successfully removed. Please restart FreeCAD</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.py" line="497"/>
<location filename="AddonManager.py" line="497"/>
<source>Unable to remove this addon</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.py" line="503"/>
<location filename="AddonManager.py" line="503"/>
<source>Macro successfully removed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.py" line="505"/>
<location filename="AddonManager.py" line="505"/>
<source>Macro could not be removed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="172"/>
<location filename="addonmanager_workers.py" line="172"/>
<source>Unable to download addon list.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="177"/>
<location filename="addonmanager_workers.py" line="177"/>
<source>Workbenches list was updated.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="733"/>
<location filename="addonmanager_workers.py" line="735"/>
<source>Outdated GitPython detected, consider upgrading with pip.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="297"/>
<location filename="addonmanager_workers.py" line="297"/>
<source>List of macros successfully retrieved.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="648"/>
<location filename="addonmanager_workers.py" line="648"/>
<source>Retrieving description...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="392"/>
<location filename="addonmanager_workers.py" line="392"/>
<source>Retrieving info from</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="533"/>
<location filename="addonmanager_workers.py" line="534"/>
<source>An update is available for this addon.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="521"/>
<location filename="addonmanager_workers.py" line="522"/>
<source>This addon is already installed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="650"/>
<location filename="addonmanager_workers.py" line="650"/>
<source>Retrieving info from git</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="653"/>
<location filename="addonmanager_workers.py" line="653"/>
<source>Retrieving info from wiki</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="696"/>
<location filename="addonmanager_workers.py" line="697"/>
<source>GitPython not found. Using standard download instead.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="700"/>
<location filename="addonmanager_workers.py" line="702"/>
<source>Your version of python doesn&apos;t appear to support ZIP files. Unable to proceed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="779"/>
<location filename="addonmanager_workers.py" line="783"/>
<source>Workbench successfully installed. Please restart FreeCAD to apply the changes.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="832"/>
<location filename="addonmanager_workers.py" line="832"/>
<source>Missing workbench</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="841"/>
<location filename="addonmanager_workers.py" line="841"/>
<source>Missing python module</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="849"/>
<location filename="addonmanager_workers.py" line="851"/>
<source>Missing optional python module (doesn&apos;t prevent installing)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="853"/>
<location filename="addonmanager_workers.py" line="854"/>
<source>Some errors were found that prevent to install this workbench</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="855"/>
<location filename="addonmanager_workers.py" line="856"/>
<source>Please install the missing components first.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="877"/>
<location filename="addonmanager_workers.py" line="877"/>
<source>Error: Unable to download</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="890"/>
<location filename="addonmanager_workers.py" line="890"/>
<source>Successfully installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="310"/>
<location filename="addonmanager_workers.py" line="311"/>
<source>GitPython not installed! Cannot retrieve macros from git</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.py" line="565"/>
<location filename="AddonManager.py" line="568"/>
<source>Installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.py" line="587"/>
<location filename="AddonManager.py" line="587"/>
<source>Update available</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.py" line="543"/>
<location filename="AddonManager.py" line="543"/>
<source>Restart required</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="660"/>
<location filename="addonmanager_workers.py" line="662"/>
<source>This macro is already installed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="793"/>
<location filename="addonmanager_workers.py" line="796"/>
<source>A macro has been installed and is available under Macro -&gt; Macros menu</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="548"/>
<location filename="addonmanager_workers.py" line="548"/>
<source>This addon is marked as obsolete</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="549"/>
<location filename="addonmanager_workers.py" line="552"/>
<source>This usually means it is no longer maintained, and some more advanced addon in this list provides the same functionality.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="870"/>
<location filename="addonmanager_workers.py" line="870"/>
<source>Error: Unable to locate zip from</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="318"/>
<location filename="addonmanager_workers.py" line="320"/>
<source>Something went wrong with the Git Macro Retrieval, possibly the Git executable is not in the path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="560"/>
<location filename="addonmanager_workers.py" line="560"/>
<source>This addon is marked as Python 2 Only</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="561"/>
<location filename="addonmanager_workers.py" line="565"/>
<source>This workbench may no longer be maintained and installing it on a Python 3 system will more than likely result in errors at startup or while in use.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="721"/>
<location filename="addonmanager_workers.py" line="724"/>
<source>User requested updating a Python 2 workbench on a system running Python 3 - </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="757"/>
<location filename="addonmanager_workers.py" line="760"/>
<source>Workbench successfully updated. Please restart FreeCAD to apply the changes.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="765"/>
<location filename="addonmanager_workers.py" line="768"/>
<source>User requested installing a Python 2 workbench on a system running Python 3 - </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="342"/>
<location filename="addonmanager_workers.py" line="344"/>
<source>Appears to be an issue connecting to the Wiki, therefore cannot retrieve Wiki macro list at this time</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="433"/>
<location filename="addonmanager_workers.py" line="434"/>
<source>Raw markdown displayed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../addonmanager_workers.py" line="435"/>
<location filename="addonmanager_workers.py" line="436"/>
<source>Python Markdown library is missing.</source>
<translation type="unfinished"></translation>
</message>
@@ -279,129 +279,129 @@
<context>
<name>Dialog</name>
<message>
<location filename="../../AddonManager.ui" line="37"/>
<location filename="AddonManager.ui" line="37"/>
<source>Workbenches</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.ui" line="47"/>
<location filename="AddonManager.ui" line="47"/>
<source>Macros</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.ui" line="59"/>
<location filename="AddonManager.ui" line="59"/>
<source>Execute</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.ui" line="113"/>
<location filename="AddonManager.ui" line="113"/>
<source>Downloading info...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.ui" line="150"/>
<location filename="AddonManager.ui" line="150"/>
<source>Update all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.ui" line="56"/>
<location filename="AddonManager.ui" line="56"/>
<source>Executes the selected macro, if installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.ui" line="127"/>
<location filename="AddonManager.ui" line="127"/>
<source>Uninstalls a selected macro or workbench</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.ui" line="137"/>
<location filename="AddonManager.ui" line="137"/>
<source>Installs or updates the selected macro or workbench</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.ui" line="147"/>
<location filename="AddonManager.ui" line="147"/>
<source>Download and apply all available updates</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManagerOptions.ui" line="35"/>
<location filename="AddonManagerOptions.ui" line="35"/>
<source>Custom repositories (one per line):</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.ui" line="89"/>
<location filename="AddonManager.ui" line="89"/>
<source>Sets configuration options for the Addon Manager</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.ui" line="92"/>
<location filename="AddonManager.ui" line="92"/>
<source>Configure...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManagerOptions.ui" line="14"/>
<location filename="AddonManagerOptions.ui" line="14"/>
<source>Addon manager options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.ui" line="130"/>
<location filename="AddonManager.ui" line="130"/>
<source>Uninstall selected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.ui" line="140"/>
<location filename="AddonManager.ui" line="140"/>
<source>Install/update selected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.ui" line="160"/>
<location filename="AddonManager.ui" line="160"/>
<source>Close</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManagerOptions.ui" line="20"/>
<location filename="AddonManagerOptions.ui" line="20"/>
<source>If this option is selected, when launching the Addon Manager,
installed addons will be checked for available updates
(this requires the GitPython package installed on your system)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManagerOptions.ui" line="25"/>
<location filename="AddonManagerOptions.ui" line="25"/>
<source>Automatically check for updates at start (requires GitPython)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManagerOptions.ui" line="57"/>
<location filename="AddonManagerOptions.ui" line="57"/>
<source>Proxy </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManagerOptions.ui" line="64"/>
<location filename="AddonManagerOptions.ui" line="64"/>
<source>No proxy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManagerOptions.ui" line="71"/>
<location filename="AddonManagerOptions.ui" line="71"/>
<source>User system proxy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManagerOptions.ui" line="78"/>
<location filename="AddonManagerOptions.ui" line="78"/>
<source>User defined proxy :</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.ui" line="14"/>
<location filename="AddonManager.ui" line="14"/>
<source>Addon Manager</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.ui" line="157"/>
<location filename="AddonManager.ui" line="157"/>
<source>Close the Addon Manager</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManagerOptions.ui" line="42"/>
<location filename="AddonManagerOptions.ui" line="42"/>
<source>You can use this window to specify additional addon repositories
to be scanned for available addons</source>
<translation type="unfinished"></translation>
@@ -410,12 +410,12 @@ to be scanned for available addons</source>
<context>
<name>Std_AddonMgr</name>
<message>
<location filename="../../AddonManager.py" line="70"/>
<location filename="AddonManager.py" line="70"/>
<source>&amp;Addon manager</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../AddonManager.py" line="71"/>
<location filename="AddonManager.py" line="71"/>
<source>Manage external workbenches and macros</source>
<translation type="unfinished"></translation>
</message>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -30,7 +30,7 @@
import FreeCAD as App
import draftutils.gui_utils as gui_utils
from draftutils.translate import _tr
from draftutils.translate import translate
from draftutils.messages import _err
@@ -54,7 +54,7 @@ def cut(object1, object2):
If there is a problem and the new object can't be created.
"""
if not App.activeDocument():
_err(_tr("No active document. Aborting."))
_err(translate("draft","No active document. Aborting."))
return
obj = App.activeDocument().addObject("Part::Cut", "Cut")
+11 -13
View File
@@ -36,7 +36,7 @@ import draftutils.gui_utils as gui_utils
import draftfunctions.cut as cut
from draftutils.messages import _msg
from draftutils.translate import _tr
from draftutils.translate import translate
def downgrade(objects, delete=False, force=None):
@@ -227,7 +227,7 @@ def downgrade(objects, delete=False, force=None):
shapify = utils.shapify
result = eval(force)(objects)
else:
_msg(_tr("Upgrade: Unknown force method:") + " " + force)
_msg(translate("draft","Upgrade: Unknown force method:") + " " + force)
result = None
else:
# applying transformation automatically
@@ -235,7 +235,7 @@ def downgrade(objects, delete=False, force=None):
if len(objects) == 1 and utils.get_type(objects[0]) == "Block":
result = explode(objects[0])
if result:
_msg(_tr("Found 1 block: exploding it"))
_msg(translate("draft","Found 1 block: exploding it"))
# we have one multi-solids compound object: extract its solids
elif (len(objects) == 1 and hasattr(objects[0], 'Shape')
@@ -243,15 +243,14 @@ def downgrade(objects, delete=False, force=None):
result = splitCompounds(objects)
# print(result)
if result:
_msg(_tr("Found 1 multi-solids compound: exploding it"))
_msg(translate("draft","Found 1 multi-solids compound: exploding it"))
# special case, we have one parametric object: we "de-parametrize" it
elif (len(objects) == 1 and hasattr(objects[0], 'Shape')
and hasattr(objects[0], 'Base')):
result = utils.shapify(objects[0])
if result:
_msg(_tr("Found 1 parametric object: "
"breaking its dependencies"))
_msg(translate("draft","Found 1 parametric object: breaking its dependencies"))
add_list.append(result)
# delete_list.append(objects[0])
@@ -259,35 +258,34 @@ def downgrade(objects, delete=False, force=None):
elif len(objects) == 2:
result = cut2(objects)
if result:
_msg(_tr("Found 2 objects: subtracting them"))
_msg(translate("draft","Found 2 objects: subtracting them"))
elif len(faces) > 1:
# one object with several faces: split it
if len(objects) == 1:
result = splitFaces(objects)
if result:
_msg(_tr("Found several faces: splitting them"))
_msg(translate("draft","Found several faces: splitting them"))
# several objects: remove all the faces from the first one
else:
result = subtr(objects)
if result:
_msg(_tr("Found several objects: "
"subtracting them from the first one"))
_msg(translate("draft","Found several objects: subtracting them from the first one"))
# only one face: we extract its wires
elif len(faces) > 0:
result = getWire(objects[0])
if result:
_msg(_tr("Found 1 face: extracting its wires"))
_msg(translate("draft","Found 1 face: extracting its wires"))
# no faces: split wire into single edges
elif not onlyedges:
result = splitWires(objects)
if result:
_msg(_tr("Found only wires: extracting their edges"))
_msg(translate("draft","Found only wires: extracting their edges"))
# no result has been obtained
if not result:
_msg(_tr("No more downgrade possible"))
_msg(translate("draft","No more downgrade possible"))
if delete:
names = []
+4 -4
View File
@@ -37,7 +37,7 @@ import draftutils.utils as utils
import draftutils.gui_utils as gui_utils
from draftutils.messages import _err
from draftutils.translate import _tr
from draftutils.translate import translate
if App.GuiUp:
import FreeCADGui as Gui
@@ -87,11 +87,11 @@ def mirror(objlist, p1, p2):
utils.print_header('mirror', "Create mirror")
if not objlist:
_err(_tr("No object given"))
_err(translate("draft","No object given"))
return
if p1 == p2:
_err(_tr("The two points are coincident"))
_err(translate("draft","The two points are coincident"))
return
if not isinstance(objlist, list):
@@ -110,7 +110,7 @@ def mirror(objlist, p1, p2):
for obj in objlist:
mir = App.ActiveDocument.addObject("Part::Mirroring", "mirror")
mir.Label = obj.Label + _tr(" (mirrored)")
mir.Label = obj.Label + " (" + translate("draft","mirrored" + ")")
mir.Source = obj
mir.Base = p1
mir.Normal = pnorm
+22 -27
View File
@@ -41,7 +41,7 @@ import draftmake.make_wire as make_wire
import draftmake.make_block as make_block
from draftutils.messages import _msg, _err
from draftutils.translate import _tr
from draftutils.translate import translate
from draftgeoutils.geometry import is_straight_line
# Delay import of module until first use because it is heavy
@@ -148,9 +148,9 @@ def upgrade(objects, delete=False, force=None):
delete_list.append(obj)
return newobj
else:
_err(_tr("Object must be a closed shape"))
_err(translate("draft","Object must be a closed shape"))
else:
_err(_tr("No solid object created"))
_err(translate("draft","No solid object created"))
return None
def closeWire(obj):
@@ -273,7 +273,7 @@ def upgrade(objects, delete=False, force=None):
if not checked:
coplanarity = DraftGeomUtils.is_coplanar(faces, 1e-3)
if not coplanarity:
_err(_tr("Faces must be coplanar to be refined"))
_err(translate("draft","Faces must be coplanar to be refined"))
return None
# fuse faces
@@ -429,7 +429,7 @@ def upgrade(objects, delete=False, force=None):
if force in all_func:
result = all_func[force](objects)
else:
_msg(_tr("Upgrade: Unknown force method:") + " " + force)
_msg(translate("draft","Upgrade: Unknown force method:") + " " + force)
result = None
else:
@@ -447,13 +447,13 @@ def upgrade(objects, delete=False, force=None):
if groups:
result = closeGroupWires(groups)
if result:
_msg(_tr("Found groups: closing each open object inside"))
_msg(translate("draft","Found groups: closing each open object inside"))
# if we have meshes, we try to turn them into shapes
elif meshes:
result = turnToParts(meshes)
if result:
_msg(_tr("Found meshes: turning into Part shapes"))
_msg(translate("draft","Found meshes: turning into Part shapes"))
# we have only faces here, no lone edges
elif faces and (len(wires) + len(openwires) == len(facewires)):
@@ -461,31 +461,29 @@ def upgrade(objects, delete=False, force=None):
if len(objects) == 1 and len(faces) > 3 and not faces_coplanarity:
result = makeSolid(objects[0])
if result:
_msg(_tr("Found 1 solidifiable object: solidifying it"))
_msg(translate("draft","Found 1 solidifiable object: solidifying it"))
# we have exactly 2 objects: we fuse them
elif len(objects) == 2 and not curves and not faces_coplanarity:
result = makeFusion(objects[0], objects[1])
if result:
_msg(_tr("Found 2 objects: fusing them"))
_msg(translate("draft","Found 2 objects: fusing them"))
# we have many separate faces: we try to make a shell or compound
elif len(objects) >= 2 and len(faces) > 1 and not loneedges:
result = makeShell(objects)
if result:
_msg(_tr("Found several objects: creating a "
_msg(translate("draft","Found several objects: creating a "
+ str(result.Shape.ShapeType)))
# we have faces: we try to join them if they are coplanar
elif len(objects) == 1 and len(faces) > 1:
result = joinFaces(objects, faces_coplanarity, True)
if result:
_msg(_tr("Found object with several coplanar faces: "
"refine them"))
_msg(translate("draft","Found object with several coplanar faces: refine them"))
# only one object: if not parametric, we "draftify" it
elif (len(objects) == 1
and not objects[0].isDerivedFrom("Part::Part2DObjectPython")):
result = ext_draftify.draftify(objects[0])
if result:
_msg(_tr("Found 1 non-parametric objects: "
"draftifying it"))
_msg(translate("draft","Found 1 non-parametric objects: draftifying it"))
# in the following cases there are no faces
elif not faces:
@@ -496,25 +494,24 @@ def upgrade(objects, delete=False, force=None):
and objects[0].isDerivedFrom("Sketcher::SketchObject")):
result = makeSketchFace(objects[0])
if result:
_msg(_tr("Found 1 closed sketch object: "
"creating a face from it"))
_msg(translate("draft","Found 1 closed sketch object: creating a face from it"))
# only closed wires
else:
result = makeFaces(objects)
if result:
_msg(_tr("Found closed wires: creating faces"))
_msg(translate("draft","Found closed wires: creating faces"))
# wires or edges: we try to join them
elif len(objects) > 1 and len(edges) > 1:
result = makeWires(objects)
if result:
_msg(_tr("Found several wires or edges: wiring them"))
_msg(translate("draft","Found several wires or edges: wiring them"))
# special case, we have only one open wire. We close it,
# unless it has only 1 edge!
elif len(objects) == 1 and len(openwires) == 1:
result = closeWire(objects[0])
_msg(_tr("trying: closing it"))
_msg(translate("draft","trying: closing it"))
if result:
_msg(_tr("Found 1 open wire: closing it"))
_msg(translate("draft","Found 1 open wire: closing it"))
# we have only one object that contains one edge
# TODO: improve draftify function
# only one object: if not parametric, we "draftify" it
@@ -522,8 +519,7 @@ def upgrade(objects, delete=False, force=None):
# and not objects[0].isDerivedFrom("Part::Part2DObjectPython")):
# result = ext_draftify.draftify(objects[0])
# if result:
# _msg(_tr("Found 1 non-parametric objects: "
# "draftifying it"))
# _msg(translate("draft","Found 1 non-parametric objects: draftifying it"))
elif (len(objects) == 1 and len(edges) == 1
and not objects[0].isDerivedFrom("Part::Part2DObjectPython")):
e = objects[0].Shape.Edges[0]
@@ -532,21 +528,20 @@ def upgrade(objects, delete=False, force=None):
if edge_type in ("Line", "Circle"):
result = ext_draftify.draftify(objects[0])
if result:
_msg(_tr("Found 1 object: draftifying it"))
_msg(translate("draft","Found 1 object: draftifying it"))
# only points, no edges
elif not edges and len(objects) > 1:
result = makeCompound(objects)
if result:
_msg(_tr("Found points: creating compound"))
_msg(translate("draft","Found points: creating compound"))
# all other cases, if more than 1 object, make a compound
elif len(objects) > 1:
result = makeCompound(objects)
if result:
_msg(_tr("Found several non-treatable objects: "
"creating compound"))
_msg(translate("draft","Found several non-treatable objects: creating compound"))
# no result has been obtained
if not result:
_msg(_tr("Unable to upgrade these objects."))
_msg(translate("draft","Unable to upgrade these objects."))
if delete:
names = []
@@ -35,7 +35,7 @@ import FreeCADGui as Gui
import draftguitools.gui_base as gui_base
from FreeCAD import Units as U
from draftutils.translate import _tr
from draftutils.translate import translate
from draftutils.utils import ANNOTATION_STYLE as DEFAULT
param = App.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft")
@@ -65,7 +65,7 @@ class AnnotationStyleEditor(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(AnnotationStyleEditor, self).__init__(name=_tr("Annotation style editor"))
super(AnnotationStyleEditor, self).__init__(name=translate("draft","Annotation style editor"))
self.doc = None
self.styles = {}
self.renamed = {}
@@ -289,9 +289,9 @@ class AnnotationStyleEditor(gui_base.GuiCommandSimplest):
"""imports styles from a json file"""
filename = QtGui.QFileDialog.getOpenFileName(
QtGui.QApplication.activeWindow(),
_tr("Open styles file"),
translate("draft","Open styles file"),
None,
_tr("JSON file (*.json)"))
translate("draft","JSON file (*.json)"))
if filename and filename[0]:
with open(filename[0]) as f:
nstyles = json.load(f)
@@ -311,9 +311,9 @@ class AnnotationStyleEditor(gui_base.GuiCommandSimplest):
"""exports styles to a json file"""
filename = QtGui.QFileDialog.getSaveFileName(
QtGui.QApplication.activeWindow(),
_tr("Save styles file"),
translate("draft","Save styles file"),
None,
_tr("JSON file (*.json)"))
translate("draft","JSON file (*.json)"))
if filename and filename[0]:
with open(filename[0],"w") as f:
json.dump(self.styles,f,indent=4)
+6 -10
View File
@@ -45,7 +45,7 @@ import draftutils.utils as utils
from FreeCAD import Units as U
from draftutils.messages import _msg, _err
from draftutils.translate import translate, _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -60,17 +60,15 @@ class Arc(gui_base_original.Creator):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Creates a circular arc by a center point and a radius.\n"
"CTRL to snap, SHIFT to constrain.")
return {'Pixmap': 'Draft_Arc',
'Accel': "A, R",
'MenuText': QT_TRANSLATE_NOOP("Draft_Arc", "Arc"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Arc", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Arc", "Creates a circular arc by a center point and a radius.\nCTRL to snap, SHIFT to constrain.")}
def Activated(self):
"""Execute when the command is called."""
super(Arc, self).Activated(name=_tr(self.featureName))
super(Arc, self).Activated(name=translate("draft","Arc")
if self.ui:
self.step = 0
self.center = None
@@ -480,7 +478,7 @@ class Arc_3Points(gui_base.GuiCommandSimplest):
"""GuiCommand for the Draft_Arc_3Points tool."""
def __init__(self):
super(Arc_3Points, self).__init__(name=_tr("Arc by 3 points"))
super(Arc_3Points, self).__init__(name=translate("draft","Arc by 3 points"))
def GetResources(self):
"""Set icon, menu and tooltip."""
@@ -596,11 +594,9 @@ class ArcGroup:
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Arc tools"
_tip = ("Create various types of circular arcs.")
return {'MenuText': QT_TRANSLATE_NOOP("Draft_ArcTools", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_ArcTools", _tip)}
return {'MenuText': QT_TRANSLATE_NOOP("Draft_ArcTools", "Arc tools"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_ArcTools", "Create various types of circular arcs.")}
def GetCommands(self):
"""Return a tuple of commands in the group."""
@@ -41,7 +41,7 @@ import Draft_rc
import draftguitools.gui_base_original as gui_base_original
import draftguitools.gui_tool_utils as gui_tool_utils
from draftutils.messages import _msg
from draftutils.translate import translate, _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -63,16 +63,12 @@ class Array(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Creates an array from a selected object. "
"By default, it is a 2x2 orthogonal array.\n"
"Once the array is created its type can be changed "
"to polar or circular, and its properties can be modified.")
return {'Pixmap': 'Draft_Array',
'MenuText': QT_TRANSLATE_NOOP("Draft_Array", "Array"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Array", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Array", "Creates an array from a selected object.\nBy default, it is a 2x2 orthogonal array.\nOnce the array is created its type can be changed\nto polar or circular, and its properties can be modified.")}
def Activated(self, name=_tr("Array")):
def Activated(self, name=translate("draft","Array")):
"""Execute when the command is called."""
super(Array, self).Activated(name=name)
if not Gui.Selection.getSelection():
@@ -118,17 +114,14 @@ class LinkArray(Array):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Like the Array tool, but creates a 'Link array' instead.\n"
"A 'Link array' is more efficient when handling many copies "
"but the 'Fuse' option cannot be used.")
return {'Pixmap': 'Draft_LinkArray',
'MenuText': QT_TRANSLATE_NOOP("Draft_LinkArray", "LinkArray"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_LinkArray", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_LinkArray", "Like the Array tool, but creates a 'Link array' instead.\nA 'Link array' is more efficient when handling many copies but the 'Fuse' option cannot be used.")}
def Activated(self):
"""Execute when the command is called."""
super(LinkArray, self).Activated(name=_tr("Link array"))
super(LinkArray, self).Activated(name=translate("draft","Link array"))
Gui.addCommand('Draft_LinkArray', LinkArray())
+1 -4
View File
@@ -60,13 +60,10 @@ class ArrayGroup:
def GetResources(self):
"""Set icon, menu and tooltip."""
_tooltip = ("Create various types of arrays, "
"including rectangular, polar, circular, "
"path, and point")
return {'Pixmap': 'Draft_Array',
'MenuText': QT_TRANSLATE_NOOP("Draft", "Array tools"),
'ToolTip': QT_TRANSLATE_NOOP("Draft", _tooltip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft", "Create various types of arrays, including rectangular, polar, circular, path, and point")}
def IsActive(self):
"""Return True when this command should be available."""
+8 -20
View File
@@ -58,15 +58,11 @@ class BezCurve(gui_lines.Line):
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Bezier curve"
_tip = ("Creates an N-degree Bezier curve. "
"The more points you pick, the higher the degree.\n"
"CTRL to snap, SHIFT to constrain.")
return {'Pixmap': 'Draft_BezCurve',
'Accel': "B, Z",
'MenuText': QT_TRANSLATE_NOOP("Draft_BezCurve", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_BezCurve", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_BezCurve", "Bezier curve"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_BezCurve", "Creates an N-degree Bezier curve. The more points you pick, the higher the degree.\nCTRL to snap, SHIFT to constrain.")}
def Activated(self):
"""Execute when the command is called.
@@ -239,18 +235,13 @@ class CubicBezCurve(gui_lines.Line):
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Cubic bezier curve"
_tip = ("Creates a Bezier curve made of 2nd degree (quadratic) "
"and 3rd degree (cubic) segments. "
"Click and drag to define each segment.\n"
"After the curve is created you can go back to edit "
"each control point and set the properties of each knot.\n"
"CTRL to snap, SHIFT to constrain.")
_menu =
_tip = ()
return {'Pixmap': 'Draft_CubicBezCurve',
# 'Accel': "B, Z",
'MenuText': QT_TRANSLATE_NOOP("Draft_CubicBezCurve", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_CubicBezCurve", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_CubicBezCurve", "Cubic bezier curve"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_CubicBezCurve", "Creates a Bezier curve made of 2nd degree (quadratic) and 3rd degree (cubic) segments. Click and drag to define each segment.\nAfter the curve is created you can go back to edit each control point and set the properties of each knot.\nCTRL to snap, SHIFT to constrain.")}
def Activated(self):
"""Execute when the command is called.
@@ -481,11 +472,8 @@ class BezierGroup:
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Bezier tools"
_tip = ("Create various types of Bezier curves.")
return {'MenuText': QT_TRANSLATE_NOOP("Draft_BezierTools", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_BezierTools", _tip)}
return {'MenuText': QT_TRANSLATE_NOOP("Draft_BezierTools", "Bezier tools"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_BezierTools", "Create various types of Bezier curves.")}
def GetCommands(self):
"""Return a tuple of commands in the group."""
+1 -3
View File
@@ -73,13 +73,11 @@ class Circle(gui_arcs.Arc):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Creates a circle (full circular arc).\n"
"CTRL to snap, ALT to select tangent objects.")
return {'Pixmap': 'Draft_Circle',
'Accel': "C, I",
'MenuText': QT_TRANSLATE_NOOP("Draft_Circle", "Circle"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Circle", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Circle", "Creates a circle (full circular arc).\nCTRL to snap, ALT to select tangent objects.")}
Gui.addCommand('Draft_Circle', Circle())
@@ -37,7 +37,7 @@ import Draft_rc # include resources, icons, ui files
import draftutils.todo as todo
from draftutils.messages import _msg, _log
from draftutils.translate import _tr
from draftutils.translate import translate
from draftguitools import gui_base
from drafttaskpanels import task_circulararray
@@ -61,16 +61,10 @@ class CircularArray(gui_base.GuiCommandBase):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Creates copies of the selected object, "
"and places the copies in a radial pattern\n"
"creating various circular layers.\n"
"\n"
"The array can be turned into an orthogonal "
"or a polar array by changing its type.")
d = {'Pixmap': 'Draft_CircularArray',
'MenuText': QT_TRANSLATE_NOOP("Draft", "Circular array"),
'ToolTip': QT_TRANSLATE_NOOP("Draft", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft", "Creates copies of the selected object, and places the copies in a radial pattern\ncreating various circular layers.\n\nThe array can be turned into an orthogonal or a polar array by changing its type.")}
return d
def Activated(self):
@@ -79,9 +73,9 @@ class CircularArray(gui_base.GuiCommandBase):
We add callbacks that connect the 3D view with
the widgets of the task panel.
"""
_log("GuiCommand: {}".format(_tr(self.command_name)))
_msg("{}".format(16*"-"))
_msg("GuiCommand: {}".format(_tr(self.command_name)))
_log("GuiCommand: {}".format(self.command_name))
#_msg("{}".format(16*"-"))
#_msg("GuiCommand: {}".format(self.command_name))
self.location = coin.SoLocation2Event.getClassTypeId()
self.mouse_event = coin.SoMouseButtonEvent.getClassTypeId()
+3 -6
View File
@@ -49,7 +49,7 @@ import draftguitools.gui_base_original as gui_base_original
import draftguitools.gui_tool_utils as gui_tool_utils
import draftutils.todo as todo
from draftutils.messages import _msg
from draftutils.translate import translate, _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -64,18 +64,15 @@ class Clone(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Creates a clone of the selected objects.\n"
"The resulting clone can be scaled in each "
"of its three directions.")
return {'Pixmap': 'Draft_Clone',
'Accel': "C,L",
'MenuText': QT_TRANSLATE_NOOP("Draft_Clone", "Clone"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Clone", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Clone", "Creates a clone of the selected objects.\nThe resulting clone can be scaled in each of its three directions.")}
def Activated(self):
"""Execute when the command is called."""
super(Clone, self).Activated(name=_tr("Clone"))
super(Clone, self).Activated(name=translate("draft","Clone"))
if not Gui.Selection.getSelection():
if self.ui:
self.ui.selectUi()
@@ -39,7 +39,7 @@ import FreeCADGui as Gui
import draftutils.utils as utils
import draftguitools.gui_base as gui_base
from draftutils.translate import _tr
from draftutils.translate import translate
class FlipDimension(gui_base.GuiCommandNeedsSelection):
@@ -52,19 +52,16 @@ class FlipDimension(gui_base.GuiCommandNeedsSelection):
"""
def __init__(self):
super(Draft_FlipDimension, self).__init__(name=_tr("Flip dimension"))
super(Draft_FlipDimension, self).__init__(name=translate("draft","Flip dimension"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Flip the normal direction of the selected dimensions "
"(linear, radial, angular).\n"
"If other objects are selected they are ignored.")
return {'Pixmap': 'Draft_FlipDimension',
'MenuText': QT_TRANSLATE_NOOP("Draft_FlipDimension",
"Flip dimension"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_FlipDimension",
_tip)}
"Flip the normal direction of the selected dimensions (linear, radial, angular).\nIf other objects are selected they are ignored.")}
def Activated(self):
"""Execute when the command is called."""
+1 -19
View File
@@ -77,29 +77,11 @@ class Dimension(gui_base_original.Creator):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Creates a dimension.\n"
"\n"
"- Pick three points to create a simple linear dimension.\n"
"- Select a straight line to create a linear dimension "
"linked to that line.\n"
"- Select an arc or circle to create a radius or diameter "
"dimension linked to that arc.\n"
"- Select two straight lines to create an angular dimension "
"between them.\n"
"CTRL to snap, SHIFT to constrain, "
"ALT to select an edge or arc.\n"
"\n"
"You may select a single line or single circular arc "
"before launching this command\n"
"to create the corresponding linked dimension.\n"
"You may also select an 'App::MeasureDistance' object "
"before launching this command\n"
"to turn it into a 'Draft Dimension' object.")
return {'Pixmap': 'Draft_Dimension',
'Accel': "D, I",
'MenuText': QT_TRANSLATE_NOOP("Draft_Dimension", "Dimension"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Dimension", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Dimension", "Creates a dimension.\n\n- Pick three points to create a simple linear dimension.\n- Select a straight line to create a linear dimension linked to that line.\n- Select an arc or circle to create a radius or diameter dimension linked to that arc.\n- Select two straight lines to create an angular dimension between them.\nCTRL to snap, SHIFT to constrain, ALT to select an edge or arc.\n\nYou may select a single line or single circular arc before launching this command\nto create the corresponding linked dimension.\nYou may also select an 'App::MeasureDistance' object before launching this command\nto turn it into a 'Draft Dimension' object.")}
def Activated(self):
"""Execute when the command is called."""
+3 -9
View File
@@ -41,7 +41,7 @@ import Draft_rc
import draftguitools.gui_base_original as gui_base_original
import draftguitools.gui_tool_utils as gui_tool_utils
from draftutils.messages import _msg
from draftutils.translate import translate, _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -52,21 +52,15 @@ class Downgrade(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Downgrades the selected objects into simpler shapes.\n"
"The result of the operation depends on the types of objects, "
"which may be able to be downgraded several times in a row.\n"
"For example, it explodes the selected polylines "
"into simpler faces, wires, and then edges. "
"It can also subtract faces.")
return {'Pixmap': 'Draft_Downgrade',
'Accel': "D, N",
'MenuText': QT_TRANSLATE_NOOP("Draft_Downgrade", "Downgrade"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Downgrade", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Downgrade", "Downgrades the selected objects into simpler shapes.\nThe result of the operation depends on the types of objects, which may be able to be downgraded several times in a row.\nFor example, it explodes the selected polylines into simpler faces, wires, and then edges. It can also subtract faces.")}
def Activated(self):
"""Execute when the command is called."""
super(Downgrade, self).Activated(name=_tr("Downgrade"))
super(Downgrade, self).Activated(name=translate("draft","Downgrade"))
if self.ui:
if not Gui.Selection.getSelection():
self.ui.selectUi()
@@ -41,7 +41,7 @@ import Draft_rc
import draftguitools.gui_base_original as gui_base_original
import draftguitools.gui_tool_utils as gui_tool_utils
from draftutils.messages import _msg
from draftutils.translate import translate, _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -52,21 +52,14 @@ class Draft2Sketch(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Draft to Sketch"
_tip = ("Convert bidirectionally between Draft objects "
"and Sketches.\n"
"Many Draft objects will be converted into a single "
"non-constrained Sketch.\n"
"However, a single sketch with disconnected traces "
"will be converted into several individual Draft objects.")
return {'Pixmap': 'Draft_Draft2Sketch',
'MenuText': QT_TRANSLATE_NOOP("Draft_Draft2Sketch", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Draft2Sketch", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_Draft2Sketch", "Draft to Sketch"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Draft2Sketch", "Convert bidirectionally between Draft objects and Sketches.\nMany Draft objects will be converted into a single non-constrained Sketch.\nHowever, a single sketch with disconnected traces will be converted into several individual Draft objects.")}
def Activated(self):
"""Execute when the command is called."""
super(Draft2Sketch, self).Activated(name=_tr("Convert Draft/Sketch"))
super(Draft2Sketch, self).Activated(name=translate("draft","Convert Draft/Sketch"))
if not Gui.Selection.getSelection():
if self.ui:
self.ui.selectUi()
+4 -11
View File
@@ -50,7 +50,7 @@ import draftutils.utils as utils
import draftguitools.gui_base_original as gui_base_original
import draftguitools.gui_tool_utils as gui_tool_utils
from draftutils.messages import _msg, _wrn
from draftutils.translate import translate, _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -65,23 +65,16 @@ class Drawing(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Creates a 2D projection on a Drawing Workbench page "
"from the selected objects.\n"
"This command is OBSOLETE since the Drawing Workbench "
"became obsolete in 0.17.\n"
"Use TechDraw Workbench instead for generating "
"technical drawings.")
return {'Pixmap': 'Draft_Drawing',
# 'Accel': "D, D",
'MenuText': QT_TRANSLATE_NOOP("Draft_Drawing", "Drawing"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Drawing", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Drawing", "Creates a 2D projection on a Drawing Workbench page from the selected objects.\nThis command is OBSOLETE since the Drawing Workbench became obsolete in 0.17.\nUse TechDraw Workbench instead for generating technical drawings.")}
def Activated(self):
"""Execute when the command is called."""
super(Drawing, self).Activated(name=_tr("Drawing"))
_wrn(_tr("The Drawing Workbench is obsolete since 0.17, "
"consider using the TechDraw Workbench instead."))
super(Drawing, self).Activated(name=translate("draft","Drawing"))
_wrn(translate("draft","The Drawing Workbench is obsolete since 0.17, consider using the TechDraw Workbench instead."))
if not Gui.Selection.getSelection():
self.ghost = None
self.ui.selectUi()
+1 -4
View File
@@ -270,13 +270,10 @@ class Edit(gui_base_original.Modifier):
def GetResources(self):
tooltip = ("Edits the active object.\n"
"Press E or ALT+LeftClick to display context menu\n"
"on supported nodes and on supported objects.")
return {'Pixmap': 'Draft_Edit',
'Accel': "D, E",
'MenuText': QtCore.QT_TRANSLATE_NOOP("Draft_Edit", "Edit"),
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_Edit", tooltip)
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_Edit", "Edits the active object.\nPress E or ALT+LeftClick to display context menu\non supported nodes and on supported objects.")
}
+1 -2
View File
@@ -53,12 +53,11 @@ class Ellipse(gui_base_original.Creator):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = "Creates an ellipse. CTRL to snap."
return {'Pixmap': 'Draft_Ellipse',
'Accel': "E, L",
'MenuText': QT_TRANSLATE_NOOP("Draft_Ellipse", "Ellipse"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Ellipse", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Ellipse", "Creates an ellipse. CTRL to snap.")}
def Activated(self):
"""Execute when the command is called."""
@@ -43,7 +43,7 @@ import draftguitools.gui_base_original as gui_base_original
import draftguitools.gui_tool_utils as gui_tool_utils
from draftutils.messages import _msg
from draftutils.translate import translate, _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -54,17 +54,16 @@ class Facebinder(gui_base_original.Creator):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = "Creates a facebinder object from selected faces."
d = {'Pixmap': 'Draft_Facebinder',
'Accel': "F,F",
'MenuText': QT_TRANSLATE_NOOP("Draft_Facebinder", "Facebinder"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Facebinder", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Facebinder", "Creates a facebinder object from selected faces.")}
return d
def Activated(self):
"""Execute when the command is called."""
super(Facebinder, self).Activated(name=_tr("Facebinder"))
super(Facebinder, self).Activated(name=translate("draft","Facebinder"))
if not Gui.Selection.getSelection():
if self.ui:
+7 -8
View File
@@ -44,7 +44,7 @@ import draftguitools.gui_base_original as gui_base_original
import draftguitools.gui_tool_utils as gui_tool_utils
from draftutils.messages import _msg, _err
from draftutils.translate import translate, _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -58,12 +58,11 @@ class Fillet(gui_base_original.Creator):
self.featureName = "Fillet"
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = "Creates a fillet between two selected wires or edges."
"""Set icon, menu and tooltip."""
return {'Pixmap': 'Draft_Fillet',
'MenuText': QT_TRANSLATE_NOOP("Draft", "Fillet"),
'ToolTip': QT_TRANSLATE_NOOP("Draft", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft", "Creates a fillet between two selected wires or edges.")}
def Activated(self, name=translate("Draft", "Fillet")):
"""Execute when the command is called."""
@@ -110,7 +109,7 @@ class Fillet(gui_base_original.Creator):
# self.linetrack = trackers.lineTracker(dotted=True)
# self.arctrack = trackers.arcTracker()
# self.call = self.view.addEventCallback("SoEvent", self.action)
_msg(_tr("Enter radius."))
_msg(translate("draft","Enter radius."))
def action(self, arg):
"""Scene event handler. CURRENTLY NOT USED.
@@ -129,12 +128,12 @@ class Fillet(gui_base_original.Creator):
def set_delete(self):
"""Execute as a callback when the delete checkbox changes."""
self.delete = self.ui.check_delete.isChecked()
_msg(_tr("Delete original objects: ") + str(self.delete))
_msg(translate("draft","Delete original objects:") + " " + str(self.delete))
def set_chamfer(self):
"""Execute as a callback when the chamfer checkbox changes."""
self.chamfer = self.ui.check_chamfer.isChecked()
_msg(_tr("Chamfer mode: ") + str(self.chamfer))
_msg(translate("draft","Chamfer mode:") + " " + str(self.chamfer))
def numericRadius(self, rad):
"""Validate the entry radius in the user interface.
@@ -151,7 +150,7 @@ class Fillet(gui_base_original.Creator):
wires = Gui.Selection.getSelection()
if not wires or len(wires) != 2:
_err(_tr("Two elements needed."))
_err(translate("draft","Two elements needed."))
return
for o in wires:
+4 -7
View File
@@ -34,7 +34,7 @@ from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCADGui as Gui
import draftguitools.gui_base as gui_base
from draftutils.translate import _tr
from draftutils.translate import translate
class ToggleGrid(gui_base.GuiCommandSimplest):
@@ -48,18 +48,15 @@ class ToggleGrid(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(ToggleGrid, self).__init__(name=_tr("Toggle grid"))
super(ToggleGrid, self).__init__(name=translate("draft","Toggle grid"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = "Toggles the Draft grid on and off."
d = {'Pixmap': 'Draft_Grid',
'Accel': "G,R",
'MenuText': QT_TRANSLATE_NOOP("Draft_ToggleGrid",
"Toggle grid"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_ToggleGrid",
_tip),
'MenuText': QT_TRANSLATE_NOOP("Draft_ToggleGrid","Toggle grid"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_ToggleGrid","Toggles the Draft grid on and off."),
'CmdType': 'ForEdit'}
return d
+14 -34
View File
@@ -44,7 +44,7 @@ import draftutils.utils as utils
import draftutils.groups as groups
import draftguitools.gui_base as gui_base
from draftutils.translate import _tr, translate
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -61,21 +61,16 @@ class AddToGroup(gui_base.GuiCommandNeedsSelection):
"""
def __init__(self):
super(AddToGroup, self).__init__(name=_tr("Add to group"))
self.ungroup = QT_TRANSLATE_NOOP("Draft_AddToGroup",
"Ungroup")
super(AddToGroup, self).__init__(name=translate("draft","Add to group"))
self.ungroup = QT_TRANSLATE_NOOP("Draft_AddToGroup","Ungroup")
def GetResources(self):
"""Set icon, menu and tooltip."""
_tooltip = ("Moves the selected objects to an existing group, "
"or removes them from any group.\n"
"Create a group first to use this tool.")
_tooltip = ()
d = {'Pixmap': 'Draft_AddToGroup',
'MenuText': QT_TRANSLATE_NOOP("Draft_AddToGroup",
"Move to group")+"...",
'ToolTip': QT_TRANSLATE_NOOP("Draft_AddToGroup",
_tooltip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_AddToGroup","Move to group")+"...",
'ToolTip': QT_TRANSLATE_NOOP("Draft_AddToGroup","Moves the selected objects to an existing group, or removes them from any group.\nCreate a group first to use this tool.")}
return d
def Activated(self):
@@ -161,24 +156,14 @@ class SelectGroup(gui_base.GuiCommandNeedsSelection):
"""
def __init__(self):
super(SelectGroup, self).__init__(name=_tr("Select group"))
super(SelectGroup, self).__init__(name=translate("draft","Select group"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_tooltip = ("If the selection is a group, it selects all objects "
"that are inside this group, including those in "
"nested sub-groups.\n"
"\n"
"If the selection is a simple object inside a group, "
'it will select the "brother" objects, that is,\n'
"those that are at the same level as this object, "
"including the upper group that contains them all.")
d = {'Pixmap': 'Draft_SelectGroup',
'MenuText': QT_TRANSLATE_NOOP("Draft_SelectGroup",
"Select group"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_SelectGroup",
_tooltip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_SelectGroup","Select group"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_SelectGroup","If the selection is a group, it selects all objects that are inside this group, including those in nested sub-groups.\n\nIf the selection is a simple object inside a group, it will select the "brother" objects, that is,\nthose that are at the same level as this object, including the upper group that contains them all.")}
return d
def Activated(self):
@@ -244,15 +229,14 @@ class SetAutoGroup(gui_base.GuiCommandSimplest):
"""GuiCommand for the Draft_AutoGroup tool."""
def __init__(self):
super(SetAutoGroup, self).__init__(name=_tr("Autogroup"))
super(SetAutoGroup, self).__init__(name=translate("draft","Autogroup"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = "Select a group to add all Draft and Arch objects to."
return {'Pixmap': 'Draft_AutoGroup',
'MenuText': QT_TRANSLATE_NOOP("Draft_AutoGroup", "Autogroup"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_AutoGroup", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_AutoGroup", "Select a group to add all Draft and Arch objects to.")}
def Activated(self):
"""Execute when the command is called.
@@ -349,18 +333,14 @@ class AddToConstruction(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(AddToConstruction, self).__init__(name=_tr("Add to construction group"))
super(AddToConstruction, self).__init__(name=translate("draft","Add to construction group"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Add to Construction group"
_tip = ("Adds the selected objects to the construction group,\n"
"and changes their appearance to the construction style.\n"
"It creates a construction group if it doesn't exist.")
d = {'Pixmap': 'Draft_AddConstruction',
'MenuText': QT_TRANSLATE_NOOP("Draft_AddConstruction", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_AddConstruction", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_AddConstruction", "Add to Construction group"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_AddConstruction", "Adds the selected objects to the construction group,\nand changes their appearance to the construction style.\nIt creates a construction group if it doesn't exist.")}
return d
def Activated(self):
+4 -9
View File
@@ -35,7 +35,7 @@ import FreeCADGui as Gui
import Draft
import draftguitools.gui_base as gui_base
from draftutils.translate import _tr
from draftutils.translate import translate
class Heal(gui_base.GuiCommandSimplest):
@@ -48,20 +48,15 @@ class Heal(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(Heal, self).__init__(name=_tr("Heal"))
super(Heal, self).__init__(name=translate("draft","Heal"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Heal faulty Draft objects saved with an earlier version "
"of the program.\n"
"If an object is selected it will try to heal that object "
"in particular,\n"
"otherwise it will try to heal all objects "
"in the active document.")
_tip = ()
return {'Pixmap': 'Draft_Heal',
'MenuText': QT_TRANSLATE_NOOP("Draft_Heal", "Heal"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Heal", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Heal", "Heal faulty Draft objects saved with an earlier version of the program.\nIf an object is selected it will try to heal that object in particular,\notherwise it will try to heal all objects in the active document.")}
def Activated(self):
"""Execute when the command is called."""
+4 -8
View File
@@ -49,7 +49,7 @@ import draftguitools.gui_base_original as gui_base_original
import draftguitools.gui_tool_utils as gui_tool_utils
from draftutils.messages import _msg
from draftutils.translate import translate, _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -60,19 +60,15 @@ class Join(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Joins the selected lines or polylines "
"into a single object.\n"
"The lines must share a common point at the start "
"or at the end for the operation to succeed.")
return {'Pixmap': 'Draft_Join',
'Accel': "J, O",
'MenuText': QT_TRANSLATE_NOOP("Draft_Join", "Join"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Join", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Join", "Joins the selected lines or polylines into a single object.\nThe lines must share a common point at the start or at the end for the operation to succeed.")}
def Activated(self):
"""Execute when the command is called."""
super(Join, self).Activated(name=_tr("Join"))
super(Join, self).Activated(name=translate("draft","Join"))
if not self.ui:
return
if not Gui.Selection.getSelection():
@@ -111,7 +107,7 @@ class Join(gui_base_original.Modifier):
labels.append(obj.Label)
labels = ", ".join(labels)
_msg(_tr("Selection:") + " {}".format(labels))
_msg(translate("draft","Selection:") + " {}".format(labels))
Gui.addCommand('Draft_Join', Join())
+1 -15
View File
@@ -58,25 +58,11 @@ class Label(gui_base_original.Creator):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Creates a label, "
"optionally attached to a selected object or subelement.\n"
"\n"
"First select a vertex, an edge, or a face of an object, "
"then call this command,\n"
"and then set the position of the leader line "
"and the textual label.\n"
"The label will be able to display information "
"about this object, and about the selected subelement,\n"
"if any.\n"
"\n"
"If many objects or many subelements are selected, "
"only the first one in each case\n"
"will be used to provide information to the label.")
return {'Pixmap': 'Draft_Label',
'Accel': "D, L",
'MenuText': QT_TRANSLATE_NOOP("Draft_Label", "Label"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Label", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Label", "Creates a label, optionally attached to a selected object or subelement.\n\nFirst select a vertex, an edge, or a face of an object, then call this command,\nand then set the position of the leader line and the textual label.\nThe label will be able to display information about this object, and about the selected subelement,\nif any.\n\nIf many objects or many subelements are selected, only the first one in each case\nwill be used to provide information to the label.")}
def Activated(self):
"""Execute when the command is called."""
+3 -8
View File
@@ -34,7 +34,7 @@ import FreeCADGui as Gui
import Draft_rc
import draftguitools.gui_base as gui_base
from draftutils.translate import _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
bool(Draft_rc.__name__)
@@ -44,18 +44,13 @@ class Layer(gui_base.GuiCommandSimplest):
"""GuiCommand to create a Layer object in the document."""
def __init__(self):
super(Layer, self).__init__(name=_tr("Layer"))
super(Layer, self).__init__(name=translate("draft","Layer"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = QT_TRANSLATE_NOOP("Draft_Layer",
"Adds a layer to the document.\n"
"Objects added to this layer can share "
"the same visual properties such as "
"line color, line width, and shape color.")
return {'Pixmap': 'Draft_Layer',
'MenuText': QT_TRANSLATE_NOOP("Draft_Layer", "Layer"),
'ToolTip': _tip}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Layer", "Adds a layer to the document.\nObjects added to this layer can share the same visual properties such as line color, line width, and shape color.")}
def Activated(self):
"""Execute when the command is called.
@@ -52,12 +52,10 @@ class AddPoint(DraftTools.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Add point"
_tip = "Adds a point to an existing Wire or B-spline."
return {'Pixmap': 'Draft_AddPoint',
'MenuText': QT_TRANSLATE_NOOP("Draft_AddPoint", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_AddPoint", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_AddPoint", "Add point"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_AddPoint", "Adds a point to an existing Wire or B-spline.")}
def IsActive(self):
"""Return True when there is selection and the command is active."""
@@ -86,12 +84,10 @@ class DelPoint(DraftTools.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Remove point"
_tip = "Removes a point from an existing Wire or B-spline."
return {'Pixmap': 'Draft_DelPoint',
'MenuText': QT_TRANSLATE_NOOP("Draft_DelPoint", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_DelPoint", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_DelPoint", "Remove point"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_DelPoint", "Removes a point from an existing Wire or B-spline.")}
def IsActive(self):
"""Return True when there is selection and the command is active."""
+8 -11
View File
@@ -41,7 +41,7 @@ import Draft_rc
import draftguitools.gui_base as gui_base
from draftutils.messages import _msg
from draftutils.translate import _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -70,7 +70,7 @@ class LineAction(gui_base.GuiCommandSimplest):
if hasattr(App, "activeDraftCommand"):
_command = App.activeDraftCommand
else:
_msg(_tr("No active command."))
_msg(translate("draft","No active command."))
return
if (_command is not None
@@ -89,15 +89,14 @@ class FinishLine(LineAction):
"""GuiCommand to finish any running line drawing operation."""
def __init__(self):
super(FinishLine, self).__init__(name=_tr("Finish line"))
super(FinishLine, self).__init__(name=translate("draft","Finish line"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = "Finishes a line without closing it."
d = {'Pixmap': 'Draft_Finish',
'MenuText': QT_TRANSLATE_NOOP("Draft_FinishLine", "Finish line"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_FinishLine", _tip),
'ToolTip': QT_TRANSLATE_NOOP("Draft_FinishLine", "Finishes a line without closing it."),
'CmdType': 'ForEdit'}
return d
@@ -116,15 +115,14 @@ class CloseLine(LineAction):
"""GuiCommand to close the line being drawn and finish the operation."""
def __init__(self):
super(CloseLine, self).__init__(name=_tr("Close line"))
super(CloseLine, self).__init__(name=translate("draft","Close line"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = "Closes the line being drawn, and finishes the operation."
d = {'Pixmap': 'Draft_Lock',
'MenuText': QT_TRANSLATE_NOOP("Draft_CloseLine", "Close Line"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_CloseLine", _tip),
'ToolTip': QT_TRANSLATE_NOOP("Draft_CloseLine", "Closes the line being drawn, and finishes the operation."),
'CmdType': 'ForEdit'}
return d
@@ -143,16 +141,15 @@ class UndoLine(LineAction):
"""GuiCommand to undo the last drawn segment of a line."""
def __init__(self):
super(UndoLine, self).__init__(name=_tr("Undo line"))
super(UndoLine, self).__init__(name=translate("draft","Undo line"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = "Undoes the last drawn segment of the line being drawn."
d = {'Pixmap': 'Draft_Rotate',
'MenuText': QT_TRANSLATE_NOOP("Draft_UndoLine",
"Undo last segment"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_UndoLine", _tip),
'ToolTip': QT_TRANSLATE_NOOP("Draft_UndoLine", "Undoes the last drawn segment of the line being drawn."),
'CmdType': 'ForEdit'}
return d
+2 -5
View File
@@ -58,12 +58,11 @@ class Line(gui_base_original.Creator):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = "Creates a 2-point line. CTRL to snap, SHIFT to constrain."
return {'Pixmap': 'Draft_Line',
'Accel': "L,I",
'MenuText': QT_TRANSLATE_NOOP("Draft_Line", "Line"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Line", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Line", "Creates a 2-point line. CTRL to snap, SHIFT to constrain.")}
def Activated(self, name=translate("draft", "Line")):
"""Execute when the command is called."""
@@ -307,13 +306,11 @@ class Wire(Line):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Creates a multiple-points line (polyline). "
"CTRL to snap, SHIFT to constrain.")
return {'Pixmap': 'Draft_Wire',
'Accel': "P, L",
'MenuText': QT_TRANSLATE_NOOP("Draft_Wire", "Polyline"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Wire", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Wire", "Creates a multiple-points line (polyline). CTRL to snap, SHIFT to constrain.")}
def Activated(self):
"""Execute when the command is called."""
+4 -13
View File
@@ -42,7 +42,7 @@ import Draft_rc
import draftutils.utils as utils
import draftguitools.gui_base as gui_base
from draftutils.translate import _tr, translate
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -61,23 +61,14 @@ class LineSlope(gui_base.GuiCommandNeedsSelection):
"""
def __init__(self):
super(LineSlope, self).__init__(name=_tr("Change slope"))
super(LineSlope, self).__init__(name=translate("draft","Change slope"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Set slope"
_tip = ("Sets the slope of the selected line "
"by changing the value of the Z value of one of its points.\n"
"If a polyline is selected, it will apply the slope "
"transformation to each of its segments.\n\n"
"The slope will always change the Z value, therefore "
"this command only works well for\n"
"straight Draft lines that are drawn in the XY plane. "
"Selected objects that aren't single lines will be ignored.")
return {'Pixmap': 'Draft_Slope',
'MenuText': QT_TRANSLATE_NOOP("Draft_Slope", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Slope", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_Slope", "Set slope"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Slope", "Sets the slope of the selected line by changing the value of the Z value of one of its points.\nIf a polyline is selected, it will apply the slope transformation to each of its segments.\n\nThe slope will always change the Z value, therefore this command only works well for\nstraight Draft lines that are drawn in the XY plane. Selected objects that aren't single lines will be ignored.")}
def Activated(self):
"""Execute when the command is called."""
+1 -3
View File
@@ -57,13 +57,11 @@ class Mirror(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Mirrors the selected objects along a line "
"defined by two points.")
return {'Pixmap': 'Draft_Mirror',
'Accel': "M, I",
'MenuText': QT_TRANSLATE_NOOP("Draft_Mirror", "Mirror"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Mirror", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Mirror", "Mirrors the selected objects along a line defined by two points.")}
def Activated(self):
"""Execute when the command is called."""
+1 -6
View File
@@ -57,16 +57,11 @@ class Move(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Moves the selected objects from one base point "
"to another point.\n"
'If the "copy" option is active, it will create '
"displaced copies.\n"
"CTRL to snap, SHIFT to constrain.")
return {'Pixmap': 'Draft_Move',
'Accel': "M, V",
'MenuText': QT_TRANSLATE_NOOP("Draft_Move", "Move"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Move", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Move", "Moves the selected objects from one base point to another point.\nIf the \"copy\" option is active, it will create displaced copies.\nCTRL to snap, SHIFT to constrain.")}
def Activated(self):
"""Execute when the command is called."""
+4 -10
View File
@@ -46,7 +46,7 @@ import draftguitools.gui_tool_utils as gui_tool_utils
import draftguitools.gui_trackers as trackers
from draftutils.messages import _msg, _wrn, _err
from draftutils.translate import translate, _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -57,20 +57,16 @@ class Offset(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Offsets of the selected object.\n"
"It can also create an offset copy of the original object.\n"
"CTRL to snap, SHIFT to constrain. "
"Hold ALT and click to create a copy with each click.")
return {'Pixmap': 'Draft_Offset',
'Accel': "O, S",
'MenuText': QT_TRANSLATE_NOOP("Draft_Offset", "Offset"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Offset", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Offset", "Offsets of the selected object.\nIt can also create an offset copy of the original object.\nCTRL to snap, SHIFT to constrain. Hold ALT and click to create a copy with each click.")}
def Activated(self):
"""Execute when the command is called."""
self.running = False
super(Offset, self).Activated(name=_tr("Offset"))
super(Offset, self).Activated(name=translate("draft","Offset"))
self.ghost = None
self.linetrack = None
self.arctrack = None
@@ -327,9 +323,7 @@ class Offset(gui_base_original.Modifier):
self.finish()
else:
_err(translate("Draft",
"Offset direction is not defined. "
"Please move the mouse on either side "
"of the object first to indicate a direction"))
"Offset direction is not defined. Please move the mouse on either side of the object first to indicate a direction"))
Gui.addCommand('Draft_Offset', Offset())
+5 -12
View File
@@ -37,7 +37,7 @@ import Draft_rc # include resources, icons, ui files
import draftutils.todo as todo
from draftutils.messages import _msg, _log
from draftutils.translate import _tr
from draftutils.translate import translate
from draftguitools import gui_base
from drafttaskpanels import task_orthoarray
@@ -61,17 +61,10 @@ class OrthoArray(gui_base.GuiCommandBase):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Creates copies of the selected object, "
"and places the copies in an orthogonal pattern,\n"
"meaning the copies follow the specified direction "
"in the X, Y, Z axes.\n"
"\n"
"The array can be turned into a polar or a circular array "
"by changing its type.")
d = {'Pixmap': 'Draft_Array',
'MenuText': QT_TRANSLATE_NOOP("Draft", "Array"),
'ToolTip': QT_TRANSLATE_NOOP("Draft", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft", "Creates copies of the selected object, and places the copies in an orthogonal pattern,\nmeaning the copies follow the specified direction in the X, Y, Z axes.\n\nThe array can be turned into a polar or a circular array by changing its type.")}
return d
def Activated(self):
@@ -80,9 +73,9 @@ class OrthoArray(gui_base.GuiCommandBase):
We add callbacks that connect the 3D view with
the widgets of the task panel.
"""
_log("GuiCommand: {}".format(_tr(self.command_name)))
_msg("{}".format(16*"-"))
_msg("GuiCommand: {}".format(_tr(self.command_name)))
_log("GuiCommand: {}".format(_self.command_name))
#_msg("{}".format(16*"-"))
#_msg("GuiCommand: {}".format(self.command_name))
# self.location = coin.SoLocation2Event.getClassTypeId()
self.mouse_event = coin.SoMouseButtonEvent.getClassTypeId()
+9 -22
View File
@@ -45,7 +45,7 @@ import DraftVecUtils
import draftguitools.gui_base_original as gui_base_original
from draftutils.messages import _err
from draftutils.translate import _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -68,18 +68,12 @@ class PathArray(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Path array"
_tip = ("Creates copies of the selected object "
"along a selected path.\n"
"First select the object, and then select the path.\n"
"The path can be a polyline, B-spline, Bezier curve, "
"or even edges from other objects.")
return {'Pixmap': 'Draft_PathArray',
'MenuText': QT_TRANSLATE_NOOP("Draft_PathArray", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_PathArray", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_PathArray", "Path array"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_PathArray", "Creates copies of the selected object along a selected path.\nFirst select the object, and then select the path.\nThe path can be a polyline, B-spline, Bezier curve, or even edges from other objects.")}
def Activated(self, name=_tr("Path array")):
def Activated(self, name=translate("draft","Path array")):
"""Execute when the command is called."""
super(PathArray, self).Activated(name=name)
self.name = name
@@ -105,9 +99,7 @@ class PathArray(gui_base_original.Modifier):
"""Proceed with the command if one object was selected."""
sel = Gui.Selection.getSelectionEx()
if len(sel) != 2:
_err(_tr("Please select exactly two objects, "
"the base object and the path object, "
"before calling this command."))
_err(translate("draft","Please select exactly two objects, the base object and the path object, before calling this command."))
else:
base_object = sel[0].Object
path_object = sel[1].Object
@@ -148,7 +140,7 @@ class PathArray(gui_base_original.Modifier):
_cmd_list = ["_obj_ = " + _cmd,
"Draft.autogroup(_obj_)",
"App.ActiveDocument.recompute()"]
self.commit(_tr(self.name), _cmd_list)
self.commit(translate("draft","Path array"), _cmd_list)
# Commit the transaction and execute the commands
# through the parent class
@@ -166,19 +158,14 @@ class PathLinkArray(PathArray):
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Path Link array"
_tip = ("Like the PathArray tool, but creates a 'Link array' "
"instead.\n"
"A 'Link array' is more efficient when handling many copies "
"but the 'Fuse' option cannot be used.")
return {'Pixmap': 'Draft_PathLinkArray',
'MenuText': QT_TRANSLATE_NOOP("Draft_PathLinkArray", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_PathLinkArray", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_PathLinkArray", "Path Link array"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_PathLinkArray", "Like the PathArray tool, but creates a 'Link array' instead.\nA 'Link array' is more efficient when handling many copies but the 'Fuse' option cannot be used.")}
def Activated(self):
"""Execute when the command is called."""
super(PathLinkArray, self).Activated(name=_tr("Path link array"))
super(PathLinkArray, self).Activated(name=translate("draft","Path link array"))
Gui.addCommand('Draft_PathLinkArray', PathLinkArray())
@@ -38,7 +38,7 @@ import Draft_rc
import draftguitools.gui_base_original as gui_base_original
from draftutils.messages import _err
from draftutils.translate import _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -61,18 +61,12 @@ class PathTwistedArray(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Path twisted array"
_tip = ("Creates copies of the selected object "
"along a selected path, and twists the copies.\n"
"First select the object, and then select the path.\n"
"The path can be a polyline, B-spline, Bezier curve, "
"or even edges from other objects.")
return {'Pixmap': 'Draft_PathTwistedArray',
'MenuText': QT_TRANSLATE_NOOP("Draft_PathTwistedArray", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_PathTwistedArray", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_PathTwistedArray", "Path twisted array"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_PathTwistedArray", "Creates copies of the selected object along a selected path, and twists the copies.\nFirst select the object, and then select the path.\nThe path can be a polyline, B-spline, Bezier curve, or even edges from other objects.")}
def Activated(self, name=_tr("Path twisted array")):
def Activated(self, name=translate("draft","Path twisted array")):
"""Execute when the command is called."""
super(PathTwistedArray, self).Activated(name=name)
self.name = name
@@ -82,9 +76,7 @@ class PathTwistedArray(gui_base_original.Modifier):
"""Proceed with the command if one object was selected."""
sel = Gui.Selection.getSelectionEx()
if len(sel) != 2:
_err(_tr("Please select exactly two objects, "
"the base object and the path object, "
"before calling this command."))
_err(translate("draft","Please select exactly two objects, the base object and the path object, before calling this command."))
else:
base_object = sel[0].Object
path_object = sel[1].Object
@@ -106,7 +98,7 @@ class PathTwistedArray(gui_base_original.Modifier):
_cmd_list = ["_obj_ = " + _cmd,
"Draft.autogroup(_obj_)",
"App.ActiveDocument.recompute()"]
self.commit(_tr(self.name), _cmd_list)
self.commit(translate("draft","Path twisted array"), _cmd_list)
# Commit the transaction and execute the commands
# through the parent class
@@ -124,22 +116,15 @@ class PathTwistedLinkArray(PathTwistedArray):
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Path twisted Link array"
_tip = ("Like the PathTwistedArray tool, but creates a 'Link array' "
"instead.\n"
"A 'Link array' is more efficient when handling many copies "
"but the 'Fuse' option cannot be used.")
return {'Pixmap': 'Draft_PathTwistedLinkArray',
'MenuText': QT_TRANSLATE_NOOP("Draft_PathTwistedLinkArray",
_menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_PathTwistedLinkArray",
_tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_PathTwistedLinkArray","Path twisted Link array"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_PathTwistedLinkArray","Like the PathTwistedArray tool, but creates a 'Link array' instead.\nA 'Link array' is more efficient when handling many copies but the 'Fuse' option cannot be used.")}
def Activated(self):
"""Execute when the command is called."""
super(PathTwistedLinkArray,
self).Activated(name=_tr("Path twisted link array"))
self).Activated(name=translate("draft","Path twisted link array"))
Gui.addCommand('Draft_PathTwistedLinkArray', PathTwistedLinkArray())
+3 -10
View File
@@ -45,17 +45,10 @@ class Draft_WorkingPlaneProxy:
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Create working plane proxy"
_tip = ("Creates a proxy object from the current working plane.\n"
"Once the object is created double click it in the tree view "
"to restore the camera position and objects' visibilities.\n"
"Then you can use it to save a different camera position "
"and objects' states any time you need.")
d = {'Pixmap': 'Draft_PlaneProxy',
'MenuText': QT_TRANSLATE_NOOP("Draft_SetWorkingPlaneProxy",
_menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_SetWorkingPlaneProxy",
_tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_SetWorkingPlaneProxy","Create working plane proxy"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_SetWorkingPlaneProxy","Creates a proxy object from the current working plane.\nOnce the object is created double click it in the tree view to restore the camera position and objects' visibilities.\nThen you can use it to save a different camera position and objects' states any time you need.")}
return d
def IsActive(self):
+7 -24
View File
@@ -49,7 +49,7 @@ import Draft_rc
import draftguitools.gui_base_original as gui_base_original
from draftutils.messages import _err
from draftutils.translate import _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -71,28 +71,15 @@ class PointArray(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Point array"
_tip = ("Creates copies of the selected object, "
"and places the copies at the position of various points.\n"
"\n"
"The points need to be grouped under a compound of points "
"before using this tool.\n"
"To create this compound, select various points "
"and then use the Part Compound tool,\n"
"or use the Draft Upgrade tool to create a 'Block', "
"or create a Sketch and add simple points to it.\n"
"\n"
"Select the base object, and then select the compound "
"or the sketch to create the point array.")
return {'Pixmap': 'Draft_PointArray',
'MenuText': QT_TRANSLATE_NOOP("Draft_PointArray", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_PointArray", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_PointArray", "Point array"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_PointArray", "Creates copies of the selected object, and places the copies at the position of various points.\n\nThe points need to be grouped under a compound of points before using this tool.\nTo create this compound, select various points and then use the Part Compound tool,\nor use the Draft Upgrade tool to create a 'Block', or create a Sketch and add simple points to it.\n\nSelect the base object, and then select the compound or the sketch to create the point array.")}
def Activated(self, name="Point array"):
"""Execute when the command is called."""
self.name = name
super(PointArray, self).Activated(name=_tr(self.name))
super(PointArray, self).Activated(name=translate("draft","Point array"))
# This was deactivated because it doesn't work correctly;
# the selection needs to be made on two objects, but currently
# it only selects one.
@@ -115,9 +102,7 @@ class PointArray(gui_base_original.Modifier):
"""Proceed with the command if one object was selected."""
sel = Gui.Selection.getSelectionEx()
if len(sel) != 2:
_err(_tr("Please select exactly two objects, "
"the base object and the point object, "
"before calling this command."))
_err(translate("draft","Please select exactly two objects, the base object and the point object, before calling this command."))
else:
base_object = sel[0].Object
point_object = sel[1].Object
@@ -135,7 +120,7 @@ class PointArray(gui_base_original.Modifier):
_cmd_list = ["_obj_ = " + _cmd,
"Draft.autogroup(_obj_)",
"App.ActiveDocument.recompute()"]
self.commit(_tr(self.name), _cmd_list)
self.commit(translate("draft","Point array"), _cmd_list)
# Commit the transaction and execute the commands
# through the parent class
@@ -152,12 +137,10 @@ class PointLinkArray(PointArray):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Like the PointArray tool, but creates a 'Point link array' instead.\n"
"A 'Point link array' is more efficient when handling many copies.")
return {'Pixmap': 'Draft_PointLinkArray',
'MenuText': QT_TRANSLATE_NOOP("Draft_PointLinkArray", "PointLinkArray"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_PointLinkArray", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_PointLinkArray", "Like the PointArray tool, but creates a 'Point link array' instead.\nA 'Point link array' is more efficient when handling many copies.")}
def Activated(self):
"""Execute when the command is called."""
+3 -4
View File
@@ -46,7 +46,7 @@ import draftutils.gui_utils as gui_utils
import draftguitools.gui_base_original as gui_base_original
import draftutils.todo as todo
from draftutils.translate import translate, _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -57,15 +57,14 @@ class Point(gui_base_original.Creator):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = "Creates a point object. Click anywhere on the 3D view."
return {'Pixmap': 'Draft_Point',
'MenuText': QT_TRANSLATE_NOOP("Draft_Point", "Point"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Point", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Point", "Creates a point object. Click anywhere on the 3D view.")}
def Activated(self):
"""Execute when the command is called."""
super(Point, self).Activated(name=_tr("Point"))
super(Point, self).Activated(name=translate("draft","Point"))
self.view = gui_utils.get3DView()
self.stack = []
rot = self.view.getCameraNode().getField("orientation").getValue()
+5 -11
View File
@@ -37,7 +37,7 @@ import Draft_rc # include resources, icons, ui files
import draftutils.todo as todo
from draftutils.messages import _msg, _log
from draftutils.translate import _tr
from draftutils.translate import translate
from draftguitools import gui_base
from drafttaskpanels import task_polararray
@@ -61,16 +61,10 @@ class PolarArray(gui_base.GuiCommandBase):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Creates copies of the selected object, "
"and places the copies in a polar pattern\n"
"defined by a center of rotation and its angle.\n"
"\n"
"The array can be turned into an orthogonal "
"or a circular array by changing its type.")
d = {'Pixmap': 'Draft_PolarArray',
'MenuText': QT_TRANSLATE_NOOP("Draft", "Polar array"),
'ToolTip': QT_TRANSLATE_NOOP("Draft", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft", "Creates copies of the selected object, and places the copies in a polar pattern\ndefined by a center of rotation and its angle.\n\nThe array can be turned into an orthogonal or a circular array by changing its type.")}
return d
def Activated(self):
@@ -79,9 +73,9 @@ class PolarArray(gui_base.GuiCommandBase):
We add callbacks that connect the 3D view with
the widgets of the task panel.
"""
_log("GuiCommand: {}".format(_tr(self.command_name)))
_msg("{}".format(16*"-"))
_msg("GuiCommand: {}".format(_tr(self.command_name)))
_log("GuiCommand: {}".format(self.command_name))
#_msg("{}".format(16*"-"))
#_msg("GuiCommand: {}".format(self.command_name))
self.location = coin.SoLocation2Event.getClassTypeId()
self.mouse_event = coin.SoMouseButtonEvent.getClassTypeId()
+1 -5
View File
@@ -51,15 +51,11 @@ class Polygon(gui_base_original.Creator):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Creates a regular polygon (triangle, square, "
"pentagon, ...), by defining the number of sides "
"and the circumscribed radius.\n"
"CTRL to snap, SHIFT to constrain")
return {'Pixmap': 'Draft_Polygon',
'Accel': "P, G",
'MenuText': QT_TRANSLATE_NOOP("Draft_Polygon", "Polygon"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Polygon", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Polygon", "Creates a regular polygon (triangle, square, pentagon, ...), by defining the number of sides and the circumscribed radius.\nCTRL to snap, SHIFT to constrain")}
def Activated(self):
"""Execute when the command is called."""
@@ -48,12 +48,11 @@ class Rectangle(gui_base_original.Creator):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = "Creates a 2-point rectangle. CTRL to snap."
return {'Pixmap': 'Draft_Rectangle',
'Accel': "R, E",
'MenuText': QT_TRANSLATE_NOOP("Draft_Rectangle", "Rectangle"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Rectangle", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Rectangle", "Creates a 2-point rectangle. CTRL to snap.")}
def Activated(self):
"""Execute when the command is called."""
+8 -21
View File
@@ -44,7 +44,7 @@ import draftguitools.gui_trackers as trackers
from FreeCAD import Units as U
from draftutils.messages import _msg, _err
from draftutils.translate import translate, _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -55,22 +55,16 @@ class Rotate(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Rotates the selected objects. "
"Choose the center of rotation, then the initial angle, "
"and then the final angle.\n"
'If the "copy" option is active, it will create '
"rotated copies.\n"
"CTRL to snap, SHIFT to constrain. "
"Hold ALT and click to create a copy with each click.")
_tip = ()
return {'Pixmap': 'Draft_Rotate',
'Accel': "R, O",
'MenuText': QT_TRANSLATE_NOOP("Draft_Rotate", "Rotate"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Rotate", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Rotate", "Rotates the selected objects. Choose the center of rotation, then the initial angle, and then the final angle.\nIf the \"copy\" option is active, it will create rotated copies.\nCTRL to snap, SHIFT to constrain. Hold ALT and click to create a copy with each click.")}
def Activated(self):
"""Execute when the command is called."""
super(Rotate, self).Activated(name=_tr("Rotate"))
super(Rotate, self).Activated(name=translate("draft","Rotate"))
if not self.ui:
return
self.ghosts = []
@@ -199,8 +193,7 @@ class Rotate(gui_base_original.Modifier):
self.ui.radiusValue.setText(U.Quantity(0, U.Angle).UserString)
self.ui.hasFill.hide()
self.ui.labelRadius.setText(translate("draft", "Base angle"))
_tip = "The base angle you wish to start the rotation from"
self.ui.radiusValue.setToolTip(translate("draft", _tip))
self.ui.radiusValue.setToolTip(translate("draft", "The base angle you wish to start the rotation from"))
self.arctrack.setCenter(self.center)
for ghost in self.ghosts:
ghost.center(self.center)
@@ -212,9 +205,7 @@ class Rotate(gui_base_original.Modifier):
def set_start_point(self):
"""Set the starting point of the rotation."""
self.ui.labelRadius.setText(translate("draft", "Rotation"))
_tip = ("The amount of rotation you wish to perform.\n"
"The final angle will be the base angle plus this amount.")
self.ui.radiusValue.setToolTip(translate("draft", _tip))
self.ui.radiusValue.setToolTip(translate("draft", "The amount of rotation you wish to perform.\nThe final angle will be the base angle plus this amount."))
self.rad = DraftVecUtils.dist(self.point, self.center)
self.arctrack.on()
self.arctrack.setStartPoint(self.point)
@@ -397,8 +388,7 @@ class Rotate(gui_base_original.Modifier):
self.ui.radiusUi()
self.ui.hasFill.hide()
self.ui.labelRadius.setText(translate("draft", "Base angle"))
_tip = "The base angle you wish to start the rotation from"
self.ui.radiusValue.setToolTip(translate("draft", _tip))
self.ui.radiusValue.setToolTip(translate("draft", "The base angle you wish to start the rotation from"))
self.ui.radiusValue.setText(U.Quantity(0, U.Angle).UserString)
self.step = 1
_msg(translate("draft", "Pick base angle"))
@@ -411,10 +401,7 @@ class Rotate(gui_base_original.Modifier):
"""
if self.step == 1:
self.ui.labelRadius.setText(translate("draft", "Rotation"))
_tip = ("The amount of rotation you wish to perform.\n"
"The final angle will be the base angle "
"plus this amount.")
self.ui.radiusValue.setToolTip(translate("draft", _tip))
self.ui.radiusValue.setToolTip(translate("draft", "The amount of rotation you wish to perform.\nThe final angle will be the base angle plus this amount."))
self.ui.radiusValue.setText(U.Quantity(0, U.Angle).UserString)
self.firstangle = math.radians(rad)
self.arctrack.setStartAngle(self.firstangle)
+2 -6
View File
@@ -65,13 +65,11 @@ class Scale(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Scales the selected objects from a base point.\n"
"CTRL to snap, SHIFT to constrain, ALT to copy.")
return {'Pixmap': 'Draft_Scale',
'Accel': "S, C",
'MenuText': QT_TRANSLATE_NOOP("Draft_Scale", "Scale"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Scale", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Scale", "Scales the selected objects from a base point.\nCTRL to snap, SHIFT to constrain, ALT to copy.")}
def Activated(self):
"""Execute when the command is called."""
@@ -337,9 +335,7 @@ class Scale(gui_base_original.Modifier):
else:
m = translate("draft", "Unable to scale objects: ")
m += ", ".join([o.Label for o in bads])
m += " - " + translate("draft",
"This object type cannot be scaled "
"directly. Please use the clone method.")
m += " - " + translate("draft","This object type cannot be scaled directly. Please use the clone method.")
_err(m)
if goods:
_doc = 'FreeCAD.ActiveDocument.'
@@ -60,14 +60,10 @@ class Draft_SelectPlane:
def GetResources(self):
"""Set icon, menu and tooltip."""
_msg = ("Select the face of solid body to create a working plane "
"on which to sketch Draft objects.\n"
"You may also select a three vertices or "
"a Working Plane Proxy.")
d = {'Pixmap': 'Draft_SelectPlane',
'Accel': "W, P",
'MenuText': QT_TRANSLATE_NOOP("Draft_SelectPlane", "SelectPlane"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_SelectPlane", _msg)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_SelectPlane", "Select the face of solid body to create a working plane on which to sketch Draft objects.\nYou may also select a three vertices or a Working Plane Proxy.")}
return d
def IsActive(self):
@@ -89,8 +85,7 @@ class Draft_SelectPlane:
p = FreeCAD.DraftWorkingPlane
self.states.append([p.u, p.v, p.axis, p.position])
m = translate("draft", "Pick a face, 3 vertices "
"or a WP Proxy to define the drawing plane")
m = translate("draft", "Pick a face, 3 vertices or a WP Proxy to define the drawing plane")
_msg(m)
# Create task panel
+6 -13
View File
@@ -43,7 +43,7 @@ import draftguitools.gui_base_original as gui_base_original
import draftguitools.gui_tool_utils as gui_tool_utils
from draftutils.messages import _msg
from draftutils.translate import translate, _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -54,23 +54,16 @@ class Shape2DView(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Shape 2D view"
_tip = ("Creates a 2D projection of the selected objects "
"on the XY plane.\n"
"The initial projection direction is the negative "
"of the current active view direction.\n"
"You can select individual faces to project, or "
"the entire solid, and also include hidden lines.\n"
"These projections can be used to create technical "
"drawings with the TechDraw Workbench.")
_menu =
_tip = ()
return {'Pixmap': 'Draft_2DShapeView',
'MenuText': QT_TRANSLATE_NOOP("Draft_Shape2DView", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Shape2DView", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_Shape2DView", "Shape 2D view"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Shape2DView", "Creates a 2D projection of the selected objects on the XY plane.\nThe initial projection direction is the negative of the current active view direction.\nYou can select individual faces to project, or the entire solid, and also include hidden lines.\nThese projections can be used to create technical drawings with the TechDraw Workbench.")}
def Activated(self):
"""Execute when the command is called."""
super(Shape2DView, self).Activated(name=_tr("Project 2D view"))
super(Shape2DView, self).Activated(name=translate("draft","Project 2D view"))
if not Gui.Selection.getSelection():
if self.ui:
self.ui.selectUi()
@@ -62,16 +62,13 @@ class ShapeString(gui_base_original.Creator):
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Shape from text"
_tip = ("Creates a shape from a text string by choosing "
"a specific font and a placement.\n"
"The closed shapes can be used for extrusions "
"and boolean operations.")
_menu =
_tip = ()
d = {'Pixmap': 'Draft_ShapeString',
'Accel': "S, S",
'MenuText': QT_TRANSLATE_NOOP("Draft_ShapeString", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_ShapeString", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_ShapeString", "Shape from text"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_ShapeString", "Creates a shape from a text string by choosing a specific font and a placement.\nThe closed shapes can be used for extrusions and boolean operations.")}
return d
def Activated(self):
+47 -91
View File
@@ -35,7 +35,7 @@ from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCADGui as Gui
import draftguitools.gui_base as gui_base
from draftutils.translate import _tr
from draftutils.translate import translate
# UTILITIES -----------------------------------------------------------------
@@ -106,18 +106,15 @@ class Draft_Snap_Lock(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(Draft_Snap_Lock, self).__init__(name=_tr("Main toggle snap"))
super(Draft_Snap_Lock, self).__init__(name=translate("draft","Main toggle snap"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Main snapping toggle On/Off"
_tip = ("Activates or deactivates "
"all snap methods at once.")
return {'Pixmap': 'Snap_Lock',
'Accel': "Shift+S",
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Lock", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Lock", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Lock", "Main snapping toggle On/Off"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Lock", "Activates or deactivates all snap methods at once.")}
def Activated(self):
"""Execute when the command is called."""
@@ -140,16 +137,14 @@ class Draft_Snap_Midpoint(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(Draft_Snap_Midpoint, self).__init__(name=_tr("Midpoint snap"))
super(Draft_Snap_Midpoint, self).__init__(name=translate("draft","Midpoint snap"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Midpoint"
_tip = "Set snapping to the midpoint of an edge."
return {'Pixmap': 'Snap_Midpoint',
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Midpoint", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Midpoint", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Midpoint", "Midpoint"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Midpoint", "Set snapping to the midpoint of an edge.")}
def Activated(self):
"""Execute when the command is called."""
@@ -172,18 +167,14 @@ class Draft_Snap_Perpendicular(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(Draft_Snap_Perpendicular, self).__init__(name=_tr("Perpendicular snap"))
super(Draft_Snap_Perpendicular, self).__init__(name=translate("draft","Perpendicular snap"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Perpendicular"
_tip = "Set snapping to a direction that is perpendicular to an edge."
return {'Pixmap': 'Snap_Perpendicular',
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Perpendicular",
_menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Perpendicular",
_tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Perpendicular", "Perpendicular"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Perpendicular", "Set snapping to a direction that is perpendicular to an edge.")}
def Activated(self):
"""Execute when the command is called."""
@@ -206,15 +197,14 @@ class Draft_Snap_Grid(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(Draft_Snap_Grid, self).__init__(name=_tr("Grid snap"))
super(Draft_Snap_Grid, self).__init__(name=translate("draft","Grid snap"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = "Set snapping to the intersection of grid lines."
return {'Pixmap': 'Snap_Grid',
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Grid", "Grid"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Grid", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Grid", "Set snapping to the intersection of grid lines.")}
def Activated(self):
"""Execute when the command is called."""
@@ -237,18 +227,14 @@ class Draft_Snap_Intersection(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(Draft_Snap_Intersection, self).__init__(name=_tr("Intersection snap"))
super(Draft_Snap_Intersection, self).__init__(name=translate("draft","Intersection snap"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Intersection"
_tip = "Set snapping to the intersection of edges."
return {'Pixmap': 'Snap_Intersection',
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Intersection",
_menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Intersection",
_tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Intersection","Intersection"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Intersection","Set snapping to the intersection of edges.")}
def Activated(self):
"""Execute when the command is called."""
@@ -271,16 +257,14 @@ class Draft_Snap_Parallel(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(Draft_Snap_Parallel, self).__init__(name=_tr("Parallel snap"))
super(Draft_Snap_Parallel, self).__init__(name=translate("draft","Parallel snap"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Parallel"
_tip = "Set snapping to a direction that is parallel to an edge."
return {'Pixmap': 'Snap_Parallel',
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Parallel", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Parallel", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Parallel", "Parallel"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Parallel", "Set snapping to a direction that is parallel to an edge.")}
def Activated(self):
"""Execute when the command is called."""
@@ -303,16 +287,14 @@ class Draft_Snap_Endpoint(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(Draft_Snap_Endpoint, self).__init__(name=_tr("Endpoint snap"))
super(Draft_Snap_Endpoint, self).__init__(name=translate("draft","Endpoint snap"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Endpoint"
_tip = "Set snapping to endpoints of an edge."
return {'Pixmap': 'Snap_Endpoint',
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Endpoint", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Endpoint", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Endpoint", "Endpoint"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Endpoint", "Set snapping to endpoints of an edge.")}
def Activated(self):
"""Execute when the command is called."""
@@ -336,17 +318,14 @@ class Draft_Snap_Angle(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(Draft_Snap_Angle, self).__init__(name=_tr("Angle snap (30 and 45 degrees)"))
super(Draft_Snap_Angle, self).__init__(name=translate("draft","Angle snap (30 and 45 degrees)"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Angles (30 and 45 degrees)"
_tip = ("Set snapping to points in a circular arc located "
"at multiples of 30 and 45 degree angles.")
return {'Pixmap': 'Snap_Angle',
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Angle", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Angle", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Angle", "Angle"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Angle", "Set snapping to points in a circular arc located at multiples of 30 and 45 degree angles.")}
def Activated(self):
"""Execute when the command is called."""
@@ -369,15 +348,14 @@ class Draft_Snap_Center(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(Draft_Snap_Center, self).__init__(name=_tr("Arc center snap"))
super(Draft_Snap_Center, self).__init__(name=translate("draft","Arc center snap"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = "Set snapping to the center of a circular arc."
return {'Pixmap': 'Snap_Center',
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Center", "Center"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Center", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Center", "Set snapping to the center of a circular arc.")}
def Activated(self):
"""Execute when the command is called."""
@@ -400,16 +378,14 @@ class Draft_Snap_Extension(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(Draft_Snap_Extension, self).__init__(name=_tr("Edge extension snap"))
super(Draft_Snap_Extension, self).__init__(name=translate("draft","Edge extension snap"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Extension"
_tip = "Set snapping to the extension of an edge."
return {'Pixmap': 'Snap_Extension',
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Extension", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Extension", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Extension", "Extension"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Extension", "Set snapping to the extension of an edge.")}
def Activated(self):
"""Execute when the command is called."""
@@ -432,15 +408,14 @@ class Draft_Snap_Near(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(Draft_Snap_Near, self).__init__(name=_tr("Near snap"))
super(Draft_Snap_Near, self).__init__(name=translate("draft","Near snap"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = "Set snapping to the nearest point of an edge."
return {'Pixmap': 'Snap_Near',
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Near", "Nearest"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Near", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Near", "Set snapping to the nearest point of an edge.")}
def Activated(self):
"""Execute when the command is called."""
@@ -464,17 +439,14 @@ class Draft_Snap_Ortho(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(Draft_Snap_Ortho, self).__init__(name=_tr("Orthogonal snap"))
super(Draft_Snap_Ortho, self).__init__(name=translate("draft","Orthogonal snap"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Orthogonal angles (45 degrees)"
_tip = ("Set snapping to a direction that is a multiple "
"of 45 degrees from a point.")
return {'Pixmap': 'Snap_Ortho',
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Ortho", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Ortho", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Ortho", "Orthogonal"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Ortho", "Set snapping to a direction that is a multiple of 45 degrees from a point.")}
def Activated(self):
"""Execute when the command is called."""
@@ -497,16 +469,14 @@ class Draft_Snap_Special(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(Draft_Snap_Special, self).__init__(name=_tr("Special point snap"))
super(Draft_Snap_Special, self).__init__(name=translate("draft","Special point snap"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Special"
_tip = "Set snapping to the special points defined inside an object."
return {'Pixmap': 'Snap_Special',
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Special", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Special", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Special", "Special"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Special", "Set snapping to the special points defined inside an object.")}
def Activated(self):
"""Execute when the command is called."""
@@ -530,17 +500,14 @@ class Draft_Snap_Dimensions(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(Draft_Snap_Dimensions, self).__init__(name=_tr("Dimension display"))
super(Draft_Snap_Dimensions, self).__init__(name=translate("draft","Dimension display"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Show dimensions"
_tip = ("Show temporary linear dimensions when editing an object "
"and using other snapping methods.")
return {'Pixmap': 'Snap_Dimensions',
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Dimensions", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Dimensions", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Dimensions", "Show dimensions"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Dimensions", "Show temporary linear dimensions when editing an object and using other snapping methods.")}
def Activated(self):
"""Execute when the command is called."""
@@ -566,23 +533,14 @@ class Draft_Snap_WorkingPlane(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(Draft_Snap_WorkingPlane, self).__init__(name=_tr("Working plane snap"))
super(Draft_Snap_WorkingPlane, self).__init__(name=translate("draft","Working plane snap"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Working plane"
_tip = ("Restricts snapping to a point in the current "
"working plane.\n"
"If you select a point outside the working plane, "
"for example, by using other snapping methods,\n"
"it will snap to that point's projection "
"in the current working plane.")
return {'Pixmap': 'Snap_WorkingPlane',
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_WorkingPlane",
_menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_WorkingPlane",
_tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_WorkingPlane","Working plane"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_WorkingPlane","Restricts snapping to a point in the current working plane.\nIf you select a point outside the working plane, for example, by using other snapping methods,\nit will snap to that point's projection in the current working plane.")}
def Activated(self):
"""Execute when the command is called."""
@@ -605,17 +563,15 @@ class ShowSnapBar(gui_base.GuiCommandSimplest):
"""
def __init__(self):
super(ShowSnapBar, self).__init__(name=_tr("Show snap toolbar"))
super(ShowSnapBar, self).__init__(name=translate("draft","Show snap toolbar"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = "Show the snap toolbar if it is hidden."
_tip =
return {'Pixmap': 'Draft_Snap',
'MenuText': QT_TRANSLATE_NOOP("Draft_ShowSnapBar",
"Show snap toolbar"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_ShowSnapBar",
_tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_ShowSnapBar","Show snap toolbar"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_ShowSnapBar","Show the snap toolbar if it is hidden.")}
def Activated(self):
"""Execute when the command is called."""
+1 -3
View File
@@ -54,13 +54,11 @@ class BSpline(gui_lines.Line):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Creates a multiple-point B-spline. "
"CTRL to snap, SHIFT to constrain.")
return {'Pixmap': 'Draft_BSpline',
'Accel': "B, S",
'MenuText': QT_TRANSLATE_NOOP("Draft_BSpline", "B-spline"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_BSpline", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_BSpline", "Creates a multiple-point B-spline. CTRL to snap, SHIFT to constrain.")}
def Activated(self):
"""Execute when the command is called.
+3 -9
View File
@@ -39,7 +39,7 @@ import draftguitools.gui_base_original as gui_base_original
import draftguitools.gui_tool_utils as gui_tool_utils
from draftutils.messages import _msg
from draftutils.translate import translate, _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -50,21 +50,15 @@ class Split(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Splits the selected line or polyline "
"into two independent lines\n"
"or polylines by clicking anywhere "
"along the original object.\n"
"It works best when choosing a point on a straight segment "
"and not a corner vertex.")
return {'Pixmap': 'Draft_Split',
'Accel': "S, P",
'MenuText': QT_TRANSLATE_NOOP("Draft_Split", "Split"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Split", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Split", "Splits the selected line or polyline into two independent lines\nor polylines by clicking anywhere along the original object.\nIt works best when choosing a point on a straight segment and not a corner vertex.")}
def Activated(self):
"""Execute when the command is called."""
super(Split, self).Activated(name=_tr("Split"))
super(Split, self).Activated(name=translate("draft","Split"))
if not self.ui:
return
_msg(translate("draft", "Click anywhere on a line to split it."))
+3 -8
View File
@@ -47,7 +47,7 @@ import draftguitools.gui_tool_utils as gui_tool_utils
import draftguitools.gui_trackers as trackers
from draftutils.messages import _msg
from draftutils.translate import translate, _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -58,20 +58,15 @@ class Stretch(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Stretches the selected objects.\n"
"Select an object, then draw a rectangle "
"to pick the vertices that will be stretched,\n"
"then draw a line to specify the distance "
"and direction of stretching.")
return {'Pixmap': 'Draft_Stretch',
'Accel': "S, H",
'MenuText': QT_TRANSLATE_NOOP("Draft_Stretch", "Stretch"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Stretch", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Stretch", "Stretches the selected objects.\nSelect an object, then draw a rectangle to pick the vertices that will be stretched,\nthen draw a line to specify the distance and direction of stretching.")}
def Activated(self):
"""Execute when the command is called."""
super(Stretch, self).Activated(name=_tr("Stretch"))
super(Stretch, self).Activated(name=translate("draft","Stretch"))
if self.ui:
if not Gui.Selection.getSelection():
self.ui.selectUi()
+4 -8
View File
@@ -34,7 +34,7 @@ from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCADGui as Gui
import draftguitools.gui_base_original as gui_base_original
from draftutils.translate import translate, _tr
from draftutils.translate import translate
class ApplyStyle(gui_base_original.Modifier):
@@ -42,21 +42,17 @@ class ApplyStyle(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Apply current style"
_tip = ("Applies the current style defined in the toolbar "
"(line width and colors) "
"to the selected objects and groups.")
return {'Pixmap': 'Draft_Apply',
'MenuText': QT_TRANSLATE_NOOP("Draft_ApplyStyle", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_ApplyStyle", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_ApplyStyle", "Apply current style"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_ApplyStyle", "Applies the current style defined in the toolbar (line width and colors) to the selected objects and groups.")}
def Activated(self):
"""Execute when the command is called.
Activate the specific BSpline tracker.
"""
super(ApplyStyle, self).Activated(name=_tr("Apply style"))
super(ApplyStyle, self).Activated(name=translate("draft","Apply style"))
if self.ui:
self.sel = Gui.Selection.getSelection()
if len(self.sel) > 0:
+6 -11
View File
@@ -41,7 +41,7 @@ import draftguitools.gui_base_original as gui_base_original
import draftguitools.gui_tool_utils as gui_tool_utils
from draftutils.messages import _msg
from draftutils.translate import translate, _tr
from draftutils.translate import translate
class SubelementHighlight(gui_base_original.Modifier):
@@ -54,25 +54,20 @@ class SubelementHighlight(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Subelement highlight"
_tip = ("Highlight the subelements "
"of the selected objects, "
"so that they can then be edited "
"with the move, rotate, and scale tools.")
_menu =
_tip = ()
return {'Pixmap': 'Draft_SubelementHighlight',
'Accel': "H, S",
'MenuText': QT_TRANSLATE_NOOP("Draft_SubelementHighlight",
_menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_SubelementHighlight",
_tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_SubelementHighlight","Subelement highlight"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_SubelementHighlight","Highlight the subelements of the selected objects, so that they can then be edited with the move, rotate, and scale tools.")}
def Activated(self):
"""Execute when the command is called."""
if self.is_running:
return self.finish()
self.is_running = True
super(SubelementHighlight, self).Activated(name=_tr("Subelement highlight"))
super(SubelementHighlight, self).Activated(name=translate("draft","Subelement highlight"))
self.get_selection()
def proceed(self):
+1 -2
View File
@@ -54,12 +54,11 @@ class Text(gui_base_original.Creator):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = "Creates a multi-line annotation. CTRL to snap."
return {'Pixmap': 'Draft_Text',
'Accel': "T, E",
'MenuText': QT_TRANSLATE_NOOP("Draft_Text", "Text"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Text", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Text", "Creates a multi-line annotation. CTRL to snap.")}
def Activated(self):
"""Execute when the command is called."""
+11 -36
View File
@@ -40,7 +40,7 @@ import Draft_rc
import draftguitools.gui_base as gui_base
from draftutils.messages import _msg
from draftutils.translate import _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -70,7 +70,7 @@ class BaseMode(gui_base.GuiCommandSimplest):
if hasattr(Gui, "draftToolBar"):
_ui = Gui.draftToolBar
else:
_msg(_tr("No active Draft Toolbar."))
_msg(translate("draft","No active Draft Toolbar."))
return
if _ui is not None:
@@ -90,23 +90,15 @@ class ToggleConstructionMode(BaseMode):
def __init__(self):
super(ToggleConstructionMode,
self).__init__(name=_tr("Construction mode"))
self).__init__(name=translate("draft","Construction mode"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Toggle construction mode"
_tip = ("Toggles the Construction mode.\n"
"When this is active, the following objects created "
"will be included in the construction group, "
"and will be drawn with the specified color "
"and properties.")
d = {'Pixmap': 'Draft_Construction',
'MenuText': QT_TRANSLATE_NOOP("Draft_ToggleConstructionMode",
_menu),
'MenuText': QT_TRANSLATE_NOOP("Draft_ToggleConstructionMode","Toggle construction mode"),
'Accel': "C, M",
'ToolTip': QT_TRANSLATE_NOOP("Draft_ToggleConstructionMode",
_tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_ToggleConstructionMode","Toggles the Construction mode.\nWhen this is active, the following objects created will be included in the construction group, and will be drawn with the specified color and properties.")}
return d
def Activated(self):
@@ -130,22 +122,14 @@ class ToggleContinueMode(BaseMode):
"""
def __init__(self):
super(ToggleContinueMode, self).__init__(name=_tr("Continue mode"))
super(ToggleContinueMode, self).__init__(name=translate("draft","Continue mode"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Toggle continue mode"
_tip = ("Toggles the Continue mode.\n"
"When this is active, any drawing tool that is terminated "
"will automatically start again.\n"
"This can be used to draw several objects "
"one after the other in succession.")
d = {'Pixmap': 'Draft_Continue',
'MenuText': QT_TRANSLATE_NOOP("Draft_ToggleContinueMode",
_menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_ToggleContinueMode",
_tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_ToggleContinueMode","Toggle continue mode"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_ToggleContinueMode","Toggles the Continue mode.\nWhen this is active, any drawing tool that is terminated will automatically start again.\nThis can be used to draw several objects one after the other in succession.")}
return d
def Activated(self):
@@ -172,24 +156,15 @@ class ToggleDisplayMode(gui_base.GuiCommandNeedsSelection):
def __init__(self):
super(ToggleDisplayMode,
self).__init__(name=_tr("Toggle display mode"))
self).__init__(name=translate("draft","Toggle display mode"))
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Toggle normal/wireframe display"
_tip = ("Switches the display mode of selected objects "
"from flatlines to wireframe and back.\n"
"This is helpful to quickly visualize objects "
"that are hidden by other objects.\n"
"This is intended to be used with closed shapes "
"and solids, and doesn't affect open wires.")
d = {'Pixmap': 'Draft_SwitchMode',
'Accel': "Shift+Space",
'MenuText': QT_TRANSLATE_NOOP("Draft_ToggleDisplayMode",
_menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_ToggleDisplayMode",
_tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_ToggleDisplayMode","Toggle normal/wireframe display"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_ToggleDisplayMode","Switches the display mode of selected objects from flatlines to wireframe and back.\nThis is helpful to quickly visualize objects that are hidden by other objects.\nThis is intended to be used with closed shapes and solids, and doesn't affect open wires.")}
return d
def Activated(self):
+3 -7
View File
@@ -52,7 +52,7 @@ import draftguitools.gui_tool_utils as gui_tool_utils
import draftguitools.gui_trackers as trackers
from draftutils.messages import _msg, _err
from draftutils.translate import translate, _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -70,19 +70,15 @@ class Trimex(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Trims or extends the selected object, "
"or extrudes single faces.\n"
"CTRL snaps, SHIFT constrains to current segment "
"or to normal, ALT inverts.")
return {'Pixmap': 'Draft_Trimex',
'Accel': "T, R",
'MenuText': QT_TRANSLATE_NOOP("Draft_Trimex", "Trimex"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Trimex", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Trimex", "Trims or extends the selected object, or extrudes single faces.\nCTRL snaps, SHIFT constrains to current segment or to normal, ALT inverts.")}
def Activated(self):
"""Execute when the command is called."""
super(Trimex, self).Activated(name=_tr("Trimex"))
super(Trimex, self).Activated(name=translate("draft","Trimex"))
self.edges = []
self.placement = None
self.ghost = []
+3 -11
View File
@@ -41,7 +41,7 @@ import draftguitools.gui_base_original as gui_base_original
import draftguitools.gui_tool_utils as gui_tool_utils
from draftutils.messages import _msg
from draftutils.translate import translate, _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -52,23 +52,15 @@ class Upgrade(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tip = ("Upgrades the selected objects into more complex shapes.\n"
"The result of the operation depends on the types of objects, "
"which may be able to be upgraded several times in a row.\n"
"For example, it can join the selected objects into one, "
"convert simple edges into parametric polylines,\n"
"convert closed edges into filled faces "
"and parametric polygons, and merge faces "
"into a single face.")
return {'Pixmap': 'Draft_Upgrade',
'Accel': "U, P",
'MenuText': QT_TRANSLATE_NOOP("Draft_Upgrade", "Upgrade"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_Upgrade", _tip)}
'ToolTip': QT_TRANSLATE_NOOP("Draft_Upgrade", "Upgrades the selected objects into more complex shapes.\nThe result of the operation depends on the types of objects, which may be able to be upgraded several times in a row.\nFor example, it can join the selected objects into one, convert simple edges into parametric polylines,\nconvert closed edges into filled faces and parametric polygons, and merge faces into a single face.")}
def Activated(self):
"""Execute when the command is called."""
super(Upgrade, self).Activated(name=_tr("Upgrade"))
super(Upgrade, self).Activated(name=translate("draft","Upgrade"))
if self.ui:
if not Gui.Selection.getSelection():
self.ui.selectUi()
@@ -44,7 +44,7 @@ import Draft
import draftutils.utils as utils
import draftguitools.gui_base_original as gui_base_original
from draftutils.translate import translate, _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -58,13 +58,10 @@ class WireToBSpline(gui_base_original.Modifier):
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Wire to B-spline"
_tip = ("Converts a selected polyline to a B-spline, "
"or a B-spline to a polyline.")
return {'Pixmap': 'Draft_WireToBSpline',
'MenuText': QT_TRANSLATE_NOOP("Draft_WireToBSpline", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_WireToBSpline", _tip)}
'MenuText': QT_TRANSLATE_NOOP("Draft_WireToBSpline", "Wire to B-spline"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_WireToBSpline", "Converts a selected polyline to a B-spline, or a B-spline to a polyline.")}
def Activated(self):
"""Execute when the command is called."""
@@ -79,7 +76,7 @@ class WireToBSpline(gui_base_original.Modifier):
selection = Gui.Selection.getSelection()
if selection:
if utils.getType(selection[0]) in ['Wire', 'BSpline']:
super(WireToBSpline, self).Activated(name=_tr("Convert polyline/B-spline"))
super(WireToBSpline, self).Activated(name=translate("draft","Convert polyline/B-spline"))
if self.doc:
self.obj = Gui.Selection.getSelection()
if self.obj:
+18 -20
View File
@@ -34,7 +34,7 @@ import Part
import Draft
import draftutils.utils as utils
from draftutils.messages import _msg, _err
from draftutils.translate import _tr
from draftutils.translate import translate
import draftutils.gui_utils as gui_utils
@@ -122,23 +122,21 @@ def make_arc_3points(points, placement=None, face=False,
try:
utils.type_check([(points, (list, tuple))], name=_name)
except TypeError:
_err(_tr("Points: ") + "{}".format(points))
_err(_tr("Wrong input: "
"must be list or tuple of three points exactly."))
_err(translate("draft","Points: ") + "{}".format(points))
_err(translate("draft","Wrong input: must be list or tuple of three points exactly."))
return None
if len(points) != 3:
_err(_tr("Points: ") + "{}".format(points))
_err(_tr("Wrong input: "
"must be list or tuple of three points exactly."))
_err(translate("draft","Points: ") + "{}".format(points))
_err(translate("draft","Wrong input: must be list or tuple of three points exactly."))
return None
if placement is not None:
try:
utils.type_check([(placement, App.Placement)], name=_name)
except TypeError:
_err(_tr("Placement: ") + "{}".format(placement))
_err(_tr("Wrong input: incorrect type of placement."))
_err(translate("draft","Placement: ") + "{}".format(placement))
_err(translate("draft","Wrong input: incorrect type of placement."))
return None
p1, p2, p3 = points
@@ -152,24 +150,24 @@ def make_arc_3points(points, placement=None, face=False,
(p2, App.Vector),
(p3, App.Vector)], name=_name)
except TypeError:
_err(_tr("Wrong input: incorrect type of points."))
_err(translate("draft","Wrong input: incorrect type of points."))
return None
try:
_edge = Part.Arc(p1, p2, p3)
except Part.OCCError as error:
_err(_tr("Cannot generate shape: ") + "{}".format(error))
_err(translate("draft","Cannot generate shape: ") + "{}".format(error))
return None
edge = _edge.toShape()
radius = edge.Curve.Radius
center = edge.Curve.Center
_msg(_tr("Radius: ") + "{}".format(radius))
_msg(_tr("Center: ") + "{}".format(center))
_msg(translate("draft","Radius:") + " " + "{}".format(radius))
_msg(translate("draft","Center:") + " " + "{}".format(center))
if primitive:
_msg(_tr("Create primitive object"))
_msg(translate("draft","Create primitive object"))
obj = App.ActiveDocument.addObject("Part::Feature", "Arc")
obj.Shape = edge
return obj
@@ -192,18 +190,18 @@ def make_arc_3points(points, placement=None, face=False,
if placement and not support:
obj.Placement.Base = placement.Base
_msg(_tr("Final placement: ") + "{}".format(obj.Placement))
_msg(translate("draft","Final placement:") + " " + "{}".format(obj.Placement))
if face:
_msg(_tr("Face: True"))
_msg(translate("draft","Face: True"))
if support:
_msg(_tr("Support: ") + "{}".format(support))
_msg(_tr("Map mode: " + "{}".format(map_mode)))
_msg(translate("draft","Support:") + " " + "{}".format(support))
_msg(translate("draft","Map mode:") + " " + "{}".format(map_mode))
obj.MapMode = map_mode
if placement:
obj.AttachmentOffset.Base = placement.Base
obj.AttachmentOffset.Rotation = original_placement.Rotation
_msg(_tr("Attachment offset: {}".format(obj.AttachmentOffset)))
_msg(_tr("Final placement: ") + "{}".format(obj.Placement))
_msg(translate("draft","Attachment offset: {}".format(obj.AttachmentOffset)))
_msg(translate("draft","Final placement:") + " " + "{}".format(obj.Placement))
return obj
+2 -2
View File
@@ -35,7 +35,7 @@ import draftutils.utils as utils
import draftutils.gui_utils as gui_utils
from draftutils.messages import _wrn, _err
from draftutils.translate import _tr
from draftutils.translate import translate
from draftobjects.array import Array
if App.GuiUp:
@@ -82,7 +82,7 @@ def make_array(base_object,
"""
found, doc = utils.find_doc(App.activeDocument())
if not found:
_err(_tr("No active document. Aborting."))
_err(translate("draft","No active document. Aborting."))
return None
if use_link:
@@ -32,7 +32,7 @@ import draftmake.make_array as make_array
import draftutils.utils as utils
from draftutils.messages import _msg, _err
from draftutils.translate import _tr
from draftutils.translate import translate
def make_circular_array(base_object,
@@ -119,7 +119,7 @@ def make_circular_array(base_object,
make_ortho_array, make_polar_array, make_path_array, make_point_array
"""
_name = "make_circular_array"
utils.print_header(_name, _tr("Circular array"))
utils.print_header(_name, translate("draft","Circular array"))
if isinstance(base_object, str):
base_object_str = base_object
@@ -128,7 +128,7 @@ def make_circular_array(base_object,
doc=App.activeDocument())
if not found:
_msg("base_object: {}".format(base_object_str))
_err(_tr("Wrong input: object not in document."))
_err(translate("draft","Wrong input: object not in document."))
return None
_msg("base_object: {}".format(base_object.Label))
@@ -141,7 +141,7 @@ def make_circular_array(base_object,
(tan_distance, (int, float, App.Units.Quantity))],
name=_name)
except TypeError:
_err(_tr("Wrong input: must be a number or quantity."))
_err(translate("draft","Wrong input: must be a number or quantity."))
return None
_msg("number: {}".format(number))
@@ -151,7 +151,7 @@ def make_circular_array(base_object,
utils.type_check([(number, int),
(symmetry, int)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be an integer number."))
_err(translate("draft","Wrong input: must be an integer number."))
return None
_msg("axis: {}".format(axis))
@@ -161,7 +161,7 @@ def make_circular_array(base_object,
utils.type_check([(axis, App.Vector),
(center, App.Vector)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a vector."))
_err(translate("draft","Wrong input: must be a vector."))
return None
use_link = bool(use_link)
+36 -42
View File
@@ -40,7 +40,7 @@ import draftutils.utils as utils
import draftutils.gui_utils as gui_utils
from draftutils.messages import _msg, _wrn, _err
from draftutils.translate import _tr
from draftutils.translate import translate
from draftobjects.dimension import (LinearDimension,
AngularDimension)
@@ -170,10 +170,8 @@ def make_dimension(p1, p2, p3=None, p4=None):
def makeDimension(p1, p2, p3=None, p4=None):
"""Create a dimension. DEPRECATED. Use 'make_dimension'."""
_wrn(_tr("This function is deprecated. "
"Do not use this function directly."))
_wrn(_tr("Use one of 'make_linear_dimension', or "
"'make_linear_dimension_obj'."))
_wrn(translate("draft","This function is deprecated. Do not use this function directly."))
_wrn(translate("draft","Use one of 'make_linear_dimension', or 'make_linear_dimension_obj'."))
return make_dimension(p1, p2, p3, p4)
@@ -214,21 +212,21 @@ def make_linear_dimension(p1, p2, dim_line=None):
found, doc = utils.find_doc(App.activeDocument())
if not found:
_err(_tr("No active document. Aborting."))
_err(translate("draft","No active document. Aborting."))
return None
_msg("p1: {}".format(p1))
try:
utils.type_check([(p1, App.Vector)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a vector."))
_err(translate("draft","Wrong input: must be a vector."))
return None
_msg("p2: {}".format(p2))
try:
utils.type_check([(p2, App.Vector)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a vector."))
_err(translate("draft","Wrong input: must be a vector."))
return None
_msg("dim_line: {}".format(dim_line))
@@ -236,7 +234,7 @@ def make_linear_dimension(p1, p2, dim_line=None):
try:
utils.type_check([(dim_line, App.Vector)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a vector."))
_err(translate("draft","Wrong input: must be a vector."))
return None
else:
diff = p2.sub(p1)
@@ -307,7 +305,7 @@ def make_linear_dimension_obj(edge_object, i1=1, i2=2, dim_line=None):
found, doc = utils.find_doc(App.activeDocument())
if not found:
_err(_tr("No active document. Aborting."))
_err(translate("draft","No active document. Aborting."))
return None
if isinstance(edge_object, str):
@@ -315,56 +313,54 @@ def make_linear_dimension_obj(edge_object, i1=1, i2=2, dim_line=None):
if isinstance(edge_object, (list, tuple)):
_msg("edge_object: {}".format(edge_object))
_err(_tr("Wrong input: object must not be a list."))
_err(translate("draft","Wrong input: object must not be a list."))
return None
found, edge_object = utils.find_object(edge_object, doc)
if not found:
_msg("edge_object: {}".format(edge_object_str))
_err(_tr("Wrong input: object not in document."))
_err(translate("draft","Wrong input: object not in document."))
return None
_msg("edge_object: {}".format(edge_object.Label))
if not hasattr(edge_object, "Shape"):
_err(_tr("Wrong input: object doesn't have a 'Shape' to measure."))
_err(translate("draft","Wrong input: object doesn't have a 'Shape' to measure."))
return None
if (not hasattr(edge_object.Shape, "Vertexes")
or len(edge_object.Shape.Vertexes) < 1):
_err(_tr("Wrong input: object doesn't have at least one element "
"in 'Vertexes' to use for measuring."))
_err(translate("draft","Wrong input: object doesn't have at least one element in 'Vertexes' to use for measuring."))
return None
_msg("i1: {}".format(i1))
try:
utils.type_check([(i1, int)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be an integer."))
_err(translate("draft","Wrong input: must be an integer."))
return None
if i1 < 1:
i1 = 1
_wrn(_tr("i1: values below 1 are not allowed; will be set to 1."))
_wrn(translate("draft","i1: values below 1 are not allowed; will be set to 1."))
vx1 = edge_object.getSubObject("Vertex" + str(i1))
if not vx1:
_err(_tr("Wrong input: vertex not in object."))
_err(translate("draft","Wrong input: vertex not in object."))
return None
_msg("i2: {}".format(i2))
try:
utils.type_check([(i2, int)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a vector."))
_err(translate("draft","Wrong input: must be a vector."))
return None
if i2 < 1:
i2 = len(edge_object.Shape.Vertexes)
_wrn(_tr("i2: values below 1 are not allowed; "
"will be set to the last vertex in the object."))
_wrn(translate("draft","i2: values below 1 are not allowed; will be set to the last vertex in the object."))
vx2 = edge_object.getSubObject("Vertex" + str(i2))
if not vx2:
_err(_tr("Wrong input: vertex not in object."))
_err(translate("draft","Wrong input: vertex not in object."))
return None
_msg("dim_line: {}".format(dim_line))
@@ -372,7 +368,7 @@ def make_linear_dimension_obj(edge_object, i1=1, i2=2, dim_line=None):
try:
utils.type_check([(dim_line, App.Vector)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a vector."))
_err(translate("draft","Wrong input: must be a vector."))
return None
else:
diff = vx2.Point.sub(vx1.Point)
@@ -439,7 +435,7 @@ def make_radial_dimension_obj(edge_object, index=1, mode="radius",
found, doc = utils.find_doc(App.activeDocument())
if not found:
_err(_tr("No active document. Aborting."))
_err(translate("draft","No active document. Aborting."))
return None
if isinstance(edge_object, str):
@@ -448,49 +444,47 @@ def make_radial_dimension_obj(edge_object, index=1, mode="radius",
found, edge_object = utils.find_object(edge_object, doc)
if not found:
_msg("edge_object: {}".format(edge_object_str))
_err(_tr("Wrong input: object not in document."))
_err(translate("draft","Wrong input: object not in document."))
return None
_msg("edge_object: {}".format(edge_object.Label))
if not hasattr(edge_object, "Shape"):
_err(_tr("Wrong input: object doesn't have a 'Shape' to measure."))
_err(translate("draft","Wrong input: object doesn't have a 'Shape' to measure."))
return None
if (not hasattr(edge_object.Shape, "Edges")
or len(edge_object.Shape.Edges) < 1):
_err(_tr("Wrong input: object doesn't have at least one element "
"in 'Edges' to use for measuring."))
_err(translate("draft","Wrong input: object doesn't have at least one element in 'Edges' to use for measuring."))
return None
_msg("index: {}".format(index))
try:
utils.type_check([(index, int)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be an integer."))
_err(translate("draft","Wrong input: must be an integer."))
return None
if index < 1:
index = 1
_wrn(_tr("index: values below 1 are not allowed; will be set to 1."))
_wrn(translate("draft","index: values below 1 are not allowed; will be set to 1."))
edge = edge_object.getSubObject("Edge" + str(index))
if not edge:
_err(_tr("Wrong input: index doesn't correspond to an edge "
"in the object."))
_err(translate("draft","Wrong input: index doesn't correspond to an edge in the object."))
return None
if not hasattr(edge, "Curve") or edge.Curve.TypeId != 'Part::GeomCircle':
_err(_tr("Wrong input: index doesn't correspond to a circular edge."))
_err(translate("draft","Wrong input: index doesn't correspond to a circular edge."))
return None
_msg("mode: {}".format(mode))
try:
utils.type_check([(mode, str)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a string, 'radius' or 'diameter'."))
_err(translate("draft","Wrong input: must be a string, 'radius' or 'diameter'."))
return None
if mode not in ("radius", "diameter"):
_err(_tr("Wrong input: must be a string, 'radius' or 'diameter'."))
_err(translate("draft","Wrong input: must be a string, 'radius' or 'diameter'."))
return None
_msg("dim_line: {}".format(dim_line))
@@ -498,7 +492,7 @@ def make_radial_dimension_obj(edge_object, index=1, mode="radius",
try:
utils.type_check([(dim_line, App.Vector)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a vector."))
_err(translate("draft","Wrong input: must be a vector."))
return None
else:
center = edge_object.Shape.Edges[index - 1].Curve.Center
@@ -563,14 +557,14 @@ def make_angular_dimension(center=App.Vector(0, 0, 0),
found, doc = utils.find_doc(App.activeDocument())
if not found:
_err(_tr("No active document. Aborting."))
_err(translate("draft","No active document. Aborting."))
return None
_msg("center: {}".format(center))
try:
utils.type_check([(center, App.Vector)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a vector."))
_err(translate("draft","Wrong input: must be a vector."))
return None
_msg("angles: {}".format(angles))
@@ -578,14 +572,14 @@ def make_angular_dimension(center=App.Vector(0, 0, 0),
utils.type_check([(angles, (tuple, list))], name=_name)
if len(angles) != 2:
_err(_tr("Wrong input: must be a list with two angles."))
_err(translate("draft","Wrong input: must be a list with two angles."))
return None
ang1, ang2 = angles
utils.type_check([(ang1, (int, float)),
(ang2, (int, float))], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a list with two angles."))
_err(translate("draft","Wrong input: must be a list with two angles."))
return None
# If the angle is larger than 360 degrees, make sure
@@ -598,7 +592,7 @@ def make_angular_dimension(center=App.Vector(0, 0, 0),
try:
utils.type_check([(dim_line, App.Vector)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a vector."))
_err(translate("draft","Wrong input: must be a vector."))
return None
_msg("normal: {}".format(normal))
@@ -606,7 +600,7 @@ def make_angular_dimension(center=App.Vector(0, 0, 0),
try:
utils.type_check([(dim_line, App.Vector)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a vector."))
_err(translate("draft","Wrong input: must be a vector."))
return None
if not normal:
+8 -8
View File
@@ -35,7 +35,7 @@ import draftutils.gui_utils as gui_utils
import draftobjects.fillet as fillet
from draftutils.messages import _msg, _err
from draftutils.translate import _tr
from draftutils.translate import translate
if App.GuiUp:
import draftviewproviders.view_fillet as view_fillet
@@ -55,7 +55,7 @@ def _print_obj_length(obj, edge, num=1):
name = num
_msg("({0}): {1}; {2} {3}".format(num, name,
_tr("length:"), edge.Length))
translate("draft","length:"), edge.Length))
def _extract_edges(objs):
@@ -129,20 +129,20 @@ def make_fillet(objs, radius=100, chamfer=False, delete=False):
utils.print_header(_name, "Fillet")
if len(objs) != 2:
_err(_tr("Two elements are needed."))
_err(translate("draft","Two elements are needed."))
return None
e1, e2 = _extract_edges(objs)
edges = DraftGeomUtils.fillet([e1, e2], radius, chamfer)
if len(edges) < 3:
_err(_tr("Radius is too large") + ", r={}".format(radius))
_err(translate("draft","Radius is too large") + ", r={}".format(radius))
return None
lengths = [edges[0].Length, edges[1].Length, edges[2].Length]
_msg(_tr("Segment") + " 1, " + _tr("length:") + " {}".format(lengths[0]))
_msg(_tr("Segment") + " 2, " + _tr("length:") + " {}".format(lengths[1]))
_msg(_tr("Segment") + " 3, " + _tr("length:") + " {}".format(lengths[2]))
_msg(translate("draft","Segment") + " 1, " + translate("draft","length:") + " {}".format(lengths[0]))
_msg(translate("draft","Segment") + " 2, " + translate("draft","length:") + " {}".format(lengths[1]))
_msg(translate("draft","Segment") + " 3, " + translate("draft","length:") + " {}".format(lengths[2]))
try:
wire = Part.Wire(edges)
@@ -162,7 +162,7 @@ def make_fillet(objs, radius=100, chamfer=False, delete=False):
if delete:
_doc.removeObject(objs[0].Name)
_doc.removeObject(objs[1].Name)
_msg(_tr("Removed original objects."))
_msg(translate("draft","Removed original objects."))
if App.GuiUp:
view_fillet.ViewProviderFillet(obj.ViewObject)
+17 -27
View File
@@ -35,7 +35,7 @@ import draftutils.gui_utils as gui_utils
import draftutils.utils as utils
from draftutils.messages import _msg, _wrn, _err
from draftutils.translate import _tr
from draftutils.translate import translate
from draftobjects.label import Label
if App.GuiUp:
@@ -191,7 +191,7 @@ def make_label(target_point=App.Vector(0, 0, 0),
found, doc = utils.find_doc(App.activeDocument())
if not found:
_err(_tr("No active document. Aborting."))
_err(translate("draft","No active document. Aborting."))
return None
_msg("target_point: {}".format(target_point))
@@ -200,7 +200,7 @@ def make_label(target_point=App.Vector(0, 0, 0),
try:
utils.type_check([(target_point, App.Vector)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a vector."))
_err(translate("draft","Wrong input: must be a vector."))
return None
_msg("placement: {}".format(placement))
@@ -211,8 +211,7 @@ def make_label(target_point=App.Vector(0, 0, 0),
App.Vector,
App.Rotation))], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a placement, a vector, "
"or a rotation."))
_err(translate("draft","Wrong input: must be a placement, a vector, or a rotation."))
return None
# Convert the vector or rotation to a full placement
@@ -227,13 +226,13 @@ def make_label(target_point=App.Vector(0, 0, 0),
if target_object:
if isinstance(target_object, (list, tuple)):
_msg("target_object: {}".format(target_object))
_err(_tr("Wrong input: object must not be a list."))
_err(translate("draft","Wrong input: object must not be a list."))
return None
found, target_object = utils.find_object(target_object, doc)
if not found:
_msg("target_object: {}".format(target_object_str))
_err(_tr("Wrong input: object not in document."))
_err(translate("draft","Wrong input: object not in document."))
return None
_msg("target_object: {}".format(target_object.Label))
@@ -248,8 +247,7 @@ def make_label(target_point=App.Vector(0, 0, 0),
utils.type_check([(subelements, (list, tuple, str))],
name=_name)
except TypeError:
_err(_tr("Wrong input: must be a list or tuple of strings. "
"Or a single string."))
_err(translate("draft","Wrong input: must be a list or tuple of strings, or a single string."))
return None
# The subelements list is used to build a special list
@@ -261,7 +259,7 @@ def make_label(target_point=App.Vector(0, 0, 0),
_sub = target_object.getSubObject(sub)
if not _sub:
_err("subelement: {}".format(sub))
_err(_tr("Wrong input: subelement not in object."))
_err(translate("draft","Wrong input: subelement not in object."))
return None
_msg("label_type: {}".format(label_type))
@@ -270,16 +268,12 @@ def make_label(target_point=App.Vector(0, 0, 0),
try:
utils.type_check([(label_type, str)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a string, "
"'Custom', 'Name', 'Label', 'Position', "
"'Length', 'Area', 'Volume', 'Tag', or 'Material'."))
_err(translate("draft","Wrong input: must be a string, 'Custom', 'Name', 'Label', 'Position', 'Length', 'Area', 'Volume', 'Tag', or 'Material'."))
return None
if label_type not in ("Custom", "Name", "Label", "Position",
"Length", "Area", "Volume", "Tag", "Material"):
_err(_tr("Wrong input: must be a string, "
"'Custom', 'Name', 'Label', 'Position', "
"'Length', 'Area', 'Volume', 'Tag', or 'Material'."))
_err(translate("draft","Wrong input: must be a string, 'Custom', 'Name', 'Label', 'Position', 'Length', 'Area', 'Volume', 'Tag', or 'Material'."))
return None
_msg("custom_text: {}".format(custom_text))
@@ -288,7 +282,7 @@ def make_label(target_point=App.Vector(0, 0, 0),
try:
utils.type_check([(custom_text, str)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a string."))
_err(translate("draft","Wrong input: must be a string."))
return None
_msg("direction: {}".format(direction))
@@ -297,13 +291,11 @@ def make_label(target_point=App.Vector(0, 0, 0),
try:
utils.type_check([(direction, str)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a string, "
"'Horizontal', 'Vertical', or 'Custom'."))
_err(translate("draft","Wrong input: must be a string, 'Horizontal', 'Vertical', or 'Custom'."))
return None
if direction not in ("Horizontal", "Vertical", "Custom"):
_err(_tr("Wrong input: must be a string, "
"'Horizontal', 'Vertical', or 'Custom'."))
_err(translate("draft","Wrong input: must be a string, 'Horizontal', 'Vertical', or 'Custom'."))
return None
_msg("distance: {}".format(distance))
@@ -312,13 +304,13 @@ def make_label(target_point=App.Vector(0, 0, 0),
try:
utils.type_check([(distance, (int, float))], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a number."))
_err(translate("draft","Wrong input: must be a number."))
return None
if points:
_msg("points: {}".format(points))
_err_msg = _tr("Wrong input: must be a list of at least two vectors.")
_err_msg = translate("draft","Wrong input: must be a list of at least two vectors.")
try:
utils.type_check([(points, (tuple, list))], name=_name)
except TypeError:
@@ -352,8 +344,7 @@ def make_label(target_point=App.Vector(0, 0, 0),
new_obj.StraightDistance = distance
if points:
if direction != "Custom":
_wrn(_tr("Direction is not 'Custom'; "
"points won't be used."))
_wrn(translate("draft","Direction is not 'Custom'; points won't be used."))
new_obj.Points = points
if App.GuiUp:
@@ -380,8 +371,7 @@ def makeLabel(targetpoint=None, target=None, direction=None,
utils.type_check([(target, (tuple, list))],
name=_name)
except TypeError:
_err(_tr("Wrong input: must be a list of two elements. "
"For example, [object, 'Edge1']."))
_err(translate("draft","Wrong input: must be a list of two elements. For example, [object, 'Edge1']."))
return None
# In the old function `target` is the original parameter,
+13 -17
View File
@@ -32,7 +32,7 @@ import FreeCAD as App
import draftutils.utils as utils
from draftutils.messages import _msg, _err
from draftutils.translate import _tr, translate
from draftutils.translate import translate
from draftobjects.layer import (Layer,
LayerContainer)
@@ -55,7 +55,7 @@ def get_layer_container():
"""
found, doc = utils.find_doc(App.activeDocument())
if not found:
_err(_tr("No active document. Aborting."))
_err(translate("draft","No active document. Aborting."))
return None
for obj in doc.Objects:
@@ -142,11 +142,11 @@ def make_layer(name=None,
If there is a problem it will return `None`.
"""
_name = "make_layer"
utils.print_header(_name, _tr("Layer"))
utils.print_header(_name, translate("draft","Layer"))
found, doc = utils.find_doc(App.activeDocument())
if not found:
_err(_tr("No active document. Aborting."))
_err(translate("draft","No active document. Aborting."))
return None
if name:
@@ -154,23 +154,21 @@ def make_layer(name=None,
try:
utils.type_check([(name, str)], name=_name)
except TypeError:
_err(_tr("Wrong input: it must be a string."))
_err(translate("draft","Wrong input: it must be a string."))
return None
else:
name = translate("draft", "Layer")
_info_color = ("Wrong input: "
"must be a tuple of three floats 0.0 to 1.0.")
if line_color:
_msg("line_color: {}".format(line_color))
try:
utils.type_check([(line_color, tuple)], name=_name)
except TypeError:
_err(_tr(_info_color))
_err(translate("draft","Wrong input: must be a tuple of three floats 0.0 to 1.0."))
return None
if not all(isinstance(color, (int, float)) for color in line_color):
_err(_tr(_info_color))
_err(translate("draft","Wrong input: must be a tuple of three floats 0.0 to 1.0."))
return None
else:
c = view_group.GetUnsigned("DefaultShapeLineColor", 255)
@@ -183,11 +181,11 @@ def make_layer(name=None,
try:
utils.type_check([(shape_color, tuple)], name=_name)
except TypeError:
_err(_tr(_info_color))
_err(translate("draft","Wrong input: must be a tuple of three floats 0.0 to 1.0."))
return None
if not all(isinstance(color, (int, float)) for color in shape_color):
_err(_tr(_info_color))
_err(translate("draft","Wrong input: must be a tuple of three floats 0.0 to 1.0."))
return None
else:
c = view_group.GetUnsigned("DefaultShapeColor", 4294967295)
@@ -200,20 +198,18 @@ def make_layer(name=None,
utils.type_check([(line_width, (int, float))], name=_name)
line_width = float(abs(line_width))
except TypeError:
_err(_tr("Wrong input: must be a number."))
_err(translate("draft","Wrong input: must be a number."))
return None
_info_style = ("Wrong input: "
"must be 'Solid', 'Dashed', 'Dotted', or 'Dashdot'.")
_msg("draw_style: {}".format(draw_style))
try:
utils.type_check([(draw_style, str)], name=_name)
except TypeError:
_err(_tr(_info_style))
_err(translate("draft","Wrong input: must be 'Solid', 'Dashed', 'Dotted', or 'Dashdot'."))
return None
if draw_style not in ('Solid', 'Dashed', 'Dotted', 'Dashdot'):
_err(_tr(_info_style))
_err(translate("draft","Wrong input: must be 'Solid', 'Dashed', 'Dotted', or 'Dashdot'."))
return None
_msg("transparency: {}".format(transparency))
@@ -221,7 +217,7 @@ def make_layer(name=None,
utils.type_check([(transparency, (int, float))], name=_name)
transparency = int(abs(transparency))
except TypeError:
_err(_tr("Wrong input: must be a number between 0 and 100."))
_err(translate("draft","Wrong input: must be a number between 0 and 100."))
return None
new_obj = doc.addObject("App::FeaturePython", "Layer")
+16 -19
View File
@@ -32,7 +32,7 @@ import draftutils.utils as utils
import draftmake.make_array as make_array
from draftutils.messages import _msg, _wrn, _err
from draftutils.translate import _tr
from draftutils.translate import translate
def _make_ortho_array(base_object,
@@ -57,7 +57,7 @@ def _make_ortho_array(base_object,
This should be handled by the subfunctions that use this one.
"""
_name = "_make_ortho_array"
utils.print_header(_name, _tr("Internal orthogonal array"), debug=False)
utils.print_header(_name, translate("draft","Internal orthogonal array"), debug=False)
new_obj = make_array.make_array(base_object,
arg1=v_x, arg2=v_y, arg3=v_z,
@@ -84,19 +84,18 @@ def _are_vectors(v_x, v_y, v_z=None, name="Unknown"):
(v_y, (int, float, App.Vector))],
name=name)
except TypeError:
_err(_tr("Wrong input: must be a number or vector."))
_err(translate("draft","Wrong input: must be a number or vector."))
return False, v_x, v_y, v_z
_text = "Input: single value expanded to vector."
if not isinstance(v_x, App.Vector):
v_x = App.Vector(v_x, 0, 0)
_wrn(_tr(_text))
_wrn(translate("draft","Input: single value expanded to vector."))
if not isinstance(v_y, App.Vector):
v_y = App.Vector(0, v_y, 0)
_wrn(_tr(_text))
_wrn(translate("draft","Input: single value expanded to vector."))
if v_z and not isinstance(v_z, App.Vector):
v_z = App.Vector(0, 0, v_z)
_wrn(_tr(_text))
_wrn(translate("draft","Input: single value expanded to vector."))
return True, v_x, v_y, v_z
@@ -117,19 +116,17 @@ def _are_integers(n_x, n_y, n_z=None, name="Unknown"):
utils.type_check([(n_x, int),
(n_y, int)], name=name)
except TypeError:
_err(_tr("Wrong input: must be an integer number."))
_err(translate("draft","Wrong input: must be an integer number."))
return False, n_x, n_y, n_z
_text = ("Input: number of elements must be at least 1. "
"It is set to 1.")
if n_x < 1:
_wrn(_tr(_text))
_wrn(translate("draft","Input: number of elements must be at least 1. It is set to 1."))
n_x = 1
if n_y < 1:
_wrn(_tr(_text))
_wrn(translate("draft","Input: number of elements must be at least 1. It is set to 1."))
n_y = 1
if n_z and n_z < 1:
_wrn(_tr(_text))
_wrn(translate("draft","Input: number of elements must be at least 1. It is set to 1."))
n_z = 1
return True, n_x, n_y, n_z
@@ -151,7 +148,7 @@ def _are_numbers(d_x, d_y, d_z=None, name="Unknown"):
utils.type_check([(d_x, (int, float)),
(d_y, (int, float))], name=name)
except TypeError:
_err(_tr("Wrong input: must be a number."))
_err(translate("draft","Wrong input: must be a number."))
return False, d_x, d_y, d_z
return True, d_x, d_y, d_z
@@ -167,7 +164,7 @@ def _find_object_in_doc(base_object, doc=None):
doc=doc)
if not found:
_msg("base_object: {}".format(base_object_str))
_err(_tr("Wrong input: object not in document."))
_err(translate("draft","Wrong input: object not in document."))
return not FOUND, base_object
_msg("base_object: {}".format(base_object.Label))
@@ -275,7 +272,7 @@ def make_ortho_array(base_object,
make_circular_array, make_path_array, make_point_array
"""
_name = "make_ortho_array"
utils.print_header(_name, _tr("Orthogonal array"))
utils.print_header(_name, translate("draft","Orthogonal array"))
found, base_object = _find_object_in_doc(base_object,
doc=App.activeDocument())
@@ -350,7 +347,7 @@ def make_ortho_array2d(base_object,
make_circular_array, make_path_array, make_point_array
"""
_name = "make_ortho_array2d"
utils.print_header(_name, _tr("Orthogonal array 2D"))
utils.print_header(_name, translate("draft","Orthogonal array 2D"))
found, base_object = _find_object_in_doc(base_object,
doc=App.activeDocument())
@@ -424,7 +421,7 @@ def make_rect_array(base_object,
make_circular_array, make_path_array, make_point_array
"""
_name = "make_rect_array"
utils.print_header(_name, _tr("Rectangular array"))
utils.print_header(_name, translate("draft","Rectangular array"))
found, base_object = _find_object_in_doc(base_object,
doc=App.activeDocument())
@@ -501,7 +498,7 @@ def make_rect_array2d(base_object,
make_circular_array, make_path_array, make_point_array
"""
_name = "make_rect_array2d"
utils.print_header(_name, _tr("Rectangular array 2D"))
utils.print_header(_name, translate("draft","Rectangular array 2D"))
found, base_object = _find_object_in_doc(base_object,
doc=App.activeDocument())
+14 -16
View File
@@ -41,7 +41,7 @@ import draftutils.utils as utils
import draftutils.gui_utils as gui_utils
from draftutils.messages import _msg, _err
from draftutils.translate import _tr
from draftutils.translate import translate
from draftobjects.patharray import PathArray
from draftobjects.pathtwistedarray import PathTwistedArray
@@ -158,7 +158,7 @@ def make_path_array(base_object, path_object, count=4,
found, doc = utils.find_doc(App.activeDocument())
if not found:
_err(_tr("No active document. Aborting."))
_err(translate("draft","No active document. Aborting."))
return None
if isinstance(base_object, str):
@@ -167,7 +167,7 @@ def make_path_array(base_object, path_object, count=4,
found, base_object = utils.find_object(base_object, doc)
if not found:
_msg("base_object: {}".format(base_object_str))
_err(_tr("Wrong input: object not in document."))
_err(translate("draft","Wrong input: object not in document."))
return None
_msg("base_object: {}".format(base_object.Label))
@@ -178,7 +178,7 @@ def make_path_array(base_object, path_object, count=4,
found, path_object = utils.find_object(path_object, doc)
if not found:
_msg("path_object: {}".format(path_object_str))
_err(_tr("Wrong input: object not in document."))
_err(translate("draft","Wrong input: object not in document."))
return None
_msg("path_object: {}".format(path_object.Label))
@@ -188,7 +188,7 @@ def make_path_array(base_object, path_object, count=4,
utils.type_check([(count, (int, float))],
name=_name)
except TypeError:
_err(_tr("Wrong input: must be a number."))
_err(translate("draft","Wrong input: must be a number."))
return None
count = int(count)
@@ -197,7 +197,7 @@ def make_path_array(base_object, path_object, count=4,
utils.type_check([(extra, App.Vector)],
name=_name)
except TypeError:
_err(_tr("Wrong input: must be a vector."))
_err(translate("draft","Wrong input: must be a vector."))
return None
_msg("subelements: {}".format(subelements))
@@ -210,8 +210,7 @@ def make_path_array(base_object, path_object, count=4,
utils.type_check([(subelements, (list, tuple, str))],
name=_name)
except TypeError:
_err(_tr("Wrong input: must be a list or tuple of strings. "
"Or a single string."))
_err(translate("draft","Wrong input: must be a list or tuple of strings, or a single string."))
return None
# The subelements list is used to build a special list
@@ -244,8 +243,7 @@ def make_path_array(base_object, path_object, count=4,
if align_mode not in ("Original", "Frenet", "Tangent"):
raise TypeError
except TypeError:
_err(_tr("Wrong input: must be "
"'Original', 'Frenet', or 'Tangent'."))
_err(translate("draft","Wrong input: must be 'Original', 'Frenet', or 'Tangent'."))
return None
_msg("tan_vector: {}".format(tan_vector))
@@ -253,7 +251,7 @@ def make_path_array(base_object, path_object, count=4,
utils.type_check([(tan_vector, App.Vector)],
name=_name)
except TypeError:
_err(_tr("Wrong input: must be a vector."))
_err(translate("draft","Wrong input: must be a vector."))
return None
force_vertical = bool(force_vertical)
@@ -264,7 +262,7 @@ def make_path_array(base_object, path_object, count=4,
utils.type_check([(vertical_vector, App.Vector)],
name=_name)
except TypeError:
_err(_tr("Wrong input: must be a vector."))
_err(translate("draft","Wrong input: must be a vector."))
return None
use_link = bool(use_link)
@@ -329,7 +327,7 @@ def make_path_twisted_array(base_object, path_object,
found, doc = utils.find_doc(App.activeDocument())
if not found:
_err(_tr("No active document. Aborting."))
_err(translate("draft","No active document. Aborting."))
return None
if isinstance(base_object, str):
@@ -338,7 +336,7 @@ def make_path_twisted_array(base_object, path_object,
found, base_object = utils.find_object(base_object, doc)
if not found:
_msg("base_object: {}".format(base_object_str))
_err(_tr("Wrong input: object not in document."))
_err(translate("draft","Wrong input: object not in document."))
return None
_msg("base_object: {}".format(base_object.Label))
@@ -349,7 +347,7 @@ def make_path_twisted_array(base_object, path_object,
found, path_object = utils.find_object(path_object, doc)
if not found:
_msg("path_object: {}".format(path_object_str))
_err(_tr("Wrong input: object not in document."))
_err(translate("draft","Wrong input: object not in document."))
return None
_msg("path_object: {}".format(path_object.Label))
@@ -359,7 +357,7 @@ def make_path_twisted_array(base_object, path_object,
utils.type_check([(count, (int, float))],
name=_name)
except TypeError:
_err(_tr("Wrong input: must be a number."))
_err(translate("draft","Wrong input: must be a number."))
return None
count = int(count)
+6 -8
View File
@@ -40,7 +40,7 @@ import draftutils.utils as utils
import draftutils.gui_utils as gui_utils
from draftutils.messages import _msg, _err
from draftutils.translate import _tr
from draftutils.translate import translate
from draftobjects.pointarray import PointArray
if App.GuiUp:
@@ -105,7 +105,7 @@ def make_point_array(base_object, point_object, extra=None, use_link=True):
found, doc = utils.find_doc(App.activeDocument())
if not found:
_err(_tr("No active document. Aborting."))
_err(translate("draft","No active document. Aborting."))
return None
if isinstance(base_object, str):
@@ -114,7 +114,7 @@ def make_point_array(base_object, point_object, extra=None, use_link=True):
found, base_object = utils.find_object(base_object, doc)
if not found:
_msg("base_object: {}".format(base_object_str))
_err(_tr("Wrong input: object not in document."))
_err(translate("draft","Wrong input: object not in document."))
return None
_msg("base_object: {}".format(base_object.Label))
@@ -125,15 +125,14 @@ def make_point_array(base_object, point_object, extra=None, use_link=True):
found, point_object = utils.find_object(point_object, doc)
if not found:
_msg("point_object: {}".format(point_object_str))
_err(_tr("Wrong input: object not in document."))
_err(translate("draft","Wrong input: object not in document."))
return None
_msg("point_object: {}".format(point_object.Label))
if (not hasattr(point_object, "Geometry")
and not hasattr(point_object, "Links")
and not hasattr(point_object, "Components")):
_err(_tr("Wrong input: point object doesn't have "
"'Geometry', 'Links', or 'Components'."))
_err(translate("draft","Wrong input: point object doesn't have 'Geometry', 'Links', or 'Components'."))
return None
_msg("extra: {}".format(extra))
@@ -145,8 +144,7 @@ def make_point_array(base_object, point_object, extra=None, use_link=True):
App.Rotation))],
name=_name)
except TypeError:
_err(_tr("Wrong input: must be a placement, a vector, "
"or a rotation."))
_err(translate("draft","Wrong input: must be a placement, a vector, or a rotation."))
return None
# Convert the vector or rotation to a full placement
+6 -6
View File
@@ -32,7 +32,7 @@ import draftutils.utils as utils
import draftmake.make_array as make_array
from draftutils.messages import _msg, _err
from draftutils.translate import _tr
from draftutils.translate import translate
def make_polar_array(base_object,
@@ -91,7 +91,7 @@ def make_polar_array(base_object,
make_ortho_array, make_circular_array, make_path_array, make_point_array
"""
_name = "make_polar_array"
utils.print_header(_name, _tr("Polar array"))
utils.print_header(_name, translate("draft","Polar array"))
if isinstance(base_object, str):
base_object_str = base_object
@@ -100,7 +100,7 @@ def make_polar_array(base_object,
doc=App.activeDocument())
if not found:
_msg("base_object: {}".format(base_object_str))
_err(_tr("Wrong input: object not in document."))
_err(translate("draft","Wrong input: object not in document."))
return None
_msg("base_object: {}".format(base_object.Label))
@@ -109,21 +109,21 @@ def make_polar_array(base_object,
try:
utils.type_check([(number, int)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be an integer number."))
_err(translate("draft","Wrong input: must be an integer number."))
return None
_msg("angle: {}".format(angle))
try:
utils.type_check([(angle, (int, float))], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a number."))
_err(translate("draft","Wrong input: must be a number."))
return None
_msg("center: {}".format(center))
try:
utils.type_check([(center, App.Vector)], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a vector."))
_err(translate("draft","Wrong input: must be a vector."))
return None
use_link = bool(use_link)
+6 -9
View File
@@ -34,7 +34,7 @@ import draftutils.utils as utils
import draftutils.gui_utils as gui_utils
from draftutils.messages import _msg, _err
from draftutils.translate import _tr
from draftutils.translate import translate
from draftobjects.text import Text
if App.GuiUp:
@@ -87,20 +87,18 @@ def make_text(string, placement=None, screen=False):
found, doc = utils.find_doc(App.activeDocument())
if not found:
_err(_tr("No active document. Aborting."))
_err(translate("draft","No active document. Aborting."))
return None
_msg("string: {}".format(string))
try:
utils.type_check([(string, (str, list))])
except TypeError:
_err(_tr("Wrong input: must be a list of strings "
"or a single string."))
_err(translate("draft","Wrong input: must be a list of strings or a single string."))
return None
if not all(isinstance(element, str) for element in string):
_err(_tr("Wrong input: must be a list of strings "
"or a single string."))
_err(translate("draft","Wrong input: must be a list of strings or a single string."))
return None
if isinstance(string, str):
@@ -114,8 +112,7 @@ def make_text(string, placement=None, screen=False):
App.Vector,
App.Rotation))], name=_name)
except TypeError:
_err(_tr("Wrong input: must be a placement, a vector, "
"or a rotation."))
_err(translate("draft","Wrong input: must be a placement, a vector, or a rotation."))
return None
# Convert the vector or rotation to a full placement
@@ -180,7 +177,7 @@ def convert_draft_texts(textslist=None):
found, doc = utils.find_doc(App.activeDocument())
if not found:
_err(_tr("No active document. Aborting."))
_err(translate("draft","No active document. Aborting."))
return None
if not textslist:
+6 -17
View File
@@ -40,7 +40,7 @@ through Coin (pivy).
from PySide.QtCore import QT_TRANSLATE_NOOP
from draftutils.messages import _wrn
from draftutils.translate import _tr
from draftutils.translate import translate
class DraftAnnotation(object):
@@ -86,19 +86,10 @@ class DraftAnnotation(object):
_tip)
vobj.ScaleMultiplier = 1.00
_info = "added view property 'ScaleMultiplier'"
_wrn("v0.19, " + obj.Label + ", " + _tr(_info))
_wrn("v0.19, " + obj.Label + ", " + translate("draft","added view property 'ScaleMultiplier'"))
if 'AnnotationStyle' not in vproperties:
_tip = QT_TRANSLATE_NOOP("App::Property",
"Annotation style to apply "
"to this object.\n"
"When using a saved style "
"some of the view properties "
"will become read-only;\n"
"they will only be editable by changing "
"the style through "
"the 'Annotation style editor' tool.")
_tip = QT_TRANSLATE_NOOP("App::Property","Annotation style to apply to this object.\nWhen using a saved style some of the view properties will become read-only;\nthey will only be editable by changing the style through the 'Annotation style editor' tool.")
vobj.addProperty("App::PropertyEnumeration",
"AnnotationStyle",
"Annotation",
@@ -111,7 +102,7 @@ class DraftAnnotation(object):
vobj.AnnotationStyle = [""] + styles
_info = "added view property 'AnnotationStyle'"
_wrn("v0.19, " + obj.Label + ", " + _tr(_info))
_wrn("v0.19, " + obj.Label + ", " + translate("draft","added view property 'ScaleMultiplier'"))
def __getstate__(self):
"""Return a tuple of objects to save or None.
@@ -131,14 +122,12 @@ class DraftAnnotation(object):
# the 'DraftText' type was changed to 'Text' type
if state["Type"] == "DraftText":
state["Type"] = "Text"
_info = "migrated 'DraftText' type to 'Text'"
_wrn("v0.19, " + _tr(_info))
_wrn("v0.19, " + translate("draft","migrated 'DraftText' type to 'Text'"))
self.Type = state["Type"]
else:
if state == "DraftText":
state = "Text"
_info = "migrated 'DraftText' type to 'Text'"
_wrn("v0.19, " + _tr(_info))
_wrn("v0.19, " + translate("draft","migrated 'DraftText' type to 'Text'"))
self.Type = state
def execute(self, obj):
+23 -48
View File
@@ -68,8 +68,8 @@ import DraftVecUtils
import lazy_loader.lazy_loader as lz
from draftutils.messages import _msg, _wrn, _err
from draftutils.translate import _tr
from draftutils.translate import translate
def QT_TRANSLATE_NOOP(ctx,txt): return txt
from draftobjects.base import DraftObject
from draftobjects.draftlink import DraftLink
@@ -165,7 +165,7 @@ class PathArray(DraftLink):
def set_general_properties(self, obj, properties):
"""Set general properties only if they don't exist."""
if "Base" not in properties:
_tip = _tr("The base object that will be duplicated")
_tip = QT_TRANSLATE_NOOP("App::Property","The base object that will be duplicated")
obj.addProperty("App::PropertyLinkGlobal",
"Base",
"Objects",
@@ -173,9 +173,7 @@ class PathArray(DraftLink):
obj.Base = None
if "PathObject" not in properties:
_tip = _tr("The object along which "
"the copies will be distributed. "
"It must contain 'Edges'.")
_tip = QT_TRANSLATE_NOOP("App::Property","The object along which the copies will be distributed. It must contain 'Edges'.")
obj.addProperty("App::PropertyLinkGlobal",
"PathObject",
"Objects",
@@ -190,11 +188,7 @@ class PathArray(DraftLink):
# as this property can be used to select a single object,
# or a single object with its subelements.
if "PathSubelements" not in properties:
_tip = _tr("List of connected edges in the 'Path Object'.\n"
"If these are present, the copies will be created "
"along these subelements only.\n"
"Leave this property empty to create copies along "
"the entire 'Path Object'.")
_tip = QT_TRANSLATE_NOOP("App::Property","List of connected edges in the 'Path Object'.\nIf these are present, the copies will be created along these subelements only.\nLeave this property empty to create copies along the entire 'Path Object'.")
obj.addProperty("App::PropertyLinkSubListGlobal",
"PathSubelements",
"Objects",
@@ -202,7 +196,7 @@ class PathArray(DraftLink):
obj.PathSubelements = []
if "Count" not in properties:
_tip = _tr("Number of copies to create")
_tip = QT_TRANSLATE_NOOP("App::Property","Number of copies to create")
obj.addProperty("App::PropertyInteger",
"Count",
"Objects",
@@ -210,8 +204,7 @@ class PathArray(DraftLink):
obj.Count = 4
if self.use_link and "ExpandArray" not in properties:
_tip = _tr("Show the individual array elements "
"(only for Link arrays)")
_tip = QT_TRANSLATE_NOOP("App::Property","Show the individual array elements (only for Link arrays)")
obj.addProperty("App::PropertyBool",
"ExpandArray",
"Objects",
@@ -222,10 +215,7 @@ class PathArray(DraftLink):
def set_align_properties(self, obj, properties):
"""Set general properties only if they don't exist."""
if "ExtraTranslation" not in properties:
_tip = _tr("Additional translation "
"that will be applied to each copy.\n"
"This is useful to adjust for the difference "
"between shape centre and shape reference point.")
_tip = QT_TRANSLATE_NOOP("App::Property","Additional translation that will be applied to each copy.\nThis is useful to adjust for the difference between shape centre and shape reference point.")
obj.addProperty("App::PropertyVectorDistance",
"ExtraTranslation",
"Alignment",
@@ -233,7 +223,7 @@ class PathArray(DraftLink):
obj.ExtraTranslation = App.Vector(0, 0, 0)
if "TangentVector" not in properties:
_tip = _tr("Alignment vector for 'Tangent' mode")
_tip = QT_TRANSLATE_NOOP("App::Property","Alignment vector for 'Tangent' mode")
obj.addProperty("App::PropertyVector",
"TangentVector",
"Alignment",
@@ -241,8 +231,7 @@ class PathArray(DraftLink):
obj.TangentVector = App.Vector(1, 0, 0)
if "ForceVertical" not in properties:
_tip = _tr("Force use of 'Vertical Vector' as local Z direction "
"when using 'Original' or 'Tangent' alignment mode")
_tip = QT_TRANSLATE_NOOP("App::Property","Force use of 'Vertical Vector' as local Z direction when using 'Original' or 'Tangent' alignment mode")
obj.addProperty("App::PropertyBool",
"ForceVertical",
"Alignment",
@@ -250,8 +239,7 @@ class PathArray(DraftLink):
obj.ForceVertical = False
if "VerticalVector" not in properties:
_tip = _tr("Direction of the local Z axis "
"when 'Force Vertical' is true")
_tip = QT_TRANSLATE_NOOP("App::Property","Direction of the local Z axis when 'Force Vertical' is true")
obj.addProperty("App::PropertyVector",
"VerticalVector",
"Alignment",
@@ -259,16 +247,7 @@ class PathArray(DraftLink):
obj.VerticalVector = App.Vector(0, 0, 1)
if "AlignMode" not in properties:
_tip = _tr("Method to orient the copies along the path.\n"
"- Original: X is curve tangent, Y is normal, "
"and Z is the cross product.\n"
"- Frenet: aligns the object following the local "
"coordinate system along the path.\n"
"- Tangent: similar to 'Original' but the local X "
"axis is pre-aligned to 'Tangent Vector'.\n"
"\n"
"To get better results with 'Original' or 'Tangent' "
"you may have to set 'Force Vertical' to true.")
_tip = QT_TRANSLATE_NOOP("App::Property","Method to orient the copies along the path.\n- Original: X is curve tangent, Y is normal, and Z is the cross product.\n- Frenet: aligns the object following the local coordinate system along the path.\n- Tangent: similar to 'Original' but the local X axis is pre-aligned to 'Tangent Vector'.\n\nTo get better results with 'Original' or 'Tangent' you may have to set 'Force Vertical' to true.")
obj.addProperty("App::PropertyEnumeration",
"AlignMode",
"Alignment",
@@ -279,10 +258,7 @@ class PathArray(DraftLink):
# The Align property must be attached after other align properties
# so that onChanged works properly
if "Align" not in properties:
_tip = _tr("Orient the copies along the path depending "
"on the 'Align Mode'.\n"
"Otherwise the copies will have the same orientation "
"as the original Base object.")
_tip = QT_TRANSLATE_NOOP("App::Property","Orient the copies along the path depending on the 'Align Mode'.\nOtherwise the copies will have the same orientation as the original Base object.")
obj.addProperty("App::PropertyBool",
"Align",
"Alignment",
@@ -305,7 +281,7 @@ class PathArray(DraftLink):
w = self.get_wires(obj.PathObject, obj.PathSubelements)
if not w:
_err(obj.PathObject.Label
+ _tr(", path object doesn't have 'Edges'."))
+ translate("draft",", path object doesn't have 'Edges'."))
return
base_rotation = obj.Base.Shape.Placement.Rotation
@@ -416,20 +392,19 @@ class PathArray(DraftLink):
if "PathObj" in properties:
obj.PathObject = obj.PathObj
obj.removeProperty("PathObj")
_info = "'PathObj' property will be migrated to 'PathObject'"
_wrn("v0.19, " + obj.Label + ", " + _tr(_info))
_wrn("v0.19, " + obj.Label + ", " + translate("draft","'PathObj' property will be migrated to 'PathObject'"))
if "PathSubs" in properties:
obj.PathSubelements = obj.PathSubs
obj.removeProperty("PathSubs")
_info = "'PathSubs' property will be migrated to 'PathSubelements'"
_wrn("v0.19, " + obj.Label + ", " + _tr(_info))
_wrn("v0.19, " + obj.Label + ", " + translate("draft","'PathObj' property will be migrated to 'PathObject'"))
if "Xlate" in properties:
obj.ExtraTranslation = obj.Xlate
obj.removeProperty("Xlate")
_info = "'Xlate' property will be migrated to 'ExtraTranslation'"
_wrn("v0.19, " + obj.Label + ", " + _tr(_info))
_wrn("v0.19, " + obj.Label + ", " + translate("draft","'PathObj' property will be migrated to 'PathObject'"))
# Alias for compatibility with v0.18 and earlier
@@ -546,8 +521,8 @@ def calculate_placement(globalRotation,
try:
t = edge.tangentAt(get_parameter_from_v0(edge, offset))
t.normalize()
except Exception:
_wrn(_tr("Cannot calculate path tangent. Copy not aligned."))
except:
_wrn(translate("draft","Cannot calculate path tangent. Copy not aligned."))
return placement
if mode in ('Original', 'Tangent'):
@@ -563,7 +538,7 @@ def calculate_placement(globalRotation,
except Exception:
# weird special case, tangent and normal parallel
b = nullv
_wrn(_tr("Tangent and normal are parallel. Copy not aligned."))
_wrn(translate("draft","Tangent and normal are parallel. Copy not aligned."))
return placement
if overrideNormal:
@@ -580,20 +555,20 @@ def calculate_placement(globalRotation,
n.normalize()
except App.Base.FreeCADError: # no/infinite normals here
n = defNormal
_msg(_tr("Cannot calculate path normal, using default."))
_msg(translate("draft","Cannot calculate path normal, using default."))
try:
b = t.cross(n)
b.normalize()
except Exception:
b = nullv
_wrn(_tr("Cannot calculate path binormal. Copy not aligned."))
_wrn(translate("draft","Cannot calculate path binormal. Copy not aligned."))
return placement
priority = "XZY"
newRot = App.Rotation(t, n, b, priority) # t/x, n/y, b/z
else:
_msg(_tr("AlignMode {} is not implemented".format(mode)))
_msg(translate("draft","AlignMode {} is not implemented").format(mode))
return placement
# Have valid tangent, normal, binormal
+7 -15
View File
@@ -48,8 +48,8 @@ object in the Arch Workbench.
# \brief Provides the object code for the TwistedArray object.
import draftgeoutils.geo_arrays as geo
from draftutils.translate import _tr
from draftutils.translate import translate
def QT_TRANSLATE_NOOP(ctx,txt): return txt
from draftobjects.draftlink import DraftLink
## \addtogroup draftobjects
@@ -80,46 +80,38 @@ class PathTwistedArray(DraftLink):
properties = []
if "Base" not in properties:
_tip = _tr("The base object that will be duplicated.")
obj.addProperty("App::PropertyLink",
"Base",
"Objects",
_tip)
Qt_TRANSLATE_NOOP("App::Property","The base object that will be duplicated."))
obj.Base = None
if "PathObject" not in properties:
_tip = _tr("The object along which "
"the copies will be distributed. "
"It must contain 'Edges'.")
obj.addProperty("App::PropertyLink",
"PathObject",
"Objects",
_tip)
Qt_TRANSLATE_NOOP("App::Property","The object along which the copies will be distributed. It must contain 'Edges'."))
obj.PathObject = None
if "Count" not in properties:
_tip = _tr("Number of copies to create.")
obj.addProperty("App::PropertyInteger",
"Count",
"Objects",
_tip)
Qt_TRANSLATE_NOOP("App::Property","Number of copies to create."))
obj.Count = 15
if "RotationFactor" not in properties:
_tip = _tr("Rotation factor of the twisted array.")
obj.addProperty("App::PropertyFloat",
"RotationFactor",
"Objects",
_tip)
Qt_TRANSLATE_NOOP("App::Property","Rotation factor of the twisted array."))
obj.RotationFactor = 0.25
if self.use_link and "ExpandArray" not in properties:
_tip = _tr("Show the individual array elements "
"(only for Link arrays)")
obj.addProperty("App::PropertyBool",
"ExpandArray",
"Objects",
_tip)
Qt_TRANSLATE_NOOP("App::Property","Show the individual array elements (only for Link arrays)"))
obj.ExpandArray = False
obj.setPropertyStatus('Shape', 'Transient')
+9 -23
View File
@@ -44,7 +44,7 @@ import FreeCAD as App
import draftutils.utils as utils
from draftutils.messages import _wrn, _err
from draftutils.translate import translate, _tr
from draftutils.translate import translate
from draftobjects.draftlink import DraftLink
# Delay import of module until first use because it is heavy
@@ -75,8 +75,7 @@ class PointArray(DraftLink):
properties = obj.PropertiesList
if "Base" not in properties:
_tip = QT_TRANSLATE_NOOP("App::Property",
"Base object that will be duplicated")
_tip = QT_TRANSLATE_NOOP("App::Property","Base object that will be duplicated")
obj.addProperty("App::PropertyLink",
"Base",
"Objects",
@@ -84,12 +83,7 @@ class PointArray(DraftLink):
obj.Base = None
if "PointObject" not in properties:
_tip = QT_TRANSLATE_NOOP("App::Property",
("Object containing points used to distribute "
"the base object, for example, a sketch or "
"a Part compound.\n"
"The sketch or compound must contain at least "
"one explicit point or vertex object."))
_tip = QT_TRANSLATE_NOOP("App::Property", "Object containing points used to distribute the base object, for example, a sketch or a Part compound.\nThe sketch or compound must contain at least one explicit point or vertex object.")
obj.addProperty("App::PropertyLink",
"PointObject",
"Objects",
@@ -97,10 +91,7 @@ class PointArray(DraftLink):
obj.PointObject = None
if "Count" not in properties:
_tip = QT_TRANSLATE_NOOP("App::Property",
"Total number of elements in the array.\n"
"This property is read-only, as the number depends "
"on the points contained within 'Point Object'.")
_tip = QT_TRANSLATE_NOOP("App::Property","Total number of elements in the array.\nThis property is read-only, as the number depends on the points contained within 'Point Object'.")
obj.addProperty("App::PropertyInteger",
"Count",
"Objects",
@@ -109,9 +100,7 @@ class PointArray(DraftLink):
obj.setEditorMode("Count", 1) # Read only
if "ExtraPlacement" not in properties:
_tip = QT_TRANSLATE_NOOP("App::Property",
"Additional placement, shift and rotation, "
"that will be applied to each copy")
_tip = QT_TRANSLATE_NOOP("App::Property","Additional placement, shift and rotation, that will be applied to each copy")
obj.addProperty("App::PropertyPlacement",
"ExtraPlacement",
"Objects",
@@ -119,8 +108,7 @@ class PointArray(DraftLink):
obj.ExtraPlacement = App.Placement()
if self.use_link and "ExpandArray" not in properties:
_tip = _tr("Show the individual array elements "
"(only for Link arrays)")
_tip = QT_TRANSLATE_NOOP("App::Property","Show the individual array elements (only for Link arrays)")
obj.addProperty("App::PropertyBool",
"ExpandArray",
"Objects",
@@ -147,15 +135,13 @@ class PointArray(DraftLink):
properties = obj.PropertiesList
if "ExtraPlacement" not in properties:
_tip = QT_TRANSLATE_NOOP("App::Property", "Additional placement, shift and rotation, "
"that will be applied to each copy")
_tip = QT_TRANSLATE_NOOP("App::Property", "Additional placement, shift and rotation, that will be applied to each copy")
obj.addProperty("App::PropertyPlacement",
"ExtraPlacement",
"Objects",
_tip)
obj.ExtraPlacement.Base = obj.Base.Placement.Base
_info = "added property 'ExtraPlacement'"
_wrn("v0.19, " + obj.Label + ", " + _tr(_info))
_wrn("v0.19, " + obj.Label + ", " + translate("draft","added property 'ExtraPlacement'"))
self.set_properties(obj)
self.migrate_properties_0v19(obj)
@@ -171,7 +157,7 @@ class PointArray(DraftLink):
obj.PointObject = obj.PointList
obj.removeProperty("PointList")
_info = "'PointList' property will be migrated to 'PointObject'"
_wrn("v0.19, " + obj.Label + ", " + _tr(_info))
_wrn("v0.19, " + obj.Label + ", " + translate("draft","added property 'ExtraPlacement'"))
def get_point_list(point_object):
@@ -38,7 +38,7 @@ import draftutils.utils as utils
from FreeCAD import Units as U
from draftutils.messages import _msg, _wrn, _err, _log
from draftutils.translate import _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
bool(Draft_rc.__name__)
@@ -80,7 +80,7 @@ class TaskPanelCircularArray:
def __init__(self):
self.name = "Circular array"
_log(_tr("Task panel:") + " {}".format(_tr(self.name)))
_log(translate("draft","Task panel:") + " {}".format(translate("draft","Circular array")))
# The .ui file must be loaded into an attribute
# called `self.form` so that it is displayed in the task panel.
@@ -92,7 +92,7 @@ class TaskPanelCircularArray:
pix = QtGui.QPixmap(svg)
icon = QtGui.QIcon.fromTheme(icon_name, QtGui.QIcon(svg))
self.form.setWindowIcon(icon)
self.form.setWindowTitle(_tr(self.name))
self.form.setWindowTitle(translate("draft","Circular array"))
self.form.label_icon.setPixmap(pix.scaled(32, 32))
@@ -215,35 +215,32 @@ class TaskPanelCircularArray:
the interface may not allow to input wrong data.
"""
if not selection:
_err(_tr("At least one element must be selected."))
_err(translate("draft","At least one element must be selected."))
return False
if number < 2:
_err(_tr("Number of layers must be at least 2."))
_err(translate("draft","Number of layers must be at least 2."))
return False
# TODO: this should handle multiple objects.
# Each of the elements of the selection should be tested.
obj = selection[0]
if obj.isDerivedFrom("App::FeaturePython"):
_err(_tr("Selection is not suitable for array."))
_err(_tr("Object:") + " {}".format(selection[0].Label))
_err(translate("draft","Selection is not suitable for array."))
_err(translate("draft","Object:") + " {}".format(selection[0].Label))
return False
if r_distance == 0:
_wrn(_tr("Radial distance is zero. "
"Resulting array may not look correct."))
_wrn(translate("draft","Radial distance is zero. Resulting array may not look correct."))
elif r_distance < 0:
_wrn(_tr("Radial distance is negative. "
"It is made positive to proceed."))
_wrn(translate("draft","Radial distance is negative. It is made positive to proceed."))
self.r_distance = abs(r_distance)
if tan_distance == 0:
_err(_tr("Tangential distance cannot be zero."))
_err(translate("draft","Tangential distance cannot be zero."))
return False
elif tan_distance < 0:
_wrn(_tr("Tangential distance is negative. "
"It is made positive to proceed."))
_wrn(translate("draft","Tangential distance is negative. It is made positive to proceed."))
self.tan_distance = abs(tan_distance)
# The other arguments are not tested but they should be present.
@@ -300,7 +297,7 @@ class TaskPanelCircularArray:
"App.ActiveDocument.recompute()"]
# We commit the command list through the parent command
self.source_command.commit(_tr(self.name), _cmd_list)
self.source_command.commit(translate("draft","Circular array", _cmd_list)
def get_distances(self):
"""Get the distance parameters from the widgets."""
@@ -340,7 +337,7 @@ class TaskPanelCircularArray:
self.form.input_c_z.setProperty('rawValue', 0)
self.center = self.get_center()
_msg(_tr("Center reset:")
_msg(translate("draft","Center reset:")
+ " ({0}, {1}, {2})".format(self.center.x,
self.center.y,
self.center.z))
@@ -351,7 +348,7 @@ class TaskPanelCircularArray:
state = self.tr_true
else:
state = self.tr_false
_msg(_tr("Fuse:") + " {}".format(state))
_msg(translate("draft","Fuse:") + " {}".format(state))
def set_fuse(self):
"""Execute as a callback when the fuse checkbox changes."""
@@ -365,7 +362,7 @@ class TaskPanelCircularArray:
state = self.tr_true
else:
state = self.tr_false
_msg(_tr("Create Link array:") + " {}".format(state))
_msg(translate("draft","Create Link array:") + " {}".format(state))
def set_link(self):
"""Execute as a callback when the link checkbox changes."""
@@ -382,12 +379,12 @@ class TaskPanelCircularArray:
# For example, it could take the shapes of all objects,
# make a compound and then use it as input for the array function.
sel_obj = self.selection[0]
_msg(_tr("Object:") + " {}".format(sel_obj.Label))
_msg(_tr("Radial distance:") + " {}".format(self.r_distance))
_msg(_tr("Tangential distance:") + " {}".format(self.tan_distance))
_msg(_tr("Number of circular layers:") + " {}".format(self.number))
_msg(_tr("Symmetry parameter:") + " {}".format(self.symmetry))
_msg(_tr("Center of rotation:")
_msg(translate("draft","Object:") + " {}".format(sel_obj.Label))
_msg(translate("draft","Radial distance:") + " {}".format(self.r_distance))
_msg(translate("draft","Tangential distance:") + " {}".format(self.tan_distance))
_msg(translate("draft","Number of circular layers:") + " {}".format(self.number))
_msg(translate("draft","Symmetry parameter:") + " {}".format(self.symmetry))
_msg(translate("draft","Center of rotation:")
+ " ({0}, {1}, {2})".format(self.center.x,
self.center.y,
self.center.z))
@@ -491,7 +488,7 @@ class TaskPanelCircularArray:
def reject(self):
"""Execute when clicking the Cancel button or pressing Escape."""
_msg(_tr("Aborted:") + " {}".format(_tr(self.name)))
_msg(translate("draft","Aborted:") + " {}".format(translate("draft","Circular array")))
self.finish()
def finish(self):
@@ -38,7 +38,7 @@ import draftutils.utils as utils
from FreeCAD import Units as U
from draftutils.messages import _msg, _err, _log
from draftutils.translate import _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
bool(Draft_rc.__name__)
@@ -80,7 +80,7 @@ class TaskPanelOrthoArray:
def __init__(self):
self.name = "Orthogonal array"
_log(_tr("Task panel:") + " {}".format(_tr(self.name)))
_log(translate("draft","Task panel:") + " {}".format(translate("draft","Orthogonal array")))
# The .ui file must be loaded into an attribute
# called `self.form` so that it is displayed in the task panel.
@@ -92,7 +92,7 @@ class TaskPanelOrthoArray:
pix = QtGui.QPixmap(svg)
icon = QtGui.QIcon.fromTheme(icon_name, QtGui.QIcon(svg))
self.form.setWindowIcon(icon)
self.form.setWindowTitle(_tr(self.name))
self.form.setWindowTitle(translate("draft","Orthogonal array"))
self.form.label_icon.setPixmap(pix.scaled(32, 32))
@@ -202,19 +202,19 @@ class TaskPanelOrthoArray:
the interface may not allow to input wrong data.
"""
if not selection:
_err(_tr("At least one element must be selected."))
_err(translate("draft","At least one element must be selected."))
return False
if n_x < 1 or n_y < 1 or n_z < 1:
_err(_tr("Number of elements must be at least 1."))
_err(translate("draft","Number of elements must be at least 1."))
return False
# TODO: this should handle multiple objects.
# Each of the elements of the selection should be tested.
obj = selection[0]
if obj.isDerivedFrom("App::FeaturePython"):
_err(_tr("Selection is not suitable for array."))
_err(_tr("Object:") + " {0} ({1})".format(obj.Label, obj.TypeId))
_err(translate("draft","Selection is not suitable for array."))
_err(translate("draft","Object:") + " {0} ({1})".format(obj.Label, obj.TypeId))
return False
# The other arguments are not tested but they should be present.
@@ -270,7 +270,7 @@ class TaskPanelOrthoArray:
"App.ActiveDocument.recompute()"]
# We commit the command list through the parent command
self.source_command.commit(_tr(self.name), _cmd_list)
self.source_command.commit(translate("draft","Orthogonal array"), _cmd_list)
def get_numbers(self):
"""Get the number of elements from the widgets."""
@@ -316,7 +316,7 @@ class TaskPanelOrthoArray:
self.form.input_X_y.setProperty('rawValue', 0)
self.form.input_X_z.setProperty('rawValue', 0)
self.v_x, self.v_y, self.v_z = self.get_intervals()
_msg(_tr("Interval X reset:")
_msg(translate("draft","Interval X reset:")
+ " ({0}, {1}, {2})".format(self.v_x.x,
self.v_x.y,
self.v_x.z))
@@ -325,7 +325,7 @@ class TaskPanelOrthoArray:
self.form.input_Y_y.setProperty('rawValue', 100)
self.form.input_Y_z.setProperty('rawValue', 0)
self.v_x, self.v_y, self.v_z = self.get_intervals()
_msg(_tr("Interval Y reset:")
_msg(translate("draft","Interval Y reset:")
+ " ({0}, {1}, {2})".format(self.v_y.x,
self.v_y.y,
self.v_y.z))
@@ -334,7 +334,7 @@ class TaskPanelOrthoArray:
self.form.input_Z_y.setProperty('rawValue', 0)
self.form.input_Z_z.setProperty('rawValue', 100)
self.v_x, self.v_y, self.v_z = self.get_intervals()
_msg(_tr("Interval Z reset:")
_msg(translate("draft","Interval Z reset:")
+ " ({0}, {1}, {2})".format(self.v_z.x,
self.v_z.y,
self.v_z.z))
@@ -345,7 +345,7 @@ class TaskPanelOrthoArray:
state = self.tr_true
else:
state = self.tr_false
_msg(_tr("Fuse:") + " {}".format(state))
_msg(translate("draft","Fuse:") + " {}".format(state))
def set_fuse(self):
"""Execute as a callback when the fuse checkbox changes."""
@@ -359,7 +359,7 @@ class TaskPanelOrthoArray:
state = self.tr_true
else:
state = self.tr_false
_msg(_tr("Create Link array:") + " {}".format(state))
_msg(translate("draft","Create Link array:") + " {}".format(state))
def set_link(self):
"""Execute as a callback when the link checkbox changes."""
@@ -376,19 +376,19 @@ class TaskPanelOrthoArray:
# For example, it could take the shapes of all objects,
# make a compound and then use it as input for the array function.
sel_obj = self.selection[0]
_msg(_tr("Object:") + " {}".format(sel_obj.Label))
_msg(_tr("Number of X elements:") + " {}".format(self.n_x))
_msg(_tr("Interval X:")
_msg(translate("draft","Object:") + " {}".format(sel_obj.Label))
_msg(translate("draft","Number of X elements:") + " {}".format(self.n_x))
_msg(translate("draft","Interval X:")
+ " ({0}, {1}, {2})".format(self.v_x.x,
self.v_x.y,
self.v_x.z))
_msg(_tr("Number of Y elements:") + " {}".format(self.n_y))
_msg(_tr("Interval Y:")
_msg(translate("draft","Number of Y elements:") + " {}".format(self.n_y))
_msg(translate("draft","Interval Y:")
+ " ({0}, {1}, {2})".format(self.v_y.x,
self.v_y.y,
self.v_y.z))
_msg(_tr("Number of Z elements:") + " {}".format(self.n_z))
_msg(_tr("Interval Z:")
_msg(translate("draft","Number of Z elements:") + " {}".format(self.n_z))
_msg(translate("draft","Interval Z:")
+ " ({0}, {1}, {2})".format(self.v_z.x,
self.v_z.y,
self.v_z.z))
@@ -397,7 +397,7 @@ class TaskPanelOrthoArray:
def reject(self):
"""Execute when clicking the Cancel button or pressing Escape."""
_msg(_tr("Aborted:") + " {}".format(_tr(self.name)))
_msg(translate("draft","Aborted:") + " {}".format(translate("draft","Orthogonal array")))
self.finish()
def finish(self):
@@ -38,7 +38,7 @@ import draftutils.utils as utils
from FreeCAD import Units as U
from draftutils.messages import _msg, _wrn, _err, _log
from draftutils.translate import _tr
from draftutils.translate import translate
# The module is used to prevent complaints from code checkers (flake8)
bool(Draft_rc.__name__)
@@ -80,7 +80,7 @@ class TaskPanelPolarArray:
def __init__(self):
self.name = "Polar array"
_log(_tr("Task panel:") + " {}".format(_tr(self.name)))
_log(translate("draft","Task panel:") + " {}".format(self.name))
# The .ui file must be loaded into an attribute
# called `self.form` so that it is displayed in the task panel.
@@ -92,7 +92,7 @@ class TaskPanelPolarArray:
pix = QtGui.QPixmap(svg)
icon = QtGui.QIcon.fromTheme(icon_name, QtGui.QIcon(svg))
self.form.setWindowIcon(icon)
self.form.setWindowTitle(_tr(self.name))
self.form.setWindowTitle(translate("draft","Polar array")
self.form.label_icon.setPixmap(pix.scaled(32, 32))
@@ -188,28 +188,26 @@ class TaskPanelPolarArray:
the interface may not allow to input wrong data.
"""
if not selection:
_err(_tr("At least one element must be selected."))
_err(translate("draft","At least one element must be selected."))
return False
# TODO: this should handle multiple objects.
# Each of the elements of the selection should be tested.
obj = selection[0]
if obj.isDerivedFrom("App::FeaturePython"):
_err(_tr("Selection is not suitable for array."))
_err(_tr("Object:") + " {}".format(selection[0].Label))
_err(translate("draft","Selection is not suitable for array."))
_err(translate("draft","Object:") + " {}".format(selection[0].Label))
return False
if number < 2:
_err(_tr("Number of elements must be at least 2."))
_err(translate("draft","Number of elements must be at least 2."))
return False
if angle > 360:
_wrn(_tr("The angle is above 360 degrees. "
"It is set to this value to proceed."))
_wrn(translate("draft","The angle is above 360 degrees. It is set to this value to proceed."))
self.angle = 360
elif angle < -360:
_wrn(_tr("The angle is below -360 degrees. "
"It is set to this value to proceed."))
_wrn(translate("draft","The angle is below -360 degrees. It is set to this value to proceed."))
self.angle = -360
# The other arguments are not tested but they should be present.
@@ -261,7 +259,7 @@ class TaskPanelPolarArray:
"App.ActiveDocument.recompute()"]
# We commit the command list through the parent command
self.source_command.commit(_tr(self.name), _cmd_list)
self.source_command.commit(translate("draft","Polar array"), _cmd_list)
def get_number_angle(self):
"""Get the number and angle parameters from the widgets."""
@@ -288,7 +286,7 @@ class TaskPanelPolarArray:
self.form.input_c_z.setProperty('rawValue', 0)
self.center = self.get_center()
_msg(_tr("Center reset:")
_msg(translate("draft","Center reset:")
+ " ({0}, {1}, {2})".format(self.center.x,
self.center.y,
self.center.z))
@@ -299,7 +297,7 @@ class TaskPanelPolarArray:
state = self.tr_true
else:
state = self.tr_false
_msg(_tr("Fuse:") + " {}".format(state))
_msg(translate("draft","Fuse:") + " {}".format(state))
def set_fuse(self):
"""Execute as a callback when the fuse checkbox changes."""
@@ -313,7 +311,7 @@ class TaskPanelPolarArray:
state = self.tr_true
else:
state = self.tr_false
_msg(_tr("Create Link array:") + " {}".format(state))
_msg(translate("draft","Create Link array:") + " {}".format(state))
def set_link(self):
"""Execute as a callback when the link checkbox changes."""
@@ -330,10 +328,10 @@ class TaskPanelPolarArray:
# For example, it could take the shapes of all objects,
# make a compound and then use it as input for the array function.
sel_obj = self.selection[0]
_msg(_tr("Object:") + " {}".format(sel_obj.Label))
_msg(_tr("Number of elements:") + " {}".format(self.number))
_msg(_tr("Polar angle:") + " {}".format(self.angle))
_msg(_tr("Center of rotation:")
_msg(translate("draft","Object:") + " {}".format(sel_obj.Label))
_msg(translate("draft","Number of elements:") + " {}".format(self.number))
_msg(translate("draft","Polar angle:") + " {}".format(self.angle))
_msg(translate("draft","Center of rotation:")
+ " ({0}, {1}, {2})".format(self.center.x,
self.center.y,
self.center.z))
@@ -437,7 +435,7 @@ class TaskPanelPolarArray:
def reject(self):
"""Execute when clicking the Cancel button or pressing Escape."""
_msg(_tr("Aborted:") + " {}".format(_tr(self.name)))
_msg(translate("draft","Aborted:") + " {}".format(translate("draft","Polar array")))
self.finish()
def finish(self):
@@ -1,6 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>Image_Scaling</name>
<message>
<location filename="../../../ImageTools/_CommandImageScaling.py" line="63"/>
<source>Scale image plane</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../ImageTools/_CommandImageScaling.py" line="65"/>
<source>Scales an image plane by defining a distance between two points</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Dialog</name>
<message>
@@ -39,19 +52,6 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Image_Scaling</name>
<message>
<location filename="../../../ImageTools/_CommandImageScaling.py" line="63"/>
<source>Scale image plane</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../ImageTools/_CommandImageScaling.py" line="65"/>
<source>Scales an image plane by defining a distance between two points</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CmdCreateImagePlane</name>
<message>
@@ -1,129 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS><TS version="2.0">
<!DOCTYPE TS><TS version="1.1">
<context>
<name>Gui::Dialog::DlgSettingsOpenSCAD</name>
<message>
<location filename="../ui/openscadprefs-base.ui" line="14"/>
<location filename="openscadprefs-base.ui" line="14"/>
<source>General settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="26"/>
<location filename="openscadprefs-base.ui" line="26"/>
<source>General OpenSCAD Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="34"/>
<location filename="openscadprefs-base.ui" line="34"/>
<source>OpenSCAD executable</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="65"/>
<location filename="openscadprefs-base.ui" line="65"/>
<source>OpenSCAD import</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="93"/>
<location filename="openscadprefs-base.ui" line="93"/>
<source>Use ViewProvider in Tree View</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="110"/>
<location filename="openscadprefs-base.ui" line="110"/>
<source>If this is checked, Multmatrix Object will be Parametric</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="113"/>
<location filename="openscadprefs-base.ui" line="113"/>
<source>Use Multmatrix Feature</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="153"/>
<location filename="openscadprefs-base.ui" line="153"/>
<source>The maximum number of faces of a polygon, prism or frustum. If fn is greater than this value the object is considered to be a circular. Set to 0 for no limit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="133"/>
<location filename="openscadprefs-base.ui" line="133"/>
<source>Maximum number of faces for polygons (fn)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="177"/>
<location filename="openscadprefs-base.ui" line="177"/>
<source>OpenSCAD export</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="185"/>
<location filename="openscadprefs-base.ui" line="185"/>
<source>maximum fragment size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="208"/>
<location filename="openscadprefs-base.ui" line="208"/>
<source>angular (fa)</source>
<translation type="unfinished"></translation>
</message>
<message encoding="UTF-8">
<location filename="../ui/openscadprefs-base.ui" line="218"/>
<location filename="openscadprefs-base.ui" line="218"/>
<source>°</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="250"/>
<location filename="openscadprefs-base.ui" line="250"/>
<source>size (fs)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="278"/>
<location filename="openscadprefs-base.ui" line="278"/>
<source>mm</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="304"/>
<location filename="openscadprefs-base.ui" line="304"/>
<source>convexity</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="341"/>
<location filename="openscadprefs-base.ui" line="341"/>
<source>Mesh fallback</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="383"/>
<location filename="openscadprefs-base.ui" line="383"/>
<source>Deflection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="386"/>
<location filename="openscadprefs-base.ui" line="386"/>
<source>deflection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="393"/>
<location filename="openscadprefs-base.ui" line="393"/>
<source>Triangulation settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="90"/>
<location filename="openscadprefs-base.ui" line="90"/>
<source>If this is checked, Features will claim their children in the tree view</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="73"/>
<location filename="openscadprefs-base.ui" line="73"/>
<source>Print debug information in the Console</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="47"/>
<location filename="openscadprefs-base.ui" line="47"/>
<source>The path to the OpenSCAD executable</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="215"/>
<location filename="openscadprefs-base.ui" line="215"/>
<source>Minimum angle for a fragment</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/openscadprefs-base.ui" line="272"/>
<location filename="openscadprefs-base.ui" line="272"/>
<source>Minimum size of a fragment</source>
<translation type="unfinished"></translation>
</message>
@@ -131,62 +131,62 @@
<context>
<name>OpenSCAD</name>
<message>
<location filename="../../OpenSCADCommands.py" line="147"/>
<location filename="OpenSCADCommands.py" line="149"/>
<source>Convert Edges to Faces</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="309"/>
<location filename="OpenSCADCommands.py" line="309"/>
<source>Please select 3 objects first</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../importCSG.py" line="1226"/>
<location filename="importCSG.py" line="1226"/>
<source>Unsupported Function</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../importCSG.py" line="1226"/>
<location filename="importCSG.py" line="1226"/>
<source>Press OK</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="347"/>
<location filename="OpenSCADCommands.py" line="347"/>
<source>Add</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="348"/>
<location filename="OpenSCADCommands.py" line="348"/>
<source>Clear</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="349"/>
<location filename="OpenSCADCommands.py" line="349"/>
<source>as Mesh</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="350"/>
<location filename="OpenSCADCommands.py" line="350"/>
<source>Add OpenSCAD Element</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="423"/>
<location filename="OpenSCADCommands.py" line="423"/>
<source>Perform</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="424"/>
<location filename="OpenSCADCommands.py" line="424"/>
<source>Mesh Boolean</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADUtils.py" line="622"/>
<location filename="OpenSCADUtils.py" line="623"/>
<source>Error all shapes must be either 2D or both must be 3D</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="102"/>
<location filename="OpenSCADCommands.py" line="102"/>
<source>Unable to explode %s</source>
<translation type="unfinished"></translation>
</message>
@@ -194,12 +194,12 @@
<context>
<name>OpenSCAD_AddOpenSCADElement</name>
<message>
<location filename="../../OpenSCADCommands.py" line="464"/>
<location filename="OpenSCADCommands.py" line="464"/>
<source>Add OpenSCAD Element...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="465"/>
<location filename="OpenSCADCommands.py" line="468"/>
<source>Add an OpenSCAD element by entering OpenSCAD code and executing the OpenSCAD binary</source>
<translation type="unfinished"></translation>
</message>
@@ -207,12 +207,12 @@
<context>
<name>OpenSCAD_ColorCodeShape</name>
<message>
<location filename="../../OpenSCADCommands.py" line="126"/>
<location filename="OpenSCADCommands.py" line="126"/>
<source>Color Shapes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="127"/>
<location filename="OpenSCADCommands.py" line="129"/>
<source>Color Shapes by validity and type</source>
<translation type="unfinished"></translation>
</message>
@@ -220,7 +220,7 @@
<context>
<name>OpenSCAD_Edgestofaces</name>
<message>
<location filename="../../OpenSCADCommands.py" line="146"/>
<location filename="OpenSCADCommands.py" line="146"/>
<source>Convert Edges To Faces</source>
<translation type="unfinished"></translation>
</message>
@@ -228,12 +228,12 @@
<context>
<name>OpenSCAD_ExpandPlacements</name>
<message>
<location filename="../../OpenSCADCommands.py" line="291"/>
<location filename="OpenSCADCommands.py" line="291"/>
<source>Expand Placements</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="292"/>
<location filename="OpenSCADCommands.py" line="294"/>
<source>Expand all placements downwards the FeatureTree</source>
<translation type="unfinished"></translation>
</message>
@@ -241,12 +241,12 @@
<context>
<name>OpenSCAD_ExplodeGroup</name>
<message>
<location filename="../../OpenSCADCommands.py" line="110"/>
<location filename="OpenSCADCommands.py" line="110"/>
<source>Explode Group</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="111"/>
<location filename="OpenSCADCommands.py" line="113"/>
<source>Remove fusion, apply placement to children, and color randomly</source>
<translation type="unfinished"></translation>
</message>
@@ -254,12 +254,12 @@
<context>
<name>OpenSCAD_Hull</name>
<message>
<location filename="../../OpenSCADCommands.py" line="497"/>
<location filename="OpenSCADCommands.py" line="497"/>
<source>Hull</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="498"/>
<location filename="OpenSCADCommands.py" line="500"/>
<source>Perform Hull</source>
<translation type="unfinished"></translation>
</message>
@@ -267,12 +267,12 @@
<context>
<name>OpenSCAD_IncreaseToleranceFeature</name>
<message>
<location filename="../../OpenSCADCommands.py" line="274"/>
<location filename="OpenSCADCommands.py" line="274"/>
<source>Increase Tolerance Feature</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="275"/>
<location filename="OpenSCADCommands.py" line="277"/>
<source>Create Feature that allows to increase the tolerance</source>
<translation type="unfinished"></translation>
</message>
@@ -280,12 +280,12 @@
<context>
<name>OpenSCAD_MeshBoolean</name>
<message>
<location filename="../../OpenSCADCommands.py" line="477"/>
<location filename="OpenSCADCommands.py" line="477"/>
<source>Mesh Boolean...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="478"/>
<location filename="OpenSCADCommands.py" line="481"/>
<source>Export objects as meshes and use OpenSCAD to perform a boolean operation</source>
<translation type="unfinished"></translation>
</message>
@@ -293,12 +293,12 @@
<context>
<name>OpenSCAD_Minkowski</name>
<message>
<location filename="../../OpenSCADCommands.py" line="516"/>
<location filename="OpenSCADCommands.py" line="516"/>
<source>Minkowski</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="517"/>
<location filename="OpenSCADCommands.py" line="519"/>
<source>Perform Minkowski</source>
<translation type="unfinished"></translation>
</message>
@@ -306,12 +306,12 @@
<context>
<name>OpenSCAD_MirrorMeshFeature</name>
<message>
<location filename="../../OpenSCADCommands.py" line="195"/>
<location filename="OpenSCADCommands.py" line="195"/>
<source>Mirror Mesh Feature...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="196"/>
<location filename="OpenSCADCommands.py" line="198"/>
<source>Create Mirror Mesh Feature</source>
<translation type="unfinished"></translation>
</message>
@@ -319,12 +319,12 @@
<context>
<name>OpenSCAD_RefineShapeFeature</name>
<message>
<location filename="../../OpenSCADCommands.py" line="165"/>
<location filename="OpenSCADCommands.py" line="165"/>
<source>Refine Shape Feature</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="166"/>
<location filename="OpenSCADCommands.py" line="168"/>
<source>Create Refine Shape Feature</source>
<translation type="unfinished"></translation>
</message>
@@ -332,12 +332,12 @@
<context>
<name>OpenSCAD_RemoveSubtree</name>
<message>
<location filename="../../OpenSCADCommands.py" line="324"/>
<location filename="OpenSCADCommands.py" line="324"/>
<source>Remove Objects and their Children</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="325"/>
<location filename="OpenSCADCommands.py" line="327"/>
<source>Removes the selected objects and all children that are not referenced from other objects</source>
<translation type="unfinished"></translation>
</message>
@@ -345,12 +345,12 @@
<context>
<name>OpenSCAD_ReplaceObject</name>
<message>
<location filename="../../OpenSCADCommands.py" line="312"/>
<location filename="OpenSCADCommands.py" line="312"/>
<source>Replace Object</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="313"/>
<location filename="OpenSCADCommands.py" line="315"/>
<source>Replace an object in the Feature Tree. Please select old, new, and parent object</source>
<translation type="unfinished"></translation>
</message>
@@ -358,12 +358,12 @@
<context>
<name>OpenSCAD_ResizeMeshFeature</name>
<message>
<location filename="../../OpenSCADCommands.py" line="254"/>
<location filename="OpenSCADCommands.py" line="254"/>
<source>Resize Mesh Feature...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="255"/>
<location filename="OpenSCADCommands.py" line="258"/>
<source>Create Resize Mesh Feature</source>
<translation type="unfinished"></translation>
</message>
@@ -371,12 +371,12 @@
<context>
<name>OpenSCAD_ScaleMeshFeature</name>
<message>
<location filename="../../OpenSCADCommands.py" line="224"/>
<location filename="OpenSCADCommands.py" line="224"/>
<source>Scale Mesh Feature...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../OpenSCADCommands.py" line="225"/>
<location filename="OpenSCADCommands.py" line="228"/>
<source>Create Scale Mesh Feature</source>
<translation type="unfinished"></translation>
</message>
@@ -384,7 +384,7 @@
<context>
<name>Workbech</name>
<message>
<location filename="../../InitGui.py" line="83"/>
<location filename="InitGui.py" line="83"/>
<source>OpenSCAD Part tools</source>
<translation type="unfinished"></translation>
</message>
@@ -392,7 +392,7 @@
<context>
<name>Workbench</name>
<message>
<location filename="../../InitGui.py" line="81"/>
<location filename="InitGui.py" line="81"/>
<source>OpenSCADTools</source>
<translation type="unfinished"></translation>
</message>
File diff suppressed because it is too large Load Diff
+34
View File
@@ -93,6 +93,40 @@ private Q_SLOTS:
void onChangeRegularPolygon(QWidget*);
private:
QString createPlane(const QString& objectName, const QString& placement) const;
QString createBox(const QString& objectName, const QString& placement) const;
QString createCylinder(const QString& objectName, const QString& placement) const;
QString createCone(const QString& objectName, const QString& placement) const;
QString createSphere(const QString& objectName, const QString& placement) const;
QString createEllipsoid(const QString& objectName, const QString& placement) const;
QString createTorus(const QString& objectName, const QString& placement) const;
QString createPrism(const QString& objectName, const QString& placement) const;
QString createWedge(const QString& objectName, const QString& placement) const;
QString createHelix(const QString& objectName, const QString& placement) const;
QString createSpiral(const QString& objectName, const QString& placement) const;
QString createCircle(const QString& objectName, const QString& placement) const;
QString createEllipse(const QString& objectName, const QString& placement) const;
QString createVertex(const QString& objectName, const QString& placement) const;
QString createLine(const QString& objectName, const QString& placement) const;
QString createRegularPolygon(const QString& objectName, const QString& placement) const;
QString changePlane(const QString& objectName, const QString& placement) const;
QString changeBox(const QString& objectName, const QString& placement) const;
QString changeCylinder(const QString& objectName, const QString& placement) const;
QString changeCone(const QString& objectName, const QString& placement) const;
QString changeSphere(const QString& objectName, const QString& placement) const;
QString changeEllipsoid(const QString& objectName, const QString& placement) const;
QString changeTorus(const QString& objectName, const QString& placement) const;
QString changePrism(const QString& objectName, const QString& placement) const;
QString changeWedge(const QString& objectName, const QString& placement) const;
QString changeHelix(const QString& objectName, const QString& placement) const;
QString changeSpiral(const QString& objectName, const QString& placement) const;
QString changeCircle(const QString& objectName, const QString& placement) const;
QString changeEllipse(const QString& objectName, const QString& placement) const;
QString changeVertex(const QString& objectName, const QString& placement) const;
QString changeLine(const QString& objectName, const QString& placement) const;
QString changeRegularPolygon(const QString& objectName, const QString& placement) const;
static void pickCallback(void * ud, SoEventCallback * n);
void executeCallback(Picker*);
void connectSignalMapper(QWidget *sender, const char *signal, QSignalMapper* mapper);
+136 -136
View File
@@ -3,6 +3,16 @@
<TS version="2.1">
<context>
<name>AttachmentEditor</name>
<message>
<location filename="../../../AttachmentEditor/Commands.py" line="80"/>
<source>Attachment...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../AttachmentEditor/Commands.py" line="82"/>
<source>Edit attachment of selected object.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../AttachmentEditor/TaskAttachmentEditor.py" line="94"/>
<source>No object named {name}</source>
@@ -24,13 +34,13 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../AttachmentEditor/TaskAttachmentEditor.py" line="229"/>
<source>Attachment</source>
<location filename="../../../AttachmentEditor/TaskAttachmentEditor.py" line="218"/>
<source>Continue</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../AttachmentEditor/TaskAttachmentEditor.py" line="218"/>
<source>Continue</source>
<location filename="../../../AttachmentEditor/TaskAttachmentEditor.py" line="229"/>
<source>Attachment</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -98,24 +108,14 @@
<source>Attachment Offset:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../AttachmentEditor/TaskAttachmentEditor.py" line="608"/>
<source>Attachment Offset (in local coordinates):</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../AttachmentEditor/TaskAttachmentEditor.py" line="598"/>
<source>Attachment Offset (inactive - not attached):</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../AttachmentEditor/Commands.py" line="80"/>
<source>Attachment...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../AttachmentEditor/Commands.py" line="82"/>
<source>Edit attachment of selected object.</source>
<location filename="../../../AttachmentEditor/TaskAttachmentEditor.py" line="608"/>
<source>Attachment Offset (in local coordinates):</source>
<translation type="unfinished"></translation>
</message>
</context>
@@ -246,88 +246,8 @@ It will create a &apos;Compound Filter&apos; for each shape.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Part_JoinFeatures</name>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="86"/>
<source>Computing the result failed with an error:
{err}
Click &apos;Continue&apos; to create the feature anyway, or &apos;Abort&apos; to cancel.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="373"/>
<source>Bad selection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="89"/>
<source>Continue</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="85"/>
<source>Computing the result failed with an error:
{err}
Click &apos;Continue&apos; to create the feature anyway, or &apos;Abort&apos; to cancel.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="196"/>
<source>Select at least two objects, or one or more compounds, first!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="208"/>
<source>Select at least two objects, or one or more compounds</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="283"/>
<source>Select base object, then the object to embed, and invoke this tool.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="304"/>
<source>Select base object, then the object to embed, and then invoke this tool.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="372"/>
<source>Select the object to make a cutout in, then the object that should fit into the cutout, and invoke this tool.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="399"/>
<source>Select the object to make a cutout in, then the object that should fit into the cutout, and then invoke this tool.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Part_SplitFeatures</name>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="501"/>
<source>Computing the result failed with an error:
{err}
Click &apos;Continue&apos; to create the feature anyway, or &apos;Abort&apos; to cancel.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="479"/>
<source>Bad selection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../CompoundTools/_CommandCompoundFilter.py" line="107"/>
<source>Continue</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="188"/>
<source>Boolean fragments</source>
@@ -342,43 +262,6 @@ of the original shapes.
A &apos;Compound Filter&apos; can be used to extract the individual slices.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="543"/>
<source>Select at least two objects, or one or more compounds. If only one compound is selected, the compounded shapes will be intersected between each other (otherwise, compounds with self-intersections are invalid).</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="310"/>
<source>Slice to compound</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="349"/>
<source>Slice a selected object by using other objects as cutting tools.
The resulting pieces will be stored in a compound.
A &apos;Compound Filter&apos; can be used to extract the individual slices.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="391"/>
<source>Select at least two objects. The first one is the object to be sliced; the rest are objects to slice with.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="334"/>
<source>Slice apart</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="174"/>
<source>Boolean Fragments</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="176"/>
<source>Split objects where they intersect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="312"/>
<source>Split object by intersections with other objects, and pack the pieces into a compound.</source>
@@ -395,9 +278,8 @@ A &apos;Compound Filter&apos; can be used to extract the individual slices.</sou
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="381"/>
<source>Slice a selected object by other objects, and split it apart.
It will create a &apos;Compound Filter&apos; for each slice.</source>
<location filename="../../../BOPTools/SplitFeatures.py" line="391"/>
<source>Select at least two objects. The first one is the object to be sliced; the rest are objects to slice with.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -419,6 +301,44 @@ Click &apos;Continue&apos; to create the feature anyway, or &apos;Abort&apos; to
<source>Select at least two objects, or one or more compounds, first! If only one compound is selected, the compounded shapes will be intersected between each other (otherwise, compounds with self-intersections are invalid).</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="543"/>
<source>Select at least two objects, or one or more compounds. If only one compound is selected, the compounded shapes will be intersected between each other (otherwise, compounds with self-intersections are invalid).</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="310"/>
<source>Slice to compound</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="174"/>
<source>Boolean Fragments</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="176"/>
<source>Split objects where they intersect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="349"/>
<source>Slice a selected object by using other objects as cutting tools.
The resulting pieces will be stored in a compound.
A &apos;Compound Filter&apos; can be used to extract the individual slices.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="334"/>
<source>Slice apart</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="381"/>
<source>Slice a selected object by other objects, and split it apart.
It will create a &apos;Compound Filter&apos; for each slice.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="468"/>
<source>Boolean XOR</source>
@@ -432,6 +352,25 @@ This means the overlapping volumes of the shapes will be removed.
A &apos;Compound Filter&apos; can be used to extract the remaining pieces.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="479"/>
<source>Bad selection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/SplitFeatures.py" line="501"/>
<source>Computing the result failed with an error:
{err}
Click &apos;Continue&apos; to create the feature anyway, or &apos;Abort&apos; to cancel.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../CompoundTools/_CommandCompoundFilter.py" line="107"/>
<source>Continue</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Part_Tube</name>
@@ -914,6 +853,67 @@ Do you want to continue?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Part_JoinFeatures</name>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="85"/>
<source>Computing the result failed with an error:
{err}
Click &apos;Continue&apos; to create the feature anyway, or &apos;Abort&apos; to cancel.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="86"/>
<source>Computing the result failed with an error:
{err}
Click &apos;Continue&apos; to create the feature anyway, or &apos;Abort&apos; to cancel.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="89"/>
<source>Continue</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="196"/>
<source>Select at least two objects, or one or more compounds, first!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="208"/>
<source>Select at least two objects, or one or more compounds</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="283"/>
<source>Select base object, then the object to embed, and invoke this tool.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="304"/>
<source>Select base object, then the object to embed, and then invoke this tool.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="372"/>
<source>Select the object to make a cutout in, then the object that should fit into the cutout, and invoke this tool.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="373"/>
<source>Bad selection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../BOPTools/JoinFeatures.py" line="399"/>
<source>Select the object to make a cutout in, then the object that should fit into the cutout, and then invoke this tool.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Part_MakeTube</name>
<message>
+16 -3
View File
@@ -543,6 +543,21 @@ void ProfileBased::getUpToFace(TopoDS_Face& upToFace,
}
}
double ProfileBased::getThroughAllLength() const
{
TopoDS_Shape profileshape;
TopoDS_Shape base;
profileshape = getVerifiedFace();
base = getBaseShape();
Bnd_Box box;
BRepBndLib::Add(base, box);
BRepBndLib::Add(profileshape, box);
box.SetGap(0.0);
// The diagonal of the bounding box, plus 1% extra to eliminate risk of
// co-planar issues, gives a length that is guaranteed to go through all.
return 1.01 * sqrt(box.SquareExtent());
}
void ProfileBased::generatePrism(TopoDS_Shape& prism,
const TopoDS_Shape& sketchshape,
const std::string& method,
@@ -556,9 +571,7 @@ void ProfileBased::generatePrism(TopoDS_Shape& prism,
double Ltotal = L;
double Loffset = 0.;
if (method == "ThroughAll")
// "ThroughAll" is modelled as a very long, but finite prism to avoid problems with pockets
// Note: 1E6 created problems once...
Ltotal = 1E4;
Ltotal = getThroughAllLength();
if (method == "TwoLengths") {
+11 -8
View File
@@ -113,6 +113,9 @@ public:
//backwards compatibility: profile property was renamed and has different type now
virtual void Restore(Base::XMLReader& reader);
// calculate the through all length
double getThroughAllLength() const;
protected:
void remapSupportShape(const TopoDS_Shape&);
@@ -132,14 +135,14 @@ protected:
* Generate a linear prism
* It will be a stand-alone solid created with BRepPrimAPI_MakePrism
*/
static void generatePrism(TopoDS_Shape& prism,
const TopoDS_Shape& sketchshape,
const std::string& method,
const gp_Dir& direction,
const double L,
const double L2,
const bool midplane,
const bool reversed);
void generatePrism(TopoDS_Shape& prism,
const TopoDS_Shape& sketchshape,
const std::string& method,
const gp_Dir& direction,
const double L,
const double L2,
const bool midplane,
const bool reversed);
/**
* Generate a linear prism
* It will be a stand-alone solid created with BRepFeat_MakePrism
+2 -2
View File
@@ -68,9 +68,9 @@ QIcon ViewProviderHelix::getIcon(void) const {
QString str = QString::fromLatin1("PartDesign_");
auto* prim = static_cast<PartDesign::Helix*>(getObject());
if(prim->getAddSubType() == PartDesign::FeatureAddSub::Additive)
str += QString::fromLatin1("Additive_");
str += QString::fromLatin1("Additive");
else
str += QString::fromLatin1("Subtractive_");
str += QString::fromLatin1("Subtractive");
str += QString::fromLatin1("Helix.svg");
return PartDesignGui::ViewProvider::mergeGreyableOverlayIcons(Gui::BitmapFactory().pixmap(str.toStdString().c_str()));
+2 -2
View File
@@ -169,9 +169,9 @@ QIcon ViewProviderLoft::getIcon(void) const {
QString str = QString::fromLatin1("PartDesign_");
auto* prim = static_cast<PartDesign::Loft*>(getObject());
if(prim->getAddSubType() == PartDesign::FeatureAddSub::Additive)
str += QString::fromLatin1("Additive_");
str += QString::fromLatin1("Additive");
else
str += QString::fromLatin1("Subtractive_");
str += QString::fromLatin1("Subtractive");
str += QString::fromLatin1("Loft.svg");
return PartDesignGui::ViewProvider::mergeGreyableOverlayIcons(Gui::BitmapFactory().pixmap(str.toStdString().c_str()));
+2 -2
View File
@@ -202,9 +202,9 @@ QIcon ViewProviderPipe::getIcon(void) const {
QString str = QString::fromLatin1("PartDesign_");
auto* prim = static_cast<PartDesign::Pipe*>(getObject());
if(prim->getAddSubType() == PartDesign::FeatureAddSub::Additive)
str += QString::fromLatin1("Additive_");
str += QString::fromLatin1("Additive");
else
str += QString::fromLatin1("Subtractive_");
str += QString::fromLatin1("Subtractive");
str += QString::fromLatin1("Pipe.svg");
return PartDesignGui::ViewProvider::mergeGreyableOverlayIcons(Gui::BitmapFactory().pixmap(str.toStdString().c_str()));
@@ -140,9 +140,9 @@ QIcon ViewProviderPrimitive::getIcon(void) const {
QString str = QString::fromLatin1("PartDesign_");
auto* prim = static_cast<PartDesign::FeaturePrimitive*>(getObject());
if(prim->getAddSubType() == PartDesign::FeatureAddSub::Additive)
str += QString::fromLatin1("Additive_");
str += QString::fromLatin1("Additive");
else
str += QString::fromLatin1("Subtractive_");
str += QString::fromLatin1("Subtractive");
switch(prim->getPrimitiveType()) {
case PartDesign::FeaturePrimitive::Box:
+226 -205
View File
@@ -8,26 +8,6 @@
<source>Show the temporary path construction objects when module is in DEBUG mode.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="124"/>
<source>Smaller values yield a finer, more accurate mesh. Smaller values increase processing time a lot.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="126"/>
<source>Smaller values yield a finer, more accurate mesh. Smaller values do not increase processing time much.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="135"/>
<source>Stop index(angle) for rotational scan</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="131"/>
<source>Dropcutter lines are created parallel to this axis.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="73"/>
<source>The direction along which dropcutter lines are created</source>
@@ -38,11 +18,6 @@
<source>Should the operation be limited by the stock object or by the bounding box of the base object</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="75"/>
<source>Additional offset to the selected bounding box</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="76"/>
<source>Step over percentage of the drop cutter path</source>
@@ -63,6 +38,16 @@
<source>Enable optimization which removes unnecessary points from G-Code output</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="124"/>
<source>Smaller values yield a finer, more accurate mesh. Smaller values increase processing time a lot.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="126"/>
<source>Smaller values yield a finer, more accurate mesh. Smaller values do not increase processing time much.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="129"/>
<source>The completion mode for the operation: single or multi-pass</source>
@@ -73,6 +58,36 @@
<source>The direction that the toolpath should go around the part: Climb(ClockWise) or Conventional(CounterClockWise)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="135"/>
<source>Stop index(angle) for rotational scan</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="141"/>
<source>Ignore areas that proceed below specified depth.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="142"/>
<source>Depth used to identify waste areas to ignore.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="143"/>
<source>Cut through waste to depth at model edge, releasing the model.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="131"/>
<source>Dropcutter lines are created parallel to this axis.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="75"/>
<source>Additional offset to the selected bounding box</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="132"/>
<source>The model will be rotated around this axis.</source>
@@ -83,26 +98,11 @@
<source>Start index(angle) for rotational scan</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="141"/>
<source>Ignore areas that proceed below specified depth.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="128"/>
<source>Planar: Flat, 3D surface scan. Rotational: 4th-axis rotational scan.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="142"/>
<source>Depth used to identify waste areas to ignore.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSurface.py" line="143"/>
<source>Cut through waste to depth at model edge, releasing the model.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathWaterline.py" line="129"/>
<source>Avoid cutting the last &apos;N&apos; faces in the Base Geometry list of selected faces.</source>
@@ -243,6 +243,11 @@
<source>The path to be copied</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathProfileEdges.py" line="56"/>
<source>The base geometry of this toolpath</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathProfileEdges.py" line="70"/>
<source>The tool controller that will be used to calculate the path</source>
@@ -418,6 +423,11 @@
<source>Controls how tool retracts Default=G98</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathDrilling.py" line="72"/>
<source>The height where feed starts and height during retract tool when path is finished</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathDrilling.py" line="73"/>
<source>Controls how tool retracts Default=G99</source>
@@ -433,11 +443,6 @@
<source>How far the drill depth is extended</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathDrilling.py" line="72"/>
<source>The height where feed starts and height during retract tool when path is finished</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathHelix.py" line="71"/>
<source>Enable rotation to gain access to pockets/areas not normal to Z axis.</source>
@@ -583,11 +588,6 @@
<source>Extra offset to apply to the operation. Direction is operation dependent.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathPocket.py" line="55"/>
<source>The library to use to generate the path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathPocket.py" line="78"/>
<source>Start pocketing at center or boundary</source>
@@ -638,11 +638,6 @@
<source>Controls how tool moves around corners. Default=Round</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathProfile.py" line="104"/>
<source>Extend the profile clearing beyond the Extra Offset.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathProfileBase.py" line="64"/>
<source>Maximum distance before a miter join is truncated</source>
@@ -679,8 +674,13 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathProfileEdges.py" line="56"/>
<source>The base geometry of this toolpath</source>
<location filename="PathPocket.py" line="55"/>
<source>The library to use to generate the path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathProfile.py" line="104"/>
<source>Extend the profile clearing beyond the Extra Offset.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -916,11 +916,6 @@
<source>Didn&apos;t find job %s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathUtils.py" line="762"/>
<source>Invalid Cutting Edge Angle %.2f, must be &lt;90° and &gt;=0°</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathUtils.py" line="541"/>
<source>Illegal arc: Start and end radii not equal</source>
@@ -931,14 +926,19 @@
<source>Invalid Cutting Edge Angle %.2f, must be &gt;0° and &lt;=180°</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathUtils.py" line="808"/>
<source>Invalid Cutting Edge Angle %.2f, must be &gt;0° and &lt;=180°</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathUtils.py" line="767"/>
<source>Cutting Edge Angle (%.2f) results in negative tool tip length</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathUtils.py" line="808"/>
<source>Invalid Cutting Edge Angle %.2f, must be &gt;0° and &lt;=180°</source>
<location filename="PathUtils.py" line="762"/>
<source>Invalid Cutting Edge Angle %.2f, must be &lt;90° and &gt;=0°</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -1036,19 +1036,24 @@
<source>Pick Start Point</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathPocketShape.py" line="452"/>
<source>Consider toggling the InverseAngle property and recomputing the operation.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathPocketShape.py" line="527"/>
<source>Verify final depth of pocket shaped by vertical faces.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathPocketShape.py" line="574"/>
<source>Processing model as a whole ...</source>
<location filename="../../../PathScripts/PathPocketShape.py" line="529"/>
<source>Depth Warning</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathPocketShape.py" line="452"/>
<source>Consider toggling the InverseAngle property and recomputing the operation.</source>
<location filename="../../../PathScripts/PathPocketShape.py" line="574"/>
<source>Processing model as a whole ...</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -1080,11 +1085,6 @@
<source>Processing subs individually ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathPocketShape.py" line="529"/>
<source>Depth Warning</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathPocketShape.py" line="835"/>
<source>Selected faces form loop. Processing looped faces.</source>
@@ -1145,6 +1145,11 @@
<source>Rotated to inverse angle.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathCircularHoleBase.py" line="277"/>
<source>Rotated to &apos;InverseAngle&apos; to attempt access.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathCircularHoleBase.py" line="847"/>
<source>Selected feature(s) require &apos;Enable Rotation: A(x)&apos; for access.</source>
@@ -1170,11 +1175,6 @@
<source>Feature %s.%s cannot be processed as a circular hole - please remove from Base geometry list.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathCircularHoleBase.py" line="277"/>
<source>Rotated to &apos;InverseAngle&apos; to attempt access.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathCircularHoleBase.py" line="331"/>
<source>Always select the bottom edge of the hole when using an edge.</source>
@@ -1583,6 +1583,11 @@ Increased to stock top.</source>
<source>Arguments for the Post Processor (specific to the script)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathJob.py" line="105"/>
<source>Collection of tool controllers available for this job.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathJob.py" line="108"/>
<source>Last Time the Job was post-processed</source>
@@ -1608,11 +1613,6 @@ Increased to stock top.</source>
<source>Compound path of all operations in the order they are processed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathJob.py" line="105"/>
<source>Collection of tool controllers available for this job.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathJob.py" line="110"/>
<source>Split output into multiple gcode files</source>
@@ -1893,16 +1893,6 @@ If it is necessary to set the FinalDepth manually please select a different oper
<source>Final depth set below ZMin of face(s) selected.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathPocketShapeGui.py" line="44"/>
<source>Pocket Shape</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathPocketShapeGui.py" line="44"/>
<source>Creates a Path Pocket object from a face or faces</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathPocketShapeGui.py" line="144"/>
<source>Normal</source>
@@ -1918,6 +1908,16 @@ If it is necessary to set the FinalDepth manually please select a different oper
<source>Y</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathPocketShapeGui.py" line="44"/>
<source>Pocket Shape</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathPocketShapeGui.py" line="44"/>
<source>Creates a Path Pocket object from a face or faces</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathPocketGui.py" line="44"/>
<source>3D Pocket</source>
@@ -2020,11 +2020,6 @@ If it is necessary to set the FinalDepth manually please select a different oper
<source>failed to return opening type.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathProfile.py" line="767"/>
<source>Please set to an acceptable value greater than zero.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathProfile.py" line="683"/>
<source>Failed to extract offset(s) for expanded profile.</source>
@@ -2035,6 +2030,11 @@ If it is necessary to set the FinalDepth manually please select a different oper
<source>Failed to expand profile.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathProfile.py" line="767"/>
<source>Please set to an acceptable value greater than zero.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathProfile.py" line="860"/>
<source>For open edges, verify Final Depth for this operation.</source>
@@ -2312,6 +2312,11 @@ If it is necessary to set the FinalDepth manually please select a different oper
<source>Current offset value is not possible.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathSlot.py" line="493"/>
<source>Current Extend Radius value produces negative arc radius.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSlot.py" line="520"/>
<source>No path extensions available for full circles.</source>
@@ -2357,6 +2362,11 @@ If it is necessary to set the FinalDepth manually please select a different oper
<source>Current tool larger than arc diameter.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathSlot.py" line="1005"/>
<source>Failed, slot from edge only accepts lines, arcs and circles.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSlot.py" line="994"/>
<source>Failed to determine point 1 from</source>
@@ -2377,6 +2387,11 @@ If it is necessary to set the FinalDepth manually please select a different oper
<source>The selected face is not oriented vertically:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathSlot.py" line="1688"/>
<source>Current offset value produces negative radius.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PathStock</name>
@@ -3086,6 +3101,12 @@ If it is necessary to set the FinalDepth manually please select a different oper
<source>Cutoff for removing colinear segments (degrees). default=10.0.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathVcarve.py" line="222"/>
<source>Cutoff for removing colinear segments (degrees).
default=10.0.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathVcarve.py" line="322"/>
<source>The Job Base Object has no engraveable element. Engraving operation will produce no output.</source>
@@ -3267,6 +3288,16 @@ If it is necessary to set the FinalDepth manually please select a different oper
</context>
<context>
<name>Path_Dressup</name>
<message>
<location filename="PathDressup.py" line="98"/>
<source>Dress-up</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathDressup.py" line="100"/>
<source>Creates a Path Dess-up object from a selected path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathDressup.py" line="110"/>
<source>Please select one path object
@@ -3284,16 +3315,6 @@ If it is necessary to set the FinalDepth manually please select a different oper
<source>Please select a Path object</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathDressup.py" line="98"/>
<source>Dress-up</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathDressup.py" line="100"/>
<source>Creates a Path Dess-up object from a selected path</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Path_DressupAxisMap</name>
@@ -3766,12 +3787,6 @@ If it is necessary to set the FinalDepth manually please select a different oper
<source>Creates a Path Hop object</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathHop.py" line="119"/>
<source>The selected object is not a path
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathHop.py" line="111"/>
<source>Please select one path object</source>
@@ -3787,6 +3802,12 @@ If it is necessary to set the FinalDepth manually please select a different oper
<source>Create Hop</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathHop.py" line="119"/>
<source>The selected object is not a path
</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Path_Inspect</name>
@@ -4033,11 +4054,41 @@ If it is necessary to set the FinalDepth manually please select a different oper
</context>
<context>
<name>Path_Sanity</name>
<message>
<location filename="../../../PathScripts/PathSanity.py" line="64"/>
<source>The Job has no selected Base object.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSanity.py" line="71"/>
<source>Check the path job for common errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSanity.py" line="76"/>
<source>A Postprocessor has not been selected.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSanity.py" line="80"/>
<source>No output file is named. You&apos;ll be prompted during postprocessing.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSanity.py" line="136"/>
<source>No active operations was found. Post processing will not result in any tooling.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSanity.py" line="140"/>
<source>A Tool Controller was not found. Default values are used which is dangerous. Please add a Tool Controller.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSanity.py" line="144"/>
<source>No issues detected, {} has passed basic sanity check.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSanity.py" line="189"/>
<source>Base Object(s)</source>
@@ -4088,36 +4139,6 @@ If it is necessary to set the FinalDepth manually please select a different oper
<source>Minimum Z Height</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSanity.py" line="64"/>
<source>The Job has no selected Base object.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSanity.py" line="76"/>
<source>A Postprocessor has not been selected.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSanity.py" line="80"/>
<source>No output file is named. You&apos;ll be prompted during postprocessing.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSanity.py" line="136"/>
<source>No active operations was found. Post processing will not result in any tooling.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSanity.py" line="140"/>
<source>A Tool Controller was not found. Default values are used which is dangerous. Please add a Tool Controller.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSanity.py" line="144"/>
<source>No issues detected, {} has passed basic sanity check.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSanity.py" line="224"/>
<source>Maximum Z Height</source>
@@ -4338,12 +4359,6 @@ If it is necessary to set the FinalDepth manually please select a different oper
</context>
<context>
<name>Path_SimpleCopy</name>
<message>
<location filename="PathSimpleCopy.py" line="59"/>
<source>Please select exactly one path object
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathSimpleCopy.py" line="62"/>
<source>Simple Copy</source>
@@ -4354,6 +4369,12 @@ If it is necessary to set the FinalDepth manually please select a different oper
<source>Creates a non-parametric copy of another path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathSimpleCopy.py" line="59"/>
<source>Please select exactly one path object
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathSimpleCopy.py" line="61"/>
<source>Please select exactly one path object</source>
@@ -4443,11 +4464,6 @@ If it is necessary to set the FinalDepth manually please select a different oper
</context>
<context>
<name>Path_ToolController</name>
<message>
<location filename="PathToolController.py" line="132"/>
<source>Tool Number to Load</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathToolController.py" line="156"/>
<source>Add Tool Controller to the Job</source>
@@ -4458,6 +4474,11 @@ If it is necessary to set the FinalDepth manually please select a different oper
<source>Add Tool Controller</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathToolController.py" line="132"/>
<source>Tool Number to Load</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Path_ToolTable</name>
@@ -4484,11 +4505,6 @@ If it is necessary to set the FinalDepth manually please select a different oper
<source>Creates a medial line engraving path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathVcarve.py" line="291"/>
<source>VCarve requires an engraving cutter with CuttingEdgeAngle</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathVcarve.py" line="309"/>
<source>VCarve requires an engraving cutter with CuttingEdgeAngle</source>
@@ -4499,6 +4515,11 @@ If it is necessary to set the FinalDepth manually please select a different oper
<source>Engraver Cutting Edge Angle must be &lt; 180 degrees.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathVcarve.py" line="291"/>
<source>VCarve requires an engraving cutter with CuttingEdgeAngle</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Path_Waterline</name>
@@ -4533,56 +4554,11 @@ If it is necessary to set the FinalDepth manually please select a different oper
<source>Save toolbit library</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathToolLibraryManager.py" line="147"/>
<source>Tooltable JSON (*.json)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathToolLibraryManager.py" line="149"/>
<source>HeeksCAD tooltable (*.tooltable)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathToolLibraryManager.py" line="150"/>
<source>LinuxCNC tooltable (*.tbl)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathToolLibraryManager.py" line="512"/>
<source>Open tooltable</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="TooltableEditor.py" line="610"/>
<source>Save tooltable</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathToolLibraryEditor.py" line="354"/>
<source>Rename Tooltable</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathToolLibraryEditor.py" line="354"/>
<source>Enter Name:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathToolLibraryEditor.py" line="385"/>
<source>Add New Tool Table</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathToolLibraryEditor.py" line="387"/>
<source>Delete Selected Tool Table</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathToolLibraryEditor.py" line="389"/>
<source>Rename Selected Tool Table</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="TooltableEditor.py" line="388"/>
<source>Tooltable editor</source>
@@ -4793,6 +4769,11 @@ If it is necessary to set the FinalDepth manually please select a different oper
<source>Tooltable XML (*.xml);;HeeksCAD tooltable (*.tooltable)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="TooltableEditor.py" line="610"/>
<source>Save tooltable</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="TooltableEditor.py" line="610"/>
<source>Tooltable XML (*.xml)</source>
@@ -4808,6 +4789,46 @@ If it is necessary to set the FinalDepth manually please select a different oper
<source>Object doesn&apos;t have a tooltable property</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathToolLibraryEditor.py" line="354"/>
<source>Rename Tooltable</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathToolLibraryEditor.py" line="354"/>
<source>Enter Name:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathToolLibraryEditor.py" line="385"/>
<source>Add New Tool Table</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathToolLibraryEditor.py" line="387"/>
<source>Delete Selected Tool Table</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathToolLibraryEditor.py" line="389"/>
<source>Rename Selected Tool Table</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathToolLibraryManager.py" line="147"/>
<source>Tooltable JSON (*.json)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathToolLibraryManager.py" line="149"/>
<source>HeeksCAD tooltable (*.tooltable)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../PathScripts/PathToolLibraryManager.py" line="150"/>
<source>LinuxCNC tooltable (*.tbl)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="PathToolLibraryManager.py" line="514"/>
<source>Tooltable XML (*.xml);;LinuxCNC tooltable (*.tbl)</source>
+84 -84
View File
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS><TS version="2.0">
<!DOCTYPE TS><TS version="1.1">
<context>
<name>Plot</name>
<message>
<location filename="../../InitGui.py" line="44"/>
<location filename="InitGui.py" line="46"/>
<source>Plot edition tools</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../InitGui.py" line="47"/>
<location filename="InitGui.py" line="49"/>
<source>Plot</source>
<translation type="unfinished"></translation>
</message>
@@ -16,12 +16,12 @@
<context>
<name>Plot_Axes</name>
<message>
<location filename="../../PlotGui.py" line="62"/>
<location filename="PlotGui.py" line="65"/>
<source>Configure axes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../PlotGui.py" line="65"/>
<location filename="PlotGui.py" line="68"/>
<source>Configure the axes parameters</source>
<translation type="unfinished"></translation>
</message>
@@ -29,12 +29,12 @@
<context>
<name>Plot_Grid</name>
<message>
<location filename="../../PlotGui.py" line="109"/>
<location filename="PlotGui.py" line="112"/>
<source>Show/Hide grid</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../PlotGui.py" line="112"/>
<location filename="PlotGui.py" line="115"/>
<source>Show/Hide grid on selected plot</source>
<translation type="unfinished"></translation>
</message>
@@ -42,12 +42,12 @@
<context>
<name>Plot_Labels</name>
<message>
<location filename="../../PlotGui.py" line="152"/>
<location filename="PlotGui.py" line="155"/>
<source>Set labels</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../PlotGui.py" line="155"/>
<location filename="PlotGui.py" line="158"/>
<source>Set title and axes labels</source>
<translation type="unfinished"></translation>
</message>
@@ -55,12 +55,12 @@
<context>
<name>Plot_Legend</name>
<message>
<location filename="../../PlotGui.py" line="135"/>
<location filename="PlotGui.py" line="138"/>
<source>Show/Hide legend</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../PlotGui.py" line="138"/>
<location filename="PlotGui.py" line="141"/>
<source>Show/Hide legend on selected plot</source>
<translation type="unfinished"></translation>
</message>
@@ -68,12 +68,12 @@
<context>
<name>Plot_Positions</name>
<message>
<location filename="../../PlotGui.py" line="169"/>
<location filename="PlotGui.py" line="172"/>
<source>Set positions and sizes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../PlotGui.py" line="172"/>
<location filename="PlotGui.py" line="175"/>
<source>Set labels and legend positions and sizes</source>
<translation type="unfinished"></translation>
</message>
@@ -81,12 +81,12 @@
<context>
<name>Plot_SaveFig</name>
<message>
<location filename="../../PlotGui.py" line="45"/>
<location filename="PlotGui.py" line="48"/>
<source>Save plot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../PlotGui.py" line="48"/>
<location filename="PlotGui.py" line="51"/>
<source>Save the plot as an image file</source>
<translation type="unfinished"></translation>
</message>
@@ -94,12 +94,12 @@
<context>
<name>Plot_Series</name>
<message>
<location filename="../../PlotGui.py" line="81"/>
<location filename="PlotGui.py" line="84"/>
<source>Configure series</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../PlotGui.py" line="84"/>
<location filename="PlotGui.py" line="87"/>
<source>Configure series drawing style and label</source>
<translation type="unfinished"></translation>
</message>
@@ -107,107 +107,107 @@
<context>
<name>plot_axes</name>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="177"/>
<location filename="TaskPanel.py" line="180"/>
<source>Configure axes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="181"/>
<location filename="TaskPanel.py" line="184"/>
<source>Active axes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="213"/>
<location filename="TaskPanel.py" line="216"/>
<source>Apply to all axes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="217"/>
<location filename="TaskPanel.py" line="220"/>
<source>Dimensions</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="221"/>
<location filename="TaskPanel.py" line="224"/>
<source>X axis position</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="225"/>
<location filename="TaskPanel.py" line="228"/>
<source>Y axis position</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="201"/>
<location filename="TaskPanel.py" line="204"/>
<source>Scales</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="205"/>
<location filename="TaskPanel.py" line="208"/>
<source>X auto</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="209"/>
<location filename="TaskPanel.py" line="212"/>
<source>Y auto</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="229"/>
<location filename="TaskPanel.py" line="232"/>
<source>Index of the active axes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="233"/>
<location filename="TaskPanel.py" line="237"/>
<source>Add new axes to the plot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="238"/>
<location filename="TaskPanel.py" line="242"/>
<source>Remove selected axes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="243"/>
<location filename="TaskPanel.py" line="247"/>
<source>Check it to apply transformations to all axes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="248"/>
<location filename="TaskPanel.py" line="252"/>
<source>Left bound of axes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="253"/>
<location filename="TaskPanel.py" line="257"/>
<source>Right bound of axes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="258"/>
<location filename="TaskPanel.py" line="262"/>
<source>Bottom bound of axes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="263"/>
<location filename="TaskPanel.py" line="267"/>
<source>Top bound of axes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="268"/>
<location filename="TaskPanel.py" line="272"/>
<source>Outward offset of X axis</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="273"/>
<location filename="TaskPanel.py" line="277"/>
<source>Outward offset of Y axis</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="278"/>
<location filename="TaskPanel.py" line="282"/>
<source>X axis scale autoselection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="283"/>
<location filename="TaskPanel.py" line="287"/>
<source>Y axis scale autoselection</source>
<translation type="unfinished"></translation>
</message>
@@ -215,32 +215,32 @@
<context>
<name>plot_console</name>
<message>
<location filename="../../Plot.py" line="43"/>
<location filename="Plot.py" line="47"/>
<source>matplotlib not found, so Plot module can not be loaded</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../InitGui.py" line="54"/>
<location filename="InitGui.py" line="58"/>
<source>matplotlib not found, Plot module will be disabled</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSave/TaskPanel.py" line="44"/>
<location filename="TaskPanel.py" line="48"/>
<source>Plot document must be selected in order to save it</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotAxes/TaskPanel.py" line="342"/>
<location filename="TaskPanel.py" line="346"/>
<source>Axes 0 can not be deleted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../PlotGui.py" line="97"/>
<location filename="PlotGui.py" line="101"/>
<source>The grid must be activated on top of a plot document</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../PlotGui.py" line="125"/>
<location filename="PlotGui.py" line="129"/>
<source>The legend must be activated on top of a plot document</source>
<translation type="unfinished"></translation>
</message>
@@ -248,62 +248,62 @@
<context>
<name>plot_labels</name>
<message>
<location filename="../../plotLabels/TaskPanel.py" line="135"/>
<location filename="TaskPanel.py" line="138"/>
<source>Set labels</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotLabels/TaskPanel.py" line="139"/>
<location filename="TaskPanel.py" line="142"/>
<source>Active axes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotLabels/TaskPanel.py" line="143"/>
<location filename="TaskPanel.py" line="146"/>
<source>Title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotLabels/TaskPanel.py" line="147"/>
<location filename="TaskPanel.py" line="150"/>
<source>X label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotLabels/TaskPanel.py" line="151"/>
<location filename="TaskPanel.py" line="154"/>
<source>Y label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotLabels/TaskPanel.py" line="155"/>
<location filename="TaskPanel.py" line="158"/>
<source>Index of the active axes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotLabels/TaskPanel.py" line="159"/>
<location filename="TaskPanel.py" line="163"/>
<source>Title (associated to active axes)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotLabels/TaskPanel.py" line="164"/>
<location filename="TaskPanel.py" line="168"/>
<source>Title font size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotLabels/TaskPanel.py" line="169"/>
<location filename="TaskPanel.py" line="173"/>
<source>X axis title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotLabels/TaskPanel.py" line="174"/>
<location filename="TaskPanel.py" line="178"/>
<source>X axis title font size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotLabels/TaskPanel.py" line="179"/>
<location filename="TaskPanel.py" line="183"/>
<source>Y axis title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotLabels/TaskPanel.py" line="184"/>
<location filename="TaskPanel.py" line="188"/>
<source>Y axis title font size</source>
<translation type="unfinished"></translation>
</message>
@@ -311,37 +311,37 @@
<context>
<name>plot_positions</name>
<message>
<location filename="../../plotPositions/TaskPanel.py" line="121"/>
<location filename="TaskPanel.py" line="124"/>
<source>Set positions and sizes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotPositions/TaskPanel.py" line="125"/>
<location filename="TaskPanel.py" line="129"/>
<source>Position</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotPositions/TaskPanel.py" line="130"/>
<location filename="TaskPanel.py" line="134"/>
<source>Size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotPositions/TaskPanel.py" line="140"/>
<location filename="TaskPanel.py" line="144"/>
<source>X item position</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotPositions/TaskPanel.py" line="145"/>
<location filename="TaskPanel.py" line="149"/>
<source>Y item position</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotPositions/TaskPanel.py" line="150"/>
<location filename="TaskPanel.py" line="154"/>
<source>Item size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotPositions/TaskPanel.py" line="135"/>
<location filename="TaskPanel.py" line="139"/>
<source>List of modifiable items</source>
<translation type="unfinished"></translation>
</message>
@@ -349,42 +349,42 @@
<context>
<name>plot_save</name>
<message>
<location filename="../../plotSave/TaskPanel.py" line="129"/>
<location filename="TaskPanel.py" line="132"/>
<source>Save figure</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSave/TaskPanel.py" line="133"/>
<location filename="TaskPanel.py" line="137"/>
<source>Inches</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSave/TaskPanel.py" line="138"/>
<location filename="TaskPanel.py" line="142"/>
<source>Dots per Inch</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSave/TaskPanel.py" line="143"/>
<location filename="TaskPanel.py" line="147"/>
<source>Output image file path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSave/TaskPanel.py" line="148"/>
<location filename="TaskPanel.py" line="152"/>
<source>Show a file selection dialog</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSave/TaskPanel.py" line="153"/>
<location filename="TaskPanel.py" line="157"/>
<source>X image size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSave/TaskPanel.py" line="158"/>
<location filename="TaskPanel.py" line="162"/>
<source>Y image size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSave/TaskPanel.py" line="163"/>
<location filename="TaskPanel.py" line="168"/>
<source>Dots per point, with size will define output image resolution</source>
<translation type="unfinished"></translation>
</message>
@@ -392,67 +392,67 @@
<context>
<name>plot_series</name>
<message>
<location filename="../../plotSeries/TaskPanel.py" line="153"/>
<location filename="TaskPanel.py" line="157"/>
<source>No label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSeries/TaskPanel.py" line="188"/>
<location filename="TaskPanel.py" line="192"/>
<source>Line style</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSeries/TaskPanel.py" line="168"/>
<location filename="TaskPanel.py" line="172"/>
<source>Marker</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSeries/TaskPanel.py" line="149"/>
<location filename="TaskPanel.py" line="152"/>
<source>Configure series</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSeries/TaskPanel.py" line="173"/>
<location filename="TaskPanel.py" line="177"/>
<source>List of available series</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSeries/TaskPanel.py" line="178"/>
<location filename="TaskPanel.py" line="182"/>
<source>Line title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSeries/TaskPanel.py" line="193"/>
<location filename="TaskPanel.py" line="197"/>
<source>Marker style</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSeries/TaskPanel.py" line="198"/>
<location filename="TaskPanel.py" line="202"/>
<source>Line width</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSeries/TaskPanel.py" line="203"/>
<location filename="TaskPanel.py" line="207"/>
<source>Marker size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSeries/TaskPanel.py" line="208"/>
<location filename="TaskPanel.py" line="212"/>
<source>Line and marker color</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSeries/TaskPanel.py" line="158"/>
<location filename="TaskPanel.py" line="162"/>
<source>Remove series</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSeries/TaskPanel.py" line="183"/>
<location filename="TaskPanel.py" line="187"/>
<source>If checked, series will not be considered for legend</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plotSeries/TaskPanel.py" line="213"/>
<location filename="TaskPanel.py" line="217"/>
<source>Removes this series</source>
<translation type="unfinished"></translation>
</message>

Some files were not shown because too many files have changed in this diff Show More