|
|
|
|
@ -27,6 +27,7 @@ |
|
|
|
|
#include <klibloader.h> |
|
|
|
|
#include <kmessagebox.h> |
|
|
|
|
#include <kstdaction.h> |
|
|
|
|
#include <ktoolbar.h> |
|
|
|
|
#include <kurl.h> |
|
|
|
|
#include <kdebug.h> |
|
|
|
|
#include <klocale.h> |
|
|
|
|
@ -50,7 +51,7 @@ Shell::Shell() |
|
|
|
|
init(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Shell::Shell(const KURL &url) |
|
|
|
|
Shell::Shell(const KUrl &url) |
|
|
|
|
: KParts::MainWindow(0, "oKular::Shell"), m_menuBarWasShown(true), m_toolBarWasShown(true) |
|
|
|
|
{ |
|
|
|
|
m_openUrl = url; |
|
|
|
|
@ -92,7 +93,7 @@ void Shell::init() |
|
|
|
|
m_part = 0; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
connect( this, SIGNAL( restoreDocument(const KURL &, int) ),m_part, SLOT( restoreDocument(const KURL &, int))); |
|
|
|
|
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))); |
|
|
|
|
|
|
|
|
|
@ -120,7 +121,7 @@ Shell::~Shell() |
|
|
|
|
if ( m_tempfile ) delete m_tempfile;
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Shell::openURL( const KURL & url ) |
|
|
|
|
void Shell::openURL( const KUrl & url ) |
|
|
|
|
{ |
|
|
|
|
if ( m_part ) |
|
|
|
|
{ |
|
|
|
|
@ -154,7 +155,7 @@ void Shell::writeSettings() |
|
|
|
|
void Shell::setupActions() |
|
|
|
|
{ |
|
|
|
|
KAction * openAction = KStdAction::open(this, SLOT(fileOpen()), actionCollection()); |
|
|
|
|
m_recent = KStdAction::openRecent( this, SLOT( openURL( const KURL& ) ), actionCollection() ); |
|
|
|
|
m_recent = KStdAction::openRecent( this, SLOT( openURL( const KUrl& ) ), actionCollection() ); |
|
|
|
|
connect( m_recent, SIGNAL( activated() ), openAction, SLOT( activate() ) ); |
|
|
|
|
m_recent->setWhatsThis( i18n( "<b>Click</b> to open a file or <b>Click and hold</b> to select a recent file" ) ); |
|
|
|
|
m_printAction = KStdAction::print( m_part, SLOT( slotPrint() ), actionCollection() ); |
|
|
|
|
@ -184,7 +185,7 @@ void Shell::readProperties(KConfig* config) |
|
|
|
|
// in 'saveProperties'
|
|
|
|
|
if(m_part) |
|
|
|
|
{ |
|
|
|
|
KURL url ( config->readPathEntry( "URL" ) ); |
|
|
|
|
KUrl url ( config->readPathEntry( "URL" ) ); |
|
|
|
|
if ( url.isValid() ) emit restoreDocument(url, config->readNumEntry( "Page", 1 )); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -249,7 +250,7 @@ QStringList* Shell::fileFormats() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
bool Shell::handleCompressed(KURL & url, const QString &path, const KMimeType::Ptr mimetype) |
|
|
|
|
bool Shell::handleCompressed(KUrl & url, const QString &path, const KMimeType::Ptr mimetype) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
// we are working with a compressed file, decompressing
|
|
|
|
|
@ -343,7 +344,7 @@ void Shell::fileOpen() |
|
|
|
|
|
|
|
|
|
if (m_fileformats) |
|
|
|
|
{ |
|
|
|
|
KURL url = KFileDialog::getOpenURL( QString::null, m_fileformats->join("\n") );//getOpenFileName();
|
|
|
|
|
KUrl url = KFileDialog::getOpenURL( QString::null, m_fileformats->join("\n") );//getOpenFileName();
|
|
|
|
|
bool reallyOpen=!url.isEmpty(); |
|
|
|
|
if (reallyOpen) |
|
|
|
|
{ |
|
|
|
|
|