summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Side-by-side diff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp32
-rw-r--r--kaddressbook/addresseeeditorwidget.h2
2 files changed, 28 insertions, 6 deletions
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp
index 29abd6f..310d628 100644
--- a/kaddressbook/addresseeeditorwidget.cpp
+++ b/kaddressbook/addresseeeditorwidget.cpp
@@ -190,3 +190,5 @@ void AddresseeEditorWidget::setupTab1()
- label = new QLabel( i18n( "Role:" ), tab1 );
+ button = new QPushButton( i18n( "Role:" ), tab1 );
+ connect( button, SIGNAL( clicked() ), SLOT( setRole2FN() ) );
+ //label = new QLabel( i18n( "Role:" ), tab1 );
mRoleEdit = new KLineEdit( tab1 );
@@ -194,4 +196,4 @@ void AddresseeEditorWidget::setupTab1()
SLOT( textChanged( const QString& ) ) );
- label->setBuddy( mRoleEdit );
- layout->addWidget( label, 1, 0 );
+ //label->setBuddy( mRoleEdit );
+ layout->addWidget( button, 1, 0 );
layout->addWidget( mRoleEdit, 1, 1 );
@@ -199,8 +201,10 @@ void AddresseeEditorWidget::setupTab1()
// Organization
- label = new QLabel( i18n( "Organization:" ), tab1 );
+ button = new QPushButton( i18n( "Organization:" ), tab1 );
+ connect( button, SIGNAL( clicked() ), SLOT( setCompany2FN() ) );
+ //label = new QLabel( i18n( "Organization:" ), tab1 );
mOrgEdit = new KLineEdit( tab1 );
- label->setBuddy( mOrgEdit );
+ //label->setBuddy( mOrgEdit );
connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ),
SLOT( textChanged( const QString& ) ) );
- layout->addWidget( label, 2, 0 );
+ layout->addWidget( button, 2, 0 );
layout->addWidget( mOrgEdit, 2, 1 );
@@ -327,2 +331,18 @@ void AddresseeEditorWidget::setupTab1()
+void AddresseeEditorWidget::setRole2FN()
+{
+ if ( mRoleEdit->text().isEmpty() ) return;
+ mFormattedNameType = NameEditDialog::CustomName;
+ mAddressee.setFormattedName( mRoleEdit->text() );
+ mFormattedNameLabel->setText( mRoleEdit->text() );
+ mDirty = true;
+}
+void AddresseeEditorWidget::setCompany2FN()
+{
+ if ( mOrgEdit->text().isEmpty() ) return;
+ mFormattedNameType = NameEditDialog::CustomName;
+ mAddressee.setFormattedName( mOrgEdit->text() );
+ mFormattedNameLabel->setText( mOrgEdit->text() );
+ mDirty = true;
+}
diff --git a/kaddressbook/addresseeeditorwidget.h b/kaddressbook/addresseeeditorwidget.h
index 995f30e..eaf5b16 100644
--- a/kaddressbook/addresseeeditorwidget.h
+++ b/kaddressbook/addresseeeditorwidget.h
@@ -91,2 +91,4 @@ class AddresseeEditorWidget : public ExtensionWidget
protected slots:
+ void setRole2FN();
+ void setCompany2FN();
void textChanged( const QString& );