Seamly2D
Code documentation
vcommonsettings.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * *
3  * Copyright (C) 2017 Seamly, LLC *
4  * *
5  * https://github.com/fashionfreedom/seamly2d *
6  * *
7  ***************************************************************************
8  **
9  ** Seamly2D is free software: you can redistribute it and/or modify
10  ** it under the terms of the GNU General Public License as published by
11  ** the Free Software Foundation, either version 3 of the License, or
12  ** (at your option) any later version.
13  **
14  ** Seamly2D is distributed in the hope that it will be useful,
15  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  ** GNU General Public License for more details.
18  **
19  ** You should have received a copy of the GNU General Public License
20  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
21  **
22  **************************************************************************
23 
24  ************************************************************************
25  **
26  ** @file vcommonsettings.cpp
27  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
28  ** @date 15 7, 2015
29  **
30  ** @brief
31  ** @copyright
32  ** This source code is part of the Valentine project, a pattern making
33  ** program, whose allow create and modeling patterns of clothing.
34  ** Copyright (C) 2015 Seamly2D project
35  ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
36  **
37  ** Seamly2D is free software: you can redistribute it and/or modify
38  ** it under the terms of the GNU General Public License as published by
39  ** the Free Software Foundation, either version 3 of the License, or
40  ** (at your option) any later version.
41  **
42  ** Seamly2D is distributed in the hope that it will be useful,
43  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
44  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45  ** GNU General Public License for more details.
46  **
47  ** You should have received a copy of the GNU General Public License
48  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
49  **
50  *************************************************************************/
51 
52 #include "vcommonsettings.h"
53 
54 #include <QApplication>
55 #include <QDate>
56 #include <QDir>
57 #include <QFont>
58 #include <QLocale>
59 #include <QMessageLogger>
60 #include <QSound>
61 #include <QStaticStringData>
62 #include <QStringData>
63 #include <QStringDataPtr>
64 #include <QVariant>
65 #include <QtDebug>
66 #include <QTextCodec>
67 
68 #include "../ifc/ifcdef.h"
69 #include "../vmisc/def.h"
70 #include "../vmisc/vmath.h"
71 #include "../vpatterndb/pmsystems.h"
72 
73 namespace
74 {
75 const QString settingPathsIndividualMeasurements = QStringLiteral("paths/individual_measurements");
76 const QString settingPathsMultisizeMeasurements = QStringLiteral("paths/standard_measurements");
77 const QString settingPathsTemplates = QStringLiteral("paths/templates");
78 const QString settingPathsLabelTemplate = QStringLiteral("paths/labels");
79 
80 const QString settingConfigurationOsSeparator = QStringLiteral("configuration/osSeparator");
81 const QString settingConfigurationAutosaveState = QStringLiteral("configuration/autosave/state");
82 const QString settingConfigurationAutosaveTime = QStringLiteral("configuration/autosave/time");
83 
84 const QString settingConfigurationUseModeType = QStringLiteral("configuration/autosave/useModeType");
85 const QString settingConfigurationUseLastExportFormat = QStringLiteral("configuration/autosave/useLastExportFormat");
86 const QString settingConfigurationExportFormat = QStringLiteral("configuration/autosave/exportFormat");
87 
88 const QString settingConfigurationSendReportState = QStringLiteral("configuration/send_report/state");
89 const QString settingConfigurationLocale = QStringLiteral("configuration/locale");
90 const QString settingPMSystemCode = QStringLiteral("configuration/pmscode");
91 const QString settingConfigurationUnit = QStringLiteral("configuration/unit");
92 const QString settingConfigurationConfirmItemDeletion = QStringLiteral("configuration/confirm_item_deletion");
93 const QString settingConfigurationConfirmFormatRewriting = QStringLiteral("configuration/confirm_format_rewriting");
94 const QString settingConfigurationMoveSuffix = QStringLiteral("configuration/moveSuffix");
95 const QString settingConfigurationRotateSuffix = QStringLiteral("configuration/rotateSuffix");
96 const QString settingConfigurationMirrorByAxisSuffix = QStringLiteral("configuration/mirrorByAxisSuffix");
97 const QString settingConfigurationMirrorByLineSuffix = QStringLiteral("configuration/mirrorByLineSuffix");
98 
99 const QString settingGraphicsViewToolBarStyle = QStringLiteral("graphicsview/tool_bar_style");
100 const QString settingGraphicsViewShowToolsToolBar = QStringLiteral("graphicsview/showToolsToolbar");
101 const QString settingGraphicsViewShowPointToolBar = QStringLiteral("graphicsview/showPointToolbar");
102 const QString settingGraphicsViewShowLineToolBar = QStringLiteral("graphicsview/showLineToolbar");
103 const QString settingGraphicsViewShowCurveToolBar = QStringLiteral("graphicsview/showCurveToolbar");
104 const QString settingGraphicsViewShowArcToolBar = QStringLiteral("graphicsview/showArcToolbar");
105 const QString settingGraphicsViewShowOpsToolBar = QStringLiteral("graphicsview/showOpsToolbar");
106 const QString settingGraphicsViewShowPieceToolBar = QStringLiteral("graphicsview/showPieceToolbar");
107 const QString settingGraphicsViewShowDetailsToolBar = QStringLiteral("graphicsview/showDetailsToolbar");
108 const QString settingGraphicsViewShowLayoutToolBar = QStringLiteral("graphicsview/showLayoutToolbar");
109 
110 const QString settingGraphicsViewShowScrollBars = QStringLiteral("graphicsview/showScrollBars");
111 const QString settingGraphicsViewScrollBarWidth = QStringLiteral("graphicsview/scrollBarWidth");
112 const QString settingGraphicsViewScrollDuration = QStringLiteral("graphicsview/scrollDuration");
113 const QString settingGraphicsViewScrollUpdateInterval = QStringLiteral("graphicsview/scrollUpdateInterval");
114 const QString settingGraphicsViewScrollSpeedFactor = QStringLiteral("graphicsview/scrollSpeedFactor");
115 const QString settingGraphicsViewPixelDelta = QStringLiteral("graphicsview/pixelDelta");
116 const QString settingGraphicsViewAngleDelta = QStringLiteral("graphicsview/angleDelta");
117 const QString settingGraphicsViewZoomModKey = QStringLiteral("graphicsview/zoomModKey");
118 const QString settingGraphicsViewZoomDoubleClick = QStringLiteral("graphicsview/zoomDoubleClick");
119 const QString settingGraphicsViewPanActiveSpaceKey = QStringLiteral("graphicsview/panActiveSpaceKey");
120 const QString settingGraphicsViewZoomSpeedFactor = QStringLiteral("graphicsview/zoomSpeedFactor");
121 const QString settingGraphicsViewExportQuality = QStringLiteral("graphicsview/exportQuality");
122 const QString settingGraphicsViewZoomRBPositiveColor = QStringLiteral("graphicsview/zoomRBPositiveColor");
123 const QString settingGraphicsViewZoomRBNegativeColor = QStringLiteral("graphicsview/zoomRBNegativeColor");
124 const QString settingGraphicsViewPointNameColor = QStringLiteral("graphicsview/pointNameColor");
125 const QString settingGraphicsViewPointNameHoverColor = QStringLiteral("graphicsview/pointNameHoverColor");
126 const QString settingGraphicsViewAxisOrginColor = QStringLiteral("graphicsview/axisOrginColor");
127 const QString settingGraphicsViewDefaultLineColor = QStringLiteral("graphicsview/defaultLineColor");
128 const QString settingGraphicsViewDefaultLineWeight = QStringLiteral("graphicsview/defaultLineWeight");
129 const QString settingGraphicsViewDefaultLineType = QStringLiteral("graphicsview/defaultLineType");
130 const QString settingGraphicsViewPrimaryColor = QStringLiteral("graphicsview/primarySupportColor");
131 const QString settingGraphicsViewSecondaryColor = QStringLiteral("graphicsview/secondarySupportColor");
132 const QString settingGraphicsViewTertiaryColor = QStringLiteral("graphicsview/tertiarySupportColor");
133 
134 const QString settingGraphicsViewConstrainValue = QStringLiteral("graphicsview/constrainValue");
135 const QString settingGraphicsViewConstrainModKey = QStringLiteral("graphicsview/constrainModKey");
136 
137 const QString settingGraphicsViewPointNameSize = QStringLiteral("graphicsview/pointNameSize");
138 const QString settingGraphicsViewGuiFontSize = QStringLiteral("graphicsview/guiFontSize");
139 const QString settingGraphicsViewHidePointNames = QStringLiteral("graphicsview/hidePointNames");
140 const QString settingGraphicsViewShowAxisOrigin = QStringLiteral("graphicsview/showAxisOrigin");
141 const QString settingGraphicsViewWireframe = QStringLiteral("graphicsview/wireframe");
142 const QString settingGraphicsViewShowControlPoints = QStringLiteral("graphicsview/showControlPoints");
143 const QString settingGraphicsViewShowAnchorPoints = QStringLiteral("graphicsview/showAnchorPoints");
144 const QString settingGraphicsUseToolColor = QStringLiteral("graphicsview/useToolColor");
145 
146 const QString settingPatternUndo = QStringLiteral("pattern/undo");
147 const QString settingSelectionSound = QStringLiteral("pattern/selectionSound");
148 const QString settingPatternForbidFlipping = QStringLiteral("pattern/forbidFlipping");
149 const QString settingPatternHideSeamLine = QStringLiteral("pattern/hideMainPath");
150 
151 const QString settingDefaultNotchLength = QStringLiteral("pattern/defaultNotchLength");
152 const QString settingDefaultNotchWidth = QStringLiteral("pattern/defaultNotchWidth");
153 const QString settingDefaultNotchType = QStringLiteral("pattern/defaultNotchType");
154 const QString settingDefaultNotchColor = QStringLiteral("pattern/defaultNotchColor");
155 const QString settingSeamlineNotch = QStringLiteral("pattern/doubleNotch");
156 const QString settingSeamAllowanceNotch = QStringLiteral("pattern/showSeamAllowanceNotch");
157 
158 const QString settingPatternDefaultSeamAllowance = QStringLiteral("pattern/defaultSeamAllowance");
159 const QString settingDefaultSeamColor = QStringLiteral("pattern/defaultSeamColor");
160 const QString settingDefaultSeamLinetype = QStringLiteral("pattern/defaultSeamLinetype");
161 const QString settingDefaultSeamLineweight = QStringLiteral("pattern/defaultSeamLineweight");
162 const QString settingDefaultCutColor = QStringLiteral("pattern/defaultCutColor");
163 const QString settingDefaultCutLinetype = QStringLiteral("pattern/defaultCutLinetype");
164 const QString settingDefaultCutLineweight = QStringLiteral("pattern/defaultCutLineweight");
165 const QString settingDefaultInternalColor = QStringLiteral("pattern/defaultInternalColor");
166 const QString settingDefaultInternalLinetype = QStringLiteral("pattern/defaultInternalLinetype");
167 const QString settingDefaultInternalLineweight = QStringLiteral("pattern/defaultInternalLineweight");
168 const QString settingDefaultCutoutColor = QStringLiteral("pattern/defaultCutoutColor");
169 const QString settingDefaultCutoutLinetype = QStringLiteral("pattern/defaultCutoutLinetype");
170 const QString settingDefaultCutoutLineweight = QStringLiteral("pattern/defaultCutoutLineweight");
171 
172 const QString settingShowSeamAllowances = QStringLiteral("pattern/showShowSeamAllowances");
173 const QString settingDefaultSeamAllowanceVisibilty = QStringLiteral("pattern/defaultSeamAllowanceVisibilty");
174 const QString settingShowGrainlines = QStringLiteral("pattern/showGrainlines");
175 const QString settingDefaultGrainlineVisibilty = QStringLiteral("pattern/defaultGrainlineVisibilty");
176 const QString settingDefaultGrainlineLength = QStringLiteral("pattern/defaultGrainlineLength");
177 const QString settingDefaultGrainlineColor = QStringLiteral("pattern/defaultGrainlineColor");
178 const QString settingDefaultGrainlineLineweight = QStringLiteral("pattern/defaultGrainlineLineweight");
179 
180 const QString settingShowLabels = QStringLiteral("pattern/showLabels");
181 const QString settingShowPatternLabels = QStringLiteral("pattern/showPatternLabels");
182 const QString settingShowPieceLabels = QStringLiteral("pattern/showPieceLabels");
183 const QString settingDefaultLabelWidth = QStringLiteral("pattern/defaultLabelWidth");
184 const QString settingDefaultLabelHeight = QStringLiteral("pattern/defaultLabelHeight");
185 const QString settingDefaultLabelColor = QStringLiteral("pattern/defaultLabelColor");
186 const QString settingDefaultPatternTemplate = QStringLiteral("pattern/defaultPatternTemplate");
187 const QString settingDefaultPieceTemplate = QStringLiteral("pattern/defaultPieceTemplate");
188 
189 const QString settingPatternLabelFont = QStringLiteral("pattern/labelFont");
190 const QString settingPatternGuiFont = QStringLiteral("pattern/guiFont");
191 const QString settingPatternPointNameFont = QStringLiteral("pattern/pointNameFont");
192 
193 const QString settingGeneralRecentFileList = QStringLiteral("recentFileList");
194 const QString settingGeneralRestoreFileList = QStringLiteral("restoreFileList");
195 const QString settingGeneralGeometry = QStringLiteral("geometry");
196 const QString settingGeneralWindowState = QStringLiteral("windowState");
197 const QString settingGeneralToolbarsState = QStringLiteral("toolbarsState");
198 const QString settingPreferenceDialogSize = QStringLiteral("preferenceDialogSize");
199 const QString settingToolSeamAllowanceDialogSize = QStringLiteral("toolSeamAllowanceDialogSize");
200 const QString settingIncrementsDialogSize = QStringLiteral("toolIncrementsDialogSize");
201 const QString settingFormulaWizardDialogSize = QStringLiteral("formulaWizardDialogSize");
202 const QString settingLatestSkippedVersion = QStringLiteral("lastestSkippedVersion");
203 const QString settingDateOfLastRemind = QStringLiteral("dateOfLastRemind");
204 
205 const QString settingCSVWithHeader = QStringLiteral("csv/withHeader");
206 const QString settingCSVCodec = QStringLiteral("csv/withCodec");
207 const QString settingCSVSeparator = QStringLiteral("csv/withSeparator");
208 
209 const QString settingLabelDateFormat = QStringLiteral("label/dateFormat");
210 const QString settingLabelUserDateFormats = QStringLiteral("label/userDateFormats");
211 const QString settingLabelTimeFormat = QStringLiteral("label/timeFormat");
212 const QString settingLabelUserTimeFormats = QStringLiteral("label/userTimeFormats");
213 
215 
216 //---------------------------------------------------------------------------------------------------------------------
217 QStringList ClearFormats(const QStringList &predefinedFormats, QStringList formats)
218 {
219  for (int i = 0; i < predefinedFormats.size(); ++i)
220  {
221  formats.removeAll(predefinedFormats.at(i));
222  }
223  return formats;
224 }
225 }
226 
227 static const QString commonIniFilename = QStringLiteral("common");
228 
229 #if !defined(Q_OS_WIN)
230 const QString VCommonSettings::unixStandardSharePath = QStringLiteral("/usr/share/seamly2d");
231 #endif
232 
233 namespace
234 {
235 //---------------------------------------------------------------------------------------------------------------------
236 void SymlinkCopyDirRecursive(const QString &fromDir, const QString &toDir, bool replaceOnConflit)
237 {
238  QDir dir;
239  dir.setPath(fromDir);
240 
241  foreach (QString copyFile, dir.entryList(QDir::Files))
242  {
243  const QString from = fromDir + QDir::separator() + copyFile;
244  QString to = toDir + QDir::separator() + copyFile;
245 
246 #ifdef Q_OS_WIN
247  {
248  // To fix issue #702 check each not symlink if it is actually broken symlink.
249  // Also trying to mimic Unix symlink. If a file eaxists do not create a symlink and remove it if exists.
250  QFile fileTo(to);
251  if (fileTo.exists())
252  {
253  if (not fileTo.rename(to + QLatin1String(".lnk")))
254  {
255  QFile::remove(to + QLatin1String(".lnk"));
256  fileTo.rename(to + QLatin1String(".lnk"));
257  }
258 
259  QFileInfo info(to + QLatin1String(".lnk"));
260  if (info.symLinkTarget().isEmpty())
261  {
262  fileTo.copy(to);
263  fileTo.remove();
264  continue; // The file already exists, skip creating shortcut
265  }
266  }
267  }
268 
269  to = to + QLatin1String(".lnk");
270 #endif
271 
272  if (QFile::exists(to))
273  {
274  if (replaceOnConflit)
275  {
276  QFile::remove(to);
277  }
278  else
279  {
280  continue;
281  }
282  }
283 
284  QFile::link(from, to);
285  }
286 
287  foreach (QString copyDir, dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot))
288  {
289  const QString from = fromDir + QDir::separator() + copyDir;
290  const QString to = toDir + QDir::separator() + copyDir;
291 
292  if (dir.mkpath(to) == false)
293  {
294  return;
295  }
296 
297  SymlinkCopyDirRecursive(from, to, replaceOnConflit);
298  }
299 }
300 
301 //---------------------------------------------------------------------------------------------------------------------
302 QString PrepareStandardFiles(const QString &currentPath, const QString &standardPath, const QString &defPath)
303 {
304  QDir standardPathDir(standardPath);
305  QDir currentPathDir(currentPath);
306  if ((currentPath == defPath || not currentPathDir.exists()) && standardPathDir.exists())
307  {
308  const QDir localdata (defPath);
309  if (localdata.mkpath("."))
310  {
311  SymlinkCopyDirRecursive(standardPath, defPath, false);
312  }
313  return defPath;
314  }
315  return currentPath;
316 }
317 }
318 
319 //---------------------------------------------------------------------------------------------------------------------
320 VCommonSettings::VCommonSettings(Format format, Scope scope, const QString &organization,
321  const QString &application, QObject *parent)
322  :QSettings(format, scope, organization, application, parent)
323 {}
324 
325 //---------------------------------------------------------------------------------------------------------------------
326 QString VCommonSettings::SharePath(const QString &shareItem)
327 {
328 #ifdef Q_OS_WIN
329  return QCoreApplication::applicationDirPath() + shareItem;
330 #elif defined(Q_OS_MAC)
331  QDir dirBundle(QCoreApplication::applicationDirPath() + QStringLiteral("/../Resources") + shareItem);
332  if (dirBundle.exists())
333  {
334  return dirBundle.absolutePath();
335  }
336  else
337  {
338  QDir appDir = QDir(qApp->applicationDirPath());
339  appDir.cdUp();
340  appDir.cdUp();
341  appDir.cdUp();
342  QDir dir(appDir.absolutePath() + shareItem);
343  if (dir.exists())
344  {
345  return dir.absolutePath();
346  }
347  else
348  {
349  return VCommonSettings::unixStandardSharePath + shareItem;
350  }
351  }
352 #else // Unix
353 #ifdef QT_DEBUG
354  return QCoreApplication::applicationDirPath() + shareItem;
355 #else
356  QDir dir(QCoreApplication::applicationDirPath() + shareItem);
357  if (dir.exists())
358  {
359  return dir.absolutePath();
360  }
361  else
362  {
363  return VCommonSettings::unixStandardSharePath + shareItem;
364  }
365 #endif
366 #endif
367 }
368 
369 //---------------------------------------------------------------------------------------------------------------------
371 {
372  return SharePath(QStringLiteral("/tables/multisize"));
373 }
374 
375 //---------------------------------------------------------------------------------------------------------------------
377 {
378  return SharePath(QStringLiteral("/tables/templates"));
379 }
380 
381 //---------------------------------------------------------------------------------------------------------------------
382 QString VCommonSettings::PrepareStandardTemplates(const QString & currentPath)
383 {
385 }
386 
387 //---------------------------------------------------------------------------------------------------------------------
388 QString VCommonSettings::PrepareMultisizeTables(const QString &currentPath)
389 {
391 }
392 
393 //---------------------------------------------------------------------------------------------------------------------
395 {
396  return QDir::homePath() + QLatin1String("/seamly2d/") + tr("measurements") + QLatin1String("/") + tr("individual");
397 }
398 
399 //---------------------------------------------------------------------------------------------------------------------
401 {
402  QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename);
403  return settings.value(settingPathsIndividualMeasurements, GetDefPathIndividualMeasurements()).toString();
404 }
405 
406 //---------------------------------------------------------------------------------------------------------------------
408 {
409  QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename);
410  settings.setValue(settingPathsIndividualMeasurements, value);
411  settings.sync();
412 }
413 
414 //---------------------------------------------------------------------------------------------------------------------
416 {
417  return QDir::homePath() + QLatin1String("/seamly2d/") + tr("measurements") + QLatin1String("/") + tr("multisize");
418 }
419 
420 //---------------------------------------------------------------------------------------------------------------------
422 {
423  QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename);
424  return settings.value(settingPathsMultisizeMeasurements, GetDefPathMultisizeMeasurements()).toString();
425 }
426 
427 //---------------------------------------------------------------------------------------------------------------------
429 {
430  QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename);
431  settings.setValue(settingPathsMultisizeMeasurements, value);
432  settings.sync();
433 }
434 
435 //---------------------------------------------------------------------------------------------------------------------
437 {
438  return QDir::homePath() + QLatin1String("/seamly2d/") + tr("templates");
439 }
440 
441 //---------------------------------------------------------------------------------------------------------------------
443 {
444  QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename);
445  return settings.value(settingPathsTemplates, GetDefPathTemplate()).toString();
446 }
447 
448 //---------------------------------------------------------------------------------------------------------------------
449 void VCommonSettings::SetPathTemplate(const QString &value)
450 {
451  QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename);
452  settings.setValue(settingPathsTemplates, value);
453  settings.sync();
454 }
455 
456 //---------------------------------------------------------------------------------------------------------------------
458 {
459  return QDir::homePath() + QLatin1String("/seamly2d/") + tr("label templates");
460 }
461 
462 //---------------------------------------------------------------------------------------------------------------------
464 {
465  return value(settingPathsLabelTemplate, GetDefPathLabelTemplate()).toString();
466 }
467 
468 //---------------------------------------------------------------------------------------------------------------------
469 void VCommonSettings::SetPathLabelTemplate(const QString &text)
470 {
471  setValue(settingPathsLabelTemplate, text);
472 }
473 
474 //---------------------------------------------------------------------------------------------------------------------
476 {
477  return value(settingDefaultPatternTemplate, GetPathLabelTemplate() + "default_pattern_label.xml").toString();
478 }
479 
480 //---------------------------------------------------------------------------------------------------------------------
482 {
483  setValue(settingDefaultPatternTemplate, text);
484 }
485 
486 //---------------------------------------------------------------------------------------------------------------------
488 {
489  return value(settingDefaultPieceTemplate, GetPathLabelTemplate() + "default_piece_label.xml").toString();
490 }
491 
492 //---------------------------------------------------------------------------------------------------------------------
494 {
495  setValue(settingDefaultPieceTemplate, value);
496 }
497 
498 //---------------------------------------------------------------------------------------------------------------------
500 {
501  return value(settingConfigurationOsSeparator, 1).toBool();
502 }
503 
504 //---------------------------------------------------------------------------------------------------------------------
505 void VCommonSettings::SetOsSeparator(const bool &value)
506 {
507  setValue(settingConfigurationOsSeparator, value);
508 }
509 
510 //---------------------------------------------------------------------------------------------------------------------
512 {
513  return value(settingConfigurationAutosaveState, 1).toBool();
514 }
515 
516 //---------------------------------------------------------------------------------------------------------------------
517 void VCommonSettings::SetAutosaveState(const bool &value)
518 {
519  setValue(settingConfigurationAutosaveState, value);
520 }
521 
522 //---------------------------------------------------------------------------------------------------------------------
524 {
525  bool ok = false;
526  int val = value(settingConfigurationAutosaveTime, 1).toInt(&ok);
527  if (ok == false)
528  {
529  qDebug()<<"Could not convert value"<<value(settingConfigurationAutosaveTime, 1)
530  <<"to int. Return default value for autosave time"<<1<<"minutes.";
531  val = 1;
532  }
533  return val;
534 }
535 
536 //---------------------------------------------------------------------------------------------------------------------
538 {
539  setValue(settingConfigurationAutosaveTime, value);
540 }
541 
542 //---------------------------------------------------------------------------------------------------------------------
544 {
545  return value(settingConfigurationUseModeType, true).toBool();
546 }
547 
548 //---------------------------------------------------------------------------------------------------------------------
549 void VCommonSettings::setUseModeType(const bool &value)
550 {
551  setValue(settingConfigurationUseModeType, value);
552 }
553 
554 //---------------------------------------------------------------------------------------------------------------------
556 {
557  return value(settingConfigurationUseLastExportFormat, true).toBool();
558 }
559 
560 //---------------------------------------------------------------------------------------------------------------------
562 {
564 }
565 
566 //---------------------------------------------------------------------------------------------------------------------
568 {
569  return value(settingConfigurationExportFormat, "SVG").toString();
570 }
571 
572 //---------------------------------------------------------------------------------------------------------------------
573 void VCommonSettings::setExportFormat(const QString &value)
574 {
575  setValue(settingConfigurationExportFormat, value);
576 }
577 
578 //---------------------------------------------------------------------------------------------------------------------
580 {
581  return value(settingConfigurationSendReportState, 1).toBool();
582 }
583 
584 //---------------------------------------------------------------------------------------------------------------------
585 void VCommonSettings::SetSendReportState(const bool &value)
586 {
587  setValue(settingConfigurationSendReportState, value);
588 }
589 
590 //---------------------------------------------------------------------------------------------------------------------
592 {
593  return value(settingConfigurationLocale, QLocale().name()).toString();
594 }
595 
596 //---------------------------------------------------------------------------------------------------------------------
597 void VCommonSettings::SetLocale(const QString &value)
598 {
599  setValue(settingConfigurationLocale, value);
600 }
601 
602 //---------------------------------------------------------------------------------------------------------------------
604 {
605  return value(settingPMSystemCode, "p998").toString();
606 }
607 
608 //---------------------------------------------------------------------------------------------------------------------
609 void VCommonSettings::SetPMSystemCode(const QString &value)
610 {
611  setValue(settingPMSystemCode, value);
612 }
613 
614 //---------------------------------------------------------------------------------------------------------------------
616 {
617  return value(settingConfigurationUnit,
618  QLocale().measurementSystem() == QLocale::MetricSystem ? unitCM : unitINCH).toString();
619 }
620 
621 //---------------------------------------------------------------------------------------------------------------------
622 void VCommonSettings::SetUnit(const QString &value)
623 {
624  setValue(settingConfigurationUnit, value);
625 }
626 
627 //---------------------------------------------------------------------------------------------------------------------
629 {
630  return value(settingConfigurationConfirmItemDeletion, 1).toBool();
631 }
632 
633 //---------------------------------------------------------------------------------------------------------------------
635 {
637 }
638 
639 //---------------------------------------------------------------------------------------------------------------------
641 {
642  return value(settingConfigurationConfirmFormatRewriting, 1).toBool();
643 }
644 
645 //---------------------------------------------------------------------------------------------------------------------
647 {
649 }
650 
651 
652 //---------------------------------------------------------------------------------------------------------------------
654 {
655  return value(settingConfigurationMoveSuffix, "").toString();
656 }
657 
658 //---------------------------------------------------------------------------------------------------------------------
659 void VCommonSettings::setMoveSuffix(const QString &value)
660 {
661  setValue(settingConfigurationMoveSuffix, value);
662 }
663 
664 //---------------------------------------------------------------------------------------------------------------------
666 {
667  return value(settingConfigurationRotateSuffix, "").toString();
668 }
669 
670 //---------------------------------------------------------------------------------------------------------------------
671 void VCommonSettings::setRotateSuffix(const QString &value)
672 {
673  setValue(settingConfigurationRotateSuffix, value);
674 }
675 
676 //---------------------------------------------------------------------------------------------------------------------
678 {
679  return value(settingConfigurationMirrorByAxisSuffix, "").toString();
680 }
681 
682 //---------------------------------------------------------------------------------------------------------------------
683 void VCommonSettings::setMirrorByAxisSuffix(const QString &value)
684 {
686 }
687 
688 //---------------------------------------------------------------------------------------------------------------------
690 {
691  return value(settingConfigurationMirrorByLineSuffix, "").toString();
692 }
693 
694 //---------------------------------------------------------------------------------------------------------------------
695 void VCommonSettings::setMirrorByLineSuffix(const QString &value)
696 {
698 }
699 
700 //---------------------------------------------------------------------------------------------------------------------
702 {
703  return value(settingGraphicsViewToolBarStyle, true).toBool();
704 }
705 
706 //---------------------------------------------------------------------------------------------------------------------
707 void VCommonSettings::setToolBarStyle(const bool &value)
708 {
709  setValue(settingGraphicsViewToolBarStyle, value);
710 }
711 
712 //---------------------------------------------------------------------------------------------------------------------
714 {
715  return value(settingGraphicsViewShowToolsToolBar, false).toBool();
716 }
717 
718 //---------------------------------------------------------------------------------------------------------------------
720 {
721  setValue(settingGraphicsViewShowToolsToolBar, value);
722 }
723 
724 //---------------------------------------------------------------------------------------------------------------------
726 {
727  return value(settingGraphicsViewShowPointToolBar, false).toBool();
728 }
729 
730 //---------------------------------------------------------------------------------------------------------------------
732 {
733  setValue(settingGraphicsViewShowPointToolBar, value);
734 }
735 
736 //---------------------------------------------------------------------------------------------------------------------
738 {
739  return value(settingGraphicsViewShowLineToolBar, false).toBool();
740 }
741 
742 //---------------------------------------------------------------------------------------------------------------------
743 void VCommonSettings::setShowLineToolBar(const bool &value)
744 {
745  setValue(settingGraphicsViewShowLineToolBar, value);
746 }
747 
748 //---------------------------------------------------------------------------------------------------------------------
750 {
751  return value(settingGraphicsViewShowCurveToolBar, false).toBool();
752 }
753 
754 //---------------------------------------------------------------------------------------------------------------------
756 {
757  setValue(settingGraphicsViewShowCurveToolBar, value);
758 }
759 
760 //---------------------------------------------------------------------------------------------------------------------
762 {
763  return value(settingGraphicsViewShowArcToolBar, false).toBool();
764 }
765 
766 //---------------------------------------------------------------------------------------------------------------------
767 void VCommonSettings::setShowArcToolBar(const bool &value)
768 {
769  setValue(settingGraphicsViewShowArcToolBar, value);
770 }
771 
772 //---------------------------------------------------------------------------------------------------------------------
774 {
775  return value(settingGraphicsViewShowOpsToolBar, false).toBool();
776 }
777 
778 //---------------------------------------------------------------------------------------------------------------------
779 void VCommonSettings::setShowOpsToolBar(const bool &value)
780 {
781  setValue(settingGraphicsViewShowOpsToolBar, value);
782 }
783 
784 //---------------------------------------------------------------------------------------------------------------------
786 {
787  return value(settingGraphicsViewShowPieceToolBar, false).toBool();
788 }
789 
790 //---------------------------------------------------------------------------------------------------------------------
792 {
793  setValue(settingGraphicsViewShowPieceToolBar, value);
794 }
795 
796 //---------------------------------------------------------------------------------------------------------------------
798 {
799  return value(settingGraphicsViewShowDetailsToolBar, false).toBool();
800 }
801 
802 //---------------------------------------------------------------------------------------------------------------------
804 {
805  setValue(settingGraphicsViewShowDetailsToolBar, value);
806 }
807 
808 //---------------------------------------------------------------------------------------------------------------------
810 {
811  return value(settingGraphicsViewShowLayoutToolBar, false).toBool();
812 }
813 
814 //---------------------------------------------------------------------------------------------------------------------
816 {
817  setValue(settingGraphicsViewShowLayoutToolBar, value);
818 }
819 
820 //---------------------------------------------------------------------------------------------------------------------
822 {
823  return value(settingGraphicsViewShowScrollBars, 1).toBool();
824 }
825 
826 //---------------------------------------------------------------------------------------------------------------------
827 void VCommonSettings::setShowScrollBars(const bool &value)
828 {
829  setValue(settingGraphicsViewShowScrollBars, value);
830 }
831 
832 //---------------------------------------------------------------------------------------------------------------------
834 {
835  return value(settingGraphicsViewScrollBarWidth, 10).toInt();
836 }
837 
838 //---------------------------------------------------------------------------------------------------------------------
840 {
841  setValue(settingGraphicsViewScrollBarWidth, width);
842 }
843 
844 //---------------------------------------------------------------------------------------------------------------------
846 {
847  return value(settingGraphicsViewScrollDuration, 300).toInt();
848 }
849 
850 //---------------------------------------------------------------------------------------------------------------------
851 void VCommonSettings::setScrollDuration(const int &duration)
852 {
853  setValue(settingGraphicsViewScrollDuration, duration);
854 }
855 
856 //---------------------------------------------------------------------------------------------------------------------
858 {
859  return value(settingGraphicsViewScrollUpdateInterval, 30).toInt();
860 }
861 
862 //---------------------------------------------------------------------------------------------------------------------
864 {
865  setValue(settingGraphicsViewScrollUpdateInterval, interval);
866 }
867 
868 //---------------------------------------------------------------------------------------------------------------------
870 {
871  return value(settingGraphicsViewScrollSpeedFactor, 10).toInt();
872 }
873 
874 //---------------------------------------------------------------------------------------------------------------------
876 {
877  setValue(settingGraphicsViewScrollSpeedFactor, factor);
878 }
879 
880 
881 //---------------------------------------------------------------------------------------------------------------------
883 {
884  return value(settingGraphicsViewZoomModKey, true).toBool();
885 }
886 
887 //---------------------------------------------------------------------------------------------------------------------
888 void VCommonSettings::setZoomModKey(const bool &value)
889 {
890  setValue(settingGraphicsViewZoomModKey, value);
891 }
892 
893 //---------------------------------------------------------------------------------------------------------------------
895 {
896  return value(settingGraphicsViewZoomDoubleClick, true).toBool();
897 }
898 
899 //---------------------------------------------------------------------------------------------------------------------
900 void VCommonSettings::setZoomDoubleClick(const bool &value)
901 {
902  setValue(settingGraphicsViewZoomDoubleClick, value);
903 }
904 
905 //---------------------------------------------------------------------------------------------------------------------
907 {
908  return value(settingGraphicsViewPanActiveSpaceKey, false).toBool();
909 }
910 
911 //---------------------------------------------------------------------------------------------------------------------
913 {
914  setValue(settingGraphicsViewPanActiveSpaceKey, value);
915 }
916 
917 //---------------------------------------------------------------------------------------------------------------------
919 {
920  return value(settingGraphicsViewZoomSpeedFactor, 16).toInt();
921 }
922 
923 //---------------------------------------------------------------------------------------------------------------------
925 {
926  setValue(settingGraphicsViewZoomSpeedFactor, value);
927 }
928 
929 //---------------------------------------------------------------------------------------------------------------------
931 {
932  return value(settingGraphicsViewExportQuality, 75).toInt();
933 }
934 
935 //---------------------------------------------------------------------------------------------------------------------
936 void VCommonSettings::setExportQuality(const int &value)
937 {
938  setValue(settingGraphicsViewExportQuality, value);
939 }
940 
941 //---------------------------------------------------------------------------------------------------------------------
943 {
944  return value(settingGraphicsViewZoomRBPositiveColor, "Blue").toString();
945 }
946 
947 //---------------------------------------------------------------------------------------------------------------------
948 void VCommonSettings::setZoomRBPositiveColor(const QString &value)
949 {
951 }
952 
953 //---------------------------------------------------------------------------------------------------------------------
955 {
956  return value(settingGraphicsViewZoomRBNegativeColor, "Green").toString();
957 }
958 
959 //---------------------------------------------------------------------------------------------------------------------
960 void VCommonSettings::setZoomRBNegativeColor(const QString &value)
961 {
963 }
964 
965 //---------------------------------------------------------------------------------------------------------------------
967 {
968  return value(settingGraphicsViewPointNameColor, "Black").toString();
969 }
970 
971 //---------------------------------------------------------------------------------------------------------------------
972 void VCommonSettings::setPointNameColor(const QString &value)
973 {
974  setValue(settingGraphicsViewPointNameColor, value);
975 }
976 
977 //---------------------------------------------------------------------------------------------------------------------
979 {
980  return value(settingGraphicsViewPointNameHoverColor, "Magenta").toString();
981 }
982 
983 //---------------------------------------------------------------------------------------------------------------------
984 void VCommonSettings::setPointNameHoverColor(const QString &value)
985 {
987 }
988 
989 //---------------------------------------------------------------------------------------------------------------------
991 {
992  return value(settingGraphicsViewAxisOrginColor, "Magenta").toString();
993 }
994 
995 //---------------------------------------------------------------------------------------------------------------------
996 void VCommonSettings::setAxisOrginColor(const QString &value)
997 {
998  setValue(settingGraphicsViewAxisOrginColor, value);
999 }
1000 
1001 //---------------------------------------------------------------------------------------------------------------------
1003 {
1004  return value(settingGraphicsViewDefaultLineColor, "black").toString();
1005 }
1006 
1007 //---------------------------------------------------------------------------------------------------------------------
1008 void VCommonSettings::setDefaultLineColor(const QString &value)
1009 {
1010  setValue(settingGraphicsViewDefaultLineColor, value);
1011 }
1012 
1013 //---------------------------------------------------------------------------------------------------------------------
1015 {
1016  return value(settingGraphicsViewDefaultLineWeight, 1.20).toReal();
1017 }
1018 
1019 //---------------------------------------------------------------------------------------------------------------------
1021 {
1022  setValue(settingGraphicsViewDefaultLineWeight, value);
1023 }
1024 
1025 //---------------------------------------------------------------------------------------------------------------------
1027 {
1028  return value(settingGraphicsViewDefaultLineType, "solidLine").toString();
1029 }
1030 
1031 //---------------------------------------------------------------------------------------------------------------------
1032 void VCommonSettings::setDefaultLineType(const QString &value)
1033 {
1034  setValue(settingGraphicsViewDefaultLineType, value);
1035 }
1036 
1037 //---------------------------------------------------------------------------------------------------------------------
1039 {
1040  return value(settingGraphicsViewPrimaryColor, "Magenta").toString();
1041 }
1042 
1043 //---------------------------------------------------------------------------------------------------------------------
1045 {
1046  setValue(settingGraphicsViewPrimaryColor, value);
1047 }
1048 
1049 //---------------------------------------------------------------------------------------------------------------------
1051 {
1052  return value(settingGraphicsViewSecondaryColor, "Forest Green").toString();
1053 }
1054 
1055 //---------------------------------------------------------------------------------------------------------------------
1057 {
1058  setValue(settingGraphicsViewSecondaryColor, value);
1059 }
1060 
1061 //---------------------------------------------------------------------------------------------------------------------
1063 {
1064  return value(settingGraphicsViewTertiaryColor, "Navy").toString();
1065 }
1066 
1067 //---------------------------------------------------------------------------------------------------------------------
1069 {
1070  setValue(settingGraphicsViewTertiaryColor, value);
1071 }
1072 
1073 //---------------------------------------------------------------------------------------------------------------------
1075 {
1076  return value(settingGraphicsViewConstrainValue, 10.00).toReal();
1077 }
1078 
1079 //---------------------------------------------------------------------------------------------------------------------
1080 void VCommonSettings::setConstrainValue(const qreal &value)
1081 {
1082  setValue(settingGraphicsViewConstrainValue, value);
1083 }
1084 
1085 //---------------------------------------------------------------------------------------------------------------------
1087 {
1088  return value(settingGraphicsViewConstrainModKey, 1).toBool();
1089 }
1090 
1091 //---------------------------------------------------------------------------------------------------------------------
1093 {
1094  setValue(settingGraphicsViewConstrainModKey, value);
1095 }
1096 
1097 //---------------------------------------------------------------------------------------------------------------------
1099 {
1100  bool ok = false;
1101  int val = value(settingPatternUndo, 0).toInt(&ok);
1102  if (ok == false)
1103  {
1104  qDebug()<<"Could not convert value"<<value(settingPatternUndo, 0)
1105  <<"to int. Return default value for undo counts 0 (no limit).";
1106  val = 0;
1107  }
1108  return val;
1109 }
1110 
1111 //---------------------------------------------------------------------------------------------------------------------
1112 void VCommonSettings::SetUndoCount(const int &value)
1113 {
1114  setValue(settingPatternUndo, value);
1115 }
1116 
1117 //---------------------------------------------------------------------------------------------------------------------
1119 {
1120  return value(settingSelectionSound, "silent").toString();
1121 }
1122 
1123 //---------------------------------------------------------------------------------------------------------------------
1125 {
1126  return QStringLiteral("qrc:/sounds/") + value(settingSelectionSound, "silent").toString() + QStringLiteral(".wav");
1127 }
1128 
1129 //---------------------------------------------------------------------------------------------------------------------
1130 void VCommonSettings::setSelectionSound(const QString &value)
1131 {
1132  setValue(settingSelectionSound, value);
1133 }
1134 
1135 //---------------------------------------------------------------------------------------------------------------------
1137 {
1138  const QStringList files = value(settingGeneralRecentFileList).toStringList();
1139  QStringList cleared;
1140 
1141  for (int i = 0; i < files.size(); ++i)
1142  {
1143  if (QFileInfo(files.at(i)).exists())
1144  {
1145  cleared.append(files.at(i));
1146  }
1147  }
1148 
1149  return cleared;
1150 }
1151 
1152 //---------------------------------------------------------------------------------------------------------------------
1153 void VCommonSettings::SetRecentFileList(const QStringList &value)
1154 {
1155  setValue(settingGeneralRecentFileList, value);
1156 }
1157 
1158 //---------------------------------------------------------------------------------------------------------------------
1160 {
1161  return value(settingGeneralRestoreFileList).toStringList();
1162 }
1163 
1164 //---------------------------------------------------------------------------------------------------------------------
1165 void VCommonSettings::SetRestoreFileList(const QStringList &value)
1166 {
1167  setValue(settingGeneralRestoreFileList, value);
1168 }
1169 
1170 //---------------------------------------------------------------------------------------------------------------------
1172 {
1173  return value(settingGeneralGeometry).toByteArray();
1174 }
1175 
1176 //---------------------------------------------------------------------------------------------------------------------
1177 void VCommonSettings::SetGeometry(const QByteArray &value)
1178 {
1179  setValue(settingGeneralGeometry, value);
1180 }
1181 
1182 //---------------------------------------------------------------------------------------------------------------------
1184 {
1185  return value(settingGeneralWindowState).toByteArray();
1186 }
1187 
1188 //---------------------------------------------------------------------------------------------------------------------
1189 void VCommonSettings::SetWindowState(const QByteArray &value)
1190 {
1191  setValue(settingGeneralWindowState, value);
1192 }
1193 
1194 //---------------------------------------------------------------------------------------------------------------------
1196 {
1197  return value(settingGeneralToolbarsState).toByteArray();
1198 }
1199 
1200 //---------------------------------------------------------------------------------------------------------------------
1201 void VCommonSettings::SetToolbarsState(const QByteArray &value)
1202 {
1203  setValue(settingGeneralToolbarsState, value);
1204 }
1205 
1206 //---------------------------------------------------------------------------------------------------------------------
1208 {
1209  return value(settingPreferenceDialogSize, QSize(0, 0)).toSize();
1210 }
1211 
1212 //---------------------------------------------------------------------------------------------------------------------
1214 {
1215  setValue(settingPreferenceDialogSize, sz);
1216 }
1217 
1218 //---------------------------------------------------------------------------------------------------------------------
1220 {
1221  return value(settingToolSeamAllowanceDialogSize, QSize(0, 0)).toSize();
1222 }
1223 
1224 //---------------------------------------------------------------------------------------------------------------------
1226 {
1227  setValue(settingToolSeamAllowanceDialogSize, sz);
1228 }
1229 
1230 //---------------------------------------------------------------------------------------------------------------------
1232 {
1233  return value(settingFormulaWizardDialogSize, QSize(0, 0)).toSize();
1234 }
1235 
1236 //---------------------------------------------------------------------------------------------------------------------
1238 {
1239  setValue(settingFormulaWizardDialogSize, sz);
1240 }
1241 
1242 //---------------------------------------------------------------------------------------------------------------------
1244 {
1245  return value(settingIncrementsDialogSize, QSize(0, 0)).toSize();
1246 }
1247 
1248 //---------------------------------------------------------------------------------------------------------------------
1250 {
1251  setValue(settingIncrementsDialogSize, sz);
1252 }
1253 
1254 //---------------------------------------------------------------------------------------------------------------------
1256 {
1257  QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename);
1258  return settings.value(settingLatestSkippedVersion, 0x0).toInt();
1259 }
1260 
1261 //---------------------------------------------------------------------------------------------------------------------
1263 {
1264  QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename);
1265  settings.setValue(settingLatestSkippedVersion, value);
1266  settings.sync();
1267 }
1268 
1269 //---------------------------------------------------------------------------------------------------------------------
1271 {
1272  QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename);
1273  return settings.value(settingDateOfLastRemind, QDate(1900, 1, 1)).toDate();
1274 }
1275 
1276 //---------------------------------------------------------------------------------------------------------------------
1278 {
1279  QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename);
1280  settings.setValue(settingDateOfLastRemind, date);
1281  settings.sync();
1282 }
1283 
1284 //---------------------------------------------------------------------------------------------------------------------
1286 {
1287  return value(settingPatternForbidFlipping, false).toBool();
1288 }
1289 
1290 //---------------------------------------------------------------------------------------------------------------------
1292 {
1293  setValue(settingPatternForbidFlipping, value);
1294 }
1295 
1296 //---------------------------------------------------------------------------------------------------------------------
1298 {
1299  return value(settingPatternHideSeamLine, false).toBool();
1300 }
1301 
1302 //---------------------------------------------------------------------------------------------------------------------
1304 {
1305  setValue(settingPatternHideSeamLine, value);
1306 }
1307 
1308 //---------------------------------------------------------------------------------------------------------------------
1310 {
1311  return value(settingSeamlineNotch, false).toBool();
1312 }
1313 
1314 //---------------------------------------------------------------------------------------------------------------------
1316 {
1317  setValue(settingSeamlineNotch, value);
1318 }
1319 
1320 //---------------------------------------------------------------------------------------------------------------------
1322 {
1323  return value(settingSeamAllowanceNotch, false).toBool();
1324 }
1325 
1326 //---------------------------------------------------------------------------------------------------------------------
1328 {
1329  setValue(settingSeamAllowanceNotch, value);
1330 }
1331 
1332 //---------------------------------------------------------------------------------------------------------------------
1334 {
1335  return value(settingDefaultNotchLength, .250).toReal();
1336 }
1337 
1338 //---------------------------------------------------------------------------------------------------------------------
1340 {
1341  setValue(settingDefaultNotchLength, value);
1342 }
1343 
1344 //---------------------------------------------------------------------------------------------------------------------
1346 {
1347  return value(settingDefaultNotchWidth, .250).toReal();
1348 }
1349 
1350 //---------------------------------------------------------------------------------------------------------------------
1352 {
1353  setValue(settingDefaultNotchWidth, value);
1354 }
1355 
1356 //---------------------------------------------------------------------------------------------------------------------
1358 {
1359  return value(settingDefaultNotchType, "Slit").toString();
1360 }
1361 
1362 //---------------------------------------------------------------------------------------------------------------------
1363 void VCommonSettings::setDefaultNotchType(const QString &value)
1364 {
1365  setValue(settingDefaultNotchType, value);
1366 }
1367 
1368 //---------------------------------------------------------------------------------------------------------------------
1370 {
1371  return value(settingDefaultNotchColor, "black").toString();
1372 }
1373 
1374 //---------------------------------------------------------------------------------------------------------------------
1375 void VCommonSettings::setDefaultNotchColor(const QString &value)
1376 {
1377  setValue(settingDefaultNotchColor, value);
1378 }
1379 
1380 //---------------------------------------------------------------------------------------------------------------------
1382 {
1383  QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename);
1384  settings.setValue(settingCSVWithHeader, withHeader);
1385 }
1386 
1387 //---------------------------------------------------------------------------------------------------------------------
1389 {
1390  QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename);
1391  return settings.value(settingCSVWithHeader, GetDefCSVWithHeader()).toBool();
1392 }
1393 
1394 //---------------------------------------------------------------------------------------------------------------------
1396 {
1397  return false;
1398 }
1399 
1400 //---------------------------------------------------------------------------------------------------------------------
1402 {
1403  QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename);
1404  settings.setValue(settingCSVCodec, mib);
1405 }
1406 
1407 //---------------------------------------------------------------------------------------------------------------------
1409 {
1410  QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename);
1411  return settings.value(settingCSVCodec, GetDefCSVCodec()).toInt();
1412 }
1413 
1414 //---------------------------------------------------------------------------------------------------------------------
1416 {
1417  return QTextCodec::codecForLocale()->mibEnum();
1418 }
1419 
1420 //---------------------------------------------------------------------------------------------------------------------
1421 void VCommonSettings::SetCSVSeparator(const QChar &separator)
1422 {
1423  QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename);
1424  switch(separator.toLatin1())
1425  {
1426  case '\t':
1427  settings.setValue(settingCSVSeparator, 0);
1428  break;
1429  case ';':
1430  settings.setValue(settingCSVSeparator, 1);
1431  break;
1432  case ' ':
1433  settings.setValue(settingCSVSeparator, 2);
1434  break;
1435  default:
1436  settings.setValue(settingCSVSeparator, 3);
1437  break;
1438  }
1439 }
1440 
1441 //---------------------------------------------------------------------------------------------------------------------
1443 {
1444  QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename);
1445  const quint8 separator = static_cast<quint8>(settings.value(settingCSVSeparator, 3).toUInt());
1446  switch(separator)
1447  {
1448  case 0:
1449  return QChar('\t');
1450  case 1:
1451  return QChar(';');
1452  case 2:
1453  return QChar(' ');
1454  default:
1455  return QChar(',');
1456  }
1457 }
1458 
1459 //---------------------------------------------------------------------------------------------------------------------
1461 {
1462  return QChar(',');
1463 }
1464 
1465 //---------------------------------------------------------------------------------------------------------------------
1467 {
1469 }
1470 
1471 //---------------------------------------------------------------------------------------------------------------------
1472 /**
1473  * @brief returns the default seam allowance. The corresponding unit is the default unit.
1474  * @return the default seam allowance
1475  */
1477 {
1478  double defaultValue;
1479 
1480  const Unit globalUnit = StrToUnits(GetUnit());
1481 
1482  switch (globalUnit)
1483  {
1484  case Unit::Mm:
1485  defaultValue = 10;
1486  break;
1487  case Unit::Inch:
1488  defaultValue = 0.25;
1489  break;
1490  default:
1491  case Unit::Cm:
1492  defaultValue = 1;
1493  break;
1494  }
1495 
1496  bool ok = false;
1497  double val = value(settingPatternDefaultSeamAllowance, -1).toDouble(&ok);
1498  if (ok == false)
1499  {
1500  qDebug()<< "Could not convert value"<<value(settingPatternDefaultSeamAllowance, 0)
1501  << "to real. Return default value for default seam allowance is "
1502  << defaultValue << ".";
1503  val = defaultValue;
1504  }
1505 
1506  if (val < 0)
1507  {
1508  val = defaultValue;
1509  }
1510  else
1511  {
1512  val = UnitConvertor(val, Unit::Cm, globalUnit);
1513  }
1514 
1515  return val;
1516 }
1517 
1518 //---------------------------------------------------------------------------------------------------------------------
1520 {
1521  return value(settingDefaultSeamColor, "black").toString();
1522 }
1523 
1524 //---------------------------------------------------------------------------------------------------------------------
1525 void VCommonSettings::setDefaultSeamColor(const QString &value)
1526 {
1527  setValue(settingDefaultSeamColor, value);
1528 }
1529 
1530 //---------------------------------------------------------------------------------------------------------------------
1532 {
1533  return value(settingDefaultSeamLinetype, "solidLine").toString();
1534 }
1535 
1536 //---------------------------------------------------------------------------------------------------------------------
1538 {
1539  setValue(settingDefaultSeamLinetype, value);
1540 }
1541 
1542 //---------------------------------------------------------------------------------------------------------------------
1544 {
1545  return value(settingDefaultSeamLineweight, 1.20).toReal();
1546 }
1547 
1548 //---------------------------------------------------------------------------------------------------------------------
1550 {
1551  setValue(settingDefaultSeamLineweight, value);
1552 }
1553 
1554 //---------------------------------------------------------------------------------------------------------------------
1556 {
1557  return value(settingDefaultCutColor, "black").toString();
1558 }
1559 
1560 //---------------------------------------------------------------------------------------------------------------------
1561 void VCommonSettings::setDefaultCutColor(const QString &value)
1562 {
1563  setValue(settingDefaultCutColor, value);
1564 }
1565 
1566 //---------------------------------------------------------------------------------------------------------------------
1568 {
1569  return value(settingDefaultCutLinetype, "solidLine").toString();
1570 }
1571 
1572 //---------------------------------------------------------------------------------------------------------------------
1573 void VCommonSettings::setDefaultCutLinetype(const QString &value)
1574 {
1575  setValue(settingDefaultCutLinetype, value);
1576 }
1577 
1578 //---------------------------------------------------------------------------------------------------------------------
1580 {
1581  return value(settingDefaultCutLineweight, 1.20).toReal();
1582 }
1583 
1584 //---------------------------------------------------------------------------------------------------------------------
1586 {
1587  setValue(settingDefaultCutLineweight, value);
1588 }
1589 
1590 //---------------------------------------------------------------------------------------------------------------------
1592 {
1593  return value(settingDefaultInternalColor, "black").toString();
1594 }
1595 
1596 //---------------------------------------------------------------------------------------------------------------------
1598 {
1599  setValue(settingDefaultInternalColor, value);
1600 }
1601 
1602 //---------------------------------------------------------------------------------------------------------------------
1604 {
1605  return value(settingDefaultInternalLinetype, "solidLine").toString();
1606 }
1607 
1608 //---------------------------------------------------------------------------------------------------------------------
1610 {
1611  setValue(settingDefaultInternalLinetype, value);
1612 }
1613 
1614 //---------------------------------------------------------------------------------------------------------------------
1616 {
1617  return value(settingDefaultInternalLineweight, 1.20).toReal();
1618 }
1619 
1620 //---------------------------------------------------------------------------------------------------------------------
1622 {
1623  setValue(settingDefaultInternalLineweight, value);
1624 }
1625 
1626 //---------------------------------------------------------------------------------------------------------------------
1628 {
1629  return value(settingDefaultCutoutColor, "black").toString();
1630 }
1631 
1632 //---------------------------------------------------------------------------------------------------------------------
1633 void VCommonSettings::setDefaultCutoutColor(const QString &value)
1634 {
1635  setValue(settingDefaultCutoutColor, value);
1636 }
1637 
1638 //---------------------------------------------------------------------------------------------------------------------
1640 {
1641  return value(settingDefaultCutoutLinetype, "solidLine").toString();
1642 }
1643 
1644 //---------------------------------------------------------------------------------------------------------------------
1646 {
1647  setValue(settingDefaultCutoutLinetype, value);
1648 }
1649 
1650 //---------------------------------------------------------------------------------------------------------------------
1652 {
1653  return value(settingDefaultCutoutLineweight, 1.20).toReal();
1654 }
1655 
1656 //---------------------------------------------------------------------------------------------------------------------
1658 {
1659  setValue(settingDefaultCutoutLineweight, value);
1660 }
1661 
1662 //---------------------------------------------------------------------------------------------------------------------
1664 {
1665  return value(settingShowSeamAllowances, true).toBool();
1666 }
1667 
1668 //---------------------------------------------------------------------------------------------------------------------
1670 {
1671  setValue(settingShowSeamAllowances, value);
1672 }
1673 
1674 //---------------------------------------------------------------------------------------------------------------------
1676 {
1677  return value(settingDefaultSeamAllowanceVisibilty, true).toBool();
1678 }
1679 
1680 //---------------------------------------------------------------------------------------------------------------------
1682 {
1683  setValue(settingDefaultSeamAllowanceVisibilty, value);
1684 }
1685 
1686 //---------------------------------------------------------------------------------------------------------------------
1688 {
1689  return value(settingShowGrainlines, true).toBool();
1690 }
1691 
1692 //---------------------------------------------------------------------------------------------------------------------
1693 void VCommonSettings::setShowGrainlines(const bool &value)
1694 {
1695  setValue(settingShowGrainlines, value);
1696 }
1697 
1698 //---------------------------------------------------------------------------------------------------------------------
1700 {
1701  return value(settingDefaultGrainlineVisibilty, true).toBool();
1702 }
1703 
1704 //---------------------------------------------------------------------------------------------------------------------
1706 {
1707  setValue(settingDefaultGrainlineVisibilty, value);
1708 }
1709 
1710 //---------------------------------------------------------------------------------------------------------------------
1712 {
1713  return value(settingDefaultGrainlineLength, 2).toReal();
1714 }
1715 
1716 //---------------------------------------------------------------------------------------------------------------------
1718 {
1719  setValue(settingDefaultGrainlineLength, value);
1720 }
1721 
1722 //---------------------------------------------------------------------------------------------------------------------
1724 {
1725  return value(settingDefaultGrainlineColor, "black").toString();
1726 }
1727 
1728 //---------------------------------------------------------------------------------------------------------------------
1730 {
1731  setValue(settingDefaultGrainlineColor, value);
1732 }
1733 
1734 //---------------------------------------------------------------------------------------------------------------------
1736 {
1737  return value(settingDefaultGrainlineLineweight, 0.25).toReal();
1738 }
1739 
1740 //---------------------------------------------------------------------------------------------------------------------
1742 {
1743  setValue(settingDefaultGrainlineLineweight, value);
1744 }
1745 
1746 //---------------------------------------------------------------------------------------------------------------------
1748 {
1749  return value(settingShowLabels, true).toBool();
1750 }
1751 
1752 //---------------------------------------------------------------------------------------------------------------------
1753 void VCommonSettings::setShowLabels(const bool &value)
1754 {
1755  setValue(settingShowLabels, value);
1756 }
1757 
1758 //---------------------------------------------------------------------------------------------------------------------
1760 {
1761  return value(settingShowPatternLabels, true).toBool();
1762 }
1763 
1764 //---------------------------------------------------------------------------------------------------------------------
1766 {
1767  setValue(settingShowPatternLabels, value);
1768 }
1769 
1770 //---------------------------------------------------------------------------------------------------------------------
1772 {
1773  return value(settingShowPieceLabels, true).toBool();
1774 }
1775 
1776 //---------------------------------------------------------------------------------------------------------------------
1778 {
1779  setValue(settingShowPieceLabels, value);
1780 }
1781 
1782 //---------------------------------------------------------------------------------------------------------------------
1784 {
1785  return value(settingDefaultLabelWidth, 3).toReal();
1786 }
1787 
1788 //---------------------------------------------------------------------------------------------------------------------
1790 {
1791  setValue(settingDefaultLabelWidth, value);
1792 }
1793 
1794 //---------------------------------------------------------------------------------------------------------------------
1796 {
1797  return value(settingDefaultLabelHeight, 2).toReal();
1798 }
1799 
1800 //---------------------------------------------------------------------------------------------------------------------
1802 {
1803  setValue(settingDefaultLabelHeight, value);
1804 }
1805 
1806 //---------------------------------------------------------------------------------------------------------------------
1808 {
1809  return value(settingDefaultLabelColor, "black").toString();
1810 }
1811 
1812 //---------------------------------------------------------------------------------------------------------------------
1813 void VCommonSettings::setDefaultLabelColor(const QString &value)
1814 {
1815  setValue(settingDefaultLabelColor, value);
1816 }
1817 
1818 //---------------------------------------------------------------------------------------------------------------------
1820 {
1821  return qvariant_cast<QFont>(value(settingPatternLabelFont, QApplication::font()));
1822 }
1823 
1824 //---------------------------------------------------------------------------------------------------------------------
1825 void VCommonSettings::setLabelFont(const QFont &f)
1826 {
1827  setValue(settingPatternLabelFont, f);
1828 }
1829 
1830 //---------------------------------------------------------------------------------------------------------------------
1832 {
1833  return qvariant_cast<QFont>(value(settingPatternGuiFont, QApplication::font()));
1834 }
1835 
1836 //---------------------------------------------------------------------------------------------------------------------
1837 void VCommonSettings::setGuiFont(const QFont &f)
1838 {
1839  setValue(settingPatternGuiFont, f);
1840 }
1841 
1842 //---------------------------------------------------------------------------------------------------------------------
1844 {
1845  return qvariant_cast<QFont>(value(settingPatternPointNameFont, QApplication::font()));
1846 }
1847 
1848 //---------------------------------------------------------------------------------------------------------------------
1850 {
1851  setValue(settingPatternPointNameFont, f);
1852 }
1853 
1854 //---------------------------------------------------------------------------------------------------------------------
1856 {
1857  return value(settingGraphicsViewHidePointNames, true).toBool();
1858 }
1859 
1860 //---------------------------------------------------------------------------------------------------------------------
1862 {
1863  setValue(settingGraphicsViewHidePointNames, value);
1864 }
1865 
1866 //---------------------------------------------------------------------------------------------------------------------
1868 {
1869  return value(settingGraphicsViewShowAxisOrigin, true).toBool();
1870 }
1871 
1872 //---------------------------------------------------------------------------------------------------------------------
1874 {
1875  setValue(settingGraphicsViewShowAxisOrigin, value);
1876 }
1877 
1878 //---------------------------------------------------------------------------------------------------------------------
1880 {
1881  return value(settingGraphicsViewWireframe, false).toBool();
1882 }
1883 
1884 //---------------------------------------------------------------------------------------------------------------------
1886 {
1887  setValue(settingGraphicsViewWireframe, value);
1888 }
1889 
1890 //---------------------------------------------------------------------------------------------------------------------
1892 {
1893  return value(settingGraphicsViewShowControlPoints, false).toBool();
1894 }
1895 
1896 //---------------------------------------------------------------------------------------------------------------------
1898 {
1899  setValue(settingGraphicsViewShowControlPoints, value);
1900 }
1901 
1902 //---------------------------------------------------------------------------------------------------------------------
1904 {
1905  return value(settingGraphicsViewShowAnchorPoints, false).toBool();
1906 }
1907 
1908 //---------------------------------------------------------------------------------------------------------------------
1910 {
1911  setValue(settingGraphicsViewShowAnchorPoints, value);
1912 }
1913 
1914 //---------------------------------------------------------------------------------------------------------------------
1916 {
1917  return value(settingGraphicsUseToolColor, false).toBool();
1918 }
1919 
1920 //---------------------------------------------------------------------------------------------------------------------
1922 {
1923  setValue(settingGraphicsUseToolColor, value);
1924 }
1925 
1926 //---------------------------------------------------------------------------------------------------------------------
1928 {
1929  if (pointNameSize <= 0)
1930  {
1931  bool ok = false;
1932  pointNameSize = value(settingGraphicsViewPointNameSize, 32).toInt(&ok);
1933  if (not ok)
1934  {
1935  pointNameSize = 32;
1936  }
1937  }
1938  return pointNameSize;
1939 }
1940 
1941 //---------------------------------------------------------------------------------------------------------------------
1943 {
1944  setValue(settingGraphicsViewPointNameSize, value);
1945  pointNameSize = value;
1946 }
1947 
1949 {
1950  return value(settingGraphicsViewGuiFontSize, 9).toInt();
1951 }
1952 
1953 //---------------------------------------------------------------------------------------------------------------------
1955 {
1956  setValue(settingGraphicsViewGuiFontSize, value);
1957 }
1958 
1959 //---------------------------------------------------------------------------------------------------------------------
1961 {
1962  const QString format = value(settingLabelDateFormat, VCommonSettings::PredefinedDateFormats().first()).toString();
1963  const QStringList allFormats = VCommonSettings::PredefinedDateFormats() + GetUserDefinedDateFormats();
1964 
1965  if (allFormats.contains(format))
1966  {
1967  return format;
1968  }
1969  else
1970  {
1971  return VCommonSettings::PredefinedDateFormats().first();
1972  }
1973 }
1974 
1975 //---------------------------------------------------------------------------------------------------------------------
1976 void VCommonSettings::SetLabelDateFormat(const QString &format)
1977 {
1978  setValue(settingLabelDateFormat, format);
1979 }
1980 
1981 //---------------------------------------------------------------------------------------------------------------------
1983 {
1984  QStringList formats = QStringList() << "MM-dd-yyyy"
1985  << "d/M/yy"
1986  << "ddddMMMM dd, yyyy"
1987  << "dd/MM/yy"
1988  << "dd/MM/yyyy"
1989  << "MMM d, yy"
1990  << "MMM d, yyyy"
1991  << "d. MMM. yyyy"
1992  << "MMMM d, yyyy"
1993  << "d. MMMM yyyy"
1994  << "ddd, MMM d, yy"
1995  << "ddd dd/MMM yy"
1996  << "ddd, MMMM d, yyyy"
1997  << "ddddMMMM d, yyyy"
1998  << "MM-dd"
1999  << "yy-MM-dd"
2000  << "yyyy-MM-dd"
2001  << "MM/yy"
2002  << "MMM dd"
2003  << "MMMM";
2004  return formats;
2005 }
2006 
2007 //---------------------------------------------------------------------------------------------------------------------
2009 {
2010  return value(settingLabelUserDateFormats, QStringList()).toStringList();
2011 }
2012 
2013 //---------------------------------------------------------------------------------------------------------------------
2014 void VCommonSettings::SetUserDefinedDateFormats(const QStringList &formats)
2015 {
2017 }
2018 
2019 //---------------------------------------------------------------------------------------------------------------------
2021 {
2022  const QString format = value(settingLabelTimeFormat, VCommonSettings::PredefinedTimeFormats().first()).toString();
2023  const QStringList allFormats = VCommonSettings::PredefinedTimeFormats() + GetUserDefinedTimeFormats();
2024 
2025  if (allFormats.contains(format))
2026  {
2027  return format;
2028  }
2029  else
2030  {
2031  return VCommonSettings::PredefinedTimeFormats().first();
2032  }
2033 }
2034 
2035 //---------------------------------------------------------------------------------------------------------------------
2036 void VCommonSettings::SetLabelTimeFormat(const QString &format)
2037 {
2038  setValue(settingLabelTimeFormat, format);
2039 }
2040 
2041 //---------------------------------------------------------------------------------------------------------------------
2043 {
2044  QStringList formats = QStringList() << "hh:mm:ss"
2045  << "hh:mm:ss AP"
2046  << "hh:mm"
2047  << "hh:mm AP";
2048  return formats;
2049 }
2050 
2051 //---------------------------------------------------------------------------------------------------------------------
2053 {
2054  return value(settingLabelUserTimeFormats, QStringList()).toStringList();
2055 }
2056 
2057 //---------------------------------------------------------------------------------------------------------------------
2058 void VCommonSettings::SetUserDefinedTimeFormats(const QStringList &formats)
2059 {
2061 }
void setPointNameSize(int value)
void SetDefaultSeamAllowance(double value)
bool showSeamAllowanceNotch() const
int getScrollBarWidth() const
void setRotateSuffix(const QString &value)
qreal getDefaultSeamLineweight() const
void setDefaultGrainlineLength(const qreal &value)
void setDefaultSeamLinetype(const QString &value)
void setDefaultGrainlineColor(const QString &value)
void setDefaultLineColor(const QString &value)
QString GetPMSystemCode() const
void setDefaultSeamLineweight(const qreal &value)
void SetUndoCount(const int &value)
QString getZoomRBPositiveColor() const
void setScrollUpdateInterval(const int &interval)
void setDefaultCutLinetype(const QString &value)
int getZoomSpeedFactor() const
void setShowCurveToolBar(const bool &value)
bool getConfirmFormatRewriting() const
void setDefaultCutoutLinetype(const QString &value)
void setForbidPieceFlipping(bool value)
void SetPathLabelTemplate(const QString &value)
void setMirrorByAxisSuffix(const QString &value)
void setUseToolColor(bool value)
QString getPointNameHoverColor() const
static QString SharePath(const QString &shareItem)
qreal getDefaultNotchWidth() const
bool getShowToolsToolBar() const
void setShowOpsToolBar(const bool &value)
bool GetSendReportState() const
QString getDefaultPatternTemplate() const
static QString GetDefPathMultisizeMeasurements()
qreal getDefaultLabelWidth() const
qreal getDefaultGrainlineLineweight() const
bool showPatternLabels() const
void setDefaultLineWeight(const qreal &value)
bool GetDefCSVWithHeader() const
void SetPMSystemCode(const QString &value)
void setGuiFont(const QFont &f)
QString getDefaultSeamLinetype() const
int GetCSVCodec() const
int getAutosaveInterval() const
qreal getDefaultCutoutLineweight() const
QSize getPreferenceDialogSize() const
void setPreferenceDialogSize(const QSize &sz)
static QString PrepareStandardTemplates(const QString &currentPath)
QString getDefaultInternalColor() const
void setDefaultCutColor(const QString &value)
void setZoomModKey(const bool &value)
static QString MultisizeTablesPath()
bool showLabels() const
void setDefaultInternalLinetype(const QString &value)
static QString GetDefPathTemplate()
QString getSelectionSound() const
QString getTertiarySupportColor() const
static QString PrepareMultisizeTables(const QString &currentPath)
void setDefaultLabelHeight(const qreal &value)
bool showSeamAllowances() const
bool useLastExportFormat() const
void setUseLastExportFormat(const bool &value)
QString GetPathIndividualMeasurements() const
QString getDefaultLineColor() const
int getPointNameSize() const
bool getUseToolColor() const
void setPointNameColor(const QString &value)
bool getShowControlPoints() const
QSize GetFormulaWizardDialogSize() const
QString GetLabelDateFormat() const
QString getDefaultNotchType() const
static QString StandardTemplatesPath()
QString getDefaultCutoutLinetype() const
bool getShowPointToolBar() const
bool GetOsSeparator() const
bool showSeamlineNotch() const
void setZoomRBNegativeColor(const QString &value)
bool getShowPieceToolBar() const
void SetLabelTimeFormat(const QString &format)
bool getDefaultGrainlineVisibilty() const
bool getShowDetailsToolBar() const
void setHidePointNames(bool value)
void setShowPieceLabels(const bool &value)
void setShowLabels(const bool &value)
void SetIncrementsDialogSize(const QSize &sz)
void setPatternPieceDialogSize(const QSize &sz)
bool GetCSVWithHeader() const
int getScrollUpdateInterval() const
void setDefaultSeamColor(const QString &value)
void setDefaultInternalColor(const QString &value)
void setDefaultPieceTemplate(const QString &text)
void setDefaultCutoutColor(const QString &value)
void SetCSVWithHeader(bool withHeader)
bool getForbidPieceFlipping() const
void setWireframe(bool value)
void SetDateOfLastRemind(const QDate &date)
bool showGrainlines() const
QString getDefaultCutoutColor() const
void setDefaultPatternTemplate(const QString &text)
void setPanActiveSpaceKey(const bool &value)
void SetRecentFileList(const QStringList &value)
void setAutosaveInterval(const int &value)
QByteArray GetGeometry() const
QString getDefaultLineType() const
int getGuiFontSize() const
bool getConstrainModKey() const
void setConfirmFormatRewriting(const bool &value)
void setDefaultInternalLineweight(const qreal &value)
bool getShowLayoutToolBar() const
bool getShowAxisOrigin() const
void setExportFormat(const QString &value)
void setDefaultNotchColor(const QString &value)
void setToolBarStyle(const bool &value)
void setShowSeamAllowances(const bool &value)
bool getZoomModKey() const
bool getShowOpsToolBar() const
QString GetPathTemplate() const
QChar GetCSVSeparator() const
void SetToolbarsState(const QByteArray &value)
QString getDefaultCutLinetype() const
qreal getDefaultLineWeight() const
bool getShowArcToolBar() const
int getExportQuality() const
QByteArray GetToolbarsState() const
QString getExportFormat() const
void setDefaultCutoutLineweight(const qreal &value)
QStringList GetUserDefinedTimeFormats() const
void setScrollSpeedFactor(const int &factor)
QString getMirrorByAxisSuffix() const
void setShowSeamlineNotch(bool value)
bool getShowCurveToolBar() const
QString GetPathMultisizeMeasurements() const
QFont getGuiFont() const
QString getDefaultLabelColor() const
void setSecondarySupportColor(const QString &value)
void setScrollBarWidth(const int &width)
QStringList GetRecentFileList() const
QChar GetDefCSVSeparator() const
void SetRestoreFileList(const QStringList &value)
void setTertiarySupportColor(const QString &value)
void setAxisOrginColor(const QString &value)
QString getSecondarySupportColor() const
void SetPathIndividualMeasurements(const QString &value)
qreal getConstrainValue() const
bool isHideSeamLine() const
QString getAxisOrginColor() const
static const QString unixStandardSharePath
QSize getPatternPieceDialogSize() const
QDate GetDateOfLastRemind() const
VCommonSettings(Format format, Scope scope, const QString &organization, const QString &application=QString(), QObject *parent=nullptr)
QString GetPathLabelTemplate() const
QString getZoomRBNegativeColor() const
QString getRotateSuffix() const
void SetUserDefinedDateFormats(const QStringList &formats)
bool isWireframe() const
void setHideSeamLine(bool value)
bool useModeType() const
void SetSendReportState(const bool &value)
void setDefaultSeamAllowanceVisibilty(const bool &value)
qreal getDefaultCutLineweight() const
void setShowGrainlines(const bool &value)
void setShowToolsToolBar(const bool &value)
QString GetLabelTimeFormat() const
int GetDefCSVCodec() const
void setDefaultGrainlineLineweight(const qreal &value)
void setPointNameHoverColor(const QString &value)
void setConfirmItemDelete(const bool &value)
QString getDefaultInternalLinetype() const
qreal getDefaultGrainlineLength() const
void setShowAxisOrigin(bool value)
void setDefaultLineType(const QString &value)
bool isPanActiveSpaceKey() const
bool getToolBarStyle() const
void SetUnit(const QString &value)
bool isZoomDoubleClick() const
void setShowSeamAllowanceNotch(bool value)
QFont getPointNameFont() const
void setDefaultLabelColor(const QString &value)
qreal getDefaultInternalLineweight() const
bool getShowAnchorPoints() const
QString getPointNameColor() const
void setScrollDuration(const int &duration)
void setShowPatternLabels(const bool &value)
void SetWindowState(const QByteArray &value)
void SetOsSeparator(const bool &value)
qreal getDefaultLabelHeight() const
void SetCSVCodec(int mib)
void setShowLineToolBar(const bool &value)
QString getDefaultGrainlineColor() const
QString GetLocale() const
int GetUndoCount() const
bool getConfirmItemDelete() const
void setLabelFont(const QFont &f)
void setZoomSpeedFactor(const int &factor)
QString getMirrorByLineSuffix() const
bool getDefaultSeamAllowanceVisibilty() const
void setPrimarySupportColor(const QString &value)
void setMirrorByLineSuffix(const QString &value)
void setConstrainModKey(const bool &value)
void setDefaultNotchWidth(const qreal &value)
void setShowPointToolBar(const bool &value)
void setShowDetailsToolBar(const bool &value)
static QStringList PredefinedTimeFormats()
void setMoveSuffix(const QString &value)
void setShowScrollBars(const bool &value)
QString getDefaultPieceTemplate() const
QFont getLabelFont() const
void setGuiFontSize(int value)
QString getSound() const
static QString GetDefPathIndividualMeasurements()
void setConstrainValue(const qreal &value)
void SetPathTemplate(const QString &value)
QString getMoveSuffix() const
int getScrollSpeedFactor() const
void setShowPieceToolBar(const bool &value)
void setZoomRBPositiveColor(const QString &value)
void setSelectionSound(const QString &value)
void setShowControlPoints(bool value)
bool getShowScrollBars() const
QByteArray GetWindowState() const
void setExportQuality(const int &value)
qreal getDefaultNotchLength() const
bool getHidePointNames() const
void SetCSVSeparator(const QChar &separator)
void setUseModeType(const bool &value)
void SetAutosaveState(const bool &value)
QString getDefaultNotchColor() const
void SetLatestSkippedVersion(int value)
double GetDefaultSeamAllowance()
returns the default seam allowance. The corresponding unit is the default unit.
void SetPathMultisizeMeasurements(const QString &value)
int GetLatestSkippedVersion() const
int getScrollDuration() const
bool showPieceLabels() const
void SetLabelDateFormat(const QString &format)
QString getPrimarySupportColor() const
void SetFormulaWizardDialogSize(const QSize &sz)
QSize GetIncrementsDialogSize() const
void setDefaultLabelWidth(const qreal &value)
static QStringList PredefinedDateFormats()
QString getDefaultSeamColor() const
QStringList GetRestoreFileList() const
void setShowAnchorPoints(bool value)
bool getShowLineToolBar() const
QStringList GetUserDefinedDateFormats() const
void setDefaultGrainlineVisibilty(const bool &value)
void setDefaultNotchType(const QString &value)
void setShowLayoutToolBar(const bool &value)
QString getDefaultCutColor() const
void setPointNameFont(const QFont &f)
void SetLocale(const QString &value)
void setDefaultNotchLength(const qreal &value)
void setShowArcToolBar(const bool &value)
void SetUserDefinedTimeFormats(const QStringList &formats)
void setZoomDoubleClick(const bool &value)
void setDefaultCutLineweight(const qreal &value)
bool GetAutosaveState() const
void SetGeometry(const QByteArray &value)
static QString GetDefPathLabelTemplate()
QString GetUnit() const
Unit StrToUnits(const QString &unit)
Definition: def.cpp:670
const QString unitCM
Definition: def.cpp:201
const QString unitINCH
Definition: def.cpp:202
qreal UnitConvertor(qreal value, const Unit &from, const Unit &to)
Definition: def.cpp:269
Unit
Definition: def.h:105
QString PrepareStandardFiles(const QString &currentPath, const QString &standardPath, const QString &defPath)
void SymlinkCopyDirRecursive(const QString &fromDir, const QString &toDir, bool replaceOnConflit)
QStringList ClearFormats(const QStringList &predefinedFormats, QStringList formats)
#define qApp
Definition: vapplication.h:67
static const QString commonIniFilename