kmconfiglpr.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
#include "kmconfiglpr.h"
00021
#include "lprsettings.h"
00022
00023
#include <qcombobox.h>
00024
#include <qlabel.h>
00025
#include <qlayout.h>
00026
#include <qgroupbox.h>
00027
#include <klocale.h>
00028
#include <kconfig.h>
00029
00030 KMConfigLpr::KMConfigLpr(
QWidget *parent,
const char *name)
00031 : KMConfigPage(parent, name)
00032 {
00033 setPageName(i18n(
"Spooler"));
00034 setPageHeader(i18n(
"Spooler Settings"));
00035 setPagePixmap(
"gear");
00036
00037
QGroupBox *m_modebox =
new QGroupBox(1, Qt::Vertical, i18n(
"Spooler"),
this);
00038
00039 m_mode =
new QComboBox(m_modebox);
00040 m_mode->insertItem(
"LPR (BSD compatible)");
00041 m_mode->insertItem(
"LPRng");
00042
00043
QVBoxLayout *l0 =
new QVBoxLayout(
this, 5, 10);
00044 l0->addWidget(m_modebox);
00045 l0->addStretch(1);
00046 }
00047
00048
void KMConfigLpr::loadConfig(KConfig*)
00049 {
00050 m_mode->setCurrentItem(LprSettings::self()->mode());
00051 }
00052
00053
void KMConfigLpr::saveConfig(KConfig *conf)
00054 {
00055 LprSettings::self()->setMode((LprSettings::Mode)(m_mode->currentItem()));
00056
00057
QString modestr;
00058
switch (m_mode->currentItem())
00059 {
00060
default:
00061
case 0: modestr =
"LPR";
break;
00062
case 1: modestr =
"LPRng";
break;
00063 }
00064 conf->setGroup(
"LPR");
00065 conf->writeEntry(
"Mode", modestr);
00066 }
This file is part of the documentation for kdeprint Library Version 3.3.1.