khtml_printsettings.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "khtml_printsettings.h"
00021
00022 #include <klocale.h>
00023 #include <qcheckbox.h>
00024 #include <qlayout.h>
00025
00026 KHTMLPrintSettings::KHTMLPrintSettings(QWidget *parent, const char *name)
00027 : KPrintDialogPage(parent, name)
00028 {
00029 setTitle(i18n("HTML Settings"));
00030
00031 m_printfriendly = new QCheckBox(i18n("Printer friendly mode (black text, no background)"), this);
00032 m_printfriendly->setChecked(true);
00033 m_printimages = new QCheckBox(i18n("Print images"), this);
00034 m_printimages->setChecked(true);
00035 m_printheader = new QCheckBox(i18n("Print header"), this);
00036 m_printheader->setChecked(true);
00037
00038 QVBoxLayout *l0 = new QVBoxLayout(this, 0, 10);
00039 l0->addWidget(m_printfriendly);
00040 l0->addWidget(m_printimages);
00041 l0->addWidget(m_printheader);
00042 l0->addStretch(1);
00043 }
00044
00045 KHTMLPrintSettings::~KHTMLPrintSettings()
00046 {
00047 }
00048
00049 void KHTMLPrintSettings::getOptions(QMap<QString,QString>& opts, bool incldef)
00050 {
00051 opts["app-khtml-printfriendly"] = (m_printfriendly->isChecked() ? "true" : "false");
00052 opts["app-khtml-printimages"] = (m_printimages->isChecked() ? "true" : "false");
00053 opts["app-khtml-printheader"] = (m_printheader->isChecked() ? "true" : "false");
00054 }
00055
00056 void KHTMLPrintSettings::setOptions(const QMap<QString,QString>& opts)
00057 {
00058 m_printfriendly->setChecked(opts["app-khtml-printfriendly"] != "false");
00059 m_printimages->setChecked(opts["app-khtml-printimages"] != "false");
00060 m_printheader->setChecked(opts["app-khtml-printheader"] != "false");
00061 }
00062
00063 #include "khtml_printsettings.moc"
This file is part of the documentation for kdelibs Version 3.1.5.