author | zautrix <zautrix> | 2005-01-16 23:41:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-16 23:41:18 (UTC) |
commit | 33c04477896c52e9cfea2a29facd959f82cbf17a (patch) (side-by-side diff) | |
tree | d7e5a882604b3bfb64087738dd61d702d2d96a60 /kaddressbook | |
parent | 507b362d42d5eed6277ad17422b6ba61acca636e (diff) | |
download | kdepimpi-33c04477896c52e9cfea2a29facd959f82cbf17a.zip kdepimpi-33c04477896c52e9cfea2a29facd959f82cbf17a.tar.gz kdepimpi-33c04477896c52e9cfea2a29facd959f82cbf17a.tar.bz2 |
several fixes
-rw-r--r-- | kaddressbook/addresseeeditorwidget.cpp | 12 | ||||
-rw-r--r-- | kaddressbook/imagewidget.cpp | 28 | ||||
-rw-r--r-- | kaddressbook/imagewidget.h | 2 |
3 files changed, 36 insertions, 6 deletions
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp index c6993e9..bd32859 100644 --- a/kaddressbook/addresseeeditorwidget.cpp +++ b/kaddressbook/addresseeeditorwidget.cpp @@ -1000,2 +1000,12 @@ void AddresseeEditorWidget::load() + mAConfig->setUid( mAddressee.uid() ); + if ( mAConfig->automaticNameParsing() ) { + mNameLabel->hide(); + mNameEdit->show(); + } else { + mNameEdit->hide(); + mNameLabel->setText( mNameEdit->text() ); + mNameLabel->show(); + } + mRoleEdit->setText( mAddressee.role() ); @@ -1207,5 +1217,5 @@ void AddresseeEditorWidget::nameTextChanged( const QString &text ) } - nameBoxChanged(); + emitModified(); diff --git a/kaddressbook/imagewidget.cpp b/kaddressbook/imagewidget.cpp index 48370e3..9ee4eac 100644 --- a/kaddressbook/imagewidget.cpp +++ b/kaddressbook/imagewidget.cpp @@ -43,2 +43,3 @@ #include <qpixmap.h> +#include <qpushbutton.h> #include <qapplication.h> @@ -54,3 +55,3 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name ) QGroupBox *photoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Photo" ), this ); - QGridLayout *boxLayout = new QGridLayout( photoBox->layout(), 3, 2, + QGridLayout *boxLayout = new QGridLayout( photoBox->layout(), 4, 2, KDialog::spacingHint() ); @@ -65,3 +66,3 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name ) mPhotoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); - boxLayout->addMultiCellWidget( mPhotoLabel, 0, 2, 0, 0 ); + boxLayout->addMultiCellWidget( mPhotoLabel, 0, 3, 0, 0 ); @@ -81,2 +82,7 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name ) + QPushButton * pb = new QPushButton( i18n( "Remove" ), photoBox ); + connect( pb, SIGNAL( clicked() ),this, SLOT( removePhoto() ) ); + boxLayout->addWidget( pb, 2, 1 ); + boxLayout->addWidget( new QLabel( photoBox ), 3, 1 ); + topLayout->addWidget( photoBox, 0, 0 ); @@ -84,3 +90,3 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name ) QGroupBox *logoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Logo" ), this ); - boxLayout = new QGridLayout( logoBox->layout(), 3, 2, KDialog::spacingHint() ); + boxLayout = new QGridLayout( logoBox->layout(), 4, 2, KDialog::spacingHint() ); boxLayout->setRowStretch( 2, 1 ); @@ -91,3 +97,3 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name ) mLogoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); - boxLayout->addMultiCellWidget( mLogoLabel, 0, 2, 0, 0 ); + boxLayout->addMultiCellWidget( mLogoLabel, 0, 3, 0, 0 ); @@ -105,2 +111,6 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name ) + pb = new QPushButton( i18n( "Remove" ), logoBox ); + connect( pb, SIGNAL( clicked() ),this, SLOT( removeLogo() ) ); + boxLayout->addWidget( pb, 2, 1 ); + boxLayout->addWidget( new QLabel( logoBox ), 3, 1 ); topLayout->addWidget( logoBox, 1, 0 ); @@ -240,5 +250,13 @@ KABC::Picture ImageWidget::logo() const } - return logo; } +void ImageWidget::removePhoto() +{ + setPhoto(KABC::Picture() ); +} + +void ImageWidget::removeLogo() +{ + setLogo(KABC::Picture() ); +} diff --git a/kaddressbook/imagewidget.h b/kaddressbook/imagewidget.h index b3ca0bd..afb9aa7 100644 --- a/kaddressbook/imagewidget.h +++ b/kaddressbook/imagewidget.h @@ -71,2 +71,4 @@ class ImageWidget : public QWidget void loadLogo(); + void removePhoto(); + void removeLogo(); void updateGUI(); |