-rw-r--r-- | korganizer/calendarview.cpp | 11 | ||||
-rw-r--r-- | korganizer/calendarview.h | 1 | ||||
-rw-r--r-- | korganizer/koeventviewer.cpp | 29 | ||||
-rw-r--r-- | korganizer/koeventviewer.h | 1 | ||||
-rw-r--r-- | korganizer/koeventviewerdialog.cpp | 14 | ||||
-rw-r--r-- | korganizer/koeventviewerdialog.h | 1 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 7 | ||||
-rw-r--r-- | korganizer/koviewmanager.h | 1 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 16 | ||||
-rw-r--r-- | korganizer/navigatorbar.cpp | 15 |
10 files changed, 86 insertions, 10 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index a330414..0015bd6 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -3427,7 +3427,16 @@ bool CalendarView::isModified() | |||
3427 | { | 3427 | { |
3428 | return mModified; | 3428 | return mModified; |
3429 | } | 3429 | } |
3430 | 3430 | void CalendarView::slotprintSelInc() | |
3431 | { | ||
3432 | if ( currentSelection() == 0 ) { | ||
3433 | KMessageBox::sorry(this,i18n("There is nothing selected!")); | ||
3434 | return; | ||
3435 | } | ||
3436 | showIncidence(); | ||
3437 | getEventViewerDialog()->print(); | ||
3438 | |||
3439 | } | ||
3431 | void CalendarView::printSetup() | 3440 | void CalendarView::printSetup() |
3432 | { | 3441 | { |
3433 | #ifndef KORG_NOPRINTER | 3442 | #ifndef KORG_NOPRINTER |
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 9782ffe..05a34b4 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -176,6 +176,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
176 | 176 | ||
177 | 177 | ||
178 | public slots: | 178 | public slots: |
179 | void slotprintSelInc(); | ||
179 | void showNextAlarms(); | 180 | void showNextAlarms(); |
180 | void showOpenError(); | 181 | void showOpenError(); |
181 | void watchSavedFile(); | 182 | void watchSavedFile(); |
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 1508638..445fc86 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -53,6 +53,9 @@ | |||
53 | #ifdef DESKTOP_VERSION | 53 | #ifdef DESKTOP_VERSION |
54 | #include <kabc/addresseedialog.h> | 54 | #include <kabc/addresseedialog.h> |
55 | #include <kabc/addresseeview.h> | 55 | #include <kabc/addresseeview.h> |
56 | #include <qprinter.h> | ||
57 | #include <qpainter.h> | ||
58 | #include <qpaintdevicemetrics.h> | ||
56 | #else //DESKTOP_VERSION | 59 | #else //DESKTOP_VERSION |
57 | #include <externalapphandler.h> | 60 | #include <externalapphandler.h> |
58 | #include <qtopia/qcopenvelope_qws.h> | 61 | #include <qtopia/qcopenvelope_qws.h> |
@@ -69,6 +72,32 @@ KOEventViewer::~KOEventViewer() | |||
69 | { | 72 | { |
70 | } | 73 | } |
71 | 74 | ||
75 | void KOEventViewer::printMe() | ||
76 | { | ||
77 | #ifdef DESKTOP_VERSION | ||
78 | QPrinter printer; | ||
79 | if (!printer.setup() ) | ||
80 | return; | ||
81 | QPainter p; | ||
82 | p.begin ( &printer ); | ||
83 | QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); | ||
84 | float dx, dy; | ||
85 | int wid = (m.width() * 9)/10; | ||
86 | dx = (float) wid/(float)contentsWidth (); | ||
87 | dy = (float)(m.height()) / (float)contentsHeight (); | ||
88 | float scale; | ||
89 | // scale to fit the width or height of the paper | ||
90 | if ( dx < dy ) | ||
91 | scale = dx; | ||
92 | else | ||
93 | scale = dy; | ||
94 | p.translate( m.width()/10,0 ); | ||
95 | p.scale( scale, scale ); | ||
96 | drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); | ||
97 | p.end(); | ||
98 | #endif | ||
99 | |||
100 | } | ||
72 | void KOEventViewer::setSource(const QString& n) | 101 | void KOEventViewer::setSource(const QString& n) |
73 | { | 102 | { |
74 | 103 | ||
diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h index 47cc5e9..ca5bc15 100644 --- a/korganizer/koeventviewer.h +++ b/korganizer/koeventviewer.h | |||
@@ -52,6 +52,7 @@ class KOEventViewer : public QTextBrowser { | |||
52 | void setSyncMode( bool ); | 52 | void setSyncMode( bool ); |
53 | void setColorMode( int ); | 53 | void setColorMode( int ); |
54 | void mailToAttendees( bool all ); | 54 | void mailToAttendees( bool all ); |
55 | void printMe(); | ||
55 | 56 | ||
56 | protected: | 57 | protected: |
57 | int mColorMode; | 58 | int mColorMode; |
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp index f734696..ec55cca 100644 --- a/korganizer/koeventviewerdialog.cpp +++ b/korganizer/koeventviewerdialog.cpp | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <qpushbutton.h> | 24 | #include <qpushbutton.h> |
25 | 25 | ||
26 | #include "koeventviewer.h" | 26 | #include "koeventviewer.h" |
27 | #include <kmessagebox.h> | ||
27 | #include "koprefs.h" | 28 | #include "koprefs.h" |
28 | #include <libkcal/todo.h> | 29 | #include <libkcal/todo.h> |
29 | #include "qapp.h" | 30 | #include "qapp.h" |
@@ -90,6 +91,19 @@ void KOEventViewerDialog::showMe() | |||
90 | //raise(); | 91 | //raise(); |
91 | 92 | ||
92 | } | 93 | } |
94 | void KOEventViewerDialog::print() | ||
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(); | ||
105 | |||
106 | } | ||
93 | void KOEventViewerDialog::setSyncMode( bool b ) | 107 | void KOEventViewerDialog::setSyncMode( bool b ) |
94 | { | 108 | { |
95 | mSyncMode = b; | 109 | mSyncMode = b; |
diff --git a/korganizer/koeventviewerdialog.h b/korganizer/koeventviewerdialog.h index 36431ad..8e1cd44 100644 --- a/korganizer/koeventviewerdialog.h +++ b/korganizer/koeventviewerdialog.h | |||
@@ -51,6 +51,7 @@ class KOEventViewerDialog : public KDialogBase { | |||
51 | int executeS( bool ); | 51 | int executeS( bool ); |
52 | public slots: | 52 | public slots: |
53 | void updateConfig(); | 53 | void updateConfig(); |
54 | void print(); | ||
54 | signals: | 55 | signals: |
55 | void editIncidence( Incidence* ); | 56 | void editIncidence( Incidence* ); |
56 | void jumpToTime( const QDate &); | 57 | void jumpToTime( const QDate &); |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index e80b3fc..8752636 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -382,6 +382,13 @@ void KOViewManager::showWhatsNextView() | |||
382 | 382 | ||
383 | } | 383 | } |
384 | 384 | ||
385 | void KOViewManager::slotprintWNV() | ||
386 | { | ||
387 | if (!mWhatsNextView) | ||
388 | showWhatsNextView(); | ||
389 | emit printWNV(); | ||
390 | |||
391 | } | ||
385 | void KOViewManager::showListView() | 392 | void KOViewManager::showListView() |
386 | { | 393 | { |
387 | if (!mListView) { | 394 | if (!mListView) { |
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h index d829f14..1d565a6 100644 --- a/korganizer/koviewmanager.h +++ b/korganizer/koviewmanager.h | |||
@@ -82,6 +82,7 @@ class KOViewManager : public QObject | |||
82 | void signalFullScreen( bool ); | 82 | void signalFullScreen( bool ); |
83 | void signalAgendaView( bool ); | 83 | void signalAgendaView( bool ); |
84 | public slots: | 84 | public slots: |
85 | void slotprintWNV(); | ||
85 | void showNextView(); | 86 | void showNextView(); |
86 | void showMonth( const QDate & ); | 87 | void showMonth( const QDate & ); |
87 | void showDateView( int, QDate ); | 88 | void showDateView( int, QDate ); |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index a4e0834..ad1c0cd 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -185,7 +185,11 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
185 | 185 | ||
186 | filterPopupMenu = new QPopupMenu( this ); | 186 | filterPopupMenu = new QPopupMenu( this ); |
187 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); | 187 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); |
188 | filterMenubar->setFixedWidth( fm.width( i18n("No Filter")+"Ax" ) ); | 188 | QString addTest = "Ax"; |
189 | #ifdef DESKTOP_VERSION | ||
190 | addTest = "AAAx"; | ||
191 | #endif | ||
192 | filterMenubar->setFixedWidth( fm.width( i18n("No Filter")+addTest ) ); | ||
189 | addToolBar (filterToolBar , tbd ); | 193 | addToolBar (filterToolBar , tbd ); |
190 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); | 194 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); |
191 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); | 195 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); |
@@ -348,6 +352,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
348 | #ifndef DESKTOP_VERSION | 352 | #ifndef DESKTOP_VERSION |
349 | infrared = 0; | 353 | infrared = 0; |
350 | #endif | 354 | #endif |
355 | updateFilterToolbar(); | ||
351 | updateWeek( mView->startDate() ); | 356 | updateWeek( mView->startDate() ); |
352 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), | 357 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), |
353 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); | 358 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); |
@@ -992,7 +997,14 @@ void MainWindow::initActions() | |||
992 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); | 997 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); |
993 | action->addTo( beamMenu_X ); | 998 | action->addTo( beamMenu_X ); |
994 | connect( action, SIGNAL( activated() ), | 999 | connect( action, SIGNAL( activated() ), |
995 | mView->viewManager(), SIGNAL( printWNV() ) ); | 1000 | mView->viewManager(), SLOT( slotprintWNV() ) ); |
1001 | |||
1002 | action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); | ||
1003 | action->addTo( beamMenu_X ); | ||
1004 | connect( action, SIGNAL( activated() ), | ||
1005 | mView, SLOT( slotprintSelInc() ) ); | ||
1006 | |||
1007 | |||
996 | importMenu->insertItem( i18n("Print"), beamMenu_X ); | 1008 | importMenu->insertItem( i18n("Print"), beamMenu_X ); |
997 | #endif | 1009 | #endif |
998 | importMenu->insertSeparator(); | 1010 | importMenu->insertSeparator(); |
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index 49149f2..0610d55 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp | |||
@@ -113,6 +113,13 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam | |||
113 | mPrevYear->setFlat( true); | 113 | mPrevYear->setFlat( true); |
114 | mPrevMonth->setFlat( true); | 114 | mPrevMonth->setFlat( true); |
115 | mPrevWeek->setFlat( true); | 115 | mPrevWeek->setFlat( true); |
116 | |||
117 | mPrevYear->setAutoRepeat( true ); | ||
118 | mPrevMonth->setAutoRepeat( true ); | ||
119 | mNextMonth->setAutoRepeat( true ); | ||
120 | mPrevWeek->setAutoRepeat( true ); | ||
121 | mNextWeek->setAutoRepeat( true ); | ||
122 | mNextYear->setAutoRepeat( true ); | ||
116 | } else { | 123 | } else { |
117 | mPrevWeek->hide(); | 124 | mPrevWeek->hide(); |
118 | mNextWeek->hide(); | 125 | mNextWeek->hide(); |
@@ -151,13 +158,7 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam | |||
151 | mNextYear->setFocusPolicy(NoFocus); | 158 | mNextYear->setFocusPolicy(NoFocus); |
152 | mSelectMonth->setFocusPolicy(NoFocus); | 159 | mSelectMonth->setFocusPolicy(NoFocus); |
153 | setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); | 160 | setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); |
154 | mPrevYear->setAutoRepeat( true ); | 161 | |
155 | mPrevMonth->setAutoRepeat( true ); | ||
156 | mNextMonth->setAutoRepeat( true ); | ||
157 | mPrevWeek->setAutoRepeat( true ); | ||
158 | mNextWeek->setAutoRepeat( true ); | ||
159 | mNextYear->setAutoRepeat( true ); | ||
160 | |||
161 | } | 162 | } |
162 | 163 | ||
163 | NavigatorBar::~NavigatorBar() | 164 | NavigatorBar::~NavigatorBar() |