summaryrefslogtreecommitdiffabout
path: root/kaddressbook/details/look_details.cpp
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kaddressbook/details/look_details.cpp
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'kaddressbook/details/look_details.cpp') (more/less context) (ignore 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