summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp11
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp2
-rw-r--r--microkde/kfiledialog.cpp11
-rw-r--r--microkde/kfiledialog.h2
-rw-r--r--microkde/kio/kfile/kurlrequester.cpp7
-rw-r--r--microkde/kio/kfile/kurlrequester.h2
6 files changed, 30 insertions, 5 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 4b82aa8..8f5de4d 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -455,387 +455,389 @@ void CalendarView::init()
455 "CalendarView::DateNavigator", QDate::currentDate()); 455 "CalendarView::DateNavigator", QDate::currentDate());
456#endif 456#endif
457 // mDateNavigator->blockSignals( true ); 457 // mDateNavigator->blockSignals( true );
458 //leftFrameLayout->addWidget( mDateNavigator ); 458 //leftFrameLayout->addWidget( mDateNavigator );
459 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); 459 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
460 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); 460 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
461 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); 461 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView");
462 mTodoList->setNavigator( mNavigator ); 462 mTodoList->setNavigator( mNavigator );
463#if 0 463#if 0
464 if ( QApplication::desktop()->width() < 480 ) { 464 if ( QApplication::desktop()->width() < 480 ) {
465 leftFrameLayout->addWidget(mFilterView); 465 leftFrameLayout->addWidget(mFilterView);
466 leftFrameLayout->addWidget(mTodoList, 2 ); 466 leftFrameLayout->addWidget(mTodoList, 2 );
467 467
468 } else { 468 } else {
469 leftFrameLayout->addWidget(mTodoList,2 ); 469 leftFrameLayout->addWidget(mTodoList,2 );
470 leftFrameLayout->addWidget(mFilterView ); 470 leftFrameLayout->addWidget(mFilterView );
471 } 471 }
472#endif 472#endif
473 mFilterView->hide(); 473 mFilterView->hide();
474 mCalEditView->hide(); 474 mCalEditView->hide();
475 QWidget *rightBox = new QWidget( mMainFrame ); 475 QWidget *rightBox = new QWidget( mMainFrame );
476 //mainBoxLayout->addWidget ( rightBox, 10 ); 476 //mainBoxLayout->addWidget ( rightBox, 10 );
477 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 477 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
478 mRightFrame = new QWidgetStack( rightBox ); 478 mRightFrame = new QWidgetStack( rightBox );
479 rightLayout->addWidget( mRightFrame, 10 ); 479 rightLayout->addWidget( mRightFrame, 10 );
480 480
481 //mLeftFrame = (QWidget *)leftFrame; 481 //mLeftFrame = (QWidget *)leftFrame;
482 if ( KOPrefs::instance()->mVerticalScreen ) { 482 if ( KOPrefs::instance()->mVerticalScreen ) {
483 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); 483 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
484 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); 484 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
485 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 485 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
486 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); 486 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
487 } else { 487 } else {
488 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); 488 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() );
489 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); 489 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
490 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); 490 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
491 } 491 }
492 if ( !KOPrefs::instance()->mShowDateNavigator) 492 if ( !KOPrefs::instance()->mShowDateNavigator)
493 mDateNavigator->hide(); 493 mDateNavigator->hide();
494 //qDebug("Calendarview Size %d %d ", width(), height()); 494 //qDebug("Calendarview Size %d %d ", width(), height());
495#endif 495#endif
496 496
497 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 497 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
498 SLOT( showDates( const KCal::DateList & ) ) ); 498 SLOT( showDates( const KCal::DateList & ) ) );
499 499
500 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 500 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
501 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 501 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
502 502
503 503
504 504
505 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), 505 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ),
506 mViewManager, SLOT( showMonth( const QDate & ) ) ); 506 mViewManager, SLOT( showMonth( const QDate & ) ) );
507 507
508 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), 508 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ),
509 mNavigator, SLOT( selectWeek( const QDate & ) ) ); 509 mNavigator, SLOT( selectWeek( const QDate & ) ) );
510 510
511 connect( mDateNavigator, SIGNAL( goPrevYear() ), 511 connect( mDateNavigator, SIGNAL( goPrevYear() ),
512 mNavigator, SLOT( selectPreviousYear() ) ); 512 mNavigator, SLOT( selectPreviousYear() ) );
513 connect( mDateNavigator, SIGNAL( goNextYear() ), 513 connect( mDateNavigator, SIGNAL( goNextYear() ),
514 mNavigator, SLOT( selectNextYear() ) ); 514 mNavigator, SLOT( selectNextYear() ) );
515 connect( mDateNavigator, SIGNAL( goPrevMonth() ), 515 connect( mDateNavigator, SIGNAL( goPrevMonth() ),
516 mNavigator, SLOT( selectPreviousMonth() ) ); 516 mNavigator, SLOT( selectPreviousMonth() ) );
517 connect( mDateNavigator, SIGNAL( goNextMonth() ), 517 connect( mDateNavigator, SIGNAL( goNextMonth() ),
518 mNavigator, SLOT( selectNextMonth() ) ); 518 mNavigator, SLOT( selectNextMonth() ) );
519 519
520 connect( mDateNavigator, SIGNAL( goPrevious() ), 520 connect( mDateNavigator, SIGNAL( goPrevious() ),
521 mNavigator, SLOT( selectPrevious() ) ); 521 mNavigator, SLOT( selectPrevious() ) );
522 connect( mDateNavigator, SIGNAL( goNext() ), 522 connect( mDateNavigator, SIGNAL( goNext() ),
523 mNavigator, SLOT( selectNext() ) ); 523 mNavigator, SLOT( selectNext() ) );
524 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), 524 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ),
525 mNavigator, SLOT( slotMonthSelect( int ) ) ); 525 mNavigator, SLOT( slotMonthSelect( int ) ) );
526 526
527 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 527 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
528 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 528 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
529#if 0 529#if 0
530 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), 530 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ),
531 SLOT( incidenceAdded( Incidence *) ) ); 531 SLOT( incidenceAdded( Incidence *) ) );
532#endif 532#endif
533 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); 533 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView()));
534 534
535 connect( this, SIGNAL( configChanged() ), 535 connect( this, SIGNAL( configChanged() ),
536 mDateNavigator, SLOT( updateConfig() ) ); 536 mDateNavigator, SLOT( updateConfig() ) );
537 537
538 connect( mTodoList, SIGNAL( newTodoSignal() ), 538 connect( mTodoList, SIGNAL( newTodoSignal() ),
539 SLOT( newTodo() ) ); 539 SLOT( newTodo() ) );
540 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), 540 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ),
541 SLOT( newSubTodo( Todo * ) ) ); 541 SLOT( newSubTodo( Todo * ) ) );
542 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), 542 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ),
543 SLOT( editTodo( Todo * ) ) ); 543 SLOT( editTodo( Todo * ) ) );
544 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), 544 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ),
545 SLOT( showTodo( Todo *) ) ); 545 SLOT( showTodo( Todo *) ) );
546 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), 546 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ),
547 SLOT( deleteTodo( Todo *) ) ); 547 SLOT( deleteTodo( Todo *) ) );
548 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); 548 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) );
549 connect( mTodoList, SIGNAL( purgeCompletedSignal() ), 549 connect( mTodoList, SIGNAL( purgeCompletedSignal() ),
550 SLOT( purgeCompleted() ) ); 550 SLOT( purgeCompleted() ) );
551 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), 551 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ),
552 SIGNAL( todoModified( Todo *, int ) ) ); 552 SIGNAL( todoModified( Todo *, int ) ) );
553 553
554 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), 554 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ),
555 this, SLOT ( cloneIncidence( Incidence * ) ) ); 555 this, SLOT ( cloneIncidence( Incidence * ) ) );
556 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), 556 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ),
557 this, SLOT (cancelIncidence( Incidence * ) ) ); 557 this, SLOT (cancelIncidence( Incidence * ) ) );
558 558
559 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), 559 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ),
560 this, SLOT ( moveIncidence( Incidence * ) ) ); 560 this, SLOT ( moveIncidence( Incidence * ) ) );
561 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), 561 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ),
562 this, SLOT ( beamIncidence( Incidence * ) ) ); 562 this, SLOT ( beamIncidence( Incidence * ) ) );
563 563
564 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), 564 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ),
565 this, SLOT ( todo_unsub( Todo * ) ) ); 565 this, SLOT ( todo_unsub( Todo * ) ) );
566 566
567 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), 567 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
568 this, SLOT ( todo_resub( Todo *,Todo * ) ) ); 568 this, SLOT ( todo_resub( Todo *,Todo * ) ) );
569 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, 569 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList,
570 SLOT( updateTodo( Todo *, int ) ) ); 570 SLOT( updateTodo( Todo *, int ) ) );
571 connect( this, SIGNAL( todoModified( Todo *, int )), this, 571 connect( this, SIGNAL( todoModified( Todo *, int )), this,
572 SLOT( changeTodoDisplay( Todo *, int ) ) ); 572 SLOT( changeTodoDisplay( Todo *, int ) ) );
573 573
574 574
575 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); 575 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) );
576 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); 576 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) );
577 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); 577 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) );
578 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); 578 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) );
579 579
580 580
581 581
582 582
583 583
584 connect(QApplication::clipboard(),SIGNAL(dataChanged()), 584 connect(QApplication::clipboard(),SIGNAL(dataChanged()),
585 SLOT(checkClipboard())); 585 SLOT(checkClipboard()));
586 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), 586 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ),
587 SLOT( processTodoListSelection( Incidence * ) ) ); 587 SLOT( processTodoListSelection( Incidence * ) ) );
588 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); 588 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool)));
589 589
590 // kdDebug() << "CalendarView::CalendarView() done" << endl; 590 // kdDebug() << "CalendarView::CalendarView() done" << endl;
591 591
592 mDateFrame = new QVBox(0,0,WType_Popup); 592 mDateFrame = new QVBox(0,0,WType_Popup);
593 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); 593 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
594 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); 594 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised );
595 mDateFrame->setLineWidth(3); 595 mDateFrame->setLineWidth(3);
596 mDateFrame->hide(); 596 mDateFrame->hide();
597 mDateFrame->setCaption( i18n( "Pick a date to display")); 597 mDateFrame->setCaption( i18n( "Pick a date to display"));
598 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); 598 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() );
599 599
600 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); 600 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
601 601
602 mEventEditor = mDialogManager->getEventEditor(); 602 mEventEditor = mDialogManager->getEventEditor();
603 mTodoEditor = mDialogManager->getTodoEditor(); 603 mTodoEditor = mDialogManager->getTodoEditor();
604 604
605 mFlagEditDescription = false; 605 mFlagEditDescription = false;
606 606
607 mSuspendTimer = new QTimer( this ); 607 mSuspendTimer = new QTimer( this );
608 mAlarmTimer = new QTimer( this ); 608 mAlarmTimer = new QTimer( this );
609 mRecheckAlarmTimer = new QTimer( this ); 609 mRecheckAlarmTimer = new QTimer( this );
610 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); 610 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) );
611 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); 611 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
612 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); 612 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
613 mAlarmDialog = new AlarmDialog( this ); 613 mAlarmDialog = new AlarmDialog( this );
614 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); 614 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
615 mAlarmDialog->setServerNotification( false ); 615 mAlarmDialog->setServerNotification( false );
616 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); 616 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
617 617
618 618
619#ifndef DESKTOP_VERSION 619#ifndef DESKTOP_VERSION
620//US listen for arriving address resultsets 620//US listen for arriving address resultsets
621 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), 621 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
622 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 622 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
623#endif 623#endif
624 mDateNavigator->setCalendar( mCalendar ); 624 mDateNavigator->setCalendar( mCalendar );
625} 625}
626 626
627 627
628CalendarView::~CalendarView() 628CalendarView::~CalendarView()
629{ 629{
630 // kdDebug() << "~CalendarView()" << endl; 630 // kdDebug() << "~CalendarView()" << endl;
631 //qDebug("CalendarView::~CalendarView() "); 631 //qDebug("CalendarView::~CalendarView() ");
632 delete mDialogManager; 632 delete mDialogManager;
633 delete mViewManager; 633 delete mViewManager;
634 delete mStorage; 634 delete mStorage;
635 delete mDateFrame ; 635 delete mDateFrame ;
636 delete beamDialog; 636 delete beamDialog;
637 delete mEventViewerDialog; 637 delete mEventViewerDialog;
638 //kdDebug() << "~CalendarView() done" << endl; 638 //kdDebug() << "~CalendarView() done" << endl;
639} 639}
640void CalendarView::checkAlarms() 640void CalendarView::checkAlarms()
641{ 641{
642 KConfig *config = KOGlobals::config(); 642 KConfig *config = KOGlobals::config();
643 config->setGroup( "AppRun" ); 643 config->setGroup( "AppRun" );
644 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 644 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
645 int secto = dt.secsTo( QDateTime::currentDateTime() ); 645 int secto = dt.secsTo( QDateTime::currentDateTime() );
646 int secs = config->readNumEntry( "LatestProgramStop" , secto) - 30; 646 int secs = config->readNumEntry( "LatestProgramStop" , secto) - 30;
647 qDebug("KO: Reading program stop %d ", secs);
647 //secs -= ( 3600 * 24*3 ); // debug only 648 //secs -= ( 3600 * 24*3 ); // debug only
648 QDateTime latest = dt.addSecs ( secs ); 649 QDateTime latest = dt.addSecs ( secs );
649 qDebug("KO: Last termination on %s ", latest.toString().latin1()); 650 qDebug("KO: Last termination on %s ", latest.toString().latin1());
651 qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
650 QPtrList<Incidence> el = mCalendar->rawIncidences(); 652 QPtrList<Incidence> el = mCalendar->rawIncidences();
651 QPtrList<Incidence> al; 653 QPtrList<Incidence> al;
652 Incidence* inL = el.first(); 654 Incidence* inL = el.first();
653 QDateTime cur = QDateTime::currentDateTime().addSecs(-59); 655 QDateTime cur = QDateTime::currentDateTime().addSecs(-59);
654 qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); 656 qDebug("KO: Checking alarm until %s ", cur.toString().latin1());
655 while ( inL ) { 657 while ( inL ) {
656 bool ok = false; 658 bool ok = false;
657 int offset = 0; 659 int offset = 0;
658 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; 660 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ;
659 if ( ok ) { 661 if ( ok ) {
660 //qDebug("OK %s",next.toString().latin1()); 662 //qDebug("OK %s",next.toString().latin1());
661 if ( next < cur ) { 663 if ( next < cur ) {
662 al.append( inL ); 664 al.append( inL );
663 //qDebug("found missed alarm: %s ", inL->summary().latin1() ); 665 //qDebug("found missed alarm: %s ", inL->summary().latin1() );
664 } 666 }
665 } 667 }
666 inL = el.next(); 668 inL = el.next();
667 } 669 }
668 if ( al.count() ) { 670 if ( al.count() ) {
669 QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); 671 QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop );
670 dia->setCaption( i18n("KO/Pi: Missing alarms!") ); 672 dia->setCaption( i18n("KO/Pi: Missing alarms!") );
671 QVBoxLayout* lay = new QVBoxLayout( dia ); 673 QVBoxLayout* lay = new QVBoxLayout( dia );
672 lay->setSpacing( 0 ); 674 lay->setSpacing( 0 );
673 lay->setMargin( 0 ); 675 lay->setMargin( 0 );
674 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); 676 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest );
675 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); 677 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) ));
676 lay->addWidget( matb ); 678 lay->addWidget( matb );
677 if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) { 679 if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) {
678 int wid = 210; 680 int wid = 210;
679 int x = QApplication::desktop()->width() - wid - 7; 681 int x = QApplication::desktop()->width() - wid - 7;
680 int y = QApplication::desktop()->height() - wid - 70; 682 int y = QApplication::desktop()->height() - wid - 70;
681 dia->setGeometry ( x,y,wid,wid); 683 dia->setGeometry ( x,y,wid,wid);
682 } else { 684 } else {
683 int si = 220; 685 int si = 220;
684 if ( QApplication::desktop()->width() > 470 ) 686 if ( QApplication::desktop()->width() > 470 )
685 si = 400; 687 si = 400;
686 dia->resize(si,si/2); 688 dia->resize(si,si/2);
687 } 689 }
688 dia->setBackgroundColor( QColor( 255, 255, 255 ) ); 690 dia->setBackgroundColor( QColor( 255, 255, 255 ) );
689 dia->show(); 691 dia->show();
690 692
691 } 693 }
692} 694}
693void CalendarView::showDay( QDate d ) 695void CalendarView::showDay( QDate d )
694{ 696{
695 dateNavigator()->blockSignals( true ); 697 dateNavigator()->blockSignals( true );
696 dateNavigator()->selectDate( d ); 698 dateNavigator()->selectDate( d );
697 dateNavigator()->blockSignals( false ); 699 dateNavigator()->blockSignals( false );
698 mViewManager->showDayView(); 700 mViewManager->showDayView();
699 //dateNavigator()->selectDate( d ); 701 //dateNavigator()->selectDate( d );
700} 702}
701void CalendarView::timerAlarm() 703void CalendarView::timerAlarm()
702{ 704{
703 //qDebug("CalendarView::timerAlarm() "); 705 //qDebug("CalendarView::timerAlarm() ");
704 computeAlarm(mAlarmNotification ); 706 computeAlarm(mAlarmNotification );
705} 707}
706 708
707void CalendarView::suspendAlarm() 709void CalendarView::suspendAlarm()
708{ 710{
709 //qDebug(" CalendarView::suspendAlarm() "); 711 //qDebug(" CalendarView::suspendAlarm() ");
710 computeAlarm(mSuspendAlarmNotification ); 712 computeAlarm(mSuspendAlarmNotification );
711 713
712} 714}
713 715
714void CalendarView::startAlarm( QString mess , QString filename) 716void CalendarView::startAlarm( QString mess , QString filename)
715{ 717{
716 718
717 topLevelWidget()->showNormal(); 719 topLevelWidget()->showNormal();
718 topLevelWidget()->setActiveWindow(); 720 topLevelWidget()->setActiveWindow();
719 topLevelWidget()->raise(); 721 topLevelWidget()->raise();
720 722
721 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); 723 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount );
722 QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) ); 724 QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) );
723 725
724} 726}
725 727
726void CalendarView::checkNextTimerAlarm() 728void CalendarView::checkNextTimerAlarm()
727{ 729{
728 mCalendar->checkAlarmForIncidence( 0, true ); 730 mCalendar->checkAlarmForIncidence( 0, true );
729} 731}
730 732
731void CalendarView::computeAlarm( QString msg ) 733void CalendarView::computeAlarm( QString msg )
732{ 734{
733 735
734 QString mess = msg; 736 QString mess = msg;
735 QString mAlarmMessage = mess.mid( 9 ); 737 QString mAlarmMessage = mess.mid( 9 );
736 QString filename = MainWindow::resourcePath(); 738 QString filename = MainWindow::resourcePath();
737 filename += "koalarm.wav"; 739 filename += "koalarm.wav";
738 QString tempfilename; 740 QString tempfilename;
739 if ( mess.left( 13 ) == "suspend_alarm") { 741 if ( mess.left( 13 ) == "suspend_alarm") {
740 bool error = false; 742 bool error = false;
741 int len = mess.mid( 13 ).find("+++"); 743 int len = mess.mid( 13 ).find("+++");
742 if ( len < 2 ) 744 if ( len < 2 )
743 error = true; 745 error = true;
744 else { 746 else {
745 tempfilename = mess.mid( 13, len ); 747 tempfilename = mess.mid( 13, len );
746 if ( !QFile::exists( tempfilename ) ) 748 if ( !QFile::exists( tempfilename ) )
747 error = true; 749 error = true;
748 } 750 }
749 if ( ! error ) { 751 if ( ! error ) {
750 filename = tempfilename; 752 filename = tempfilename;
751 } 753 }
752 mAlarmMessage = mess.mid( 13+len+3 ); 754 mAlarmMessage = mess.mid( 13+len+3 );
753 //qDebug("suspend file %s ",tempfilename.latin1() ); 755 //qDebug("suspend file %s ",tempfilename.latin1() );
754 startAlarm( mAlarmMessage, filename); 756 startAlarm( mAlarmMessage, filename);
755 return; 757 return;
756 } 758 }
757 if ( mess.left( 11 ) == "timer_alarm") { 759 if ( mess.left( 11 ) == "timer_alarm") {
758 //mTimerTime = 0; 760 //mTimerTime = 0;
759 startAlarm( mess.mid( 11 ), filename ); 761 startAlarm( mess.mid( 11 ), filename );
760 return; 762 return;
761 } 763 }
762 if ( mess.left( 10 ) == "proc_alarm") { 764 if ( mess.left( 10 ) == "proc_alarm") {
763 bool error = false; 765 bool error = false;
764 int len = mess.mid( 10 ).find("+++"); 766 int len = mess.mid( 10 ).find("+++");
765 if ( len < 2 ) 767 if ( len < 2 )
766 error = true; 768 error = true;
767 else { 769 else {
768 tempfilename = mess.mid( 10, len ); 770 tempfilename = mess.mid( 10, len );
769 if ( !QFile::exists( tempfilename ) ) 771 if ( !QFile::exists( tempfilename ) )
770 error = true; 772 error = true;
771 } 773 }
772 if ( error ) { 774 if ( error ) {
773 mAlarmMessage = "Procedure Alarm\nError - File not found\n"; 775 mAlarmMessage = "Procedure Alarm\nError - File not found\n";
774 mAlarmMessage += mess.mid( 10+len+3+9 ); 776 mAlarmMessage += mess.mid( 10+len+3+9 );
775 } else { 777 } else {
776 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); 778 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent");
777 //qDebug("-----system command %s ",tempfilename.latin1() ); 779 //qDebug("-----system command %s ",tempfilename.latin1() );
778#ifndef _WIN32_ 780#ifndef _WIN32_
779 if ( vfork () == 0 ) { 781 if ( vfork () == 0 ) {
780 execl ( tempfilename.latin1(), 0 ); 782 execl ( tempfilename.latin1(), 0 );
781 return; 783 return;
782 } 784 }
783#else 785#else
784 QProcess* p = new QProcess(); 786 QProcess* p = new QProcess();
785 p->addArgument( tempfilename.latin1() ); 787 p->addArgument( tempfilename.latin1() );
786 p->start(); 788 p->start();
787 return; 789 return;
788#endif 790#endif
789 791
790 return; 792 return;
791 } 793 }
792 794
793 //qDebug("+++++++system command %s ",tempfilename.latin1() ); 795 //qDebug("+++++++system command %s ",tempfilename.latin1() );
794 } 796 }
795 if ( mess.left( 11 ) == "audio_alarm") { 797 if ( mess.left( 11 ) == "audio_alarm") {
796 bool error = false; 798 bool error = false;
797 int len = mess.mid( 11 ).find("+++"); 799 int len = mess.mid( 11 ).find("+++");
798 if ( len < 2 ) 800 if ( len < 2 )
799 error = true; 801 error = true;
800 else { 802 else {
801 tempfilename = mess.mid( 11, len ); 803 tempfilename = mess.mid( 11, len );
802 if ( !QFile::exists( tempfilename ) ) 804 if ( !QFile::exists( tempfilename ) )
803 error = true; 805 error = true;
804 } 806 }
805 if ( ! error ) { 807 if ( ! error ) {
806 filename = tempfilename; 808 filename = tempfilename;
807 } 809 }
808 mAlarmMessage = mess.mid( 11+len+3+9 ); 810 mAlarmMessage = mess.mid( 11+len+3+9 );
809 //qDebug("audio file command %s ",tempfilename.latin1() ); 811 //qDebug("audio file command %s ",tempfilename.latin1() );
810 } 812 }
811 if ( mess.left( 9 ) == "cal_alarm") { 813 if ( mess.left( 9 ) == "cal_alarm") {
812 mAlarmMessage = mess.mid( 9 ) ; 814 mAlarmMessage = mess.mid( 9 ) ;
813 } 815 }
814 816
815 startAlarm( mAlarmMessage, filename ); 817 startAlarm( mAlarmMessage, filename );
816 818
817 819
818} 820}
819 821
820void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti ) 822void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti )
821{ 823{
822 //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 824 //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
823 825
824 mSuspendAlarmNotification = noti; 826 mSuspendAlarmNotification = noti;
825 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000; 827 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000;
826 //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000); 828 //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000);
827 mSuspendTimer->start( ms , true ); 829 mSuspendTimer->start( ms , true );
828 830
829} 831}
830 832
831void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti ) 833void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti )
832{ 834{
833 mNextAlarmDateTime = qdt; 835 mNextAlarmDateTime = qdt;
834 //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 836 //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
835 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 837 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
836#ifndef DESKTOP_VERSION 838#ifndef DESKTOP_VERSION
837 AlarmServer::addAlarm ( qdt,"koalarm", noti.utf8() ); 839 AlarmServer::addAlarm ( qdt,"koalarm", noti.utf8() );
838#endif 840#endif
839 return; 841 return;
840 } 842 }
841 int maxSec; 843 int maxSec;
@@ -1967,386 +1969,391 @@ bool CalendarView::saveCalendar( QString filename )
1967 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); 1969 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() );
1968 if ( mViewManager->currentView() ) 1970 if ( mViewManager->currentView() )
1969 mViewManager->currentView()->flushView(); 1971 mViewManager->currentView()->flushView();
1970 1972
1971 1973
1972 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2); 1974 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2);
1973 mStorage->setSaveFormat( new ICalFormat() ); 1975 mStorage->setSaveFormat( new ICalFormat() );
1974 mStorage->setFileName( filename ); 1976 mStorage->setFileName( filename );
1975 bool success; 1977 bool success;
1976 success = mStorage->save(); 1978 success = mStorage->save();
1977 if ( !success ) { 1979 if ( !success ) {
1978 return false; 1980 return false;
1979 } 1981 }
1980 if ( filename == MainWindow::defaultFileName() ) { 1982 if ( filename == MainWindow::defaultFileName() ) {
1981 setLoadedFileVersion( lfv ); 1983 setLoadedFileVersion( lfv );
1982 watchSavedFile(); 1984 watchSavedFile();
1983 } 1985 }
1984 return true; 1986 return true;
1985} 1987}
1986 1988
1987void CalendarView::closeCalendar() 1989void CalendarView::closeCalendar()
1988{ 1990{
1989 1991
1990 // child windows no longer valid 1992 // child windows no longer valid
1991 clearAllViews(); 1993 clearAllViews();
1992 emit closingDown(); 1994 emit closingDown();
1993 1995
1994 mCalendar->close(); 1996 mCalendar->close();
1995 setModified(false); 1997 setModified(false);
1996 updateView(); 1998 updateView();
1997} 1999}
1998 2000
1999void CalendarView::archiveCalendar() 2001void CalendarView::archiveCalendar()
2000{ 2002{
2001 mDialogManager->showArchiveDialog(); 2003 mDialogManager->showArchiveDialog();
2002} 2004}
2003 2005
2004 2006
2005void CalendarView::readSettings() 2007void CalendarView::readSettings()
2006{ 2008{
2007 2009
2008 2010
2009 // mViewManager->showAgendaView(); 2011 // mViewManager->showAgendaView();
2010 QString str; 2012 QString str;
2011 //qDebug("CalendarView::readSettings() "); 2013 //qDebug("CalendarView::readSettings() ");
2012 // read settings from the KConfig, supplying reasonable 2014 // read settings from the KConfig, supplying reasonable
2013 // defaults where none are to be found 2015 // defaults where none are to be found
2014 KConfig *config = KOGlobals::config(); 2016 KConfig *config = KOGlobals::config();
2015#ifndef KORG_NOSPLITTER 2017#ifndef KORG_NOSPLITTER
2016 config->setGroup("KOrganizer Geometry"); 2018 config->setGroup("KOrganizer Geometry");
2017 2019
2018 QValueList<int> sizes = config->readIntListEntry("Separator1"); 2020 QValueList<int> sizes = config->readIntListEntry("Separator1");
2019 if (sizes.count() != 2) { 2021 if (sizes.count() != 2) {
2020 sizes << mDateNavigator->minimumSizeHint().width(); 2022 sizes << mDateNavigator->minimumSizeHint().width();
2021 sizes << 300; 2023 sizes << 300;
2022 } 2024 }
2023 mPanner->setSizes(sizes); 2025 mPanner->setSizes(sizes);
2024 2026
2025 sizes = config->readIntListEntry("Separator2"); 2027 sizes = config->readIntListEntry("Separator2");
2026 if ( ( mResourceView && sizes.count() == 4 ) || 2028 if ( ( mResourceView && sizes.count() == 4 ) ||
2027 ( !mResourceView && sizes.count() == 3 ) ) { 2029 ( !mResourceView && sizes.count() == 3 ) ) {
2028 mLeftSplitter->setSizes(sizes); 2030 mLeftSplitter->setSizes(sizes);
2029 } 2031 }
2030#endif 2032#endif
2031 globalFlagBlockAgenda = 1; 2033 globalFlagBlockAgenda = 1;
2032 mViewManager->showAgendaView(); 2034 mViewManager->showAgendaView();
2033 //mViewManager->readSettings( config ); 2035 //mViewManager->readSettings( config );
2034 mTodoList->restoreLayout(config,QString("Todo Layout")); 2036 mTodoList->restoreLayout(config,QString("Todo Layout"));
2035 readFilterSettings(config); 2037 readFilterSettings(config);
2036 2038
2037#ifdef DESKTOP_VERSION 2039#ifdef DESKTOP_VERSION
2038 config->setGroup("WidgetLayout"); 2040 config->setGroup("WidgetLayout");
2039 QStringList list; 2041 QStringList list;
2040 list = config->readListEntry("MainLayout"); 2042 list = config->readListEntry("MainLayout");
2041 int x,y,w,h; 2043 int x,y,w,h;
2042 if ( ! list.isEmpty() ) { 2044 if ( ! list.isEmpty() ) {
2043 x = list[0].toInt(); 2045 x = list[0].toInt();
2044 y = list[1].toInt(); 2046 y = list[1].toInt();
2045 w = list[2].toInt(); 2047 w = list[2].toInt();
2046 h = list[3].toInt(); 2048 h = list[3].toInt();
2047 KApplication::testCoords( &x,&y,&w,&h ); 2049 KApplication::testCoords( &x,&y,&w,&h );
2048 topLevelWidget()->setGeometry(x,y,w,h); 2050 topLevelWidget()->setGeometry(x,y,w,h);
2049 2051
2050 } else { 2052 } else {
2051 topLevelWidget()->setGeometry( 40 ,40 , 640, 440); 2053 topLevelWidget()->setGeometry( 40 ,40 , 640, 440);
2052 } 2054 }
2053 list = config->readListEntry("EditEventLayout"); 2055 list = config->readListEntry("EditEventLayout");
2054 if ( ! list.isEmpty() ) { 2056 if ( ! list.isEmpty() ) {
2055 x = list[0].toInt(); 2057 x = list[0].toInt();
2056 y = list[1].toInt(); 2058 y = list[1].toInt();
2057 w = list[2].toInt(); 2059 w = list[2].toInt();
2058 h = list[3].toInt(); 2060 h = list[3].toInt();
2059 KApplication::testCoords( &x,&y,&w,&h ); 2061 KApplication::testCoords( &x,&y,&w,&h );
2060 mEventEditor->setGeometry(x,y,w,h); 2062 mEventEditor->setGeometry(x,y,w,h);
2061 2063
2062 } 2064 }
2063 list = config->readListEntry("EditTodoLayout"); 2065 list = config->readListEntry("EditTodoLayout");
2064 if ( ! list.isEmpty() ) { 2066 if ( ! list.isEmpty() ) {
2065 x = list[0].toInt(); 2067 x = list[0].toInt();
2066 y = list[1].toInt(); 2068 y = list[1].toInt();
2067 w = list[2].toInt(); 2069 w = list[2].toInt();
2068 h = list[3].toInt(); 2070 h = list[3].toInt();
2069 KApplication::testCoords( &x,&y,&w,&h ); 2071 KApplication::testCoords( &x,&y,&w,&h );
2070 mTodoEditor->setGeometry(x,y,w,h); 2072 mTodoEditor->setGeometry(x,y,w,h);
2071 2073
2072 } 2074 }
2073 list = config->readListEntry("ViewerLayout"); 2075 list = config->readListEntry("ViewerLayout");
2074 if ( ! list.isEmpty() ) { 2076 if ( ! list.isEmpty() ) {
2075 x = list[0].toInt(); 2077 x = list[0].toInt();
2076 y = list[1].toInt(); 2078 y = list[1].toInt();
2077 w = list[2].toInt(); 2079 w = list[2].toInt();
2078 h = list[3].toInt(); 2080 h = list[3].toInt();
2079 KApplication::testCoords( &x,&y,&w,&h ); 2081 KApplication::testCoords( &x,&y,&w,&h );
2080 getEventViewerDialog()->setGeometry(x,y,w,h); 2082 getEventViewerDialog()->setGeometry(x,y,w,h);
2081 } 2083 }
2082#endif 2084#endif
2083 config->setGroup( "Views" ); 2085 config->setGroup( "Views" );
2084 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 2086 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
2085 2087
2086 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); 2088 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame");
2087 2089
2088 int resetval = 0; 2090 int resetval = 0;
2089 int maxVal = 0; 2091 int maxVal = 0;
2090 if (sizes.count() != 3) { 2092 if (sizes.count() != 3) {
2091 if ( KOPrefs::instance()->mVerticalScreen ) { 2093 if ( KOPrefs::instance()->mVerticalScreen ) {
2092 resetval = mDateNavigator->sizeHint().width()+2; 2094 resetval = mDateNavigator->sizeHint().width()+2;
2093 } else { 2095 } else {
2094 resetval = mDateNavigator->sizeHint().height()+2; 2096 resetval = mDateNavigator->sizeHint().height()+2;
2095 } 2097 }
2096 } 2098 }
2097 if ( resetval ) { 2099 if ( resetval ) {
2098 sizes.clear(); 2100 sizes.clear();
2099 if ( KOPrefs::instance()->mVerticalScreen ) { 2101 if ( KOPrefs::instance()->mVerticalScreen ) {
2100 maxVal = QApplication::desktop()->width() -10; 2102 maxVal = QApplication::desktop()->width() -10;
2101 } else { 2103 } else {
2102 maxVal = QApplication::desktop()->height()-10; 2104 maxVal = QApplication::desktop()->height()-10;
2103 } 2105 }
2104 sizes << resetval; 2106 sizes << resetval;
2105 if ( maxVal < resetval + resetval) 2107 if ( maxVal < resetval + resetval)
2106 resetval = maxVal - resetval; 2108 resetval = maxVal - resetval;
2107 sizes << resetval; 2109 sizes << resetval;
2108 sizes << 100; 2110 sizes << 100;
2109 } 2111 }
2110 mLeftFrame->setSizes(sizes); 2112 mLeftFrame->setSizes(sizes);
2111 sizes = config->readIntListEntry("Main Splitter Frame"); 2113 sizes = config->readIntListEntry("Main Splitter Frame");
2112 resetval = 0; 2114 resetval = 0;
2113 maxVal = 0; 2115 maxVal = 0;
2114 if (sizes.count() != 2) { 2116 if (sizes.count() != 2) {
2115 if ( !KOPrefs::instance()->mVerticalScreen ) { 2117 if ( !KOPrefs::instance()->mVerticalScreen ) {
2116 resetval = mDateNavigator->sizeHint().width()+2; 2118 resetval = mDateNavigator->sizeHint().width()+2;
2117 } else { 2119 } else {
2118 resetval = mDateNavigator->sizeHint().height()+2; 2120 resetval = mDateNavigator->sizeHint().height()+2;
2119 } 2121 }
2120 } 2122 }
2121 if ( resetval ) { 2123 if ( resetval ) {
2122 sizes.clear(); 2124 sizes.clear();
2123 if ( !KOPrefs::instance()->mVerticalScreen ) { 2125 if ( !KOPrefs::instance()->mVerticalScreen ) {
2124 maxVal = QApplication::desktop()->width() -10; 2126 maxVal = QApplication::desktop()->width() -10;
2125 } else { 2127 } else {
2126 maxVal = QApplication::desktop()->height()-10; 2128 maxVal = QApplication::desktop()->height()-10;
2127 } 2129 }
2128 sizes << resetval; 2130 sizes << resetval;
2129 if ( maxVal < resetval + resetval) 2131 if ( maxVal < resetval + resetval)
2130 resetval = maxVal - resetval; 2132 resetval = maxVal - resetval;
2131 sizes << resetval; 2133 sizes << resetval;
2132 } 2134 }
2133 mMainFrame->setSizes(sizes); 2135 mMainFrame->setSizes(sizes);
2134 if ( dateCount == 5 ) mNavigator->selectWorkWeek(); 2136 if ( dateCount == 5 ) mNavigator->selectWorkWeek();
2135 else if ( dateCount == 7 ) mNavigator->selectWeek(); 2137 else if ( dateCount == 7 ) mNavigator->selectWeek();
2136 else mNavigator->selectDates( dateCount ); 2138 else mNavigator->selectDates( dateCount );
2137 // mViewManager->readSettings( config ); 2139 // mViewManager->readSettings( config );
2138 updateConfig(); 2140 updateConfig();
2139 globalFlagBlockAgenda = 2; 2141 globalFlagBlockAgenda = 2;
2140 mViewManager->readSettings( config ); 2142 mViewManager->readSettings( config );
2141 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) ); 2143 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) );
2142} 2144}
2143 2145
2144 2146
2145void CalendarView::writeSettings() 2147void CalendarView::writeSettings()
2146{ 2148{
2147 // kdDebug() << "CalendarView::writeSettings" << endl; 2149 // kdDebug() << "CalendarView::writeSettings" << endl;
2148 2150
2149 KConfig *config = KOGlobals::config(); 2151 KConfig *config = KOGlobals::config();
2150 2152
2151 mViewManager->writeSettings( config ); 2153 mViewManager->writeSettings( config );
2152 mTodoList->saveLayout(config,QString("Todo Layout")); 2154 mTodoList->saveLayout(config,QString("Todo Layout"));
2153 mDialogManager->writeSettings( config ); 2155 mDialogManager->writeSettings( config );
2154 //KOPrefs::instance()->usrWriteConfig(); 2156 //KOPrefs::instance()->usrWriteConfig();
2155 KOPrefs::instance()->writeConfig(); 2157 KOPrefs::instance()->writeConfig();
2156 2158
2157 writeFilterSettings(config); 2159 writeFilterSettings(config);
2158 config->setGroup( "AppRun" ); 2160 config->setGroup( "AppRun" );
2159 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 2161 QDateTime dt ( QDate (2005,3,1), QTime( 0,0,0 ) );
2160 config->writeEntry( "LatestProgramStop", dt.secsTo( QDateTime::currentDateTime() ) ); 2162 int secs = dt.secsTo( QDateTime::currentDateTime() );
2163 config->writeEntry( "LatestProgramStop", secs );
2164 qDebug("KO: Writing stop time: %d ", secs);
2165 qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
2166 QDateTime latest = dt.addSecs ( secs );
2167 qDebug("KO: Test termination on %s ", latest.toString().latin1());
2161 config->setGroup( "Views" ); 2168 config->setGroup( "Views" );
2162 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 2169 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
2163 2170
2164 QValueList<int> listINT = mLeftFrame->sizes(); 2171 QValueList<int> listINT = mLeftFrame->sizes();
2165 config->writeEntry("Left Splitter Frame",listINT); 2172 config->writeEntry("Left Splitter Frame",listINT);
2166 QValueList<int> listINT2 = mMainFrame->sizes(); 2173 QValueList<int> listINT2 = mMainFrame->sizes();
2167 config->writeEntry("Main Splitter Frame",listINT2); 2174 config->writeEntry("Main Splitter Frame",listINT2);
2168#ifdef DESKTOP_VERSION 2175#ifdef DESKTOP_VERSION
2169 config->setGroup("WidgetLayout"); 2176 config->setGroup("WidgetLayout");
2170 QStringList list ;//= config->readListEntry("MainLayout"); 2177 QStringList list ;//= config->readListEntry("MainLayout");
2171 int x,y,w,h; 2178 int x,y,w,h;
2172 QWidget* wid; 2179 QWidget* wid;
2173 wid = topLevelWidget(); 2180 wid = topLevelWidget();
2174 x = wid->geometry().x(); 2181 x = wid->geometry().x();
2175 y = wid->geometry().y(); 2182 y = wid->geometry().y();
2176 w = wid->width(); 2183 w = wid->width();
2177 h = wid->height(); 2184 h = wid->height();
2178 list.clear(); 2185 list.clear();
2179 list << QString::number( x ); 2186 list << QString::number( x );
2180 list << QString::number( y ); 2187 list << QString::number( y );
2181 list << QString::number( w ); 2188 list << QString::number( w );
2182 list << QString::number( h ); 2189 list << QString::number( h );
2183 config->writeEntry("MainLayout",list ); 2190 config->writeEntry("MainLayout",list );
2184 2191
2185 wid = mEventEditor; 2192 wid = mEventEditor;
2186 x = wid->geometry().x(); 2193 x = wid->geometry().x();
2187 y = wid->geometry().y(); 2194 y = wid->geometry().y();
2188 w = wid->width(); 2195 w = wid->width();
2189 h = wid->height(); 2196 h = wid->height();
2190 list.clear(); 2197 list.clear();
2191 list << QString::number( x ); 2198 list << QString::number( x );
2192 list << QString::number( y ); 2199 list << QString::number( y );
2193 list << QString::number( w ); 2200 list << QString::number( w );
2194 list << QString::number( h ); 2201 list << QString::number( h );
2195 config->writeEntry("EditEventLayout",list ); 2202 config->writeEntry("EditEventLayout",list );
2196 2203
2197 wid = mTodoEditor; 2204 wid = mTodoEditor;
2198 x = wid->geometry().x(); 2205 x = wid->geometry().x();
2199 y = wid->geometry().y(); 2206 y = wid->geometry().y();
2200 w = wid->width(); 2207 w = wid->width();
2201 h = wid->height(); 2208 h = wid->height();
2202 list.clear(); 2209 list.clear();
2203 list << QString::number( x ); 2210 list << QString::number( x );
2204 list << QString::number( y ); 2211 list << QString::number( y );
2205 list << QString::number( w ); 2212 list << QString::number( w );
2206 list << QString::number( h ); 2213 list << QString::number( h );
2207 config->writeEntry("EditTodoLayout",list ); 2214 config->writeEntry("EditTodoLayout",list );
2208 wid = getEventViewerDialog(); 2215 wid = getEventViewerDialog();
2209 x = wid->geometry().x(); 2216 x = wid->geometry().x();
2210 y = wid->geometry().y(); 2217 y = wid->geometry().y();
2211 w = wid->width(); 2218 w = wid->width();
2212 h = wid->height(); 2219 h = wid->height();
2213 list.clear(); 2220 list.clear();
2214 list << QString::number( x ); 2221 list << QString::number( x );
2215 list << QString::number( y ); 2222 list << QString::number( y );
2216 list << QString::number( w ); 2223 list << QString::number( w );
2217 list << QString::number( h ); 2224 list << QString::number( h );
2218 config->writeEntry("ViewerLayout",list ); 2225 config->writeEntry("ViewerLayout",list );
2219 wid = mDialogManager->getSearchDialog(); 2226 wid = mDialogManager->getSearchDialog();
2220 if ( wid ) { 2227 if ( wid ) {
2221 x = wid->geometry().x(); 2228 x = wid->geometry().x();
2222 y = wid->geometry().y(); 2229 y = wid->geometry().y();
2223 w = wid->width(); 2230 w = wid->width();
2224 h = wid->height(); 2231 h = wid->height();
2225 list.clear(); 2232 list.clear();
2226 list << QString::number( x ); 2233 list << QString::number( x );
2227 list << QString::number( y ); 2234 list << QString::number( y );
2228 list << QString::number( w ); 2235 list << QString::number( w );
2229 list << QString::number( h ); 2236 list << QString::number( h );
2230 config->writeEntry("SearchLayout",list ); 2237 config->writeEntry("SearchLayout",list );
2231 } 2238 }
2232#endif 2239#endif
2233 2240
2234 2241
2235 config->sync(); 2242 config->sync();
2236} 2243}
2237 2244
2238void CalendarView::readFilterSettings(KConfig *config) 2245void CalendarView::readFilterSettings(KConfig *config)
2239{ 2246{
2240 // kdDebug() << "CalendarView::readFilterSettings()" << endl; 2247 // kdDebug() << "CalendarView::readFilterSettings()" << endl;
2241 2248
2242 mFilters.clear(); 2249 mFilters.clear();
2243 2250
2244 config->setGroup("General"); 2251 config->setGroup("General");
2245 QStringList filterList = config->readListEntry("CalendarFilters"); 2252 QStringList filterList = config->readListEntry("CalendarFilters");
2246 2253
2247 QStringList::ConstIterator it = filterList.begin(); 2254 QStringList::ConstIterator it = filterList.begin();
2248 QStringList::ConstIterator end = filterList.end(); 2255 QStringList::ConstIterator end = filterList.end();
2249 while(it != end) { 2256 while(it != end) {
2250 // kdDebug() << " filter: " << (*it) << endl; 2257 // kdDebug() << " filter: " << (*it) << endl;
2251 2258
2252 CalFilter *filter; 2259 CalFilter *filter;
2253 filter = new CalFilter(*it); 2260 filter = new CalFilter(*it);
2254 config->setGroup("Filter_" + (*it).utf8()); 2261 config->setGroup("Filter_" + (*it).utf8());
2255 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); 2262 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) );
2256 filter->setCriteria(config->readNumEntry("Criteria",0)); 2263 filter->setCriteria(config->readNumEntry("Criteria",0));
2257 filter->setCategoryList(config->readListEntry("CategoryList")); 2264 filter->setCategoryList(config->readListEntry("CategoryList"));
2258 mFilters.append(filter); 2265 mFilters.append(filter);
2259 2266
2260 ++it; 2267 ++it;
2261 } 2268 }
2262 2269
2263 if (mFilters.count() == 0) { 2270 if (mFilters.count() == 0) {
2264 CalFilter *filter = new CalFilter(i18n("Default")); 2271 CalFilter *filter = new CalFilter(i18n("Default"));
2265 mFilters.append(filter); 2272 mFilters.append(filter);
2266 } 2273 }
2267 mFilterView->updateFilters(); 2274 mFilterView->updateFilters();
2268 config->setGroup("FilterView"); 2275 config->setGroup("FilterView");
2269 2276
2270 mFilterView->blockSignals(true); 2277 mFilterView->blockSignals(true);
2271 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); 2278 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled"));
2272 mFilterView->setSelectedFilter(config->readEntry("Current Filter")); 2279 mFilterView->setSelectedFilter(config->readEntry("Current Filter"));
2273 mFilterView->blockSignals(false); 2280 mFilterView->blockSignals(false);
2274 // We do it manually to avoid it being done twice by the above calls 2281 // We do it manually to avoid it being done twice by the above calls
2275 updateFilter(); 2282 updateFilter();
2276} 2283}
2277 2284
2278void CalendarView::writeFilterSettings(KConfig *config) 2285void CalendarView::writeFilterSettings(KConfig *config)
2279{ 2286{
2280 // kdDebug() << "CalendarView::writeFilterSettings()" << endl; 2287 // kdDebug() << "CalendarView::writeFilterSettings()" << endl;
2281 2288
2282 QStringList filterList; 2289 QStringList filterList;
2283 2290
2284 CalFilter *filter = mFilters.first(); 2291 CalFilter *filter = mFilters.first();
2285 while(filter) { 2292 while(filter) {
2286 // kdDebug() << " fn: " << filter->name() << endl; 2293 // kdDebug() << " fn: " << filter->name() << endl;
2287 filterList << filter->name(); 2294 filterList << filter->name();
2288 config->setGroup("Filter_" + filter->name().utf8()); 2295 config->setGroup("Filter_" + filter->name().utf8());
2289 config->writeEntry("Criteria",filter->criteria()); 2296 config->writeEntry("Criteria",filter->criteria());
2290 config->writeEntry("CategoryList",filter->categoryList()); 2297 config->writeEntry("CategoryList",filter->categoryList());
2291 filter = mFilters.next(); 2298 filter = mFilters.next();
2292 } 2299 }
2293 config->setGroup("General"); 2300 config->setGroup("General");
2294 config->writeEntry("CalendarFilters",filterList); 2301 config->writeEntry("CalendarFilters",filterList);
2295 2302
2296 config->setGroup("FilterView"); 2303 config->setGroup("FilterView");
2297 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); 2304 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled());
2298 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); 2305 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name());
2299} 2306}
2300 2307
2301 2308
2302void CalendarView::goToday() 2309void CalendarView::goToday()
2303{ 2310{
2304 if ( mViewManager->currentView()->isMonthView() ) 2311 if ( mViewManager->currentView()->isMonthView() )
2305 mNavigator->selectTodayMonth(); 2312 mNavigator->selectTodayMonth();
2306 else 2313 else
2307 mNavigator->selectToday(); 2314 mNavigator->selectToday();
2308} 2315}
2309 2316
2310void CalendarView::goNext() 2317void CalendarView::goNext()
2311{ 2318{
2312 mNavigator->selectNext(); 2319 mNavigator->selectNext();
2313} 2320}
2314 2321
2315void CalendarView::goPrevious() 2322void CalendarView::goPrevious()
2316{ 2323{
2317 mNavigator->selectPrevious(); 2324 mNavigator->selectPrevious();
2318} 2325}
2319void CalendarView::goNextMonth() 2326void CalendarView::goNextMonth()
2320{ 2327{
2321 mNavigator->selectNextMonth(); 2328 mNavigator->selectNextMonth();
2322} 2329}
2323 2330
2324void CalendarView::goPreviousMonth() 2331void CalendarView::goPreviousMonth()
2325{ 2332{
2326 mNavigator->selectPreviousMonth(); 2333 mNavigator->selectPreviousMonth();
2327} 2334}
2328void CalendarView::writeLocale() 2335void CalendarView::writeLocale()
2329{ 2336{
2330 //KPimGlobalPrefs::instance()->setGlobalConfig(); 2337 //KPimGlobalPrefs::instance()->setGlobalConfig();
2331#if 0 2338#if 0
2332 KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime ); 2339 KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime );
2333 KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday ); 2340 KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday );
2334 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate ); 2341 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate );
2335 KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage ); 2342 KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage );
2336 QString dummy = KOPrefs::instance()->mUserDateFormatLong; 2343 QString dummy = KOPrefs::instance()->mUserDateFormatLong;
2337 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); 2344 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
2338 dummy = KOPrefs::instance()->mUserDateFormatShort; 2345 dummy = KOPrefs::instance()->mUserDateFormatShort;
2339 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); 2346 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
2340 KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving, 2347 KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving,
2341 KOPrefs::instance()->mDaylightsavingStart, 2348 KOPrefs::instance()->mDaylightsavingStart,
2342 KOPrefs::instance()->mDaylightsavingEnd ); 2349 KOPrefs::instance()->mDaylightsavingEnd );
2343 KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId ); 2350 KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId );
2344#endif 2351#endif
2345} 2352}
2346void CalendarView::updateConfig() 2353void CalendarView::updateConfig()
2347{ 2354{
2348 writeLocale(); 2355 writeLocale();
2349 if ( KOPrefs::instance()->mUseAppColors ) 2356 if ( KOPrefs::instance()->mUseAppColors )
2350 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 2357 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
2351 emit configChanged(); 2358 emit configChanged();
2352 mTodoList->updateConfig(); 2359 mTodoList->updateConfig();
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index d3797ae..a0f9d2e 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -1,375 +1,377 @@
1/* 1/*
2 This file is part of KdePim/Pi. 2 This file is part of KdePim/Pi.
3 Copyright (c) 2004 Ulf Schenk 3 Copyright (c) 2004 Ulf Schenk
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/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <qlayout.h> 31#include <qlayout.h>
32#include <qtabwidget.h> 32#include <qtabwidget.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qgroupbox.h> 34#include <qgroupbox.h>
35#include <qlabel.h> 35#include <qlabel.h>
36#include <qlineedit.h> 36#include <qlineedit.h>
37#include <qbuttongroup.h> 37#include <qbuttongroup.h>
38#include <qcheckbox.h> 38#include <qcheckbox.h>
39#include <qfile.h> 39#include <qfile.h>
40#include <qvbox.h> 40#include <qvbox.h>
41#include <qdir.h> 41#include <qdir.h>
42#include <qregexp.h> 42#include <qregexp.h>
43#include <qspinbox.h> 43#include <qspinbox.h>
44 44
45#include <kdialog.h> 45#include <kdialog.h>
46#include <kprefsdialog.h> 46#include <kprefsdialog.h>
47#include <klocale.h> 47#include <klocale.h>
48#include <kglobalsettings.h> 48#include <kglobalsettings.h>
49#include <kdateedit.h> 49#include <kdateedit.h>
50#include <kglobal.h> 50#include <kglobal.h>
51#include <stdlib.h> 51#include <stdlib.h>
52 52
53/*US 53/*US
54#include <qcheckbox.h> 54#include <qcheckbox.h>
55#include <qframe.h> 55#include <qframe.h>
56#include <qpushbutton.h> 56#include <qpushbutton.h>
57#include <qcombobox.h> 57#include <qcombobox.h>
58#include <qlineedit.h> 58#include <qlineedit.h>
59#include <qlabel.h> 59#include <qlabel.h>
60#include <qfile.h> 60#include <qfile.h>
61 61
62#include <kconfig.h> 62#include <kconfig.h>
63#include <kdebug.h> 63#include <kdebug.h>
64#include <kdialog.h> 64#include <kdialog.h>
65#include <klistview.h> 65#include <klistview.h>
66#include <klocale.h> 66#include <klocale.h>
67#include <kglobal.h> 67#include <kglobal.h>
68#include <kmessagebox.h> 68#include <kmessagebox.h>
69#include <kstandarddirs.h> 69#include <kstandarddirs.h>
70 70
71#ifndef KAB_EMBEDDED 71#ifndef KAB_EMBEDDED
72#include <ktrader.h> 72#include <ktrader.h>
73#else // KAB_EMBEDDED 73#else // KAB_EMBEDDED
74#include <mergewidget.h> 74#include <mergewidget.h>
75#include <distributionlistwidget.h> 75#include <distributionlistwidget.h>
76#endif // KAB_EMBEDDED 76#endif // KAB_EMBEDDED
77 77
78#include "addresseewidget.h" 78#include "addresseewidget.h"
79#include "extensionconfigdialog.h" 79#include "extensionconfigdialog.h"
80#include "extensionwidget.h" 80#include "extensionwidget.h"
81*/ 81*/
82 82
83#include "qapplication.h" 83#include "qapplication.h"
84 84
85#include "kpimglobalprefs.h" 85#include "kpimglobalprefs.h"
86 86
87#include "kdepimconfigwidget.h" 87#include "kdepimconfigwidget.h"
88#include <kprefs.h> 88#include <kprefs.h>
89#include <kmessagebox.h> 89#include <kmessagebox.h>
90 90
91 91
92KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) 92KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name )
93 : KPrefsWidget(prefs, parent, name ) 93 : KPrefsWidget(prefs, parent, name )
94{ 94{
95 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); 95 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email"));
96 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); 96 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone"));
97 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); 97 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS"));
98 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); 98 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax"));
99 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); 99 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager"));
100 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); 100 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP"));
101 101
102 102
103 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 103 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
104 KDialog::spacingHint() ); 104 KDialog::spacingHint() );
105 105
106 tabWidget = new QTabWidget( this ); 106 tabWidget = new QTabWidget( this );
107 topLayout->addWidget( tabWidget ); 107 topLayout->addWidget( tabWidget );
108 108
109 109
110 setupLocaleTab(); 110 setupLocaleTab();
111 setupLocaleDateTab(); 111 setupLocaleDateTab();
112 setupTimeZoneTab(); 112 setupTimeZoneTab();
113 setupExternalAppTab(); 113 setupExternalAppTab();
114 setupStoreTab(); 114 setupStoreTab();
115 setupBackupTab(); 115 setupBackupTab();
116} 116}
117void KDEPIMConfigWidget::showTimeZoneTab() 117void KDEPIMConfigWidget::showTimeZoneTab()
118{ 118{
119 tabWidget->setCurrentPage ( 3 ) ; 119 tabWidget->setCurrentPage ( 3 ) ;
120} 120}
121void KDEPIMConfigWidget::setupBackupTab() 121void KDEPIMConfigWidget::setupBackupTab()
122{ 122{
123 QVBox *colorPage = new QVBox( this ); 123 QVBox *colorPage = new QVBox( this );
124 tabWidget->addTab( colorPage, i18n( "Backup" ) ); 124 tabWidget->addTab( colorPage, i18n( "Backup" ) );
125 QWidget* topFrame = new QWidget( colorPage ); 125 QWidget* topFrame = new QWidget( colorPage );
126 QVBoxLayout *topLayout = new QVBoxLayout(topFrame); 126 QVBoxLayout *topLayout = new QVBoxLayout(topFrame);
127 KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"), 127 KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"),
128 &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame); 128 &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame);
129 topLayout->addWidget((QWidget*)sb->checkBox()); 129 topLayout->addWidget((QWidget*)sb->checkBox());
130 QWidget* bupFrame = new QWidget( topFrame ); 130 QWidget* bupFrame = new QWidget( topFrame );
131 topLayout->addWidget((bupFrame)); 131 topLayout->addWidget((bupFrame));
132 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); 132 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) );
133 QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); 133 QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame);
134 sb = addWidBool(i18n("Use standard backup dir"), 134 sb = addWidBool(i18n("Use standard backup dir"),
135 &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame); 135 &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame);
136 bupLayout->addWidget((QWidget*)sb->checkBox()); 136 bupLayout->addWidget((QWidget*)sb->checkBox());
137 mBackupUrl = new KURLRequester( bupFrame ); 137 mBackupUrl = new KURLRequester( bupFrame );
138 mBackupUrl->setPathIsDir();
138 mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); 139 mBackupUrl->setURL( KGlobalSettings::backupDataDir() );
139 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) ); 140 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) );
140 bupLayout->addWidget( mBackupUrl ); 141 bupLayout->addWidget( mBackupUrl );
141 142
142 mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir ); 143 mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir );
143 bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled ); 144 bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled );
144 QHBox *dummy = new QHBox(bupFrame); 145 QHBox *dummy = new QHBox(bupFrame);
145 new QLabel(i18n("Number of Backups:"),dummy); 146 new QLabel(i18n("Number of Backups:"),dummy);
146 mBackupNumbersSpin = new QSpinBox(1,21,1,dummy); 147 mBackupNumbersSpin = new QSpinBox(1,21,1,dummy);
147 new QLabel(i18n(" "),dummy); 148 new QLabel(i18n(" "),dummy);
148 bupLayout->addWidget( dummy ); 149 bupLayout->addWidget( dummy );
149 150
150 dummy = new QHBox(bupFrame); 151 dummy = new QHBox(bupFrame);
151 new QLabel(i18n("Make backup every "),dummy); 152 new QLabel(i18n("Make backup every "),dummy);
152 mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); 153 mBackupDayCountSpin = new QSpinBox(1,28,1,dummy);
153 new QLabel(i18n(" days"),dummy); 154 new QLabel(i18n(" days"),dummy);
154 new QLabel(i18n(" "),dummy); 155 new QLabel(i18n(" "),dummy);
155 bupLayout->addWidget( dummy ); 156 bupLayout->addWidget( dummy );
156 QString localKdeDir; 157 QString localKdeDir;
157 localKdeDir = readEnvPath("LOCALMICROKDEHOME"); 158 localKdeDir = readEnvPath("LOCALMICROKDEHOME");
158 if ( ! localKdeDir.isEmpty() ) { 159 if ( ! localKdeDir.isEmpty() ) {
159 sb->checkBox()->setEnabled( false ); 160 sb->checkBox()->setEnabled( false );
160 sb->checkBox()->setChecked( true ); 161 sb->checkBox()->setChecked( true );
161 mBackupUrl->setEnabled( false ); 162 mBackupUrl->setEnabled( false );
162 KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true; 163 KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true;
163 } 164 }
164 165
165} 166}
166void KDEPIMConfigWidget::setupStoreTab() 167void KDEPIMConfigWidget::setupStoreTab()
167{ 168{
168 QVBox *colorPage = new QVBox( this ); 169 QVBox *colorPage = new QVBox( this );
169 tabWidget->addTab( colorPage, i18n( "Colors" ) ); 170 tabWidget->addTab( colorPage, i18n( "Colors" ) );
170 QWidget* cw = new QWidget( colorPage ); 171 QWidget* cw = new QWidget( colorPage );
171 KPrefsWidColor *holidayColor = 172 KPrefsWidColor *holidayColor =
172 addWidColor(i18n("Alternating background of list views"), 173 addWidColor(i18n("Alternating background of list views"),
173 &(KPimGlobalPrefs::instance()->mAlternateColor),cw); 174 &(KPimGlobalPrefs::instance()->mAlternateColor),cw);
174 QHBoxLayout *topLayout = new QHBoxLayout(cw); 175 QHBoxLayout *topLayout = new QHBoxLayout(cw);
175 topLayout->addWidget(holidayColor->label()); 176 topLayout->addWidget(holidayColor->label());
176 topLayout->addWidget( (QWidget* )holidayColor->button()); 177 topLayout->addWidget( (QWidget* )holidayColor->button());
177 178
178 179
179 QVBox *storePage = new QVBox( this ); 180 QVBox *storePage = new QVBox( this );
180 if ( QApplication::desktop()->height() > 240 ) 181 if ( QApplication::desktop()->height() > 240 )
181 new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); 182 new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage );
182 new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); 183 new QLabel( i18n("<b>New data storage dir:</b>"), storePage );
183 mStoreUrl = new KURLRequester( storePage ); 184 mStoreUrl = new KURLRequester( storePage );
185 mStoreUrl->setPathIsDir();
184 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); 186 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() );
185#ifdef DESKTOP_VERSION 187#ifdef DESKTOP_VERSION
186 QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; 188 QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ;
187 QFileInfo fi ( confFile ); 189 QFileInfo fi ( confFile );
188 if ( fi.exists() ) { 190 if ( fi.exists() ) {
189 KConfig cfg ( confFile ); 191 KConfig cfg ( confFile );
190 cfg.setGroup("Global"); 192 cfg.setGroup("Global");
191 QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" ); 193 QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" );
192 if ( localKdeDir != "x_x_x" ) { 194 if ( localKdeDir != "x_x_x" ) {
193 mStoreUrl->setURL( localKdeDir ); 195 mStoreUrl->setURL( localKdeDir );
194 qDebug("Reading config from %s ", confFile.latin1()); 196 qDebug("Reading config from %s ", confFile.latin1());
195 } 197 }
196 } 198 }
197 199
198#endif 200#endif
199 new QLabel( i18n("New dirs are created automatically"), storePage ); 201 new QLabel( i18n("New dirs are created automatically"), storePage );
200 QHBox *bb = new QHBox( storePage ); 202 QHBox *bb = new QHBox( storePage );
201 QPushButton * pb; 203 QPushButton * pb;
202 if ( QApplication::desktop()->width() < 640 ) 204 if ( QApplication::desktop()->width() < 640 )
203 pb = new QPushButton ( i18n("Save"), bb ); 205 pb = new QPushButton ( i18n("Save"), bb );
204 else 206 else
205 pb = new QPushButton ( i18n("Save settings"), bb ); 207 pb = new QPushButton ( i18n("Save settings"), bb );
206 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); 208 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) );
207 pb = new QPushButton ( i18n("Save standard"), bb ); 209 pb = new QPushButton ( i18n("Save standard"), bb );
208 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); 210 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) );
209#ifdef DESKTOP_VERSION 211#ifdef DESKTOP_VERSION
210 pb = new QPushButton ( i18n("Save using LOCAL storage"), bb ); 212 pb = new QPushButton ( i18n("Save using LOCAL storage"), bb );
211 connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) ); 213 connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) );
212#endif 214#endif
213 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); 215 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage );
214 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); 216 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage );
215 tabWidget->addTab( storePage, i18n( "Data storage path" ) ); 217 tabWidget->addTab( storePage, i18n( "Data storage path" ) );
216} 218}
217void KDEPIMConfigWidget::setLocalStore() 219void KDEPIMConfigWidget::setLocalStore()
218{ 220{
219 mStoreUrl->setURL( "LOCAL:kdepimpi" ); 221 mStoreUrl->setURL( "LOCAL:kdepimpi" );
220 saveStoreSettings(); 222 saveStoreSettings();
221 QString message = i18n("'LOCAL' mode makes is possible to run\nKA/Pi and KO/Pi from a USB memory stick.\nIn LOCAL mode the data is stored\nin a path relative to the executable.\nNote, that in LOCAL mode only addressbook\nresource files in\n <path of the executable>/<dirname after LOCAL:>/apps/kabc/*.vcf\n are supported.\nIf you use the standard addressbook settings\nyou do not have to reconfigure any path,\njust restart the application and import\nyour addressbook and calendar data."); 223 QString message = i18n("'LOCAL' mode makes is possible to run\nKA/Pi and KO/Pi from a USB memory stick.\nIn LOCAL mode the data is stored\nin a path relative to the executable.\nNote, that in LOCAL mode only addressbook\nresource files in\n <path of the executable>/<dirname after LOCAL:>/apps/kabc/*.vcf\n are supported.\nIf you use the standard addressbook settings\nyou do not have to reconfigure any path,\njust restart the application and import\nyour addressbook and calendar data.");
222 KMessageBox::information( this, message); 224 KMessageBox::information( this, message);
223} 225}
224void KDEPIMConfigWidget::setStandardStore() 226void KDEPIMConfigWidget::setStandardStore()
225{ 227{
226 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 228 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
227 saveStoreSettings(); 229 saveStoreSettings();
228} 230}
229void KDEPIMConfigWidget::saveStoreSettings() 231void KDEPIMConfigWidget::saveStoreSettings()
230{ 232{
231 if ( !mStoreUrl->url().isEmpty() ) { 233 if ( !mStoreUrl->url().isEmpty() ) {
232 QString path = QDir::homeDirPath(); 234 QString path = QDir::homeDirPath();
233 QString url = mStoreUrl->url(); 235 QString url = mStoreUrl->url();
234#ifdef DESKTOP_VERSION 236#ifdef DESKTOP_VERSION
235 if ( url.startsWith( "LOCAL:" ) ) { 237 if ( url.startsWith( "LOCAL:" ) ) {
236 path = qApp->applicationDirPath () ; 238 path = qApp->applicationDirPath () ;
237 } 239 }
238#endif 240#endif
239 KConfig cfg ( path + "/.microkdehome" ); 241 KConfig cfg ( path + "/.microkdehome" );
240 cfg.setGroup("Global"); 242 cfg.setGroup("Global");
241 cfg.writeEntry( "MICROKDEHOME", url ); 243 cfg.writeEntry( "MICROKDEHOME", url );
242 qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); 244 qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1());
243 cfg.sync(); 245 cfg.sync();
244 } else { 246 } else {
245 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 247 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
246 saveStoreSettings(); 248 saveStoreSettings();
247 } 249 }
248} 250}
249void KDEPIMConfigWidget::setupExternalAppTab() 251void KDEPIMConfigWidget::setupExternalAppTab()
250{ 252{
251 QWidget *externalAppsPage = new QWidget( this ); 253 QWidget *externalAppsPage = new QWidget( this );
252 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), 254 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(),
253 KDialog::spacingHintSmall() ); 255 KDialog::spacingHintSmall() );
254 256
255 mExternalApps = new QComboBox( externalAppsPage ); 257 mExternalApps = new QComboBox( externalAppsPage );
256 258
257 QMap<ExternalAppHandler::Types, QString>::Iterator it; 259 QMap<ExternalAppHandler::Types, QString>::Iterator it;
258 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) 260 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it )
259 mExternalApps->insertItem( it.data(), it.key() ); 261 mExternalApps->insertItem( it.data(), it.key() );
260 262
261 layout->addWidget( mExternalApps ); 263 layout->addWidget( mExternalApps );
262 264
263 connect( mExternalApps, SIGNAL( activated( int ) ), 265 connect( mExternalApps, SIGNAL( activated( int ) ),
264 this, SLOT (externalapp_changed( int ) ) ); 266 this, SLOT (externalapp_changed( int ) ) );
265 267
266 268
267 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); 269 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage );
268 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); 270 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" );
269 mExternalAppGroupBox->layout()->setMargin(4); 271 mExternalAppGroupBox->layout()->setMargin(4);
270 272
271 mClient = new QComboBox( mExternalAppGroupBox ); 273 mClient = new QComboBox( mExternalAppGroupBox );
272 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); 274 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 );
273 275
274 connect( mClient, SIGNAL( activated( int ) ), 276 connect( mClient, SIGNAL( activated( int ) ),
275 this, SLOT (client_changed( int ) ) ); 277 this, SLOT (client_changed( int ) ) );
276 278
277 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); 279 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox);
278 boxLayout->addWidget( lab, 1, 0 ); 280 boxLayout->addWidget( lab, 1, 0 );
279 mChannel = new QLineEdit(mExternalAppGroupBox); 281 mChannel = new QLineEdit(mExternalAppGroupBox);
280 mChannel->setReadOnly(true); 282 mChannel->setReadOnly(true);
281 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); 283 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 );
282 284
283 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); 285 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox);
284 boxLayout->addWidget( lab, 3, 0 ); 286 boxLayout->addWidget( lab, 3, 0 );
285 mMessage = new QLineEdit(mExternalAppGroupBox); 287 mMessage = new QLineEdit(mExternalAppGroupBox);
286 mMessage->setReadOnly(true); 288 mMessage->setReadOnly(true);
287 boxLayout->addWidget( mMessage , 4, 0); 289 boxLayout->addWidget( mMessage , 4, 0);
288 290
289 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); 291 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox);
290 boxLayout->addWidget( lab, 3, 1 ); 292 boxLayout->addWidget( lab, 3, 1 );
291 mParameters = new QLineEdit(mExternalAppGroupBox); 293 mParameters = new QLineEdit(mExternalAppGroupBox);
292 mParameters->setReadOnly(true); 294 mParameters->setReadOnly(true);
293 boxLayout->addWidget( mParameters, 4, 1 ); 295 boxLayout->addWidget( mParameters, 4, 1 );
294 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); 296 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox);
295 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); 297 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 );
296 298
297 299
298 if ( QApplication::desktop()->height() > 240 ) { 300 if ( QApplication::desktop()->height() > 240 ) {
299 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); 301 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox);
300 boxLayout->addWidget( lab, 6, 0 ); 302 boxLayout->addWidget( lab, 6, 0 );
301 mMessage2 = new QLineEdit(mExternalAppGroupBox); 303 mMessage2 = new QLineEdit(mExternalAppGroupBox);
302 mMessage2->setReadOnly(true); 304 mMessage2->setReadOnly(true);
303 boxLayout->addWidget( mMessage2 , 7, 0); 305 boxLayout->addWidget( mMessage2 , 7, 0);
304 306
305 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); 307 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox);
306 boxLayout->addWidget( lab, 6, 1 ); 308 boxLayout->addWidget( lab, 6, 1 );
307 mParameters2 = new QLineEdit(mExternalAppGroupBox); 309 mParameters2 = new QLineEdit(mExternalAppGroupBox);
308 mParameters2->setReadOnly(true); 310 mParameters2->setReadOnly(true);
309 boxLayout->addWidget( mParameters2, 7, 1 ); 311 boxLayout->addWidget( mParameters2, 7, 1 );
310 312
311 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); 313 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox);
312 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); 314 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 );
313 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 315 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
314 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 316 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
315 } else { 317 } else {
316 mMessage2 = 0; 318 mMessage2 = 0;
317 mParameters2 = 0; 319 mParameters2 = 0;
318 } 320 }
319 321
320 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 322 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
321 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 323 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
322 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 324 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
323 325
324 326
325 layout->addWidget( mExternalAppGroupBox ); 327 layout->addWidget( mExternalAppGroupBox );
326 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); 328 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) );
327 329
328} 330}
329 331
330 332
331void KDEPIMConfigWidget::setupLocaleDateTab() 333void KDEPIMConfigWidget::setupLocaleDateTab()
332{ 334{
333 QWidget *topFrame = new QWidget( this ); 335 QWidget *topFrame = new QWidget( this );
334 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); 336 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2);
335 337
336 topLayout->setSpacing(KDialog::spacingHintSmall()); 338 topLayout->setSpacing(KDialog::spacingHintSmall());
337 topLayout->setMargin(KDialog::marginHintSmall()); 339 topLayout->setMargin(KDialog::marginHintSmall());
338 int iii = 0; 340 int iii = 0;
339 341
340 342
341 KPrefsWidRadios *syncPrefsGroup = 343 KPrefsWidRadios *syncPrefsGroup =
342 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); 344 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame);
343 QString format; 345 QString format;
344 if ( QApplication::desktop()->width() < 480 ) 346 if ( QApplication::desktop()->width() < 480 )
345 format = "(%d.%m.%Y)"; 347 format = "(%d.%m.%Y)";
346 else 348 else
347 format = "(%d.%m.%Y|%A %d %B %Y)"; 349 format = "(%d.%m.%Y|%A %d %B %Y)";
348 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 350 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
349 if ( QApplication::desktop()->width() < 480 ) 351 if ( QApplication::desktop()->width() < 480 )
350 format = "(%m.%d.%Y)"; 352 format = "(%m.%d.%Y)";
351 else 353 else
352 format = "(%m.%d.%Y|%A %B %d %Y)"; 354 format = "(%m.%d.%Y|%A %B %d %Y)";
353 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 355 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
354 if ( QApplication::desktop()->width() < 480 ) 356 if ( QApplication::desktop()->width() < 480 )
355 format = "(%Y-%m-%d)"; 357 format = "(%Y-%m-%d)";
356 else 358 else
357 format = "(%Y-%m-%d|%A %Y %B %d)"; 359 format = "(%Y-%m-%d|%A %Y %B %d)";
358 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 360 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
359 syncPrefsGroup->addRadio(i18n("User defined")); 361 syncPrefsGroup->addRadio(i18n("User defined"));
360 if ( QApplication::desktop()->width() < 480 ) { 362 if ( QApplication::desktop()->width() < 480 ) {
361 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 363 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
362 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); 364 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 );
363 } 365 }
364 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 366 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
365 ++iii; 367 ++iii;
366 ++iii; 368 ++iii;
367 QLabel * lab; 369 QLabel * lab;
368 mUserDateFormatLong = new QLineEdit(topFrame); 370 mUserDateFormatLong = new QLineEdit(topFrame);
369 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 371 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
370 topLayout->addWidget(lab ,iii,0); 372 topLayout->addWidget(lab ,iii,0);
371 topLayout->addWidget(mUserDateFormatLong,iii,1); 373 topLayout->addWidget(mUserDateFormatLong,iii,1);
372 ++iii; 374 ++iii;
373 mUserDateFormatShort = new QLineEdit(topFrame); 375 mUserDateFormatShort = new QLineEdit(topFrame);
374 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 376 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
375 topLayout->addWidget(lab ,iii,0); 377 topLayout->addWidget(lab ,iii,0);
diff --git a/microkde/kfiledialog.cpp b/microkde/kfiledialog.cpp
index 6be1580..c64f325 100644
--- a/microkde/kfiledialog.cpp
+++ b/microkde/kfiledialog.cpp
@@ -1,79 +1,88 @@
1#include <kfiledialog.h> 1#include <kfiledialog.h>
2#include <qdialog.h> 2#include <qdialog.h>
3#include <qlayout.h> 3#include <qlayout.h>
4#include <qdir.h> 4#include <qdir.h>
5#include <qfileinfo.h> 5#include <qfileinfo.h>
6#include <qapplication.h> 6#include <qapplication.h>
7 7
8#ifndef DESKTOP_VERSION 8#ifndef DESKTOP_VERSION
9//US orig#include <ofileselector.h> 9//US orig#include <ofileselector.h>
10#include <ofileselector_p.h> 10#include <ofileselector_p.h>
11QString KFileDialog::getSaveFileName( const QString & fn, 11QString KFileDialog::getSaveFileName( const QString & fn,
12 const QString & cap , QWidget * par ) 12 const QString & cap , QWidget * par )
13{ 13{
14 QString retfile = ""; 14 QString retfile = "";
15 QDialog dia ( par, "input-dialog", true ); 15 QDialog dia ( par, "input-dialog", true );
16 QVBoxLayout lay( &dia ); 16 QVBoxLayout lay( &dia );
17 lay.setMargin(7); 17 lay.setMargin(7);
18 lay.setSpacing(7); 18 lay.setSpacing(7);
19 QString file = fn; 19 QString file = fn;
20 if ( file.isEmpty() ) 20 if ( file.isEmpty() )
21 file = QDir::homeDirPath()+"/*"; 21 file = QDir::homeDirPath()+"/*";
22 QFileInfo fi ( file ); 22 QFileInfo fi ( file );
23 OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Save, fi.dirPath(true), fi.fileName() ); 23 OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Save, fi.dirPath(true), fi.fileName() );
24 QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); 24 QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) );
25 lay.addWidget( &o); 25 lay.addWidget( &o);
26 // o.setNewVisible( true ); 26 // o.setNewVisible( true );
27 // o.setNameVisible( true ); 27 // o.setNameVisible( true );
28 dia.showMaximized(); 28 dia.showMaximized();
29 if ( cap.isEmpty() ) 29 if ( cap.isEmpty() )
30 dia.setCaption( file ); 30 dia.setCaption( file );
31 else 31 else
32 dia.setCaption( cap ); 32 dia.setCaption( cap );
33 int res = dia.exec(); 33 int res = dia.exec();
34 if ( res ) 34 if ( res )
35 retfile = o.selectedName(); 35 retfile = o.selectedName();
36 return retfile; 36 return retfile;
37} 37}
38 38
39QString KFileDialog::getOpenFileName( const QString & fn, 39QString KFileDialog::getOpenFileName( const QString & fn,
40 const QString & cap, QWidget * par ) 40 const QString & cap, QWidget * par )
41{ 41{
42 QString retfile = ""; 42 QString retfile = "";
43 QDialog dia ( par, "input-dialog", true ); 43 QDialog dia ( par, "input-dialog", true );
44 // QLineEdit lab ( &dia ); 44 // QLineEdit lab ( &dia );
45 QVBoxLayout lay( &dia ); 45 QVBoxLayout lay( &dia );
46 lay.setMargin(7); 46 lay.setMargin(7);
47 lay.setSpacing(7); 47 lay.setSpacing(7);
48 QString file = fn; 48 QString file = fn;
49 if ( file.isEmpty() ) 49 if ( file.isEmpty() )
50 file = QDir::homeDirPath()+"/*";; 50 file = QDir::homeDirPath()+"/*";;
51 QFileInfo fi ( file ); 51 QFileInfo fi ( file );
52 OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Open, fi.dirPath(true), fi.fileName() ); 52 OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Open, fi.dirPath(true), fi.fileName() );
53 QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); 53 QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) );
54 lay.addWidget( &o); 54 lay.addWidget( &o);
55 dia.showMaximized(); 55 dia.showMaximized();
56 dia.setCaption( cap ); 56 dia.setCaption( cap );
57 int res = dia.exec(); 57 int res = dia.exec();
58 if ( res ) 58 if ( res )
59 retfile = o.selectedName(); 59 retfile = o.selectedName();
60 return retfile; 60 return retfile;
61} 61}
62 62QString KFileDialog::getExistingDirectory( const QString & fn,
63 const QString & cap, QWidget * par )
64{
65 return KFileDialog::getSaveFileName( fn, cap, pr );
66}
63#else 67#else
64 68
65#include <qfiledialog.h> 69#include <qfiledialog.h>
66 70
67QString KFileDialog::getSaveFileName( const QString & fn, 71QString KFileDialog::getSaveFileName( const QString & fn,
68 const QString & cap , QWidget * par ) 72 const QString & cap , QWidget * par )
69{ 73{
70 return QFileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap ); 74 return QFileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap );
71} 75}
72QString KFileDialog::getOpenFileName( const QString & fn, 76QString KFileDialog::getOpenFileName( const QString & fn,
73 const QString & cap, QWidget * par ) 77 const QString & cap, QWidget * par )
74{ 78{
75 79
76 return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap ); 80 return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap );
77} 81}
82QString KFileDialog::getExistingDirectory( const QString & fn,
83 const QString & cap, QWidget * par )
84{
85 return QFileDialog::getExistingDirectory( fn, par, "exidtingdir", cap );
86}
78#endif 87#endif
79 88
diff --git a/microkde/kfiledialog.h b/microkde/kfiledialog.h
index 0825872..90709cd 100644
--- a/microkde/kfiledialog.h
+++ b/microkde/kfiledialog.h
@@ -1,20 +1,22 @@
1#ifndef MICROKDE_KFILEDIALOG_H 1#ifndef MICROKDE_KFILEDIALOG_H
2#define MICROKDE_KFILEDIALOG_H 2#define MICROKDE_KFILEDIALOG_H
3 3
4#include <qstring.h> 4#include <qstring.h>
5#include <qwidget.h> 5#include <qwidget.h>
6 6
7class KFileDialog 7class KFileDialog
8{ 8{
9 public: 9 public:
10 10
11 static QString getSaveFileName( const QString &, 11 static QString getSaveFileName( const QString &,
12 const QString &, QWidget * ); 12 const QString &, QWidget * );
13 13
14 14
15 static QString getOpenFileName( const QString &, 15 static QString getOpenFileName( const QString &,
16 const QString &, QWidget * ); 16 const QString &, QWidget * );
17 17
18 static QString getExistingDirectory( const QString &,
19 const QString &, QWidget * );
18}; 20};
19 21
20#endif 22#endif
diff --git a/microkde/kio/kfile/kurlrequester.cpp b/microkde/kio/kfile/kurlrequester.cpp
index 991c8be..ca94570 100644
--- a/microkde/kio/kfile/kurlrequester.cpp
+++ b/microkde/kio/kfile/kurlrequester.cpp
@@ -22,385 +22,388 @@
22 22
23#else 23#else
24#include <unistd.h> 24#include <unistd.h>
25#endif 25#endif
26#include <qstring.h> 26#include <qstring.h>
27//US #include <qtooltip.h> 27//US #include <qtooltip.h>
28 28
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30 30
31//US #include <kaccel.h> 31//US #include <kaccel.h>
32//US #include <kcombobox.h> 32//US #include <kcombobox.h>
33#include <kdebug.h> 33#include <kdebug.h>
34#include <kdialog.h> 34#include <kdialog.h>
35#include <kfiledialog.h> 35#include <kfiledialog.h>
36#include <kglobal.h> 36#include <kglobal.h>
37#include <kiconloader.h> 37#include <kiconloader.h>
38#include <klineedit.h> 38#include <klineedit.h>
39#include <klocale.h> 39#include <klocale.h>
40//US #include <kurlcompletion.h> 40//US #include <kurlcompletion.h>
41//US #include <kurldrag.h> 41//US #include <kurldrag.h>
42//US #include <kprotocolinfo.h> 42//US #include <kprotocolinfo.h>
43 43
44 44
45#include "kurlrequester.h" 45#include "kurlrequester.h"
46 46
47 47
48class KURLDragPushButton : public QPushButton 48class KURLDragPushButton : public QPushButton
49{ 49{
50public: 50public:
51 KURLDragPushButton( QWidget *parent, const char *name=0 ) 51 KURLDragPushButton( QWidget *parent, const char *name=0 )
52 : QPushButton( parent, name ) { 52 : QPushButton( parent, name ) {
53 //US setDragEnabled( true ); 53 //US setDragEnabled( true );
54 } 54 }
55 ~KURLDragPushButton() {} 55 ~KURLDragPushButton() {}
56 56
57 void setURL( const KURL& url ) { 57 void setURL( const KURL& url ) {
58 m_urls.clear(); 58 m_urls.clear();
59 m_urls.append( url ); 59 m_urls.append( url );
60 } 60 }
61 61
62 /* not needed so far 62 /* not needed so far
63 void setURLs( const KURL::List& urls ) { 63 void setURLs( const KURL::List& urls ) {
64 m_urls = urls; 64 m_urls = urls;
65 } 65 }
66 const KURL::List& urls() const { return m_urls; } 66 const KURL::List& urls() const { return m_urls; }
67 */ 67 */
68 68
69protected: 69protected:
70/*US 70/*US
71 virtual QDragObject *dragObject() { 71 virtual QDragObject *dragObject() {
72 if ( m_urls.isEmpty() ) 72 if ( m_urls.isEmpty() )
73 return 0L; 73 return 0L;
74 74
75 QDragObject *drag = KURLDrag::newDrag( m_urls, this, "url drag" ); 75 QDragObject *drag = KURLDrag::newDrag( m_urls, this, "url drag" );
76 return drag; 76 return drag;
77 } 77 }
78*/ 78*/
79private: 79private:
80 KURL::List m_urls; 80 KURL::List m_urls;
81 81
82}; 82};
83 83
84 84
85/* 85/*
86************************************************************************* 86*************************************************************************
87*/ 87*/
88 88
89class KURLRequester::KURLRequesterPrivate 89class KURLRequester::KURLRequesterPrivate
90{ 90{
91public: 91public:
92 KURLRequesterPrivate() { 92 KURLRequesterPrivate() {
93 edit = 0L; 93 edit = 0L;
94 //UScombo = 0L; 94 //UScombo = 0L;
95//US fileDialogMode = KFile::File | KFile::ExistingOnly | KFile::LocalOnly; 95//US fileDialogMode = KFile::File | KFile::ExistingOnly | KFile::LocalOnly;
96 } 96 }
97 97
98 void setText( const QString& text ) { 98 void setText( const QString& text ) {
99/*US 99/*US
100 if ( combo ) 100 if ( combo )
101 { 101 {
102 if (combo->editable()) 102 if (combo->editable())
103 { 103 {
104 combo->setEditText( text ); 104 combo->setEditText( text );
105 } 105 }
106 else 106 else
107 { 107 {
108 combo->insertItem( text ); 108 combo->insertItem( text );
109 combo->setCurrentItem( combo->count()-1 ); 109 combo->setCurrentItem( combo->count()-1 );
110 } 110 }
111 } 111 }
112 else 112 else
113*/ 113*/
114 { 114 {
115 edit->setText( text ); 115 edit->setText( text );
116 } 116 }
117 } 117 }
118 118
119 void connectSignals( QObject *receiver ) { 119 void connectSignals( QObject *receiver ) {
120 QObject *sender; 120 QObject *sender;
121 /*USif ( combo ) 121 /*USif ( combo )
122 sender = combo; 122 sender = combo;
123 else 123 else
124*/ 124*/
125 sender = edit; 125 sender = edit;
126 126
127 connect( sender, SIGNAL( textChanged( const QString& )), 127 connect( sender, SIGNAL( textChanged( const QString& )),
128 receiver, SIGNAL( textChanged( const QString& ))); 128 receiver, SIGNAL( textChanged( const QString& )));
129 connect( sender, SIGNAL( returnPressed() ), 129 connect( sender, SIGNAL( returnPressed() ),
130 receiver, SIGNAL( returnPressed() )); 130 receiver, SIGNAL( returnPressed() ));
131 //USconnect( sender, SIGNAL( returnPressed( const QString& ) ), 131 //USconnect( sender, SIGNAL( returnPressed( const QString& ) ),
132 //US receiver, SIGNAL( returnPressed( const QString& ) )); 132 //US receiver, SIGNAL( returnPressed( const QString& ) ));
133 } 133 }
134/*US 134/*US
135 void setCompletionObject( KCompletion *comp ) { 135 void setCompletionObject( KCompletion *comp ) {
136 if ( combo ) 136 if ( combo )
137 combo->setCompletionObject( comp ); 137 combo->setCompletionObject( comp );
138 else 138 else
139 edit->setCompletionObject( comp ); 139 edit->setCompletionObject( comp );
140 } 140 }
141 */ 141 */
142 /** 142 /**
143 * replaces ~user or $FOO, if necessary 143 * replaces ~user or $FOO, if necessary
144 */ 144 */
145 QString url() { 145 QString url() {
146 QString txt = /*US combo ? combo->currentText() : */ edit->text(); 146 QString txt = /*US combo ? combo->currentText() : */ edit->text();
147/*US KURLCompletion *comp; 147/*US KURLCompletion *comp;
148 if ( combo ) 148 if ( combo )
149 comp = dynamic_cast<KURLCompletion*>(combo->completionObject()); 149 comp = dynamic_cast<KURLCompletion*>(combo->completionObject());
150 else 150 else
151 comp = dynamic_cast<KURLCompletion*>(edit->completionObject()); 151 comp = dynamic_cast<KURLCompletion*>(edit->completionObject());
152 152
153 if ( comp ) 153 if ( comp )
154 return comp->replacedPath( txt ); 154 return comp->replacedPath( txt );
155 else 155 else
156*/ 156*/
157 return txt; 157 return txt;
158 } 158 }
159 159
160 KLineEdit *edit; 160 KLineEdit *edit;
161//US KComboBox *combo; 161//US KComboBox *combo;
162 int fileDialogMode; 162 int fileDialogMode;
163 QString fileDialogFilter; 163 QString fileDialogFilter;
164}; 164};
165 165
166 166
167/*US 167/*US
168KURLRequester::KURLRequester( QWidget *editWidget, QWidget *parent, 168KURLRequester::KURLRequester( QWidget *editWidget, QWidget *parent,
169 const char *name ) 169 const char *name )
170 : QHBox( parent, name ) 170 : QHBox( parent, name )
171{ 171{
172 d = new KURLRequesterPrivate; 172 d = new KURLRequesterPrivate;
173 173
174 // must have this as parent 174 // must have this as parent
175 editWidget->reparent( this, 0, QPoint(0,0) ); 175 editWidget->reparent( this, 0, QPoint(0,0) );
176//US d->edit = dynamic_cast<KLineEdit*>( editWidget ); 176//US d->edit = dynamic_cast<KLineEdit*>( editWidget );
177 d->edit = (KLineEdit*)( editWidget ); 177 d->edit = (KLineEdit*)( editWidget );
178//US d->combo = dynamic_cast<KComboBox*>( editWidget ); 178//US d->combo = dynamic_cast<KComboBox*>( editWidget );
179 179
180 init(); 180 init();
181} 181}
182*/ 182*/
183 183
184KURLRequester::KURLRequester( QWidget *parent, const char *name ) 184KURLRequester::KURLRequester( QWidget *parent, const char *name )
185 : QHBox( parent, name ) 185 : QHBox( parent, name )
186{ 186{
187 d = new KURLRequesterPrivate; 187 d = new KURLRequesterPrivate;
188 init(); 188 init();
189} 189}
190 190
191 191
192KURLRequester::KURLRequester( const QString& url, QWidget *parent, 192KURLRequester::KURLRequester( const QString& url, QWidget *parent,
193 const char *name ) 193 const char *name )
194 : QHBox( parent, name ) 194 : QHBox( parent, name )
195{ 195{
196 d = new KURLRequesterPrivate; 196 d = new KURLRequesterPrivate;
197 init(); 197 init();
198 setURL( url ); 198 setURL( url );
199} 199}
200 200
201 201
202KURLRequester::~KURLRequester() 202KURLRequester::~KURLRequester()
203{ 203{
204//US delete myCompletion; 204//US delete myCompletion;
205 delete myFileDialog; 205 delete myFileDialog;
206 delete d; 206 delete d;
207} 207}
208 208
209 209
210void KURLRequester::init() 210void KURLRequester::init()
211{ 211{
212 myFileDialog = 0L; 212 myFileDialog = 0L;
213 myShowLocalProt = false; 213 myShowLocalProt = false;
214 214 mPathIsDir = false;
215 if (/*US !d->combo && */ !d->edit ) 215 if (/*US !d->combo && */ !d->edit )
216 d->edit = new KLineEdit( this, "KURLRequester::KLineEdit" ); 216 d->edit = new KLineEdit( this, "KURLRequester::KLineEdit" );
217 217
218 myButton = new KURLDragPushButton( this, "kfile button"); 218 myButton = new KURLDragPushButton( this, "kfile button");
219 QIconSet iconSet = SmallIconSet("fileopen"); 219 QIconSet iconSet = SmallIconSet("fileopen");
220 QPixmap pixMap = iconSet.pixmap( QIconSet::Small, QIconSet::Normal ); 220 QPixmap pixMap = iconSet.pixmap( QIconSet::Small, QIconSet::Normal );
221 myButton->setIconSet( iconSet ); 221 myButton->setIconSet( iconSet );
222 myButton->setFixedSize( pixMap.width()+8, pixMap.height()+8 ); 222 myButton->setFixedSize( pixMap.width()+8, pixMap.height()+8 );
223//US QToolTip::add(myButton, i18n("Open file dialog")); 223//US QToolTip::add(myButton, i18n("Open file dialog"));
224 224
225 connect( myButton, SIGNAL( pressed() ), SLOT( slotUpdateURL() )); 225 connect( myButton, SIGNAL( pressed() ), SLOT( slotUpdateURL() ));
226 226
227 setSpacing( KDialog::spacingHint() ); 227 setSpacing( KDialog::spacingHint() );
228 228
229 QWidget *widget = /*US d->combo ? (QWidget*) d->combo : */ (QWidget*) d->edit; 229 QWidget *widget = /*US d->combo ? (QWidget*) d->combo : */ (QWidget*) d->edit;
230 setFocusProxy( widget ); 230 setFocusProxy( widget );
231 231
232 d->connectSignals( this ); 232 d->connectSignals( this );
233 connect( myButton, SIGNAL( clicked() ), this, SLOT( slotOpenDialog() )); 233 connect( myButton, SIGNAL( clicked() ), this, SLOT( slotOpenDialog() ));
234/*US 234/*US
235 myCompletion = new KURLCompletion(); 235 myCompletion = new KURLCompletion();
236 d->setCompletionObject( myCompletion ); 236 d->setCompletionObject( myCompletion );
237 237
238 KAccel *accel = new KAccel( this ); 238 KAccel *accel = new KAccel( this );
239 accel->insert( KStdAccel::Open, this, SLOT( slotOpenDialog() )); 239 accel->insert( KStdAccel::Open, this, SLOT( slotOpenDialog() ));
240 accel->readSettings(); 240 accel->readSettings();
241*/ 241*/
242} 242}
243 243
244 244
245void KURLRequester::setURL( const QString& url ) 245void KURLRequester::setURL( const QString& url )
246{ 246{
247 bool hasLocalPrefix = (url.startsWith("file:")); 247 bool hasLocalPrefix = (url.startsWith("file:"));
248 248
249 if ( !myShowLocalProt && hasLocalPrefix ) 249 if ( !myShowLocalProt && hasLocalPrefix )
250 d->setText( url.mid( 5, url.length()-5 )); 250 d->setText( url.mid( 5, url.length()-5 ));
251 else 251 else
252 d->setText( url ); 252 d->setText( url );
253} 253}
254 254
255void KURLRequester::setCaption( const QString& caption ) 255void KURLRequester::setCaption( const QString& caption )
256{ 256{
257 //USfileDialog()->setCaption( caption ); 257 //USfileDialog()->setCaption( caption );
258 //USQWidget::setCaption( caption ); 258 //USQWidget::setCaption( caption );
259} 259}
260 260
261QString KURLRequester::url() const 261QString KURLRequester::url() const
262{ 262{
263 return d->url(); 263 return d->url();
264} 264}
265 265
266 266
267void KURLRequester::slotOpenDialog() 267void KURLRequester::slotOpenDialog()
268{ 268{
269 emit openFileDialog( this ); 269 emit openFileDialog( this );
270 270
271//US use our special KFIleDialog instead 271//US use our special KFIleDialog instead
272 KURL u( url() ); 272 KURL u( url() );
273 //QString fn = u.url(); 273 //QString fn = u.url();
274 QString fn = d->edit->text(); 274 QString fn = d->edit->text();
275 fn = KFileDialog::getSaveFileName( fn, "", this ); 275 if ( mPathIsDir )
276 fn = KFileDialog::getExistingDirectory ( fn, "", this );
277 else
278 fn = KFileDialog::getSaveFileName( fn, "", this );
276 279
277 if ( fn == "" ) 280 if ( fn == "" )
278 return; 281 return;
279 282
280 setURL( fn ); 283 setURL( fn );
281 emit urlSelected( d->url() ); 284 emit urlSelected( d->url() );
282/*US 285/*US
283 KFileDialog *dlg = fileDialog(); 286 KFileDialog *dlg = fileDialog();
284 if ( !d->url().isEmpty() ) { 287 if ( !d->url().isEmpty() ) {
285 KURL u( url() ); 288 KURL u( url() );
286 // If we won't be able to list it (e.g. http), then don't try :) 289 // If we won't be able to list it (e.g. http), then don't try :)
287 if ( KProtocolInfo::supportsListing( u.protocol() ) ) 290 if ( KProtocolInfo::supportsListing( u.protocol() ) )
288 dlg->setSelection( u.url() ); 291 dlg->setSelection( u.url() );
289 } 292 }
290 293
291 if ( dlg->exec() == QDialog::Accepted ) 294 if ( dlg->exec() == QDialog::Accepted )
292 { 295 {
293 setURL( dlg->selectedURL().prettyURL() ); 296 setURL( dlg->selectedURL().prettyURL() );
294 emit urlSelected( d->url() ); 297 emit urlSelected( d->url() );
295 } 298 }
296*/ 299*/
297 300
298} 301}
299 302
300void KURLRequester::setMode(unsigned int mode) 303void KURLRequester::setMode(unsigned int mode)
301{ 304{
302/*US 305/*US
303 Q_ASSERT( (mode & KFile::Files) == 0 ); 306 Q_ASSERT( (mode & KFile::Files) == 0 );
304 d->fileDialogMode = mode; 307 d->fileDialogMode = mode;
305 if ( (mode & KFile::Directory) && !(mode & KFile::File) ) 308 if ( (mode & KFile::Directory) && !(mode & KFile::File) )
306 myCompletion->setMode( KURLCompletion::DirCompletion ); 309 myCompletion->setMode( KURLCompletion::DirCompletion );
307 310
308 if (myFileDialog) 311 if (myFileDialog)
309 myFileDialog->setMode( d->fileDialogMode ); 312 myFileDialog->setMode( d->fileDialogMode );
310*/ 313*/
311} 314}
312 315
313void KURLRequester::setFilter(const QString &filter) 316void KURLRequester::setFilter(const QString &filter)
314{ 317{
315/*US 318/*US
316 d->fileDialogFilter = filter; 319 d->fileDialogFilter = filter;
317 if (myFileDialog) 320 if (myFileDialog)
318 myFileDialog->setFilter( d->fileDialogFilter ); 321 myFileDialog->setFilter( d->fileDialogFilter );
319*/ 322*/
320} 323}
321 324
322KFileDialog * KURLRequester::fileDialog() const 325KFileDialog * KURLRequester::fileDialog() const
323{ 326{
324/*US 327/*US
325 if ( !myFileDialog ) { 328 if ( !myFileDialog ) {
326 QWidget *p = parentWidget(); 329 QWidget *p = parentWidget();
327 myFileDialog = new KFileDialog( QString::null, QString::null, p, 330 myFileDialog = new KFileDialog( QString::null, QString::null, p,
328 "file dialog", true ); 331 "file dialog", true );
329 332
330 myFileDialog->setMode( d->fileDialogMode ); 333 myFileDialog->setMode( d->fileDialogMode );
331 myFileDialog->setFilter( d->fileDialogFilter ); 334 myFileDialog->setFilter( d->fileDialogFilter );
332 } 335 }
333 336
334 return myFileDialog; 337 return myFileDialog;
335*/ 338*/
336 return 0; 339 return 0;
337} 340}
338 341
339 342
340void KURLRequester::setShowLocalProtocol( bool b ) 343void KURLRequester::setShowLocalProtocol( bool b )
341{ 344{
342 if ( myShowLocalProt == b ) 345 if ( myShowLocalProt == b )
343 return; 346 return;
344 347
345 myShowLocalProt = b; 348 myShowLocalProt = b;
346 setURL( url() ); 349 setURL( url() );
347} 350}
348 351
349void KURLRequester::clear() 352void KURLRequester::clear()
350{ 353{
351 d->setText( QString::null ); 354 d->setText( QString::null );
352} 355}
353 356
354KLineEdit * KURLRequester::lineEdit() const 357KLineEdit * KURLRequester::lineEdit() const
355{ 358{
356 return d->edit; 359 return d->edit;
357} 360}
358/*US 361/*US
359KComboBox * KURLRequester::comboBox() const 362KComboBox * KURLRequester::comboBox() const
360{ 363{
361 return d->combo; 364 return d->combo;
362} 365}
363*/ 366*/
364void KURLRequester::slotUpdateURL() 367void KURLRequester::slotUpdateURL()
365{ 368{
366 // bin compat, myButton is declared as QPushButton 369 // bin compat, myButton is declared as QPushButton
367//US KURL u( QDir::currentDirPath() + '/', url() ); 370//US KURL u( QDir::currentDirPath() + '/', url() );
368 KURL u( url() ); 371 KURL u( url() );
369 (static_cast<KURLDragPushButton *>( myButton))->setURL( u ); 372 (static_cast<KURLDragPushButton *>( myButton))->setURL( u );
370} 373}
371 374
372QPushButton * KURLRequester::button() const 375QPushButton * KURLRequester::button() const
373{ 376{
374 return myButton; 377 return myButton;
375} 378}
376/*US 379/*US
377KEditListBox::CustomEditor KURLRequester::customEditor() 380KEditListBox::CustomEditor KURLRequester::customEditor()
378{ 381{
379 setSizePolicy(QSizePolicy( QSizePolicy::Preferred, 382 setSizePolicy(QSizePolicy( QSizePolicy::Preferred,
380 QSizePolicy::Fixed)); 383 QSizePolicy::Fixed));
381 384
382 KLineEdit *edit = d->edit; 385 KLineEdit *edit = d->edit;
383 if ( !edit && d->combo ) 386 if ( !edit && d->combo )
384 edit = dynamic_cast<KLineEdit*>( d->combo->lineEdit() ); 387 edit = dynamic_cast<KLineEdit*>( d->combo->lineEdit() );
385 388
386#ifndef NDEBUG 389#ifndef NDEBUG
387 if ( !edit ) 390 if ( !edit )
388 kdWarning() << "KURLRequester's lineedit is not a KLineEdit!??\n"; 391 kdWarning() << "KURLRequester's lineedit is not a KLineEdit!??\n";
389#endif 392#endif
390 393
391 KEditListBox::CustomEditor editor( this, edit ); 394 KEditListBox::CustomEditor editor( this, edit );
392 return editor; 395 return editor;
393} 396}
394*/ 397*/
395void KURLRequester::virtual_hook( int, void* ) 398void KURLRequester::virtual_hook( int, void* )
396{ /*BASE::virtual_hook( id, data );*/ } 399{ /*BASE::virtual_hook( id, data );*/ }
397 400
398/*US 401/*US
399KURLComboRequester::KURLComboRequester( QWidget *parent, 402KURLComboRequester::KURLComboRequester( QWidget *parent,
400 const char *name ) 403 const char *name )
401 : KURLRequester( new KComboBox(false), parent, name) 404 : KURLRequester( new KComboBox(false), parent, name)
402{ 405{
403} 406}
404*/ 407*/
405 408
406//US #include "kurlrequester.moc" 409//US #include "kurlrequester.moc"
diff --git a/microkde/kio/kfile/kurlrequester.h b/microkde/kio/kfile/kurlrequester.h
index 3253dd5..faa3326 100644
--- a/microkde/kio/kfile/kurlrequester.h
+++ b/microkde/kio/kfile/kurlrequester.h
@@ -1,269 +1,271 @@
1/* This file is part of the KDE libraries 1/* This file is part of the KDE libraries
2 Copyright (C) 1999,2000,2001 Carsten Pfeiffer <pfeiffer@kde.org> 2 Copyright (C) 1999,2000,2001 Carsten Pfeiffer <pfeiffer@kde.org>
3 3
4 library is free software; you can redistribute it and/or 4 library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public 5 modify it under the terms of the GNU Library General Public
6 License version 2, as published by the Free Software Foundation. 6 License version 2, as published by the Free Software Foundation.
7 7
8 This library is distributed in the hope that it will be useful, 8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of 9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details. 11 Library General Public License for more details.
12 12
13 You should have received a copy of the GNU Library General Public License 13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to 14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA. 16 Boston, MA 02111-1307, USA.
17*/ 17*/
18 18
19 19
20#ifndef KURLREQUESTER_H 20#ifndef KURLREQUESTER_H
21#define KURLREQUESTER_H 21#define KURLREQUESTER_H
22 22
23#include <qhbox.h> 23#include <qhbox.h>
24 24
25#include <keditlistbox.h> 25#include <keditlistbox.h>
26//US #include <kfile.h> 26//US #include <kfile.h>
27//US #include <kpushbutton.h> 27//US #include <kpushbutton.h>
28#include <kurl.h> 28#include <kurl.h>
29 29
30//US class KComboBox; 30//US class KComboBox;
31 31
32class KFileDialog; 32class KFileDialog;
33class KLineEdit; 33class KLineEdit;
34//US class KURLCompletion; 34//US class KURLCompletion;
35class KURLDragPushButton; 35class KURLDragPushButton;
36 36
37class QPushButton; 37class QPushButton;
38class QString; 38class QString;
39class QTimer; 39class QTimer;
40 40
41/** 41/**
42 * This class is a widget showing a lineedit and a button, which invokes a 42 * This class is a widget showing a lineedit and a button, which invokes a
43 * filedialog. File name completion is available in the lineedit. 43 * filedialog. File name completion is available in the lineedit.
44 * 44 *
45 * The defaults for the filedialog are to ask for one existing local file, i.e. 45 * The defaults for the filedialog are to ask for one existing local file, i.e.
46 * KFileDialog::setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly ) 46 * KFileDialog::setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly )
47 * The default filter is "*", i.e. show all files, and the start directory is 47 * The default filter is "*", i.e. show all files, and the start directory is
48 * the current working directory, or the last directory where a file has been 48 * the current working directory, or the last directory where a file has been
49 * selected. 49 * selected.
50 * 50 *
51 * You can change this behavior by using @ref setMode() or @ref setFilter(). 51 * You can change this behavior by using @ref setMode() or @ref setFilter().
52 * 52 *
53 * @short A widget to request a filename/url from the user 53 * @short A widget to request a filename/url from the user
54 * @author Carsten Pfeiffer <pfeiffer@kde.org> 54 * @author Carsten Pfeiffer <pfeiffer@kde.org>
55 */ 55 */
56class KURLRequester : public QHBox 56class KURLRequester : public QHBox
57{ 57{
58 Q_OBJECT 58 Q_OBJECT
59 Q_PROPERTY( QString url READ url WRITE setURL ) 59 Q_PROPERTY( QString url READ url WRITE setURL )
60 60
61public: 61public:
62 /** 62 /**
63 * Constructs a KURLRequester widget. 63 * Constructs a KURLRequester widget.
64 */ 64 */
65 KURLRequester( QWidget *parent=0, const char *name=0 ); 65 KURLRequester( QWidget *parent=0, const char *name=0 );
66 66
67 /** 67 /**
68 * Constructs a KURLRequester widget with the initial URL @p url. 68 * Constructs a KURLRequester widget with the initial URL @p url.
69 */ 69 */
70 KURLRequester( const QString& url, QWidget *parent=0, const char *name=0 ); 70 KURLRequester( const QString& url, QWidget *parent=0, const char *name=0 );
71 71
72 /** 72 /**
73 * Special constructor, which creates a KURLRequester widget with a custom 73 * Special constructor, which creates a KURLRequester widget with a custom
74 * edit-widget. The edit-widget can be either a KComboBox or a KLineEdit 74 * edit-widget. The edit-widget can be either a KComboBox or a KLineEdit
75 * (or inherited thereof). Note: for geometry management reasons, the 75 * (or inherited thereof). Note: for geometry management reasons, the
76 * edit-widget is reparented to have the KURLRequester as parent. 76 * edit-widget is reparented to have the KURLRequester as parent.
77 * @param modal specifies whether the filedialog should be opened as modal 77 * @param modal specifies whether the filedialog should be opened as modal
78 * or not. 78 * or not.
79 */ 79 */
80//US KURLRequester( QWidget *editWidget, QWidget *parent, const char *name=0 ); 80//US KURLRequester( QWidget *editWidget, QWidget *parent, const char *name=0 );
81 /** 81 /**
82 * Destructs the KURLRequester. 82 * Destructs the KURLRequester.
83 */ 83 */
84 ~KURLRequester(); 84 ~KURLRequester();
85 85
86 /** 86 /**
87 * @returns the current url in the lineedit. May be malformed, if the user 87 * @returns the current url in the lineedit. May be malformed, if the user
88 * entered something weird. ~user or environment variables are substituted 88 * entered something weird. ~user or environment variables are substituted
89 * for local files. 89 * for local files.
90 */ 90 */
91 QString url() const; 91 QString url() const;
92 92
93 /** 93 /**
94 * Enables/disables showing file:/ in the lineedit, when a local file has 94 * Enables/disables showing file:/ in the lineedit, when a local file has
95 * been selected in the filedialog or was set via @ref setURL(). 95 * been selected in the filedialog or was set via @ref setURL().
96 * Default is false, not showing file:/ 96 * Default is false, not showing file:/
97 * @see #showLocalProtocol 97 * @see #showLocalProtocol
98 */ 98 */
99 void setShowLocalProtocol( bool b ); 99 void setShowLocalProtocol( bool b );
100 100
101 /** 101 /**
102 * Sets the mode of the file dialog. 102 * Sets the mode of the file dialog.
103 * Note: you can only select one file with the filedialog, 103 * Note: you can only select one file with the filedialog,
104 * so KFile::Files doesn't make much sense. 104 * so KFile::Files doesn't make much sense.
105 * @see KFileDialog::setMode() 105 * @see KFileDialog::setMode()
106 */ 106 */
107 void setMode( unsigned int m ); 107 void setMode( unsigned int m );
108 void setPathIsDir( ) {mPathIsDir = true;}
108 109
109 /** 110 /**
110 * Sets the filter for the file dialog. 111 * Sets the filter for the file dialog.
111 * @see KFileDialog::setFilter() 112 * @see KFileDialog::setFilter()
112 */ 113 */
113 void setFilter( const QString& filter ); 114 void setFilter( const QString& filter );
114 115
115 /** 116 /**
116 * @returns whether local files will be prefixed with file:/ in the 117 * @returns whether local files will be prefixed with file:/ in the
117 * lineedit 118 * lineedit
118 * @see #setShowLocalProtocol 119 * @see #setShowLocalProtocol
119 */ 120 */
120 bool showLocalProtocol() const { return myShowLocalProt; } 121 bool showLocalProtocol() const { return myShowLocalProt; }
121 122
122 /** 123 /**
123 * @returns a pointer to the filedialog 124 * @returns a pointer to the filedialog
124 * You can use this to customize the dialog, e.g. to specify a filter. 125 * You can use this to customize the dialog, e.g. to specify a filter.
125 * Never returns 0L. 126 * Never returns 0L.
126 */ 127 */
127 virtual KFileDialog * fileDialog() const; 128 virtual KFileDialog * fileDialog() const;
128 129
129 /** 130 /**
130 * @returns a pointer to the lineedit, either the default one, or the 131 * @returns a pointer to the lineedit, either the default one, or the
131 * special one, if you used the special constructor. 132 * special one, if you used the special constructor.
132 * 133 *
133 * It is provided so that you can e.g. set an own completion object 134 * It is provided so that you can e.g. set an own completion object
134 * (e.g. @ref KShellCompletion) into it. 135 * (e.g. @ref KShellCompletion) into it.
135 */ 136 */
136 KLineEdit * lineEdit() const; 137 KLineEdit * lineEdit() const;
137 138
138 /** 139 /**
139 * @returns a pointer to the combobox, in case you have set one using the 140 * @returns a pointer to the combobox, in case you have set one using the
140 * special constructor. Returns 0L otherwise. 141 * special constructor. Returns 0L otherwise.
141 */ 142 */
142//US KComboBox * comboBox() const; 143//US KComboBox * comboBox() const;
143 144
144 /** 145 /**
145 * @returns a pointer to the pushbutton. It is provided so that you can 146 * @returns a pointer to the pushbutton. It is provided so that you can
146 * specify an own pixmap or a text, if you really need to. 147 * specify an own pixmap or a text, if you really need to.
147 */ 148 */
148 QPushButton * button() const; 149 QPushButton * button() const;
149 150
150 /** 151 /**
151 * @returns the KURLCompletion object used in the lineedit/combobox. 152 * @returns the KURLCompletion object used in the lineedit/combobox.
152 */ 153 */
153//US KURLCompletion *completionObject() const { return myCompletion; } 154//US KURLCompletion *completionObject() const { return myCompletion; }
154 155
155 /** 156 /**
156 * @returns an object, suitable for use with KEditListBox. It allows you 157 * @returns an object, suitable for use with KEditListBox. It allows you
157 * to put this KURLRequester into a KEditListBox. 158 * to put this KURLRequester into a KEditListBox.
158 * Basically, do it like this: 159 * Basically, do it like this:
159 * <pre> 160 * <pre>
160 * KURLRequester *req = new KURLRequester( someWidget ); 161 * KURLRequester *req = new KURLRequester( someWidget );
161 * [...] 162 * [...]
162 * KEditListBox *editListBox = new KEditListBox( i18n("Some Title"), req->customEditor(), someWidget ); 163 * KEditListBox *editListBox = new KEditListBox( i18n("Some Title"), req->customEditor(), someWidget );
163 * </pre> 164 * </pre>
164 * @since 3.1 165 * @since 3.1
165 */ 166 */
166//US KEditListBox::CustomEditor customEditor(); 167//US KEditListBox::CustomEditor customEditor();
167 168
168public slots: 169public slots:
169 /** 170 /**
170 * Sets the url in the lineedit to @p url. Depending on the state of 171 * Sets the url in the lineedit to @p url. Depending on the state of
171 * @ref showLocalProtocol(), file:/ on local files will be shown or not. 172 * @ref showLocalProtocol(), file:/ on local files will be shown or not.
172 * @since 3.1 173 * @since 3.1
173 */ 174 */
174 void setURL( const QString& url ); 175 void setURL( const QString& url );
175 176
176 /** 177 /**
177 * @reimp 178 * @reimp
178 * Sets the caption of the file dialog. 179 * Sets the caption of the file dialog.
179 * @since 3.1 180 * @since 3.1
180 */ 181 */
181 virtual void setCaption( const QString& caption ); 182 virtual void setCaption( const QString& caption );
182 183
183 /** 184 /**
184 * Clears the lineedit/combobox. 185 * Clears the lineedit/combobox.
185 */ 186 */
186 void clear(); 187 void clear();
187 188
188signals: 189signals:
189 // forwards from LineEdit 190 // forwards from LineEdit
190 /** 191 /**
191 * Emitted when the text in the lineedit changes. 192 * Emitted when the text in the lineedit changes.
192 * The parameter contains the contents of the lineedit. 193 * The parameter contains the contents of the lineedit.
193 * @since 3.1 194 * @since 3.1
194 */ 195 */
195 void textChanged( const QString& ); 196 void textChanged( const QString& );
196 197
197 /** 198 /**
198 * Emitted when return or enter was pressed in the lineedit. 199 * Emitted when return or enter was pressed in the lineedit.
199 */ 200 */
200 void returnPressed(); 201 void returnPressed();
201 202
202 /** 203 /**
203 * Emitted when return or enter was pressed in the lineedit. 204 * Emitted when return or enter was pressed in the lineedit.
204 * The parameter contains the contents of the lineedit. 205 * The parameter contains the contents of the lineedit.
205 */ 206 */
206 void returnPressed( const QString& ); 207 void returnPressed( const QString& );
207 208
208 /** 209 /**
209 * Emitted before the filedialog is going to open. Connect 210 * Emitted before the filedialog is going to open. Connect
210 * to this signal to "configure" the filedialog, e.g. set the 211 * to this signal to "configure" the filedialog, e.g. set the
211 * filefilter, the mode, a preview-widget, etc. It's usually 212 * filefilter, the mode, a preview-widget, etc. It's usually
212 * not necessary to set a URL for the filedialog, as it will 213 * not necessary to set a URL for the filedialog, as it will
213 * get set properly from the editfield contents. 214 * get set properly from the editfield contents.
214 * 215 *
215 * If you use multiple KURLRequesters, you can connect all of them 216 * If you use multiple KURLRequesters, you can connect all of them
216 * to the same slot and use the given KURLRequester pointer to know 217 * to the same slot and use the given KURLRequester pointer to know
217 * which one is going to open. 218 * which one is going to open.
218 */ 219 */
219 void openFileDialog( KURLRequester * ); 220 void openFileDialog( KURLRequester * );
220 221
221 /** 222 /**
222 * Emitted when the user changed the URL via the file dialog. 223 * Emitted when the user changed the URL via the file dialog.
223 * The parameter contains the contents of the lineedit. 224 * The parameter contains the contents of the lineedit.
224 */ 225 */
225 void urlSelected( const QString& ); 226 void urlSelected( const QString& );
226 227
227protected: 228protected:
228 void init(); 229 void init();
229 230
230//US KURLCompletion * myCompletion; 231//US KURLCompletion * myCompletion;
231 232
232 233
233private: 234private:
234 KURLDragPushButton * myButton; 235 KURLDragPushButton * myButton;
235 bool myShowLocalProt; 236 bool myShowLocalProt;
236 mutable KFileDialog * myFileDialog; 237 mutable KFileDialog * myFileDialog;
238 bool mPathIsDir;
237 239
238 240
239protected slots: 241protected slots:
240 /** 242 /**
241 * Called when the button is pressed to open the filedialog. 243 * Called when the button is pressed to open the filedialog.
242 * Also called when @ref KStdAccel::Open (default is Ctrl-O) is pressed. 244 * Also called when @ref KStdAccel::Open (default is Ctrl-O) is pressed.
243 */ 245 */
244 void slotOpenDialog(); 246 void slotOpenDialog();
245 247
246private slots: 248private slots:
247 void slotUpdateURL(); 249 void slotUpdateURL();
248 250
249protected: 251protected:
250 virtual void virtual_hook( int id, void* data ); 252 virtual void virtual_hook( int id, void* data );
251private: 253private:
252 class KURLRequesterPrivate; 254 class KURLRequesterPrivate;
253 KURLRequesterPrivate *d; 255 KURLRequesterPrivate *d;
254}; 256};
255/*US 257/*US
256class KURLComboRequester : public KURLRequester // For use in Qt Designer 258class KURLComboRequester : public KURLRequester // For use in Qt Designer
257{ 259{
258 Q_OBJECT 260 Q_OBJECT
259public: 261public:
260*/ 262*/
261 /** 263 /**
262 * Constructs a KURLRequester widget with a combobox. 264 * Constructs a KURLRequester widget with a combobox.
263 */ 265 */
264/*US 266/*US
265 KURLComboRequester( QWidget *parent=0, const char *name=0 ); 267 KURLComboRequester( QWidget *parent=0, const char *name=0 );
266}; 268};
267*/ 269*/
268 270
269#endif // KURLREQUESTER_H 271#endif // KURLREQUESTER_H