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
@@ -38,12 +38,13 @@
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{
@@ -58,12 +59,17 @@ void WhatsNextTextBrowser::setSource(const QString& n)
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 );
@@ -75,13 +81,17 @@ void WhatsNextTextBrowser::printMe()
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,