-rw-r--r-- | kaddressbook/addresseeeditordialog.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kaddressbook/addresseeeditordialog.cpp b/kaddressbook/addresseeeditordialog.cpp index 5e42640..a84fc61 100644 --- a/kaddressbook/addresseeeditordialog.cpp +++ b/kaddressbook/addresseeeditordialog.cpp | |||
@@ -21,96 +21,98 @@ | |||
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qapplication.h> | 25 | #include <qapplication.h> |
26 | 26 | ||
27 | #include <kdebug.h> | 27 | #include <kdebug.h> |
28 | #include <klocale.h> | 28 | #include <klocale.h> |
29 | #include <kglobal.h> | 29 | #include <kglobal.h> |
30 | 30 | ||
31 | #include "addresseeeditorwidget.h" | 31 | #include "addresseeeditorwidget.h" |
32 | #include "kabcore.h" | 32 | #include "kabcore.h" |
33 | 33 | ||
34 | #include "addresseeeditordialog.h" | 34 | #include "addresseeeditordialog.h" |
35 | 35 | ||
36 | AddresseeEditorDialog::AddresseeEditorDialog( KABCore *core, QWidget *parent, | 36 | AddresseeEditorDialog::AddresseeEditorDialog( KABCore *core, QWidget *parent, |
37 | const char *name ) | 37 | const char *name ) |
38 | : KDialogBase( KDialogBase::Plain, i18n( "Edit Contact" ), | 38 | : KDialogBase( KDialogBase::Plain, i18n( "Edit Contact" ), |
39 | KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Apply, | 39 | KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Apply, |
40 | KDialogBase::Ok, parent, name, true ) | 40 | KDialogBase::Ok, parent, name, true ) |
41 | { | 41 | { |
42 | 42 | ||
43 | 43 | ||
44 | QWidget *page = plainPage(); | 44 | QWidget *page = plainPage(); |
45 | 45 | ||
46 | QVBoxLayout *layout = new QVBoxLayout( page ); | 46 | QVBoxLayout *layout = new QVBoxLayout( page ); |
47 | 47 | ||
48 | mEditorWidget = new AddresseeEditorWidget( core, false, page ); | 48 | mEditorWidget = new AddresseeEditorWidget( core, false, page ); |
49 | connect( mEditorWidget, SIGNAL( modified( const KABC::Addressee::List& ) ), | 49 | connect( mEditorWidget, SIGNAL( modified( const KABC::Addressee::List& ) ), |
50 | SLOT( widgetModified() ) ); | 50 | SLOT( widgetModified() ) ); |
51 | layout->addWidget( mEditorWidget ); | 51 | layout->addWidget( mEditorWidget ); |
52 | 52 | ||
53 | enableButton( KDialogBase::Apply, false ); | 53 | enableButton( KDialogBase::Apply, false ); |
54 | if ( QApplication::desktop()->width() < 480 ) { | 54 | if ( QApplication::desktop()->width() < 480 ) { |
55 | hideButtons(); | 55 | hideButtons(); |
56 | } | 56 | } |
57 | } | 57 | } |
58 | 58 | ||
59 | AddresseeEditorDialog::~AddresseeEditorDialog() | 59 | AddresseeEditorDialog::~AddresseeEditorDialog() |
60 | { | 60 | { |
61 | //emit editorDestroyed( mEditorWidget->addressee().uid() ); | 61 | //emit editorDestroyed( mEditorWidget->addressee().uid() ); |
62 | } | 62 | } |
63 | 63 | ||
64 | void AddresseeEditorDialog::setAddressee( const KABC::Addressee &addr ) | 64 | void AddresseeEditorDialog::setAddressee( const KABC::Addressee &addr ) |
65 | { | 65 | { |
66 | enableButton( KDialogBase::Apply, false ); | 66 | enableButton( KDialogBase::Apply, false ); |
67 | 67 | ||
68 | mEditorWidget->setAddressee( addr ); | 68 | mEditorWidget->setAddressee( addr ); |
69 | |||
70 | this->setCaption("Edit " + addr.formattedName()); | ||
69 | } | 71 | } |
70 | 72 | ||
71 | KABC::Addressee AddresseeEditorDialog::addressee() | 73 | KABC::Addressee AddresseeEditorDialog::addressee() |
72 | { | 74 | { |
73 | return mEditorWidget->addressee(); | 75 | return mEditorWidget->addressee(); |
74 | } | 76 | } |
75 | 77 | ||
76 | bool AddresseeEditorDialog::dirty() | 78 | bool AddresseeEditorDialog::dirty() |
77 | { | 79 | { |
78 | return mEditorWidget->dirty(); | 80 | return mEditorWidget->dirty(); |
79 | } | 81 | } |
80 | 82 | ||
81 | void AddresseeEditorDialog::slotApply() | 83 | void AddresseeEditorDialog::slotApply() |
82 | { | 84 | { |
83 | if ( mEditorWidget->dirty() ) { | 85 | if ( mEditorWidget->dirty() ) { |
84 | mEditorWidget->save(); | 86 | mEditorWidget->save(); |
85 | emit contactModified( mEditorWidget->addressee() ); | 87 | emit contactModified( mEditorWidget->addressee() ); |
86 | } | 88 | } |
87 | 89 | ||
88 | enableButton( KDialogBase::Apply, false ); | 90 | enableButton( KDialogBase::Apply, false ); |
89 | 91 | ||
90 | KDialogBase::slotApply(); | 92 | KDialogBase::slotApply(); |
91 | } | 93 | } |
92 | 94 | ||
93 | void AddresseeEditorDialog:: accept () | 95 | void AddresseeEditorDialog:: accept () |
94 | { | 96 | { |
95 | slotOk(); | 97 | slotOk(); |
96 | 98 | ||
97 | } | 99 | } |
98 | void AddresseeEditorDialog::slotOk() | 100 | void AddresseeEditorDialog::slotOk() |
99 | { | 101 | { |
100 | slotApply(); | 102 | slotApply(); |
101 | 103 | ||
102 | //KDialogBase::slotOk(); | 104 | //KDialogBase::slotOk(); |
103 | emit okClicked(); | 105 | emit okClicked(); |
104 | QDialog::accept(); | 106 | QDialog::accept(); |
105 | } | 107 | } |
106 | 108 | ||
107 | void AddresseeEditorDialog::widgetModified() | 109 | void AddresseeEditorDialog::widgetModified() |
108 | { | 110 | { |
109 | enableButton( KDialogBase::Apply, true ); | 111 | enableButton( KDialogBase::Apply, true ); |
110 | } | 112 | } |
111 | 113 | ||
112 | void AddresseeEditorDialog::slotCancel() | 114 | void AddresseeEditorDialog::slotCancel() |
113 | { | 115 | { |
114 | KDialogBase::slotCancel(); | 116 | KDialogBase::slotCancel(); |
115 | 117 | ||
116 | 118 | ||