author | zautrix <zautrix> | 2005-08-10 12:07:33 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-08-10 12:07:33 (UTC) |
commit | a238b7709a6abcf39dc5f79c26270d04bf18f00c (patch) (unidiff) | |
tree | 7e87a8bcdfbc65f1e7fbfe1690a5f2ac36f69815 | |
parent | 722a463b47ba8fe2dbf52329fec27af4125d530b (diff) | |
download | kdepimpi-a238b7709a6abcf39dc5f79c26270d04bf18f00c.zip kdepimpi-a238b7709a6abcf39dc5f79c26270d04bf18f00c.tar.gz kdepimpi-a238b7709a6abcf39dc5f79c26270d04bf18f00c.tar.bz2 |
fixx
-rw-r--r-- | kaddressbook/addresseeeditorwidget.cpp | 32 | ||||
-rw-r--r-- | kaddressbook/addresseeeditorwidget.h | 2 |
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 | |||
@@ -175,47 +175,51 @@ void AddresseeEditorWidget::setupTab1() | |||
175 | */ | 175 | */ |
176 | // First name | 176 | // First name |
177 | button = new QPushButton( i18n( "Name..." ), tab1 ); | 177 | button = new QPushButton( i18n( "Name..." ), tab1 ); |
178 | //US QToolTip::add( button, i18n( "Edit the contact's name" ) ); | 178 | //US QToolTip::add( button, i18n( "Edit the contact's name" ) ); |
179 | mNameEdit = new KLineEdit( tab1, "mNameEdit" ); | 179 | mNameEdit = new KLineEdit( tab1, "mNameEdit" ); |
180 | connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), | 180 | connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), |
181 | SLOT( nameTextChanged( const QString& ) ) ); | 181 | SLOT( nameTextChanged( const QString& ) ) ); |
182 | connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) ); | 182 | connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) ); |
183 | 183 | ||
184 | mNameLabel = new KSqueezedTextLabel( tab1 ); | 184 | mNameLabel = new KSqueezedTextLabel( tab1 ); |
185 | mNameLabel->hide(); | 185 | mNameLabel->hide(); |
186 | 186 | ||
187 | layout->addWidget( button, 0, 0 ); | 187 | layout->addWidget( button, 0, 0 ); |
188 | layout->addWidget( mNameEdit, 0, 1 ); | 188 | layout->addWidget( mNameEdit, 0, 1 ); |
189 | layout->addWidget( mNameLabel, 0, 1 ); | 189 | layout->addWidget( mNameLabel, 0, 1 ); |
190 | 190 | ||
191 | label = new QLabel( i18n( "Role:" ), tab1 ); | 191 | button = new QPushButton( i18n( "Role:" ), tab1 ); |
192 | connect( button, SIGNAL( clicked() ), SLOT( setRole2FN() ) ); | ||
193 | //label = new QLabel( i18n( "Role:" ), tab1 ); | ||
192 | mRoleEdit = new KLineEdit( tab1 ); | 194 | mRoleEdit = new KLineEdit( tab1 ); |
193 | connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ), | 195 | connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ), |
194 | SLOT( textChanged( const QString& ) ) ); | 196 | SLOT( textChanged( const QString& ) ) ); |
195 | label->setBuddy( mRoleEdit ); | 197 | //label->setBuddy( mRoleEdit ); |
196 | layout->addWidget( label, 1, 0 ); | 198 | layout->addWidget( button, 1, 0 ); |
197 | layout->addWidget( mRoleEdit, 1, 1 ); | 199 | layout->addWidget( mRoleEdit, 1, 1 ); |
198 | 200 | ||
199 | // Organization | 201 | // Organization |
200 | label = new QLabel( i18n( "Organization:" ), tab1 ); | 202 | button = new QPushButton( i18n( "Organization:" ), tab1 ); |
203 | connect( button, SIGNAL( clicked() ), SLOT( setCompany2FN() ) ); | ||
204 | //label = new QLabel( i18n( "Organization:" ), tab1 ); | ||
201 | mOrgEdit = new KLineEdit( tab1 ); | 205 | mOrgEdit = new KLineEdit( tab1 ); |
202 | label->setBuddy( mOrgEdit ); | 206 | //label->setBuddy( mOrgEdit ); |
203 | connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), | 207 | connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), |
204 | SLOT( textChanged( const QString& ) ) ); | 208 | SLOT( textChanged( const QString& ) ) ); |
205 | layout->addWidget( label, 2, 0 ); | 209 | layout->addWidget( button, 2, 0 ); |
206 | layout->addWidget( mOrgEdit, 2, 1 ); | 210 | layout->addWidget( mOrgEdit, 2, 1 ); |
207 | 211 | ||
208 | // File as (formatted name) | 212 | // File as (formatted name) |
209 | label = new QLabel( i18n( "Formatted name:" ), tab1 ); | 213 | label = new QLabel( i18n( "Formatted name:" ), tab1 ); |
210 | mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); | 214 | mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); |
211 | layout->addWidget( label, 3, 0 ); | 215 | layout->addWidget( label, 3, 0 ); |
212 | layout->addWidget( mFormattedNameLabel, 3, 1 ); | 216 | layout->addWidget( mFormattedNameLabel, 3, 1 ); |
213 | /* LR | 217 | /* LR |
214 | // Left hand separator. This separator doesn't go all the way | 218 | // Left hand separator. This separator doesn't go all the way |
215 | // across so the dialog still flows from top to bottom | 219 | // across so the dialog still flows from top to bottom |
216 | bar = new KSeparator( KSeparator::HLine, tab1 ); | 220 | bar = new KSeparator( KSeparator::HLine, tab1 ); |
217 | layout->addMultiCellWidget( bar, 4, 4, 0, 2 ); | 221 | layout->addMultiCellWidget( bar, 4, 4, 0, 2 ); |
218 | */ | 222 | */ |
219 | ////////////////////////////////////// | 223 | ////////////////////////////////////// |
220 | 224 | ||
221 | /* LR | 225 | /* LR |
@@ -312,32 +316,48 @@ void AddresseeEditorWidget::setupTab1() | |||
312 | mCategoryEdit->setReadOnly( true ); | 316 | mCategoryEdit->setReadOnly( true ); |
313 | connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), | 317 | connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), |
314 | SLOT( textChanged( const QString& ) ) ); | 318 | SLOT( textChanged( const QString& ) ) ); |
315 | 319 | ||
316 | mSecrecyWidget = new SecrecyWidget( categoryBox ); | 320 | mSecrecyWidget = new SecrecyWidget( categoryBox ); |
317 | connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 321 | connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
318 | 322 | ||
319 | //US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); | 323 | //US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); |
320 | layout->addMultiCellWidget( categoryBox, iii, iii, 0, 1 ); | 324 | layout->addMultiCellWidget( categoryBox, iii, iii, 0, 1 ); |
321 | 325 | ||
322 | // Build the layout and add to the tab widget | 326 | // Build the layout and add to the tab widget |
323 | layout->activate(); // required | 327 | layout->activate(); // required |
324 | 328 | ||
325 | mTabWidget->addTab( tab1, i18n( "&General" ) ); | 329 | mTabWidget->addTab( tab1, i18n( "&General" ) ); |
326 | } | 330 | } |
327 | 331 | ||
332 | void AddresseeEditorWidget::setRole2FN() | ||
333 | { | ||
334 | if ( mRoleEdit->text().isEmpty() ) return; | ||
335 | mFormattedNameType = NameEditDialog::CustomName; | ||
336 | mAddressee.setFormattedName( mRoleEdit->text() ); | ||
337 | mFormattedNameLabel->setText( mRoleEdit->text() ); | ||
338 | mDirty = true; | ||
339 | } | ||
340 | void AddresseeEditorWidget::setCompany2FN() | ||
341 | { | ||
342 | if ( mOrgEdit->text().isEmpty() ) return; | ||
343 | mFormattedNameType = NameEditDialog::CustomName; | ||
344 | mAddressee.setFormattedName( mOrgEdit->text() ); | ||
345 | mFormattedNameLabel->setText( mOrgEdit->text() ); | ||
346 | mDirty = true; | ||
347 | } | ||
328 | 348 | ||
329 | void AddresseeEditorWidget::setupTab1_1() | 349 | void AddresseeEditorWidget::setupTab1_1() |
330 | { | 350 | { |
331 | // This is the Address tab | 351 | // This is the Address tab |
332 | QWidget *tab1_1 = new QWidget( mTabWidget ); | 352 | QWidget *tab1_1 = new QWidget( mTabWidget ); |
333 | 353 | ||
334 | //US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 ); | 354 | //US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 ); |
335 | QGridLayout *layout = new QGridLayout( tab1_1, 7, 2 ); | 355 | QGridLayout *layout = new QGridLayout( tab1_1, 7, 2 ); |
336 | layout->setMargin( KDialogBase::marginHintSmall() ); | 356 | layout->setMargin( KDialogBase::marginHintSmall() ); |
337 | layout->setSpacing( KDialogBase::spacingHintSmall() ); | 357 | layout->setSpacing( KDialogBase::spacingHintSmall() ); |
338 | 358 | ||
339 | QLabel *label; | 359 | QLabel *label; |
340 | KSeparator* bar; | 360 | KSeparator* bar; |
341 | QPushButton *button; | 361 | QPushButton *button; |
342 | 362 | ||
343 | /*US | 363 | /*US |
diff --git a/kaddressbook/addresseeeditorwidget.h b/kaddressbook/addresseeeditorwidget.h index 995f30e..eaf5b16 100644 --- a/kaddressbook/addresseeeditorwidget.h +++ b/kaddressbook/addresseeeditorwidget.h | |||
@@ -76,32 +76,34 @@ class AddresseeEditorWidget : public ExtensionWidget | |||
76 | ~AddresseeEditorWidget(); | 76 | ~AddresseeEditorWidget(); |
77 | 77 | ||
78 | void setAddressee( const KABC::Addressee& ); | 78 | void setAddressee( const KABC::Addressee& ); |
79 | const KABC::Addressee &addressee(); | 79 | const KABC::Addressee &addressee(); |
80 | 80 | ||
81 | void contactsSelectionChanged(); | 81 | void contactsSelectionChanged(); |
82 | 82 | ||
83 | void load(); | 83 | void load(); |
84 | void save(); | 84 | void save(); |
85 | 85 | ||
86 | bool dirty(); | 86 | bool dirty(); |
87 | 87 | ||
88 | QString title() const; | 88 | QString title() const; |
89 | QString identifier() const; | 89 | QString identifier() const; |
90 | 90 | ||
91 | protected slots: | 91 | protected slots: |
92 | void setRole2FN(); | ||
93 | void setCompany2FN(); | ||
92 | void textChanged( const QString& ); | 94 | void textChanged( const QString& ); |
93 | void pageChanged( QWidget *wdg ); | 95 | void pageChanged( QWidget *wdg ); |
94 | 96 | ||
95 | /** | 97 | /** |
96 | Emits the modified signal and sets the dirty flag. Any slot | 98 | Emits the modified signal and sets the dirty flag. Any slot |
97 | that modifies data should use this method instead of calling emit | 99 | that modifies data should use this method instead of calling emit |
98 | modified() directly. | 100 | modified() directly. |
99 | */ | 101 | */ |
100 | void emitModified(); | 102 | void emitModified(); |
101 | 103 | ||
102 | void dateChanged( QDate ); | 104 | void dateChanged( QDate ); |
103 | void invalidDate(); | 105 | void invalidDate(); |
104 | void nameTextChanged( const QString& ); | 106 | void nameTextChanged( const QString& ); |
105 | void nameBoxChanged(); | 107 | void nameBoxChanged(); |
106 | void nameButtonClicked(); | 108 | void nameButtonClicked(); |
107 | void categoryButtonClicked(); | 109 | void categoryButtonClicked(); |