20 #include "kmconfigcupsdir.h"
22 #include <tqcheckbox.h>
23 #include <kurlrequester.h>
24 #include <tdelocale.h>
26 #include <tdeconfig.h>
27 #include <tqgroupbox.h>
31 KMConfigCupsDir::KMConfigCupsDir(TQWidget *parent)
32 : KMConfigPage(parent,
"ConfigCupsDir")
34 setPageName(i18n(
"Folder"));
35 setPageHeader(i18n(
"CUPS Folder Settings"));
36 setPagePixmap(
"folder");
38 TQGroupBox *m_dirbox =
new TQGroupBox(0, TQt::Vertical, i18n(
"Installation Folder"),
this);
39 m_installdir =
new KURLRequester(m_dirbox);
40 m_installdir->setMode((KFile::Mode)(KFile::Directory|KFile::ExistingOnly|KFile::LocalOnly));
41 m_stddir =
new TQCheckBox(i18n(
"Standard installation (/)"), m_dirbox);
42 m_stddir->setCursor(KCursor::handCursor());
44 TQVBoxLayout *lay0 =
new TQVBoxLayout(
this, 0, KDialog::spacingHint());
45 lay0->addWidget(m_dirbox);
47 TQVBoxLayout *lay1 =
new TQVBoxLayout(m_dirbox->layout(), 10);
48 lay1->addWidget(m_stddir);
49 lay1->addWidget(m_installdir);
51 connect(m_stddir,TQ_SIGNAL(toggled(
bool)),m_installdir,TQ_SLOT(setDisabled(
bool)));
52 m_stddir->setChecked(
true);
55 void KMConfigCupsDir::loadConfig(TDEConfig *conf)
57 conf->setGroup(
"CUPS");
58 TQString dir = conf->readPathEntry(
"InstallDir");
59 m_stddir->setChecked(dir.isEmpty());
60 m_installdir->setURL(dir);
63 void KMConfigCupsDir::saveConfig(TDEConfig *conf)
65 conf->setGroup(
"CUPS");
66 conf->writePathEntry(
"InstallDir",(m_stddir->isChecked() ? TQString::null : m_installdir->url()));