Changeset View
Changeset View
Standalone View
Standalone View
ui/pageview.cpp
Show First 20 Lines • Show All 216 Lines • ▼ Show 20 Line(s) | 190 | #endif | |||
---|---|---|---|---|---|
217 | QAction * aMouseTextSelect; | 217 | QAction * aMouseTextSelect; | ||
218 | QAction * aMouseTableSelect; | 218 | QAction * aMouseTableSelect; | ||
219 | QAction * aMouseMagnifier; | 219 | QAction * aMouseMagnifier; | ||
220 | KToggleAction * aTrimToSelection; | 220 | KToggleAction * aTrimToSelection; | ||
221 | KToggleAction * aToggleAnnotator; | 221 | KToggleAction * aToggleAnnotator; | ||
222 | KSelectAction * aZoom; | 222 | KSelectAction * aZoom; | ||
223 | QAction * aZoomIn; | 223 | QAction * aZoomIn; | ||
224 | QAction * aZoomOut; | 224 | QAction * aZoomOut; | ||
225 | QAction * aZoomActual; | ||||
225 | KToggleAction * aZoomFitWidth; | 226 | KToggleAction * aZoomFitWidth; | ||
226 | KToggleAction * aZoomFitPage; | 227 | KToggleAction * aZoomFitPage; | ||
227 | KToggleAction * aZoomAutoFit; | 228 | KToggleAction * aZoomAutoFit; | ||
228 | KActionMenu * aViewMode; | 229 | KActionMenu * aViewMode; | ||
229 | KToggleAction * aViewContinuous; | 230 | KToggleAction * aViewContinuous; | ||
230 | QAction * aPrevAction; | 231 | QAction * aPrevAction; | ||
231 | QAction * aToggleForms; | 232 | QAction * aToggleForms; | ||
232 | QAction * aSpeakDoc; | 233 | QAction * aSpeakDoc; | ||
▲ Show 20 Lines • Show All 245 Lines • ▼ Show 20 Line(s) | 473 | { | |||
478 | d->aZoom->setEditable( true ); | 479 | d->aZoom->setEditable( true ); | ||
479 | d->aZoom->setMaxComboViewCount( 14 ); | 480 | d->aZoom->setMaxComboViewCount( 14 ); | ||
480 | connect( d->aZoom, SIGNAL(triggered(QAction*)), this, SLOT(slotZoom()) ); | 481 | connect( d->aZoom, SIGNAL(triggered(QAction*)), this, SLOT(slotZoom()) ); | ||
481 | updateZoomText(); | 482 | updateZoomText(); | ||
482 | 483 | | |||
483 | d->aZoomIn = KStandardAction::zoomIn( this, SLOT(slotZoomIn()), ac ); | 484 | d->aZoomIn = KStandardAction::zoomIn( this, SLOT(slotZoomIn()), ac ); | ||
484 | 485 | | |||
485 | d->aZoomOut = KStandardAction::zoomOut( this, SLOT(slotZoomOut()), ac ); | 486 | d->aZoomOut = KStandardAction::zoomOut( this, SLOT(slotZoomOut()), ac ); | ||
487 | | ||||
488 | d->aZoomActual = KStandardAction::actualSize( this, &PageView::slotZoomActual, ac ); | ||||
aacid: Please use the new connect syntax | |||||
489 | d->aZoomActual->setText(i18n("Zoom to 100%")); | ||||
486 | } | 490 | } | ||
487 | 491 | | |||
488 | void PageView::setupViewerActions( KActionCollection * ac ) | 492 | void PageView::setupViewerActions( KActionCollection * ac ) | ||
489 | { | 493 | { | ||
490 | d->actionCollection = ac; | 494 | d->actionCollection = ac; | ||
491 | 495 | | |||
492 | ac->setDefaultShortcut(d->aZoomIn, QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Plus)); | 496 | ac->setDefaultShortcut(d->aZoomIn, QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Plus)); | ||
493 | ac->setDefaultShortcut(d->aZoomOut, QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Minus)); | 497 | ac->setDefaultShortcut(d->aZoomOut, QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Minus)); | ||
▲ Show 20 Lines • Show All 705 Lines • ▼ Show 20 Line(s) | 1166 | { | |||
1199 | { | 1203 | { | ||
1200 | d->aZoom->selectableActionGroup()->setEnabled( haspages ); | 1204 | d->aZoom->selectableActionGroup()->setEnabled( haspages ); | ||
1201 | d->aZoom->setEnabled( haspages ); | 1205 | d->aZoom->setEnabled( haspages ); | ||
1202 | } | 1206 | } | ||
1203 | if ( d->aZoomIn ) | 1207 | if ( d->aZoomIn ) | ||
1204 | d->aZoomIn->setEnabled( haspages ); | 1208 | d->aZoomIn->setEnabled( haspages ); | ||
1205 | if ( d->aZoomOut ) | 1209 | if ( d->aZoomOut ) | ||
1206 | d->aZoomOut->setEnabled( haspages ); | 1210 | d->aZoomOut->setEnabled( haspages ); | ||
1211 | if ( d->aZoomActual ) | ||||
1212 | d->aZoomActual->setEnabled( haspages && d->zoomFactor != 1.0 ); | ||||
1207 | 1213 | | |||
1208 | if ( d->mouseModeActionGroup ) | 1214 | if ( d->mouseModeActionGroup ) | ||
1209 | d->mouseModeActionGroup->setEnabled( haspages ); | 1215 | d->mouseModeActionGroup->setEnabled( haspages ); | ||
1210 | 1216 | | |||
1211 | if ( d->aRotateClockwise ) | 1217 | if ( d->aRotateClockwise ) | ||
1212 | d->aRotateClockwise->setEnabled( haspages ); | 1218 | d->aRotateClockwise->setEnabled( haspages ); | ||
1213 | if ( d->aRotateCounterClockwise ) | 1219 | if ( d->aRotateCounterClockwise ) | ||
1214 | d->aRotateCounterClockwise->setEnabled( haspages ); | 1220 | d->aRotateCounterClockwise->setEnabled( haspages ); | ||
▲ Show 20 Lines • Show All 2781 Lines • ▼ Show 20 Line(s) | 3971 | case ZoomOut:{ | |||
3996 | } | 4002 | } | ||
3997 | else | 4003 | else | ||
3998 | { | 4004 | { | ||
3999 | newFactor = tmpFactor; | 4005 | newFactor = tmpFactor; | ||
4000 | newZoomMode = ZoomFixed; | 4006 | newZoomMode = ZoomFixed; | ||
4001 | } | 4007 | } | ||
4002 | } | 4008 | } | ||
4003 | break; | 4009 | break; | ||
4010 | case ZoomActual: | ||||
4011 | newZoomMode = ZoomFixed; | ||||
4012 | newFactor = 1.0; | ||||
4013 | break; | ||||
4004 | case ZoomFitWidth: | 4014 | case ZoomFitWidth: | ||
4005 | checkedZoomAction = d->aZoomFitWidth; | 4015 | checkedZoomAction = d->aZoomFitWidth; | ||
4006 | break; | 4016 | break; | ||
4007 | case ZoomFitPage: | 4017 | case ZoomFitPage: | ||
4008 | checkedZoomAction = d->aZoomFitPage; | 4018 | checkedZoomAction = d->aZoomFitPage; | ||
4009 | break; | 4019 | break; | ||
4010 | case ZoomFitAuto: | 4020 | case ZoomFitAuto: | ||
4011 | checkedZoomAction = d->aZoomAutoFit; | 4021 | checkedZoomAction = d->aZoomAutoFit; | ||
Show All 31 Lines | 4050 | { | |||
4043 | d->aZoomAutoFit->setChecked( checkedZoomAction == d->aZoomAutoFit ); | 4053 | d->aZoomAutoFit->setChecked( checkedZoomAction == d->aZoomAutoFit ); | ||
4044 | } | 4054 | } | ||
4045 | } | 4055 | } | ||
4046 | else if ( newZoomMode == ZoomFixed && newFactor == d->zoomFactor ) | 4056 | else if ( newZoomMode == ZoomFixed && newFactor == d->zoomFactor ) | ||
4047 | updateZoomText(); | 4057 | updateZoomText(); | ||
4048 | 4058 | | |||
4049 | d->aZoomIn->setEnabled( d->zoomFactor < upperZoomLimit-0.001 ); | 4059 | d->aZoomIn->setEnabled( d->zoomFactor < upperZoomLimit-0.001 ); | ||
4050 | d->aZoomOut->setEnabled( d->zoomFactor > 0.101 ); | 4060 | d->aZoomOut->setEnabled( d->zoomFactor > 0.101 ); | ||
4061 | d->aZoomActual->setEnabled( d->zoomFactor != 1.0 ); | ||||
4051 | } | 4062 | } | ||
4052 | 4063 | | |||
4053 | void PageView::updateZoomText() | 4064 | void PageView::updateZoomText() | ||
4054 | { | 4065 | { | ||
4055 | // use current page zoom as zoomFactor if in ZoomFit/* mode | 4066 | // use current page zoom as zoomFactor if in ZoomFit/* mode | ||
4056 | if ( d->zoomMode != ZoomFixed && d->items.count() > 0 ) | 4067 | if ( d->zoomMode != ZoomFixed && d->items.count() > 0 ) | ||
4057 | d->zoomFactor = d->items[ qMax( 0, (int)d->document->currentPage() ) ]->zoomFactor(); | 4068 | d->zoomFactor = d->items[ qMax( 0, (int)d->document->currentPage() ) ]->zoomFactor(); | ||
4058 | float newFactor = d->zoomFactor; | 4069 | float newFactor = d->zoomFactor; | ||
▲ Show 20 Lines • Show All 914 Lines • ▼ Show 20 Line(s) | 4983 | { | |||
4973 | updateZoom( ZoomIn ); | 4984 | updateZoom( ZoomIn ); | ||
4974 | } | 4985 | } | ||
4975 | 4986 | | |||
4976 | void PageView::slotZoomOut() | 4987 | void PageView::slotZoomOut() | ||
4977 | { | 4988 | { | ||
4978 | updateZoom( ZoomOut ); | 4989 | updateZoom( ZoomOut ); | ||
4979 | } | 4990 | } | ||
4980 | 4991 | | |||
4992 | void PageView::slotZoomActual() | ||||
4993 | { | ||||
4994 | updateZoom( ZoomActual ); | ||||
4995 | } | ||||
4996 | | ||||
4981 | void PageView::slotFitToWidthToggled( bool on ) | 4997 | void PageView::slotFitToWidthToggled( bool on ) | ||
4982 | { | 4998 | { | ||
4983 | if ( on ) updateZoom( ZoomFitWidth ); | 4999 | if ( on ) updateZoom( ZoomFitWidth ); | ||
4984 | } | 5000 | } | ||
4985 | 5001 | | |||
4986 | void PageView::slotFitToPageToggled( bool on ) | 5002 | void PageView::slotFitToPageToggled( bool on ) | ||
4987 | { | 5003 | { | ||
4988 | if ( on ) updateZoom( ZoomFitPage ); | 5004 | if ( on ) updateZoom( ZoomFitPage ); | ||
▲ Show 20 Lines • Show All 555 Lines • Show Last 20 Lines |
Please use the new connect syntax