diff --git a/.gitignore b/.gitignore index eed2f58cb..19aa9e681 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,9 @@ *(v*).vit* *(v*).vst* +# Valentina's backup file +*.bak + # KDE directory preferences .directory diff --git a/.tx/config b/.tx/config index 0ca0025fd..de69aa30f 100644 --- a/.tx/config +++ b/.tx/config @@ -2,8 +2,9 @@ host = https://www.transifex.com lang_map = uk: uk_UA, cs : cs_CZ, nl : nl_NL, fi : fi_FI, es : es_ES, id : id_ID -[valentina-project.valentina_ts] +[valentina-project.valentina-ts] file_filter = share/translations/valentina_.ts +minimum_perc = 20 source_file = share/translations/valentina.ts source_lang = en type = QT diff --git a/ChangeLog.txt b/ChangeLog.txt index e33a1db31..74b331d2f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -38,6 +38,15 @@ - Export tiled PDF with watermark. - [#984] Issue with up to date list of unique names. - Tracking changes/prevent "OK" recalculation after "Apply". +- Change behavior for menu Pattern piece -> Show main path. Now it has an influence on export as well. +- Call Piece Options and Delete Piece from the piece list context menu. +- Change default values for grainline length and pattern label size to 10 cm. +- Tool Point at distance and angle now allows negative length. +- Export pattern to DXF-ASTM. +- [smart-pattern/valentina#18] Auto-created Visibility Group for group operation. +- Setting scale factor for export and print. +- New layout generator option: Prefer one sheet solution. +- [smart-pattern/valentina#15] Organization of groups - groups categories # Version 0.6.2 (unreleased) - [#903] Bug in tool Cut Spline path. diff --git a/common.pri b/common.pri index 8a9f35321..efdd80636 100644 --- a/common.pri +++ b/common.pri @@ -933,5 +933,7 @@ MSVC_DEBUG_CXXFLAGS += \ -wd5026 \ # move constructor was implicitly defined as deleted -wd5027 \ # move assignment operator was implicitly defined as deleted -wd5039 \ # pointer or reference to potentially throwing function passed to extern C function under -EHc. - -wd4774 # format string expected in argument 3 is not a string literal + -wd4774 \ # format string expected in argument 3 is not a string literal + -wd5204 # class has virtual functions, but its trivial destructor is not virtual; instances of objects derived + # from this class may not be destructed correctly } diff --git a/dist/OBS_debian/debian.valentina.1 b/dist/OBS_debian/debian.valentina.1 index 715019661..48c841dd1 100644 --- a/dist/OBS_debian/debian.valentina.1 +++ b/dist/OBS_debian/debian.valentina.1 @@ -1,6 +1,6 @@ .\" Manpage for valentina. .\" Contact dismine@gmail.com to correct errors. -.TH valentina 1 "21 July, 2019" "valentina man page" +.TH valentina 1 "22 March, 2020" "valentina man page" .SH NAME Valentina \- Pattern making program. .SH SYNOPSIS @@ -102,6 +102,33 @@ The path to output destination folder. By default the directory at which the app .BR "*" " AutoCAD DXF 2013 AAMA files (*.dxf) = 23," .RE .RS +.BR "*" " AutoCAD DXF R10 ASTM файли (*.dxf) = 24," +.RE +.RS +.BR "*" " AutoCAD DXF R11/12 ASTM файли (*.dxf) = 25," +.RE +.RS +.BR "*" " AutoCAD DXF R13 ASTM файли (*.dxf) = 26," +.RE +.RS +.BR "*" " AutoCAD DXF R14 ASTM файли (*.dxf) = 27," +.RE +.RS +.BR "*" " AutoCAD DXF 2000 ASTM файли (*.dxf) = 28," +.RE +.RS +.BR "*" " AutoCAD DXF 2004 ASTM файли (*.dxf) = 29," +.RE +.RS +.BR "*" " AutoCAD DXF 2007 ASTM файли (*.dxf) = 30," +.RE +.RS +.BR "*" " AutoCAD DXF 2010 ASTM файли (*.dxf) = 31," +.RE +.RS +.BR "*" " AutoCAD DXF 2013 ASTM файли (*.dxf) = 32," +.RE +.RS .BR "*" " PDF tiled files (*.pdf) = 33." .RE .IP "--bdxf" @@ -186,16 +213,24 @@ The path to output destination folder. By default the directory at which the app .RB "Page top margin in current units like 3.0 (" "export mode" "). If not set will be used value from default printer. Or 0 if none printers was found." .IP "-B, --bmargin " .RB "Page bottom margin in current units like 3.0 (" "export mode" "). If not set will be used value from default printer. Or 0 if none printers was found." +.IP "--xscale " +.RB "Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, " "export mode" ")." +.IP "--yscale " +.RB "Set vertical scale factor from 0.01 to 3.0 (default = 1.0, " "export mode" ")." .IP "--followGrainline" -.RB "Order detail to follow grainline direction (" "export mode" "). +.RB "Order detail to follow grainline direction (" "export mode" ")." .IP "--manualPriority" -.RB "Follow manual priority over priority by square (" "export mode" "). +.RB "Follow manual priority over priority by square (" "export mode" ")." .IP "--nestQuantity" .RB "Nest quantity copies of each piece (" "export mode" "). .IP "-c, --crop" .RB "Auto crop unused length (" "export mode" ")." +.IP "--cropWidth" +.RB "Auto crop unused width (" "export mode" ")." .IP "-u, --unite" .RB "Unite pages if possible (" "export mode" "). Maximum value limited by QImage that supports only a maximum of " "32768x32768 px" " images." +.IP "--preferOneSheetSolution" +.RB "Prefer one sheet layout solution (" "export mode" ")." .IP "-S, --savelen" .RB "Save length of the sheet if set (" "export mode" "). The option tells the program to use as much as possible width of sheet. Quality of a layout can be worse when this option was used." .IP "-l, --layounits " diff --git a/dist/debian/valentina.1 b/dist/debian/valentina.1 index 18664147b..48c841dd1 100644 --- a/dist/debian/valentina.1 +++ b/dist/debian/valentina.1 @@ -1,6 +1,6 @@ .\" Manpage for valentina. .\" Contact dismine@gmail.com to correct errors. -.TH valentina 1 "17 October, 2019" "valentina man page" +.TH valentina 1 "22 March, 2020" "valentina man page" .SH NAME Valentina \- Pattern making program. .SH SYNOPSIS @@ -102,6 +102,33 @@ The path to output destination folder. By default the directory at which the app .BR "*" " AutoCAD DXF 2013 AAMA files (*.dxf) = 23," .RE .RS +.BR "*" " AutoCAD DXF R10 ASTM файли (*.dxf) = 24," +.RE +.RS +.BR "*" " AutoCAD DXF R11/12 ASTM файли (*.dxf) = 25," +.RE +.RS +.BR "*" " AutoCAD DXF R13 ASTM файли (*.dxf) = 26," +.RE +.RS +.BR "*" " AutoCAD DXF R14 ASTM файли (*.dxf) = 27," +.RE +.RS +.BR "*" " AutoCAD DXF 2000 ASTM файли (*.dxf) = 28," +.RE +.RS +.BR "*" " AutoCAD DXF 2004 ASTM файли (*.dxf) = 29," +.RE +.RS +.BR "*" " AutoCAD DXF 2007 ASTM файли (*.dxf) = 30," +.RE +.RS +.BR "*" " AutoCAD DXF 2010 ASTM файли (*.dxf) = 31," +.RE +.RS +.BR "*" " AutoCAD DXF 2013 ASTM файли (*.dxf) = 32," +.RE +.RS .BR "*" " PDF tiled files (*.pdf) = 33." .RE .IP "--bdxf" @@ -186,10 +213,14 @@ The path to output destination folder. By default the directory at which the app .RB "Page top margin in current units like 3.0 (" "export mode" "). If not set will be used value from default printer. Or 0 if none printers was found." .IP "-B, --bmargin " .RB "Page bottom margin in current units like 3.0 (" "export mode" "). If not set will be used value from default printer. Or 0 if none printers was found." +.IP "--xscale " +.RB "Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, " "export mode" ")." +.IP "--yscale " +.RB "Set vertical scale factor from 0.01 to 3.0 (default = 1.0, " "export mode" ")." .IP "--followGrainline" -.RB "Order detail to follow grainline direction (" "export mode" "). +.RB "Order detail to follow grainline direction (" "export mode" ")." .IP "--manualPriority" -.RB "Follow manual priority over priority by square (" "export mode" "). +.RB "Follow manual priority over priority by square (" "export mode" ")." .IP "--nestQuantity" .RB "Nest quantity copies of each piece (" "export mode" "). .IP "-c, --crop" @@ -198,6 +229,8 @@ The path to output destination folder. By default the directory at which the app .RB "Auto crop unused width (" "export mode" ")." .IP "-u, --unite" .RB "Unite pages if possible (" "export mode" "). Maximum value limited by QImage that supports only a maximum of " "32768x32768 px" " images." +.IP "--preferOneSheetSolution" +.RB "Prefer one sheet layout solution (" "export mode" ")." .IP "-S, --savelen" .RB "Save length of the sheet if set (" "export mode" "). The option tells the program to use as much as possible width of sheet. Quality of a layout can be worse when this option was used." .IP "-l, --layounits " diff --git a/share/translations/valentina.ts b/share/translations/valentina.ts index bc8a8ad32..ddcd84322 100644 --- a/share/translations/valentina.ts +++ b/share/translations/valentina.ts @@ -50,6 +50,13 @@ add union details + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -2463,6 +2470,34 @@ Flipping by axis + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Rotation + Rotation + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -2502,6 +2537,34 @@ Flipping by line + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Rotation + Rotation + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -2515,7 +2578,7 @@ Unique pattern piece name - Unique pattern piece name + Unique pattern piece name Choose group name @@ -2525,6 +2588,18 @@ New group New group + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -3064,6 +3139,65 @@ + + DialogLayoutScale + + Layout scale + + + + Margins + + + + Left: + Left: + + + cm + cm + + + Right: + Right: + + + Top: + Top: + + + Bottom: + Bottom: + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -3363,6 +3497,14 @@ Apply settings anyway? Auto crop unused width + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -3775,6 +3917,34 @@ Apply settings anyway? Center point Center point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Rotation + Rotation + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -5460,6 +5630,30 @@ Apply settings anyway? This point cannot be origin point. Please, select another origin point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -5567,6 +5761,34 @@ Apply settings anyway? Orientation: + + Options + Options + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -9780,6 +10002,13 @@ This option will take an affect after restart. + + RenameGroup + + rename group + + + RenamePP @@ -11565,6 +11794,26 @@ Do you want to save your changes? Invalid version. Maximum supported format version is %1 + + Can't open file %1: +%2. + Can't open file %1: +%2. + + + Can't open schema file %1: +%2. + Can't open schema file %1: +%2. + + + Could not load schema file '%1'. + Could not load schema file '%1'. + + + Validation error file %3 in line %1 column %2 + Validation error file %3 in line %1 column %2 + VAbstractCubicBezierPath @@ -11697,6 +11946,18 @@ Do you want to save your changes? Length Length + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -11868,6 +12129,21 @@ Do you want to save your changes? + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -12370,6 +12646,26 @@ Do you want to save your changes? Auto crop unused width (export mode). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -12463,7 +12759,7 @@ Do you want to save your changes? Can't open schema file %1: %2. - Can't open schema file %1: + Can't open schema file %1: %2. @@ -12472,7 +12768,7 @@ Do you want to save your changes? Validation error file %3 in line %1 column %2 - Validation error file %3 in line %1 column %2 + Validation error file %3 in line %1 column %2 Parsing error file %3 in line %1 column %2 @@ -12500,7 +12796,7 @@ Do you want to save your changes? Could not load schema file '%1'. - Could not load schema file '%1'. + Could not load schema file '%1'. Fail to write Canonical XML. @@ -13104,6 +13400,14 @@ Do you want to save your changes? Can't create history record for the tool. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -13428,6 +13732,10 @@ Do you want to save your changes? Origin point + + Flipping by axis + + VToolFlippingByLine @@ -13439,6 +13747,10 @@ Do you want to save your changes? Second line point Second line point + + flipping by line + + VToolHeight @@ -13533,6 +13845,10 @@ Do you want to save your changes? Rotation origin point + + move + + VToolOptionsPropertyBrowser @@ -14133,6 +14449,10 @@ Do you want to save your changes? Rotation angle + + rotate + + VToolSeamAllowance @@ -15662,6 +15982,191 @@ Do you want to save your changes? Left symbol _ in the name + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VVITConverter @@ -15723,6 +16228,18 @@ Do you want to save your changes? Hide not in layout + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups @@ -15732,7 +16249,7 @@ Do you want to save your changes? Rename - Rename + Rename Delete @@ -15754,6 +16271,26 @@ Do you want to save your changes? Show All + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + Preferences + + + Categories: %1. + + Valentina diff --git a/share/translations/valentina_cs_CZ.ts b/share/translations/valentina_cs_CZ.ts index e0b6041bb..af9b1d3a2 100644 --- a/share/translations/valentina_cs_CZ.ts +++ b/share/translations/valentina_cs_CZ.ts @@ -50,6 +50,13 @@ Přidat spojení jednotlivostí (dílů střihu) + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -2447,6 +2454,34 @@ Flipping by axis Převrácení podle osy + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Název: + + + Rotation + Otáčení + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -2486,6 +2521,34 @@ Flipping by line Převrácení podle čáry + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Název: + + + Rotation + Otáčení + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -2499,7 +2562,7 @@ Unique pattern piece name - Jedinečný název dílu střihu + Jedinečný název dílu střihu Choose group name @@ -2509,6 +2572,18 @@ New group Nová skupina + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -3048,6 +3123,65 @@ Koeficient účinnosti: %1% + + DialogLayoutScale + + Layout scale + + + + Margins + Okraje + + + Left: + Levý: + + + cm + cm + + + Right: + Pravý: + + + Top: + Nahoře: + + + Bottom: + Dole: + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + % + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -3349,6 +3483,14 @@ Přesto použít nastavení? Auto crop unused width Automaticky ořezat nepoužívanou šířku + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -3761,6 +3903,34 @@ Přesto použít nastavení? Center point Středový bod + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Název: + + + Rotation + Otáčení + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -5435,6 +5605,30 @@ Přesto použít nastavení? This point cannot be origin point. Please, select another origin point Tento bod nemůže být původní bod. Vyberte, prosím, jiný původní bod + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Název: + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -5538,6 +5732,38 @@ Přesto použít nastavení? Orientation: Natočení: + + Options + Volby + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + % + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -9569,6 +9795,13 @@ Tato volba se projeví po opětovném spuštění. Odstranit položku ze skupiny + + RenameGroup + + rename group + + + RenamePP @@ -11233,6 +11466,26 @@ Chcete uložit změny? Invalid version. Maximum supported format version is %1 Neplatná verze. Nejvyšší podporovaná verze formátu je %1 + + Can't open file %1: +%2. + Nelze otevřít soubor %1: +%2. + + + Can't open schema file %1: +%2. + Nelze otevřít soubor se schématem %1: +%2. + + + Could not load schema file '%1'. + Nepodařilo se nahrát soubor se schématem '%1'. + + + Validation error file %3 in line %1 column %2 + Chyba při ověřování souboru %3 na řádku %1, ve sloupci %2 + VAbstractCubicBezierPath @@ -11321,6 +11574,18 @@ Chcete uložit změny? Length Délka + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -11492,6 +11757,21 @@ Chcete uložit změny? Neplatný zářez. + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -11994,6 +12274,26 @@ Chcete uložit změny? Auto crop unused width (export mode). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -12087,7 +12387,7 @@ Chcete uložit změny? Can't open schema file %1: %2. - Nelze otevřít soubor se schématem %1: + Nelze otevřít soubor se schématem %1: %2. @@ -12096,7 +12396,7 @@ Chcete uložit změny? Validation error file %3 in line %1 column %2 - Chyba při ověřování souboru %3 na řádku %1, ve sloupci %2 + Chyba při ověřování souboru %3 na řádku %1, ve sloupci %2 Parsing error file %3 in line %1 column %2 @@ -12124,7 +12424,7 @@ Chcete uložit změny? Could not load schema file '%1'. - Nepodařilo se nahrát soubor se schématem '%1'. + Nepodařilo se nahrát soubor se schématem '%1'. Fail to write Canonical XML. @@ -12717,6 +13017,14 @@ Chcete uložit změny? Can't create history record for the tool. Nelze vytvořit záznam historie pro nástroj. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -13034,6 +13342,10 @@ Chcete uložit změny? Origin point Původní bod + + Flipping by axis + Převrácení podle osy + VToolFlippingByLine @@ -13045,6 +13357,10 @@ Chcete uložit změny? Second line point Druhý bod čáry + + flipping by line + + VToolHeight @@ -13139,6 +13455,10 @@ Chcete uložit změny? Rotation origin point Původní bod otočení + + move + + VToolOptionsPropertyBrowser @@ -13739,6 +14059,10 @@ Chcete uložit změny? Rotation angle Úhel otáčení + + rotate + + VToolSeamAllowance @@ -15238,6 +15562,191 @@ Chcete uložit změny? Left symbol _ in the name OtočeníElOblouk_ + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VVITConverter @@ -15299,6 +15808,18 @@ Chcete uložit změny? Hide not in layout Skrýt ne v rozvržení + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups @@ -15308,7 +15829,7 @@ Chcete uložit změny? Rename - Přejmenovat + Přejmenovat Delete @@ -15330,6 +15851,26 @@ Chcete uložit změny? Show All Ukázat vše + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + Nastavení + + + Categories: %1. + + Valentina diff --git a/share/translations/valentina_de_DE.ts b/share/translations/valentina_de_DE.ts index 44b38165f..9d981a899 100644 --- a/share/translations/valentina_de_DE.ts +++ b/share/translations/valentina_de_DE.ts @@ -50,6 +50,13 @@ Verbindungsdetail hinzufügen + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -2447,6 +2454,34 @@ Flipping by axis Über Achse spiegeln + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Rotation + Drehung + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -2486,6 +2521,34 @@ Flipping by line Über Linie spiegeln + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Rotation + Drehung + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -2499,7 +2562,7 @@ Unique pattern piece name - Eindeutiger Name des Schnittteils + Eindeutiger Name des Schnittteils Choose group name @@ -2509,6 +2572,18 @@ New group Neue Gruppe + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -3048,6 +3123,65 @@ + + DialogLayoutScale + + Layout scale + + + + Margins + + + + Left: + Links: + + + cm + cm + + + Right: + Rechts: + + + Top: + Oben: + + + Bottom: + Unten: + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -3348,6 +3482,14 @@ Einstellungen trotzdem anwenden? Auto crop unused width + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -3760,6 +3902,34 @@ Einstellungen trotzdem anwenden? Center point Mittelpunkt + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Rotation + Drehung + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -5433,6 +5603,30 @@ Einstellungen trotzdem anwenden? This point cannot be origin point. Please, select another origin point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -5536,6 +5730,38 @@ Einstellungen trotzdem anwenden? Orientation: Ausrichtung: + + Options + Optionen + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -9549,6 +9775,13 @@ This option will take an affect after restart. + + RenameGroup + + rename group + + + RenamePP @@ -11190,6 +11423,25 @@ Do you want to save your changes? Invalid version. Maximum supported format version is %1 + + Can't open file %1: +%2. + Konnte Datei %1 nicht öffnen: %2. + + + Can't open schema file %1: +%2. + Konnte Schemadatei %1 nicht öffnen: +%2. + + + Could not load schema file '%1'. + Konnte Schemadatei %1 nicht öffnen. + + + Validation error file %3 in line %1 column %2 + Fehler bei der Gültigkeitsprüfung in Datei %3, Zeile %1, Spalte %2 + VAbstractCubicBezierPath @@ -11278,6 +11530,18 @@ Do you want to save your changes? Length Länge + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -11445,6 +11709,21 @@ Do you want to save your changes? + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -11943,6 +12222,26 @@ Do you want to save your changes? Auto crop unused width (export mode). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -12035,7 +12334,7 @@ Do you want to save your changes? Can't open schema file %1: %2. - Konnte Schemadatei %1 nicht öffnen: + Konnte Schemadatei %1 nicht öffnen: %2. @@ -12044,7 +12343,7 @@ Do you want to save your changes? Validation error file %3 in line %1 column %2 - Fehler bei der Gültigkeitsprüfung in Datei %3, Zeile %1, Spalte %2 + Fehler bei der Gültigkeitsprüfung in Datei %3, Zeile %1, Spalte %2 Parsing error file %3 in line %1 column %2 @@ -12072,7 +12371,7 @@ Do you want to save your changes? Could not load schema file '%1'. - Konnte Schemadatei %1 nicht öffnen. + Konnte Schemadatei %1 nicht öffnen. Fail to write Canonical XML. @@ -12665,6 +12964,14 @@ Do you want to save your changes? Can't create history record for the tool. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -12954,6 +13261,10 @@ Do you want to save your changes? Origin point + + Flipping by axis + Über Achse spiegeln + VToolFlippingByLine @@ -12965,6 +13276,10 @@ Do you want to save your changes? Second line point Punkt 2 der Linie + + flipping by line + + VToolHeight @@ -13059,6 +13374,10 @@ Do you want to save your changes? Rotation origin point + + move + + VToolOptionsPropertyBrowser @@ -13651,6 +13970,10 @@ Do you want to save your changes? Rotation angle + + rotate + + VToolSeamAllowance @@ -15146,6 +15469,191 @@ Do you want to save your changes? Left symbol _ in the name + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VVITConverter @@ -15207,6 +15715,18 @@ Do you want to save your changes? Hide not in layout + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups @@ -15216,7 +15736,7 @@ Do you want to save your changes? Rename - Umbenennen + Umbenennen Delete @@ -15238,6 +15758,26 @@ Do you want to save your changes? Show All + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + Einstellungen + + + Categories: %1. + + Valentina diff --git a/share/translations/valentina_el_GR.ts b/share/translations/valentina_el_GR.ts index 556d8da2c..b48e0a0c6 100644 --- a/share/translations/valentina_el_GR.ts +++ b/share/translations/valentina_el_GR.ts @@ -50,6 +50,13 @@ προσθήκη λεπτομερειών συνένωσης + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -2403,6 +2410,34 @@ Flipping by axis Αναστροφή κατά άξονα + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Όνομα: + + + Rotation + Περιστροφή + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -2442,6 +2477,34 @@ Flipping by line Αναστροφή κατά γραμμή + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Όνομα: + + + Rotation + Περιστροφή + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -2455,7 +2518,7 @@ Unique pattern piece name - Μοναδικό όνομα κομματιού πατρόν + Μοναδικό όνομα κομματιού πατρόν Choose group name @@ -2465,6 +2528,18 @@ New group Νέα ομάδα + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -2992,6 +3067,65 @@ + + DialogLayoutScale + + Layout scale + + + + Margins + Περιθώρια + + + Left: + Αριστερά: + + + cm + εκ + + + Right: + Δεξιά: + + + Top: + Επάνω: + + + Bottom: + Κάτω: + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -3276,6 +3410,14 @@ Apply settings anyway? Auto crop unused width + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -3688,6 +3830,34 @@ Apply settings anyway? Center point Κεντρικό σημείο + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Όνομα: + + + Rotation + Περιστροφή + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -5349,6 +5519,30 @@ Apply settings anyway? This point cannot be origin point. Please, select another origin point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Όνομα: + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -5452,6 +5646,38 @@ Apply settings anyway? Orientation: + + Options + Επιλογές + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -9363,6 +9589,13 @@ This option will take an affect after restart. + + RenameGroup + + rename group + + + RenamePP @@ -10973,6 +11206,24 @@ Do you want to save your changes? Invalid version. Maximum supported format version is %1 + + Can't open file %1: +%2. + + + + Can't open schema file %1: +%2. + + + + Could not load schema file '%1'. + + + + Validation error file %3 in line %1 column %2 + + VAbstractCubicBezierPath @@ -11061,6 +11312,18 @@ Do you want to save your changes? Length Μήκος + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -11228,6 +11491,21 @@ Do you want to save your changes? + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -11614,6 +11892,26 @@ Do you want to save your changes? Auto crop unused width (export mode). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -11687,15 +11985,6 @@ Do you want to save your changes? %2. - - Can't open schema file %1: -%2. - - - - Validation error file %3 in line %1 column %2 - - Parsing error file %3 in line %1 column %2 @@ -11712,10 +12001,6 @@ Do you want to save your changes? Could not copy temp file to document file Δεν ήταν δυνατή η αντιγραφή του προσωρινού αρχείου στο αρχείο εγγράφου - - Could not load schema file '%1'. - - Fail to write Canonical XML. @@ -12307,6 +12592,14 @@ Do you want to save your changes? Can't create history record for the tool. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -12608,6 +12901,10 @@ Do you want to save your changes? Origin point + + Flipping by axis + Αναστροφή κατά άξονα + VToolFlippingByLine @@ -12619,6 +12916,10 @@ Do you want to save your changes? Second line point Δεύτερο σημείο γραμμής + + flipping by line + + VToolHeight @@ -12713,6 +13014,10 @@ Do you want to save your changes? Rotation origin point + + move + + VToolOptionsPropertyBrowser @@ -13309,6 +13614,10 @@ Do you want to save your changes? Rotation angle + + rotate + + VToolSeamAllowance @@ -14734,6 +15043,191 @@ Do you want to save your changes? Left symbol _ in the name + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VVITConverter @@ -14795,12 +15289,24 @@ Do you want to save your changes? Hide not in layout + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups Rename - Μετονομασία + Μετονομασία Delete @@ -14822,6 +15328,26 @@ Do you want to save your changes? Show All + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + Προτιμήσεις + + + Categories: %1. + + Valentina diff --git a/share/translations/valentina_en_CA.ts b/share/translations/valentina_en_CA.ts index 9b4a1cc9e..6d08da1c9 100644 --- a/share/translations/valentina_en_CA.ts +++ b/share/translations/valentina_en_CA.ts @@ -50,6 +50,13 @@ add union details + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -2447,6 +2454,34 @@ Flipping by axis Flipping by axis + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Rotation + Rotation + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -2486,6 +2521,34 @@ Flipping by line Flipping by line + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Rotation + Rotation + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -2499,7 +2562,7 @@ Unique pattern piece name - Unique pattern piece name + Unique pattern piece name Choose group name @@ -2509,6 +2572,18 @@ New group New group + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -3048,6 +3123,65 @@ + + DialogLayoutScale + + Layout scale + + + + Margins + + + + Left: + Left: + + + cm + cm + + + Right: + Right: + + + Top: + Top: + + + Bottom: + Bottom: + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -3347,6 +3481,14 @@ Apply settings anyway? Auto crop unused width + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -3759,6 +3901,34 @@ Apply settings anyway? Center point Center point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Rotation + Rotation + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -5432,6 +5602,30 @@ Apply settings anyway? This point cannot be origin point. Please, select another origin point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -5535,6 +5729,38 @@ Apply settings anyway? Orientation: + + Options + Options + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -9560,6 +9786,13 @@ This option will take an affect after restart. + + RenameGroup + + rename group + + + RenamePP @@ -11224,6 +11457,26 @@ Do you want to save your changes? Invalid version. Maximum supported format version is %1 + + Can't open file %1: +%2. + Can't open file %1: +%2. + + + Can't open schema file %1: +%2. + Can't open schema file %1: +%2. + + + Could not load schema file '%1'. + Could not load schema file '%1'. + + + Validation error file %3 in line %1 column %2 + Validation error file %3 in line %1 column %2 + VAbstractCubicBezierPath @@ -11312,6 +11565,18 @@ Do you want to save your changes? Length Length + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -11483,6 +11748,21 @@ Do you want to save your changes? + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -11985,6 +12265,26 @@ Do you want to save your changes? Auto crop unused width (export mode). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -12078,7 +12378,7 @@ Do you want to save your changes? Can't open schema file %1: %2. - Can't open schema file %1: + Can't open schema file %1: %2. @@ -12087,7 +12387,7 @@ Do you want to save your changes? Validation error file %3 in line %1 column %2 - Validation error file %3 in line %1 column %2 + Validation error file %3 in line %1 column %2 Parsing error file %3 in line %1 column %2 @@ -12115,7 +12415,7 @@ Do you want to save your changes? Could not load schema file '%1'. - Could not load schema file '%1'. + Could not load schema file '%1'. Fail to write Canonical XML. @@ -12708,6 +13008,14 @@ Do you want to save your changes? Can't create history record for the tool. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -13025,6 +13333,10 @@ Do you want to save your changes? Origin point + + Flipping by axis + Flipping by axis + VToolFlippingByLine @@ -13036,6 +13348,10 @@ Do you want to save your changes? Second line point Second line point + + flipping by line + + VToolHeight @@ -13130,6 +13446,10 @@ Do you want to save your changes? Rotation origin point + + move + + VToolOptionsPropertyBrowser @@ -13730,6 +14050,10 @@ Do you want to save your changes? Rotation angle + + rotate + + VToolSeamAllowance @@ -15229,6 +15553,191 @@ Do you want to save your changes? Left symbol _ in the name + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VVITConverter @@ -15290,6 +15799,18 @@ Do you want to save your changes? Hide not in layout + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups @@ -15299,7 +15820,7 @@ Do you want to save your changes? Rename - Rename + Rename Delete @@ -15321,6 +15842,26 @@ Do you want to save your changes? Show All + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + Preferences + + + Categories: %1. + + Valentina diff --git a/share/translations/valentina_en_IN.ts b/share/translations/valentina_en_IN.ts index db9d738cb..8d2186c7e 100644 --- a/share/translations/valentina_en_IN.ts +++ b/share/translations/valentina_en_IN.ts @@ -50,6 +50,13 @@ add union details + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -2447,6 +2454,34 @@ Flipping by axis Flipping by axis + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Rotation + Rotation + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -2486,6 +2521,34 @@ Flipping by line Flipping by line + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Rotation + Rotation + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -2499,7 +2562,7 @@ Unique pattern piece name - Unique pattern piece name + Unique pattern piece name Choose group name @@ -2509,6 +2572,18 @@ New group New group + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -3048,6 +3123,65 @@ + + DialogLayoutScale + + Layout scale + + + + Margins + + + + Left: + Left: + + + cm + cm + + + Right: + Right: + + + Top: + Top: + + + Bottom: + Bottom: + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -3347,6 +3481,14 @@ Apply settings anyway? Auto crop unused width + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -3759,6 +3901,34 @@ Apply settings anyway? Center point Center point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Rotation + Rotation + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -5432,6 +5602,30 @@ Apply settings anyway? This point cannot be origin point. Please, select another origin point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -5535,6 +5729,38 @@ Apply settings anyway? Orientation: + + Options + Options + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -9560,6 +9786,13 @@ This option will take an affect after restart. + + RenameGroup + + rename group + + + RenamePP @@ -11224,6 +11457,26 @@ Do you want to save your changes? Invalid version. Maximum supported format version is %1 + + Can't open file %1: +%2. + Can't open file %1: +%2. + + + Can't open schema file %1: +%2. + Can't open schema file %1: +%2. + + + Could not load schema file '%1'. + Could not load schema file '%1'. + + + Validation error file %3 in line %1 column %2 + Validation error file %3 in line %1 column %2 + VAbstractCubicBezierPath @@ -11312,6 +11565,18 @@ Do you want to save your changes? Length Length + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -11483,6 +11748,21 @@ Do you want to save your changes? + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -11985,6 +12265,26 @@ Do you want to save your changes? Auto crop unused width (export mode). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -12078,7 +12378,7 @@ Do you want to save your changes? Can't open schema file %1: %2. - Can't open schema file %1: + Can't open schema file %1: %2. @@ -12087,7 +12387,7 @@ Do you want to save your changes? Validation error file %3 in line %1 column %2 - Validation error file %3 in line %1 column %2 + Validation error file %3 in line %1 column %2 Parsing error file %3 in line %1 column %2 @@ -12115,7 +12415,7 @@ Do you want to save your changes? Could not load schema file '%1'. - Could not load schema file '%1'. + Could not load schema file '%1'. Fail to write Canonical XML. @@ -12708,6 +13008,14 @@ Do you want to save your changes? Can't create history record for the tool. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -13025,6 +13333,10 @@ Do you want to save your changes? Origin point + + Flipping by axis + Flipping by axis + VToolFlippingByLine @@ -13036,6 +13348,10 @@ Do you want to save your changes? Second line point Second line point + + flipping by line + + VToolHeight @@ -13130,6 +13446,10 @@ Do you want to save your changes? Rotation origin point + + move + + VToolOptionsPropertyBrowser @@ -13730,6 +14050,10 @@ Do you want to save your changes? Rotation angle + + rotate + + VToolSeamAllowance @@ -15229,6 +15553,191 @@ Do you want to save your changes? Left symbol _ in the name + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VVITConverter @@ -15290,6 +15799,18 @@ Do you want to save your changes? Hide not in layout + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups @@ -15299,7 +15820,7 @@ Do you want to save your changes? Rename - Rename + Rename Delete @@ -15321,6 +15842,26 @@ Do you want to save your changes? Show All + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + Preferences + + + Categories: %1. + + Valentina diff --git a/share/translations/valentina_en_US.ts b/share/translations/valentina_en_US.ts index cfc4d098e..d4043c1fd 100644 --- a/share/translations/valentina_en_US.ts +++ b/share/translations/valentina_en_US.ts @@ -50,6 +50,13 @@ add union details + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -2447,6 +2454,34 @@ Flipping by axis Flipping by axis + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Rotation + Rotation + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -2486,6 +2521,34 @@ Flipping by line Flipping by line + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Rotation + Rotation + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -2499,7 +2562,7 @@ Unique pattern piece name - Unique pattern piece name + Unique pattern piece name Choose group name @@ -2509,6 +2572,18 @@ New group New group + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -3048,6 +3123,65 @@ + + DialogLayoutScale + + Layout scale + + + + Margins + + + + Left: + Left: + + + cm + cm + + + Right: + Right: + + + Top: + Top: + + + Bottom: + Bottom: + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -3347,6 +3481,14 @@ Apply settings anyway? Auto crop unused width + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -3759,6 +3901,34 @@ Apply settings anyway? Center point Center point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Rotation + Rotation + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -5432,6 +5602,30 @@ Apply settings anyway? This point cannot be origin point. Please, select another origin point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Name: + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -5535,6 +5729,38 @@ Apply settings anyway? Orientation: + + Options + Options + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -9560,6 +9786,13 @@ This option will take an affect after restart. + + RenameGroup + + rename group + + + RenamePP @@ -11224,6 +11457,26 @@ Do you want to save your changes? Invalid version. Maximum supported format version is %1 + + Can't open file %1: +%2. + Can't open file %1: +%2. + + + Can't open schema file %1: +%2. + Can't open schema file %1: +%2. + + + Could not load schema file '%1'. + Could not load schema file '%1'. + + + Validation error file %3 in line %1 column %2 + Validation error file %3 in line %1 column %2 + VAbstractCubicBezierPath @@ -11312,6 +11565,18 @@ Do you want to save your changes? Length Length + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -11483,6 +11748,21 @@ Do you want to save your changes? + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -11985,6 +12265,26 @@ Do you want to save your changes? Auto crop unused width (export mode). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -12078,7 +12378,7 @@ Do you want to save your changes? Can't open schema file %1: %2. - Can't open schema file %1: + Can't open schema file %1: %2. @@ -12087,7 +12387,7 @@ Do you want to save your changes? Validation error file %3 in line %1 column %2 - Validation error file %3 in line %1 column %2 + Validation error file %3 in line %1 column %2 Parsing error file %3 in line %1 column %2 @@ -12115,7 +12415,7 @@ Do you want to save your changes? Could not load schema file '%1'. - Could not load schema file '%1'. + Could not load schema file '%1'. Fail to write Canonical XML. @@ -12708,6 +13008,14 @@ Do you want to save your changes? Can't create history record for the tool. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -13025,6 +13333,10 @@ Do you want to save your changes? Origin point + + Flipping by axis + Flipping by axis + VToolFlippingByLine @@ -13036,6 +13348,10 @@ Do you want to save your changes? Second line point Second line point + + flipping by line + + VToolHeight @@ -13130,6 +13446,10 @@ Do you want to save your changes? Rotation origin point + + move + + VToolOptionsPropertyBrowser @@ -13730,6 +14050,10 @@ Do you want to save your changes? Rotation angle + + rotate + + VToolSeamAllowance @@ -15229,6 +15553,191 @@ Do you want to save your changes? Left symbol _ in the name + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VVITConverter @@ -15290,6 +15799,18 @@ Do you want to save your changes? Hide not in layout + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups @@ -15299,7 +15820,7 @@ Do you want to save your changes? Rename - Rename + Rename Delete @@ -15321,6 +15842,26 @@ Do you want to save your changes? Show All + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + Preferences + + + Categories: %1. + + Valentina diff --git a/share/translations/valentina_es_ES.ts b/share/translations/valentina_es_ES.ts index cd8f57e19..5faa86e87 100644 --- a/share/translations/valentina_es_ES.ts +++ b/share/translations/valentina_es_ES.ts @@ -50,6 +50,13 @@ añadir detalles de la unión + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -2447,6 +2454,34 @@ Flipping by axis Volteando por ejes + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nombre: + + + Rotation + Rotación + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -2486,6 +2521,34 @@ Flipping by line Volteando por linea + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nombre: + + + Rotation + Rotación + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -2499,7 +2562,7 @@ Unique pattern piece name - Nombre único de pieza del patrón + Nombre único de pieza del patrón Choose group name @@ -2509,6 +2572,18 @@ New group Nuevo grupo + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -3048,6 +3123,65 @@ Coeficiente de eficiencia: %1% + + DialogLayoutScale + + Layout scale + + + + Margins + Margenes + + + Left: + Izquierda: + + + cm + cm + + + Right: + Derecha: + + + Top: + + + + Bottom: + + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + % + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -3348,6 +3482,14 @@ Aplicar características de todos modos? Auto crop unused width Recorte automático del ancho no utilizado + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -3760,6 +3902,34 @@ Aplicar características de todos modos? Center point Punto central + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nombre: + + + Rotation + Rotación + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -5433,6 +5603,30 @@ Aplicar características de todos modos? This point cannot be origin point. Please, select another origin point Este punto no puede ser punto de origen. Por favor, seleccione otro punto de origen + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nombre: + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -5536,6 +5730,38 @@ Aplicar características de todos modos? Orientation: Orientación: + + Options + Opciones + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + % + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -9563,6 +9789,13 @@ Esta opción surtirá efecto después de reiniciar. Remover elemento del grupo + + RenameGroup + + rename group + + + RenamePP @@ -11227,6 +11460,26 @@ Quieres guardar los cambios? Invalid version. Maximum supported format version is %1 Versión invalida. La versión de formato máximo admitido es %1 + + Can't open file %1: +%2. + No se pudo abrir el archivo %1: +%2. + + + Can't open schema file %1: +%2. + No se pudo abrir el archivo de esquema %1: +%2. + + + Could not load schema file '%1'. + No se puede cargar el archivo de esquema '%1'. + + + Validation error file %3 in line %1 column %2 + Error de validación en el archivo %3 en la línea %1 columna %2 + VAbstractCubicBezierPath @@ -11315,6 +11568,18 @@ Quieres guardar los cambios? Length Longitud + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -11486,6 +11751,21 @@ Quieres guardar los cambios? Pique invalido. + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -11988,6 +12268,26 @@ Quieres guardar los cambios? Auto crop unused width (export mode). Auto cortar ancho sin uso (modo de exportación). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -12081,7 +12381,7 @@ Quieres guardar los cambios? Can't open schema file %1: %2. - No se pudo abrir el archivo de esquema %1: + No se pudo abrir el archivo de esquema %1: %2. @@ -12090,7 +12390,7 @@ Quieres guardar los cambios? Validation error file %3 in line %1 column %2 - Error de validación en el archivo %3 en la línea %1 columna %2 + Error de validación en el archivo %3 en la línea %1 columna %2 Parsing error file %3 in line %1 column %2 @@ -12118,7 +12418,7 @@ Quieres guardar los cambios? Could not load schema file '%1'. - No se puede cargar el archivo de esquema '%1'. + No se puede cargar el archivo de esquema '%1'. Fail to write Canonical XML. @@ -12711,6 +13011,14 @@ Quieres guardar los cambios? Can't create history record for the tool. No se puede crear un registro de historial para la herramienta. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -13028,6 +13336,10 @@ Quieres guardar los cambios? Origin point Punto origen + + Flipping by axis + Volteando por ejes + VToolFlippingByLine @@ -13039,6 +13351,10 @@ Quieres guardar los cambios? Second line point Punto segunda linea + + flipping by line + + VToolHeight @@ -13133,6 +13449,10 @@ Quieres guardar los cambios? Rotation origin point Punto de origen de rotación + + move + + VToolOptionsPropertyBrowser @@ -13733,6 +14053,10 @@ Quieres guardar los cambios? Rotation angle Angulo de rotación + + rotate + + VToolSeamAllowance @@ -15232,6 +15556,191 @@ Quieres guardar los cambios? Left symbol _ in the name RotaciónElArco_ + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VVITConverter @@ -15293,6 +15802,18 @@ Quieres guardar los cambios? Hide not in layout No ocultar en el diseño + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups @@ -15302,7 +15823,7 @@ Quieres guardar los cambios? Rename - Renombrar + Renombrar Delete @@ -15324,6 +15845,26 @@ Quieres guardar los cambios? Show All Mostrar Todo + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + Preferencias + + + Categories: %1. + + Valentina diff --git a/share/translations/valentina_fi_FI.ts b/share/translations/valentina_fi_FI.ts index 8e177bc36..466e8af13 100644 --- a/share/translations/valentina_fi_FI.ts +++ b/share/translations/valentina_fi_FI.ts @@ -36,6 +36,13 @@ + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -2059,6 +2066,34 @@ Flipping by axis + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nmi: + + + Rotation + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -2094,6 +2129,34 @@ Flipping by line + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nmi: + + + Rotation + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -2105,10 +2168,6 @@ Group name: - - Unique pattern piece name - - Choose group name @@ -2117,6 +2176,18 @@ New group + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -2628,6 +2699,65 @@ + + DialogLayoutScale + + Layout scale + + + + Margins + + + + Left: + + + + cm + cm + + + Right: + + + + Top: + + + + Bottom: + + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -2852,6 +2982,14 @@ Apply settings anyway? Auto crop unused width + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -3260,6 +3398,34 @@ Apply settings anyway? Center point Keskipiste + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nmi: + + + Rotation + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -4805,6 +4971,30 @@ Apply settings anyway? This point cannot be origin point. Please, select another origin point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nmi: + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -4888,6 +5078,38 @@ Apply settings anyway? Orientation: + + Options + Asetukset + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -8519,6 +8741,13 @@ This option will take an affect after restart. + + RenameGroup + + rename group + + + RenamePP @@ -9997,6 +10226,26 @@ Do you want to save your changes? Invalid version. Maximum supported format version is %1 + + Can't open file %1: +%2. + Tiedostoa %1 ei voitu avata: +%2. + + + Can't open schema file %1: +%2. + Skeematiedostoa %1 ei voitu avata. +%2. + + + Could not load schema file '%1'. + + + + Validation error file %3 in line %1 column %2 + Tarkastus virhe tiedostossa %3 rivillä %1 kohdassa %2 + VAbstractCubicBezierPath @@ -10085,6 +10334,18 @@ Do you want to save your changes? Length Pituus + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -10252,6 +10513,21 @@ Do you want to save your changes? + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -10634,6 +10910,26 @@ Do you want to save your changes? Auto crop unused width (export mode). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -10727,7 +11023,7 @@ Do you want to save your changes? Can't open schema file %1: %2. - Skeematiedostoa %1 ei voitu avata. + Skeematiedostoa %1 ei voitu avata. %2. @@ -10736,7 +11032,7 @@ Do you want to save your changes? Validation error file %3 in line %1 column %2 - Tarkastus virhe tiedostossa %3 rivillä %1 kohdassa %2 + Tarkastus virhe tiedostossa %3 rivillä %1 kohdassa %2 Parsing error file %3 in line %1 column %2 @@ -10762,10 +11058,6 @@ Do you want to save your changes? Could not remove document file Dokumenttitiedostoa ei voitu poistaa - - Could not load schema file '%1'. - - Fail to write Canonical XML. @@ -11357,6 +11649,14 @@ Do you want to save your changes? Can't create history record for the tool. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -11607,6 +11907,10 @@ Do you want to save your changes? Origin point + + Flipping by axis + + VToolFlippingByLine @@ -11618,6 +11922,10 @@ Do you want to save your changes? Second line point Viivan toinen piste + + flipping by line + + VToolHeight @@ -11712,6 +12020,10 @@ Do you want to save your changes? Rotation origin point + + move + + VToolOptionsPropertyBrowser @@ -12252,6 +12564,10 @@ Do you want to save your changes? Rotation angle + + rotate + + VToolSeamAllowance @@ -13712,6 +14028,191 @@ Do you want to save your changes? Left symbol _ in the name + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VVITConverter @@ -13773,13 +14274,21 @@ Do you want to save your changes? Hide not in layout + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups - - Rename - - Delete Poista @@ -13800,6 +14309,26 @@ Do you want to save your changes? Show All + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + Asetukset + + + Categories: %1. + + Valentina diff --git a/share/translations/valentina_fr_FR.ts b/share/translations/valentina_fr_FR.ts index 52f42e174..5f0ef24b0 100644 --- a/share/translations/valentina_fr_FR.ts +++ b/share/translations/valentina_fr_FR.ts @@ -50,6 +50,13 @@ Ajouter des fusions de pièce de patron + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -2447,6 +2454,34 @@ Flipping by axis + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Rotation + Rotation + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -2486,6 +2521,34 @@ Flipping by line + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Rotation + Rotation + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -2499,7 +2562,7 @@ Unique pattern piece name - Nom unique de pièce de patron + Nom unique de pièce de patron Choose group name @@ -2509,6 +2572,18 @@ New group Nouveau groupe + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -3048,6 +3123,65 @@ + + DialogLayoutScale + + Layout scale + + + + Margins + + + + Left: + Gauche: + + + cm + + + + Right: + Droite: + + + Top: + Haut: + + + Bottom: + Bas: + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -3344,6 +3478,14 @@ Apply settings anyway? Auto crop unused width + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -3756,6 +3898,34 @@ Apply settings anyway? Center point Point central + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Rotation + Rotation + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -5429,6 +5599,30 @@ Apply settings anyway? This point cannot be origin point. Please, select another origin point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -5532,6 +5726,38 @@ Apply settings anyway? Orientation: + + Options + Options + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -9545,6 +9771,13 @@ This option will take an affect after restart. + + RenameGroup + + rename group + + + RenamePP @@ -11205,6 +11438,25 @@ Voulez-vous enregistrer les changements? Invalid version. Maximum supported format version is %1 + + Can't open file %1: +%2. + impossible d'ouvrir le fichier %1: +%2. + + + Can't open schema file %1: +%2. + Erreur d'ouverture du fichier de schéma %1: %2. + + + Could not load schema file '%1'. + Impossible de lire le schéma de fichier '%1'. + + + Validation error file %3 in line %1 column %2 + Erreur de validation : fichier %3, ligne %1, colonne %2 + VAbstractCubicBezierPath @@ -11293,6 +11545,18 @@ Voulez-vous enregistrer les changements? Length Longueur + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -11460,6 +11724,21 @@ Voulez-vous enregistrer les changements? + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -11962,6 +12241,26 @@ Voulez-vous enregistrer les changements? Auto crop unused width (export mode). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -12055,7 +12354,7 @@ Voulez-vous enregistrer les changements? Can't open schema file %1: %2. - Erreur d'ouverture du fichier de schéma %1: %2. + Erreur d'ouverture du fichier de schéma %1: %2. Could not load schema file. @@ -12063,7 +12362,7 @@ Voulez-vous enregistrer les changements? Validation error file %3 in line %1 column %2 - Erreur de validation : fichier %3, ligne %1, colonne %2 + Erreur de validation : fichier %3, ligne %1, colonne %2 Parsing error file %3 in line %1 column %2 @@ -12091,7 +12390,7 @@ Voulez-vous enregistrer les changements? Could not load schema file '%1'. - Impossible de lire le schéma de fichier '%1'. + Impossible de lire le schéma de fichier '%1'. Fail to write Canonical XML. @@ -12684,6 +12983,14 @@ Voulez-vous enregistrer les changements? Can't create history record for the tool. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -12993,6 +13300,10 @@ Voulez-vous enregistrer les changements? Origin point + + Flipping by axis + + VToolFlippingByLine @@ -13004,6 +13315,10 @@ Voulez-vous enregistrer les changements? Second line point Point de deuxieme ligne + + flipping by line + + VToolHeight @@ -13098,6 +13413,10 @@ Voulez-vous enregistrer les changements? Rotation origin point + + move + + VToolOptionsPropertyBrowser @@ -13694,6 +14013,10 @@ Voulez-vous enregistrer les changements? Rotation angle + + rotate + + VToolSeamAllowance @@ -15193,6 +15516,191 @@ Voulez-vous enregistrer les changements? Left symbol _ in the name + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VVITConverter @@ -15254,6 +15762,18 @@ Voulez-vous enregistrer les changements? Hide not in layout + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups @@ -15263,7 +15783,7 @@ Voulez-vous enregistrer les changements? Rename - Renommer + Renommer Delete @@ -15285,6 +15805,26 @@ Voulez-vous enregistrer les changements? Show All + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + Préférences + + + Categories: %1. + + Valentina diff --git a/share/translations/valentina_he_IL.ts b/share/translations/valentina_he_IL.ts index fdba7ec7b..4cf4f4d4e 100644 --- a/share/translations/valentina_he_IL.ts +++ b/share/translations/valentina_he_IL.ts @@ -36,6 +36,13 @@ + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -1668,6 +1675,34 @@ Flipping by axis + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Rotation + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -1703,6 +1738,34 @@ Flipping by line + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Rotation + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -1714,10 +1777,6 @@ Group name: - - Unique pattern piece name - - Choose group name @@ -1726,6 +1785,18 @@ New group + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -2185,6 +2256,65 @@ + + DialogLayoutScale + + Layout scale + + + + Margins + + + + Left: + + + + cm + + + + Right: + + + + Top: + + + + Bottom: + + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -2381,6 +2511,14 @@ Apply settings anyway? Auto crop unused width + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -2757,6 +2895,34 @@ Apply settings anyway? Center point נקודת מרכז + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Rotation + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -4091,6 +4257,30 @@ Apply settings anyway? This point cannot be origin point. Please, select another origin point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -4174,6 +4364,38 @@ Apply settings anyway? Orientation: + + Options + אפשרויות + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -7474,6 +7696,13 @@ This option will take an affect after restart. + + RenameGroup + + rename group + + + RenamePP @@ -8815,6 +9044,24 @@ Do you want to save your changes? Invalid version. Maximum supported format version is %1 + + Can't open file %1: +%2. + + + + Can't open schema file %1: +%2. + + + + Could not load schema file '%1'. + + + + Validation error file %3 in line %1 column %2 + + VAbstractCubicBezierPath @@ -8903,6 +9150,18 @@ Do you want to save your changes? Length אורך + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -9070,6 +9329,21 @@ Do you want to save your changes? + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -9448,6 +9722,26 @@ Do you want to save your changes? Auto crop unused width (export mode). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -9521,15 +9815,6 @@ Do you want to save your changes? %2. - - Can't open schema file %1: -%2. - - - - Validation error file %3 in line %1 column %2 - - Parsing error file %3 in line %1 column %2 @@ -9538,10 +9823,6 @@ Do you want to save your changes? Couldn't get node - - Could not load schema file '%1'. - - Fail to write Canonical XML. @@ -10106,6 +10387,14 @@ Do you want to save your changes? Can't create history record for the tool. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -10352,6 +10641,10 @@ Do you want to save your changes? Origin point + + Flipping by axis + + VToolFlippingByLine @@ -10363,6 +10656,10 @@ Do you want to save your changes? Second line point + + flipping by line + + VToolHeight @@ -10457,6 +10754,10 @@ Do you want to save your changes? Rotation origin point + + move + + VToolOptionsPropertyBrowser @@ -10961,6 +11262,10 @@ Do you want to save your changes? Rotation angle + + rotate + + VToolSeamAllowance @@ -12346,6 +12651,191 @@ Do you want to save your changes? Left symbol _ in the name + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VWidgetDetails @@ -12385,13 +12875,21 @@ Do you want to save your changes? Hide not in layout + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups - - Rename - - Delete למחוק @@ -12412,6 +12910,26 @@ Do you want to save your changes? Show All + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + + + + Categories: %1. + + Valentina diff --git a/share/translations/valentina_id_ID.ts b/share/translations/valentina_id_ID.ts index 357a7597d..7e5a2cad0 100644 --- a/share/translations/valentina_id_ID.ts +++ b/share/translations/valentina_id_ID.ts @@ -36,6 +36,13 @@ + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -1939,6 +1946,34 @@ Flipping by axis + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Rotation + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -1974,6 +2009,34 @@ Flipping by line + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Rotation + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -1985,10 +2048,6 @@ Group name: - - Unique pattern piece name - - Choose group name @@ -1997,6 +2056,18 @@ New group + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -2456,6 +2527,61 @@ + + DialogLayoutScale + + Layout scale + + + + Margins + + + + Left: + + + + cm + cm + + + Right: + + + + Top: + + + + Bottom: + + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -2652,6 +2778,14 @@ Apply settings anyway? Auto crop unused width + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -3044,6 +3178,34 @@ Apply settings anyway? Center point titik tengah + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Rotation + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -4417,6 +4579,30 @@ Apply settings anyway? This point cannot be origin point. Please, select another origin point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -4500,6 +4686,34 @@ Apply settings anyway? Orientation: + + Options + pilihan + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -7820,6 +8034,13 @@ This option will take an affect after restart. + + RenameGroup + + rename group + + + RenamePP @@ -9195,6 +9416,24 @@ Do you want to save your changes? Invalid version. Maximum supported format version is %1 + + Can't open file %1: +%2. + + + + Can't open schema file %1: +%2. + + + + Could not load schema file '%1'. + + + + Validation error file %3 in line %1 column %2 + + VAbstractCubicBezierPath @@ -9283,6 +9522,18 @@ Do you want to save your changes? Length panjang + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -9450,6 +9701,21 @@ Do you want to save your changes? + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -9832,6 +10098,26 @@ Do you want to save your changes? Auto crop unused width (export mode). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -9905,15 +10191,6 @@ Do you want to save your changes? %2. - - Can't open schema file %1: -%2. - - - - Validation error file %3 in line %1 column %2 - - Parsing error file %3 in line %1 column %2 @@ -9922,10 +10199,6 @@ Do you want to save your changes? Couldn't get node - - Could not load schema file '%1'. - - Fail to write Canonical XML. @@ -10490,6 +10763,14 @@ Do you want to save your changes? Can't create history record for the tool. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -10736,6 +11017,10 @@ Do you want to save your changes? Origin point + + Flipping by axis + + VToolFlippingByLine @@ -10747,6 +11032,10 @@ Do you want to save your changes? Second line point + + flipping by line + + VToolHeight @@ -10841,6 +11130,10 @@ Do you want to save your changes? Rotation origin point + + move + + VToolOptionsPropertyBrowser @@ -11357,6 +11650,10 @@ Do you want to save your changes? Rotation angle + + rotate + + VToolSeamAllowance @@ -12747,6 +13044,191 @@ Do you want to save your changes? Left symbol _ in the name + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VWidgetDetails @@ -12786,13 +13268,21 @@ Do you want to save your changes? Hide not in layout + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups - - Rename - - Delete hapus @@ -12813,6 +13303,26 @@ Do you want to save your changes? Show All + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + + + + Categories: %1. + + Valentina diff --git a/share/translations/valentina_it_IT.ts b/share/translations/valentina_it_IT.ts index 94ba8841e..d25c99035 100644 --- a/share/translations/valentina_it_IT.ts +++ b/share/translations/valentina_it_IT.ts @@ -50,6 +50,13 @@ Aggiungi dettagli di unione + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -2439,6 +2446,34 @@ Flipping by axis Ruotare sull'asse + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nome: + + + Rotation + Rotazione + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -2478,6 +2513,34 @@ Flipping by line Ruota sulla linea + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nome: + + + Rotation + Rotazione + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -2491,7 +2554,7 @@ Unique pattern piece name - Nome unico del pezzo del modello + Nome unico del pezzo del modello Choose group name @@ -2501,6 +2564,18 @@ New group Nuovo gruppo + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -3040,6 +3115,65 @@ Coefficiente di efficienza: %1% + + DialogLayoutScale + + Layout scale + + + + Margins + Margini + + + Left: + Sinistra: + + + cm + cm + + + Right: + Destra: + + + Top: + Top: + + + Bottom: + Fondo: + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -3341,6 +3475,14 @@ Applicare la configurazione comunque? Auto crop unused width + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -3753,6 +3895,34 @@ Applicare la configurazione comunque? Center point Punto centrale + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nome: + + + Rotation + Rotazione + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -5426,6 +5596,30 @@ Applicare la configurazione comunque? This point cannot be origin point. Please, select another origin point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nome: + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -5529,6 +5723,38 @@ Applicare la configurazione comunque? Orientation: Orientamento: + + Options + Opzioni + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -9555,6 +9781,13 @@ Questa opzione sarà effettiva dopo il riavvio del programma. Rimuovi oggetto dal gruppo + + RenameGroup + + rename group + + + RenamePP @@ -11215,6 +11448,25 @@ Vuoi salvare le tue modifiche? Invalid version. Maximum supported format version is %1 + + Can't open file %1: +%2. + Impossibile aprire file %1: +%2. + + + Can't open schema file %1: +%2. + + + + Could not load schema file '%1'. + + + + Validation error file %3 in line %1 column %2 + + VAbstractCubicBezierPath @@ -11303,6 +11555,18 @@ Vuoi salvare le tue modifiche? Length Lunghezza + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -11474,6 +11738,21 @@ Vuoi salvare le tue modifiche? + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -11944,6 +12223,26 @@ Vuoi salvare le tue modifiche? Auto crop unused width (export mode). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -12022,19 +12321,10 @@ Vuoi salvare le tue modifiche? Impossibile aprire file %1: %2. - - Can't open schema file %1: -%2. - - Could not load schema file. Impossibile caricare il file di schema - - Validation error file %3 in line %1 column %2 - - Parsing error file %3 in line %1 column %2 @@ -12047,10 +12337,6 @@ Vuoi salvare le tue modifiche? This id is not unique. Questo ID è già esistente. - - Could not load schema file '%1'. - - Fail to write Canonical XML. @@ -12642,6 +12928,14 @@ Vuoi salvare le tue modifiche? Can't create history record for the tool. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -12955,6 +13249,10 @@ Vuoi salvare le tue modifiche? Origin point Punto d'origine + + Flipping by axis + Ruotare sull'asse + VToolFlippingByLine @@ -12966,6 +13264,10 @@ Vuoi salvare le tue modifiche? Second line point Secondo punto della linea + + flipping by line + + VToolHeight @@ -13060,6 +13362,10 @@ Vuoi salvare le tue modifiche? Rotation origin point Ruota punto d'origine + + move + + VToolOptionsPropertyBrowser @@ -13652,6 +13958,10 @@ Vuoi salvare le tue modifiche? Rotation angle Angolo di rotazione + + rotate + + VToolSeamAllowance @@ -15106,6 +15416,191 @@ Vuoi salvare le tue modifiche? Left symbol _ in the name + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VVITConverter @@ -15167,12 +15662,24 @@ Vuoi salvare le tue modifiche? Hide not in layout + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups Rename - Rinomina + Rinomina Delete @@ -15194,6 +15701,26 @@ Vuoi salvare le tue modifiche? Show All + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + Preferenze + + + Categories: %1. + + Valentina diff --git a/share/translations/valentina_nl_NL.ts b/share/translations/valentina_nl_NL.ts index d53ef63fa..c1f374f3b 100644 --- a/share/translations/valentina_nl_NL.ts +++ b/share/translations/valentina_nl_NL.ts @@ -50,6 +50,13 @@ voeg een samengevoegd detail toe + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -2447,6 +2454,34 @@ Flipping by axis Kantelen via de aslijn + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Naam: + + + Rotation + Rotatie + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -2486,6 +2521,34 @@ Flipping by line Kantelen via de lijn + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Naam: + + + Rotation + Rotatie + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -2499,7 +2562,7 @@ Unique pattern piece name - Unieke patroondeel naam + Unieke patroondeel naam Choose group name @@ -2509,6 +2572,18 @@ New group Nieuwe groep + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -3048,6 +3123,65 @@ Efficiëntie coëfficiënt: %1% + + DialogLayoutScale + + Layout scale + + + + Margins + Marges + + + Left: + Links: + + + cm + cm + + + Right: + Rechts: + + + Top: + Bovenaan: + + + Bottom: + Onderaan: + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + % + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -3349,6 +3483,14 @@ Toch de instellingen aanpassen? Auto crop unused width Automatisch inkorten van ongebruikte breedte + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -3761,6 +3903,34 @@ Toch de instellingen aanpassen? Center point Middelpunt + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Naam: + + + Rotation + Rotatie + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -5434,6 +5604,30 @@ Toch de instellingen aanpassen? This point cannot be origin point. Please, select another origin point Dit punt kan geen startpunt zijn. Gelieve een ander startpunt te kiezen + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Naam: + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -5537,6 +5731,38 @@ Toch de instellingen aanpassen? Orientation: Orientatie: + + Options + Opties + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + % + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -9566,6 +9792,13 @@ Deze optie wordt actief na een herstart.. Verwijder item van groep + + RenameGroup + + rename group + + + RenamePP @@ -11230,6 +11463,26 @@ Wil je deze veranderingen opslaan? Invalid version. Maximum supported format version is %1 Ongeldige versie. Maximum ondersteund formaat is %1 + + Can't open file %1: +%2. + kan bestand niet openen %1: +%2. + + + Can't open schema file %1: +%2. + Kan schema bestand niet openen %1: +%2. + + + Could not load schema file '%1'. + Kan schema bestand niet laden '%1". + + + Validation error file %3 in line %1 column %2 + Validatie fout bestand %3 op lijn %1 kolom %2 + VAbstractCubicBezierPath @@ -11318,6 +11571,18 @@ Wil je deze veranderingen opslaan? Length Lengte + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -11489,6 +11754,21 @@ Wil je deze veranderingen opslaan? Ongeldige inkeping. + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -11991,6 +12271,26 @@ Wil je deze veranderingen opslaan? Auto crop unused width (export mode). Automatisch inkorten van ongebruikte breedte (export modus). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -12084,7 +12384,7 @@ Wil je deze veranderingen opslaan? Can't open schema file %1: %2. - Kan schema bestand niet openen %1: + Kan schema bestand niet openen %1: %2. @@ -12093,7 +12393,7 @@ Wil je deze veranderingen opslaan? Validation error file %3 in line %1 column %2 - Validatie fout bestand %3 op lijn %1 kolom %2 + Validatie fout bestand %3 op lijn %1 kolom %2 Parsing error file %3 in line %1 column %2 @@ -12121,7 +12421,7 @@ Wil je deze veranderingen opslaan? Could not load schema file '%1'. - Kan schema bestand niet laden '%1". + Kan schema bestand niet laden '%1". Fail to write Canonical XML. @@ -12714,6 +13014,14 @@ Wil je deze veranderingen opslaan? Can't create history record for the tool. Kan geen geschiedenis item voor dit gereedschap aanmaken. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -13031,6 +13339,10 @@ Wil je deze veranderingen opslaan? Origin point Startpunt + + Flipping by axis + Kantelen via de aslijn + VToolFlippingByLine @@ -13042,6 +13354,10 @@ Wil je deze veranderingen opslaan? Second line point Tweede lijnpunt + + flipping by line + + VToolHeight @@ -13136,6 +13452,10 @@ Wil je deze veranderingen opslaan? Rotation origin point Rotatie startpunt + + move + + VToolOptionsPropertyBrowser @@ -13736,6 +14056,10 @@ Wil je deze veranderingen opslaan? Rotation angle Hoek van draaiing + + rotate + + VToolSeamAllowance @@ -15235,6 +15559,191 @@ Wil je deze veranderingen opslaan? Left symbol _ in the name RotationElArc_ + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VVITConverter @@ -15296,6 +15805,18 @@ Wil je deze veranderingen opslaan? Hide not in layout Verberg niet in opmaak + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups @@ -15305,7 +15826,7 @@ Wil je deze veranderingen opslaan? Rename - Hernoem + Hernoem Delete @@ -15327,6 +15848,26 @@ Wil je deze veranderingen opslaan? Show All Vertoon Alles + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + Voorkeuren + + + Categories: %1. + + Valentina diff --git a/share/translations/valentina_pl_PL.ts b/share/translations/valentina_pl_PL.ts index 3543a96e8..ab5590421 100644 --- a/share/translations/valentina_pl_PL.ts +++ b/share/translations/valentina_pl_PL.ts @@ -50,6 +50,13 @@ dodaj szczegóły połaczenia + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -2263,6 +2270,34 @@ Flipping by axis + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nazwa: + + + Rotation + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -2302,6 +2337,34 @@ Flipping by line + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nazwa: + + + Rotation + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -2315,7 +2378,7 @@ Unique pattern piece name - Unikalna nazwa formy + Unikalna nazwa formy Choose group name @@ -2325,6 +2388,18 @@ New group Nowa grupa + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -2816,6 +2891,65 @@ + + DialogLayoutScale + + Layout scale + + + + Margins + Marginesy + + + Left: + Lewy: + + + cm + cm + + + Right: + Prawy: + + + Top: + + + + Bottom: + + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -3036,6 +3170,14 @@ Apply settings anyway? Auto crop unused width + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -3440,6 +3582,34 @@ Apply settings anyway? Center point Punkt środkowy + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nazwa: + + + Rotation + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -4926,6 +5096,30 @@ Apply settings anyway? This point cannot be origin point. Please, select another origin point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nazwa: + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -5009,6 +5203,38 @@ Apply settings anyway? Orientation: + + Options + Opcje + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -8598,6 +8824,13 @@ This option will take an affect after restart. Usuń element z grupy + + RenameGroup + + rename group + + + RenamePP @@ -10179,6 +10412,24 @@ Do you want to save your changes? Invalid version. Maximum supported format version is %1 + + Can't open file %1: +%2. + + + + Can't open schema file %1: +%2. + + + + Could not load schema file '%1'. + + + + Validation error file %3 in line %1 column %2 + + VAbstractCubicBezierPath @@ -10267,6 +10518,18 @@ Do you want to save your changes? Length Długość + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -10434,6 +10697,21 @@ Do you want to save your changes? + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -10816,6 +11094,26 @@ Do you want to save your changes? Auto crop unused width (export mode). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -10889,15 +11187,6 @@ Do you want to save your changes? %2. - - Can't open schema file %1: -%2. - - - - Validation error file %3 in line %1 column %2 - - Parsing error file %3 in line %1 column %2 @@ -10906,10 +11195,6 @@ Do you want to save your changes? Couldn't get node - - Could not load schema file '%1'. - - Fail to write Canonical XML. @@ -11489,6 +11774,14 @@ Do you want to save your changes? Can't create history record for the tool. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -11747,6 +12040,10 @@ Do you want to save your changes? Origin point + + Flipping by axis + + VToolFlippingByLine @@ -11758,6 +12055,10 @@ Do you want to save your changes? Second line point + + flipping by line + + VToolHeight @@ -11852,6 +12153,10 @@ Do you want to save your changes? Rotation origin point + + move + + VToolOptionsPropertyBrowser @@ -12380,6 +12685,10 @@ Do you want to save your changes? Rotation angle + + rotate + + VToolSeamAllowance @@ -13815,6 +14124,191 @@ Do you want to save your changes? Left symbol _ in the name + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VVITConverter @@ -13876,13 +14370,21 @@ Do you want to save your changes? Hide not in layout + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups - - Rename - - Delete Usuń @@ -13903,6 +14405,26 @@ Do you want to save your changes? Show All + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + Ustawienia + + + Categories: %1. + + Valentina diff --git a/share/translations/valentina_pt_BR.ts b/share/translations/valentina_pt_BR.ts index cd2c19ffc..cc9d6ee7a 100644 --- a/share/translations/valentina_pt_BR.ts +++ b/share/translations/valentina_pt_BR.ts @@ -50,6 +50,13 @@ Adicionar detalhes de ligação + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -2447,6 +2454,34 @@ Flipping by axis Espelhar através do eixo + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nome: + + + Rotation + Rotação + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -2486,6 +2521,34 @@ Flipping by line Espelhar através de linha + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nome: + + + Rotation + Rotação + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -2499,7 +2562,7 @@ Unique pattern piece name - Nome único da peça de molde + Nome único da peça de molde Choose group name @@ -2509,6 +2572,18 @@ New group Novo grupo + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -3048,6 +3123,65 @@ + + DialogLayoutScale + + Layout scale + + + + Margins + Margens + + + Left: + Esquerda: + + + cm + cm + + + Right: + Direita: + + + Top: + Topo: + + + Bottom: + Base: + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -3345,6 +3479,14 @@ Aplicar configurações de qualquer forma? Auto crop unused width + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -3757,6 +3899,34 @@ Aplicar configurações de qualquer forma? Center point Ponto central + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nome: + + + Rotation + Rotação + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -5430,6 +5600,30 @@ Aplicar configurações de qualquer forma? This point cannot be origin point. Please, select another origin point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Nome: + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -5529,6 +5723,38 @@ Aplicar configurações de qualquer forma? Orientation: Orientação: + + Options + Opções + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -9543,6 +9769,13 @@ Esta opção terá um efeito após o reinício. + + RenameGroup + + rename group + + + RenamePP @@ -11203,6 +11436,26 @@ Deseja salvar suas mudanças? Invalid version. Maximum supported format version is %1 Versão inválida. O formato da versão máxima suportado é %1 + + Can't open file %1: +%2. + Impossível abrir o arquivo %1: +%2. + + + Can't open schema file %1: +%2. + Impossível abrir o arquivo de esquema %1: +%2. + + + Could not load schema file '%1'. + + + + Validation error file %3 in line %1 column %2 + Arquivo de erro de validação %3 na linha %1 coluna %2 + VAbstractCubicBezierPath @@ -11291,6 +11544,18 @@ Deseja salvar suas mudanças? Length Comprimento + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -11462,6 +11727,21 @@ Deseja salvar suas mudanças? + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -11932,6 +12212,26 @@ Deseja salvar suas mudanças? Auto crop unused width (export mode). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -12025,7 +12325,7 @@ Deseja salvar suas mudanças? Can't open schema file %1: %2. - Impossível abrir o arquivo de esquema %1: + Impossível abrir o arquivo de esquema %1: %2. @@ -12034,7 +12334,7 @@ Deseja salvar suas mudanças? Validation error file %3 in line %1 column %2 - Arquivo de erro de validação %3 na linha %1 coluna %2 + Arquivo de erro de validação %3 na linha %1 coluna %2 Parsing error file %3 in line %1 column %2 @@ -12048,10 +12348,6 @@ Deseja salvar suas mudanças? Got wrong parameter id. Need only id > 0. Obteve parâmetro de identidade errado. Permitido somente Identidade > 0. - - Could not load schema file '%1'. - - Fail to write Canonical XML. @@ -12643,6 +12939,14 @@ Deseja salvar suas mudanças? Can't create history record for the tool. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -12960,6 +13264,10 @@ Deseja salvar suas mudanças? Origin point Ponto de origem + + Flipping by axis + Espelhar através do eixo + VToolFlippingByLine @@ -12971,6 +13279,10 @@ Deseja salvar suas mudanças? Second line point Segundo ponto da linha + + flipping by line + + VToolHeight @@ -13065,6 +13377,10 @@ Deseja salvar suas mudanças? Rotation origin point Rotação do ponto de origem + + move + + VToolOptionsPropertyBrowser @@ -13665,6 +13981,10 @@ Deseja salvar suas mudanças? Rotation angle Ângulo de rotação + + rotate + + VToolSeamAllowance @@ -15119,6 +15439,191 @@ Deseja salvar suas mudanças? Left symbol _ in the name + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VVITConverter @@ -15180,6 +15685,18 @@ Deseja salvar suas mudanças? Hide not in layout + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups @@ -15189,7 +15706,7 @@ Deseja salvar suas mudanças? Rename - Renomear + Renomear Delete @@ -15211,6 +15728,26 @@ Deseja salvar suas mudanças? Show All + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + Preferências + + + Categories: %1. + + Valentina diff --git a/share/translations/valentina_ro_RO.ts b/share/translations/valentina_ro_RO.ts index 23bdd373b..b3ca87679 100644 --- a/share/translations/valentina_ro_RO.ts +++ b/share/translations/valentina_ro_RO.ts @@ -50,6 +50,13 @@ adauga detalii ale Uniunii + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -2228,6 +2235,34 @@ Flipping by axis + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Rotation + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -2263,6 +2298,34 @@ Flipping by line + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Rotation + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -2274,10 +2337,6 @@ Group name: - - Unique pattern piece name - - Choose group name @@ -2286,6 +2345,18 @@ New group + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -2801,6 +2872,65 @@ + + DialogLayoutScale + + Layout scale + + + + Margins + + + + Left: + + + + cm + cm + + + Right: + + + + Top: + + + + Bottom: + + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -3025,6 +3155,14 @@ Apply settings anyway? Auto crop unused width + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -3433,6 +3571,34 @@ Apply settings anyway? Center point Punct central + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Rotation + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -4883,6 +5049,30 @@ Apply settings anyway? This point cannot be origin point. Please, select another origin point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -4966,6 +5156,38 @@ Apply settings anyway? Orientation: + + Options + Opțiuni + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -8486,6 +8708,13 @@ This option will take an affect after restart. + + RenameGroup + + rename group + + + RenamePP @@ -9932,6 +10161,24 @@ Do you want to save your changes? Invalid version. Maximum supported format version is %1 + + Can't open file %1: +%2. + + + + Can't open schema file %1: +%2. + + + + Could not load schema file '%1'. + + + + Validation error file %3 in line %1 column %2 + + VAbstractCubicBezierPath @@ -10020,6 +10267,18 @@ Do you want to save your changes? Length Lungime + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -10187,6 +10446,21 @@ Do you want to save your changes? + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -10569,6 +10843,26 @@ Do you want to save your changes? Auto crop unused width (export mode). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -10642,15 +10936,6 @@ Do you want to save your changes? %2. - - Can't open schema file %1: -%2. - - - - Validation error file %3 in line %1 column %2 - - Parsing error file %3 in line %1 column %2 @@ -10659,10 +10944,6 @@ Do you want to save your changes? Couldn't get node - - Could not load schema file '%1'. - - Fail to write Canonical XML. @@ -11231,6 +11512,14 @@ Do you want to save your changes? Can't create history record for the tool. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -11477,6 +11766,10 @@ Do you want to save your changes? Origin point + + Flipping by axis + + VToolFlippingByLine @@ -11488,6 +11781,10 @@ Do you want to save your changes? Second line point Al doilea Punct de linie + + flipping by line + + VToolHeight @@ -11582,6 +11879,10 @@ Do you want to save your changes? Rotation origin point + + move + + VToolOptionsPropertyBrowser @@ -12110,6 +12411,10 @@ Do you want to save your changes? Rotation angle + + rotate + + VToolSeamAllowance @@ -13535,6 +13840,191 @@ Do you want to save your changes? Left symbol _ in the name + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VWidgetDetails @@ -13574,13 +14064,21 @@ Do you want to save your changes? Hide not in layout + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups - - Rename - - Delete Șterge @@ -13601,6 +14099,26 @@ Do you want to save your changes? Show All + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + Preferințe + + + Categories: %1. + + Valentina diff --git a/share/translations/valentina_ru_RU.ts b/share/translations/valentina_ru_RU.ts index 53738b7e6..61e8f5006 100644 --- a/share/translations/valentina_ru_RU.ts +++ b/share/translations/valentina_ru_RU.ts @@ -50,6 +50,13 @@ добавить объединение деталей + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -2447,6 +2454,34 @@ Flipping by axis Отразить объект по оси + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Rotation + Поворот + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -2486,6 +2521,34 @@ Flipping by line Отразить объект по линии + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Rotation + Поворот + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -2499,7 +2562,7 @@ Unique pattern piece name - Уникальное имя выкройки + Уникальное имя выкройки Choose group name @@ -2509,6 +2572,18 @@ New group Новая группа + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -3048,6 +3123,65 @@ Коэффициент эффективности: %1% + + DialogLayoutScale + + Layout scale + + + + Margins + Поля + + + Left: + Левое: + + + cm + см + + + Right: + Правое: + + + Top: + Верхнее: + + + Bottom: + Нижнее: + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -3349,6 +3483,14 @@ Apply settings anyway? Auto crop unused width Автоматически обрезать неиспользуемую ширину + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -3761,6 +3903,34 @@ Apply settings anyway? Center point Центральная точка + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Rotation + Поворот + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -5435,6 +5605,30 @@ Apply settings anyway? This point cannot be origin point. Please, select another origin point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -5538,6 +5732,38 @@ Apply settings anyway? Orientation: Ориентация: + + Options + + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -9568,6 +9794,13 @@ This option will take an affect after restart. Удалить объект из группы + + RenameGroup + + rename group + + + RenamePP @@ -11232,6 +11465,26 @@ Do you want to save your changes? Invalid version. Maximum supported format version is %1 Недействительная версия. Максимально поддерживаемая версия формата %1 + + Can't open file %1: +%2. + Невозможно открыть файл %1: +%2. + + + Can't open schema file %1: +%2. + Невозможно открыть файл схемы %1: +%2. + + + Could not load schema file '%1'. + Не удалось открыть файл схемы '%1'. + + + Validation error file %3 in line %1 column %2 + Ошибка валидации файла %3 в строке %1 столбца %2 + VAbstractCubicBezierPath @@ -11320,6 +11573,18 @@ Do you want to save your changes? Length Длина + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -11491,6 +11756,21 @@ Do you want to save your changes? Неправильная надсечка. + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -11993,6 +12273,26 @@ Do you want to save your changes? Auto crop unused width (export mode). Автоматическая обрезка неиспользуемой ширины (режим экспорта). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -12086,7 +12386,7 @@ Do you want to save your changes? Can't open schema file %1: %2. - Невозможно открыть файл схемы %1: + Невозможно открыть файл схемы %1: %2. @@ -12095,7 +12395,7 @@ Do you want to save your changes? Validation error file %3 in line %1 column %2 - Ошибка валидации файла %3 в строке %1 столбца %2 + Ошибка валидации файла %3 в строке %1 столбца %2 Parsing error file %3 in line %1 column %2 @@ -12123,7 +12423,7 @@ Do you want to save your changes? Could not load schema file '%1'. - Не удалось открыть файл схемы '%1'. + Не удалось открыть файл схемы '%1'. Fail to write Canonical XML. @@ -12716,6 +13016,14 @@ Do you want to save your changes? Can't create history record for the tool. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -13033,6 +13341,10 @@ Do you want to save your changes? Origin point Исходная точка + + Flipping by axis + Отразить объект по оси + VToolFlippingByLine @@ -13044,6 +13356,10 @@ Do you want to save your changes? Second line point Вторая точка линии + + flipping by line + + VToolHeight @@ -13138,6 +13454,10 @@ Do you want to save your changes? Rotation origin point Исходная точка вращения + + move + + VToolOptionsPropertyBrowser @@ -13738,6 +14058,10 @@ Do you want to save your changes? Rotation angle Угол вращения + + rotate + + VToolSeamAllowance @@ -15242,6 +15566,191 @@ Do you want to save your changes? Left symbol _ in the name ВращениеЭлДуга_ + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VVITConverter @@ -15303,6 +15812,18 @@ Do you want to save your changes? Hide not in layout Скрыть не в раскладке + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups @@ -15312,7 +15833,7 @@ Do you want to save your changes? Rename - Переименовать + Переименовать Delete @@ -15334,6 +15855,26 @@ Do you want to save your changes? Show All Показать все + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + + + + Categories: %1. + + Valentina diff --git a/share/translations/valentina_uk_UA.ts b/share/translations/valentina_uk_UA.ts index 23f445a34..45c6231e7 100644 --- a/share/translations/valentina_uk_UA.ts +++ b/share/translations/valentina_uk_UA.ts @@ -50,6 +50,13 @@ додати об'єднання деталей + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -2447,6 +2454,34 @@ Flipping by axis Відзеркалити по вісі + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Імя: + + + Rotation + Поворот + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -2486,6 +2521,34 @@ Flipping by line Відзеркалити по лінії + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Імя: + + + Rotation + Поворот + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -2499,7 +2562,7 @@ Unique pattern piece name - Унікальне ім'я лекала + Унікальне ім'я лекала Choose group name @@ -2509,6 +2572,18 @@ New group Нова група + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -3048,6 +3123,65 @@ + + DialogLayoutScale + + Layout scale + + + + Margins + + + + Left: + Ліве: + + + cm + см + + + Right: + Праве: + + + Top: + Верхнє: + + + Bottom: + Нижнє: + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -3347,6 +3481,14 @@ Apply settings anyway? Auto crop unused width + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -3759,6 +3901,34 @@ Apply settings anyway? Center point Точка центру + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Імя: + + + Rotation + Поворот + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -5433,6 +5603,30 @@ Apply settings anyway? This point cannot be origin point. Please, select another origin point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + Імя: + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -5536,6 +5730,38 @@ Apply settings anyway? Orientation: + + Options + Параметри + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + ... + ... + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -9561,6 +9787,13 @@ This option will take an affect after restart. + + RenameGroup + + rename group + + + RenamePP @@ -11225,6 +11458,25 @@ Do you want to save your changes? Invalid version. Maximum supported format version is %1 + + Can't open file %1: +%2. + Не можу відкрити файл%1: +%2. + + + Can't open schema file %1: +%2. + Не можу відкрити файл схеми %1:\n%2. + + + Could not load schema file '%1'. + Не вдалося завантажити файл схеми '%1'. + + + Validation error file %3 in line %1 column %2 + Помилка валідації файлу %3 в рядку %1 стовпця %2 + VAbstractCubicBezierPath @@ -11313,6 +11565,18 @@ Do you want to save your changes? Length Довжина + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -11484,6 +11748,21 @@ Do you want to save your changes? + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -11986,6 +12265,26 @@ Do you want to save your changes? Auto crop unused width (export mode). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -12079,7 +12378,7 @@ Do you want to save your changes? Can't open schema file %1: %2. - Не можу відкрити файл схеми %1:\n%2. + Не можу відкрити файл схеми %1:\n%2. Could not load schema file. @@ -12087,7 +12386,7 @@ Do you want to save your changes? Validation error file %3 in line %1 column %2 - Помилка валідації файлу %3 в рядку %1 стовпця %2 + Помилка валідації файлу %3 в рядку %1 стовпця %2 Parsing error file %3 in line %1 column %2 @@ -12115,7 +12414,7 @@ Do you want to save your changes? Could not load schema file '%1'. - Не вдалося завантажити файл схеми '%1'. + Не вдалося завантажити файл схеми '%1'. Fail to write Canonical XML. @@ -12708,6 +13007,14 @@ Do you want to save your changes? Can't create history record for the tool. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -13025,6 +13332,10 @@ Do you want to save your changes? Origin point + + Flipping by axis + Відзеркалити по вісі + VToolFlippingByLine @@ -13036,6 +13347,10 @@ Do you want to save your changes? Second line point Друга точка лінії + + flipping by line + + VToolHeight @@ -13130,6 +13445,10 @@ Do you want to save your changes? Rotation origin point + + move + + VToolOptionsPropertyBrowser @@ -13730,6 +14049,10 @@ Do you want to save your changes? Rotation angle + + rotate + + VToolSeamAllowance @@ -15229,6 +15552,191 @@ Do you want to save your changes? Left symbol _ in the name + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VVITConverter @@ -15290,6 +15798,18 @@ Do you want to save your changes? Hide not in layout + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups @@ -15299,7 +15819,7 @@ Do you want to save your changes? Rename - Перейменувати + Перейменувати Delete @@ -15321,6 +15841,26 @@ Do you want to save your changes? Show All + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + Властивості + + + Categories: %1. + + Valentina diff --git a/share/translations/valentina_zh_CN.ts b/share/translations/valentina_zh_CN.ts index 3b04f2cc7..b5acb1a29 100644 --- a/share/translations/valentina_zh_CN.ts +++ b/share/translations/valentina_zh_CN.ts @@ -50,6 +50,13 @@ 添加合成细节 + + ChangeGroupOptions + + rename group + + + ChangeGroupVisibility @@ -1820,6 +1827,34 @@ Flipping by axis + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Rotation + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogFlippingByLine @@ -1855,6 +1890,34 @@ Flipping by line + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Rotation + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogGroup @@ -1866,10 +1929,6 @@ Group name: - - Unique pattern piece name - - Choose group name @@ -1878,6 +1937,18 @@ New group + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogHeight @@ -2329,6 +2400,61 @@ + + DialogLayoutScale + + Layout scale + + + + Margins + + + + Left: + + + + cm + + + + Right: + + + + Top: + + + + Bottom: + + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + DialogLayoutSettings @@ -2533,6 +2659,14 @@ Apply settings anyway? Auto crop unused width + + Enable this option to prefer getting one sheet solutions. + + + + Prefer one sheet solution + + DialogLine @@ -2909,6 +3043,34 @@ Apply settings anyway? Center point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Rotation + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogNewMeasurements @@ -4194,6 +4356,30 @@ Apply settings anyway? This point cannot be origin point. Please, select another origin point + + Enable to create a visibility gropup from original objects + + + + Visibility Group + + + + Name: + + + + Tags: + + + + Separate each tag with comma. + + + + Add tags + + DialogSaveLAyout @@ -4277,6 +4463,34 @@ Apply settings anyway? Orientation: + + Options + + + + Scale + + + + Horizontal: + + + + Vertical: + + + + % + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + DialogSaveLayout @@ -7606,6 +7820,13 @@ This option will take an affect after restart. + + RenameGroup + + rename group + + + RenamePP @@ -9016,6 +9237,24 @@ Do you want to save your changes? Invalid version. Maximum supported format version is %1 + + Can't open file %1: +%2. + + + + Can't open schema file %1: +%2. + + + + Could not load schema file '%1'. + + + + Validation error file %3 in line %1 column %2 + + VAbstractCubicBezierPath @@ -9104,6 +9343,18 @@ Do you want to save your changes? Length 长度 + + operation options + + + + delete operation + + + + Visibility group + + VAbstractPattern @@ -9271,6 +9522,21 @@ Do you want to save your changes? + + VBank + + Preparing data for layout error: Detail '%1' square <= 0 + + + + Preparing data for layout error: Layout paper sheet <= 0 + + + + Preparing data for layout error: List of details is empty + + + VCommandLine @@ -9649,6 +9915,26 @@ Do you want to save your changes? Auto crop unused width (export mode). + + Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Horizontal scale + + + + Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). + + + + Vertical scale + + + + Prefer one sheet layout solution (export mode). + + VCommonSettings @@ -9722,15 +10008,6 @@ Do you want to save your changes? %2. - - Can't open schema file %1: -%2. - - - - Validation error file %3 in line %1 column %2 - - Parsing error file %3 in line %1 column %2 @@ -9739,10 +10016,6 @@ Do you want to save your changes? Couldn't get node - - Could not load schema file '%1'. - - Fail to write Canonical XML. @@ -10307,6 +10580,14 @@ Do you want to save your changes? Can't create history record for the tool. + + Reading final measurements error. + + + + Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + VPiece @@ -10549,6 +10830,10 @@ Do you want to save your changes? Origin point + + Flipping by axis + + VToolFlippingByLine @@ -10560,6 +10845,10 @@ Do you want to save your changes? Second line point + + flipping by line + + VToolHeight @@ -10654,6 +10943,10 @@ Do you want to save your changes? Rotation origin point + + move + + VToolOptionsPropertyBrowser @@ -11158,6 +11451,10 @@ Do you want to save your changes? Rotation angle + + rotate + + VToolSeamAllowance @@ -12543,6 +12840,191 @@ Do you want to save your changes? Left symbol _ in the name + + converts degrees to radian + functionm degTorad + + + + converts radian to degrees + function radTodeg + + + + sine function working with radians + function sin + + + + cosine function working with radians + function cos + + + + tangens function working with radians + function tan + + + + arcus sine function working with radians + function asin + + + + arcus cosine function working with radians + function acos + + + + arcus tangens function working with radians + function atan + + + + hyperbolic sine function + function sinh + + + + hyperbolic cosine + function cosh + + + + hyperbolic tangens function + function tanh + + + + hyperbolic arcus sine function + function asinh + + + + hyperbolic arcus cosine function + function acosh + + + + hyperbolic arcur tangens function + function atanh + + + + sine function working with degrees + function sinD + + + + cosine function working with degrees + function cosD + + + + tangens function working with degrees + function tanD + + + + arcus sine function working with degrees + function asinD + + + + arcus cosine function working with degrees + function acosD + + + + arcus tangens function working with degrees + function atanD + + + + logarithm to the base 2 + function log2 + + + + logarithm to the base 10 + function log10 + + + + logarithm to the base 10 + function log + + + + logarithm to base e (2.71828...) + function ln + + + + e raised to the power of x + function exp + + + + square root of a value + function sqrt + + + + sign function -1 if x<0; 1 if x>0 + function sign + + + + round to nearest integer + function rint + + + + round to up to 1 decimal + function r2cm + + + + cut, split and rotate modeling operation. Takes cm units. + function csrCm + + + + cut, split and rotate modeling operation. Takes inch units. + function csrInch + + + + absolute value + function abs + + + + min of all arguments + function min + + + + max of all arguments + function max + + + + sum of all arguments + function sum + + + + mean value of all arguments + function avg + + + + Returns the floating-point remainder of numer/denom (rounded towards zero) + function fmod + + VWidgetDetails @@ -12582,13 +13064,21 @@ Do you want to save your changes? Hide not in layout + + Piece options + + + + Delete piece + + + + Cannot find piece by id '%1' + + VWidgetGroups - - Rename - - Delete 删除 @@ -12609,6 +13099,26 @@ Do you want to save your changes? Show All + + Tags: + + + + Separate each tag with comma. + + + + Filter by tags + + + + Preferences + + + + Categories: %1. + + Valentina diff --git a/src/app/valentina/core/vapplication.cpp b/src/app/valentina/core/vapplication.cpp index 6b31f0724..493a5392e 100644 --- a/src/app/valentina/core/vapplication.cpp +++ b/src/app/valentina/core/vapplication.cpp @@ -172,6 +172,10 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con vStdErr() << QApplication::translate("vNoisyHandler", "WARNING:") << logMsg << "\n"; break; case QtCriticalMsg: + if (isPatternMessage) + { + qApp->PostPatternMessage(logMsg, type); + } debugdate += QStringLiteral(":CRITICAL:%1(%2)] %3: %4: %5").arg(context.file).arg(context.line) .arg(context.function, context.category, logMsg); vStdErr() << QApplication::translate("vNoisyHandler", "CRITICAL:") << logMsg << "\n"; diff --git a/src/app/valentina/core/vcmdexport.cpp b/src/app/valentina/core/vcmdexport.cpp index b58f8f33e..e608db6c7 100644 --- a/src/app/valentina/core/vcmdexport.cpp +++ b/src/app/valentina/core/vcmdexport.cpp @@ -204,6 +204,7 @@ VLayoutGeneratorPtr VCommandLine::DefaultGenerator() const diag.SetAutoCropWidth(IsOptionSet(LONG_OPTION_CROP_WIDTH)); diag.SetUnitePages(IsOptionSet(LONG_OPTION_UNITE)); diag.SetSaveLength(IsOptionSet(LONG_OPTION_SAVELENGTH)); + diag.SetPreferOneSheetSolution(IsOptionSet(LONG_OPTION_PREFER_ONE_SHEET_SOLUTION)); diag.SetGroup(OptGroup()); if (IsOptionSet(LONG_OPTION_IGNORE_MARGINS)) @@ -408,6 +409,28 @@ bool VCommandLine::IsCSVWithHeader() const return IsOptionSet(LONG_OPTION_CSVWITHHEADER); } +//--------------------------------------------------------------------------------------------------------------------- +qreal VCommandLine::ExportXScale() const +{ + qreal xs = 0; + if (IsOptionSet(LONG_OPTION_EXPXSCALE)) + { + xs = OptionValue(LONG_OPTION_EXPXSCALE).toDouble(); + } + return xs; +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal VCommandLine::ExportYScale() const +{ + qreal ys = 0; + if (IsOptionSet(LONG_OPTION_EXPYSCALE)) + { + ys = OptionValue(LONG_OPTION_EXPYSCALE).toDouble(); + } + return ys; +} + //--------------------------------------------------------------------------------------------------------------------- QString VCommandLine::OptExportSuchDetails() const { @@ -664,6 +687,12 @@ void VCommandLine::InitCommandLineOptions() translate("VCommandLine", "Page bottom margin in current units like 3.0 (export mode). If not set will be " "used value from default printer. Or 0 if none printers was found."), translate("VCommandLine", "The bottom margin")}, + {LONG_OPTION_EXPXSCALE, + translate("VCommandLine", "Set horizontal scale factor from 0.01 to 3.0 (default = 1.0, export mode)."), + translate("VCommandLine", "Horizontal scale")}, + {LONG_OPTION_EXPYSCALE, + translate("VCommandLine", "Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode)."), + translate("VCommandLine", "Vertical scale")}, //================================================================================================================= {LONG_OPTION_FOLLOW_GRAINLINE, translate("VCommandLine", "Order detail to follow grainline direction (export mode).")}, @@ -678,6 +707,8 @@ void VCommandLine::InitCommandLineOptions() {{SINGLE_OPTION_UNITE, LONG_OPTION_UNITE}, translate("VCommandLine", "Unite pages if possible (export mode). Maximum value limited by QImage that " "supports only a maximum of 32768x32768 px images.")}, + {LONG_OPTION_PREFER_ONE_SHEET_SOLUTION, + translate("VCommandLine", "Prefer one sheet layout solution (export mode).")}, //================================================================================================================= {{SINGLE_OPTION_SAVELENGTH, LONG_OPTION_SAVELENGTH}, translate("VCommandLine", "Save length of the sheet if set (export mode). The option tells the program to use " diff --git a/src/app/valentina/core/vcmdexport.h b/src/app/valentina/core/vcmdexport.h index a89f0bf4c..b4b8057b7 100644 --- a/src/app/valentina/core/vcmdexport.h +++ b/src/app/valentina/core/vcmdexport.h @@ -88,6 +88,9 @@ public: bool IsExportOnlyDetails() const; bool IsCSVWithHeader() const; + qreal ExportXScale() const; + qreal ExportYScale() const; + //@brief returns the piece name regex or empty string if not set QString OptExportSuchDetails() const; diff --git a/src/app/valentina/dialogs/dialoghistory.cpp b/src/app/valentina/dialogs/dialoghistory.cpp index 7d8f1fb37..ec6c1ce22 100644 --- a/src/app/valentina/dialogs/dialoghistory.cpp +++ b/src/app/valentina/dialogs/dialoghistory.cpp @@ -40,7 +40,10 @@ #include "../vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.h" #include "../xml/vpattern.h" #include "../vmisc/diagnostic.h" + #include +#include +#include //--------------------------------------------------------------------------------------------------------------------- /** @@ -165,26 +168,30 @@ void DialogHistory::FillTable() qint32 currentRow = -1; qint32 count = 0; ui->tableWidget->setRowCount(history.size());//Make row count max possible number - for (qint32 i = 0; i< history.size(); ++i) + + std::function CreateRecord = [this](const VToolRecord &tool) { - const VToolRecord tool = history.at(i); - const QString historyRecord = Record(tool); - if (not historyRecord.isEmpty()) + return Record(tool); + }; + + QVector historyRecords = QtConcurrent::blockingMapped(history, CreateRecord); + + for (auto &record : historyRecords) + { + if (not record.description.isEmpty()) { currentRow++; { QTableWidgetItem *item = new QTableWidgetItem(QString()); item->setTextAlignment(Qt::AlignHCenter); - item->setData(Qt::UserRole, tool.getId()); + item->setData(Qt::UserRole, record.id); item->setFlags(item->flags() ^ Qt::ItemIsEditable); ui->tableWidget->setItem(currentRow, 0, item); } - QTableWidgetItem *item = new QTableWidgetItem(historyRecord); - QFont font = item->font(); - font.setBold(true); - item->setFont(font); + QTableWidgetItem *item = new QTableWidgetItem(record.description); + item->setFont(QFont("Times", 12, QFont::Bold)); item->setFlags(item->flags() ^ Qt::ItemIsEditable); ui->tableWidget->setItem(currentRow, 1, item); ++count; @@ -211,16 +218,20 @@ QT_WARNING_DISABLE_GCC("-Wswitch-default") * @param tool record data * @return description */ -QString DialogHistory::Record(const VToolRecord &tool) +HistoryRecord DialogHistory::Record(const VToolRecord &tool) const { // This check helps to find missed tools in the switch Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 55, "Not all tools were used in history."); - const QDomElement domElem = doc->elementById(tool.getId()); + HistoryRecord record; + record.id = tool.getId(); + + bool updateCache = false; + const QDomElement domElem = doc->elementById(tool.getId(), QString(), updateCache); if (domElem.isElement() == false) { - qDebug()<<"Can't find element by id"< spl = data->GeometricObject(tool.getId()); SCASSERT(not spl.isNull()) - return spl->NameForHistory(tr("Curve")); + record.description = spl->NameForHistory(tr("Curve")); + return record; } case Tool::CubicBezier: { const QSharedPointer spl = data->GeometricObject(tool.getId()); SCASSERT(not spl.isNull()) - return spl->NameForHistory(tr("Cubic bezier curve")); + record.description = spl->NameForHistory(tr("Cubic bezier curve")); + return record; } case Tool::Arc: { const QSharedPointer arc = data->GeometricObject(tool.getId()); SCASSERT(not arc.isNull()) - return arc->NameForHistory(tr("Arc")); + record.description = arc->NameForHistory(tr("Arc")); + return record; } case Tool::ArcWithLength: { const QSharedPointer arc = data->GeometricObject(tool.getId()); SCASSERT(not arc.isNull()) - return tr("%1 with length %2") - .arg(arc->NameForHistory(tr("Arc"))) - .arg(arc->GetLength()); + record.description = tr("%1 with length %2") + .arg(arc->NameForHistory(tr("Arc"))) + .arg(arc->GetLength()); + return record; } case Tool::SplinePath: { const QSharedPointer splPath = data->GeometricObject(tool.getId()); SCASSERT(not splPath.isNull()) - return splPath->NameForHistory(tr("Spline path")); + record.description = splPath->NameForHistory(tr("Spline path")); + return record; } case Tool::CubicBezierPath: { const QSharedPointer splPath = data->GeometricObject(tool.getId()); SCASSERT(not splPath.isNull()) - return splPath->NameForHistory(tr("Cubic bezier curve path")); + record.description = splPath->NameForHistory(tr("Cubic bezier curve path")); + return record; } case Tool::PointOfContact: - return tr("%4 - point of contact of arc with the center in point %1 and line %2_%3") - .arg(PointName(AttrUInt(domElem, AttrCenter)), - PointName(AttrUInt(domElem, AttrFirstPoint)), - PointName(AttrUInt(domElem, AttrSecondPoint)), - PointName(tool.getId())); + record.description = tr("%4 - point of contact of arc with the center in point %1 and line %2_%3") + .arg(PointName(AttrUInt(domElem, AttrCenter)), + PointName(AttrUInt(domElem, AttrFirstPoint)), + PointName(AttrUInt(domElem, AttrSecondPoint)), + PointName(tool.getId())); + return record; case Tool::Height: - return tr("Point of perpendicular from point %1 to line %2_%3") - .arg(PointName(AttrUInt(domElem, AttrBasePoint)), - PointName(AttrUInt(domElem, AttrP1Line)), - PointName(AttrUInt(domElem, AttrP2Line))); + record.description = tr("Point of perpendicular from point %1 to line %2_%3") + .arg(PointName(AttrUInt(domElem, AttrBasePoint)), + PointName(AttrUInt(domElem, AttrP1Line)), + PointName(AttrUInt(domElem, AttrP2Line))); + return record; case Tool::Triangle: - return tr("Triangle: axis %1_%2, points %3 and %4") - .arg(PointName(AttrUInt(domElem, AttrAxisP1)), - PointName(AttrUInt(domElem, AttrAxisP2)), - PointName(AttrUInt(domElem, AttrFirstPoint)), - PointName(AttrUInt(domElem, AttrSecondPoint))); + record.description = tr("Triangle: axis %1_%2, points %3 and %4") + .arg(PointName(AttrUInt(domElem, AttrAxisP1)), + PointName(AttrUInt(domElem, AttrAxisP2)), + PointName(AttrUInt(domElem, AttrFirstPoint)), + PointName(AttrUInt(domElem, AttrSecondPoint))); + return record; case Tool::PointOfIntersection: - return tr("%1 - point of intersection %2 and %3") - .arg(PointName(tool.getId()), - PointName(AttrUInt(domElem, AttrFirstPoint)), - PointName(AttrUInt(domElem, AttrSecondPoint))); + record.description = tr("%1 - point of intersection %2 and %3") + .arg(PointName(tool.getId()), + PointName(AttrUInt(domElem, AttrFirstPoint)), + PointName(AttrUInt(domElem, AttrSecondPoint))); + return record; case Tool::CutArc: { const QSharedPointer arc = data->GeometricObject(AttrUInt(domElem, AttrArc)); SCASSERT(not arc.isNull()) - return tr("%1 - cut %2") - .arg(PointName(tool.getId()), arc->NameForHistory(tr("arc"))); + record.description = tr("%1 - cut %2") + .arg(PointName(tool.getId()), arc->NameForHistory(tr("arc"))); + return record; } case Tool::CutSpline: { const quint32 splineId = AttrUInt(domElem, VToolCutSpline::AttrSpline); const QSharedPointer spl = data->GeometricObject(splineId); SCASSERT(not spl.isNull()) - return tr("%1 - cut %2") - .arg(PointName(tool.getId()), spl->NameForHistory(tr("curve"))); + record.description = tr("%1 - cut %2") + .arg(PointName(tool.getId()), spl->NameForHistory(tr("curve"))); + return record; } case Tool::CutSplinePath: { @@ -349,56 +380,71 @@ QString DialogHistory::Record(const VToolRecord &tool) const QSharedPointer splPath = data->GeometricObject(splinePathId); SCASSERT(not splPath.isNull()) - return tr("%1 - cut %2") - .arg(PointName(tool.getId()), splPath->NameForHistory(tr("curve path"))); + record.description = tr("%1 - cut %2") + .arg(PointName(tool.getId()), splPath->NameForHistory(tr("curve path"))); + return record; } case Tool::LineIntersectAxis: - return tr("%1 - point of intersection line %2_%3 and axis through point %4") - .arg(PointName(tool.getId()), - PointName(AttrUInt(domElem, AttrP1Line)), - PointName(AttrUInt(domElem, AttrP2Line)), - PointName(AttrUInt(domElem, AttrBasePoint))); + record.description = tr("%1 - point of intersection line %2_%3 and axis through point %4") + .arg(PointName(tool.getId()), + PointName(AttrUInt(domElem, AttrP1Line)), + PointName(AttrUInt(domElem, AttrP2Line)), + PointName(AttrUInt(domElem, AttrBasePoint))); + return record; case Tool::CurveIntersectAxis: - return tr("%1 - point of intersection curve and axis through point %2") - .arg(PointName(tool.getId()), PointName(AttrUInt(domElem, AttrBasePoint))); + record.description = tr("%1 - point of intersection curve and axis through point %2") + .arg(PointName(tool.getId()), PointName(AttrUInt(domElem, AttrBasePoint))); + return record; case Tool::PointOfIntersectionArcs: - return tr("%1 - point of arcs intersection").arg(PointName(tool.getId())); + record.description = tr("%1 - point of arcs intersection").arg(PointName(tool.getId())); + return record; case Tool::PointOfIntersectionCircles: - return tr("%1 - point of circles intersection").arg(PointName(tool.getId())); + record.description = tr("%1 - point of circles intersection").arg(PointName(tool.getId())); + return record; case Tool::PointOfIntersectionCurves: - return tr("%1 - point of curves intersection").arg(PointName(tool.getId())); + record.description = tr("%1 - point of curves intersection").arg(PointName(tool.getId())); + return record; case Tool::PointFromCircleAndTangent: - return tr("%1 - point from circle and tangent").arg(PointName(tool.getId())); + record.description = tr("%1 - point from circle and tangent").arg(PointName(tool.getId())); + return record; case Tool::PointFromArcAndTangent: - return tr("%1 - point from arc and tangent").arg(PointName(tool.getId())); + record.description = tr("%1 - point from arc and tangent").arg(PointName(tool.getId())); + return record; case Tool::TrueDarts: - return tr("Correction the dart %1_%2_%3") - .arg(PointName(AttrUInt(domElem, AttrDartP1)), - PointName(AttrUInt(domElem, AttrDartP2)), - PointName(AttrUInt(domElem, AttrDartP2))); + record.description = tr("Correction the dart %1_%2_%3") + .arg(PointName(AttrUInt(domElem, AttrDartP1)), + PointName(AttrUInt(domElem, AttrDartP2)), + PointName(AttrUInt(domElem, AttrDartP2))); + return record; case Tool::EllipticalArc: { const QSharedPointer elArc = data->GeometricObject(tool.getId()); SCASSERT(not elArc.isNull()) - return tr("%1 with length %2") - .arg(elArc->NameForHistory(tr("Elliptical arc"))) - .arg(elArc->GetLength()); + record.description = tr("%1 with length %2") + .arg(elArc->NameForHistory(tr("Elliptical arc"))) + .arg(elArc->GetLength()); + return record; } case Tool::Rotation: - return tr("Rotate objects around point %1. Suffix '%2'") - .arg(PointName(AttrUInt(domElem, AttrCenter)), - doc->GetParametrString(domElem, AttrSuffix, QString())); + record.description = tr("Rotate objects around point %1. Suffix '%2'") + .arg(PointName(AttrUInt(domElem, AttrCenter)), + doc->GetParametrString(domElem, AttrSuffix, QString())); + return record; case Tool::FlippingByLine: - return tr("Flipping by line %1_%2. Suffix '%3'") - .arg(PointName(AttrUInt(domElem, AttrP1Line)), - PointName(AttrUInt(domElem, AttrP2Line)), - doc->GetParametrString(domElem, AttrSuffix, QString())); + record.description = tr("Flipping by line %1_%2. Suffix '%3'") + .arg(PointName(AttrUInt(domElem, AttrP1Line)), + PointName(AttrUInt(domElem, AttrP2Line)), + doc->GetParametrString(domElem, AttrSuffix, QString())); + return record; case Tool::FlippingByAxis: - return tr("Flipping by axis through %1 point. Suffix '%2'") - .arg(PointName(AttrUInt(domElem, AttrCenter)), - doc->GetParametrString(domElem, AttrSuffix, QString())); + record.description = tr("Flipping by axis through %1 point. Suffix '%2'") + .arg(PointName(AttrUInt(domElem, AttrCenter)), + doc->GetParametrString(domElem, AttrSuffix, QString())); + return record; case Tool::Move: - return tr("Move objects. Suffix '%1'").arg(doc->GetParametrString(domElem, AttrSuffix, QString())); + record.description = tr("Move objects. Suffix '%1'") + .arg(doc->GetParametrString(domElem, AttrSuffix, QString())); + return record; //Because "history" not only show history of pattern, but help restore current data for each pattern's //piece, we need add record about details and nodes, but don't show them. case Tool::Piece: @@ -414,16 +460,16 @@ QString DialogHistory::Record(const VToolRecord &tool) case Tool::PlaceLabel: case Tool::InsertNode: case Tool::DuplicateDetail: - return QString(); + return record; } } catch (const VExceptionBadId &e) { qDebug()<GeometricObject(pointId)->name(); } //--------------------------------------------------------------------------------------------------------------------- -quint32 DialogHistory::AttrUInt(const QDomElement &domElement, const QString &name) +quint32 DialogHistory::AttrUInt(const QDomElement &domElement, const QString &name) const { return doc->GetParametrUInt(domElement, name, QChar('0')); } diff --git a/src/app/valentina/dialogs/dialoghistory.h b/src/app/valentina/dialogs/dialoghistory.h index bf5987b85..85e3e999d 100644 --- a/src/app/valentina/dialogs/dialoghistory.h +++ b/src/app/valentina/dialogs/dialoghistory.h @@ -35,6 +35,12 @@ class VPattern; +struct HistoryRecord +{ + QString description{}; + quint32 id{NULL_ID}; +}; + namespace Ui { class DialogHistory; @@ -86,11 +92,11 @@ private: qint32 cursorToolRecordRow; void FillTable(); - QString Record(const VToolRecord &tool); + HistoryRecord Record(const VToolRecord &tool) const; void InitialTable(); void ShowPoint(); - QString PointName(quint32 pointId); - quint32 AttrUInt(const QDomElement &domElement, const QString &name); + QString PointName(quint32 pointId) const; + quint32 AttrUInt(const QDomElement &domElement, const QString &name) const; void RetranslateUi(); int CursorRow() const; }; diff --git a/src/app/valentina/dialogs/dialoglayoutscale.cpp b/src/app/valentina/dialogs/dialoglayoutscale.cpp new file mode 100644 index 000000000..256c66f14 --- /dev/null +++ b/src/app/valentina/dialogs/dialoglayoutscale.cpp @@ -0,0 +1,214 @@ +/************************************************************************ + ** + ** @file dialoglayoutscale.cpp + ** @author Roman Telezhynskyi + ** @date 21 3, 2020 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentina project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2020 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "dialoglayoutscale.h" +#include "ui_dialoglayoutscale.h" +#include "../core/vapplication.h" +#include "../vmisc/vsettings.h" + +#include + +//--------------------------------------------------------------------------------------------------------------------- +DialogLayoutScale::DialogLayoutScale(bool printTiled, QWidget *parent) + :QDialog(parent), + ui(new Ui::DialogLayoutScale) +{ + ui->setupUi(this); + + qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale()) : setLocale(QLocale::c()); + + QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok); + SCASSERT(bOk != nullptr) + connect(bOk, &QPushButton::clicked, this, &DialogLayoutScale::Save); + + if (not printTiled) + { + ui->groupBoxMargins->setVisible(false); + } + + connect(ui->toolButtonScaleConnected, &QToolButton::clicked, this, &DialogLayoutScale::ToggleScaleConnection); + + connect(ui->doubleSpinBoxHorizontalScale, QOverload::of(&QDoubleSpinBox::valueChanged), + this, &DialogLayoutScale::HorizontalScaleChanged); + connect(ui->doubleSpinBoxVerticalScale, QOverload::of(&QDoubleSpinBox::valueChanged), + this, &DialogLayoutScale::VerticalScaleChanged); + + ReadSettings(); +} + +//--------------------------------------------------------------------------------------------------------------------- +DialogLayoutScale::~DialogLayoutScale() +{ + delete ui; +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::SetTiledMargins(QMarginsF margins) +{ + // read Margins top, right, bottom, left + margins = UnitConvertor(margins, Unit::Mm, qApp->patternUnit()); + + ui->doubleSpinBoxLeftField->setValue(margins.left()); + ui->doubleSpinBoxTopField->setValue(margins.top()); + ui->doubleSpinBoxRightField->setValue(margins.right()); + ui->doubleSpinBoxBottomField->setValue(margins.bottom()); +} + +//--------------------------------------------------------------------------------------------------------------------- +QMarginsF DialogLayoutScale::GetTiledMargins() const +{ + QMarginsF margins = QMarginsF( + ui->doubleSpinBoxLeftField->value(), + ui->doubleSpinBoxTopField->value(), + ui->doubleSpinBoxRightField->value(), + ui->doubleSpinBoxBottomField->value() + ); + + return UnitConvertor(margins, qApp->patternUnit(), Unit::Mm); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::SetXScale(qreal scale) +{ + ui->doubleSpinBoxHorizontalScale->setValue(scale * 100.); +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal DialogLayoutScale::GetXScale() const +{ + return ui->doubleSpinBoxHorizontalScale->value() / 100.; +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::SetYScale(qreal scale) +{ + ui->doubleSpinBoxVerticalScale->setValue(scale * 100.); +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal DialogLayoutScale::GetYScale() const +{ + return ui->doubleSpinBoxVerticalScale->value() / 100.; +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::showEvent(QShowEvent *event) +{ + QDialog::showEvent( event ); + if ( event->spontaneous() ) + { + return; + } + + if (isInitialized) + { + return; + } + // do your init stuff here + + setFixedSize(size()); + + isInitialized = true;//first show windows are held +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::Save() +{ + WriteSettings(); + + accept(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::ToggleScaleConnection() +{ + m_scaleConnected = not m_scaleConnected; + + QIcon icon; + icon.addFile(m_scaleConnected ? QStringLiteral(":/icon/32x32/link.png") + : QStringLiteral(":/icon/32x32/broken_link.png")); + ui->toolButtonScaleConnected->setIcon(icon); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::HorizontalScaleChanged(double d) +{ + if (m_scaleConnected) + { + ui->doubleSpinBoxVerticalScale->blockSignals(true); + ui->doubleSpinBoxVerticalScale->setValue(d); + ui->doubleSpinBoxVerticalScale->blockSignals(false); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::VerticalScaleChanged(double d) +{ + if (m_scaleConnected) + { + ui->doubleSpinBoxHorizontalScale->blockSignals(true); + ui->doubleSpinBoxHorizontalScale->setValue(d); + ui->doubleSpinBoxHorizontalScale->blockSignals(false); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::ReadSettings() +{ + VSettings *settings = qApp->ValentinaSettings(); + const Unit unit = qApp->patternUnit(); + + // read Margins top, right, bottom, left + const QMarginsF margins = settings->GetTiledPDFMargins(unit); + + ui->doubleSpinBoxLeftField->setValue(margins.left()); + ui->doubleSpinBoxTopField->setValue(margins.top()); + ui->doubleSpinBoxRightField->setValue(margins.right()); + ui->doubleSpinBoxBottomField->setValue(margins.bottom()); + + ui->doubleSpinBoxLeftField->setSuffix(UnitsToStr(unit, true)); + ui->doubleSpinBoxTopField->setSuffix(UnitsToStr(unit, true)); + ui->doubleSpinBoxRightField->setSuffix(UnitsToStr(unit, true)); + ui->doubleSpinBoxBottomField->setSuffix(UnitsToStr(unit, true)); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutScale::WriteSettings() const +{ + VSettings *settings = qApp->ValentinaSettings(); + const Unit unit = qApp->patternUnit(); + + // write Margins top, right, bottom, left + QMarginsF margins = QMarginsF( + ui->doubleSpinBoxLeftField->value(), + ui->doubleSpinBoxTopField->value(), + ui->doubleSpinBoxRightField->value(), + ui->doubleSpinBoxBottomField->value() + ); + settings->SetTiledPDFMargins(margins,unit); +} diff --git a/src/libs/vtools/undocommands/changegroupvisibility.h b/src/app/valentina/dialogs/dialoglayoutscale.h similarity index 53% rename from src/libs/vtools/undocommands/changegroupvisibility.h rename to src/app/valentina/dialogs/dialoglayoutscale.h index f126718e4..757f9c6e6 100644 --- a/src/libs/vtools/undocommands/changegroupvisibility.h +++ b/src/app/valentina/dialogs/dialoglayoutscale.h @@ -1,14 +1,14 @@ /************************************************************************ ** - ** @file changegroupVisibility.h + ** @file dialoglayoutscale.h ** @author Roman Telezhynskyi - ** @date 14 7, 2019 + ** @date 21 3, 2020 ** ** @brief ** @copyright ** This source code is part of the Valentina project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2019 Valentina project + ** Copyright (C) 2020 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -25,31 +25,50 @@ ** along with Valentina. If not, see . ** *************************************************************************/ -#ifndef CHANGEGROUPVISIBILITY_H -#define CHANGEGROUPVISIBILITY_H +#ifndef DIALOGLAYOUTSCALE_H +#define DIALOGLAYOUTSCALE_H -#include "vundocommand.h" +#include -class ChangeGroupVisibility : public VUndoCommand +namespace Ui +{ + class DialogLayoutScale; +} + +class DialogLayoutScale : public QDialog { Q_OBJECT -public: - ChangeGroupVisibility(VAbstractPattern *doc, vidtype id, bool visible, QUndoCommand *parent = nullptr); - virtual ~ChangeGroupVisibility(); - virtual void undo() override; - virtual void redo() override; -signals: - void UpdateGroup(vidtype id, bool visible); +public: + explicit DialogLayoutScale(bool printTiled, QWidget *parent = nullptr); + ~DialogLayoutScale(); + + void SetTiledMargins(QMarginsF margins); + QMarginsF GetTiledMargins() const; + + void SetXScale(qreal scale); + qreal GetXScale() const; + + void SetYScale(qreal scale); + qreal GetYScale() const; + +protected: + virtual void showEvent(QShowEvent *event) override; + +private slots: + void Save(); + void ToggleScaleConnection(); + void HorizontalScaleChanged(double d); + void VerticalScaleChanged(double d); private: - Q_DISABLE_COPY(ChangeGroupVisibility) + Q_DISABLE_COPY(DialogLayoutScale) + Ui::DialogLayoutScale *ui; + bool isInitialized{false}; + bool m_scaleConnected{true}; - bool m_oldVisibility{true}; - bool m_newVisibility{true}; - const QString m_nameActivDraw{}; - - void Do(bool visible); + void ReadSettings(); + void WriteSettings() const; }; -#endif // CHANGEGROUPVISIBILITY_H +#endif // DIALOGLAYOUTSCALE_H diff --git a/src/app/valentina/dialogs/dialoglayoutscale.ui b/src/app/valentina/dialogs/dialoglayoutscale.ui new file mode 100644 index 000000000..86fd6db95 --- /dev/null +++ b/src/app/valentina/dialogs/dialoglayoutscale.ui @@ -0,0 +1,334 @@ + + + DialogLayoutScale + + + + 0 + 0 + 404 + 211 + + + + Layout scale + + + + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png + + + + + + + + true + + + Margins + + + false + + + + + + + 0 + 0 + + + + Left: + + + + + + + cm + + + 0.100000000000000 + + + + + + + + 0 + 0 + + + + Right: + + + + + + + cm + + + 0.100000000000000 + + + + + + + + 0 + 0 + + + + Top: + + + + + + + cm + + + 0.100000000000000 + + + + + + + + 0 + 0 + + + + Bottom: + + + + + + + cm + + + 0.100000000000000 + + + + + + + + + + + + Scale + + + + + + + + Horizontal: + + + + + + + Vertical: + + + + + + + + + + + % + + + 1 + + + 1.000000000000000 + + + 300.000000000000000 + + + 0.100000000000000 + + + 100.000000000000000 + + + + + + + % + + + 1 + + + 1.000000000000000 + + + 300.000000000000000 + + + 0.100000000000000 + + + 100.000000000000000 + + + + + + + + + 1 + + + 0 + + + 0 + + + + + + 10 + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + ... + + + + :/icon/32x32/link.png:/icon/32x32/link.png + + + + 32 + 32 + + + + QToolButton::DelayedPopup + + + + + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Ok + + + + + + + + + + + buttonBox + accepted() + DialogLayoutScale + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + DialogLayoutScale + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/app/valentina/dialogs/dialoglayoutsettings.cpp b/src/app/valentina/dialogs/dialoglayoutsettings.cpp index 1847c4286..04549ef52 100644 --- a/src/app/valentina/dialogs/dialoglayoutsettings.cpp +++ b/src/app/valentina/dialogs/dialoglayoutsettings.cpp @@ -292,6 +292,18 @@ void DialogLayoutSettings::SetSaveLength(bool save) ui->checkBoxSaveLength->setChecked(save); } +//--------------------------------------------------------------------------------------------------------------------- +bool DialogLayoutSettings::IsPreferOneSheetSolution() const +{ + return ui->checkBoxOneSheetSolution->isChecked(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::SetPreferOneSheetSolution(bool prefer) +{ + ui->checkBoxOneSheetSolution->setChecked(prefer); +} + //--------------------------------------------------------------------------------------------------------------------- bool DialogLayoutSettings::IsUnitePages() const { @@ -600,6 +612,7 @@ void DialogLayoutSettings::DialogAccepted() generator->SetAutoCropLength(GetAutoCropLength()); generator->SetAutoCropWidth(GetAutoCropWidth()); generator->SetSaveLength(IsSaveLength()); + generator->SetPreferOneSheetSolution(IsPreferOneSheetSolution()); generator->SetUnitePages(IsUnitePages()); generator->SetStripOptimization(IsStripOptimization()); generator->SetMultiplier(GetMultiplier()); @@ -695,6 +708,7 @@ void DialogLayoutSettings::RestoreDefaults() SetNestingTime(VSettings::GetDefNestingTime()); SetEfficiencyCoefficient(VSettings::GetDefEfficiencyCoefficient()); SetNestQuantity(VSettings::GetDefLayoutNestQuantity()); + SetPreferOneSheetSolution(VSettings::GetDefLayoutPreferOneSheetSolution()); CorrectMaxFileds(); IgnoreAllFields(ui->checkBoxIgnoreFileds->isChecked()); @@ -1019,6 +1033,7 @@ void DialogLayoutSettings::ReadSettings() SetAutoCropLength(settings->GetLayoutAutoCropLength()); SetAutoCropWidth(settings->GetLayoutAutoCropWidth()); SetSaveLength(settings->GetLayoutSaveLength()); + SetPreferOneSheetSolution(settings->GetLayoutPreferOneSheetSolution()); SetUnitePages(settings->GetLayoutUnitePages()); SetFields(settings->GetFields(GetDefPrinterFields())); SetIgnoreAllFields(settings->GetIgnoreAllFields()); @@ -1046,6 +1061,7 @@ void DialogLayoutSettings::WriteSettings() const settings->SetLayoutAutoCropLength(GetAutoCropLength()); settings->SetLayoutAutoCropWidth(GetAutoCropWidth()); settings->SetLayoutSaveLength(IsSaveLength()); + settings->SetLayoutPreferOneSheetSolution(IsPreferOneSheetSolution()); settings->SetLayoutUnitePages(IsUnitePages()); settings->SetFields(GetFields()); settings->SetIgnoreAllFields(IsIgnoreAllFields()); diff --git a/src/app/valentina/dialogs/dialoglayoutsettings.h b/src/app/valentina/dialogs/dialoglayoutsettings.h index 778014b2b..bf6c9d8c7 100644 --- a/src/app/valentina/dialogs/dialoglayoutsettings.h +++ b/src/app/valentina/dialogs/dialoglayoutsettings.h @@ -85,6 +85,9 @@ public: bool IsSaveLength() const; void SetSaveLength(bool save); + bool IsPreferOneSheetSolution() const; + void SetPreferOneSheetSolution(bool prefer); + bool IsUnitePages() const; void SetUnitePages(bool save); diff --git a/src/app/valentina/dialogs/dialoglayoutsettings.ui b/src/app/valentina/dialogs/dialoglayoutsettings.ui index 648e09b5a..94f63d258 100644 --- a/src/app/valentina/dialogs/dialoglayoutsettings.ui +++ b/src/app/valentina/dialogs/dialoglayoutsettings.ui @@ -7,7 +7,7 @@ 0 0 601 - 600 + 645 @@ -448,6 +448,16 @@ + + + + Enable this option to prefer getting one sheet solutions. + + + Prefer one sheet solution + + + diff --git a/src/app/valentina/dialogs/dialogs.h b/src/app/valentina/dialogs/dialogs.h index 122665410..2ca4e9ca3 100644 --- a/src/app/valentina/dialogs/dialogs.h +++ b/src/app/valentina/dialogs/dialogs.h @@ -36,5 +36,6 @@ #include "dialogaboutapp.h" #include "dialogpreferences.h" #include "dialogfinalmeasurements.h" +#include "dialoglayoutscale.h" #endif // DIALOGS_H diff --git a/src/app/valentina/dialogs/dialogs.pri b/src/app/valentina/dialogs/dialogs.pri index 2bb72de56..af53d7952 100644 --- a/src/app/valentina/dialogs/dialogs.pri +++ b/src/app/valentina/dialogs/dialogs.pri @@ -2,6 +2,7 @@ # This need for corect working file translations.pro HEADERS += \ + $$PWD/dialoglayoutscale.h \ $$PWD/dialogs.h \ $$PWD/dialogincrements.h \ $$PWD/dialoghistory.h \ @@ -26,6 +27,7 @@ HEADERS += \ SOURCES += \ $$PWD/dialogincrements.cpp \ $$PWD/dialoghistory.cpp \ + $$PWD/dialoglayoutscale.cpp \ $$PWD/dialogpatternproperties.cpp \ $$PWD/dialognewpattern.cpp \ $$PWD/dialogaboutapp.cpp \ @@ -47,6 +49,7 @@ SOURCES += \ FORMS += \ $$PWD/dialogincrements.ui \ $$PWD/dialoghistory.ui \ + $$PWD/dialoglayoutscale.ui \ $$PWD/dialogpatternproperties.ui \ $$PWD/dialognewpattern.ui \ $$PWD/dialogaboutapp.ui \ diff --git a/src/app/valentina/dialogs/dialogsavelayout.cpp b/src/app/valentina/dialogs/dialogsavelayout.cpp index fc095b21d..ecac7451b 100644 --- a/src/app/valentina/dialogs/dialogsavelayout.cpp +++ b/src/app/valentina/dialogs/dialogsavelayout.cpp @@ -151,26 +151,15 @@ DialogSaveLayout::DialogSaveLayout(int count, Draw mode, const QString &fileName InitTemplates(ui->comboBoxTemplates); + connect(ui->toolButtonScaleConnected, &QToolButton::clicked, this, &DialogSaveLayout::ToggleScaleConnection); + + connect(ui->doubleSpinBoxHorizontalScale, QOverload::of(&QDoubleSpinBox::valueChanged), + this, &DialogSaveLayout::HorizontalScaleChanged); + connect(ui->doubleSpinBoxVerticalScale, QOverload::of(&QDoubleSpinBox::valueChanged), + this, &DialogSaveLayout::VerticalScaleChanged); + ReadSettings(); - // connect for the template drop down box of the tiled pds - connect(ui->comboBoxTemplates, QOverload::of(&QComboBox::currentIndexChanged), - this, &DialogSaveLayout::WriteSettings); - - // connects for the margins of the tiled pdf - connect(ui->doubleSpinBoxLeftField, QOverload::of(&QDoubleSpinBox::valueChanged), - this, &DialogSaveLayout::WriteSettings); - connect(ui->doubleSpinBoxTopField, QOverload::of(&QDoubleSpinBox::valueChanged), - this, &DialogSaveLayout::WriteSettings); - connect(ui->doubleSpinBoxRightField, QOverload::of(&QDoubleSpinBox::valueChanged), - this, &DialogSaveLayout::WriteSettings); - connect(ui->doubleSpinBoxBottomField, QOverload::of(&QDoubleSpinBox::valueChanged), - this, &DialogSaveLayout::WriteSettings); - - // connects for the orientation buttons for the tiled pdf - connect(ui->toolButtonPortrait, &QToolButton::toggled, this, &DialogSaveLayout::WriteSettings); - connect(ui->toolButtonLandscape, &QToolButton::toggled, this, &DialogSaveLayout::WriteSettings); - ShowExample();//Show example for current format. } @@ -520,6 +509,8 @@ LayoutExportFormats DialogSaveLayout::Format() const //--------------------------------------------------------------------------------------------------------------------- void DialogSaveLayout::Save() { + WriteSettings(); + for (int i=0; i < count; ++i) { const QString name = Path()+'/'+FileName()+QString::number(i+1)+ExportFormatSuffix(Format()); @@ -623,6 +614,39 @@ void DialogSaveLayout::ShowExample() } } +//--------------------------------------------------------------------------------------------------------------------- +void DialogSaveLayout::ToggleScaleConnection() +{ + m_scaleConnected = not m_scaleConnected; + + QIcon icon; + icon.addFile(m_scaleConnected ? QStringLiteral(":/icon/32x32/link.png") + : QStringLiteral(":/icon/32x32/broken_link.png")); + ui->toolButtonScaleConnected->setIcon(icon); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSaveLayout::HorizontalScaleChanged(double d) +{ + if (m_scaleConnected) + { + ui->doubleSpinBoxVerticalScale->blockSignals(true); + ui->doubleSpinBoxVerticalScale->setValue(d); + ui->doubleSpinBoxVerticalScale->blockSignals(false); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSaveLayout::VerticalScaleChanged(double d) +{ + if (m_scaleConnected) + { + ui->doubleSpinBoxHorizontalScale->blockSignals(true); + ui->doubleSpinBoxHorizontalScale->setValue(d); + ui->doubleSpinBoxHorizontalScale->blockSignals(false); + } +} + //--------------------------------------------------------------------------------------------------------------------- bool DialogSaveLayout::IsTextAsPaths() const { @@ -719,6 +743,30 @@ PageOrientation DialogSaveLayout::GetTiledPageOrientation() const } } +//--------------------------------------------------------------------------------------------------------------------- +void DialogSaveLayout::SetXScale(qreal scale) +{ + ui->doubleSpinBoxHorizontalScale->setValue(scale * 100.); +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal DialogSaveLayout::GetXScale() const +{ + return ui->doubleSpinBoxHorizontalScale->value() / 100.; +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSaveLayout::SetYScale(qreal scale) +{ + ui->doubleSpinBoxVerticalScale->setValue(scale * 100.); +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal DialogSaveLayout::GetYScale() const +{ + return ui->doubleSpinBoxVerticalScale->value() / 100.; +} + //--------------------------------------------------------------------------------------------------------------------- void DialogSaveLayout::showEvent(QShowEvent *event) { @@ -810,16 +858,15 @@ QVector > DialogSaveLayout::InitFormats( InitFormat(LayoutExportFormats::DXF_AC1021_AAMA); InitFormat(LayoutExportFormats::DXF_AC1024_AAMA); InitFormat(LayoutExportFormats::DXF_AC1027_AAMA); - // We will support them anyway -// InitFormat(LayoutExportFormats::DXF_AC1006_ASTM); -// InitFormat(LayoutExportFormats::DXF_AC1009_ASTM); -// InitFormat(LayoutExportFormats::DXF_AC1012_ASTM); -// InitFormat(LayoutExportFormats::DXF_AC1014_ASTM); -// InitFormat(LayoutExportFormats::DXF_AC1015_ASTM); -// InitFormat(LayoutExportFormats::DXF_AC1018_ASTM); -// InitFormat(LayoutExportFormats::DXF_AC1021_ASTM); -// InitFormat(LayoutExportFormats::DXF_AC1024_ASTM); -// InitFormat(LayoutExportFormats::DXF_AC1027_ASTM); + InitFormat(LayoutExportFormats::DXF_AC1006_ASTM); + InitFormat(LayoutExportFormats::DXF_AC1009_ASTM); + InitFormat(LayoutExportFormats::DXF_AC1012_ASTM); + InitFormat(LayoutExportFormats::DXF_AC1014_ASTM); + InitFormat(LayoutExportFormats::DXF_AC1015_ASTM); + InitFormat(LayoutExportFormats::DXF_AC1018_ASTM); + InitFormat(LayoutExportFormats::DXF_AC1021_ASTM); + InitFormat(LayoutExportFormats::DXF_AC1024_ASTM); + InitFormat(LayoutExportFormats::DXF_AC1027_ASTM); InitFormat(LayoutExportFormats::PDFTiled); // InitFormat(LayoutExportFormats::NC); diff --git a/src/app/valentina/dialogs/dialogsavelayout.h b/src/app/valentina/dialogs/dialogsavelayout.h index 462c2330e..8f6d480f7 100644 --- a/src/app/valentina/dialogs/dialogsavelayout.h +++ b/src/app/valentina/dialogs/dialogsavelayout.h @@ -86,6 +86,12 @@ public: void SetTiledPageOrientation(PageOrientation orientation); PageOrientation GetTiledPageOrientation() const; + void SetXScale(qreal scale); + qreal GetXScale() const; + + void SetYScale(qreal scale); + qreal GetYScale() const; + protected: virtual void showEvent(QShowEvent *event) override; void InitTemplates(QComboBox *comboBoxTemplates); @@ -94,6 +100,9 @@ private slots: void Save(); void PathChanged(const QString &text); void ShowExample(); + void ToggleScaleConnection(); + void HorizontalScaleChanged(double d); + void VerticalScaleChanged(double d); private: Q_DISABLE_COPY(DialogSaveLayout) Ui::DialogSaveLAyout *ui; @@ -101,6 +110,7 @@ private: bool isInitialized; Draw m_mode; bool m_tiledExportMode; + bool m_scaleConnected{true}; static bool havePdf; static bool tested; diff --git a/src/app/valentina/dialogs/dialogsavelayout.ui b/src/app/valentina/dialogs/dialogsavelayout.ui index c9440ace0..90bf2ac81 100644 --- a/src/app/valentina/dialogs/dialogsavelayout.ui +++ b/src/app/valentina/dialogs/dialogsavelayout.ui @@ -6,8 +6,8 @@ 0 0 - 719 - 314 + 493 + 391 @@ -17,20 +17,20 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png - - - - - Path: - - - - + + + + + + Path: + + + - + 0 0 @@ -46,7 +46,7 @@ - + 0 0 @@ -61,44 +61,229 @@ - - - - File format: - - + + + + + + + 0 + 0 + + + + File format: + + + + + + + + 0 + 0 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - - - - - 0 - 0 - - - + + + + + + Options + + + + + + false + + + Binary form + + + + + + + true + + + Text as paths + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Scale + + + + + + + + Horizontal: + + + + + + + Vertical: + + + + + + + + + + + % + + + 1 + + + 1.000000000000000 + + + 300.000000000000000 + + + 0.100000000000000 + + + 100.000000000000000 + + + + + + + % + + + 1 + + + 1.000000000000000 + + + 300.000000000000000 + + + 0.100000000000000 + + + 100.000000000000000 + + + + + + + + + 1 + + + 0 + + + 0 + + + + + + 10 + + + + <html><head/><body><p><span style=" font-size:16pt;">┐</span></p></body></html> + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + ... + + + + :/icon/32x32/link.png:/icon/32x32/link.png + + + + 32 + 32 + + + + QToolButton::DelayedPopup + + + + + + + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">┘</span></p></body></html> + + + + + + + + + - - - - false - - - Binary form - - - - - - - true - - - Text as paths - - - - + @@ -148,6 +333,9 @@ cm + + 0.100000000000000 + @@ -164,6 +352,9 @@ cm + + 0.100000000000000 + @@ -204,6 +395,9 @@ cm + + 0.100000000000000 + @@ -224,6 +418,9 @@ cm + + 0.100000000000000 + @@ -239,79 +436,75 @@ Paper format - - - - - + + + + + Templates: + + + + + + + + + + Orientation: + + + + + + + - Templates: + ... + + + + :/icon/16x16/portrait.png:/icon/16x16/portrait.png + + + true + + + true + + + true - - - - - + + - Orientation: + ... + + + + :/icon/16x16/landscape.png:/icon/16x16/landscape.png + + + true + + + true - - - - - - ... - - - - :/icon/16x16/portrait.png:/icon/16x16/portrait.png - - - true - - - true - - - true - - - - - - - ... - - - - :/icon/16x16/landscape.png:/icon/16x16/landscape.png - - - true - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + + + + Qt::Horizontal + + + + 40 + 20 + + + @@ -320,19 +513,28 @@ - - - - File name: - - - - + + + QLayout::SetDefaultConstraint + + + + + + 0 + 0 + + + + File name: + + + - + 0 0 @@ -347,6 +549,12 @@ + + + 0 + 0 + + 130 @@ -363,7 +571,7 @@ - + Qt::Horizontal diff --git a/src/app/valentina/dialogs/vwidgetdetails.cpp b/src/app/valentina/dialogs/vwidgetdetails.cpp index 2145c6407..084ababfa 100644 --- a/src/app/valentina/dialogs/vwidgetdetails.cpp +++ b/src/app/valentina/dialogs/vwidgetdetails.cpp @@ -263,12 +263,44 @@ void VWidgetDetails::ShowContextMenu(const QPoint &pos) QAction *actionSelectAll = menu->addAction(tr("Select all")); QAction *actionSelectNone = menu->addAction(tr("Select none")); - QAction *actionSeparator = new QAction(this); - actionSeparator->setSeparator(true); - menu->addAction(actionSeparator); + menu->addSeparator(); QAction *actionInvertSelection = menu->addAction(tr("Invert selection")); + bool pieceMode = false; + QAction *actionPieceOptions = nullptr; + QAction *actionDeletePiece = nullptr; + VToolSeamAllowance *toolPiece = nullptr; + + QTableWidgetItem *selectedItem = ui->tableWidget->itemAt(pos); + if (selectedItem) + { + QTableWidgetItem *item = ui->tableWidget->item(selectedItem->row(), PieceColumn::InLayout); + const quint32 id = item->data(Qt::UserRole).toUInt(); + + try + { + toolPiece = qobject_cast(VAbstractPattern::getTool(id)); + if (toolPiece) + { + pieceMode = true; + menu->addSeparator(); + + actionPieceOptions = menu->addAction(QIcon::fromTheme(QStringLiteral("preferences-other")), + tr("Piece options")); + + actionDeletePiece = menu->addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), + tr("Delete piece")); + actionDeletePiece->setDisabled(toolPiece->referens() > 0); + } + } + catch (const VExceptionBadId &) + { + const QString errorMsg = tr("Cannot find piece by id '%1'").arg(id); + qWarning() << VAbstractApplication::patternMessageSignature + errorMsg; + } + } + const QHash *allDetails = m_data->DataPieces(); if (allDetails->count() == 0) { @@ -333,6 +365,23 @@ void VWidgetDetails::ShowContextMenu(const QPoint &pos) qApp->getUndoStack()->endMacro(); } + else if (pieceMode && selectedAction == actionPieceOptions) + { + toolPiece->ShowOptions(); + } + else if (pieceMode && selectedAction == actionDeletePiece) + { + try + { + toolPiece->DeleteFromMenu(); + } + catch(const VExceptionToolWasDeleted &e) + { + Q_UNUSED(e); + return;//Leave this method immediately!!! + } + //Leave this method immediately after call!!! + } } //------------------------------------------------------------------------------------------------------------------ diff --git a/src/app/valentina/dialogs/vwidgetgroups.cpp b/src/app/valentina/dialogs/vwidgetgroups.cpp index 02e19b6a5..17d09e1a9 100644 --- a/src/app/valentina/dialogs/vwidgetgroups.cpp +++ b/src/app/valentina/dialogs/vwidgetgroups.cpp @@ -29,11 +29,11 @@ #include "vwidgetgroups.h" #include "ui_vwidgetgroups.h" #include "../vtools/dialogs/tools/dialoggroup.h" -#include "../vtools/undocommands/delgroup.h" -#include "../vtools/undocommands/changegroupvisibility.h" -#include "../vtools/undocommands/changemultiplegroupsvisibility.h" +#include "../vtools/undocommands/undogroup.h" #include "../vpatterndb/vcontainer.h" +#include "../vmisc/compatibility.h" +#include #include #include @@ -53,6 +53,7 @@ VWidgetGroups::VWidgetGroups(VAbstractPattern *doc, QWidget *parent) connect(ui->tableWidget, &QTableWidget::cellClicked, this, &VWidgetGroups::GroupVisibilityChanged); connect(ui->tableWidget, &QTableWidget::cellChanged, this, &VWidgetGroups::RenameGroup); connect(ui->tableWidget, &QTableWidget::customContextMenuRequested, this, &VWidgetGroups::CtxMenu); + connect(ui->lineEditTags, &QLineEdit::textChanged, this, &VWidgetGroups::UpdateGroups); } //--------------------------------------------------------------------------------------------------------------------- @@ -112,6 +113,32 @@ void VWidgetGroups::SetMultipleGroupsVisibility(const QVector &groups, qApp->getUndoStack()->push(changeGroups); } +//--------------------------------------------------------------------------------------------------------------------- +QMap VWidgetGroups::FilterGroups(const QMap &groups) +{ + QMap filtered; + QSet filterCategories = ConvertToSet(VAbstractPattern::FilterGroupTags(ui->lineEditTags->text())); + + if (filterCategories.isEmpty()) + { + return groups; + } + + auto i = groups.constBegin(); + while (i != groups.constEnd()) + { + const VGroupData &data = i.value(); + QSet groupCategories = ConvertToSet(data.tags); + if (SetIntersects(filterCategories, groupCategories)) + { + filtered.insert(i.key(), data); + } + ++i; + } + + return filtered; +} + //--------------------------------------------------------------------------------------------------------------------- int VWidgetGroups::GroupRow(vidtype id) const { @@ -150,9 +177,9 @@ void VWidgetGroups::RenameGroup(int row, int column) } const quint32 id = ui->tableWidget->item(row, 0)->data(Qt::UserRole).toUInt(); - doc->SetGroupName(id, ui->tableWidget->item(row, column)->text()); - - UpdateGroups(); + ::RenameGroup *renameGroup = new ::RenameGroup(doc, id, ui->tableWidget->item(row, column)->text()); + connect(renameGroup, &RenameGroup::UpdateGroups, this, &VWidgetGroups::UpdateGroups); + qApp->getUndoStack()->push(renameGroup); } //--------------------------------------------------------------------------------------------------------------------- @@ -187,7 +214,7 @@ void VWidgetGroups::CtxMenu(const QPoint &pos) menu->addAction(QIcon(QStringLiteral("://icon/16x16/closed_eye.png")), tr("Hide")) : menu->addAction(QIcon(QStringLiteral("://icon/16x16/open_eye.png")), tr("Show")); - QAction *actionRename = menu->addAction(tr("Rename")); + QAction *actionPreferences = menu->addAction(QIcon::fromTheme(preferencesOtherIcon), tr("Preferences")); QAction *actionDelete = menu->addAction(QIcon::fromTheme(editDeleteIcon), tr("Delete")); menu->addSeparator(); QAction *actionHideAll = menu->addAction(tr("Hide All")); @@ -201,19 +228,22 @@ void VWidgetGroups::CtxMenu(const QPoint &pos) { SetGroupVisibility(id, not doc->GetGroupVisibility(id)); } - else if (selectedAction == actionRename) + else if (selectedAction == actionPreferences) { QScopedPointer fackeContainer(new VContainer(qApp->TrVars(), qApp->patternUnitP(), VContainer::UniqueNamespace())); QScopedPointer dialog(new DialogGroup(fackeContainer.data(), NULL_ID, this)); dialog->SetName(doc->GetGroupName(id)); + dialog->SetTags(doc->GetGroupTags(id)); + dialog->SetGroupCategories(doc->GetGroupCategories()); const int result = dialog->exec(); if (result == QDialog::Accepted) { - doc->SetGroupName(id, dialog->GetName()); - item = ui->tableWidget->item(row, 1); - item->setText(dialog->GetName()); + ChangeGroupOptions *changeGroupOptions = new ChangeGroupOptions(doc, id, dialog->GetName(), + dialog->GetTags()); + connect(changeGroupOptions, &ChangeGroupOptions::UpdateGroups, this, &VWidgetGroups::UpdateGroups); + qApp->getUndoStack()->push(changeGroupOptions); } } else if (selectedAction == actionDelete) @@ -279,8 +309,13 @@ void VWidgetGroups::UpdateGroups() } //--------------------------------------------------------------------------------------------------------------------- -void VWidgetGroups::FillTable(const QMap > &groups) +void VWidgetGroups::FillTable(QMap groups) { + emit doc->UpdateToolTip(); + ui->lineEditTags->SetCompletion(doc->GetGroupCategories()); + + groups = FilterGroups(groups); + ui->tableWidget->blockSignals(true); ui->tableWidget->clear(); @@ -291,12 +326,12 @@ void VWidgetGroups::FillTable(const QMap > &groups while (i != groups.constEnd()) { ++currentRow; - const QPair data = i.value(); + const VGroupData data = i.value(); QTableWidgetItem *item = new QTableWidgetItem(); item->setTextAlignment(Qt::AlignHCenter); - (data.second) ? item->setIcon(QIcon("://icon/16x16/open_eye.png")) - : item->setIcon(QIcon("://icon/16x16/closed_eye.png")); + (data.visible) ? item->setIcon(QIcon("://icon/16x16/open_eye.png")) + : item->setIcon(QIcon("://icon/16x16/closed_eye.png")); item->setData(Qt::UserRole, i.key()); @@ -307,8 +342,9 @@ void VWidgetGroups::FillTable(const QMap > &groups ui->tableWidget->setItem(currentRow, 0, item); - item = new QTableWidgetItem(data.first); + item = new QTableWidgetItem(data.name); item->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter); + item->setToolTip(tr("Categories: %1.").arg(data.tags.join(", "))); if(doc->GroupIsEmpty(i.key())) { diff --git a/src/app/valentina/dialogs/vwidgetgroups.h b/src/app/valentina/dialogs/vwidgetgroups.h index 0d0838a68..ba4e0f17c 100644 --- a/src/app/valentina/dialogs/vwidgetgroups.h +++ b/src/app/valentina/dialogs/vwidgetgroups.h @@ -34,6 +34,7 @@ class QTableWidgetItem; class VAbstractPattern; +struct VGroupData; namespace Ui { @@ -61,10 +62,12 @@ private: Ui::VWidgetGroups *ui; VAbstractPattern *doc; - void FillTable(const QMap > &groups); + void FillTable(QMap groups); void SetGroupVisibility(vidtype id, bool visible) const; void SetMultipleGroupsVisibility(const QVector &groups, bool visible) const; + QMap FilterGroups(const QMap &groups); + int GroupRow(vidtype id) const; }; diff --git a/src/app/valentina/dialogs/vwidgetgroups.ui b/src/app/valentina/dialogs/vwidgetgroups.ui index 006e30e6c..3a3ee72f3 100644 --- a/src/app/valentina/dialogs/vwidgetgroups.ui +++ b/src/app/valentina/dialogs/vwidgetgroups.ui @@ -7,7 +7,7 @@ 0 0 371 - 279 + 438 @@ -18,6 +18,30 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png + + + + + + Tags: + + + + + + + Separate each tag with comma. + + + Filter by tags + + + true + + + + + @@ -47,16 +71,23 @@ false - - false - 10 + + false + + + + VCompleterLineEdit + QLineEdit +
vlineedit.h
+
+
diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 427681cb6..f5bb15524 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -58,7 +58,7 @@ #include "tools/vtooluniondetails.h" #include "dialogs/dialogs.h" #include "dialogs/vwidgetgroups.h" -#include "../vtools/undocommands/addgroup.h" +#include "../vtools/undocommands/undogroup.h" #include "dialogs/vwidgetdetails.h" #include "../vpatterndb/vpiecepath.h" #include "../qmuparser/qmuparsererror.h" @@ -648,6 +648,12 @@ void MainWindow::SetToolButton(bool checked, Tool t, const QString &cursor, cons case Tool::PlaceLabel: dialogTool->SetPiecesList(doc->GetActivePPPieces()); break; + case Tool::Rotation: + case Tool::Move: + case Tool::FlippingByAxis: + case Tool::FlippingByLine: + dialogTool->SetGroupCategories(doc->GetGroupCategories()); + break; default: break; } @@ -1241,7 +1247,8 @@ void MainWindow::ClosedDialogGroup(int result) { const QPointer dialog = qobject_cast(dialogTool); SCASSERT(not dialog.isNull()) - const QDomElement group = doc->CreateGroup(pattern->getNextId(), dialog->GetName(), dialog->GetGroup()); + const QDomElement group = doc->CreateGroup(pattern->getNextId(), dialog->GetName(), dialog->GetTags(), + dialog->GetGroup()); if (not group.isNull()) { AddGroup *addGroup = new AddGroup(group, doc); @@ -5527,6 +5534,8 @@ bool MainWindow::DoExport(const VCommandLinePtr &expParams) m_dialogSaveLayout->SelectFormat(static_cast(expParams->OptExportType())); m_dialogSaveLayout->SetBinaryDXFFormat(expParams->IsBinaryDXF()); m_dialogSaveLayout->SetTextAsPaths(expParams->IsTextAsPaths()); + m_dialogSaveLayout->SetXScale(expParams->ExportXScale()); + m_dialogSaveLayout->SetYScale(expParams->ExportYScale()); if (static_cast(expParams->OptExportType()) == LayoutExportFormats::PDFTiled) { @@ -5562,6 +5571,8 @@ bool MainWindow::DoExport(const VCommandLinePtr &expParams) m_dialogSaveLayout->SetDestinationPath(expParams->OptDestinationPath()); m_dialogSaveLayout->SelectFormat(static_cast(expParams->OptExportType())); m_dialogSaveLayout->SetBinaryDXFFormat(expParams->IsBinaryDXF()); + m_dialogSaveLayout->SetXScale(expParams->ExportXScale()); + m_dialogSaveLayout->SetYScale(expParams->ExportYScale()); if (static_cast(expParams->OptExportType()) == LayoutExportFormats::PDFTiled) { diff --git a/src/app/valentina/mainwindowsnogui.cpp b/src/app/valentina/mainwindowsnogui.cpp index 14459be31..559a02dcd 100644 --- a/src/app/valentina/mainwindowsnogui.cpp +++ b/src/app/valentina/mainwindowsnogui.cpp @@ -41,6 +41,7 @@ #include "../vlayout/vlayoutgenerator.h" #include "dialogs/dialoglayoutprogress.h" #include "dialogs/dialogsavelayout.h" +#include "dialogs/dialoglayoutscale.h" #include "../vlayout/vposter.h" #include "../vpatterndb/floatItemData/vpiecelabeldata.h" #include "../vpatterndb/floatItemData/vpatternlabeldata.h" @@ -312,7 +313,7 @@ bool MainWindowsNoGUI::GenerateLayout(VLayoutGenerator& lGenerator) if (lGenerator.PapersCount() <= papersCount) { const qreal layoutEfficiency = lGenerator.LayoutEfficiency(); - if (efficiency < layoutEfficiency) + if (efficiency < layoutEfficiency || lGenerator.PapersCount() < papersCount) { efficiency = layoutEfficiency; if (VApplication::IsGUIMode()) @@ -403,7 +404,10 @@ bool MainWindowsNoGUI::GenerateLayout(VLayoutGenerator& lGenerator) || (nestingState == LayoutErrors::NoError && not qFuzzyIsNull(lGenerator.GetEfficiencyCoefficient()) && efficiency >= lGenerator.GetEfficiencyCoefficient())) { - break; + if (not lGenerator.IsPreferOneSheetSolution() || lGenerator.PapersCount() == 1) + { + break; + } } if (IsTimeout()) @@ -510,7 +514,16 @@ void MainWindowsNoGUI::ExportData(const QVector &listDetails) format == LayoutExportFormats::DXF_AC1018_AAMA || format == LayoutExportFormats::DXF_AC1021_AAMA || format == LayoutExportFormats::DXF_AC1024_AAMA || - format == LayoutExportFormats::DXF_AC1027_AAMA) + format == LayoutExportFormats::DXF_AC1027_AAMA || + format == LayoutExportFormats::DXF_AC1006_ASTM || + format == LayoutExportFormats::DXF_AC1009_ASTM || + format == LayoutExportFormats::DXF_AC1012_ASTM || + format == LayoutExportFormats::DXF_AC1014_ASTM || + format == LayoutExportFormats::DXF_AC1015_ASTM || + format == LayoutExportFormats::DXF_AC1018_ASTM || + format == LayoutExportFormats::DXF_AC1021_ASTM || + format == LayoutExportFormats::DXF_AC1024_ASTM || + format == LayoutExportFormats::DXF_AC1027_ASTM) { if (m_dialogSaveLayout->Mode() == Draw::Layout) { @@ -665,15 +678,31 @@ void MainWindowsNoGUI::ExportApparelLayout(const QVector &details, switch (format) { case LayoutExportFormats::DXF_AC1006_ASTM: + ASTMDxfFile(name, DRW::AC1006, m_dialogSaveLayout->IsBinaryDXFFormat(), size, details); + break; case LayoutExportFormats::DXF_AC1009_ASTM: + ASTMDxfFile(name, DRW::AC1009, m_dialogSaveLayout->IsBinaryDXFFormat(), size, details); + break; case LayoutExportFormats::DXF_AC1012_ASTM: + ASTMDxfFile(name, DRW::AC1012, m_dialogSaveLayout->IsBinaryDXFFormat(), size, details); + break; case LayoutExportFormats::DXF_AC1014_ASTM: + ASTMDxfFile(name, DRW::AC1014, m_dialogSaveLayout->IsBinaryDXFFormat(), size, details); + break; case LayoutExportFormats::DXF_AC1015_ASTM: + ASTMDxfFile(name, DRW::AC1015, m_dialogSaveLayout->IsBinaryDXFFormat(), size, details); + break; case LayoutExportFormats::DXF_AC1018_ASTM: + ASTMDxfFile(name, DRW::AC1018, m_dialogSaveLayout->IsBinaryDXFFormat(), size, details); + break; case LayoutExportFormats::DXF_AC1021_ASTM: + ASTMDxfFile(name, DRW::AC1021, m_dialogSaveLayout->IsBinaryDXFFormat(), size, details); + break; case LayoutExportFormats::DXF_AC1024_ASTM: + ASTMDxfFile(name, DRW::AC1024, m_dialogSaveLayout->IsBinaryDXFFormat(), size, details); + break; case LayoutExportFormats::DXF_AC1027_ASTM: - Q_UNREACHABLE(); // For now not supported + ASTMDxfFile(name, DRW::AC1027, m_dialogSaveLayout->IsBinaryDXFFormat(), size, details); break; case LayoutExportFormats::DXF_AC1006_AAMA: AAMADxfFile(name, DRW::AC1006, m_dialogSaveLayout->IsBinaryDXFFormat(), size, details); @@ -798,7 +827,6 @@ void MainWindowsNoGUI::PrintPages(QPrinter *printer) ToPixel(printer->pageRect(QPrinter::Millimeter).height(), Unit::Mm)); const double xscale = printer->pageRect().width() / printerPageRect.width(); const double yscale = printer->pageRect().height() / printerPageRect.height(); - const double scale = qMin(xscale, yscale); QPainter painter; if (not painter.begin(printer)) @@ -844,7 +872,9 @@ void MainWindowsNoGUI::PrintPages(QPrinter *printer) auto *paper = qgraphicsitem_cast(papers.at(i)); if (paper) { - *poster += posterazor->Calc(paper->rect().toRect(), i, orientation); + QRectF paperRect = paper->rect(); + QSizeF image(paperRect.width() * m_xscale, paperRect.height() * m_yscale); + *poster += posterazor->Calc(image.toSize(), i, orientation); } } @@ -949,7 +979,9 @@ void MainWindowsNoGUI::PrintPages(QPrinter *printer) qreal x,y; if(printer->fullPage()) { - QMarginsF printerMargins = printer->pageLayout().margins(); + QPageLayout layout = printer->pageLayout(); + layout.setUnits(QPageLayout::Millimeter); + QMarginsF printerMargins = layout.margins(); x = qFloor(ToPixel(printerMargins.left(),Unit::Mm)); y = qFloor(ToPixel(printerMargins.top(),Unit::Mm)); } @@ -958,7 +990,7 @@ void MainWindowsNoGUI::PrintPages(QPrinter *printer) x = 0; y = 0; } - QRectF target(x * scale, y * scale, source.width() * scale, source.height() * scale); + QRectF target(x * xscale, y * yscale, source.width() * xscale, source.height() * yscale); scenes.at(paperIndex)->render(&painter, target, source, Qt::IgnoreAspectRatio); @@ -1187,10 +1219,10 @@ void MainWindowsNoGUI::SvgFile(const QString &name, QGraphicsRectItem *paper, QG const QRectF r = paper->rect(); QSvgGenerator generator; generator.setFileName(name); - generator.setSize(QSize(qFloor(r.width() + margins.left() + margins.right()), - qFloor(r.height() + margins.top() + margins.bottom()))); - generator.setViewBox(QRectF(0, 0, r.width() + margins.left() + margins.right(), - r.height() + margins.top() + margins.bottom())); + generator.setSize(QSize(qFloor(r.width() * m_dialogSaveLayout->GetXScale() + margins.left() + margins.right()), + qFloor(r.height() * m_dialogSaveLayout->GetYScale() + margins.top() + margins.bottom()))); + generator.setViewBox(QRectF(0, 0, r.width() * m_dialogSaveLayout->GetXScale() + margins.left() + margins.right(), + r.height() * m_dialogSaveLayout->GetYScale() + margins.top() + margins.bottom())); generator.setTitle(tr("Pattern")); generator.setDescription(doc->GetDescription().toHtmlEscaped()); generator.setResolution(static_cast(PrintDPI)); @@ -1200,6 +1232,7 @@ void MainWindowsNoGUI::SvgFile(const QString &name, QGraphicsRectItem *paper, QG painter.setRenderHint(QPainter::Antialiasing, true); painter.setPen(QPen(Qt::black, qApp->Settings()->WidthHairLine(), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); painter.setBrush ( QBrush ( Qt::NoBrush ) ); + painter.scale(m_dialogSaveLayout->GetXScale(), m_dialogSaveLayout->GetYScale()); scene->render(&painter, r, r, Qt::IgnoreAspectRatio); painter.end(); } @@ -1214,8 +1247,8 @@ void MainWindowsNoGUI::PngFile(const QString &name, QGraphicsRectItem *paper, QG { const QRectF r = paper->rect(); // Create the image with the exact size of the shrunk scene - QImage image(QSize(qFloor(r.width() + margins.left() + margins.right()), - qFloor(r.height() + margins.top() + margins.bottom())), + QImage image(QSize(qFloor(r.width() * m_dialogSaveLayout->GetXScale() + margins.left() + margins.right()), + qFloor(r.height() * m_dialogSaveLayout->GetYScale() + margins.top() + margins.bottom())), QImage::Format_ARGB32); image.fill(Qt::white); QPainter painter(&image); @@ -1223,6 +1256,7 @@ void MainWindowsNoGUI::PngFile(const QString &name, QGraphicsRectItem *paper, QG painter.setRenderHint(QPainter::Antialiasing, true); painter.setPen(QPen(Qt::black, qApp->Settings()->WidthMainLine(), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); painter.setBrush ( QBrush ( Qt::NoBrush ) ); + painter.scale(m_dialogSaveLayout->GetXScale(), m_dialogSaveLayout->GetYScale()); scene->render(&painter, r, r, Qt::IgnoreAspectRatio); image.save(name); } @@ -1245,9 +1279,11 @@ void MainWindowsNoGUI::PdfFile(const QString &name, QGraphicsRectItem *paper, QG printer.setResolution(static_cast(PrintDPI)); printer.setOrientation(QPrinter::Portrait); printer.setFullPage(ignorePrinterFields); - if (not printer.setPageSize(QPageSize(QSizeF(FromPixel(r.width() + margins.left() + margins.right(), Unit::Mm), - FromPixel(r.height() + margins.top() + margins.bottom(), Unit::Mm)), - QPageSize::Millimeter))) + + qreal width = FromPixel(r.width() * m_dialogSaveLayout->GetXScale() + margins.left() + margins.right(), Unit::Mm); + qreal height = FromPixel(r.height() * m_dialogSaveLayout->GetYScale() + margins.top() + margins.bottom(), Unit::Mm); + + if (not printer.setPageSize(QPageSize(QSizeF(width, height), QPageSize::Millimeter))) { qWarning() << tr("Cannot set printer page size"); } @@ -1272,6 +1308,7 @@ void MainWindowsNoGUI::PdfFile(const QString &name, QGraphicsRectItem *paper, QG painter.setRenderHint(QPainter::Antialiasing, true); painter.setPen(QPen(Qt::black, qApp->Settings()->WidthMainLine(), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); painter.setBrush ( QBrush ( Qt::NoBrush ) ); + painter.scale(m_dialogSaveLayout->GetXScale(), m_dialogSaveLayout->GetYScale()); scene->render(&painter, r, r, Qt::IgnoreAspectRatio); painter.end(); } @@ -1297,6 +1334,9 @@ void MainWindowsNoGUI::PdfTiledFile(const QString &name) qWarning()<GetXScale(); + m_yscale = m_dialogSaveLayout->GetYScale(); + printer.setOutputFileName(name); printer.setResolution(static_cast(PrintDPI)); PrintPages(&printer); @@ -1395,7 +1435,11 @@ void MainWindowsNoGUI::FlatDxfFile(const QString &name, int version, bool binary PrepareTextForDXF(endStringPlaceholder, details); VDxfPaintDevice generator; generator.setFileName(name); - generator.setSize(paper->rect().size().toSize()); + + const QRectF r = paper->rect(); + generator.setSize(QSize(qFloor(r.width() * m_dialogSaveLayout->GetXScale()), + qFloor(r.height() * m_dialogSaveLayout->GetYScale()))); + generator.setResolution(PrintDPI); generator.SetVersion(static_cast(version)); generator.SetBinaryFormat(binary); @@ -1404,6 +1448,7 @@ void MainWindowsNoGUI::FlatDxfFile(const QString &name, int version, bool binary QPainter painter; if (painter.begin(&generator)) { + painter.scale(m_dialogSaveLayout->GetXScale(), m_dialogSaveLayout->GetYScale()); scene->render(&painter, paper->rect(), paper->rect(), Qt::IgnoreAspectRatio); painter.end(); } @@ -1413,6 +1458,23 @@ void MainWindowsNoGUI::FlatDxfFile(const QString &name, int version, bool binary //--------------------------------------------------------------------------------------------------------------------- void MainWindowsNoGUI::AAMADxfFile(const QString &name, int version, bool binary, const QSize &size, const QVector &details) const +{ + VDxfPaintDevice generator; + generator.setFileName(name); + generator.setSize(QSize(qCeil(size.width() * m_dialogSaveLayout->GetXScale()), + qCeil(size.height() * m_dialogSaveLayout->GetYScale()))); + generator.setResolution(PrintDPI); + generator.SetVersion(static_cast(version)); + generator.SetBinaryFormat(binary); + generator.setInsunits(VarInsunits::Millimeters);// Decided to always use mm. See issue #745 + generator.SetXScale(m_dialogSaveLayout->GetXScale()); + generator.SetYScale(m_dialogSaveLayout->GetYScale()); + generator.ExportToAAMA(details); +} + +//--------------------------------------------------------------------------------------------------------------------- +void MainWindowsNoGUI::ASTMDxfFile(const QString &name, int version, bool binary, const QSize &size, + const QVector &details) const { VDxfPaintDevice generator; generator.setFileName(name); @@ -1421,7 +1483,9 @@ void MainWindowsNoGUI::AAMADxfFile(const QString &name, int version, bool binary generator.SetVersion(static_cast(version)); generator.SetBinaryFormat(binary); generator.setInsunits(VarInsunits::Millimeters);// Decided to always use mm. See issue #745 - generator.ExportToAAMA(details); + generator.SetXScale(m_dialogSaveLayout->GetXScale()); + generator.SetYScale(m_dialogSaveLayout->GetYScale()); + generator.ExportToASTM(details); } QT_WARNING_POP @@ -1437,6 +1501,17 @@ void MainWindowsNoGUI::PreparePaper(int index) const shadows.at(index)->setVisible(false); paper->setPen(QPen(Qt::white, 0.1, Qt::NoPen));// border } + + QTransform matrix; + matrix.scale(m_xscale, m_yscale); + + QList paperDetails = details.at(index); + for (auto detail : paperDetails) + { + QTransform m = detail->transform(); + m *= matrix; + detail->setTransform(m); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -1451,6 +1526,17 @@ void MainWindowsNoGUI::RestorePaper(int index) const scenes.at(index)->setBackgroundBrush(brush); shadows.at(index)->setVisible(true); } + + QTransform matrix; + matrix.scale(1./m_xscale, 1./m_yscale); + + QList paperDetails = details.at(index); + for (auto detail : paperDetails) + { + QTransform m = detail->transform(); + m *= matrix; + detail->setTransform(m); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -1541,8 +1627,19 @@ void MainWindowsNoGUI::PrintPreview() return; } + { + DialogLayoutScale layoutScale(isTiled, this); + layoutScale.SetXScale(1); + layoutScale.SetYScale(1); + layoutScale.exec(); + + m_xscale = layoutScale.GetXScale(); + m_yscale = layoutScale.GetYScale(); + } + SetPrinterSettings(printer.data(), PrintType::PrintPreview); printer->setResolution(static_cast(PrintDPI)); + // display print preview dialog QPrintPreviewDialog preview(printer.data()); connect(&preview, &QPrintPreviewDialog::paintRequested, this, &MainWindowsNoGUI::PrintPages); @@ -1573,6 +1670,16 @@ void MainWindowsNoGUI::LayoutPrint() return; } + { + DialogLayoutScale layoutScale(isTiled, this); + layoutScale.SetXScale(1); + layoutScale.SetYScale(1); + layoutScale.exec(); + + m_xscale = layoutScale.GetXScale(); + m_yscale = layoutScale.GetYScale(); + } + SetPrinterSettings(printer.data(), PrintType::PrintNative); QPrintDialog dialog(printer.data(), this ); // If only user couldn't change page margins we could use method setMinMax(); diff --git a/src/app/valentina/mainwindowsnogui.h b/src/app/valentina/mainwindowsnogui.h index 7e9e289dd..77a69eb86 100644 --- a/src/app/valentina/mainwindowsnogui.h +++ b/src/app/valentina/mainwindowsnogui.h @@ -162,6 +162,9 @@ private: QString layoutPrinterName; + qreal m_xscale{1}; + qreal m_yscale{1}; + static QList CreateShadows(const QList &papers); static QList CreateScenes(const QList &papers, const QList &shadows, @@ -182,6 +185,8 @@ private: const QList > &details)const; void AAMADxfFile(const QString &name, int version, bool binary, const QSize &size, const QVector &details) const; + void ASTMDxfFile(const QString &name, int version, bool binary, const QSize &size, + const QVector &details) const; void PreparePaper(int index) const; void RestorePaper(int index) const; diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 53387a7e1..763ae9415 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -3450,6 +3450,22 @@ void VPattern::GarbageCollector(bool commit) { modElement.removeChild(modNode); cleared = true; + + // Clear history + try + { + vidtype id = GetParametrId(modNode); + auto record = std::find_if(history.begin(), history.end(), + [id](const VToolRecord &record) { return record.getId() == id; }); + if (record != history.end()) + { + history.erase(record); + } + } + catch(const VExceptionWrongId &) + { + // do nothing + } } } } diff --git a/src/libs/ifc/schema.qrc b/src/libs/ifc/schema.qrc index bf0597e5d..5d41d6883 100644 --- a/src/libs/ifc/schema.qrc +++ b/src/libs/ifc/schema.qrc @@ -58,6 +58,7 @@ schema/pattern/v0.8.4.xsd schema/pattern/v0.8.5.xsd schema/pattern/v0.8.6.xsd + schema/pattern/v0.8.7.xsd schema/standard_measurements/v0.3.0.xsd schema/standard_measurements/v0.4.0.xsd schema/standard_measurements/v0.4.1.xsd diff --git a/src/libs/ifc/schema/pattern/v0.8.7.xsd b/src/libs/ifc/schema/pattern/v0.8.7.xsd new file mode 100644 index 000000000..26e7571a0 --- /dev/null +++ b/src/libs/ifc/schema/pattern/v0.8.7.xsd @@ -0,0 +1,1254 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index 1f010cc0d..c45c7a026 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -135,7 +135,8 @@ const QString VAbstractPattern::AttrNumber = QStringLiteral("number") const QString VAbstractPattern::AttrCheckUniqueness = QStringLiteral("checkUniqueness"); const QString VAbstractPattern::AttrManualPassmarkLength = QStringLiteral("manualPassmarkLength"); const QString VAbstractPattern::AttrPassmarkLength = QStringLiteral("passmarkLength"); -const QString VAbstractPattern::AttrOpacity = QStringLiteral("opacity"); +const QString VAbstractPattern::AttrOpacity = QStringLiteral("opacity"); +const QString VAbstractPattern::AttrTags = QStringLiteral("tags"); const QString VAbstractPattern::AttrAll = QStringLiteral("all"); @@ -283,6 +284,17 @@ QMap AdjustMaterials(QMap materials) return materials; } + +//--------------------------------------------------------------------------------------------------------------------- +QString PrepareGroupTags(QStringList tags) +{ + for (auto &tag : tags) + { + tag = tag.simplified(); + } + + return ConvertToList(ConvertToSet(tags)).join(','); +} } //--------------------------------------------------------------------------------------------------------------------- @@ -1730,6 +1742,12 @@ void VAbstractPattern::SelectedDetail(quint32 id) emit ShowDetail(id); } +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractPattern::UpdateVisiblityGroups() +{ + emit UpdateGroups(); +} + //--------------------------------------------------------------------------------------------------------------------- void VAbstractPattern::ToolExists(const quint32 &id) { @@ -2422,17 +2440,22 @@ QDomElement VAbstractPattern::CreateGroups() } //--------------------------------------------------------------------------------------------------------------------- -QDomElement VAbstractPattern::CreateGroup(quint32 id, const QString &name, const QMap &groupData) +QDomElement VAbstractPattern::CreateGroup(quint32 id, const QString &name, const QStringList &tags, + const QMap &groupData, vidtype tool) { if (id == NULL_ID || groupData.isEmpty()) { return QDomElement(); } + const QString preparedTags = PrepareGroupTags(tags); + QDomElement group = createElement(TagGroup); SetAttribute(group, AttrId, id); SetAttribute(group, AttrName, name); SetAttribute(group, AttrVisible, true); + SetAttributeOrRemoveIf(group, AttrTool, tool, tool == null_id); + SetAttributeOrRemoveIf(group, AttrTags, preparedTags, preparedTags.isEmpty()); auto i = groupData.constBegin(); while (i != groupData.constEnd()) @@ -2446,73 +2469,102 @@ QDomElement VAbstractPattern::CreateGroup(quint32 id, const QString &name, const return group; } +//--------------------------------------------------------------------------------------------------------------------- +vidtype VAbstractPattern::GroupLinkedToTool(vidtype toolId) const +{ + const QDomNodeList groups = elementsByTagName(TagGroup); + for (int i=0; i < groups.size(); ++i) + { + const QDomElement group = groups.at(i).toElement(); + if (not group.isNull() && group.hasAttribute(AttrTool)) + { + const quint32 id = GetParametrUInt(group, AttrTool, NULL_ID_STR); + + if (toolId == id) + { + return GetParametrUInt(group, AttrId, NULL_ID_STR); + } + } + } + + return null_id; +} //--------------------------------------------------------------------------------------------------------------------- QString VAbstractPattern::GetGroupName(quint32 id) { QString name = tr("New group"); - QDomElement groups = CreateGroups(); - if (not groups.isNull()) + QDomElement group = elementById(id, TagGroup); + if (group.isElement()) { - QDomElement group = elementById(id, TagGroup); - if (group.isElement()) - { - name = GetParametrString(group, AttrName, name); - return name; - } - else - { - if (groups.childNodes().isEmpty()) - { - QDomNode parent = groups.parentNode(); - parent.removeChild(groups); - } + name = GetParametrString(group, AttrName, name); - qDebug("Can't get group by id = %u.", id); - return name; - } - } - else - { - qDebug("Can't get tag Groups."); - return name; } + + return name; } //--------------------------------------------------------------------------------------------------------------------- void VAbstractPattern::SetGroupName(quint32 id, const QString &name) { - QDomElement groups = CreateGroups(); - if (not groups.isNull()) + QDomElement group = elementById(id, TagGroup); + if (group.isElement()) { - QDomElement group = elementById(id, TagGroup); - if (group.isElement()) - { - group.setAttribute(AttrName, name); - modified = true; - emit patternChanged(false); - } - else - { - if (groups.childNodes().isEmpty()) - { - QDomNode parent = groups.parentNode(); - parent.removeChild(groups); - } - - qDebug("Can't get group by id = %u.", id); - } - } - else - { - qDebug("Can't get tag Groups."); + group.setAttribute(AttrName, name); + modified = true; + emit patternChanged(false); } } //--------------------------------------------------------------------------------------------------------------------- -QMap > VAbstractPattern::GetGroups() +QStringList VAbstractPattern::GetGroupTags(vidtype id) { - QMap > data; + QStringList tags; + QDomElement group = elementById(id, TagGroup); + if (group.isElement()) + { + tags = FilterGroupTags(GetParametrEmptyString(group, AttrTags)); + } + + return tags; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractPattern::SetGroupTags(quint32 id, const QStringList &tags) +{ + QDomElement group = elementById(id, TagGroup); + if (group.isElement()) + { + const QString rawTags = tags.join(','); + SetAttributeOrRemoveIf(group, AttrTags, rawTags, rawTags.isEmpty()); + modified = true; + emit patternChanged(false); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +QStringList VAbstractPattern::GetGroupCategories() const +{ + QSet categories; + + const QDomNodeList groups = elementsByTagName(TagGroup); + for (int i=0; i < groups.size(); ++i) + { + const QDomElement group = groups.at(i).toElement(); + if (not group.isNull() && group.hasAttribute(AttrTags)) + { + QStringList groupTags = VAbstractPattern::FilterGroupTags(GetParametrEmptyString(group, AttrTags)); + categories.unite(ConvertToSet(groupTags)); + } + } + + return ConvertToList(categories); +} + +//--------------------------------------------------------------------------------------------------------------------- +QMap VAbstractPattern::GetGroups() +{ + QMap data; try { @@ -2529,11 +2581,13 @@ QMap > VAbstractPattern::GetGroups() { if (group.tagName() == TagGroup) { + VGroupData groupData; const quint32 id = GetParametrUInt(group, AttrId, QChar('0')); - const bool visible = GetParametrBool(group, AttrVisible, trueStr); - const QString name = GetParametrString(group, AttrName, tr("New group")); + groupData.visible = GetParametrBool(group, AttrVisible, trueStr); + groupData.name = GetParametrString(group, AttrName, tr("New group")); + groupData.tags = FilterGroupTags(GetParametrEmptyString(group, AttrTags)); - data.insert(id, qMakePair(name, visible)); + data.insert(id, groupData); } } } @@ -2547,7 +2601,7 @@ QMap > VAbstractPattern::GetGroups() } catch (const VExceptionConversionError &) { - return QMap >(); + return QMap(); } return data; @@ -2804,3 +2858,22 @@ QString VAbstractPattern::PieceDrawName(quint32 id) return draw.attribute(VAbstractPattern::AttrName); } + +//--------------------------------------------------------------------------------------------------------------------- +QStringList VAbstractPattern::FilterGroupTags(const QString &tags) +{ + if (tags.isEmpty()) + { + return QStringList(); + } + + QStringList list = tags.split(','); + for (auto &tag : list) + { + tag = tag.simplified(); + } + + list.removeAll(""); + + return ConvertToList(ConvertToSet(list)); +} diff --git a/src/libs/ifc/xml/vabstractpattern.h b/src/libs/ifc/xml/vabstractpattern.h index 55167d2d0..6a3b7a981 100644 --- a/src/libs/ifc/xml/vabstractpattern.h +++ b/src/libs/ifc/xml/vabstractpattern.h @@ -78,6 +78,13 @@ struct VFinalMeasurement QString description; }; +struct VGroupData +{ + QString name{}; + bool visible{true}; + QStringList tags{}; +}; + QT_WARNING_POP class VAbstractPattern : public VDomDocument @@ -200,16 +207,27 @@ public: void ParseGroups(const QDomElement &domElement); QDomElement CreateGroups(); - QDomElement CreateGroup(quint32 id, const QString &name, const QMap &groupData); + QDomElement CreateGroup(quint32 id, const QString &name, const QStringList &tags, + const QMap &groupData, vidtype tool=null_id); + vidtype GroupLinkedToTool(vidtype toolId) const; + QString GetGroupName(quint32 id); void SetGroupName(quint32 id, const QString &name); - QMap > GetGroups(); + + QStringList GetGroupTags(vidtype id); + void SetGroupTags(quint32 id, const QStringList &tags); + + QStringList GetGroupCategories() const; + + QMap GetGroups(); QMap GetGroupsContainingItem(quint32 toolId, quint32 objectId, bool containItem); QDomElement AddItemToGroup(quint32 toolId, quint32 objectId, quint32 groupId); QDomElement RemoveItemFromGroup(quint32 toolId, quint32 objectId, quint32 groupId); bool GroupIsEmpty(quint32 id); bool GetGroupVisibility(quint32 id); + static QStringList FilterGroupTags(const QString &tags); + QString PieceDrawName(quint32 id); static const QString TagPattern; @@ -288,6 +306,7 @@ public: static const QString AttrManualPassmarkLength; static const QString AttrPassmarkLength; static const QString AttrOpacity; + static const QString AttrTags; static const QString AttrAll; @@ -404,7 +423,8 @@ signals: /** * @brief UpdateGroups emit if the groups have been updated */ - void UpdateGroups(); + void UpdateGroups(); + void UpdateToolTip(); public slots: virtual void LiteParseTree(const Document &parse)=0; @@ -413,6 +433,7 @@ public slots: void ClearScene(); void CheckInLayoutList(); void SelectedDetail(quint32 id); + void UpdateVisiblityGroups(); protected: /** @brief nameActivDraw name current pattern peace. */ diff --git a/src/libs/ifc/xml/vdomdocument.cpp b/src/libs/ifc/xml/vdomdocument.cpp index 40941545d..cd0733d4c 100644 --- a/src/libs/ifc/xml/vdomdocument.cpp +++ b/src/libs/ifc/xml/vdomdocument.cpp @@ -264,7 +264,7 @@ VDomDocument::~VDomDocument() } //--------------------------------------------------------------------------------------------------------------------- -QDomElement VDomDocument::elementById(quint32 id, const QString &tagName) +QDomElement VDomDocument::elementById(quint32 id, const QString &tagName, bool updateCache) { if (id == 0) { @@ -273,16 +273,27 @@ QDomElement VDomDocument::elementById(quint32 id, const QString &tagName) if (m_elementIdCache.contains(id)) { - const QDomElement e = m_elementIdCache.value(id); - if (e.parentNode().nodeType() != QDomNode::BaseNode) - { - return e; - } - m_elementIdCache.remove(id); + const QDomElement e = m_elementIdCache.value(id); + if (e.parentNode().nodeType() != QDomNode::BaseNode) + { + if (not tagName.isEmpty()) + { + if (e.tagName() == tagName) + { + return e; + } + } + else + { + return e; + } + } } - // Cached missed - RefreshElementIdCache(); + if (updateCache) + { // Cached missed + RefreshElementIdCache(); + } if (tagName.isEmpty()) { @@ -290,10 +301,8 @@ QDomElement VDomDocument::elementById(quint32 id, const QString &tagName) QHash tmpCache; if (VDomDocument::find(tmpCache, this->documentElement(), id)) { - m_elementIdCache = tmpCache; - return m_elementIdCache.value(id); + return tmpCache.value(id); } - m_elementIdCache = tmpCache; } else { @@ -305,7 +314,6 @@ QDomElement VDomDocument::elementById(quint32 id, const QString &tagName) { const quint32 elementId = GetParametrUInt(domElement, AttrId, NULL_ID_STR); - m_elementIdCache.insert(elementId, domElement); if (elementId == id) { return domElement; diff --git a/src/libs/ifc/xml/vdomdocument.h b/src/libs/ifc/xml/vdomdocument.h index ed3b2f108..238851546 100644 --- a/src/libs/ifc/xml/vdomdocument.h +++ b/src/libs/ifc/xml/vdomdocument.h @@ -96,7 +96,7 @@ public: explicit VDomDocument(QObject *parent = nullptr); virtual ~VDomDocument(); - QDomElement elementById(quint32 id, const QString &tagName = QString()); + QDomElement elementById(quint32 id, const QString &tagName = QString(), bool updateCache=true); template void SetAttribute(QDomElement &domElement, const QString &name, const T &value) const; diff --git a/src/libs/ifc/xml/vpatternconverter.cpp b/src/libs/ifc/xml/vpatternconverter.cpp index 1c29121a5..a38a9dbfc 100644 --- a/src/libs/ifc/xml/vpatternconverter.cpp +++ b/src/libs/ifc/xml/vpatternconverter.cpp @@ -59,8 +59,8 @@ class QDomElement; */ const QString VPatternConverter::PatternMinVerStr = QStringLiteral("0.1.4"); -const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.8.6"); -const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.8.6.xsd"); +const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.8.7"); +const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.8.7.xsd"); //VPatternConverter::PatternMinVer; // <== DON'T FORGET TO UPDATE TOO!!!! //VPatternConverter::PatternMaxVer; // <== DON'T FORGET TO UPDATE TOO!!!! @@ -236,7 +236,8 @@ QString VPatternConverter::XSDSchema(int ver) const std::make_pair(FORMAT_VERSION(0, 8, 3), QStringLiteral("://schema/pattern/v0.8.3.xsd")), std::make_pair(FORMAT_VERSION(0, 8, 4), QStringLiteral("://schema/pattern/v0.8.4.xsd")), std::make_pair(FORMAT_VERSION(0, 8, 5), QStringLiteral("://schema/pattern/v0.8.5.xsd")), - std::make_pair(FORMAT_VERSION(0, 8, 6), CurrentSchema) + std::make_pair(FORMAT_VERSION(0, 8, 6), QStringLiteral("://schema/pattern/v0.8.6.xsd")), + std::make_pair(FORMAT_VERSION(0, 8, 7), CurrentSchema) }; if (schemas.contains(ver)) @@ -481,6 +482,10 @@ void VPatternConverter::ApplyPatches() ValidateXML(XSDSchema(FORMAT_VERSION(0, 8, 6))); Q_FALLTHROUGH(); case (FORMAT_VERSION(0, 8, 6)): + ToV0_8_7(); + ValidateXML(XSDSchema(FORMAT_VERSION(0, 8, 7))); + Q_FALLTHROUGH(); + case (FORMAT_VERSION(0, 8, 7)): break; default: InvalidVersion(m_ver); @@ -498,7 +503,7 @@ void VPatternConverter::DowngradeToCurrentMaxVersion() bool VPatternConverter::IsReadOnly() const { // Check if attribute readOnly was not changed in file format - Q_STATIC_ASSERT_X(VPatternConverter::PatternMaxVer == FORMAT_VERSION(0, 8, 6), + Q_STATIC_ASSERT_X(VPatternConverter::PatternMaxVer == FORMAT_VERSION(0, 8, 7), "Check attribute readOnly."); // Possibly in future attribute readOnly will change position etc. @@ -1128,6 +1133,16 @@ void VPatternConverter::ToV0_8_6() Save(); } +//--------------------------------------------------------------------------------------------------------------------- +void VPatternConverter::ToV0_8_7() +{ + // TODO. Delete if minimal supported version is 0.8.7 + Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FORMAT_VERSION(0, 8, 7), + "Time to refactor the code."); + SetVersion(QStringLiteral("0.8.7")); + Save(); +} + //--------------------------------------------------------------------------------------------------------------------- void VPatternConverter::TagUnitToV0_2_0() { diff --git a/src/libs/ifc/xml/vpatternconverter.h b/src/libs/ifc/xml/vpatternconverter.h index 944820654..1adaabee3 100644 --- a/src/libs/ifc/xml/vpatternconverter.h +++ b/src/libs/ifc/xml/vpatternconverter.h @@ -53,7 +53,7 @@ public: static const QString PatternMaxVerStr; static const QString CurrentSchema; static Q_DECL_CONSTEXPR const int PatternMinVer = FORMAT_VERSION(0, 1, 4); - static Q_DECL_CONSTEXPR const int PatternMaxVer = FORMAT_VERSION(0, 8, 6); + static Q_DECL_CONSTEXPR const int PatternMaxVer = FORMAT_VERSION(0, 8, 7); protected: virtual int MinVer() const override; @@ -129,6 +129,7 @@ private: void ToV0_8_4(); void ToV0_8_5(); void ToV0_8_6(); + void ToV0_8_7(); void TagUnitToV0_2_0(); void TagIncrementToV0_2_0(); diff --git a/src/libs/vdxf/dxiface.cpp b/src/libs/vdxf/dxiface.cpp index fb7b743ef..88372d63f 100644 --- a/src/libs/vdxf/dxiface.cpp +++ b/src/libs/vdxf/dxiface.cpp @@ -43,9 +43,12 @@ bool dx_iface::fileExport(bool binary) void dx_iface::writeEntity(DRW_Entity* e){ switch (e->eType) { - case DRW::POINT: + case DRW::POINT: dxfW->writePoint(static_cast(e)); break; + case DRW::ASTMNOTCH: + dxfW->writeASTMNotch(static_cast(e)); + break; case DRW::LINE: dxfW->writeLine(static_cast(e)); break; @@ -283,6 +286,107 @@ void dx_iface::AddAAMAHeaderData() cData.headerC.addStr("$CLAYER", "1", 8); // Current layer name } +void dx_iface::AddASTMLayers() +{ + DRW_Layer layer; + + layer.name = '1';// piece boundary + layer.color = DRW::black; + cData.layers.push_back(layer); + + // Do not support +// layer.name = '2';// turn points +// layer.color = DRW::black; +// cData.layers.push_back(layer); + + // Do not support +// layer.name = '3';// curve points +// layer.color = DRW::black; +// cData.layers.push_back(layer); + + layer.name = '4';// V-notch and slit notch + layer.color = DRW::black; + cData.layers.push_back(layer); + + // Do not support +// layer.name = '5';// grade reference and alternate grade reference line(s) +// layer.color = DRW::black; +// cData.layers.push_back(layer); + + // Do not support +// layer.name = '6';// mirror line +// layer.color = DRW::black; +// cData.layers.push_back(layer); + + layer.name = '7';// grainline + layer.color = DRW::black; + cData.layers.push_back(layer); + + layer.name = '8';// internal line(s) + layer.color = DRW::black; + cData.layers.push_back(layer); + + // Do not support +// layer.name = '9';// stripe reference line(s) +// layer.color = DRW::black; +// cData.layers.push_back(layer); + + // Do not support +// layer.name = '10';// plaid reference line(s) +// layer.color = DRW::black; +// cData.layers.push_back(layer); + + layer.name = "11";// internal cutout(s) + layer.color = DRW::black; + cData.layers.push_back(layer); + + // Layer 12 intentionally left blank by the standard + + layer.name = "13";// drill holes + layer.color = DRW::black; + cData.layers.push_back(layer); + + layer.name = "14";// sew line(s) + layer.color = DRW::black; + cData.layers.push_back(layer); + + layer.name = "15";// annotation text + layer.color = DRW::black; + cData.layers.push_back(layer); + + layer.name = "80";// T-notch + layer.color = DRW::black; + cData.layers.push_back(layer); + + layer.name = "81";// castle notch + layer.color = DRW::black; + cData.layers.push_back(layer); + + layer.name = "82";// check notch + layer.color = DRW::black; + cData.layers.push_back(layer); + + layer.name = "83";// U-notch + layer.color = DRW::black; + cData.layers.push_back(layer); + + layer.name = "84";// piece boundary quality validation curves + layer.color = DRW::black; + cData.layers.push_back(layer); + + layer.name = "85";// internal lines quality validation curves + layer.color = DRW::black; + cData.layers.push_back(layer); + + layer.name = "86";// internal cutouts quality validation curves + layer.color = DRW::black; + cData.layers.push_back(layer); + + layer.name = "87";// sew lines quality validation curves + layer.color = DRW::black; + cData.layers.push_back(layer); +} + void dx_iface::AddDefLayers() { DRW_Layer defLayer; diff --git a/src/libs/vdxf/dxiface.h b/src/libs/vdxf/dxiface.h index 15adc34f3..78c9b11d2 100644 --- a/src/libs/vdxf/dxiface.h +++ b/src/libs/vdxf/dxiface.h @@ -124,6 +124,7 @@ public: void AddDefLayers(); void AddAAMALayers(); void AddAAMAHeaderData(); + void AddASTMLayers(); private: Q_DISABLE_COPY(dx_iface) diff --git a/src/libs/vdxf/libdxfrw/drw_entities.cpp b/src/libs/vdxf/libdxfrw/drw_entities.cpp index 8f2c8a677..1450a07dc 100644 --- a/src/libs/vdxf/libdxfrw/drw_entities.cpp +++ b/src/libs/vdxf/libdxfrw/drw_entities.cpp @@ -224,6 +224,18 @@ void DRW_Point::parseCode(int code, dxfReader *reader){ } } +void DRW_ASTMNotch::parseCode(int code, dxfReader *reader) +{ + switch (code) { + case 50: + angle = reader->getDouble(); + break; + default: + DRW_Point::parseCode(code, reader); + break; + } +} + void DRW_Line::parseCode(int code, dxfReader *reader){ switch (code) { case 11: diff --git a/src/libs/vdxf/libdxfrw/drw_entities.h b/src/libs/vdxf/libdxfrw/drw_entities.h index 1b4719a94..667007d2a 100644 --- a/src/libs/vdxf/libdxfrw/drw_entities.h +++ b/src/libs/vdxf/libdxfrw/drw_entities.h @@ -80,6 +80,7 @@ namespace DRW { VIEWPORT, // WIPEOUT, //WIPEOUTVARIABLE XLINE, + ASTMNOTCH, // ASTM NOTCH UNKNOWN }; @@ -251,6 +252,22 @@ public: // the UCS in effect when the point was drawn }; + +class DRW_ASTMNotch : public DRW_Point { + SETENTFRIENDS +public: + DRW_ASTMNotch() + { + eType = DRW::ASTMNOTCH; + } + +protected: + void parseCode(int code, dxfReader *reader); + +public: + double angle{0}; /*!< angle, code 50 */ +}; + //! Class to handle line entity /*! * Class to handle line entity diff --git a/src/libs/vdxf/libdxfrw/libdxfrw.cpp b/src/libs/vdxf/libdxfrw/libdxfrw.cpp index 3f775a573..3f74513ba 100644 --- a/src/libs/vdxf/libdxfrw/libdxfrw.cpp +++ b/src/libs/vdxf/libdxfrw/libdxfrw.cpp @@ -553,6 +553,15 @@ bool dxfRW::writePoint(DRW_Point *ent) { return true; } +bool dxfRW::writeASTMNotch(DRW_ASTMNotch *ent) +{ + writePoint(ent); + writer->writeDouble(50, ent->angle); + writer->writeDouble(39, ent->thickness); // Defined, but not used in point + + return true; +} + bool dxfRW::writeLine(DRW_Line *ent) { writer->writeString(0, "LINE"); writeEntity(ent); diff --git a/src/libs/vdxf/libdxfrw/libdxfrw.h b/src/libs/vdxf/libdxfrw/libdxfrw.h index 6e3e17679..fa20baced 100644 --- a/src/libs/vdxf/libdxfrw/libdxfrw.h +++ b/src/libs/vdxf/libdxfrw/libdxfrw.h @@ -47,6 +47,7 @@ public: bool writeVport(DRW_Vport *ent); bool writeAppId(DRW_AppId *ent); bool writePoint(DRW_Point *ent); + bool writeASTMNotch(DRW_ASTMNotch *ent); bool writeLine(DRW_Line *ent); bool writeRay(DRW_Ray *ent); bool writeXline(DRW_Xline *ent); diff --git a/src/libs/vdxf/vdxfengine.cpp b/src/libs/vdxf/vdxfengine.cpp index af8f5546b..f023ea186 100644 --- a/src/libs/vdxf/vdxfengine.cpp +++ b/src/libs/vdxf/vdxfengine.cpp @@ -55,6 +55,23 @@ static const qreal AAMATextHeight = 2.5; +namespace +{ +QVector PieceOutline(const VLayoutPiece &detail) +{ + QVector outline; + if (detail.IsSeamAllowance() && not detail.IsSeamAllowanceBuiltIn()) + { + outline = detail.GetMappedSeamAllowancePoints(); + } + else + { + outline = detail.GetMappedContourPoints(); + } + return outline; +} +} + //--------------------------------------------------------------------------------------------------------------------- static inline QPaintEngine::PaintEngineFeatures svgEngineFeatures() { @@ -570,6 +587,30 @@ void VDxfEngine::setInsunits(const VarInsunits &var) varInsunits = var; } +//--------------------------------------------------------------------------------------------------------------------- +qreal VDxfEngine::GetXScale() const +{ + return m_xscale; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VDxfEngine::SetXScale(const qreal &xscale) +{ + m_xscale = xscale; +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal VDxfEngine::GetYScale() const +{ + return m_yscale; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VDxfEngine::SetYScale(const qreal &yscale) +{ + m_yscale = yscale; +} + //--------------------------------------------------------------------------------------------------------------------- QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wswitch-default") @@ -623,9 +664,9 @@ bool VDxfEngine::ExportToAAMA(const QVector &details) } input->AddAAMALayers(); - ExportAAMAGlobalText(input, details); + ExportStyleSystemText(input, details); - for(auto &detail : details) + for(auto detail : details) { dx_ifaceBlock *detailBlock = new dx_ifaceBlock(); @@ -638,12 +679,14 @@ bool VDxfEngine::ExportToAAMA(const QVector &details) detailBlock->name = blockName.toStdString(); detailBlock->layer = '1'; + detail.Scale(m_xscale, m_yscale); + ExportAAMAOutline(detailBlock, detail); ExportAAMADraw(detailBlock, detail); ExportAAMAIntcut(detailBlock, detail); ExportAAMANotch(detailBlock, detail); ExportAAMAGrainline(detailBlock, detail); - ExportAAMAText(detailBlock, detail); + ExportPieceText(detailBlock, detail); ExportAAMADrill(detailBlock, detail); input->AddBlock(detailBlock); @@ -661,17 +704,7 @@ bool VDxfEngine::ExportToAAMA(const QVector &details) //--------------------------------------------------------------------------------------------------------------------- void VDxfEngine::ExportAAMAOutline(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail) { - QVector outline; - if (detail.IsSeamAllowance() && not detail.IsSeamAllowanceBuiltIn()) - { - outline = detail.GetMappedSeamAllowancePoints(); - } - else - { - outline = detail.GetMappedContourPoints(); - } - - DRW_Entity *e = AAMAPolygon(outline, QChar('1'), true); + DRW_Entity *e = AAMAPolygon(PieceOutline(detail), QChar('1'), true); if (e) { detailBlock->ent.push_back(e); @@ -761,20 +794,20 @@ void VDxfEngine::ExportAAMAGrainline(dx_ifaceBlock *detailBlock, const VLayoutPi } //--------------------------------------------------------------------------------------------------------------------- -void VDxfEngine::ExportAAMAText(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail) +void VDxfEngine::ExportPieceText(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail) { const QStringList list = detail.GetPieceText(); const QPointF startPos = detail.GetPieceTextPosition(); for (int i = 0; i < list.size(); ++i) { - QPointF pos(startPos.x(), startPos.y() - ToPixel(AAMATextHeight, varInsunits)*(list.size() - i-1)); + QPointF pos(startPos.x(), startPos.y() - ToPixel(AAMATextHeight * m_yscale, varInsunits)*(list.size() - i-1)); detailBlock->ent.push_back(AAMAText(pos, list.at(i), QChar('1'))); } } //--------------------------------------------------------------------------------------------------------------------- -void VDxfEngine::ExportAAMAGlobalText(const QSharedPointer &input, const QVector &details) +void VDxfEngine::ExportStyleSystemText(const QSharedPointer &input, const QVector &details) { for(auto &detail : details) { @@ -783,7 +816,8 @@ void VDxfEngine::ExportAAMAGlobalText(const QSharedPointer &input, con { for (int j = 0; j < strings.size(); ++j) { - QPointF pos(0, getSize().height() - ToPixel(AAMATextHeight, varInsunits)*(strings.size() - j-1)); + QPointF pos(0, getSize().height() - + ToPixel(AAMATextHeight * m_yscale, varInsunits)*(strings.size() - j-1)); input->AddEntity(AAMAText(pos, strings.at(j), QChar('1'))); } return; @@ -812,6 +846,263 @@ void VDxfEngine::ExportAAMADrill(dx_ifaceBlock *detailBlock, const VLayoutPiece } } +//--------------------------------------------------------------------------------------------------------------------- +bool VDxfEngine::ExportToASTM(const QVector &details) +{ + if (size.isValid() == false) + { + qWarning()<<"VDxfEngine::begin(), size is not valid"; + return false; + } + + input = QSharedPointer(new dx_iface(getFileNameForLocale(), m_version, varMeasurement, + varInsunits)); + + input->AddAAMAHeaderData(); + if (m_version > DRW::AC1009) + { + input->AddDefLayers(); + } + input->AddASTMLayers(); + + ExportStyleSystemText(input, details); + + for(auto detail : details) + { + dx_ifaceBlock *detailBlock = new dx_ifaceBlock(); + + QString blockName = detail.GetName(); + if (m_version <= DRW::AC1009) + { + blockName.replace(' ', '_'); + } + + detailBlock->name = blockName.toStdString(); + detailBlock->layer = '1'; + + detail.Scale(m_xscale, m_yscale); + + ExportASTMPieceBoundary(detailBlock, detail); + ExportASTMSewLine(detailBlock, detail); + ExportASTMInternalLine(detailBlock, detail); + ExportASTMInternalCutout(detailBlock, detail); + ExportASTMNotch(detailBlock, detail); + ExportAAMAGrainline(detailBlock, detail); + ExportPieceText(detailBlock, detail); + ExportASTMDrill(detailBlock, detail); + ExportASTMAnnotationText(detailBlock, detail); + + input->AddBlock(detailBlock); + + DRW_Insert *insert = new DRW_Insert(); + insert->name = blockName.toStdString(); + insert->layer = '1'; + + input->AddEntity(insert); + } + + return input->fileExport(m_binary); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VDxfEngine::ExportASTMPieceBoundary(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail) +{ + QVector pieceBoundary = PieceOutline(detail); + + // Piece boundary + DRW_Entity *e = AAMAPolygon(PieceOutline(detail), QChar('1'), true); + if (e) + { + detailBlock->ent.push_back(e); + } + + // Piece boundary quality validation curves + DRW_Entity *q = AAMAPolygon(PieceOutline(detail), "84", true); + if (q) + { + detailBlock->ent.push_back(q); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VDxfEngine::ExportASTMSewLine(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail) +{ + if (not detail.IsHideMainPath() && not detail.IsSeamAllowanceBuiltIn()) + { + QVector sewLine = detail.GetMappedContourPoints(); + + // Sew lines + if (DRW_Entity *e = AAMAPolygon(sewLine, "14", true)) + { + detailBlock->ent.push_back(e); + } + + // Sew lines quality validation curves + if (DRW_Entity *e = AAMAPolygon(sewLine, "87", true)) + { + detailBlock->ent.push_back(e); + } + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VDxfEngine::ExportASTMInternalLine(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail) +{ + const QVector> drawIntCut = detail.InternalPathsForCut(false); + for(auto &intCut : drawIntCut) + { + // Internal line + if (DRW_Entity *e = AAMAPolygon(intCut, QChar('8'), false)) + { + detailBlock->ent.push_back(e); + } + + // Internal lines quality validation curves + if (DRW_Entity *e = AAMAPolygon(intCut, "85", false)) + { + detailBlock->ent.push_back(e); + } + } + + const QVector labels = detail.GetPlaceLabels(); + for(auto &label : labels) + { + if (label.type != PlaceLabelType::Doubletree && label.type != PlaceLabelType::Button + && label.type != PlaceLabelType::Circle) + { + for(auto &p : qAsConst(label.shape)) + { + // Internal line (placelabel) + if (DRW_Entity *e = AAMAPolygon(p, QChar('8'), false)) + { + detailBlock->ent.push_back(e); + } + + // Internal lines quality validation curves + if (DRW_Entity *e = AAMAPolygon(p, "85", false)) + { + detailBlock->ent.push_back(e); + } + } + } + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VDxfEngine::ExportASTMInternalCutout(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail) +{ + QVector> drawIntCut = detail.InternalPathsForCut(true); + for(auto &intCut : drawIntCut) + { + // Internal cutout + if (DRW_Entity *e = AAMAPolygon(intCut, "11", false)) + { + detailBlock->ent.push_back(e); + } + + // Internal cutouts quality validation curves + if (DRW_Entity *e = AAMAPolygon(intCut, "86", false)) + { + detailBlock->ent.push_back(e); + } + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VDxfEngine::ExportASTMAnnotationText(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail) +{ + QString name = detail.GetName(); + QPointF textPos = detail.VLayoutPiece::DetailBoundingRect().center(); + + QPointF pos(textPos.x(), textPos.y() - ToPixel(AAMATextHeight, varInsunits)); + detailBlock->ent.push_back(AAMAText(pos, name, "15")); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VDxfEngine::ExportASTMDrill(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail) +{ + const QVector labels = detail.GetPlaceLabels(); + + for(auto &label : labels) + { + if (label.type == PlaceLabelType::Doubletree || label.type == PlaceLabelType::Button + || label.type == PlaceLabelType::Circle) + { + const QPointF center = detail.GetMatrix().map(label.center); + DRW_Point *point = new DRW_Point(); + point->basePoint = DRW_Coord(FromPixel(center.x(), varInsunits), + FromPixel(getSize().height() - center.y(), varInsunits), 0); + point->layer = "13"; + + detailBlock->ent.push_back(point); + + // TODO. Investigate drill category +// QPointF pos(center.x(), center.y() - ToPixel(AAMATextHeight, varInsunits)); +// detailBlock->ent.push_back(AAMAText(pos, category, "13")); + } + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VDxfEngine::ExportASTMNotch(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail) +{ + if (detail.IsSeamAllowance()) + { + const QVector passmarks = detail.GetPassmarks(); + for(auto &passmark : passmarks) + { + DRW_ASTMNotch *notch = new DRW_ASTMNotch(); + const QPointF center = passmark.baseLine.p1(); + + notch->basePoint = DRW_Coord(FromPixel(center.x(), varInsunits), + FromPixel(getSize().height() - center.y(), varInsunits), + FromPixel(passmark.baseLine.length(), varInsunits)); + + notch->angle = passmark.baseLine.angle(); + + if (passmark.type == PassmarkLineType::OneLine || passmark.type == PassmarkLineType::TwoLines + || passmark.type == PassmarkLineType::ThreeLines) + { // Slit notch + notch->layer = "4"; + } + else if (passmark.type == PassmarkLineType::VMark || passmark.type == PassmarkLineType::VMark2) + { + QLineF boundaryLine = QLineF(passmark.lines.first().p2(), passmark.lines.last().p2()); + notch->thickness = FromPixel(boundaryLine.length(), varInsunits); // width + + notch->layer = "4"; + } + else if (passmark.type == PassmarkLineType::TMark) + { + qreal width = FromPixel(passmark.lines.last().length(), varInsunits); + notch->thickness = FromPixel(width, varInsunits); + + notch->layer = "80"; + } + else if (passmark.type == PassmarkLineType::BoxMark) + { + QPointF start = passmark.lines.first().p1(); + QPointF end = passmark.lines.last().p2(); + + notch->layer = "81"; + + notch->thickness = FromPixel(QLineF(start, end).length(), varInsunits); + } + else if (passmark.type == PassmarkLineType::UMark) + { + QPointF start = passmark.lines.first().p1(); + QPointF end = passmark.lines.last().p2(); + + notch->thickness = FromPixel(QLineF(start, end).length(), varInsunits); + + notch->layer = "83"; + } + + detailBlock->ent.push_back(notch); + } + } +} + //--------------------------------------------------------------------------------------------------------------------- DRW_Entity *VDxfEngine::AAMAPolygon(const QVector &polygon, const QString &layer, bool forceClosed) { diff --git a/src/libs/vdxf/vdxfengine.h b/src/libs/vdxf/vdxfengine.h index 0c8c261e3..de1e8d0bf 100644 --- a/src/libs/vdxf/vdxfengine.h +++ b/src/libs/vdxf/vdxfengine.h @@ -92,6 +92,12 @@ public: void setMeasurement(const VarMeasurement &var); void setInsunits(const VarInsunits &var); + qreal GetXScale() const; + void SetXScale(const qreal &xscale); + + qreal GetYScale() const; + void SetYScale(const qreal &yscale); + private: Q_DISABLE_COPY(VDxfEngine) QSize size; @@ -104,6 +110,8 @@ private: VarMeasurement varMeasurement; VarInsunits varInsunits; DRW_Text *textBuffer; + qreal m_xscale{1}; + qreal m_yscale{1}; Q_REQUIRED_RESULT double FromPixel(double pix, const VarInsunits &unit) const; Q_REQUIRED_RESULT double ToPixel(double val, const VarInsunits &unit) const; @@ -114,10 +122,19 @@ private: void ExportAAMAIntcut(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail); void ExportAAMANotch(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail); void ExportAAMAGrainline(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail); - void ExportAAMAText(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail); - void ExportAAMAGlobalText(const QSharedPointer &input, const QVector &details); + void ExportPieceText(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail); + void ExportStyleSystemText(const QSharedPointer &input, const QVector &details); void ExportAAMADrill(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail); + bool ExportToASTM(const QVector &details); + void ExportASTMPieceBoundary(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail); + void ExportASTMSewLine(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail); + void ExportASTMInternalLine(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail); + void ExportASTMInternalCutout(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail); + void ExportASTMAnnotationText(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail); + void ExportASTMDrill(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail); + void ExportASTMNotch(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail); + Q_REQUIRED_RESULT DRW_Entity *AAMAPolygon(const QVector &polygon, const QString &layer, bool forceClosed); Q_REQUIRED_RESULT DRW_Entity *AAMALine(const QLineF &line, const QString &layer); Q_REQUIRED_RESULT DRW_Entity *AAMAText(const QPointF &pos, const QString &text, const QString &layer); diff --git a/src/libs/vdxf/vdxfpaintdevice.cpp b/src/libs/vdxf/vdxfpaintdevice.cpp index a45414e96..23622d211 100644 --- a/src/libs/vdxf/vdxfpaintdevice.cpp +++ b/src/libs/vdxf/vdxfpaintdevice.cpp @@ -162,6 +162,40 @@ void VDxfPaintDevice::setInsunits(const VarInsunits &var) engine->setInsunits(var); } +//--------------------------------------------------------------------------------------------------------------------- +qreal VDxfPaintDevice::GetXScale() const +{ + return engine->GetYScale(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VDxfPaintDevice::SetXScale(const qreal &xscale) +{ + if (engine->isActive()) + { + qWarning("VDxfPaintDevice::SetXScale(), cannot set x scale while Dxf is being generated"); + return; + } + engine->SetXScale(xscale); +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal VDxfPaintDevice::GetYScale() const +{ + return engine->GetXScale(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VDxfPaintDevice::SetYScale(const qreal &yscale) +{ + if (engine->isActive()) + { + qWarning("VDxfPaintDevice::SetYScale(), cannot set y scale while Dxf is being generated"); + return; + } + engine->SetYScale(yscale); +} + //--------------------------------------------------------------------------------------------------------------------- bool VDxfPaintDevice::ExportToAAMA(const QVector &details) const { @@ -171,7 +205,16 @@ bool VDxfPaintDevice::ExportToAAMA(const QVector &details) const return res; } - //--------------------------------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------------------------------- +bool VDxfPaintDevice::ExportToASTM(const QVector &details) const +{ + engine->setActive(true); + const bool res = engine->ExportToASTM(details); + engine->setActive(false); + return res; +} + +//--------------------------------------------------------------------------------------------------------------------- int VDxfPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const { switch (metric) diff --git a/src/libs/vdxf/vdxfpaintdevice.h b/src/libs/vdxf/vdxfpaintdevice.h index e6fac0510..a78f762f8 100644 --- a/src/libs/vdxf/vdxfpaintdevice.h +++ b/src/libs/vdxf/vdxfpaintdevice.h @@ -66,7 +66,14 @@ public: void setMeasurement(const VarMeasurement &var); void setInsunits(const VarInsunits &var); + qreal GetXScale() const; + void SetXScale(const qreal &xscale); + + qreal GetYScale() const; + void SetYScale(const qreal &yscale); + bool ExportToAAMA(const QVector &details) const; + bool ExportToASTM(const QVector &details) const; protected: virtual int metric(PaintDeviceMetric metric) const override; diff --git a/src/libs/vformat/vpatternrecipe.cpp b/src/libs/vformat/vpatternrecipe.cpp index 57f86b31d..6a2756448 100644 --- a/src/libs/vformat/vpatternrecipe.cpp +++ b/src/libs/vformat/vpatternrecipe.cpp @@ -37,6 +37,7 @@ #include "../vgeometry/vsplinepath.h" #include "../vgeometry/vcubicbezierpath.h" #include "../vtools/tools/drawTools/drawtools.h" +#include "../vpatterndb/calculator.h" namespace { @@ -88,7 +89,7 @@ VPatternRecipe::VPatternRecipe(VContainer *data, VAbstractPattern *pattern, QObj QDomElement recipeElement = createElement(QStringLiteral("recipe")); recipeElement.appendChild(createComment(FileComment())); - SetAttribute(recipeElement, QStringLiteral("version"), QStringLiteral("1.0.0")); + SetAttribute(recipeElement, QStringLiteral("version"), QStringLiteral("1.1.0")); recipeElement.appendChild(Prerequisite()); recipeElement.appendChild(Content()); @@ -252,6 +253,8 @@ QDomElement VPatternRecipe::Content() content.appendChild(Draft(draw)); } + content.appendChild(FinalMeasurements()); + return content; } @@ -402,6 +405,46 @@ QT_WARNING_POP throw VExceptionInvalidHistory(tr("Can't create history record for the tool.")); } +//--------------------------------------------------------------------------------------------------------------------- +QDomElement VPatternRecipe::FinalMeasurements() +{ + QDomElement recipeFinalMeasurements = createElement(QStringLiteral("finalMeasurements")); + + const QVector measurements = m_pattern->GetFinalMeasurements(); + + for (auto &m : measurements) + { + recipeFinalMeasurements.appendChild(FinalMeasurement(m)); + } + + return recipeFinalMeasurements; +} + +//--------------------------------------------------------------------------------------------------------------------- +QDomElement VPatternRecipe::FinalMeasurement(const VFinalMeasurement &fm) +{ + QDomElement recipeFinalMeasurement = createElement(QStringLiteral("finalMeasurement")); + + SetAttribute(recipeFinalMeasurement, QStringLiteral("description"), fm.description); + SetAttribute(recipeFinalMeasurement, QStringLiteral("name"), fm.name); + SetAttribute(recipeFinalMeasurement, QStringLiteral("formula"), fm.formula); // TODO: localize + + QScopedPointer cal(new Calculator()); + const qreal result = cal->EvalFormula(m_data->DataVariables(), fm.formula); + if (qIsInf(result) || qIsNaN(result)) + { + const QString errorMsg = QString("%1\n\n%1").arg(tr("Reading final measurements error."), + tr("Value for final measurtement '%1' is infinite or NaN. " + "Please, check your calculations.").arg(fm.name)); + qApp->IsPedantic() ? throw VException(errorMsg) : + qWarning() << VAbstractApplication::patternMessageSignature + errorMsg; + } + + SetAttribute(recipeFinalMeasurement, QStringLiteral("value"), result); + + return recipeFinalMeasurement; +} + //--------------------------------------------------------------------------------------------------------------------- QDomElement VPatternRecipe::BasePoint(const VToolRecord &record) { diff --git a/src/libs/vformat/vpatternrecipe.h b/src/libs/vformat/vpatternrecipe.h index 3beb05267..4b53304a2 100644 --- a/src/libs/vformat/vpatternrecipe.h +++ b/src/libs/vformat/vpatternrecipe.h @@ -37,6 +37,7 @@ class VIncrement; class VToolRecord; class VFormula; class VAbstractOperation; +struct VFinalMeasurement; class VPatternRecipe : public VDomDocument { @@ -65,6 +66,9 @@ private: QDomElement Draft(const QDomElement &draft); QDomElement Step(const VToolRecord &tool); + QDomElement FinalMeasurements(); + QDomElement FinalMeasurement(const VFinalMeasurement &fm); + QDomElement BasePoint(const VToolRecord &record); QDomElement EndLine(const VToolRecord &record); QDomElement Line(const VToolRecord &record); diff --git a/src/libs/vlayout/vabstractpiece.cpp b/src/libs/vlayout/vabstractpiece.cpp index 649a4af02..ff7eef16b 100644 --- a/src/libs/vlayout/vabstractpiece.cpp +++ b/src/libs/vlayout/vabstractpiece.cpp @@ -51,7 +51,7 @@ const quint32 VAbstractPieceData::streamHeader = 0x05CDD73A; // CRC-32Q string "VAbstractPieceData" const quint16 VAbstractPieceData::classVersion = 2; -const qreal maxL = 2.5; +const qreal maxL = 3.5; const qreal VSAPoint::passmarkFactor = 0.5; const qreal VSAPoint::maxPassmarkLength = (10/*mm*/ / 25.4) * PrintDPI; diff --git a/src/libs/vlayout/vbank.cpp b/src/libs/vlayout/vbank.cpp index 32a72881c..1df82536c 100644 --- a/src/libs/vlayout/vbank.cpp +++ b/src/libs/vlayout/vbank.cpp @@ -29,6 +29,7 @@ #include "vbank.h" #include +#include #include "../vmisc/diagnostic.h" #include "../vmisc/vabstractapplication.h" @@ -334,8 +335,9 @@ bool VBank::PrepareUnsorted() const qint64 square = details.at(i).Square(); if (square <= 0) { - qCCritical(lBank, "Preparing data for layout error: Detail '%s' square <= 0", - qUtf8Printable(details.at(i).GetName())); + qCCritical(lBank) << VAbstractApplication::patternMessageSignature + + tr("Preparing data for layout error: Detail '%1' square <= 0") + .arg(details.at(i).GetName()); prepare = false; return prepare; } @@ -358,14 +360,16 @@ bool VBank::PrepareDetails() { if (layoutWidth <= 0) { - qCCritical(lBank, "Preparing data for layout error: Layout paper sheet <= 0"); + qCCritical(lBank) << VAbstractApplication::patternMessageSignature + + tr("Preparing data for layout error: Layout paper sheet <= 0"); prepare = false; return prepare; } if (details.isEmpty()) { - qCCritical(lBank, "Preparing data for layout error: List of details is empty"); + qCCritical(lBank) << VAbstractApplication::patternMessageSignature + + tr("Preparing data for layout error: List of details is empty"); prepare = false; return prepare; } diff --git a/src/libs/vlayout/vbank.h b/src/libs/vlayout/vbank.h index 7dd5a6c41..37b821e72 100644 --- a/src/libs/vlayout/vbank.h +++ b/src/libs/vlayout/vbank.h @@ -53,6 +53,7 @@ enum class Cases : qint8 { CaseThreeGroup = 0, CaseTwoGroup, CaseDesc, UnknownCa class VBank { + Q_DECLARE_TR_FUNCTIONS(VBank) public: VBank(); diff --git a/src/libs/vlayout/vcontour.cpp b/src/libs/vlayout/vcontour.cpp index 7a565e105..76fb6adce 100644 --- a/src/libs/vlayout/vcontour.cpp +++ b/src/libs/vlayout/vcontour.cpp @@ -278,8 +278,10 @@ QLineF VContour::GlobalEdge(int i) const const QLineF emptyEdge = EmptySheetEdge(); const qreal nShift = emptyEdge.length()/GlobalEdgesCount(); - edge = IsPortrait() ? QLineF(nShift*(i-1), emptyEdge.y1(), nShift*i, emptyEdge.y2()) : - QLineF(emptyEdge.x1(), nShift*(i-1), emptyEdge.x2(), nShift*i); + edge = IsPortrait() ? QLineF(nShift*(i-1) + emptyEdge.x1(), emptyEdge.y1(), + nShift*i + emptyEdge.x1(), emptyEdge.y2()) : + QLineF(emptyEdge.x1(), nShift*(i-1) + emptyEdge.y1(), + emptyEdge.x2(), nShift*i + emptyEdge.y1()); } else { @@ -445,7 +447,7 @@ bool VContour::IsPortrait() const QLineF VContour::EmptySheetEdge() const { const int offset = qRound(accuracyPointOnLine*4.); - const int layoutOffset = qCeil(d->layoutWidth - accuracyPointOnLine*4.); + const int layoutOffset = qCeil(d->layoutWidth - accuracyPointOnLine*2.); return IsPortrait() ? QLineF(offset, -layoutOffset, d->paperWidth-offset, -layoutOffset) : QLineF(-layoutOffset, offset, -layoutOffset, d->paperHeight-offset); } diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp index db19d5bd8..c34d403c3 100644 --- a/src/libs/vlayout/vlayoutgenerator.cpp +++ b/src/libs/vlayout/vlayoutgenerator.cpp @@ -275,12 +275,7 @@ qreal VLayoutGenerator::LayoutEfficiency() const qreal efficiency = 0; if (not papers.isEmpty()) { - for(auto &paper : papers) - { - efficiency += paper.Efficiency(); - } - - efficiency /= papers.size(); + efficiency = MasterPage().Efficiency(); } return efficiency; } @@ -613,7 +608,7 @@ void VLayoutGenerator::UnitePages() } //--------------------------------------------------------------------------------------------------------------------- -void VLayoutGenerator::UniteDetails(int j, QList > &nDetails, qreal length, int i) +void VLayoutGenerator::UniteDetails(int j, QList > &nDetails, qreal length, int i) const { if ((j == 0 && nDetails.isEmpty()) || j >= nDetails.size()) {//First or new details in paper @@ -639,7 +634,7 @@ void VLayoutGenerator::UnitePapers(int j, QList &papersLength, qreal leng } //--------------------------------------------------------------------------------------------------------------------- -QList VLayoutGenerator::MoveDetails(qreal length, const QVector &details) +QList VLayoutGenerator::MoveDetails(qreal length, const QVector &details) const { if (qFuzzyIsNull(length)) { @@ -656,6 +651,87 @@ QList VLayoutGenerator::MoveDetails(qreal length, const QVector > nDetails; + qreal length = 0; + const int j = 0; // papers count. Always 1. + + for (int i = 0; i < papers.size(); ++i) + { + if (IsPortrait()) + { + int paperHeight = 0; + if (autoCropLength) + { + const QRectF rec = papers.at(i).DetailsBoundingRect(); + paperHeight = qRound(rec.y() + rec.height()); + } + else + { + paperHeight = papers.at(i).GetHeight(); + } + + if (i != papers.size()-1) + { + paperHeight = qRound(paperHeight + bank->GetLayoutWidth()*2); + } + + UniteDetails(j, nDetails, length, i); + length += paperHeight; + } + else + { + int paperWidth = 0; + if (autoCropLength) + { + const QRectF rec = papers.at(i).DetailsBoundingRect(); + paperWidth = qRound(rec.x() + rec.width()); + } + else + { + paperWidth = papers.at(i).GetWidth(); + } + + if (i != papers.size()-1) + { + paperWidth = qRound(paperWidth + bank->GetLayoutWidth()*2); + } + + UniteDetails(j, nDetails, length, i); + length += paperWidth; + } + } + + const int height = IsPortrait() ? qRound(length+accuracyPointOnLine*4) : PageHeight(); + const int width = IsPortrait() ? PageWidth() : qRound(length+accuracyPointOnLine*4); + + VLayoutPaper paper(height, width, bank->GetLayoutWidth()); + paper.SetShift(shift); + paper.SetPaperIndex(static_cast(0)); + paper.SetRotate(rotate); + paper.SetFollowGrainline(followGrainline); + paper.SetRotationNumber(rotationNumber); + paper.SetSaveLength(saveLength); + paper.SetDetails(nDetails.at(0)); + + return paper; +} + //--------------------------------------------------------------------------------------------------------------------- bool VLayoutGenerator::IsUnitePages() const { @@ -680,6 +756,18 @@ void VLayoutGenerator::SetSaveLength(bool value) saveLength = value; } +//--------------------------------------------------------------------------------------------------------------------- +bool VLayoutGenerator::IsPreferOneSheetSolution() const +{ + return preferOneSheetSolution; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::SetPreferOneSheetSolution(bool value) +{ + preferOneSheetSolution = value; +} + //--------------------------------------------------------------------------------------------------------------------- bool VLayoutGenerator::GetAutoCropLength() const { diff --git a/src/libs/vlayout/vlayoutgenerator.h b/src/libs/vlayout/vlayoutgenerator.h index 2115140da..e7c4d011b 100644 --- a/src/libs/vlayout/vlayoutgenerator.h +++ b/src/libs/vlayout/vlayoutgenerator.h @@ -117,6 +117,9 @@ public: bool IsSaveLength() const; void SetSaveLength(bool value); + bool IsPreferOneSheetSolution() const; + void SetPreferOneSheetSolution(bool value); + bool IsUnitePages() const; void SetUnitePages(bool value); @@ -154,6 +157,7 @@ private: bool autoCropLength; bool autoCropWidth; bool saveLength; + bool preferOneSheetSolution{false}; bool unitePages; bool stripOptimizationEnabled; quint8 multiplier; @@ -167,9 +171,10 @@ private: void GatherPages(); void UnitePages(); - void UniteDetails(int j, QList > &nDetails, qreal length, int i); + void UniteDetails(int j, QList > &nDetails, qreal length, int i) const; void UnitePapers(int j, QList &papersLength, qreal length); - QList MoveDetails(qreal length, const QVector &details); + QList MoveDetails(qreal length, const QVector &details) const; + VLayoutPaper MasterPage() const; }; #endif // VLAYOUTGENERATOR_H diff --git a/src/libs/vlayout/vlayoutpiece.cpp b/src/libs/vlayout/vlayoutpiece.cpp index e7a1fb53e..7d4fbb5cb 100644 --- a/src/libs/vlayout/vlayoutpiece.cpp +++ b/src/libs/vlayout/vlayoutpiece.cpp @@ -354,7 +354,7 @@ QVector ConvertPassmarks(const VPiece &piece, const VContainer } if (qApp->Settings()->IsDoublePassmark() - && not piece.IsHideMainPath() + && (qApp->Settings()->IsPieceShowMainPath() || not piece.IsHideMainPath()) && pData.isMainPathNode && pData.passmarkAngleType != PassmarkAngleType::Intersection && pData.passmarkAngleType != PassmarkAngleType::IntersectionOnlyLeft @@ -466,7 +466,8 @@ VLayoutPiece VLayoutPiece::Create(const VPiece &piece, vidtype id, const VContai qWarning() << VAbstractApplication::patternMessageSignature + errorMsg; } - det.SetCountourPoints(futureMainPath.result(), piece.IsHideMainPath()); + det.SetCountourPoints(futureMainPath.result(), + qApp->Settings()->IsPieceShowMainPath() ? false : piece.IsHideMainPath()); det.SetSeamAllowancePoints(futureSeamAllowance.result(), piece.IsSeamAllowance(), piece.IsSeamAllowanceBuiltIn()); det.SetInternalPaths(futureInternalPaths.result()); det.SetPassmarks(futurePassmarks.result()); @@ -543,6 +544,7 @@ QVector VLayoutPiece::Map(QVectormatrix.map(passmarks.at(i).baseLine); } return passmarks; @@ -828,6 +830,14 @@ void VLayoutPiece::Translate(qreal dx, qreal dy) d->matrix *= m; } +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPiece::Scale(qreal sx, qreal sy) +{ + QTransform m; + m.scale(sx, sy); + d->matrix *= m; +} + //--------------------------------------------------------------------------------------------------------------------- void VLayoutPiece::Rotate(const QPointF &originPoint, qreal degrees) { diff --git a/src/libs/vlayout/vlayoutpiece.h b/src/libs/vlayout/vlayoutpiece.h index f0471e84f..509bf18ac 100644 --- a/src/libs/vlayout/vlayoutpiece.h +++ b/src/libs/vlayout/vlayoutpiece.h @@ -126,6 +126,7 @@ public: void SetMirror(bool value); void Translate(qreal dx, qreal dy); + void Scale(qreal sx, qreal sy); void Rotate(const QPointF &originPoint, qreal degrees); void Mirror(const QLineF &edge); void Mirror(); diff --git a/src/libs/vlayout/vposter.cpp b/src/libs/vlayout/vposter.cpp index b278c564e..82069b214 100644 --- a/src/libs/vlayout/vposter.cpp +++ b/src/libs/vlayout/vposter.cpp @@ -124,7 +124,7 @@ VPoster::VPoster(const QPrinter *printer) } //--------------------------------------------------------------------------------------------------------------------- -QVector VPoster::Calc(const QRect &imageRect, int page, PageOrientation orientation) const +QVector VPoster::Calc(const QSize &imageRect, int page, PageOrientation orientation) const { QVector poster; @@ -390,7 +390,7 @@ int VPoster::CountColumns(int width, PageOrientation orientation) const } //--------------------------------------------------------------------------------------------------------------------- -PosterData VPoster::Cut(int i, int j, const QRect &imageRect, PageOrientation orientation) const +PosterData VPoster::Cut(int i, int j, const QSize &imageRect, PageOrientation orientation) const { Q_UNUSED(imageRect) @@ -431,7 +431,9 @@ QRect VPoster::PageRect() const if(printer->fullPage()) { - QMarginsF pMargins = printer->pageLayout().margins(); + QPageLayout layout = printer->pageLayout(); + layout.setUnits(QPageLayout::Millimeter); + QMarginsF pMargins = layout.margins(); QRectF newRect = rect.marginsRemoved(pMargins); const QRect pageRectFP(0, 0, qFloor(ToPixel(newRect.width())), qFloor(ToPixel(newRect.height()))); return pageRectFP; diff --git a/src/libs/vlayout/vposter.h b/src/libs/vlayout/vposter.h index 4860765f3..056b5fb3b 100644 --- a/src/libs/vlayout/vposter.h +++ b/src/libs/vlayout/vposter.h @@ -68,7 +68,7 @@ class VPoster public: explicit VPoster(const QPrinter *printer); - QVector Calc(const QRect &imageRect, int page, PageOrientation orientation) const; + QVector Calc(const QSize &imageRect, int page, PageOrientation orientation) const; QVector Tile(QGraphicsItem *parent, const PosterData &img, int sheets, const VWatermarkData &watermarkData, const QString &watermarkPath) const; @@ -84,7 +84,7 @@ private: int CountRows(int height, PageOrientation orientation) const; int CountColumns(int width, PageOrientation orientation) const; - PosterData Cut(int i, int j, const QRect &imageRect, PageOrientation orientation) const; + PosterData Cut(int i, int j, const QSize &imageRect, PageOrientation orientation) const; QRect PageRect() const; diff --git a/src/libs/vlayout/warnings.pri b/src/libs/vlayout/warnings.pri index f2b2a2224..2f715e3cc 100644 --- a/src/libs/vlayout/warnings.pri +++ b/src/libs/vlayout/warnings.pri @@ -45,7 +45,8 @@ unix { # Key -isystem disable checking errors in system headers. -isystem "$${OUT_PWD}/$${MOC_DIR}" \ -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details. + $$CLANG_DEBUG_CXXFLAGS \# See common.pri for more details. + -Wno-gnu-zero-variadic-macro-arguments\ # See macros qCCritical checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings QMAKE_CXXFLAGS += -Werror diff --git a/src/libs/vmisc/commandoptions.cpp b/src/libs/vmisc/commandoptions.cpp index 1a2eefe37..6499f46d5 100644 --- a/src/libs/vmisc/commandoptions.cpp +++ b/src/libs/vmisc/commandoptions.cpp @@ -53,6 +53,8 @@ const QString LONG_OPTION_BINARYDXF = QStringLiteral("bdxf"); const QString LONG_OPTION_TEXT2PATHS = QStringLiteral("text2paths"); const QString LONG_OPTION_EXPORTONLYDETAILS = QStringLiteral("exportOnlyDetails"); const QString LONG_OPTION_EXPORTSUCHDETAILS = QStringLiteral("exportSuchDetails"); +const QString LONG_OPTION_EXPXSCALE = QStringLiteral("xscale"); +const QString LONG_OPTION_EXPYSCALE = QStringLiteral("yscale"); const QString LONG_OPTION_CROP_LENGTH = QStringLiteral("crop"); const QString SINGLE_OPTION_CROP_LENGTH = QStringLiteral("c"); @@ -134,6 +136,7 @@ const QString LONG_OPTION_MANUAL_PRIORITY = QStringLiteral("manualPriority"); const QString LONG_OPTION_LANDSCAPE_ORIENTATION = QStringLiteral("landscapeOrientation"); const QString LONG_OPTION_NEST_QUANTITY = QStringLiteral("nestQuantity"); +const QString LONG_OPTION_PREFER_ONE_SHEET_SOLUTION = QStringLiteral("preferOneSheetSolution"); //--------------------------------------------------------------------------------------------------------------------- /** @@ -153,6 +156,8 @@ QStringList AllKeys() LONG_OPTION_TEXT2PATHS, LONG_OPTION_EXPORTONLYDETAILS, LONG_OPTION_EXPORTSUCHDETAILS, + LONG_OPTION_EXPXSCALE, + LONG_OPTION_EXPYSCALE, LONG_OPTION_CROP_LENGTH, SINGLE_OPTION_CROP_LENGTH, LONG_OPTION_CROP_WIDTH, LONG_OPTION_UNITE, SINGLE_OPTION_UNITE, @@ -189,6 +194,7 @@ QStringList AllKeys() LONG_OPTION_FOLLOW_GRAINLINE, LONG_OPTION_MANUAL_PRIORITY, LONG_OPTION_LANDSCAPE_ORIENTATION, - LONG_OPTION_NEST_QUANTITY + LONG_OPTION_NEST_QUANTITY, + LONG_OPTION_PREFER_ONE_SHEET_SOLUTION }; } diff --git a/src/libs/vmisc/commandoptions.h b/src/libs/vmisc/commandoptions.h index cd8c57ed5..a4737440e 100644 --- a/src/libs/vmisc/commandoptions.h +++ b/src/libs/vmisc/commandoptions.h @@ -50,6 +50,8 @@ extern const QString LONG_OPTION_BINARYDXF; extern const QString LONG_OPTION_TEXT2PATHS; extern const QString LONG_OPTION_EXPORTONLYDETAILS; extern const QString LONG_OPTION_EXPORTSUCHDETAILS; +extern const QString LONG_OPTION_EXPXSCALE; +extern const QString LONG_OPTION_EXPYSCALE; extern const QString LONG_OPTION_CROP_LENGTH; extern const QString SINGLE_OPTION_CROP_LENGTH; @@ -128,6 +130,7 @@ extern const QString LONG_OPTION_FOLLOW_GRAINLINE; extern const QString LONG_OPTION_MANUAL_PRIORITY; extern const QString LONG_OPTION_LANDSCAPE_ORIENTATION; extern const QString LONG_OPTION_NEST_QUANTITY; +extern const QString LONG_OPTION_PREFER_ONE_SHEET_SOLUTION; QStringList AllKeys(); diff --git a/src/libs/vmisc/compatibility.h b/src/libs/vmisc/compatibility.h index 982f3ed91..f00bdccf0 100644 --- a/src/libs/vmisc/compatibility.h +++ b/src/libs/vmisc/compatibility.h @@ -195,4 +195,27 @@ inline void AppendTo(Cont &container, const Input &input) #endif // QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) } +//--------------------------------------------------------------------------------------------------------------------- +template +inline bool SetIntersects(const QSet &set1, const QSet &set2) +{ +#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) + return set1.intersects(set2); +#else + const bool otherIsBigger = set2.size() > set1.size(); + const QSet &smallestSet = otherIsBigger ? set1 : set2; + const QSet &biggestSet = otherIsBigger ? set2 : set1; + typename QSet::const_iterator i = smallestSet.cbegin(); + typename QSet::const_iterator e = smallestSet.cend(); + while (i != e) + { + if (biggestSet.contains(*i)) + return true; + ++i; + } + return false; + +#endif +} + #endif // COMPATIBILITY_H diff --git a/src/libs/vmisc/share/resources/icon.qrc b/src/libs/vmisc/share/resources/icon.qrc index ebd7ae48f..f4cff9ed5 100644 --- a/src/libs/vmisc/share/resources/icon.qrc +++ b/src/libs/vmisc/share/resources/icon.qrc @@ -85,5 +85,9 @@ icon/32x32/font_preferences.png icon/24x24/font_preferences@2x.png icon/24x24/font_preferences.png + icon/32x32/broken_link.png + icon/32x32/broken_link@2x.png + icon/32x32/link.png + icon/32x32/link@2x.png diff --git a/src/libs/vmisc/share/resources/icon/32x32/broken_link.png b/src/libs/vmisc/share/resources/icon/32x32/broken_link.png new file mode 100644 index 000000000..e9eda1311 Binary files /dev/null and b/src/libs/vmisc/share/resources/icon/32x32/broken_link.png differ diff --git a/src/libs/vmisc/share/resources/icon/32x32/broken_link@2x.png b/src/libs/vmisc/share/resources/icon/32x32/broken_link@2x.png new file mode 100644 index 000000000..7c709416c Binary files /dev/null and b/src/libs/vmisc/share/resources/icon/32x32/broken_link@2x.png differ diff --git a/src/libs/vmisc/share/resources/icon/32x32/link.png b/src/libs/vmisc/share/resources/icon/32x32/link.png new file mode 100644 index 000000000..2b227e48e Binary files /dev/null and b/src/libs/vmisc/share/resources/icon/32x32/link.png differ diff --git a/src/libs/vmisc/share/resources/icon/32x32/link@2x.png b/src/libs/vmisc/share/resources/icon/32x32/link@2x.png new file mode 100644 index 000000000..46527dab9 Binary files /dev/null and b/src/libs/vmisc/share/resources/icon/32x32/link@2x.png differ diff --git a/src/libs/vmisc/vcommonsettings.cpp b/src/libs/vmisc/vcommonsettings.cpp index 1b9369cb3..5a4bfa8b4 100644 --- a/src/libs/vmisc/vcommonsettings.cpp +++ b/src/libs/vmisc/vcommonsettings.cpp @@ -238,6 +238,11 @@ VCommonSettings::VCommonSettings(Format format, Scope scope, const QString &orga :QSettings(format, scope, organization, application, parent) {} +//--------------------------------------------------------------------------------------------------------------------- +VCommonSettings::VCommonSettings(const QString &fileName, QSettings::Format format, QObject *parent) + :QSettings(fileName, format, parent) +{} + //--------------------------------------------------------------------------------------------------------------------- QString VCommonSettings::SharePath(const QString &shareItem) { diff --git a/src/libs/vmisc/vcommonsettings.h b/src/libs/vmisc/vcommonsettings.h index da65ccd61..26f5acd17 100644 --- a/src/libs/vmisc/vcommonsettings.h +++ b/src/libs/vmisc/vcommonsettings.h @@ -44,6 +44,7 @@ class VCommonSettings : public QSettings public: VCommonSettings(Format format, Scope scope, const QString &organization, const QString &application = QString(), QObject *parent = nullptr); + VCommonSettings(const QString &fileName, Format format, QObject *parent = nullptr); static QString SharePath(const QString &shareItem); static QString MultisizeTablesPath(); diff --git a/src/libs/vmisc/vsettings.cpp b/src/libs/vmisc/vsettings.cpp index 12330741d..dbe6ff220 100644 --- a/src/libs/vmisc/vsettings.cpp +++ b/src/libs/vmisc/vsettings.cpp @@ -91,6 +91,8 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutNestQuantity, (QLatin1Stri Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutAutoCropLength, (QLatin1String("layout/autoCropLength"))) Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutAutoCropWidth, (QLatin1String("layout/autoCropWidth"))) Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutSaveLength, (QLatin1String("layout/saveLength"))) +Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutPreferOneSheetSolution, + (QLatin1String("layout/preferOneSheetSolution"))) Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutUnitePages, (QLatin1String("layout/unitePages"))) Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingFields, (QLatin1String("layout/fields"))) Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingIgnoreFields, (QLatin1String("layout/ignoreFields"))) @@ -137,6 +139,13 @@ VSettings::VSettings(Format format, Scope scope, const QString &organization, co qRegisterMetaTypeStreamOperators("QMarginsF"); } +//--------------------------------------------------------------------------------------------------------------------- +VSettings::VSettings(const QString &fileName, QSettings::Format format, QObject *parent) + :VCommonSettings(fileName, format, parent) +{ + qRegisterMetaTypeStreamOperators("QMarginsF"); +} + //--------------------------------------------------------------------------------------------------------------------- template inline T VSettings::ValueOrDef(const QString &setting, const T &defValue) const @@ -419,6 +428,24 @@ void VSettings::SetLayoutSaveLength(bool value) setValue(*settingLayoutSaveLength, value); } +//--------------------------------------------------------------------------------------------------------------------- +bool VSettings::GetLayoutPreferOneSheetSolution() const +{ + return value(*settingLayoutPreferOneSheetSolution, GetDefLayoutPreferOneSheetSolution()).toBool(); +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VSettings::GetDefLayoutPreferOneSheetSolution() +{ + return false; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VSettings::SetLayoutPreferOneSheetSolution(bool value) +{ + setValue(*settingLayoutPreferOneSheetSolution, value); +} + //--------------------------------------------------------------------------------------------------------------------- bool VSettings::GetLayoutUnitePages() const { diff --git a/src/libs/vmisc/vsettings.h b/src/libs/vmisc/vsettings.h index 47b8f831a..8b6d0aacd 100644 --- a/src/libs/vmisc/vsettings.h +++ b/src/libs/vmisc/vsettings.h @@ -45,6 +45,7 @@ class VSettings : public VCommonSettings public: VSettings(Format format, Scope scope, const QString &organization, const QString &application = QString(), QObject *parent = nullptr); + VSettings(const QString &fileName, Format format, QObject *parent = nullptr); QString GetLabelLanguage() const; void SetLabelLanguage(const QString &value); @@ -109,6 +110,10 @@ public: static bool GetDefLayoutSaveLength(); void SetLayoutSaveLength(bool value); + bool GetLayoutPreferOneSheetSolution() const; + static bool GetDefLayoutPreferOneSheetSolution(); + void SetLayoutPreferOneSheetSolution(bool value); + bool GetLayoutUnitePages() const; static bool GetDefLayoutUnitePages(); void SetLayoutUnitePages(bool value); diff --git a/src/libs/vpatterndb/vpassmark.cpp b/src/libs/vpatterndb/vpassmark.cpp index 825e9f05e..8db56a243 100644 --- a/src/libs/vpatterndb/vpassmark.cpp +++ b/src/libs/vpatterndb/vpassmark.cpp @@ -660,7 +660,7 @@ QVector VPassmark::FullPassmark(const VPiece &piece, const VContainer *d QVector lines; lines += SAPassmark(piece, data, PassmarkSide::All); if (qApp->Settings()->IsDoublePassmark() - && not piece.IsHideMainPath() + && (qApp->Settings()->IsPieceShowMainPath() || not piece.IsHideMainPath()) && m_data.isMainPathNode && m_data.passmarkAngleType != PassmarkAngleType::Intersection && m_data.passmarkAngleType != PassmarkAngleType::IntersectionOnlyLeft diff --git a/src/libs/vpatterndb/vtranslatevars.cpp b/src/libs/vpatterndb/vtranslatevars.cpp index a45b55c91..aa4870654 100644 --- a/src/libs/vpatterndb/vtranslatevars.cpp +++ b/src/libs/vpatterndb/vtranslatevars.cpp @@ -47,15 +47,7 @@ //--------------------------------------------------------------------------------------------------------------------- VTranslateVars::VTranslateVars() - :VTranslateMeasurements(), - PMSystemNames(QMap()), - PMSystemAuthors(QMap()), - PMSystemBooks(QMap()), - variables(QMap()), - functions(QMap()), - placeholders(QMap()), - stDescriptions(QMap()), - translatedFunctions(QMap()) + :VTranslateMeasurements() { InitPatternMakingSystems(); InitVariables(); @@ -408,45 +400,140 @@ void VTranslateVars::InitVariables() void VTranslateVars::InitFunctions() { functions.insert(degTorad_F, translate("VTranslateVars", "degTorad", "converts degrees to radian")); + functionsDescriptions.insert(degTorad_F, translate("VTranslateVars", "converts degrees to radian", + "functionm degTorad")); + functions.insert(radTodeg_F, translate("VTranslateVars", "radTodeg", "converts radian to degrees")); + functionsDescriptions.insert(radTodeg_F, translate("VTranslateVars", "converts radian to degrees", + "function radTodeg")); + functions.insert(sin_F, translate("VTranslateVars", "sin", "sine function working with radians")); + functionsDescriptions.insert(sin_F, translate("VTranslateVars", "sine function working with radians", + "function sin")); + functions.insert(cos_F, translate("VTranslateVars", "cos", "cosine function working with radians")); + functionsDescriptions.insert(cos_F, translate("VTranslateVars", "cosine function working with radians", + "function cos")); + functions.insert(tan_F, translate("VTranslateVars", "tan", "tangens function working with radians")); + functionsDescriptions.insert(tan_F, translate("VTranslateVars", "tangens function working with radians", + "function tan")); + functions.insert(asin_F, translate("VTranslateVars", "asin", "arcus sine function working with radians")); + functionsDescriptions.insert(asin_F, translate("VTranslateVars", "arcus sine function working with radians", + "function asin")); + functions.insert(acos_F, translate("VTranslateVars", "acos", "arcus cosine function working with radians")); + functionsDescriptions.insert(acos_F, translate("VTranslateVars", "arcus cosine function working with radians", + "function acos")); + functions.insert(atan_F, translate("VTranslateVars", "atan", "arcus tangens function working with radians")); + functionsDescriptions.insert(atan_F, translate("VTranslateVars", "arcus tangens function working with radians", + "function atan")); + functions.insert(sinh_F, translate("VTranslateVars", "sinh", "hyperbolic sine function")); + functionsDescriptions.insert(sinh_F, translate("VTranslateVars", "hyperbolic sine function", "function sinh")); + functions.insert(cosh_F, translate("VTranslateVars", "cosh", "hyperbolic cosine")); + functionsDescriptions.insert(cosh_F, translate("VTranslateVars", "hyperbolic cosine", "function cosh")); + functions.insert(tanh_F, translate("VTranslateVars", "tanh", "hyperbolic tangens function")); + functionsDescriptions.insert(tanh_F, translate("VTranslateVars", "hyperbolic tangens function", "function tanh")); + functions.insert(asinh_F, translate("VTranslateVars", "asinh", "hyperbolic arcus sine function")); + functionsDescriptions.insert(asinh_F, translate("VTranslateVars", "hyperbolic arcus sine function", + "function asinh")); + functions.insert(acosh_F, translate("VTranslateVars", "acosh", "hyperbolic arcus cosine function")); + functionsDescriptions.insert(acosh_F, translate("VTranslateVars", "hyperbolic arcus cosine function", + "function acosh")); + functions.insert(atanh_F, translate("VTranslateVars", "atanh", "hyperbolic arcur tangens function")); + functionsDescriptions.insert(atanh_F, translate("VTranslateVars", "hyperbolic arcur tangens function", + "function atanh")); + functions.insert(sinD_F, translate("VTranslateVars", "sinD", "sine function working with degrees")); + functionsDescriptions.insert(sinD_F, translate("VTranslateVars", "sine function working with degrees", + "function sinD")); + functions.insert(cosD_F, translate("VTranslateVars", "cosD", "cosine function working with degrees")); + functionsDescriptions.insert(cosD_F, translate("VTranslateVars", "cosine function working with degrees", + "function cosD")); + functions.insert(tanD_F, translate("VTranslateVars", "tanD", "tangens function working with degrees")); + functionsDescriptions.insert(tanD_F, translate("VTranslateVars", "tangens function working with degrees", + "function tanD")); + functions.insert(asinD_F, translate("VTranslateVars", "asinD", "arcus sine function working with degrees")); + functionsDescriptions.insert(asinD_F, translate("VTranslateVars", "arcus sine function working with degrees", + "function asinD")); + functions.insert(acosD_F, translate("VTranslateVars", "acosD", "arcus cosine function working with degrees")); + functionsDescriptions.insert(acosD_F, translate("VTranslateVars", "arcus cosine function working with degrees", + "function acosD")); + functions.insert(atanD_F, translate("VTranslateVars", "atanD", "arcus tangens function working with degrees")); + functionsDescriptions.insert(atanD_F, translate("VTranslateVars", "arcus tangens function working with degrees", + "function atanD")); + functions.insert(log2_F, translate("VTranslateVars", "log2", "logarithm to the base 2")); + functionsDescriptions.insert(log2_F, translate("VTranslateVars", "logarithm to the base 2", "function log2")); + functions.insert(log10_F, translate("VTranslateVars", "log10", "logarithm to the base 10")); + functionsDescriptions.insert(log10_F, translate("VTranslateVars", "logarithm to the base 10", "function log10")); + functions.insert(log_F, translate("VTranslateVars", "log", "logarithm to the base 10")); + functionsDescriptions.insert(log_F, translate("VTranslateVars", "logarithm to the base 10", "function log")); + functions.insert(ln_F, translate("VTranslateVars", "ln", "logarithm to base e (2.71828...)")); + functionsDescriptions.insert(ln_F, translate("VTranslateVars", "logarithm to base e (2.71828...)", "function ln")); + functions.insert(exp_F, translate("VTranslateVars", "exp", "e raised to the power of x")); + functionsDescriptions.insert(exp_F, translate("VTranslateVars", "e raised to the power of x", "function exp")); + functions.insert(sqrt_F, translate("VTranslateVars", "sqrt", "square root of a value")); + functionsDescriptions.insert(sqrt_F, translate("VTranslateVars", "square root of a value", "function sqrt")); + functions.insert(sign_F, translate("VTranslateVars", "sign", "sign function -1 if x<0; 1 if x>0")); + functionsDescriptions.insert(sign_F, translate("VTranslateVars", "sign function -1 if x<0; 1 if x>0", + "function sign")); + functions.insert(rint_F, translate("VTranslateVars", "rint", "round to nearest integer")); + functionsDescriptions.insert(rint_F, translate("VTranslateVars", "round to nearest integer", "function rint")); + functions.insert(r2cm_F, translate("VTranslateVars", "r2cm", "round to up to 1 decimal")); + functionsDescriptions.insert(r2cm_F, translate("VTranslateVars", "round to up to 1 decimal", "function r2cm")); + functions.insert(csrCm_F, translate("VTranslateVars", "csrCm", "cut, split and rotate modeling operation. Takes" " cm units.")); + functionsDescriptions.insert(csrCm_F, translate("VTranslateVars", "cut, split and rotate modeling operation. Takes " + "cm units.", "function csrCm")); + functions.insert(csrInch_F, translate("VTranslateVars", "csrInch", "cut, split and rotate modeling operation. Takes" - " inch units.")); + " inch units.")); + functionsDescriptions.insert(csrInch_F, translate("VTranslateVars", "cut, split and rotate modeling operation. Takes" + " inch units.", "function csrInch")); + functions.insert(abs_F, translate("VTranslateVars", "abs", "absolute value")); + functionsDescriptions.insert(abs_F, translate("VTranslateVars", "absolute value", "function abs")); + functions.insert(min_F, translate("VTranslateVars", "min", "min of all arguments")); + functionsDescriptions.insert(min_F, translate("VTranslateVars", "min of all arguments", "function min")); + functions.insert(max_F, translate("VTranslateVars", "max", "max of all arguments")); + functionsDescriptions.insert(max_F, translate("VTranslateVars", "max of all arguments", "function max")); + functions.insert(sum_F, translate("VTranslateVars", "sum", "sum of all arguments")); + functionsDescriptions.insert(sum_F, translate("VTranslateVars", "sum of all arguments", "function sum")); + functions.insert(avg_F, translate("VTranslateVars", "avg", "mean value of all arguments")); + functionsDescriptions.insert(avg_F, translate("VTranslateVars", "mean value of all arguments", "function avg")); + functions.insert(fmod_F, translate("VTranslateVars", "fmod", "Returns the floating-point remainder of numer/denom (rounded towards zero)")); + functionsDescriptions.insert(fmod_F, translate("VTranslateVars", "Returns the floating-point remainder of " + "numer/denom (rounded towards zero)", + "function fmod")); } //--------------------------------------------------------------------------------------------------------------------- @@ -1094,6 +1181,7 @@ void VTranslateVars::Retranslate() PMSystemBooks.clear(); variables.clear(); functions.clear(); + functionsDescriptions.clear(); stDescriptions.clear(); InitPatternMakingSystems(); @@ -1115,3 +1203,9 @@ QMap VTranslateVars::GetFunctions() const { return functions; } + +//--------------------------------------------------------------------------------------------------------------------- +QMap VTranslateVars::GetFunctionsDescriptions() const +{ + return functionsDescriptions; +} diff --git a/src/libs/vpatterndb/vtranslatevars.h b/src/libs/vpatterndb/vtranslatevars.h index c7842fdef..c5d02c94d 100644 --- a/src/libs/vpatterndb/vtranslatevars.h +++ b/src/libs/vpatterndb/vtranslatevars.h @@ -67,19 +67,21 @@ public: QMap GetTranslatedFunctions() const; QMap GetFunctions() const; + QMap GetFunctionsDescriptions() const; static void BiasTokens(int position, int bias, QMap &tokens); private: Q_DISABLE_COPY(VTranslateVars) - QMap PMSystemNames; - QMap PMSystemAuthors; - QMap PMSystemBooks; - QMap variables; - QMap functions; - QMap placeholders; - QMap stDescriptions; - QMap translatedFunctions; + QMap PMSystemNames{}; + QMap PMSystemAuthors{}; + QMap PMSystemBooks{}; + QMap variables{}; + QMap functions{}; + QMap functionsDescriptions{}; + QMap placeholders{}; + QMap stDescriptions{}; + QMap translatedFunctions{}; void InitPatternMakingSystems(); void InitVariables(); diff --git a/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp index 912fec524..a7d3663ab 100644 --- a/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp +++ b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp @@ -612,6 +612,7 @@ void DialogEditWrongFormula::ShowFunctions() ui->tableWidget->setColumnHidden(ColumnFullName, true); ui->labelDescription->setText(QString()); + const QMap functionsDescriptions = qApp->TrVars()->GetFunctionsDescriptions(); const QMap functions = qApp->TrVars()->GetFunctions(); QMap::const_iterator i = functions.constBegin(); while (i != functions.constEnd()) @@ -622,7 +623,10 @@ void DialogEditWrongFormula::ShowFunctions() font.setBold(true); item->setFont(font); ui->tableWidget->setItem(ui->tableWidget->rowCount()-1, ColumnName, item); - item->setToolTip(i.value().getMdisambiguation()); + + functionsDescriptions.contains(i.key()) + ? item->setToolTip(functionsDescriptions.value(i.key()).translate(qApp->Settings()->GetLocale())) + : item->setToolTip(i.value().getMdisambiguation()); ++i; } diff --git a/src/libs/vtools/dialogs/tools/dialogendline.cpp b/src/libs/vtools/dialogs/tools/dialogendline.cpp index 5032edb41..b8cef020f 100644 --- a/src/libs/vtools/dialogs/tools/dialogendline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogendline.cpp @@ -151,7 +151,7 @@ void DialogEndLine::EvalLength() formulaData.labelEditFormula = ui->labelEditFormula; formulaData.labelResult = ui->labelResultCalculation; formulaData.postfix = UnitsToStr(qApp->patternUnit(), true); - formulaData.checkLessThanZero = true; + formulaData.checkLessThanZero = false; Eval(formulaData, flagFormula); } diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp index b9e746971..e370fc820 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -67,6 +68,7 @@ DialogFlippingByAxis::DialogFlippingByAxis(const VContainer *data, quint32 toolI stage1(true), m_suffix(), flagName(true), + flagGroupName(true), flagError(false) { ui->setupUi(this); @@ -81,6 +83,7 @@ DialogFlippingByAxis::DialogFlippingByAxis(const VContainer *data, quint32 toolI ui->comboBoxOriginPoint->setCurrentIndex(-1); connect(ui->lineEditSuffix, &QLineEdit::textChanged, this, &DialogFlippingByAxis::SuffixChanged); + connect(ui->lineEditVisibilityGroup, &QLineEdit::textChanged, this, &DialogFlippingByAxis::GroupNameChanged); connect(ui->comboBoxOriginPoint, &QComboBox::currentTextChanged, this, &DialogFlippingByAxis::PointChanged); @@ -147,6 +150,49 @@ QVector DialogFlippingByAxis::GetObjects() const return ConvertToVector(objects); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogFlippingByAxis::GetVisibilityGroupName() const +{ + return ui->lineEditVisibilityGroup->text(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogFlippingByAxis::SetVisibilityGroupName(const QString &name) +{ + ui->lineEditVisibilityGroup->setText(name.isEmpty() ? tr("Rotation") : name); +} + +//--------------------------------------------------------------------------------------------------------------------- +bool DialogFlippingByAxis::HasLinkedVisibilityGroup() const +{ + return ui->groupBoxVisibilityGroup->isChecked(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogFlippingByAxis::SetHasLinkedVisibilityGroup(bool linked) +{ + ui->groupBoxVisibilityGroup->setChecked(linked); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogFlippingByAxis::SetVisibilityGroupTags(const QStringList &tags) +{ + ui->lineEditGroupTags->setText(tags.join(", ")); +} + +//--------------------------------------------------------------------------------------------------------------------- +QStringList DialogFlippingByAxis::GetVisibilityGroupTags() const +{ + return ui->lineEditGroupTags->text().split(','); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogFlippingByAxis::SetGroupCategories(const QStringList &categories) +{ + m_groupTags = categories; + ui->lineEditGroupTags->SetCompletion(m_groupTags); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogFlippingByAxis::ShowDialog(bool click) { @@ -277,6 +323,27 @@ void DialogFlippingByAxis::SuffixChanged() CheckState(); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogFlippingByAxis::GroupNameChanged() +{ + QLineEdit* edit = qobject_cast(sender()); + if (edit) + { + const QString name = edit->text(); + if (name.isEmpty()) + { + flagGroupName = false; + ChangeColor(ui->labelGroupName, errorColor); + CheckState(); + return; + } + + flagGroupName = true; + ChangeColor(ui->labelGroupName, OkColor(this)); + } + CheckState(); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogFlippingByAxis::ShowVisualization() { @@ -295,6 +362,18 @@ void DialogFlippingByAxis::SaveData() operation->SetOriginPointId(GetOriginPointId()); operation->SetAxisType(GetAxisType()); operation->RefreshGeometry(); + + QStringList groupTags = ui->lineEditGroupTags->text().split(','); + for (auto &tag : groupTags) + { + tag = tag.trimmed(); + if (not m_groupTags.contains(tag)) + { + m_groupTags.append(tag); + } + } + + ui->lineEditGroupTags->SetCompletion(m_groupTags); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.h b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.h index 0b31ac1ce..234261fe0 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.h +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.h @@ -65,6 +65,17 @@ public: QVector GetObjects() const; + QString GetVisibilityGroupName() const; + void SetVisibilityGroupName(const QString &name); + + bool HasLinkedVisibilityGroup() const; + void SetHasLinkedVisibilityGroup(bool linked); + + void SetVisibilityGroupTags(const QStringList &tags); + QStringList GetVisibilityGroupTags() const; + + virtual void SetGroupCategories(const QStringList &categories) override; + virtual void ShowDialog(bool click) override; public slots: @@ -73,6 +84,7 @@ public slots: private slots: void SuffixChanged(); + void GroupNameChanged(); protected: virtual void ShowVisualization() override; @@ -96,15 +108,18 @@ private: QString m_suffix; bool flagName; + bool flagGroupName; bool flagError; + QStringList m_groupTags{}; + static void FillComboBoxAxisType(QComboBox *box); }; //--------------------------------------------------------------------------------------------------------------------- inline bool DialogFlippingByAxis::IsValid() const { - return flagError && flagName; + return flagError && flagName && flagGroupName; } #endif // DIALOGFLIPPINGBYAXIS_H diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.ui b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.ui index d21839e55..9ebf2e47f 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.ui +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.ui @@ -6,8 +6,8 @@ 0 0 - 285 - 146 + 304 + 237 @@ -48,6 +48,61 @@
+ + + + Enable to create a visibility gropup from original objects + + + Visibility Group + + + true + + + false + + + + + + Name: + + + + + + + Flipping by axis + + + true + + + + + + + Tags: + + + + + + + Separate each tag with comma. + + + Add tags + + + true + + + + + + @@ -60,6 +115,13 @@ + + + VCompleterLineEdit + QLineEdit +
vlineedit.h
+
+
diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp b/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp index bf62e73c3..9532bd364 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -67,6 +68,7 @@ DialogFlippingByLine::DialogFlippingByLine(const VContainer *data, quint32 toolI stage1(true), m_suffix(), flagName(true), + flagGroupName(true), flagError(false) { ui->setupUi(this); @@ -79,6 +81,7 @@ DialogFlippingByLine::DialogFlippingByLine(const VContainer *data, quint32 toolI FillComboBoxPoints(ui->comboBoxSecondLinePoint); connect(ui->lineEditSuffix, &QLineEdit::textChanged, this, &DialogFlippingByLine::SuffixChanged); + connect(ui->lineEditVisibilityGroup, &QLineEdit::textChanged, this, &DialogFlippingByLine::GroupNameChanged); connect(ui->comboBoxFirstLinePoint, &QComboBox::currentTextChanged, this, &DialogFlippingByLine::PointChanged); connect(ui->comboBoxSecondLinePoint, &QComboBox::currentTextChanged, @@ -142,6 +145,49 @@ QVector DialogFlippingByLine::GetObjects() const return ConvertToVector(objects); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogFlippingByLine::GetVisibilityGroupName() const +{ + return ui->lineEditVisibilityGroup->text(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogFlippingByLine::SetVisibilityGroupName(const QString &name) +{ + ui->lineEditVisibilityGroup->setText(name.isEmpty() ? tr("Rotation") : name); +} + +//--------------------------------------------------------------------------------------------------------------------- +bool DialogFlippingByLine::HasLinkedVisibilityGroup() const +{ + return ui->groupBoxVisibilityGroup->isChecked(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogFlippingByLine::SetHasLinkedVisibilityGroup(bool linked) +{ + ui->groupBoxVisibilityGroup->setChecked(linked); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogFlippingByLine::SetVisibilityGroupTags(const QStringList &tags) +{ + ui->lineEditGroupTags->setText(tags.join(", ")); +} + +//--------------------------------------------------------------------------------------------------------------------- +QStringList DialogFlippingByLine::GetVisibilityGroupTags() const +{ + return ui->lineEditGroupTags->text().split(','); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogFlippingByLine::SetGroupCategories(const QStringList &categories) +{ + m_groupTags = categories; + ui->lineEditGroupTags->SetCompletion(m_groupTags); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogFlippingByLine::ShowDialog(bool click) { @@ -301,6 +347,27 @@ void DialogFlippingByLine::SuffixChanged() CheckState(); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogFlippingByLine::GroupNameChanged() +{ + QLineEdit* edit = qobject_cast(sender()); + if (edit) + { + const QString name = edit->text(); + if (name.isEmpty()) + { + flagGroupName = false; + ChangeColor(ui->labelGroupName, errorColor); + CheckState(); + return; + } + + flagGroupName = true; + ChangeColor(ui->labelGroupName, OkColor(this)); + } + CheckState(); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogFlippingByLine::ShowVisualization() { @@ -319,6 +386,18 @@ void DialogFlippingByLine::SaveData() operation->SetFirstLinePointId(GetFirstLinePointId()); operation->SetSecondLinePointId(GetSecondLinePointId()); operation->RefreshGeometry(); + + QStringList groupTags = ui->lineEditGroupTags->text().split(','); + for (auto &tag : groupTags) + { + tag = tag.trimmed(); + if (not m_groupTags.contains(tag)) + { + m_groupTags.append(tag); + } + } + + ui->lineEditGroupTags->SetCompletion(m_groupTags); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyline.h b/src/libs/vtools/dialogs/tools/dialogflippingbyline.h index b4334b4e7..27a4314a2 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyline.h +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyline.h @@ -65,6 +65,17 @@ public: QVector GetObjects() const; + QString GetVisibilityGroupName() const; + void SetVisibilityGroupName(const QString &name); + + bool HasLinkedVisibilityGroup() const; + void SetHasLinkedVisibilityGroup(bool linked); + + void SetVisibilityGroupTags(const QStringList &tags); + QStringList GetVisibilityGroupTags() const; + + virtual void SetGroupCategories(const QStringList &categories) override; + virtual void ShowDialog(bool click) override; public slots: @@ -73,6 +84,7 @@ public slots: private slots: void SuffixChanged(); + void GroupNameChanged(); protected: virtual void ShowVisualization() override; @@ -96,13 +108,16 @@ private: QString m_suffix; bool flagName; + bool flagGroupName; bool flagError; + + QStringList m_groupTags{}; }; //--------------------------------------------------------------------------------------------------------------------- inline bool DialogFlippingByLine::IsValid() const { - return flagError && flagName; + return flagError && flagName && flagGroupName; } #endif // DIALOGFLIPPINGBYLINE_H diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyline.ui b/src/libs/vtools/dialogs/tools/dialogflippingbyline.ui index fc76e9099..788368f5c 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyline.ui +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyline.ui @@ -6,8 +6,8 @@ 0 0 - 285 - 146 + 304 + 237 @@ -52,6 +52,61 @@ + + + + Enable to create a visibility gropup from original objects + + + Visibility Group + + + true + + + false + + + + + + Name: + + + + + + + Flipping by line + + + true + + + + + + + Tags: + + + + + + + Separate each tag with comma. + + + Add tags + + + true + + + + + + @@ -64,6 +119,13 @@ + + + VCompleterLineEdit + QLineEdit +
vlineedit.h
+
+
diff --git a/src/libs/vtools/dialogs/tools/dialoggroup.cpp b/src/libs/vtools/dialogs/tools/dialoggroup.cpp index 8aad034bf..3b5f4a713 100644 --- a/src/libs/vtools/dialogs/tools/dialoggroup.cpp +++ b/src/libs/vtools/dialogs/tools/dialoggroup.cpp @@ -28,6 +28,7 @@ #include "dialoggroup.h" +#include #include #include "ui_dialoggroup.h" @@ -63,6 +64,24 @@ QString DialogGroup::GetName() const return ui->lineEditName->text(); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogGroup::SetTags(const QStringList &tags) +{ + ui->lineEditTags->setText(tags.join(", ")); +} + +//--------------------------------------------------------------------------------------------------------------------- +QStringList DialogGroup::GetTags() const +{ + return ui->lineEditTags->text().split(","); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogGroup::SetGroupCategories(const QStringList &categories) +{ + ui->lineEditTags->SetCompletion(categories); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogGroup::ShowDialog(bool click) { diff --git a/src/libs/vtools/dialogs/tools/dialoggroup.h b/src/libs/vtools/dialogs/tools/dialoggroup.h index ec0efd4c9..ca9632c89 100644 --- a/src/libs/vtools/dialogs/tools/dialoggroup.h +++ b/src/libs/vtools/dialogs/tools/dialoggroup.h @@ -54,6 +54,11 @@ public: void SetName(const QString &name); QString GetName() const; + void SetTags(const QStringList &tags); + QStringList GetTags() const; + + virtual void SetGroupCategories(const QStringList &categories) override; + QMap GetGroup() const; virtual void ShowDialog(bool click) override; diff --git a/src/libs/vtools/dialogs/tools/dialoggroup.ui b/src/libs/vtools/dialogs/tools/dialoggroup.ui index 3983b99f8..436f2229f 100644 --- a/src/libs/vtools/dialogs/tools/dialoggroup.ui +++ b/src/libs/vtools/dialogs/tools/dialoggroup.ui @@ -6,8 +6,8 @@ 0 0 - 397 - 80 + 294 + 104
@@ -19,22 +19,45 @@ - - + + Group name: - + - Unique pattern piece name + Choose group name + + true + + + + + + + Tags: + + + + + + + Separate each tag with comma. + + + Add tags + + + true + @@ -51,6 +74,13 @@ + + + VCompleterLineEdit + QLineEdit +
vlineedit.h
+
+
diff --git a/src/libs/vtools/dialogs/tools/dialogmove.cpp b/src/libs/vtools/dialogs/tools/dialogmove.cpp index 2c9a3ee2a..c079a97a5 100644 --- a/src/libs/vtools/dialogs/tools/dialogmove.cpp +++ b/src/libs/vtools/dialogs/tools/dialogmove.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -85,7 +86,8 @@ DialogMove::DialogMove(const VContainer *data, quint32 toolId, QWidget *parent) flagAngle(false), flagRotationAngle(false), flagLength(false), - flagName(true) + flagName(true), + flagGroupName(true) { ui->setupUi(this); @@ -118,6 +120,7 @@ DialogMove::DialogMove(const VContainer *data, quint32 toolId, QWidget *parent) ui->comboBoxRotationOriginPoint->blockSignals(false); connect(ui->lineEditSuffix, &QLineEdit::textChanged, this, &DialogMove::SuffixChanged); + connect(ui->lineEditVisibilityGroup, &QLineEdit::textChanged, this, &DialogMove::GroupNameChanged); connect(ui->toolButtonExprAngle, &QPushButton::clicked, this, &DialogMove::FXAngle); connect(ui->toolButtonExprRotationAngle, &QPushButton::clicked, this, &DialogMove::FXRotationAngle); connect(ui->toolButtonExprLength, &QPushButton::clicked, this, &DialogMove::FXLength); @@ -257,6 +260,49 @@ QVector DialogMove::GetObjects() const return ConvertToVector(objects); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogMove::GetVisibilityGroupName() const +{ + return ui->lineEditVisibilityGroup->text(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogMove::SetVisibilityGroupName(const QString &name) +{ + ui->lineEditVisibilityGroup->setText(name.isEmpty() ? tr("Rotation") : name); +} + +//--------------------------------------------------------------------------------------------------------------------- +bool DialogMove::HasLinkedVisibilityGroup() const +{ + return ui->groupBoxVisibilityGroup->isChecked(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogMove::SetHasLinkedVisibilityGroup(bool linked) +{ + ui->groupBoxVisibilityGroup->setChecked(linked); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogMove::SetVisibilityGroupTags(const QStringList &tags) +{ + ui->lineEditGroupTags->setText(tags.join(", ")); +} + +//--------------------------------------------------------------------------------------------------------------------- +QStringList DialogMove::GetVisibilityGroupTags() const +{ + return ui->lineEditGroupTags->text().split(','); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogMove::SetGroupCategories(const QStringList &categories) +{ + m_groupTags = categories; + ui->lineEditGroupTags->SetCompletion(m_groupTags); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogMove::ShowDialog(bool click) { @@ -481,6 +527,27 @@ void DialogMove::SuffixChanged() CheckState(); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogMove::GroupNameChanged() +{ + QLineEdit* edit = qobject_cast(sender()); + if (edit) + { + const QString name = edit->text(); + if (name.isEmpty()) + { + flagGroupName = false; + ChangeColor(ui->labelGroupName, errorColor); + CheckState(); + return; + } + + flagGroupName = true; + ChangeColor(ui->labelGroupName, OkColor(this)); + } + CheckState(); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogMove::ShowVisualization() { @@ -504,6 +571,18 @@ void DialogMove::SaveData() operation->SetRotationAngle(formulaRotationAngle); operation->SetRotationOriginPointId(GetRotationOrigPointId()); operation->RefreshGeometry(); + + QStringList groupTags = ui->lineEditGroupTags->text().split(','); + for (auto &tag : groupTags) + { + tag = tag.trimmed(); + if (not m_groupTags.contains(tag)) + { + m_groupTags.append(tag); + } + } + + ui->lineEditGroupTags->SetCompletion(m_groupTags); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogmove.h b/src/libs/vtools/dialogs/tools/dialogmove.h index 632ad3b26..741d8d144 100644 --- a/src/libs/vtools/dialogs/tools/dialogmove.h +++ b/src/libs/vtools/dialogs/tools/dialogmove.h @@ -70,6 +70,17 @@ public: QVector GetObjects() const; + QString GetVisibilityGroupName() const; + void SetVisibilityGroupName(const QString &name); + + bool HasLinkedVisibilityGroup() const; + void SetHasLinkedVisibilityGroup(bool linked); + + void SetVisibilityGroupTags(const QStringList &tags); + QStringList GetVisibilityGroupTags() const; + + virtual void SetGroupCategories(const QStringList &categories) override; + virtual void ShowDialog(bool click) override; public slots: @@ -87,6 +98,7 @@ private slots: void FXLength(); void SuffixChanged(); + void GroupNameChanged(); protected: virtual void ShowVisualization() override; @@ -129,6 +141,9 @@ private: bool flagRotationAngle; bool flagLength; bool flagName; + bool flagGroupName; + + QStringList m_groupTags{}; void EvalAngle(); void EvalRotationAngle(); @@ -138,7 +153,7 @@ private: //--------------------------------------------------------------------------------------------------------------------- inline bool DialogMove::IsValid() const { - return flagAngle && flagRotationAngle && flagLength && flagName; + return flagAngle && flagRotationAngle && flagLength && flagName && flagGroupName; } #endif // DIALOGMOVING_H diff --git a/src/libs/vtools/dialogs/tools/dialogmove.ui b/src/libs/vtools/dialogs/tools/dialogmove.ui index 2dcc1d530..defd52ef1 100644 --- a/src/libs/vtools/dialogs/tools/dialogmove.ui +++ b/src/libs/vtools/dialogs/tools/dialogmove.ui @@ -6,8 +6,8 @@ 0 0 - 292 - 332 + 424 + 432 @@ -591,6 +591,61 @@
+ + + + Enable to create a visibility gropup from original objects + + + Visibility Group + + + true + + + false + + + + + + Name: + + + + + + + Move + + + true + + + + + + + Tags: + + + + + + + Separate each tag with comma. + + + Add tags + + + true + + + + + + @@ -604,6 +659,11 @@ + + VCompleterLineEdit + QLineEdit +
vlineedit.h
+
VPlainTextEdit QPlainTextEdit diff --git a/src/libs/vtools/dialogs/tools/dialogrotation.cpp b/src/libs/vtools/dialogs/tools/dialogrotation.cpp index cc9d0404e..306477be9 100644 --- a/src/libs/vtools/dialogs/tools/dialogrotation.cpp +++ b/src/libs/vtools/dialogs/tools/dialogrotation.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -77,6 +78,7 @@ DialogRotation::DialogRotation(const VContainer *data, quint32 toolId, QWidget * m_firstRelease(false), flagAngle(false), flagName(true), + flagGroupName(true), flagError(false) { ui->setupUi(this); @@ -94,6 +96,7 @@ DialogRotation::DialogRotation(const VContainer *data, quint32 toolId, QWidget * FillComboBoxPoints(ui->comboBoxOriginPoint); connect(ui->lineEditSuffix, &QLineEdit::textChanged, this, &DialogRotation::SuffixChanged); + connect(ui->lineEditVisibilityGroup, &QLineEdit::textChanged, this, &DialogRotation::GroupNameChanged); connect(ui->toolButtonExprAngle, &QPushButton::clicked, this, &DialogRotation::FXAngle); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, [this]() { @@ -170,6 +173,49 @@ QVector DialogRotation::GetObjects() const return ConvertToVector(objects); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogRotation::GetVisibilityGroupName() const +{ + return ui->lineEditVisibilityGroup->text(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogRotation::SetVisibilityGroupName(const QString &name) +{ + ui->lineEditVisibilityGroup->setText(name.isEmpty() ? tr("Rotation") : name); +} + +//--------------------------------------------------------------------------------------------------------------------- +bool DialogRotation::HasLinkedVisibilityGroup() const +{ + return ui->groupBoxVisibilityGroup->isChecked(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogRotation::SetHasLinkedVisibilityGroup(bool linked) +{ + ui->groupBoxVisibilityGroup->setChecked(linked); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogRotation::SetVisibilityGroupTags(const QStringList &tags) +{ + ui->lineEditGroupTags->setText(tags.join(", ")); +} + +//--------------------------------------------------------------------------------------------------------------------- +QStringList DialogRotation::GetVisibilityGroupTags() const +{ + return ui->lineEditGroupTags->text().split(','); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogRotation::SetGroupCategories(const QStringList &categories) +{ + m_groupTags = categories; + ui->lineEditGroupTags->SetCompletion(m_groupTags); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogRotation::ShowDialog(bool click) { @@ -366,6 +412,27 @@ void DialogRotation::SuffixChanged() CheckState(); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogRotation::GroupNameChanged() +{ + QLineEdit* edit = qobject_cast(sender()); + if (edit) + { + const QString name = edit->text(); + if (name.isEmpty()) + { + flagGroupName = false; + ChangeColor(ui->labelGroupName, errorColor); + CheckState(); + return; + } + + flagGroupName = true; + ChangeColor(ui->labelGroupName, OkColor(this)); + } + CheckState(); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogRotation::ShowVisualization() { @@ -385,6 +452,18 @@ void DialogRotation::SaveData() operation->SetOriginPointId(GetOrigPointId()); operation->SetAngle(formulaAngle); operation->RefreshGeometry(); + + QStringList groupTags = ui->lineEditGroupTags->text().split(','); + for (auto &tag : groupTags) + { + tag = tag.trimmed(); + if (not m_groupTags.contains(tag)) + { + m_groupTags.append(tag); + } + } + + ui->lineEditGroupTags->SetCompletion(m_groupTags); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogrotation.h b/src/libs/vtools/dialogs/tools/dialogrotation.h index f26194389..89b1221d5 100644 --- a/src/libs/vtools/dialogs/tools/dialogrotation.h +++ b/src/libs/vtools/dialogs/tools/dialogrotation.h @@ -63,6 +63,17 @@ public: QVector GetObjects() const; + QString GetVisibilityGroupName() const; + void SetVisibilityGroupName(const QString &name); + + bool HasLinkedVisibilityGroup() const; + void SetHasLinkedVisibilityGroup(bool linked); + + void SetVisibilityGroupTags(const QStringList &tags); + QStringList GetVisibilityGroupTags() const; + + virtual void SetGroupCategories(const QStringList &categories) override; + virtual void ShowDialog(bool click) override; public slots: @@ -74,6 +85,7 @@ private slots: void DeployAngleTextEdit(); void FXAngle(); void SuffixChanged(); + void GroupNameChanged(); void EvalAngle(); protected: @@ -111,13 +123,16 @@ private: /** @brief flagAngle true if value of angle is correct */ bool flagAngle; bool flagName; + bool flagGroupName; bool flagError; + + QStringList m_groupTags{}; }; //--------------------------------------------------------------------------------------------------------------------- inline bool DialogRotation::IsValid() const { - return flagAngle && flagName && flagError; + return flagAngle && flagName && flagError && flagGroupName; } #endif // DIALOGROTATION_H diff --git a/src/libs/vtools/dialogs/tools/dialogrotation.ui b/src/libs/vtools/dialogs/tools/dialogrotation.ui index cae139a96..84bc08968 100644 --- a/src/libs/vtools/dialogs/tools/dialogrotation.ui +++ b/src/libs/vtools/dialogs/tools/dialogrotation.ui @@ -6,8 +6,8 @@ 0 0 - 285 - 189 + 392 + 282 @@ -222,6 +222,61 @@
+ + + + Enable to create a visibility gropup from original objects + + + Visibility Group + + + true + + + false + + + + + + Tags: + + + + + + + Rotation + + + true + + + + + + + Name: + + + + + + + Separate each tag with comma. + + + Add tags + + + true + + + + + + @@ -235,6 +290,11 @@ + + VCompleterLineEdit + QLineEdit +
vlineedit.h
+
VPlainTextEdit QPlainTextEdit diff --git a/src/libs/vtools/dialogs/tools/dialogtool.cpp b/src/libs/vtools/dialogs/tools/dialogtool.cpp index 2e69eb12c..ee514bfd0 100644 --- a/src/libs/vtools/dialogs/tools/dialogtool.cpp +++ b/src/libs/vtools/dialogs/tools/dialogtool.cpp @@ -799,6 +799,13 @@ void DialogTool::SetToolId(const quint32 &value) toolId = value; } +//--------------------------------------------------------------------------------------------------------------------- +void DialogTool::SetGroupCategories(const QStringList &categories) +{ + Q_UNUSED(categories) + // do nothing +} + //--------------------------------------------------------------------------------------------------------------------- void DialogTool::ShowDialog(bool click) { diff --git a/src/libs/vtools/dialogs/tools/dialogtool.h b/src/libs/vtools/dialogs/tools/dialogtool.h index 46e3775ae..c13c54651 100644 --- a/src/libs/vtools/dialogs/tools/dialogtool.h +++ b/src/libs/vtools/dialogs/tools/dialogtool.h @@ -90,6 +90,8 @@ public: quint32 GetToolId() const; void SetToolId(const quint32 &value); + virtual void SetGroupCategories(const QStringList &categories); + static void MoveListRowTop(QListWidget *list); static void MoveListRowUp(QListWidget *list); static void MoveListRowDown(QListWidget *list); diff --git a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp index 5672d9325..86db51444 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp @@ -3059,6 +3059,12 @@ void DialogSeamAllowance::InitPatternPieceDataTab() //--------------------------------------------------------------------------------------------------------------------- void DialogSeamAllowance::InitLabelsTab() { + QString labelValue = QString().setNum(UnitConvertor(10, Unit::Cm, *data->GetPatternUnit())); + uiTabLabels->lineEditDLWidthFormula->setPlainText(labelValue); + uiTabLabels->lineEditDLHeightFormula->setPlainText(labelValue); + uiTabLabels->lineEditPLWidthFormula->setPlainText(labelValue); + uiTabLabels->lineEditPLHeightFormula->setPlainText(labelValue); + m_DLWidthBaseHeight = uiTabLabels->lineEditDLWidthFormula->height(); m_DLHeightBaseHeight = uiTabLabels->lineEditDLHeightFormula->height(); m_DLAngleBaseHeight = uiTabLabels->lineEditDLAngleFormula->height(); @@ -3125,6 +3131,9 @@ void DialogSeamAllowance::InitLabelsTab() //--------------------------------------------------------------------------------------------------------------------- void DialogSeamAllowance::InitGrainlineTab() { + uiTabGrainline->lineEditLenFormula->setPlainText( + QString().setNum(UnitConvertor(10, Unit::Cm, *data->GetPatternUnit()))); + connect(uiTabGrainline->groupBoxGrainline, &QGroupBox::toggled, this, &DialogSeamAllowance::EnabledGrainline); connect(uiTabGrainline->pushButtonRot, &QPushButton::clicked, this, &DialogSeamAllowance::EditGrainlineFormula); connect(uiTabGrainline->pushButtonLen, &QPushButton::clicked, this, &DialogSeamAllowance::EditGrainlineFormula); @@ -3349,7 +3358,7 @@ void DialogSeamAllowance::SetGrainlineLength(QString lengthFormula) { if (lengthFormula.isEmpty()) { - lengthFormula = QString().setNum(UnitConvertor(1, Unit::Cm, *data->GetPatternUnit())); + lengthFormula = QString().setNum(UnitConvertor(10, Unit::Cm, *data->GetPatternUnit())); } const QString formula = qApp->TrVars()->FormulaToUser(lengthFormula, qApp->Settings()->GetOsSeparator()); @@ -3369,7 +3378,7 @@ void DialogSeamAllowance::SetDLWidth(QString widthFormula) { if (widthFormula.isEmpty()) { - widthFormula = QString().setNum(UnitConvertor(1, Unit::Cm, *data->GetPatternUnit())); + widthFormula = QString().setNum(UnitConvertor(10, Unit::Cm, *data->GetPatternUnit())); } const QString formula = qApp->TrVars()->FormulaToUser(widthFormula, qApp->Settings()->GetOsSeparator()); @@ -3389,7 +3398,7 @@ void DialogSeamAllowance::SetDLHeight(QString heightFormula) { if (heightFormula.isEmpty()) { - heightFormula = QString().setNum(UnitConvertor(1, Unit::Cm, *data->GetPatternUnit())); + heightFormula = QString().setNum(UnitConvertor(10, Unit::Cm, *data->GetPatternUnit())); } const QString formula = qApp->TrVars()->FormulaToUser(heightFormula, qApp->Settings()->GetOsSeparator()); @@ -3429,7 +3438,7 @@ void DialogSeamAllowance::SetPLWidth(QString widthFormula) { if (widthFormula.isEmpty()) { - widthFormula = QString().setNum(UnitConvertor(1, Unit::Cm, *data->GetPatternUnit())); + widthFormula = QString().setNum(UnitConvertor(10, Unit::Cm, *data->GetPatternUnit())); } const QString formula = qApp->TrVars()->FormulaToUser(widthFormula, qApp->Settings()->GetOsSeparator()); @@ -3449,7 +3458,7 @@ void DialogSeamAllowance::SetPLHeight(QString heightFormula) { if (heightFormula.isEmpty()) { - heightFormula = QString().setNum(UnitConvertor(1, Unit::Cm, *data->GetPatternUnit())); + heightFormula = QString().setNum(UnitConvertor(10, Unit::Cm, *data->GetPatternUnit())); } const QString formula = qApp->TrVars()->FormulaToUser(heightFormula, qApp->Settings()->GetOsSeparator()); diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp index e64036d7d..ca558230f 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp @@ -74,6 +74,8 @@ void VToolFlippingByAxis::setDialog() dialogTool->SetOriginPointId(m_originPointId); dialogTool->SetAxisType(m_axisType); dialogTool->SetSuffix(suffix); + + SetDialogVisibilityGroupData(dialogTool); } //--------------------------------------------------------------------------------------------------------------------- @@ -89,6 +91,9 @@ VToolFlippingByAxis *VToolFlippingByAxis::Create(const QPointer &dia initData.axisType = dialogTool->GetAxisType(); initData.suffix = dialogTool->GetSuffix(); initData.source = dialogTool->GetObjects(); + initData.hasLinkedVisibilityGroup = dialogTool->HasLinkedVisibilityGroup(); + initData.visibilityGroupName = dialogTool->GetVisibilityGroupName(); + initData.visibilityGroupTags = dialogTool->GetVisibilityGroupTags(); initData.scene = scene; initData.doc = doc; initData.data = data; @@ -123,6 +128,11 @@ VToolFlippingByAxis *VToolFlippingByAxis::Create(VToolFlippingByAxisInitData ini if (initData.parse == Document::FullParse) { + if (initData.typeCreation == Source::FromGui && initData.hasLinkedVisibilityGroup) + { + qApp->getUndoStack()->beginMacro(tr("Flipping by axis")); + } + VAbstractTool::AddRecord(initData.id, Tool::FlippingByAxis, initData.doc); VToolFlippingByAxis *tool = new VToolFlippingByAxis(initData); initData.scene->addItem(tool); @@ -133,6 +143,13 @@ VToolFlippingByAxis *VToolFlippingByAxis::Create(VToolFlippingByAxisInitData ini { initData.doc->IncrementReferens(initData.data->GetGObject(idObject)->getIdTool()); } + + if (initData.typeCreation == Source::FromGui && initData.hasLinkedVisibilityGroup) + { + VAbstractOperation::CreateVisibilityGroup(initData); + qApp->getUndoStack()->endMacro(); + } + return tool; } return nullptr; @@ -208,6 +225,10 @@ void VToolFlippingByAxis::SaveDialog(QDomElement &domElement, QList &ol doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetOriginPointId())); doc->SetAttribute(domElement, AttrAxisType, QString().setNum(static_cast(dialogTool->GetAxisType()))); doc->SetAttribute(domElement, AttrSuffix, dialogTool->GetSuffix()); + + // Save for later use. + hasLinkedGroup = dialogTool->HasLinkedVisibilityGroup(); + groupName = dialogTool->GetVisibilityGroupName(); } //--------------------------------------------------------------------------------------------------------------------- @@ -234,8 +255,10 @@ void VToolFlippingByAxis::SaveOptions(QDomElement &tag, QSharedPointer //--------------------------------------------------------------------------------------------------------------------- QString VToolFlippingByAxis::MakeToolTip() const { - return QStringLiteral(" %1: %2 ") - .arg(tr("Origin point"), OriginPointName()); + return QStringLiteral(" %1: %2 " + "%3") + .arg(tr("Origin point"), OriginPointName()) // 1, 2 + .arg(VisibilityGroupToolTip()); // 3 } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp index 97d161154..e862a99b7 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp @@ -74,6 +74,8 @@ void VToolFlippingByLine::setDialog() dialogTool->SetFirstLinePointId(m_firstLinePointId); dialogTool->SetSecondLinePointId(m_secondLinePointId); dialogTool->SetSuffix(suffix); + + SetDialogVisibilityGroupData(dialogTool); } //--------------------------------------------------------------------------------------------------------------------- @@ -89,6 +91,9 @@ VToolFlippingByLine *VToolFlippingByLine::Create(const QPointer &dia initData.secondLinePointId = dialogTool->GetSecondLinePointId(); initData.suffix = dialogTool->GetSuffix(); initData.source = dialogTool->GetObjects(); + initData.hasLinkedVisibilityGroup = dialogTool->HasLinkedVisibilityGroup(); + initData.visibilityGroupName = dialogTool->GetVisibilityGroupName(); + initData.visibilityGroupTags = dialogTool->GetVisibilityGroupTags(); initData.scene = scene; initData.doc = doc; initData.data = data; @@ -116,6 +121,11 @@ VToolFlippingByLine *VToolFlippingByLine::Create(VToolFlippingByLineInitData ini if (initData.parse == Document::FullParse) { + if (initData.typeCreation == Source::FromGui && initData.hasLinkedVisibilityGroup) + { + qApp->getUndoStack()->beginMacro(tr("flipping by line")); + } + VAbstractTool::AddRecord(initData.id, Tool::FlippingByLine, initData.doc); VToolFlippingByLine *tool = new VToolFlippingByLine(initData); initData.scene->addItem(tool); @@ -127,6 +137,13 @@ VToolFlippingByLine *VToolFlippingByLine::Create(VToolFlippingByLineInitData ini { initData.doc->IncrementReferens(initData.data->GetGObject(idObject)->getIdTool()); } + + if (initData.typeCreation == Source::FromGui && initData.hasLinkedVisibilityGroup) + { + VAbstractOperation::CreateVisibilityGroup(initData); + qApp->getUndoStack()->endMacro(); + } + return tool; } return nullptr; @@ -195,6 +212,10 @@ void VToolFlippingByLine::SaveDialog(QDomElement &domElement, QList &ol doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetFirstLinePointId())); doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetSecondLinePointId())); doc->SetAttribute(domElement, AttrSuffix, dialogTool->GetSuffix()); + + // Save for later use. + hasLinkedGroup = dialogTool->HasLinkedVisibilityGroup(); + groupName = dialogTool->GetVisibilityGroupName(); } //--------------------------------------------------------------------------------------------------------------------- @@ -222,8 +243,11 @@ void VToolFlippingByLine::SaveOptions(QDomElement &tag, QSharedPointer QString VToolFlippingByLine::MakeToolTip() const { return QStringLiteral(" %1: %2 " - " %3: %4 ") - .arg(tr("First line point"), FirstLinePointName(), tr("Second line point"), SecondLinePointName()); + " %3: %4 " + "%5") + .arg(tr("First line point"), FirstLinePointName(), + tr("Second line point"), SecondLinePointName()) // 1, 2, 3, 4 + .arg(VisibilityGroupToolTip()); // 5 } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp index 9d1ad8a3f..e3b72e2fa 100644 --- a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp @@ -29,12 +29,44 @@ #include "vabstractoperation.h" #include "../../../undocommands/label/operationmovelabel.h" #include "../../../undocommands/label/operationshowlabel.h" +#include "../../../undocommands/savetooloptions.h" +#include "../../../undocommands/undogroup.h" +#include "../../../undocommands/deltool.h" #include "../vgeometry/vpointf.h" const QString VAbstractOperation::TagItem = QStringLiteral("item"); const QString VAbstractOperation::TagSource = QStringLiteral("source"); const QString VAbstractOperation::TagDestination = QStringLiteral("destination"); +namespace +{ +/** + * @brief VisibilityGroupDataFromSource converts source list to visibility group list. + * @param data container with pattern data + * @param source list with source objects + * @return visibility group data + */ +QMap VisibilityGroupDataFromSource(const VContainer *data, const QVector &source) +{ + QMap groupData; + + for (auto &sId : source) + { + try + { + groupData.insert(sId, data->GetGObject(sId)->getIdTool()); + } + catch (const VExceptionBadId &) + { + // ignore + } + + } + + return groupData; +} +} + //--------------------------------------------------------------------------------------------------------------------- QString VAbstractOperation::getTagName() const { @@ -498,6 +530,26 @@ VAbstractOperation::VAbstractOperation(VAbstractPattern *doc, VContainer *data, destination(destination), operatedObjects() { + connect(doc, &VAbstractPattern::UpdateToolTip, [this]() + { + QMapIterator i(operatedObjects); + while (i.hasNext()) + { + i.next(); + if (i.value()->GetType() == GOType::Point) + { + VSimplePoint *item = qobject_cast(i.value()); + SCASSERT(item != nullptr) + item->setToolTip(ComplexPointToolTip(i.key())); + } + else + { + VSimpleCurve *item = qobject_cast(i.value()); + SCASSERT(item != nullptr) + item->setToolTip(ComplexCurveToolTip(i.key())); + } + } + }); } //--------------------------------------------------------------------------------------------------------------------- @@ -528,6 +580,95 @@ void VAbstractOperation::ChangeLabelVisibility(quint32 id, bool visible) } } +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractOperation::ApplyToolOptions(const QList &oldDependencies, const QList &newDependencies, + const QDomElement &oldDomElement, const QDomElement &newDomElement) +{ + bool updateToolOptions = + newDependencies != oldDependencies || not VDomDocument::Compare(newDomElement, oldDomElement); + bool updateVisibilityOptions = NeedUpdateVisibilityGroup(); + + if (updateToolOptions && updateVisibilityOptions) + { + qApp->getUndoStack()->beginMacro(tr("operation options")); + } + + if (updateToolOptions) + { + SaveToolOptions *saveOptions = new SaveToolOptions(oldDomElement, newDomElement, oldDependencies, + newDependencies, doc, m_id); + connect(saveOptions, &SaveToolOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree); + qApp->getUndoStack()->push(saveOptions); + } + + if (updateVisibilityOptions) + { + vidtype group = doc->GroupLinkedToTool(m_id); + + if (hasLinkedGroup) + { + if (group != null_id) + { + ChangeGroupOptions *groupOptions = new ChangeGroupOptions(doc, group, groupName, groupTags); + connect(groupOptions, &ChangeGroupOptions::UpdateGroups, doc, &VAbstractPattern::UpdateVisiblityGroups); + qApp->getUndoStack()->push(groupOptions); + } + else + { + VAbstractOperationInitData initData; + initData.id = m_id; + initData.hasLinkedVisibilityGroup = hasLinkedGroup; + initData.visibilityGroupName = groupName; + initData.visibilityGroupTags = groupTags; + initData.data = &(VDataTool::data); + initData.doc = doc; + initData.source = source; + + VAbstractOperation::CreateVisibilityGroup(initData); + } + } + else + { + DelGroup *delGroup = new DelGroup(doc, group); + connect(delGroup, &DelGroup::UpdateGroups, doc, &VAbstractPattern::UpdateVisiblityGroups); + qApp->getUndoStack()->push(delGroup); + } + } + + if (updateToolOptions && updateVisibilityOptions) + { + qApp->getUndoStack()->endMacro(); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractOperation::PerformDelete() +{ + vidtype group = doc->GroupLinkedToTool(m_id); + bool deleteGroup = group != null_id; + + qCDebug(vTool, "Begin deleting."); + if (deleteGroup) + { + qApp->getUndoStack()->beginMacro(tr("delete operation")); + + qCDebug(vTool, "Deleting the linked group."); + DelGroup *delGroup = new DelGroup(doc, group); + connect(delGroup, &DelGroup::UpdateGroups, doc, &VAbstractPattern::UpdateVisiblityGroups); + qApp->getUndoStack()->push(delGroup); + } + + qCDebug(vTool, "Deleting the tool."); + DelTool *delTool = new DelTool(doc, m_id); + connect(delTool, &DelTool::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); + qApp->getUndoStack()->push(delTool); + + if (deleteGroup) + { + qApp->getUndoStack()->endMacro(); + } +} + //--------------------------------------------------------------------------------------------------------------------- void VAbstractOperation::UpdateNamePosition(quint32 id, const QPointF &pos) { @@ -641,6 +782,33 @@ void VAbstractOperation::AllowCurveSelecting(bool enabled, GOType type) } } +//--------------------------------------------------------------------------------------------------------------------- +bool VAbstractOperation::NeedUpdateVisibilityGroup() const +{ + vidtype group = doc->GroupLinkedToTool(m_id); + + if (hasLinkedGroup) + { + if (group != null_id) + { + if (groupName != doc->GetGroupName(group) || groupTags != doc->GetGroupTags(group)) + { + return true; // rename group + } + } + else + { + return true; // create group + } + } + else + { + return group != null_id; // remove group + } + + return false; +} + //--------------------------------------------------------------------------------------------------------------------- void VAbstractOperation::InitOperatedObjects() { @@ -725,3 +893,38 @@ QString VAbstractOperation::ComplexCurveToolTip(quint32 itemId) const .arg(UnitsToStr(qApp->patternUnit(), true), MakeToolTip()); return toolTip; } + +//--------------------------------------------------------------------------------------------------------------------- +QString VAbstractOperation::VisibilityGroupToolTip() const +{ + vidtype group = doc->GroupLinkedToTool(m_id); + if (group != null_id) + { + return QStringLiteral(" %1: %2 ") + .arg(tr("Visibility group"), doc->GetGroupName(group)); // 1, 2 + } + + return QString(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractOperation::CreateVisibilityGroup(const VAbstractOperationInitData &initData) +{ + if (not initData.hasLinkedVisibilityGroup && not initData.visibilityGroupName.isEmpty()) + { + return; + } + + const QMap groupData = VisibilityGroupDataFromSource(initData.data, initData.source); + vidtype groupId = initData.data->getNextId(); + const QDomElement group = initData.doc->CreateGroup(groupId, initData.visibilityGroupName, + initData.visibilityGroupTags, groupData, initData.id); + if (not group.isNull()) + { + AddGroup *addGroup = new AddGroup(group, initData.doc); + connect(addGroup, &AddGroup::UpdateGroups, initData.doc, &VAbstractPattern::UpdateVisiblityGroups); + qApp->getUndoStack()->push(addGroup); + } + + return; +} diff --git a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h index 411b25d90..926411a72 100644 --- a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h +++ b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.h @@ -53,15 +53,15 @@ struct DestinationItem struct VAbstractOperationInitData : VAbstractToolInitData { VAbstractOperationInitData() - : VAbstractToolInitData(), - suffix(), - source(), - destination() + : VAbstractToolInitData() {} - QString suffix; - QVector source; - QVector destination; + QString suffix{}; + QVector source{}; + QVector destination{}; + QString visibilityGroupName{}; + QStringList visibilityGroupTags{}; + bool hasLinkedVisibilityGroup{false}; }; // FIXME. I don't know how to use QGraphicsItem properly, so just took first available finished class. @@ -133,12 +133,19 @@ protected: QMap operatedObjects; + bool hasLinkedGroup{false}; + QString groupName{}; + QStringList groupTags{}; + VAbstractOperation(VAbstractPattern *doc, VContainer *data, quint32 id, const QString &suffix, const QVector &source, const QVector &destination, QGraphicsItem *parent = nullptr); virtual void AddToFile() override; virtual void ChangeLabelVisibility(quint32 id, bool visible) override; + virtual void ApplyToolOptions(const QList &oldDependencies, const QList &newDependencies, + const QDomElement &oldDomElement, const QDomElement &newDomElement) override; + virtual void PerformDelete() override; void UpdateNamePosition(quint32 id, const QPointF &pos); void SaveSourceDestination(QDomElement &tag); @@ -146,6 +153,9 @@ protected: template void ShowToolVisualization(bool show); + template + void SetDialogVisibilityGroupData(QPointer dialogTool); + void InitCurve(quint32 id, VContainer *data, GOType curveType, SceneObject sceneType); template @@ -155,13 +165,38 @@ protected: QString ComplexPointToolTip(quint32 itemId) const; QString ComplexCurveToolTip(quint32 itemId) const; + QString VisibilityGroupToolTip() const; + + static void CreateVisibilityGroup(const VAbstractOperationInitData & initData); private: Q_DISABLE_COPY(VAbstractOperation) void AllowCurveHover(bool enabled, GOType type); void AllowCurveSelecting(bool enabled, GOType type); + + bool NeedUpdateVisibilityGroup() const; }; +//--------------------------------------------------------------------------------------------------------------------- +template +void VAbstractOperation::SetDialogVisibilityGroupData(QPointer dialogTool) +{ + SCASSERT(not dialogTool.isNull()) + + vidtype group = doc->GroupLinkedToTool(m_id); + dialogTool->SetGroupCategories(doc->GetGroupCategories()); + if (group != null_id) + { + dialogTool->SetHasLinkedVisibilityGroup(true); + dialogTool->SetVisibilityGroupName(doc->GetGroupName(group)); + dialogTool->SetVisibilityGroupTags(doc->GetGroupTags(group)); + } + else + { + dialogTool->SetHasLinkedVisibilityGroup(false); + } +} + //--------------------------------------------------------------------------------------------------------------------- template void VAbstractOperation::ShowToolVisualization(bool show) diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp index c0bf390e3..24c5bf9b4 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp @@ -128,6 +128,8 @@ void VToolMove::setDialog() dialogTool->SetLength(formulaLength); dialogTool->SetSuffix(suffix); dialogTool->SetRotationOrigPointId(origPointId); + + SetDialogVisibilityGroupData(dialogTool); } //--------------------------------------------------------------------------------------------------------------------- @@ -145,6 +147,9 @@ VToolMove *VToolMove::Create(const QPointer &dialog, VMainGraphicsSc initData.rotationOrigin = dialogTool->GetRotationOrigPointId(); initData.suffix = dialogTool->GetSuffix(); initData.source = dialogTool->GetObjects(); + initData.hasLinkedVisibilityGroup = dialogTool->HasLinkedVisibilityGroup(); + initData.visibilityGroupName = dialogTool->GetVisibilityGroupName(); + initData.visibilityGroupTags = dialogTool->GetVisibilityGroupTags(); initData.scene = scene; initData.doc = doc; initData.data = data; @@ -309,6 +314,11 @@ QT_WARNING_POP if (initData.parse == Document::FullParse) { + if (initData.typeCreation == Source::FromGui && initData.hasLinkedVisibilityGroup) + { + qApp->getUndoStack()->beginMacro(tr("move")); + } + VAbstractTool::AddRecord(initData.id, Tool::Move, initData.doc); VToolMove *tool = new VToolMove(initData); initData.scene->addItem(tool); @@ -324,6 +334,13 @@ QT_WARNING_POP { initData.doc->IncrementReferens(initData.data->GetGObject(idObject)->getIdTool()); } + + if (initData.typeCreation == Source::FromGui && initData.hasLinkedVisibilityGroup) + { + VAbstractOperation::CreateVisibilityGroup(initData); + qApp->getUndoStack()->endMacro(); + } + return tool; } return nullptr; @@ -464,6 +481,10 @@ void VToolMove::SaveDialog(QDomElement &domElement, QList &oldDependenc doc->SetAttribute(domElement, AttrSuffix, dialogTool->GetSuffix()); doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetRotationOrigPointId())); doc->SetAttribute(domElement, AttrRotationAngle, dialogTool->GetRotationAngle()); + + // Save for later use. + hasLinkedGroup = dialogTool->HasLinkedVisibilityGroup(); + groupName = dialogTool->GetVisibilityGroupName(); } //--------------------------------------------------------------------------------------------------------------------- @@ -497,7 +518,8 @@ QString VToolMove::MakeToolTip() const return QStringLiteral(" %1: %2° " " %3: %4 %5 " " %6: %7° " - " %8: %9 ") + " %8: %9 " + "%10") .arg(tr("Angle")) // 1 .arg(GetFormulaAngle().getDoubleValue()) // 2 .arg(tr("Length")) // 3 @@ -506,7 +528,8 @@ QString VToolMove::MakeToolTip() const tr("Rotation angle")) // 6 .arg(GetFormulaRotationAngle().getDoubleValue()) // 7 .arg(tr("Rotation origin point"), // 8 - OriginPointName()); // 9 + OriginPointName()) // 9 + .arg(VisibilityGroupToolTip()); // 10 } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp index efbaf0083..1d4428f33 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp @@ -98,6 +98,8 @@ void VToolRotation::setDialog() dialogTool->SetOrigPointId(origPointId); dialogTool->SetAngle(formulaAngle); dialogTool->SetSuffix(suffix); + + SetDialogVisibilityGroupData(dialogTool); } //--------------------------------------------------------------------------------------------------------------------- @@ -113,6 +115,9 @@ VToolRotation *VToolRotation::Create(const QPointer &dialog, VMainGr initData.angle = dialogTool->GetAngle(); initData.suffix = dialogTool->GetSuffix(); initData.source = dialogTool->GetObjects(); + initData.hasLinkedVisibilityGroup = dialogTool->HasLinkedVisibilityGroup(); + initData.visibilityGroupName = dialogTool->GetVisibilityGroupName(); + initData.visibilityGroupTags = dialogTool->GetVisibilityGroupTags(); initData.scene = scene; initData.doc = doc; initData.data = data; @@ -251,6 +256,11 @@ QT_WARNING_POP if (initData.parse == Document::FullParse) { + if (initData.typeCreation == Source::FromGui && initData.hasLinkedVisibilityGroup) + { + qApp->getUndoStack()->beginMacro(tr("rotate")); + } + VAbstractTool::AddRecord(initData.id, Tool::Rotation, initData.doc); VToolRotation *tool = new VToolRotation(initData); initData.scene->addItem(tool); @@ -261,6 +271,13 @@ QT_WARNING_POP { initData.doc->IncrementReferens(initData.data->GetGObject(idObject)->getIdTool()); } + + if (initData.typeCreation == Source::FromGui && initData.hasLinkedVisibilityGroup) + { + VAbstractOperation::CreateVisibilityGroup(initData); + qApp->getUndoStack()->endMacro(); + } + return tool; } return nullptr; @@ -344,6 +361,10 @@ void VToolRotation::SaveDialog(QDomElement &domElement, QList &oldDepen doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetOrigPointId())); doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle()); doc->SetAttribute(domElement, AttrSuffix, dialogTool->GetSuffix()); + + // Save for later use. + hasLinkedGroup = dialogTool->HasLinkedVisibilityGroup(); + groupName = dialogTool->GetVisibilityGroupName(); } //--------------------------------------------------------------------------------------------------------------------- @@ -371,9 +392,11 @@ void VToolRotation::SaveOptions(QDomElement &tag, QSharedPointer &obj) QString VToolRotation::MakeToolTip() const { return QStringLiteral(" %1: %2 " - " %3: %4° ") - .arg(tr("Origin point"), OriginPointName(), tr("Rotation angle")) - .arg(GetFormulaAngle().getDoubleValue()); + " %3: %4° " + "%5") + .arg(tr("Origin point"), OriginPointName(), tr("Rotation angle")) // 1, 2, 3 + .arg(GetFormulaAngle().getDoubleValue()) // 4 + .arg(VisibilityGroupToolTip()); // 5 } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/vdrawtool.cpp b/src/libs/vtools/tools/drawTools/vdrawtool.cpp index 682a9c368..1abee64b1 100644 --- a/src/libs/vtools/tools/drawTools/vdrawtool.cpp +++ b/src/libs/vtools/tools/drawTools/vdrawtool.cpp @@ -114,14 +114,7 @@ void VDrawTool::SaveDialogChange(const QString &undoText) QList oldDependencies; QList newDependencies; SaveDialog(newDomElement, oldDependencies, newDependencies); - - if (newDependencies != oldDependencies || not VDomDocument::Compare(newDomElement, oldDomElement)) - { - SaveToolOptions *saveOptions = new SaveToolOptions(oldDomElement, newDomElement, oldDependencies, - newDependencies, doc, m_id); - connect(saveOptions, &SaveToolOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree); - qApp->getUndoStack()->push(saveOptions); - } + ApplyToolOptions(oldDependencies, newDependencies, oldDomElement, newDomElement); } else { @@ -129,6 +122,19 @@ void VDrawTool::SaveDialogChange(const QString &undoText) } } +//--------------------------------------------------------------------------------------------------------------------- +void VDrawTool::ApplyToolOptions(const QList &oldDependencies, const QList &newDependencies, + const QDomElement &oldDomElement, const QDomElement &newDomElement) +{ + if (newDependencies != oldDependencies || not VDomDocument::Compare(newDomElement, oldDomElement)) + { + SaveToolOptions *saveOptions = new SaveToolOptions(oldDomElement, newDomElement, oldDependencies, + newDependencies, doc, m_id); + connect(saveOptions, &SaveToolOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree); + qApp->getUndoStack()->push(saveOptions); + } +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief AddToFile add tag with informations about tool into file. diff --git a/src/libs/vtools/tools/drawTools/vdrawtool.h b/src/libs/vtools/tools/drawTools/vdrawtool.h index 396401400..b8de88334 100644 --- a/src/libs/vtools/tools/drawTools/vdrawtool.h +++ b/src/libs/vtools/tools/drawTools/vdrawtool.h @@ -51,9 +51,7 @@ #include "../vwidgets/vabstractmainwindow.h" #include "../vdatatool.h" #include "../vgeometry/vpointf.h" -#include "../vtools/undocommands/addgroup.h" -#include "../vtools/undocommands/additemtogroup.h" -#include "../vtools/undocommands/removeitemfromgroup.h" +#include "../vtools/undocommands/undogroup.h" /** * @brief The VDrawTool abstract class for all draw tool. @@ -101,6 +99,8 @@ protected: virtual void SaveDialog(QDomElement &domElement, QList &oldDependencies, QList &newDependencies)=0; virtual void SaveDialogChange(const QString &undoText = QString()) final; + virtual void ApplyToolOptions(const QList &oldDependencies, const QList &newDependencies, + const QDomElement &oldDomElement, const QDomElement &newDomElement); virtual void AddToFile() override; void SaveOption(QSharedPointer &obj); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); diff --git a/src/libs/vtools/tools/vabstracttool.cpp b/src/libs/vtools/tools/vabstracttool.cpp index 17b459939..0488f935a 100644 --- a/src/libs/vtools/tools/vabstracttool.cpp +++ b/src/libs/vtools/tools/vabstracttool.cpp @@ -224,10 +224,7 @@ void VAbstractTool::DeleteToolWithConfirm(bool ask) } } - qCDebug(vTool, "Begin deleting."); - DelTool *delTool = new DelTool(doc, m_id); - connect(delTool, &DelTool::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); - qApp->getUndoStack()->push(delTool); + PerformDelete(); // Throw exception, this will help prevent case when we forget to immediately quit function. VExceptionToolWasDeleted e("Tool was used after deleting."); @@ -239,6 +236,15 @@ void VAbstractTool::DeleteToolWithConfirm(bool ask) } } +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractTool::PerformDelete() +{ + qCDebug(vTool, "Begin deleting."); + DelTool *delTool = new DelTool(doc, m_id); + connect(delTool, &DelTool::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing); + qApp->getUndoStack()->push(delTool); +} + //--------------------------------------------------------------------------------------------------------------------- int VAbstractTool::ConfirmDeletion() { diff --git a/src/libs/vtools/tools/vabstracttool.h b/src/libs/vtools/tools/vabstracttool.h index 00f467654..80d6135b2 100644 --- a/src/libs/vtools/tools/vabstracttool.h +++ b/src/libs/vtools/tools/vabstracttool.h @@ -159,6 +159,7 @@ protected: */ virtual void RemoveReferens() {} virtual void DeleteToolWithConfirm(bool ask = true); + virtual void PerformDelete(); static int ConfirmDeletion(); template diff --git a/src/libs/vtools/tools/vtoolseamallowance.h b/src/libs/vtools/tools/vtoolseamallowance.h index c2e256f99..9de9c5d8b 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.h +++ b/src/libs/vtools/tools/vtoolseamallowance.h @@ -133,6 +133,8 @@ public slots: void Highlight(quint32 id); void UpdateDetailLabel(); void UpdatePatternInfo(); + void ShowOptions(); + void DeleteFromMenu(); protected slots: void UpdateGrainline(); void SaveMoveDetail(const QPointF &ptPos); @@ -161,11 +163,9 @@ protected: virtual void SaveDialogChange(const QString &undoText = QString()) final; private slots: - void ShowOptions(); void ToggleInLayout(bool checked); void ToggleForbidFlipping(bool checked); void ToggleForceFlipping(bool checked); - void DeleteFromMenu(); void ToggleExcludeState(quint32 id); void ToggleNodePointAngleType(quint32 id, PieceNodeAngle type); void ToggleNodePointPassmark(quint32 id, bool toggle); diff --git a/src/libs/vtools/undocommands/addgroup.cpp b/src/libs/vtools/undocommands/addgroup.cpp deleted file mode 100644 index c0eab5ff0..000000000 --- a/src/libs/vtools/undocommands/addgroup.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/************************************************************************ - ** - ** @file addgroup.cpp - ** @author Roman Telezhynskyi - ** @date 6 4, 2016 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentina project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2016 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#include "addgroup.h" - -#include -#include - -#include "../vmisc/vabstractapplication.h" -#include "../vmisc/def.h" -#include "../vwidgets/vmaingraphicsview.h" -#include "../ifc/xml/vabstractpattern.h" -#include "vundocommand.h" - -//--------------------------------------------------------------------------------------------------------------------- -AddGroup::AddGroup(const QDomElement &xml, VAbstractPattern *doc, QUndoCommand *parent) - : VUndoCommand(xml, doc, parent), nameActivDraw(doc->GetNameActivPP()) -{ - setText(tr("add group")); - nodeId = doc->GetParametrId(xml); -} - -//--------------------------------------------------------------------------------------------------------------------- -AddGroup::~AddGroup() -{ -} - -//--------------------------------------------------------------------------------------------------------------------- -void AddGroup::undo() -{ - qCDebug(vUndo, "Undo."); - - doc->ChangeActivPP(nameActivDraw);//Without this user will not see this change - - QDomElement groups = doc->CreateGroups(); - if (not groups.isNull()) - { - QDomElement group = doc->elementById(nodeId, VAbstractPattern::TagGroup); - if (group.isElement()) - { - group.setAttribute(VAbstractPattern::AttrVisible, trueStr); - doc->ParseGroups(groups); - if (groups.removeChild(group).isNull()) - { - qCDebug(vUndo, "Can't delete group."); - return; - } - emit UpdateGroups(); - } - else - { - if (groups.childNodes().isEmpty()) - { - QDomNode parent = groups.parentNode(); - parent.removeChild(groups); - } - - qCDebug(vUndo, "Can't get group by id = %u.", nodeId); - return; - } - } - else - { - qCDebug(vUndo, "Can't get tag Groups."); - return; - } - - VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); - if (qApp->GetDrawMode() == Draw::Calculation) - { - emit doc->SetCurrentPP(nameActivDraw);//Return current pattern piece after undo - } -} - -//--------------------------------------------------------------------------------------------------------------------- -void AddGroup::redo() -{ - qCDebug(vUndo, "Redo."); - - doc->ChangeActivPP(nameActivDraw);//Without this user will not see this change - - QDomElement groups = doc->CreateGroups(); - if (not groups.isNull()) - { - groups.appendChild(xml); - doc->ParseGroups(groups); - emit UpdateGroups(); - } - else - { - qCDebug(vUndo, "Can't get tag Groups."); - return; - } - - VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); -} diff --git a/src/libs/vtools/undocommands/addgroup.h b/src/libs/vtools/undocommands/addgroup.h deleted file mode 100644 index 0c8b21267..000000000 --- a/src/libs/vtools/undocommands/addgroup.h +++ /dev/null @@ -1,56 +0,0 @@ -/************************************************************************ - ** - ** @file addgroup.h - ** @author Roman Telezhynskyi - ** @date 6 4, 2016 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentina project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2016 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#ifndef ADDGROUP_H -#define ADDGROUP_H - -#include -#include -#include -#include -#include -#include - -#include "vundocommand.h" - -class AddGroup : public VUndoCommand -{ - Q_OBJECT -public: - AddGroup(const QDomElement &xml, VAbstractPattern *doc, QUndoCommand *parent = nullptr); - virtual ~AddGroup(); - virtual void undo() override; - virtual void redo() override; -signals: - void UpdateGroups(); -private: - Q_DISABLE_COPY(AddGroup) - const QString nameActivDraw; -}; - -#endif // ADDGROUP_H diff --git a/src/libs/vtools/undocommands/additemtogroup.cpp b/src/libs/vtools/undocommands/additemtogroup.cpp deleted file mode 100644 index 2c5af9d5e..000000000 --- a/src/libs/vtools/undocommands/additemtogroup.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/************************************************************************ - ** - ** @file addgroup.h - ** @author Ronan Le Tiec - ** @date 31 3, 2018 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentina project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2016 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#include "additemtogroup.h" - -#include -#include - -#include "../vmisc/vabstractapplication.h" -#include "../vmisc/def.h" -#include "../vwidgets/vmaingraphicsview.h" -#include "../ifc/xml/vabstractpattern.h" -#include "../vtools/tools/vdatatool.h" -#include "vundocommand.h" - -//--------------------------------------------------------------------------------------------------------------------- -AddItemToGroup::AddItemToGroup(const QDomElement &xml, VAbstractPattern *doc, quint32 groupId, QUndoCommand *parent) - : VUndoCommand(xml, doc, parent), nameActivDraw(doc->GetNameActivPP()) -{ - setText(tr("Add item to group")); - nodeId = groupId; -} - -//--------------------------------------------------------------------------------------------------------------------- -void AddItemToGroup::undo() -{ - qCDebug(vUndo, "Undo the add item to group"); - performUndoRedo(true); -} - -//--------------------------------------------------------------------------------------------------------------------- -void AddItemToGroup::redo() -{ - qCDebug(vUndo, "Redo the add item to group"); - performUndoRedo(false); -} - -//--------------------------------------------------------------------------------------------------------------------- -void AddItemToGroup::performUndoRedo(bool isUndo) -{ - doc->ChangeActivPP(nameActivDraw);//Without this user will not see this change - - QDomElement group = doc->elementById(nodeId, VAbstractPattern::TagGroup); - if (group.isElement()) - { - if(isUndo) - { - if (group.removeChild(xml).isNull()) - { - qCDebug(vUndo, "Can't delete item."); - return; - } - - // set the item visible. Because if the undo is done when unvisible and it's not in any group after the - // undo, it stays unvisible until the entire drawing is completly rerendered. - quint32 objectId = doc->GetParametrUInt(xml, QStringLiteral("object"), NULL_ID_STR); - quint32 toolId = doc->GetParametrUInt(xml, QStringLiteral("tool"), NULL_ID_STR); - VDataTool* tool = VAbstractPattern::getTool(toolId); - tool->GroupVisibility(objectId,true); - } - else // is redo - { - - if (group.appendChild(xml).isNull()) - { - qCDebug(vUndo, "Can't add item."); - return; - } - } - - doc->SetModified(true); - emit qApp->getCurrentDocument()->patternChanged(false); - - QDomElement groups = doc->CreateGroups(); - if (not groups.isNull()) - { - doc->ParseGroups(groups); - } else - { - qCDebug(vUndo, "Can't get tag Groups."); - return; - } - - emit UpdateGroups(); - } - else - { - qCDebug(vUndo, "Can't get group by id = %u.", nodeId); - return; - } - - VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); - if (qApp->GetDrawMode() == Draw::Calculation) - { - emit doc->SetCurrentPP(nameActivDraw);//Return current pattern piece after undo - } -} diff --git a/src/libs/vtools/undocommands/additemtogroup.h b/src/libs/vtools/undocommands/additemtogroup.h deleted file mode 100644 index 3f8d9c7b8..000000000 --- a/src/libs/vtools/undocommands/additemtogroup.h +++ /dev/null @@ -1,58 +0,0 @@ -/************************************************************************ - ** - ** @file addgroup.h - ** @author Ronan Le Tiec - ** @date 31 3, 2018 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentina project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2016 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#ifndef ADDITEMTOGROUP_H -#define ADDITEMTOGROUP_H - -#include -#include -#include -#include -#include -#include - -#include "vundocommand.h" - -class AddItemToGroup : public VUndoCommand -{ - Q_OBJECT -public: - AddItemToGroup(const QDomElement &xml, VAbstractPattern *doc, quint32 groupId, QUndoCommand *parent = nullptr); - virtual ~AddItemToGroup()=default; - virtual void undo() override; - virtual void redo() override; -signals: - void UpdateGroups(); -protected: - void performUndoRedo(bool isUndo); -private: - Q_DISABLE_COPY(AddItemToGroup) - const QString nameActivDraw; -}; - -#endif // ADDITEMTOGROUP_H diff --git a/src/libs/vtools/undocommands/changegroupvisibility.cpp b/src/libs/vtools/undocommands/changegroupvisibility.cpp deleted file mode 100644 index ef511f084..000000000 --- a/src/libs/vtools/undocommands/changegroupvisibility.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/************************************************************************ - ** - ** @file changegroupVisibility.cpp - ** @author Roman Telezhynskyi - ** @date 14 7, 2019 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentina project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2019 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ -#include "changegroupvisibility.h" -#include "../vmisc/vabstractapplication.h" -#include "../vwidgets/vmaingraphicsview.h" - -//--------------------------------------------------------------------------------------------------------------------- -ChangeGroupVisibility::ChangeGroupVisibility(VAbstractPattern *doc, vidtype id, bool visible, QUndoCommand *parent) - : VUndoCommand(QDomElement(), doc, parent), - m_newVisibility(visible), - m_nameActivDraw(doc->GetNameActivPP()) -{ - setText(tr("change group visibility")); - nodeId = id; - QDomElement group = doc->elementById(nodeId, VAbstractPattern::TagGroup); - if (group.isElement()) - { - m_oldVisibility = doc->GetParametrBool(group, VAbstractPattern::AttrVisible, trueStr); - } - else - { - qDebug("Can't get group by id = %u.", id); - } -} - -//--------------------------------------------------------------------------------------------------------------------- -ChangeGroupVisibility::~ChangeGroupVisibility() -{} - -//--------------------------------------------------------------------------------------------------------------------- -void ChangeGroupVisibility::undo() -{ - qCDebug(vUndo, "Undo."); - - Do(m_oldVisibility); -} - -//--------------------------------------------------------------------------------------------------------------------- -void ChangeGroupVisibility::redo() -{ - qCDebug(vUndo, "Redo."); - - Do(m_newVisibility); -} - -//--------------------------------------------------------------------------------------------------------------------- -void ChangeGroupVisibility::Do(bool visible) -{ - doc->ChangeActivPP(m_nameActivDraw);//Without this user will not see this change - - QDomElement group = doc->elementById(nodeId, VAbstractPattern::TagGroup); - if (group.isElement()) - { - doc->SetAttribute(group, VAbstractPattern::AttrVisible, visible); - - QDomElement groups = doc->CreateGroups(); - if (not groups.isNull()) - { - doc->ParseGroups(groups); - } - - emit UpdateGroup(nodeId, visible); - - VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); - } - else - { - qDebug("Can't get group by id = %u.", nodeId); - } -} diff --git a/src/libs/vtools/undocommands/changemultiplegroupsvisibility.cpp b/src/libs/vtools/undocommands/changemultiplegroupsvisibility.cpp deleted file mode 100644 index 47e16355c..000000000 --- a/src/libs/vtools/undocommands/changemultiplegroupsvisibility.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/************************************************************************ - ** - ** @file changemultiplegroupsVisibility.cpp - ** @author Roman Telezhynskyi - ** @date 15 7, 2019 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentina project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2019 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ -#include "changemultiplegroupsvisibility.h" -#include "../vmisc/vabstractapplication.h" -#include "../vwidgets/vmaingraphicsview.h" - -//--------------------------------------------------------------------------------------------------------------------- -ChangeMultipleGroupsVisibility::ChangeMultipleGroupsVisibility(VAbstractPattern *doc, const QVector &groups, - bool visible, QUndoCommand *parent) - : VUndoCommand(QDomElement(), doc, parent), - m_groups(groups), - m_newVisibility(visible), - m_nameActivDraw(doc->GetNameActivPP()) -{ - setText(tr("change multiple groups visibility")); - - for(auto & groupId : m_groups) - { - QDomElement group = doc->elementById(groupId, VAbstractPattern::TagGroup); - if (group.isElement()) - { - m_oldVisibility.insert(groupId, doc->GetParametrBool(group, VAbstractPattern::AttrVisible, trueStr)); - } - else - { - qDebug("Can't get group by id = %u.", groupId); - } - } - -} - -//--------------------------------------------------------------------------------------------------------------------- -void ChangeMultipleGroupsVisibility::undo() -{ - qCDebug(vUndo, "Undo."); - - doc->ChangeActivPP(m_nameActivDraw);//Without this user will not see this change - - QMap groupsState; - - QMap::const_iterator i = m_oldVisibility.constBegin(); - while (i != m_oldVisibility.constEnd()) - { - QDomElement group = doc->elementById(i.key(), VAbstractPattern::TagGroup); - if (group.isElement()) - { - doc->SetAttribute(group, VAbstractPattern::AttrVisible, i.value()); - groupsState.insert(i.key(), i.value()); - } - else - { - qDebug("Can't get group by id = %u.", i.key()); - } - ++i; - } - - if (not groupsState.isEmpty()) - { - QDomElement groups = doc->CreateGroups(); - if (not groups.isNull()) - { - doc->ParseGroups(groups); - } - - VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); - - emit UpdateMultipleGroups(groupsState); - } -} - -//--------------------------------------------------------------------------------------------------------------------- -void ChangeMultipleGroupsVisibility::redo() -{ - qCDebug(vUndo, "ChangeMultipleGroupsVisibility::redo"); - - doc->ChangeActivPP(m_nameActivDraw);//Without this user will not see this change - - QMap groupsState; - - for (auto& groupId : m_groups) - { - QDomElement group = doc->elementById(groupId, VAbstractPattern::TagGroup); - if (group.isElement()) - { - doc->SetAttribute(group, VAbstractPattern::AttrVisible, m_newVisibility); - groupsState.insert(groupId, m_newVisibility); - } - else - { - qDebug("Can't get group by id = %u.", groupId); - } - } - - if (not groupsState.isEmpty()) - { - QDomElement groups = doc->CreateGroups(); - if (not groups.isNull()) - { - doc->ParseGroups(groups); - } - - VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); - - emit UpdateMultipleGroups(groupsState); - } -} diff --git a/src/libs/vtools/undocommands/changemultiplegroupsvisibility.h b/src/libs/vtools/undocommands/changemultiplegroupsvisibility.h deleted file mode 100644 index 4a70c65c8..000000000 --- a/src/libs/vtools/undocommands/changemultiplegroupsvisibility.h +++ /dev/null @@ -1,55 +0,0 @@ -/************************************************************************ - ** - ** @file changemultiplegroupsVisibility.h - ** @author Roman Telezhynskyi - ** @date 15 7, 2019 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentina project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2019 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ -#ifndef CHANGEMULTIPLEGROUPSVISIBILITY_H -#define CHANGEMULTIPLEGROUPSVISIBILITY_H - -#include "vundocommand.h" - -class ChangeMultipleGroupsVisibility : public VUndoCommand -{ - Q_OBJECT -public: - ChangeMultipleGroupsVisibility(VAbstractPattern *doc, const QVector &groups, bool visible, - QUndoCommand *parent = nullptr); - virtual ~ChangeMultipleGroupsVisibility() =default; - virtual void undo() override; - virtual void redo() override; - -signals: - void UpdateMultipleGroups(const QMap &groups); - -private: - Q_DISABLE_COPY(ChangeMultipleGroupsVisibility) - - QVector m_groups; - bool m_newVisibility{true}; - QMap m_oldVisibility{}; - const QString m_nameActivDraw{}; -}; - -#endif // CHANGEMULTIPLEGROUPSVISIBILITY_H diff --git a/src/libs/vtools/undocommands/delgroup.cpp b/src/libs/vtools/undocommands/delgroup.cpp deleted file mode 100644 index 87e818c25..000000000 --- a/src/libs/vtools/undocommands/delgroup.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/************************************************************************ - ** - ** @file delgroup.cpp - ** @author Roman Telezhynskyi - ** @date 6 4, 2016 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentina project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2016 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#include "delgroup.h" - -#include -#include -#include - -#include "../vmisc/vabstractapplication.h" -#include "../vmisc/def.h" -#include "../vwidgets/vmaingraphicsview.h" -#include "../ifc/xml/vabstractpattern.h" -#include "vundocommand.h" - -//--------------------------------------------------------------------------------------------------------------------- -DelGroup::DelGroup(VAbstractPattern *doc, quint32 id, QUndoCommand *parent) - : VUndoCommand(QDomElement(), doc, parent), nameActivDraw(doc->GetNameActivPP()) -{ - setText(tr("delete group")); - nodeId = id; - xml = doc->CloneNodeById(nodeId); -} - -//--------------------------------------------------------------------------------------------------------------------- -DelGroup::~DelGroup() -{ -} - -//--------------------------------------------------------------------------------------------------------------------- -void DelGroup::undo() -{ - qCDebug(vUndo, "Undo."); - - if (qApp->GetDrawMode() == Draw::Calculation) - { - emit doc->SetCurrentPP(nameActivDraw);//Without this user will not see this change - } - - QDomElement groups = doc->CreateGroups(); - if (not groups.isNull()) - { - groups.appendChild(xml); - doc->ParseGroups(groups); - emit UpdateGroups(); - } - else - { - qCDebug(vUndo, "Can't get tag Groups."); - return; - } - - VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); -} - -//--------------------------------------------------------------------------------------------------------------------- -void DelGroup::redo() -{ - qCDebug(vUndo, "Redo."); - - if (qApp->GetDrawMode() == Draw::Calculation) - {//Keep first! - emit doc->SetCurrentPP(nameActivDraw);//Without this user will not see this change - } - QDomElement groups = doc->CreateGroups(); - if (not groups.isNull()) - { - QDomElement group = doc->elementById(nodeId, VAbstractPattern::TagGroup); - if (group.isElement()) - { - group.setAttribute(VAbstractPattern::AttrVisible, trueStr); - doc->ParseGroups(groups); - if (groups.removeChild(group).isNull()) - { - qCDebug(vUndo, "Can't delete group."); - return; - } - emit UpdateGroups(); - - if (groups.childNodes().isEmpty()) - { - QDomNode parent = groups.parentNode(); - parent.removeChild(groups); - } - } - else - { - qCDebug(vUndo, "Can't get group by id = %u.", nodeId); - return; - } - } - else - { - qCDebug(vUndo, "Can't get tag Groups."); - return; - } - - VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); -} diff --git a/src/libs/vtools/undocommands/delgroup.h b/src/libs/vtools/undocommands/delgroup.h deleted file mode 100644 index bdd5120f1..000000000 --- a/src/libs/vtools/undocommands/delgroup.h +++ /dev/null @@ -1,55 +0,0 @@ -/************************************************************************ - ** - ** @file delgroup.h - ** @author Roman Telezhynskyi - ** @date 6 4, 2016 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentina project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2016 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#ifndef DELGROUP_H -#define DELGROUP_H - -#include -#include -#include -#include -#include - -#include "vundocommand.h" - -class DelGroup : public VUndoCommand -{ - Q_OBJECT -public: - DelGroup(VAbstractPattern *doc, quint32 id, QUndoCommand *parent = nullptr); - virtual ~DelGroup(); - virtual void undo() override; - virtual void redo() override; -signals: - void UpdateGroups(); -private: - Q_DISABLE_COPY(DelGroup) - const QString nameActivDraw; -}; - -#endif // DELGROUP_H diff --git a/src/libs/vtools/undocommands/removeitemfromgroup.cpp b/src/libs/vtools/undocommands/removeitemfromgroup.cpp deleted file mode 100644 index 27b905ebe..000000000 --- a/src/libs/vtools/undocommands/removeitemfromgroup.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/************************************************************************ - ** - ** @file removeitemfromgroup.cpp - ** @author Ronan Le Tiec - ** @date 1 4, 2018 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentina project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2016 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#include "removeitemfromgroup.h" - -#include -#include - -#include "../vmisc/vabstractapplication.h" -#include "../vmisc/def.h" -#include "../vwidgets/vmaingraphicsview.h" -#include "../ifc/xml/vabstractpattern.h" -#include "../vtools/tools/vdatatool.h" -#include "vundocommand.h" - -//--------------------------------------------------------------------------------------------------------------------- - -RemoveItemFromGroup::RemoveItemFromGroup(const QDomElement &xml, VAbstractPattern *doc, quint32 groupId, QUndoCommand *parent) - : VUndoCommand(xml, doc, parent), nameActivDraw(doc->GetNameActivPP()) -{ - setText(tr("Remove item from group")); - nodeId = groupId; -} - -//--------------------------------------------------------------------------------------------------------------------- -void RemoveItemFromGroup::undo() -{ - qCDebug(vUndo, "Undo the remove item from group"); - performUndoRedo(true); -} - -//--------------------------------------------------------------------------------------------------------------------- -void RemoveItemFromGroup::redo() -{ - qCDebug(vUndo, "Redo the add item to group"); - performUndoRedo(false); -} - -//--------------------------------------------------------------------------------------------------------------------- -void RemoveItemFromGroup::performUndoRedo(bool isUndo) -{ - doc->ChangeActivPP(nameActivDraw);//Without this user will not see this change - - QDomElement group = doc->elementById(nodeId, VAbstractPattern::TagGroup); - if (group.isElement()) - { - if(isUndo) - { - if (group.appendChild(xml).isNull()) - { - qCDebug(vUndo, "Can't add the item."); - return; - } - } - else // is redo - { - if (group.removeChild(xml).isNull()) - { - qCDebug(vUndo, "Can't delete item."); - return; - } - - // set the item visible. Because if the undo is done when unvisibile and it's not in any group after the - // undo, it stays unvisible until the entire drawing is completly rerendered. - quint32 objectId = doc->GetParametrUInt(xml, QStringLiteral("object"), NULL_ID_STR); - quint32 toolId = doc->GetParametrUInt(xml, QStringLiteral("tool"), NULL_ID_STR); - VDataTool* tool = VAbstractPattern::getTool(toolId); - tool->GroupVisibility(objectId,true); - } - - doc->SetModified(true); - emit qApp->getCurrentDocument()->patternChanged(false); - - QDomElement groups = doc->CreateGroups(); - if (not groups.isNull()) - { - doc->ParseGroups(groups); - } else - { - qCDebug(vUndo, "Can't get tag Groups."); - return; - } - - emit UpdateGroups(); - } - else - { - qCDebug(vUndo, "Can't get group by id = %u.", nodeId); - return; - } - - VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); - - if (qApp->GetDrawMode() == Draw::Calculation) - { - emit doc->SetCurrentPP(nameActivDraw);//Return current pattern piece after undo - } -} diff --git a/src/libs/vtools/undocommands/removeitemfromgroup.h b/src/libs/vtools/undocommands/removeitemfromgroup.h deleted file mode 100644 index e19873476..000000000 --- a/src/libs/vtools/undocommands/removeitemfromgroup.h +++ /dev/null @@ -1,58 +0,0 @@ -/************************************************************************ - ** - ** @file removeitemfromgroup.h - ** @author Ronan Le Tiec - ** @date 31 3, 2018 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentina project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2016 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#ifndef REMOVEITEMFROMGROUP_H -#define REMOVEITEMFROMGROUP_H - -#include -#include -#include -#include -#include -#include - -#include "vundocommand.h" - -class RemoveItemFromGroup : public VUndoCommand -{ - Q_OBJECT -public: - RemoveItemFromGroup(const QDomElement &xml, VAbstractPattern *doc, quint32 groupId, QUndoCommand *parent = nullptr); - virtual ~RemoveItemFromGroup()=default; - virtual void undo() override; - virtual void redo() override; -signals: - void UpdateGroups(); -protected: - void performUndoRedo(bool isUndo); -private: - Q_DISABLE_COPY(RemoveItemFromGroup) - const QString nameActivDraw; -}; - -#endif // REMOVEITEMFROMGROUP_H diff --git a/src/libs/vtools/undocommands/undocommands.pri b/src/libs/vtools/undocommands/undocommands.pri index 310cb557c..37d8a34b6 100644 --- a/src/libs/vtools/undocommands/undocommands.pri +++ b/src/libs/vtools/undocommands/undocommands.pri @@ -4,20 +4,17 @@ HEADERS += \ $$PWD/addtocalc.h \ $$PWD/addpatternpiece.h \ - $$PWD/changegroupvisibility.h \ - $$PWD/changemultiplegroupsvisibility.h \ $$PWD/movespoint.h \ $$PWD/movespline.h \ $$PWD/movesplinepath.h \ $$PWD/savetooloptions.h \ $$PWD/deltool.h \ $$PWD/deletepatternpiece.h \ + $$PWD/undogroup.h \ $$PWD/vundocommand.h \ $$PWD/renamepp.h \ $$PWD/label/movelabel.h \ $$PWD/label/movedoublelabel.h \ - $$PWD/addgroup.h \ - $$PWD/delgroup.h \ $$PWD/label/moveabstractlabel.h \ $$PWD/label/operationmovelabel.h \ $$PWD/addpiece.h \ @@ -29,27 +26,22 @@ HEADERS += \ $$PWD/label/showdoublelabel.h \ $$PWD/label/operationshowlabel.h \ $$PWD/saveplacelabeloptions.h \ - $$PWD/togglepiecestate.h \ - $$PWD/additemtogroup.h \ - $$PWD/removeitemfromgroup.h + $$PWD/togglepiecestate.h SOURCES += \ $$PWD/addtocalc.cpp \ $$PWD/addpatternpiece.cpp \ - $$PWD/changegroupvisibility.cpp \ - $$PWD/changemultiplegroupsvisibility.cpp \ $$PWD/movespoint.cpp \ $$PWD/movespline.cpp \ $$PWD/movesplinepath.cpp \ $$PWD/savetooloptions.cpp \ $$PWD/deltool.cpp \ $$PWD/deletepatternpiece.cpp \ + $$PWD/undogroup.cpp \ $$PWD/vundocommand.cpp \ $$PWD/renamepp.cpp \ $$PWD/label/movelabel.cpp \ $$PWD/label/movedoublelabel.cpp \ - $$PWD/addgroup.cpp \ - $$PWD/delgroup.cpp \ $$PWD/label/moveabstractlabel.cpp \ $$PWD/label/operationmovelabel.cpp \ $$PWD/addpiece.cpp \ @@ -61,6 +53,4 @@ SOURCES += \ $$PWD/label/showdoublelabel.cpp \ $$PWD/label/operationshowlabel.cpp \ $$PWD/saveplacelabeloptions.cpp \ - $$PWD/togglepiecestate.cpp \ - $$PWD/additemtogroup.cpp \ - $$PWD/removeitemfromgroup.cpp + $$PWD/togglepiecestate.cpp diff --git a/src/libs/vtools/undocommands/undogroup.cpp b/src/libs/vtools/undocommands/undogroup.cpp new file mode 100644 index 000000000..8b9def919 --- /dev/null +++ b/src/libs/vtools/undocommands/undogroup.cpp @@ -0,0 +1,592 @@ +/************************************************************************ + ** + ** @file undogroup.cpp + ** @author Roman Telezhynskyi + ** @date 18 3, 2020 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentina project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2020 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "undogroup.h" + +#include +#include + +#include "../vmisc/vabstractapplication.h" +#include "../vmisc/def.h" +#include "../vwidgets/vmaingraphicsview.h" +#include "../ifc/xml/vabstractpattern.h" +#include "vundocommand.h" +#include "../vtools/tools/vdatatool.h" + +//AddGroup +//--------------------------------------------------------------------------------------------------------------------- +AddGroup::AddGroup(const QDomElement &xml, VAbstractPattern *doc, QUndoCommand *parent) + : VUndoCommand(xml, doc, parent), nameActivDraw(doc->GetNameActivPP()) +{ + setText(tr("add group")); + nodeId = doc->GetParametrId(xml); +} + +//--------------------------------------------------------------------------------------------------------------------- +void AddGroup::undo() +{ + qCDebug(vUndo, "Undo."); + + doc->ChangeActivPP(nameActivDraw);//Without this user will not see this change + + QDomElement groups = doc->CreateGroups(); + if (not groups.isNull()) + { + QDomElement group = doc->elementById(nodeId, VAbstractPattern::TagGroup); + if (group.isElement()) + { + group.setAttribute(VAbstractPattern::AttrVisible, trueStr); + doc->ParseGroups(groups); + if (groups.removeChild(group).isNull()) + { + qCDebug(vUndo, "Can't delete group."); + return; + } + emit UpdateGroups(); + } + else + { + if (groups.childNodes().isEmpty()) + { + QDomNode parent = groups.parentNode(); + parent.removeChild(groups); + } + + qCDebug(vUndo, "Can't get group by id = %u.", nodeId); + return; + } + } + else + { + qCDebug(vUndo, "Can't get tag Groups."); + return; + } + + VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); + if (qApp->GetDrawMode() == Draw::Calculation) + { + emit doc->SetCurrentPP(nameActivDraw);//Return current pattern piece after undo + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void AddGroup::redo() +{ + qCDebug(vUndo, "Redo."); + + doc->ChangeActivPP(nameActivDraw);//Without this user will not see this change + + QDomElement groups = doc->CreateGroups(); + if (not groups.isNull()) + { + groups.appendChild(xml); + doc->ParseGroups(groups); + emit UpdateGroups(); + } + else + { + qCDebug(vUndo, "Can't get tag Groups."); + return; + } + + VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); +} + +//RenameGroup +//--------------------------------------------------------------------------------------------------------------------- +RenameGroup::RenameGroup(VAbstractPattern *doc, quint32 id, const QString &name, QUndoCommand *parent) + : VUndoCommand(QDomElement(), doc, parent), + newName(name) +{ + setText(tr("rename group")); + nodeId = id; + oldName = doc->GetGroupName(nodeId); +} + +//--------------------------------------------------------------------------------------------------------------------- +void RenameGroup::undo() +{ + qCDebug(vUndo, "Undo."); + doc->SetGroupName(nodeId, oldName); + emit UpdateGroups(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void RenameGroup::redo() +{ + qCDebug(vUndo, "Redo."); + + doc->SetGroupName(nodeId, newName); + emit UpdateGroups(); +} + +//ChangeGroupOptions +//--------------------------------------------------------------------------------------------------------------------- +ChangeGroupOptions::ChangeGroupOptions(VAbstractPattern *doc, quint32 id, const QString &name, const QStringList &tags, + QUndoCommand *parent) + : VUndoCommand(QDomElement(), doc, parent), + newName(name), + newTags(tags) +{ + setText(tr("rename group")); + nodeId = id; + oldName = doc->GetGroupName(nodeId); + oldTags = doc->GetGroupTags(nodeId); +} + +//--------------------------------------------------------------------------------------------------------------------- +void ChangeGroupOptions::undo() +{ + qCDebug(vUndo, "Undo."); + doc->SetGroupName(nodeId, oldName); + doc->SetGroupTags(nodeId, oldTags); + emit UpdateGroups(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void ChangeGroupOptions::redo() +{ + qCDebug(vUndo, "Redo."); + doc->SetGroupName(nodeId, newName); + doc->SetGroupTags(nodeId, newTags); + emit UpdateGroups(); +} + +//AddItemToGroup +//--------------------------------------------------------------------------------------------------------------------- +AddItemToGroup::AddItemToGroup(const QDomElement &xml, VAbstractPattern *doc, quint32 groupId, QUndoCommand *parent) + : VUndoCommand(xml, doc, parent), nameActivDraw(doc->GetNameActivPP()) +{ + setText(tr("Add item to group")); + nodeId = groupId; +} + +//--------------------------------------------------------------------------------------------------------------------- +void AddItemToGroup::undo() +{ + qCDebug(vUndo, "Undo the add item to group"); + performUndoRedo(true); +} + +//--------------------------------------------------------------------------------------------------------------------- +void AddItemToGroup::redo() +{ + qCDebug(vUndo, "Redo the add item to group"); + performUndoRedo(false); +} + +//--------------------------------------------------------------------------------------------------------------------- +void AddItemToGroup::performUndoRedo(bool isUndo) +{ + doc->ChangeActivPP(nameActivDraw);//Without this user will not see this change + + QDomElement group = doc->elementById(nodeId, VAbstractPattern::TagGroup); + if (group.isElement()) + { + if(isUndo) + { + if (group.removeChild(xml).isNull()) + { + qCDebug(vUndo, "Can't delete item."); + return; + } + + // set the item visible. Because if the undo is done when unvisible and it's not in any group after the + // undo, it stays unvisible until the entire drawing is completly rerendered. + quint32 objectId = doc->GetParametrUInt(xml, QStringLiteral("object"), NULL_ID_STR); + quint32 toolId = doc->GetParametrUInt(xml, QStringLiteral("tool"), NULL_ID_STR); + VDataTool* tool = VAbstractPattern::getTool(toolId); + tool->GroupVisibility(objectId,true); + } + else // is redo + { + + if (group.appendChild(xml).isNull()) + { + qCDebug(vUndo, "Can't add item."); + return; + } + } + + doc->SetModified(true); + emit qApp->getCurrentDocument()->patternChanged(false); + + QDomElement groups = doc->CreateGroups(); + if (not groups.isNull()) + { + doc->ParseGroups(groups); + } else + { + qCDebug(vUndo, "Can't get tag Groups."); + return; + } + + emit UpdateGroups(); + } + else + { + qCDebug(vUndo, "Can't get group by id = %u.", nodeId); + return; + } + + VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); + if (qApp->GetDrawMode() == Draw::Calculation) + { + emit doc->SetCurrentPP(nameActivDraw);//Return current pattern piece after undo + } +} + +//RemoveItemFromGroup +//--------------------------------------------------------------------------------------------------------------------- +RemoveItemFromGroup::RemoveItemFromGroup(const QDomElement &xml, VAbstractPattern *doc, quint32 groupId, + QUndoCommand *parent) + : VUndoCommand(xml, doc, parent), nameActivDraw(doc->GetNameActivPP()) +{ + setText(tr("Remove item from group")); + nodeId = groupId; +} + +//--------------------------------------------------------------------------------------------------------------------- +void RemoveItemFromGroup::undo() +{ + qCDebug(vUndo, "Undo the remove item from group"); + performUndoRedo(true); +} + +//--------------------------------------------------------------------------------------------------------------------- +void RemoveItemFromGroup::redo() +{ + qCDebug(vUndo, "Redo the add item to group"); + performUndoRedo(false); +} + +//--------------------------------------------------------------------------------------------------------------------- +void RemoveItemFromGroup::performUndoRedo(bool isUndo) +{ + doc->ChangeActivPP(nameActivDraw);//Without this user will not see this change + + QDomElement group = doc->elementById(nodeId, VAbstractPattern::TagGroup); + if (group.isElement()) + { + if(isUndo) + { + if (group.appendChild(xml).isNull()) + { + qCDebug(vUndo, "Can't add the item."); + return; + } + } + else // is redo + { + if (group.removeChild(xml).isNull()) + { + qCDebug(vUndo, "Can't delete item."); + return; + } + + // set the item visible. Because if the undo is done when unvisibile and it's not in any group after the + // undo, it stays unvisible until the entire drawing is completly rerendered. + quint32 objectId = doc->GetParametrUInt(xml, QStringLiteral("object"), NULL_ID_STR); + quint32 toolId = doc->GetParametrUInt(xml, QStringLiteral("tool"), NULL_ID_STR); + VDataTool* tool = VAbstractPattern::getTool(toolId); + tool->GroupVisibility(objectId,true); + } + + doc->SetModified(true); + emit qApp->getCurrentDocument()->patternChanged(false); + + QDomElement groups = doc->CreateGroups(); + if (not groups.isNull()) + { + doc->ParseGroups(groups); + } else + { + qCDebug(vUndo, "Can't get tag Groups."); + return; + } + + emit UpdateGroups(); + } + else + { + qCDebug(vUndo, "Can't get group by id = %u.", nodeId); + return; + } + + VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); + + if (qApp->GetDrawMode() == Draw::Calculation) + { + emit doc->SetCurrentPP(nameActivDraw);//Return current pattern piece after undo + } +} + +//ChangeGroupVisibility +//--------------------------------------------------------------------------------------------------------------------- +ChangeGroupVisibility::ChangeGroupVisibility(VAbstractPattern *doc, vidtype id, bool visible, QUndoCommand *parent) + : VUndoCommand(QDomElement(), doc, parent), + m_newVisibility(visible), + m_nameActivDraw(doc->GetNameActivPP()) +{ + setText(tr("change group visibility")); + nodeId = id; + QDomElement group = doc->elementById(nodeId, VAbstractPattern::TagGroup); + if (group.isElement()) + { + m_oldVisibility = doc->GetParametrBool(group, VAbstractPattern::AttrVisible, trueStr); + } + else + { + qDebug("Can't get group by id = %u.", id); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void ChangeGroupVisibility::undo() +{ + qCDebug(vUndo, "Undo."); + + Do(m_oldVisibility); +} + +//--------------------------------------------------------------------------------------------------------------------- +void ChangeGroupVisibility::redo() +{ + qCDebug(vUndo, "Redo."); + + Do(m_newVisibility); +} + +//--------------------------------------------------------------------------------------------------------------------- +void ChangeGroupVisibility::Do(bool visible) +{ + doc->ChangeActivPP(m_nameActivDraw);//Without this user will not see this change + + QDomElement group = doc->elementById(nodeId, VAbstractPattern::TagGroup); + if (group.isElement()) + { + doc->SetAttribute(group, VAbstractPattern::AttrVisible, visible); + + QDomElement groups = doc->CreateGroups(); + if (not groups.isNull()) + { + doc->ParseGroups(groups); + } + + emit UpdateGroup(nodeId, visible); + + VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); + } + else + { + qDebug("Can't get group by id = %u.", nodeId); + } +} + +//ChangeMultipleGroupsVisibility +//--------------------------------------------------------------------------------------------------------------------- +ChangeMultipleGroupsVisibility::ChangeMultipleGroupsVisibility(VAbstractPattern *doc, const QVector &groups, + bool visible, QUndoCommand *parent) + : VUndoCommand(QDomElement(), doc, parent), + m_groups(groups), + m_newVisibility(visible), + m_nameActivDraw(doc->GetNameActivPP()) +{ + setText(tr("change multiple groups visibility")); + + for(auto & groupId : m_groups) + { + QDomElement group = doc->elementById(groupId, VAbstractPattern::TagGroup); + if (group.isElement()) + { + m_oldVisibility.insert(groupId, doc->GetParametrBool(group, VAbstractPattern::AttrVisible, trueStr)); + } + else + { + qDebug("Can't get group by id = %u.", groupId); + } + } + +} + +//--------------------------------------------------------------------------------------------------------------------- +void ChangeMultipleGroupsVisibility::undo() +{ + qCDebug(vUndo, "Undo."); + + doc->ChangeActivPP(m_nameActivDraw);//Without this user will not see this change + + QMap groupsState; + + QMap::const_iterator i = m_oldVisibility.constBegin(); + while (i != m_oldVisibility.constEnd()) + { + QDomElement group = doc->elementById(i.key(), VAbstractPattern::TagGroup); + if (group.isElement()) + { + doc->SetAttribute(group, VAbstractPattern::AttrVisible, i.value()); + groupsState.insert(i.key(), i.value()); + } + else + { + qDebug("Can't get group by id = %u.", i.key()); + } + ++i; + } + + if (not groupsState.isEmpty()) + { + QDomElement groups = doc->CreateGroups(); + if (not groups.isNull()) + { + doc->ParseGroups(groups); + } + + VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); + + emit UpdateMultipleGroups(groupsState); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void ChangeMultipleGroupsVisibility::redo() +{ + qCDebug(vUndo, "ChangeMultipleGroupsVisibility::redo"); + + doc->ChangeActivPP(m_nameActivDraw);//Without this user will not see this change + + QMap groupsState; + + for (auto& groupId : m_groups) + { + QDomElement group = doc->elementById(groupId, VAbstractPattern::TagGroup); + if (group.isElement()) + { + doc->SetAttribute(group, VAbstractPattern::AttrVisible, m_newVisibility); + groupsState.insert(groupId, m_newVisibility); + } + else + { + qDebug("Can't get group by id = %u.", groupId); + } + } + + if (not groupsState.isEmpty()) + { + QDomElement groups = doc->CreateGroups(); + if (not groups.isNull()) + { + doc->ParseGroups(groups); + } + + VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); + + emit UpdateMultipleGroups(groupsState); + } +} + +//DelGroup +//--------------------------------------------------------------------------------------------------------------------- +DelGroup::DelGroup(VAbstractPattern *doc, quint32 id, QUndoCommand *parent) + : VUndoCommand(QDomElement(), doc, parent), nameActivDraw(doc->GetNameActivPP()) +{ + setText(tr("delete group")); + nodeId = id; + xml = doc->CloneNodeById(nodeId); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DelGroup::undo() +{ + qCDebug(vUndo, "Undo."); + + if (qApp->GetDrawMode() == Draw::Calculation) + { + emit doc->SetCurrentPP(nameActivDraw);//Without this user will not see this change + } + + QDomElement groups = doc->CreateGroups(); + if (not groups.isNull()) + { + groups.appendChild(xml); + doc->ParseGroups(groups); + emit UpdateGroups(); + } + else + { + qCDebug(vUndo, "Can't get tag Groups."); + return; + } + + VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DelGroup::redo() +{ + qCDebug(vUndo, "Redo."); + + if (qApp->GetDrawMode() == Draw::Calculation) + {//Keep first! + emit doc->SetCurrentPP(nameActivDraw);//Without this user will not see this change + } + QDomElement groups = doc->CreateGroups(); + if (not groups.isNull()) + { + QDomElement group = doc->elementById(nodeId, VAbstractPattern::TagGroup); + if (group.isElement()) + { + group.setAttribute(VAbstractPattern::AttrVisible, trueStr); + doc->ParseGroups(groups); + if (groups.removeChild(group).isNull()) + { + qCDebug(vUndo, "Can't delete group."); + return; + } + emit UpdateGroups(); + + if (groups.childNodes().isEmpty()) + { + QDomNode parent = groups.parentNode(); + parent.removeChild(groups); + } + } + else + { + qCDebug(vUndo, "Can't get group by id = %u.", nodeId); + return; + } + } + else + { + qCDebug(vUndo, "Can't get tag Groups."); + return; + } + + VMainGraphicsView::NewSceneRect(qApp->getCurrentScene(), qApp->getSceneView()); +} diff --git a/src/libs/vtools/undocommands/undogroup.h b/src/libs/vtools/undocommands/undogroup.h new file mode 100644 index 000000000..e3185fc8c --- /dev/null +++ b/src/libs/vtools/undocommands/undogroup.h @@ -0,0 +1,184 @@ +/************************************************************************ + ** + ** @file undogroup.h + ** @author Roman Telezhynskyi + ** @date 18 3, 2020 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentina project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2020 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ +#ifndef UNDOGROUP_H +#define UNDOGROUP_H + + +#include +#include +#include +#include +#include +#include + +#include "vundocommand.h" + +class AddGroup : public VUndoCommand +{ + Q_OBJECT +public: + AddGroup(const QDomElement &xml, VAbstractPattern *doc, QUndoCommand *parent = nullptr); + virtual ~AddGroup()=default; + virtual void undo() override; + virtual void redo() override; +signals: + void UpdateGroups(); +private: + Q_DISABLE_COPY(AddGroup) + const QString nameActivDraw; +}; + +class RenameGroup : public VUndoCommand +{ + Q_OBJECT +public: + RenameGroup(VAbstractPattern *doc, quint32 id, const QString &name, QUndoCommand *parent = nullptr); + virtual ~RenameGroup()=default; + virtual void undo() override; + virtual void redo() override; +signals: + void UpdateGroups(); +private: + Q_DISABLE_COPY(RenameGroup) + QString newName; + QString oldName{}; +}; + +class ChangeGroupOptions : public VUndoCommand +{ + Q_OBJECT +public: + ChangeGroupOptions(VAbstractPattern *doc, quint32 id, const QString &name, const QStringList &tags, + QUndoCommand *parent = nullptr); + virtual ~ChangeGroupOptions()=default; + virtual void undo() override; + virtual void redo() override; +signals: + void UpdateGroups(); +private: + Q_DISABLE_COPY(ChangeGroupOptions) + QString newName; + QString oldName{}; + QStringList newTags; + QStringList oldTags{}; +}; + +class AddItemToGroup : public VUndoCommand +{ + Q_OBJECT +public: + AddItemToGroup(const QDomElement &xml, VAbstractPattern *doc, quint32 groupId, QUndoCommand *parent = nullptr); + virtual ~AddItemToGroup()=default; + virtual void undo() override; + virtual void redo() override; +signals: + void UpdateGroups(); +protected: + void performUndoRedo(bool isUndo); +private: + Q_DISABLE_COPY(AddItemToGroup) + const QString nameActivDraw; +}; + +class RemoveItemFromGroup : public VUndoCommand +{ + Q_OBJECT +public: + RemoveItemFromGroup(const QDomElement &xml, VAbstractPattern *doc, quint32 groupId, QUndoCommand *parent = nullptr); + virtual ~RemoveItemFromGroup()=default; + virtual void undo() override; + virtual void redo() override; +signals: + void UpdateGroups(); +protected: + void performUndoRedo(bool isUndo); +private: + Q_DISABLE_COPY(RemoveItemFromGroup) + const QString nameActivDraw; +}; + +class ChangeGroupVisibility : public VUndoCommand +{ + Q_OBJECT +public: + ChangeGroupVisibility(VAbstractPattern *doc, vidtype id, bool visible, QUndoCommand *parent = nullptr); + virtual ~ChangeGroupVisibility()=default; + virtual void undo() override; + virtual void redo() override; + +signals: + void UpdateGroup(vidtype id, bool visible); + +private: + Q_DISABLE_COPY(ChangeGroupVisibility) + + bool m_oldVisibility{true}; + bool m_newVisibility{true}; + const QString m_nameActivDraw{}; + + void Do(bool visible); +}; + +class ChangeMultipleGroupsVisibility : public VUndoCommand +{ + Q_OBJECT +public: + ChangeMultipleGroupsVisibility(VAbstractPattern *doc, const QVector &groups, bool visible, + QUndoCommand *parent = nullptr); + virtual ~ChangeMultipleGroupsVisibility() =default; + virtual void undo() override; + virtual void redo() override; + +signals: + void UpdateMultipleGroups(const QMap &groups); + +private: + Q_DISABLE_COPY(ChangeMultipleGroupsVisibility) + + QVector m_groups; + bool m_newVisibility{true}; + QMap m_oldVisibility{}; + const QString m_nameActivDraw{}; +}; + +class DelGroup : public VUndoCommand +{ + Q_OBJECT +public: + DelGroup(VAbstractPattern *doc, quint32 id, QUndoCommand *parent = nullptr); + virtual ~DelGroup()=default; + virtual void undo() override; + virtual void redo() override; +signals: + void UpdateGroups(); +private: + Q_DISABLE_COPY(DelGroup) + const QString nameActivDraw; +}; + +#endif // UNDOGROUP_H diff --git a/src/libs/vwidgets/vlineedit.cpp b/src/libs/vwidgets/vlineedit.cpp index d00e656f6..e919a5456 100644 --- a/src/libs/vwidgets/vlineedit.cpp +++ b/src/libs/vwidgets/vlineedit.cpp @@ -28,6 +28,66 @@ #include "vlineedit.h" +#include +#include +#include +#include +#include + +#include "../vmisc/compatibility.h" + +namespace +{ +class MultiSelectCompleter : public QCompleter +{ +public: + explicit MultiSelectCompleter(QObject* parent=nullptr); + virtual ~MultiSelectCompleter() =default; + + virtual QString pathFromIndex(const QModelIndex& index) const override; + virtual QStringList splitPath(const QString& path) const override; + +private: + Q_DISABLE_COPY(MultiSelectCompleter) +}; +} + +//MultiSelectCompleter +//--------------------------------------------------------------------------------------------------------------------- +MultiSelectCompleter::MultiSelectCompleter(QObject *parent) + : QCompleter(parent) +{} + +//--------------------------------------------------------------------------------------------------------------------- +QString MultiSelectCompleter::pathFromIndex(const QModelIndex& index) const +{ + QString path = QCompleter::pathFromIndex(index); + + QString text = static_cast(widget())->text(); + + int pos = text.lastIndexOf(','); + if (pos >= 0) + { + path = text.left(pos) + ", " + path; + } + + return path; +} + +//--------------------------------------------------------------------------------------------------------------------- +QStringList MultiSelectCompleter::splitPath( const QString& path ) const +{ + int pos = path.lastIndexOf(',') + 1; + + while (pos < path.length() && path.at(pos) == QLatin1Char(' ')) + { + pos++; + } + + return QStringList(path.mid(pos)); +} + +//VLineEdit //--------------------------------------------------------------------------------------------------------------------- VLineEdit::VLineEdit(QWidget *parent) : QLineEdit(parent), @@ -74,3 +134,59 @@ void VLineEdit::mousePressEvent(QMouseEvent *e) } } +// VCompleterLineEdit +//--------------------------------------------------------------------------------------------------------------------- +VCompleterLineEdit::VCompleterLineEdit(QWidget *parent) + : VLineEdit(parent), + m_model(new QStringListModel(this)) +{ + setCompleter(new MultiSelectCompleter()); + completer()->setModel(m_model); + completer()->setCompletionMode(QCompleter::PopupCompletion); + completer()->setCaseSensitivity(Qt::CaseInsensitive); + connect(this, &VCompleterLineEdit::textEdited, this, &VCompleterLineEdit::ShowCompletion); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VCompleterLineEdit::SetCompletion(const QStringList &list) +{ + m_model->setStringList(list); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VCompleterLineEdit::focusInEvent(QFocusEvent *e) +{ + QLineEdit::focusInEvent(e); + // force completion when line edit is focued in + completer()->complete(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VCompleterLineEdit::ShowCompletion() +{ +// PrepareCompletion(); + + // force to show all items when text is empty + completer()->setCompletionMode(text().isEmpty() ? QCompleter::UnfilteredPopupCompletion + : QCompleter::PopupCompletion); + if (text().isEmpty()) + { + // completion list will be hidden now; we will show it again after a delay + QTimer::singleShot(100, this, &VCompleterLineEdit::CompletionPopup); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VCompleterLineEdit::CompletionPopup() +{ + // apparently, complete() works only in event handler + QApplication::postEvent(this, new QEvent(QEvent::User)); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VCompleterLineEdit::customEvent(QEvent *e) +{ + QLineEdit::customEvent(e); + // force completion after text is deleted + completer()->complete(); +} diff --git a/src/libs/vwidgets/vlineedit.h b/src/libs/vwidgets/vlineedit.h index 096eef4e4..23a75a35c 100644 --- a/src/libs/vwidgets/vlineedit.h +++ b/src/libs/vwidgets/vlineedit.h @@ -31,6 +31,8 @@ #include +class QStringListModel; + class VLineEdit : public QLineEdit { Q_OBJECT @@ -47,4 +49,31 @@ private: bool m_selectOnMousePress; }; +/*! Line edit widget with auto completion based on QStringListModel. + Modified behaviour: completion list will appear even when contents of + line edit is empty. Full list of options will be showed when line edit + has focus and is empty. + */ +class VCompleterLineEdit : public VLineEdit +{ + Q_OBJECT +public: + explicit VCompleterLineEdit(QWidget *parent = nullptr); + + //! Set list of options used for completion. + void SetCompletion(const QStringList &list); + +protected: + virtual void focusInEvent(QFocusEvent *e) override; + virtual void customEvent(QEvent* e) override; + +private slots: + void ShowCompletion(); + void CompletionPopup(); + +private: + Q_DISABLE_COPY(VCompleterLineEdit) + QStringListModel *m_model; +}; + #endif // VLINEEDIT_H diff --git a/src/test/ValentinaTest/share/Issue_298_case1/output.json b/src/test/ValentinaTest/share/Issue_298_case1/output.json index 1a44b8e0a..f7c9f2516 100644 --- a/src/test/ValentinaTest/share/Issue_298_case1/output.json +++ b/src/test/ValentinaTest/share/Issue_298_case1/output.json @@ -117,13 +117,8 @@ }, { "type": "QPointF", - "x": 1033.62206579804, - "y": 991.8906443458876 - }, - { - "type": "QPointF", - "x": 940.8759712878797, - "y": 1031.2978406173477 + "x": 1034.5174749200823, + "y": 1122.8420636232784 }, { "type": "QPointF", diff --git a/src/test/ValentinaTest/share/Issue_548_case1/output.json b/src/test/ValentinaTest/share/Issue_548_case1/output.json index 042cd5f37..0efb7d010 100644 --- a/src/test/ValentinaTest/share/Issue_548_case1/output.json +++ b/src/test/ValentinaTest/share/Issue_548_case1/output.json @@ -27,13 +27,8 @@ }, { "type": "QPointF", - "x": 29.78045942584839, - "y": 314.5929172205191 - }, - { - "type": "QPointF", - "x": 17.016714467558195, - "y": 305.7450353602103 + "x": 11.986528767485936, + "y": 326.6317413168879 }, { "type": "QPointF", diff --git a/src/test/ValentinaTest/tst_vposter.cpp b/src/test/ValentinaTest/tst_vposter.cpp index 5613ad178..6f7ae25e6 100644 --- a/src/test/ValentinaTest/tst_vposter.cpp +++ b/src/test/ValentinaTest/tst_vposter.cpp @@ -55,7 +55,7 @@ void TST_VPoster::BigPoster() printer.setPageMargins(QMarginsF(left, top, right, bottom), QPageLayout::Millimeter); - const QRect image(0, 0, 2622, 3178); // Little bit bigger than A1 + const QSize image(2622, 3178); // Little bit bigger than A1 VPoster posterazor(&printer); const QVector poster = posterazor.Calc(image, 0, PageOrientation::Portrait); @@ -75,7 +75,7 @@ void TST_VPoster::SmallPoster() printer.setResolution(96);// By default printer.setPageSize(QPageSize(QPageSize::A4)); - const QRect image(0, 0, 700, 1000); // Little bit less than A4 + const QSize image(700, 1000); // Little bit less than A4 VPoster posterazor(&printer); const QVector poster = posterazor.Calc(image, 0, PageOrientation::Portrait);