Commit 60463481 authored by Enrico Ros's avatar Enrico Ros

applying patch_113 (tinyurl.com/8t5ec)

svn path=/branches/kpdf/annotations/kdegraphics/kpdf/; revision=428591
parent 383459da
...@@ -83,13 +83,14 @@ Part::Part(QWidget *parentWidget, const char *widgetName, ...@@ -83,13 +83,14 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name, QObject *parent, const char *name,
const QStringList & /*args*/ ) const QStringList & /*args*/ )
: DCOPObject("kpdf"), KParts::ReadOnlyPart(parent, name), m_dirtyViewport( 0 ), : DCOPObject("kpdf"), KParts::ReadOnlyPart(parent, name), m_dirtyViewport( 0 ),
m_showMenuBarAction(0), m_showFullScreenAction(0), m_actionsSearched(false), m_searchStarted(false) m_showMenuBarAction(0), m_showFullScreenAction(0), m_actionsSearched(false),
m_searchStarted(false), m_notifyOpening(false)
{ {
// load catalog for translation // load catalog for translation
KGlobal::locale()->insertCatalogue("kpdf"); KGlobal::locale()->insertCatalogue("kpdf");
// create browser extension (for printing when embedded into browser) // create browser extension (for printing when embedded into browser)
new BrowserExtension(this); m_bExtension = new BrowserExtension(this);
// xpdf 'extern' global class (m_count is a static instance counter) // xpdf 'extern' global class (m_count is a static instance counter)
//if ( m_count ) TODO check if we need to insert these lines.. //if ( m_count ) TODO check if we need to insert these lines..
...@@ -107,7 +108,7 @@ Part::Part(QWidget *parentWidget, const char *widgetName, ...@@ -107,7 +108,7 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
connect( m_document, SIGNAL( linkGoToPage() ), this, SLOT( slotGoToPage() ) ); connect( m_document, SIGNAL( linkGoToPage() ), this, SLOT( slotGoToPage() ) );
connect( m_document, SIGNAL( linkPresentation() ), this, SLOT( slotShowPresentation() ) ); connect( m_document, SIGNAL( linkPresentation() ), this, SLOT( slotShowPresentation() ) );
connect( m_document, SIGNAL( linkEndPresentation() ), this, SLOT( slotHidePresentation() ) ); connect( m_document, SIGNAL( linkEndPresentation() ), this, SLOT( slotHidePresentation() ) );
connect( m_document, SIGNAL( openURL(const KURL &) ), this, SLOT( openURL(const KURL &) ) ); connect( m_document, SIGNAL( openURL(const KURL &) ), this, SLOT( openURLFromDocument(const KURL &) ) );
// widgets: [] splitter [] // widgets: [] splitter []
m_splitter = new QSplitter( parentWidget, widgetName ); m_splitter = new QSplitter( parentWidget, widgetName );
...@@ -377,6 +378,12 @@ bool Part::openFile() ...@@ -377,6 +378,12 @@ bool Part::openFile()
return true; return true;
} }
void Part::openURLFromDocument(const KURL &url)
{
m_notifyOpening = true;
openURL(url);
}
bool Part::openURL(const KURL &url) bool Part::openURL(const KURL &url)
{ {
// note: this can be the right place to check the file for gz or bz2 extension // note: this can be the right place to check the file for gz or bz2 extension
...@@ -385,6 +392,12 @@ bool Part::openURL(const KURL &url) ...@@ -385,6 +392,12 @@ bool Part::openURL(const KURL &url)
// this calls in sequence the 'closeURL' and 'openFile' methods // this calls in sequence the 'closeURL' and 'openFile' methods
bool openOk = KParts::ReadOnlyPart::openURL(url); bool openOk = KParts::ReadOnlyPart::openURL(url);
if ( m_notifyOpening )
{
m_bExtension->openURLNotify();
m_bExtension->setLocationBarURL( url.prettyURL() );
m_notifyOpening = false;
}
if ( openOk ) if ( openOk )
{ {
delete m_dirtyViewport; delete m_dirtyViewport;
......
...@@ -111,6 +111,8 @@ protected slots: ...@@ -111,6 +111,8 @@ protected slots:
// can be connected to widget elements // can be connected to widget elements
void updateViewActions(); void updateViewActions();
void enableTOC(bool enable); void enableTOC(bool enable);
void openURLFromDocument(const KURL &url);
public slots: public slots:
// connected to Shell action (and browserExtension), not local one // connected to Shell action (and browserExtension), not local one
...@@ -162,6 +164,8 @@ private: ...@@ -162,6 +164,8 @@ private:
KToggleAction* m_showFullScreenAction; KToggleAction* m_showFullScreenAction;
bool m_actionsSearched; bool m_actionsSearched;
bool m_searchStarted; bool m_searchStarted;
BrowserExtension *m_bExtension;
bool m_notifyOpening;
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment