[poppler] qt4/demos

Brad Hards bradh at kemper.freedesktop.org
Thu Feb 28 03:18:57 PST 2008


 qt4/demos/embeddedfiles.cpp |    7 +++++++
 qt4/demos/embeddedfiles.h   |    1 +
 qt4/demos/optcontent.cpp    |    8 ++++++++
 qt4/demos/optcontent.h      |    1 +
 4 files changed, 17 insertions(+)

New commits:
commit 31ce4049bf12c2716be7ec0fb8eda502d989f66e
Author: Brad Hards <bradh at saxicola.cuneata.net>
Date:   Thu Feb 28 22:09:30 2008 +1100

    Respect PageMode for optional content and embedded files.
    
    This makes the PDF 1.7 spec open with the embedded files showing.

diff --git a/qt4/demos/embeddedfiles.cpp b/qt4/demos/embeddedfiles.cpp
index a91d8dd..de8119e 100644
--- a/qt4/demos/embeddedfiles.cpp
+++ b/qt4/demos/embeddedfiles.cpp
@@ -65,6 +65,13 @@ void EmbeddedFilesDock::fillInfo()
     }
 }
 
+void EmbeddedFilesDock::documentLoaded()
+{
+    if ( document()->pageMode() == Poppler::Document::UseAttach ) {
+        show();
+    }
+}
+
 void EmbeddedFilesDock::documentClosed()
 {
     m_table->clear();
diff --git a/qt4/demos/embeddedfiles.h b/qt4/demos/embeddedfiles.h
index b1b0d00..7cd6039 100644
--- a/qt4/demos/embeddedfiles.h
+++ b/qt4/demos/embeddedfiles.h
@@ -31,6 +31,7 @@ public:
     EmbeddedFilesDock(QWidget *parent = 0);
     ~EmbeddedFilesDock();
 
+    virtual void documentLoaded();
     /*virtual*/ void documentClosed();
 
 protected:
diff --git a/qt4/demos/optcontent.cpp b/qt4/demos/optcontent.cpp
index e2bc3ae..9c3f05a 100644
--- a/qt4/demos/optcontent.cpp
+++ b/qt4/demos/optcontent.cpp
@@ -37,6 +37,14 @@ OptContentDock::~OptContentDock()
 {
 }
 
+
+void OptContentDock::documentLoaded()
+{
+    if ( document()->pageMode() == Poppler::Document::UseOC ) {
+        show();
+    }  
+}
+
 void OptContentDock::fillInfo()
 {
     if (!document()->hasOptionalContent()) {
diff --git a/qt4/demos/optcontent.h b/qt4/demos/optcontent.h
index 3260f29..b933f5c 100644
--- a/qt4/demos/optcontent.h
+++ b/qt4/demos/optcontent.h
@@ -31,6 +31,7 @@ public:
     OptContentDock(QWidget *parent = 0);
     ~OptContentDock();
 
+    /*virtual*/ void documentLoaded();
     /*virtual*/ void documentClosed();
 
 protected:


More information about the poppler mailing list