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

tdeprint

  • tdeprint
  • cups
  • cupsdconf2
cupsdlogpage.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 "cupsdlogpage.h"
21 #include "cupsdconf.h"
22 #include "qdirlineedit.h"
23 #include "sizewidget.h"
24 
25 #include <tqlabel.h>
26 #include <tqcombobox.h>
27 #include <tqlayout.h>
28 #include <tqwhatsthis.h>
29 
30 #include <tdelocale.h>
31 #include <tdefiledialog.h>
32 
33 CupsdLogPage::CupsdLogPage(TQWidget *parent, const char *name)
34  : CupsdPage(parent, name)
35 {
36  setPageLabel(i18n("Log"));
37  setHeader(i18n("Log Settings"));
38  setPixmap("contents");
39 
40  accesslog_ = new QDirLineEdit(true, this);
41  errorlog_ = new QDirLineEdit(true, this);
42  pagelog_ = new QDirLineEdit(true, this);
43  maxlogsize_ = new SizeWidget(this);
44  loglevel_ = new TQComboBox(this);
45 
46  loglevel_->insertItem(i18n("Detailed Debugging"));
47  loglevel_->insertItem(i18n("Debug Information"));
48  loglevel_->insertItem(i18n("General Information"));
49  loglevel_->insertItem(i18n("Warnings"));
50  loglevel_->insertItem(i18n("Errors"));
51  loglevel_->insertItem(i18n("No Logging"));
52 
53  /*maxlogsize_->setRange(0, 100, 1, true);
54  maxlogsize_->setSteps(1, 5);
55  maxlogsize_->setSpecialValueText(i18n("Unlimited"));
56  maxlogsize_->setSuffix(i18n("MB"));*/
57 
58  TQLabel *l1 = new TQLabel(i18n("Access log:"), this);
59  TQLabel *l2 = new TQLabel(i18n("Error log:"), this);
60  TQLabel *l3 = new TQLabel(i18n("Page log:"), this);
61  TQLabel *l4 = new TQLabel(i18n("Max log size:"), this);
62  TQLabel *l5 = new TQLabel(i18n("Log level:"), this);
63 
64  loglevel_->setCurrentItem(2);
65 
66  TQGridLayout *m1 = new TQGridLayout(this, 6, 2, 10, 7);
67  m1->setRowStretch(5, 1);
68  m1->setColStretch(1, 1);
69  m1->addWidget(l1, 0, 0, Qt::AlignRight);
70  m1->addWidget(l2, 1, 0, Qt::AlignRight);
71  m1->addWidget(l3, 2, 0, Qt::AlignRight);
72  m1->addWidget(l4, 3, 0, Qt::AlignRight);
73  m1->addWidget(l5, 4, 0, Qt::AlignRight);
74  m1->addWidget(accesslog_, 0, 1);
75  m1->addWidget(errorlog_, 1, 1);
76  m1->addWidget(pagelog_, 2, 1);
77  m1->addWidget(maxlogsize_, 3, 1);
78  m1->addWidget(loglevel_, 4, 1);
79 }
80 
81 bool CupsdLogPage::loadConfig(CupsdConf *conf, TQString&)
82 {
83  conf_ = conf;
84  accesslog_->setURL(conf_->accesslog_);
85  errorlog_->setURL(conf_->errorlog_);
86  pagelog_->setURL(conf_->pagelog_);
87  maxlogsize_->setSizeString(conf_->maxlogsize_);
88  loglevel_->setCurrentItem(conf_->loglevel_);
89 
90  return true;
91 }
92 
93 bool CupsdLogPage::saveConfig(CupsdConf *conf, TQString&)
94 {
95  conf->accesslog_ = accesslog_->url();
96  conf->errorlog_ = errorlog_->url();
97  conf->pagelog_ = pagelog_->url();
98  conf->maxlogsize_ = maxlogsize_->sizeString();
99  conf->loglevel_ = loglevel_->currentItem();
100 
101  return true;
102 }
103 
104 void CupsdLogPage::setInfos(CupsdConf *conf)
105 {
106  TQWhatsThis::add(accesslog_, conf->comments_.toolTip("accesslog"));
107  TQWhatsThis::add(errorlog_, conf->comments_.toolTip("errorlog"));
108  TQWhatsThis::add(pagelog_, conf->comments_.toolTip("pagelog"));
109  TQWhatsThis::add(maxlogsize_, conf->comments_.toolTip("maxlogsize"));
110  TQWhatsThis::add(loglevel_, conf->comments_.toolTip("loglevel"));
111 }

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
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeprint by doxygen 1.8.8
This website is maintained by Timothy Pearson.