diff --git a/kpdf/kpdf_part.cpp b/kpdf/kpdf_part.cpp index 7ee65a790..5c06b67ee 100644 --- a/kpdf/kpdf_part.cpp +++ b/kpdf/kpdf_part.cpp @@ -39,8 +39,10 @@ #include #include #include +#include #include #include +#include #include "kpdf_error.h" #include "part.h" @@ -101,6 +103,7 @@ Part::Part(QWidget *parentWidget, const char *widgetName, SLOT( showMarkList( bool ) ) ); // create our actions + KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection(), "save"); m_find = KStdAction::find(this, SLOT(find()), actionCollection(), "find"); m_find->setEnabled(false); @@ -412,6 +415,22 @@ void Part::nextThumbnail() m_nextThumbnail++; if (m_nextThumbnail <= m_doc->getNumPages()) QTimer::singleShot(10, this, SLOT(nextThumbnail())); +} + + void +Part::fileSaveAs() +{ + KURL saveURL = KFileDialog::getSaveURL( + url().isLocalFile() + ? url().url() + : url().fileName(), + QString::null, + widget(), + QString::null ); + if( !KIO::NetAccess::upload( url().path(), + saveURL, static_cast( 0 ) ) ) + ; // TODO: Proper error dialog + } void diff --git a/kpdf/kpdf_part.h b/kpdf/kpdf_part.h index 4c5581de3..068d46bc2 100644 --- a/kpdf/kpdf_part.h +++ b/kpdf/kpdf_part.h @@ -162,6 +162,7 @@ namespace KPDF void redrawPage(); void pageClicked ( int ); void nextThumbnail(); + void fileSaveAs(); }; class BrowserExtension : public KParts::BrowserExtension diff --git a/kpdf/kpdf_part.rc b/kpdf/kpdf_part.rc index 9ab845c8d..8d925b62b 100644 --- a/kpdf/kpdf_part.rc +++ b/kpdf/kpdf_part.rc @@ -2,6 +2,7 @@ &File + diff --git a/kpdf/kpdf_shell.cpp b/kpdf/kpdf_shell.cpp index c10bcee4f..26a39f07d 100644 --- a/kpdf/kpdf_shell.cpp +++ b/kpdf/kpdf_shell.cpp @@ -122,7 +122,6 @@ Shell::setupActions() KStdAction::open(this, SLOT(fileOpen()), actionCollection()); recent = KStdAction::openRecent( this, SLOT( openURL( const KURL& ) ), actionCollection() ); - KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection()); KStdAction::print(m_part, SLOT(print()), actionCollection()); KStdAction::quit(this, SLOT(slotQuit()), actionCollection()); @@ -175,22 +174,6 @@ Shell::fileOpen() if (!url.isEmpty()) openURL(url); -} - - void -Shell::fileSaveAs() -{ - KURL saveURL = KFileDialog::getSaveURL( - m_part->url().isLocalFile() - ? m_part->url().url() - : m_part->url().fileName(), - QString::null, - m_part->widget(), - QString::null ); - if( !KIO::NetAccess::upload( m_part->url().path(), - saveURL, static_cast( 0 ) ) ) - ; // TODO: Proper error dialog - } void diff --git a/kpdf/kpdf_shell.h b/kpdf/kpdf_shell.h index f7be1bb5d..85df012c8 100644 --- a/kpdf/kpdf_shell.h +++ b/kpdf/kpdf_shell.h @@ -70,7 +70,6 @@ namespace KPDF private slots: void fileOpen(); - void fileSaveAs(); void slotQuit();