Commit 34edbef7 authored by Laurent Montel's avatar Laurent Montel 😁

Port to new api

svn path=/trunk/playground/graphics/okular/; revision=621624
parent 53c97a48
......@@ -296,9 +296,11 @@ bool PDFGenerator::loadDocument( const QString & filePath, QVector<Okular::Page*
firstInput = false;
// if the user presses cancel, abort opening
password = KPasswordDialog::getPassword( prompt, i18n( "Document Password" ), wallet ? &keep : 0 );
if ( password.isNull() )
KPasswordDialog dlg( 0 , KPasswordDialog::ShowUsernameLine );
dlg.setPrompt( prompt);
if( !dlg.exec() )
break;
password = dlg.password();
}
// 2. reopen the document using the password
......
......@@ -234,57 +234,74 @@ Part::Part(QWidget *parentWidget,
KActionCollection * ac = actionCollection();
// Page Traversal actions
m_gotoPage = KStandardAction::gotoPage( this, SLOT( slotGoToPage() ), ac, "goto_page" );
m_gotoPage = KStandardAction::gotoPage( this, SLOT( slotGoToPage() ), ac );
ac->addAction("goto_page", m_gotoPage);
m_gotoPage->setShortcut( QKeySequence(Qt::CTRL + Qt::Key_G) );
// dirty way to activate gotopage when pressing miniBar's button
connect( m_miniBar, SIGNAL( gotoPage() ), m_gotoPage, SLOT( trigger() ) );
m_prevPage = KStandardAction::prior(this, SLOT(slotPreviousPage()), ac, "previous_page");
m_prevPage = KStandardAction::prior(this, SLOT(slotPreviousPage()), ac);
ac->addAction("previous_page", m_prevPage);
m_prevPage->setWhatsThis( i18n( "Moves to the previous page of the document" ) );
m_prevPage->setShortcut( 0 );
// dirty way to activate prev page when pressing miniBar's button
connect( m_miniBar, SIGNAL( prevPage() ), m_prevPage, SLOT( trigger() ) );
connect( m_progressWidget, SIGNAL( prevPage() ), m_prevPage, SLOT( trigger() ) );
m_nextPage = KStandardAction::next(this, SLOT(slotNextPage()), ac, "next_page" );
m_nextPage = KStandardAction::next(this, SLOT(slotNextPage()), ac );
ac->addAction("next_page", m_nextPage);
m_nextPage->setWhatsThis( i18n( "Moves to the next page of the document" ) );
m_nextPage->setShortcut( 0 );
// dirty way to activate next page when pressing miniBar's button
connect( m_miniBar, SIGNAL( nextPage() ), m_nextPage, SLOT( trigger() ) );
connect( m_progressWidget, SIGNAL( nextPage() ), m_nextPage, SLOT( trigger() ) );
m_firstPage = KStandardAction::firstPage( this, SLOT( slotGotoFirst() ), ac, "first_page" );
m_firstPage = KStandardAction::firstPage( this, SLOT( slotGotoFirst() ), ac );
ac->addAction("first_page", m_firstPage);
m_firstPage->setWhatsThis( i18n( "Moves to the first page of the document" ) );
m_lastPage = KStandardAction::lastPage( this, SLOT( slotGotoLast() ), ac, "last_page" );
m_lastPage = KStandardAction::lastPage( this, SLOT( slotGotoLast() ), ac );
ac->addAction("last_page",m_lastPage);
m_lastPage->setWhatsThis( i18n( "Moves to the last page of the document" ) );
m_historyBack = KStandardAction::back( this, SLOT( slotHistoryBack() ), ac, "history_back" );
m_historyBack = KStandardAction::back( this, SLOT( slotHistoryBack() ), ac );
ac->addAction("history_back",m_historyBack);
m_historyBack->setWhatsThis( i18n( "Go to the place you were before" ) );
m_historyNext = KStandardAction::forward( this, SLOT( slotHistoryNext() ), ac, "history_forward" );
m_historyNext = KStandardAction::forward( this, SLOT( slotHistoryNext() ), ac);
ac->addAction("history_forward",m_historyNext);
m_historyNext->setWhatsThis( i18n( "Go to the place you were after" ) );
m_prevBookmark = new KAction( KIcon( "previous" ), i18n( "Previous Bookmark" ), ac, "previous_bookmark" );
m_prevBookmark = ac->addAction("previous_bookmark");
m_prevBookmark->setText(i18n( "Previous Bookmark" ));
m_prevBookmark->setIcon(KIcon( "previous" ));
m_prevBookmark->setWhatsThis( i18n( "Go to the previous bookmarked page" ) );
connect( m_prevBookmark, SIGNAL( triggered() ), this, SLOT( slotPreviousBookmark() ) );
m_nextBookmark = new KAction( KIcon( "next" ), i18n( "Next Bookmark" ), ac, "next_bookmark" );
m_nextBookmark = ac->addAction("next_bookmark");
m_nextBookmark->setText(i18n( "Next Bookmark" ));
m_nextBookmark->setIcon(KIcon( "next" ));
m_nextBookmark->setWhatsThis( i18n( "Go to the next bookmarked page" ) );
connect( m_nextBookmark, SIGNAL( triggered() ), this, SLOT( slotNextBookmark() ) );
m_copy = KStandardAction::create( KStandardAction::Copy, "edit_copy", m_pageView, SLOT( copyTextSelection() ), ac );
m_copy = KStandardAction::create( KStandardAction::Copy, m_pageView, SLOT( copyTextSelection() ), ac );
ac->addAction("edit_copy",m_copy);
// Find and other actions
m_find = KStandardAction::find( this, SLOT( slotFind() ), ac, "find" );
m_find = KStandardAction::find( this, SLOT( slotFind() ), ac );
ac->addAction("find", m_find);
m_find->setEnabled( false );
m_findNext = KStandardAction::findNext( this, SLOT( slotFindNext() ), ac, "find_next" );
m_findNext = KStandardAction::findNext( this, SLOT( slotFindNext() ), ac);
ac->addAction("find_next",m_findNext);
m_findNext->setEnabled( false );
m_saveAs = KStandardAction::saveAs( this, SLOT( slotSaveFileAs() ), ac, "save" );
m_saveAs = KStandardAction::saveAs( this, SLOT( slotSaveFileAs() ), ac );
ac->addAction("save",m_saveAs);
m_saveAs->setEnabled( false );
KAction * prefs = KStandardAction::preferences( this, SLOT( slotPreferences() ), ac, "preferences" );
QAction * prefs = KStandardAction::preferences( this, SLOT( slotPreferences() ), ac);
ac->addAction("preferences", prefs);
if ( parent && ( parent->objectName() == QLatin1String( "okular::Shell" ) ) )
{
prefs->setText( i18n( "Configure okular..." ) );
......@@ -294,7 +311,8 @@ Part::Part(QWidget *parentWidget,
prefs->setText( i18n( "Configure Viewer..." ) ); // TODO: improve this message
}
KAction * genPrefs = KStandardAction::preferences( this, SLOT( slotGeneratorPreferences() ), ac, "generator_prefs" );
QAction * genPrefs = KStandardAction::preferences( this, SLOT( slotGeneratorPreferences() ), ac );
ac->addAction("generator_prefs", genPrefs);
genPrefs->setText( i18n( "Configure Backends..." ) );
QString constraint("([X-KDE-Priority] > 0) and (exist Library) and ([X-KDE-okularHasInternalSettings])") ;
KService::List gens = KServiceTypeTrader::self()->query("okular/Generator",constraint);
......@@ -306,33 +324,45 @@ Part::Part(QWidget *parentWidget,
m_printPreview = KStandardAction::printPreview( this, SLOT( slotPrintPreview() ), ac );
m_printPreview->setEnabled( false );
m_showLeftPanel = new KToggleAction( KIcon( "show_side_panel" ), i18n( "Show &Navigation Panel"), ac, "show_leftpanel" );
m_showLeftPanel = ac->add<KToggleAction>("show_leftpanel");
m_showLeftPanel->setText(i18n( "Show &Navigation Panel"));
m_showLeftPanel->setIcon(KIcon( "show_side_panel" ));
connect( m_showLeftPanel, SIGNAL( toggled( bool ) ), this, SLOT( slotShowLeftPanel() ) );
m_showLeftPanel->setShortcut( QKeySequence(Qt::CTRL + Qt::Key_L) );
m_showLeftPanel->setCheckedState( KGuiItem(i18n( "Hide &Navigation Panel" ) ));
m_showLeftPanel->setChecked( Okular::Settings::showLeftPanel() );
slotShowLeftPanel();
KAction * importPS= new KAction(KIcon("psimport"), i18n("&Import Postscript as PDF..."), ac, "import_ps");
QAction * importPS = ac->addAction("import_ps");
importPS->setText(i18n("&Import Postscript as PDF..."));
importPS->setIcon(KIcon("psimport"));
connect(importPS, SIGNAL(triggered()), this, SLOT(slotImportPSFile()));
KAction * ghns = new KAction(KIcon("knewstuff"), i18n("&Get Books From Internet..."), ac, "get_new_stuff");
QAction * ghns = ac->addAction("get_new_stuff");
ghns->setText(i18n("&Get Books From Internet..."));
ghns->setIcon(KIcon("knewstuff"));
connect(ghns, SIGNAL(triggered()), this, SLOT(slotGetNewStuff()));
ghns->setShortcut( Qt::Key_G ); // TEMP, REMOVE ME!
m_showProperties = new KAction(KIcon("info"), i18n("&Properties"), ac, "properties");
m_showProperties = ac->addAction("properties");
m_showProperties->setText(i18n("&Properties"));
m_showProperties->setIcon(KIcon("info"));
connect(m_showProperties, SIGNAL(triggered()), this, SLOT(slotShowProperties()));
m_showProperties->setEnabled( false );
m_showEmbeddedFiles = new KAction(i18n("&Embedded Files"), ac, "embedded_files");
m_showEmbeddedFiles = ac->addAction("embedded_files");
m_showEmbeddedFiles->setText(i18n("&Embedded Files"));
connect(m_showEmbeddedFiles, SIGNAL(triggered()), this, SLOT(slotShowEmbeddedFiles()));
m_showEmbeddedFiles->setEnabled( false );
m_showPresentation = new KAction( KIcon( "kpresenter_kpr" ), i18n("P&resentation"), ac, "presentation");
m_showPresentation = ac->addAction("presentation");
m_showPresentation->setText(i18n("P&resentation"));
m_showPresentation->setIcon(KIcon( "kpresenter_kpr" ));
connect(m_showPresentation, SIGNAL(triggered()), this, SLOT(slotShowPresentation()));
m_showPresentation->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_P ) );
m_showPresentation->setEnabled( false );
m_exportAs = new KAction(i18n("E&xport As"), ac, "file_export_as");
m_exportAs = ac->addAction("file_export_as");
m_exportAs->setText(i18n("E&xport As"));
QMenu *menu = new QMenu(widget());
connect(menu, SIGNAL(triggered(QAction *)), this, SLOT(slotExportAs(QAction *)));
m_exportAs->setMenu( menu );
......
......@@ -183,25 +183,25 @@ private:
QStringList m_searchHistory;
// actions
KAction *m_gotoPage;
KAction *m_prevPage;
KAction *m_nextPage;
KAction *m_firstPage;
KAction *m_lastPage;
KAction *m_historyBack;
KAction *m_historyNext;
KAction *m_prevBookmark;
KAction *m_nextBookmark;
KAction *m_copy;
KAction *m_find;
KAction *m_findNext;
KAction *m_saveAs;
KAction *m_printPreview;
KAction *m_showProperties;
KAction *m_showEmbeddedFiles;
KAction *m_exportAs;
QAction *m_gotoPage;
QAction *m_prevPage;
QAction *m_nextPage;
QAction *m_firstPage;
QAction *m_lastPage;
QAction *m_historyBack;
QAction *m_historyNext;
QAction *m_prevBookmark;
QAction *m_nextBookmark;
QAction *m_copy;
QAction *m_find;
QAction *m_findNext;
QAction *m_saveAs;
QAction *m_printPreview;
QAction *m_showProperties;
QAction *m_showEmbeddedFiles;
QAction *m_exportAs;
QAction *m_exportAsText;
KAction *m_showPresentation;
QAction *m_showPresentation;
KToggleAction* m_showMenuBarAction;
KToggleAction* m_showLeftPanel;
KToggleFullScreenAction* m_showFullScreenAction;
......
......@@ -42,7 +42,7 @@
#include <ktemporaryfile.h>
#include <kfilterbase.h>
#include <kfilterdev.h>
#include <kactioncollection.h>
// local includes
#include "shell.h"
#include "kdocumentviewer.h"
......@@ -175,7 +175,7 @@ void Shell::setupActions()
m_showMenuBarAction = KStandardAction::showMenubar( this, SLOT( slotShowMenubar() ), actionCollection());
KStandardAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection());
m_fullScreenAction = KStandardAction::fullScreen( this, SLOT( slotUpdateFullScreen() ), actionCollection(), this );
m_fullScreenAction = KStandardAction::fullScreen( this, SLOT( slotUpdateFullScreen() ), this,actionCollection() );
}
void Shell::saveProperties(KConfig* config)
......
......@@ -15,7 +15,6 @@
#include <qlayout.h>
#include <qspinbox.h>
#include <qvariant.h>
#include <kapplication.h>
#include <kcolorbutton.h>
#include <kfontrequester.h>
#include <kiconloader.h>
......@@ -89,9 +88,9 @@ void PixmapPreviewSelector::iconComboChanged( const QString& icon )
m_icon = m_comboItems->itemData( id ).toString();
QString path;
QPixmap pixmap = kapp->iconLoader()->loadIcon( m_icon.toLower(), K3Icon::User, m_previewSize, K3Icon::DefaultState, &path, true );
QPixmap pixmap = KIconLoader::global()->loadIcon( m_icon.toLower(), K3Icon::User, m_previewSize, K3Icon::DefaultState, &path, true );
if ( path.isEmpty() )
pixmap = kapp->iconLoader()->loadIcon( m_icon.toLower(), K3Icon::NoGroup, m_previewSize );
pixmap = KIconLoader::global()->loadIcon( m_icon.toLower(), K3Icon::NoGroup, m_previewSize );
m_iconLabel->setPixmap( pixmap );
}
......
......@@ -14,12 +14,11 @@
#include <qpixmap.h>
#include <qimage.h>
#include <qvarlengtharray.h>
#include <kapplication.h>
#include <kimageeffect.h>
#include <kiconloader.h>
#include <kstaticdeleter.h>
#include <kdebug.h>
#include <QApplication>
// system includes
#include <math.h>
......@@ -79,7 +78,7 @@ void PagePainter::paintPageOnPainter( QPainter * destPainter, const Okular::Page
if ( !busyPixmap )
{
sd.setObject(busyPixmap, new QPixmap());
*busyPixmap = kapp->iconLoader()->loadIcon("okular", K3Icon::NoGroup, 32, K3Icon::DefaultState, 0, true);
*busyPixmap = KIconLoader::global()->loadIcon("okular", K3Icon::NoGroup, 32, K3Icon::DefaultState, 0, true);
}
// draw something on the blank page: the okular icon or a cross (as a fallback)
if ( busyPixmap && !busyPixmap->isNull() )
......@@ -558,9 +557,9 @@ void PagePainter::paintPageOnPainter( QPainter * destPainter, const Okular::Page
{
// get pixmap, colorize and alpha-blend it
QString path;
QPixmap pixmap = kapp->iconLoader()->loadIcon( text->textIcon().toLower(), K3Icon::User, 32, K3Icon::DefaultState, &path, true );
QPixmap pixmap = KIconLoader::global()->loadIcon( text->textIcon().toLower(), K3Icon::User, 32, K3Icon::DefaultState, &path, true );
if ( path.isEmpty() )
pixmap = kapp->iconLoader()->loadIcon( text->textIcon().toLower(), K3Icon::NoGroup, 32 );
pixmap = KIconLoader::global()->loadIcon( text->textIcon().toLower(), K3Icon::NoGroup, 32 );
QImage scaledImage;
QRect annotBoundary2 = QRect( annotBoundary.topLeft(), QSize( TEXTANNOTATION_ICONSIZE, TEXTANNOTATION_ICONSIZE ) );
QRect annotRect2 = annotBoundary2.intersect( limits );
......@@ -588,9 +587,9 @@ void PagePainter::paintPageOnPainter( QPainter * destPainter, const Okular::Page
// get pixmap and alpha blend it if needed
QString path;
QPixmap pixmap = kapp->iconLoader()->loadIcon( stamp->stampIconName().toLower(), K3Icon::User, qMin( annotBoundary.width(), annotBoundary.height() ), K3Icon::DefaultState, &path, true );
QPixmap pixmap = KIconLoader::global()->loadIcon( stamp->stampIconName().toLower(), K3Icon::User, qMin( annotBoundary.width(), annotBoundary.height() ), K3Icon::DefaultState, &path, true );
if ( path.isEmpty() )
pixmap = kapp->iconLoader()->loadIcon( stamp->stampIconName().toLower(), K3Icon::NoGroup, qMin( annotBoundary.width(), annotBoundary.height() ) );
pixmap = KIconLoader::global()->loadIcon( stamp->stampIconName().toLower(), K3Icon::NoGroup, qMin( annotBoundary.width(), annotBoundary.height() ) );
QImage scaledImage;
scalePixmapOnImage( scaledImage, &pixmap, annotBoundary.width(),
annotBoundary.height(), innerRect, QImage::Format_ARGB32 );
......
......@@ -136,9 +136,9 @@ public:
// actions
KSelectAction * aOrientation;
KSelectAction * aPageSizes;
KAction * aMouseNormal;
KAction * aMouseSelect;
KAction * aMouseTextSelect;
QAction * aMouseNormal;
QAction * aMouseSelect;
QAction * aMouseTextSelect;
KToggleAction * aToggleAnnotator;
KSelectAction * aZoom;
KToggleAction * aZoomFitWidth;
......@@ -146,7 +146,7 @@ public:
KToggleAction * aZoomFitText;
KSelectAction * aRenderMode;
KToggleAction * aViewContinuous;
KAction * aPrevAction;
QAction * aPrevAction;
KActionCollection * actionCollection;
int setting_renderMode;
......@@ -323,8 +323,10 @@ void PageView::setupActions( KActionCollection * ac )
{
d->actionCollection = ac;
d->aOrientation=new KSelectAction( i18n( "&Orientation" ), ac, "view_orientation" );
d->aPageSizes=new KSelectAction( i18n( "&Page Size" ), ac, "view_pagesizes" );
d->aOrientation = new KSelectAction(i18n("&Orientation"), this);
ac->addAction("view_orientation", d->aOrientation);
d->aPageSizes = new KSelectAction(i18n("&Page Size"), this);
ac->addAction("view_pagesizes", d->aPageSizes);
QStringList rotations;
rotations.append( i18n( "Default" ) );
rotations.append( i18n( "Rotated 90 Degrees" ) );
......@@ -348,23 +350,27 @@ void PageView::setupActions( KActionCollection * ac )
}
// Zoom actions ( higher scales takes lots of memory! )
d->aZoom = new KSelectAction( KIcon( "viewmag" ), i18n( "Zoom" ), ac, "zoom_to" );
d->aZoom = new KSelectAction(KIcon( "viewmag" ), i18n("Zoom"), this);
ac->addAction("zoom_to", d->aZoom );
d->aZoom->setEditable( true );
d->aZoom->setMaxComboViewCount( 13 );
connect( d->aZoom, SIGNAL( triggered(QAction *) ), this, SLOT( slotZoom() ) );
updateZoomText();
KStandardAction::zoomIn( this, SLOT( slotZoomIn() ), ac, "zoom_in" );
ac->addAction(KStandardAction::ZoomIn, "zoom_in", this, SLOT( slotZoomIn() ));
KStandardAction::zoomOut( this, SLOT( slotZoomOut() ), ac, "zoom_out" );
ac->addAction(KStandardAction::ZoomOut, "zoom_out", this, SLOT( slotZoomOut() ));
d->aZoomFitWidth = new KToggleAction( KIcon( "view_fit_width" ), i18n("Fit &Width"), ac, "zoom_fit_width" );
d->aZoomFitWidth = new KToggleAction(KIcon( "view_fit_width" ), i18n("Fit &Width"), this);
ac->addAction("zoom_fit_width", d->aZoomFitWidth );
connect( d->aZoomFitWidth, SIGNAL( toggled( bool ) ), SLOT( slotFitToWidthToggled( bool ) ) );
d->aZoomFitPage = new KToggleAction( KIcon( "view_fit_window" ), i18n("Fit &Page"), ac, "zoom_fit_page" );
d->aZoomFitPage = new KToggleAction(KIcon( "view_fit_window" ), i18n("Fit &Page"), this);
ac->addAction("zoom_fit_page", d->aZoomFitPage );
connect( d->aZoomFitPage, SIGNAL( toggled( bool ) ), SLOT( slotFitToPageToggled( bool ) ) );
d->aZoomFitText = new KToggleAction( KIcon( "viewmagfit" ), i18n("Fit &Text"), ac, "zoom_fit_text" );
d->aZoomFitText = new KToggleAction(KIcon( "viewmagfit" ), i18n("Fit &Text"), this);
ac->addAction("zoom_fit_text", d->aZoomFitText );
connect( d->aZoomFitText, SIGNAL( toggled( bool ) ), SLOT( slotFitToTextToggled( bool ) ) );
// View-Layout actions
......@@ -373,51 +379,60 @@ void PageView::setupActions( KActionCollection * ac )
renderModes.append( i18n( "Facing" ) );
renderModes.append( i18n( "Overview" ) );
d->aRenderMode = new KSelectAction( KIcon( "view_left_right" ), i18n("&View Mode"), ac, "view_render_mode" );
d->aRenderMode = new KSelectAction(KIcon( "view_left_right" ), i18n("&View Mode"), this);
ac->addAction("view_render_mode", d->aRenderMode );
connect( d->aRenderMode, SIGNAL( triggered( int ) ), SLOT( slotRenderMode( int ) ) );
d->aRenderMode->setItems( renderModes );
d->aRenderMode->setCurrentItem( Okular::Settings::renderMode() );
d->aViewContinuous = new KToggleAction( KIcon( "view_text" ), i18n("&Continuous"), ac, "view_continuous" );
d->aViewContinuous = new KToggleAction(KIcon( "view_text" ), i18n("&Continuous"), this);
ac->addAction("view_continuous", d->aViewContinuous );
connect( d->aViewContinuous, SIGNAL( toggled( bool ) ), SLOT( slotContinuousToggled( bool ) ) );
d->aViewContinuous->setChecked( Okular::Settings::viewContinuous() );
// Mouse-Mode actions
QActionGroup * actGroup = new QActionGroup( this );
actGroup->setExclusive( true );
d->aMouseNormal = new KAction( KIcon( "mouse" ), i18n("&Browse Tool"), ac, "mouse_drag" );
d->aMouseNormal = new KAction(KIcon( "mouse" ), i18n("&Browse Tool"), this);
ac->addAction("mouse_drag", d->aMouseNormal );
connect( d->aMouseNormal, SIGNAL( triggered() ), this, SLOT( slotSetMouseNormal() ) );
d->aMouseNormal->setCheckable( true );
d->aMouseNormal->setActionGroup( actGroup );
d->aMouseNormal->setChecked( true );
KAction * mz = new KAction( KIcon( "viewmag" ), i18n("&Zoom Tool"), ac, "mouse_zoom" );
KAction * mz = new KAction(KIcon( "viewmag" ), i18n("&Zoom Tool"), this);
ac->addAction("mouse_zoom", mz );
connect( mz, SIGNAL( triggered() ), this, SLOT( slotSetMouseZoom() ) );
mz->setCheckable( true );
mz->setActionGroup( actGroup );
d->aMouseSelect = new KAction( KIcon( "frame_edit" ), i18n("&Select Tool"), ac, "mouse_select" );
d->aMouseSelect = new KAction(KIcon( "frame_edit" ), i18n("&Select Tool"), this);
ac->addAction("mouse_select", d->aMouseSelect );
connect( d->aMouseSelect, SIGNAL( triggered() ), this, SLOT( slotSetMouseSelect() ) );
d->aMouseSelect->setCheckable( true );
d->aMouseSelect->setActionGroup( actGroup );
d->aMouseTextSelect = new KAction( KIcon( "text" ), i18n("&Text Selection Tool"), ac, "mouse_textselect" );
d->aMouseTextSelect = new KAction(KIcon( "text" ), i18n("&Text Selection Tool"), this);
ac->addAction("mouse_textselect", d->aMouseTextSelect );
connect( d->aMouseTextSelect, SIGNAL( triggered() ), this, SLOT( slotSetMouseTextSelect() ) );
d->aMouseTextSelect->setCheckable( true );
d->aMouseTextSelect->setActionGroup( actGroup );
d->aToggleAnnotator = new KToggleAction( KIcon( "pencil" ), i18n("&Review"), ac, "mouse_toggle_annotate" );
d->aToggleAnnotator = new KToggleAction(KIcon( "pencil" ), i18n("&Review"), this);
ac->addAction("mouse_toggle_annotate", d->aToggleAnnotator );
d->aToggleAnnotator->setCheckable( true );
connect( d->aToggleAnnotator, SIGNAL( toggled( bool ) ), SLOT( slotToggleAnnotator( bool ) ) );
d->aToggleAnnotator->setShortcut( Qt::Key_F6 );
// Other actions
KAction * su = new KAction( i18n("Scroll Up"), ac, "view_scroll_up" );
KAction * su = new KAction(i18n("Scroll Up"), this);
ac->addAction("view_scroll_up", su );
connect( su, SIGNAL( triggered() ), this, SLOT( slotScrollUp() ) );
su->setShortcut( QKeySequence(Qt::SHIFT + Qt::Key_Up) );
addAction(su);
KAction * sd = new KAction( i18n("Scroll Down"), ac, "view_scroll_down" );
KAction * sd = new KAction(i18n("Scroll Down"), this);
ac->addAction("view_scroll_down", sd );
connect( sd, SIGNAL( triggered() ), this, SLOT( slotScrollDown() ) );
sd->setShortcut( QKeySequence(Qt::SHIFT + Qt::Key_Down) );
addAction(sd);
......@@ -2165,7 +2180,7 @@ void PageView::updateZoom( ZoomMode newZoomMode )
}
float newFactor = d->zoomFactor;
KAction * checkedZoomAction = 0;
QAction * checkedZoomAction = 0;
switch ( newZoomMode )
{
case ZoomFixed:{ //ZoomFixed case
......
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