Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 20370 → Rev 20371

/trunk/Scribus/scribus/ui/newmarginwidget.cpp
15,7 → 15,7
: QWidget(parent),
savedPresetItem(PresetLayout::none),
facingPages(false),
usingPreset(true)
m_flags(MarginWidgetFlags)
{
setupUi(this);
 
27,11 → 27,12
{
}
 
void NewMarginWidget::setup(const MarginStruct& margs, int layoutType, int unitIndex, bool showPreset, bool showPrinterMargins)
void NewMarginWidget::setup(const MarginStruct& margs, int layoutType, int unitIndex, int flags)
{
marginData=savedMarginData=margs;
m_unitIndex=unitIndex;
m_unitRatio=unitGetRatioFromIndex(unitIndex);
m_flags=flags;
leftMarginSpinBox->setMaximum(1000);
rightMarginSpinBox->setMaximum(1000);
topMarginSpinBox->setMaximum(1000);
41,8 → 42,7
topMarginSpinBox->init(unitIndex);
bottomMarginSpinBox->init(unitIndex);
updateMarginSpinValues();
usingPreset=showPreset;
if (!showPreset)
if ((m_flags & ShowPreset) == 0)
{
presetLayoutComboBox->blockSignals(true);
presetLayoutComboBox->resize(0,0);
52,7 → 52,7
gridLayout->removeWidget(presetLayoutComboBox);
gridLayout->removeWidget(presetLayoutLabel);
}
if (!showPrinterMargins)
if ((m_flags & ShowPrinterMargins) == 0)
{
printerMarginsPushButton->blockSignals(true);
printerMarginsPushButton->resize(0,0);
76,10 → 76,20
 
void NewMarginWidget::languageChange()
{
topMarginSpinBox->setToolTip( "<qt>" + tr( "Distance between the top margin guide and the edge of the page" ) + "</qt>");
bottomMarginSpinBox->setToolTip( "<qt>" + tr( "Distance between the bottom margin guide and the edge of the page" ) + "</qt>");
leftMarginSpinBox->setToolTip( "<qt>" + tr( "Distance between the left margin guide and the edge of the page. If a double-sided, 3 or 4-fold layout is selected, this margin space can be used to achieve the correct margins for binding.") + "</qt>");
rightMarginSpinBox->setToolTip( "<qt>" + tr( "Distance between the right margin guide and the edge of the page. If a double-sided, 3 or 4-fold layout is selected, this margin space can be used to achieve the correct margins for binding.") + "</qt>");
if (m_flags & MarginWidgetFlags)
{
topMarginSpinBox->setToolTip( "<qt>" + tr( "Distance between the top margin guide and the edge of the page" ) + "</qt>");
bottomMarginSpinBox->setToolTip( "<qt>" + tr( "Distance between the bottom margin guide and the edge of the page" ) + "</qt>");
leftMarginSpinBox->setToolTip( "<qt>" + tr( "Distance between the left margin guide and the edge of the page. If a double-sided, 3 or 4-fold layout is selected, this margin space can be used to achieve the correct margins for binding.") + "</qt>");
rightMarginSpinBox->setToolTip( "<qt>" + tr( "Distance between the right margin guide and the edge of the page. If a double-sided, 3 or 4-fold layout is selected, this margin space can be used to achieve the correct margins for binding.") + "</qt>");
}
else
{
topMarginSpinBox->setToolTip( "<qt>" + tr( "Distance for bleed from the top of the physical page" ) + "</qt>" );
bottomMarginSpinBox->setToolTip( "<qt>" + tr( "Distance for bleed from the bottom of the physical page" ) + "</qt>" );
leftMarginSpinBox->setToolTip( "<qt>" + tr( "Distance for bleed from the left of the physical page" ) + "</qt>" );
rightMarginSpinBox->setToolTip( "<qt>" + tr( "Distance for bleed from the right of the physical page" ) + "</qt>");
}
printerMarginsPushButton->setToolTip( "<qt>" + tr( "Import the margins for the selected page size from the available printers" ) + "</qt>");
}
 
183,7 → 193,7
 
void NewMarginWidget::setPreset()
{
if (!usingPreset)
if ((m_flags & ShowPreset) == 0)
return;
leftMarginSpinBox->blockSignals(true);
rightMarginSpinBox->blockSignals(true);
281,7 → 291,7
 
void NewMarginWidget::setMarginPreset(int p)
{
if (!usingPreset)
if ((m_flags & ShowPreset) == 0)
return;
presetLayoutComboBox->blockSignals(true);
savedPresetItem = p;
/trunk/Scribus/scribus/ui/newmarginwidget.h
20,7 → 20,15
NewMarginWidget(QWidget* parent=0);
~NewMarginWidget();
 
void setup(const MarginStruct& margs, int layoutType, int unitIndex=0, bool showPreset=true, bool showPrinterMargins=true);
enum SetupFlags
{
ShowPreset = 1,
ShowPrinterMargins = 2,
MarginWidgetFlags = 3,
BleedWidgetFlags = 4,
};
 
void setup(const MarginStruct& margs, int layoutType, int unitIndex, int flags = MarginWidgetFlags);
/*! \brief Setup the labels by facing pages option */
void setFacingPages(bool facing, int pagetype = 0);
/*! \brief Setup the spinboxes properties (min/max value etc.) by width */
54,6 → 62,7
MarginStruct savedMarginData;
int savedPresetItem;
bool facingPages;
int m_flags;
int m_unitIndex;
double m_unitRatio;
QString m_pageSize;
60,8 → 69,6
double pageWidth;
double pageHeight;
int pageType;
bool usingPreset;
bool usingPrinterMargins;
};
 
#endif // NEWMARGINWIDGET_H
/trunk/Scribus/scribus/ui/prefs_documentsetup.cpp
164,12 → 164,12
pageOrientationComboBox->blockSignals(false);
pageSizeComboBox->blockSignals(false);
 
marginsWidget->setup(prefsData->docSetupPrefs.margins, prefsData->docSetupPrefs.pagePositioning, prefsData->docSetupPrefs.docUnitIndex, true, true);
marginsWidget->setup(prefsData->docSetupPrefs.margins, prefsData->docSetupPrefs.pagePositioning, prefsData->docSetupPrefs.docUnitIndex, NewMarginWidget::MarginWidgetFlags);
marginsWidget->setPageWidth(prefsData->docSetupPrefs.pageWidth);
marginsWidget->setPageHeight(prefsData->docSetupPrefs.pageHeight);
// marginsWidget->setPageSize(prefsPageSizeName);
marginsWidget->setMarginPreset(prefsData->docSetupPrefs.marginPreset);
bleedsWidget->setup(prefsData->docSetupPrefs.bleeds, prefsData->docSetupPrefs.pagePositioning, prefsData->docSetupPrefs.docUnitIndex, false, false);
bleedsWidget->setup(prefsData->docSetupPrefs.bleeds, prefsData->docSetupPrefs.pagePositioning, prefsData->docSetupPrefs.docUnitIndex, NewMarginWidget::BleedWidgetFlags);
bleedsWidget->setPageWidth(prefsData->docSetupPrefs.pageWidth);
bleedsWidget->setPageHeight(prefsData->docSetupPrefs.pageHeight);
// bleedsWidget->setPageSize(prefsPageSizeName);
/trunk/Scribus/scribus/ui/prefs_pdfexport.cpp
455,7 → 455,7
}
convertSpotsToProcessCheckBox->setChecked(!prefsData->pdfPrefs.UseSpotColors);
 
bleedsWidget->setup(prefsData->pdfPrefs.bleeds, prefsData->docSetupPrefs.pagePositioning, prefsData->docSetupPrefs.docUnitIndex, false, false);
bleedsWidget->setup(prefsData->pdfPrefs.bleeds, prefsData->docSetupPrefs.pagePositioning, prefsData->docSetupPrefs.docUnitIndex, NewMarginWidget::BleedWidgetFlags);
bleedsWidget->setPageWidth(prefsData->docSetupPrefs.pageWidth);
bleedsWidget->setPageHeight(prefsData->docSetupPrefs.pageHeight);
bleedsWidget->setPageSize(prefsData->docSetupPrefs.pageSize);
/trunk/Scribus/scribus/ui/prefs_printer.cpp
87,7 → 87,7
prefs->getDouble("BleedLeft", 0.0));
 
 
bleedsWidget->setup(bleeds, 0, docUnitIndex, false, false);
bleedsWidget->setup(bleeds, 0, docUnitIndex, NewMarginWidget::BleedWidgetFlags);
bleedsWidget->setPageWidth(prefsData->docSetupPrefs.pageWidth);
bleedsWidget->setPageHeight(prefsData->docSetupPrefs.pageHeight);
markLengthSpinBox->setValue(prefs->getDouble("markLength", 20.0) * unitRatio);