kchart
kchartPrinterDlg.cc00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <qlayout.h>
00025
00026
00027 #include <kdebug.h>
00028 #include <kdialog.h>
00029 #include <klocale.h>
00030
00031
00032 #include "kchartPrinterDlg.h"
00033 namespace KChart
00034 {
00035
00036 KChartPrinterDlg::KChartPrinterDlg( QWidget *parent, const char *name )
00037 : KPrintDialogPage( parent, name )
00038 {
00039 setTitle( i18n( "KChart Options" ) );
00040 QVBoxLayout *layout = new QVBoxLayout( this );
00041 layout->setMargin( KDialog::marginHint() );
00042 layout->setSpacing( KDialog::spacingHint() );
00043 txtSizex = new KIntNumInput(this );
00044 txtSizex->setSuffix("%");
00045 txtSizex->setMinValue(1);
00046 txtSizex->setMaxValue(100);
00047 txtSizex->setValue(100);
00048 txtSizey = new KIntNumInput(this );
00049 txtSizey->setSuffix("%");
00050 txtSizey->setMinValue(1);
00051 txtSizey->setMaxValue(100);
00052 txtSizey->setValue(100);
00053
00054 layout->addWidget( new QLabel(i18n("Print Size"), this) );
00055 layout->addWidget( new QLabel(i18n("Width: "), this) );
00056 layout->addWidget( txtSizex );
00057 layout->addWidget( new QLabel(i18n("Height: "), this) );
00058 layout->addWidget( txtSizey );
00059 layout->addStretch( 1 );
00060 }
00061
00062 void KChartPrinterDlg::getOptions( QMap<QString, QString>& opts, bool )
00063 {
00064 opts["kde-kchart-printsizex"] = QString::number(txtSizex->value());
00065 opts["kde-kchart-printsizey"] = QString::number(txtSizey->value());
00066 }
00067
00068 void KChartPrinterDlg::setOptions( const QMap<QString, QString>& opts )
00069 {
00070 if ( opts["kde-kchart-printsizex"].isEmpty() )
00071 txtSizex->setValue(100);
00072 else
00073 txtSizex->setValue((opts["kde-kchart-printsizex"]).toInt());
00074 if ( opts["kde-kchart-printsizey"].isEmpty() )
00075 txtSizey->setValue(100);
00076 else
00077 txtSizey->setValue((opts["kde-kchart-printsizey"]).toInt());
00078 }
00079
00080 bool KChartPrinterDlg::isValid( const QString& )
00081 {
00082 return true;
00083 }
00084 }
00085 #include "kchartPrinterDlg.moc"
|