summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Unidiff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 1f2c6da..3e0a27d 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2302,78 +2302,86 @@ void CalendarView::beamFilteredCalendar()
2302void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) 2302void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
2303{ 2303{
2304 if ( beamDialog->exec () == QDialog::Rejected ) 2304 if ( beamDialog->exec () == QDialog::Rejected )
2305 return; 2305 return;
2306 2306
2307 QString fn = "/tmp/kopibeamfile"; 2307 QString fn = "/tmp/kopibeamfile";
2308 QString mes; 2308 QString mes;
2309 bool createbup = true; 2309 bool createbup = true;
2310 if ( createbup ) { 2310 if ( createbup ) {
2311 QString description = "\n"; 2311 QString description = "\n";
2312 CalendarLocal* cal = new CalendarLocal(); 2312 CalendarLocal* cal = new CalendarLocal();
2313 if ( beamDialog->beamLocal() ) 2313 if ( beamDialog->beamLocal() )
2314 cal->setLocalTime(); 2314 cal->setLocalTime();
2315 else 2315 else
2316 cal->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); 2316 cal->setTimeZoneId(KOPrefs::instance()->mTimeZoneId);
2317 Incidence *incidence = delSel.first(); 2317 Incidence *incidence = delSel.first();
2318 bool addText = false; 2318 bool addText = false;
2319 if ( delSel.count() < 10 ) 2319 if ( delSel.count() < 10 )
2320 addText = true; 2320 addText = true;
2321 else { 2321 else {
2322 description.sprintf(i18n(" %d items?"),delSel.count() ); 2322 description.sprintf(i18n(" %d items?"),delSel.count() );
2323 } 2323 }
2324 while ( incidence ) { 2324 while ( incidence ) {
2325 Incidence *in = incidence->clone(); 2325 Incidence *in = incidence->clone();
2326 if ( ! in->summary().isEmpty() ) {
2327 in->setDescription("");
2328 } else {
2329 in->setSummary( in->description().left(20));
2330 in->setDescription("");
2331 }
2326 if ( addText ) 2332 if ( addText )
2327 description += in->summary() + "\n"; 2333 description += in->summary() + "\n";
2328 cal->addIncidence( in ); 2334 cal->addIncidence( in );
2329 incidence = delSel.next(); 2335 incidence = delSel.next();
2330 } 2336 }
2331 if ( beamDialog->beamVcal() ) { 2337 if ( beamDialog->beamVcal() ) {
2332 fn += ".vcs"; 2338 fn += ".vcs";
2333 FileStorage storage( cal, fn, new VCalFormat ); 2339 FileStorage storage( cal, fn, new VCalFormat );
2334 storage.save(); 2340 storage.save();
2335 } else { 2341 } else {
2336 fn += ".ics"; 2342 fn += ".ics";
2337 FileStorage storage( cal, fn, new ICalFormat( ) ); 2343 FileStorage storage( cal, fn, new ICalFormat( ) );
2338 storage.save(); 2344 storage.save();
2339 } 2345 }
2340 delete cal; 2346 delete cal;
2341 mes = i18n("KO/Pi: Ready for beaming"); 2347 mes = i18n("KO/Pi: Ready for beaming");
2342 setCaption(mes); 2348 topLevelWidget()->setCaption(mes);
2343 2349 KApplication::convert2latin1( fn );
2344#ifndef DESKTOP_VERSION 2350#ifndef DESKTOP_VERSION
2345 Ir *ir = new Ir( this ); 2351 Ir *ir = new Ir( this );
2346 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 2352 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
2347 ir->send( fn, description, "text/x-vCalendar" ); 2353 ir->send( fn, description, "text/x-vCalendar" );
2348#endif 2354#endif
2349 } 2355 }
2350} 2356}
2351void CalendarView::beamDone( Ir *ir ) 2357void CalendarView::beamDone( Ir *ir )
2352{ 2358{
2353#ifndef DESKTOP_VERSION 2359#ifndef DESKTOP_VERSION
2354 delete ir; 2360 delete ir;
2355#endif 2361#endif
2362 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") );
2363 topLevelWidget()->raise();
2356} 2364}
2357 2365
2358void CalendarView::moveIncidence(Incidence * inc ) 2366void CalendarView::moveIncidence(Incidence * inc )
2359{ 2367{
2360 if ( !inc ) return; 2368 if ( !inc ) return;
2361 // qDebug("showDatePickerForIncidence( ) "); 2369 // qDebug("showDatePickerForIncidence( ) ");
2362 if ( mDateFrame->isVisible() ) 2370 if ( mDateFrame->isVisible() )
2363 mDateFrame->hide(); 2371 mDateFrame->hide();
2364 else { 2372 else {
2365 int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ; 2373 int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ;
2366 int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ; 2374 int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ;
2367 int dw = QApplication::desktop()->width(); 2375 int dw = QApplication::desktop()->width();
2368 int dh = QApplication::desktop()->height(); 2376 int dh = QApplication::desktop()->height();
2369 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2377 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2370 mDateFrame->show(); 2378 mDateFrame->show();
2371 } 2379 }
2372 mDatePickerMode = 2; 2380 mDatePickerMode = 2;
2373 mMoveIncidence = inc ; 2381 mMoveIncidence = inc ;
2374 QDate da; 2382 QDate da;
2375 if ( mMoveIncidence->type() == "Todo" ) { 2383 if ( mMoveIncidence->type() == "Todo" ) {
2376 Todo * to = (Todo *) mMoveIncidence; 2384 Todo * to = (Todo *) mMoveIncidence;
2377 if ( to->hasDueDate() ) 2385 if ( to->hasDueDate() )
2378 da = to->dtDue().date(); 2386 da = to->dtDue().date();
2379 else 2387 else