diff --git a/src/app/valentina/dialogs/dialoglayoutsettings.cpp b/src/app/valentina/dialogs/dialoglayoutsettings.cpp index 5a0e51859..0d97179ec 100644 --- a/src/app/valentina/dialogs/dialoglayoutsettings.cpp +++ b/src/app/valentina/dialogs/dialoglayoutsettings.cpp @@ -58,15 +58,16 @@ const DialogLayoutSettings::FormatsVector DialogLayoutSettings::pageFormatNames= }; //--------------------------------------------------------------------------------------------------------------------- -DialogLayoutSettings::DialogLayoutSettings(VLayoutGenerator *generator, QWidget *parent, bool disableSetting) - : QDialog(parent), disableSettings(disableSettings), ui(new Ui::DialogLayoutSettings), oldPaperUnit(Unit::Mm), oldLayoutUnit(Unit::Mm), - generator(generator) +DialogLayoutSettings::DialogLayoutSettings(VLayoutGenerator *generator, QWidget *parent, bool disableSettings) + : QDialog(parent), disableSettings(disableSettings), ui(new Ui::DialogLayoutSettings), oldPaperUnit(Unit::Mm), + oldLayoutUnit(Unit::Mm), generator(generator) { ui->setupUi(this); qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); - //moved from ReadSettings - well...it seems it can be done once only (i.e. constructor) because Init funcs dont even cleanse lists before adding + //moved from ReadSettings - well...it seems it can be done once only (i.e. constructor) because Init funcs dont + //even cleanse lists before adding InitPaperUnits(); InitLayoutUnits(); InitTemplates(); @@ -74,7 +75,7 @@ DialogLayoutSettings::DialogLayoutSettings(VLayoutGenerator *generator, QWidget MinimumLayoutSize(); //in export console mode going to use defaults - if (!disableSettings) + if (disableSettings == false) { ReadSettings(); } @@ -140,8 +141,7 @@ void DialogLayoutSettings::SetPaperWidth(int value) //--------------------------------------------------------------------------------------------------------------------- unsigned int DialogLayoutSettings::GetShift() const { - return static_cast(qFloor(UnitConvertor(ui->doubleSpinBoxShift->value(), - oldLayoutUnit, Unit::Px))); + return static_cast(qFloor(UnitConvertor(ui->doubleSpinBoxShift->value(), oldLayoutUnit, Unit::Px))); } //--------------------------------------------------------------------------------------------------------------------- @@ -153,8 +153,7 @@ void DialogLayoutSettings::SetShift(unsigned int value) //--------------------------------------------------------------------------------------------------------------------- unsigned int DialogLayoutSettings::GetLayoutWidth() const { - return static_cast(qFloor(UnitConvertor(ui->doubleSpinBoxLayoutWidth->value(), - oldLayoutUnit, Unit::Px))); + return static_cast(qFloor(UnitConvertor(ui->doubleSpinBoxLayoutWidth->value(), oldLayoutUnit, Unit::Px))); } //--------------------------------------------------------------------------------------------------------------------- @@ -420,7 +419,7 @@ void DialogLayoutSettings::DialogAccepted() generator->SetUnitePages(IsUnitePages()); //don't want to break visual settings when cmd used - if (!disableSettings) + if (disableSettings == false) { WriteSettings(); } diff --git a/src/app/valentina/dialogs/dialoglayoutsettings.h b/src/app/valentina/dialogs/dialoglayoutsettings.h index 386c0ec3a..7ea7f8c1d 100644 --- a/src/app/valentina/dialogs/dialoglayoutsettings.h +++ b/src/app/valentina/dialogs/dialoglayoutsettings.h @@ -47,8 +47,9 @@ class DialogLayoutSettings : public QDialog { Q_OBJECT public: - enum class PaperSizeTemplate : char { A0 = 0, A1, A2, A3, A4, Letter, Legal, Roll24in, Roll30in, Roll36in, Roll42in, Roll44in}; - DialogLayoutSettings(VLayoutGenerator *generator, QWidget *parent = 0, bool disableSetting = false); + enum class PaperSizeTemplate : char { A0 = 0, A1, A2, A3, A4, Letter, Legal, Roll24in, Roll30in, Roll36in, Roll42in, + Roll44in}; + DialogLayoutSettings(VLayoutGenerator *generator, QWidget *parent = nullptr, bool disableSettings = false); ~DialogLayoutSettings(); int GetPaperHeight() const;