43
43
dsGroupBox7Layout->setMargin( 10 );
44
44
TextLabel1 = new QLabel( tr( "&Size:" ), dsGroupBox7, "TextLabel1" );
45
45
dsGroupBox7Layout->addMultiCellWidget( TextLabel1, 0, 0, 0, 1 );
46
PageSize *ps=new PageSize(doc->currentPage->PageSize);
46
PageSize *ps=new PageSize(doc->currentPage()->m_pageSize);
47
47
sizeQComboBox = new QComboBox( true, dsGroupBox7, "ComboBox1" );
48
48
sizeQComboBox->setEditable(false);
49
QStringList pageSizes=ps->getPageSizeList();
50
sizeQComboBox->insertStringList(ps->getTrPageSizeList());
51
sizeQComboBox->insertItem( tr( "Custom" ) );
52
prefsPageSizeName=ps->getPageName();
53
int sizeIndex = pageSizes.findIndex(ps->getPageText());
49
QStringList pageSizes=ps->sizeList();
50
sizeQComboBox->insertStringList(ps->sizeTRList());
51
sizeQComboBox->insertItem( CommonStrings::trCustomPageSize );
52
prefsPageSizeName=ps->name();
53
int sizeIndex = pageSizes.findIndex(ps->nameTR());
54
54
if (sizeIndex != -1)
55
55
sizeQComboBox->setCurrentItem(sizeIndex);
63
63
orientationQComboBox->insertItem( tr( "Portrait" ) );
64
64
orientationQComboBox->insertItem( tr( "Landscape" ) );
65
65
orientationQComboBox->setEditable(false);
66
orientationQComboBox->setCurrentItem(doc->currentPage->PageOri );
67
oldOri = doc->currentPage->PageOri;
66
orientationQComboBox->setCurrentItem(doc->currentPage()->PageOri );
67
oldOri = doc->currentPage()->PageOri;
68
68
TextLabel2->setBuddy(orientationQComboBox);
69
69
dsGroupBox7Layout->addMultiCellWidget( orientationQComboBox, 1, 1, 2, 3 );
70
70
widthMSpinBox = new MSpinBox( 1, 100000, dsGroupBox7, unitGetDecimalsFromIndex(doc->unitIndex()) );
71
71
widthQLabel = new QLabel( tr( "&Width:" ), dsGroupBox7, "widthLabel" );
72
72
widthMSpinBox->setSuffix(unitGetSuffixFromIndex(doc->unitIndex()));
73
widthMSpinBox->setValue(doc->currentPage->width() * doc->unitRatio());
73
widthMSpinBox->setValue(doc->currentPage()->width() * doc->unitRatio());
74
74
widthQLabel->setBuddy(widthMSpinBox);
75
75
dsGroupBox7Layout->addWidget( widthQLabel, 2, 0 );
76
76
dsGroupBox7Layout->addWidget( widthMSpinBox, 2, 1 );
77
77
heightMSpinBox = new MSpinBox( 1, 100000, dsGroupBox7, unitGetDecimalsFromIndex(doc->unitIndex()) );
78
78
heightMSpinBox->setSuffix(unitGetSuffixFromIndex(doc->unitIndex()));
79
heightMSpinBox->setValue(doc->currentPage->height() * doc->unitRatio());
79
heightMSpinBox->setValue(doc->currentPage()->height() * doc->unitRatio());
80
80
heightQLabel = new QLabel(heightMSpinBox, tr( "&Height:" ), dsGroupBox7, "heightLabel" );
81
81
dsGroupBox7Layout->addWidget( heightQLabel, 2, 2 );
82
82
dsGroupBox7Layout->addWidget( heightMSpinBox, 2, 3 );
99
99
Links->setEditable(false);
100
100
dsGroupBox7Layout->addMultiCellWidget( Links, 4, 4, 2, 3 );
101
if (doc->currentPage->LeftPg == 0)
101
if (doc->currentPage()->LeftPg == 0)
102
102
Links->setCurrentItem(Links->count()-1);
103
else if (doc->currentPage->LeftPg == 1)
103
else if (doc->currentPage()->LeftPg == 1)
104
104
Links->setCurrentItem(0);
106
Links->setCurrentItem(doc->currentPage->LeftPg-1);
106
Links->setCurrentItem(doc->currentPage()->LeftPg-1);
108
108
dialogLayout->addWidget( dsGroupBox7 );
110
//GroupRand = new MarginWidget(this, tr( "Margin Guides" ), &doc->currentPage->initialMargins, doc->unitIndex());
111
GroupRand = new MarginWidget(this, tr( "Margin Guides" ), &doc->currentPage->Margins, doc->unitIndex());
112
GroupRand->setPageWidthHeight(doc->currentPage->width(), doc->currentPage->height());
113
GroupRand->setFacingPages(!(doc->currentPageLayout == singlePage));
110
GroupRand = new MarginWidget(this, tr( "Margin Guides" ), &doc->currentPage()->initialMargins, doc->unitIndex(), false, false);
111
GroupRand->setPageWidthHeight(doc->currentPage()->width(), doc->currentPage()->height());
112
GroupRand->setFacingPages(!(doc->currentPageLayout == singlePage), doc->locationOfPage(doc->currentPage()->pageNr()));
114
113
dialogLayout->addWidget( GroupRand );
115
groupMaster = new QGroupBox( this, "groupMaster" );
116
groupMaster->setTitle( tr( "Other Settings" ) );
117
groupMaster->setColumnLayout(0, Qt::Vertical );
118
groupMaster->layout()->setSpacing( 0 );
119
groupMaster->layout()->setMargin( 0 );
120
masterLayout = new QHBoxLayout( groupMaster->layout() );
121
masterLayout->setAlignment( Qt::AlignTop );
122
masterLayout->setSpacing( 5 );
123
masterLayout->setMargin( 10 );
124
masterPageLabel = new QLabel( groupMaster, "masterPageLabel" );
125
masterPageLabel->setText( tr( "Master Page:" ) );
126
masterLayout->addWidget( masterPageLabel );
127
masterPageComboBox = new QComboBox( false, groupMaster, "masterPageComboBox" );
128
QString Nam = doc->currentPage()->MPageNam;
129
QString na = Nam == CommonStrings::masterPageNormal ? CommonStrings::trMasterPageNormal : Nam, in;
131
for (QMap<QString,int>::Iterator it = doc->MasterNames.begin(); it != doc->MasterNames.end(); ++it)
133
in = it.key() == CommonStrings::masterPageNormal ? CommonStrings::trMasterPageNormal : it.key();
134
masterPageComboBox->insertItem(in);
136
masterPageComboBox->setCurrentItem(cc);
139
masterLayout->addWidget( masterPageComboBox );
140
dialogLayout->addWidget( groupMaster );
141
if (doc->masterPageMode())
116
144
okCancelLayout = new QHBoxLayout;
117
145
okCancelLayout->setSpacing( 6 );
118
146
okCancelLayout->setMargin( 0 );
146
174
connect(sizeQComboBox, SIGNAL(activated(const QString &)), this, SLOT(setPageSize()));
147
175
connect(widthMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
148
176
connect(heightMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
149
179
setMinimumSize(minimumSizeHint());
150
180
setMaximumSize(minimumSizeHint());
151
181
resize(minimumSizeHint());
175
207
widthMSpinBox->setEnabled(false);
176
208
heightMSpinBox->setEnabled(false);
177
209
PageSize *ps2 = new PageSize(gr);
178
prefsPageSizeName = ps2->getPageName();
179
if (gr == tr("Custom"))
210
prefsPageSizeName = ps2->name();
211
if (gr == CommonStrings::trCustomPageSize)
181
213
widthMSpinBox->setEnabled(true);
182
214
heightMSpinBox->setEnabled(true);
215
prefsPageSizeName = CommonStrings::customPageSize;
186
pageWidth = ps2->getPageWidth();
187
pageHeight = ps2->getPageHeight();
219
pageWidth = ps2->width();
220
pageHeight = ps2->height();
189
222
disconnect(widthMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
190
223
disconnect(heightMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
192
225
heightMSpinBox->setValue(pageHeight * unitRatio);
193
226
GroupRand->setPageHeight(pageHeight);
194
227
GroupRand->setPageWidth(pageWidth);
228
GroupRand->setPageSize(gr);
195
229
connect(widthMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
196
230
connect(heightMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
203
237
setSize(sizeQComboBox->currentText());
204
238
disconnect(widthMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageWidth(int)));
205
239
disconnect(heightMSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPageHeight(int)));
206
if ((sizeQComboBox->currentText() == tr("Custom")) && (ori != oldOri))
240
if ((sizeQComboBox->currentText() == CommonStrings::trCustomPageSize) && (ori != oldOri))
208
242
br = widthMSpinBox->value();
209
243
widthMSpinBox->setValue(heightMSpinBox->value());