cupsdbrowsinggeneralpage.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "cupsdbrowsinggeneralpage.h"
00021
00022 #include <klocale.h>
00023 #include <qlayout.h>
00024 #include <qcheckbox.h>
00025 #include <qlabel.h>
00026 #include <qwhatsthis.h>
00027
00028 #include <kseparator.h>
00029
00030 #include "cupsdconf.h"
00031 #include "cupsdoption.h"
00032
00033 CupsdBrowsingGeneralPage::CupsdBrowsingGeneralPage(QWidget *parent, const char *name)
00034 : CupsdPage(parent, name)
00035 {
00036 path_.append(i18n("Browsing"));
00037
00038 header_ = i18n("Browsing General Configuration");
00039
00040 for (int i=0;i<5;i++)
00041 opt_[i] = new CupsdOption(this);
00042
00043 browsing_ = new QCheckBox(i18n("Enable browsing"), opt_[0]);
00044 browseshortnames_ = new QCheckBox(i18n("Use short names when possible"), opt_[1]);
00045
00046 KSeparator *sep = new KSeparator(KSeparator::HLine, this);
00047 sep->setFixedHeight(25);
00048
00049 implicitclasses_ = new QCheckBox(i18n("Use implicit classes"), opt_[2]);
00050 implicitanyclasses_ = new QCheckBox(i18n("Create \"Any\" implicit classes when needed"), opt_[3]);
00051 hideimplicitmembers_ = new QCheckBox(i18n("Hide members of implicit classes"), opt_[4]);
00052
00053 QVBoxLayout *main_ = new QVBoxLayout(this, 10, 10);
00054 main_->addWidget(deflabel_, 0, Qt::AlignRight|Qt::AlignVCenter);
00055 main_->addWidget(opt_[0]);
00056 main_->addWidget(opt_[1]);
00057 main_->addWidget(sep);
00058 main_->addWidget(opt_[2]);
00059 main_->addWidget(opt_[3]);
00060 main_->addWidget(opt_[4]);
00061 main_->addStretch(1);
00062 }
00063
00064 CupsdBrowsingGeneralPage::~CupsdBrowsingGeneralPage()
00065 {
00066 }
00067
00068 bool CupsdBrowsingGeneralPage::loadConfig(CupsdConf *conf, QString&)
00069 {
00070 conf_ = conf;
00071 if (conf->browsing_ != -1)
00072 {
00073 opt_[0]->setDefault(0);
00074 browsing_->setChecked(conf->browsing_ == 1);
00075 }
00076 if (conf->browseshortnames_ != -1)
00077 {
00078 opt_[1]->setDefault(0);
00079 browseshortnames_->setChecked(conf->browseshortnames_ == 1);
00080 }
00081 if (conf->implicitclasses_ != -1)
00082 {
00083 opt_[2]->setDefault(0);
00084 implicitclasses_->setChecked(conf->implicitclasses_ == 1);
00085 }
00086 if (conf->implicitanyclasses_ != -1)
00087 {
00088 opt_[3]->setDefault(0);
00089 implicitanyclasses_->setChecked(conf->implicitanyclasses_ == 1);
00090 }
00091 if (conf->hideimplicitmembers_ != -1)
00092 {
00093 opt_[4]->setDefault(0);
00094 hideimplicitmembers_->setChecked(conf->hideimplicitmembers_ == 1);
00095 }
00096 return true;
00097 }
00098
00099 bool CupsdBrowsingGeneralPage::saveConfig(CupsdConf *conf, QString&)
00100 {
00101 if (!opt_[0]->isDefault()) conf->browsing_ = (browsing_->isChecked() ? 1 : 0);
00102 if (!opt_[1]->isDefault()) conf->browseshortnames_ = (browseshortnames_->isChecked() ? 1 : 0);
00103 if (!opt_[2]->isDefault()) conf->implicitclasses_ = (implicitclasses_->isChecked() ? 1 : 0);
00104 if (!opt_[3]->isDefault()) conf->implicitanyclasses_ = (implicitanyclasses_->isChecked() ? 1 : 0);
00105 if (!opt_[4]->isDefault()) conf->hideimplicitmembers_ = (hideimplicitmembers_->isChecked() ? 1 : 0);
00106 return true;
00107 }
00108
00109 void CupsdBrowsingGeneralPage::setDefaults()
00110 {
00111 browsing_->setChecked(true);
00112 browseshortnames_->setChecked(true);
00113 implicitclasses_->setChecked(true);
00114 implicitanyclasses_->setChecked(false);
00115 hideimplicitmembers_->setChecked(true);
00116 }
00117
00118 void CupsdBrowsingGeneralPage::setInfos(CupsdConf *conf)
00119 {
00120 QWhatsThis::add(browsing_, conf->comments_.toolTip(BROWSING_COMM));
00121 QWhatsThis::add(browseshortnames_, conf->comments_.toolTip(BROWSESHORTNAMES_COMM));
00122 QWhatsThis::add(implicitclasses_, conf->comments_.toolTip(IMPLICITCLASSES_COMM));
00123 QWhatsThis::add(implicitanyclasses_, conf->comments_.toolTip(IMPLICITANYCLASSES_COMM));
00124 QWhatsThis::add(hideimplicitmembers_, conf->comments_.toolTip(HIDEIMPLICITMEMBERS_COMM));
00125 }
This file is part of the documentation for kdeprint Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Sep 23 17:12:53 2004 by
doxygen 1.3.8-20040913 written by
Dimitri van Heesch, © 1997-2003