summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-01-05 23:13:10 (UTC)
committer zautrix <zautrix>2005-01-05 23:13:10 (UTC)
commit0618fbee69bfde7f7f3c4a54b5cc45dac446abd3 (patch) (side-by-side diff)
tree5fa2e93328b3429a22e0a712f45bdc91e3da1f07 /korganizer
parented3b1be69915eaff3bfad542fd50bb18624c323e (diff)
downloadkdepimpi-0618fbee69bfde7f7f3c4a54b5cc45dac446abd3.zip
kdepimpi-0618fbee69bfde7f7f3c4a54b5cc45dac446abd3.tar.gz
kdepimpi-0618fbee69bfde7f7f3c4a54b5cc45dac446abd3.tar.bz2
added wnv printing
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koviewmanager.cpp2
-rw-r--r--korganizer/koviewmanager.h2
-rw-r--r--korganizer/kowhatsnextview.cpp19
-rw-r--r--korganizer/kowhatsnextview.h3
-rw-r--r--korganizer/mainwindow.cpp6
5 files changed, 30 insertions, 2 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index b2dd266..cf56fcf 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -240,2 +240,4 @@ void KOViewManager::showWhatsNextView()
addView(mWhatsNextView);
+ connect(this, SIGNAL( printWNV() ),
+ mWhatsNextView, SLOT( printMe() ) );
}
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h
index 26b22be..6f76e2c 100644
--- a/korganizer/koviewmanager.h
+++ b/korganizer/koviewmanager.h
@@ -80,2 +80,4 @@ class KOViewManager : public QObject
+ signals:
+ void printWNV();
public slots:
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 5f14bfa..219f7c3 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -113,3 +113,19 @@ QPtrList<Incidence> KOWhatsNextView::selectedIncidences()
-
+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,
@@ -676,2 +692,3 @@ void KOWhatsNextView::showIncidence(const QString &uid)
{
+
if ( !mEventViewer ) {
diff --git a/korganizer/kowhatsnextview.h b/korganizer/kowhatsnextview.h
index 9049268..0231cf2 100644
--- a/korganizer/kowhatsnextview.h
+++ b/korganizer/kowhatsnextview.h
@@ -31,2 +31,4 @@ class KOEventViewerDialog;
+#include <qpainter.h>
+#include <qwidget.h>
class WhatsNextTextBrowser : public QTextBrowser {
@@ -66,2 +68,3 @@ class KOWhatsNextView : public KOrg::BaseView
virtual void updateView();
+ void printMe();
virtual void showDates(const QDate &start, const QDate &end);
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 6bc5b3a..def8431 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -847,3 +847,7 @@ void MainWindow::initActions()
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