You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdeedu/kmplot/kmplot/kprinterdlg.cpp

72 lines
2.3 KiB

/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* 2000, 2002 kd.moeller@t-online.de
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
// TQt includes
#include <tqlayout.h>
// KDE includes
#include <kdialog.h>
#include <tdelocale.h>
// local includes
#include "kprinterdlg.h"
KPrinterDlg::KPrinterDlg( TQWidget *parent, const char *name )
: KPrintDialogPage( parent, name )
{
setTitle( i18n( "KmPlot Options" ) );
TQVBoxLayout *layout = new TQVBoxLayout( this );
layout->setMargin( KDialog::marginHint() );
layout->setSpacing( KDialog::spacingHint() );
printHeaderTable = new TQCheckBox( i18n( "Print header table" ), this );
transparent_background = new TQCheckBox( i18n( "Transparent background" ), this );
layout->addWidget( printHeaderTable );
layout->addWidget( transparent_background );
layout->addStretch( 1 );
}
void KPrinterDlg::getOptions( TQMap<TQString, TQString>& opts, bool include_def )
{
if ( include_def || !printHeaderTable->isChecked() )
opts[ "app-kmplot-printtable" ] = ( printHeaderTable->isChecked() ? "1" : "-1" );
if ( include_def || !transparent_background->isChecked() )
opts[ "app-kmplot-printbackground" ] = ( transparent_background->isChecked() ? "1" : "-1" );
}
void KPrinterDlg::setOptions( const TQMap<TQString, TQString>& opts )
{
printHeaderTable->setChecked( opts[ "app-kmplot-printtable" ] != "-1" );
transparent_background->setChecked( opts[ "app-kmplot-printbackground" ] != "-1" );
}
bool KPrinterDlg::isValid( const TQString& )
{
return true;
}
#include "kprinterdlg.moc"