Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Public Slots | Public Member Functions | Public Attributes | Protected Slots | Protected Attributes
ExportForm Class Reference

#include <dialog.h>

List of all members.

Public Slots

virtual void OutputDirectoryButton_pressed ()
virtual void OkButton_pressed ()
virtual void IntervalPagesRadio_stateChanged (int)
virtual void AllPagesRadio_stateChanged (int)
virtual void OnePageRadio_stateChanged (int)
virtual void computeSize ()

Public Member Functions

 ExportForm (QWidget *parent, ScribusDoc *doc, int size, int quality, QString type)
 ~ExportForm ()

Public Attributes

QString bitmapType
QLabel * TextLabel1
QLineEdit * OutputDirectory
QPushButton * OutputDirectoryButton
QGroupBox * groupBox1
QLabel * TextLabel2
QLabel * textLabel1
QLabel * textLabel3
QLabel * textLabel4
QLabel * textLabel5
QLabel * textLabel6
QComboBox * BitmapType
QSpinBox * QualityBox
QSpinBox * DPIBox
MSpinBox * EnlargementBox
QButtonGroup * ButtonGroup1
QRadioButton * OnePageRadio
QRadioButton * AllPagesRadio
QRadioButton * IntervalPagesRadio
QLineEdit * RangeVal
QPushButton * OkButton
QPushButton * CancelButton

Protected Slots

virtual void createPageNumberRange ()
virtual void languageChange ()
virtual void readConfig ()
virtual void writeConfig ()

Protected Attributes

QVBoxLayout * ExportFormLayout
QHBoxLayout * layout1
QHBoxLayout * layout3
QGridLayout * groupBox1Layout
QVBoxLayout * ButtonGroup1Layout
QHBoxLayout * layout2
QHBoxLayout * layout4
QHBoxLayout * pageNumberSelectorLayout
QPushButton * pageNrButton
PrefsContext * prefs
ScribusDoc * m_doc
int m_PageCount

Detailed Description

Definition at line 28 of file dialog.h.


Constructor & Destructor Documentation

ExportForm::ExportForm ( QWidget *  parent,
ScribusDoc *  doc,
int  size,
int  quality,
QString  type 
)

Definition at line 41 of file dialog.cpp.

       : QDialog(parent, "ExportForm", true, 0), m_doc(doc), m_PageCount(doc->DocPages.count())
{
       prefs = PrefsManager::instance()->prefsFile->getPluginContext("pixmapexport");
       ExportFormLayout = new QVBoxLayout( this, 10, 5, "ExportFormLayout");
       layout1 = new QHBoxLayout( 0, 0, 5, "layout1");
       TextLabel1 = new QLabel( this, "TextLabel1" );
       layout1->addWidget( TextLabel1 );
       OutputDirectory = new QLineEdit( this, "OutputDirectory" );
       OutputDirectory->setText( QDir::convertSeparators(prefs->get("wdir", QDir::currentDirPath())) );
       layout1->addWidget( OutputDirectory );
       OutputDirectoryButton = new QPushButton( this, "OutputDirectoryButton" );
       OutputDirectoryButton->setDefault( true );
       layout1->addWidget( OutputDirectoryButton );
       ExportFormLayout->addLayout( layout1 );

       layout3 = new QHBoxLayout( 0, 0, 5, "layout3");
       groupBox1 = new QGroupBox( this, "groupBox1" );
       groupBox1->setColumnLayout(0, Qt::Vertical );
       groupBox1->layout()->setSpacing( 5 );
       groupBox1->layout()->setMargin( 10 );
       groupBox1Layout = new QGridLayout( groupBox1->layout() );
       groupBox1Layout->setAlignment( Qt::AlignTop );
       TextLabel2 = new QLabel( groupBox1, "TextLabel2" );
       groupBox1Layout->addWidget( TextLabel2, 0, 0 );
       textLabel1 = new QLabel( groupBox1, "textLabel1" );
       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());
       BitmapType->setCurrentText(type);
       BitmapType->setEditable(false);
       groupBox1Layout->addMultiCellWidget( BitmapType, 0, 0, 1, 2 );
       QualityBox = new QSpinBox( groupBox1, "QualityBox" );
       QualityBox->setMaxValue( 100 );
       QualityBox->setMinValue( 1 );
       QualityBox->setValue(quality);
       groupBox1Layout->addWidget( QualityBox, 1, 1 );
       DPIBox = new QSpinBox( groupBox1, "DPIBox" );
       DPIBox->setMaxValue( 2400 );
       DPIBox->setMinValue( 72 );
       DPIBox->setValue(size);
       groupBox1Layout->addWidget( DPIBox, 2, 1 );
       EnlargementBox = new MSpinBox( groupBox1, 1 );
       EnlargementBox->setMaxValue( 2400 );
       EnlargementBox->setMinValue( 1 );
       EnlargementBox->setValue(size);
       groupBox1Layout->addWidget( EnlargementBox, 3, 1 );
       textLabel5 = new QLabel( groupBox1, "textLabel5" );
       groupBox1Layout->addMultiCellWidget( textLabel5, 4, 4, 0, 2 );
       textLabel6 = new QLabel( groupBox1, "textLabel6" );
       groupBox1Layout->addMultiCellWidget( textLabel6, 5, 5, 0, 2 );
       layout3->addWidget( groupBox1 );

       ButtonGroup1 = new QButtonGroup( this, "ButtonGroup1" );
       ButtonGroup1->setColumnLayout(0, Qt::Vertical );
       ButtonGroup1->layout()->setSpacing( 5 );
       ButtonGroup1->layout()->setMargin( 10 );
       ButtonGroup1Layout = new QVBoxLayout( ButtonGroup1->layout() );
       ButtonGroup1Layout->setAlignment( Qt::AlignTop );
       OnePageRadio = new QRadioButton( ButtonGroup1, "OnePageRadio" );
       OnePageRadio->setChecked( true );
       ButtonGroup1Layout->addWidget( OnePageRadio );
       AllPagesRadio = new QRadioButton( ButtonGroup1, "AllPagesRadio" );
       ButtonGroup1Layout->addWidget( AllPagesRadio );
       layout2 = new QHBoxLayout( 0, 0, 5, "layout2");
       IntervalPagesRadio = new QRadioButton( ButtonGroup1, "IntervalPagesRadio" );
       layout2->addWidget( IntervalPagesRadio );

//     pageNumberSelectorLayout = new QHBoxLayout( 0, 0, 5, "pageNumberSelectorLayout" );
       RangeVal = new QLineEdit( ButtonGroup1, "RangeVal" );
//     pageNumberSelectorLayout->addWidget( RangeVal );
       layout2->addWidget( RangeVal );
       pageNrButton = new QPushButton( QString::fromUtf8("…"), ButtonGroup1, "pageNrButton" );
       pageNrButton->setPixmap(loadIcon("ellipsis.png"));
       layout2->addWidget( pageNrButton );
//     layout2->addLayout( pageNumberSelectorLayout, 2, 1 );
       RangeVal->setEnabled(false);
       pageNrButton->setEnabled(false);
       ButtonGroup1Layout->addLayout( layout2 );
       layout3->addWidget( ButtonGroup1 );
       ExportFormLayout->addLayout( layout3 );

       layout4 = new QHBoxLayout( 0, 0, 5, "layout4");
       QSpacerItem* spacer = new QSpacerItem( 111, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
       layout4->addItem( spacer );
       OkButton = new QPushButton( this, "OkButton" );
       layout4->addWidget( OkButton );
       CancelButton = new QPushButton( this, "CancelButton" );
       layout4->addWidget( CancelButton );
       ExportFormLayout->addLayout( layout4 );
       languageChange();
       readConfig();
       computeSize();
       resize( QSize(447, 206).expandedTo(minimumSizeHint()) );

    // buddies
       TextLabel1->setBuddy( OutputDirectory );
       TextLabel2->setBuddy( BitmapType );
       textLabel1->setBuddy( QualityBox );
       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()));
       connect(IntervalPagesRadio, SIGNAL(stateChanged(int)), this, SLOT(IntervalPagesRadio_stateChanged(int)));
       connect(AllPagesRadio, SIGNAL(stateChanged(int)), this, SLOT(AllPagesRadio_stateChanged(int)));
       connect(OnePageRadio, SIGNAL(stateChanged(int)), this, SLOT(OnePageRadio_stateChanged(int)));
       connect(EnlargementBox, SIGNAL(valueChanged(int)), this, SLOT(computeSize()));
       connect(DPIBox, SIGNAL(valueChanged(int)), this, SLOT(computeSize()));
       connect(pageNrButton, SIGNAL(clicked()), this, SLOT(createPageNumberRange()));
}

Here is the call graph for this function:

Definition at line 212 of file dialog.cpp.

{
       // no need to delete child widgets, Qt does it all for us
}

Member Function Documentation

void ExportForm::AllPagesRadio_stateChanged ( int  ) [virtual, slot]

Definition at line 195 of file dialog.cpp.

{
       RangeVal->setEnabled(false);
       pageNrButton->setEnabled(false);
       computeSize();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void ExportForm::computeSize ( ) [virtual, slot]

Definition at line 158 of file dialog.cpp.

{
       double pixmapSize;
       double pw = (OnePageRadio->isOn() && m_doc->currentPage()) ? m_doc->currentPage()->width() : m_doc->pageWidth;
       double ph = (OnePageRadio->isOn() && m_doc->currentPage()) ? m_doc->currentPage()->height() : m_doc->pageHeight;
       (ph > pw) ? pixmapSize = ph : pixmapSize = pw;
       int maxGr = qRound(pixmapSize * EnlargementBox->value() * (DPIBox->value() / 72.0) / 100.0);
       double sc = QMIN(maxGr / pw, maxGr / ph);
       textLabel6->setText(QString("%1 x %2 px").arg(qRound(pw * sc)).arg(qRound(ph * sc)));
}

Here is the caller graph for this function:

void ExportForm::createPageNumberRange ( ) [protected, virtual, slot]

Definition at line 279 of file dialog.cpp.

{
       CreateRange cr(RangeVal->text(), m_PageCount, this);
       if (cr.exec())
       {
              CreateRangeData crData;
              cr.getCreateRangeData(crData);
              RangeVal->setText(crData.pageRange);
       }
}

Here is the caller graph for this function:

Definition at line 188 of file dialog.cpp.

{
       RangeVal->setEnabled(true);
       pageNrButton->setEnabled(true);
       computeSize();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void ExportForm::languageChange ( ) [protected, virtual, slot]

Definition at line 221 of file dialog.cpp.

{
       setCaption( tr( "Export as Image(s)" ) );
       TextLabel1->setText( tr( "&Export to Directory:" ) );
       OutputDirectoryButton->setText( tr( "C&hange..." ) );
       groupBox1->setTitle( tr( "Options" ) );
       TextLabel2->setText( tr( "Image &Type:" ) );
       textLabel1->setText( tr( "&Quality:" ) );
       textLabel3->setText( tr( "&Resolution:" ) );
       textLabel4->setText( tr( "&Size:" ) );
       QualityBox->setSuffix( tr( " %" ) );
       DPIBox->setSuffix( tr( " dpi" ) );
       EnlargementBox->setSuffix( tr( " %" ) );
       ButtonGroup1->setTitle( tr( "Range" ) );
       OnePageRadio->setText( tr( "&Current page" ) );
       AllPagesRadio->setText( tr( "&All pages" ) );
       IntervalPagesRadio->setText( tr( "&Range" ) );
       OkButton->setText( CommonStrings::tr_OK );
       CancelButton->setText( CommonStrings::tr_Cancel );
       CancelButton->setAccel( QKeySequence( tr( "C" ) ) );
       textLabel5->setText( tr("Image size in Pixels"));
       QToolTip::add( IntervalPagesRadio, tr( "Export a range of pages" ) );
       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( 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'" ) );
       QToolTip::add( OutputDirectoryButton, tr( "Change the output directory" ) );
}

Here is the call graph for this function:

Here is the caller graph for this function:

void ExportForm::OkButton_pressed ( ) [virtual, slot]

Definition at line 181 of file dialog.cpp.

{
       bitmapType = BitmapType->currentText();
       writeConfig();
       accept();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void ExportForm::OnePageRadio_stateChanged ( int  ) [virtual, slot]

Definition at line 202 of file dialog.cpp.

{
       RangeVal->setEnabled(false);
       pageNrButton->setEnabled(false);
       computeSize();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 169 of file dialog.cpp.

{
       QString lastDir = prefs->get("wdir", ".");
       QString d = QFileDialog::getExistingDirectory(lastDir, this, "d", tr("Choose a Export Directory"), true);
       if (d.length()>0)
       {
              d = QDir::convertSeparators(d);
              OutputDirectory->setText(d);
              prefs->set("wdir", d);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void ExportForm::readConfig ( ) [protected, virtual, slot]

Definition at line 255 of file dialog.cpp.

{
       DPIBox->setValue(prefs->getUInt("DPIBox", 72));
       EnlargementBox->setValue(prefs->getDouble("EnlargementBox", 100));
       QualityBox->setValue(prefs->getUInt("QualityBox", 100));
       ButtonGroup1->setButton(prefs->getUInt("ButtonGroup1", 0));
       if (prefs->getInt("ButtonGroup1")==2)
              RangeVal->setEnabled(true);
       else
              RangeVal->setEnabled(false);
       BitmapType->setCurrentItem(prefs->getInt("BitmapType", 4));
       RangeVal->setText(prefs->get("RangeVal", ""));
}

Here is the caller graph for this function:

void ExportForm::writeConfig ( ) [protected, virtual, slot]

Definition at line 269 of file dialog.cpp.

{
       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());
       prefs->set("RangeVal", RangeVal->text());
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 54 of file dialog.h.

Definition at line 36 of file dialog.h.

Definition at line 48 of file dialog.h.

QButtonGroup* ExportForm::ButtonGroup1

Definition at line 52 of file dialog.h.

QVBoxLayout* ExportForm::ButtonGroup1Layout [protected]

Definition at line 74 of file dialog.h.

Definition at line 58 of file dialog.h.

QSpinBox* ExportForm::DPIBox

Definition at line 50 of file dialog.h.

Definition at line 51 of file dialog.h.

QVBoxLayout* ExportForm::ExportFormLayout [protected]

Definition at line 70 of file dialog.h.

Definition at line 41 of file dialog.h.

QGridLayout* ExportForm::groupBox1Layout [protected]

Definition at line 73 of file dialog.h.

Definition at line 55 of file dialog.h.

QHBoxLayout* ExportForm::layout1 [protected]

Definition at line 71 of file dialog.h.

QHBoxLayout* ExportForm::layout2 [protected]

Definition at line 75 of file dialog.h.

QHBoxLayout* ExportForm::layout3 [protected]

Definition at line 72 of file dialog.h.

QHBoxLayout* ExportForm::layout4 [protected]

Definition at line 76 of file dialog.h.

ScribusDoc* ExportForm::m_doc [protected]

Definition at line 80 of file dialog.h.

Definition at line 81 of file dialog.h.

QPushButton* ExportForm::OkButton

Definition at line 57 of file dialog.h.

QRadioButton* ExportForm::OnePageRadio

Definition at line 53 of file dialog.h.

Definition at line 39 of file dialog.h.

Definition at line 40 of file dialog.h.

QPushButton* ExportForm::pageNrButton [protected]

Definition at line 78 of file dialog.h.

QHBoxLayout* ExportForm::pageNumberSelectorLayout [protected]

Definition at line 77 of file dialog.h.

PrefsContext* ExportForm::prefs [protected]

Definition at line 79 of file dialog.h.

Definition at line 49 of file dialog.h.

Definition at line 56 of file dialog.h.

Definition at line 38 of file dialog.h.

Definition at line 43 of file dialog.h.

Definition at line 42 of file dialog.h.

Definition at line 44 of file dialog.h.

Definition at line 45 of file dialog.h.

Definition at line 46 of file dialog.h.

Definition at line 47 of file dialog.h.


The documentation for this class was generated from the following files: