author | zautrix <zautrix> | 2005-01-26 01:50:23 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-26 01:50:23 (UTC) |
commit | 76b0e73d8752448058e2fa3ad065f0219b9ffad8 (patch) (unidiff) | |
tree | 5bd4ecf8e2f101ac3fe4eeb5a140869b5d6caee8 /kaddressbook | |
parent | ab91893abef351f53275248a50032a6d5175132a (diff) | |
download | kdepimpi-76b0e73d8752448058e2fa3ad065f0219b9ffad8.zip kdepimpi-76b0e73d8752448058e2fa3ad065f0219b9ffad8.tar.gz kdepimpi-76b0e73d8752448058e2fa3ad065f0219b9ffad8.tar.bz2 |
fixes
-rw-r--r-- | kaddressbook/kabcore.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index ae0a068..e34a7d3 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -218,386 +218,386 @@ class KABFormatPrefs : public QDialog | |||
218 | reverse = new QRadioButton(i18n("Reverse: Bond, James"), format ); | 218 | reverse = new QRadioButton(i18n("Reverse: Bond, James"), format ); |
219 | company = new QRadioButton(i18n("Organization: MI6"), format ); | 219 | company = new QRadioButton(i18n("Organization: MI6"), format ); |
220 | simple->setChecked( true ); | 220 | simple->setChecked( true ); |
221 | setCompany = new QCheckBox(i18n("Set formatted name to\norganization, if name empty"), this); | 221 | setCompany = new QCheckBox(i18n("Set formatted name to\norganization, if name empty"), this); |
222 | lay->addWidget( setCompany ); | 222 | lay->addWidget( setCompany ); |
223 | QPushButton * ok = new QPushButton( i18n("Select contact list"), this ); | 223 | QPushButton * ok = new QPushButton( i18n("Select contact list"), this ); |
224 | lay->addWidget( ok ); | 224 | lay->addWidget( ok ); |
225 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 225 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
226 | lay->addWidget( cancel ); | 226 | lay->addWidget( cancel ); |
227 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 227 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
228 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 228 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
229 | //resize( 200, 200 ); | 229 | //resize( 200, 200 ); |
230 | 230 | ||
231 | } | 231 | } |
232 | public: | 232 | public: |
233 | QRadioButton* simple, *full, *reverse, *company; | 233 | QRadioButton* simple, *full, *reverse, *company; |
234 | QCheckBox* setCompany; | 234 | QCheckBox* setCompany; |
235 | }; | 235 | }; |
236 | 236 | ||
237 | 237 | ||
238 | 238 | ||
239 | class KAex2phonePrefs : public QDialog | 239 | class KAex2phonePrefs : public QDialog |
240 | { | 240 | { |
241 | public: | 241 | public: |
242 | KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) : | 242 | KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) : |
243 | QDialog( parent, name, true ) | 243 | QDialog( parent, name, true ) |
244 | { | 244 | { |
245 | setCaption( i18n("Export to phone options") ); | 245 | setCaption( i18n("Export to phone options") ); |
246 | QVBoxLayout* lay = new QVBoxLayout( this ); | 246 | QVBoxLayout* lay = new QVBoxLayout( this ); |
247 | lay->setSpacing( 3 ); | 247 | lay->setSpacing( 3 ); |
248 | lay->setMargin( 3 ); | 248 | lay->setMargin( 3 ); |
249 | QLabel *lab; | 249 | QLabel *lab; |
250 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); | 250 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); |
251 | lab->setAlignment (AlignHCenter ); | 251 | lab->setAlignment (AlignHCenter ); |
252 | QHBox* temphb; | 252 | QHBox* temphb; |
253 | temphb = new QHBox( this ); | 253 | temphb = new QHBox( this ); |
254 | new QLabel( i18n("I/O device: "), temphb ); | 254 | new QLabel( i18n("I/O device: "), temphb ); |
255 | mPhoneDevice = new QLineEdit( temphb); | 255 | mPhoneDevice = new QLineEdit( temphb); |
256 | lay->addWidget( temphb ); | 256 | lay->addWidget( temphb ); |
257 | temphb = new QHBox( this ); | 257 | temphb = new QHBox( this ); |
258 | new QLabel( i18n("Connection: "), temphb ); | 258 | new QLabel( i18n("Connection: "), temphb ); |
259 | mPhoneConnection = new QLineEdit( temphb); | 259 | mPhoneConnection = new QLineEdit( temphb); |
260 | lay->addWidget( temphb ); | 260 | lay->addWidget( temphb ); |
261 | temphb = new QHBox( this ); | 261 | temphb = new QHBox( this ); |
262 | new QLabel( i18n("Model(opt.): "), temphb ); | 262 | new QLabel( i18n("Model(opt.): "), temphb ); |
263 | mPhoneModel = new QLineEdit( temphb); | 263 | mPhoneModel = new QLineEdit( temphb); |
264 | lay->addWidget( temphb ); | 264 | lay->addWidget( temphb ); |
265 | // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this ); | 265 | // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this ); |
266 | // lay->addWidget( mWriteToSim ); | 266 | // lay->addWidget( mWriteToSim ); |
267 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) ); | 267 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) ); |
268 | lab->setAlignment (AlignHCenter); | 268 | lab->setAlignment (AlignHCenter); |
269 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); | 269 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); |
270 | lay->addWidget( ok ); | 270 | lay->addWidget( ok ); |
271 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 271 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
272 | lay->addWidget( cancel ); | 272 | lay->addWidget( cancel ); |
273 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 273 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
274 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 274 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
275 | resize( 220, 240 ); | 275 | resize( 220, 240 ); |
276 | 276 | ||
277 | } | 277 | } |
278 | 278 | ||
279 | public: | 279 | public: |
280 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; | 280 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; |
281 | QCheckBox* mWriteToSim; | 281 | QCheckBox* mWriteToSim; |
282 | }; | 282 | }; |
283 | 283 | ||
284 | 284 | ||
285 | bool pasteWithNewUid = true; | 285 | bool pasteWithNewUid = true; |
286 | 286 | ||
287 | #ifdef KAB_EMBEDDED | 287 | #ifdef KAB_EMBEDDED |
288 | KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) | 288 | KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) |
289 | : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), | 289 | : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), |
290 | mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ | 290 | mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ |
291 | mReadWrite( readWrite ), mModified( false ), mMainWindow(client) | 291 | mReadWrite( readWrite ), mModified( false ), mMainWindow(client) |
292 | #else //KAB_EMBEDDED | 292 | #else //KAB_EMBEDDED |
293 | KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) | 293 | KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) |
294 | : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), | 294 | : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), |
295 | mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), | 295 | mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), |
296 | mReadWrite( readWrite ), mModified( false ) | 296 | mReadWrite( readWrite ), mModified( false ) |
297 | #endif //KAB_EMBEDDED | 297 | #endif //KAB_EMBEDDED |
298 | { | 298 | { |
299 | // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); | 299 | // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); |
300 | // syncManager->setBlockSave(false); | 300 | // syncManager->setBlockSave(false); |
301 | mMiniSplitter = 0; | 301 | mMiniSplitter = 0; |
302 | mExtensionBarSplitter = 0; | 302 | mExtensionBarSplitter = 0; |
303 | mIsPart = !parent->inherits( "KAddressBookMain" ); | 303 | mIsPart = !parent->inherits( "KAddressBookMain" ); |
304 | mAddressBook = KABC::StdAddressBook::self(); | 304 | mAddressBook = KABC::StdAddressBook::self(); |
305 | KABC::StdAddressBook::setAutomaticSave( false ); | 305 | KABC::StdAddressBook::setAutomaticSave( false ); |
306 | 306 | ||
307 | #ifndef KAB_EMBEDDED | 307 | #ifndef KAB_EMBEDDED |
308 | mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); | 308 | mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); |
309 | #endif //KAB_EMBEDDED | 309 | #endif //KAB_EMBEDDED |
310 | 310 | ||
311 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), | 311 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), |
312 | SLOT( addressBookChanged() ) ); | 312 | SLOT( addressBookChanged() ) ); |
313 | 313 | ||
314 | #if 0 | 314 | #if 0 |
315 | // LP moved to addressbook init method | 315 | // LP moved to addressbook init method |
316 | mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, | 316 | mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, |
317 | "X-Department", "KADDRESSBOOK" ); | 317 | "X-Department", "KADDRESSBOOK" ); |
318 | mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, | 318 | mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, |
319 | "X-Profession", "KADDRESSBOOK" ); | 319 | "X-Profession", "KADDRESSBOOK" ); |
320 | mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, | 320 | mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, |
321 | "X-AssistantsName", "KADDRESSBOOK" ); | 321 | "X-AssistantsName", "KADDRESSBOOK" ); |
322 | mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, | 322 | mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, |
323 | "X-ManagersName", "KADDRESSBOOK" ); | 323 | "X-ManagersName", "KADDRESSBOOK" ); |
324 | mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, | 324 | mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, |
325 | "X-SpousesName", "KADDRESSBOOK" ); | 325 | "X-SpousesName", "KADDRESSBOOK" ); |
326 | mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, | 326 | mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, |
327 | "X-Office", "KADDRESSBOOK" ); | 327 | "X-Office", "KADDRESSBOOK" ); |
328 | mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, | 328 | mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, |
329 | "X-IMAddress", "KADDRESSBOOK" ); | 329 | "X-IMAddress", "KADDRESSBOOK" ); |
330 | mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, | 330 | mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, |
331 | "X-Anniversary", "KADDRESSBOOK" ); | 331 | "X-Anniversary", "KADDRESSBOOK" ); |
332 | 332 | ||
333 | //US added this field to become compatible with Opie/qtopia addressbook | 333 | //US added this field to become compatible with Opie/qtopia addressbook |
334 | // values can be "female" or "male" or "". An empty field represents undefined. | 334 | // values can be "female" or "male" or "". An empty field represents undefined. |
335 | mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, | 335 | mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, |
336 | "X-Gender", "KADDRESSBOOK" ); | 336 | "X-Gender", "KADDRESSBOOK" ); |
337 | mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, | 337 | mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, |
338 | "X-Children", "KADDRESSBOOK" ); | 338 | "X-Children", "KADDRESSBOOK" ); |
339 | mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, | 339 | mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, |
340 | "X-FreeBusyUrl", "KADDRESSBOOK" ); | 340 | "X-FreeBusyUrl", "KADDRESSBOOK" ); |
341 | #endif | 341 | #endif |
342 | initGUI(); | 342 | initGUI(); |
343 | 343 | ||
344 | mIncSearchWidget->setFocus(); | 344 | mIncSearchWidget->setFocus(); |
345 | 345 | ||
346 | 346 | ||
347 | connect( mViewManager, SIGNAL( selected( const QString& ) ), | 347 | connect( mViewManager, SIGNAL( selected( const QString& ) ), |
348 | SLOT( setContactSelected( const QString& ) ) ); | 348 | SLOT( setContactSelected( const QString& ) ) ); |
349 | connect( mViewManager, SIGNAL( executed( const QString& ) ), | 349 | connect( mViewManager, SIGNAL( executed( const QString& ) ), |
350 | SLOT( executeContact( const QString& ) ) ); | 350 | SLOT( executeContact( const QString& ) ) ); |
351 | 351 | ||
352 | connect( mViewManager, SIGNAL( deleteRequest( ) ), | 352 | connect( mViewManager, SIGNAL( deleteRequest( ) ), |
353 | SLOT( deleteContacts( ) ) ); | 353 | SLOT( deleteContacts( ) ) ); |
354 | connect( mViewManager, SIGNAL( modified() ), | 354 | connect( mViewManager, SIGNAL( modified() ), |
355 | SLOT( setModified() ) ); | 355 | SLOT( setModified() ) ); |
356 | 356 | ||
357 | connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); | 357 | connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); |
358 | connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); | 358 | connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); |
359 | 359 | ||
360 | connect( mXXPortManager, SIGNAL( modified() ), | 360 | connect( mXXPortManager, SIGNAL( modified() ), |
361 | SLOT( setModified() ) ); | 361 | SLOT( setModified() ) ); |
362 | 362 | ||
363 | connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), | 363 | connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), |
364 | SLOT( incrementalSearch( const QString& ) ) ); | 364 | SLOT( incrementalSearch( const QString& ) ) ); |
365 | connect( mIncSearchWidget, SIGNAL( fieldChanged() ), | 365 | connect( mIncSearchWidget, SIGNAL( fieldChanged() ), |
366 | mJumpButtonBar, SLOT( recreateButtons() ) ); | 366 | mJumpButtonBar, SLOT( recreateButtons() ) ); |
367 | 367 | ||
368 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), | 368 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), |
369 | SLOT( sendMail( const QString& ) ) ); | 369 | SLOT( sendMail( const QString& ) ) ); |
370 | 370 | ||
371 | 371 | ||
372 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); | 372 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); |
373 | connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); | 373 | connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); |
374 | connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); | 374 | connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); |
375 | connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); | 375 | connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); |
376 | 376 | ||
377 | 377 | ||
378 | #ifndef KAB_EMBEDDED | 378 | #ifndef KAB_EMBEDDED |
379 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), | 379 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), |
380 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); | 380 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); |
381 | 381 | ||
382 | connect( mDetails, SIGNAL( browse( const QString& ) ), | 382 | connect( mDetails, SIGNAL( browse( const QString& ) ), |
383 | SLOT( browse( const QString& ) ) ); | 383 | SLOT( browse( const QString& ) ) ); |
384 | 384 | ||
385 | 385 | ||
386 | mAddressBookService = new KAddressBookService( this ); | 386 | mAddressBookService = new KAddressBookService( this ); |
387 | 387 | ||
388 | #endif //KAB_EMBEDDED | 388 | #endif //KAB_EMBEDDED |
389 | 389 | ||
390 | mMessageTimer = new QTimer( this ); | 390 | mMessageTimer = new QTimer( this ); |
391 | connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); | 391 | connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); |
392 | mEditorDialog = 0; | 392 | mEditorDialog = 0; |
393 | createAddresseeEditorDialog( this ); | 393 | createAddresseeEditorDialog( this ); |
394 | setModified( false ); | 394 | setModified( false ); |
395 | mBRdisabled = false; | 395 | mBRdisabled = false; |
396 | #ifndef DESKTOP_VERSION | 396 | #ifndef DESKTOP_VERSION |
397 | infrared = 0; | 397 | infrared = 0; |
398 | #endif | 398 | #endif |
399 | //toggleBeamReceive( ); | 399 | //toggleBeamReceive( ); |
400 | //mMainWindow->toolBar()->show(); | 400 | //mMainWindow->toolBar()->show(); |
401 | // we have a toolbar repainting error on the Zaurus when starting KA/Pi | 401 | // we have a toolbar repainting error on the Zaurus when starting KA/Pi |
402 | QTimer::singleShot( 10, this , SLOT ( updateToolBar())); | 402 | QTimer::singleShot( 10, this , SLOT ( updateToolBar())); |
403 | } | 403 | } |
404 | 404 | ||
405 | void KABCore::updateToolBar() | 405 | void KABCore::updateToolBar() |
406 | { | 406 | { |
407 | static int iii = 0; | 407 | static int iii = 0; |
408 | ++iii; | 408 | ++iii; |
409 | mMainWindow->toolBar()->repaintMe(); | 409 | mMainWindow->toolBar()->repaintMe(); |
410 | if ( iii < 3 ) | 410 | if ( iii < 4 ) |
411 | QTimer::singleShot( 10, this , SLOT ( updateToolBar())); | 411 | QTimer::singleShot( 100*iii, this , SLOT ( updateToolBar())); |
412 | } | 412 | } |
413 | KABCore::~KABCore() | 413 | KABCore::~KABCore() |
414 | { | 414 | { |
415 | // save(); | 415 | // save(); |
416 | //saveSettings(); | 416 | //saveSettings(); |
417 | //KABPrefs::instance()->writeConfig(); | 417 | //KABPrefs::instance()->writeConfig(); |
418 | delete AddresseeConfig::instance(); | 418 | delete AddresseeConfig::instance(); |
419 | mAddressBook = 0; | 419 | mAddressBook = 0; |
420 | KABC::StdAddressBook::close(); | 420 | KABC::StdAddressBook::close(); |
421 | 421 | ||
422 | delete syncManager; | 422 | delete syncManager; |
423 | #ifndef DESKTOP_VERSION | 423 | #ifndef DESKTOP_VERSION |
424 | if ( infrared ) | 424 | if ( infrared ) |
425 | delete infrared; | 425 | delete infrared; |
426 | #endif | 426 | #endif |
427 | } | 427 | } |
428 | void KABCore::receive( const QCString& cmsg, const QByteArray& data ) | 428 | void KABCore::receive( const QCString& cmsg, const QByteArray& data ) |
429 | { | 429 | { |
430 | //qDebug("KA: QCOP message received: %s ", cmsg.data() ); | 430 | //qDebug("KA: QCOP message received: %s ", cmsg.data() ); |
431 | if ( cmsg == "setDocument(QString)" ) { | 431 | if ( cmsg == "setDocument(QString)" ) { |
432 | QDataStream stream( data, IO_ReadOnly ); | 432 | QDataStream stream( data, IO_ReadOnly ); |
433 | QString fileName; | 433 | QString fileName; |
434 | stream >> fileName; | 434 | stream >> fileName; |
435 | recieve( fileName ); | 435 | recieve( fileName ); |
436 | return; | 436 | return; |
437 | } | 437 | } |
438 | } | 438 | } |
439 | void KABCore::toggleBeamReceive( ) | 439 | void KABCore::toggleBeamReceive( ) |
440 | { | 440 | { |
441 | if ( mBRdisabled ) | 441 | if ( mBRdisabled ) |
442 | return; | 442 | return; |
443 | #ifndef DESKTOP_VERSION | 443 | #ifndef DESKTOP_VERSION |
444 | if ( infrared ) { | 444 | if ( infrared ) { |
445 | qDebug("KA: AB disable BeamReceive "); | 445 | qDebug("KA: AB disable BeamReceive "); |
446 | delete infrared; | 446 | delete infrared; |
447 | infrared = 0; | 447 | infrared = 0; |
448 | mActionBR->setChecked(false); | 448 | mActionBR->setChecked(false); |
449 | return; | 449 | return; |
450 | } | 450 | } |
451 | qDebug("KA: AB enable BeamReceive "); | 451 | qDebug("KA: AB enable BeamReceive "); |
452 | mActionBR->setChecked(true); | 452 | mActionBR->setChecked(true); |
453 | 453 | ||
454 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; | 454 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; |
455 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); | 455 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); |
456 | #endif | 456 | #endif |
457 | } | 457 | } |
458 | 458 | ||
459 | 459 | ||
460 | void KABCore::disableBR(bool b) | 460 | void KABCore::disableBR(bool b) |
461 | { | 461 | { |
462 | #ifndef DESKTOP_VERSION | 462 | #ifndef DESKTOP_VERSION |
463 | if ( b ) { | 463 | if ( b ) { |
464 | if ( infrared ) { | 464 | if ( infrared ) { |
465 | toggleBeamReceive( ); | 465 | toggleBeamReceive( ); |
466 | } | 466 | } |
467 | mBRdisabled = true; | 467 | mBRdisabled = true; |
468 | } else { | 468 | } else { |
469 | if ( mBRdisabled ) { | 469 | if ( mBRdisabled ) { |
470 | mBRdisabled = false; | 470 | mBRdisabled = false; |
471 | //toggleBeamReceive( ); | 471 | //toggleBeamReceive( ); |
472 | } | 472 | } |
473 | } | 473 | } |
474 | #endif | 474 | #endif |
475 | 475 | ||
476 | } | 476 | } |
477 | void KABCore::recieve( QString fn ) | 477 | void KABCore::recieve( QString fn ) |
478 | { | 478 | { |
479 | //qDebug("KABCore::recieve "); | 479 | //qDebug("KABCore::recieve "); |
480 | int count = mAddressBook->importFromFile( fn, true ); | 480 | int count = mAddressBook->importFromFile( fn, true ); |
481 | if ( count ) | 481 | if ( count ) |
482 | setModified( true ); | 482 | setModified( true ); |
483 | mViewManager->refreshView(); | 483 | mViewManager->refreshView(); |
484 | message(i18n("%1 contact(s) received!").arg( count )); | 484 | message(i18n("%1 contact(s) received!").arg( count )); |
485 | topLevelWidget()->showMaximized(); | 485 | topLevelWidget()->showMaximized(); |
486 | topLevelWidget()->raise(); | 486 | topLevelWidget()->raise(); |
487 | } | 487 | } |
488 | void KABCore::restoreSettings() | 488 | void KABCore::restoreSettings() |
489 | { | 489 | { |
490 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; | 490 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; |
491 | 491 | ||
492 | bool state; | 492 | bool state; |
493 | 493 | ||
494 | if (mMultipleViewsAtOnce) | 494 | if (mMultipleViewsAtOnce) |
495 | state = KABPrefs::instance()->mDetailsPageVisible; | 495 | state = KABPrefs::instance()->mDetailsPageVisible; |
496 | else | 496 | else |
497 | state = false; | 497 | state = false; |
498 | 498 | ||
499 | mActionDetails->setChecked( state ); | 499 | mActionDetails->setChecked( state ); |
500 | setDetailsVisible( state ); | 500 | setDetailsVisible( state ); |
501 | 501 | ||
502 | state = KABPrefs::instance()->mJumpButtonBarVisible; | 502 | state = KABPrefs::instance()->mJumpButtonBarVisible; |
503 | 503 | ||
504 | mActionJumpBar->setChecked( state ); | 504 | mActionJumpBar->setChecked( state ); |
505 | setJumpButtonBarVisible( state ); | 505 | setJumpButtonBarVisible( state ); |
506 | /*US | 506 | /*US |
507 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; | 507 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; |
508 | if ( splitterSize.count() == 0 ) { | 508 | if ( splitterSize.count() == 0 ) { |
509 | splitterSize.append( width() / 2 ); | 509 | splitterSize.append( width() / 2 ); |
510 | splitterSize.append( width() / 2 ); | 510 | splitterSize.append( width() / 2 ); |
511 | } | 511 | } |
512 | mMiniSplitter->setSizes( splitterSize ); | 512 | mMiniSplitter->setSizes( splitterSize ); |
513 | if ( mExtensionBarSplitter ) { | 513 | if ( mExtensionBarSplitter ) { |
514 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 514 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; |
515 | if ( splitterSize.count() == 0 ) { | 515 | if ( splitterSize.count() == 0 ) { |
516 | splitterSize.append( width() / 2 ); | 516 | splitterSize.append( width() / 2 ); |
517 | splitterSize.append( width() / 2 ); | 517 | splitterSize.append( width() / 2 ); |
518 | } | 518 | } |
519 | mExtensionBarSplitter->setSizes( splitterSize ); | 519 | mExtensionBarSplitter->setSizes( splitterSize ); |
520 | 520 | ||
521 | } | 521 | } |
522 | */ | 522 | */ |
523 | mViewManager->restoreSettings(); | 523 | mViewManager->restoreSettings(); |
524 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); | 524 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); |
525 | mExtensionManager->restoreSettings(); | 525 | mExtensionManager->restoreSettings(); |
526 | #ifdef DESKTOP_VERSION | 526 | #ifdef DESKTOP_VERSION |
527 | int wid = width(); | 527 | int wid = width(); |
528 | if ( wid < 10 ) | 528 | if ( wid < 10 ) |
529 | wid = 400; | 529 | wid = 400; |
530 | #else | 530 | #else |
531 | int wid = QApplication::desktop()->width(); | 531 | int wid = QApplication::desktop()->width(); |
532 | if ( wid < 640 ) | 532 | if ( wid < 640 ) |
533 | wid = QApplication::desktop()->height(); | 533 | wid = QApplication::desktop()->height(); |
534 | #endif | 534 | #endif |
535 | QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; | 535 | QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; |
536 | if ( true /*splitterSize.count() == 0*/ ) { | 536 | if ( true /*splitterSize.count() == 0*/ ) { |
537 | splitterSize.append( wid / 2 ); | 537 | splitterSize.append( wid / 2 ); |
538 | splitterSize.append( wid / 2 ); | 538 | splitterSize.append( wid / 2 ); |
539 | } | 539 | } |
540 | mMiniSplitter->setSizes( splitterSize ); | 540 | mMiniSplitter->setSizes( splitterSize ); |
541 | if ( mExtensionBarSplitter ) { | 541 | if ( mExtensionBarSplitter ) { |
542 | //splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 542 | //splitterSize = KABPrefs::instance()->mExtensionsSplitter; |
543 | if ( true /*splitterSize.count() == 0*/ ) { | 543 | if ( true /*splitterSize.count() == 0*/ ) { |
544 | splitterSize.append( wid / 2 ); | 544 | splitterSize.append( wid / 2 ); |
545 | splitterSize.append( wid / 2 ); | 545 | splitterSize.append( wid / 2 ); |
546 | } | 546 | } |
547 | mExtensionBarSplitter->setSizes( splitterSize ); | 547 | mExtensionBarSplitter->setSizes( splitterSize ); |
548 | 548 | ||
549 | } | 549 | } |
550 | 550 | ||
551 | 551 | ||
552 | } | 552 | } |
553 | 553 | ||
554 | void KABCore::saveSettings() | 554 | void KABCore::saveSettings() |
555 | { | 555 | { |
556 | KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); | 556 | KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); |
557 | if ( mExtensionBarSplitter ) | 557 | if ( mExtensionBarSplitter ) |
558 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); | 558 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); |
559 | KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); | 559 | KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); |
560 | KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); | 560 | KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); |
561 | #ifndef KAB_EMBEDDED | 561 | #ifndef KAB_EMBEDDED |
562 | 562 | ||
563 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); | 563 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); |
564 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); | 564 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); |
565 | #endif //KAB_EMBEDDED | 565 | #endif //KAB_EMBEDDED |
566 | mExtensionManager->saveSettings(); | 566 | mExtensionManager->saveSettings(); |
567 | mViewManager->saveSettings(); | 567 | mViewManager->saveSettings(); |
568 | 568 | ||
569 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); | 569 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); |
570 | KABPrefs::instance()->writeConfig(); | 570 | KABPrefs::instance()->writeConfig(); |
571 | qDebug("KA: KABCore::saveSettings() "); | 571 | qDebug("KA: KABCore::saveSettings() "); |
572 | } | 572 | } |
573 | 573 | ||
574 | KABC::AddressBook *KABCore::addressBook() const | 574 | KABC::AddressBook *KABCore::addressBook() const |
575 | { | 575 | { |
576 | return mAddressBook; | 576 | return mAddressBook; |
577 | } | 577 | } |
578 | 578 | ||
579 | KConfig *KABCore::config() | 579 | KConfig *KABCore::config() |
580 | { | 580 | { |
581 | #ifndef KAB_EMBEDDED | 581 | #ifndef KAB_EMBEDDED |
582 | return KABPrefs::instance()->config(); | 582 | return KABPrefs::instance()->config(); |
583 | #else //KAB_EMBEDDED | 583 | #else //KAB_EMBEDDED |
584 | return KABPrefs::instance()->getConfig(); | 584 | return KABPrefs::instance()->getConfig(); |
585 | #endif //KAB_EMBEDDED | 585 | #endif //KAB_EMBEDDED |
586 | } | 586 | } |
587 | 587 | ||
588 | KActionCollection *KABCore::actionCollection() const | 588 | KActionCollection *KABCore::actionCollection() const |
589 | { | 589 | { |
590 | return mGUIClient->actionCollection(); | 590 | return mGUIClient->actionCollection(); |
591 | } | 591 | } |
592 | 592 | ||
593 | KABC::Field *KABCore::currentSearchField() const | 593 | KABC::Field *KABCore::currentSearchField() const |
594 | { | 594 | { |
595 | if (mIncSearchWidget) | 595 | if (mIncSearchWidget) |
596 | return mIncSearchWidget->currentField(); | 596 | return mIncSearchWidget->currentField(); |
597 | else | 597 | else |
598 | return 0; | 598 | return 0; |
599 | } | 599 | } |
600 | 600 | ||
601 | QStringList KABCore::selectedUIDs() const | 601 | QStringList KABCore::selectedUIDs() const |
602 | { | 602 | { |
603 | return mViewManager->selectedUids(); | 603 | return mViewManager->selectedUids(); |