summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-28 13:31:19 (UTC)
committer zautrix <zautrix>2005-03-28 13:31:19 (UTC)
commite4e6bda3a6b0a82e3f64db0fa5f7d60cab9f0e48 (patch) (side-by-side diff)
treee1b5b2d51b8026b08f6eb3680304fa8d86d1873a
parent314908d5d9139af7711c6e425260363bb014afce (diff)
downloadkdepimpi-e4e6bda3a6b0a82e3f64db0fa5f7d60cab9f0e48.zip
kdepimpi-e4e6bda3a6b0a82e3f64db0fa5f7d60cab9f0e48.tar.gz
kdepimpi-e4e6bda3a6b0a82e3f64db0fa5f7d60cab9f0e48.tar.bz2
fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt3
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt14
-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
12 files changed, 97 insertions, 16 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index da27fea..ce68a1d 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -6,6 +6,9 @@ KO/Pi:
Fix for creating events/todos via the abgenda context menu.
Added option to split toolbar to 3 toolbars.
Added option to show one small filter-view-toolbar.
+Added a print option to the desktop version:
+Now you can print out the view of the "Event Viewer".
+That means you can print all data of one particular event/todo.
********** VERSION 2.0.21 ************
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index 732bb3f..546c32e 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -745,7 +745,7 @@
{ "Observer","Beobachter" },
{ "Chair","Vorsitzender" },
{ "Not supported \non desktop!\n","" },
-{ "Nothing selected!\n\nThis prints the full width of the Agenda view as you see it!\n\nTo determine the vertical range of the printing, please select\na vertical range (with the left mouse button down) in one column. ","Es ist nichts selektiert!\nDieses druckt die volle Breite der Agenda View, so wie man sie sieht.\nUm die verticale Auswahl zum Drucken zu bestimmen,\nbitte einen verticalen Zeitraum (mit gedrückter linker Maustaste)\nin einer Spalte auswählen. " },
+{ "Nothing selected!\n\nThis prints the full width of the Agenda view as you see it!\n\nTo determine the vertical range of the printing, please select\na vertical range (with the left mouse button down) in one column. ","Es ist nichts selektiert!\nDieses druckt die volle Breite der Agenda View, so wie man sie sieht.\nUm die vertikale Auswahl zum Drucken zu bestimmen,\nbitte einen vertikalen Zeitraum (mit gedrückter linker Maustaste)\nin einer Spalte auswählen.\n(Es wird danach direkt der Termin Dialog angezeigt\n - dort bitte auf Abbrechen klicken) " },
{ "Date range: ","Datums Zeitspanne: " },
{ "Not supported \non PDA!\n","Nicht verfügbar\nauf dem PDA. " },
{ "Syncing - close to abort!","Syncing-schließe um abzubrechen." },
@@ -1314,12 +1314,14 @@
{ "%1 minutes\n","%1 Minuten\n" },
{ "1 minute\n","1 Minute\n" },
{ "Only one toolbar","Nur eine Toolbar" },
+{ "Print","Drucke" },
+{ "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." },
+{ "There is nothing selected!","Es ist nichts ausgewählt!" },
+{ "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " },
+{ "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
-{ "","" },
-{ "","" },
-{ "","" },
-{ "","" },
-{ "","" }, \ No newline at end of file
+
+
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()
{
return mModified;
}
-
+void CalendarView::slotprintSelInc()
+{
+ if ( currentSelection() == 0 ) {
+ KMessageBox::sorry(this,i18n("There is nothing selected!"));
+ return;
+ }
+ showIncidence();
+ getEventViewerDialog()->print();
+
+}
void CalendarView::printSetup()
{
#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
public slots:
+ void slotprintSelInc();
void showNextAlarms();
void showOpenError();
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 @@
#ifdef DESKTOP_VERSION
#include <kabc/addresseedialog.h>
#include <kabc/addresseeview.h>
+#include <qprinter.h>
+#include <qpainter.h>
+#include <qpaintdevicemetrics.h>
#else //DESKTOP_VERSION
#include <externalapphandler.h>
#include <qtopia/qcopenvelope_qws.h>
@@ -69,6 +72,32 @@ 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
@@ -52,6 +52,7 @@ class KOEventViewer : public QTextBrowser {
void setSyncMode( bool );
void setColorMode( int );
void mailToAttendees( bool all );
+ void printMe();
protected:
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 @@
#include <qpushbutton.h>
#include "koeventviewer.h"
+#include <kmessagebox.h>
#include "koprefs.h"
#include <libkcal/todo.h>
#include "qapp.h"
@@ -90,6 +91,19 @@ void KOEventViewerDialog::showMe()
//raise();
}
+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 )
{
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 {
int executeS( bool );
public slots:
void updateConfig();
+ void print();
signals:
void editIncidence( Incidence* );
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()
}
+void KOViewManager::slotprintWNV()
+{
+ if (!mWhatsNextView)
+ showWhatsNextView();
+ emit printWNV();
+
+}
void KOViewManager::showListView()
{
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
void signalFullScreen( bool );
void signalAgendaView( bool );
public slots:
+ void slotprintWNV();
void showNextView();
void showMonth( const QDate & );
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) :
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 ) ) );
connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) );
@@ -348,6 +352,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
#ifndef DESKTOP_VERSION
infrared = 0;
#endif
+ updateFilterToolbar();
updateWeek( mView->startDate() );
connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
SLOT( updateWeekNum( const KCal::DateList & ) ) );
@@ -992,7 +997,14 @@ void MainWindow::initActions()
action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this );
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
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
mPrevYear->setFlat( true);
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();
mNextWeek->hide();
@@ -151,13 +158,7 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam
mNextYear->setFocusPolicy(NoFocus);
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 );
-
+
}
NavigatorBar::~NavigatorBar()