-rw-r--r-- | kaddressbook/addresseeeditordialog.cpp | 1 | ||||
-rw-r--r-- | kaddressbook/addresseeeditorwidget.cpp | 6 |
2 files changed, 1 insertions, 6 deletions
diff --git a/kaddressbook/addresseeeditordialog.cpp b/kaddressbook/addresseeeditordialog.cpp index d8c1aca..5e42640 100644 --- a/kaddressbook/addresseeeditordialog.cpp +++ b/kaddressbook/addresseeeditordialog.cpp | |||
@@ -1,122 +1,121 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | 3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
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 | #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 | qDebug("AddresseeEditorDialog::~AddresseeEditorDialog()"); | ||
62 | //emit editorDestroyed( mEditorWidget->addressee().uid() ); | 61 | //emit editorDestroyed( mEditorWidget->addressee().uid() ); |
63 | } | 62 | } |
64 | 63 | ||
65 | void AddresseeEditorDialog::setAddressee( const KABC::Addressee &addr ) | 64 | void AddresseeEditorDialog::setAddressee( const KABC::Addressee &addr ) |
66 | { | 65 | { |
67 | enableButton( KDialogBase::Apply, false ); | 66 | enableButton( KDialogBase::Apply, false ); |
68 | 67 | ||
69 | mEditorWidget->setAddressee( addr ); | 68 | mEditorWidget->setAddressee( addr ); |
70 | } | 69 | } |
71 | 70 | ||
72 | KABC::Addressee AddresseeEditorDialog::addressee() | 71 | KABC::Addressee AddresseeEditorDialog::addressee() |
73 | { | 72 | { |
74 | return mEditorWidget->addressee(); | 73 | return mEditorWidget->addressee(); |
75 | } | 74 | } |
76 | 75 | ||
77 | bool AddresseeEditorDialog::dirty() | 76 | bool AddresseeEditorDialog::dirty() |
78 | { | 77 | { |
79 | return mEditorWidget->dirty(); | 78 | return mEditorWidget->dirty(); |
80 | } | 79 | } |
81 | 80 | ||
82 | void AddresseeEditorDialog::slotApply() | 81 | void AddresseeEditorDialog::slotApply() |
83 | { | 82 | { |
84 | if ( mEditorWidget->dirty() ) { | 83 | if ( mEditorWidget->dirty() ) { |
85 | mEditorWidget->save(); | 84 | mEditorWidget->save(); |
86 | emit contactModified( mEditorWidget->addressee() ); | 85 | emit contactModified( mEditorWidget->addressee() ); |
87 | } | 86 | } |
88 | 87 | ||
89 | enableButton( KDialogBase::Apply, false ); | 88 | enableButton( KDialogBase::Apply, false ); |
90 | 89 | ||
91 | KDialogBase::slotApply(); | 90 | KDialogBase::slotApply(); |
92 | } | 91 | } |
93 | 92 | ||
94 | void AddresseeEditorDialog:: accept () | 93 | void AddresseeEditorDialog:: accept () |
95 | { | 94 | { |
96 | slotOk(); | 95 | slotOk(); |
97 | 96 | ||
98 | } | 97 | } |
99 | void AddresseeEditorDialog::slotOk() | 98 | void AddresseeEditorDialog::slotOk() |
100 | { | 99 | { |
101 | slotApply(); | 100 | slotApply(); |
102 | 101 | ||
103 | //KDialogBase::slotOk(); | 102 | //KDialogBase::slotOk(); |
104 | emit okClicked(); | 103 | emit okClicked(); |
105 | QDialog::accept(); | 104 | QDialog::accept(); |
106 | } | 105 | } |
107 | 106 | ||
108 | void AddresseeEditorDialog::widgetModified() | 107 | void AddresseeEditorDialog::widgetModified() |
109 | { | 108 | { |
110 | enableButton( KDialogBase::Apply, true ); | 109 | enableButton( KDialogBase::Apply, true ); |
111 | } | 110 | } |
112 | 111 | ||
113 | void AddresseeEditorDialog::slotCancel() | 112 | void AddresseeEditorDialog::slotCancel() |
114 | { | 113 | { |
115 | KDialogBase::slotCancel(); | 114 | KDialogBase::slotCancel(); |
116 | 115 | ||
117 | 116 | ||
118 | } | 117 | } |
119 | 118 | ||
120 | #ifndef KAB_EMBEDDED | 119 | #ifndef KAB_EMBEDDED |
121 | #include "addresseeeditordialog.moc" | 120 | #include "addresseeeditordialog.moc" |
122 | #endif //KAB_EMBEDDED | 121 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp index 4365ee5..3cfc1f2 100644 --- a/kaddressbook/addresseeeditorwidget.cpp +++ b/kaddressbook/addresseeeditorwidget.cpp | |||
@@ -1,1284 +1,1280 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | 3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
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 <qcheckbox.h> | 24 | #include <qcheckbox.h> |
25 | #include <qhbox.h> | 25 | #include <qhbox.h> |
26 | #include <qlabel.h> | 26 | #include <qlabel.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qlistbox.h> | 28 | #include <qlistbox.h> |
29 | #include <qpushbutton.h> | 29 | #include <qpushbutton.h> |
30 | #include <qtabwidget.h> | 30 | #include <qtabwidget.h> |
31 | 31 | ||
32 | #ifndef KAB_EMBEDDED | 32 | #ifndef KAB_EMBEDDED |
33 | #include <qtextedit.h> | 33 | #include <qtextedit.h> |
34 | 34 | ||
35 | #include <kaccelmanager.h> | 35 | #include <kaccelmanager.h> |
36 | #include "keywidget.h" | 36 | #include "keywidget.h" |
37 | #include "soundwidget.h" | 37 | #include "soundwidget.h" |
38 | 38 | ||
39 | #else //KAB_EMBEDDED | 39 | #else //KAB_EMBEDDED |
40 | #include <qmultilineedit.h> | 40 | #include <qmultilineedit.h> |
41 | #endif //KAB_EMBEDDED | 41 | #endif //KAB_EMBEDDED |
42 | 42 | ||
43 | 43 | ||
44 | #include "keywidget.h" | 44 | #include "keywidget.h" |
45 | #include "geowidget.h" | 45 | #include "geowidget.h" |
46 | #include "imagewidget.h" | 46 | #include "imagewidget.h" |
47 | #include "nameeditdialog.h" | 47 | #include "nameeditdialog.h" |
48 | #include "phoneeditwidget.h" | 48 | #include "phoneeditwidget.h" |
49 | #include "secrecywidget.h" | 49 | #include "secrecywidget.h" |
50 | 50 | ||
51 | 51 | ||
52 | #include <qtoolbutton.h> | 52 | #include <qtoolbutton.h> |
53 | #include <qtooltip.h> | 53 | #include <qtooltip.h> |
54 | 54 | ||
55 | #include <kapplication.h> | 55 | #include <kapplication.h> |
56 | #include <kconfig.h> | 56 | #include <kconfig.h> |
57 | #include <kcombobox.h> | 57 | #include <kcombobox.h> |
58 | #include <kdebug.h> | 58 | #include <kdebug.h> |
59 | #include <kdialogbase.h> | 59 | #include <kdialogbase.h> |
60 | #include <kglobal.h> | 60 | #include <kglobal.h> |
61 | #include <kiconloader.h> | 61 | #include <kiconloader.h> |
62 | #include <klineedit.h> | 62 | #include <klineedit.h> |
63 | #include <klocale.h> | 63 | #include <klocale.h> |
64 | #include <kmessagebox.h> | 64 | #include <kmessagebox.h> |
65 | #include <kseparator.h> | 65 | #include <kseparator.h> |
66 | #include <ksqueezedtextlabel.h> | 66 | #include <ksqueezedtextlabel.h> |
67 | 67 | ||
68 | #include <libkdepim/categoryeditdialog.h> | 68 | #include <libkdepim/categoryeditdialog.h> |
69 | #include <libkdepim/categoryselectdialog.h> | 69 | #include <libkdepim/categoryselectdialog.h> |
70 | 70 | ||
71 | #include <libkdepim/kdateedit.h> | 71 | #include <libkdepim/kdateedit.h> |
72 | 72 | ||
73 | #include "addresseditwidget.h" | 73 | #include "addresseditwidget.h" |
74 | #include "emaileditwidget.h" | 74 | #include "emaileditwidget.h" |
75 | #include "kabcore.h" | 75 | #include "kabcore.h" |
76 | #include "kabprefs.h" | 76 | #include "kabprefs.h" |
77 | 77 | ||
78 | #include "addresseeeditorwidget.h" | 78 | #include "addresseeeditorwidget.h" |
79 | 79 | ||
80 | 80 | ||
81 | 81 | ||
82 | AddresseeEditorWidget::AddresseeEditorWidget( KABCore *core, bool isExtension, | 82 | AddresseeEditorWidget::AddresseeEditorWidget( KABCore *core, bool isExtension, |
83 | QWidget *parent, const char *name ) | 83 | QWidget *parent, const char *name ) |
84 | : ExtensionWidget( core, parent, name ), mIsExtension( isExtension ), | 84 | : ExtensionWidget( core, parent, name ), mIsExtension( isExtension ), |
85 | mBlockSignals( false ) | 85 | mBlockSignals( false ) |
86 | { | 86 | { |
87 | 87 | ||
88 | mAConfig = AddresseeConfig::instance(); | 88 | mAConfig = AddresseeConfig::instance(); |
89 | 89 | ||
90 | kdDebug(5720) << "AddresseeEditorWidget()" << endl; | 90 | kdDebug(5720) << "AddresseeEditorWidget()" << endl; |
91 | mFormattedNameType = NameEditDialog::CustomName; | 91 | mFormattedNameType = NameEditDialog::CustomName; |
92 | initGUI(); | 92 | initGUI(); |
93 | mCategoryDialog = 0; | 93 | mCategoryDialog = 0; |
94 | mCategoryEditDialog = 0; | 94 | mCategoryEditDialog = 0; |
95 | 95 | ||
96 | // Load the empty addressee as defaults | 96 | // Load the empty addressee as defaults |
97 | load(); | 97 | load(); |
98 | 98 | ||
99 | mDirty = false; | 99 | mDirty = false; |
100 | } | 100 | } |
101 | 101 | ||
102 | AddresseeEditorWidget::~AddresseeEditorWidget() | 102 | AddresseeEditorWidget::~AddresseeEditorWidget() |
103 | { | 103 | { |
104 | kdDebug(5720) << "~AddresseeEditorWidget()" << endl; | 104 | kdDebug(5720) << "~AddresseeEditorWidget()" << endl; |
105 | } | 105 | } |
106 | 106 | ||
107 | void AddresseeEditorWidget::contactsSelectionChanged() | 107 | void AddresseeEditorWidget::contactsSelectionChanged() |
108 | { | 108 | { |
109 | KABC::Addressee::List list = selectedContacts(); | 109 | KABC::Addressee::List list = selectedContacts(); |
110 | 110 | ||
111 | mAddressee = list[ 0 ]; | 111 | mAddressee = list[ 0 ]; |
112 | load(); | 112 | load(); |
113 | } | 113 | } |
114 | 114 | ||
115 | void AddresseeEditorWidget::setAddressee( const KABC::Addressee &addr ) | 115 | void AddresseeEditorWidget::setAddressee( const KABC::Addressee &addr ) |
116 | { | 116 | { |
117 | mAddressee = addr; | 117 | mAddressee = addr; |
118 | load(); | 118 | load(); |
119 | } | 119 | } |
120 | 120 | ||
121 | const KABC::Addressee &AddresseeEditorWidget::addressee() | 121 | const KABC::Addressee &AddresseeEditorWidget::addressee() |
122 | { | 122 | { |
123 | return mAddressee; | 123 | return mAddressee; |
124 | } | 124 | } |
125 | 125 | ||
126 | void AddresseeEditorWidget::textChanged( const QString& ) | 126 | void AddresseeEditorWidget::textChanged( const QString& ) |
127 | { | 127 | { |
128 | emitModified(); | 128 | emitModified(); |
129 | } | 129 | } |
130 | 130 | ||
131 | void AddresseeEditorWidget::initGUI() | 131 | void AddresseeEditorWidget::initGUI() |
132 | { | 132 | { |
133 | QVBoxLayout *layout = new QVBoxLayout( this ); | 133 | QVBoxLayout *layout = new QVBoxLayout( this ); |
134 | 134 | ||
135 | mTabWidget = new QTabWidget( this ); | 135 | mTabWidget = new QTabWidget( this ); |
136 | layout->addWidget( mTabWidget ); | 136 | layout->addWidget( mTabWidget ); |
137 | 137 | ||
138 | setupTab1(); | 138 | setupTab1(); |
139 | setupTab1_1(); | 139 | setupTab1_1(); |
140 | setupTab2(); | 140 | setupTab2(); |
141 | setupTab2_1(); | 141 | setupTab2_1(); |
142 | setupTab3(); | 142 | setupTab3(); |
143 | setupTab3_1(); | 143 | setupTab3_1(); |
144 | 144 | ||
145 | mNameEdit->setFocus(); | 145 | mNameEdit->setFocus(); |
146 | 146 | ||
147 | connect( mTabWidget, SIGNAL( currentChanged(QWidget*) ), | 147 | connect( mTabWidget, SIGNAL( currentChanged(QWidget*) ), |
148 | SLOT( pageChanged(QWidget*) ) ); | 148 | SLOT( pageChanged(QWidget*) ) ); |
149 | } | 149 | } |
150 | 150 | ||
151 | void AddresseeEditorWidget::setupTab1() | 151 | void AddresseeEditorWidget::setupTab1() |
152 | { | 152 | { |
153 | // This is the General tab | 153 | // This is the General tab |
154 | QWidget *tab1 = new QWidget( mTabWidget ); | 154 | QWidget *tab1 = new QWidget( mTabWidget ); |
155 | 155 | ||
156 | //US QGridLayout *layout = new QGridLayout( tab1, 11, 7 ); | 156 | //US QGridLayout *layout = new QGridLayout( tab1, 11, 7 ); |
157 | QGridLayout *layout = new QGridLayout( tab1, 7, 1 ); | 157 | QGridLayout *layout = new QGridLayout( tab1, 7, 1 ); |
158 | layout->setMargin( KDialogBase::marginHintSmall() ); | 158 | layout->setMargin( KDialogBase::marginHintSmall() ); |
159 | layout->setSpacing( KDialogBase::spacingHintSmall() ); | 159 | layout->setSpacing( KDialogBase::spacingHintSmall() ); |
160 | 160 | ||
161 | QLabel *label; | 161 | QLabel *label; |
162 | KSeparator* bar; | 162 | KSeparator* bar; |
163 | QPushButton *button; | 163 | QPushButton *button; |
164 | 164 | ||
165 | ////////////////////////////////// | 165 | ////////////////////////////////// |
166 | // Upper left group (person info) | 166 | // Upper left group (person info) |
167 | 167 | ||
168 | // Person icon | 168 | // Person icon |
169 | /* LR | 169 | /* LR |
170 | label = new QLabel( tab1 ); | 170 | label = new QLabel( tab1 ); |
171 | //US ambiguous call. Add one more parameter | 171 | //US ambiguous call. Add one more parameter |
172 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); | 172 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); |
173 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); | 173 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); |
174 | layout->addMultiCellWidget( label, 0, 1, 0, 0 ); | 174 | layout->addMultiCellWidget( label, 0, 1, 0, 0 ); |
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 | label = new QLabel( i18n( "Role:" ), tab1 ); |
192 | mRoleEdit = new KLineEdit( tab1 ); | 192 | mRoleEdit = new KLineEdit( tab1 ); |
193 | connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ), | 193 | connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ), |
194 | SLOT( textChanged( const QString& ) ) ); | 194 | SLOT( textChanged( const QString& ) ) ); |
195 | label->setBuddy( mRoleEdit ); | 195 | label->setBuddy( mRoleEdit ); |
196 | layout->addWidget( label, 1, 0 ); | 196 | layout->addWidget( label, 1, 0 ); |
197 | layout->addWidget( mRoleEdit, 1, 1 ); | 197 | layout->addWidget( mRoleEdit, 1, 1 ); |
198 | 198 | ||
199 | // Organization | 199 | // Organization |
200 | label = new QLabel( i18n( "Organization:" ), tab1 ); | 200 | label = new QLabel( i18n( "Organization:" ), tab1 ); |
201 | mOrgEdit = new KLineEdit( tab1 ); | 201 | mOrgEdit = new KLineEdit( tab1 ); |
202 | label->setBuddy( mOrgEdit ); | 202 | label->setBuddy( mOrgEdit ); |
203 | connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), | 203 | connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), |
204 | SLOT( textChanged( const QString& ) ) ); | 204 | SLOT( textChanged( const QString& ) ) ); |
205 | layout->addWidget( label, 2, 0 ); | 205 | layout->addWidget( label, 2, 0 ); |
206 | layout->addWidget( mOrgEdit, 2, 1 ); | 206 | layout->addWidget( mOrgEdit, 2, 1 ); |
207 | 207 | ||
208 | // File as (formatted name) | 208 | // File as (formatted name) |
209 | label = new QLabel( i18n( "Formatted name:" ), tab1 ); | 209 | label = new QLabel( i18n( "Formatted name:" ), tab1 ); |
210 | mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); | 210 | mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); |
211 | layout->addWidget( label, 3, 0 ); | 211 | layout->addWidget( label, 3, 0 ); |
212 | layout->addWidget( mFormattedNameLabel, 3, 1 ); | 212 | layout->addWidget( mFormattedNameLabel, 3, 1 ); |
213 | /* LR | 213 | /* LR |
214 | // Left hand separator. This separator doesn't go all the way | 214 | // Left hand separator. This separator doesn't go all the way |
215 | // across so the dialog still flows from top to bottom | 215 | // across so the dialog still flows from top to bottom |
216 | bar = new KSeparator( KSeparator::HLine, tab1 ); | 216 | bar = new KSeparator( KSeparator::HLine, tab1 ); |
217 | layout->addMultiCellWidget( bar, 4, 4, 0, 2 ); | 217 | layout->addMultiCellWidget( bar, 4, 4, 0, 2 ); |
218 | */ | 218 | */ |
219 | ////////////////////////////////////// | 219 | ////////////////////////////////////// |
220 | 220 | ||
221 | /* LR | 221 | /* LR |
222 | // Phone numbers (upper right) | 222 | // Phone numbers (upper right) |
223 | label = new QLabel( tab1 ); | 223 | label = new QLabel( tab1 ); |
224 | //US loadIcon call is ambiguous. Add one more parameter | 224 | //US loadIcon call is ambiguous. Add one more parameter |
225 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) ); | 225 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) ); |
226 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); | 226 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); |
227 | //US layout->addMultiCellWidget( label, 0, 1, 3, 3 ); | 227 | //US layout->addMultiCellWidget( label, 0, 1, 3, 3 ); |
228 | layout->addMultiCellWidget( label, 5, 6, 0, 0 ); | 228 | layout->addMultiCellWidget( label, 5, 6, 0, 0 ); |
229 | */ | 229 | */ |
230 | mPhoneEditWidget = new PhoneEditWidget( tab1 ); | 230 | mPhoneEditWidget = new PhoneEditWidget( tab1 ); |
231 | connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); | 231 | connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); |
232 | //US layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 ); | 232 | //US layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 ); |
233 | int iii; | 233 | int iii; |
234 | #ifndef DESKTOP_VERSION | 234 | #ifndef DESKTOP_VERSION |
235 | iii = 7; | 235 | iii = 7; |
236 | #else | 236 | #else |
237 | iii = 8; | 237 | iii = 8; |
238 | #endif | 238 | #endif |
239 | layout->addMultiCellWidget( mPhoneEditWidget, 4, iii, 0, 1 ); | 239 | layout->addMultiCellWidget( mPhoneEditWidget, 4, iii, 0, 1 ); |
240 | ++iii; | 240 | ++iii; |
241 | /* LR | 241 | /* LR |
242 | bar = new KSeparator( KSeparator::HLine, tab1 ); | 242 | bar = new KSeparator( KSeparator::HLine, tab1 ); |
243 | //US layout->addMultiCellWidget( bar, 4, 4, 3, 6 ); | 243 | //US layout->addMultiCellWidget( bar, 4, 4, 3, 6 ); |
244 | layout->addMultiCellWidget( bar, 9, 9, 0, 2 ); | 244 | layout->addMultiCellWidget( bar, 9, 9, 0, 2 ); |
245 | */ | 245 | */ |
246 | /*US | 246 | /*US |
247 | ////////////////////////////////////// | 247 | ////////////////////////////////////// |
248 | // Addresses (lower left) | 248 | // Addresses (lower left) |
249 | label = new QLabel( tab1 ); | 249 | label = new QLabel( tab1 ); |
250 | //US loadIcon call is ambiguous. Add one more parameter | 250 | //US loadIcon call is ambiguous. Add one more parameter |
251 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop ) ); | 251 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop ) ); |
252 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) ); | 252 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) ); |
253 | layout->addMultiCellWidget( label, 5, 6, 0, 0 ); | 253 | layout->addMultiCellWidget( label, 5, 6, 0, 0 ); |
254 | 254 | ||
255 | mAddressEditWidget = new AddressEditWidget( tab1 ); | 255 | mAddressEditWidget = new AddressEditWidget( tab1 ); |
256 | connect( mAddressEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); | 256 | connect( mAddressEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); |
257 | layout->addMultiCellWidget( mAddressEditWidget, 5, 9, 1, 2 ); | 257 | layout->addMultiCellWidget( mAddressEditWidget, 5, 9, 1, 2 ); |
258 | 258 | ||
259 | ////////////////////////////////////// | 259 | ////////////////////////////////////// |
260 | // Email / Web (lower right) | 260 | // Email / Web (lower right) |
261 | label = new QLabel( tab1 ); | 261 | label = new QLabel( tab1 ); |
262 | //US loadIcon call is ambiguous. Add one more parameter | 262 | //US loadIcon call is ambiguous. Add one more parameter |
263 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop) ); | 263 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop) ); |
264 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop, 0) ); | 264 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop, 0) ); |
265 | layout->addMultiCellWidget( label, 5, 6, 3, 3 ); | 265 | layout->addMultiCellWidget( label, 5, 6, 3, 3 ); |
266 | 266 | ||
267 | mEmailWidget = new EmailEditWidget( tab1 ); | 267 | mEmailWidget = new EmailEditWidget( tab1 ); |
268 | connect( mEmailWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); | 268 | connect( mEmailWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); |
269 | layout->addMultiCellWidget( mEmailWidget, 5, 6, 4, 6 ); | 269 | layout->addMultiCellWidget( mEmailWidget, 5, 6, 4, 6 ); |
270 | 270 | ||
271 | // add the separator | 271 | // add the separator |
272 | bar = new KSeparator( KSeparator::HLine, tab1 ); | 272 | bar = new KSeparator( KSeparator::HLine, tab1 ); |
273 | layout->addMultiCellWidget( bar, 7, 7, 3, 6 ); | 273 | layout->addMultiCellWidget( bar, 7, 7, 3, 6 ); |
274 | 274 | ||
275 | label = new QLabel( tab1 ); | 275 | label = new QLabel( tab1 ); |
276 | //US loadIcon call is ambiguous. Add one more parameter | 276 | //US loadIcon call is ambiguous. Add one more parameter |
277 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) ); | 277 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) ); |
278 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) ); | 278 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) ); |
279 | layout->addMultiCellWidget( label, 8, 9, 3, 3 ); | 279 | layout->addMultiCellWidget( label, 8, 9, 3, 3 ); |
280 | 280 | ||
281 | label = new QLabel( i18n( "URL:" ), tab1 ); | 281 | label = new QLabel( i18n( "URL:" ), tab1 ); |
282 | mURLEdit = new KLineEdit( tab1 ); | 282 | mURLEdit = new KLineEdit( tab1 ); |
283 | connect( mURLEdit, SIGNAL( textChanged( const QString& ) ), | 283 | connect( mURLEdit, SIGNAL( textChanged( const QString& ) ), |
284 | SLOT( textChanged( const QString& ) ) ); | 284 | SLOT( textChanged( const QString& ) ) ); |
285 | label->setBuddy( mURLEdit ); | 285 | label->setBuddy( mURLEdit ); |
286 | layout->addWidget( label, 8, 4 ); | 286 | layout->addWidget( label, 8, 4 ); |
287 | layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 ); | 287 | layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 ); |
288 | 288 | ||
289 | label = new QLabel( i18n( "&IM address:" ), tab1 ); | 289 | label = new QLabel( i18n( "&IM address:" ), tab1 ); |
290 | mIMAddressEdit = new KLineEdit( tab1 ); | 290 | mIMAddressEdit = new KLineEdit( tab1 ); |
291 | connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ), | 291 | connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ), |
292 | SLOT( textChanged( const QString& ) ) ); | 292 | SLOT( textChanged( const QString& ) ) ); |
293 | label->setBuddy( mIMAddressEdit ); | 293 | label->setBuddy( mIMAddressEdit ); |
294 | layout->addWidget( label, 9, 4 ); | 294 | layout->addWidget( label, 9, 4 ); |
295 | layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 ); | 295 | layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 ); |
296 | 296 | ||
297 | layout->addColSpacing( 6, 50 ); | 297 | layout->addColSpacing( 6, 50 ); |
298 | 298 | ||
299 | bar = new KSeparator( KSeparator::HLine, tab1 ); | 299 | bar = new KSeparator( KSeparator::HLine, tab1 ); |
300 | layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); | 300 | layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); |
301 | */ | 301 | */ |
302 | /////////////////////////////////////// | 302 | /////////////////////////////////////// |
303 | QHBox *categoryBox = new QHBox( tab1 ); | 303 | QHBox *categoryBox = new QHBox( tab1 ); |
304 | categoryBox->setSpacing( KDialogBase::spacingHint() ); | 304 | categoryBox->setSpacing( KDialogBase::spacingHint() ); |
305 | categoryBox->setMargin( KDialogBase::marginHintSmall() ); | 305 | categoryBox->setMargin( KDialogBase::marginHintSmall() ); |
306 | 306 | ||
307 | // Categories | 307 | // Categories |
308 | button = new QPushButton( i18n( "Categories" ), categoryBox ); | 308 | button = new QPushButton( i18n( "Categories" ), categoryBox ); |
309 | connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); | 309 | connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); |
310 | 310 | ||
311 | mCategoryEdit = new KLineEdit( categoryBox ); | 311 | mCategoryEdit = new KLineEdit( categoryBox ); |
312 | mCategoryEdit->setReadOnly( true ); | 312 | mCategoryEdit->setReadOnly( true ); |
313 | connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), | 313 | connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), |
314 | SLOT( textChanged( const QString& ) ) ); | 314 | SLOT( textChanged( const QString& ) ) ); |
315 | 315 | ||
316 | mSecrecyWidget = new SecrecyWidget( categoryBox ); | 316 | mSecrecyWidget = new SecrecyWidget( categoryBox ); |
317 | connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 317 | connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
318 | 318 | ||
319 | //US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); | 319 | //US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); |
320 | layout->addMultiCellWidget( categoryBox, iii, iii, 0, 1 ); | 320 | layout->addMultiCellWidget( categoryBox, iii, iii, 0, 1 ); |
321 | 321 | ||
322 | // Build the layout and add to the tab widget | 322 | // Build the layout and add to the tab widget |
323 | layout->activate(); // required | 323 | layout->activate(); // required |
324 | 324 | ||
325 | mTabWidget->addTab( tab1, i18n( "&General" ) ); | 325 | mTabWidget->addTab( tab1, i18n( "&General" ) ); |
326 | } | 326 | } |
327 | 327 | ||
328 | 328 | ||
329 | void AddresseeEditorWidget::setupTab1_1() | 329 | void AddresseeEditorWidget::setupTab1_1() |
330 | { | 330 | { |
331 | // This is the Address tab | 331 | // This is the Address tab |
332 | QWidget *tab1_1 = new QWidget( mTabWidget ); | 332 | QWidget *tab1_1 = new QWidget( mTabWidget ); |
333 | 333 | ||
334 | //US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 ); | 334 | //US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 ); |
335 | QGridLayout *layout = new QGridLayout( tab1_1, 7, 2 ); | 335 | QGridLayout *layout = new QGridLayout( tab1_1, 7, 2 ); |
336 | layout->setMargin( KDialogBase::marginHintSmall() ); | 336 | layout->setMargin( KDialogBase::marginHintSmall() ); |
337 | layout->setSpacing( KDialogBase::spacingHintSmall() ); | 337 | layout->setSpacing( KDialogBase::spacingHintSmall() ); |
338 | 338 | ||
339 | QLabel *label; | 339 | QLabel *label; |
340 | KSeparator* bar; | 340 | KSeparator* bar; |
341 | QPushButton *button; | 341 | QPushButton *button; |
342 | 342 | ||
343 | /*US | 343 | /*US |
344 | ////////////////////////////////// | 344 | ////////////////////////////////// |
345 | // Upper left group (person info) | 345 | // Upper left group (person info) |
346 | 346 | ||
347 | // Person icon | 347 | // Person icon |
348 | label = new QLabel( tab1 ); | 348 | label = new QLabel( tab1 ); |
349 | //US ambiguous call. Add one more parameter | 349 | //US ambiguous call. Add one more parameter |
350 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); | 350 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); |
351 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); | 351 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); |
352 | layout->addMultiCellWidget( label, 0, 1, 0, 0 ); | 352 | layout->addMultiCellWidget( label, 0, 1, 0, 0 ); |
353 | 353 | ||
354 | // First name | 354 | // First name |
355 | button = new QPushButton( i18n( "Name..." ), tab1 ); | 355 | button = new QPushButton( i18n( "Name..." ), tab1 ); |
356 | QToolTip::add( button, i18n( "Edit the contact's name" ) ); | 356 | QToolTip::add( button, i18n( "Edit the contact's name" ) ); |
357 | mNameEdit = new KLineEdit( tab1, "mNameEdit" ); | 357 | mNameEdit = new KLineEdit( tab1, "mNameEdit" ); |
358 | connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), | 358 | connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), |
359 | SLOT( nameTextChanged( const QString& ) ) ); | 359 | SLOT( nameTextChanged( const QString& ) ) ); |
360 | connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) ); | 360 | connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) ); |
361 | 361 | ||
362 | #ifndef KAB_EMBEDDED | 362 | #ifndef KAB_EMBEDDED |
363 | mNameLabel = new KSqueezedTextLabel( tab1 ); | 363 | mNameLabel = new KSqueezedTextLabel( tab1 ); |
364 | mNameLabel->hide(); | 364 | mNameLabel->hide(); |
365 | #else //KAB_EMBEDDED | 365 | #else //KAB_EMBEDDED |
366 | qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); | 366 | qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); |
367 | #endif //KAB_EMBEDDED | 367 | #endif //KAB_EMBEDDED |
368 | 368 | ||
369 | layout->addWidget( button, 0, 1 ); | 369 | layout->addWidget( button, 0, 1 ); |
370 | layout->addWidget( mNameEdit, 0, 2 ); | 370 | layout->addWidget( mNameEdit, 0, 2 ); |
371 | 371 | ||
372 | #ifndef KAB_EMBEDDED | 372 | #ifndef KAB_EMBEDDED |
373 | layout->addWidget( mNameLabel, 0, 2 ); | 373 | layout->addWidget( mNameLabel, 0, 2 ); |
374 | #else //KAB_EMBEDDED | 374 | #else //KAB_EMBEDDED |
375 | qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); | 375 | qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); |
376 | #endif //KAB_EMBEDDED | 376 | #endif //KAB_EMBEDDED |
377 | 377 | ||
378 | label = new QLabel( i18n( "Role:" ), tab1 ); | 378 | label = new QLabel( i18n( "Role:" ), tab1 ); |
379 | mRoleEdit = new KLineEdit( tab1 ); | 379 | mRoleEdit = new KLineEdit( tab1 ); |
380 | connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ), | 380 | connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ), |
381 | SLOT( textChanged( const QString& ) ) ); | 381 | SLOT( textChanged( const QString& ) ) ); |
382 | label->setBuddy( mRoleEdit ); | 382 | label->setBuddy( mRoleEdit ); |
383 | layout->addWidget( label, 1, 1 ); | 383 | layout->addWidget( label, 1, 1 ); |
384 | layout->addWidget( mRoleEdit, 1, 2 ); | 384 | layout->addWidget( mRoleEdit, 1, 2 ); |
385 | 385 | ||
386 | // Organization | 386 | // Organization |
387 | label = new QLabel( i18n( "Organization:" ), tab1 ); | 387 | label = new QLabel( i18n( "Organization:" ), tab1 ); |
388 | mOrgEdit = new KLineEdit( tab1 ); | 388 | mOrgEdit = new KLineEdit( tab1 ); |
389 | label->setBuddy( mOrgEdit ); | 389 | label->setBuddy( mOrgEdit ); |
390 | connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), | 390 | connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), |
391 | SLOT( textChanged( const QString& ) ) ); | 391 | SLOT( textChanged( const QString& ) ) ); |
392 | layout->addWidget( label, 2, 1 ); | 392 | layout->addWidget( label, 2, 1 ); |
393 | layout->addWidget( mOrgEdit, 2, 2 ); | 393 | layout->addWidget( mOrgEdit, 2, 2 ); |
394 | 394 | ||
395 | // File as (formatted name) | 395 | // File as (formatted name) |
396 | label = new QLabel( i18n( "Formatted name:" ), tab1 ); | 396 | label = new QLabel( i18n( "Formatted name:" ), tab1 ); |
397 | #ifndef KAB_EMBEDDED | 397 | #ifndef KAB_EMBEDDED |
398 | mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); | 398 | mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); |
399 | #else //KAB_EMBEDDED | 399 | #else //KAB_EMBEDDED |
400 | qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); | 400 | qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); |
401 | #endif //KAB_EMBEDDED | 401 | #endif //KAB_EMBEDDED |
402 | layout->addWidget( label, 3, 1 ); | 402 | layout->addWidget( label, 3, 1 ); |
403 | #ifndef KAB_EMBEDDED | 403 | #ifndef KAB_EMBEDDED |
404 | layout->addWidget( mFormattedNameLabel, 3, 2 ); | 404 | layout->addWidget( mFormattedNameLabel, 3, 2 ); |
405 | #else //KAB_EMBEDDED | 405 | #else //KAB_EMBEDDED |
406 | qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); | 406 | qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); |
407 | #endif //KAB_EMBEDDED | 407 | #endif //KAB_EMBEDDED |
408 | 408 | ||
409 | // Left hand separator. This separator doesn't go all the way | 409 | // Left hand separator. This separator doesn't go all the way |
410 | // across so the dialog still flows from top to bottom | 410 | // across so the dialog still flows from top to bottom |
411 | bar = new KSeparator( KSeparator::HLine, tab1 ); | 411 | bar = new KSeparator( KSeparator::HLine, tab1 ); |
412 | layout->addMultiCellWidget( bar, 4, 4, 0, 2 ); | 412 | layout->addMultiCellWidget( bar, 4, 4, 0, 2 ); |
413 | 413 | ||
414 | ////////////////////////////////////// | 414 | ////////////////////////////////////// |
415 | // Phone numbers (upper right) | 415 | // Phone numbers (upper right) |
416 | label = new QLabel( tab1 ); | 416 | label = new QLabel( tab1 ); |
417 | //US loadIcon call is ambiguous. Add one more parameter | 417 | //US loadIcon call is ambiguous. Add one more parameter |
418 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) ); | 418 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) ); |
419 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); | 419 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); |
420 | layout->addMultiCellWidget( label, 0, 1, 3, 3 ); | 420 | layout->addMultiCellWidget( label, 0, 1, 3, 3 ); |
421 | 421 | ||
422 | mPhoneEditWidget = new PhoneEditWidget( tab1 ); | 422 | mPhoneEditWidget = new PhoneEditWidget( tab1 ); |
423 | connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); | 423 | connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); |
424 | layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 ); | 424 | layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 ); |
425 | 425 | ||
426 | bar = new KSeparator( KSeparator::HLine, tab1 ); | 426 | bar = new KSeparator( KSeparator::HLine, tab1 ); |
427 | layout->addMultiCellWidget( bar, 4, 4, 3, 6 ); | 427 | layout->addMultiCellWidget( bar, 4, 4, 3, 6 ); |
428 | */ | 428 | */ |
429 | ////////////////////////////////////// | 429 | ////////////////////////////////////// |
430 | // Addresses (lower left) | 430 | // Addresses (lower left) |
431 | /* LR | 431 | /* LR |
432 | label = new QLabel( tab1_1 ); | 432 | label = new QLabel( tab1_1 ); |
433 | //US loadIcon call is ambiguous. Add one more parameter | 433 | //US loadIcon call is ambiguous. Add one more parameter |
434 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop ) ); | 434 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop ) ); |
435 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) ); | 435 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) ); |
436 | //US layout->addMultiCellWidget( label, 5, 6, 0, 0 ); | 436 | //US layout->addMultiCellWidget( label, 5, 6, 0, 0 ); |
437 | layout->addMultiCellWidget( label, 0, 1, 0, 0 ); | 437 | layout->addMultiCellWidget( label, 0, 1, 0, 0 ); |
438 | */ | 438 | */ |
439 | 439 | ||
440 | mAddressEditWidget = new AddressEditWidget( tab1_1 ); | 440 | mAddressEditWidget = new AddressEditWidget( tab1_1 ); |
441 | connect( mAddressEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); | 441 | connect( mAddressEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); |
442 | //US layout->addMultiCellWidget( mAddressEditWidget, 5, 9, 1, 2 ); | 442 | //US layout->addMultiCellWidget( mAddressEditWidget, 5, 9, 1, 2 ); |
443 | layout->addMultiCellWidget( mAddressEditWidget, 0, 4, 0, 1 ); | 443 | layout->addMultiCellWidget( mAddressEditWidget, 0, 4, 0, 1 ); |
444 | 444 | ||
445 | //US | 445 | //US |
446 | /* LR | 446 | /* LR |
447 | bar = new KSeparator( KSeparator::HLine, tab1_1 ); | 447 | bar = new KSeparator( KSeparator::HLine, tab1_1 ); |
448 | layout->addMultiCellWidget( bar, 5, 5, 0, 3 ); | 448 | layout->addMultiCellWidget( bar, 5, 5, 0, 3 ); |
449 | */ | 449 | */ |
450 | 450 | ||
451 | ////////////////////////////////////// | 451 | ////////////////////////////////////// |
452 | // Email / Web (lower right) | 452 | // Email / Web (lower right) |
453 | /* LR | 453 | /* LR |
454 | label = new QLabel( tab1_1 ); | 454 | label = new QLabel( tab1_1 ); |
455 | //US loadIcon call is ambiguous. Add one more parameter | 455 | //US loadIcon call is ambiguous. Add one more parameter |
456 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop) ); | 456 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop) ); |
457 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop, 0) ); | 457 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop, 0) ); |
458 | //US layout->addMultiCellWidget( label, 5, 6, 3, 3 ); | 458 | //US layout->addMultiCellWidget( label, 5, 6, 3, 3 ); |
459 | layout->addMultiCellWidget( label, 6, 7, 0, 0 ); | 459 | layout->addMultiCellWidget( label, 6, 7, 0, 0 ); |
460 | */ | 460 | */ |
461 | mEmailWidget = new EmailEditWidget( tab1_1 ); | 461 | mEmailWidget = new EmailEditWidget( tab1_1 ); |
462 | connect( mEmailWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); | 462 | connect( mEmailWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); |
463 | //US layout->addMultiCellWidget( mEmailWidget, 5, 6, 4, 6 ); | 463 | //US layout->addMultiCellWidget( mEmailWidget, 5, 6, 4, 6 ); |
464 | layout->addMultiCellWidget( mEmailWidget, 5, 6, 0, 1 ); | 464 | layout->addMultiCellWidget( mEmailWidget, 5, 6, 0, 1 ); |
465 | 465 | ||
466 | /* LR | 466 | /* LR |
467 | // add the separator | 467 | // add the separator |
468 | bar = new KSeparator( KSeparator::HLine, tab1_1 ); | 468 | bar = new KSeparator( KSeparator::HLine, tab1_1 ); |
469 | //US layout->addMultiCellWidget( bar, 7, 7, 3, 6 ); | 469 | //US layout->addMultiCellWidget( bar, 7, 7, 3, 6 ); |
470 | layout->addMultiCellWidget( bar, 8, 8, 0, 3 ); | 470 | layout->addMultiCellWidget( bar, 8, 8, 0, 3 ); |
471 | 471 | ||
472 | label = new QLabel( tab1_1 ); | 472 | label = new QLabel( tab1_1 ); |
473 | //US loadIcon call is ambiguous. Add one more parameter | 473 | //US loadIcon call is ambiguous. Add one more parameter |
474 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) ); | 474 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) ); |
475 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) ); | 475 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) ); |
476 | //US layout->addMultiCellWidget( label, 8, 9, 3, 3 ); | 476 | //US layout->addMultiCellWidget( label, 8, 9, 3, 3 ); |
477 | layout->addMultiCellWidget( label, 9, 10, 0, 0 ); | 477 | layout->addMultiCellWidget( label, 9, 10, 0, 0 ); |
478 | */ | 478 | */ |
479 | label = new QLabel( i18n( "URL:" ), tab1_1 ); | 479 | label = new QLabel( i18n( "URL:" ), tab1_1 ); |
480 | mURLEdit = new KLineEdit( tab1_1 ); | 480 | mURLEdit = new KLineEdit( tab1_1 ); |
481 | connect( mURLEdit, SIGNAL( textChanged( const QString& ) ), | 481 | connect( mURLEdit, SIGNAL( textChanged( const QString& ) ), |
482 | SLOT( textChanged( const QString& ) ) ); | 482 | SLOT( textChanged( const QString& ) ) ); |
483 | label->setBuddy( mURLEdit ); | 483 | label->setBuddy( mURLEdit ); |
484 | //US layout->addWidget( label, 8, 4 ); | 484 | //US layout->addWidget( label, 8, 4 ); |
485 | layout->addWidget( label, 7,0 ); | 485 | layout->addWidget( label, 7,0 ); |
486 | //US layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 ); | 486 | //US layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 ); |
487 | layout->addWidget( mURLEdit, 7, 1); | 487 | layout->addWidget( mURLEdit, 7, 1); |
488 | 488 | ||
489 | label = new QLabel( i18n( "&IM address:" ), tab1_1 ); | 489 | label = new QLabel( i18n( "&IM address:" ), tab1_1 ); |
490 | mIMAddressEdit = new KLineEdit( tab1_1 ); | 490 | mIMAddressEdit = new KLineEdit( tab1_1 ); |
491 | connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ), | 491 | connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ), |
492 | SLOT( textChanged( const QString& ) ) ); | 492 | SLOT( textChanged( const QString& ) ) ); |
493 | label->setBuddy( mIMAddressEdit ); | 493 | label->setBuddy( mIMAddressEdit ); |
494 | //US layout->addWidget( label, 9, 4 ); | 494 | //US layout->addWidget( label, 9, 4 ); |
495 | layout->addWidget( label, 8, 0 ); | 495 | layout->addWidget( label, 8, 0 ); |
496 | //US layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 ); | 496 | //US layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 ); |
497 | layout->addWidget( mIMAddressEdit, 8,1 ); | 497 | layout->addWidget( mIMAddressEdit, 8,1 ); |
498 | 498 | ||
499 | //US layout->addColSpacing( 6, 50 ); | 499 | //US layout->addColSpacing( 6, 50 ); |
500 | 500 | ||
501 | //US bar = new KSeparator( KSeparator::HLine, tab1_1 ); | 501 | //US bar = new KSeparator( KSeparator::HLine, tab1_1 ); |
502 | //US layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); | 502 | //US layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); |
503 | 503 | ||
504 | /*US | 504 | /*US |
505 | /////////////////////////////////////// | 505 | /////////////////////////////////////// |
506 | QHBox *categoryBox = new QHBox( tab1 ); | 506 | QHBox *categoryBox = new QHBox( tab1 ); |
507 | categoryBox->setSpacing( KDialogBase::spacingHintSmall() ); | 507 | categoryBox->setSpacing( KDialogBase::spacingHintSmall() ); |
508 | 508 | ||
509 | // Categories | 509 | // Categories |
510 | button = new QPushButton( i18n( "Categories" ), categoryBox ); | 510 | button = new QPushButton( i18n( "Categories" ), categoryBox ); |
511 | connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); | 511 | connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); |
512 | 512 | ||
513 | mCategoryEdit = new KLineEdit( categoryBox ); | 513 | mCategoryEdit = new KLineEdit( categoryBox ); |
514 | mCategoryEdit->setReadOnly( true ); | 514 | mCategoryEdit->setReadOnly( true ); |
515 | connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), | 515 | connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), |
516 | SLOT( textChanged( const QString& ) ) ); | 516 | SLOT( textChanged( const QString& ) ) ); |
517 | 517 | ||
518 | mSecrecyWidget = new SecrecyWidget( categoryBox ); | 518 | mSecrecyWidget = new SecrecyWidget( categoryBox ); |
519 | connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 519 | connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
520 | 520 | ||
521 | layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); | 521 | layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); |
522 | */ | 522 | */ |
523 | // Build the layout and add to the tab widget | 523 | // Build the layout and add to the tab widget |
524 | layout->activate(); // required | 524 | layout->activate(); // required |
525 | 525 | ||
526 | mTabWidget->addTab( tab1_1, i18n( "&Address" ) ); | 526 | mTabWidget->addTab( tab1_1, i18n( "&Address" ) ); |
527 | } | 527 | } |
528 | 528 | ||
529 | 529 | ||
530 | 530 | ||
531 | void AddresseeEditorWidget::setupTab2() | 531 | void AddresseeEditorWidget::setupTab2() |
532 | { | 532 | { |
533 | // This is the Details tab | 533 | // This is the Details tab |
534 | QWidget *tab2 = new QWidget( mTabWidget ); | 534 | QWidget *tab2 = new QWidget( mTabWidget ); |
535 | 535 | ||
536 | QGridLayout *layout = new QGridLayout( tab2, 8, 3 ); | 536 | QGridLayout *layout = new QGridLayout( tab2, 8, 3 ); |
537 | layout->setMargin( KDialogBase::marginHintSmall() ); | 537 | layout->setMargin( KDialogBase::marginHintSmall() ); |
538 | layout->setSpacing( KDialogBase::spacingHintSmall() ); | 538 | layout->setSpacing( KDialogBase::spacingHintSmall() ); |
539 | 539 | ||
540 | QLabel *label; | 540 | QLabel *label; |
541 | KSeparator* bar; | 541 | KSeparator* bar; |
542 | 542 | ||
543 | /////////////////////// | 543 | /////////////////////// |
544 | // Office info | 544 | // Office info |
545 | 545 | ||
546 | // Department | 546 | // Department |
547 | label = new QLabel( tab2 ); | 547 | label = new QLabel( tab2 ); |
548 | //US loadIcon call is ambiguous. Add one more parameter | 548 | //US loadIcon call is ambiguous. Add one more parameter |
549 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) ); | 549 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) ); |
550 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) ); | 550 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) ); |
551 | layout->addMultiCellWidget( label, 0, 1, 0, 0 ); | 551 | layout->addMultiCellWidget( label, 0, 1, 0, 0 ); |
552 | 552 | ||
553 | label = new QLabel( i18n( "Department:" ), tab2 ); | 553 | label = new QLabel( i18n( "Department:" ), tab2 ); |
554 | layout->addWidget( label, 0, 1 ); | 554 | layout->addWidget( label, 0, 1 ); |
555 | mDepartmentEdit = new KLineEdit( tab2 ); | 555 | mDepartmentEdit = new KLineEdit( tab2 ); |
556 | connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), | 556 | connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), |
557 | SLOT( textChanged( const QString& ) ) ); | 557 | SLOT( textChanged( const QString& ) ) ); |
558 | label->setBuddy( mDepartmentEdit ); | 558 | label->setBuddy( mDepartmentEdit ); |
559 | layout->addWidget( mDepartmentEdit, 0, 2 ); | 559 | layout->addWidget( mDepartmentEdit, 0, 2 ); |
560 | 560 | ||
561 | label = new QLabel( i18n( "Office:" ), tab2 ); | 561 | label = new QLabel( i18n( "Office:" ), tab2 ); |
562 | layout->addWidget( label, 1, 1 ); | 562 | layout->addWidget( label, 1, 1 ); |
563 | mOfficeEdit = new KLineEdit( tab2 ); | 563 | mOfficeEdit = new KLineEdit( tab2 ); |
564 | connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), | 564 | connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), |
565 | SLOT( textChanged( const QString& ) ) ); | 565 | SLOT( textChanged( const QString& ) ) ); |
566 | label->setBuddy( mOfficeEdit ); | 566 | label->setBuddy( mOfficeEdit ); |
567 | layout->addWidget( mOfficeEdit, 1, 2 ); | 567 | layout->addWidget( mOfficeEdit, 1, 2 ); |
568 | 568 | ||
569 | label = new QLabel( i18n( "Profession:" ), tab2 ); | 569 | label = new QLabel( i18n( "Profession:" ), tab2 ); |
570 | layout->addWidget( label, 2, 1 ); | 570 | layout->addWidget( label, 2, 1 ); |
571 | mProfessionEdit = new KLineEdit( tab2 ); | 571 | mProfessionEdit = new KLineEdit( tab2 ); |
572 | connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ), | 572 | connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ), |
573 | SLOT( textChanged( const QString& ) ) ); | 573 | SLOT( textChanged( const QString& ) ) ); |
574 | label->setBuddy( mProfessionEdit ); | 574 | label->setBuddy( mProfessionEdit ); |
575 | layout->addWidget( mProfessionEdit, 2, 2 ); | 575 | layout->addWidget( mProfessionEdit, 2, 2 ); |
576 | 576 | ||
577 | label = new QLabel( i18n( "Manager\'s name:" ), tab2 ); | 577 | label = new QLabel( i18n( "Manager\'s name:" ), tab2 ); |
578 | //US layout->addWidget( label, 0, 3 ); | 578 | //US layout->addWidget( label, 0, 3 ); |
579 | layout->addWidget( label, 3, 1 ); | 579 | layout->addWidget( label, 3, 1 ); |
580 | mManagerEdit = new KLineEdit( tab2 ); | 580 | mManagerEdit = new KLineEdit( tab2 ); |
581 | connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ), | 581 | connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ), |
582 | SLOT( textChanged( const QString& ) ) ); | 582 | SLOT( textChanged( const QString& ) ) ); |
583 | label->setBuddy( mManagerEdit ); | 583 | label->setBuddy( mManagerEdit ); |
584 | //US layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 ); | 584 | //US layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 ); |
585 | layout->addWidget( mManagerEdit, 3, 2 ); | 585 | layout->addWidget( mManagerEdit, 3, 2 ); |
586 | 586 | ||
587 | label = new QLabel( i18n( "Assistant's name:" ), tab2 ); | 587 | label = new QLabel( i18n( "Assistant's name:" ), tab2 ); |
588 | //US layout->addWidget( label, 1, 3 ); | 588 | //US layout->addWidget( label, 1, 3 ); |
589 | layout->addWidget( label, 4, 1 ); | 589 | layout->addWidget( label, 4, 1 ); |
590 | mAssistantEdit = new KLineEdit( tab2 ); | 590 | mAssistantEdit = new KLineEdit( tab2 ); |
591 | connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ), | 591 | connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ), |
592 | SLOT( textChanged( const QString& ) ) ); | 592 | SLOT( textChanged( const QString& ) ) ); |
593 | label->setBuddy( mAssistantEdit ); | 593 | label->setBuddy( mAssistantEdit ); |
594 | //US layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 ); | 594 | //US layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 ); |
595 | layout->addWidget( mAssistantEdit, 4, 2 ); | 595 | layout->addWidget( mAssistantEdit, 4, 2 ); |
596 | 596 | ||
597 | bar = new KSeparator( KSeparator::HLine, tab2 ); | 597 | bar = new KSeparator( KSeparator::HLine, tab2 ); |
598 | //US layout->addMultiCellWidget( bar, 3, 3, 0, 5 ); | 598 | //US layout->addMultiCellWidget( bar, 3, 3, 0, 5 ); |
599 | layout->addMultiCellWidget( bar, 5, 5, 0, 2 ); | 599 | layout->addMultiCellWidget( bar, 5, 5, 0, 2 ); |
600 | 600 | ||
601 | ///////////////////////////////////////////////// | 601 | ///////////////////////////////////////////////// |
602 | // Personal info | 602 | // Personal info |
603 | 603 | ||
604 | label = new QLabel( tab2 ); | 604 | label = new QLabel( tab2 ); |
605 | //US loadIcon call is ambiguous. Add one more parameter | 605 | //US loadIcon call is ambiguous. Add one more parameter |
606 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); | 606 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); |
607 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); | 607 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); |
608 | //US layout->addMultiCellWidget( label, 4, 5, 0, 0 ); | 608 | //US layout->addMultiCellWidget( label, 4, 5, 0, 0 ); |
609 | layout->addMultiCellWidget( label, 6, 7, 0, 0 ); | 609 | layout->addMultiCellWidget( label, 6, 7, 0, 0 ); |
610 | 610 | ||
611 | label = new QLabel( i18n( "Nick name:" ), tab2 ); | 611 | label = new QLabel( i18n( "Nick name:" ), tab2 ); |
612 | //US layout->addWidget( label, 4, 1 ); | 612 | //US layout->addWidget( label, 4, 1 ); |
613 | layout->addWidget( label, 6, 1 ); | 613 | layout->addWidget( label, 6, 1 ); |
614 | mNicknameEdit = new KLineEdit( tab2 ); | 614 | mNicknameEdit = new KLineEdit( tab2 ); |
615 | connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), | 615 | connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), |
616 | SLOT( textChanged( const QString& ) ) ); | 616 | SLOT( textChanged( const QString& ) ) ); |
617 | label->setBuddy( mNicknameEdit ); | 617 | label->setBuddy( mNicknameEdit ); |
618 | //US layout->addWidget( mNicknameEdit, 4, 2 ); | 618 | //US layout->addWidget( mNicknameEdit, 4, 2 ); |
619 | layout->addWidget( mNicknameEdit, 6, 2 ); | 619 | layout->addWidget( mNicknameEdit, 6, 2 ); |
620 | 620 | ||
621 | label = new QLabel( i18n( "Spouse's name:" ), tab2 ); | 621 | label = new QLabel( i18n( "Spouse's name:" ), tab2 ); |
622 | //US layout->addWidget( label, 5, 1 ); | 622 | //US layout->addWidget( label, 5, 1 ); |
623 | layout->addWidget( label, 7, 1 ); | 623 | layout->addWidget( label, 7, 1 ); |
624 | mSpouseEdit = new KLineEdit( tab2 ); | 624 | mSpouseEdit = new KLineEdit( tab2 ); |
625 | connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), | 625 | connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), |
626 | SLOT( textChanged( const QString& ) ) ); | 626 | SLOT( textChanged( const QString& ) ) ); |
627 | label->setBuddy( mSpouseEdit ); | 627 | label->setBuddy( mSpouseEdit ); |
628 | //US layout->addWidget( mSpouseEdit, 5, 2 ); | 628 | //US layout->addWidget( mSpouseEdit, 5, 2 ); |
629 | layout->addWidget( mSpouseEdit, 7, 2 ); | 629 | layout->addWidget( mSpouseEdit, 7, 2 ); |
630 | 630 | ||
631 | label = new QLabel( i18n( "Birthday:" ), tab2 ); | 631 | label = new QLabel( i18n( "Birthday:" ), tab2 ); |
632 | //US layout->addWidget( label, 4, 3 ); | 632 | //US layout->addWidget( label, 4, 3 ); |
633 | layout->addWidget( label, 8, 1 ); | 633 | layout->addWidget( label, 8, 1 ); |
634 | mBirthdayPicker = new KDateEdit( tab2 ); | 634 | mBirthdayPicker = new KDateEdit( tab2 ); |
635 | mBirthdayPicker->setHandleInvalid( true ); | 635 | mBirthdayPicker->setHandleInvalid( true ); |
636 | connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), | 636 | connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), |
637 | SLOT( dateChanged( QDate ) ) ); | 637 | SLOT( dateChanged( QDate ) ) ); |
638 | 638 | ||
639 | 639 | ||
640 | #ifndef KAB_EMBEDDED | 640 | #ifndef KAB_EMBEDDED |
641 | //US invalid dates are handdled by the KDateEdit widget itself | 641 | //US invalid dates are handdled by the KDateEdit widget itself |
642 | connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ), | 642 | connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ), |
643 | SLOT( invalidDate() ) ); | 643 | SLOT( invalidDate() ) ); |
644 | connect( mBirthdayPicker, SIGNAL( textChanged( const QString& ) ), | 644 | connect( mBirthdayPicker, SIGNAL( textChanged( const QString& ) ), |
645 | SLOT( emitModified() ) ); | 645 | SLOT( emitModified() ) ); |
646 | #endif //KAB_EMBEDDED | 646 | #endif //KAB_EMBEDDED |
647 | 647 | ||
648 | label->setBuddy( mBirthdayPicker ); | 648 | label->setBuddy( mBirthdayPicker ); |
649 | //US layout->addWidget( mBirthdayPicker, 4, 4 ); | 649 | //US layout->addWidget( mBirthdayPicker, 4, 4 ); |
650 | layout->addWidget( mBirthdayPicker, 8, 2 ); | 650 | layout->addWidget( mBirthdayPicker, 8, 2 ); |
651 | 651 | ||
652 | label = new QLabel( i18n( "Anniversary:" ), tab2 ); | 652 | label = new QLabel( i18n( "Anniversary:" ), tab2 ); |
653 | //US layout->addWidget( label, 5, 3 ); | 653 | //US layout->addWidget( label, 5, 3 ); |
654 | layout->addWidget( label, 9, 1 ); | 654 | layout->addWidget( label, 9, 1 ); |
655 | mAnniversaryPicker = new KDateEdit( tab2 ); | 655 | mAnniversaryPicker = new KDateEdit( tab2 ); |
656 | mAnniversaryPicker->setHandleInvalid( true ); | 656 | mAnniversaryPicker->setHandleInvalid( true ); |
657 | connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), | 657 | connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), |
658 | SLOT( dateChanged( QDate ) ) ); | 658 | SLOT( dateChanged( QDate ) ) ); |
659 | #ifndef KAB_EMBEDDED | 659 | #ifndef KAB_EMBEDDED |
660 | //US invalid dates are handled by the KDateEdit widget itself | 660 | //US invalid dates are handled by the KDateEdit widget itself |
661 | connect( mAnniversaryPicker, SIGNAL( invalidDateEntered() ), | 661 | connect( mAnniversaryPicker, SIGNAL( invalidDateEntered() ), |
662 | SLOT( invalidDate() ) ); | 662 | SLOT( invalidDate() ) ); |
663 | connect( mAnniversaryPicker, SIGNAL( textChanged( const QString& ) ), | 663 | connect( mAnniversaryPicker, SIGNAL( textChanged( const QString& ) ), |
664 | SLOT( emitModified() ) ); | 664 | SLOT( emitModified() ) ); |
665 | #endif //KAB_EMBEDDED | 665 | #endif //KAB_EMBEDDED |
666 | 666 | ||
667 | label->setBuddy( mAnniversaryPicker ); | 667 | label->setBuddy( mAnniversaryPicker ); |
668 | //US layout->addWidget( mAnniversaryPicker, 5, 4 ); | 668 | //US layout->addWidget( mAnniversaryPicker, 5, 4 ); |
669 | layout->addWidget( mAnniversaryPicker, 9, 2 ); | 669 | layout->addWidget( mAnniversaryPicker, 9, 2 ); |
670 | 670 | ||
671 | /*US | 671 | /*US |
672 | bar = new KSeparator( KSeparator::HLine, tab2 ); | 672 | bar = new KSeparator( KSeparator::HLine, tab2 ); |
673 | layout->addMultiCellWidget( bar, 6, 6, 0, 5 ); | 673 | layout->addMultiCellWidget( bar, 6, 6, 0, 5 ); |
674 | 674 | ||
675 | ////////////////////////////////////// | 675 | ////////////////////////////////////// |
676 | // Notes | 676 | // Notes |
677 | label = new QLabel( i18n( "Note:" ), tab2 ); | 677 | label = new QLabel( i18n( "Note:" ), tab2 ); |
678 | label->setAlignment( Qt::AlignTop | Qt::AlignLeft ); | 678 | label->setAlignment( Qt::AlignTop | Qt::AlignLeft ); |
679 | layout->addWidget( label, 7, 0 ); | 679 | layout->addWidget( label, 7, 0 ); |
680 | #ifndef KAB_EMBEDDED | 680 | #ifndef KAB_EMBEDDED |
681 | mNoteEdit = new QTextEdit( tab2 ); | 681 | mNoteEdit = new QTextEdit( tab2 ); |
682 | mNoteEdit->setWordWrap( QTextEdit::WidgetWidth ); | 682 | mNoteEdit->setWordWrap( QTextEdit::WidgetWidth ); |
683 | mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); | 683 | mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); |
684 | #else //KAB_EMBEDDED | 684 | #else //KAB_EMBEDDED |
685 | mNoteEdit = new QMultiLineEdit( tab2 ); | 685 | mNoteEdit = new QMultiLineEdit( tab2 ); |
686 | //US mNoteEdit->setWordWrap( QTextEdit::WidgetWidth ); | 686 | //US mNoteEdit->setWordWrap( QTextEdit::WidgetWidth ); |
687 | //US mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); | 687 | //US mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); |
688 | qDebug("AddresseeEditorWidget::setupTab2 has to be changed"); | 688 | qDebug("AddresseeEditorWidget::setupTab2 has to be changed"); |
689 | #endif //KAB_EMBEDDED | 689 | #endif //KAB_EMBEDDED |
690 | connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) ); | 690 | connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) ); |
691 | label->setBuddy( mNoteEdit ); | 691 | label->setBuddy( mNoteEdit ); |
692 | layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 ); | 692 | layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 ); |
693 | */ | 693 | */ |
694 | // Build the layout and add to the tab widget | 694 | // Build the layout and add to the tab widget |
695 | layout->activate(); // required | 695 | layout->activate(); // required |
696 | 696 | ||
697 | mTabWidget->addTab( tab2, i18n( "&Details" ) ); | 697 | mTabWidget->addTab( tab2, i18n( "&Details" ) ); |
698 | } | 698 | } |
699 | 699 | ||
700 | void AddresseeEditorWidget::setupTab2_1() | 700 | void AddresseeEditorWidget::setupTab2_1() |
701 | { | 701 | { |
702 | // This is the Details tab | 702 | // This is the Details tab |
703 | QWidget *tab2_2 = new QWidget( mTabWidget ); | 703 | QWidget *tab2_2 = new QWidget( mTabWidget ); |
704 | 704 | ||
705 | QGridLayout *layout = new QGridLayout( tab2_2, 1, 2 ); | 705 | QGridLayout *layout = new QGridLayout( tab2_2, 1, 2 ); |
706 | layout->setMargin( KDialogBase::marginHintSmall() ); | 706 | layout->setMargin( KDialogBase::marginHintSmall() ); |
707 | layout->setSpacing( KDialogBase::spacingHintSmall() ); | 707 | layout->setSpacing( KDialogBase::spacingHintSmall() ); |
708 | 708 | ||
709 | QLabel *label; | 709 | QLabel *label; |
710 | KSeparator* bar; | 710 | KSeparator* bar; |
711 | 711 | ||
712 | /*US | 712 | /*US |
713 | /////////////////////// | 713 | /////////////////////// |
714 | // Office info | 714 | // Office info |
715 | 715 | ||
716 | // Department | 716 | // Department |
717 | label = new QLabel( tab2 ); | 717 | label = new QLabel( tab2 ); |
718 | //US loadIcon call is ambiguous. Add one more parameter | 718 | //US loadIcon call is ambiguous. Add one more parameter |
719 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) ); | 719 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) ); |
720 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) ); | 720 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) ); |
721 | layout->addMultiCellWidget( label, 0, 1, 0, 0 ); | 721 | layout->addMultiCellWidget( label, 0, 1, 0, 0 ); |
722 | 722 | ||
723 | label = new QLabel( i18n( "Department:" ), tab2 ); | 723 | label = new QLabel( i18n( "Department:" ), tab2 ); |
724 | layout->addWidget( label, 0, 1 ); | 724 | layout->addWidget( label, 0, 1 ); |
725 | mDepartmentEdit = new KLineEdit( tab2 ); | 725 | mDepartmentEdit = new KLineEdit( tab2 ); |
726 | connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), | 726 | connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), |
727 | SLOT( textChanged( const QString& ) ) ); | 727 | SLOT( textChanged( const QString& ) ) ); |
728 | label->setBuddy( mDepartmentEdit ); | 728 | label->setBuddy( mDepartmentEdit ); |
729 | layout->addWidget( mDepartmentEdit, 0, 2 ); | 729 | layout->addWidget( mDepartmentEdit, 0, 2 ); |
730 | 730 | ||
731 | label = new QLabel( i18n( "Office:" ), tab2 ); | 731 | label = new QLabel( i18n( "Office:" ), tab2 ); |
732 | layout->addWidget( label, 1, 1 ); | 732 | layout->addWidget( label, 1, 1 ); |
733 | mOfficeEdit = new KLineEdit( tab2 ); | 733 | mOfficeEdit = new KLineEdit( tab2 ); |
734 | connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), | 734 | connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), |
735 | SLOT( textChanged( const QString& ) ) ); | 735 | SLOT( textChanged( const QString& ) ) ); |
736 | label->setBuddy( mOfficeEdit ); | 736 | label->setBuddy( mOfficeEdit ); |
737 | layout->addWidget( mOfficeEdit, 1, 2 ); | 737 | layout->addWidget( mOfficeEdit, 1, 2 ); |
738 | 738 | ||
739 | label = new QLabel( i18n( "Profession:" ), tab2 ); | 739 | label = new QLabel( i18n( "Profession:" ), tab2 ); |
740 | layout->addWidget( label, 2, 1 ); | 740 | layout->addWidget( label, 2, 1 ); |
741 | mProfessionEdit = new KLineEdit( tab2 ); | 741 | mProfessionEdit = new KLineEdit( tab2 ); |
742 | connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ), | 742 | connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ), |
743 | SLOT( textChanged( const QString& ) ) ); | 743 | SLOT( textChanged( const QString& ) ) ); |
744 | label->setBuddy( mProfessionEdit ); | 744 | label->setBuddy( mProfessionEdit ); |
745 | layout->addWidget( mProfessionEdit, 2, 2 ); | 745 | layout->addWidget( mProfessionEdit, 2, 2 ); |
746 | 746 | ||
747 | label = new QLabel( i18n( "Manager\'s name:" ), tab2 ); | 747 | label = new QLabel( i18n( "Manager\'s name:" ), tab2 ); |
748 | layout->addWidget( label, 0, 3 ); | 748 | layout->addWidget( label, 0, 3 ); |
749 | mManagerEdit = new KLineEdit( tab2 ); | 749 | mManagerEdit = new KLineEdit( tab2 ); |
750 | connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ), | 750 | connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ), |
751 | SLOT( textChanged( const QString& ) ) ); | 751 | SLOT( textChanged( const QString& ) ) ); |
752 | label->setBuddy( mManagerEdit ); | 752 | label->setBuddy( mManagerEdit ); |
753 | layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 ); | 753 | layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 ); |
754 | 754 | ||
755 | label = new QLabel( i18n( "Assistant's name:" ), tab2 ); | 755 | label = new QLabel( i18n( "Assistant's name:" ), tab2 ); |
756 | layout->addWidget( label, 1, 3 ); | 756 | layout->addWidget( label, 1, 3 ); |
757 | mAssistantEdit = new KLineEdit( tab2 ); | 757 | mAssistantEdit = new KLineEdit( tab2 ); |
758 | connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ), | 758 | connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ), |
759 | SLOT( textChanged( const QString& ) ) ); | 759 | SLOT( textChanged( const QString& ) ) ); |
760 | label->setBuddy( mAssistantEdit ); | 760 | label->setBuddy( mAssistantEdit ); |
761 | layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 ); | 761 | layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 ); |
762 | 762 | ||
763 | bar = new KSeparator( KSeparator::HLine, tab2 ); | 763 | bar = new KSeparator( KSeparator::HLine, tab2 ); |
764 | layout->addMultiCellWidget( bar, 3, 3, 0, 5 ); | 764 | layout->addMultiCellWidget( bar, 3, 3, 0, 5 ); |
765 | 765 | ||
766 | ///////////////////////////////////////////////// | 766 | ///////////////////////////////////////////////// |
767 | // Personal info | 767 | // Personal info |
768 | 768 | ||
769 | label = new QLabel( tab2 ); | 769 | label = new QLabel( tab2 ); |
770 | //US loadIcon call is ambiguous. Add one more parameter | 770 | //US loadIcon call is ambiguous. Add one more parameter |
771 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); | 771 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); |
772 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); | 772 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); |
773 | layout->addMultiCellWidget( label, 4, 5, 0, 0 ); | 773 | layout->addMultiCellWidget( label, 4, 5, 0, 0 ); |
774 | 774 | ||
775 | label = new QLabel( i18n( "Nick name:" ), tab2 ); | 775 | label = new QLabel( i18n( "Nick name:" ), tab2 ); |
776 | layout->addWidget( label, 4, 1 ); | 776 | layout->addWidget( label, 4, 1 ); |
777 | mNicknameEdit = new KLineEdit( tab2 ); | 777 | mNicknameEdit = new KLineEdit( tab2 ); |
778 | connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), | 778 | connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), |
779 | SLOT( textChanged( const QString& ) ) ); | 779 | SLOT( textChanged( const QString& ) ) ); |
780 | label->setBuddy( mNicknameEdit ); | 780 | label->setBuddy( mNicknameEdit ); |
781 | layout->addWidget( mNicknameEdit, 4, 2 ); | 781 | layout->addWidget( mNicknameEdit, 4, 2 ); |
782 | 782 | ||
783 | label = new QLabel( i18n( "Spouse's name:" ), tab2 ); | 783 | label = new QLabel( i18n( "Spouse's name:" ), tab2 ); |
784 | layout->addWidget( label, 5, 1 ); | 784 | layout->addWidget( label, 5, 1 ); |
785 | mSpouseEdit = new KLineEdit( tab2 ); | 785 | mSpouseEdit = new KLineEdit( tab2 ); |
786 | connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), | 786 | connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), |
787 | SLOT( textChanged( const QString& ) ) ); | 787 | SLOT( textChanged( const QString& ) ) ); |
788 | label->setBuddy( mSpouseEdit ); | 788 | label->setBuddy( mSpouseEdit ); |
789 | layout->addWidget( mSpouseEdit, 5, 2 ); | 789 | layout->addWidget( mSpouseEdit, 5, 2 ); |
790 | 790 | ||
791 | label = new QLabel( i18n( "Birthday:" ), tab2 ); | 791 | label = new QLabel( i18n( "Birthday:" ), tab2 ); |
792 | layout->addWidget( label, 4, 3 ); | 792 | layout->addWidget( label, 4, 3 ); |
793 | mBirthdayPicker = new KDateEdit( tab2 ); | 793 | mBirthdayPicker = new KDateEdit( tab2 ); |
794 | mBirthdayPicker->setHandleInvalid( true ); | 794 | mBirthdayPicker->setHandleInvalid( true ); |
795 | connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), | 795 | connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), |
796 | SLOT( dateChanged( QDate ) ) ); | 796 | SLOT( dateChanged( QDate ) ) ); |
797 | connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ), | 797 | connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ), |
798 | SLOT( invalidDate() ) ); | 798 | SLOT( invalidDate() ) ); |
799 | connect( mBirthdayPicker, SIGNAL( textChanged( const QString& ) ), | 799 | connect( mBirthdayPicker, SIGNAL( textChanged( const QString& ) ), |
800 | SLOT( emitModified() ) ); | 800 | SLOT( emitModified() ) ); |
801 | label->setBuddy( mBirthdayPicker ); | 801 | label->setBuddy( mBirthdayPicker ); |
802 | layout->addWidget( mBirthdayPicker, 4, 4 ); | 802 | layout->addWidget( mBirthdayPicker, 4, 4 ); |
803 | 803 | ||
804 | label = new QLabel( i18n( "Anniversary:" ), tab2 ); | 804 | label = new QLabel( i18n( "Anniversary:" ), tab2 ); |
805 | layout->addWidget( label, 5, 3 ); | 805 | layout->addWidget( label, 5, 3 ); |
806 | mAnniversaryPicker = new KDateEdit( tab2 ); | 806 | mAnniversaryPicker = new KDateEdit( tab2 ); |
807 | mAnniversaryPicker->setHandleInvalid( true ); | 807 | mAnniversaryPicker->setHandleInvalid( true ); |
808 | connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), | 808 | connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), |
809 | SLOT( dateChanged( QDate ) ) ); | 809 | SLOT( dateChanged( QDate ) ) ); |
810 | connect( mAnniversaryPicker, SIGNAL( invalidDateEntered() ), | 810 | connect( mAnniversaryPicker, SIGNAL( invalidDateEntered() ), |
811 | SLOT( invalidDate() ) ); | 811 | SLOT( invalidDate() ) ); |
812 | connect( mAnniversaryPicker, SIGNAL( textChanged( const QString& ) ), | 812 | connect( mAnniversaryPicker, SIGNAL( textChanged( const QString& ) ), |
813 | SLOT( emitModified() ) ); | 813 | SLOT( emitModified() ) ); |
814 | label->setBuddy( mAnniversaryPicker ); | 814 | label->setBuddy( mAnniversaryPicker ); |
815 | layout->addWidget( mAnniversaryPicker, 5, 4 ); | 815 | layout->addWidget( mAnniversaryPicker, 5, 4 ); |
816 | 816 | ||
817 | bar = new KSeparator( KSeparator::HLine, tab2 ); | 817 | bar = new KSeparator( KSeparator::HLine, tab2 ); |
818 | layout->addMultiCellWidget( bar, 6, 6, 0, 5 ); | 818 | layout->addMultiCellWidget( bar, 6, 6, 0, 5 ); |
819 | */ | 819 | */ |
820 | ////////////////////////////////////// | 820 | ////////////////////////////////////// |
821 | // Notes | 821 | // Notes |
822 | label = new QLabel( i18n( "Note:" ), tab2_2 ); | 822 | label = new QLabel( i18n( "Note:" ), tab2_2 ); |
823 | label->setAlignment( Qt::AlignTop | Qt::AlignLeft ); | 823 | label->setAlignment( Qt::AlignTop | Qt::AlignLeft ); |
824 | //US layout->addWidget( label, 7, 0 ); | 824 | //US layout->addWidget( label, 7, 0 ); |
825 | layout->addWidget( label, 0, 0 ); | 825 | layout->addWidget( label, 0, 0 ); |
826 | #ifndef KAB_EMBEDDED | 826 | #ifndef KAB_EMBEDDED |
827 | mNoteEdit = new QTextEdit( tab2_2 ); | 827 | mNoteEdit = new QTextEdit( tab2_2 ); |
828 | mNoteEdit->setWordWrap( QTextEdit::WidgetWidth ); | 828 | mNoteEdit->setWordWrap( QTextEdit::WidgetWidth ); |
829 | mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); | 829 | mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); |
830 | #else //KAB_EMBEDDED | 830 | #else //KAB_EMBEDDED |
831 | mNoteEdit = new QMultiLineEdit( tab2_2 ); | 831 | mNoteEdit = new QMultiLineEdit( tab2_2 ); |
832 | mNoteEdit->setWordWrap( QMultiLineEdit::WidgetWidth ); | 832 | mNoteEdit->setWordWrap( QMultiLineEdit::WidgetWidth ); |
833 | mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); | 833 | mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); |
834 | #endif //KAB_EMBEDDED | 834 | #endif //KAB_EMBEDDED |
835 | 835 | ||
836 | connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) ); | 836 | connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) ); |
837 | label->setBuddy( mNoteEdit ); | 837 | label->setBuddy( mNoteEdit ); |
838 | //US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 ); | 838 | //US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 ); |
839 | layout->addWidget( mNoteEdit, 1, 0); | 839 | layout->addWidget( mNoteEdit, 1, 0); |
840 | 840 | ||
841 | // Build the layout and add to the tab widget | 841 | // Build the layout and add to the tab widget |
842 | layout->activate(); // required | 842 | layout->activate(); // required |
843 | 843 | ||
844 | mTabWidget->addTab( tab2_2, i18n( "&Notes" ) ); | 844 | mTabWidget->addTab( tab2_2, i18n( "&Notes" ) ); |
845 | } | 845 | } |
846 | 846 | ||
847 | 847 | ||
848 | 848 | ||
849 | void AddresseeEditorWidget::setupTab3() | 849 | void AddresseeEditorWidget::setupTab3() |
850 | { | 850 | { |
851 | // This is the Misc tab | 851 | // This is the Misc tab |
852 | QWidget *tab3 = new QWidget( mTabWidget ); | 852 | QWidget *tab3 = new QWidget( mTabWidget ); |
853 | 853 | ||
854 | QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); | 854 | QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); |
855 | layout->setMargin( KDialogBase::marginHintSmall() ); | 855 | layout->setMargin( KDialogBase::marginHintSmall() ); |
856 | layout->setSpacing( KDialogBase::spacingHintSmall() ); | 856 | layout->setSpacing( KDialogBase::spacingHintSmall() ); |
857 | //US layout->setColStretch( 2, 1 ); | 857 | //US layout->setColStretch( 2, 1 ); |
858 | 858 | ||
859 | ////////////////////////////////////// | 859 | ////////////////////////////////////// |
860 | // Geo | 860 | // Geo |
861 | mGeoWidget = new GeoWidget( tab3 ); | 861 | mGeoWidget = new GeoWidget( tab3 ); |
862 | // mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); | 862 | // mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); |
863 | connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 863 | connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
864 | layout->addWidget( mGeoWidget, 0, 0 ); | 864 | layout->addWidget( mGeoWidget, 0, 0 ); |
865 | /*US | 865 | /*US |
866 | ////////////////////////////////////// | 866 | ////////////////////////////////////// |
867 | // Sound | 867 | // Sound |
868 | #ifndef KAB_EMBEDDED | 868 | #ifndef KAB_EMBEDDED |
869 | mSoundWidget = new SoundWidget( tab3 ); | 869 | mSoundWidget = new SoundWidget( tab3 ); |
870 | mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); | 870 | mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); |
871 | connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 871 | connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
872 | layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); | 872 | layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); |
873 | #else //KAB_EMBEDDED | 873 | #else //KAB_EMBEDDED |
874 | qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); | 874 | qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); |
875 | #endif //KAB_EMBEDDED | 875 | #endif //KAB_EMBEDDED |
876 | 876 | ||
877 | ////////////////////////////////////// | 877 | ////////////////////////////////////// |
878 | // Images | 878 | // Images |
879 | mImageWidget = new ImageWidget( tab3 ); | 879 | mImageWidget = new ImageWidget( tab3 ); |
880 | mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); | 880 | mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); |
881 | connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 881 | connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
882 | layout->addWidget( mImageWidget, 1, 0, Qt::AlignTop ); | 882 | layout->addWidget( mImageWidget, 1, 0, Qt::AlignTop ); |
883 | */ | 883 | */ |
884 | //US | 884 | //US |
885 | /* | 885 | /* |
886 | KSeparator* bar = new KSeparator( KSeparator::HLine, tab3 ); | 886 | KSeparator* bar = new KSeparator( KSeparator::HLine, tab3 ); |
887 | layout->addMultiCellWidget( bar, 1, 1, 0, 0 ); | 887 | layout->addMultiCellWidget( bar, 1, 1, 0, 0 ); |
888 | */ | 888 | */ |
889 | ////////////////////////////////////// | 889 | ////////////////////////////////////// |
890 | // Keys | 890 | // Keys |
891 | mKeyWidget = new KeyWidget( tab3 ); | 891 | mKeyWidget = new KeyWidget( tab3 ); |
892 | //mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); | 892 | //mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); |
893 | connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 893 | connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
894 | //US layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); | 894 | //US layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); |
895 | layout->addWidget( mKeyWidget, 1, 0 ); | 895 | layout->addWidget( mKeyWidget, 1, 0 ); |
896 | 896 | ||
897 | mTabWidget->addTab( tab3, i18n( "&Misc" ) ); | 897 | mTabWidget->addTab( tab3, i18n( "&Misc" ) ); |
898 | } | 898 | } |
899 | 899 | ||
900 | void AddresseeEditorWidget::setupTab3_1() | 900 | void AddresseeEditorWidget::setupTab3_1() |
901 | { | 901 | { |
902 | // This is the Misc tab | 902 | // This is the Misc tab |
903 | QWidget *tab3 = new QWidget( mTabWidget ); | 903 | QWidget *tab3 = new QWidget( mTabWidget ); |
904 | 904 | ||
905 | //US QGridLayout *layout = new QGridLayout( tab3, 2, 3 ); | 905 | //US QGridLayout *layout = new QGridLayout( tab3, 2, 3 ); |
906 | QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); | 906 | QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); |
907 | layout->setMargin( KDialogBase::marginHint() ); | 907 | layout->setMargin( KDialogBase::marginHint() ); |
908 | layout->setSpacing( KDialogBase::spacingHint() ); | 908 | layout->setSpacing( KDialogBase::spacingHint() ); |
909 | //US layout->setColStretch( 2, 1 ); | 909 | //US layout->setColStretch( 2, 1 ); |
910 | 910 | ||
911 | /*US | 911 | /*US |
912 | ////////////////////////////////////// | 912 | ////////////////////////////////////// |
913 | // Geo | 913 | // Geo |
914 | mGeoWidget = new GeoWidget( tab3 ); | 914 | mGeoWidget = new GeoWidget( tab3 ); |
915 | mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); | 915 | mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); |
916 | connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 916 | connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
917 | layout->addWidget( mGeoWidget, 0, 0, Qt::AlignTop ); | 917 | layout->addWidget( mGeoWidget, 0, 0, Qt::AlignTop ); |
918 | */ | 918 | */ |
919 | ////////////////////////////////////// | 919 | ////////////////////////////////////// |
920 | // Sound | 920 | // Sound |
921 | #ifndef KAB_EMBEDDED | 921 | #ifndef KAB_EMBEDDED |
922 | mSoundWidget = new SoundWidget( tab3 ); | 922 | mSoundWidget = new SoundWidget( tab3 ); |
923 | mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); | 923 | mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); |
924 | connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 924 | connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
925 | layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); | 925 | layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); |
926 | #else //KAB_EMBEDDED | 926 | #else //KAB_EMBEDDED |
927 | //US qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); | 927 | //US qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); |
928 | #endif //KAB_EMBEDDED | 928 | #endif //KAB_EMBEDDED |
929 | 929 | ||
930 | ////////////////////////////////////// | 930 | ////////////////////////////////////// |
931 | // Images | 931 | // Images |
932 | mImageWidget = new ImageWidget( tab3 ); | 932 | mImageWidget = new ImageWidget( tab3 ); |
933 | mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); | 933 | mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); |
934 | connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 934 | connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
935 | layout->addWidget( mImageWidget, 0, 0, Qt::AlignTop ); | 935 | layout->addWidget( mImageWidget, 0, 0, Qt::AlignTop ); |
936 | /*US | 936 | /*US |
937 | ////////////////////////////////////// | 937 | ////////////////////////////////////// |
938 | // Keys | 938 | // Keys |
939 | mKeyWidget = new KeyWidget( tab3 ); | 939 | mKeyWidget = new KeyWidget( tab3 ); |
940 | mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); | 940 | mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); |
941 | connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 941 | connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
942 | layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); | 942 | layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); |
943 | */ | 943 | */ |
944 | mTabWidget->addTab( tab3, i18n( "&Images" ) ); | 944 | mTabWidget->addTab( tab3, i18n( "&Images" ) ); |
945 | } | 945 | } |
946 | 946 | ||
947 | 947 | ||
948 | void AddresseeEditorWidget::load() | 948 | void AddresseeEditorWidget::load() |
949 | { | 949 | { |
950 | kdDebug(5720) << "AddresseeEditorWidget::load()" << endl; | 950 | kdDebug(5720) << "AddresseeEditorWidget::load()" << endl; |
951 | 951 | ||
952 | // Block signals in case anything tries to emit modified | 952 | // Block signals in case anything tries to emit modified |
953 | // CS: This doesn't seem to work. | 953 | // CS: This doesn't seem to work. |
954 | bool block = signalsBlocked(); | 954 | bool block = signalsBlocked(); |
955 | blockSignals( true ); | 955 | blockSignals( true ); |
956 | mBlockSignals = true; // used for internal signal blocking | 956 | mBlockSignals = true; // used for internal signal blocking |
957 | 957 | ||
958 | mNameEdit->setText( mAddressee.assembledName() ); | 958 | mNameEdit->setText( mAddressee.assembledName() ); |
959 | 959 | ||
960 | if ( mAddressee.formattedName().isEmpty() ) { | 960 | if ( mAddressee.formattedName().isEmpty() ) { |
961 | //US KConfig config( "kaddressbookrc" ); | 961 | //US KConfig config( "kaddressbookrc" ); |
962 | KConfig config( locateLocal("config", "kaddressbookrc") ); | 962 | KConfig config( locateLocal("config", "kaddressbookrc") ); |
963 | config.setGroup( "General" ); | 963 | config.setGroup( "General" ); |
964 | mFormattedNameType = config.readNumEntry( "FormattedNameType", 1 ); | 964 | mFormattedNameType = config.readNumEntry( "FormattedNameType", 1 ); |
965 | mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); | 965 | mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); |
966 | } else { | 966 | } else { |
967 | if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::SimpleName ) ) | 967 | if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::SimpleName ) ) |
968 | mFormattedNameType = NameEditDialog::SimpleName; | 968 | mFormattedNameType = NameEditDialog::SimpleName; |
969 | else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::FullName ) ) | 969 | else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::FullName ) ) |
970 | mFormattedNameType = NameEditDialog::FullName; | 970 | mFormattedNameType = NameEditDialog::FullName; |
971 | else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::ReverseName ) ) | 971 | else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::ReverseName ) ) |
972 | mFormattedNameType = NameEditDialog::ReverseName; | 972 | mFormattedNameType = NameEditDialog::ReverseName; |
973 | else | 973 | else |
974 | mFormattedNameType = NameEditDialog::CustomName; | 974 | mFormattedNameType = NameEditDialog::CustomName; |
975 | } | 975 | } |
976 | 976 | ||
977 | mFormattedNameLabel->setText( mAddressee.formattedName() ); | 977 | mFormattedNameLabel->setText( mAddressee.formattedName() ); |
978 | 978 | ||
979 | mRoleEdit->setText( mAddressee.role() ); | 979 | mRoleEdit->setText( mAddressee.role() ); |
980 | mOrgEdit->setText( mAddressee.organization() ); | 980 | mOrgEdit->setText( mAddressee.organization() ); |
981 | 981 | ||
982 | //US mURLEdit->setURL( mAddressee.url().url() ); | 982 | //US mURLEdit->setURL( mAddressee.url().url() ); |
983 | mURLEdit->setText( mAddressee.url().prettyURL() ); | 983 | mURLEdit->setText( mAddressee.url().prettyURL() ); |
984 | //US?? mURLEdit->home( false ); | 984 | //US?? mURLEdit->home( false ); |
985 | 985 | ||
986 | // mNoteEdit->setText( mAddressee.note() ); | 986 | // mNoteEdit->setText( mAddressee.note() ); |
987 | mNoteEdit->setText( mAddressee.note() ); | 987 | mNoteEdit->setText( mAddressee.note() ); |
988 | mEmailWidget->setEmails( mAddressee.emails() ); | 988 | mEmailWidget->setEmails( mAddressee.emails() ); |
989 | mPhoneEditWidget->setPhoneNumbers( mAddressee.phoneNumbers() ); | 989 | mPhoneEditWidget->setPhoneNumbers( mAddressee.phoneNumbers() ); |
990 | mAddressEditWidget->setAddresses( mAddressee, mAddressee.addresses() ); | 990 | mAddressEditWidget->setAddresses( mAddressee, mAddressee.addresses() ); |
991 | mBirthdayPicker->setDate( mAddressee.birthday().date() ); | 991 | mBirthdayPicker->setDate( mAddressee.birthday().date() ); |
992 | 992 | ||
993 | //US mAnniversaryPicker->setDate( QDate::fromString( mAddressee.custom( | 993 | //US mAnniversaryPicker->setDate( QDate::fromString( mAddressee.custom( |
994 | //US "KADDRESSBOOK", "X-Anniversary" ), Qt::ISODate) ); | 994 | //US "KADDRESSBOOK", "X-Anniversary" ), Qt::ISODate) ); |
995 | QDate dt = KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ), | 995 | QDate dt = KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ), |
996 | "%Y-%m-%d"); // = Qt::ISODate | 996 | "%Y-%m-%d"); // = Qt::ISODate |
997 | mAnniversaryPicker->setDate( dt ); | 997 | mAnniversaryPicker->setDate( dt ); |
998 | 998 | ||
999 | 999 | ||
1000 | mNicknameEdit->setText( mAddressee.nickName() ); | 1000 | mNicknameEdit->setText( mAddressee.nickName() ); |
1001 | mCategoryEdit->setText( mAddressee.categories().join( "," ) ); | 1001 | mCategoryEdit->setText( mAddressee.categories().join( "," ) ); |
1002 | 1002 | ||
1003 | mGeoWidget->setGeo( mAddressee.geo() ); | 1003 | mGeoWidget->setGeo( mAddressee.geo() ); |
1004 | mImageWidget->setPhoto( mAddressee.photo() ); | 1004 | mImageWidget->setPhoto( mAddressee.photo() ); |
1005 | mImageWidget->setLogo( mAddressee.logo() ); | 1005 | mImageWidget->setLogo( mAddressee.logo() ); |
1006 | mKeyWidget->setKeys( mAddressee.keys() ); | 1006 | mKeyWidget->setKeys( mAddressee.keys() ); |
1007 | mSecrecyWidget->setSecrecy( mAddressee.secrecy() ); | 1007 | mSecrecyWidget->setSecrecy( mAddressee.secrecy() ); |
1008 | #ifndef KAB_EMBEDDED | 1008 | #ifndef KAB_EMBEDDED |
1009 | mSoundWidget->setSound( mAddressee.sound() ); | 1009 | mSoundWidget->setSound( mAddressee.sound() ); |
1010 | #else //KAB_EMBEDDED | 1010 | #else //KAB_EMBEDDED |
1011 | //US qDebug("AddresseeEditorWidget::load has to be changed 2"); | 1011 | //US qDebug("AddresseeEditorWidget::load has to be changed 2"); |
1012 | #endif //KAB_EMBEDDED | 1012 | #endif //KAB_EMBEDDED |
1013 | 1013 | ||
1014 | // Load customs | 1014 | // Load customs |
1015 | mIMAddressEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-IMAddress" ) ); | 1015 | mIMAddressEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-IMAddress" ) ); |
1016 | mSpouseEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-SpousesName" ) ); | 1016 | mSpouseEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-SpousesName" ) ); |
1017 | mManagerEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-ManagersName" ) ); | 1017 | mManagerEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-ManagersName" ) ); |
1018 | mAssistantEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-AssistantsName" ) ); | 1018 | mAssistantEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-AssistantsName" ) ); |
1019 | mDepartmentEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Department" ) ); | 1019 | mDepartmentEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Department" ) ); |
1020 | mOfficeEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Office" ) ); | 1020 | mOfficeEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Office" ) ); |
1021 | mProfessionEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Profession" ) ); | 1021 | mProfessionEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Profession" ) ); |
1022 | 1022 | ||
1023 | blockSignals( block ); | 1023 | blockSignals( block ); |
1024 | mBlockSignals = false; | 1024 | mBlockSignals = false; |
1025 | 1025 | ||
1026 | mDirty = false; | 1026 | mDirty = false; |
1027 | } | 1027 | } |
1028 | 1028 | ||
1029 | void AddresseeEditorWidget::save() | 1029 | void AddresseeEditorWidget::save() |
1030 | { | 1030 | { |
1031 | if ( !mDirty ) return; | 1031 | if ( !mDirty ) return; |
1032 | 1032 | ||
1033 | mAddressee.setRole( mRoleEdit->text() ); | 1033 | mAddressee.setRole( mRoleEdit->text() ); |
1034 | mAddressee.setOrganization( mOrgEdit->text() ); | 1034 | mAddressee.setOrganization( mOrgEdit->text() ); |
1035 | mAddressee.setUrl( KURL( mURLEdit->text() ) ); | 1035 | mAddressee.setUrl( KURL( mURLEdit->text() ) ); |
1036 | mAddressee.setNote( mNoteEdit->text() ); | 1036 | mAddressee.setNote( mNoteEdit->text() ); |
1037 | if ( mBirthdayPicker->inputIsValid() ) | 1037 | if ( mBirthdayPicker->inputIsValid() ) |
1038 | mAddressee.setBirthday( QDateTime( mBirthdayPicker->date() ) ); | 1038 | mAddressee.setBirthday( QDateTime( mBirthdayPicker->date() ) ); |
1039 | else | 1039 | else |
1040 | mAddressee.setBirthday( QDateTime() ); | 1040 | mAddressee.setBirthday( QDateTime() ); |
1041 | 1041 | ||
1042 | mAddressee.setNickName( mNicknameEdit->text() ); | 1042 | mAddressee.setNickName( mNicknameEdit->text() ); |
1043 | mAddressee.setCategories( QStringList::split( ",", mCategoryEdit->text() ) ); | 1043 | mAddressee.setCategories( QStringList::split( ",", mCategoryEdit->text() ) ); |
1044 | 1044 | ||
1045 | mAddressee.setGeo( mGeoWidget->geo() ); | 1045 | mAddressee.setGeo( mGeoWidget->geo() ); |
1046 | mAddressee.setPhoto( mImageWidget->photo() ); | 1046 | mAddressee.setPhoto( mImageWidget->photo() ); |
1047 | mAddressee.setLogo( mImageWidget->logo() ); | 1047 | mAddressee.setLogo( mImageWidget->logo() ); |
1048 | mAddressee.setKeys( mKeyWidget->keys() ); | 1048 | mAddressee.setKeys( mKeyWidget->keys() ); |
1049 | #ifndef KAB_EMBEDDED | 1049 | #ifndef KAB_EMBEDDED |
1050 | mAddressee.setSound( mSoundWidget->sound() ); | 1050 | mAddressee.setSound( mSoundWidget->sound() ); |
1051 | #else //KAB_EMBEDDED | 1051 | #else //KAB_EMBEDDED |
1052 | //US qDebug("AddresseeEditorWidget::save sound not supported"); | 1052 | //US qDebug("AddresseeEditorWidget::save sound not supported"); |
1053 | #endif //KAB_EMBEDDED | 1053 | #endif //KAB_EMBEDDED |
1054 | mAddressee.setSecrecy( mSecrecyWidget->secrecy() ); | 1054 | mAddressee.setSecrecy( mSecrecyWidget->secrecy() ); |
1055 | 1055 | ||
1056 | // save custom fields | 1056 | // save custom fields |
1057 | mAddressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", mIMAddressEdit->text() ); | 1057 | mAddressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", mIMAddressEdit->text() ); |
1058 | mAddressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", mSpouseEdit->text() ); | 1058 | mAddressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", mSpouseEdit->text() ); |
1059 | mAddressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", mManagerEdit->text() ); | 1059 | mAddressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", mManagerEdit->text() ); |
1060 | mAddressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", mAssistantEdit->text() ); | 1060 | mAddressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", mAssistantEdit->text() ); |
1061 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Department", mDepartmentEdit->text() ); | 1061 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Department", mDepartmentEdit->text() ); |
1062 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Office", mOfficeEdit->text() ); | 1062 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Office", mOfficeEdit->text() ); |
1063 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Profession", mProfessionEdit->text() ); | 1063 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Profession", mProfessionEdit->text() ); |
1064 | if ( mAnniversaryPicker->inputIsValid() ) { | 1064 | if ( mAnniversaryPicker->inputIsValid() ) { |
1065 | 1065 | ||
1066 | //US mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", | 1066 | //US mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", |
1067 | //US mAnniversaryPicker->date().toString( Qt::ISODate ) ); | 1067 | //US mAnniversaryPicker->date().toString( Qt::ISODate ) ); |
1068 | int orgformat = KGlobal::locale()->getIntDateFormat(); | 1068 | QString dt = KGlobal::locale()->formatDate(mAnniversaryPicker->date(), true, KLocale::ISODate); |
1069 | QDate da = mAnniversaryPicker->date(); | ||
1070 | KGlobal::locale()->setIntDateFormat( 2 ); // = Qt::ISODate | ||
1071 | QString dt = KGlobal::locale()->formatDate(da, true); | ||
1072 | KGlobal::locale()->setIntDateFormat(orgformat ); | ||
1073 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); | 1069 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); |
1074 | } | 1070 | } |
1075 | else | 1071 | else |
1076 | mAddressee.removeCustom( "KADDRESSBOOK", "X-Anniversary" ); | 1072 | mAddressee.removeCustom( "KADDRESSBOOK", "X-Anniversary" ); |
1077 | 1073 | ||
1078 | // Save the email addresses | 1074 | // Save the email addresses |
1079 | QStringList emails = mAddressee.emails(); | 1075 | QStringList emails = mAddressee.emails(); |
1080 | QStringList::Iterator iter; | 1076 | QStringList::Iterator iter; |
1081 | for ( iter = emails.begin(); iter != emails.end(); ++iter ) | 1077 | for ( iter = emails.begin(); iter != emails.end(); ++iter ) |
1082 | mAddressee.removeEmail( *iter ); | 1078 | mAddressee.removeEmail( *iter ); |
1083 | 1079 | ||
1084 | emails = mEmailWidget->emails(); | 1080 | emails = mEmailWidget->emails(); |
1085 | bool first = true; | 1081 | bool first = true; |
1086 | for ( iter = emails.begin(); iter != emails.end(); ++iter ) { | 1082 | for ( iter = emails.begin(); iter != emails.end(); ++iter ) { |
1087 | mAddressee.insertEmail( *iter, first ); | 1083 | mAddressee.insertEmail( *iter, first ); |
1088 | first = false; | 1084 | first = false; |
1089 | } | 1085 | } |
1090 | 1086 | ||
1091 | // Save the phone numbers | 1087 | // Save the phone numbers |
1092 | KABC::PhoneNumber::List phoneNumbers; | 1088 | KABC::PhoneNumber::List phoneNumbers; |
1093 | KABC::PhoneNumber::List::Iterator phoneIter; | 1089 | KABC::PhoneNumber::List::Iterator phoneIter; |
1094 | phoneNumbers = mAddressee.phoneNumbers(); | 1090 | phoneNumbers = mAddressee.phoneNumbers(); |
1095 | for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end(); | 1091 | for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end(); |
1096 | ++phoneIter ) | 1092 | ++phoneIter ) |
1097 | mAddressee.removePhoneNumber( *phoneIter ); | 1093 | mAddressee.removePhoneNumber( *phoneIter ); |
1098 | 1094 | ||
1099 | phoneNumbers = mPhoneEditWidget->phoneNumbers(); | 1095 | phoneNumbers = mPhoneEditWidget->phoneNumbers(); |
1100 | for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end(); | 1096 | for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end(); |
1101 | ++phoneIter ) | 1097 | ++phoneIter ) |
1102 | mAddressee.insertPhoneNumber( *phoneIter ); | 1098 | mAddressee.insertPhoneNumber( *phoneIter ); |
1103 | 1099 | ||
1104 | // Save the addresses | 1100 | // Save the addresses |
1105 | KABC::Address::List addresses; | 1101 | KABC::Address::List addresses; |
1106 | KABC::Address::List::Iterator addressIter; | 1102 | KABC::Address::List::Iterator addressIter; |
1107 | addresses = mAddressee.addresses(); | 1103 | addresses = mAddressee.addresses(); |
1108 | for ( addressIter = addresses.begin(); addressIter != addresses.end(); | 1104 | for ( addressIter = addresses.begin(); addressIter != addresses.end(); |
1109 | ++addressIter ) | 1105 | ++addressIter ) |
1110 | mAddressee.removeAddress( *addressIter ); | 1106 | mAddressee.removeAddress( *addressIter ); |
1111 | 1107 | ||
1112 | addresses = mAddressEditWidget->addresses(); | 1108 | addresses = mAddressEditWidget->addresses(); |
1113 | for ( addressIter = addresses.begin(); addressIter != addresses.end(); | 1109 | for ( addressIter = addresses.begin(); addressIter != addresses.end(); |
1114 | ++addressIter ) | 1110 | ++addressIter ) |
1115 | mAddressee.insertAddress( *addressIter ); | 1111 | mAddressee.insertAddress( *addressIter ); |
1116 | mDirty = false; | 1112 | mDirty = false; |
1117 | } | 1113 | } |
1118 | 1114 | ||
1119 | bool AddresseeEditorWidget::dirty() | 1115 | bool AddresseeEditorWidget::dirty() |
1120 | { | 1116 | { |
1121 | return mDirty; | 1117 | return mDirty; |
1122 | } | 1118 | } |
1123 | 1119 | ||
1124 | void AddresseeEditorWidget::nameTextChanged( const QString &text ) | 1120 | void AddresseeEditorWidget::nameTextChanged( const QString &text ) |
1125 | { | 1121 | { |
1126 | // use the addressee class to parse the name for us | 1122 | // use the addressee class to parse the name for us |
1127 | mAConfig->setUid( mAddressee.uid() ); | 1123 | mAConfig->setUid( mAddressee.uid() ); |
1128 | if ( mAConfig->automaticNameParsing() ) { | 1124 | if ( mAConfig->automaticNameParsing() ) { |
1129 | if ( !mAddressee.formattedName().isEmpty() ) { | 1125 | if ( !mAddressee.formattedName().isEmpty() ) { |
1130 | QString fn = mAddressee.formattedName(); | 1126 | QString fn = mAddressee.formattedName(); |
1131 | mAddressee.setNameFromString( text ); | 1127 | mAddressee.setNameFromString( text ); |
1132 | mAddressee.setFormattedName( fn ); | 1128 | mAddressee.setFormattedName( fn ); |
1133 | } else { | 1129 | } else { |
1134 | // use extra addressee to avoid a formatted name assignment | 1130 | // use extra addressee to avoid a formatted name assignment |
1135 | Addressee addr; | 1131 | Addressee addr; |
1136 | addr.setNameFromString( text ); | 1132 | addr.setNameFromString( text ); |
1137 | mAddressee.setPrefix( addr.prefix() ); | 1133 | mAddressee.setPrefix( addr.prefix() ); |
1138 | mAddressee.setGivenName( addr.givenName() ); | 1134 | mAddressee.setGivenName( addr.givenName() ); |
1139 | mAddressee.setAdditionalName( addr.additionalName() ); | 1135 | mAddressee.setAdditionalName( addr.additionalName() ); |
1140 | mAddressee.setFamilyName( addr.familyName() ); | 1136 | mAddressee.setFamilyName( addr.familyName() ); |
1141 | mAddressee.setSuffix( addr.suffix() ); | 1137 | mAddressee.setSuffix( addr.suffix() ); |
1142 | } | 1138 | } |
1143 | } | 1139 | } |
1144 | 1140 | ||
1145 | nameBoxChanged(); | 1141 | nameBoxChanged(); |
1146 | 1142 | ||
1147 | emitModified(); | 1143 | emitModified(); |
1148 | } | 1144 | } |
1149 | 1145 | ||
1150 | void AddresseeEditorWidget::nameBoxChanged() | 1146 | void AddresseeEditorWidget::nameBoxChanged() |
1151 | { | 1147 | { |
1152 | KABC::Addressee addr; | 1148 | KABC::Addressee addr; |
1153 | mAConfig->setUid( mAddressee.uid() ); | 1149 | mAConfig->setUid( mAddressee.uid() ); |
1154 | if ( mAConfig->automaticNameParsing() ) { | 1150 | if ( mAConfig->automaticNameParsing() ) { |
1155 | addr.setNameFromString( mNameEdit->text() ); | 1151 | addr.setNameFromString( mNameEdit->text() ); |
1156 | mNameLabel->hide(); | 1152 | mNameLabel->hide(); |
1157 | mNameEdit->show(); | 1153 | mNameEdit->show(); |
1158 | } else { | 1154 | } else { |
1159 | addr = mAddressee; | 1155 | addr = mAddressee; |
1160 | mNameEdit->hide(); | 1156 | mNameEdit->hide(); |
1161 | mNameLabel->setText( mNameEdit->text() ); | 1157 | mNameLabel->setText( mNameEdit->text() ); |
1162 | mNameLabel->show(); | 1158 | mNameLabel->show(); |
1163 | } | 1159 | } |
1164 | 1160 | ||
1165 | if ( mFormattedNameType != NameEditDialog::CustomName ) { | 1161 | if ( mFormattedNameType != NameEditDialog::CustomName ) { |
1166 | mFormattedNameLabel->setText( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); | 1162 | mFormattedNameLabel->setText( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); |
1167 | mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); | 1163 | mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); |
1168 | } | 1164 | } |
1169 | } | 1165 | } |
1170 | 1166 | ||
1171 | void AddresseeEditorWidget::nameButtonClicked() | 1167 | void AddresseeEditorWidget::nameButtonClicked() |
1172 | { | 1168 | { |
1173 | // show the name dialog. | 1169 | // show the name dialog. |
1174 | NameEditDialog dialog( mAddressee, mFormattedNameType, this ); | 1170 | NameEditDialog dialog( mAddressee, mFormattedNameType, this ); |
1175 | 1171 | ||
1176 | if ( dialog.exec() ) { | 1172 | if ( dialog.exec() ) { |
1177 | if ( dialog.changed() ) { | 1173 | if ( dialog.changed() ) { |
1178 | mAddressee.setFamilyName( dialog.familyName() ); | 1174 | mAddressee.setFamilyName( dialog.familyName() ); |
1179 | mAddressee.setGivenName( dialog.givenName() ); | 1175 | mAddressee.setGivenName( dialog.givenName() ); |
1180 | mAddressee.setPrefix( dialog.prefix() ); | 1176 | mAddressee.setPrefix( dialog.prefix() ); |
1181 | mAddressee.setSuffix( dialog.suffix() ); | 1177 | mAddressee.setSuffix( dialog.suffix() ); |
1182 | mAddressee.setAdditionalName( dialog.additionalName() ); | 1178 | mAddressee.setAdditionalName( dialog.additionalName() ); |
1183 | mFormattedNameType = dialog.formattedNameType(); | 1179 | mFormattedNameType = dialog.formattedNameType(); |
1184 | if ( mFormattedNameType == NameEditDialog::CustomName ) { | 1180 | if ( mFormattedNameType == NameEditDialog::CustomName ) { |
1185 | mFormattedNameLabel->setText( dialog.customFormattedName() ); | 1181 | mFormattedNameLabel->setText( dialog.customFormattedName() ); |
1186 | mAddressee.setFormattedName( dialog.customFormattedName() ); | 1182 | mAddressee.setFormattedName( dialog.customFormattedName() ); |
1187 | } | 1183 | } |
1188 | // Update the name edit. | 1184 | // Update the name edit. |
1189 | bool block = mNameEdit->signalsBlocked(); | 1185 | bool block = mNameEdit->signalsBlocked(); |
1190 | mNameEdit->blockSignals( true ); | 1186 | mNameEdit->blockSignals( true ); |
1191 | mNameEdit->setText( mAddressee.assembledName() ); | 1187 | mNameEdit->setText( mAddressee.assembledName() ); |
1192 | mNameEdit->blockSignals( block ); | 1188 | mNameEdit->blockSignals( block ); |
1193 | 1189 | ||
1194 | // Update the combo box. | 1190 | // Update the combo box. |
1195 | nameBoxChanged(); | 1191 | nameBoxChanged(); |
1196 | 1192 | ||
1197 | emitModified(); | 1193 | emitModified(); |
1198 | } | 1194 | } |
1199 | } | 1195 | } |
1200 | } | 1196 | } |
1201 | 1197 | ||
1202 | void AddresseeEditorWidget::categoryButtonClicked() | 1198 | void AddresseeEditorWidget::categoryButtonClicked() |
1203 | { | 1199 | { |
1204 | // Show the category dialog | 1200 | // Show the category dialog |
1205 | if ( mCategoryDialog == 0 ) { | 1201 | if ( mCategoryDialog == 0 ) { |
1206 | mCategoryDialog = new KPIM::CategorySelectDialog( KABPrefs::instance(), this ); | 1202 | mCategoryDialog = new KPIM::CategorySelectDialog( KABPrefs::instance(), this ); |
1207 | connect( mCategoryDialog, SIGNAL( categoriesSelected( const QStringList& ) ), | 1203 | connect( mCategoryDialog, SIGNAL( categoriesSelected( const QStringList& ) ), |
1208 | SLOT(categoriesSelected( const QStringList& ) ) ); | 1204 | SLOT(categoriesSelected( const QStringList& ) ) ); |
1209 | connect( mCategoryDialog, SIGNAL( editCategories() ), SLOT( editCategories() ) ); | 1205 | connect( mCategoryDialog, SIGNAL( editCategories() ), SLOT( editCategories() ) ); |
1210 | } | 1206 | } |
1211 | 1207 | ||
1212 | mCategoryDialog->setCategories(); | 1208 | mCategoryDialog->setCategories(); |
1213 | mCategoryDialog->setSelected( QStringList::split( ",", mCategoryEdit->text() ) ); | 1209 | mCategoryDialog->setSelected( QStringList::split( ",", mCategoryEdit->text() ) ); |
1214 | mCategoryDialog->show(); | 1210 | mCategoryDialog->show(); |
1215 | mCategoryDialog->raise(); | 1211 | mCategoryDialog->raise(); |
1216 | } | 1212 | } |
1217 | 1213 | ||
1218 | void AddresseeEditorWidget::categoriesSelected( const QStringList &list ) | 1214 | void AddresseeEditorWidget::categoriesSelected( const QStringList &list ) |
1219 | { | 1215 | { |
1220 | mCategoryEdit->setText( list.join( "," ) ); | 1216 | mCategoryEdit->setText( list.join( "," ) ); |
1221 | } | 1217 | } |
1222 | 1218 | ||
1223 | void AddresseeEditorWidget::editCategories() | 1219 | void AddresseeEditorWidget::editCategories() |
1224 | { | 1220 | { |
1225 | if ( mCategoryEditDialog == 0 ) { | 1221 | if ( mCategoryEditDialog == 0 ) { |
1226 | mCategoryEditDialog = new KPIM::CategoryEditDialog( KABPrefs::instance(), this ); | 1222 | mCategoryEditDialog = new KPIM::CategoryEditDialog( KABPrefs::instance(), this ); |
1227 | connect( mCategoryEditDialog, SIGNAL( categoryConfigChanged() ), | 1223 | connect( mCategoryEditDialog, SIGNAL( categoryConfigChanged() ), |
1228 | SLOT( categoryButtonClicked() ) ); | 1224 | SLOT( categoryButtonClicked() ) ); |
1229 | } | 1225 | } |
1230 | 1226 | ||
1231 | mCategoryEditDialog->show(); | 1227 | mCategoryEditDialog->show(); |
1232 | mCategoryEditDialog->raise(); | 1228 | mCategoryEditDialog->raise(); |
1233 | } | 1229 | } |
1234 | 1230 | ||
1235 | void AddresseeEditorWidget::emitModified() | 1231 | void AddresseeEditorWidget::emitModified() |
1236 | { | 1232 | { |
1237 | mDirty = true; | 1233 | mDirty = true; |
1238 | 1234 | ||
1239 | KABC::Addressee::List list; | 1235 | KABC::Addressee::List list; |
1240 | 1236 | ||
1241 | if ( mIsExtension && !mBlockSignals ) { | 1237 | if ( mIsExtension && !mBlockSignals ) { |
1242 | save(); | 1238 | save(); |
1243 | list.append( mAddressee ); | 1239 | list.append( mAddressee ); |
1244 | } | 1240 | } |
1245 | 1241 | ||
1246 | emit modified( list ); | 1242 | emit modified( list ); |
1247 | } | 1243 | } |
1248 | 1244 | ||
1249 | void AddresseeEditorWidget::dateChanged( QDate ) | 1245 | void AddresseeEditorWidget::dateChanged( QDate ) |
1250 | { | 1246 | { |
1251 | emitModified(); | 1247 | emitModified(); |
1252 | } | 1248 | } |
1253 | 1249 | ||
1254 | //US invalid dates are handdled by the KDateEdit widget itself | 1250 | //US invalid dates are handdled by the KDateEdit widget itself |
1255 | void AddresseeEditorWidget::invalidDate() | 1251 | void AddresseeEditorWidget::invalidDate() |
1256 | { | 1252 | { |
1257 | KMessageBox::sorry( this, i18n( "You must specify a valid date" ) ); | 1253 | KMessageBox::sorry( this, i18n( "You must specify a valid date" ) ); |
1258 | } | 1254 | } |
1259 | 1255 | ||
1260 | 1256 | ||
1261 | void AddresseeEditorWidget::pageChanged( QWidget *wdg ) | 1257 | void AddresseeEditorWidget::pageChanged( QWidget *wdg ) |
1262 | { | 1258 | { |
1263 | #ifndef KAB_EMBEDDED | 1259 | #ifndef KAB_EMBEDDED |
1264 | if ( wdg ) | 1260 | if ( wdg ) |
1265 | KAcceleratorManager::manage( wdg ); | 1261 | KAcceleratorManager::manage( wdg ); |
1266 | #else //KAB_EMBEDDED | 1262 | #else //KAB_EMBEDDED |
1267 | //US | 1263 | //US |
1268 | #endif //KAB_EMBEDDED | 1264 | #endif //KAB_EMBEDDED |
1269 | 1265 | ||
1270 | } | 1266 | } |
1271 | 1267 | ||
1272 | QString AddresseeEditorWidget::title() const | 1268 | QString AddresseeEditorWidget::title() const |
1273 | { | 1269 | { |
1274 | return i18n( "Contact Editor" ); | 1270 | return i18n( "Contact Editor" ); |
1275 | } | 1271 | } |
1276 | 1272 | ||
1277 | QString AddresseeEditorWidget::identifier() const | 1273 | QString AddresseeEditorWidget::identifier() const |
1278 | { | 1274 | { |
1279 | return i18n( "contact_editor" ); | 1275 | return i18n( "contact_editor" ); |
1280 | } | 1276 | } |
1281 | 1277 | ||
1282 | #ifndef KAB_EMBEDDED | 1278 | #ifndef KAB_EMBEDDED |
1283 | #include "addresseeeditorwidget.moc" | 1279 | #include "addresseeeditorwidget.moc" |
1284 | #endif //KAB_EMBEDDED | 1280 | #endif //KAB_EMBEDDED |