summaryrefslogtreecommitdiffabout
authorulf69 <ulf69>2004-10-28 17:09:29 (UTC)
committer ulf69 <ulf69>2004-10-28 17:09:29 (UTC)
commit5c64eb04c048d7e51f1c71621e1d37c5c0c580a0 (patch) (unidiff)
treec0c3a06395729d25feeb930479bb153d964a71db
parent709e2793be2dd47dc0a15488f43fd2f058db2036 (diff)
downloadkdepimpi-5c64eb04c048d7e51f1c71621e1d37c5c0c580a0.zip
kdepimpi-5c64eb04c048d7e51f1c71621e1d37c5c0c580a0.tar.gz
kdepimpi-5c64eb04c048d7e51f1c71621e1d37c5c0c580a0.tar.bz2
undo nextView fix. Zautrix did the same already in externalapphandler
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp9
1 files changed, 0 insertions, 9 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 9ef97c9..ea103a9 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -221,265 +221,256 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
221{ 221{
222 // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); 222 // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu);
223 // syncManager->setBlockSave(false); 223 // syncManager->setBlockSave(false);
224 mExtensionBarSplitter = 0; 224 mExtensionBarSplitter = 0;
225 mIsPart = !parent->inherits( "KAddressBookMain" ); 225 mIsPart = !parent->inherits( "KAddressBookMain" );
226 mAddressBook = KABC::StdAddressBook::self(); 226 mAddressBook = KABC::StdAddressBook::self();
227 KABC::StdAddressBook::setAutomaticSave( false ); 227 KABC::StdAddressBook::setAutomaticSave( false );
228 228
229#ifndef KAB_EMBEDDED 229#ifndef KAB_EMBEDDED
230 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); 230 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler );
231#endif //KAB_EMBEDDED 231#endif //KAB_EMBEDDED
232 232
233 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), 233 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ),
234 SLOT( addressBookChanged() ) ); 234 SLOT( addressBookChanged() ) );
235 235
236#if 0 236#if 0
237 // LP moved to addressbook init method 237 // LP moved to addressbook init method
238 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, 238 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization,
239 "X-Department", "KADDRESSBOOK" ); 239 "X-Department", "KADDRESSBOOK" );
240 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, 240 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization,
241 "X-Profession", "KADDRESSBOOK" ); 241 "X-Profession", "KADDRESSBOOK" );
242 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, 242 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization,
243 "X-AssistantsName", "KADDRESSBOOK" ); 243 "X-AssistantsName", "KADDRESSBOOK" );
244 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, 244 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization,
245 "X-ManagersName", "KADDRESSBOOK" ); 245 "X-ManagersName", "KADDRESSBOOK" );
246 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, 246 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal,
247 "X-SpousesName", "KADDRESSBOOK" ); 247 "X-SpousesName", "KADDRESSBOOK" );
248 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, 248 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal,
249 "X-Office", "KADDRESSBOOK" ); 249 "X-Office", "KADDRESSBOOK" );
250 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, 250 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal,
251 "X-IMAddress", "KADDRESSBOOK" ); 251 "X-IMAddress", "KADDRESSBOOK" );
252 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, 252 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal,
253 "X-Anniversary", "KADDRESSBOOK" ); 253 "X-Anniversary", "KADDRESSBOOK" );
254 254
255 //US added this field to become compatible with Opie/qtopia addressbook 255 //US added this field to become compatible with Opie/qtopia addressbook
256 // values can be "female" or "male" or "". An empty field represents undefined. 256 // values can be "female" or "male" or "". An empty field represents undefined.
257 mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, 257 mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal,
258 "X-Gender", "KADDRESSBOOK" ); 258 "X-Gender", "KADDRESSBOOK" );
259 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, 259 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal,
260 "X-Children", "KADDRESSBOOK" ); 260 "X-Children", "KADDRESSBOOK" );
261 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, 261 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal,
262 "X-FreeBusyUrl", "KADDRESSBOOK" ); 262 "X-FreeBusyUrl", "KADDRESSBOOK" );
263#endif 263#endif
264 initGUI(); 264 initGUI();
265 265
266 mIncSearchWidget->setFocus(); 266 mIncSearchWidget->setFocus();
267 267
268 268
269 connect( mViewManager, SIGNAL( selected( const QString& ) ), 269 connect( mViewManager, SIGNAL( selected( const QString& ) ),
270 SLOT( setContactSelected( const QString& ) ) ); 270 SLOT( setContactSelected( const QString& ) ) );
271 connect( mViewManager, SIGNAL( executed( const QString& ) ), 271 connect( mViewManager, SIGNAL( executed( const QString& ) ),
272 SLOT( executeContact( const QString& ) ) ); 272 SLOT( executeContact( const QString& ) ) );
273 273
274 connect( mViewManager, SIGNAL( deleteRequest( ) ), 274 connect( mViewManager, SIGNAL( deleteRequest( ) ),
275 SLOT( deleteContacts( ) ) ); 275 SLOT( deleteContacts( ) ) );
276 connect( mViewManager, SIGNAL( modified() ), 276 connect( mViewManager, SIGNAL( modified() ),
277 SLOT( setModified() ) ); 277 SLOT( setModified() ) );
278 278
279 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); 279 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) );
280 connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); 280 connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) );
281 281
282 connect( mXXPortManager, SIGNAL( modified() ), 282 connect( mXXPortManager, SIGNAL( modified() ),
283 SLOT( setModified() ) ); 283 SLOT( setModified() ) );
284 284
285 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), 285 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ),
286 SLOT( incrementalSearch( const QString& ) ) ); 286 SLOT( incrementalSearch( const QString& ) ) );
287 connect( mIncSearchWidget, SIGNAL( fieldChanged() ), 287 connect( mIncSearchWidget, SIGNAL( fieldChanged() ),
288 mJumpButtonBar, SLOT( recreateButtons() ) ); 288 mJumpButtonBar, SLOT( recreateButtons() ) );
289 289
290 connect( mDetails, SIGNAL( sendEmail( const QString& ) ), 290 connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
291 SLOT( sendMail( const QString& ) ) ); 291 SLOT( sendMail( const QString& ) ) );
292 292
293 293
294 connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); 294 connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&)));
295 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&))); 295 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&)));
296 connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); 296 connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&)));
297 connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); 297 connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle()));
298 298
299 299
300#ifndef KAB_EMBEDDED 300#ifndef KAB_EMBEDDED
301 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), 301 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ),
302 mXXPortManager, SLOT( importVCard( const KURL& ) ) ); 302 mXXPortManager, SLOT( importVCard( const KURL& ) ) );
303 303
304 connect( mDetails, SIGNAL( browse( const QString& ) ), 304 connect( mDetails, SIGNAL( browse( const QString& ) ),
305 SLOT( browse( const QString& ) ) ); 305 SLOT( browse( const QString& ) ) );
306 306
307 307
308 mAddressBookService = new KAddressBookService( this ); 308 mAddressBookService = new KAddressBookService( this );
309 309
310#endif //KAB_EMBEDDED 310#endif //KAB_EMBEDDED
311 311
312 mMessageTimer = new QTimer( this ); 312 mMessageTimer = new QTimer( this );
313 connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); 313 connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) );
314 mEditorDialog = 0; 314 mEditorDialog = 0;
315 createAddresseeEditorDialog( this ); 315 createAddresseeEditorDialog( this );
316 setModified( false ); 316 setModified( false );
317 mBRdisabled = false; 317 mBRdisabled = false;
318#ifndef DESKTOP_VERSION 318#ifndef DESKTOP_VERSION
319 infrared = 0; 319 infrared = 0;
320#endif 320#endif
321 //toggleBeamReceive( ); 321 //toggleBeamReceive( );
322} 322}
323 323
324KABCore::~KABCore() 324KABCore::~KABCore()
325{ 325{
326 // save(); 326 // save();
327 //saveSettings(); 327 //saveSettings();
328 //KABPrefs::instance()->writeConfig(); 328 //KABPrefs::instance()->writeConfig();
329 delete AddresseeConfig::instance(); 329 delete AddresseeConfig::instance();
330 mAddressBook = 0; 330 mAddressBook = 0;
331 KABC::StdAddressBook::close(); 331 KABC::StdAddressBook::close();
332 332
333 delete syncManager; 333 delete syncManager;
334#ifndef DESKTOP_VERSION 334#ifndef DESKTOP_VERSION
335 if ( infrared ) 335 if ( infrared )
336 delete infrared; 336 delete infrared;
337#endif 337#endif
338} 338}
339void KABCore::receive( const QCString& cmsg, const QByteArray& data ) 339void KABCore::receive( const QCString& cmsg, const QByteArray& data )
340{ 340{
341 qDebug("KA: QCOP message received: %s ", cmsg.data() ); 341 qDebug("KA: QCOP message received: %s ", cmsg.data() );
342 if ( cmsg == "setDocument(QString)" ) { 342 if ( cmsg == "setDocument(QString)" ) {
343 QDataStream stream( data, IO_ReadOnly ); 343 QDataStream stream( data, IO_ReadOnly );
344 QString fileName; 344 QString fileName;
345 stream >> fileName; 345 stream >> fileName;
346 recieve( fileName ); 346 recieve( fileName );
347 return; 347 return;
348 } 348 }
349 else if ( cmsg == "nextView()" )
350 {
351 //toggle between details/ no details
352 bool b = !mActionDetails->isChecked();
353 setDetailsVisible( b );
354 mActionDetails->setChecked( b );
355 }
356
357
358} 349}
359void KABCore::toggleBeamReceive( ) 350void KABCore::toggleBeamReceive( )
360{ 351{
361 if ( mBRdisabled ) 352 if ( mBRdisabled )
362 return; 353 return;
363#ifndef DESKTOP_VERSION 354#ifndef DESKTOP_VERSION
364 if ( infrared ) { 355 if ( infrared ) {
365 qDebug("AB disable BeamReceive "); 356 qDebug("AB disable BeamReceive ");
366 delete infrared; 357 delete infrared;
367 infrared = 0; 358 infrared = 0;
368 mActionBR->setChecked(false); 359 mActionBR->setChecked(false);
369 return; 360 return;
370 } 361 }
371 qDebug("AB enable BeamReceive "); 362 qDebug("AB enable BeamReceive ");
372 mActionBR->setChecked(true); 363 mActionBR->setChecked(true);
373 364
374 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; 365 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ;
375 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); 366 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& )));
376#endif 367#endif
377} 368}
378 369
379 370
380void KABCore::disableBR(bool b) 371void KABCore::disableBR(bool b)
381{ 372{
382#ifndef DESKTOP_VERSION 373#ifndef DESKTOP_VERSION
383 if ( b ) { 374 if ( b ) {
384 if ( infrared ) { 375 if ( infrared ) {
385 toggleBeamReceive( ); 376 toggleBeamReceive( );
386 } 377 }
387 mBRdisabled = true; 378 mBRdisabled = true;
388 } else { 379 } else {
389 if ( mBRdisabled ) { 380 if ( mBRdisabled ) {
390 mBRdisabled = false; 381 mBRdisabled = false;
391 //toggleBeamReceive( ); 382 //toggleBeamReceive( );
392 } 383 }
393 } 384 }
394#endif 385#endif
395 386
396} 387}
397void KABCore::recieve( QString fn ) 388void KABCore::recieve( QString fn )
398{ 389{
399 //qDebug("KABCore::recieve "); 390 //qDebug("KABCore::recieve ");
400 int count = mAddressBook->importFromFile( fn, true ); 391 int count = mAddressBook->importFromFile( fn, true );
401 if ( count ) 392 if ( count )
402 setModified( true ); 393 setModified( true );
403 mViewManager->refreshView(); 394 mViewManager->refreshView();
404 message(i18n("%1 contact(s) received!").arg( count )); 395 message(i18n("%1 contact(s) received!").arg( count ));
405 topLevelWidget()->showMaximized(); 396 topLevelWidget()->showMaximized();
406 topLevelWidget()->raise(); 397 topLevelWidget()->raise();
407} 398}
408void KABCore::restoreSettings() 399void KABCore::restoreSettings()
409{ 400{
410 mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; 401 mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce;
411 402
412 bool state; 403 bool state;
413 404
414 if (mMultipleViewsAtOnce) 405 if (mMultipleViewsAtOnce)
415 state = KABPrefs::instance()->mDetailsPageVisible; 406 state = KABPrefs::instance()->mDetailsPageVisible;
416 else 407 else
417 state = false; 408 state = false;
418 409
419 mActionDetails->setChecked( state ); 410 mActionDetails->setChecked( state );
420 setDetailsVisible( state ); 411 setDetailsVisible( state );
421 412
422 state = KABPrefs::instance()->mJumpButtonBarVisible; 413 state = KABPrefs::instance()->mJumpButtonBarVisible;
423 414
424 mActionJumpBar->setChecked( state ); 415 mActionJumpBar->setChecked( state );
425 setJumpButtonBarVisible( state ); 416 setJumpButtonBarVisible( state );
426/*US 417/*US
427 QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; 418 QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter;
428 if ( splitterSize.count() == 0 ) { 419 if ( splitterSize.count() == 0 ) {
429 splitterSize.append( width() / 2 ); 420 splitterSize.append( width() / 2 );
430 splitterSize.append( width() / 2 ); 421 splitterSize.append( width() / 2 );
431 } 422 }
432 mMiniSplitter->setSizes( splitterSize ); 423 mMiniSplitter->setSizes( splitterSize );
433 if ( mExtensionBarSplitter ) { 424 if ( mExtensionBarSplitter ) {
434 splitterSize = KABPrefs::instance()->mExtensionsSplitter; 425 splitterSize = KABPrefs::instance()->mExtensionsSplitter;
435 if ( splitterSize.count() == 0 ) { 426 if ( splitterSize.count() == 0 ) {
436 splitterSize.append( width() / 2 ); 427 splitterSize.append( width() / 2 );
437 splitterSize.append( width() / 2 ); 428 splitterSize.append( width() / 2 );
438 } 429 }
439 mExtensionBarSplitter->setSizes( splitterSize ); 430 mExtensionBarSplitter->setSizes( splitterSize );
440 431
441 } 432 }
442*/ 433*/
443 mViewManager->restoreSettings(); 434 mViewManager->restoreSettings();
444 mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); 435 mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField );
445 mExtensionManager->restoreSettings(); 436 mExtensionManager->restoreSettings();
446#ifdef DESKTOP_VERSION 437#ifdef DESKTOP_VERSION
447 int wid = width(); 438 int wid = width();
448 if ( wid < 10 ) 439 if ( wid < 10 )
449 wid = 400; 440 wid = 400;
450#else 441#else
451 int wid = QApplication::desktop()->width(); 442 int wid = QApplication::desktop()->width();
452 if ( wid < 640 ) 443 if ( wid < 640 )
453 wid = QApplication::desktop()->height(); 444 wid = QApplication::desktop()->height();
454#endif 445#endif
455 QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; 446 QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter;
456 if ( true /*splitterSize.count() == 0*/ ) { 447 if ( true /*splitterSize.count() == 0*/ ) {
457 splitterSize.append( wid / 2 ); 448 splitterSize.append( wid / 2 );
458 splitterSize.append( wid / 2 ); 449 splitterSize.append( wid / 2 );
459 } 450 }
460 mMiniSplitter->setSizes( splitterSize ); 451 mMiniSplitter->setSizes( splitterSize );
461 if ( mExtensionBarSplitter ) { 452 if ( mExtensionBarSplitter ) {
462 //splitterSize = KABPrefs::instance()->mExtensionsSplitter; 453 //splitterSize = KABPrefs::instance()->mExtensionsSplitter;
463 if ( true /*splitterSize.count() == 0*/ ) { 454 if ( true /*splitterSize.count() == 0*/ ) {
464 splitterSize.append( wid / 2 ); 455 splitterSize.append( wid / 2 );
465 splitterSize.append( wid / 2 ); 456 splitterSize.append( wid / 2 );
466 } 457 }
467 mExtensionBarSplitter->setSizes( splitterSize ); 458 mExtensionBarSplitter->setSizes( splitterSize );
468 459
469 } 460 }
470 461
471 462
472} 463}
473 464
474void KABCore::saveSettings() 465void KABCore::saveSettings()
475{ 466{
476 KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); 467 KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked();
477 if ( mExtensionBarSplitter ) 468 if ( mExtensionBarSplitter )
478 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); 469 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes();
479 KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); 470 KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked();
480 KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); 471 KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes();
481#ifndef KAB_EMBEDDED 472#ifndef KAB_EMBEDDED
482 473
483 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); 474 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes();
484 KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); 475 KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes();
485#endif //KAB_EMBEDDED 476#endif //KAB_EMBEDDED