QAction, more includes fixed

frameworks
Frederik Gladhorn 12 years ago
parent 4ce837a7ac
commit 96b0e27c44
  1. 2
      conf/preferencesdialog.cpp
  2. 1
      core/document.cpp
  3. 2
      core/document.h
  4. 1
      extensions.h
  5. 1
      generators/txt/generator_txt.cpp
  6. 23
      part.cpp
  7. 55
      part.h

@ -42,7 +42,7 @@ PreferencesDialog::PreferencesDialog( QWidget * parent, KConfigSkeleton * skelet
addPage( m_performance, i18n("Performance"), "preferences-system-performance", i18n("Performance Tuning") ); addPage( m_performance, i18n("Performance"), "preferences-system-performance", i18n("Performance Tuning") );
if( embedMode == Okular::ViewerWidgetMode ) if( embedMode == Okular::ViewerWidgetMode )
{ {
setCaption( i18n("Configure Viewer") ); setWindowTitle( i18n("Configure Viewer") );
} }
else else
{ {

@ -39,7 +39,6 @@
#include <kaboutdata.h> #include <kaboutdata.h>
#include <k4aboutdata.h> #include <k4aboutdata.h>
#include <kauthorized.h> #include <kauthorized.h>
#include <kcomponentdata.h>
#include <kconfigdialog.h> #include <kconfigdialog.h>
#include <kdebug.h> #include <kdebug.h>
#include <klibloader.h> #include <klibloader.h>

@ -23,9 +23,9 @@
#include <QtXml/QDomDocument> #include <QtXml/QDomDocument>
#include <kmimetype.h> #include <kmimetype.h>
#include <kcomponentdata.h>
class QPrintDialog; class QPrintDialog;
class KComponentData;
class KBookmark; class KBookmark;
class KConfigDialog; class KConfigDialog;
class KXMLGUIClient; class KXMLGUIClient;

@ -12,6 +12,7 @@
#define _EXTENSIONS_H_ #define _EXTENSIONS_H_
#include <kparts/browserextension.h> #include <kparts/browserextension.h>
#include <kparts/liveconnectextension.h>
namespace Okular namespace Okular
{ {

@ -12,6 +12,7 @@
#include "converter.h" #include "converter.h"
#include <kaboutdata.h> #include <kaboutdata.h>
#include <klocalizedstring.h>
#include <KConfigDialog> #include <KConfigDialog>
static KAboutData createAboutData() static KAboutData createAboutData()

@ -37,6 +37,7 @@
#include <kaboutapplicationdialog.h> #include <kaboutapplicationdialog.h>
#include <kaction.h> #include <kaction.h>
#include <kactioncollection.h> #include <kactioncollection.h>
#include <kbookmarkaction.h>
#include <kdirwatch.h> #include <kdirwatch.h>
#include <kstandardaction.h> #include <kstandardaction.h>
#include <kpluginfactory.h> #include <kpluginfactory.h>
@ -210,7 +211,7 @@ static QString compressedMimeFor( const QString& mime_to_check )
compressedMimeMap[ QString::fromLatin1( "application/x-bzdvi" ) ] = app_bzip; compressedMimeMap[ QString::fromLatin1( "application/x-bzdvi" ) ] = app_bzip;
compressedMimeMap[ QString::fromLatin1( "image/x-bzeps" ) ] = app_bzip; compressedMimeMap[ QString::fromLatin1( "image/x-bzeps" ) ] = app_bzip;
} }
// check we can read XZ-compressed files // check if we can read XZ-compressed files
f.reset( KFilterBase::findFilterByMimeType( app_xz ) ); f.reset( KFilterBase::findFilterByMimeType( app_xz ) );
if ( f.get() ) if ( f.get() )
{ {
@ -713,7 +714,7 @@ void Part::setupViewerActions()
reload->setIcon( KIcon( "view-refresh" ) ); reload->setIcon( KIcon( "view-refresh" ) );
reload->setWhatsThis( i18n( "Reload the current document from disk." ) ); reload->setWhatsThis( i18n( "Reload the current document from disk." ) );
connect( reload, SIGNAL(triggered()), this, SLOT(slotReload()) ); connect( reload, SIGNAL(triggered()), this, SLOT(slotReload()) );
reload->setShortcut( KStandardShortcut::reload() ); reload->setShortcut( QKeySequence(QKeySequence::Refresh) );
m_reload = reload; m_reload = reload;
m_closeFindBar = ac->addAction( "close_find_bar", this, SLOT(slotHideFindBar()) ); m_closeFindBar = ac->addAction( "close_find_bar", this, SLOT(slotHideFindBar()) );
@ -755,7 +756,7 @@ void Part::setupActions()
m_saveCopyAs = KStandardAction::saveAs( this, SLOT(slotSaveCopyAs()), ac ); m_saveCopyAs = KStandardAction::saveAs( this, SLOT(slotSaveCopyAs()), ac );
m_saveCopyAs->setText( i18n( "Save &Copy As..." ) ); m_saveCopyAs->setText( i18n( "Save &Copy As..." ) );
m_saveCopyAs->setShortcut( KShortcut() ); m_saveCopyAs->setShortcut( QKeySequence(QKeySequence::SaveAs) );
ac->addAction( "file_save_copy", m_saveCopyAs ); ac->addAction( "file_save_copy", m_saveCopyAs );
m_saveCopyAs->setEnabled( false ); m_saveCopyAs->setEnabled( false );
@ -1050,7 +1051,7 @@ void Part::loadCancelled(const QString &reason)
{ {
if (!reason.isEmpty()) if (!reason.isEmpty())
{ {
KMessageBox::error( widget(), i18n("Could not open %1. Reason: %2", url().prettyUrl(), reason ) ); KMessageBox::error( widget(), i18n("Could not open %1. Reason: %2", url().toDisplayString(), reason ) );
} }
} }
} }
@ -1081,11 +1082,11 @@ KConfigDialog * Part::slotGeneratorPreferences( )
if( m_embedMode == ViewerWidgetMode ) if( m_embedMode == ViewerWidgetMode )
{ {
dialog->setCaption( i18n( "Configure Viewer Backends" ) ); dialog->setWindowTitle( i18n( "Configure Viewer Backends" ) );
} }
else else
{ {
dialog->setCaption( i18n( "Configure Backends" ) ); dialog->setWindowTitle( i18n( "Configure Backends" ) );
} }
m_document->fillConfigDialog( dialog ); m_document->fillConfigDialog( dialog );
@ -1224,7 +1225,7 @@ bool Part::openFile()
{ {
KMimeType::Ptr mime; KMimeType::Ptr mime;
QString fileNameToOpen = localFilePath(); QString fileNameToOpen = localFilePath();
const bool isstdin = url().isLocalFile() && url().fileName( KUrl::ObeyTrailingSlash ) == QLatin1String( "-" ); const bool isstdin = url().isLocalFile() && url().adjusted(QUrl::RemoveFilename) == QLatin1String( "-" );
const QFileInfo fileInfo( fileNameToOpen ); const QFileInfo fileInfo( fileNameToOpen );
if ( !isstdin && !fileInfo.exists() ) if ( !isstdin && !fileInfo.exists() )
return false; return false;
@ -1304,7 +1305,7 @@ bool Part::openFile()
// if the user presses cancel, abort opening // if the user presses cancel, abort opening
KPasswordDialog dlg( widget(), wallet ? KPasswordDialog::ShowKeepPassword : KPasswordDialog::KPasswordDialogFlags() ); KPasswordDialog dlg( widget(), wallet ? KPasswordDialog::ShowKeepPassword : KPasswordDialog::KPasswordDialogFlags() );
dlg.setCaption( i18n( "Document Password" ) ); dlg.setWindowTitle( i18n( "Document Password" ) );
dlg.setPrompt( prompt ); dlg.setPrompt( prompt );
if( !dlg.exec() ) if( !dlg.exec() )
break; break;
@ -2083,7 +2084,7 @@ void Part::slotPreviousBookmark()
if ( !bookmark.isNull() ) if ( !bookmark.isNull() )
{ {
DocumentViewport vp( bookmark.url().htmlRef() ); DocumentViewport vp( bookmark.url().fragment(QUrl::FullyDecoded) );
m_document->setViewport( vp ); m_document->setViewport( vp );
} }
} }
@ -2095,7 +2096,7 @@ void Part::slotNextBookmark()
if ( !bookmark.isNull() ) if ( !bookmark.isNull() )
{ {
DocumentViewport vp( bookmark.url().htmlRef() ); DocumentViewport vp( bookmark.url().fragment(QUrl::FullyDecoded) );
m_document->setViewport( vp ); m_document->setViewport( vp );
} }
} }
@ -2574,7 +2575,7 @@ void Part::slotExportAs(QAction * act)
filter = m_exportFormats.at( id - 2 ).mimeType()->name(); filter = m_exportFormats.at( id - 2 ).mimeType()->name();
break; break;
} }
QString fileName = KFileDialog::getSaveFileName( url().isLocalFile() ? url().directory() : QString(), QString fileName = KFileDialog::getSaveFileName( url().isLocalFile() ? url().adjusted(QUrl::RemoveFilename) : QString(),
filter, widget(), QString(), filter, widget(), QString(),
KFileDialog::ConfirmOverwrite ); KFileDialog::ConfirmOverwrite );
if ( !fileName.isEmpty() ) if ( !fileName.isEmpty() )

@ -16,7 +16,7 @@
#ifndef _PART_H_ #ifndef _PART_H_
#define _PART_H_ #define _PART_H_
#include <kparts/part.h> #include <kparts/readwritepart.h>
#include <kpluginfactory.h> #include <kpluginfactory.h>
#include <kmessagewidget.h> #include <kmessagewidget.h>
#include <qicon.h> #include <qicon.h>
@ -24,6 +24,7 @@
#include <qpointer.h> #include <qpointer.h>
#include <qprocess.h> #include <qprocess.h>
#include <kurl.h> #include <kurl.h>
#include <kio/job.h>
#include "core/observer.h" #include "core/observer.h"
#include "core/document.h" #include "core/document.h"
#include "kdocumentviewer.h" #include "kdocumentviewer.h"
@ -293,39 +294,39 @@ class OKULAR_PART_EXPORT Part : public KParts::ReadWritePart, public Okular::Doc
QStringList m_searchHistory; QStringList m_searchHistory;
// actions // actions
KAction *m_gotoPage; QAction *m_gotoPage;
KAction *m_prevPage; QAction *m_prevPage;
KAction *m_nextPage; QAction *m_nextPage;
KAction *m_beginningOfDocument; QAction *m_beginningOfDocument;
KAction *m_endOfDocument; QAction *m_endOfDocument;
KAction *m_historyBack; QAction *m_historyBack;
KAction *m_historyNext; QAction *m_historyNext;
KAction *m_addBookmark; QAction *m_addBookmark;
KAction *m_renameBookmark; QAction *m_renameBookmark;
KAction *m_prevBookmark; QAction *m_prevBookmark;
KAction *m_nextBookmark; QAction *m_nextBookmark;
KAction *m_copy; QAction *m_copy;
KAction *m_selectAll; QAction *m_selectAll;
KAction *m_find; QAction *m_find;
KAction *m_findNext; QAction *m_findNext;
KAction *m_findPrev; QAction *m_findPrev;
KAction *m_saveAs; QAction *m_saveAs;
KAction *m_saveCopyAs; QAction *m_saveCopyAs;
KAction *m_printPreview; QAction *m_printPreview;
KAction *m_showProperties; QAction *m_showProperties;
KAction *m_showEmbeddedFiles; QAction *m_showEmbeddedFiles;
KAction *m_exportAs; QAction *m_exportAs;
QAction *m_exportAsText; QAction *m_exportAsText;
QAction *m_exportAsDocArchive; QAction *m_exportAsDocArchive;
KAction *m_showPresentation; QAction *m_showPresentation;
KToggleAction* m_showMenuBarAction; KToggleAction* m_showMenuBarAction;
KToggleAction* m_showLeftPanel; KToggleAction* m_showLeftPanel;
KToggleAction* m_showBottomBar; KToggleAction* m_showBottomBar;
KToggleFullScreenAction* m_showFullScreenAction; KToggleFullScreenAction* m_showFullScreenAction;
KAction *m_aboutBackend; QAction *m_aboutBackend;
KAction *m_reload; QAction *m_reload;
QMenu *m_exportAsMenu; QMenu *m_exportAsMenu;
KAction *m_closeFindBar; QAction *m_closeFindBar;
bool m_actionsSearched; bool m_actionsSearched;
BrowserExtension *m_bExtension; BrowserExtension *m_bExtension;

Loading…
Cancel
Save