More on the DRM issue.

How it is going to end:
 - Exists a configure option called --enable-kpdf-drm that is DISABLE by default and you can use to FORCE kpdf obeying DRM
 - Exists a kiosk option called skip_drm that is true by default and the admin can set to TRUE to FORCE kdpf obeying DRM
 - Exists a GUI option called Obey pdf limitations that is shown if skip_drm is true, that option is ON by default, that means DRM is obeyed but the user can disable it from the GUI
Hope that will please everyone
Please can somebody with better english than me check that the wording i used is actually correct english? Thanks

svn path=/trunk/kdegraphics/kpdf/; revision=394212
This commit is contained in:
Albert Astals Cid 2005-03-01 22:10:32 +00:00
parent 02b3ab70f1
commit 1eed94c3d6
6 changed files with 41 additions and 3 deletions

1
TODO
View file

@ -75,6 +75,7 @@ More items (first items will enter 'In progress list' first):
Done (newest features come first):
-- merging from kdpf_annotations branch --
-> ADD: Obey DRM is now a configuration option
-> FIX: leakfix when closing document while thread was running (no more leaks now)
-> FIX: direct hi-performance pixels manipulation for highlighting (instead of the obsoleted setRasterOp)
-> CHG: new search api. supports multiple searches at once, multiple highlighs per page

View file

@ -9,7 +9,7 @@
<x>0</x>
<y>0</y>
<width>320</width>
<height>169</height>
<height>300</height>
</rect>
</property>
<vbox>
@ -32,7 +32,7 @@
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout6</cstring>
<cstring>layout4</cstring>
</property>
<vbox>
<property name="name">
@ -111,6 +111,14 @@
<string>Show &amp;hints and info messages</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>kcfg_ObeyDRM</cstring>
</property>
<property name="text">
<string>&amp;Obey DRM limitations</string>
</property>
</widget>
</vbox>
</widget>
<widget class="QLayoutWidget">
@ -194,7 +202,11 @@
<includes>
<include location="global" impldecl="in implementation">kdialog.h</include>
<include location="global" impldecl="in implementation">kiconloader.h</include>
<include location="local" impldecl="in implementation">dlggeneral.ui.h</include>
</includes>
<functions>
<function access="protected" specifier="non virtual">showEvent( QShowEvent * )</function>
</functions>
<pixmapfunction>DesktopIcon</pixmapfunction>
<layoutdefaults spacing="6" margin="11"/>
</UI>

19
conf/dlggeneral.ui.h Normal file
View file

@ -0,0 +1,19 @@
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you want to add, delete, or rename functions or slots, use
** Qt Designer to update this file, preserving your code.
**
** You should not define a constructor or destructor in this file.
** Instead, write your code in functions called init() and destroy().
** These will automatically be called by the form's constructor and
** destructor.
*****************************************************************************/
#include <kapplication.h>
void DlgGeneral::showEvent( QShowEvent * )
{
if (kapp->authorize("skip_drm")) kcfg_ObeyDRM->show();
else kcfg_ObeyDRM->hide();
}

View file

@ -53,6 +53,9 @@
<entry key="WatchFile" type="Bool" >
<default>true</default>
</entry>
<entry key="ObeyDRM" type="Bool" >
<default>true</default>
</entry>
</group>
<group name="MainView" >
<entry key="ShowLeftPanel" type="Bool" >

View file

@ -112,6 +112,6 @@ AC_ARG_ENABLE(kpdf-drm,
;;
esac
]
, AC_DEFINE(KPDF_HAVE_DRM, 1, [Defines if use DRM in kpdf])
, AC_DEFINE(KPDF_HAVE_DRM, 0, [Defines if use DRM in kpdf])
)

View file

@ -15,6 +15,7 @@
#include <qapplication.h>
#include <qpaintdevicemetrics.h>
#include <qregexp.h>
#include <kapplication.h>
#include <klocale.h>
#include <kpassdlg.h>
#include <kprinter.h>
@ -213,6 +214,8 @@ const DocumentSynopsis * PDFGenerator::generateDocumentSynopsis()
bool PDFGenerator::isAllowed( int permissions )
{
if (kapp->authorize("skip_drm") && !Settings::obeyDRM()) return true;
bool b = true;
if (permissions & KPDFDocument::AllowModify) b = b && pdfdoc->okToChange();
if (permissions & KPDFDocument::AllowCopy) b = b && pdfdoc->okToCopy();