summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Side-by-side diff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp12
-rw-r--r--kaddressbook/imagewidget.cpp28
-rw-r--r--kaddressbook/imagewidget.h2
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();