shell builds

svn path=/branches/work/kde4/playground/graphics/okular/; revision=521181
remotes/origin/old/work/newpageview
Albert Astals Cid 20 years ago
parent 178bab06cb
commit b261381531
  1. 2
      shell/main.cpp
  2. 15
      shell/shell.cpp
  3. 10
      shell/shell.h

@ -53,7 +53,7 @@ int main(int argc, char** argv)
KApplication app;
// see if we are starting with session management
if (app.isRestored())
if (app.isSessionRestored())
{
RESTORE(oKular::Shell);
} else {

@ -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)
{

@ -48,7 +48,7 @@ class Part;
/**
* Open an url
*/
Shell(const KURL &url);
Shell(const KUrl &url);
/**
* Default Destructor
@ -82,18 +82,18 @@ class Part;
void slotUpdateFullScreen();
void slotShowMenubar();
void openURL( const KURL & url );
void openURL( const KUrl & url );
void delayedOpen();
signals:
void restoreDocument(const KURL &url, int page);
void restoreDocument(const KUrl &url, int page);
void saveDocumentRestoreInfo(KConfig* config);
private:
void setupAccel();
void setupActions();
void init();
bool handleCompressed(KURL & url, const QString &path, const KMimeType::Ptr mimetype);
bool handleCompressed(KUrl & url, const QString &path, const KMimeType::Ptr mimetype);
QStringList* fileFormats();
private:
@ -106,7 +106,7 @@ class Part;
KToggleAction* m_showMenuBarAction;
KToggleAction* m_showToolBarAction;
bool m_menuBarWasShown, m_toolBarWasShown;
KURL m_openUrl;
KUrl m_openUrl;
};
}

Loading…
Cancel
Save