summaryrefslogtreecommitdiffabout
path: root/kaddressbook/details/look_details.cpp
Side-by-side diff
Diffstat (limited to 'kaddressbook/details/look_details.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/details/look_details.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/kaddressbook/details/look_details.cpp b/kaddressbook/details/look_details.cpp
index 11d06e9..2c3a79d 100644
--- a/kaddressbook/details/look_details.cpp
+++ b/kaddressbook/details/look_details.cpp
@@ -144,100 +144,100 @@ void KABDetailedView::paintEvent( QPaintEvent* )
case Bordered:
p.drawTiledPixmap( 1, 1, QMIN( width() - 2, mCurrentBackground.width() ),
height() - 2, mCurrentBackground );
break;
case None: // no BG image defined for this entry:
default:
if ( mUseDefaultBGImage )
p.drawTiledPixmap( 1, 1, width() - 2, height() - 2, mDefaultBGImage );
break;
};
p.setViewport( entryArea );
mPainter->setShowAddresses( mActionShowAddresses->isChecked() );
mPainter->setShowEmails( mActionShowEmails->isChecked() );
mPainter->setShowPhones( mActionShowPhones->isChecked() );
mPainter->setShowURLs( mActionShowURLs->isChecked() );
mPainter->printAddressee( addressee(), QRect( 0, 0, entryArea.width(),
entryArea.height() ), &p );
p.end();
bitBlt( this, 0, 0, &pm );
}
void KABDetailedView::mouseMoveEvent( QMouseEvent *e )
{
QPoint bias( mGrid, mGrid );
int rc;
bool hit = false;
if ( ( rc = mPainter->hitsEmail( e->pos() - bias ) ) != -1 )
hit = true;
else if ( ( rc = mPainter->hitsURL( e->pos() - bias ) ) != -1 )
hit = true;
else if ( ( rc = mPainter->hitsPhone( e->pos() - bias ) ) != -1 )
hit = true;
else if ( ( rc = mPainter->hitsTalk( e->pos() - bias ) ) != -1 )
hit = true;
if ( hit ) {
if ( cursor().shape() != PointingHandCursor )
setCursor( PointingHandCursor );
else if( cursor().shape() != ArrowCursor )
setCursor(ArrowCursor);
}
}
void KABDetailedView::mousePressEvent( QMouseEvent *e )
{
- QPopupMenu menu( this );
- QPopupMenu *menuBG = new QPopupMenu( &menu );
- mMenuBorderedBG = new QPopupMenu( &menu );
- mMenuTiledBG = new QPopupMenu( &menu );
+ Q3PopupMenu menu( this );
+ Q3PopupMenu *menuBG = new Q3PopupMenu( &menu );
+ mMenuBorderedBG = new Q3PopupMenu( &menu );
+ mMenuTiledBG = new Q3PopupMenu( &menu );
menu.insertItem( i18n( "Select Background" ), menuBG );
menuBG->insertItem( i18n( "Bordered Backgrounds" ), mMenuBorderedBG );
menuBG->insertItem( i18n( "Tiled Backgrounds" ), mMenuTiledBG );
menu.insertSeparator();
QPoint point = e->pos() - QPoint( mGrid, mGrid );
int rc;
QStringList dirsBorderedBG, dirsTiledBG;
QDir dir;
switch( e->button() ) {
case QMouseEvent::RightButton:
if ( isReadOnly() )
menu.setItemEnabled( menu.idAt( 0 ), false );
else {
// TODO: settings need to be saved in view options
dirsBorderedBG = KGlobal::instance()->dirs()->findDirs( "data", mBorderedBGDir );
if ( dirsBorderedBG.count() > 0 ) {
dir.setPath( dirsBorderedBG[ 0 ] );
mBorders = dir.entryList( QDir::Files );
for ( uint count = 0; count < mBorders.count(); ++count )
mMenuBorderedBG->insertItem( mBorders[ count ], count );
connect( mMenuBorderedBG, SIGNAL( activated( int ) ),
SLOT( slotBorderedBGSelected( int ) ) );
} else
menuBG->setItemEnabled( menuBG->idAt( 0 ), false );
dirsTiledBG = KGlobal::instance()->dirs()->findDirs( "data", mTiledBGDir );
if ( dirsTiledBG.count() > 0 ) {
dir.setPath( dirsTiledBG[ 0 ] );
mTiles = dir.entryList( QDir::Files );
for ( uint count = 0; count < mTiles.count(); ++count )
mMenuTiledBG->insertItem( mTiles[ count ], count );
connect( mMenuTiledBG, SIGNAL( activated( int ) ),
SLOT( slotTiledBGSelected( int ) ) );
} else
menuBG->setItemEnabled( menuBG->idAt( 1 ), false );
}
mActionShowAddresses->plug( &menu );
mActionShowEmails->plug( &menu );
mActionShowPhones->plug( &menu );
mActionShowURLs->plug( &menu );
menu.exec( e->globalPos() );
@@ -369,51 +369,51 @@ void KABDetailedView::restoreSettings( KConfig *config )
config->setGroup( ConfigView );
// load the default background image:
QString bgImage;
mUseDefaultBGImage = config->readBoolEntry( ConfigView_UseDefaultBackground, true );
mDefaultBGColor = config->readColorEntry( ConfigView_DefaultBackgroundColor, &white );
bgImage = config->readEntry( ConfigView_DefaultBackgroundImage, "konqueror/tiles/kenwimer.png" );
if ( mUseDefaultBGImage ) {
uint count = 0;
QStringList dirs = KGlobal::instance()->dirs()->findDirs( "data", "/" );
if ( !dirs.isEmpty() ) {
for ( count = 0; count < dirs.count(); ++count ) {
if ( getBackground( dirs[ count ] + "/" + bgImage, mDefaultBGImage ) )
break;
}
}
if ( count == dirs.count() ) {
mUseDefaultBGImage = getBackground( bgImage, mDefaultBGImage );
if ( !mUseDefaultBGImage )
kdDebug(5720) << "KABDetailedView::configure: "
<< "default BG image selected, but could not be loaded."
<< endl;
}
}
mDefaultBGColor = config->readColorEntry( ConfigView_DefaultBackgroundColor, &white );
mHeadLineBGColor = config->readColorEntry( ConfigView_HeadlineBGColor, &darkBlue );
mHeadLineTextColor = config->readColorEntry( ConfigView_HeadlineTextColor, &yellow );
mUseHeadLineBGColor = config->readBoolEntry( ConfigView_UseHeadlineBGColor, true );
if ( !mPainter )
mPainter = new KABEntryPainter;
mPainter->setForegroundColor( black );
mPainter->setHeaderColor( mHeadLineTextColor );
mPainter->setUseHeaderColor( mUseHeadLineBGColor );
mPainter->setBackgroundColor( mHeadLineBGColor );
mPainter->setHeaderFont( QFont( gfont, gpointsize + 4, QFont::Bold, true ) );
mPainter->setHeadLineFont( QFont( gfont, gpointsize + 2, QFont::Bold, true ) );
mPainter->setBodyFont( QFont( gfont, gpointsize, QFont::Normal, false ) );
mPainter->setFixedFont( QFont( ffont, fpointsize, QFont::Normal, false ) );
mPainter->setCommentFont( QFont( gfont, gpointsize, QFont::Normal, false ) );
}
-#ifndef KAB_EMBEDDED
-#include "look_details.moc"
+#ifndef KAB_EMBEDDED_
+#include "moc_look_details.cpp"
#endif //KAB_EMBEDDED