From 1eed94c3d665137402a1f5205968eb35417cd7fc Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 1 Mar 2005 22:10:32 +0000 Subject: [PATCH] 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 --- TODO | 1 + conf/dlggeneral.ui | 16 ++++++++++++++-- conf/dlggeneral.ui.h | 19 +++++++++++++++++++ conf/kpdf.kcfg | 3 +++ configure.in.in | 2 +- core/generator_pdf/generator_pdf.cpp | 3 +++ 6 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 conf/dlggeneral.ui.h diff --git a/TODO b/TODO index bfd4db0f2..84f73c977 100644 --- a/TODO +++ b/TODO @@ -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 diff --git a/conf/dlggeneral.ui b/conf/dlggeneral.ui index 603228d78..9a7bb2c16 100644 --- a/conf/dlggeneral.ui +++ b/conf/dlggeneral.ui @@ -9,7 +9,7 @@ 0 0 320 - 169 + 300 @@ -32,7 +32,7 @@ - layout6 + layout4 @@ -111,6 +111,14 @@ Show &hints and info messages + + + kcfg_ObeyDRM + + + &Obey DRM limitations + + @@ -194,7 +202,11 @@ kdialog.h kiconloader.h + dlggeneral.ui.h + + showEvent( QShowEvent * ) + DesktopIcon diff --git a/conf/dlggeneral.ui.h b/conf/dlggeneral.ui.h new file mode 100644 index 000000000..6d96d78ef --- /dev/null +++ b/conf/dlggeneral.ui.h @@ -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 + +void DlgGeneral::showEvent( QShowEvent * ) +{ + if (kapp->authorize("skip_drm")) kcfg_ObeyDRM->show(); + else kcfg_ObeyDRM->hide(); +} diff --git a/conf/kpdf.kcfg b/conf/kpdf.kcfg index 12a92b8c0..64d343250 100644 --- a/conf/kpdf.kcfg +++ b/conf/kpdf.kcfg @@ -53,6 +53,9 @@ true + + true + diff --git a/configure.in.in b/configure.in.in index 62f5b415d..a5cdfac20 100644 --- a/configure.in.in +++ b/configure.in.in @@ -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]) ) diff --git a/core/generator_pdf/generator_pdf.cpp b/core/generator_pdf/generator_pdf.cpp index 24c288381..44771df16 100644 --- a/core/generator_pdf/generator_pdf.cpp +++ b/core/generator_pdf/generator_pdf.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -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();