[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/kpdf/annotations/kdegraphics/kpdf
From:       Enrico Ros <rosenric () dei ! unipd ! it>
Date:       2005-07-27 23:39:50
Message-ID: 1122507590.702858.10425.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 439379 by eros:

Merging trunk changes (now 3.5) till 2005-07-27.
patch_131.
This last patch contains:
o correct implementation for Quit links
o merged implementation of Close links
o Link z-order fixes
o cursor updating on doc close
-- annotations branch is synced and contains KPDF-3.5-NOW --


 M  +1 -0      TODO  
 M  +1 -1      core/document.cpp  
 M  +1 -0      core/document.h  
 M  +1 -1      core/generator_pdf/gp_outputdev.cpp  
 M  +22 -1     part.cpp  
 M  +4 -0      part.h  
 M  +1 -0      shell/shell.cpp  
 M  +3 -1      shell/shell.h  
 M  +5 -0      ui/pageview.cpp  


--- branches/kpdf/annotations/kdegraphics/kpdf/TODO #439378:439379
@@ -32,6 +32,7 @@
 -> pageview: change document viewport after mouse scrolling ended (not every scroll \
frame)  this will give better mvc consistancy
 -> send current file as attachment by mail
+-> links: check wether to separate close presentation and close document actions
 -> other info on pdfs properties: number of accessed times, time spent on pdf, ...
 -> part: collapsing the left panel will hide it (activate hiding action)
 -> preload: add a delay when forward loading pages
--- branches/kpdf/annotations/kdegraphics/kpdf/core/document.cpp #439378:439379
@@ -1047,7 +1047,7 @@
                     setNextViewport();
                     break;
                 case KPDFLinkAction::Quit:
-                    kapp->quit();
+                    emit linkQuit();
                     break;
                 case KPDFLinkAction::Presentation:
                     emit linkPresentation();
--- branches/kpdf/annotations/kdegraphics/kpdf/core/document.h #439378:439379
@@ -104,6 +104,7 @@
         void requestDone( PixmapRequest * request );
 
     signals:
+        void linkQuit();
         void linkFind();
         void linkGoToPage();
         void linkPresentation();
--- branches/kpdf/annotations/kdegraphics/kpdf/core/generator_pdf/gp_outputdev.cpp \
#439378:439379 @@ -174,7 +174,7 @@
             // create the rect using normalized coords and attach the KPDFLink to it
             ObjectRect * rect = new ObjectRect( nl, nt, nr, nb, ObjectRect::Link, l \
);  // add the ObjectRect to the vector container
-            m_rects.push_back( rect );
+            m_rects.push_front( rect );
         }
     }
     SplashOutputDev::drawLink( link, catalog );
--- branches/kpdf/annotations/kdegraphics/kpdf/part.cpp #439378:439379
@@ -112,6 +112,11 @@
 	connect( m_document, SIGNAL( linkPresentation() ), this, SLOT( \
slotShowPresentation() ) );  connect( m_document, SIGNAL( linkEndPresentation() ), \
this, SLOT( slotHidePresentation() ) );  connect( m_document, SIGNAL( openURL(const \
KURL &) ), this, SLOT( openURL(const KURL &) ) ); +	bool inShell = parent && \
parent->metaObject()->slotNames( true ).contains( "slotQuit()" ); +	if ( inShell )
+		connect( m_document, SIGNAL( linkQuit() ), parent, SLOT( slotQuit() ) );
+	else
+		connect( m_document, SIGNAL( linkQuit() ), this, SLOT( cannotQuitMessage() ) );
 
         // widgets: ^searchbar (toolbar containing label and SearchWidget)
 //      m_searchToolBar = new KToolBar( parentWidget, "searchBar" );
@@ -455,10 +460,12 @@
     m_printPreview->setEnabled( false );
     m_showProperties->setEnabled( false );
     m_showPresentation->setEnabled( false );
-    updateViewActions();
     m_searchStarted = false;
+    emit setWindowCaption("");
+    emit enablePrintAction(false);
     if (!m_file.isEmpty()) m_watcher->removeFile(m_file);
     m_document->closeDocument();
+    updateViewActions();
     m_searchWidget->clearText();
     return KParts::ReadOnlyPart::closeURL();
 }
@@ -558,6 +565,11 @@
 	m_toolBox->setItemEnabled(0, enable);
 }
 
+void Part::cannotQuitMessage()
+{
+	KMessageBox::information( widget(), i18n("This link points to a quit application \
action that does not work when using the embedded viewer."), QString::null, \
"warnNoQuitIfNotInKPDF" ); +}
+
 //BEGIN go to page dialog
 class KPDFGotoPageDialog : public KDialogBase
 {
@@ -859,7 +871,16 @@
 void Part::slotHidePresentation()
 {
     if ( m_presentationWidget )
+    {
         delete (PresentationWidget*) m_presentationWidget;
+        return;
+    }
+
+    // if no presentation to hide, do it on the document itself
+    if ( parent() && !strcmp(parent()->name(), "KPDF::Shell") )
+        closeURL();
+    else
+        KMessageBox::information( widget(), i18n("This link points to a close \
document action that does not work when using the embedded viewer."), QString::null, \
"warnNoCloseIfNotInKPDF" );  }
 
 void Part::slotPrint()
--- branches/kpdf/annotations/kdegraphics/kpdf/part.h #439378:439379
@@ -79,6 +79,9 @@
 	uint currentPage();
 	KURL currentDocument();
 
+signals:
+	void enablePrintAction( bool enable );
+
 protected:
 	// reimplemented from KParts::ReadOnlyPart
 	bool openFile();
@@ -112,6 +115,7 @@
 	// can be connected to widget elements
 	void updateViewActions();
 	void enableTOC(bool enable);
+	void cannotQuitMessage();
 
 public slots:
 	// connected to Shell action (and browserExtension), not local one
--- branches/kpdf/annotations/kdegraphics/kpdf/shell/shell.cpp #439378:439379
@@ -89,6 +89,7 @@
   }
   connect( this, SIGNAL( restoreDocument(const KURL &, int) ),m_part, SLOT( \
restoreDocument(const KURL &, int)));  connect( this, SIGNAL( \
saveDocumentRestoreInfo(KConfig*) ), m_part, SLOT( \
saveDocumentRestoreInfo(KConfig*))); +  connect( m_part, SIGNAL( \
enablePrintAction(bool) ), m_printAction, SLOT( setEnabled(bool)));  
   readSettings();
   if (!KGlobal::config()->hasGroup("MainWindow"))
--- branches/kpdf/annotations/kdegraphics/kpdf/shell/shell.h #439378:439379
@@ -69,9 +69,11 @@
     void writeSettings();
     void setFullScreen( bool );
 
+  public slots:
+    void slotQuit();
+
   private slots:
     void fileOpen();
-    void slotQuit();
 
     void optionsConfigureToolbars();
     void applyNewToolbarConfig();
--- branches/kpdf/annotations/kdegraphics/kpdf/ui/pageview.cpp #439378:439379
@@ -309,7 +309,12 @@
         // so pages are never relayouted
         slotRelayoutPages();
     else
+    {
+        // update the mouse cursor when closing because we may have close through a \
link and +        // want the cursor to come back to the normal cursor
+        updateCursor( viewportToContents( mapFromGlobal( QCursor::pos() ) ) );
         resizeContents( 0, 0 );
+    }
 
     // OSD to display pages
     if ( documentChanged && pageSet.count() > 0 && KpdfSettings::showOSD() )


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic