summaryrefslogtreecommitdiffstats
path: root/src/indexwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/indexwidget.cpp')
-rw-r--r--src/indexwidget.cpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/src/indexwidget.cpp b/src/indexwidget.cpp
index 9c2f8ff..023867e 100644
--- a/src/indexwidget.cpp
+++ b/src/indexwidget.cpp
@@ -20,19 +20,19 @@
* *
***************************************************************************/
-#include <qdragobject.h>
-#include <qfontmetrics.h>
-#include <qpainter.h>
-#include <qpopupmenu.h>
-#include <qtimer.h>
+#include <ntqdragobject.h>
+#include <ntqfontmetrics.h>
+#include <ntqpainter.h>
+#include <ntqpopupmenu.h>
+#include <ntqtimer.h>
#include <kapplication.h>
-#include <kconfig.h>
+#include <tdeconfig.h>
#include <kdebug.h>
-#include <kglobal.h>
+#include <tdeglobal.h>
#include <kglobalsettings.h>
#include <kiconloader.h>
-#include <klocale.h>
+#include <tdelocale.h>
#include "global.h"
#include "indexwidget.h"
@@ -44,7 +44,7 @@
// ===========
IndexWidget::IndexWidget( ScanStack* scanStack, MainWidget* parent, const char* name )
-: QScrollView( parent, name ),
+: TQScrollView( parent, name ),
m_blinkTimer( NULL ),
m_scanCount( 0 ),
m_scanStack( scanStack )
@@ -56,7 +56,7 @@ IndexWidget::IndexWidget( ScanStack* scanStack, MainWidget* parent, const char*
// ==============
short IndexWidget::calculateIndex( const ushort y )
-{ QFontMetrics metrics = fontMetrics( );
+{ TQFontMetrics metrics = fontMetrics( );
byte height = metrics.height( );
ushort index = y / height;
@@ -66,7 +66,7 @@ short IndexWidget::calculateIndex( const ushort y )
// contentsContextMenuEvent
// ========================
-void IndexWidget::contentsContextMenuEvent( QContextMenuEvent* event )
+void IndexWidget::contentsContextMenuEvent( TQContextMenuEvent* event )
{ short index = calculateIndex( event->y( ));
if( index < 0 )
@@ -75,15 +75,15 @@ void IndexWidget::contentsContextMenuEvent( QContextMenuEvent* event )
ScanWidget* scanWidget = m_scanStack->makeScanWidgetVisible( index );
emit( visibleScanWidgetChanged( scanWidget ));
- QPopupMenu* contextMenu = new QPopupMenu( this, "context menu" );
- KIconLoader* iconLoader = KGlobal::iconLoader( );
- QIconSet profileLoad = iconLoader->loadIconSet( "profileload", KIcon::Small );
- QIconSet profileSave = iconLoader->loadIconSet( "profilesave", KIcon::Small );
- QIconSet profileSaveAs = iconLoader->loadIconSet( "profilesaveas", KIcon::Small );
- QIconSet scanClose = iconLoader->loadIconSet( "scanclose", KIcon::Small );
- QIconSet scanDuplicate = iconLoader->loadIconSet( "scanduplicate", KIcon::Small );
- QIconSet scanNew = iconLoader->loadIconSet( "scannew", KIcon::Small );
- QIconSet scanRename = iconLoader->loadIconSet( "scanrename", KIcon::Small );
+ TQPopupMenu* contextMenu = new TQPopupMenu( this, "context menu" );
+ TDEIconLoader* iconLoader = TDEGlobal::iconLoader( );
+ TQIconSet profileLoad = iconLoader->loadIconSet( "profileload", TDEIcon::Small );
+ TQIconSet profileSave = iconLoader->loadIconSet( "profilesave", TDEIcon::Small );
+ TQIconSet profileSaveAs = iconLoader->loadIconSet( "profilesaveas", TDEIcon::Small );
+ TQIconSet scanClose = iconLoader->loadIconSet( "scanclose", TDEIcon::Small );
+ TQIconSet scanDuplicate = iconLoader->loadIconSet( "scanduplicate", TDEIcon::Small );
+ TQIconSet scanNew = iconLoader->loadIconSet( "scannew", TDEIcon::Small );
+ TQIconSet scanRename = iconLoader->loadIconSet( "scanrename", TDEIcon::Small );
contextMenu->insertItem( scanClose, i18n( "&Close scan" ), parent( ), SLOT( slotScanClose( )), CTRL+Key_W );
contextMenu->insertItem( scanDuplicate, i18n( "&Duplicate scan" ), parent( ), SLOT( slotScanDuplicate( )), CTRL+Key_C );
@@ -101,7 +101,7 @@ void IndexWidget::contentsContextMenuEvent( QContextMenuEvent* event )
// contentsDragMoveEvent
// =====================
-void IndexWidget::contentsDragMoveEvent( QDragMoveEvent* event )
+void IndexWidget::contentsDragMoveEvent( TQDragMoveEvent* event )
{ short index = calculateIndex( event->pos( ).y( ));
index = index < 0 ? m_scanStack->count( ) - 1 : index;
@@ -112,8 +112,8 @@ void IndexWidget::contentsDragMoveEvent( QDragMoveEvent* event )
// contentsMouseMoveEvent
// ======================
-void IndexWidget::contentsMouseMoveEvent( QMouseEvent* event )
-{ if( event->stateAfter( ) != Qt::LeftButton )
+void IndexWidget::contentsMouseMoveEvent( TQMouseEvent* event )
+{ if( event->stateAfter( ) != TQt::LeftButton )
return;
short index = calculateIndex( event->y( ));
@@ -121,7 +121,7 @@ void IndexWidget::contentsMouseMoveEvent( QMouseEvent* event )
if( index < 0 )
return;
- QStoredDrag* drag = new QStoredDrag( "application/octet-stream", this );
+ TQStoredDrag* drag = new TQStoredDrag( "application/octet-stream", this );
drag->dragMove( );
ScanWidget* scanWidget = m_scanStack->moveScanWidget( index );
@@ -135,8 +135,8 @@ void IndexWidget::contentsMouseMoveEvent( QMouseEvent* event )
// contentsMousePressEvent
// =======================
-void IndexWidget::contentsMousePressEvent( QMouseEvent* event )
-{ if( event->stateAfter( ) != Qt::LeftButton )
+void IndexWidget::contentsMousePressEvent( TQMouseEvent* event )
+{ if( event->stateAfter( ) != TQt::LeftButton )
return;
short index = calculateIndex( event->y( ));
@@ -154,11 +154,11 @@ void IndexWidget::contentsMousePressEvent( QMouseEvent* event )
// drawContents
// ============
-void IndexWidget::drawContents( QPainter* painter, int clipx, int clipy, int clipw, int cliph )
-{ painter->fillRect( clipx, clipy, clipw, cliph, KGlobalSettings::baseColor( ));
- painter->setBackgroundMode( Qt::OpaqueMode );
+void IndexWidget::drawContents( TQPainter* painter, int clipx, int clipy, int clipw, int cliph )
+{ painter->fillRect( clipx, clipy, clipw, cliph, TDEGlobalSettings::baseColor( ));
+ painter->setBackgroundMode( TQt::OpaqueMode );
- QFontMetrics metrics = fontMetrics( );
+ TQFontMetrics metrics = fontMetrics( );
byte height = metrics.height( );
byte aWidth2 = 2 * metrics.width( "*" );
ushort x = height / 2;
@@ -172,40 +172,40 @@ void IndexWidget::drawContents( QPainter* painter, int clipx, int clipy, int cli
switch( scanWidget->state( ))
{ case ScanWidget::dormant:
if( m_scanStack->isVisibleWidget( scanWidget ))
- { painter->fillRect( 0, y, visibleWidth( ), height, KGlobalSettings::alternateBackgroundColor( ));
- painter->setBackgroundColor( KGlobalSettings::alternateBackgroundColor( ));
- painter->setPen( KGlobalSettings::buttonTextColor( ));
+ { painter->fillRect( 0, y, visibleWidth( ), height, TDEGlobalSettings::alternateBackgroundColor( ));
+ painter->setBackgroundColor( TDEGlobalSettings::alternateBackgroundColor( ));
+ painter->setPen( TDEGlobalSettings::buttonTextColor( ));
break;
}
- painter->setBackgroundColor( KGlobalSettings::baseColor( ));
- painter->setPen( KGlobalSettings::buttonTextColor( ));
+ painter->setBackgroundColor( TDEGlobalSettings::baseColor( ));
+ painter->setPen( TDEGlobalSettings::buttonTextColor( ));
break;
case ScanWidget::finished:
- painter->fillRect( 0, y, visibleWidth( ), height, KGlobalSettings::highlightColor( ));
- painter->setBackgroundColor( KGlobalSettings::highlightColor( ));
- painter->setPen( KGlobalSettings::activeTextColor( ));
+ painter->fillRect( 0, y, visibleWidth( ), height, TDEGlobalSettings::highlightColor( ));
+ painter->setBackgroundColor( TDEGlobalSettings::highlightColor( ));
+ painter->setPen( TDEGlobalSettings::activeTextColor( ));
break;
case ScanWidget::running:
if( m_highlight )
- { painter->fillRect( 0, y, visibleWidth( ), height, KGlobalSettings::highlightColor( ));
- painter->setBackgroundColor( KGlobalSettings::highlightColor( ));
- painter->setPen( KGlobalSettings::activeTextColor( ));
+ { painter->fillRect( 0, y, visibleWidth( ), height, TDEGlobalSettings::highlightColor( ));
+ painter->setBackgroundColor( TDEGlobalSettings::highlightColor( ));
+ painter->setPen( TDEGlobalSettings::activeTextColor( ));
break;
}
if( m_scanStack->isVisibleWidget( scanWidget ))
- { painter->fillRect( 0, y, visibleWidth( ), height, KGlobalSettings::alternateBackgroundColor( ));
- painter->setBackgroundColor( KGlobalSettings::alternateBackgroundColor( ));
- painter->setPen( KGlobalSettings::buttonTextColor( ));
+ { painter->fillRect( 0, y, visibleWidth( ), height, TDEGlobalSettings::alternateBackgroundColor( ));
+ painter->setBackgroundColor( TDEGlobalSettings::alternateBackgroundColor( ));
+ painter->setPen( TDEGlobalSettings::buttonTextColor( ));
break;
}
- painter->fillRect( 0, y, visibleWidth( ), height, KGlobalSettings::baseColor( ));
- painter->setBackgroundColor( KGlobalSettings::baseColor( ));
- painter->setPen( KGlobalSettings::buttonTextColor( ));
+ painter->fillRect( 0, y, visibleWidth( ), height, TDEGlobalSettings::baseColor( ));
+ painter->setBackgroundColor( TDEGlobalSettings::baseColor( ));
+ painter->setPen( TDEGlobalSettings::buttonTextColor( ));
break;
}
@@ -231,7 +231,7 @@ void IndexWidget::ensureCurrentVisible( )
if( index < 0 )
return;
- QFontMetrics metrics = fontMetrics( );
+ TQFontMetrics metrics = fontMetrics( );
short y = index * metrics.height( ) - height( ) / 2;
setContentsPos( 0, y );
updateContents( );
@@ -252,7 +252,7 @@ void IndexWidget::slotScanStarted( )
return;
ASSERT( m_blinkTimer == NULL );
- m_blinkTimer = new QTimer( this );
+ m_blinkTimer = new TQTimer( this );
connect( m_blinkTimer, SIGNAL( timeout( )), SLOT( slotRepaint( )));
m_blinkTimer->start( 500 );
m_highlight = true;