summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-03-11 19:26:02 (UTC)
committer zautrix <zautrix>2005-03-11 19:26:02 (UTC)
commit1166a4797a91cedd5002a3513d5028c5e86016f0 (patch) (unidiff)
tree8e7443bc887a15dcf3852abd36e6e61f2e6bddad /korganizer
parent71462ba8ef1803787bba6793f1adb85987eb57df (diff)
downloadkdepimpi-1166a4797a91cedd5002a3513d5028c5e86016f0.zip
kdepimpi-1166a4797a91cedd5002a3513d5028c5e86016f0.tar.gz
kdepimpi-1166a4797a91cedd5002a3513d5028c5e86016f0.tar.bz2
better kopi export
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kolistview.cpp41
-rw-r--r--korganizer/kolistview.h2
2 files changed, 35 insertions, 8 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 710a9f9..f235705 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -220,102 +220,104 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
220 : KOEventView(calendar, parent, name) 220 : KOEventView(calendar, parent, name)
221{ 221{
222 mActiveItem = 0; 222 mActiveItem = 0;
223 mListView = new KOListViewListView(this); 223 mListView = new KOListViewListView(this);
224 mListView->addColumn(i18n("Summary")); 224 mListView->addColumn(i18n("Summary"));
225 mListView->addColumn(i18n("Start Date")); 225 mListView->addColumn(i18n("Start Date"));
226 mListView->addColumn(i18n("Start Time")); 226 mListView->addColumn(i18n("Start Time"));
227 mListView->addColumn(i18n("End Date")); 227 mListView->addColumn(i18n("End Date"));
228 mListView->addColumn(i18n("End Time")); 228 mListView->addColumn(i18n("End Time"));
229 mListView->addColumn(i18n("Alarm")); // alarm set? 229 mListView->addColumn(i18n("Alarm")); // alarm set?
230 mListView->addColumn(i18n("Recurs")); // recurs? 230 mListView->addColumn(i18n("Recurs")); // recurs?
231 mListView->addColumn(i18n("Due Date")); 231 mListView->addColumn(i18n("Due Date"));
232 mListView->addColumn(i18n("Due Time")); 232 mListView->addColumn(i18n("Due Time"));
233 mListView->addColumn(i18n("Cancelled")); 233 mListView->addColumn(i18n("Cancelled"));
234 mListView->addColumn(i18n("Categories")); 234 mListView->addColumn(i18n("Categories"));
235 235
236 mListView->setColumnAlignment(0,AlignLeft); 236 mListView->setColumnAlignment(0,AlignLeft);
237 mListView->setColumnAlignment(1,AlignLeft); 237 mListView->setColumnAlignment(1,AlignLeft);
238 mListView->setColumnAlignment(2,AlignHCenter); 238 mListView->setColumnAlignment(2,AlignHCenter);
239 mListView->setColumnAlignment(3,AlignLeft); 239 mListView->setColumnAlignment(3,AlignLeft);
240 mListView->setColumnAlignment(4,AlignHCenter); 240 mListView->setColumnAlignment(4,AlignHCenter);
241 mListView->setColumnAlignment(5,AlignLeft); 241 mListView->setColumnAlignment(5,AlignLeft);
242 mListView->setColumnAlignment(6,AlignLeft); 242 mListView->setColumnAlignment(6,AlignLeft);
243 mListView->setColumnAlignment(7,AlignLeft); 243 mListView->setColumnAlignment(7,AlignLeft);
244 mListView->setColumnAlignment(8,AlignLeft); 244 mListView->setColumnAlignment(8,AlignLeft);
245 mListView->setColumnAlignment(9,AlignLeft); 245 mListView->setColumnAlignment(9,AlignLeft);
246 mListView->setColumnAlignment(10,AlignLeft); 246 mListView->setColumnAlignment(10,AlignLeft);
247 mListView->setColumnWidthMode(10, QListView::Manual); 247 mListView->setColumnWidthMode(10, QListView::Manual);
248 new KOListViewWhatsThis(mListView->viewport(),this); 248 new KOListViewWhatsThis(mListView->viewport(),this);
249 249
250 int iii = 0; 250 int iii = 0;
251 for ( iii = 0; iii< 10 ; ++iii ) 251 for ( iii = 0; iii< 10 ; ++iii )
252 mListView->setColumnWidthMode( iii, QListView::Manual ); 252 mListView->setColumnWidthMode( iii, QListView::Manual );
253 253
254 QBoxLayout *layoutTop = new QVBoxLayout(this); 254 QBoxLayout *layoutTop = new QVBoxLayout(this);
255 layoutTop->addWidget(mListView); 255 layoutTop->addWidget(mListView);
256 mListView->setFont ( KOPrefs::instance()->mListViewFont ); 256 mListView->setFont ( KOPrefs::instance()->mListViewFont );
257 mPopupMenu = eventPopup(); 257 mPopupMenu = eventPopup();
258 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 258 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
259 i18n("Select all"),this, 259 i18n("Select all"),this,
260 SLOT(allSelection()),true); 260 SLOT(allSelection()),true);
261 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 261 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
262 i18n("Deselect all"),this, 262 i18n("Deselect all"),this,
263 SLOT(clearSelection()),true); 263 SLOT(clearSelection()),true);
264 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 264 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
265 i18n("Delete all selected"),this, 265 i18n("Delete all selected"),this,
266 SLOT(deleteAll()),true); 266 SLOT(deleteAll()),true);
267 mPopupMenu->insertSeparator(); 267 mPopupMenu->insertSeparator();
268 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 268 QPopupMenu * exportPO = new QPopupMenu ( this );
269 i18n("Save selected to file..."),this, 269 mPopupMenu->insertItem( i18n("Export selected"), exportPO );
270 SLOT(saveToFile()),true); 270 exportPO->insertItem( i18n("As iCal (ics) file..."),this,
271 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 271 SLOT(saveToFile()));
272 i18n("Save Journal/Description..."),this, 272 exportPO->insertItem( i18n("As vCal (vcs) file..."),this,
273 SLOT(saveDescriptionToFile()),true); 273 SLOT(saveToFileVCS()));
274 exportPO->insertItem( i18n("Journal/Details..."),this,
275 SLOT(saveDescriptionToFile()));
274 // mPopupMenu->insertSeparator(); 276 // mPopupMenu->insertSeparator();
275 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 277 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
276 i18n("Add Categ. to selected..."),this, 278 i18n("Add Categ. to selected..."),this,
277 SLOT(addCat()),true); 279 SLOT(addCat()),true);
278 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 280 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
279 i18n("Set Categ. for selected..."),this, 281 i18n("Set Categ. for selected..."),this,
280 SLOT(setCat()),true); 282 SLOT(setCat()),true);
281 //mPopupMenu->insertSeparator(); 283 //mPopupMenu->insertSeparator();
282 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 284 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
283 i18n("Set alarm for selected..."),this, 285 i18n("Set alarm for selected..."),this,
284 SLOT(setAlarm()),true); 286 SLOT(setAlarm()),true);
285 287
286 288
287#ifndef DESKTOP_VERSION 289#ifndef DESKTOP_VERSION
288 mPopupMenu->insertSeparator(); 290 mPopupMenu->insertSeparator();
289 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 291 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
290 i18n("Beam selected via IR"),this, 292 i18n("Beam selected via IR"),this,
291 SLOT(beamSelected()),true); 293 SLOT(beamSelected()),true);
292#endif 294#endif
293 /* 295 /*
294 mPopupMenu = new QPopupMenu; 296 mPopupMenu = new QPopupMenu;
295 mPopupMenu->insertItem(i18n("Edit Event"), this, 297 mPopupMenu->insertItem(i18n("Edit Event"), this,
296 SLOT (editEvent())); 298 SLOT (editEvent()));
297 mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, 299 mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this,
298 SLOT (deleteEvent())); 300 SLOT (deleteEvent()));
299 mPopupMenu->insertSeparator(); 301 mPopupMenu->insertSeparator();
300 mPopupMenu->insertItem(i18n("Show Dates"), this, 302 mPopupMenu->insertItem(i18n("Show Dates"), this,
301 SLOT(showDates())); 303 SLOT(showDates()));
302 mPopupMenu->insertItem(i18n("Hide Dates"), this, 304 mPopupMenu->insertItem(i18n("Hide Dates"), this,
303 SLOT(hideDates())); 305 SLOT(hideDates()));
304 */ 306 */
305 QObject::connect(mListView,SIGNAL( newEvent()), 307 QObject::connect(mListView,SIGNAL( newEvent()),
306 this,SIGNAL(signalNewEvent())); 308 this,SIGNAL(signalNewEvent()));
307 QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), 309 QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)),
308 this,SLOT(defaultItemAction(QListViewItem *))); 310 this,SLOT(defaultItemAction(QListViewItem *)));
309 QObject::connect(mListView,SIGNAL(rightButtonClicked ( QListViewItem *, 311 QObject::connect(mListView,SIGNAL(rightButtonClicked ( QListViewItem *,
310 const QPoint &, int )), 312 const QPoint &, int )),
311 this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); 313 this,SLOT(popupMenu(QListViewItem *,const QPoint &,int)));
312 QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), 314 QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)),
313 SLOT(processSelectionChange(QListViewItem *))); 315 SLOT(processSelectionChange(QListViewItem *)));
314 QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), 316 QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)),
315 SIGNAL(showIncidenceSignal(Incidence *)) ); 317 SIGNAL(showIncidenceSignal(Incidence *)) );
316 318
317 readSettings(KOGlobals::config(),"KOListView Layout"); 319 readSettings(KOGlobals::config(),"KOListView Layout");
318} 320}
319 321
320KOListView::~KOListView() 322KOListView::~KOListView()
321{ 323{
@@ -561,139 +563,162 @@ void KOListView::saveDescriptionToFile()
561 } 563 }
562 } 564 }
563 if ( createbup ) { 565 if ( createbup ) {
564 QString text = i18n("KO/Pi Description/Journal save file.\nSave date: ") + 566 QString text = i18n("KO/Pi Description/Journal save file.\nSave date: ") +
565 KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), false); 567 KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), false);
566 Incidence *incidence = delSel.first(); 568 Incidence *incidence = delSel.first();
567 icount = 0; 569 icount = 0;
568 while ( incidence ) { 570 while ( incidence ) {
569 if ( incidence->type() == "Journal" ) { 571 if ( incidence->type() == "Journal" ) {
570 text += "\n************************************\n"; 572 text += "\n************************************\n";
571 text += i18n("Journal from: ") +incidence->dtStartDateStr( false ); 573 text += i18n("Journal from: ") +incidence->dtStartDateStr( false );
572 text +="\n" + i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false); 574 text +="\n" + i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false);
573 text +="\n" + i18n("Description: ") + "\n"+ incidence->description(); 575 text +="\n" + i18n("Description: ") + "\n"+ incidence->description();
574 ++icount; 576 ++icount;
575 577
576 } else { 578 } else {
577 if ( !incidence->description().isEmpty() ) { 579 if ( !incidence->description().isEmpty() ) {
578 text += "\n************************************\n"; 580 text += "\n************************************\n";
579 if ( incidence->type() == "Todo" ) 581 if ( incidence->type() == "Todo" )
580 text += i18n("To-Do: "); 582 text += i18n("To-Do: ");
581 text += incidence->summary(); 583 text += incidence->summary();
582 if ( incidence->hasStartDate() ) 584 if ( incidence->hasStartDate() )
583 text +="\n"+ i18n("Start Date: ") + incidence->dtStartStr( false ); 585 text +="\n"+ i18n("Start Date: ") + incidence->dtStartStr( false );
584 text +="\n"+ i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false); 586 text +="\n"+ i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false);
585 if ( !incidence->location().isEmpty() ) 587 if ( !incidence->location().isEmpty() )
586 text += "\n" +i18n("Location: ") + incidence->location(); 588 text += "\n" +i18n("Location: ") + incidence->location();
587 text += "\n" + i18n("Description: ") + "\n" + incidence->description(); 589 text += "\n" + i18n("Description: ") + "\n" + incidence->description();
588 ++icount; 590 ++icount;
589 591
590 } 592 }
591 } 593 }
592 incidence = delSel.next(); 594 incidence = delSel.next();
593 } 595 }
594 QFile file( fn ); 596 QFile file( fn );
595 if (!file.open( IO_WriteOnly ) ) { 597 if (!file.open( IO_WriteOnly ) ) {
596 topLevelWidget()->setCaption(i18n("File open error - nothing saved!") ); 598 topLevelWidget()->setCaption(i18n("File open error - nothing saved!") );
597 return; 599 return;
598 } 600 }
599 QTextStream ts( &file ); 601 QTextStream ts( &file );
600 ts << text; 602 ts << text;
601 file.close(); 603 file.close();
602 //qDebug("%s ", text.latin1()); 604 //qDebug("%s ", text.latin1());
603 mes = i18n("KO/Pi:Saved %1 descriptions/journals").arg(icount ); 605 mes = i18n("KO/Pi:Saved %1 descriptions/journals").arg(icount );
604 KOPrefs::instance()->mLastSaveFile = fn; 606 KOPrefs::instance()->mLastSaveFile = fn;
605 topLevelWidget()->setCaption(mes); 607 topLevelWidget()->setCaption(mes);
606 } 608 }
607 } 609 }
608} 610}
611void KOListView::saveToFileVCS()
612{
613 writeToFile( false );
614}
609void KOListView::saveToFile() 615void KOListView::saveToFile()
610{ 616{
617 writeToFile( true );
618}
619void KOListView::writeToFile( bool iCal )
620{
611 621
612 int icount = 0; 622 int icount = 0;
613 QPtrList<Incidence> delSel ; 623 QPtrList<Incidence> delSel ;
614 QListViewItem *item = mListView->firstChild (); 624 QListViewItem *item = mListView->firstChild ();
615 while ( item ) { 625 while ( item ) {
616 if ( item->isSelected() ) { 626 if ( item->isSelected() ) {
617 delSel.append(((KOListViewItem *)item)->data()); 627 delSel.append(((KOListViewItem *)item)->data());
618 ++icount; 628 ++icount;
619 } 629 }
620 630
621 item = item->nextSibling(); 631 item = item->nextSibling();
622 } 632 }
623 if ( icount ) { 633 if ( icount ) {
624 QString fn = KOPrefs::instance()->mLastSaveFile; 634 QString fn = KOPrefs::instance()->mLastSaveFile;
635 QString extension;
636 if ( iCal ) {
637 if ( fn.right( 4 ).lower() == ".vcs" ) {
638 fn = fn.left( fn.length() -3) + "ics";
639 }
640 } else {
641 if ( fn.right( 4 ).lower() == ".ics" ) {
642 fn = fn.left( fn.length() -3) + "vcs";
643 }
644 }
625 fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this ); 645 fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this );
626 646
627 if ( fn == "" ) 647 if ( fn == "" )
628 return; 648 return;
629 QFileInfo info; 649 QFileInfo info;
630 info.setFile( fn ); 650 info.setFile( fn );
631 QString mes; 651 QString mes;
632 bool createbup = true; 652 bool createbup = true;
633 if ( info. exists() ) { 653 if ( info. exists() ) {
634 mes = i18n("File already exists!\nOld file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); 654 mes = i18n("File already exists!\nOld file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) );
635 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, 655 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
636 i18n("Overwrite!"), i18n("Cancel"), 0, 656 i18n("Overwrite!"), i18n("Cancel"), 0,
637 0, 1 ); 657 0, 1 );
638 if ( result != 0 ) { 658 if ( result != 0 ) {
639 createbup = false; 659 createbup = false;
640 } 660 }
641 } 661 }
642 if ( createbup ) { 662 if ( createbup ) {
643 CalendarLocal cal; 663 CalendarLocal cal;
644 cal.setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 664 cal.setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
645 Incidence *incidence = delSel.first(); 665 Incidence *incidence = delSel.first();
646 while ( incidence ) { 666 while ( incidence ) {
647 cal.addIncidence( incidence->clone() ); 667 cal.addIncidence( incidence->clone() );
648 incidence = delSel.next(); 668 incidence = delSel.next();
649 } 669 }
650 ICalFormat format; 670 if ( iCal ) {
651 format.save( &cal, fn ); 671 ICalFormat format;
672 format.save( &cal, fn );
673 } else {
674 VCalFormat format;
675 format.save( &cal, fn );
676 }
652 mes = i18n("KO/Pi:Saved %1").arg(fn ); 677 mes = i18n("KO/Pi:Saved %1").arg(fn );
653 KOPrefs::instance()->mLastSaveFile = fn; 678 KOPrefs::instance()->mLastSaveFile = fn;
654 topLevelWidget()->setCaption(mes); 679 topLevelWidget()->setCaption(mes);
655 } 680 }
656 } 681 }
657} 682}
658void KOListView::deleteAll() 683void KOListView::deleteAll()
659{ 684{
660 int icount = 0; 685 int icount = 0;
661 QPtrList<Incidence> delSel ; 686 QPtrList<Incidence> delSel ;
662 QListViewItem *item = mListView->firstChild (); 687 QListViewItem *item = mListView->firstChild ();
663 while ( item ) { 688 while ( item ) {
664 if ( item->isSelected() ) { 689 if ( item->isSelected() ) {
665 delSel.append(((KOListViewItem *)item)->data()); 690 delSel.append(((KOListViewItem *)item)->data());
666 ++icount; 691 ++icount;
667 } 692 }
668 693
669 item = item->nextSibling(); 694 item = item->nextSibling();
670 } 695 }
671 if ( icount ) { 696 if ( icount ) {
672 Incidence *incidence = delSel.first(); 697 Incidence *incidence = delSel.first();
673 Incidence *toDelete; 698 Incidence *toDelete;
674 KOPrefs *p = KOPrefs::instance(); 699 KOPrefs *p = KOPrefs::instance();
675 bool confirm = p->mConfirm; 700 bool confirm = p->mConfirm;
676 QString mess; 701 QString mess;
677 mess = mess.sprintf( i18n("You have %d item(s) selected.\n"), icount ); 702 mess = mess.sprintf( i18n("You have %d item(s) selected.\n"), icount );
678 if ( KMessageBox::Continue == KMessageBox::warningContinueCancel(this, mess + i18n("All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n"), i18n("KO/Pi Confirmation"),i18n("Delete")) ) { 703 if ( KMessageBox::Continue == KMessageBox::warningContinueCancel(this, mess + i18n("All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n"), i18n("KO/Pi Confirmation"),i18n("Delete")) ) {
679 p->mConfirm = false; 704 p->mConfirm = false;
680 int delCounter = 0; 705 int delCounter = 0;
681 QDialog dia ( this, "p-dialog", true ); 706 QDialog dia ( this, "p-dialog", true );
682 QLabel lab (i18n("Close dialog to abort deletion!"), &dia ); 707 QLabel lab (i18n("Close dialog to abort deletion!"), &dia );
683 QVBoxLayout lay( &dia ); 708 QVBoxLayout lay( &dia );
684 lay.setMargin(7); 709 lay.setMargin(7);
685 lay.setSpacing(7); 710 lay.setSpacing(7);
686 lay.addWidget( &lab); 711 lay.addWidget( &lab);
687 QProgressBar bar( icount, &dia ); 712 QProgressBar bar( icount, &dia );
688 lay.addWidget( &bar); 713 lay.addWidget( &bar);
689 int w = 220; 714 int w = 220;
690 int h = 50; 715 int h = 50;
691 int dw = QApplication::desktop()->width(); 716 int dw = QApplication::desktop()->width();
692 int dh = QApplication::desktop()->height(); 717 int dh = QApplication::desktop()->height();
693 dia.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 718 dia.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
694 //dia.resize( 240,50 ); 719 //dia.resize( 240,50 );
695 dia.show(); 720 dia.show();
696 721
697 while ( incidence ) { 722 while ( incidence ) {
698 bar.setProgress( delCounter ); 723 bar.setProgress( delCounter );
699 mess = mess.sprintf( i18n("Deleting item %d ..."), ++delCounter ); 724 mess = mess.sprintf( i18n("Deleting item %d ..."), ++delCounter );
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h
index c86449d..0d9c525 100644
--- a/korganizer/kolistview.h
+++ b/korganizer/kolistview.h
@@ -227,78 +227,80 @@ class KOListViewListView : public KListView
227 bool mMouseDown; 227 bool mMouseDown;
228 int mYMousePos; 228 int mYMousePos;
229}; 229};
230 230
231class KOListView : public KOEventView 231class KOListView : public KOEventView
232{ 232{
233 Q_OBJECT 233 Q_OBJECT
234 public: 234 public:
235 KOListView(Calendar *calendar, QWidget *parent = 0, 235 KOListView(Calendar *calendar, QWidget *parent = 0,
236 const char *name = 0); 236 const char *name = 0);
237 ~KOListView(); 237 ~KOListView();
238 238
239 virtual int maxDatesHint(); 239 virtual int maxDatesHint();
240 virtual int currentDateCount(); 240 virtual int currentDateCount();
241 virtual QPtrList<Incidence> selectedIncidences(); 241 virtual QPtrList<Incidence> selectedIncidences();
242 virtual DateList selectedDates(); 242 virtual DateList selectedDates();
243 243
244 void showDates(bool show); 244 void showDates(bool show);
245 Incidence* currentItem(); 245 Incidence* currentItem();
246 void addTodos(QPtrList<Todo> eventList); 246 void addTodos(QPtrList<Todo> eventList);
247 void addJournals(QPtrList<Journal> eventList); 247 void addJournals(QPtrList<Journal> eventList);
248 virtual void printPreview(CalPrinter *calPrinter, 248 virtual void printPreview(CalPrinter *calPrinter,
249 const QDate &, const QDate &); 249 const QDate &, const QDate &);
250 250
251 void readSettings(KConfig *config, QString setting = "KOListView Layout"); 251 void readSettings(KConfig *config, QString setting = "KOListView Layout");
252 void writeSettings(KConfig *config, QString setting = "KOListView Layout"); 252 void writeSettings(KConfig *config, QString setting = "KOListView Layout");
253 void updateList(); 253 void updateList();
254 void setStartDate(const QDate &start); 254 void setStartDate(const QDate &start);
255 int count(); 255 int count();
256 QString getWhatsThisText(QPoint p); 256 QString getWhatsThisText(QPoint p);
257 void resetFocus(); 257 void resetFocus();
258 signals: 258 signals:
259 void signalNewEvent(); 259 void signalNewEvent();
260 void beamIncidenceList(QPtrList<Incidence>); 260 void beamIncidenceList(QPtrList<Incidence>);
261 261
262 public slots: 262 public slots:
263 virtual void updateView(); 263 virtual void updateView();
264 virtual void showDates(const QDate &start, const QDate &end); 264 virtual void showDates(const QDate &start, const QDate &end);
265 virtual void showEvents(QPtrList<Event> eventList); 265 virtual void showEvents(QPtrList<Event> eventList);
266 void clearSelection(); 266 void clearSelection();
267 void allSelection(); 267 void allSelection();
268 268
269 void clear(); 269 void clear();
270 void beamDone( Ir *ir ); 270 void beamDone( Ir *ir );
271 void showDates(); 271 void showDates();
272 void hideDates(); 272 void hideDates();
273 void deleteAll(); 273 void deleteAll();
274 void saveToFile(); 274 void saveToFile();
275 void saveToFileVCS();
275 void saveDescriptionToFile(); 276 void saveDescriptionToFile();
276 void beamSelected(); 277 void beamSelected();
277 void updateConfig(); 278 void updateConfig();
278 void addCat(); 279 void addCat();
279 void setCat(); 280 void setCat();
280 void setAlarm(); 281 void setAlarm();
281 void setCategories( bool removeOld ); 282 void setCategories( bool removeOld );
282 void changeEventDisplay(Event *, int); 283 void changeEventDisplay(Event *, int);
283 284
284 void defaultItemAction(QListViewItem *item); 285 void defaultItemAction(QListViewItem *item);
285 void popupMenu(QListViewItem *item,const QPoint &,int); 286 void popupMenu(QListViewItem *item,const QPoint &,int);
286 287
287 protected slots: 288 protected slots:
288 void processSelectionChange(QListViewItem *); 289 void processSelectionChange(QListViewItem *);
289 290
290 protected: 291 protected:
292 void writeToFile( bool iCal );
291 void addEvents(QPtrList<Event> eventList); 293 void addEvents(QPtrList<Event> eventList);
292 void addIncidence(Incidence *); 294 void addIncidence(Incidence *);
293 KOListViewItem *getItemForEvent(Event *event); 295 KOListViewItem *getItemForEvent(Event *event);
294 296
295 private: 297 private:
296 KOListViewListView *mListView; 298 KOListViewListView *mListView;
297 KOEventPopupMenu *mPopupMenu; 299 KOEventPopupMenu *mPopupMenu;
298 KOListViewItem *mActiveItem; 300 KOListViewItem *mActiveItem;
299 QDict<Incidence> mUidDict; 301 QDict<Incidence> mUidDict;
300 QDate mStartDate; 302 QDate mStartDate;
301 void keyPressEvent ( QKeyEvent * ) ; 303 void keyPressEvent ( QKeyEvent * ) ;
302}; 304};
303 305
304#endif 306#endif