-rw-r--r-- | kaddressbook/kabcore.cpp | 4 | ||||
-rw-r--r-- | kaddressbook/kaddressbook.pro | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 1667400..4303cab 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -1,343 +1,343 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressbook. | 2 | This file is part of KAddressbook. |
3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> |
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 "kabcore.h" | 24 | #include "kabcore.h" |
25 | 25 | ||
26 | #include <stdaddressbook.h> | 26 | #include <stdaddressbook.h> |
27 | #include <klocale.h> | 27 | #include <klocale.h> |
28 | 28 | ||
29 | #ifndef KAB_EMBEDDED | 29 | #ifndef KAB_EMBEDDED |
30 | #include <qclipboard.h> | 30 | #include <qclipboard.h> |
31 | #include <qdir.h> | 31 | #include <qdir.h> |
32 | #include <qfile.h> | 32 | #include <qfile.h> |
33 | #include <qapplicaton.h> | 33 | #include <qapplicaton.h> |
34 | #include <qlayout.h> | 34 | #include <qlayout.h> |
35 | #include <qregexp.h> | 35 | #include <qregexp.h> |
36 | #include <qvbox.h> | 36 | #include <qvbox.h> |
37 | #include <kabc/addresseelist.h> | 37 | #include <kabc/addresseelist.h> |
38 | #include <kabc/errorhandler.h> | 38 | #include <kabc/errorhandler.h> |
39 | #include <kabc/resource.h> | 39 | #include <kabc/resource.h> |
40 | #include <kabc/vcardconverter.h> | 40 | #include <kabc/vcardconverter.h> |
41 | #include <kapplication.h> | 41 | #include <kapplication.h> |
42 | #include <kactionclasses.h> | 42 | #include <kactionclasses.h> |
43 | #include <kcmultidialog.h> | 43 | #include <kcmultidialog.h> |
44 | #include <kdebug.h> | 44 | #include <kdebug.h> |
45 | #include <kdeversion.h> | 45 | #include <kdeversion.h> |
46 | #include <kkeydialog.h> | 46 | #include <kkeydialog.h> |
47 | #include <kmessagebox.h> | 47 | #include <kmessagebox.h> |
48 | #include <kprinter.h> | 48 | #include <kprinter.h> |
49 | #include <kprotocolinfo.h> | 49 | #include <kprotocolinfo.h> |
50 | #include <kresources/selectdialog.h> | 50 | #include <kresources/selectdialog.h> |
51 | #include <kstandarddirs.h> | 51 | #include <kstandarddirs.h> |
52 | #include <ktempfile.h> | 52 | #include <ktempfile.h> |
53 | #include <kxmlguiclient.h> | 53 | #include <kxmlguiclient.h> |
54 | #include <kaboutdata.h> | 54 | #include <kaboutdata.h> |
55 | #include <libkdepim/categoryselectdialog.h> | 55 | #include <libkdepim/categoryselectdialog.h> |
56 | 56 | ||
57 | #include "addresseeutil.h" | 57 | #include "addresseeutil.h" |
58 | #include "addresseeeditordialog.h" | 58 | #include "addresseeeditordialog.h" |
59 | #include "extensionmanager.h" | 59 | #include "extensionmanager.h" |
60 | #include "kstdaction.h" | 60 | #include "kstdaction.h" |
61 | #include "kaddressbookservice.h" | 61 | #include "kaddressbookservice.h" |
62 | #include "ldapsearchdialog.h" | 62 | #include "ldapsearchdialog.h" |
63 | #include "printing/printingwizard.h" | 63 | #include "printing/printingwizard.h" |
64 | #else // KAB_EMBEDDED | 64 | #else // KAB_EMBEDDED |
65 | 65 | ||
66 | #include <kapplication.h> | 66 | #include <kapplication.h> |
67 | #include "KDGanttMinimizeSplitter.h" | 67 | #include "KDGanttMinimizeSplitter.h" |
68 | #include "kaddressbookmain.h" | 68 | #include "kaddressbookmain.h" |
69 | #include "kactioncollection.h" | 69 | #include "kactioncollection.h" |
70 | #include <qapp.h> | 70 | #include <qapp.h> |
71 | #include <qmenubar.h> | 71 | #include <qmenubar.h> |
72 | //#include <qtoolbar.h> | 72 | //#include <qtoolbar.h> |
73 | #include <qmessagebox.h> | 73 | #include <qmessagebox.h> |
74 | #include <kdebug.h> | 74 | #include <kdebug.h> |
75 | #include <kiconloader.h> // needed for SmallIcon | 75 | #include <kiconloader.h> // needed for SmallIcon |
76 | #include <kresources/kcmkresources.h> | 76 | #include <kresources/kcmkresources.h> |
77 | #include <ktoolbar.h> | 77 | #include <ktoolbar.h> |
78 | 78 | ||
79 | 79 | ||
80 | //#include <qlabel.h> | 80 | //#include <qlabel.h> |
81 | 81 | ||
82 | 82 | ||
83 | #ifdef Q_WS_QWS | 83 | #ifndef DESKTOP_VERSION |
84 | #include <qtopia/services.h> | 84 | #include <qtopia/services.h> |
85 | #include <qtopia/qcopenvelope_qws.h> | 85 | #include <qtopia/qcopenvelope_qws.h> |
86 | #endif | ||
87 | #include <qpe/ir.h> | 86 | #include <qpe/ir.h> |
87 | #endif | ||
88 | 88 | ||
89 | #endif // KAB_EMBEDDED | 89 | #endif // KAB_EMBEDDED |
90 | #include "kcmconfigs/kcmkabconfig.h" | 90 | #include "kcmconfigs/kcmkabconfig.h" |
91 | #include "kcmconfigs/kcmkdepimconfig.h" | 91 | #include "kcmconfigs/kcmkdepimconfig.h" |
92 | 92 | ||
93 | 93 | ||
94 | #include <kresources/selectdialog.h> | 94 | #include <kresources/selectdialog.h> |
95 | #include <kmessagebox.h> | 95 | #include <kmessagebox.h> |
96 | 96 | ||
97 | #include <picture.h> | 97 | #include <picture.h> |
98 | #include <resource.h> | 98 | #include <resource.h> |
99 | 99 | ||
100 | //US#include <qsplitter.h> | 100 | //US#include <qsplitter.h> |
101 | #include <qmap.h> | 101 | #include <qmap.h> |
102 | #include <qdir.h> | 102 | #include <qdir.h> |
103 | #include <qfile.h> | 103 | #include <qfile.h> |
104 | #include <qvbox.h> | 104 | #include <qvbox.h> |
105 | #include <qlayout.h> | 105 | #include <qlayout.h> |
106 | #include <qclipboard.h> | 106 | #include <qclipboard.h> |
107 | #include <qtextstream.h> | 107 | #include <qtextstream.h> |
108 | 108 | ||
109 | #include <libkdepim/categoryselectdialog.h> | 109 | #include <libkdepim/categoryselectdialog.h> |
110 | #include <kabc/vcardconverter.h> | 110 | #include <kabc/vcardconverter.h> |
111 | 111 | ||
112 | 112 | ||
113 | #include "addresseeutil.h" | 113 | #include "addresseeutil.h" |
114 | #include "undocmds.h" | 114 | #include "undocmds.h" |
115 | #include "addresseeeditordialog.h" | 115 | #include "addresseeeditordialog.h" |
116 | #include "viewmanager.h" | 116 | #include "viewmanager.h" |
117 | #include "details/detailsviewcontainer.h" | 117 | #include "details/detailsviewcontainer.h" |
118 | #include "kabprefs.h" | 118 | #include "kabprefs.h" |
119 | #include "xxportmanager.h" | 119 | #include "xxportmanager.h" |
120 | #include "incsearchwidget.h" | 120 | #include "incsearchwidget.h" |
121 | #include "jumpbuttonbar.h" | 121 | #include "jumpbuttonbar.h" |
122 | #include "extensionmanager.h" | 122 | #include "extensionmanager.h" |
123 | #include "addresseeconfig.h" | 123 | #include "addresseeconfig.h" |
124 | #include <kcmultidialog.h> | 124 | #include <kcmultidialog.h> |
125 | 125 | ||
126 | #ifdef _WIN32_ | 126 | #ifdef _WIN32_ |
127 | 127 | ||
128 | #include "kaimportoldialog.h" | 128 | #include "kaimportoldialog.h" |
129 | #endif | 129 | #endif |
130 | 130 | ||
131 | bool pasteWithNewUid = true; | 131 | bool pasteWithNewUid = true; |
132 | 132 | ||
133 | #ifdef KAB_EMBEDDED | 133 | #ifdef KAB_EMBEDDED |
134 | KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) | 134 | KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) |
135 | : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), | 135 | : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), |
136 | mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ | 136 | mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ |
137 | mReadWrite( readWrite ), mModified( false ), mMainWindow(client) | 137 | mReadWrite( readWrite ), mModified( false ), mMainWindow(client) |
138 | #else //KAB_EMBEDDED | 138 | #else //KAB_EMBEDDED |
139 | KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) | 139 | KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) |
140 | : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), | 140 | : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), |
141 | mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), | 141 | mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), |
142 | mReadWrite( readWrite ), mModified( false ) | 142 | mReadWrite( readWrite ), mModified( false ) |
143 | #endif //KAB_EMBEDDED | 143 | #endif //KAB_EMBEDDED |
144 | { | 144 | { |
145 | 145 | ||
146 | mExtensionBarSplitter = 0; | 146 | mExtensionBarSplitter = 0; |
147 | mIsPart = !parent->inherits( "KAddressBookMain" ); | 147 | mIsPart = !parent->inherits( "KAddressBookMain" ); |
148 | 148 | ||
149 | mAddressBook = KABC::StdAddressBook::self(); | 149 | mAddressBook = KABC::StdAddressBook::self(); |
150 | KABC::StdAddressBook::setAutomaticSave( false ); | 150 | KABC::StdAddressBook::setAutomaticSave( false ); |
151 | 151 | ||
152 | #ifndef KAB_EMBEDDED | 152 | #ifndef KAB_EMBEDDED |
153 | mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); | 153 | mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); |
154 | #endif //KAB_EMBEDDED | 154 | #endif //KAB_EMBEDDED |
155 | 155 | ||
156 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), | 156 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), |
157 | SLOT( addressBookChanged() ) ); | 157 | SLOT( addressBookChanged() ) ); |
158 | 158 | ||
159 | mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, | 159 | mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, |
160 | "X-Department", "KADDRESSBOOK" ); | 160 | "X-Department", "KADDRESSBOOK" ); |
161 | mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, | 161 | mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, |
162 | "X-Profession", "KADDRESSBOOK" ); | 162 | "X-Profession", "KADDRESSBOOK" ); |
163 | mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, | 163 | mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, |
164 | "X-AssistantsName", "KADDRESSBOOK" ); | 164 | "X-AssistantsName", "KADDRESSBOOK" ); |
165 | mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, | 165 | mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, |
166 | "X-ManagersName", "KADDRESSBOOK" ); | 166 | "X-ManagersName", "KADDRESSBOOK" ); |
167 | mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, | 167 | mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, |
168 | "X-SpousesName", "KADDRESSBOOK" ); | 168 | "X-SpousesName", "KADDRESSBOOK" ); |
169 | mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, | 169 | mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, |
170 | "X-Office", "KADDRESSBOOK" ); | 170 | "X-Office", "KADDRESSBOOK" ); |
171 | mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, | 171 | mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, |
172 | "X-IMAddress", "KADDRESSBOOK" ); | 172 | "X-IMAddress", "KADDRESSBOOK" ); |
173 | mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, | 173 | mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, |
174 | "X-Anniversary", "KADDRESSBOOK" ); | 174 | "X-Anniversary", "KADDRESSBOOK" ); |
175 | 175 | ||
176 | //US added this field to become compatible with Opie/qtopia addressbook | 176 | //US added this field to become compatible with Opie/qtopia addressbook |
177 | // values can be "female" or "male" or "". An empty field represents undefined. | 177 | // values can be "female" or "male" or "". An empty field represents undefined. |
178 | mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, | 178 | mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, |
179 | "X-Gender", "KADDRESSBOOK" ); | 179 | "X-Gender", "KADDRESSBOOK" ); |
180 | mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, | 180 | mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, |
181 | "X-Children", "KADDRESSBOOK" ); | 181 | "X-Children", "KADDRESSBOOK" ); |
182 | mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, | 182 | mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, |
183 | "X-FreeBusyUrl", "KADDRESSBOOK" ); | 183 | "X-FreeBusyUrl", "KADDRESSBOOK" ); |
184 | 184 | ||
185 | initGUI(); | 185 | initGUI(); |
186 | 186 | ||
187 | mIncSearchWidget->setFocus(); | 187 | mIncSearchWidget->setFocus(); |
188 | 188 | ||
189 | 189 | ||
190 | connect( mViewManager, SIGNAL( selected( const QString& ) ), | 190 | connect( mViewManager, SIGNAL( selected( const QString& ) ), |
191 | SLOT( setContactSelected( const QString& ) ) ); | 191 | SLOT( setContactSelected( const QString& ) ) ); |
192 | connect( mViewManager, SIGNAL( executed( const QString& ) ), | 192 | connect( mViewManager, SIGNAL( executed( const QString& ) ), |
193 | SLOT( editContact( const QString& ) ) ); | 193 | SLOT( editContact( const QString& ) ) ); |
194 | connect( mViewManager, SIGNAL( deleteRequest( ) ), | 194 | connect( mViewManager, SIGNAL( deleteRequest( ) ), |
195 | SLOT( deleteContacts( ) ) ); | 195 | SLOT( deleteContacts( ) ) ); |
196 | connect( mViewManager, SIGNAL( modified() ), | 196 | connect( mViewManager, SIGNAL( modified() ), |
197 | SLOT( setModified() ) ); | 197 | SLOT( setModified() ) ); |
198 | 198 | ||
199 | connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); | 199 | connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); |
200 | 200 | ||
201 | connect( mXXPortManager, SIGNAL( modified() ), | 201 | connect( mXXPortManager, SIGNAL( modified() ), |
202 | SLOT( setModified() ) ); | 202 | SLOT( setModified() ) ); |
203 | 203 | ||
204 | connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), | 204 | connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), |
205 | SLOT( incrementalSearch( const QString& ) ) ); | 205 | SLOT( incrementalSearch( const QString& ) ) ); |
206 | connect( mIncSearchWidget, SIGNAL( fieldChanged() ), | 206 | connect( mIncSearchWidget, SIGNAL( fieldChanged() ), |
207 | mJumpButtonBar, SLOT( recreateButtons() ) ); | 207 | mJumpButtonBar, SLOT( recreateButtons() ) ); |
208 | 208 | ||
209 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), | 209 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), |
210 | SLOT( sendMail( const QString& ) ) ); | 210 | SLOT( sendMail( const QString& ) ) ); |
211 | 211 | ||
212 | #ifndef KAB_EMBEDDED | 212 | #ifndef KAB_EMBEDDED |
213 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), | 213 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), |
214 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); | 214 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); |
215 | 215 | ||
216 | connect( mDetails, SIGNAL( browse( const QString& ) ), | 216 | connect( mDetails, SIGNAL( browse( const QString& ) ), |
217 | SLOT( browse( const QString& ) ) ); | 217 | SLOT( browse( const QString& ) ) ); |
218 | 218 | ||
219 | mAddressBookService = new KAddressBookService( this ); | 219 | mAddressBookService = new KAddressBookService( this ); |
220 | 220 | ||
221 | #endif //KAB_EMBEDDED | 221 | #endif //KAB_EMBEDDED |
222 | mEditorDialog = 0; | 222 | mEditorDialog = 0; |
223 | createAddresseeEditorDialog( this ); | 223 | createAddresseeEditorDialog( this ); |
224 | setModified( false ); | 224 | setModified( false ); |
225 | } | 225 | } |
226 | 226 | ||
227 | KABCore::~KABCore() | 227 | KABCore::~KABCore() |
228 | { | 228 | { |
229 | // save(); | 229 | // save(); |
230 | //saveSettings(); | 230 | //saveSettings(); |
231 | //KABPrefs::instance()->writeConfig(); | 231 | //KABPrefs::instance()->writeConfig(); |
232 | delete AddresseeConfig::instance(); | 232 | delete AddresseeConfig::instance(); |
233 | mAddressBook = 0; | 233 | mAddressBook = 0; |
234 | KABC::StdAddressBook::close(); | 234 | KABC::StdAddressBook::close(); |
235 | } | 235 | } |
236 | 236 | ||
237 | void KABCore::restoreSettings() | 237 | void KABCore::restoreSettings() |
238 | { | 238 | { |
239 | bool state = KABPrefs::instance()->mJumpButtonBarVisible; | 239 | bool state = KABPrefs::instance()->mJumpButtonBarVisible; |
240 | 240 | ||
241 | mActionJumpBar->setChecked( state ); | 241 | mActionJumpBar->setChecked( state ); |
242 | setJumpButtonBarVisible( state ); | 242 | setJumpButtonBarVisible( state ); |
243 | 243 | ||
244 | state = KABPrefs::instance()->mDetailsPageVisible; | 244 | state = KABPrefs::instance()->mDetailsPageVisible; |
245 | 245 | ||
246 | mActionDetails->setChecked( state ); | 246 | mActionDetails->setChecked( state ); |
247 | setDetailsVisible( state ); | 247 | setDetailsVisible( state ); |
248 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; | 248 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; |
249 | if ( splitterSize.count() == 0 ) { | 249 | if ( splitterSize.count() == 0 ) { |
250 | splitterSize.append( width() / 2 ); | 250 | splitterSize.append( width() / 2 ); |
251 | splitterSize.append( width() / 2 ); | 251 | splitterSize.append( width() / 2 ); |
252 | } | 252 | } |
253 | mMiniSplitter->setSizes( splitterSize ); | 253 | mMiniSplitter->setSizes( splitterSize ); |
254 | if ( mExtensionBarSplitter ) { | 254 | if ( mExtensionBarSplitter ) { |
255 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 255 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; |
256 | if ( splitterSize.count() == 0 ) { | 256 | if ( splitterSize.count() == 0 ) { |
257 | splitterSize.append( width() / 2 ); | 257 | splitterSize.append( width() / 2 ); |
258 | splitterSize.append( width() / 2 ); | 258 | splitterSize.append( width() / 2 ); |
259 | } | 259 | } |
260 | mExtensionBarSplitter->setSizes( splitterSize ); | 260 | mExtensionBarSplitter->setSizes( splitterSize ); |
261 | 261 | ||
262 | } | 262 | } |
263 | #ifndef KAB_EMBEDDED | 263 | #ifndef KAB_EMBEDDED |
264 | QValueList<int> splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 264 | QValueList<int> splitterSize = KABPrefs::instance()->mExtensionsSplitter; |
265 | if ( splitterSize.count() == 0 ) { | 265 | if ( splitterSize.count() == 0 ) { |
266 | splitterSize.append( width() / 2 ); | 266 | splitterSize.append( width() / 2 ); |
267 | splitterSize.append( width() / 2 ); | 267 | splitterSize.append( width() / 2 ); |
268 | } | 268 | } |
269 | mExtensionBarSplitter->setSizes( splitterSize ); | 269 | mExtensionBarSplitter->setSizes( splitterSize ); |
270 | 270 | ||
271 | splitterSize = KABPrefs::instance()->mDetailsSplitter; | 271 | splitterSize = KABPrefs::instance()->mDetailsSplitter; |
272 | if ( splitterSize.count() == 0 ) { | 272 | if ( splitterSize.count() == 0 ) { |
273 | splitterSize.append( height() / 2 ); | 273 | splitterSize.append( height() / 2 ); |
274 | splitterSize.append( height() / 2 ); | 274 | splitterSize.append( height() / 2 ); |
275 | } | 275 | } |
276 | mDetailsSplitter->setSizes( splitterSize ); | 276 | mDetailsSplitter->setSizes( splitterSize ); |
277 | 277 | ||
278 | mExtensionManager->restoreSettings(); | 278 | mExtensionManager->restoreSettings(); |
279 | 279 | ||
280 | #endif //KAB_EMBEDDED | 280 | #endif //KAB_EMBEDDED |
281 | 281 | ||
282 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); | 282 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); |
283 | 283 | ||
284 | mViewManager->restoreSettings(); | 284 | mViewManager->restoreSettings(); |
285 | mExtensionManager->restoreSettings(); | 285 | mExtensionManager->restoreSettings(); |
286 | } | 286 | } |
287 | 287 | ||
288 | void KABCore::saveSettings() | 288 | void KABCore::saveSettings() |
289 | { | 289 | { |
290 | KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); | 290 | KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); |
291 | if ( mExtensionBarSplitter ) | 291 | if ( mExtensionBarSplitter ) |
292 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); | 292 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); |
293 | KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); | 293 | KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); |
294 | KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); | 294 | KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); |
295 | #ifndef KAB_EMBEDDED | 295 | #ifndef KAB_EMBEDDED |
296 | 296 | ||
297 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); | 297 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); |
298 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); | 298 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); |
299 | #endif //KAB_EMBEDDED | 299 | #endif //KAB_EMBEDDED |
300 | mExtensionManager->saveSettings(); | 300 | mExtensionManager->saveSettings(); |
301 | mViewManager->saveSettings(); | 301 | mViewManager->saveSettings(); |
302 | 302 | ||
303 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); | 303 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); |
304 | 304 | ||
305 | } | 305 | } |
306 | 306 | ||
307 | KABC::AddressBook *KABCore::addressBook() const | 307 | KABC::AddressBook *KABCore::addressBook() const |
308 | { | 308 | { |
309 | return mAddressBook; | 309 | return mAddressBook; |
310 | } | 310 | } |
311 | 311 | ||
312 | KConfig *KABCore::config() | 312 | KConfig *KABCore::config() |
313 | { | 313 | { |
314 | #ifndef KAB_EMBEDDED | 314 | #ifndef KAB_EMBEDDED |
315 | return KABPrefs::instance()->config(); | 315 | return KABPrefs::instance()->config(); |
316 | #else //KAB_EMBEDDED | 316 | #else //KAB_EMBEDDED |
317 | return KABPrefs::instance()->getConfig(); | 317 | return KABPrefs::instance()->getConfig(); |
318 | #endif //KAB_EMBEDDED | 318 | #endif //KAB_EMBEDDED |
319 | } | 319 | } |
320 | 320 | ||
321 | KActionCollection *KABCore::actionCollection() const | 321 | KActionCollection *KABCore::actionCollection() const |
322 | { | 322 | { |
323 | return mGUIClient->actionCollection(); | 323 | return mGUIClient->actionCollection(); |
324 | } | 324 | } |
325 | 325 | ||
326 | KABC::Field *KABCore::currentSearchField() const | 326 | KABC::Field *KABCore::currentSearchField() const |
327 | { | 327 | { |
328 | if (mIncSearchWidget) | 328 | if (mIncSearchWidget) |
329 | return mIncSearchWidget->currentField(); | 329 | return mIncSearchWidget->currentField(); |
330 | else | 330 | else |
331 | return 0; | 331 | return 0; |
332 | } | 332 | } |
333 | 333 | ||
334 | QStringList KABCore::selectedUIDs() const | 334 | QStringList KABCore::selectedUIDs() const |
335 | { | 335 | { |
336 | return mViewManager->selectedUids(); | 336 | return mViewManager->selectedUids(); |
337 | } | 337 | } |
338 | 338 | ||
339 | KABC::Resource *KABCore::requestResource( QWidget *parent ) | 339 | KABC::Resource *KABCore::requestResource( QWidget *parent ) |
340 | { | 340 | { |
341 | QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); | 341 | QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); |
342 | 342 | ||
343 | QPtrList<KRES::Resource> kresResources; | 343 | QPtrList<KRES::Resource> kresResources; |
diff --git a/kaddressbook/kaddressbook.pro b/kaddressbook/kaddressbook.pro index b57317f..fec2341 100644 --- a/kaddressbook/kaddressbook.pro +++ b/kaddressbook/kaddressbook.pro | |||
@@ -1,183 +1,186 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG = qt warn_on | 2 | CONFIG = qt warn_on |
3 | TARGET = kapi | 3 | TARGET = kapi |
4 | DESTDIR= ../bin | 4 | DESTDIR= ../bin |
5 | 5 | ||
6 | include( ../variables.pri ) | 6 | include( ../variables.pri ) |
7 | 7 | ||
8 | 8 | ||
9 | INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../ interfaces | 9 | INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../ interfaces |
10 | DEFINES += KAB_EMBEDDED KAB_NOSPLITTER DESKTOP_VERSION | 10 | DEFINES += KAB_EMBEDDED KAB_NOSPLITTER DESKTOP_VERSION |
11 | 11 | ||
12 | unix : { | 12 | unix : { |
13 | LIBS += ../bin/libmicrokdepim.so | 13 | LIBS += ../bin/libmicrokdepim.so |
14 | LIBS += ../bin/libmicrokde.so | 14 | LIBS += ../bin/libmicrokde.so |
15 | LIBS += ../bin/libmicrokabc.so | 15 | LIBS += ../bin/libmicrokabc.so |
16 | LIBS += ../bin/libmicrokcal.so | 16 | LIBS += ../bin/libmicrokcal.so |
17 | LIBS += ../bin/libmicrogammu.so | ||
18 | LIBS += -lbluetooth | ||
19 | LIBS += -lsdp | ||
17 | LIBS += -lldap | 20 | LIBS += -lldap |
18 | OBJECTS_DIR = obj/unix | 21 | OBJECTS_DIR = obj/unix |
19 | MOC_DIR = moc/unix | 22 | MOC_DIR = moc/unix |
20 | } | 23 | } |
21 | win32: { | 24 | win32: { |
22 | DEFINES += _WIN32_ | 25 | DEFINES += _WIN32_ |
23 | LIBS += ../bin/microkdepim.lib | 26 | LIBS += ../bin/microkdepim.lib |
24 | LIBS += ../bin/microkcal.lib | 27 | LIBS += ../bin/microkcal.lib |
25 | LIBS += ../bin/microkde.lib | 28 | LIBS += ../bin/microkde.lib |
26 | LIBS += ../bin/microkabc.lib | 29 | LIBS += ../bin/microkabc.lib |
27 | QMAKE_LINK += /NODEFAULTLIB:LIBC | 30 | QMAKE_LINK += /NODEFAULTLIB:LIBC |
28 | OBJECTS_DIR = obj/win | 31 | OBJECTS_DIR = obj/win |
29 | MOC_DIR = moc/win | 32 | MOC_DIR = moc/win |
30 | LIBS += mfc71u.lib | 33 | LIBS += mfc71u.lib |
31 | } | 34 | } |
32 | 35 | ||
33 | 36 | ||
34 | 37 | ||
35 | 38 | ||
36 | 39 | ||
37 | 40 | ||
38 | 41 | ||
39 | 42 | ||
40 | INTERFACES = \ | 43 | INTERFACES = \ |
41 | # filteredit_base.ui \ | 44 | # filteredit_base.ui \ |
42 | # kofilterview_base.ui \ | 45 | # kofilterview_base.ui \ |
43 | 46 | ||
44 | HEADERS = \ | 47 | HEADERS = \ |
45 | features/mergewidget.h \ | 48 | features/mergewidget.h \ |
46 | features/distributionlistwidget.h \ | 49 | features/distributionlistwidget.h \ |
47 | kcmconfigs/addresseewidget.h \ | 50 | kcmconfigs/addresseewidget.h \ |
48 | kcmconfigs/extensionconfigdialog.h \ | 51 | kcmconfigs/extensionconfigdialog.h \ |
49 | kcmconfigs/kcmkabconfig.h \ | 52 | kcmconfigs/kcmkabconfig.h \ |
50 | kcmconfigs/kabconfigwidget.h \ | 53 | kcmconfigs/kabconfigwidget.h \ |
51 | addresseeeditordialog.h \ | 54 | addresseeeditordialog.h \ |
52 | addresseeeditorwidget.h \ | 55 | addresseeeditorwidget.h \ |
53 | addresseditwidget.h \ | 56 | addresseditwidget.h \ |
54 | addresseeconfig.h \ | 57 | addresseeconfig.h \ |
55 | addresseeutil.h \ | 58 | addresseeutil.h \ |
56 | emaileditwidget.h \ | 59 | emaileditwidget.h \ |
57 | filtereditdialog.h \ | 60 | filtereditdialog.h \ |
58 | kaddressbookmain.h \ | 61 | kaddressbookmain.h \ |
59 | kabprefs.h \ | 62 | kabprefs.h \ |
60 | kabcore.h \ | 63 | kabcore.h \ |
61 | viewmanager.h \ | 64 | viewmanager.h \ |
62 | extensionmanager.h \ | 65 | extensionmanager.h \ |
63 | extensionwidget.h \ | 66 | extensionwidget.h \ |
64 | kaddressbookview.h \ | 67 | kaddressbookview.h \ |
65 | geowidget.h \ | 68 | geowidget.h \ |
66 | imagewidget.h \ | 69 | imagewidget.h \ |
67 | incsearchwidget.h \ | 70 | incsearchwidget.h \ |
68 | jumpbuttonbar.h \ | 71 | jumpbuttonbar.h \ |
69 | phoneeditwidget.h \ | 72 | phoneeditwidget.h \ |
70 | secrecywidget.h \ | 73 | secrecywidget.h \ |
71 | keywidget.h \ | 74 | keywidget.h \ |
72 | nameeditdialog.h \ | 75 | nameeditdialog.h \ |
73 | filter.h \ | 76 | filter.h \ |
74 | addviewdialog.h \ | 77 | addviewdialog.h \ |
75 | configurewidget.h \ | 78 | configurewidget.h \ |
76 | viewconfigurewidget.h \ | 79 | viewconfigurewidget.h \ |
77 | viewconfigurefieldspage.h \ | 80 | viewconfigurefieldspage.h \ |
78 | viewconfigurefilterpage.h \ | 81 | viewconfigurefilterpage.h \ |
79 | typecombo.h \ | 82 | typecombo.h \ |
80 | undo.h \ | 83 | undo.h \ |
81 | undocmds.h \ | 84 | undocmds.h \ |
82 | xxportmanager.h \ | 85 | xxportmanager.h \ |
83 | xxportobject.h \ | 86 | xxportobject.h \ |
84 | xxportselectdialog.h \ | 87 | xxportselectdialog.h \ |
85 | details/detailsviewcontainer.h \ | 88 | details/detailsviewcontainer.h \ |
86 | details/look_basic.h \ | 89 | details/look_basic.h \ |
87 | details/look_html.h \ | 90 | details/look_html.h \ |
88 | views/kaddressbookiconview.h \ | 91 | views/kaddressbookiconview.h \ |
89 | views/kaddressbooktableview.h \ | 92 | views/kaddressbooktableview.h \ |
90 | views/kaddressbookcardview.h \ | 93 | views/kaddressbookcardview.h \ |
91 | views/configuretableviewdialog.h \ | 94 | views/configuretableviewdialog.h \ |
92 | views/configurecardviewdialog.h \ | 95 | views/configurecardviewdialog.h \ |
93 | views/cardview.h \ | 96 | views/cardview.h \ |
94 | views/colorlistbox.h \ | 97 | views/colorlistbox.h \ |
95 | views/contactlistview.h \ | 98 | views/contactlistview.h \ |
96 | xxport/vcard_xxport.h \ | 99 | xxport/vcard_xxport.h \ |
97 | xxport/kde2_xxport.h \ | 100 | xxport/kde2_xxport.h \ |
98 | xxport/csv_xxport.h \ | 101 | xxport/csv_xxport.h \ |
99 | xxport/csvimportdialog.h \ | 102 | xxport/csvimportdialog.h \ |
100 | xxport/opie_xxport.h \ | 103 | xxport/opie_xxport.h \ |
101 | xxport/qtopia_xxport.h \ | 104 | xxport/qtopia_xxport.h \ |
102 | xxport/sharpdtm_xxport.h \ | 105 | xxport/sharpdtm_xxport.h \ |
103 | #details/look_details.h \ | 106 | #details/look_details.h \ |
104 | #mainwindoiw.h \ | 107 | #mainwindoiw.h \ |
105 | # alarmclient.h \ | 108 | # alarmclient.h \ |
106 | # calendarview.h \ | 109 | # calendarview.h \ |
107 | # customlistviewitem.h \ | 110 | # customlistviewitem.h \ |
108 | # datenavigator.h | 111 | # datenavigator.h |
109 | 112 | ||
110 | SOURCES = \ | 113 | SOURCES = \ |
111 | addresseeeditordialog.cpp \ | 114 | addresseeeditordialog.cpp \ |
112 | addresseeeditorwidget.cpp \ | 115 | addresseeeditorwidget.cpp \ |
113 | addresseditwidget.cpp \ | 116 | addresseditwidget.cpp \ |
114 | addresseeconfig.cpp \ | 117 | addresseeconfig.cpp \ |
115 | addresseeutil.cpp \ | 118 | addresseeutil.cpp \ |
116 | extensionmanager.cpp \ | 119 | extensionmanager.cpp \ |
117 | features/mergewidget.cpp \ | 120 | features/mergewidget.cpp \ |
118 | features/distributionlistwidget.cpp \ | 121 | features/distributionlistwidget.cpp \ |
119 | kcmconfigs/addresseewidget.cpp \ | 122 | kcmconfigs/addresseewidget.cpp \ |
120 | kcmconfigs/extensionconfigdialog.cpp \ | 123 | kcmconfigs/extensionconfigdialog.cpp \ |
121 | kcmconfigs/kcmkabconfig.cpp \ | 124 | kcmconfigs/kcmkabconfig.cpp \ |
122 | kcmconfigs/kabconfigwidget.cpp \ | 125 | kcmconfigs/kabconfigwidget.cpp \ |
123 | emaileditwidget.cpp \ | 126 | emaileditwidget.cpp \ |
124 | filtereditdialog.cpp \ | 127 | filtereditdialog.cpp \ |
125 | mainembedded.cpp \ | 128 | mainembedded.cpp \ |
126 | kaddressbookmain.cpp \ | 129 | kaddressbookmain.cpp \ |
127 | kabcore.cpp \ | 130 | kabcore.cpp \ |
128 | kabprefs.cpp \ | 131 | kabprefs.cpp \ |
129 | viewmanager.cpp \ | 132 | viewmanager.cpp \ |
130 | kaddressbookview.cpp \ | 133 | kaddressbookview.cpp \ |
131 | extensionwidget.cpp \ | 134 | extensionwidget.cpp \ |
132 | geowidget.cpp \ | 135 | geowidget.cpp \ |
133 | imagewidget.cpp \ | 136 | imagewidget.cpp \ |
134 | incsearchwidget.cpp \ | 137 | incsearchwidget.cpp \ |
135 | jumpbuttonbar.cpp \ | 138 | jumpbuttonbar.cpp \ |
136 | phoneeditwidget.cpp \ | 139 | phoneeditwidget.cpp \ |
137 | secrecywidget.cpp \ | 140 | secrecywidget.cpp \ |
138 | keywidget.cpp \ | 141 | keywidget.cpp \ |
139 | nameeditdialog.cpp \ | 142 | nameeditdialog.cpp \ |
140 | filter.cpp \ | 143 | filter.cpp \ |
141 | addviewdialog.cpp \ | 144 | addviewdialog.cpp \ |
142 | configurewidget.cpp \ | 145 | configurewidget.cpp \ |
143 | viewconfigurewidget.cpp \ | 146 | viewconfigurewidget.cpp \ |
144 | viewconfigurefieldspage.cpp \ | 147 | viewconfigurefieldspage.cpp \ |
145 | viewconfigurefilterpage.cpp \ | 148 | viewconfigurefilterpage.cpp \ |
146 | undo.cpp \ | 149 | undo.cpp \ |
147 | undocmds.cpp \ | 150 | undocmds.cpp \ |
148 | xxportmanager.cpp \ | 151 | xxportmanager.cpp \ |
149 | xxportobject.cpp \ | 152 | xxportobject.cpp \ |
150 | xxportselectdialog.cpp \ | 153 | xxportselectdialog.cpp \ |
151 | details/detailsviewcontainer.cpp \ | 154 | details/detailsviewcontainer.cpp \ |
152 | details/look_basic.cpp \ | 155 | details/look_basic.cpp \ |
153 | details/look_html.cpp \ | 156 | details/look_html.cpp \ |
154 | views/kaddressbookiconview.cpp \ | 157 | views/kaddressbookiconview.cpp \ |
155 | views/kaddressbooktableview.cpp \ | 158 | views/kaddressbooktableview.cpp \ |
156 | views/kaddressbookcardview.cpp \ | 159 | views/kaddressbookcardview.cpp \ |
157 | views/configuretableviewdialog.cpp \ | 160 | views/configuretableviewdialog.cpp \ |
158 | views/configurecardviewdialog.cpp \ | 161 | views/configurecardviewdialog.cpp \ |
159 | views/cardview.cpp \ | 162 | views/cardview.cpp \ |
160 | views/contactlistview.cpp \ | 163 | views/contactlistview.cpp \ |
161 | views/colorlistbox.cpp \ | 164 | views/colorlistbox.cpp \ |
162 | xxport/vcard_xxport.cpp \ | 165 | xxport/vcard_xxport.cpp \ |
163 | xxport/kde2_xxport.cpp \ | 166 | xxport/kde2_xxport.cpp \ |
164 | xxport/csv_xxport.cpp \ | 167 | xxport/csv_xxport.cpp \ |
165 | xxport/csvimportdialog.cpp \ | 168 | xxport/csvimportdialog.cpp \ |
166 | xxport/opie_xxport.cpp \ | 169 | xxport/opie_xxport.cpp \ |
167 | xxport/qtopia_xxport.cpp \ | 170 | xxport/qtopia_xxport.cpp \ |
168 | xxport/sharpdtm_xxport.cpp \ | 171 | xxport/sharpdtm_xxport.cpp \ |
169 | #details/look_details.cpp \ | 172 | #details/look_details.cpp \ |
170 | #mainwindow.cpp \ | 173 | #mainwindow.cpp \ |
171 | # calendarview.cpp \ | 174 | # calendarview.cpp \ |
172 | # timespanview.cpp | 175 | # timespanview.cpp |
173 | 176 | ||
174 | 177 | ||
175 | 178 | ||
176 | win32: { | 179 | win32: { |
177 | HEADERS += ../outport/msoutl9.h \ | 180 | HEADERS += ../outport/msoutl9.h \ |
178 | kaimportoldialog.h | 181 | kaimportoldialog.h |
179 | 182 | ||
180 | SOURCES += ../outport/msoutl9.cpp \ | 183 | SOURCES += ../outport/msoutl9.cpp \ |
181 | kaimportoldialog.cpp | 184 | kaimportoldialog.cpp |
182 | } | 185 | } |
183 | 186 | ||