-rw-r--r-- | kaddressbook/addresseeeditorwidget.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp index dbbf7fe..50b6b6d 100644 --- a/kaddressbook/addresseeeditorwidget.cpp +++ b/kaddressbook/addresseeeditorwidget.cpp | |||
@@ -1,158 +1,159 @@ | |||
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 | #include <qapplication.h> | ||
31 | 32 | ||
32 | #ifndef KAB_EMBEDDED | 33 | #ifndef KAB_EMBEDDED |
33 | #include <qtextedit.h> | 34 | #include <qtextedit.h> |
34 | 35 | ||
35 | #include <kaccelmanager.h> | 36 | #include <kaccelmanager.h> |
36 | #include "keywidget.h" | 37 | #include "keywidget.h" |
37 | #include "soundwidget.h" | 38 | #include "soundwidget.h" |
38 | 39 | ||
39 | #else //KAB_EMBEDDED | 40 | #else //KAB_EMBEDDED |
40 | #include <qmultilineedit.h> | 41 | #include <qmultilineedit.h> |
41 | #endif //KAB_EMBEDDED | 42 | #endif //KAB_EMBEDDED |
42 | 43 | ||
43 | 44 | ||
44 | #include "keywidget.h" | 45 | #include "keywidget.h" |
45 | #include "geowidget.h" | 46 | #include "geowidget.h" |
46 | #include "imagewidget.h" | 47 | #include "imagewidget.h" |
47 | #include "nameeditdialog.h" | 48 | #include "nameeditdialog.h" |
48 | #include "phoneeditwidget.h" | 49 | #include "phoneeditwidget.h" |
49 | #include "secrecywidget.h" | 50 | #include "secrecywidget.h" |
50 | 51 | ||
51 | 52 | ||
52 | #include <qtoolbutton.h> | 53 | #include <qtoolbutton.h> |
53 | #include <qtooltip.h> | 54 | #include <qtooltip.h> |
54 | 55 | ||
55 | #include <kapplication.h> | 56 | #include <kapplication.h> |
56 | #include <kconfig.h> | 57 | #include <kconfig.h> |
57 | #include <kcombobox.h> | 58 | #include <kcombobox.h> |
58 | #include <kdebug.h> | 59 | #include <kdebug.h> |
59 | #include <kdialogbase.h> | 60 | #include <kdialogbase.h> |
60 | #include <kglobal.h> | 61 | #include <kglobal.h> |
61 | #include <kiconloader.h> | 62 | #include <kiconloader.h> |
62 | #include <klineedit.h> | 63 | #include <klineedit.h> |
63 | #include <klocale.h> | 64 | #include <klocale.h> |
64 | #include <kmessagebox.h> | 65 | #include <kmessagebox.h> |
65 | #include <kseparator.h> | 66 | #include <kseparator.h> |
66 | #include <ksqueezedtextlabel.h> | 67 | #include <ksqueezedtextlabel.h> |
67 | 68 | ||
68 | #include <libkdepim/categoryeditdialog.h> | 69 | #include <libkdepim/categoryeditdialog.h> |
69 | #include <libkdepim/categoryselectdialog.h> | 70 | #include <libkdepim/categoryselectdialog.h> |
70 | 71 | ||
71 | #include <libkdepim/kdateedit.h> | 72 | #include <libkdepim/kdateedit.h> |
72 | 73 | ||
73 | #include "addresseditwidget.h" | 74 | #include "addresseditwidget.h" |
74 | #include "emaileditwidget.h" | 75 | #include "emaileditwidget.h" |
75 | #include "kabcore.h" | 76 | #include "kabcore.h" |
76 | #include "kabprefs.h" | 77 | #include "kabprefs.h" |
77 | 78 | ||
78 | #include "addresseeeditorwidget.h" | 79 | #include "addresseeeditorwidget.h" |
79 | 80 | ||
80 | 81 | ||
81 | 82 | ||
82 | AddresseeEditorWidget::AddresseeEditorWidget( KABCore *core, bool isExtension, | 83 | AddresseeEditorWidget::AddresseeEditorWidget( KABCore *core, bool isExtension, |
83 | QWidget *parent, const char *name ) | 84 | QWidget *parent, const char *name ) |
84 | : ExtensionWidget( core, parent, name ), mIsExtension( isExtension ), | 85 | : ExtensionWidget( core, parent, name ), mIsExtension( isExtension ), |
85 | mBlockSignals( false ) | 86 | mBlockSignals( false ) |
86 | { | 87 | { |
87 | 88 | ||
88 | mAConfig = AddresseeConfig::instance(); | 89 | mAConfig = AddresseeConfig::instance(); |
89 | 90 | ||
90 | mFormattedNameType = NameEditDialog::CustomName; | 91 | mFormattedNameType = NameEditDialog::CustomName; |
91 | initGUI(); | 92 | initGUI(); |
92 | mCategoryDialog = 0; | 93 | mCategoryDialog = 0; |
93 | mCategoryEditDialog = 0; | 94 | mCategoryEditDialog = 0; |
94 | 95 | ||
95 | // Load the empty addressee as defaults | 96 | // Load the empty addressee as defaults |
96 | load(); | 97 | load(); |
97 | 98 | ||
98 | mDirty = false; | 99 | mDirty = false; |
99 | } | 100 | } |
100 | 101 | ||
101 | AddresseeEditorWidget::~AddresseeEditorWidget() | 102 | AddresseeEditorWidget::~AddresseeEditorWidget() |
102 | { | 103 | { |
103 | kdDebug(5720) << "~AddresseeEditorWidget()" << endl; | 104 | kdDebug(5720) << "~AddresseeEditorWidget()" << endl; |
104 | } | 105 | } |
105 | 106 | ||
106 | void AddresseeEditorWidget::contactsSelectionChanged() | 107 | void AddresseeEditorWidget::contactsSelectionChanged() |
107 | { | 108 | { |
108 | KABC::Addressee::List list = selectedContacts(); | 109 | KABC::Addressee::List list = selectedContacts(); |
109 | 110 | ||
110 | mAddressee = list[ 0 ]; | 111 | mAddressee = list[ 0 ]; |
111 | load(); | 112 | load(); |
112 | } | 113 | } |
113 | 114 | ||
114 | void AddresseeEditorWidget::setAddressee( const KABC::Addressee &addr ) | 115 | void AddresseeEditorWidget::setAddressee( const KABC::Addressee &addr ) |
115 | { | 116 | { |
116 | mAddressee = addr; | 117 | mAddressee = addr; |
117 | load(); | 118 | load(); |
118 | } | 119 | } |
119 | 120 | ||
120 | const KABC::Addressee &AddresseeEditorWidget::addressee() | 121 | const KABC::Addressee &AddresseeEditorWidget::addressee() |
121 | { | 122 | { |
122 | return mAddressee; | 123 | return mAddressee; |
123 | } | 124 | } |
124 | 125 | ||
125 | void AddresseeEditorWidget::textChanged( const QString& ) | 126 | void AddresseeEditorWidget::textChanged( const QString& ) |
126 | { | 127 | { |
127 | emitModified(); | 128 | emitModified(); |
128 | } | 129 | } |
129 | 130 | ||
130 | void AddresseeEditorWidget::initGUI() | 131 | void AddresseeEditorWidget::initGUI() |
131 | { | 132 | { |
132 | QVBoxLayout *layout = new QVBoxLayout( this ); | 133 | QVBoxLayout *layout = new QVBoxLayout( this ); |
133 | 134 | ||
134 | mTabWidget = new QTabWidget( this ); | 135 | mTabWidget = new QTabWidget( this ); |
135 | layout->addWidget( mTabWidget ); | 136 | layout->addWidget( mTabWidget ); |
136 | 137 | ||
137 | setupTab1(); | 138 | setupTab1(); |
138 | setupTab1_1(); | 139 | setupTab1_1(); |
139 | setupTab2(); | 140 | setupTab2(); |
140 | setupTab2_1(); | 141 | setupTab2_1(); |
141 | setupTab3(); | 142 | setupTab3(); |
142 | setupTab3_1(); | 143 | setupTab3_1(); |
143 | 144 | ||
144 | mNameEdit->setFocus(); | 145 | mNameEdit->setFocus(); |
145 | 146 | ||
146 | connect( mTabWidget, SIGNAL( currentChanged(QWidget*) ), | 147 | connect( mTabWidget, SIGNAL( currentChanged(QWidget*) ), |
147 | SLOT( pageChanged(QWidget*) ) ); | 148 | SLOT( pageChanged(QWidget*) ) ); |
148 | } | 149 | } |
149 | 150 | ||
150 | void AddresseeEditorWidget::setupTab1() | 151 | void AddresseeEditorWidget::setupTab1() |
151 | { | 152 | { |
152 | // This is the General tab | 153 | // This is the General tab |
153 | QWidget *tab1 = new QWidget( mTabWidget ); | 154 | QWidget *tab1 = new QWidget( mTabWidget ); |
154 | 155 | ||
155 | //US QGridLayout *layout = new QGridLayout( tab1, 11, 7 ); | 156 | //US QGridLayout *layout = new QGridLayout( tab1, 11, 7 ); |
156 | QGridLayout *layout = new QGridLayout( tab1, 7, 1 ); | 157 | QGridLayout *layout = new QGridLayout( tab1, 7, 1 ); |
157 | layout->setMargin( KDialogBase::marginHintSmall() ); | 158 | layout->setMargin( KDialogBase::marginHintSmall() ); |
158 | layout->setSpacing( KDialogBase::spacingHintSmall() ); | 159 | layout->setSpacing( KDialogBase::spacingHintSmall() ); |