20#include "krlprprinterimpl.h"
27#include <tdestandarddirs.h>
31KRlprPrinterImpl::KRlprPrinterImpl(TQObject *parent,
const char *name,
const TQStringList & )
32: KPrinterImpl(parent,name)
36KRlprPrinterImpl::~KRlprPrinterImpl()
40bool KRlprPrinterImpl::setupCommand(TQString& cmd,
KPrinter *printer)
43 KMPrinter *rpr = KMFactory::self()->manager()->findPrinter(printer->
printerName());
47 TQString host(rpr->option(
"host")), queue(rpr->option(
"queue"));
48 if (!host.isEmpty() && !queue.isEmpty())
50 TQString exestr = TDEStandardDirs::findExe(
"rlpr");
53 printer->
setErrorMessage(i18n(
"The <b>%1</b> executable could not be found in your path. Check your installation.").arg(
"rlpr"));
57 cmd = TQString::fromLatin1(
"%1 -H %2 -P %3 -\\#%4").arg(exestr).arg(quote(host)).arg(quote(queue)).arg(printer->
numCopies());
60 TDEConfig *conf = KMFactory::self()->printConfig();
61 conf->setGroup(
"RLPR");
62 TQString host = conf->readEntry(
"ProxyHost",TQString::null), port = conf->readEntry(
"ProxyPort",TQString::null);
65 cmd.append(
" -X ").append(quote(host));
66 if (!port.isEmpty()) cmd.append(
" --port=").append(port);
73 printer->
setErrorMessage(i18n(
"The printer is incompletely defined. Try to reinstall it."));
This class is the main interface to access the TDE print framework.
void setErrorMessage(const TQString &msg)
Sets the last error message.
TQString printerName() const
See TQPrinter::printerName().
int numCopies() const
See TQPrinter::numCopies().