summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-03-28 19:26:15 (UTC)
committer zautrix <zautrix>2005-03-28 19:26:15 (UTC)
commitea070abfcff313cac87dbb4d5c9410784740de21 (patch) (unidiff)
tree3e95608a0444030016eb6845b95a582e265c1dad /korganizer
parent57f95bb15f732ede3ddc68b077b6a5476246e971 (diff)
downloadkdepimpi-ea070abfcff313cac87dbb4d5c9410784740de21.zip
kdepimpi-ea070abfcff313cac87dbb4d5c9410784740de21.tar.gz
kdepimpi-ea070abfcff313cac87dbb4d5c9410784740de21.tar.bz2
print fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventviewer.cpp13
-rw-r--r--korganizer/koeventviewer.h53
-rw-r--r--korganizer/koeventviewerdialog.cpp8
-rw-r--r--korganizer/kowhatsnextview.cpp12
4 files changed, 76 insertions, 10 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 445fc86..dbe0668 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -77,2 +77,8 @@ void KOEventViewer::printMe()
77#ifdef DESKTOP_VERSION 77#ifdef DESKTOP_VERSION
78
79 KOPrintPrefs pp ( this );
80 if (!pp.exec() )
81 return;
82 int scaleval = pp.printMode() ;
83
78 QPrinter printer; 84 QPrinter printer;
@@ -93,4 +99,9 @@ void KOEventViewer::printMe()
93 scale = dy; 99 scale = dy;
100
94 p.translate( m.width()/10,0 ); 101 p.translate( m.width()/10,0 );
95 p.scale( scale, scale ); 102 qDebug("Scale: %f ", scale );
103 if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) {
104 qDebug("SCALE ");
105 p.scale( scale, scale );
106 }
96 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); 107 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () );
diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h
index ca5bc15..6ecc233 100644
--- a/korganizer/koeventviewer.h
+++ b/korganizer/koeventviewer.h
@@ -32,2 +32,55 @@ using namespace KCal;
32 32
33#ifdef DESKTOP_VERSION
34
35#include <qradiobutton.h>
36#include <qpushbutton.h>
37#include <qlayout.h>
38#include <qdialog.h>
39#include <qlabel.h>
40#include <qbuttongroup.h>
41#include <kglobal.h>
42
43class KOPrintPrefs : public QDialog
44{
45 public:
46 KOPrintPrefs( QWidget *parent=0, const char *name=0 ) :
47 QDialog( parent, name, true )
48 {
49 setCaption( i18n("KO/Pi Printout") );
50 QVBoxLayout* lay = new QVBoxLayout( this );
51 lay->setSpacing( 3 );
52 lay->setMargin( 3 );
53 QLabel * lab = new QLabel( i18n("This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog."), this );
54 lay->addWidget( lab );
55 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Printout Mode"), this );
56 lay->addWidget( format );
57 format->setExclusive ( true ) ;
58 pmNo = new QRadioButton(i18n("Print unscaled"), format );
59 pmScaledDown = new QRadioButton(i18n("Print scaled down to fit one page"), format );
60 new QRadioButton(i18n("Print scaled up/down to fit one page"), format );
61 pmScaledDown->setChecked( true );
62 QPushButton * ok = new QPushButton( i18n("OK"), this );
63 lay->addWidget( ok );
64 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
65 lay->addWidget( cancel );
66 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
67 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
68 resize( 200, 200 );
69 }
70
71 int printMode()
72 {
73 if ( pmNo->isChecked() )
74 return 0;
75 if ( pmScaledDown->isChecked() )
76 return 1;
77 return 2;
78 }
79private:
80 QRadioButton* pmNo;
81 QRadioButton* pmScaledDown;
82};
83
84#endif
85
33class KOEventViewer : public QTextBrowser { 86class KOEventViewer : public QTextBrowser {
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index ec55cca..35d084d 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -95,10 +95,2 @@ void KOEventViewerDialog::print()
95{ 95{
96 qDebug("PRINT ");
97 int km = KMessageBox::warningContinueCancel(this,mIncidence->summary().left(35) +
98 i18n("\n\nDo you really want to print this item?"),
99 i18n("KO/Pi Print Confirmation"),i18n("Print"));
100 if ( km != KMessageBox::Continue ) {
101 qDebug("cancel ");
102 return;
103 }
104 mEventViewer->printMe(); 96 mEventViewer->printMe();
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 66ff75d..53fe7d0 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -43,2 +43,3 @@
43#include "koeventviewerdialog.h" 43#include "koeventviewerdialog.h"
44#include "koeventviewer.h"
44#include <qstylesheet.h> 45#include <qstylesheet.h>
@@ -63,2 +64,7 @@ void WhatsNextTextBrowser::printMe()
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;
@@ -80,3 +86,7 @@ void WhatsNextTextBrowser::printMe()
80 p.translate( m.width()/10,0 ); 86 p.translate( m.width()/10,0 );
81 p.scale( scale, scale ); 87 qDebug("Scale: %f ", scale );
88 if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) {
89 qDebug("SCALE ");
90 p.scale( scale, scale );
91 }
82 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); 92 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () );