[Kde-kiosk] Printing wo the dialog

Waldo Bastian kde-kiosk@mail.kde.org
Fri, 14 Mar 2003 00:38:55 +0100


--Boundary-00=_PaRc+0NwR6gXI5H
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Thursday 13 March 2003 19:46, Dag Nygren wrote:
> > I would like to hear from people who are interested in reducing the
> > print-related options available in their organisation whether the above
> > KIOSK options would meet their needs. I will hopefully be able to add
> > basic support for KDE 3.1.2 already, although changes such as the
> > introduction of a seperate preview button will have to wait for 3.2.
>
> The above would do the trick for me.
> Thanks in advance!

Here you go, patch will be part of KDE 3.1.2

Cheers,
Waldo
-- 
bastian@kde.org -=|[ SuSE, The Linux Desktop Experts ]|=- bastian@suse.com

--Boundary-00=_PaRc+0NwR6gXI5H
Content-Type: text/x-diff;
  charset="iso-8859-1";
  name="print.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="print.patch"

Index: kpcopiespage.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeprint/kpcopiespage.cpp,v
retrieving revision 1.14
diff -u -r1.14 kpcopiespage.cpp
--- kpcopiespage.cpp	27 Jan 2003 10:16:57 -0000	1.14
+++ kpcopiespage.cpp	13 Mar 2003 23:19:11 -0000
@@ -35,6 +35,8 @@
 #include <qtooltip.h>
 #include <qwhatsthis.h>
 #include <qlayout.h>
+
+#include <kapplication.h>
 #include <klocale.h>
 #include <kiconloader.h>
 #include <kseparator.h>
@@ -124,6 +126,12 @@
 	connect(m_rangeedit,SIGNAL(textChanged(const QString&)),SLOT(slotRangeEntered()));
 	connect(m_collate,SIGNAL(clicked()),SLOT(slotCollateClicked()));
 	connect(m_order,SIGNAL(clicked()),SLOT(slotCollateClicked()));
+	
+	if (!kapp->authorize("print/copies"))
+	{
+		setTitle(i18n("Pages"));
+		m_copybox->hide();
+	}
 }
 
 KPCopiesPage::~KPCopiesPage()
Index: kprintdialog.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeprint/kprintdialog.cpp,v
retrieving revision 1.61
diff -u -r1.61 kprintdialog.cpp
--- kprintdialog.cpp	27 Jan 2003 10:16:57 -0000	1.61
+++ kprintdialog.cpp	13 Mar 2003 23:19:11 -0000
@@ -213,9 +213,32 @@
 	connect( d->m_file, SIGNAL( openFileDialog( KURLRequester* ) ), SLOT( slotOpenFileDialog() ) );
 	connect( KMFactory::self()->manager(), SIGNAL( updatePossible( bool ) ), SLOT( slotUpdatePossible( bool ) ) );
 
-	KConfig	*config = KGlobal::config();
-	config->setGroup("KPrinter Settings");
-	expandDialog(!config->readBoolEntry("DialogReduced", (KMFactory::self()->settings()->application != KPrinter::StandAlone)));
+	if (!kapp->authorize("print/system"))
+	{
+		d->m_plugin->hide();
+	}
+
+	if (!kapp->authorize("print/options"))
+	{
+		d->m_options->hide();
+	}
+
+	if (!kapp->authorize("print/selection"))
+	{
+		d->m_plugin->hide();
+		d->m_options->hide();
+
+		d->m_extbtn->hide();
+		m_pbox->hide();
+		
+		expandDialog(true);
+	}
+	else
+	{
+		KConfig	*config = KGlobal::config();
+		config->setGroup("KPrinter Settings");
+		expandDialog(!config->readBoolEntry("DialogReduced", (KMFactory::self()->settings()->application != KPrinter::StandAlone)));
+	}
 }
 
 KPrintDialog::~KPrintDialog()
Index: kprinter.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeprint/kprinter.cpp,v
retrieving revision 1.62
diff -u -r1.62 kprinter.cpp
--- kprinter.cpp	10 Feb 2003 15:54:02 -0000	1.62
+++ kprinter.cpp	13 Mar 2003 23:19:11 -0000
@@ -215,6 +215,9 @@
 
 bool KPrinter::setup(QWidget *parent, const QString& caption, bool forceExpand)
 {
+	if (!kapp->authorize("print/dialog"))
+		return true; // Just print it
+		
 	if (parent)
 		d->m_parentId = parent->winId();
 

--Boundary-00=_PaRc+0NwR6gXI5H
Content-Type: text/x-diff;
  charset="iso-8859-1";
  name="print.readme.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="print.readme.patch"

Index: README.kiosk
===================================================================
RCS file: /home/kde/kdelibs/kdecore/README.kiosk,v
retrieving revision 1.28
diff -u -r1.28 README.kiosk
--- README.kiosk	13 Mar 2003 17:57:29 -0000	1.28
+++ README.kiosk	13 Mar 2003 23:32:28 -0000
@@ -240,6 +240,31 @@
 should be disabled as part of the "shell_access" action or whether it should 
 get its own action definition, e.g. "custom .desktop files".
 
+Printing related action restrictions:
+
+print/system
+        - disables the option to select the printing system (backend). It is 
+          recommended to  disable this option once the correct printing 
+          system has been configured.
+
+print/options
+        - disables the button to select additional print options.
+
+print/copies
+        - disables the panel that allows users to make more than one copy.
+
+print/selection
+        - disables the options that allows selecting a (pseudo) printer or 
+          change any of the printer properties. Make sure that a proper
+          default printer has been selected before disabling this option.
+          Disabling this option also disables print/system and print/options.
+
+print/dialog
+        - disables the complete print dialog. Selecting the print option will
+          immediate print the selected document using default settings.
+          Make sure that a system wide default printer has been selected.
+          No application specific settings are honoured.
+
 Other defined actions:
 
 shell_access 

--Boundary-00=_PaRc+0NwR6gXI5H--