kmpropgeneral.cpp

00001 /*
00002  *  This file is part of the KDE libraries
00003  *  Copyright (c) 2001 Michael Goffioul <kdeprint@swing.be>
00004  *
00005  *  This library is free software; you can redistribute it and/or
00006  *  modify it under the terms of the GNU Library General Public
00007  *  License version 2 as published by the Free Software Foundation.
00008  *
00009  *  This library is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  *  Library General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU Library General Public License
00015  *  along with this library; see the file COPYING.LIB.  If not, write to
00016  *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  *  Boston, MA 02110-1301, USA.
00018  **/
00019 
00020 #include "kmpropgeneral.h"
00021 #include "kmprinter.h"
00022 #include "kmwizard.h"
00023 #include "kmfactory.h"
00024 #include "kmmanager.h"
00025 
00026 #include <qlabel.h>
00027 #include <qlayout.h>
00028 #include <klocale.h>
00029 
00030 KMPropGeneral::KMPropGeneral(QWidget *parent, const char *name)
00031 : KMPropWidget(parent,name)
00032 {
00033     m_name = new QLabel("",this);
00034     m_location = new QLabel("",this);
00035     m_description = new QLabel("",this);
00036 
00037     QLabel  *l1 = new QLabel(i18n("Printer name:"), this);
00038     QLabel  *l2 = new QLabel(i18n("Physical Location", "Location:"), this);
00039     QLabel  *l3 = new QLabel(i18n("Description:"), this);
00040 
00041     // layout
00042     QGridLayout *main_ = new QGridLayout(this, 4, 2, 10, 7);
00043     main_->setColStretch(0,0);
00044     main_->setColStretch(1,1);
00045     main_->setRowStretch(3,1);
00046     main_->addWidget(l1,0,0);
00047     main_->addWidget(l2,1,0);
00048     main_->addWidget(l3,2,0);
00049     main_->addWidget(m_name,0,1);
00050     main_->addWidget(m_location,1,1);
00051     main_->addWidget(m_description,2,1);
00052 
00053     m_pixmap = "contents";
00054     m_title = i18n("General");
00055     m_header = i18n("General Settings");
00056 }
00057 
00058 KMPropGeneral::~KMPropGeneral()
00059 {
00060 }
00061 
00062 void KMPropGeneral::setPrinter(KMPrinter *p)
00063 {
00064     if (p)
00065     {
00066         m_name->setText(p->name());
00067         m_location->setText(p->location());
00068         m_description->setText(p->description());
00069         emit enableChange(!(p->isSpecial() || p->isRemote() || p->isImplicit()));
00070     }
00071     else
00072     {
00073         emit enableChange(false);
00074         m_name->setText("");
00075         m_location->setText("");
00076         m_description->setText("");
00077     }
00078 }
00079 
00080 void KMPropGeneral::configureWizard(KMWizard *w)
00081 {
00082     w->configure(KMWizard::Name,KMWizard::Name,true);
00083 }
KDE Home | KDE Accessibility Home | Description of Access Keys