Valentina did not read/write the layout dialog settings.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-09-13 13:07:12 +03:00
parent ec82936f86
commit 59389aa049
2 changed files with 12 additions and 12 deletions

View File

@ -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<quint32>(qFloor(UnitConvertor(ui->doubleSpinBoxShift->value(),
oldLayoutUnit, Unit::Px)));
return static_cast<quint32>(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<quint32>(qFloor(UnitConvertor(ui->doubleSpinBoxLayoutWidth->value(),
oldLayoutUnit, Unit::Px)));
return static_cast<quint32>(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();
}

View File

@ -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;