summaryrefslogtreecommitdiffstats
path: root/kdeprint/lpdunix
diff options
context:
space:
mode:
Diffstat (limited to 'kdeprint/lpdunix')
-rw-r--r--kdeprint/lpdunix/Makefile.am15
-rw-r--r--kdeprint/lpdunix/klpdunixprinterimpl.cpp83
-rw-r--r--kdeprint/lpdunix/klpdunixprinterimpl.h41
-rw-r--r--kdeprint/lpdunix/kmlpdunixfactory.cpp29
-rw-r--r--kdeprint/lpdunix/kmlpdunixmanager.cpp410
-rw-r--r--kdeprint/lpdunix/kmlpdunixmanager.h42
-rw-r--r--kdeprint/lpdunix/kmlpdunixuimanager.cpp45
-rw-r--r--kdeprint/lpdunix/kmlpdunixuimanager.h35
-rw-r--r--kdeprint/lpdunix/lpdunix.print83
9 files changed, 783 insertions, 0 deletions
diff --git a/kdeprint/lpdunix/Makefile.am b/kdeprint/lpdunix/Makefile.am
new file mode 100644
index 000000000..79d4dce56
--- /dev/null
+++ b/kdeprint/lpdunix/Makefile.am
@@ -0,0 +1,15 @@
+AM_CPPFLAGS = -D_KDEPRINT_COMPILE
+
+INCLUDES= -I$(top_srcdir) -I$(top_srcdir)/kdeprint $(all_includes)
+
+kde_module_LTLIBRARIES = kdeprint_lpdunix.la
+
+kdeprint_lpdunix_la_SOURCES = kmlpdunixfactory.cpp kmlpdunixmanager.cpp klpdunixprinterimpl.cpp kmlpdunixuimanager.cpp
+kdeprint_lpdunix_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
+kdeprint_lpdunix_la_LIBADD = $(top_builddir)/kdeprint/management/libkdeprint_management.la
+kdeprint_lpdunix_la_METASOURCES = AUTO
+
+noinst_HEADERS = kmlpdunixmanager.h klpdunixprinterimpl.h kmlpdunixuimanager.h
+
+entry_DATA = lpdunix.print
+entrydir = $(kde_datadir)/kdeprint/plugins
diff --git a/kdeprint/lpdunix/klpdunixprinterimpl.cpp b/kdeprint/lpdunix/klpdunixprinterimpl.cpp
new file mode 100644
index 000000000..51cc5145d
--- /dev/null
+++ b/kdeprint/lpdunix/klpdunixprinterimpl.cpp
@@ -0,0 +1,83 @@
+/*
+ * This file is part of the KDE libraries
+ * Copyright (c) 2001 Michael Goffioul <kdeprint@swing.be>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ **/
+
+#include "klpdunixprinterimpl.h"
+#include "kprinter.h"
+
+#include <qfile.h>
+#include <kstandarddirs.h>
+#include <klocale.h>
+#include <kmacroexpander.h>
+
+KLpdUnixPrinterImpl::KLpdUnixPrinterImpl(QObject *parent, const char *name, const QStringList & /*args*/)
+: KPrinterImpl(parent,name)
+{
+}
+
+KLpdUnixPrinterImpl::~KLpdUnixPrinterImpl()
+{
+}
+
+void KLpdUnixPrinterImpl::initLpPrint(QString& cmd, KPrinter *printer)
+{
+ cmd += QString::fromLatin1(" -d %1 -n%2").arg(quote(printer->printerName())).arg(printer->numCopies());
+}
+
+void KLpdUnixPrinterImpl::initLprPrint(QString& cmd, KPrinter *printer)
+{
+ cmd += QString::fromLatin1(" -P %1 '-#%2'").arg(quote(printer->printerName())).arg(printer->numCopies());
+}
+
+// look for executable, starting with "lpr"
+QString KLpdUnixPrinterImpl::executable()
+{
+ QString exe = KStandardDirs::findExe("lpr");
+ if (exe.isEmpty())
+ exe = KStandardDirs::findExe("lp");
+ return exe;
+}
+
+bool KLpdUnixPrinterImpl::setupCommand(QString& cmd, KPrinter *printer)
+{
+ QString exe = printer->option( "kde-printcommand" );
+ if ( exe.isEmpty() || exe == "<automatic>" )
+ {
+ exe = executable();
+ if (!exe.isEmpty())
+ {
+ cmd = exe;
+ if (exe.right(3) == "lpr")
+ initLprPrint(cmd,printer);
+ else
+ initLpPrint(cmd,printer);
+ return true;
+ }
+ else
+ printer->setErrorMessage(i18n("No valid print executable was found in your path. Check your installation."));
+ return false;
+ }
+ else
+ {
+ QMap<QString,QString> map;
+ map.insert( "printer", printer->printerName() );
+ map.insert( "copies", QString::number( printer->numCopies() ) );
+ cmd = KMacroExpander::expandMacrosShellQuote( exe, map );
+ return true;
+ }
+}
diff --git a/kdeprint/lpdunix/klpdunixprinterimpl.h b/kdeprint/lpdunix/klpdunixprinterimpl.h
new file mode 100644
index 000000000..e3fba97a2
--- /dev/null
+++ b/kdeprint/lpdunix/klpdunixprinterimpl.h
@@ -0,0 +1,41 @@
+/*
+ * This file is part of the KDE libraries
+ * Copyright (c) 2001 Michael Goffioul <kdeprint@swing.be>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ **/
+
+#ifndef KLPDUNIXPRINTERIMPL_H
+#define KLPDUNIXPRINTERIMPL_H
+
+#include "kprinterimpl.h"
+
+class KProcess;
+
+class KLpdUnixPrinterImpl : public KPrinterImpl
+{
+public:
+ KLpdUnixPrinterImpl(QObject *parent, const char *name, const QStringList & /*args*/);
+ ~KLpdUnixPrinterImpl();
+
+ bool setupCommand(QString&, KPrinter*);
+
+protected:
+ void initLpPrint(QString&, KPrinter*);
+ void initLprPrint(QString&, KPrinter*);
+ QString executable();
+};
+
+#endif
diff --git a/kdeprint/lpdunix/kmlpdunixfactory.cpp b/kdeprint/lpdunix/kmlpdunixfactory.cpp
new file mode 100644
index 000000000..8ebb19f22
--- /dev/null
+++ b/kdeprint/lpdunix/kmlpdunixfactory.cpp
@@ -0,0 +1,29 @@
+/*
+ * This file is part of the KDE libraries
+ * Copyright (c) 2001 Michael Goffioul <kdeprint@swing.be>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ **/
+
+#include "kmlpdunixmanager.h"
+#include "kmlpdunixuimanager.h"
+#include "klpdunixprinterimpl.h"
+
+#include <kgenericfactory.h>
+
+typedef K_TYPELIST_3( KMLpdUnixManager, KLpdUnixPrinterImpl, KMLpdUnixUiManager ) Products;
+K_EXPORT_COMPONENT_FACTORY( kdeprint_lpdunix, KGenericFactory< Products > )
+
+
diff --git a/kdeprint/lpdunix/kmlpdunixmanager.cpp b/kdeprint/lpdunix/kmlpdunixmanager.cpp
new file mode 100644
index 000000000..f19e76f8f
--- /dev/null
+++ b/kdeprint/lpdunix/kmlpdunixmanager.cpp
@@ -0,0 +1,410 @@
+/*
+ * This file is part of the KDE libraries
+ * Copyright (c) 2001 Michael Goffioul <kdeprint@swing.be>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ **/
+
+#include "kmlpdunixmanager.h"
+#include "kmfactory.h"
+#include "kmprinter.h"
+
+#include <qfile.h>
+#include <qdir.h>
+#include <qfileinfo.h>
+#include <qtextstream.h>
+#include <qregexp.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include <kdebug.h>
+
+#include <stdlib.h>
+
+/*****************
+ * Utility class *
+ *****************/
+class KTextBuffer
+{
+public:
+ KTextBuffer(QIODevice *dev) : m_stream(dev) {}
+ bool eof() const { return (m_stream.eof() && m_linebuf.isEmpty()); }
+ QString readLine();
+ void unreadLine(const QString& l) { m_linebuf = l; }
+private:
+ QTextStream m_stream;
+ QString m_linebuf;
+};
+
+QString KTextBuffer::readLine()
+{
+ QString line;
+ if (!m_linebuf.isEmpty())
+ {
+ line = m_linebuf;
+ m_linebuf = QString::null;
+ }
+ else
+ line = m_stream.readLine();
+ return line;
+}
+
+/*****************************
+ * Various parsing functions *
+ *****************************/
+
+// Extract a line from a KTextBuffer:
+// '#' -> comments
+// '\' -> line continue
+// ':' or '|' -> line continue (LPRng)
+//
+// New entry is detected by a line which have first character different from
+// '#', '|', ':'. The line is then put back in the IODevice.
+QString readLine(KTextBuffer& t)
+{
+ QString line, buffer;
+ bool lineContinue(false);
+
+ while (!t.eof())
+ {
+ buffer = t.readLine().stripWhiteSpace();
+ if (buffer.isEmpty() || buffer[0] == '#')
+ continue;
+ if (buffer[0] == '|' || buffer[0] == ':' || lineContinue || line.isEmpty())
+ {
+ line.append(buffer);
+ if (line.right(1) == "\\")
+ {
+ line.truncate(line.length()-1);
+ line = line.stripWhiteSpace();
+ lineContinue = true;
+ }
+ else
+ lineContinue = false;
+ }
+ else
+ {
+ t.unreadLine(buffer);
+ break;
+ }
+ }
+ return line;
+}
+
+// extact an entry (printcap-like)
+QMap<QString,QString> readEntry(KTextBuffer& t)
+{
+ QString line = readLine(t);
+ QMap<QString,QString> entry;
+
+ if (!line.isEmpty())
+ {
+ QStringList l = QStringList::split(':',line,false);
+ if (l.count() > 0)
+ {
+ int p(-1);
+ if ((p=l[0].find('|')) != -1)
+ entry["printer-name"] = l[0].left(p); // only keep first name (discard aliases
+ else
+ entry["printer-name"] = l[0];
+ for (uint i=1; i<l.count(); i++)
+ if ((p=l[i].find('=')) != -1)
+ entry[l[i].left(p).stripWhiteSpace()] = l[i].right(l[i].length()-p-1).stripWhiteSpace();
+ else
+ entry[l[i].stripWhiteSpace()] = QString::null;
+ }
+ }
+ return entry;
+}
+
+// create basic printer from entry
+KMPrinter* createPrinter(const QMap<QString,QString>& entry)
+{
+ KMPrinter *printer = new KMPrinter();
+ printer->setName(entry["printer-name"]);
+ printer->setPrinterName(entry["printer-name"]);
+ printer->setType(KMPrinter::Printer);
+ printer->setState(KMPrinter::Idle);
+ return printer;
+}
+KMPrinter* createPrinter(const QString& prname)
+{
+ QMap<QString,QString> map;
+ map["printer-name"] = prname;
+ return createPrinter(map);
+}
+
+// this function support LPRng piping feature, it defaults to
+// /etc/printcap in any other cases (basic support)
+QString getPrintcapFileName()
+{
+ // check if LPRng system
+ QString printcap("/etc/printcap");
+ QFile f("/etc/lpd.conf");
+ if (f.exists() && f.open(IO_ReadOnly))
+ {
+ kdDebug() << "/etc/lpd.conf found: probably LPRng system" << endl;
+ QTextStream t(&f);
+ QString line;
+ while (!t.eof())
+ {
+ line = t.readLine().stripWhiteSpace();
+ if (line.startsWith("printcap_path="))
+ {
+ kdDebug() << "printcap_path entry found: " << line << endl;
+ QString pcentry = line.mid(14).stripWhiteSpace();
+ kdDebug() << "printcap_path value: " << pcentry << endl;
+ if (pcentry[0] == '|')
+ { // printcap through pipe
+ printcap = locateLocal("tmp","printcap");
+ QString cmd = QString::fromLatin1("echo \"all\" | %1 > %2").arg(pcentry.mid(1)).arg(printcap);
+ kdDebug() << "printcap obtained through pipe" << endl << "executing: " << cmd << endl;
+ ::system(cmd.local8Bit());
+ }
+ break;
+ }
+ }
+ }
+ kdDebug() << "printcap file returned: " << printcap << endl;
+ return printcap;
+}
+
+// "/etc/printcap" file parsing (Linux/LPR)
+void KMLpdUnixManager::parseEtcPrintcap()
+{
+ QFile f(getPrintcapFileName());
+ if (f.exists() && f.open(IO_ReadOnly))
+ {
+ KTextBuffer t(&f);
+ QMap<QString,QString> entry;
+
+ while (!t.eof())
+ {
+ entry = readEntry(t);
+ if (entry.isEmpty() || !entry.contains("printer-name") || entry.contains("server"))
+ continue;
+ if (entry["printer-name"] == "all")
+ {
+ if (entry.contains("all"))
+ {
+ // find separator
+ int p = entry["all"].find(QRegExp("[^a-zA-Z0-9_\\s-]"));
+ if (p != -1)
+ {
+ QChar c = entry["all"][p];
+ QStringList prs = QStringList::split(c,entry["all"],false);
+ for (QStringList::ConstIterator it=prs.begin(); it!=prs.end(); ++it)
+ {
+ KMPrinter *printer = ::createPrinter(*it);
+ printer->setDescription(i18n("Description unavailable"));
+ addPrinter(printer);
+ }
+ }
+ }
+ }
+ else
+ {
+ KMPrinter *printer = ::createPrinter(entry);
+ if (entry.contains("rm"))
+ printer->setDescription(i18n("Remote printer queue on %1").arg(entry["rm"]));
+ else
+ printer->setDescription(i18n("Local printer"));
+ addPrinter(printer);
+ }
+ }
+ }
+}
+
+// helper function for NIS support in Solaris-2.6 (use "ypcat printers.conf.byname")
+QString getEtcPrintersConfName()
+{
+ QString printersconf("/etc/printers.conf");
+ if (!QFile::exists(printersconf) && !KStandardDirs::findExe( "ypcat" ).isEmpty())
+ {
+ // standard file not found, try NIS
+ printersconf = locateLocal("tmp","printers.conf");
+ QString cmd = QString::fromLatin1("ypcat printers.conf.byname > %1").arg(printersconf);
+ kdDebug() << "printers.conf obtained from NIS server: " << cmd << endl;
+ ::system(QFile::encodeName(cmd));
+ }
+ return printersconf;
+}
+
+// "/etc/printers.conf" file parsing (Solaris 2.6)
+void KMLpdUnixManager::parseEtcPrintersConf()
+{
+ QFile f(getEtcPrintersConfName());
+ if (f.exists() && f.open(IO_ReadOnly))
+ {
+ KTextBuffer t(&f);
+ QMap<QString,QString> entry;
+ QString default_printer;
+
+ while (!t.eof())
+ {
+ entry = readEntry(t);
+ if (entry.isEmpty() || !entry.contains("printer-name"))
+ continue;
+ QString prname = entry["printer-name"];
+ if (prname == "_default")
+ {
+ if (entry.contains("use"))
+ default_printer = entry["use"];
+ }
+ else if (prname != "_all")
+ {
+ KMPrinter *printer = ::createPrinter(entry);
+ if (entry.contains("bsdaddr"))
+ {
+ QStringList l = QStringList::split(',',entry["bsdaddr"],false);
+ printer->setDescription(i18n("Remote printer queue on %1").arg(l[0]));
+ }
+ else
+ printer->setDescription(i18n("Local printer"));
+ addPrinter(printer);
+ }
+ }
+
+ if (!default_printer.isEmpty())
+ setSoftDefault(findPrinter(default_printer));
+ }
+}
+
+// "/etc/lp/printers/" directory parsing (Solaris non-2.6)
+void KMLpdUnixManager::parseEtcLpPrinters()
+{
+ QDir d("/etc/lp/printers");
+ const QFileInfoList *prlist = d.entryInfoList(QDir::Dirs);
+ if (!prlist)
+ return;
+
+ QFileInfoListIterator it(*prlist);
+ for (;it.current();++it)
+ {
+ if (it.current()->fileName() == "." || it.current()->fileName() == "..")
+ continue;
+ QFile f(it.current()->absFilePath() + "/configuration");
+ if (f.exists() && f.open(IO_ReadOnly))
+ {
+ KTextBuffer t(&f);
+ QString line, remote;
+ while (!t.eof())
+ {
+ line = readLine(t);
+ if (line.isEmpty()) continue;
+ if (line.startsWith("Remote:"))
+ {
+ QStringList l = QStringList::split(':',line,false);
+ if (l.count() > 1) remote = l[1];
+ }
+ }
+ KMPrinter *printer = new KMPrinter;
+ printer->setName(it.current()->fileName());
+ printer->setPrinterName(it.current()->fileName());
+ printer->setType(KMPrinter::Printer);
+ printer->setState(KMPrinter::Idle);
+ if (!remote.isEmpty())
+ printer->setDescription(i18n("Remote printer queue on %1").arg(remote));
+ else
+ printer->setDescription(i18n("Local printer"));
+ addPrinter(printer);
+ }
+ }
+}
+
+// "/etc/lp/member/" directory parsing (HP-UX)
+void KMLpdUnixManager::parseEtcLpMember()
+{
+ QDir d("/etc/lp/member");
+ const QFileInfoList *prlist = d.entryInfoList(QDir::Files);
+ if (!prlist)
+ return;
+
+ QFileInfoListIterator it(*prlist);
+ for (;it.current();++it)
+ {
+ KMPrinter *printer = new KMPrinter;
+ printer->setName(it.current()->fileName());
+ printer->setPrinterName(it.current()->fileName());
+ printer->setType(KMPrinter::Printer);
+ printer->setState(KMPrinter::Idle);
+ printer->setDescription(i18n("Local printer"));
+ addPrinter(printer);
+ }
+}
+
+// "/usr/spool/lp/interfaces/" directory parsing (IRIX 6.x)
+void KMLpdUnixManager::parseSpoolInterface()
+{
+ QDir d("/usr/spool/interfaces/lp");
+ const QFileInfoList *prlist = d.entryInfoList(QDir::Files);
+ if (!prlist)
+ return;
+
+ QFileInfoListIterator it(*prlist);
+ for (;it.current();++it)
+ {
+ QFile f(it.current()->absFilePath());
+ if (f.exists() && f.open(IO_ReadOnly))
+ {
+ KTextBuffer t(&f);
+ QString line, remote;
+
+ while (!t.eof())
+ {
+ line = t.readLine().stripWhiteSpace();
+ if (line.startsWith("HOSTNAME"))
+ {
+ QStringList l = QStringList::split('=',line,false);
+ if (l.count() > 1) remote = l[1];
+ }
+ }
+
+ KMPrinter *printer = new KMPrinter;
+ printer->setName(it.current()->fileName());
+ printer->setPrinterName(it.current()->fileName());
+ printer->setType(KMPrinter::Printer);
+ printer->setState(KMPrinter::Idle);
+ if (!remote.isEmpty())
+ printer->setDescription(i18n("Remote printer queue on %1").arg(remote));
+ else
+ printer->setDescription(i18n("Local printer"));
+ addPrinter(printer);
+ }
+ }
+}
+
+//*********************************************************************************************************
+
+KMLpdUnixManager::KMLpdUnixManager(QObject *parent, const char *name, const QStringList & /*args*/)
+: KMManager(parent,name)
+{
+ m_loaded = false;
+}
+
+void KMLpdUnixManager::listPrinters()
+{
+ // load only once, if already loaded, just keep them (remove discard flag)
+ if (!m_loaded)
+ {
+ parseEtcPrintcap();
+ parseEtcPrintersConf();
+ parseEtcLpPrinters();
+ parseEtcLpMember();
+ parseSpoolInterface();
+ m_loaded = true;
+ }
+ else
+ discardAllPrinters(false);
+}
diff --git a/kdeprint/lpdunix/kmlpdunixmanager.h b/kdeprint/lpdunix/kmlpdunixmanager.h
new file mode 100644
index 000000000..29c536a21
--- /dev/null
+++ b/kdeprint/lpdunix/kmlpdunixmanager.h
@@ -0,0 +1,42 @@
+/*
+ * This file is part of the KDE libraries
+ * Copyright (c) 2001 Michael Goffioul <kdeprint@swing.be>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ **/
+
+#ifndef KMLPDUNIXMANAGER_H
+#define KMLPDUNIXMANAGER_H
+
+#include "kmmanager.h"
+
+class KMLpdUnixManager : public KMManager
+{
+public:
+ KMLpdUnixManager(QObject *parent, const char *name, const QStringList & /*args*/);
+
+protected:
+ void listPrinters();
+ void parseEtcPrintcap();
+ void parseEtcPrintersConf();
+ void parseEtcLpPrinters();
+ void parseEtcLpMember();
+ void parseSpoolInterface();
+
+private:
+ bool m_loaded;
+};
+
+#endif
diff --git a/kdeprint/lpdunix/kmlpdunixuimanager.cpp b/kdeprint/lpdunix/kmlpdunixuimanager.cpp
new file mode 100644
index 000000000..20c62c845
--- /dev/null
+++ b/kdeprint/lpdunix/kmlpdunixuimanager.cpp
@@ -0,0 +1,45 @@
+/*
+ * This file is part of the KDE libraries
+ * Copyright (c) 2001 Michael Goffioul <kdeprint@swing.be>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ **/
+
+#include "kmlpdunixuimanager.h"
+#include "kpqtpage.h"
+#include "kprinterpropertydialog.h"
+
+#include <klocale.h>
+
+KMLpdUnixUiManager::KMLpdUnixUiManager(QObject *parent, const char *name, const QStringList & /*args*/)
+: KMUiManager(parent,name)
+{
+ m_printdialogflags |= KMUiManager::PrintCommand;
+}
+
+KMLpdUnixUiManager::~KMLpdUnixUiManager()
+{
+}
+
+int KMLpdUnixUiManager::pluginPageCap()
+{
+ return KMUiManager::pluginPageCap();
+ //return KMUiManager::NoAutoCollate;
+}
+
+void KMLpdUnixUiManager::setupPrinterPropertyDialog( KPrinterPropertyDialog *dlg )
+{
+ dlg->addPage( new KPQtPage( dlg, "QtPage" ) );
+}
diff --git a/kdeprint/lpdunix/kmlpdunixuimanager.h b/kdeprint/lpdunix/kmlpdunixuimanager.h
new file mode 100644
index 000000000..4882399e9
--- /dev/null
+++ b/kdeprint/lpdunix/kmlpdunixuimanager.h
@@ -0,0 +1,35 @@
+/*
+ * This file is part of the KDE libraries
+ * Copyright (c) 2001 Michael Goffioul <kdeprint@swing.be>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ **/
+
+#ifndef KMLPDUNIXUIMANAGER_H
+#define KMLPDUNIXUIMANAGER_H
+
+#include "kmuimanager.h"
+
+class KMLpdUnixUiManager : public KMUiManager
+{
+public:
+ KMLpdUnixUiManager(QObject *parent, const char *name, const QStringList & /*args*/);
+ ~KMLpdUnixUiManager();
+
+ int pluginPageCap();
+ void setupPrinterPropertyDialog( KPrinterPropertyDialog* );
+};
+
+#endif
diff --git a/kdeprint/lpdunix/lpdunix.print b/kdeprint/lpdunix/lpdunix.print
new file mode 100644
index 000000000..8ef71a28d
--- /dev/null
+++ b/kdeprint/lpdunix/lpdunix.print
@@ -0,0 +1,83 @@
+[KDE Print Entry]
+PrintSystem=lpdunix
+Comment=Generic UNIX LPD Print System (default)
+Comment[af]=Generies Unix Lpd Druk Stelsel (verstek)
+Comment[ar]=نظام طباعة LPD العام ليونيكس (افتراضي)
+Comment[az]=Ümumi UNIX LPD Sistemi (ön qurğulu)
+Comment[be]=Звычайная сістэма друку UNIX LPD (прадвызначана)
+Comment[bn]= সাধারণ ইউনিক্স এল-পি-ডি মুদ্রণ ব্যবস্থা (ডিফল্ট)
+Comment[bs]=Generički UNIX LPD sistem štampe (default)
+Comment[ca]=Sistema d'impressió genèric LPD de Unix (predeterminat)
+Comment[cs]=Obecný UNIXový tiskový systém LPD (implicitní)
+Comment[csb]=Pierwòsznô uniksowô systema drëkù LPD (domëslny)
+Comment[cy]=Cysawd Argraffu LPD Unix Cyffredinol (rhagosodiad)
+Comment[da]=Generisk UNIX LPD-udskriftssystem (standard)
+Comment[de]=UNIX-LPD-Drucksystem (Voreinstellung)
+Comment[el]=Γενικό σύστημα εκτύπωσης UNIX LPD (προκαθορισμένο)
+Comment[eo]=Ĝenerala Uniksa LPD-pressistemo (apriora)
+Comment[es]=Sistema de impresión genérico LPD de Unix (predeterminado)
+Comment[et]=Tavaline UNIX-i LPD trükkimise süsteem (vaikimisi)
+Comment[eu]=UNIX LPD inprimatze-sistema generikoa (lehenetsia)
+Comment[fa]=سیستم چاپUNIX LPD عمومی )پیش‌فرض(
+Comment[fi]=Yleinen UNIX LPD-tulostusjärjestelmä (oletus)
+Comment[fr]=Système d'impression LPD Unix générique (par défaut)
+Comment[fy]=Algemiene UNIX LPD-ôfdruksysteem (standert)
+Comment[ga]=Córas priontála cineálach LPD UNIX (réamhshocrú)
+Comment[gl]=Sistema UNIX Xenérico de Impresión LPD (por omisión)
+Comment[he]=מערכת ההדפסה הכללית של יוניקס LPD (ברירת מחדל)
+Comment[hi]=जेनरिक UNIX LPD छपाई पद्धत्ति (ङिफाल्ट)
+Comment[hr]=Generički UNIX LPD sustav za ispis (zadani)
+Comment[hu]=LPD (standard UNIX nyomtatási rendszer)
+Comment[id]=Sistem Pencetakan UNIX Generik LPD (bawaan)
+Comment[is]=Almennt UNIX LPD prentkerfi (sjálfgefið)
+Comment[it]=Sistema di stampa UNIX LPD generico (predefinito)
+Comment[ja]=一般的な UNIX LPD 印刷システム (標準)
+Comment[ka]=UNIX LPD ბეჭდვის სისტემა (ნაგულისხმები)
+Comment[kk]=UNIX жүйесіндегі әдетті LPD басып шғаруы
+Comment[km]=ប្រព័ន្ធ​បោះពុម្ព Generic UNIX LPD (លំនាំដើម)
+Comment[ko]=보통 유닉스 LPD 인쇄 시스템 (기본)
+Comment[lb]=Allgemengt UNIX-LPD-Drécksystem (Virastellung)
+Comment[lt]=Bendra UNIX LPD spausdinimo sistema (numatyta)
+Comment[lv]=Vispārēja UNIX LPD drukas sistēma (noklusēta)
+Comment[mk]=Општ UNIX LPD систем за печатење (стандардно)
+Comment[mn]=UNIX-LPD-Хэвлэх систем (Стандарт)
+Comment[ms]=Sistem Cetak UNIX LPD Generik (default)
+Comment[mt]=Sistema ġenerika tal-ipprintjar Unix LPD (standard)
+Comment[nb]=Vanlig UNIX LPD skriversystem (standard)
+Comment[nds]=Dat normale LPD-Drucksysteem vun UNIX (Standard)
+Comment[ne]=जेनेरिक UNIX LPD मुद्रण प्रणाली (पूर्वनिर्धारित)
+Comment[nl]=Generiek UNIX LPD-afdruksysteem (standaard)
+Comment[nn]=Generelt UNIX LPD-utskriftssystem (standard)
+Comment[nso]=System ya Kgatiso ya LPD ya UNIX ya Kakaretso (thuso ya tshoganetso)
+Comment[pa]=ਆਮ UNIX LPD ਪ੍ਰਿੰਟ ਸਿਸਟਮ(ਮੂਲ)
+Comment[pl]=Pierwotny uniksowy system druku LPD (domyślny)
+Comment[pt]=O sistema de impressão genérico do UNIX LPD (por omissão)
+Comment[pt_BR]= LPD - Sistema Genérico do UNIX de Impressão (padrão)
+Comment[ro]=Sistem generic de tipărire UNIX LPD (implicit)
+Comment[ru]=Система печати UNIX LPD (по умолчанию)
+Comment[rw]=Sisitemu yo Gucapa ya UNIX LPD Rusange (Mburabuzi)
+Comment[se]=Oppalaš UNIX LPD čálihanvuogádat (standárda)
+Comment[sk]=Generický tlačový systém UNIX LPD (štandardné)
+Comment[sl]=Splošni tiskalniški sistem LDP za Unix (privzeto)
+Comment[sq]=Sitemi Gjenrik Shtypi nga UNI LPD (e parazgjedhur)
+Comment[sr]=Генерички UNIX LPD систем за штампање (предефинисано)
+Comment[sr@Latn]=Generički UNIX LPD sistem za štampanje (predefinisano)
+Comment[ss]=Umshini wekushicelela lobanti weLPD ku KDE (kwehluleka)
+Comment[sv]=Generellt Unix LPD-skrivarsystem (standard)
+Comment[ta]=பொது யுனிக்ஸ் LPD அச்சுத் தொகுதி (முன் இருந்த)
+Comment[te]=సాధారణ యునిక్స్ ఎల్ పి డి ప్రచురణ వ్యవస్థ (అప్రమేయం)
+Comment[tg]=Системаи чопи UNIX LPD (пешфарзӣ)
+Comment[th]=ระบบการพิมพ์ LPD ของยูนิกซ์ (ค่าปริยาย)
+Comment[tr]=Genel UNIX LPD Yazdırma Sistemi (öntanımlı)
+Comment[tt]=UNIX LPD Bastıru Sisteme (töp)
+Comment[uk]=Загальна система друку UNIX - LPD (типова)
+Comment[uz]=Oddiy UNIX LPD bosib chiqarish tizimi (andoza)
+Comment[uz@cyrillic]=Оддий UNIX LPD босиб чиқариш тизими (андоза)
+Comment[ven]=Maitele au phirintha a UNIX (default)
+Comment[vi]=Hệ thống in LPD UNIX giống loài (mặc định)
+Comment[wa]=Sistinme d' imprimaedje djenerike LPD po UNIX (prémetou)
+Comment[xh]=Indlela Yoshicilelo Ngokubanzi ye UNIX LPD (edaliweyo)
+Comment[zh_CN]=通用 UNIX LPD 打印系统(默认)
+Comment[zh_HK]=通用 UNIX LPD 列印系統 (預設)
+Comment[zh_TW]=通用 UNIX LPD 列印系統(預設)
+Comment[zu]=Isistimu Yokushicilela ye-UNIX LPD Kawonke wonke (yokwendalo)