Diffstat (limited to 'kaddressbook/addresseeeditordialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/addresseeeditordialog.cpp | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/kaddressbook/addresseeeditordialog.cpp b/kaddressbook/addresseeeditordialog.cpp index 102138e..790f148 100644 --- a/kaddressbook/addresseeeditordialog.cpp +++ b/kaddressbook/addresseeeditordialog.cpp | |||
@@ -19,12 +19,13 @@ | |||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
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 | 26 | ||
26 | #include <kdebug.h> | 27 | #include <kdebug.h> |
27 | #include <klocale.h> | 28 | #include <klocale.h> |
28 | #include <kglobal.h> | 29 | #include <kglobal.h> |
29 | 30 | ||
30 | #include "addresseeeditorwidget.h" | 31 | #include "addresseeeditorwidget.h" |
@@ -33,37 +34,35 @@ | |||
33 | #include "addresseeeditordialog.h" | 34 | #include "addresseeeditordialog.h" |
34 | 35 | ||
35 | AddresseeEditorDialog::AddresseeEditorDialog( KABCore *core, QWidget *parent, | 36 | AddresseeEditorDialog::AddresseeEditorDialog( KABCore *core, QWidget *parent, |
36 | const char *name ) | 37 | const char *name ) |
37 | : KDialogBase( KDialogBase::Plain, i18n( "Edit Contact" ), | 38 | : KDialogBase( KDialogBase::Plain, i18n( "Edit Contact" ), |
38 | KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Apply, | 39 | KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Apply, |
39 | KDialogBase::Ok, parent, name, false ) | 40 | KDialogBase::Ok, parent, name, true ) |
40 | { | 41 | { |
41 | #ifdef KAB_EMBEDDED | ||
42 | resize( KMIN(KGlobal::getDesktopWidth()-10, 490), KMIN(KGlobal::getDesktopHeight()-50, 300)); | ||
43 | #endif //KAB_EMBEDDED | ||
44 | 42 | ||
45 | kdDebug(5720) << "AddresseeEditorDialog()" << endl; | ||
46 | 43 | ||
47 | QWidget *page = plainPage(); | 44 | QWidget *page = plainPage(); |
48 | 45 | ||
49 | QVBoxLayout *layout = new QVBoxLayout( page ); | 46 | QVBoxLayout *layout = new QVBoxLayout( page ); |
50 | 47 | ||
51 | mEditorWidget = new AddresseeEditorWidget( core, false, page ); | 48 | mEditorWidget = new AddresseeEditorWidget( core, false, page ); |
52 | connect( mEditorWidget, SIGNAL( modified( const KABC::Addressee::List& ) ), | 49 | connect( mEditorWidget, SIGNAL( modified( const KABC::Addressee::List& ) ), |
53 | SLOT( widgetModified() ) ); | 50 | SLOT( widgetModified() ) ); |
54 | layout->addWidget( mEditorWidget ); | 51 | layout->addWidget( mEditorWidget ); |
55 | 52 | ||
56 | enableButton( KDialogBase::Apply, false ); | 53 | enableButton( KDialogBase::Apply, false ); |
54 | if ( QApplication::desktop()->width() < 480 ) { | ||
55 | hideButtons(); | ||
56 | } | ||
57 | } | 57 | } |
58 | 58 | ||
59 | AddresseeEditorDialog::~AddresseeEditorDialog() | 59 | AddresseeEditorDialog::~AddresseeEditorDialog() |
60 | { | 60 | { |
61 | kdDebug(5720) << "~AddresseeEditorDialog()" << endl; | 61 | qDebug("----------------------------------------------- "); |
62 | 62 | //emit editorDestroyed( mEditorWidget->addressee().uid() ); | |
63 | emit editorDestroyed( mEditorWidget->addressee().uid() ); | ||
64 | } | 63 | } |
65 | 64 | ||
66 | void AddresseeEditorDialog::setAddressee( const KABC::Addressee &addr ) | 65 | void AddresseeEditorDialog::setAddressee( const KABC::Addressee &addr ) |
67 | { | 66 | { |
68 | enableButton( KDialogBase::Apply, false ); | 67 | enableButton( KDialogBase::Apply, false ); |
69 | 68 | ||
@@ -89,41 +88,34 @@ void AddresseeEditorDialog::slotApply() | |||
89 | 88 | ||
90 | enableButton( KDialogBase::Apply, false ); | 89 | enableButton( KDialogBase::Apply, false ); |
91 | 90 | ||
92 | KDialogBase::slotApply(); | 91 | KDialogBase::slotApply(); |
93 | } | 92 | } |
94 | 93 | ||
94 | void AddresseeEditorDialog:: accept () | ||
95 | { | ||
96 | slotOk(); | ||
97 | |||
98 | } | ||
95 | void AddresseeEditorDialog::slotOk() | 99 | void AddresseeEditorDialog::slotOk() |
96 | { | 100 | { |
97 | slotApply(); | 101 | slotApply(); |
98 | 102 | ||
99 | KDialogBase::slotOk(); | 103 | KDialogBase::slotOk(); |
100 | 104 | ||
101 | // Destroy this dialog | ||
102 | #ifndef KAB_EMBEDDED | ||
103 | delayedDestruct(); | ||
104 | #else //KAB_EMBEDDED | ||
105 | delete this; | ||
106 | #endif //KAB_EMBEDDED | ||
107 | } | 105 | } |
108 | 106 | ||
109 | void AddresseeEditorDialog::widgetModified() | 107 | void AddresseeEditorDialog::widgetModified() |
110 | { | 108 | { |
111 | enableButton( KDialogBase::Apply, true ); | 109 | enableButton( KDialogBase::Apply, true ); |
112 | } | 110 | } |
113 | 111 | ||
114 | void AddresseeEditorDialog::slotCancel() | 112 | void AddresseeEditorDialog::slotCancel() |
115 | { | 113 | { |
116 | KDialogBase::slotCancel(); | 114 | KDialogBase::slotCancel(); |
117 | 115 | ||
118 | // Destroy this dialog | 116 | |
119 | #ifndef KAB_EMBEDDED | ||
120 | delayedDestruct(); | ||
121 | #else //KAB_EMBEDDED | ||
122 | delete this; | ||
123 | #endif //KAB_EMBEDDED | ||
124 | |||
125 | } | 117 | } |
126 | 118 | ||
127 | #ifndef KAB_EMBEDDED | 119 | #ifndef KAB_EMBEDDED |
128 | #include "addresseeeditordialog.moc" | 120 | #include "addresseeeditordialog.moc" |
129 | #endif //KAB_EMBEDDED | 121 | #endif //KAB_EMBEDDED |