diff options
Diffstat (limited to 'kpdf/ui')
-rw-r--r-- | kpdf/ui/minibar.cpp | 18 | ||||
-rw-r--r-- | kpdf/ui/minibar.h | 2 | ||||
-rw-r--r-- | kpdf/ui/pageview.cpp | 124 | ||||
-rw-r--r-- | kpdf/ui/pageview.h | 3 | ||||
-rw-r--r-- | kpdf/ui/pageviewutils.cpp | 4 | ||||
-rw-r--r-- | kpdf/ui/presentationwidget.cpp | 32 | ||||
-rw-r--r-- | kpdf/ui/presentationwidget.h | 2 | ||||
-rw-r--r-- | kpdf/ui/searchwidget.cpp | 14 | ||||
-rw-r--r-- | kpdf/ui/searchwidget.h | 2 | ||||
-rw-r--r-- | kpdf/ui/thumbnaillist.cpp | 14 | ||||
-rw-r--r-- | kpdf/ui/thumbnaillist.h | 2 | ||||
-rw-r--r-- | kpdf/ui/toc.cpp | 4 | ||||
-rw-r--r-- | kpdf/ui/toc.h | 2 |
13 files changed, 130 insertions, 93 deletions
diff --git a/kpdf/ui/minibar.cpp b/kpdf/ui/minibar.cpp index eaceeed2..f05b8931 100644 --- a/kpdf/ui/minibar.cpp +++ b/kpdf/ui/minibar.cpp @@ -121,10 +121,10 @@ MiniBar::MiniBar( TQWidget * parent, KPDFDocument * document ) setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken ); // connect signals from child widgets to internal handlers / signals bouncers - connect( m_pagesEdit, TQT_SIGNAL( returnPressed() ), this, TQT_SLOT( slotChangePage() ) ); - connect( m_pagesButton, TQT_SIGNAL( clicked() ), this, TQT_SIGNAL( gotoPage() ) ); - connect( m_prevButton, TQT_SIGNAL( clicked() ), this, TQT_SIGNAL( prevPage() ) ); - connect( m_nextButton, TQT_SIGNAL( clicked() ), this, TQT_SIGNAL( nextPage() ) ); + connect( m_pagesEdit, TQ_SIGNAL( returnPressed() ), this, TQ_SLOT( slotChangePage() ) ); + connect( m_pagesButton, TQ_SIGNAL( clicked() ), this, TQ_SIGNAL( gotoPage() ) ); + connect( m_prevButton, TQ_SIGNAL( clicked() ), this, TQ_SIGNAL( prevPage() ) ); + connect( m_nextButton, TQ_SIGNAL( clicked() ), this, TQ_SIGNAL( nextPage() ) ); // widget starts hidden (will be shown after opening a document) parent->hide(); @@ -146,7 +146,7 @@ void MiniBar::notifySetup( const TQValueVector< KPDFPage * > & pageVector, bool if ( pages < 1 ) { m_currentPage = -1; - TQT_TQWIDGET( parent() )->hide(); + static_cast<TQWidget*>( parent() )->hide(); return; } @@ -171,7 +171,7 @@ void MiniBar::notifySetup( const TQValueVector< KPDFPage * > & pageVector, bool m_pagesButton->setText( TQString::number( pages ) ); m_prevButton->setEnabled( false ); m_nextButton->setEnabled( false ); - TQT_TQWIDGET( parent() )->show(); + static_cast<TQWidget*>( parent() )->show(); } void MiniBar::notifyViewportChanged( bool /*smoothMove*/ ) @@ -275,13 +275,13 @@ void ProgressWidget::setProgress( float percentage ) void ProgressWidget::mouseMoveEvent( TQMouseEvent * e ) { - if ( e->state() == Qt::LeftButton && width() > 0 ) + if ( e->state() == TQt::LeftButton && width() > 0 ) m_miniBar->slotGotoNormalizedPage( (float)( TQApplication::reverseLayout() ? width() - e->x() : e->x() ) / (float)width() ); } void ProgressWidget::mousePressEvent( TQMouseEvent * e ) { - if ( e->button() == Qt::LeftButton && width() > 0 ) + if ( e->button() == TQt::LeftButton && width() > 0 ) m_miniBar->slotGotoNormalizedPage( (float)( TQApplication::reverseLayout() ? width() - e->x() : e->x() ) / (float)width() ); } @@ -333,7 +333,7 @@ PagesEdit::PagesEdit( MiniBar * parent ) focusOutEvent( 0 ); // use an integer validator - m_validator = new TQIntValidator( 1, 1, TQT_TQOBJECT(this) ); + m_validator = new TQIntValidator( 1, 1, this ); setValidator( m_validator ); // customize text properties diff --git a/kpdf/ui/minibar.h b/kpdf/ui/minibar.h index 2d4ee4bb..29c117d5 100644 --- a/kpdf/ui/minibar.h +++ b/kpdf/ui/minibar.h @@ -24,7 +24,7 @@ class ProgressWidget; */ class MiniBar : public TQFrame, public DocumentObserver { - Q_OBJECT + TQ_OBJECT public: MiniBar( TQWidget *parent, KPDFDocument * document ); diff --git a/kpdf/ui/pageview.cpp b/kpdf/ui/pageview.cpp index 556512de..57f201a0 100644 --- a/kpdf/ui/pageview.cpp +++ b/kpdf/ui/pageview.cpp @@ -2,7 +2,7 @@ * Copyright (C) 2004 by Enrico Ros <eros.kde@email.it> * * Copyright (C) 2004-2006 by Albert Astals Cid <tsdgeos@terra.es> * * * - * With portions of code from kpdf/kpdf_pagewidget.cc by: * + * With portions of code from kpdf/kpdf_pagewidget.cpp by: * * Copyright (C) 2002 by Wilco Greven <greven@kde.org> * * Copyright (C) 2003 by Christophe Devriese * * <Christophe.Devriese@student.kuleuven.ac.be> * @@ -114,6 +114,7 @@ public: TDEToggleAction * aZoomFitText; TDEToggleAction * aViewTwoPages; TDEToggleAction * aViewContinuous; + TDEToggleAction * aViewCoverPage; TDEAction * aPrevAction; }; @@ -206,7 +207,7 @@ PageView::PageView( TQWidget *parent, KPDFDocument *document ) // widget setup: setup focus, accept drops and track mouse viewport()->setFocusProxy( this ); - viewport()->setFocusPolicy( TQ_StrongFocus ); + viewport()->setFocusPolicy( TQWidget::StrongFocus ); //viewport()->setPaletteBackgroundColor( TQt::white ); viewport()->setBackgroundMode( TQt::NoBackground ); setResizePolicy( Manual ); @@ -215,8 +216,8 @@ PageView::PageView( TQWidget *parent, KPDFDocument *document ) viewport()->setMouseTracking( true ); // conntect the padding of the viewport to pixmaps requests - connect( this, TQT_SIGNAL(contentsMoving(int, int)), this, TQT_SLOT(slotRequestVisiblePixmaps(int, int)) ); - connect( &d->dragScrollTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotDragScroll()) ); + connect( this, TQ_SIGNAL(contentsMoving(int, int)), this, TQ_SLOT(slotRequestVisiblePixmaps(int, int)) ); + connect( &d->dragScrollTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(slotDragScroll()) ); // set a corner button to resize the view to the page size // TQPushButton * resizeButton = new TQPushButton( viewport() ); @@ -227,7 +228,7 @@ PageView::PageView( TQWidget *parent, KPDFDocument *document ) setInputMethodEnabled( true ); // schedule the welcome message - TQTimer::singleShot( 0, this, TQT_SLOT( slotShowWelcome() ) ); + TQTimer::singleShot( 0, this, TQ_SLOT( slotShowWelcome() ) ); } PageView::~PageView() @@ -245,63 +246,68 @@ PageView::~PageView() void PageView::setupActions( TDEActionCollection * ac ) { // Zoom actions ( higher scales takes lots of memory! ) - d->aZoom = new TDESelectAction( i18n( "Zoom" ), "viewmag", 0, TQT_TQOBJECT(this), TQT_SLOT( slotZoom() ), ac, "zoom_to" ); + d->aZoom = new TDESelectAction( i18n( "Zoom" ), "viewmag", 0, this, TQ_SLOT( slotZoom() ), ac, "zoom_to" ); d->aZoom->setEditable( true ); #if KDE_IS_VERSION(3,4,89) d->aZoom->setMaxComboViewCount( 13 ); #endif updateZoomText(); - KStdAction::zoomIn( TQT_TQOBJECT(this), TQT_SLOT( slotZoomIn() ), ac, "zoom_in" ); + KStdAction::zoomIn( this, TQ_SLOT( slotZoomIn() ), ac, "zoom_in" ); - KStdAction::zoomOut( TQT_TQOBJECT(this), TQT_SLOT( slotZoomOut() ), ac, "zoom_out" ); + KStdAction::zoomOut( this, TQ_SLOT( slotZoomOut() ), ac, "zoom_out" ); d->aZoomFitWidth = new TDEToggleAction( i18n("Fit to Page &Width"), "view_fit_width", 0, ac, "zoom_fit_width" ); - connect( d->aZoomFitWidth, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( slotFitToWidthToggled( bool ) ) ); + connect( d->aZoomFitWidth, TQ_SIGNAL( toggled( bool ) ), TQ_SLOT( slotFitToWidthToggled( bool ) ) ); d->aZoomFitPage = new TDEToggleAction( i18n("Fit to &Page"), "view_fit_window", 0, ac, "zoom_fit_page" ); - connect( d->aZoomFitPage, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( slotFitToPageToggled( bool ) ) ); + connect( d->aZoomFitPage, TQ_SIGNAL( toggled( bool ) ), TQ_SLOT( slotFitToPageToggled( bool ) ) ); d->aZoomFitText = new TDEToggleAction( i18n("Fit to &Text"), "zoom-fit-best", 0, ac, "zoom_fit_text" ); - connect( d->aZoomFitText, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( slotFitToTextToggled( bool ) ) ); + connect( d->aZoomFitText, TQ_SIGNAL( toggled( bool ) ), TQ_SLOT( slotFitToTextToggled( bool ) ) ); // rotate actions TDEAction *action; action = new TDEAction( i18n("Rotate Right"), "object-rotate-right", TDEShortcut( "Ctrl+Shift++" ), - TQT_TQOBJECT(this), TQT_SLOT( slotRotateRight() ), ac, "rotate_right" ); + this, TQ_SLOT( slotRotateRight() ), ac, "rotate_right" ); action = new TDEAction( i18n("Rotate Left"), "object-rotate-left", TDEShortcut( "Ctrl+Shift+-" ), - TQT_TQOBJECT(this), TQT_SLOT( slotRotateLeft() ), ac, "rotate_left" ); + this, TQ_SLOT( slotRotateLeft() ), ac, "rotate_left" ); // View-Layout actions d->aViewTwoPages = new TDEToggleAction( i18n("&Two Pages"), "view_left_right", 0, ac, "view_twopages" ); - connect( d->aViewTwoPages, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( slotTwoPagesToggled( bool ) ) ); + connect( d->aViewTwoPages, TQ_SIGNAL( toggled( bool ) ), TQ_SLOT( slotTwoPagesToggled( bool ) ) ); d->aViewTwoPages->setChecked( KpdfSettings::viewColumns() > 1 ); d->aViewContinuous = new TDEToggleAction( i18n("&Continuous"), "view_text", 0, ac, "view_continuous" ); - connect( d->aViewContinuous, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( slotContinuousToggled( bool ) ) ); + connect( d->aViewContinuous, TQ_SIGNAL( toggled( bool ) ), TQ_SLOT( slotContinuousToggled( bool ) ) ); d->aViewContinuous->setChecked( KpdfSettings::viewContinuous() ); + d->aViewCoverPage = new TDEToggleAction( i18n("Co&ver Page"), "contents2", 0, ac, "view_coverpage" ); + connect( d->aViewCoverPage, TQ_SIGNAL( toggled( bool ) ), TQ_SLOT( slotCoverPageToggled( bool ) ) ); + d->aViewCoverPage->setChecked( KpdfSettings::viewCoverPage() ); + d->aViewCoverPage->setEnabled( KpdfSettings::viewColumns() > 1 ); + // Mouse-Mode actions - d->aMouseNormal = new TDERadioAction( i18n("&Browse Tool"), "input-mouse", 0, TQT_TQOBJECT(this), TQT_SLOT( slotSetMouseNormal() ), ac, "mouse_drag" ); + d->aMouseNormal = new TDERadioAction( i18n("&Browse Tool"), "input-mouse", 0, this, TQ_SLOT( slotSetMouseNormal() ), ac, "mouse_drag" ); d->aMouseNormal->setExclusiveGroup( "MouseType" ); d->aMouseNormal->setChecked( true ); - TDEToggleAction * mz = new TDERadioAction( i18n("&Zoom Tool"), "viewmag", 0, TQT_TQOBJECT(this), TQT_SLOT( slotSetMouseZoom() ), ac, "mouse_zoom" ); + TDEToggleAction * mz = new TDERadioAction( i18n("&Zoom Tool"), "viewmag", 0, this, TQ_SLOT( slotSetMouseZoom() ), ac, "mouse_zoom" ); mz->setExclusiveGroup( "MouseType" ); - d->aMouseSelect = new TDERadioAction( i18n("&Select Tool"), "frame_edit", 0, TQT_TQOBJECT(this), TQT_SLOT( slotSetMouseSelect() ), ac, "mouse_select" ); + d->aMouseSelect = new TDERadioAction( i18n("&Select Tool"), "frame_edit", 0, this, TQ_SLOT( slotSetMouseSelect() ), ac, "mouse_select" ); d->aMouseSelect->setExclusiveGroup( "MouseType" ); -/* d->aMouseEdit = new TDERadioAction( i18n("Draw"), "edit", 0, TQT_TQOBJECT(this), TQT_SLOT( slotSetMouseDraw() ), ac, "mouse_draw" ); +/* d->aMouseEdit = new TDERadioAction( i18n("Draw"), "edit", 0, this, TQ_SLOT( slotSetMouseDraw() ), ac, "mouse_draw" ); d->aMouseEdit->setExclusiveGroup("MouseType"); d->aMouseEdit->setEnabled( false ); // implement feature before removing this line*/ // Other actions - TDEAction * su = new TDEAction( i18n("Scroll Up"), 0, TQT_TQOBJECT(this), TQT_SLOT( slotScrollUp() ), ac, "view_scroll_up" ); + TDEAction * su = new TDEAction( i18n("Scroll Up"), 0, this, TQ_SLOT( slotScrollUp() ), ac, "view_scroll_up" ); su->setShortcut( "Shift+Up" ); - TDEAction * sd = new TDEAction( i18n("Scroll Down"), 0, TQT_TQOBJECT(this), TQT_SLOT( slotScrollDown() ), ac, "view_scroll_down" ); + TDEAction * sd = new TDEAction( i18n("Scroll Down"), 0, this, TQ_SLOT( slotScrollDown() ), ac, "view_scroll_down" ); sd->setShortcut( "Shift+Down" ); } @@ -348,7 +354,7 @@ void PageView::notifySetup( const TQValueVector< KPDFPage * > & pageSet, bool do // Need slotRelayoutPages() here instead of d->dirtyLayout = true // because opening a pdf from another pdf will not trigger a viewportchange // so pages are never relayouted - TQTimer::singleShot(0, this, TQT_SLOT(slotRelayoutPages())); + TQTimer::singleShot(0, this, TQ_SLOT(slotRelayoutPages())); else { // update the mouse cursor when closing because we may have close through a link and @@ -431,8 +437,8 @@ void PageView::notifyViewportChanged( bool smoothMove ) if ( !d->viewportMoveTimer ) { d->viewportMoveTimer = new TQTimer( this ); - connect( d->viewportMoveTimer, TQT_SIGNAL( timeout() ), - this, TQT_SLOT( slotMoveViewport() ) ); + connect( d->viewportMoveTimer, TQ_SIGNAL( timeout() ), + this, TQ_SLOT( slotMoveViewport() ) ); } d->viewportMoveTimer->start( 25 ); verticalScrollBar()->setEnabled( false ); @@ -637,7 +643,7 @@ void PageView::viewportResizeEvent( TQResizeEvent * ) if ( !d->delayResizeTimer ) { d->delayResizeTimer = new TQTimer( this ); - connect( d->delayResizeTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotRelayoutPages() ) ); + connect( d->delayResizeTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( slotRelayoutPages() ) ); } d->delayResizeTimer->start( 333, true ); } @@ -719,7 +725,7 @@ void PageView::keyPressEvent( TQKeyEvent * e ) { // create the timer on demand d->findTimeoutTimer = new TQTimer( this ); - connect( d->findTimeoutTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( findAheadStop() ) ); + connect( d->findTimeoutTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( findAheadStop() ) ); } d->findTimeoutTimer->start( 3000, true ); // it is needed to grab the keyboard becase people may have Space assigned to a @@ -840,7 +846,7 @@ void PageView::contentsMouseMoveEvent( TQMouseEvent * e ) return; // if holding mouse mid button, perform zoom - if ( (e->state() & Qt::MidButton) && d->mouseMidStartY >= 0 ) + if ( (e->state() & TQt::MidButton) && d->mouseMidStartY >= 0 ) { int deltaY = d->mouseMidStartY - e->globalPos().y(); d->mouseMidStartY = e->globalPos().y(); @@ -851,8 +857,8 @@ void PageView::contentsMouseMoveEvent( TQMouseEvent * e ) return; } - bool leftButton = e->state() & Qt::LeftButton, - rightButton = e->state() & Qt::RightButton; + bool leftButton = e->state() & TQt::LeftButton, + rightButton = e->state() & TQt::RightButton; switch ( d->mouseMode ) { case MouseNormal: @@ -920,7 +926,7 @@ void PageView::contentsMousePressEvent( TQMouseEvent * e ) } // if pressing mid mouse button while not doing other things, begin 'comtinous zoom' mode - if ( e->button() & Qt::MidButton ) + if ( e->button() & TQt::MidButton ) { d->mouseMidStartY = e->globalPos().y(); setCursor( KCursor::sizeVerCursor() ); @@ -931,8 +937,8 @@ void PageView::contentsMousePressEvent( TQMouseEvent * e ) d->mousePressPos = e->globalPos(); // handle mode dependant mouse press actions - bool leftButton = e->button() & Qt::LeftButton, - rightButton = e->button() & Qt::RightButton; + bool leftButton = e->button() & TQt::LeftButton, + rightButton = e->button() & TQt::RightButton; switch ( d->mouseMode ) { case MouseNormal: // drag start / click / link following @@ -973,7 +979,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) if ( d->items.isEmpty() ) { // ..except for right Clicks (emitted even it viewport is empty) - if ( e->button() == Qt::RightButton ) + if ( e->button() == TQt::RightButton ) emit rightClick( 0, e->globalPos() ); return; } @@ -983,7 +989,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) return; // handle mode indepent mid buttom zoom - bool midButton = e->button() & Qt::MidButton; + bool midButton = e->button() & TQt::MidButton; if ( midButton && d->mouseMidStartY > 0 ) { d->mouseMidStartY = -1; @@ -992,8 +998,8 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) return; } - bool leftButton = e->button() & Qt::LeftButton, - rightButton = e->button() & Qt::RightButton; + bool leftButton = e->button() & TQt::LeftButton, + rightButton = e->button() & TQt::RightButton; switch ( d->mouseMode ) { case MouseNormal:{ @@ -1652,6 +1658,7 @@ void PageView::doTypeAheadSearch() void PageView::slotRelayoutPages() // called by: notifySetup, viewportResizeEvent, slotTwoPagesToggled, slotContinuousToggled, updateZoom { + bool coverPageMode = ( KpdfSettings::viewColumns() == 2 && KpdfSettings::viewCoverPage() ); // set an empty container if we have no pages int pageCount = d->items.count(); if ( pageCount < 1 ) @@ -1682,11 +1689,12 @@ void PageView::slotRelayoutPages() { // Here we find out column's width and row's height to compute a table // so we can place widgets 'centered in virtual cells'. - int nCols = KpdfSettings::viewColumns(), - nRows = (int)ceil( (float)pageCount / (float)nCols ), + int pageShift = coverPageMode ? 1 : 0, + nCols = KpdfSettings::viewColumns(), + nRows = (int)ceil( (float)(pageCount + pageShift) / (float)nCols ), * colWidth = new int[ nCols ], * rowHeight = new int[ nRows ], - cIdx = 0, + cIdx = pageShift, rIdx = 0; for ( int i = 0; i < nCols; i++ ) colWidth[ i ] = viewportWidth / nCols; @@ -1716,13 +1724,18 @@ void PageView::slotRelayoutPages() // 2) arrange widgets inside cells int insertX = 0, insertY = 4; // 2 + 4*d->zoomFactor ? - cIdx = 0; + cIdx = pageShift; rIdx = 0; + for ( iIt = d->items.begin(); iIt != iEnd; ++iIt ) { PageViewItem * item = *iIt; int cWidth = colWidth[ cIdx ], rHeight = rowHeight[ rIdx ]; + + if( coverPageMode && item->pageNumber() == 0 ) // align widget right inside viewport + insertX+=cWidth; + // center widget inside 'cells' item->moveTo( insertX + (cWidth - item->width()) / 2, insertY + (rHeight - item->height()) / 2 ); @@ -1776,14 +1789,24 @@ void PageView::slotRelayoutPages() // 2) hide all widgets except the displayable ones and dispose those int insertX = 0; cIdx = 0; + + if( coverPageMode && (int)d->document->currentPage() == 0 ) + ++cIdx; + for ( iIt = d->items.begin(); iIt != iEnd; ++iIt ) { PageViewItem * item = *iIt; if ( item == currentItem || (cIdx > 0 && cIdx < nCols) ) { - // center widget inside 'cells' - item->moveTo( insertX + (colWidth[ cIdx ] - item->width()) / 2, - (fullHeight - item->height()) / 2 ); + if( KpdfSettings::viewCoverPage() && (int)d->document->currentPage() == 0 ) { + // center widget inside viewport + item->moveTo( insertX + (viewportWidth - item->width()) / 2, + (viewportHeight - item->height()) / 2 ); + } else { + // center widget inside 'cells' + item->moveTo( insertX + (colWidth[ cIdx ] - item->width()) / 2, + (fullHeight - item->height()) / 2 ); + } // advance col index insertX += colWidth[ cIdx ]; cIdx++; @@ -1981,7 +2004,7 @@ void PageView::slotAutoScoll() if ( !d->autoScrollTimer ) { d->autoScrollTimer = new TQTimer( this ); - connect( d->autoScrollTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotAutoScoll() ) ); + connect( d->autoScrollTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( slotAutoScoll() ) ); } // if scrollIncrement is zero, stop the timer @@ -2110,6 +2133,8 @@ void PageView::slotTwoPagesToggled( bool on ) if ( d->document->pages() > 0 ) slotRelayoutPages(); } + + d->aViewCoverPage->setEnabled( on ); } void PageView::slotContinuousToggled( bool on ) @@ -2123,6 +2148,17 @@ void PageView::slotContinuousToggled( bool on ) } } +void PageView::slotCoverPageToggled( bool on ) +{ + if ( KpdfSettings::viewCoverPage() != on ) + { + KpdfSettings::setViewCoverPage( on ); + KpdfSettings::writeConfig(); + if ( d->document->pages() > 0 ) + slotRelayoutPages(); + } +} + void PageView::slotSetMouseNormal() { d->mouseMode = MouseNormal; diff --git a/kpdf/ui/pageview.h b/kpdf/ui/pageview.h index 901ec9e6..4072713d 100644 --- a/kpdf/ui/pageview.h +++ b/kpdf/ui/pageview.h @@ -38,7 +38,7 @@ class PageViewTip; */ class PageView : public TQScrollView, public DocumentObserver { - Q_OBJECT + TQ_OBJECT friend class PageViewTip; @@ -140,6 +140,7 @@ class PageView : public TQScrollView, public DocumentObserver void slotRotateLeft(); void slotTwoPagesToggled( bool ); void slotContinuousToggled( bool ); + void slotCoverPageToggled( bool ); void slotSetMouseNormal(); void slotSetMouseZoom(); void slotSetMouseSelect(); diff --git a/kpdf/ui/pageviewutils.cpp b/kpdf/ui/pageviewutils.cpp index 91a9de8d..90d90472 100644 --- a/kpdf/ui/pageviewutils.cpp +++ b/kpdf/ui/pageviewutils.cpp @@ -24,7 +24,7 @@ PageViewMessage::PageViewMessage( TQWidget * parent ) : TQWidget( parent, "pageViewMessage" ), m_timer( 0 ) { - setFocusPolicy( TQ_NoFocus ); + setFocusPolicy( TQWidget::NoFocus ); setBackgroundMode( NoBackground ); setPaletteBackgroundColor(kapp->palette().color(TQPalette::Active, TQColorGroup::Background)); // if the layout is LtR, we can safely place it in the right position @@ -131,7 +131,7 @@ void PageViewMessage::display( const TQString & message, Icon icon, int duration if ( !m_timer ) { m_timer = new TQTimer( this ); - connect( m_timer, TQT_SIGNAL( timeout() ), TQT_SLOT( hide() ) ); + connect( m_timer, TQ_SIGNAL( timeout() ), TQ_SLOT( hide() ) ); } m_timer->start( durationMs, true ); } else if ( m_timer ) diff --git a/kpdf/ui/presentationwidget.cpp b/kpdf/ui/presentationwidget.cpp index 6dfd2a9d..65645400 100644 --- a/kpdf/ui/presentationwidget.cpp +++ b/kpdf/ui/presentationwidget.cpp @@ -61,7 +61,7 @@ PresentationWidget::PresentationWidget( TQWidget * parent, KPDFDocument * doc ) m_width = -1; - m_accel = new TDEAccel( this, TQT_TQOBJECT(this), "presentationmode-accel" ); + m_accel = new TDEAccel( this, this, "presentationmode-accel" ); // show widget and take control showFullScreen(); @@ -69,11 +69,11 @@ PresentationWidget::PresentationWidget( TQWidget * parent, KPDFDocument * doc ) // misc stuff setMouseTracking( true ); m_transitionTimer = new TQTimer( this ); - connect( m_transitionTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotTransitionStep() ) ); + connect( m_transitionTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( slotTransitionStep() ) ); m_overlayHideTimer = new TQTimer( this ); - connect( m_overlayHideTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotHideOverlay() ) ); + connect( m_overlayHideTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( slotHideOverlay() ) ); m_nextPageTimer = new TQTimer( this ); - connect( m_nextPageTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotNextPage() ) ); + connect( m_nextPageTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( slotNextPage() ) ); // handle cursor appearance as specified in configuration if ( KpdfSettings::slidesCursor() == KpdfSettings::EnumSlidesCursor::HiddenDelay ) @@ -100,11 +100,11 @@ PresentationWidget::~PresentationWidget() void PresentationWidget::setupActions( TDEActionCollection * ac ) { - m_accel->insert( "previous_page", ac->action( "previous_page" )->shortcut(), TQT_TQOBJECT(this), TQT_SLOT( slotPrevPage() ), false, true ); - m_accel->insert( "next_page", ac->action( "next_page" )->shortcut(), TQT_TQOBJECT(this), TQT_SLOT( slotNextPage() ), false, true ); - m_accel->insert( "first_page", ac->action( "first_page" )->shortcut(), TQT_TQOBJECT(this), TQT_SLOT( slotFirstPage() ), false, true ); - m_accel->insert( "last_page", ac->action( "last_page" )->shortcut(), TQT_TQOBJECT(this), TQT_SLOT( slotLastPage() ), false, true ); - m_accel->insert( "presentation", ac->action( "presentation" )->shortcut(), TQT_TQOBJECT(this), TQT_SLOT( close() ), false, true ); + m_accel->insert( "previous_page", ac->action( "previous_page" )->shortcut(), this, TQ_SLOT( slotPrevPage() ), false, true ); + m_accel->insert( "next_page", ac->action( "next_page" )->shortcut(), this, TQ_SLOT( slotNextPage() ), false, true ); + m_accel->insert( "first_page", ac->action( "first_page" )->shortcut(), this, TQ_SLOT( slotFirstPage() ), false, true ); + m_accel->insert( "last_page", ac->action( "last_page" )->shortcut(), this, TQ_SLOT( slotLastPage() ), false, true ); + m_accel->insert( "presentation", ac->action( "presentation" )->shortcut(), this, TQ_SLOT( close() ), false, true ); } void PresentationWidget::notifySetup( const TQValueVector< KPDFPage * > & pageSet, bool /*documentChanged*/ ) @@ -235,7 +235,7 @@ void PresentationWidget::wheelEvent( TQWheelEvent * e ) void PresentationWidget::mousePressEvent( TQMouseEvent * e ) { // pressing left button - if ( e->button() == Qt::LeftButton ) + if ( e->button() == TQt::LeftButton ) { // if pressing on a link, skip other checks if ( ( m_pressedLink = getLink( e->x(), e->y() ) ) ) @@ -252,14 +252,14 @@ void PresentationWidget::mousePressEvent( TQMouseEvent * e ) slotNextPage(); } // pressing right button - else if ( e->button() == Qt::RightButton ) + else if ( e->button() == TQt::RightButton ) slotPrevPage(); } void PresentationWidget::mouseReleaseEvent( TQMouseEvent * e ) { // if releasing on the same link we pressed over, execute it - if ( m_pressedLink && e->button() == Qt::LeftButton ) + if ( m_pressedLink && e->button() == TQt::LeftButton ) { const KPDFLink * link = getLink( e->x(), e->y() ); if ( link == m_pressedLink ) @@ -290,7 +290,7 @@ void PresentationWidget::mouseMoveEvent( TQMouseEvent * e ) if ( e->y() <= (geometry().top() + 1) ) m_topBar->show(); // handle "dragging the wheel" if clicking on its geometry - else if ( e->state() == Qt::LeftButton && m_overlayGeometry.contains( e->pos() ) ) + else if ( e->state() == TQt::LeftButton && m_overlayGeometry.contains( e->pos() ) ) overlayClick( e->pos() ); } } @@ -307,9 +307,9 @@ void PresentationWidget::paintEvent( TQPaintEvent * pe ) m_topBar = new TDEToolBar( this, "presentationBar" ); m_topBar->setIconSize( 32 ); m_topBar->setMovingEnabled( false ); - m_topBar->insertButton( TQApplication::reverseLayout() ? "1rightarrow" : "1leftarrow", 2, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(this), TQT_SLOT( slotPrevPage() ) ); - m_topBar->insertButton( TQApplication::reverseLayout() ? "1leftarrow" : "1rightarrow", 3, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(this), TQT_SLOT( slotNextPage() ) ); - m_topBar->insertButton( "system-log-out", 1, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(this), TQT_SLOT( close() ) ); + m_topBar->insertButton( TQApplication::reverseLayout() ? "1rightarrow" : "1leftarrow", 2, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotPrevPage() ) ); + m_topBar->insertButton( TQApplication::reverseLayout() ? "1leftarrow" : "1rightarrow", 3, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotNextPage() ) ); + m_topBar->insertButton( "system-log-out", 1, TQ_SIGNAL( clicked() ), this, TQ_SLOT( close() ) ); m_topBar->setGeometry( 0, 0, m_width, 32 + 10 ); m_topBar->alignItemRight( 1 ); m_topBar->hide(); diff --git a/kpdf/ui/presentationwidget.h b/kpdf/ui/presentationwidget.h index 177b3da0..e38332d7 100644 --- a/kpdf/ui/presentationwidget.h +++ b/kpdf/ui/presentationwidget.h @@ -34,7 +34,7 @@ class PresentationFrame; */ class PresentationWidget : public TQDialog, public DocumentObserver { - Q_OBJECT + TQ_OBJECT public: PresentationWidget( TQWidget * parent, KPDFDocument * doc ); diff --git a/kpdf/ui/searchwidget.cpp b/kpdf/ui/searchwidget.cpp index 8fcbfe22..f7c5b719 100644 --- a/kpdf/ui/searchwidget.cpp +++ b/kpdf/ui/searchwidget.cpp @@ -40,18 +40,18 @@ SearchWidget::SearchWidget( TQWidget * parent, KPDFDocument * document ) // a timer to ensure that we don't flood the document with requests to search m_inputDelayTimer = new TQTimer(this); - connect( m_inputDelayTimer, TQT_SIGNAL( timeout() ), - this, TQT_SLOT( startSearch() ) ); + connect( m_inputDelayTimer, TQ_SIGNAL( timeout() ), + this, TQ_SLOT( startSearch() ) ); // 1. text line - insertLined( TQString(), LEDIT_ID, TQT_SIGNAL( textChanged(const TQString &) ), - TQT_TQOBJECT(this), TQT_SLOT( slotTextChanged(const TQString &) ), true, + insertLined( TQString(), LEDIT_ID, TQ_SIGNAL( textChanged(const TQString &) ), + this, TQ_SLOT( slotTextChanged(const TQString &) ), true, i18n( "Enter at least 3 letters to filter pages" ), 0/*size*/, 1 ); // 2. clear button (uses a lineEdit slot, so it must be created after) insertButton( TQApplication::reverseLayout() ? "clear_left" : "locationbar_erase", - CLEAR_ID, TQT_SIGNAL( clicked() ), - TQT_TQOBJECT(getLined( LEDIT_ID )), TQT_SLOT( clear() ), true, + CLEAR_ID, TQ_SIGNAL( clicked() ), + getLined( LEDIT_ID ), TQ_SLOT( clear() ), true, i18n( "Clear filter" ), 0/*index*/ ); // 3.1. create the popup menu for changing filtering features @@ -62,7 +62,7 @@ SearchWidget::SearchWidget( TQWidget * parent, KPDFDocument * document ) m_menu->insertItem( i18n("Match All Words"), 4 ); m_menu->insertItem( i18n("Match Any Word"), 5 ); m_menu->setItemChecked( 3, true ); - connect( m_menu, TQT_SIGNAL( activated(int) ), TQT_SLOT( slotMenuChaged(int) ) ); + connect( m_menu, TQ_SIGNAL( activated(int) ), TQ_SLOT( slotMenuChaged(int) ) ); // 3.2. create the toolbar button that spawns the popup menu insertButton( "kpdf", FIND_ID, m_menu, true, i18n( "Filter Options" ), 2/*index*/ ); diff --git a/kpdf/ui/searchwidget.h b/kpdf/ui/searchwidget.h index c84db96f..16a492de 100644 --- a/kpdf/ui/searchwidget.h +++ b/kpdf/ui/searchwidget.h @@ -29,7 +29,7 @@ class m_inputDelayTimer; */ class SearchWidget : public TDEToolBar { - Q_OBJECT + TQ_OBJECT public: SearchWidget( TQWidget *parent, KPDFDocument *document ); diff --git a/kpdf/ui/thumbnaillist.cpp b/kpdf/ui/thumbnaillist.cpp index b443daa5..7d66cfb2 100644 --- a/kpdf/ui/thumbnaillist.cpp +++ b/kpdf/ui/thumbnaillist.cpp @@ -76,7 +76,7 @@ ThumbnailList::ThumbnailList( TQWidget *parent, KPDFDocument *document ) // widget setup: can be focused by tab and mouse click (not wheel) viewport()->setFocusProxy( this ); - viewport()->setFocusPolicy( TQ_StrongFocus ); + viewport()->setFocusPolicy( TQWidget::StrongFocus ); setResizePolicy( Manual ); setAcceptDrops( true ); setDragAutoScroll( false ); @@ -85,7 +85,7 @@ ThumbnailList::ThumbnailList( TQWidget *parent, KPDFDocument *document ) viewport()->setPaletteBackgroundColor( palette().active().base() ); setFrameStyle( StyledPanel | Raised ); - connect( this, TQT_SIGNAL(contentsMoving(int, int)), this, TQT_SLOT(slotRequestVisiblePixmaps(int, int)) ); + connect( this, TQ_SIGNAL(contentsMoving(int, int)), this, TQ_SLOT(slotRequestVisiblePixmaps(int, int)) ); } ThumbnailList::~ThumbnailList() @@ -311,7 +311,7 @@ void ThumbnailList::keyPressEvent( TQKeyEvent * keyEvent ) void ThumbnailList::contentsMousePressEvent( TQMouseEvent * e ) { - if ( e->button() != Qt::LeftButton ) + if ( e->button() != TQt::LeftButton ) return; int clickY = e->y(); TQValueList<ThumbnailWidget *>::iterator vIt = m_visibleThumbnails.begin(), vEnd = m_visibleThumbnails.end(); @@ -444,7 +444,7 @@ void ThumbnailList::delayedRequestVisiblePixmaps( int delayMs ) if ( !m_delayTimer ) { m_delayTimer = new TQTimer( this ); - connect( m_delayTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotDelayTimeout() ) ); + connect( m_delayTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( slotDelayTimeout() ) ); } m_delayTimer->start( delayMs, true ); } @@ -479,7 +479,7 @@ void ThumbnailWidget::setSelected( bool selected ) void ThumbnailWidget::mouseReleaseEvent( TQMouseEvent * e ) { - if ( e->button() != Qt::RightButton ) + if ( e->button() != TQt::RightButton ) return; m_tl->forwardRightClick( m_page, e->globalPos() ); @@ -563,8 +563,8 @@ ThumbnailController::ThumbnailController( TQWidget * parent, ThumbnailList * lis // insert a togglebutton [show only bookmarked pages] //insertSeparator(); - insertButton( "bookmark", FILTERB_ID, TQT_SIGNAL( toggled( bool ) ), - TQT_TQOBJECT(list), TQT_SLOT( slotFilterBookmarks( bool ) ), + insertButton( "bookmark", FILTERB_ID, TQ_SIGNAL( toggled( bool ) ), + list, TQ_SLOT( slotFilterBookmarks( bool ) ), true, i18n( "Show bookmarked pages only" ) ); setToggle( FILTERB_ID ); setButton( FILTERB_ID, KpdfSettings::filterBookmarks() ); diff --git a/kpdf/ui/thumbnaillist.h b/kpdf/ui/thumbnaillist.h index b9fc06ae..b08a98f8 100644 --- a/kpdf/ui/thumbnaillist.h +++ b/kpdf/ui/thumbnaillist.h @@ -29,7 +29,7 @@ class ThumbnailWidget; */ class ThumbnailList : public TQScrollView, public DocumentObserver { -Q_OBJECT +TQ_OBJECT public: ThumbnailList(TQWidget *parent, KPDFDocument *document); diff --git a/kpdf/ui/toc.cpp b/kpdf/ui/toc.cpp index 00ac8eaf..e71f8746 100644 --- a/kpdf/ui/toc.cpp +++ b/kpdf/ui/toc.cpp @@ -67,8 +67,8 @@ TOC::TOC(TQWidget *parent, KPDFDocument *document) : TDEListView(parent), m_docu // the next line causes bug:147233 // setResizeMode(AllColumns); setAllColumnsShowFocus(true); - connect(this, TQT_SIGNAL(clicked(TQListViewItem *)), this, TQT_SLOT(slotExecuted(TQListViewItem *))); - connect(this, TQT_SIGNAL(returnPressed(TQListViewItem *)), this, TQT_SLOT(slotExecuted(TQListViewItem *))); + connect(this, TQ_SIGNAL(clicked(TQListViewItem *)), this, TQ_SLOT(slotExecuted(TQListViewItem *))); + connect(this, TQ_SIGNAL(returnPressed(TQListViewItem *)), this, TQ_SLOT(slotExecuted(TQListViewItem *))); } TOC::~TOC() diff --git a/kpdf/ui/toc.h b/kpdf/ui/toc.h index 3de43502..9ed1d55c 100644 --- a/kpdf/ui/toc.h +++ b/kpdf/ui/toc.h @@ -19,7 +19,7 @@ class KPDFDocument; class TOC : public TDEListView, public DocumentObserver { -Q_OBJECT +TQ_OBJECT public: TOC(TQWidget *parent, KPDFDocument *document); |