author | zautrix <zautrix> | 2004-07-06 20:10:47 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-07-06 20:10:47 (UTC) |
commit | 3db5c4e190d1031f2471516f8a52114f06d1a3eb (patch) (unidiff) | |
tree | dbccf9780829b25c01a2a65439409591b8da422e | |
parent | 9c1abdb6194f9539b26d9f3045bde5cd91960dd0 (diff) | |
download | kdepimpi-3db5c4e190d1031f2471516f8a52114f06d1a3eb.zip kdepimpi-3db5c4e190d1031f2471516f8a52114f06d1a3eb.tar.gz kdepimpi-3db5c4e190d1031f2471516f8a52114f06d1a3eb.tar.bz2 |
Fixed the qdialog::accept problem
-rw-r--r-- | kaddressbook/addresseeeditordialog.cpp | 5 | ||||
-rw-r--r-- | microkde/kdialogbase.cpp | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/kaddressbook/addresseeeditordialog.cpp b/kaddressbook/addresseeeditordialog.cpp index 6bc4129..d8c1aca 100644 --- a/kaddressbook/addresseeeditordialog.cpp +++ b/kaddressbook/addresseeeditordialog.cpp | |||
@@ -55,67 +55,68 @@ AddresseeEditorDialog::AddresseeEditorDialog( KABCore *core, QWidget *parent, | |||
55 | hideButtons(); | 55 | hideButtons(); |
56 | } | 56 | } |
57 | } | 57 | } |
58 | 58 | ||
59 | AddresseeEditorDialog::~AddresseeEditorDialog() | 59 | AddresseeEditorDialog::~AddresseeEditorDialog() |
60 | { | 60 | { |
61 | qDebug("AddresseeEditorDialog::~AddresseeEditorDialog()"); | 61 | qDebug("AddresseeEditorDialog::~AddresseeEditorDialog()"); |
62 | //emit editorDestroyed( mEditorWidget->addressee().uid() ); | 62 | //emit editorDestroyed( mEditorWidget->addressee().uid() ); |
63 | } | 63 | } |
64 | 64 | ||
65 | void AddresseeEditorDialog::setAddressee( const KABC::Addressee &addr ) | 65 | void AddresseeEditorDialog::setAddressee( const KABC::Addressee &addr ) |
66 | { | 66 | { |
67 | enableButton( KDialogBase::Apply, false ); | 67 | enableButton( KDialogBase::Apply, false ); |
68 | 68 | ||
69 | mEditorWidget->setAddressee( addr ); | 69 | mEditorWidget->setAddressee( addr ); |
70 | } | 70 | } |
71 | 71 | ||
72 | KABC::Addressee AddresseeEditorDialog::addressee() | 72 | KABC::Addressee AddresseeEditorDialog::addressee() |
73 | { | 73 | { |
74 | return mEditorWidget->addressee(); | 74 | return mEditorWidget->addressee(); |
75 | } | 75 | } |
76 | 76 | ||
77 | bool AddresseeEditorDialog::dirty() | 77 | bool AddresseeEditorDialog::dirty() |
78 | { | 78 | { |
79 | return mEditorWidget->dirty(); | 79 | return mEditorWidget->dirty(); |
80 | } | 80 | } |
81 | 81 | ||
82 | void AddresseeEditorDialog::slotApply() | 82 | void AddresseeEditorDialog::slotApply() |
83 | { | 83 | { |
84 | if ( mEditorWidget->dirty() ) { | 84 | if ( mEditorWidget->dirty() ) { |
85 | mEditorWidget->save(); | 85 | mEditorWidget->save(); |
86 | emit contactModified( mEditorWidget->addressee() ); | 86 | emit contactModified( mEditorWidget->addressee() ); |
87 | } | 87 | } |
88 | 88 | ||
89 | enableButton( KDialogBase::Apply, false ); | 89 | enableButton( KDialogBase::Apply, false ); |
90 | 90 | ||
91 | KDialogBase::slotApply(); | 91 | KDialogBase::slotApply(); |
92 | } | 92 | } |
93 | 93 | ||
94 | void AddresseeEditorDialog:: accept () | 94 | void AddresseeEditorDialog:: accept () |
95 | { | 95 | { |
96 | slotOk(); | 96 | slotOk(); |
97 | 97 | ||
98 | } | 98 | } |
99 | void AddresseeEditorDialog::slotOk() | 99 | void AddresseeEditorDialog::slotOk() |
100 | { | 100 | { |
101 | slotApply(); | 101 | slotApply(); |
102 | 102 | ||
103 | KDialogBase::slotOk(); | 103 | //KDialogBase::slotOk(); |
104 | 104 | emit okClicked(); | |
105 | QDialog::accept(); | ||
105 | } | 106 | } |
106 | 107 | ||
107 | void AddresseeEditorDialog::widgetModified() | 108 | void AddresseeEditorDialog::widgetModified() |
108 | { | 109 | { |
109 | enableButton( KDialogBase::Apply, true ); | 110 | enableButton( KDialogBase::Apply, true ); |
110 | } | 111 | } |
111 | 112 | ||
112 | void AddresseeEditorDialog::slotCancel() | 113 | void AddresseeEditorDialog::slotCancel() |
113 | { | 114 | { |
114 | KDialogBase::slotCancel(); | 115 | KDialogBase::slotCancel(); |
115 | 116 | ||
116 | 117 | ||
117 | } | 118 | } |
118 | 119 | ||
119 | #ifndef KAB_EMBEDDED | 120 | #ifndef KAB_EMBEDDED |
120 | #include "addresseeeditordialog.moc" | 121 | #include "addresseeeditordialog.moc" |
121 | #endif //KAB_EMBEDDED | 122 | #endif //KAB_EMBEDDED |
diff --git a/microkde/kdialogbase.cpp b/microkde/kdialogbase.cpp index 2251207..c953058 100644 --- a/microkde/kdialogbase.cpp +++ b/microkde/kdialogbase.cpp | |||
@@ -215,76 +215,76 @@ QPushButton *KDialogBase::findButton( ButtonCode id ) | |||
215 | default: | 215 | default: |
216 | break; | 216 | break; |
217 | } | 217 | } |
218 | return button; | 218 | return button; |
219 | } | 219 | } |
220 | 220 | ||
221 | void KDialogBase::enableButtonOK( bool state ) | 221 | void KDialogBase::enableButtonOK( bool state ) |
222 | { | 222 | { |
223 | enableButton( Ok, state ); | 223 | enableButton( Ok, state ); |
224 | } | 224 | } |
225 | 225 | ||
226 | void KDialogBase::enableButtonApply( bool state ) | 226 | void KDialogBase::enableButtonApply( bool state ) |
227 | { | 227 | { |
228 | enableButton( Apply, state ); | 228 | enableButton( Apply, state ); |
229 | } | 229 | } |
230 | 230 | ||
231 | void KDialogBase::showButton( ButtonCode id, bool show ) | 231 | void KDialogBase::showButton( ButtonCode id, bool show ) |
232 | { | 232 | { |
233 | QPushButton *button = findButton( id ); | 233 | QPushButton *button = findButton( id ); |
234 | if ( button ) { | 234 | if ( button ) { |
235 | if ( show ) button->show(); | 235 | if ( show ) button->show(); |
236 | else button->hide(); | 236 | else button->hide(); |
237 | } | 237 | } |
238 | } | 238 | } |
239 | 239 | ||
240 | int KDialogBase::pageIndex( QWidget *widget ) const | 240 | int KDialogBase::pageIndex( QWidget *widget ) const |
241 | { | 241 | { |
242 | return 0; | 242 | return 0; |
243 | } | 243 | } |
244 | 244 | ||
245 | 245 | ||
246 | bool KDialogBase::showPage( int index ) | 246 | bool KDialogBase::showPage( int index ) |
247 | { | 247 | { |
248 | tabWidget()->setCurrentPage( index );return false; | 248 | tabWidget()->setCurrentPage( index );return false; |
249 | } | 249 | } |
250 | 250 | ||
251 | QFrame *KDialogBase::plainPage() | 251 | QFrame *KDialogBase::plainPage() |
252 | { | 252 | { |
253 | if ( !mPlainPage ) { | 253 | if ( !mPlainPage ) { |
254 | mPlainPage = new QFrame( this ); | 254 | mPlainPage = new QFrame( this ); |
255 | setMainWidget( mPlainPage ); | 255 | setMainWidget( mPlainPage ); |
256 | } | 256 | } |
257 | return mPlainPage; | 257 | return mPlainPage; |
258 | } | 258 | } |
259 | 259 | ||
260 | void KDialogBase::slotOk() | 260 | void KDialogBase::slotOk() |
261 | { | 261 | { |
262 | emit okClicked(); | 262 | emit okClicked(); |
263 | QDialog::accept(); | 263 | accept(); |
264 | } | 264 | } |
265 | 265 | ||
266 | void KDialogBase::slotApply() | 266 | void KDialogBase::slotApply() |
267 | { | 267 | { |
268 | emit applyClicked(); | 268 | emit applyClicked(); |
269 | } | 269 | } |
270 | 270 | ||
271 | void KDialogBase::slotCancel() | 271 | void KDialogBase::slotCancel() |
272 | { | 272 | { |
273 | emit cancelClicked(); | 273 | emit cancelClicked(); |
274 | reject(); | 274 | reject(); |
275 | } | 275 | } |
276 | 276 | ||
277 | void KDialogBase::slotClose() | 277 | void KDialogBase::slotClose() |
278 | { | 278 | { |
279 | emit closeClicked(); | 279 | emit closeClicked(); |
280 | reject(); | 280 | reject(); |
281 | } | 281 | } |
282 | 282 | ||
283 | void KDialogBase::slotUser1() | 283 | void KDialogBase::slotUser1() |
284 | { | 284 | { |
285 | emit user1Clicked(); | 285 | emit user1Clicked(); |
286 | } | 286 | } |
287 | void KDialogBase::slotUser2() | 287 | void KDialogBase::slotUser2() |
288 | { | 288 | { |
289 | emit user2Clicked(); | 289 | emit user2Clicked(); |
290 | } | 290 | } |