20 #include "cupsddirpage.h"
21 #include "cupsdconf.h"
22 #include "qdirlineedit.h"
23 #include "qdirmultilineedit.h"
27 #include <tqwhatsthis.h>
29 #include <tdelocale.h>
31 CupsdDirPage::CupsdDirPage(TQWidget *parent,
const char *name)
32 : CupsdPage(parent, name)
34 setPageLabel(i18n(
"Folders"));
35 setHeader(i18n(
"Folders Settings"));
38 datadir_ =
new QDirLineEdit(
false,
this);
39 documentdir_ =
new QDirLineEdit(
false,
this);
40 fontpath_ =
new QDirMultiLineEdit(
this);
41 requestdir_ =
new QDirLineEdit(
false,
this);
42 serverbin_ =
new QDirLineEdit(
false,
this);
43 serverfiles_ =
new QDirLineEdit(
false,
this);
44 tmpfiles_ =
new QDirLineEdit(
false,
this);
46 TQLabel *l1 =
new TQLabel(i18n(
"Data folder:"),
this);
47 TQLabel *l2 =
new TQLabel(i18n(
"Document folder:"),
this);
48 TQLabel *l3 =
new TQLabel(i18n(
"Font path:"),
this);
49 TQLabel *l4 =
new TQLabel(i18n(
"Request folder:"),
this);
50 TQLabel *l5 =
new TQLabel(i18n(
"Server binaries:"),
this);
51 TQLabel *l6 =
new TQLabel(i18n(
"Server files:"),
this);
52 TQLabel *l7 =
new TQLabel(i18n(
"Temporary files:"),
this);
54 TQGridLayout *m1 =
new TQGridLayout(
this, 8, 2, 10, 7);
55 m1->setRowStretch(7, 1);
56 m1->setColStretch(1, 1);
57 m1->addWidget(l1, 0, 0, TQt::AlignRight);
58 m1->addWidget(l2, 1, 0, TQt::AlignRight);
59 m1->addWidget(l3, 2, 0, TQt::AlignRight|TQt::AlignTop);
60 m1->addWidget(l4, 3, 0, TQt::AlignRight);
61 m1->addWidget(l5, 4, 0, TQt::AlignRight);
62 m1->addWidget(l6, 5, 0, TQt::AlignRight);
63 m1->addWidget(l7, 6, 0, TQt::AlignRight);
64 m1->addWidget(datadir_, 0, 1);
65 m1->addWidget(documentdir_, 1, 1);
66 m1->addWidget(fontpath_, 2, 1);
67 m1->addWidget(requestdir_, 3, 1);
68 m1->addWidget(serverbin_, 4, 1);
69 m1->addWidget(serverfiles_, 5, 1);
70 m1->addWidget(tmpfiles_, 6, 1);
73 bool CupsdDirPage::loadConfig(CupsdConf *conf, TQString&)
76 datadir_->setURL(conf_->datadir_);
77 documentdir_->setURL(conf_->documentdir_);
78 fontpath_->setURLs(conf_->fontpath_);
79 requestdir_->setURL(conf_->requestdir_);
80 serverbin_->setURL(conf_->serverbin_);
81 serverfiles_->setURL(conf_->serverfiles_);
82 tmpfiles_->setURL(conf_->tmpfiles_);
87 bool CupsdDirPage::saveConfig(CupsdConf *conf, TQString&)
89 conf->datadir_ = datadir_->url();
90 conf->documentdir_ = documentdir_->url();
91 conf->fontpath_ = fontpath_->urls();
92 conf->requestdir_ = requestdir_->url();
93 conf->serverbin_ = serverbin_->url();
94 conf->serverfiles_ = serverfiles_->url();
95 conf->tmpfiles_ = tmpfiles_->url();
100 void CupsdDirPage::setInfos(CupsdConf *conf)
102 TQWhatsThis::add(datadir_, conf->comments_.toolTip(
"datadir"));
103 TQWhatsThis::add(documentdir_, conf->comments_.toolTip(
"documentroot"));
104 TQWhatsThis::add(fontpath_, conf->comments_.toolTip(
"fontpath"));
105 TQWhatsThis::add(requestdir_, conf->comments_.toolTip(
"requestroot"));
106 TQWhatsThis::add(serverbin_, conf->comments_.toolTip(
"serverbin"));
107 TQWhatsThis::add(serverfiles_, conf->comments_.toolTip(
"serverroot"));
108 TQWhatsThis::add(tmpfiles_, conf->comments_.toolTip(
"tempdir"));