summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp11
-rw-r--r--korganizer/calendarview.h1
-rw-r--r--korganizer/koeventviewer.cpp29
-rw-r--r--korganizer/koeventviewer.h1
-rw-r--r--korganizer/koeventviewerdialog.cpp14
-rw-r--r--korganizer/koeventviewerdialog.h1
-rw-r--r--korganizer/koviewmanager.cpp7
-rw-r--r--korganizer/koviewmanager.h1
-rw-r--r--korganizer/mainwindow.cpp16
-rw-r--r--korganizer/navigatorbar.cpp15
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
@@ -3428,5 +3428,14 @@ bool CalendarView::isModified()
return mModified;
}
-
+void CalendarView::slotprintSelInc()
+{
+ if ( currentSelection() == 0 ) {
+ KMessageBox::sorry(this,i18n("There is nothing selected!"));
+ return;
+ }
+ showIncidence();
+ getEventViewerDialog()->print();
+
+}
void CalendarView::printSetup()
{
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 9782ffe..05a34b4 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -177,4 +177,5 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
public slots:
+ void slotprintSelInc();
void showNextAlarms();
void showOpenError();
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 1508638..445fc86 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -54,4 +54,7 @@
#include <kabc/addresseedialog.h>
#include <kabc/addresseeview.h>
+#include <qprinter.h>
+#include <qpainter.h>
+#include <qpaintdevicemetrics.h>
#else //DESKTOP_VERSION
#include <externalapphandler.h>
@@ -70,4 +73,30 @@ KOEventViewer::~KOEventViewer()
}
+void KOEventViewer::printMe()
+{
+#ifdef DESKTOP_VERSION
+ QPrinter printer;
+ if (!printer.setup() )
+ return;
+ QPainter p;
+ p.begin ( &printer );
+ QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer );
+ float dx, dy;
+ int wid = (m.width() * 9)/10;
+ dx = (float) wid/(float)contentsWidth ();
+ dy = (float)(m.height()) / (float)contentsHeight ();
+ float scale;
+ // scale to fit the width or height of the paper
+ if ( dx < dy )
+ scale = dx;
+ else
+ scale = dy;
+ p.translate( m.width()/10,0 );
+ p.scale( scale, scale );
+ drawContents ( &p, 0,0, contentsWidth (), contentsHeight () );
+ p.end();
+#endif
+
+}
void KOEventViewer::setSource(const QString& n)
{
diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h
index 47cc5e9..ca5bc15 100644
--- a/korganizer/koeventviewer.h
+++ b/korganizer/koeventviewer.h
@@ -53,4 +53,5 @@ class KOEventViewer : public QTextBrowser {
void setColorMode( int );
void mailToAttendees( bool all );
+ void printMe();
protected:
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index f734696..ec55cca 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -25,4 +25,5 @@
#include "koeventviewer.h"
+#include <kmessagebox.h>
#include "koprefs.h"
#include <libkcal/todo.h>
@@ -91,4 +92,17 @@ void KOEventViewerDialog::showMe()
}
+void KOEventViewerDialog::print()
+{
+ qDebug("PRINT ");
+ int km = KMessageBox::warningContinueCancel(this,mIncidence->summary().left(35) +
+ i18n("\n\nDo you really want to print this item?"),
+ i18n("KO/Pi Print Confirmation"),i18n("Print"));
+ if ( km != KMessageBox::Continue ) {
+ qDebug("cancel ");
+ return;
+ }
+ mEventViewer->printMe();
+
+}
void KOEventViewerDialog::setSyncMode( bool b )
{
diff --git a/korganizer/koeventviewerdialog.h b/korganizer/koeventviewerdialog.h
index 36431ad..8e1cd44 100644
--- a/korganizer/koeventviewerdialog.h
+++ b/korganizer/koeventviewerdialog.h
@@ -52,4 +52,5 @@ class KOEventViewerDialog : public KDialogBase {
public slots:
void updateConfig();
+ void print();
signals:
void editIncidence( Incidence* );
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index e80b3fc..8752636 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -383,4 +383,11 @@ void KOViewManager::showWhatsNextView()
}
+void KOViewManager::slotprintWNV()
+{
+ if (!mWhatsNextView)
+ showWhatsNextView();
+ emit printWNV();
+
+}
void KOViewManager::showListView()
{
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h
index d829f14..1d565a6 100644
--- a/korganizer/koviewmanager.h
+++ b/korganizer/koviewmanager.h
@@ -83,4 +83,5 @@ class KOViewManager : public QObject
void signalAgendaView( bool );
public slots:
+ void slotprintWNV();
void showNextView();
void showMonth( const QDate & );
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index a4e0834..ad1c0cd 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -186,5 +186,9 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
filterPopupMenu = new QPopupMenu( this );
filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 );
- filterMenubar->setFixedWidth( fm.width( i18n("No Filter")+"Ax" ) );
+ QString addTest = "Ax";
+#ifdef DESKTOP_VERSION
+ addTest = "AAAx";
+#endif
+ filterMenubar->setFixedWidth( fm.width( i18n("No Filter")+addTest ) );
addToolBar (filterToolBar , tbd );
connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) );
@@ -349,4 +353,5 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
infrared = 0;
#endif
+ updateFilterToolbar();
updateWeek( mView->startDate() );
connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
@@ -993,5 +998,12 @@ void MainWindow::initActions()
action->addTo( beamMenu_X );
connect( action, SIGNAL( activated() ),
- mView->viewManager(), SIGNAL( printWNV() ) );
+ mView->viewManager(), SLOT( slotprintWNV() ) );
+
+ action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this );
+ action->addTo( beamMenu_X );
+ connect( action, SIGNAL( activated() ),
+ mView, SLOT( slotprintSelInc() ) );
+
+
importMenu->insertItem( i18n("Print"), beamMenu_X );
#endif
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index 49149f2..0610d55 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -114,4 +114,11 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam
mPrevMonth->setFlat( true);
mPrevWeek->setFlat( true);
+
+ mPrevYear->setAutoRepeat( true );
+ mPrevMonth->setAutoRepeat( true );
+ mNextMonth->setAutoRepeat( true );
+ mPrevWeek->setAutoRepeat( true );
+ mNextWeek->setAutoRepeat( true );
+ mNextYear->setAutoRepeat( true );
} else {
mPrevWeek->hide();
@@ -152,11 +159,5 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam
mSelectMonth->setFocusPolicy(NoFocus);
setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) );
- mPrevYear->setAutoRepeat( true );
- mPrevMonth->setAutoRepeat( true );
- mNextMonth->setAutoRepeat( true );
- mPrevWeek->setAutoRepeat( true );
- mNextWeek->setAutoRepeat( true );
- mNextYear->setAutoRepeat( true );
-
+
}