-rw-r--r-- | korganizer/mainwindow.cpp | 8 | ||||
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 7 | ||||
-rw-r--r-- | libkdepim/ksyncprefsdialog.h | 1 | ||||
-rw-r--r-- | libkdepim/ksyncprofile.cpp | 4 | ||||
-rw-r--r-- | libkdepim/ksyncprofile.h | 3 |
5 files changed, 18 insertions, 5 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index d0d1f3b..298fa82 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -349,1126 +349,1126 @@ void MainWindow::initActions() | |||
349 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 349 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
350 | QPopupMenu *importMenu = new QPopupMenu( this ); | 350 | QPopupMenu *importMenu = new QPopupMenu( this ); |
351 | 351 | ||
352 | syncMenu = new QPopupMenu( this ); | 352 | syncMenu = new QPopupMenu( this ); |
353 | configureAgendaMenu = new QPopupMenu( this ); | 353 | configureAgendaMenu = new QPopupMenu( this ); |
354 | configureToolBarMenu = new QPopupMenu( this ); | 354 | configureToolBarMenu = new QPopupMenu( this ); |
355 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 355 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
356 | if ( KOPrefs::instance()->mShowFullMenu ) { | 356 | if ( KOPrefs::instance()->mShowFullMenu ) { |
357 | QMenuBar *menuBar1; | 357 | QMenuBar *menuBar1; |
358 | menuBar1 = menuBar(); | 358 | menuBar1 = menuBar(); |
359 | menuBar1->insertItem( i18n("File"), importMenu ); | 359 | menuBar1->insertItem( i18n("File"), importMenu ); |
360 | menuBar1->insertItem( i18n("View"), viewMenu ); | 360 | menuBar1->insertItem( i18n("View"), viewMenu ); |
361 | menuBar1->insertItem( i18n("Actions"), actionMenu ); | 361 | menuBar1->insertItem( i18n("Actions"), actionMenu ); |
362 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 362 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
363 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 363 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
364 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 364 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
365 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 365 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
366 | } else { | 366 | } else { |
367 | QPEMenuBar *menuBar1; | 367 | QPEMenuBar *menuBar1; |
368 | menuBar1 = new QPEMenuBar( iconToolBar ); | 368 | menuBar1 = new QPEMenuBar( iconToolBar ); |
369 | QPopupMenu *menuBar = new QPopupMenu( this ); | 369 | QPopupMenu *menuBar = new QPopupMenu( this ); |
370 | menuBar1->insertItem( i18n("ME"), menuBar); | 370 | menuBar1->insertItem( i18n("ME"), menuBar); |
371 | menuBar->insertItem( i18n("File"), importMenu ); | 371 | menuBar->insertItem( i18n("File"), importMenu ); |
372 | menuBar->insertItem( i18n("View"), viewMenu ); | 372 | menuBar->insertItem( i18n("View"), viewMenu ); |
373 | menuBar->insertItem( i18n("Actions"), actionMenu ); | 373 | menuBar->insertItem( i18n("Actions"), actionMenu ); |
374 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 374 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
375 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 375 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
376 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 376 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
377 | menuBar->insertItem( i18n("Help"), helpMenu ); | 377 | menuBar->insertItem( i18n("Help"), helpMenu ); |
378 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 378 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
379 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 379 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
380 | } | 380 | } |
381 | connect ( syncMenu, SIGNAL( activated ( int ) ), this, SLOT (slotSyncMenu( int ) ) ); | 381 | connect ( syncMenu, SIGNAL( activated ( int ) ), this, SLOT (slotSyncMenu( int ) ) ); |
382 | // ****************** | 382 | // ****************** |
383 | QAction *action; | 383 | QAction *action; |
384 | QIconSet icon; | 384 | QIconSet icon; |
385 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 385 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
386 | configureToolBarMenu->setCheckable( true ); | 386 | configureToolBarMenu->setCheckable( true ); |
387 | 387 | ||
388 | QString pathString = ""; | 388 | QString pathString = ""; |
389 | if ( !p->mToolBarMiniIcons ) { | 389 | if ( !p->mToolBarMiniIcons ) { |
390 | if ( QApplication::desktop()->width() < 480 ) | 390 | if ( QApplication::desktop()->width() < 480 ) |
391 | pathString += "icons16/"; | 391 | pathString += "icons16/"; |
392 | } else | 392 | } else |
393 | pathString += "iconsmini/"; | 393 | pathString += "iconsmini/"; |
394 | configureAgendaMenu->setCheckable( true ); | 394 | configureAgendaMenu->setCheckable( true ); |
395 | configureAgendaMenu->insertItem(i18n("Toggle Allday"), 1 ); | 395 | configureAgendaMenu->insertItem(i18n("Toggle Allday"), 1 ); |
396 | configureAgendaMenu->insertSeparator(); | 396 | configureAgendaMenu->insertSeparator(); |
397 | configureAgendaMenu->insertItem(i18n("Tiny"), 4 ); | 397 | configureAgendaMenu->insertItem(i18n("Tiny"), 4 ); |
398 | configureAgendaMenu->insertItem(i18n("Small"), 6 ); | 398 | configureAgendaMenu->insertItem(i18n("Small"), 6 ); |
399 | configureAgendaMenu->insertItem(i18n("Medium"), 8 ); | 399 | configureAgendaMenu->insertItem(i18n("Medium"), 8 ); |
400 | configureAgendaMenu->insertItem(i18n("Normal"), 10 ); | 400 | configureAgendaMenu->insertItem(i18n("Normal"), 10 ); |
401 | configureAgendaMenu->insertItem(i18n("Large"), 12 ); | 401 | configureAgendaMenu->insertItem(i18n("Large"), 12 ); |
402 | configureAgendaMenu->insertItem(i18n("Big"), 14 ); | 402 | configureAgendaMenu->insertItem(i18n("Big"), 14 ); |
403 | configureAgendaMenu->insertItem(i18n("Bigger"), 16 ); | 403 | configureAgendaMenu->insertItem(i18n("Bigger"), 16 ); |
404 | configureAgendaMenu->insertItem(i18n("Biggest"), 18 ); | 404 | configureAgendaMenu->insertItem(i18n("Biggest"), 18 ); |
405 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 405 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
406 | 406 | ||
407 | icon = loadPixmap( pathString + "configure" ); | 407 | icon = loadPixmap( pathString + "configure" ); |
408 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); | 408 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); |
409 | action->addTo( actionMenu ); | 409 | action->addTo( actionMenu ); |
410 | connect( action, SIGNAL( activated() ), | 410 | connect( action, SIGNAL( activated() ), |
411 | mView, SLOT( edit_options() ) ); | 411 | mView, SLOT( edit_options() ) ); |
412 | actionMenu->insertSeparator(); | 412 | actionMenu->insertSeparator(); |
413 | icon = loadPixmap( pathString + "newevent" ); | 413 | icon = loadPixmap( pathString + "newevent" ); |
414 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 414 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
415 | configureToolBarMenu->insertSeparator(); | 415 | configureToolBarMenu->insertSeparator(); |
416 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 416 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
417 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 417 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
418 | ne_action->addTo( actionMenu ); | 418 | ne_action->addTo( actionMenu ); |
419 | connect( ne_action, SIGNAL( activated() ), | 419 | connect( ne_action, SIGNAL( activated() ), |
420 | mView, SLOT( newEvent() ) ); | 420 | mView, SLOT( newEvent() ) ); |
421 | icon = loadPixmap( pathString + "newtodo" ); | 421 | icon = loadPixmap( pathString + "newtodo" ); |
422 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 422 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
423 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 423 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
424 | nt_action->addTo( actionMenu ); | 424 | nt_action->addTo( actionMenu ); |
425 | connect( nt_action, SIGNAL( activated() ), | 425 | connect( nt_action, SIGNAL( activated() ), |
426 | mView, SLOT( newTodo() ) ); | 426 | mView, SLOT( newTodo() ) ); |
427 | icon = loadPixmap( pathString + "navi" ); | 427 | icon = loadPixmap( pathString + "navi" ); |
428 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 428 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
429 | action->addTo( viewMenu ); | 429 | action->addTo( viewMenu ); |
430 | connect( action, SIGNAL( activated() ), | 430 | connect( action, SIGNAL( activated() ), |
431 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 431 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
432 | icon = loadPixmap( pathString + "filter" ); | 432 | icon = loadPixmap( pathString + "filter" ); |
433 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); | 433 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); |
434 | action->addTo( viewMenu ); | 434 | action->addTo( viewMenu ); |
435 | connect( action, SIGNAL( activated() ), | 435 | connect( action, SIGNAL( activated() ), |
436 | mView, SLOT( toggleFilter() ) ); | 436 | mView, SLOT( toggleFilter() ) ); |
437 | 437 | ||
438 | 438 | ||
439 | viewMenu->insertSeparator(); | 439 | viewMenu->insertSeparator(); |
440 | icon = loadPixmap( pathString + "picker" ); | 440 | icon = loadPixmap( pathString + "picker" ); |
441 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); | 441 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); |
442 | action->addTo( viewMenu ); | 442 | action->addTo( viewMenu ); |
443 | connect( action, SIGNAL( activated() ), | 443 | connect( action, SIGNAL( activated() ), |
444 | mView, SLOT( showDatePicker() ) ); | 444 | mView, SLOT( showDatePicker() ) ); |
445 | action->addTo( iconToolBar ); | 445 | action->addTo( iconToolBar ); |
446 | viewMenu->insertSeparator(); | 446 | viewMenu->insertSeparator(); |
447 | icon = loadPixmap( pathString + "list" ); | 447 | icon = loadPixmap( pathString + "list" ); |
448 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 448 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
449 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 449 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
450 | showlist_action->addTo( viewMenu ); | 450 | showlist_action->addTo( viewMenu ); |
451 | connect( showlist_action, SIGNAL( activated() ), | 451 | connect( showlist_action, SIGNAL( activated() ), |
452 | mView->viewManager(), SLOT( showListView() ) ); | 452 | mView->viewManager(), SLOT( showListView() ) ); |
453 | 453 | ||
454 | 454 | ||
455 | icon = loadPixmap( pathString + "day" ); | 455 | icon = loadPixmap( pathString + "day" ); |
456 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 456 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
457 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 457 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
458 | day1_action->addTo( viewMenu ); | 458 | day1_action->addTo( viewMenu ); |
459 | // action->addTo( toolBar ); | 459 | // action->addTo( toolBar ); |
460 | connect( day1_action, SIGNAL( activated() ), | 460 | connect( day1_action, SIGNAL( activated() ), |
461 | mView->viewManager(), SLOT( showDayView() ) ); | 461 | mView->viewManager(), SLOT( showDayView() ) ); |
462 | 462 | ||
463 | icon = loadPixmap( pathString + "workweek" ); | 463 | icon = loadPixmap( pathString + "workweek" ); |
464 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 464 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
465 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 465 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
466 | day5_action->addTo( viewMenu ); | 466 | day5_action->addTo( viewMenu ); |
467 | connect( day5_action, SIGNAL( activated() ), | 467 | connect( day5_action, SIGNAL( activated() ), |
468 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 468 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
469 | 469 | ||
470 | icon = loadPixmap( pathString + "week" ); | 470 | icon = loadPixmap( pathString + "week" ); |
471 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 471 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
472 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 472 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
473 | day7_action->addTo( viewMenu ); | 473 | day7_action->addTo( viewMenu ); |
474 | connect( day7_action, SIGNAL( activated() ), | 474 | connect( day7_action, SIGNAL( activated() ), |
475 | mView->viewManager(), SLOT( showWeekView() ) ); | 475 | mView->viewManager(), SLOT( showWeekView() ) ); |
476 | 476 | ||
477 | icon = loadPixmap( pathString + "month" ); | 477 | icon = loadPixmap( pathString + "month" ); |
478 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 478 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
479 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 479 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
480 | month_action->addTo( viewMenu ); | 480 | month_action->addTo( viewMenu ); |
481 | connect( month_action, SIGNAL( activated() ), | 481 | connect( month_action, SIGNAL( activated() ), |
482 | mView->viewManager(), SLOT( showMonthView() ) ); | 482 | mView->viewManager(), SLOT( showMonthView() ) ); |
483 | 483 | ||
484 | icon = loadPixmap( pathString + "todo" ); | 484 | icon = loadPixmap( pathString + "todo" ); |
485 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 485 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
486 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 486 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
487 | todoview_action->addTo( viewMenu ); | 487 | todoview_action->addTo( viewMenu ); |
488 | connect( todoview_action, SIGNAL( activated() ), | 488 | connect( todoview_action, SIGNAL( activated() ), |
489 | mView->viewManager(), SLOT( showTodoView() ) ); | 489 | mView->viewManager(), SLOT( showTodoView() ) ); |
490 | 490 | ||
491 | icon = loadPixmap( pathString + "journal" ); | 491 | icon = loadPixmap( pathString + "journal" ); |
492 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 492 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
493 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 493 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
494 | viewjournal_action->addTo( viewMenu ); | 494 | viewjournal_action->addTo( viewMenu ); |
495 | connect( viewjournal_action, SIGNAL( activated() ), | 495 | connect( viewjournal_action, SIGNAL( activated() ), |
496 | mView->viewManager(), SLOT( showJournalView() ) ); | 496 | mView->viewManager(), SLOT( showJournalView() ) ); |
497 | 497 | ||
498 | icon = loadPixmap( pathString + "xdays" ); | 498 | icon = loadPixmap( pathString + "xdays" ); |
499 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); | 499 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); |
500 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 500 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
501 | xdays_action->addTo( viewMenu ); | 501 | xdays_action->addTo( viewMenu ); |
502 | connect( xdays_action, SIGNAL( activated() ), | 502 | connect( xdays_action, SIGNAL( activated() ), |
503 | mView->viewManager(), SLOT( showNextXView() ) ); | 503 | mView->viewManager(), SLOT( showNextXView() ) ); |
504 | 504 | ||
505 | icon = loadPixmap( pathString + "whatsnext" ); | 505 | icon = loadPixmap( pathString + "whatsnext" ); |
506 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); | 506 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); |
507 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 507 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
508 | whatsnext_action->addTo( viewMenu ); | 508 | whatsnext_action->addTo( viewMenu ); |
509 | connect( whatsnext_action, SIGNAL( activated() ), | 509 | connect( whatsnext_action, SIGNAL( activated() ), |
510 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 510 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
511 | 511 | ||
512 | #if 0 | 512 | #if 0 |
513 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 513 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
514 | action->addTo( viewMenu ); | 514 | action->addTo( viewMenu ); |
515 | connect( action, SIGNAL( activated() ), | 515 | connect( action, SIGNAL( activated() ), |
516 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 516 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
517 | #endif | 517 | #endif |
518 | 518 | ||
519 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 519 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, |
520 | this ); | 520 | this ); |
521 | mNewSubTodoAction->addTo( actionMenu ); | 521 | mNewSubTodoAction->addTo( actionMenu ); |
522 | connect( mNewSubTodoAction, SIGNAL( activated() ), | 522 | connect( mNewSubTodoAction, SIGNAL( activated() ), |
523 | mView, SLOT( newSubTodo() ) ); | 523 | mView, SLOT( newSubTodo() ) ); |
524 | 524 | ||
525 | actionMenu->insertSeparator(); | 525 | actionMenu->insertSeparator(); |
526 | 526 | ||
527 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); | 527 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); |
528 | mShowAction->addTo( actionMenu ); | 528 | mShowAction->addTo( actionMenu ); |
529 | connect( mShowAction, SIGNAL( activated() ), | 529 | connect( mShowAction, SIGNAL( activated() ), |
530 | mView, SLOT( showIncidence() ) ); | 530 | mView, SLOT( showIncidence() ) ); |
531 | 531 | ||
532 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 532 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
533 | mEditAction->addTo( actionMenu ); | 533 | mEditAction->addTo( actionMenu ); |
534 | connect( mEditAction, SIGNAL( activated() ), | 534 | connect( mEditAction, SIGNAL( activated() ), |
535 | mView, SLOT( editIncidence() ) ); | 535 | mView, SLOT( editIncidence() ) ); |
536 | 536 | ||
537 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 537 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
538 | mDeleteAction->addTo( actionMenu ); | 538 | mDeleteAction->addTo( actionMenu ); |
539 | connect( mDeleteAction, SIGNAL( activated() ), | 539 | connect( mDeleteAction, SIGNAL( activated() ), |
540 | mView, SLOT( deleteIncidence() ) ); | 540 | mView, SLOT( deleteIncidence() ) ); |
541 | 541 | ||
542 | actionMenu->insertSeparator(); | 542 | actionMenu->insertSeparator(); |
543 | 543 | ||
544 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, | 544 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, |
545 | this ); | 545 | this ); |
546 | action->addTo( actionMenu ); | 546 | action->addTo( actionMenu ); |
547 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 547 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
548 | 548 | ||
549 | icon = loadPixmap( pathString + "search" ); | 549 | icon = loadPixmap( pathString + "search" ); |
550 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 550 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
551 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); | 551 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); |
552 | search_action->addTo( actionMenu ); | 552 | search_action->addTo( actionMenu ); |
553 | connect( search_action, SIGNAL( activated() ), | 553 | connect( search_action, SIGNAL( activated() ), |
554 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 554 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
555 | 555 | ||
556 | icon = loadPixmap( pathString + "today" ); | 556 | icon = loadPixmap( pathString + "today" ); |
557 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); | 557 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); |
558 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 558 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
559 | today_action->addTo( actionMenu ); | 559 | today_action->addTo( actionMenu ); |
560 | connect( today_action, SIGNAL( activated() ), | 560 | connect( today_action, SIGNAL( activated() ), |
561 | mView, SLOT( goToday() ) ); | 561 | mView, SLOT( goToday() ) ); |
562 | 562 | ||
563 | if ( KOPrefs::instance()->mShowFullMenu ) { | 563 | if ( KOPrefs::instance()->mShowFullMenu ) { |
564 | actionMenu->insertSeparator(); | 564 | actionMenu->insertSeparator(); |
565 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 565 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
566 | 566 | ||
567 | } | 567 | } |
568 | // actionMenu->insertSeparator(); | 568 | // actionMenu->insertSeparator(); |
569 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 569 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
570 | this ); | 570 | this ); |
571 | action->addTo( importMenu ); | 571 | action->addTo( importMenu ); |
572 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 572 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
573 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 573 | action = new QAction( "import_quick", i18n("Import last file"), 0, |
574 | this ); | 574 | this ); |
575 | action->addTo( importMenu ); | 575 | action->addTo( importMenu ); |
576 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 576 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
577 | importMenu->insertSeparator(); | 577 | importMenu->insertSeparator(); |
578 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 578 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
579 | this ); | 579 | this ); |
580 | action->addTo( importMenu ); | 580 | action->addTo( importMenu ); |
581 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 581 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
582 | #ifndef DESKTOP_VERSION | 582 | #ifndef DESKTOP_VERSION |
583 | importMenu->insertSeparator(); | 583 | importMenu->insertSeparator(); |
584 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 584 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
585 | this ); | 585 | this ); |
586 | action->addTo( importMenu ); | 586 | action->addTo( importMenu ); |
587 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 587 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
588 | #else | 588 | #else |
589 | #ifdef _WIN32_ | 589 | #ifdef _WIN32_ |
590 | importMenu->insertSeparator(); | 590 | importMenu->insertSeparator(); |
591 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | 591 | action = new QAction( "import_ol", i18n("Import from OL"), 0, |
592 | this ); | 592 | this ); |
593 | action->addTo( importMenu ); | 593 | action->addTo( importMenu ); |
594 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); | 594 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); |
595 | #endif | 595 | #endif |
596 | #endif | 596 | #endif |
597 | 597 | ||
598 | importMenu->insertSeparator(); | 598 | importMenu->insertSeparator(); |
599 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, | 599 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, |
600 | this ); | 600 | this ); |
601 | action->addTo( importMenu ); | 601 | action->addTo( importMenu ); |
602 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); | 602 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); |
603 | 603 | ||
604 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, | 604 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, |
605 | this ); | 605 | this ); |
606 | action->addTo( importMenu ); | 606 | action->addTo( importMenu ); |
607 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); | 607 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); |
608 | 608 | ||
609 | importMenu->insertSeparator(); | 609 | importMenu->insertSeparator(); |
610 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, | 610 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, |
611 | this ); | 611 | this ); |
612 | action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); | 612 | action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); |
613 | importMenu->insertSeparator(); | 613 | importMenu->insertSeparator(); |
614 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | 614 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, |
615 | this ); | 615 | this ); |
616 | action->addTo( importMenu ); | 616 | action->addTo( importMenu ); |
617 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); | 617 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); |
618 | #ifndef DESKTOP_VERSION | 618 | #ifndef DESKTOP_VERSION |
619 | importMenu->insertSeparator(); | 619 | importMenu->insertSeparator(); |
620 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, | 620 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, |
621 | this ); | 621 | this ); |
622 | action->addTo( importMenu ); | 622 | action->addTo( importMenu ); |
623 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); | 623 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); |
624 | 624 | ||
625 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 625 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, |
626 | this ); | 626 | this ); |
627 | action->addTo( importMenu ); | 627 | action->addTo( importMenu ); |
628 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 628 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
629 | #else | 629 | #else |
630 | importMenu->insertSeparator(); | 630 | importMenu->insertSeparator(); |
631 | icon = loadPixmap( pathString + "print" ); | 631 | icon = loadPixmap( pathString + "print" ); |
632 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); | 632 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); |
633 | action->addTo( importMenu ); | 633 | action->addTo( importMenu ); |
634 | connect( action, SIGNAL( activated() ), | 634 | connect( action, SIGNAL( activated() ), |
635 | this, SLOT( printCal() ) ); | 635 | this, SLOT( printCal() ) ); |
636 | 636 | ||
637 | icon = loadPixmap( pathString + "print" ); | 637 | icon = loadPixmap( pathString + "print" ); |
638 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); | 638 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); |
639 | action->addTo( importMenu ); | 639 | action->addTo( importMenu ); |
640 | connect( action, SIGNAL( activated() ), | 640 | connect( action, SIGNAL( activated() ), |
641 | this, SLOT( printSel() ) ); | 641 | this, SLOT( printSel() ) ); |
642 | #endif | 642 | #endif |
643 | importMenu->insertSeparator(); | 643 | importMenu->insertSeparator(); |
644 | action = new QAction( "beam all", i18n("Save"), 0, | 644 | action = new QAction( "beam all", i18n("Save"), 0, |
645 | this ); | 645 | this ); |
646 | action->addTo( importMenu ); | 646 | action->addTo( importMenu ); |
647 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); | 647 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); |
648 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, | 648 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, |
649 | this ); | 649 | this ); |
650 | action->addTo( importMenu ); | 650 | action->addTo( importMenu ); |
651 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); | 651 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); |
652 | 652 | ||
653 | //menuBar->insertItem( "Configure",configureMenu ); | 653 | //menuBar->insertItem( "Configure",configureMenu ); |
654 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); | 654 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); |
655 | icon = loadPixmap( "korganizer/korganizer" ); | 655 | icon = loadPixmap( "korganizer/korganizer" ); |
656 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); | 656 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); |
657 | action->addTo( helpMenu ); | 657 | action->addTo( helpMenu ); |
658 | connect( action, SIGNAL( activated() ), | 658 | connect( action, SIGNAL( activated() ), |
659 | SLOT( keyBindings() ) ); | 659 | SLOT( keyBindings() ) ); |
660 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); | 660 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); |
661 | action->addTo( helpMenu ); | 661 | action->addTo( helpMenu ); |
662 | connect( action, SIGNAL( activated() ), | 662 | connect( action, SIGNAL( activated() ), |
663 | SLOT( features() ) ); | 663 | SLOT( features() ) ); |
664 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); | 664 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); |
665 | action->addTo( helpMenu ); | 665 | action->addTo( helpMenu ); |
666 | connect( action, SIGNAL( activated() ), | 666 | connect( action, SIGNAL( activated() ), |
667 | SLOT( aboutAutoSaving() ) ); | 667 | SLOT( aboutAutoSaving() ) ); |
668 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); | 668 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); |
669 | action->addTo( helpMenu ); | 669 | action->addTo( helpMenu ); |
670 | connect( action, SIGNAL( activated() ), | 670 | connect( action, SIGNAL( activated() ), |
671 | SLOT( aboutKnownBugs() ) ); | 671 | SLOT( aboutKnownBugs() ) ); |
672 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); | 672 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); |
673 | action->addTo( helpMenu ); | 673 | action->addTo( helpMenu ); |
674 | connect( action, SIGNAL( activated() ), | 674 | connect( action, SIGNAL( activated() ), |
675 | SLOT( usertrans() ) ); | 675 | SLOT( usertrans() ) ); |
676 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); | 676 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); |
677 | action->addTo( helpMenu ); | 677 | action->addTo( helpMenu ); |
678 | connect( action, SIGNAL( activated() ), | 678 | connect( action, SIGNAL( activated() ), |
679 | SLOT( synchowto() ) ); | 679 | SLOT( synchowto() ) ); |
680 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); | 680 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); |
681 | action->addTo( helpMenu ); | 681 | action->addTo( helpMenu ); |
682 | connect( action, SIGNAL( activated() ), | 682 | connect( action, SIGNAL( activated() ), |
683 | SLOT( whatsNew() ) ); | 683 | SLOT( whatsNew() ) ); |
684 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); | 684 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); |
685 | action->addTo( helpMenu ); | 685 | action->addTo( helpMenu ); |
686 | connect( action, SIGNAL( activated() ), | 686 | connect( action, SIGNAL( activated() ), |
687 | SLOT( faq() ) ); | 687 | SLOT( faq() ) ); |
688 | 688 | ||
689 | 689 | ||
690 | action = new QAction( "about", i18n("About..."), 0, this ); | 690 | action = new QAction( "about", i18n("About..."), 0, this ); |
691 | action->addTo( helpMenu ); | 691 | action->addTo( helpMenu ); |
692 | connect( action, SIGNAL( activated() ), | 692 | connect( action, SIGNAL( activated() ), |
693 | SLOT( about() ) ); | 693 | SLOT( about() ) ); |
694 | //menuBar->insertSeparator(); | 694 | //menuBar->insertSeparator(); |
695 | 695 | ||
696 | // ****************************************************** | 696 | // ****************************************************** |
697 | // menubar icons | 697 | // menubar icons |
698 | 698 | ||
699 | 699 | ||
700 | iconToolBar->setHorizontalStretchable (true ); | 700 | iconToolBar->setHorizontalStretchable (true ); |
701 | //menuBar->insertItem( iconToolBar ); | 701 | //menuBar->insertItem( iconToolBar ); |
702 | //xdays_action | 702 | //xdays_action |
703 | if (p-> mShowIconNewEvent) | 703 | if (p-> mShowIconNewEvent) |
704 | ne_action->addTo( iconToolBar ); | 704 | ne_action->addTo( iconToolBar ); |
705 | if (p->mShowIconNewTodo ) | 705 | if (p->mShowIconNewTodo ) |
706 | nt_action->addTo( iconToolBar ); | 706 | nt_action->addTo( iconToolBar ); |
707 | if (p-> mShowIconSearch) | 707 | if (p-> mShowIconSearch) |
708 | search_action->addTo( iconToolBar ); | 708 | search_action->addTo( iconToolBar ); |
709 | if (p-> mShowIconNext) | 709 | if (p-> mShowIconNext) |
710 | whatsnext_action->addTo( iconToolBar ); | 710 | whatsnext_action->addTo( iconToolBar ); |
711 | if (p-> mShowIconNextDays) | 711 | if (p-> mShowIconNextDays) |
712 | xdays_action->addTo( iconToolBar ); | 712 | xdays_action->addTo( iconToolBar ); |
713 | if (p-> mShowIconList) | 713 | if (p-> mShowIconList) |
714 | showlist_action->addTo( iconToolBar ); | 714 | showlist_action->addTo( iconToolBar ); |
715 | if (p-> mShowIconDay1) | 715 | if (p-> mShowIconDay1) |
716 | day1_action->addTo( iconToolBar ); | 716 | day1_action->addTo( iconToolBar ); |
717 | if (p-> mShowIconDay5) | 717 | if (p-> mShowIconDay5) |
718 | day5_action->addTo( iconToolBar ); | 718 | day5_action->addTo( iconToolBar ); |
719 | if (p-> mShowIconDay7) | 719 | if (p-> mShowIconDay7) |
720 | day7_action->addTo( iconToolBar ); | 720 | day7_action->addTo( iconToolBar ); |
721 | if (p-> mShowIconMonth) | 721 | if (p-> mShowIconMonth) |
722 | month_action->addTo( iconToolBar ); | 722 | month_action->addTo( iconToolBar ); |
723 | if (p-> mShowIconTodoview) | 723 | if (p-> mShowIconTodoview) |
724 | todoview_action->addTo( iconToolBar ); | 724 | todoview_action->addTo( iconToolBar ); |
725 | if (p-> mShowIconJournal) | 725 | if (p-> mShowIconJournal) |
726 | viewjournal_action->addTo( iconToolBar ); | 726 | viewjournal_action->addTo( iconToolBar ); |
727 | icon = loadPixmap( pathString + "2leftarrowB" ); | 727 | icon = loadPixmap( pathString + "2leftarrowB" ); |
728 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); | 728 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); |
729 | if (p-> mShowIconBackFast) { | 729 | if (p-> mShowIconBackFast) { |
730 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); | 730 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); |
731 | connect( action, SIGNAL( activated() ), | 731 | connect( action, SIGNAL( activated() ), |
732 | mView, SLOT( goPreviousMonth() ) ); | 732 | mView, SLOT( goPreviousMonth() ) ); |
733 | action->addTo( iconToolBar ); | 733 | action->addTo( iconToolBar ); |
734 | } | 734 | } |
735 | icon = loadPixmap( pathString + "1leftarrowB" ); | 735 | icon = loadPixmap( pathString + "1leftarrowB" ); |
736 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); | 736 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); |
737 | if (p-> mShowIconBack) { | 737 | if (p-> mShowIconBack) { |
738 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); | 738 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); |
739 | connect( action, SIGNAL( activated() ), | 739 | connect( action, SIGNAL( activated() ), |
740 | mView, SLOT( goPrevious() ) ); | 740 | mView, SLOT( goPrevious() ) ); |
741 | action->addTo( iconToolBar ); | 741 | action->addTo( iconToolBar ); |
742 | } | 742 | } |
743 | if (p-> mShowIconToday) | 743 | if (p-> mShowIconToday) |
744 | today_action->addTo( iconToolBar ); | 744 | today_action->addTo( iconToolBar ); |
745 | icon = loadPixmap( pathString + "1rightarrowB" ); | 745 | icon = loadPixmap( pathString + "1rightarrowB" ); |
746 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); | 746 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); |
747 | if (p-> mShowIconForward) { | 747 | if (p-> mShowIconForward) { |
748 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); | 748 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); |
749 | connect( action, SIGNAL( activated() ), | 749 | connect( action, SIGNAL( activated() ), |
750 | mView, SLOT( goNext() ) ); | 750 | mView, SLOT( goNext() ) ); |
751 | action->addTo( iconToolBar ); | 751 | action->addTo( iconToolBar ); |
752 | } | 752 | } |
753 | icon = loadPixmap( pathString + "2rightarrowB" ); | 753 | icon = loadPixmap( pathString + "2rightarrowB" ); |
754 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); | 754 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); |
755 | if (p-> mShowIconForwardFast) { | 755 | if (p-> mShowIconForwardFast) { |
756 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); | 756 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); |
757 | connect( action, SIGNAL( activated() ), | 757 | connect( action, SIGNAL( activated() ), |
758 | mView, SLOT( goNextMonth() ) ); | 758 | mView, SLOT( goNextMonth() ) ); |
759 | action->addTo( iconToolBar ); | 759 | action->addTo( iconToolBar ); |
760 | } | 760 | } |
761 | 761 | ||
762 | 762 | ||
763 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); | 763 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); |
764 | 764 | ||
765 | if (p-> mShowIconNewEvent) | 765 | if (p-> mShowIconNewEvent) |
766 | configureToolBarMenu->setItemChecked( 10, true ); | 766 | configureToolBarMenu->setItemChecked( 10, true ); |
767 | if (p->mShowIconNewTodo ) | 767 | if (p->mShowIconNewTodo ) |
768 | configureToolBarMenu->setItemChecked( 20, true ); | 768 | configureToolBarMenu->setItemChecked( 20, true ); |
769 | if (p-> mShowIconSearch) | 769 | if (p-> mShowIconSearch) |
770 | configureToolBarMenu->setItemChecked( 120, true ); | 770 | configureToolBarMenu->setItemChecked( 120, true ); |
771 | if (p-> mShowIconList) | 771 | if (p-> mShowIconList) |
772 | configureToolBarMenu->setItemChecked( 30, true ); | 772 | configureToolBarMenu->setItemChecked( 30, true ); |
773 | if (p-> mShowIconDay1) | 773 | if (p-> mShowIconDay1) |
774 | configureToolBarMenu->setItemChecked( 40, true ); | 774 | configureToolBarMenu->setItemChecked( 40, true ); |
775 | if (p-> mShowIconDay5) | 775 | if (p-> mShowIconDay5) |
776 | configureToolBarMenu->setItemChecked( 50, true ); | 776 | configureToolBarMenu->setItemChecked( 50, true ); |
777 | if (p-> mShowIconDay7) | 777 | if (p-> mShowIconDay7) |
778 | configureToolBarMenu->setItemChecked( 60, true ); | 778 | configureToolBarMenu->setItemChecked( 60, true ); |
779 | if (p-> mShowIconMonth) | 779 | if (p-> mShowIconMonth) |
780 | configureToolBarMenu->setItemChecked( 70, true ); | 780 | configureToolBarMenu->setItemChecked( 70, true ); |
781 | if (p-> mShowIconTodoview) | 781 | if (p-> mShowIconTodoview) |
782 | configureToolBarMenu->setItemChecked( 80, true ); | 782 | configureToolBarMenu->setItemChecked( 80, true ); |
783 | if (p-> mShowIconBackFast) | 783 | if (p-> mShowIconBackFast) |
784 | configureToolBarMenu->setItemChecked( 200, true ); | 784 | configureToolBarMenu->setItemChecked( 200, true ); |
785 | if (p-> mShowIconBack) | 785 | if (p-> mShowIconBack) |
786 | configureToolBarMenu->setItemChecked( 210, true ); | 786 | configureToolBarMenu->setItemChecked( 210, true ); |
787 | if (p-> mShowIconToday) | 787 | if (p-> mShowIconToday) |
788 | configureToolBarMenu->setItemChecked( 130, true ); | 788 | configureToolBarMenu->setItemChecked( 130, true ); |
789 | if (p-> mShowIconForward) | 789 | if (p-> mShowIconForward) |
790 | configureToolBarMenu->setItemChecked( 220, true ); | 790 | configureToolBarMenu->setItemChecked( 220, true ); |
791 | if (p-> mShowIconForwardFast) | 791 | if (p-> mShowIconForwardFast) |
792 | configureToolBarMenu->setItemChecked( 230, true ); | 792 | configureToolBarMenu->setItemChecked( 230, true ); |
793 | if (p-> mShowIconNextDays) | 793 | if (p-> mShowIconNextDays) |
794 | configureToolBarMenu->setItemChecked( 100, true ); | 794 | configureToolBarMenu->setItemChecked( 100, true ); |
795 | if (p-> mShowIconNext) | 795 | if (p-> mShowIconNext) |
796 | configureToolBarMenu->setItemChecked( 110, true ); | 796 | configureToolBarMenu->setItemChecked( 110, true ); |
797 | if (p-> mShowIconJournal) | 797 | if (p-> mShowIconJournal) |
798 | configureToolBarMenu->setItemChecked( 90, true ); | 798 | configureToolBarMenu->setItemChecked( 90, true ); |
799 | if (p-> mShowIconWhatsThis) | 799 | if (p-> mShowIconWhatsThis) |
800 | configureToolBarMenu->setItemChecked( 300, true ); | 800 | configureToolBarMenu->setItemChecked( 300, true ); |
801 | 801 | ||
802 | QLabel* dummy = new QLabel( iconToolBar ); | 802 | QLabel* dummy = new QLabel( iconToolBar ); |
803 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); | 803 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); |
804 | if (!p-> mShowIconStretch) | 804 | if (!p-> mShowIconStretch) |
805 | iconToolBar->setStretchableWidget ( dummy ) ; | 805 | iconToolBar->setStretchableWidget ( dummy ) ; |
806 | else | 806 | else |
807 | configureToolBarMenu->setItemChecked( 5, true ); | 807 | configureToolBarMenu->setItemChecked( 5, true ); |
808 | if (p-> mShowIconWhatsThis) | 808 | if (p-> mShowIconWhatsThis) |
809 | QWhatsThis::whatsThisButton ( iconToolBar ); | 809 | QWhatsThis::whatsThisButton ( iconToolBar ); |
810 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 810 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
811 | configureAgenda( p->mHourSize ); | 811 | configureAgenda( p->mHourSize ); |
812 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 812 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
813 | } | 813 | } |
814 | void MainWindow::fillSyncMenu() | 814 | void MainWindow::fillSyncMenu() |
815 | { | 815 | { |
816 | syncMenu->clear(); | 816 | syncMenu->clear(); |
817 | syncMenu->insertItem( i18n("Configure..."), 0 ); | 817 | syncMenu->insertItem( i18n("Configure..."), 0 ); |
818 | syncMenu->insertSeparator(); | 818 | syncMenu->insertSeparator(); |
819 | syncMenu->insertItem( i18n("Multiple sync"), 1 ); | 819 | syncMenu->insertItem( i18n("Multiple sync"), 1 ); |
820 | syncMenu->insertSeparator(); | 820 | syncMenu->insertSeparator(); |
821 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); | 821 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
822 | config.setGroup("SyncProfiles"); | 822 | config.setGroup("SyncProfiles"); |
823 | QStringList prof = config.readListEntry("SyncProfileNames"); | 823 | QStringList prof = config.readListEntry("SyncProfileNames"); |
824 | KOPrefs::instance()->mLocalMachineName = config.readEntry("LocalMachineName","undefined"); | 824 | KOPrefs::instance()->mLocalMachineName = config.readEntry("LocalMachineName","undefined"); |
825 | if ( prof.count() < 3 ) { | 825 | if ( prof.count() < 3 ) { |
826 | prof.clear(); | 826 | prof.clear(); |
827 | prof << i18n("Sharp-DTM"); | 827 | prof << i18n("Sharp-DTM"); |
828 | prof << i18n("Local file"); | 828 | prof << i18n("Local file"); |
829 | prof << i18n("Last file"); | 829 | prof << i18n("Last file"); |
830 | KSyncProfile* temp = new KSyncProfile (); | 830 | KSyncProfile* temp = new KSyncProfile (); |
831 | temp->setName( prof[0] ); | 831 | temp->setName( prof[0] ); |
832 | temp->writeConfig(&config); | 832 | temp->writeConfig(&config); |
833 | temp->setName( prof[1] ); | 833 | temp->setName( prof[1] ); |
834 | temp->writeConfig(&config); | 834 | temp->writeConfig(&config); |
835 | temp->setName( prof[2] ); | 835 | temp->setName( prof[2] ); |
836 | temp->writeConfig(&config); | 836 | temp->writeConfig(&config); |
837 | config.setGroup("SyncProfiles"); | 837 | config.setGroup("SyncProfiles"); |
838 | config.writeEntry("SyncProfileNames",prof); | 838 | config.writeEntry("SyncProfileNames",prof); |
839 | config.sync(); | 839 | config.sync(); |
840 | delete temp; | 840 | delete temp; |
841 | } | 841 | } |
842 | KOPrefs::instance()->mSyncProfileNames = prof; | 842 | KOPrefs::instance()->mSyncProfileNames = prof; |
843 | int i; | 843 | int i; |
844 | for ( i = 0; i < prof.count(); ++i ) { | 844 | for ( i = 0; i < prof.count(); ++i ) { |
845 | 845 | ||
846 | syncMenu->insertItem( prof[i], 1000+i ); | 846 | syncMenu->insertItem( prof[i], 1000+i ); |
847 | if ( i == 2 ) | 847 | if ( i == 2 ) |
848 | syncMenu->insertSeparator(); | 848 | syncMenu->insertSeparator(); |
849 | } | 849 | } |
850 | QDir app_dir; | 850 | QDir app_dir; |
851 | if ( !app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { | 851 | if ( !app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { |
852 | syncMenu->setItemEnabled( false , 1000 ); | 852 | syncMenu->setItemEnabled( false , 1000 ); |
853 | } | 853 | } |
854 | } | 854 | } |
855 | 855 | ||
856 | int MainWindow::ringSync() | 856 | int MainWindow::ringSync() |
857 | { | 857 | { |
858 | int syncedProfiles = 0; | 858 | int syncedProfiles = 0; |
859 | int i; | 859 | int i; |
860 | QTime timer; | 860 | QTime timer; |
861 | KConfig *config = KOGlobals::config(); | 861 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
862 | QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; | 862 | QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; |
863 | KSyncProfile* temp = new KSyncProfile (); | 863 | KSyncProfile* temp = new KSyncProfile (); |
864 | KOPrefs::instance()->mAskForPreferences = false; | 864 | KOPrefs::instance()->mAskForPreferences = false; |
865 | for ( i = 0; i < syncProfileNames.count(); ++i ) { | 865 | for ( i = 0; i < syncProfileNames.count(); ++i ) { |
866 | mCurrentSyncProfile = i; | 866 | mCurrentSyncProfile = i; |
867 | temp->setName(syncProfileNames[mCurrentSyncProfile]); | 867 | temp->setName(syncProfileNames[mCurrentSyncProfile]); |
868 | temp->readConfig(config); | 868 | temp->readConfig(&config); |
869 | if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) { | 869 | if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) { |
870 | setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); | 870 | setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); |
871 | ++syncedProfiles; | 871 | ++syncedProfiles; |
872 | // KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); | 872 | // KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); |
873 | KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); | 873 | KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); |
874 | KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); | 874 | KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); |
875 | KOPrefs::instance()->mShowSyncSummary = false; | 875 | KOPrefs::instance()->mShowSyncSummary = false; |
876 | mView->setSyncDevice(syncProfileNames[i] ); | 876 | mView->setSyncDevice(syncProfileNames[i] ); |
877 | mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); | 877 | mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); |
878 | if ( i == 0 ) { | 878 | if ( i == 0 ) { |
879 | syncSharp(); | 879 | syncSharp(); |
880 | } else { | 880 | } else { |
881 | if ( temp->getIsLocalFileSync() ) { | 881 | if ( temp->getIsLocalFileSync() ) { |
882 | if ( syncWithFile( temp->getRemoteFileName( ), true ) ) | 882 | if ( syncWithFile( temp->getRemoteFileName( ), true ) ) |
883 | KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); | 883 | KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); |
884 | } else { | 884 | } else { |
885 | syncRemote( temp, false ); | 885 | syncRemote( temp, false ); |
886 | 886 | ||
887 | } | 887 | } |
888 | } | 888 | } |
889 | timer.start(); | 889 | timer.start(); |
890 | setCaption(i18n("Multiple sync in progress ... please wait!") ); | 890 | setCaption(i18n("Multiple sync in progress ... please wait!") ); |
891 | while ( timer.elapsed () < 2000 ) { | 891 | while ( timer.elapsed () < 2000 ) { |
892 | qApp->processEvents(); | 892 | qApp->processEvents(); |
893 | #ifndef _WIN32_ | 893 | #ifndef _WIN32_ |
894 | sleep (1); | 894 | sleep (1); |
895 | #endif | 895 | #endif |
896 | } | 896 | } |
897 | 897 | ||
898 | } | 898 | } |
899 | 899 | ||
900 | } | 900 | } |
901 | delete temp; | 901 | delete temp; |
902 | return syncedProfiles; | 902 | return syncedProfiles; |
903 | } | 903 | } |
904 | 904 | ||
905 | void MainWindow::multiSync( bool askforPrefs ) | 905 | void MainWindow::multiSync( bool askforPrefs ) |
906 | { | 906 | { |
907 | if (mBlockSaveFlag) | 907 | if (mBlockSaveFlag) |
908 | return; | 908 | return; |
909 | mBlockSaveFlag = true; | 909 | mBlockSaveFlag = true; |
910 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); | 910 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); |
911 | if ( QMessageBox::information( this, i18n("KO/Pi Sync"), | 911 | if ( QMessageBox::information( this, i18n("KO/Pi Sync"), |
912 | question, | 912 | question, |
913 | i18n("Yes"), i18n("No"), | 913 | i18n("Yes"), i18n("No"), |
914 | 0, 0 ) != 0 ) { | 914 | 0, 0 ) != 0 ) { |
915 | mBlockSaveFlag = false; | 915 | mBlockSaveFlag = false; |
916 | setCaption(i18n("Aborted! Nothing synced!")); | 916 | setCaption(i18n("Aborted! Nothing synced!")); |
917 | return; | 917 | return; |
918 | } | 918 | } |
919 | mView->setSyncDevice(i18n("Multiple profiles") ); | 919 | mView->setSyncDevice(i18n("Multiple profiles") ); |
920 | KOPrefs::instance()->mSyncAlgoPrefs = KOPrefs::instance()->mRingSyncAlgoPrefs; | 920 | KOPrefs::instance()->mSyncAlgoPrefs = KOPrefs::instance()->mRingSyncAlgoPrefs; |
921 | if ( askforPrefs ) { | 921 | if ( askforPrefs ) { |
922 | mView->edit_sync_options(); | 922 | mView->edit_sync_options(); |
923 | KOPrefs::instance()->mRingSyncAlgoPrefs = KOPrefs::instance()->mSyncAlgoPrefs; | 923 | KOPrefs::instance()->mRingSyncAlgoPrefs = KOPrefs::instance()->mSyncAlgoPrefs; |
924 | } | 924 | } |
925 | setCaption(i18n("Multiple sync started.") ); | 925 | setCaption(i18n("Multiple sync started.") ); |
926 | qApp->processEvents(); | 926 | qApp->processEvents(); |
927 | int num = ringSync() ; | 927 | int num = ringSync() ; |
928 | if ( num > 1 ) | 928 | if ( num > 1 ) |
929 | ringSync(); | 929 | ringSync(); |
930 | mBlockSaveFlag = false; | 930 | mBlockSaveFlag = false; |
931 | if ( num ) | 931 | if ( num ) |
932 | save(); | 932 | save(); |
933 | if ( num ) | 933 | if ( num ) |
934 | setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) ); | 934 | setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) ); |
935 | else | 935 | else |
936 | setCaption(i18n("Nothing synced! No profiles defined for multisync!")); | 936 | setCaption(i18n("Nothing synced! No profiles defined for multisync!")); |
937 | return; | 937 | return; |
938 | } | 938 | } |
939 | void MainWindow::slotSyncMenu( int action ) | 939 | void MainWindow::slotSyncMenu( int action ) |
940 | { | 940 | { |
941 | //qDebug("syncaction %d ", action); | 941 | //qDebug("syncaction %d ", action); |
942 | if ( action == 0 ) { | 942 | if ( action == 0 ) { |
943 | 943 | ||
944 | confSync(); | 944 | confSync(); |
945 | 945 | ||
946 | return; | 946 | return; |
947 | } | 947 | } |
948 | if ( action == 1 ) { | 948 | if ( action == 1 ) { |
949 | multiSync( true ); | 949 | multiSync( true ); |
950 | return; | 950 | return; |
951 | } | 951 | } |
952 | 952 | ||
953 | if (mBlockSaveFlag) | 953 | if (mBlockSaveFlag) |
954 | return; | 954 | return; |
955 | mBlockSaveFlag = true; | 955 | mBlockSaveFlag = true; |
956 | mCurrentSyncProfile = action - 1000 ; | 956 | mCurrentSyncProfile = action - 1000 ; |
957 | mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] ); | 957 | mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] ); |
958 | mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); | 958 | mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); |
959 | KConfig *config = KOGlobals::config(); | 959 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
960 | KSyncProfile* temp = new KSyncProfile (); | 960 | KSyncProfile* temp = new KSyncProfile (); |
961 | temp->setName(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); | 961 | temp->setName(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); |
962 | temp->readConfig(config); | 962 | temp->readConfig(&config); |
963 | KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); | 963 | KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); |
964 | KOPrefs::instance()->mSyncAlgoPrefs = temp->getSyncPrefs(); | 964 | KOPrefs::instance()->mSyncAlgoPrefs = temp->getSyncPrefs(); |
965 | KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); | 965 | KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); |
966 | KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); | 966 | KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); |
967 | KOPrefs::instance()->mShowSyncSummary = temp->getShowSummaryAfterSync(); | 967 | KOPrefs::instance()->mShowSyncSummary = temp->getShowSummaryAfterSync(); |
968 | if ( action == 1000 ) { | 968 | if ( action == 1000 ) { |
969 | syncSharp(); | 969 | syncSharp(); |
970 | 970 | ||
971 | } else if ( action == 1001 ) { | 971 | } else if ( action == 1001 ) { |
972 | syncLocalFile(); | 972 | syncLocalFile(); |
973 | 973 | ||
974 | } else if ( action == 1002 ) { | 974 | } else if ( action == 1002 ) { |
975 | quickSyncLocalFile(); | 975 | quickSyncLocalFile(); |
976 | 976 | ||
977 | } else if ( action >= 1003 ) { | 977 | } else if ( action >= 1003 ) { |
978 | if ( temp->getIsLocalFileSync() ) { | 978 | if ( temp->getIsLocalFileSync() ) { |
979 | if ( syncWithFile( temp->getRemoteFileName( ), false ) ) | 979 | if ( syncWithFile( temp->getRemoteFileName( ), false ) ) |
980 | KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); | 980 | KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); |
981 | } else { | 981 | } else { |
982 | syncRemote( temp ); | 982 | syncRemote( temp ); |
983 | 983 | ||
984 | } | 984 | } |
985 | } | 985 | } |
986 | delete temp; | 986 | delete temp; |
987 | mBlockSaveFlag = false; | 987 | mBlockSaveFlag = false; |
988 | } | 988 | } |
989 | void MainWindow::setDefaultPreferences() | 989 | void MainWindow::setDefaultPreferences() |
990 | { | 990 | { |
991 | KOPrefs *p = KOPrefs::instance(); | 991 | KOPrefs *p = KOPrefs::instance(); |
992 | 992 | ||
993 | p->mCompactDialogs = true; | 993 | p->mCompactDialogs = true; |
994 | p->mConfirm = true; | 994 | p->mConfirm = true; |
995 | // p->mEnableQuickTodo = false; | 995 | // p->mEnableQuickTodo = false; |
996 | } | 996 | } |
997 | 997 | ||
998 | QString MainWindow::resourcePath() | 998 | QString MainWindow::resourcePath() |
999 | { | 999 | { |
1000 | return KGlobal::iconLoader()->iconPath(); | 1000 | return KGlobal::iconLoader()->iconPath(); |
1001 | } | 1001 | } |
1002 | 1002 | ||
1003 | void MainWindow::displayText( QString text ,QString cap ) | 1003 | void MainWindow::displayText( QString text ,QString cap ) |
1004 | { | 1004 | { |
1005 | QDialog dia( this, "name", true ); ; | 1005 | QDialog dia( this, "name", true ); ; |
1006 | dia.setCaption( cap ); | 1006 | dia.setCaption( cap ); |
1007 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 1007 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
1008 | lay->setSpacing( 3 ); | 1008 | lay->setSpacing( 3 ); |
1009 | lay->setMargin( 3 ); | 1009 | lay->setMargin( 3 ); |
1010 | QTextBrowser tb ( &dia ); | 1010 | QTextBrowser tb ( &dia ); |
1011 | lay->addWidget( &tb ); | 1011 | lay->addWidget( &tb ); |
1012 | tb.setText( text ); | 1012 | tb.setText( text ); |
1013 | #ifdef DESKTOP_VERSION | 1013 | #ifdef DESKTOP_VERSION |
1014 | dia.resize( 640, 480); | 1014 | dia.resize( 640, 480); |
1015 | #else | 1015 | #else |
1016 | dia.showMaximized(); | 1016 | dia.showMaximized(); |
1017 | #endif | 1017 | #endif |
1018 | dia.exec(); | 1018 | dia.exec(); |
1019 | } | 1019 | } |
1020 | void MainWindow::displayFile( QString fn, QString cap ) | 1020 | void MainWindow::displayFile( QString fn, QString cap ) |
1021 | { | 1021 | { |
1022 | QString fileName = resourcePath() + fn; | 1022 | QString fileName = resourcePath() + fn; |
1023 | QString text; | 1023 | QString text; |
1024 | QFile file( fileName ); | 1024 | QFile file( fileName ); |
1025 | if (!file.open( IO_ReadOnly ) ) { | 1025 | if (!file.open( IO_ReadOnly ) ) { |
1026 | return ; | 1026 | return ; |
1027 | 1027 | ||
1028 | } | 1028 | } |
1029 | QTextStream ts( &file ); | 1029 | QTextStream ts( &file ); |
1030 | text = ts.read(); | 1030 | text = ts.read(); |
1031 | file.close(); | 1031 | file.close(); |
1032 | displayText( text, cap); | 1032 | displayText( text, cap); |
1033 | } | 1033 | } |
1034 | void MainWindow::features() | 1034 | void MainWindow::features() |
1035 | { | 1035 | { |
1036 | 1036 | ||
1037 | displayFile( "featuresKOPI.txt",i18n("KO/Pi Features and hints") ); | 1037 | displayFile( "featuresKOPI.txt",i18n("KO/Pi Features and hints") ); |
1038 | } | 1038 | } |
1039 | 1039 | ||
1040 | void MainWindow::usertrans() | 1040 | void MainWindow::usertrans() |
1041 | { | 1041 | { |
1042 | 1042 | ||
1043 | displayFile( "usertranslationHOWTO.txt",i18n("KO/Pi User translation HowTo") ); | 1043 | displayFile( "usertranslationHOWTO.txt",i18n("KO/Pi User translation HowTo") ); |
1044 | } | 1044 | } |
1045 | void MainWindow::synchowto() | 1045 | void MainWindow::synchowto() |
1046 | { | 1046 | { |
1047 | 1047 | ||
1048 | displayFile( "howtoSYNC.txt",i18n("KO/Pi Synchronization HowTo") ); | 1048 | displayFile( "howtoSYNC.txt",i18n("KO/Pi Synchronization HowTo") ); |
1049 | } | 1049 | } |
1050 | void MainWindow::faq() | 1050 | void MainWindow::faq() |
1051 | { | 1051 | { |
1052 | displayFile( "kopiFAQ.txt",i18n("KO/Pi FAQ") ); | 1052 | displayFile( "kopiFAQ.txt",i18n("KO/Pi FAQ") ); |
1053 | 1053 | ||
1054 | } | 1054 | } |
1055 | void MainWindow::whatsNew() | 1055 | void MainWindow::whatsNew() |
1056 | { | 1056 | { |
1057 | displayFile( "kopiWhatsNew.txt",i18n("KO/Pi Version Info") ); | 1057 | displayFile( "kopiWhatsNew.txt",i18n("KO/Pi Version Info") ); |
1058 | 1058 | ||
1059 | } | 1059 | } |
1060 | void MainWindow::about() | 1060 | void MainWindow::about() |
1061 | { | 1061 | { |
1062 | QString version; | 1062 | QString version; |
1063 | #include <../version> | 1063 | #include <../version> |
1064 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), | 1064 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), |
1065 | i18n("KOrganizer/Platform-independent\n") + | 1065 | i18n("KOrganizer/Platform-independent\n") + |
1066 | "(KO/Pi) " + version + " - " + | 1066 | "(KO/Pi) " + version + " - " + |
1067 | 1067 | ||
1068 | #ifdef DESKTOP_VERSION | 1068 | #ifdef DESKTOP_VERSION |
1069 | i18n("Desktop Edition\n") + | 1069 | i18n("Desktop Edition\n") + |
1070 | #else | 1070 | #else |
1071 | i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") + | 1071 | i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") + |
1072 | #endif | 1072 | #endif |
1073 | i18n("(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n") ); | 1073 | i18n("(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n") ); |
1074 | } | 1074 | } |
1075 | void MainWindow::keyBindings() | 1075 | void MainWindow::keyBindings() |
1076 | { | 1076 | { |
1077 | QString cap = i18n("Key bindings KOrganizer/Pi"); | 1077 | QString cap = i18n("Key bindings KOrganizer/Pi"); |
1078 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + | 1078 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + |
1079 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ | 1079 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ |
1080 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + | 1080 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + |
1081 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ | 1081 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ |
1082 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ | 1082 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ |
1083 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ | 1083 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ |
1084 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ | 1084 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ |
1085 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ | 1085 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ |
1086 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ | 1086 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ |
1087 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ | 1087 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ |
1088 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ | 1088 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ |
1089 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ | 1089 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ |
1090 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ | 1090 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ |
1091 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ | 1091 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ |
1092 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ | 1092 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ |
1093 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ | 1093 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ |
1094 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ | 1094 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ |
1095 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ | 1095 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ |
1096 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ | 1096 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ |
1097 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ | 1097 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ |
1098 | i18n("<p><h3>In agenda view:</h3></p>\n") + | 1098 | i18n("<p><h3>In agenda view:</h3></p>\n") + |
1099 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ | 1099 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ |
1100 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ | 1100 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ |
1101 | i18n("<p><h3>In todo view:</h3></p>\n") + | 1101 | i18n("<p><h3>In todo view:</h3></p>\n") + |
1102 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ | 1102 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ |
1103 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1103 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1104 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ | 1104 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ |
1105 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ | 1105 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ |
1106 | i18n("<p><h3>In list view:</h3></p>\n") + | 1106 | i18n("<p><h3>In list view:</h3></p>\n") + |
1107 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1107 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1108 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ | 1108 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ |
1109 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ | 1109 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ |
1110 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ | 1110 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ |
1111 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ | 1111 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ |
1112 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ | 1112 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ |
1113 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + | 1113 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + |
1114 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ | 1114 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ |
1115 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ | 1115 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ |
1116 | i18n("<p><b>E</b>: Edit item</p>\n") + | 1116 | i18n("<p><b>E</b>: Edit item</p>\n") + |
1117 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + | 1117 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + |
1118 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + | 1118 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + |
1119 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ | 1119 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ |
1120 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ | 1120 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ |
1121 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ | 1121 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ |
1122 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ | 1122 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ |
1123 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ | 1123 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ |
1124 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + | 1124 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + |
1125 | i18n("<p><b>White</b>: Item readonly</p>\n"); | 1125 | i18n("<p><b>White</b>: Item readonly</p>\n"); |
1126 | displayText( text, cap); | 1126 | displayText( text, cap); |
1127 | 1127 | ||
1128 | } | 1128 | } |
1129 | void MainWindow::aboutAutoSaving() | 1129 | void MainWindow::aboutAutoSaving() |
1130 | { | 1130 | { |
1131 | QMessageBox* msg; | 1131 | QMessageBox* msg; |
1132 | msg = new QMessageBox( i18n("Auto Saving in KOrganizer/Pi"), | 1132 | msg = new QMessageBox( i18n("Auto Saving in KOrganizer/Pi"), |
1133 | i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configureable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"), QMessageBox::NoIcon, | 1133 | i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configureable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"), QMessageBox::NoIcon, |
1134 | QMessageBox::Ok, | 1134 | QMessageBox::Ok, |
1135 | QMessageBox::NoButton, | 1135 | QMessageBox::NoButton, |
1136 | QMessageBox::NoButton); | 1136 | QMessageBox::NoButton); |
1137 | msg->exec(); | 1137 | msg->exec(); |
1138 | delete msg; | 1138 | delete msg; |
1139 | 1139 | ||
1140 | 1140 | ||
1141 | } | 1141 | } |
1142 | void MainWindow::aboutKnownBugs() | 1142 | void MainWindow::aboutKnownBugs() |
1143 | { | 1143 | { |
1144 | QMessageBox* msg; | 1144 | QMessageBox* msg; |
1145 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), | 1145 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), |
1146 | i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ | 1146 | i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ |
1147 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ | 1147 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ |
1148 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n") + | 1148 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n") + |
1149 | i18n("\nor report them in the bugtracker on\n") + | 1149 | i18n("\nor report them in the bugtracker on\n") + |
1150 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), | 1150 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), |
1151 | QMessageBox::NoIcon, | 1151 | QMessageBox::NoIcon, |
1152 | QMessageBox::Ok, | 1152 | QMessageBox::Ok, |
1153 | QMessageBox::NoButton, | 1153 | QMessageBox::NoButton, |
1154 | QMessageBox::NoButton); | 1154 | QMessageBox::NoButton); |
1155 | msg->exec(); | 1155 | msg->exec(); |
1156 | delete msg; | 1156 | delete msg; |
1157 | 1157 | ||
1158 | } | 1158 | } |
1159 | 1159 | ||
1160 | QString MainWindow::defaultFileName() | 1160 | QString MainWindow::defaultFileName() |
1161 | { | 1161 | { |
1162 | return locateLocal( "data", "korganizer/mycalendar.ics" ); | 1162 | return locateLocal( "data", "korganizer/mycalendar.ics" ); |
1163 | } | 1163 | } |
1164 | 1164 | ||
1165 | void MainWindow::processIncidenceSelection( Incidence *incidence ) | 1165 | void MainWindow::processIncidenceSelection( Incidence *incidence ) |
1166 | { | 1166 | { |
1167 | if ( !incidence ) { | 1167 | if ( !incidence ) { |
1168 | enableIncidenceActions( false ); | 1168 | enableIncidenceActions( false ); |
1169 | 1169 | ||
1170 | mNewSubTodoAction->setEnabled( false ); | 1170 | mNewSubTodoAction->setEnabled( false ); |
1171 | setCaptionToDates(); | 1171 | setCaptionToDates(); |
1172 | return; | 1172 | return; |
1173 | 1173 | ||
1174 | } | 1174 | } |
1175 | 1175 | ||
1176 | //KGlobal::locale()->formatDateTime(nextA, true); | 1176 | //KGlobal::locale()->formatDateTime(nextA, true); |
1177 | QString startString = ""; | 1177 | QString startString = ""; |
1178 | if ( incidence->type() != "Todo" ) { | 1178 | if ( incidence->type() != "Todo" ) { |
1179 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { | 1179 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { |
1180 | if ( incidence->doesFloat() ) { | 1180 | if ( incidence->doesFloat() ) { |
1181 | startString += ": "+incidence->dtStartDateStr( true ); | 1181 | startString += ": "+incidence->dtStartDateStr( true ); |
1182 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); | 1182 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); |
1183 | 1183 | ||
1184 | } else { | 1184 | } else { |
1185 | startString = ": "+incidence->dtStartStr(true); | 1185 | startString = ": "+incidence->dtStartStr(true); |
1186 | startString += " --- "+((Event*)incidence)->dtEndStr(true); | 1186 | startString += " --- "+((Event*)incidence)->dtEndStr(true); |
1187 | 1187 | ||
1188 | } | 1188 | } |
1189 | 1189 | ||
1190 | } else { | 1190 | } else { |
1191 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) | 1191 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) |
1192 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ | 1192 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ |
1193 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); | 1193 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); |
1194 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); | 1194 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); |
1195 | } | 1195 | } |
1196 | 1196 | ||
1197 | } | 1197 | } |
1198 | else | 1198 | else |
1199 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); | 1199 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); |
1200 | if ( !incidence->location().isEmpty() ) | 1200 | if ( !incidence->location().isEmpty() ) |
1201 | startString += " (" +incidence->location()+")"; | 1201 | startString += " (" +incidence->location()+")"; |
1202 | setCaption( incidence->summary()+startString); | 1202 | setCaption( incidence->summary()+startString); |
1203 | 1203 | ||
1204 | enableIncidenceActions( true ); | 1204 | enableIncidenceActions( true ); |
1205 | 1205 | ||
1206 | if ( incidence->type() == "Event" ) { | 1206 | if ( incidence->type() == "Event" ) { |
1207 | mShowAction->setText( i18n("Show Event...") ); | 1207 | mShowAction->setText( i18n("Show Event...") ); |
1208 | mEditAction->setText( i18n("Edit Event...") ); | 1208 | mEditAction->setText( i18n("Edit Event...") ); |
1209 | mDeleteAction->setText( i18n("Delete Event...") ); | 1209 | mDeleteAction->setText( i18n("Delete Event...") ); |
1210 | 1210 | ||
1211 | mNewSubTodoAction->setEnabled( false ); | 1211 | mNewSubTodoAction->setEnabled( false ); |
1212 | } else if ( incidence->type() == "Todo" ) { | 1212 | } else if ( incidence->type() == "Todo" ) { |
1213 | mShowAction->setText( i18n("Show Todo...") ); | 1213 | mShowAction->setText( i18n("Show Todo...") ); |
1214 | mEditAction->setText( i18n("Edit Todo...") ); | 1214 | mEditAction->setText( i18n("Edit Todo...") ); |
1215 | mDeleteAction->setText( i18n("Delete Todo...") ); | 1215 | mDeleteAction->setText( i18n("Delete Todo...") ); |
1216 | 1216 | ||
1217 | mNewSubTodoAction->setEnabled( true ); | 1217 | mNewSubTodoAction->setEnabled( true ); |
1218 | } else { | 1218 | } else { |
1219 | mShowAction->setText( i18n("Show...") ); | 1219 | mShowAction->setText( i18n("Show...") ); |
1220 | mShowAction->setText( i18n("Edit...") ); | 1220 | mShowAction->setText( i18n("Edit...") ); |
1221 | mShowAction->setText( i18n("Delete...") ); | 1221 | mShowAction->setText( i18n("Delete...") ); |
1222 | 1222 | ||
1223 | mNewSubTodoAction->setEnabled( false ); | 1223 | mNewSubTodoAction->setEnabled( false ); |
1224 | } | 1224 | } |
1225 | } | 1225 | } |
1226 | 1226 | ||
1227 | void MainWindow::enableIncidenceActions( bool enabled ) | 1227 | void MainWindow::enableIncidenceActions( bool enabled ) |
1228 | { | 1228 | { |
1229 | mShowAction->setEnabled( enabled ); | 1229 | mShowAction->setEnabled( enabled ); |
1230 | mEditAction->setEnabled( enabled ); | 1230 | mEditAction->setEnabled( enabled ); |
1231 | mDeleteAction->setEnabled( enabled ); | 1231 | mDeleteAction->setEnabled( enabled ); |
1232 | } | 1232 | } |
1233 | 1233 | ||
1234 | void MainWindow::importOL() | 1234 | void MainWindow::importOL() |
1235 | { | 1235 | { |
1236 | #ifdef _WIN32_ | 1236 | #ifdef _WIN32_ |
1237 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | 1237 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); |
1238 | id->exec(); | 1238 | id->exec(); |
1239 | delete id; | 1239 | delete id; |
1240 | mView->updateView(); | 1240 | mView->updateView(); |
1241 | #endif | 1241 | #endif |
1242 | } | 1242 | } |
1243 | void MainWindow::importBday() | 1243 | void MainWindow::importBday() |
1244 | { | 1244 | { |
1245 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1245 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1246 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1246 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
1247 | i18n("Import!"), i18n("Cancel"), 0, | 1247 | i18n("Import!"), i18n("Cancel"), 0, |
1248 | 0, 1 ); | 1248 | 0, 1 ); |
1249 | if ( result == 0 ) { | 1249 | if ( result == 0 ) { |
1250 | mView->importBday(); | 1250 | mView->importBday(); |
1251 | 1251 | ||
1252 | } | 1252 | } |
1253 | 1253 | ||
1254 | 1254 | ||
1255 | } | 1255 | } |
1256 | void MainWindow::importQtopia() | 1256 | void MainWindow::importQtopia() |
1257 | { | 1257 | { |
1258 | #ifndef DESKTOP_VERSION | 1258 | #ifndef DESKTOP_VERSION |
1259 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1259 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1260 | i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"), | 1260 | i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"), |
1261 | i18n("Import!"), i18n("Cancel"), 0, | 1261 | i18n("Import!"), i18n("Cancel"), 0, |
1262 | 0, 1 ); | 1262 | 0, 1 ); |
1263 | if ( result == 0 ) { | 1263 | if ( result == 0 ) { |
1264 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); | 1264 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); |
1265 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); | 1265 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); |
1266 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; | 1266 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; |
1267 | mView->importQtopia( categories, datebook, todolist ); | 1267 | mView->importQtopia( categories, datebook, todolist ); |
1268 | } | 1268 | } |
1269 | #else | 1269 | #else |
1270 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1270 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1271 | i18n("Not supported \non desktop!\n"), | 1271 | i18n("Not supported \non desktop!\n"), |
1272 | i18n("Ok"), i18n("Cancel"), 0, | 1272 | i18n("Ok"), i18n("Cancel"), 0, |
1273 | 0, 1 ); | 1273 | 0, 1 ); |
1274 | 1274 | ||
1275 | #endif | 1275 | #endif |
1276 | } | 1276 | } |
1277 | 1277 | ||
1278 | void MainWindow::saveOnClose() | 1278 | void MainWindow::saveOnClose() |
1279 | { | 1279 | { |
1280 | KOPrefs *p = KOPrefs::instance(); | 1280 | KOPrefs *p = KOPrefs::instance(); |
1281 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); | 1281 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); |
1282 | p->mToolBarUp = iconToolBar->x() > width()/2 || | 1282 | p->mToolBarUp = iconToolBar->x() > width()/2 || |
1283 | iconToolBar->y() > height()/2; | 1283 | iconToolBar->y() > height()/2; |
1284 | mView->writeSettings(); | 1284 | mView->writeSettings(); |
1285 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) | 1285 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) |
1286 | save(); | 1286 | save(); |
1287 | } | 1287 | } |
1288 | void MainWindow::slotModifiedChanged( bool changed ) | 1288 | void MainWindow::slotModifiedChanged( bool changed ) |
1289 | { | 1289 | { |
1290 | if ( mBlockAtStartup ) | 1290 | if ( mBlockAtStartup ) |
1291 | return; | 1291 | return; |
1292 | int msec; | 1292 | int msec; |
1293 | // we store the changes after 1 minute, | 1293 | // we store the changes after 1 minute, |
1294 | // and for safety reasons after 10 minutes again | 1294 | // and for safety reasons after 10 minutes again |
1295 | if ( !mBlockSaveFlag ) | 1295 | if ( !mBlockSaveFlag ) |
1296 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; | 1296 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; |
1297 | else | 1297 | else |
1298 | msec = 1000 * 600; | 1298 | msec = 1000 * 600; |
1299 | mSaveTimer.start( msec, true ); // 1 minute | 1299 | mSaveTimer.start( msec, true ); // 1 minute |
1300 | qDebug("KO: Saving File in %d secs!", msec/1000); | 1300 | qDebug("KO: Saving File in %d secs!", msec/1000); |
1301 | mCalendarModifiedFlag = true; | 1301 | mCalendarModifiedFlag = true; |
1302 | } | 1302 | } |
1303 | #include <qfileinfo.h> | 1303 | #include <qfileinfo.h> |
1304 | void MainWindow::save() | 1304 | void MainWindow::save() |
1305 | { | 1305 | { |
1306 | if ( mBlockSaveFlag ) | 1306 | if ( mBlockSaveFlag ) |
1307 | return; | 1307 | return; |
1308 | bool store = mBlockSaveFlag; | 1308 | bool store = mBlockSaveFlag; |
1309 | mBlockSaveFlag = true; | 1309 | mBlockSaveFlag = true; |
1310 | if ( mView->checkFileVersion( defaultFileName()) ) { | 1310 | if ( mView->checkFileVersion( defaultFileName()) ) { |
1311 | 1311 | ||
1312 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 1312 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
1313 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); | 1313 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); |
1314 | qDebug("KO: Start saving data to file!"); | 1314 | qDebug("KO: Start saving data to file!"); |
1315 | mView->saveCalendar( defaultFileName() ); | 1315 | mView->saveCalendar( defaultFileName() ); |
1316 | 1316 | ||
1317 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 1317 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
1318 | mView->setLoadedFileVersion(QDateTime::currentDateTime()); | 1318 | mView->setLoadedFileVersion(QDateTime::currentDateTime()); |
1319 | qDebug("KO: Needed %d ms for saving.",msNeeded ); | 1319 | qDebug("KO: Needed %d ms for saving.",msNeeded ); |
1320 | QString savemes; | 1320 | QString savemes; |
1321 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); | 1321 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); |
1322 | setCaption(savemes); | 1322 | setCaption(savemes); |
1323 | } else | 1323 | } else |
1324 | setCaption(i18n("Saving cancelled!")); | 1324 | setCaption(i18n("Saving cancelled!")); |
1325 | mCalendarModifiedFlag = false; | 1325 | mCalendarModifiedFlag = false; |
1326 | mBlockSaveFlag = store; | 1326 | mBlockSaveFlag = store; |
1327 | } | 1327 | } |
1328 | 1328 | ||
1329 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) | 1329 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) |
1330 | { | 1330 | { |
1331 | if ( !e->isAutoRepeat() ) { | 1331 | if ( !e->isAutoRepeat() ) { |
1332 | mFlagKeyPressed = false; | 1332 | mFlagKeyPressed = false; |
1333 | } | 1333 | } |
1334 | } | 1334 | } |
1335 | void MainWindow::keyPressEvent ( QKeyEvent * e ) | 1335 | void MainWindow::keyPressEvent ( QKeyEvent * e ) |
1336 | { | 1336 | { |
1337 | qApp->processEvents(); | 1337 | qApp->processEvents(); |
1338 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { | 1338 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { |
1339 | e->ignore(); | 1339 | e->ignore(); |
1340 | // qDebug(" ignore %d",e->isAutoRepeat() ); | 1340 | // qDebug(" ignore %d",e->isAutoRepeat() ); |
1341 | return; | 1341 | return; |
1342 | } | 1342 | } |
1343 | if (! e->isAutoRepeat() ) | 1343 | if (! e->isAutoRepeat() ) |
1344 | mFlagKeyPressed = true; | 1344 | mFlagKeyPressed = true; |
1345 | KOPrefs *p = KOPrefs::instance(); | 1345 | KOPrefs *p = KOPrefs::instance(); |
1346 | bool showSelectedDates = false; | 1346 | bool showSelectedDates = false; |
1347 | int size; | 1347 | int size; |
1348 | int pro = 0; | 1348 | int pro = 0; |
1349 | //qDebug("MainWindow::keyPressEvent "); | 1349 | //qDebug("MainWindow::keyPressEvent "); |
1350 | switch ( e->key() ) { | 1350 | switch ( e->key() ) { |
1351 | case Qt::Key_Right: | 1351 | case Qt::Key_Right: |
1352 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1352 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1353 | mView->goNextMonth(); | 1353 | mView->goNextMonth(); |
1354 | else | 1354 | else |
1355 | mView->goNext(); | 1355 | mView->goNext(); |
1356 | showSelectedDates = true; | 1356 | showSelectedDates = true; |
1357 | break; | 1357 | break; |
1358 | case Qt::Key_Left: | 1358 | case Qt::Key_Left: |
1359 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1359 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1360 | mView->goPreviousMonth(); | 1360 | mView->goPreviousMonth(); |
1361 | else | 1361 | else |
1362 | mView->goPrevious(); | 1362 | mView->goPrevious(); |
1363 | showSelectedDates = true; | 1363 | showSelectedDates = true; |
1364 | break; | 1364 | break; |
1365 | case Qt::Key_Down: | 1365 | case Qt::Key_Down: |
1366 | mView->viewManager()->agendaView()->scrollOneHourDown(); | 1366 | mView->viewManager()->agendaView()->scrollOneHourDown(); |
1367 | break; | 1367 | break; |
1368 | case Qt::Key_Up: | 1368 | case Qt::Key_Up: |
1369 | mView->viewManager()->agendaView()->scrollOneHourUp(); | 1369 | mView->viewManager()->agendaView()->scrollOneHourUp(); |
1370 | break; | 1370 | break; |
1371 | case Qt::Key_I: | 1371 | case Qt::Key_I: |
1372 | mView->showIncidence(); | 1372 | mView->showIncidence(); |
1373 | break; | 1373 | break; |
1374 | case Qt::Key_Delete: | 1374 | case Qt::Key_Delete: |
1375 | case Qt::Key_Backspace: | 1375 | case Qt::Key_Backspace: |
1376 | mView->deleteIncidence(); | 1376 | mView->deleteIncidence(); |
1377 | break; | 1377 | break; |
1378 | case Qt::Key_D: | 1378 | case Qt::Key_D: |
1379 | mView->viewManager()->showDayView(); | 1379 | mView->viewManager()->showDayView(); |
1380 | showSelectedDates = true; | 1380 | showSelectedDates = true; |
1381 | break; | 1381 | break; |
1382 | case Qt::Key_O: | 1382 | case Qt::Key_O: |
1383 | mView->toggleFilerEnabled( ); | 1383 | mView->toggleFilerEnabled( ); |
1384 | break; | 1384 | break; |
1385 | case Qt::Key_0: | 1385 | case Qt::Key_0: |
1386 | case Qt::Key_1: | 1386 | case Qt::Key_1: |
1387 | case Qt::Key_2: | 1387 | case Qt::Key_2: |
1388 | case Qt::Key_3: | 1388 | case Qt::Key_3: |
1389 | case Qt::Key_4: | 1389 | case Qt::Key_4: |
1390 | case Qt::Key_5: | 1390 | case Qt::Key_5: |
1391 | case Qt::Key_6: | 1391 | case Qt::Key_6: |
1392 | case Qt::Key_7: | 1392 | case Qt::Key_7: |
1393 | case Qt::Key_8: | 1393 | case Qt::Key_8: |
1394 | case Qt::Key_9: | 1394 | case Qt::Key_9: |
1395 | pro = e->key()-48; | 1395 | pro = e->key()-48; |
1396 | if ( pro == 0 ) | 1396 | if ( pro == 0 ) |
1397 | pro = 10; | 1397 | pro = 10; |
1398 | if ( e->state() == Qt::ControlButton) | 1398 | if ( e->state() == Qt::ControlButton) |
1399 | pro += 10; | 1399 | pro += 10; |
1400 | break; | 1400 | break; |
1401 | case Qt::Key_M: | 1401 | case Qt::Key_M: |
1402 | mView->viewManager()->showMonthView(); | 1402 | mView->viewManager()->showMonthView(); |
1403 | showSelectedDates = true; | 1403 | showSelectedDates = true; |
1404 | break; | 1404 | break; |
1405 | case Qt::Key_Insert: | 1405 | case Qt::Key_Insert: |
1406 | mView->newEvent(); | 1406 | mView->newEvent(); |
1407 | break; | 1407 | break; |
1408 | case Qt::Key_S : | 1408 | case Qt::Key_S : |
1409 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1409 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1410 | mView->newSubTodo(); | 1410 | mView->newSubTodo(); |
1411 | else | 1411 | else |
1412 | mView->dialogManager()->showSearchDialog(); | 1412 | mView->dialogManager()->showSearchDialog(); |
1413 | break; | 1413 | break; |
1414 | case Qt::Key_Y : | 1414 | case Qt::Key_Y : |
1415 | case Qt::Key_Z : | 1415 | case Qt::Key_Z : |
1416 | mView->viewManager()->showWorkWeekView(); | 1416 | mView->viewManager()->showWorkWeekView(); |
1417 | showSelectedDates = true; | 1417 | showSelectedDates = true; |
1418 | break; | 1418 | break; |
1419 | case Qt::Key_U : | 1419 | case Qt::Key_U : |
1420 | mView->viewManager()->showWeekView(); | 1420 | mView->viewManager()->showWeekView(); |
1421 | showSelectedDates = true; | 1421 | showSelectedDates = true; |
1422 | break; | 1422 | break; |
1423 | case Qt::Key_H : | 1423 | case Qt::Key_H : |
1424 | keyBindings(); | 1424 | keyBindings(); |
1425 | break; | 1425 | break; |
1426 | case Qt::Key_W: | 1426 | case Qt::Key_W: |
1427 | mView->viewManager()->showWhatsNextView(); | 1427 | mView->viewManager()->showWhatsNextView(); |
1428 | break; | 1428 | break; |
1429 | case Qt::Key_L: | 1429 | case Qt::Key_L: |
1430 | mView->viewManager()->showListView(); | 1430 | mView->viewManager()->showListView(); |
1431 | break; | 1431 | break; |
1432 | case Qt::Key_N: | 1432 | case Qt::Key_N: |
1433 | mView->viewManager()->showNextXView(); | 1433 | mView->viewManager()->showNextXView(); |
1434 | showSelectedDates = true; | 1434 | showSelectedDates = true; |
1435 | break; | 1435 | break; |
1436 | case Qt::Key_V: | 1436 | case Qt::Key_V: |
1437 | mView->viewManager()->showTodoView(); | 1437 | mView->viewManager()->showTodoView(); |
1438 | break; | 1438 | break; |
1439 | case Qt::Key_C: | 1439 | case Qt::Key_C: |
1440 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); | 1440 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); |
1441 | break; | 1441 | break; |
1442 | case Qt::Key_P: | 1442 | case Qt::Key_P: |
1443 | mView->showDatePicker( ); | 1443 | mView->showDatePicker( ); |
1444 | break; | 1444 | break; |
1445 | case Qt::Key_F: | 1445 | case Qt::Key_F: |
1446 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1446 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1447 | mView->editFilters(); | 1447 | mView->editFilters(); |
1448 | else | 1448 | else |
1449 | mView->toggleFilter(); | 1449 | mView->toggleFilter(); |
1450 | break; | 1450 | break; |
1451 | case Qt::Key_X: | 1451 | case Qt::Key_X: |
1452 | mView->toggleDateNavigatorWidget(); | 1452 | mView->toggleDateNavigatorWidget(); |
1453 | break; | 1453 | break; |
1454 | case Qt::Key_Space: | 1454 | case Qt::Key_Space: |
1455 | mView->toggleExpand(); | 1455 | mView->toggleExpand(); |
1456 | break; | 1456 | break; |
1457 | case Qt::Key_A: | 1457 | case Qt::Key_A: |
1458 | mView->toggleAllDaySize(); | 1458 | mView->toggleAllDaySize(); |
1459 | break; | 1459 | break; |
1460 | case Qt::Key_T: | 1460 | case Qt::Key_T: |
1461 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1461 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1462 | mView->newTodo(); | 1462 | mView->newTodo(); |
1463 | else { | 1463 | else { |
1464 | mView->goToday(); | 1464 | mView->goToday(); |
1465 | showSelectedDates = true; | 1465 | showSelectedDates = true; |
1466 | } | 1466 | } |
1467 | break; | 1467 | break; |
1468 | case Qt::Key_J: | 1468 | case Qt::Key_J: |
1469 | mView->viewManager()->showJournalView(); | 1469 | mView->viewManager()->showJournalView(); |
1470 | break; | 1470 | break; |
1471 | case Qt::Key_B: | 1471 | case Qt::Key_B: |
1472 | mView->editIncidenceDescription();; | 1472 | mView->editIncidenceDescription();; |
1473 | break; | 1473 | break; |
1474 | // case Qt::Key_Return: | 1474 | // case Qt::Key_Return: |
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 3df2a3b..7c04f48 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp | |||
@@ -1,471 +1,476 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> | 3 | Copyright (c) 2004 Lutz Rogowski <rogowski@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 <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qlabel.h> | 25 | #include <qlabel.h> |
26 | #include <qgroupbox.h> | 26 | #include <qgroupbox.h> |
27 | #include <qbuttongroup.h> | 27 | #include <qbuttongroup.h> |
28 | #include <qlineedit.h> | 28 | #include <qlineedit.h> |
29 | #include <qfont.h> | 29 | #include <qfont.h> |
30 | #include <qslider.h> | 30 | #include <qslider.h> |
31 | #include <qfile.h> | 31 | #include <qfile.h> |
32 | #include <qdir.h> | 32 | #include <qdir.h> |
33 | #include <qtextstream.h> | 33 | #include <qtextstream.h> |
34 | #include <qcombobox.h> | 34 | #include <qcombobox.h> |
35 | #include <qvbox.h> | 35 | #include <qvbox.h> |
36 | #include <qhbox.h> | 36 | #include <qhbox.h> |
37 | #include <qspinbox.h> | 37 | #include <qspinbox.h> |
38 | #include <qdatetime.h> | 38 | #include <qdatetime.h> |
39 | #include <qcheckbox.h> | 39 | #include <qcheckbox.h> |
40 | #include <qradiobutton.h> | 40 | #include <qradiobutton.h> |
41 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
42 | #include <qstrlist.h> | 42 | #include <qstrlist.h> |
43 | #include <qapplication.h> | 43 | #include <qapplication.h> |
44 | #include <qlayout.h> | 44 | #include <qlayout.h> |
45 | #include <qscrollview.h> | 45 | #include <qscrollview.h> |
46 | 46 | ||
47 | #include <kcolorbutton.h> | 47 | #include <kcolorbutton.h> |
48 | #include <kdebug.h> | 48 | #include <kdebug.h> |
49 | #include <klocale.h> | 49 | #include <klocale.h> |
50 | #include <kglobal.h> | 50 | #include <kglobal.h> |
51 | #include <kfontdialog.h> | 51 | #include <kfontdialog.h> |
52 | #include <kmessagebox.h> | 52 | #include <kmessagebox.h> |
53 | #include <kcolordialog.h> | 53 | #include <kcolordialog.h> |
54 | #include <kiconloader.h> | 54 | #include <kiconloader.h> |
55 | #include <kemailsettings.h> | 55 | #include <kemailsettings.h> |
56 | #include <kstandarddirs.h> | 56 | #include <kstandarddirs.h> |
57 | #include <kfiledialog.h> | 57 | #include <kfiledialog.h> |
58 | #include <kmessagebox.h> | 58 | #include <kmessagebox.h> |
59 | 59 | ||
60 | //#include <kurlrequester.h> | 60 | //#include <kurlrequester.h> |
61 | #include <klineedit.h> | 61 | #include <klineedit.h> |
62 | #include "ksyncprofile.h" | 62 | #include "ksyncprofile.h" |
63 | 63 | ||
64 | 64 | ||
65 | //#include "koprefs.h" | 65 | //#include "koprefs.h" |
66 | 66 | ||
67 | #include "ksyncprefsdialog.h" | 67 | #include "ksyncprefsdialog.h" |
68 | //#include "koglobals.h" | 68 | //#include "koglobals.h" |
69 | 69 | ||
70 | 70 | ||
71 | KSyncPrefsDialog::KSyncPrefsDialog(QWidget *parent, char *name, bool modal) : | 71 | KSyncPrefsDialog::KSyncPrefsDialog(QWidget *parent, char *name, bool modal) : |
72 | KDialog(parent,name,true) | 72 | KDialog(parent,name,true) |
73 | { | 73 | { |
74 | 74 | ||
75 | setCaption( i18n("Synchronization Preferences")); | 75 | setCaption( i18n("Synchronization Preferences")); |
76 | 76 | ||
77 | mSyncProfiles.setAutoDelete( true ); | 77 | mSyncProfiles.setAutoDelete( true ); |
78 | setupSyncAlgTab(); | 78 | setupSyncAlgTab(); |
79 | } | 79 | } |
80 | 80 | ||
81 | 81 | ||
82 | KSyncPrefsDialog::~KSyncPrefsDialog() | 82 | KSyncPrefsDialog::~KSyncPrefsDialog() |
83 | { | 83 | { |
84 | } | 84 | } |
85 | 85 | ||
86 | void KSyncPrefsDialog::setupSyncAlgTab() | 86 | void KSyncPrefsDialog::setupSyncAlgTab() |
87 | { | 87 | { |
88 | QLabel * lab; | 88 | QLabel * lab; |
89 | //QFrame *page = addPage(i18n("Sync Prefs"),0,0); | 89 | //QFrame *page = addPage(i18n("Sync Prefs"),0,0); |
90 | QVBox * mainbox = new QVBox( this ); | 90 | QVBox * mainbox = new QVBox( this ); |
91 | QScrollView* sv = new QScrollView( mainbox ); | 91 | QScrollView* sv = new QScrollView( mainbox ); |
92 | QHBoxLayout * lay = new QHBoxLayout( this ); | 92 | QHBoxLayout * lay = new QHBoxLayout( this ); |
93 | lay->addWidget( mainbox ); | 93 | lay->addWidget( mainbox ); |
94 | QHBox * b_box = new QHBox( mainbox ); | 94 | QHBox * b_box = new QHBox( mainbox ); |
95 | 95 | ||
96 | QPushButton* button = new QPushButton( i18n("Ok"), b_box ); | 96 | QPushButton* button = new QPushButton( i18n("Ok"), b_box ); |
97 | connect ( button, SIGNAL( clicked()), this, SLOT (slotOK() ) ); | 97 | connect ( button, SIGNAL( clicked()), this, SLOT (slotOK() ) ); |
98 | button = new QPushButton( i18n("Cancel"), b_box ); | 98 | button = new QPushButton( i18n("Cancel"), b_box ); |
99 | connect ( button, SIGNAL( clicked()), this, SLOT (reject() ) ); | 99 | connect ( button, SIGNAL( clicked()), this, SLOT (reject() ) ); |
100 | //QBoxLayout * sl = new QVBoxLayout(this ); | 100 | //QBoxLayout * sl = new QVBoxLayout(this ); |
101 | //sl->addWidget ( sv ); | 101 | //sl->addWidget ( sv ); |
102 | sv->setResizePolicy ( QScrollView::AutoOneFit ); | 102 | sv->setResizePolicy ( QScrollView::AutoOneFit ); |
103 | QFrame *topFrame = new QFrame ( sv ); | 103 | QFrame *topFrame = new QFrame ( sv ); |
104 | sv->addChild( topFrame ); | 104 | sv->addChild( topFrame ); |
105 | mSetupSyncAlgTab = topFrame; | 105 | mSetupSyncAlgTab = topFrame; |
106 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 106 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
107 | topLayout->setSpacing(spacingHint()); | 107 | topLayout->setSpacing(spacingHint()); |
108 | topLayout->setMargin(marginHint()); | 108 | topLayout->setMargin(marginHint()); |
109 | 109 | ||
110 | //lab = new QLabel(i18n("Sync settings not yet implemented. DO NOT USE!"), topFrame); | 110 | //lab = new QLabel(i18n("Sync settings not yet implemented. DO NOT USE!"), topFrame); |
111 | int iii = 0; | 111 | int iii = 0; |
112 | //topLayout->addMultiCellWidget(lab , iii,iii,0,1); | 112 | //topLayout->addMultiCellWidget(lab , iii,iii,0,1); |
113 | //++iii; | 113 | //++iii; |
114 | 114 | ||
115 | mMyMachineName = new QLineEdit(topFrame); | 115 | mMyMachineName = new QLineEdit(topFrame); |
116 | lab = new QLabel(mMyMachineName, i18n("Local device name:"), topFrame); | 116 | lab = new QLabel(mMyMachineName, i18n("Local device name:"), topFrame); |
117 | topLayout->addWidget(lab ,iii,0); | 117 | topLayout->addWidget(lab ,iii,0); |
118 | topLayout->addWidget(mMyMachineName,iii,1); | 118 | topLayout->addWidget(mMyMachineName,iii,1); |
119 | ++iii; | 119 | ++iii; |
120 | 120 | ||
121 | QHBox* buttonbox = new QHBox( topFrame); | 121 | QHBox* buttonbox = new QHBox( topFrame); |
122 | topLayout->addMultiCellWidget(buttonbox, iii,iii,0,1); | 122 | topLayout->addMultiCellWidget(buttonbox, iii,iii,0,1); |
123 | ++iii; | 123 | ++iii; |
124 | button = new QPushButton( i18n("New profile"), buttonbox ); | 124 | button = new QPushButton( i18n("New profile"), buttonbox ); |
125 | connect ( button, SIGNAL( clicked()), this, SLOT (newProfile() ) ); | 125 | connect ( button, SIGNAL( clicked()), this, SLOT (newProfile() ) ); |
126 | 126 | ||
127 | button = new QPushButton( i18n("Clone profile"), buttonbox ); | 127 | button = new QPushButton( i18n("Clone profile"), buttonbox ); |
128 | connect ( button, SIGNAL( clicked()), this, SLOT ( cloneProfile() ) ); | 128 | connect ( button, SIGNAL( clicked()), this, SLOT ( cloneProfile() ) ); |
129 | 129 | ||
130 | button = new QPushButton( i18n("Delete profile"), buttonbox ); | 130 | button = new QPushButton( i18n("Delete profile"), buttonbox ); |
131 | connect ( button, SIGNAL( clicked()), this, SLOT (deleteProfile() ) ); | 131 | connect ( button, SIGNAL( clicked()), this, SLOT (deleteProfile() ) ); |
132 | 132 | ||
133 | mProfileBox = new QComboBox(topFrame); | 133 | mProfileBox = new QComboBox(topFrame); |
134 | mProfileBox->setEditable ( true ); | 134 | mProfileBox->setEditable ( true ); |
135 | connect ( mProfileBox, SIGNAL(activated ( int ) ), this, SLOT (profileChanged( int ) ) ); | 135 | connect ( mProfileBox, SIGNAL(activated ( int ) ), this, SLOT (profileChanged( int ) ) ); |
136 | connect ( mProfileBox, SIGNAL( textChanged ( const QString & ) ), this, SLOT (textChanged( const QString & ) ) ); | 136 | connect ( mProfileBox, SIGNAL( textChanged ( const QString & ) ), this, SLOT (textChanged( const QString & ) ) ); |
137 | 137 | ||
138 | lab = new QLabel(mProfileBox, i18n("Profile:"), topFrame); | 138 | lab = new QLabel(mProfileBox, i18n("Profile:"), topFrame); |
139 | topLayout->addWidget(lab ,iii,0); | 139 | topLayout->addWidget(lab ,iii,0); |
140 | topLayout->addWidget(mProfileBox, iii,1); | 140 | topLayout->addWidget(mProfileBox, iii,1); |
141 | ++iii; | 141 | ++iii; |
142 | 142 | ||
143 | mIncludeInRing = new QCheckBox( i18n("Include in multiple sync"), topFrame ); | 143 | mIncludeInRing = new QCheckBox( i18n("Include in multiple calendar sync"), topFrame ); |
144 | topLayout->addMultiCellWidget(mIncludeInRing, iii,iii,0,1); | 144 | topLayout->addMultiCellWidget(mIncludeInRing, iii,iii,0,1); |
145 | ++iii; | 145 | ++iii; |
146 | mIncludeInRingAB = new QCheckBox( i18n("Include in multiple addressbook sync"), topFrame ); | ||
147 | topLayout->addMultiCellWidget(mIncludeInRingAB, iii,iii,0,1); | ||
148 | ++iii; | ||
146 | 149 | ||
147 | mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame ); | 150 | mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame ); |
148 | topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1); | 151 | topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1); |
149 | ++iii; | 152 | ++iii; |
150 | QButtonGroup* gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame); | 153 | QButtonGroup* gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame); |
151 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); | 154 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); |
152 | ++iii; | 155 | ++iii; |
153 | loc = new QRadioButton ( i18n("Take local entry on conflict"), gr ); | 156 | loc = new QRadioButton ( i18n("Take local entry on conflict"), gr ); |
154 | rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr ); | 157 | rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr ); |
155 | newest = new QRadioButton ( i18n("Take newest entry on conflict"), gr ); | 158 | newest = new QRadioButton ( i18n("Take newest entry on conflict"), gr ); |
156 | ask = new QRadioButton ( i18n("Ask for every entry on conflict"), gr ); | 159 | ask = new QRadioButton ( i18n("Ask for every entry on conflict"), gr ); |
157 | f_loc= new QRadioButton ( i18n("Force: Take local entry always"), gr ); | 160 | f_loc= new QRadioButton ( i18n("Force: Take local entry always"), gr ); |
158 | f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr ); | 161 | f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr ); |
159 | // both = new QRadioButton ( i18n("Take both on conflict"), gr ); | 162 | // both = new QRadioButton ( i18n("Take both on conflict"), gr ); |
160 | 163 | ||
161 | mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame ); | 164 | mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame ); |
162 | topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1); | 165 | topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1); |
163 | ++iii; | 166 | ++iii; |
164 | 167 | ||
165 | mWriteBackExisting= new QCheckBox( i18n("Write back existing entries only"), topFrame ); | 168 | mWriteBackExisting= new QCheckBox( i18n("Write back existing entries only"), topFrame ); |
166 | topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); | 169 | topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); |
167 | ++iii; | 170 | ++iii; |
168 | 171 | ||
169 | mWriteBackFile = new QCheckBox( i18n("Write back file"), topFrame ); | 172 | mWriteBackFile = new QCheckBox( i18n("Write back file"), topFrame ); |
170 | topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); | 173 | topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); |
171 | ++iii; | 174 | ++iii; |
172 | 175 | ||
173 | proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); | 176 | proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); |
174 | gr = proGr; | 177 | gr = proGr; |
175 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); | 178 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); |
176 | ++iii; | 179 | ++iii; |
177 | mIsLocal = new QRadioButton ( i18n("Local file"), gr ); | 180 | mIsLocal = new QRadioButton ( i18n("Local file"), gr ); |
178 | mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); | 181 | mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); |
179 | connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | 182 | connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); |
180 | 183 | ||
181 | localFileWidget = new QVBox( topFrame); | 184 | localFileWidget = new QVBox( topFrame); |
182 | topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); | 185 | topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); |
183 | ++iii; | 186 | ++iii; |
184 | QHBox* temphb = new QHBox( localFileWidget ); | 187 | QHBox* temphb = new QHBox( localFileWidget ); |
185 | lab = new QLabel( i18n("Local file:"), temphb); | 188 | lab = new QLabel( i18n("Local file:"), temphb); |
186 | mRemoteFile = new QLineEdit(localFileWidget); | 189 | mRemoteFile = new QLineEdit(localFileWidget); |
187 | 190 | ||
188 | button = new QPushButton( i18n("Choose..."), temphb ); | 191 | button = new QPushButton( i18n("Choose..."), temphb ); |
189 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); | 192 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); |
190 | 193 | ||
191 | 194 | ||
192 | remoteFileWidget = new QVBox( topFrame); | 195 | remoteFileWidget = new QVBox( topFrame); |
193 | topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); | 196 | topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); |
194 | ++iii; | 197 | ++iii; |
195 | lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); | 198 | lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); |
196 | mRemotePrecommand = new QLineEdit(remoteFileWidget); | 199 | mRemotePrecommand = new QLineEdit(remoteFileWidget); |
197 | 200 | ||
198 | lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); | 201 | lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); |
199 | mLocalTempFile = new QLineEdit(remoteFileWidget); | 202 | mLocalTempFile = new QLineEdit(remoteFileWidget); |
200 | 203 | ||
201 | 204 | ||
202 | lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); | 205 | lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); |
203 | mRemotePostcommand = new QLineEdit(remoteFileWidget); | 206 | mRemotePostcommand = new QLineEdit(remoteFileWidget); |
204 | 207 | ||
205 | lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); | 208 | lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); |
206 | temphb = new QHBox( remoteFileWidget ); | 209 | temphb = new QHBox( remoteFileWidget ); |
207 | button = new QPushButton( i18n("ssh/scp"), temphb ); | 210 | button = new QPushButton( i18n("ssh/scp"), temphb ); |
208 | connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); | 211 | connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); |
209 | button = new QPushButton( i18n("ftp"), temphb ); | 212 | button = new QPushButton( i18n("ftp"), temphb ); |
210 | connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) ); | 213 | connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) ); |
211 | lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); | 214 | lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); |
212 | 215 | ||
213 | 216 | ||
214 | } | 217 | } |
215 | void KSyncPrefsDialog::slotOK() | 218 | void KSyncPrefsDialog::slotOK() |
216 | { | 219 | { |
217 | if ( mMyMachineName->text() == "undefined" ) { | 220 | if ( mMyMachineName->text() == "undefined" ) { |
218 | KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error")); | 221 | KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error")); |
219 | return; | 222 | return; |
220 | } | 223 | } |
221 | int i; | 224 | int i; |
222 | for (i = 0; i < mSyncProfileNames.count(); ++ i) { | 225 | for (i = 0; i < mSyncProfileNames.count(); ++ i) { |
223 | if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) { | 226 | if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) { |
224 | KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error")); | 227 | KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error")); |
225 | return; | 228 | return; |
226 | } | 229 | } |
227 | } | 230 | } |
228 | usrWriteConfig(); | 231 | usrWriteConfig(); |
229 | QDialog::accept(); | 232 | QDialog::accept(); |
230 | } | 233 | } |
231 | void KSyncPrefsDialog::accept() | 234 | void KSyncPrefsDialog::accept() |
232 | { | 235 | { |
233 | slotOK(); | 236 | slotOK(); |
234 | } | 237 | } |
235 | void KSyncPrefsDialog::chooseFile() | 238 | void KSyncPrefsDialog::chooseFile() |
236 | { | 239 | { |
237 | QString fn = QDir::homeDirPath(); | 240 | QString fn = QDir::homeDirPath(); |
238 | 241 | ||
239 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); | 242 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); |
240 | if ( fn == "" ) | 243 | if ( fn == "" ) |
241 | return; | 244 | return; |
242 | mRemoteFile->setText( fn ); | 245 | mRemoteFile->setText( fn ); |
243 | } | 246 | } |
244 | 247 | ||
245 | void KSyncPrefsDialog::textChanged( const QString & s ) | 248 | void KSyncPrefsDialog::textChanged( const QString & s ) |
246 | { | 249 | { |
247 | if ( mProfileBox->count() == 0 ) | 250 | if ( mProfileBox->count() == 0 ) |
248 | return; | 251 | return; |
249 | if ( currentSelection < 3 ) { | 252 | if ( currentSelection < 3 ) { |
250 | //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); | 253 | //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); |
251 | mProfileBox->blockSignals( true ); | 254 | mProfileBox->blockSignals( true ); |
252 | mProfileBox->setCurrentItem(mProfileBox-> currentItem ()); | 255 | mProfileBox->setCurrentItem(mProfileBox-> currentItem ()); |
253 | mProfileBox->blockSignals( false ); | 256 | mProfileBox->blockSignals( false ); |
254 | return; | 257 | return; |
255 | } | 258 | } |
256 | //qDebug("cur i %d ",mProfileBox-> currentItem () ); | 259 | //qDebug("cur i %d ",mProfileBox-> currentItem () ); |
257 | mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; | 260 | mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; |
258 | KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; | 261 | KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; |
259 | prof->setName( s ); | 262 | prof->setName( s ); |
260 | mSyncProfileNames[mProfileBox-> currentItem ()] = s; | 263 | mSyncProfileNames[mProfileBox-> currentItem ()] = s; |
261 | } | 264 | } |
262 | void KSyncPrefsDialog::profileChanged( int item ) | 265 | void KSyncPrefsDialog::profileChanged( int item ) |
263 | { | 266 | { |
264 | //qDebug("KSyncPrefsDialog::profileChanged %d ", item ); | 267 | //qDebug("KSyncPrefsDialog::profileChanged %d ", item ); |
265 | KSyncProfile* prof; | 268 | KSyncProfile* prof; |
266 | saveProfile(); | 269 | saveProfile(); |
267 | currentSelection = item; | 270 | currentSelection = item; |
268 | prof = mSyncProfiles.at(item) ; | 271 | prof = mSyncProfiles.at(item) ; |
269 | mRemotePrecommand->setText(prof->getPreSyncCommand()); | 272 | mRemotePrecommand->setText(prof->getPreSyncCommand()); |
270 | mRemotePostcommand->setText(prof->getPostSyncCommand()); | 273 | mRemotePostcommand->setText(prof->getPostSyncCommand()); |
271 | mLocalTempFile->setText(prof->getLocalTempFile()); | 274 | mLocalTempFile->setText(prof->getLocalTempFile()); |
272 | mRemoteFile->setText(prof->getRemoteFileName()) ; | 275 | mRemoteFile->setText(prof->getRemoteFileName()) ; |
273 | mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); | 276 | mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); |
274 | mAskForPreferences->setChecked( prof->getAskForPreferences()); | 277 | mAskForPreferences->setChecked( prof->getAskForPreferences()); |
275 | mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); | 278 | mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); |
276 | mWriteBackFile->setChecked( prof->getWriteBackFile()); | 279 | mWriteBackFile->setChecked( prof->getWriteBackFile()); |
277 | mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); | 280 | mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); |
281 | mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); | ||
278 | 282 | ||
279 | switch ( prof->getSyncPrefs() ) { | 283 | switch ( prof->getSyncPrefs() ) { |
280 | case 0: | 284 | case 0: |
281 | loc->setChecked( true); | 285 | loc->setChecked( true); |
282 | break; | 286 | break; |
283 | case 1: | 287 | case 1: |
284 | rem->setChecked( true ); | 288 | rem->setChecked( true ); |
285 | break; | 289 | break; |
286 | case 2: | 290 | case 2: |
287 | newest->setChecked( true); | 291 | newest->setChecked( true); |
288 | break; | 292 | break; |
289 | case 3: | 293 | case 3: |
290 | ask->setChecked( true); | 294 | ask->setChecked( true); |
291 | break; | 295 | break; |
292 | case 4: | 296 | case 4: |
293 | f_loc->setChecked( true); | 297 | f_loc->setChecked( true); |
294 | break; | 298 | break; |
295 | case 5: | 299 | case 5: |
296 | f_rem->setChecked( true); | 300 | f_rem->setChecked( true); |
297 | break; | 301 | break; |
298 | case 6: | 302 | case 6: |
299 | //both->setChecked( true); | 303 | //both->setChecked( true); |
300 | break; | 304 | break; |
301 | default: | 305 | default: |
302 | break; | 306 | break; |
303 | } | 307 | } |
304 | mIsLocal->setChecked(prof->getIsLocalFileSync()) ; | 308 | mIsLocal->setChecked(prof->getIsLocalFileSync()) ; |
305 | mIsNotLocal->setChecked(!prof->getIsLocalFileSync()); | 309 | mIsNotLocal->setChecked(!prof->getIsLocalFileSync()); |
306 | proGr->setEnabled( item > 2 ); | 310 | proGr->setEnabled( item > 2 ); |
307 | if ( item < 3 ) { | 311 | if ( item < 3 ) { |
308 | localFileWidget->setEnabled(false); | 312 | localFileWidget->setEnabled(false); |
309 | remoteFileWidget->setEnabled(false); | 313 | remoteFileWidget->setEnabled(false); |
310 | 314 | ||
311 | } else | 315 | } else |
312 | kindChanged( prof->getIsLocalFileSync() ); | 316 | kindChanged( prof->getIsLocalFileSync() ); |
313 | } | 317 | } |
314 | 318 | ||
315 | void KSyncPrefsDialog::fillSSH() | 319 | void KSyncPrefsDialog::fillSSH() |
316 | { | 320 | { |
317 | mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); | 321 | mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); |
318 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); | 322 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); |
319 | mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" ); | 323 | mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" ); |
320 | } | 324 | } |
321 | void KSyncPrefsDialog::fillFTP() | 325 | void KSyncPrefsDialog::fillFTP() |
322 | { | 326 | { |
323 | mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" ); | 327 | mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" ); |
324 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); | 328 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); |
325 | mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); | 329 | mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); |
326 | 330 | ||
327 | } | 331 | } |
328 | void KSyncPrefsDialog::kindChanged( bool b ) | 332 | void KSyncPrefsDialog::kindChanged( bool b ) |
329 | { | 333 | { |
330 | 334 | ||
331 | localFileWidget->setEnabled(b); | 335 | localFileWidget->setEnabled(b); |
332 | remoteFileWidget->setEnabled(!b); | 336 | remoteFileWidget->setEnabled(!b); |
333 | 337 | ||
334 | } | 338 | } |
335 | void KSyncPrefsDialog::deleteProfile() | 339 | void KSyncPrefsDialog::deleteProfile() |
336 | { | 340 | { |
337 | //qDebug("KSyncPrefsDialog::deleteProfile() "); | 341 | //qDebug("KSyncPrefsDialog::deleteProfile() "); |
338 | if ( currentSelection >= 0 ) { | 342 | if ( currentSelection >= 0 ) { |
339 | if ( currentSelection < 3 ) { | 343 | if ( currentSelection < 3 ) { |
340 | KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error")); | 344 | KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error")); |
341 | return; | 345 | return; |
342 | } | 346 | } |
343 | KSyncProfile* temp = mSyncProfiles.at(currentSelection); | 347 | KSyncProfile* temp = mSyncProfiles.at(currentSelection); |
344 | mSyncProfiles.remove( temp ); | 348 | mSyncProfiles.remove( temp ); |
345 | mSyncProfileNames.remove( mSyncProfileNames.at( currentSelection )); | 349 | mSyncProfileNames.remove( mSyncProfileNames.at( currentSelection )); |
346 | insertProfiles(); | 350 | insertProfiles(); |
347 | } | 351 | } |
348 | } | 352 | } |
349 | 353 | ||
350 | void KSyncPrefsDialog::saveProfile() | 354 | void KSyncPrefsDialog::saveProfile() |
351 | { | 355 | { |
352 | KSyncProfile* prof; | 356 | KSyncProfile* prof; |
353 | if ( currentSelection >= 0 ) { | 357 | if ( currentSelection >= 0 ) { |
354 | prof = mSyncProfiles.at(currentSelection) ; | 358 | prof = mSyncProfiles.at(currentSelection) ; |
355 | prof->setPreSyncCommand( mRemotePrecommand->text()); | 359 | prof->setPreSyncCommand( mRemotePrecommand->text()); |
356 | prof->setPostSyncCommand( mRemotePostcommand->text() ); | 360 | prof->setPostSyncCommand( mRemotePostcommand->text() ); |
357 | prof->setLocalTempFile( mLocalTempFile->text()); | 361 | prof->setLocalTempFile( mLocalTempFile->text()); |
358 | prof->setRemoteFileName( mRemoteFile->text() ); | 362 | prof->setRemoteFileName( mRemoteFile->text() ); |
359 | prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); | 363 | prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); |
360 | prof->setAskForPreferences( mAskForPreferences->isChecked()); | 364 | prof->setAskForPreferences( mAskForPreferences->isChecked()); |
361 | prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); | 365 | prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); |
362 | prof->setWriteBackFile( mWriteBackFile->isChecked()); | 366 | prof->setWriteBackFile( mWriteBackFile->isChecked()); |
363 | prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); | 367 | prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); |
368 | prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() ); | ||
364 | int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; | 369 | int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; |
365 | prof->setSyncPrefs( syncprefs); | 370 | prof->setSyncPrefs( syncprefs); |
366 | prof->setIsLocalFileSync( mIsLocal->isChecked() ); | 371 | prof->setIsLocalFileSync( mIsLocal->isChecked() ); |
367 | } | 372 | } |
368 | 373 | ||
369 | } | 374 | } |
370 | 375 | ||
371 | void KSyncPrefsDialog::insertProfiles() | 376 | void KSyncPrefsDialog::insertProfiles() |
372 | { | 377 | { |
373 | int curItem = mProfileBox->currentItem(); | 378 | int curItem = mProfileBox->currentItem(); |
374 | mProfileBox->blockSignals( true ); | 379 | mProfileBox->blockSignals( true ); |
375 | mProfileBox->clear(); | 380 | mProfileBox->clear(); |
376 | mProfileBox->insertStringList (mSyncProfileNames ); | 381 | mProfileBox->insertStringList (mSyncProfileNames ); |
377 | int item = mSyncProfileNames.count() -1; | 382 | int item = mSyncProfileNames.count() -1; |
378 | if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() ) | 383 | if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() ) |
379 | mProfileBox->setCurrentItem( curItem ); | 384 | mProfileBox->setCurrentItem( curItem ); |
380 | else if ( item >= 0 ) { | 385 | else if ( item >= 0 ) { |
381 | mProfileBox->setCurrentItem( item ); | 386 | mProfileBox->setCurrentItem( item ); |
382 | } | 387 | } |
383 | currentSelection = -1; | 388 | currentSelection = -1; |
384 | if ( mSyncProfileNames.count() > 0 ) { | 389 | if ( mSyncProfileNames.count() > 0 ) { |
385 | //qDebug(" profileChanged( mProfileBox->currentItem() "); | 390 | //qDebug(" profileChanged( mProfileBox->currentItem() "); |
386 | profileChanged( mProfileBox->currentItem() ); | 391 | profileChanged( mProfileBox->currentItem() ); |
387 | currentSelection = mProfileBox->currentItem(); | 392 | currentSelection = mProfileBox->currentItem(); |
388 | } | 393 | } |
389 | mProfileBox->blockSignals( false ); | 394 | mProfileBox->blockSignals( false ); |
390 | } | 395 | } |
391 | 396 | ||
392 | void KSyncPrefsDialog::addProfile ( KSyncProfile* temp ) | 397 | void KSyncPrefsDialog::addProfile ( KSyncProfile* temp ) |
393 | { | 398 | { |
394 | saveProfile(); | 399 | saveProfile(); |
395 | mSyncProfiles.append( temp ); | 400 | mSyncProfiles.append( temp ); |
396 | mSyncProfileNames << temp->getName(); | 401 | mSyncProfileNames << temp->getName(); |
397 | insertProfiles(); | 402 | insertProfiles(); |
398 | int last = mProfileBox->count() -1; | 403 | int last = mProfileBox->count() -1; |
399 | mProfileBox->blockSignals( true ); | 404 | mProfileBox->blockSignals( true ); |
400 | mProfileBox->setCurrentItem( last ); | 405 | mProfileBox->setCurrentItem( last ); |
401 | mProfileBox->blockSignals( false ); | 406 | mProfileBox->blockSignals( false ); |
402 | profileChanged(last); | 407 | profileChanged(last); |
403 | } | 408 | } |
404 | void KSyncPrefsDialog::newProfile() | 409 | void KSyncPrefsDialog::newProfile() |
405 | { | 410 | { |
406 | addProfile ( new KSyncProfile () ); | 411 | addProfile ( new KSyncProfile () ); |
407 | } | 412 | } |
408 | 413 | ||
409 | void KSyncPrefsDialog::cloneProfile() | 414 | void KSyncPrefsDialog::cloneProfile() |
410 | { | 415 | { |
411 | if ( currentSelection >= 0 ) | 416 | if ( currentSelection >= 0 ) |
412 | addProfile (mSyncProfiles.at(currentSelection)->clone()) ; | 417 | addProfile (mSyncProfiles.at(currentSelection)->clone()) ; |
413 | else | 418 | else |
414 | newProfile(); | 419 | newProfile(); |
415 | } | 420 | } |
416 | 421 | ||
417 | void KSyncPrefsDialog::setLocalMachineName ( const QString& name ) | 422 | void KSyncPrefsDialog::setLocalMachineName ( const QString& name ) |
418 | { | 423 | { |
419 | mMyMachineName->setText( name ); | 424 | mMyMachineName->setText( name ); |
420 | 425 | ||
421 | } | 426 | } |
422 | QString KSyncPrefsDialog::getLocalMachineName ( ) | 427 | QString KSyncPrefsDialog::getLocalMachineName ( ) |
423 | { | 428 | { |
424 | return mMyMachineName->text(); | 429 | return mMyMachineName->text(); |
425 | } | 430 | } |
426 | 431 | ||
427 | QStringList KSyncPrefsDialog::getSyncProfileNames() | 432 | QStringList KSyncPrefsDialog::getSyncProfileNames() |
428 | { | 433 | { |
429 | return mSyncProfileNames; | 434 | return mSyncProfileNames; |
430 | } | 435 | } |
431 | void KSyncPrefsDialog::usrReadConfig() | 436 | void KSyncPrefsDialog::usrReadConfig() |
432 | { | 437 | { |
433 | //KConfig *config = KOGlobals::config(); | 438 | //KConfig *config = KOGlobals::config(); |
434 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); | 439 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
435 | config.setGroup("SyncProfiles"); | 440 | config.setGroup("SyncProfiles"); |
436 | mSyncProfileNames =config.readListEntry("SyncProfileNames"); | 441 | mSyncProfileNames =config.readListEntry("SyncProfileNames"); |
437 | mMyMachineName->setText(config.readEntry("LocalMachineName","undefined")); | 442 | mMyMachineName->setText(config.readEntry("LocalMachineName","undefined")); |
438 | int i; | 443 | int i; |
439 | KSyncProfile* temp ; | 444 | KSyncProfile* temp ; |
440 | mSyncProfiles.clear(); | 445 | mSyncProfiles.clear(); |
441 | for ( i = 0; i < mSyncProfileNames.count();++i ) { | 446 | for ( i = 0; i < mSyncProfileNames.count();++i ) { |
442 | temp = new KSyncProfile (); | 447 | temp = new KSyncProfile (); |
443 | temp->setName( mSyncProfileNames[i] ); | 448 | temp->setName( mSyncProfileNames[i] ); |
444 | temp->readConfig( &config ); | 449 | temp->readConfig( &config ); |
445 | mSyncProfiles.append( temp ); | 450 | mSyncProfiles.append( temp ); |
446 | } | 451 | } |
447 | insertProfiles(); | 452 | insertProfiles(); |
448 | //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); | 453 | //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); |
449 | } | 454 | } |
450 | 455 | ||
451 | 456 | ||
452 | void KSyncPrefsDialog::usrWriteConfig() | 457 | void KSyncPrefsDialog::usrWriteConfig() |
453 | { | 458 | { |
454 | saveProfile(); | 459 | saveProfile(); |
455 | if ( currentSelection >= 0 ) | 460 | if ( currentSelection >= 0 ) |
456 | profileChanged(currentSelection); | 461 | profileChanged(currentSelection); |
457 | //KConfig *config = KOGlobals::config(); | 462 | //KConfig *config = KOGlobals::config(); |
458 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); | 463 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
459 | config.setGroup("SyncProfiles"); | 464 | config.setGroup("SyncProfiles"); |
460 | KSyncProfile* prof = mSyncProfiles.first(); | 465 | KSyncProfile* prof = mSyncProfiles.first(); |
461 | while ( prof ) { | 466 | while ( prof ) { |
462 | prof->writeConfig(&config); | 467 | prof->writeConfig(&config); |
463 | prof = mSyncProfiles.next(); | 468 | prof = mSyncProfiles.next(); |
464 | } | 469 | } |
465 | //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; | 470 | //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; |
466 | //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); | 471 | //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); |
467 | config.writeEntry("SyncProfileNames",mSyncProfileNames); | 472 | config.writeEntry("SyncProfileNames",mSyncProfileNames); |
468 | QString name = mMyMachineName->text(); | 473 | QString name = mMyMachineName->text(); |
469 | config.writeEntry("LocalMachineName",name); | 474 | config.writeEntry("LocalMachineName",name); |
470 | } | 475 | } |
471 | 476 | ||
diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h index 90fa286..c663d22 100644 --- a/libkdepim/ksyncprefsdialog.h +++ b/libkdepim/ksyncprefsdialog.h | |||
@@ -1,110 +1,111 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@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 | #ifndef _KSYNCPREFSDIALOG_H | 23 | #ifndef _KSYNCPREFSDIALOG_H |
24 | #define _KSYNCPREFSDIALOG_H | 24 | #define _KSYNCPREFSDIALOG_H |
25 | 25 | ||
26 | 26 | ||
27 | #include <kdialogbase.h> | 27 | #include <kdialogbase.h> |
28 | #include <qptrlist.h> | 28 | #include <qptrlist.h> |
29 | 29 | ||
30 | //#include <libkdepim/kprefsdialog.h> | 30 | //#include <libkdepim/kprefsdialog.h> |
31 | 31 | ||
32 | class KColorButton; | 32 | class KColorButton; |
33 | class QSpinBox;; | 33 | class QSpinBox;; |
34 | class QRadioButton; | 34 | class QRadioButton; |
35 | class QCheckBox; | 35 | class QCheckBox; |
36 | class QSlider; | 36 | class QSlider; |
37 | class KURLRequester; | 37 | class KURLRequester; |
38 | class QComboBox; | 38 | class QComboBox; |
39 | class QButtonGroup; | 39 | class QButtonGroup; |
40 | class QLineEdit; | 40 | class QLineEdit; |
41 | class QVBox; | 41 | class QVBox; |
42 | class QStringList; | 42 | class QStringList; |
43 | class KSyncProfile; | 43 | class KSyncProfile; |
44 | 44 | ||
45 | /** Dialog to change the korganizer configuration. | 45 | /** Dialog to change the korganizer configuration. |
46 | */ | 46 | */ |
47 | class KSyncPrefsDialog : public KDialog | 47 | class KSyncPrefsDialog : public KDialog |
48 | { | 48 | { |
49 | Q_OBJECT | 49 | Q_OBJECT |
50 | public: | 50 | public: |
51 | /** Initialize dialog and pages */ | 51 | /** Initialize dialog and pages */ |
52 | KSyncPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); | 52 | KSyncPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); |
53 | ~KSyncPrefsDialog(); | 53 | ~KSyncPrefsDialog(); |
54 | void usrReadConfig(); | 54 | void usrReadConfig(); |
55 | void setLocalMachineName ( const QString& name ); | 55 | void setLocalMachineName ( const QString& name ); |
56 | QString getLocalMachineName ( ); | 56 | QString getLocalMachineName ( ); |
57 | 57 | ||
58 | QStringList getSyncProfileNames(); | 58 | QStringList getSyncProfileNames(); |
59 | 59 | ||
60 | public slots: | 60 | public slots: |
61 | protected slots: | 61 | protected slots: |
62 | void accept(); | 62 | void accept(); |
63 | void deleteProfile(); | 63 | void deleteProfile(); |
64 | void newProfile(); | 64 | void newProfile(); |
65 | void cloneProfile(); | 65 | void cloneProfile(); |
66 | void kindChanged(bool); | 66 | void kindChanged(bool); |
67 | void fillSSH(); | 67 | void fillSSH(); |
68 | void fillFTP(); | 68 | void fillFTP(); |
69 | void textChanged( const QString & ); | 69 | void textChanged( const QString & ); |
70 | void profileChanged( int ); | 70 | void profileChanged( int ); |
71 | void chooseFile(); | 71 | void chooseFile(); |
72 | void slotOK(); | 72 | void slotOK(); |
73 | 73 | ||
74 | protected: | 74 | protected: |
75 | void usrWriteConfig(); | 75 | void usrWriteConfig(); |
76 | 76 | ||
77 | void setupSyncAlgTab(); | 77 | void setupSyncAlgTab(); |
78 | 78 | ||
79 | private: | 79 | private: |
80 | int currentSelection; | 80 | int currentSelection; |
81 | QPtrList<KSyncProfile> mSyncProfiles; | 81 | QPtrList<KSyncProfile> mSyncProfiles; |
82 | QStringList mSyncProfileNames; | 82 | QStringList mSyncProfileNames; |
83 | QLineEdit * mMyMachineName; | 83 | QLineEdit * mMyMachineName; |
84 | QComboBox * mProfileBox; | 84 | QComboBox * mProfileBox; |
85 | QRadioButton* mIsLocal; | 85 | QRadioButton* mIsLocal; |
86 | QRadioButton* mIsNotLocal; | 86 | QRadioButton* mIsNotLocal; |
87 | QCheckBox* mIncludeInRing; | 87 | QCheckBox* mIncludeInRing; |
88 | QCheckBox* mIncludeInRingAB; | ||
88 | void addProfile ( KSyncProfile* ); | 89 | void addProfile ( KSyncProfile* ); |
89 | void insertProfiles(); | 90 | void insertProfiles(); |
90 | void saveProfile(); | 91 | void saveProfile(); |
91 | QButtonGroup* proGr; | 92 | QButtonGroup* proGr; |
92 | 93 | ||
93 | QRadioButton* loc, *rem, *newest, *ask, *f_loc,* f_rem, *both; | 94 | QRadioButton* loc, *rem, *newest, *ask, *f_loc,* f_rem, *both; |
94 | 95 | ||
95 | 96 | ||
96 | QLineEdit * mRemotePostcommand; | 97 | QLineEdit * mRemotePostcommand; |
97 | QLineEdit * mRemotePrecommand; | 98 | QLineEdit * mRemotePrecommand; |
98 | QLineEdit * mRemoteFile; | 99 | QLineEdit * mRemoteFile; |
99 | QLineEdit * mLocalTempFile; | 100 | QLineEdit * mLocalTempFile; |
100 | QWidget* mSetupSyncAlgTab; | 101 | QWidget* mSetupSyncAlgTab; |
101 | 102 | ||
102 | QVBox* localFileWidget; | 103 | QVBox* localFileWidget; |
103 | QVBox* remoteFileWidget; | 104 | QVBox* remoteFileWidget; |
104 | QCheckBox* mWriteBackFile; | 105 | QCheckBox* mWriteBackFile; |
105 | QCheckBox* mWriteBackExisting; | 106 | QCheckBox* mWriteBackExisting; |
106 | QCheckBox* mAskForPreferences; | 107 | QCheckBox* mAskForPreferences; |
107 | QCheckBox* mShowSummaryAfterSync; | 108 | QCheckBox* mShowSummaryAfterSync; |
108 | }; | 109 | }; |
109 | 110 | ||
110 | #endif | 111 | #endif |
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp index d6d8fa3..ea41a85 100644 --- a/libkdepim/ksyncprofile.cpp +++ b/libkdepim/ksyncprofile.cpp | |||
@@ -1,125 +1,129 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> | 3 | Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library 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 GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | // $Id$ | 21 | // $Id$ |
22 | 22 | ||
23 | #include <qcolor.h> | 23 | #include <qcolor.h> |
24 | 24 | ||
25 | #include <kconfig.h> | 25 | #include <kconfig.h> |
26 | #include <kstandarddirs.h> | 26 | #include <kstandarddirs.h> |
27 | #include <kglobal.h> | 27 | #include <kglobal.h> |
28 | #include <kdebug.h> | 28 | #include <kdebug.h> |
29 | 29 | ||
30 | #include "ksyncprofile.h" | 30 | #include "ksyncprofile.h" |
31 | 31 | ||
32 | 32 | ||
33 | KSyncProfile::KSyncProfile( const char * name): QObject (0, name ) | 33 | KSyncProfile::KSyncProfile( const char * name): QObject (0, name ) |
34 | { | 34 | { |
35 | setDefault(); | 35 | setDefault(); |
36 | } | 36 | } |
37 | KSyncProfile::~KSyncProfile() | 37 | KSyncProfile::~KSyncProfile() |
38 | { | 38 | { |
39 | 39 | ||
40 | } | 40 | } |
41 | 41 | ||
42 | 42 | ||
43 | KSyncProfile* KSyncProfile::clone() | 43 | KSyncProfile* KSyncProfile::clone() |
44 | { | 44 | { |
45 | KSyncProfile* myClone = new KSyncProfile(); | 45 | KSyncProfile* myClone = new KSyncProfile(); |
46 | myClone->setPreSyncCommand( mPreSyncCommand ); | 46 | myClone->setPreSyncCommand( mPreSyncCommand ); |
47 | myClone->setPostSyncCommand( mPostSyncCommand ); | 47 | myClone->setPostSyncCommand( mPostSyncCommand ); |
48 | myClone->setLocalTempFile( mLocalTempFile); | 48 | myClone->setLocalTempFile( mLocalTempFile); |
49 | myClone->setRemoteFileName( mRemoteFileName ); | 49 | myClone->setRemoteFileName( mRemoteFileName ); |
50 | myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); | 50 | myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); |
51 | myClone->setAskForPreferences( mAskForPreferences); | 51 | myClone->setAskForPreferences( mAskForPreferences); |
52 | myClone->setWriteBackExisting(mWriteBackExisting ); | 52 | myClone->setWriteBackExisting(mWriteBackExisting ); |
53 | myClone->setWriteBackFile( mWriteBackFile); | 53 | myClone->setWriteBackFile( mWriteBackFile); |
54 | myClone->setIncludeInRingSync( mIncludeInRingSync ); | 54 | myClone->setIncludeInRingSync( mIncludeInRingSync ); |
55 | myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); | ||
55 | myClone->setSyncPrefs( mSyncPrefs); | 56 | myClone->setSyncPrefs( mSyncPrefs); |
56 | myClone->setIsLocalFileSync( mIsLocalFileSync ); | 57 | myClone->setIsLocalFileSync( mIsLocalFileSync ); |
57 | myClone->setName( "noName" ); | 58 | myClone->setName( "noName" ); |
58 | return myClone; | 59 | return myClone; |
59 | } | 60 | } |
60 | 61 | ||
61 | 62 | ||
62 | void KSyncProfile::setDefault() | 63 | void KSyncProfile::setDefault() |
63 | { | 64 | { |
64 | mName = "noName"; | 65 | mName = "noName"; |
65 | mPreSyncCommand = i18n("command for downloading remote file to local device"); | 66 | mPreSyncCommand = i18n("command for downloading remote file to local device"); |
66 | mPostSyncCommand = i18n("command for uploading local temp file to remote device"); | 67 | mPostSyncCommand = i18n("command for uploading local temp file to remote device"); |
67 | mLocalTempFile = "/tmp/mycalendar.ics"; | 68 | mLocalTempFile = "/tmp/mycalendar.ics"; |
68 | mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; | 69 | mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; |
69 | mShowSummaryAfterSync = true; | 70 | mShowSummaryAfterSync = true; |
70 | mAskForPreferences = true; | 71 | mAskForPreferences = true; |
71 | mWriteBackExisting = false; | 72 | mWriteBackExisting = false; |
72 | mWriteBackFile = true; | 73 | mWriteBackFile = true; |
73 | mIncludeInRingSync = false; | 74 | mIncludeInRingSync = false; |
75 | mIncludeInRingSyncAB = false; | ||
74 | mSyncPrefs = SYNC_PREF_ASK; | 76 | mSyncPrefs = SYNC_PREF_ASK; |
75 | mIsLocalFileSync = true; | 77 | mIsLocalFileSync = true; |
76 | 78 | ||
77 | } | 79 | } |
78 | void KSyncProfile::readConfig(KConfig *config ) | 80 | void KSyncProfile::readConfig(KConfig *config ) |
79 | { | 81 | { |
80 | config->setGroup("SyncProfiles"); | 82 | config->setGroup("SyncProfiles"); |
81 | QString prefix = "Profile_"+mName+"_"; | 83 | QString prefix = "Profile_"+mName+"_"; |
82 | //mName = config->readEntry( prefix+ "Name", mName ); | 84 | //mName = config->readEntry( prefix+ "Name", mName ); |
83 | mPreSyncCommand = config->readEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); | 85 | mPreSyncCommand = config->readEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); |
84 | mPostSyncCommand = config->readEntry( prefix+ "PostSyncCommand", mPostSyncCommand ); | 86 | mPostSyncCommand = config->readEntry( prefix+ "PostSyncCommand", mPostSyncCommand ); |
85 | mIncludeInRingSync = config->readBoolEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); | 87 | mIncludeInRingSync = config->readBoolEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); |
88 | mIncludeInRingSyncAB = config->readBoolEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB ); | ||
86 | mLocalTempFile = config->readEntry( prefix+ "LocalTempFile", mLocalTempFile ); | 89 | mLocalTempFile = config->readEntry( prefix+ "LocalTempFile", mLocalTempFile ); |
87 | mRemoteFileName = config->readEntry( prefix+ "RemoteFileName", mRemoteFileName ); | 90 | mRemoteFileName = config->readEntry( prefix+ "RemoteFileName", mRemoteFileName ); |
88 | mShowSummaryAfterSync = config->readBoolEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); | 91 | mShowSummaryAfterSync = config->readBoolEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); |
89 | mAskForPreferences = config->readBoolEntry( prefix+ "AskForPreferences",mAskForPreferences ); | 92 | mAskForPreferences = config->readBoolEntry( prefix+ "AskForPreferences",mAskForPreferences ); |
90 | mWriteBackExisting = config->readBoolEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); | 93 | mWriteBackExisting = config->readBoolEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); |
91 | mSyncPrefs = config->readNumEntry( prefix+ "SyncPrefs", mSyncPrefs ); | 94 | mSyncPrefs = config->readNumEntry( prefix+ "SyncPrefs", mSyncPrefs ); |
92 | mIsLocalFileSync= config->readBoolEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); | 95 | mIsLocalFileSync= config->readBoolEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); |
93 | } | 96 | } |
94 | void KSyncProfile::writeConfig( KConfig * config ) | 97 | void KSyncProfile::writeConfig( KConfig * config ) |
95 | { | 98 | { |
96 | config->setGroup("SyncProfiles"); | 99 | config->setGroup("SyncProfiles"); |
97 | QString prefix = "Profile_"+mName+"_"; | 100 | QString prefix = "Profile_"+mName+"_"; |
98 | // config->writeEntry( prefix+ "Name", mName ); | 101 | // config->writeEntry( prefix+ "Name", mName ); |
99 | config->writeEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); | 102 | config->writeEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); |
100 | config->writeEntry( prefix+ "PostSyncCommand", mPostSyncCommand ); | 103 | config->writeEntry( prefix+ "PostSyncCommand", mPostSyncCommand ); |
101 | config->writeEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); | 104 | config->writeEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); |
105 | config->writeEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB ); | ||
102 | config->writeEntry( prefix+ "LocalTempFile", mLocalTempFile ); | 106 | config->writeEntry( prefix+ "LocalTempFile", mLocalTempFile ); |
103 | config->writeEntry( prefix+ "RemoteFileName", mRemoteFileName ); | 107 | config->writeEntry( prefix+ "RemoteFileName", mRemoteFileName ); |
104 | config->writeEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); | 108 | config->writeEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); |
105 | config->writeEntry( prefix+ "AskForPreferences",mAskForPreferences ); | 109 | config->writeEntry( prefix+ "AskForPreferences",mAskForPreferences ); |
106 | config->writeEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); | 110 | config->writeEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); |
107 | config->writeEntry( prefix+ "SyncPrefs", mSyncPrefs ); | 111 | config->writeEntry( prefix+ "SyncPrefs", mSyncPrefs ); |
108 | config->writeEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); | 112 | config->writeEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); |
109 | } | 113 | } |
110 | 114 | ||
111 | /* | 115 | /* |
112 | class KPrefsItemInt : public KPrefsItem { | 116 | class KPrefsItemInt : public KPrefsItem { |
113 | public: | 117 | public: |
114 | KPrefsItemInt(const QString &group,const QString &name,int *,int defaultValue=0); | 118 | KPrefsItemInt(const QString &group,const QString &name,int *,int defaultValue=0); |
115 | virtual ~KPrefsItemInt() {} | 119 | virtual ~KPrefsItemInt() {} |
116 | 120 | ||
117 | void setDefault(); | 121 | void setDefault(); |
118 | void readConfig(KConfig *); | 122 | void readConfig(KConfig *); |
119 | void writeConfig(KConfig *); | 123 | void writeConfig(KConfig *); |
120 | 124 | ||
121 | private: | 125 | private: |
122 | int *mReference; | 126 | int *mReference; |
123 | int mDefault; | 127 | int mDefault; |
124 | }; | 128 | }; |
125 | */ | 129 | */ |
diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h index 3f7f1ac..df1b49e 100644 --- a/libkdepim/ksyncprofile.h +++ b/libkdepim/ksyncprofile.h | |||
@@ -1,102 +1,105 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> | 3 | Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library 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 GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | #ifndef _KSYNCPROFILE_H | 20 | #ifndef _KSYNCPROFILE_H |
21 | #define _KSYNCPROFILE_H | 21 | #define _KSYNCPROFILE_H |
22 | 22 | ||
23 | #include <qptrlist.h> | 23 | #include <qptrlist.h> |
24 | #include <qcolor.h> | 24 | #include <qcolor.h> |
25 | #include <qfont.h> | 25 | #include <qfont.h> |
26 | #include <qstringlist.h> | 26 | #include <qstringlist.h> |
27 | #include <qobject.h> | 27 | #include <qobject.h> |
28 | #include <qstring.h> | 28 | #include <qstring.h> |
29 | 29 | ||
30 | #include <libkcal/syncdefines.h> | 30 | #include <libkcal/syncdefines.h> |
31 | 31 | ||
32 | 32 | ||
33 | 33 | ||
34 | class KConfig; | 34 | class KConfig; |
35 | 35 | ||
36 | /** | 36 | /** |
37 | @short Class for storing a preferences setting | 37 | @short Class for storing a preferences setting |
38 | @author Cornelius Schumacher | 38 | @author Cornelius Schumacher |
39 | @see KPref | 39 | @see KPref |
40 | 40 | ||
41 | This class represents one preferences setting as used by @ref KPrefs. | 41 | This class represents one preferences setting as used by @ref KPrefs. |
42 | Subclasses of KPrefsItem implement storage functions for a certain type of | 42 | Subclasses of KPrefsItem implement storage functions for a certain type of |
43 | setting. Normally you don't have to use this class directly. Use the special | 43 | setting. Normally you don't have to use this class directly. Use the special |
44 | addItem() functions of KPrefs instead. If you subclass this class you will | 44 | addItem() functions of KPrefs instead. If you subclass this class you will |
45 | have to register instances with the function KPrefs::addItem(). | 45 | have to register instances with the function KPrefs::addItem(). |
46 | */ | 46 | */ |
47 | class KSyncProfile : public QObject { | 47 | class KSyncProfile : public QObject { |
48 | public: | 48 | public: |
49 | KSyncProfile( const char * name = 0); | 49 | KSyncProfile( const char * name = 0); |
50 | ~KSyncProfile() ; | 50 | ~KSyncProfile() ; |
51 | 51 | ||
52 | KSyncProfile* clone(); | 52 | KSyncProfile* clone(); |
53 | void setDefault(); | 53 | void setDefault(); |
54 | void readConfig(KConfig *); | 54 | void readConfig(KConfig *); |
55 | void writeConfig(KConfig *); | 55 | void writeConfig(KConfig *); |
56 | void setName( const QString& n ) {mName = n;} | 56 | void setName( const QString& n ) {mName = n;} |
57 | QString getName( ) { return mName;} | 57 | QString getName( ) { return mName;} |
58 | void setPreSyncCommand( const QString& n ) {mPreSyncCommand = n;} | 58 | void setPreSyncCommand( const QString& n ) {mPreSyncCommand = n;} |
59 | QString getPreSyncCommand( ) { return mPreSyncCommand; } | 59 | QString getPreSyncCommand( ) { return mPreSyncCommand; } |
60 | void setPostSyncCommand( const QString& n ) {mPostSyncCommand = n;} | 60 | void setPostSyncCommand( const QString& n ) {mPostSyncCommand = n;} |
61 | QString getPostSyncCommand( ) { return mPostSyncCommand;} | 61 | QString getPostSyncCommand( ) { return mPostSyncCommand;} |
62 | 62 | ||
63 | void setLocalTempFile( const QString& n ) { mLocalTempFile= n;} | 63 | void setLocalTempFile( const QString& n ) { mLocalTempFile= n;} |
64 | QString getLocalTempFile( ) { return mLocalTempFile;} | 64 | QString getLocalTempFile( ) { return mLocalTempFile;} |
65 | void setRemoteFileName( const QString& n ) { mRemoteFileName = n;} | 65 | void setRemoteFileName( const QString& n ) { mRemoteFileName = n;} |
66 | QString getRemoteFileName( ) { return mRemoteFileName;} | 66 | QString getRemoteFileName( ) { return mRemoteFileName;} |
67 | /* | 67 | /* |
68 | void set( const QString& n ) { = n;} | 68 | void set( const QString& n ) { = n;} |
69 | QString get( ) { return ;} | 69 | QString get( ) { return ;} |
70 | */ | 70 | */ |
71 | 71 | ||
72 | void setShowSummaryAfterSync( bool b ) { mShowSummaryAfterSync = b;} | 72 | void setShowSummaryAfterSync( bool b ) { mShowSummaryAfterSync = b;} |
73 | bool getShowSummaryAfterSync( ) { return mShowSummaryAfterSync ;} | 73 | bool getShowSummaryAfterSync( ) { return mShowSummaryAfterSync ;} |
74 | void setAskForPreferences( bool b ) { mAskForPreferences= b;} | 74 | void setAskForPreferences( bool b ) { mAskForPreferences= b;} |
75 | bool getAskForPreferences( ) { return mAskForPreferences;} | 75 | bool getAskForPreferences( ) { return mAskForPreferences;} |
76 | void setWriteBackExisting( bool b ) { mWriteBackExisting = b;} | 76 | void setWriteBackExisting( bool b ) { mWriteBackExisting = b;} |
77 | bool getWriteBackExisting( ) { return mWriteBackExisting;} | 77 | bool getWriteBackExisting( ) { return mWriteBackExisting;} |
78 | void setWriteBackFile( bool b ) { mWriteBackFile= b;} | 78 | void setWriteBackFile( bool b ) { mWriteBackFile= b;} |
79 | bool getWriteBackFile( ) { return mWriteBackFile;} | 79 | bool getWriteBackFile( ) { return mWriteBackFile;} |
80 | void setIncludeInRingSync( bool b ) {mIncludeInRingSync = b;} | 80 | void setIncludeInRingSync( bool b ) {mIncludeInRingSync = b;} |
81 | bool getIncludeInRingSync( ) { return mIncludeInRingSync;} | 81 | bool getIncludeInRingSync( ) { return mIncludeInRingSync;} |
82 | void setIncludeInRingSyncAB( bool b ) {mIncludeInRingSyncAB = b;} | ||
83 | bool getIncludeInRingSyncAB( ) { return mIncludeInRingSyncAB;} | ||
82 | void setSyncPrefs( int n ) { mSyncPrefs= n;} | 84 | void setSyncPrefs( int n ) { mSyncPrefs= n;} |
83 | int getSyncPrefs( ) { return mSyncPrefs;} | 85 | int getSyncPrefs( ) { return mSyncPrefs;} |
84 | void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;} | 86 | void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;} |
85 | bool getIsLocalFileSync( ) { return mIsLocalFileSync;} | 87 | bool getIsLocalFileSync( ) { return mIsLocalFileSync;} |
86 | 88 | ||
87 | private: | 89 | private: |
88 | QString mName; | 90 | QString mName; |
89 | QString mPreSyncCommand; | 91 | QString mPreSyncCommand; |
90 | QString mPostSyncCommand; | 92 | QString mPostSyncCommand; |
91 | QString mLocalTempFile; | 93 | QString mLocalTempFile; |
92 | QString mRemoteFileName; | 94 | QString mRemoteFileName; |
93 | bool mIncludeInRingSync; | 95 | bool mIncludeInRingSync; |
96 | bool mIncludeInRingSyncAB; | ||
94 | int mSyncPrefs; | 97 | int mSyncPrefs; |
95 | bool mWriteBackFile; | 98 | bool mWriteBackFile; |
96 | bool mWriteBackExisting; | 99 | bool mWriteBackExisting; |
97 | bool mAskForPreferences; | 100 | bool mAskForPreferences; |
98 | bool mShowSummaryAfterSync; | 101 | bool mShowSummaryAfterSync; |
99 | bool mIsLocalFileSync; | 102 | bool mIsLocalFileSync; |
100 | }; | 103 | }; |
101 | 104 | ||
102 | #endif | 105 | #endif |