54 #include <QApplication>
59 #include <QMessageLogger>
61 #include <QStaticStringData>
62 #include <QStringData>
63 #include <QStringDataPtr>
68 #include "../ifc/ifcdef.h"
69 #include "../vmisc/def.h"
70 #include "../vmisc/vmath.h"
71 #include "../vpatterndb/pmsystems.h"
217 QStringList
ClearFormats(
const QStringList &predefinedFormats, QStringList formats)
219 for (
int i = 0; i < predefinedFormats.size(); ++i)
221 formats.removeAll(predefinedFormats.at(i));
229 #if !defined(Q_OS_WIN)
239 dir.setPath(fromDir);
241 foreach (QString copyFile, dir.entryList(QDir::Files))
243 const QString from = fromDir + QDir::separator() + copyFile;
244 QString to = toDir + QDir::separator() + copyFile;
253 if (not fileTo.rename(to + QLatin1String(
".lnk")))
255 QFile::remove(to + QLatin1String(
".lnk"));
256 fileTo.rename(to + QLatin1String(
".lnk"));
259 QFileInfo info(to + QLatin1String(
".lnk"));
260 if (info.symLinkTarget().isEmpty())
269 to = to + QLatin1String(
".lnk");
272 if (QFile::exists(to))
274 if (replaceOnConflit)
284 QFile::link(from, to);
287 foreach (QString copyDir, dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot))
289 const QString from = fromDir + QDir::separator() + copyDir;
290 const QString to = toDir + QDir::separator() + copyDir;
292 if (dir.mkpath(to) ==
false)
304 QDir standardPathDir(standardPath);
305 QDir currentPathDir(currentPath);
306 if ((currentPath == defPath || not currentPathDir.exists()) && standardPathDir.exists())
308 const QDir localdata (defPath);
309 if (localdata.mkpath(
"."))
321 const QString &application, QObject *parent)
322 :QSettings(format, scope, organization, application, parent)
329 return QCoreApplication::applicationDirPath() + shareItem;
330 #elif defined(Q_OS_MAC)
331 QDir dirBundle(QCoreApplication::applicationDirPath() + QStringLiteral(
"/../Resources") + shareItem);
332 if (dirBundle.exists())
334 return dirBundle.absolutePath();
338 QDir appDir = QDir(
qApp->applicationDirPath());
342 QDir dir(appDir.absolutePath() + shareItem);
345 return dir.absolutePath();
354 return QCoreApplication::applicationDirPath() + shareItem;
356 QDir dir(QCoreApplication::applicationDirPath() + shareItem);
359 return dir.absolutePath();
372 return SharePath(QStringLiteral(
"/tables/multisize"));
378 return SharePath(QStringLiteral(
"/tables/templates"));
396 return QDir::homePath() + QLatin1String(
"/seamly2d/") + tr(
"measurements") + QLatin1String(
"/") + tr(
"individual");
402 QSettings settings(this->format(), this->scope(), this->organizationName(),
commonIniFilename);
409 QSettings settings(this->format(), this->scope(), this->organizationName(),
commonIniFilename);
417 return QDir::homePath() + QLatin1String(
"/seamly2d/") + tr(
"measurements") + QLatin1String(
"/") + tr(
"multisize");
423 QSettings settings(this->format(), this->scope(), this->organizationName(),
commonIniFilename);
430 QSettings settings(this->format(), this->scope(), this->organizationName(),
commonIniFilename);
438 return QDir::homePath() + QLatin1String(
"/seamly2d/") + tr(
"templates");
444 QSettings settings(this->format(), this->scope(), this->organizationName(),
commonIniFilename);
451 QSettings settings(this->format(), this->scope(), this->organizationName(),
commonIniFilename);
459 return QDir::homePath() + QLatin1String(
"/seamly2d/") + tr(
"label templates");
530 <<
"to int. Return default value for autosave time"<<1<<
"minutes.";
618 QLocale().measurementSystem() == QLocale::MetricSystem ?
unitCM :
unitINCH).toString();
1105 <<
"to int. Return default value for undo counts 0 (no limit).";
1126 return QStringLiteral(
"qrc:/sounds/") + value(
settingSelectionSound,
"silent").toString() + QStringLiteral(
".wav");
1139 QStringList cleared;
1141 for (
int i = 0; i < files.size(); ++i)
1143 if (QFileInfo(files.at(i)).exists())
1145 cleared.append(files.at(i));
1257 QSettings settings(this->format(), this->scope(), this->organizationName(),
commonIniFilename);
1264 QSettings settings(this->format(), this->scope(), this->organizationName(),
commonIniFilename);
1272 QSettings settings(this->format(), this->scope(), this->organizationName(),
commonIniFilename);
1279 QSettings settings(this->format(), this->scope(), this->organizationName(),
commonIniFilename);
1383 QSettings settings(this->format(), this->scope(), this->organizationName(),
commonIniFilename);
1390 QSettings settings(this->format(), this->scope(), this->organizationName(),
commonIniFilename);
1403 QSettings settings(this->format(), this->scope(), this->organizationName(),
commonIniFilename);
1410 QSettings settings(this->format(), this->scope(), this->organizationName(),
commonIniFilename);
1417 return QTextCodec::codecForLocale()->mibEnum();
1423 QSettings settings(this->format(), this->scope(), this->organizationName(),
commonIniFilename);
1424 switch(separator.toLatin1())
1444 QSettings settings(this->format(), this->scope(), this->organizationName(),
commonIniFilename);
1445 const quint8 separator =
static_cast<quint8
>(settings.value(
settingCSVSeparator, 3).toUInt());
1478 double defaultValue;
1488 defaultValue = 0.25;
1501 <<
"to real. Return default value for default seam allowance is "
1502 << defaultValue <<
".";
1965 if (allFormats.contains(format))
1984 QStringList formats = QStringList() <<
"MM-dd-yyyy"
1986 <<
"ddddMMMM dd, yyyy"
1996 <<
"ddd, MMMM d, yyyy"
1997 <<
"ddddMMMM d, yyyy"
2025 if (allFormats.contains(format))
2044 QStringList formats = QStringList() <<
"hh:mm:ss"
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 getAutosaveInterval() const
qreal getDefaultCutoutLineweight() const
QSize getPreferenceDialogSize() const
void setPreferenceDialogSize(const QSize &sz)
static QString PrepareStandardTemplates(const QString ¤tPath)
QString getDefaultInternalColor() const
void setDefaultCutColor(const QString &value)
void setZoomModKey(const bool &value)
static QString MultisizeTablesPath()
void setDefaultInternalLinetype(const QString &value)
static QString GetDefPathTemplate()
QString getSelectionSound() const
QString getTertiarySupportColor() const
static QString PrepareMultisizeTables(const QString ¤tPath)
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
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)
void setHideSeamLine(bool value)
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
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)
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()
Unit StrToUnits(const QString &unit)
qreal UnitConvertor(qreal value, const Unit &from, const Unit &to)
const QString settingGraphicsViewZoomDoubleClick
const QString settingLatestSkippedVersion
const QString settingGeneralWindowState
const QString settingDefaultCutoutLinetype
const QString settingCSVSeparator
const QString settingGraphicsViewZoomRBPositiveColor
const QString settingDefaultCutLineweight
const QString settingGraphicsViewConstrainModKey
const QString settingDefaultLabelHeight
const QString settingGraphicsViewSecondaryColor
const QString settingShowPatternLabels
const QString settingDefaultCutoutColor
const QString settingPathsIndividualMeasurements
const QString settingGraphicsViewZoomSpeedFactor
const QString settingGraphicsViewShowArcToolBar
const QString settingDefaultLabelWidth
const QString settingSelectionSound
const QString settingConfigurationUseModeType
const QString settingFormulaWizardDialogSize
const QString settingConfigurationConfirmItemDeletion
const QString settingConfigurationAutosaveTime
QString PrepareStandardFiles(const QString ¤tPath, const QString &standardPath, const QString &defPath)
const QString settingPatternHideSeamLine
const QString settingDefaultGrainlineColor
const QString settingPatternDefaultSeamAllowance
const QString settingLabelTimeFormat
const QString settingGraphicsViewConstrainValue
const QString settingDefaultInternalLinetype
const QString settingGraphicsViewShowControlPoints
const QString settingCSVWithHeader
const QString settingConfigurationLocale
const QString settingGraphicsViewAngleDelta
const QString settingPatternUndo
const QString settingConfigurationRotateSuffix
const QString settingGraphicsViewTertiaryColor
const QString settingGraphicsViewScrollSpeedFactor
const QString settingConfigurationUseLastExportFormat
const QString settingLabelUserDateFormats
const QString settingGraphicsViewShowLineToolBar
const QString settingGraphicsViewZoomModKey
const QString settingGraphicsViewShowPieceToolBar
const QString settingGraphicsViewWireframe
const QString settingGraphicsViewPointNameSize
const QString settingPMSystemCode
const QString settingDefaultLabelColor
const QString settingGraphicsUseToolColor
const QString settingDefaultGrainlineLineweight
const QString settingDefaultSeamColor
const QString settingDefaultCutoutLineweight
const QString settingDefaultCutLinetype
const QString settingDefaultInternalLineweight
const QString settingConfigurationConfirmFormatRewriting
const QString settingShowLabels
const QString settingGeneralRestoreFileList
const QString settingConfigurationMoveSuffix
const QString settingConfigurationOsSeparator
const QString settingPathsMultisizeMeasurements
const QString settingConfigurationAutosaveState
const QString settingConfigurationMirrorByLineSuffix
const QString settingDefaultNotchColor
const QString settingPreferenceDialogSize
const QString settingDefaultPatternTemplate
const QString settingDefaultNotchType
const QString settingDefaultInternalColor
const QString settingGraphicsViewGuiFontSize
const QString settingDefaultGrainlineVisibilty
void SymlinkCopyDirRecursive(const QString &fromDir, const QString &toDir, bool replaceOnConflit)
const QString settingGraphicsViewPointNameHoverColor
const QString settingGraphicsViewShowScrollBars
const QString settingPatternLabelFont
const QString settingToolSeamAllowanceDialogSize
const QString settingDefaultSeamLinetype
const QString settingLabelUserTimeFormats
const QString settingConfigurationExportFormat
const QString settingLabelDateFormat
const QString settingGraphicsViewShowCurveToolBar
const QString settingDefaultGrainlineLength
const QString settingGraphicsViewShowAxisOrigin
const QString settingShowGrainlines
const QString settingPatternForbidFlipping
const QString settingGeneralGeometry
const QString settingGraphicsViewPanActiveSpaceKey
const QString settingGraphicsViewExportQuality
const QString settingDefaultNotchLength
const QString settingConfigurationUnit
const QString settingGraphicsViewShowAnchorPoints
const QString settingGraphicsViewShowDetailsToolBar
const QString settingConfigurationSendReportState
const QString settingGraphicsViewShowOpsToolBar
const QString settingGraphicsViewPointNameColor
const QString settingSeamlineNotch
const QString settingGraphicsViewPixelDelta
const QString settingDefaultSeamAllowanceVisibilty
const QString settingGeneralRecentFileList
const QString settingPatternGuiFont
const QString settingGraphicsViewAxisOrginColor
const QString settingSeamAllowanceNotch
const QString settingGraphicsViewShowLayoutToolBar
const QString settingPathsTemplates
const QString settingGraphicsViewDefaultLineColor
const QString settingDateOfLastRemind
const QString settingConfigurationMirrorByAxisSuffix
const QString settingPathsLabelTemplate
const QString settingGraphicsViewHidePointNames
const QString settingGraphicsViewToolBarStyle
QStringList ClearFormats(const QStringList &predefinedFormats, QStringList formats)
const QString settingIncrementsDialogSize
const QString settingDefaultPieceTemplate
const QString settingGraphicsViewShowToolsToolBar
const QString settingCSVCodec
const QString settingGraphicsViewShowPointToolBar
const QString settingShowPieceLabels
const QString settingShowSeamAllowances
const QString settingDefaultCutColor
const QString settingGraphicsViewScrollUpdateInterval
const QString settingGraphicsViewZoomRBNegativeColor
const QString settingGraphicsViewPrimaryColor
const QString settingPatternPointNameFont
const QString settingDefaultNotchWidth
const QString settingDefaultSeamLineweight
const QString settingGeneralToolbarsState
const QString settingGraphicsViewScrollBarWidth
const QString settingGraphicsViewDefaultLineWeight
const QString settingGraphicsViewScrollDuration
const QString settingGraphicsViewDefaultLineType
static const QString commonIniFilename