summaryrefslogtreecommitdiffabout
path: root/korganizer/kowhatsnextview.cpp
Unidiff
Diffstat (limited to 'korganizer/kowhatsnextview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kowhatsnextview.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 5f14bfa..219f7c3 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -90,49 +90,65 @@ KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent,
90 connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); 90 connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer()));
91} 91}
92 92
93KOWhatsNextView::~KOWhatsNextView() 93KOWhatsNextView::~KOWhatsNextView()
94{ 94{
95} 95}
96 96
97int KOWhatsNextView::maxDatesHint() 97int KOWhatsNextView::maxDatesHint()
98{ 98{
99 return 0; 99 return 0;
100} 100}
101 101
102int KOWhatsNextView::currentDateCount() 102int KOWhatsNextView::currentDateCount()
103{ 103{
104 return 0; 104 return 0;
105} 105}
106 106
107QPtrList<Incidence> KOWhatsNextView::selectedIncidences() 107QPtrList<Incidence> KOWhatsNextView::selectedIncidences()
108{ 108{
109 QPtrList<Incidence> eventList; 109 QPtrList<Incidence> eventList;
110 110
111 return eventList; 111 return eventList;
112} 112}
113 113
114 114void KOWhatsNextView::printMe()
115{
116#ifdef DESKTOP_VERSION
117 QPrinter printer;
118 if (!printer.setup() )
119 return;
120 QTextBrowser tb;
121 tb.setFixedSize( 600, 4000 );
122 QPainter::redirect ( tb.viewport(), &printer );
123 updateView();
124 tb.setText( mText );
125 tb.show();
126 tb.repaint();
127 tb.hide();
128 KMessageBox::information( this, i18n("Printing What's Next View!\n\nPlease close after\nprinting is finished."));
129#endif
130}
115void KOWhatsNextView::printPreview(CalPrinter *calPrinter, const QDate &fd, 131void KOWhatsNextView::printPreview(CalPrinter *calPrinter, const QDate &fd,
116 const QDate &td) 132 const QDate &td)
117{ 133{
118#ifndef KORG_NOPRINTER 134#ifndef KORG_NOPRINTER
119 calPrinter->preview(CalPrinter::Day, fd, td); 135 calPrinter->preview(CalPrinter::Day, fd, td);
120#endif 136#endif
121} 137}
122void KOWhatsNextView::updateConfig() 138void KOWhatsNextView::updateConfig()
123{ 139{
124 setFont( KOPrefs::instance()->mWhatsNextFont ); 140 setFont( KOPrefs::instance()->mWhatsNextFont );
125 updateView(); 141 updateView();
126 142
127} 143}
128void KOWhatsNextView::showEvent ( QShowEvent * e ) 144void KOWhatsNextView::showEvent ( QShowEvent * e )
129{ 145{
130 //qDebug("KOWhatsNextView::showEvent "); 146 //qDebug("KOWhatsNextView::showEvent ");
131 restartTimer(); 147 restartTimer();
132 QWidget::showEvent ( e ); 148 QWidget::showEvent ( e );
133} 149}
134void KOWhatsNextView::hideEvent ( QHideEvent * e) 150void KOWhatsNextView::hideEvent ( QHideEvent * e)
135{ 151{
136 //qDebug(" KOWhatsNextView::hideEvent"); 152 //qDebug(" KOWhatsNextView::hideEvent");
137 mTimer->stop(); 153 mTimer->stop();
138 QWidget::hideEvent ( e ); 154 QWidget::hideEvent ( e );
@@ -653,48 +669,49 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub )
653 if (!((Todo*)to)->isCompleted()) 669 if (!((Todo*)to)->isCompleted())
654 appendTodo( to, ind , true ); 670 appendTodo( to, ind , true );
655 } 671 }
656 672
657 return true; 673 return true;
658} 674}
659 675
660/* 676/*
661 void KOWhatsNextView::createEventViewer() 677 void KOWhatsNextView::createEventViewer()
662 { 678 {
663 if (!mEventViewer) { 679 if (!mEventViewer) {
664 680
665 mEventViewer = new KOEventViewerDialog(this); 681 mEventViewer = new KOEventViewerDialog(this);
666 } 682 }
667 } 683 }
668*/ 684*/
669void KOWhatsNextView::setEventViewer(KOEventViewerDialog* v ) 685void KOWhatsNextView::setEventViewer(KOEventViewerDialog* v )
670{ 686{
671 mEventViewer = v; 687 mEventViewer = v;
672} 688}
673 689
674// TODO: Create this function in CalendarView and remove it from here 690// TODO: Create this function in CalendarView and remove it from here
675void KOWhatsNextView::showIncidence(const QString &uid) 691void KOWhatsNextView::showIncidence(const QString &uid)
676{ 692{
693
677 if ( !mEventViewer ) { 694 if ( !mEventViewer ) {
678 qDebug("KOWhatsNextView::showIncidence::sorry, no event viewer set "); 695 qDebug("KOWhatsNextView::showIncidence::sorry, no event viewer set ");
679 return; 696 return;
680 } 697 }
681 //kdDebug() << "KOWhatsNextView::showIncidence(): " << uid << endl; 698 //kdDebug() << "KOWhatsNextView::showIncidence(): " << uid << endl;
682 //qDebug("KOWhatsNextView::showIncidence %s ", uid.latin1()); 699 //qDebug("KOWhatsNextView::showIncidence %s ", uid.latin1());
683 if (uid.startsWith("event:")) { 700 if (uid.startsWith("event:")) {
684#ifdef DESKTOP_VERSION 701#ifdef DESKTOP_VERSION
685 Event *event = calendar()->event(uid.mid(8)); 702 Event *event = calendar()->event(uid.mid(8));
686#else 703#else
687 Event *event = calendar()->event(uid.mid(6)); 704 Event *event = calendar()->event(uid.mid(6));
688#endif 705#endif
689 //qDebug("event %d uid %s ", event, uid.mid(6).latin1()); 706 //qDebug("event %d uid %s ", event, uid.mid(6).latin1());
690 if (!event) return; 707 if (!event) return;
691 //createEventViewer(); 708 //createEventViewer();
692 mEventViewer->setEvent(event); 709 mEventViewer->setEvent(event);
693 } else if (uid.startsWith("todo:")) { 710 } else if (uid.startsWith("todo:")) {
694#ifdef DESKTOP_VERSION 711#ifdef DESKTOP_VERSION
695 Todo *todo = calendar()->todo(uid.mid(7)); 712 Todo *todo = calendar()->todo(uid.mid(7));
696#else 713#else
697 Todo *todo = calendar()->todo(uid.mid(5)); 714 Todo *todo = calendar()->todo(uid.mid(5));
698#endif 715#endif
699 if (!todo) return; 716 if (!todo) return;
700 //createEventViewer(); 717 //createEventViewer();