Subversion Repositories Scribus

Compare Revisions

Regard whitespace Rev 550 → Rev 552

/branches/Version13x/Scribus/scribus/plugins/pixmapexport/dialog.cpp
54,6 → 54,8
groupBox1Layout->addWidget( textLabel1, 1, 0 );
textLabel3 = new QLabel( groupBox1, "textLabel3" );
groupBox1Layout->addWidget( textLabel3, 2, 0 );
textLabel4 = new QLabel( groupBox1, "textLabel4" );
groupBox1Layout->addWidget( textLabel4, 3, 0 );
BitmapType = new QComboBox( FALSE, groupBox1, "BitmapType" );
BitmapType->clear();
BitmapType->insertStrList(QImageIO::outputFormats());
65,11 → 67,16
QualityBox->setMinValue( 1 );
QualityBox->setValue(quality);
groupBox1Layout->addWidget( QualityBox, 1, 1 );
SizeBox = new QSpinBox( groupBox1, "SizeBox" );
SizeBox->setMaxValue( 2400 );
SizeBox->setMinValue( 1 );
SizeBox->setValue(size);
groupBox1Layout->addWidget( SizeBox, 2, 1 );
DPIBox = new QSpinBox( groupBox1, "DPIBox" );
DPIBox->setMaxValue( 2400 );
DPIBox->setMinValue( 1 );
DPIBox->setValue(size);
groupBox1Layout->addWidget( DPIBox, 2, 1 );
EnlargementBox = new QSpinBox( groupBox1, "EnlargementBox" );
EnlargementBox->setMaxValue( 2400 );
EnlargementBox->setMinValue( 1 );
EnlargementBox->setValue(size);
groupBox1Layout->addWidget( EnlargementBox, 3, 1 );
layout3->addWidget( groupBox1 );
 
ButtonGroup1 = new QButtonGroup( this, "ButtonGroup1" );
109,7 → 116,8
TextLabel1->setBuddy( OutputDirectory );
TextLabel2->setBuddy( BitmapType );
textLabel1->setBuddy( QualityBox );
textLabel3->setBuddy( SizeBox );
textLabel3->setBuddy( DPIBox );
textLabel4->setBuddy( EnlargementBox );
connect(OutputDirectoryButton, SIGNAL(clicked()), this, SLOT(OutputDirectoryButton_pressed()));
connect(OkButton, SIGNAL(clicked()), this, SLOT(OkButton_pressed()));
connect(CancelButton, SIGNAL(clicked()), this, SLOT(reject()));
172,8 → 180,10
TextLabel2->setText( tr( "Image &Type:" ) );
textLabel1->setText( tr( "&Quality:" ) );
textLabel3->setText( tr( "&Resolution:" ) );
textLabel4->setText( tr( "&Size:" ) );
QualityBox->setSuffix( tr( " %" ) );
SizeBox->setSuffix( tr( " dpi" ) );
DPIBox->setSuffix( tr( " dpi" ) );
EnlargementBox->setSuffix( tr( " %" ) );
ButtonGroup1->setTitle( tr( "Range" ) );
OnePageRadio->setText( tr( "&Current page" ) );
AllPagesRadio->setText( tr( "&All pages" ) );
185,7 → 195,8
QToolTip::add( RangeVal, tr( "Insert a comma separated list of tokens where\na token can be * for all the pages, 1-5 for\na range of pages or a single page number." ) );
QToolTip::add( AllPagesRadio, tr( "Export all pages" ) );
QToolTip::add( OnePageRadio, tr( "Export only the current page" ) );
QToolTip::add( SizeBox, tr( "Resolution of the Images\nUse 72 dpi for Images intended for the Screen" ) );
QToolTip::add( DPIBox, tr( "Resolution of the Images\nUse 72 dpi for Images intended for the Screen" ) );
QToolTip::add( EnlargementBox, tr( "Size of the images. 100% for no changes, 200% for two times larger etc." ));
QToolTip::add( QualityBox, tr( "The quality of your images - 100% is the best, 1% the lowest quality" ) );
QToolTip::add( BitmapType, tr( "Available export formats" ) );
QToolTip::add( OutputDirectory, tr( "The output directory - the place to store your images.\nName of the export file will be 'documentname-pagenumber.filetype'" ) );
195,7 → 206,8
 
void ExportForm::readConfig()
{
SizeBox->setValue(prefs->getUInt("SizeBox", 72));
DPIBox->setValue(prefs->getUInt("DPIBox", 72));
EnlargementBox->setValue(prefs->getUInt("EnlargementBox", 100));
QualityBox->setValue(prefs->getUInt("QualityBox", 100));
ButtonGroup1->setButton(prefs->getUInt("ButtonGroup1", 0));
if (prefs->getInt("ButtonGroup1")==2)
208,7 → 220,8
 
void ExportForm::writeConfig()
{
prefs->set("SizeBox", SizeBox->value());
prefs->set("DPIBox", DPIBox->value());
prefs->set("EnlargementBox", EnlargementBox->value());
prefs->set("QualityBox", QualityBox->value());
prefs->set("ButtonGroup1", ButtonGroup1->id(ButtonGroup1->selected()));
prefs->set("BitmapType",BitmapType->currentItem());
/branches/Version13x/Scribus/scribus/plugins/pixmapexport/export.cpp
38,7 → 38,8
{
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
std::vector<int> pageNs;
ex->pageSize = dia->SizeBox->value();
ex->pageSize = dia->DPIBox->value();
ex->enlargement = dia->EnlargementBox->value();
ex->quality = dia->QualityBox->value();
ex->exportDir = dia->OutputDirectory->text();
ex->bitmapType = dia->bitmapType;
76,6 → 77,7
carrier = plug;
pageSize = 72;
quality = 100;
enlargement = 100;
exportDir = QDir::currentDirPath();
bitmapType = QString("PNG");
overwrite = FALSE;
102,7 → 104,7
if (!carrier->doc->Pages.at(pageNr))
return FALSE;
 
QPixmap pixmap = carrier->view->PageToPixmap(pageNr, qRound(carrier->doc->PageH * (pageSize / 72.0)));
QPixmap pixmap = carrier->view->PageToPixmap(pageNr, qRound(carrier->doc->PageH * enlargement / 100));
QImage im = pixmap.convertToImage();
int dpi = qRound(100.0 / 2.54 * pageSize);
im.setDotsPerMeterY(dpi);
/branches/Version13x/Scribus/scribus/plugins/pixmapexport/dialog.h
34,9 → 34,11
QLabel* TextLabel2;
QLabel* textLabel1;
QLabel* textLabel3;
QLabel* textLabel4;
QComboBox* BitmapType;
QSpinBox* QualityBox;
QSpinBox* SizeBox;
QSpinBox* DPIBox;
QSpinBox* EnlargementBox;
QButtonGroup* ButtonGroup1;
QRadioButton* OnePageRadio;
QRadioButton* AllPagesRadio;
/branches/Version13x/Scribus/scribus/plugins/pixmapexport/export.h
37,6 → 37,8
QString bitmapType;
/*! Height of the page - exported image */
int pageSize;
/*! Enlargement of the exported image... 2x 3x etc. */
int enlargement;
/*! Quality of the image <0; 100> */
int quality;
/*! A place for stored images */