From 0618fbee69bfde7f7f3c4a54b5cc45dac446abd3 Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 05 Jan 2005 23:13:10 +0000 Subject: added wnv printing --- diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 6a9a200..b66062c 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -8,13 +8,15 @@ Added setting to hide/show time in agenda items. Added setting to hide not running todos in todo view. Added columns for start date/time in todo view. Replaced the solid half-hour lines in agenda view by dot lines. -Fixed some minor problems. (Like word wrap in help text windows). +Added possibility of printing the What's Next View on the desktop +(i.e. Windows and Linux). Fixed a strange problem in KO/Pi alarm applet. Did not find the actual problem, such that now Qtopia reboots again if deinstalling the alarm applet. But the alarm applet should work again. +Fixed some minor problems. (Like word wrap in help text windows). ********** VERSION 1.9.15 ************ diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index b2dd266..cf56fcf 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -238,6 +238,8 @@ void KOViewManager::showWhatsNextView() mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); addView(mWhatsNextView); + connect(this, SIGNAL( printWNV() ), + mWhatsNextView, SLOT( printMe() ) ); } globalFlagBlockAgenda = 1; showView(mWhatsNextView, true ); diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h index 26b22be..6f76e2c 100644 --- a/korganizer/koviewmanager.h +++ b/korganizer/koviewmanager.h @@ -78,6 +78,8 @@ class KOViewManager : public QObject KOAgendaView *agendaView() const { return mAgendaView; } + signals: + void printWNV(); public slots: void showWhatsNextView(); void showListView(); diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index 5f14bfa..219f7c3 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp @@ -111,7 +111,23 @@ QPtrList KOWhatsNextView::selectedIncidences() return eventList; } - +void KOWhatsNextView::printMe() +{ +#ifdef DESKTOP_VERSION + QPrinter printer; + if (!printer.setup() ) + return; + QTextBrowser tb; + tb.setFixedSize( 600, 4000 ); + QPainter::redirect ( tb.viewport(), &printer ); + updateView(); + tb.setText( mText ); + tb.show(); + tb.repaint(); + tb.hide(); + KMessageBox::information( this, i18n("Printing What's Next View!\n\nPlease close after\nprinting is finished.")); +#endif +} void KOWhatsNextView::printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td) { @@ -674,6 +690,7 @@ void KOWhatsNextView::setEventViewer(KOEventViewerDialog* v ) // TODO: Create this function in CalendarView and remove it from here void KOWhatsNextView::showIncidence(const QString &uid) { + if ( !mEventViewer ) { qDebug("KOWhatsNextView::showIncidence::sorry, no event viewer set "); return; diff --git a/korganizer/kowhatsnextview.h b/korganizer/kowhatsnextview.h index 9049268..0231cf2 100644 --- a/korganizer/kowhatsnextview.h +++ b/korganizer/kowhatsnextview.h @@ -29,6 +29,8 @@ class QLabel; class KOEventViewerDialog; +#include +#include class WhatsNextTextBrowser : public QTextBrowser { Q_OBJECT public: @@ -64,6 +66,7 @@ class KOWhatsNextView : public KOrg::BaseView public slots: virtual void updateView(); + void printMe(); virtual void showDates(const QDate &start, const QDate &end); virtual void showEvents(QPtrList eventList); void updateConfig(); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 6bc5b3a..def8431 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -845,7 +845,11 @@ void MainWindow::initActions() action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); action->addTo( importMenu ); connect( action, SIGNAL( activated() ), - this, SLOT( printSel() ) ); + this, SLOT( printSel() ) ); + action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); + action->addTo( importMenu ); + connect( action, SIGNAL( activated() ), + mView->viewManager(), SIGNAL( printWNV() ) ); #endif importMenu->insertSeparator(); action = new QAction( "beam all", i18n("Save"), 0, -- cgit v0.9.0.2