• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeprint
 

tdeprint

  • tdeprint
  • cups
  • cupsdconf2
cupsddirpage.cpp
1 /*
2  * This file is part of the KDE libraries
3  * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License version 2 as published by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB. If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  **/
19 
20 #include "cupsddirpage.h"
21 #include "cupsdconf.h"
22 #include "qdirlineedit.h"
23 #include "qdirmultilineedit.h"
24 
25 #include <tqlabel.h>
26 #include <tqlayout.h>
27 #include <tqwhatsthis.h>
28 
29 #include <tdelocale.h>
30 
31 CupsdDirPage::CupsdDirPage(TQWidget *parent, const char *name)
32  : CupsdPage(parent, name)
33 {
34  setPageLabel(i18n("Folders"));
35  setHeader(i18n("Folders Settings"));
36  setPixmap("folder");
37 
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);
45 
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);
53 
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);
71 }
72 
73 bool CupsdDirPage::loadConfig(CupsdConf *conf, TQString&)
74 {
75  conf_ = conf;
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_);
83 
84  return true;
85 }
86 
87 bool CupsdDirPage::saveConfig(CupsdConf *conf, TQString&)
88 {
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();
96 
97  return true;
98 }
99 
100 void CupsdDirPage::setInfos(CupsdConf *conf)
101 {
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"));
109 }

tdeprint

Skip menu "tdeprint"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeprint

Skip menu "tdeprint"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeprint by doxygen 1.9.1
This website is maintained by Timothy Pearson.