summaryrefslogtreecommitdiffabout
path: root/korganizer/kowhatsnextview.cpp
Unidiff
Diffstat (limited to 'korganizer/kowhatsnextview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kowhatsnextview.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 66ff75d..53fe7d0 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -36,16 +36,17 @@
36#include <libkcal/calendar.h> 36#include <libkcal/calendar.h>
37 37
38#ifndef KORG_NOPRINTER 38#ifndef KORG_NOPRINTER
39#include "calprinter.h" 39#include "calprinter.h"
40#endif 40#endif
41#include "koglobals.h" 41#include "koglobals.h"
42#include "koprefs.h" 42#include "koprefs.h"
43#include "koeventviewerdialog.h" 43#include "koeventviewerdialog.h"
44#include "koeventviewer.h"
44#include <qstylesheet.h> 45#include <qstylesheet.h>
45#include "kowhatsnextview.h" 46#include "kowhatsnextview.h"
46using namespace KOrg; 47using namespace KOrg;
47 48
48void WhatsNextTextBrowser::setSource(const QString& n) 49void WhatsNextTextBrowser::setSource(const QString& n)
49{ 50{
50 51
51 if (n.startsWith("event:")) { 52 if (n.startsWith("event:")) {
@@ -56,16 +57,21 @@ void WhatsNextTextBrowser::setSource(const QString& n)
56 return; 57 return;
57 } else { 58 } else {
58 QTextBrowser::setSource(n); 59 QTextBrowser::setSource(n);
59 } 60 }
60} 61}
61void WhatsNextTextBrowser::printMe() 62void WhatsNextTextBrowser::printMe()
62{ 63{
63#ifdef DESKTOP_VERSION 64#ifdef DESKTOP_VERSION
65 KOPrintPrefs pp ( this );
66 if (!pp.exec() )
67 return;
68 int scaleval = pp.printMode() ;
69
64 QPrinter printer; 70 QPrinter printer;
65 if (!printer.setup() ) 71 if (!printer.setup() )
66 return; 72 return;
67 QPainter p; 73 QPainter p;
68 p.begin ( &printer ); 74 p.begin ( &printer );
69 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); 75 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer );
70 float dx, dy; 76 float dx, dy;
71 int wid = (m.width() * 9)/10; 77 int wid = (m.width() * 9)/10;
@@ -73,17 +79,21 @@ void WhatsNextTextBrowser::printMe()
73 dy = (float)(m.height()) / (float)contentsHeight (); 79 dy = (float)(m.height()) / (float)contentsHeight ();
74 float scale; 80 float scale;
75 // scale to fit the width or height of the paper 81 // scale to fit the width or height of the paper
76 if ( dx < dy ) 82 if ( dx < dy )
77 scale = dx; 83 scale = dx;
78 else 84 else
79 scale = dy; 85 scale = dy;
80 p.translate( m.width()/10,0 ); 86 p.translate( m.width()/10,0 );
87 qDebug("Scale: %f ", scale );
88 if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) {
89 qDebug("SCALE ");
81 p.scale( scale, scale ); 90 p.scale( scale, scale );
91 }
82 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); 92 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () );
83 p.end(); 93 p.end();
84#endif 94#endif
85} 95}
86 96
87KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, 97KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent,
88 const char *name) 98 const char *name)
89 : KOrg::BaseView(calendar, parent, name) 99 : KOrg::BaseView(calendar, parent, name)