summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.cpp
Unidiff
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 66bb19b..69ccde1 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -353,50 +353,52 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) :
353 //int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 353 //int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
354 //qDebug("KO: Calendar loading time: %d ms",msNeeded ); 354 //qDebug("KO: Calendar loading time: %d ms",msNeeded );
355 355
356 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { 356 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) {
357 KOPrefs::instance()->setAllDefaults(); 357 KOPrefs::instance()->setAllDefaults();
358 } 358 }
359 359
360 360
361 connect( mView, SIGNAL( tempDisableBR(bool) ), 361 connect( mView, SIGNAL( tempDisableBR(bool) ),
362 SLOT( disableBR(bool) ) ); 362 SLOT( disableBR(bool) ) );
363 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); 363 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
364 setCentralWidget( mView ); 364 setCentralWidget( mView );
365 globalFlagBlockStartup = 0; 365 globalFlagBlockStartup = 0;
366 //mView->show(); 366 //mView->show();
367 //delete splash; 367 //delete splash;
368 if ( newFile ) 368 if ( newFile )
369 mView->updateConfig(); 369 mView->updateConfig();
370 // qApp->processEvents(); 370 // qApp->processEvents();
371 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 371 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
372 //fillSyncMenu(); 372 //fillSyncMenu();
373 373
374 374
375 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); 375 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) );
376 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); 376 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) );
377 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); 377 connect(mSyncManager , SIGNAL( request_file(const QString &) ), this, SLOT( syncFileRequest(const QString &) ) );
378 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 378 connect(mSyncManager , SIGNAL( getFile( bool, const QString &)), this, SLOT(getFile( bool,const QString & ) ) );
379 connect(mSyncManager , SIGNAL( multiResourceSyncStart( bool )), mView, SLOT( multiResourceSyncStart( bool ) ) );
380
379 mSyncManager->setDefaultFileName( sentSyncFile()); 381 mSyncManager->setDefaultFileName( sentSyncFile());
380 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); 382 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) );
381 mSyncManager->fillSyncMenu(); 383 mSyncManager->fillSyncMenu();
382 384
383 385
384 386
385 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); 387 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins );
386 if ( showWarning ) { 388 if ( showWarning ) {
387 KMessageBox::information( this, 389 KMessageBox::information( this,
388 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); 390 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information");
389 //qApp->processEvents(); 391 //qApp->processEvents();
390 mView->dialogManager()->showSyncOptions(); 392 mView->dialogManager()->showSyncOptions();
391 } 393 }
392 394
393 //US listen for result adressed from Ka/Pi 395 //US listen for result adressed from Ka/Pi
394 396
395#ifndef DESKTOP_VERSION 397#ifndef DESKTOP_VERSION
396 infrared = 0; 398 infrared = 0;
397#endif 399#endif
398 updateFilterToolbar(); 400 updateFilterToolbar();
399 updateWeek( mView->startDate() ); 401 updateWeek( mView->startDate() );
400 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 402 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
401 SLOT( updateWeekNum( const KCal::DateList & ) ) ); 403 SLOT( updateWeekNum( const KCal::DateList & ) ) );
402 mBRdisabled = false; 404 mBRdisabled = false;
@@ -2683,72 +2685,72 @@ void MainWindow::exportCalendar( bool iCalFormat )
2683 else 2685 else
2684 mes = i18n("KO/Pi:Exported to %1").arg(fn ); 2686 mes = i18n("KO/Pi:Exported to %1").arg(fn );
2685 setCaption(mes); 2687 setCaption(mes);
2686 } 2688 }
2687 } 2689 }
2688 2690
2689} 2691}
2690void MainWindow::exportICalendar() 2692void MainWindow::exportICalendar()
2691{ 2693{
2692 exportCalendar( true ); 2694 exportCalendar( true );
2693} 2695}
2694void MainWindow::exportVCalendar() 2696void MainWindow::exportVCalendar()
2695{ 2697{
2696 exportCalendar( false ); 2698 exportCalendar( false );
2697} 2699}
2698QString MainWindow::sentSyncFile() 2700QString MainWindow::sentSyncFile()
2699{ 2701{
2700#ifdef DESKTOP_VERSION 2702#ifdef DESKTOP_VERSION
2701 return QDir::convertSeparators( locateLocal( "tmp", "copysynccal.ics" ) ); 2703 return QDir::convertSeparators( locateLocal( "tmp", "copysynccal.ics" ) );
2702#else 2704#else
2703 return QString( "/tmp/copysynccal.ics" ); 2705 return QString( "/tmp/copysynccal.ics" );
2704#endif 2706#endif
2705} 2707}
2706 2708
2707void MainWindow::syncFileRequest() 2709void MainWindow::syncFileRequest(const QString& resource)
2708{ 2710{
2709 while ( mSyncManager->blockSave() ) { 2711 while ( mSyncManager->blockSave() ) {
2710 qApp->processEvents(); 2712 qApp->processEvents();
2711 } 2713 }
2712 mSyncManager->setBlockSave(true); 2714 mSyncManager->setBlockSave(true);
2713 2715
2714 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 2716 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
2715 mSyncManager->slotSyncMenu( 999 ); 2717 mSyncManager->slotSyncMenu( 999 );
2716 } 2718 }
2717 2719
2718 setCaption(i18n("Saving Data to temp file ..." )); 2720 setCaption(i18n("Saving Data to temp file ..." ));
2719 mView->saveCalendar( sentSyncFile() ); 2721 mView->saveCalendarResource( sentSyncFile(), resource );
2720 setCaption(i18n("Data saved to temp file!" )); 2722 setCaption(i18n("Data saved to temp file!" ));
2721 mSyncManager->setBlockSave( false ); 2723 mSyncManager->setBlockSave( false );
2722 2724
2723} 2725}
2724void MainWindow::getFile( bool success ) 2726void MainWindow::getFile( bool success ,const QString& resource)
2725{ 2727{
2726 if ( ! success ) { 2728 if ( ! success ) {
2727 setCaption( i18n("Error receiving file. Nothing changed!") ); 2729 setCaption( i18n("Error receiving file. Nothing changed!") );
2728 return; 2730 return;
2729 } 2731 }
2730 mView->mergeFile( sentSyncFile() ); 2732 mView->mergeFileResource( sentSyncFile(), resource);
2731 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 2733 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
2732 mSyncManager->slotSyncMenu( 999 ); 2734 mSyncManager->slotSyncMenu( 999 );
2733 } 2735 }
2734 setCaption( i18n("Pi-Sync successful!") ); 2736 setCaption( i18n("Pi-Sync successful!") );
2735} 2737}
2736void MainWindow::printListView() 2738void MainWindow::printListView()
2737{ 2739{
2738 2740
2739 QString message = i18n("You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items."); 2741 QString message = i18n("You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items.");
2740 2742
2741 KMessageBox::information( this, message); 2743 KMessageBox::information( this, message);
2742} 2744}
2743void MainWindow::printSel( ) 2745void MainWindow::printSel( )
2744{ 2746{
2745 mView->viewManager()->agendaView()->agenda()->printSelection(); 2747 mView->viewManager()->agendaView()->agenda()->printSelection();
2746} 2748}
2747 2749
2748void MainWindow::printCal() 2750void MainWindow::printCal()
2749{ 2751{
2750 mView->print();//mCp->showDialog(); 2752 mView->print();//mCp->showDialog();
2751} 2753}
2752 2754
2753 2755
2754#include "libkdepim/kdatepicker.h" 2756#include "libkdepim/kdatepicker.h"