Diffstat (limited to 'kaddressbook/addresseeeditorwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/addresseeeditorwidget.cpp | 32 |
1 files changed, 26 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 @@ -183,31 +183,35 @@ void AddresseeEditorWidget::setupTab1() mNameLabel = new KSqueezedTextLabel( tab1 ); mNameLabel->hide(); layout->addWidget( button, 0, 0 ); layout->addWidget( mNameEdit, 0, 1 ); layout->addWidget( mNameLabel, 0, 1 ); - 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 ); connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ), 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 ); // 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 ); // File as (formatted name) label = new QLabel( i18n( "Formatted name:" ), tab1 ); mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); layout->addWidget( label, 3, 0 ); layout->addWidget( mFormattedNameLabel, 3, 1 ); /* LR @@ -320,16 +324,32 @@ void AddresseeEditorWidget::setupTab1() layout->addMultiCellWidget( categoryBox, iii, iii, 0, 1 ); // Build the layout and add to the tab widget layout->activate(); // required mTabWidget->addTab( tab1, i18n( "&General" ) ); } +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; +} void AddresseeEditorWidget::setupTab1_1() { // This is the Address tab QWidget *tab1_1 = new QWidget( mTabWidget ); //US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 ); QGridLayout *layout = new QGridLayout( tab1_1, 7, 2 ); |