tdeprint
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 <tqcombobox.h>
00024 #include <tqlabel.h>
00025 #include <tqlayout.h>
00026 #include <tqgroupbox.h>
00027 #include <tdelocale.h>
00028 #include <tdeconfig.h>
00029
00030 KMConfigLpr::KMConfigLpr(TQWidget *parent, const char *name)
00031 : KMConfigPage(parent, name)
00032 {
00033 setPageName(i18n("Spooler"));
00034 setPageHeader(i18n("Spooler Settings"));
00035 setPagePixmap("gear");
00036
00037 TQGroupBox *m_modebox = new TQGroupBox(1, Qt::Vertical, i18n("Spooler"), this);
00038
00039 m_mode = new TQComboBox(m_modebox);
00040 m_mode->insertItem("LPR (BSD compatible)");
00041 m_mode->insertItem("LPRng");
00042
00043 TQVBoxLayout *l0 = new TQVBoxLayout(this, 5, 10);
00044 l0->addWidget(m_modebox);
00045 l0->addStretch(1);
00046 }
00047
00048 void KMConfigLpr::loadConfig(TDEConfig*)
00049 {
00050 m_mode->setCurrentItem(LprSettings::self()->mode());
00051 }
00052
00053 void KMConfigLpr::saveConfig(TDEConfig *conf)
00054 {
00055 LprSettings::self()->setMode((LprSettings::Mode)(m_mode->currentItem()));
00056
00057 TQString 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 }