From 041729646fdaabd2ed69b4fc77c839efa81a7d2e Mon Sep 17 00:00:00 2001 From: zautrix Date: Tue, 07 Jun 2005 20:23:54 +0000 Subject: print list added to kopi --- diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 6e3b886..719f120 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -1,5 +1,11 @@ Info about the changes in new versions of KDE-Pim/Pi +********** VERSION 2.1.6 ************ + +KO/Pi: +Added to the list view (the list view is used in search dialog as well) the possibility to print it. +Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. + ********** VERSION 2.1.5 ************ This is the new stable version. diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 5a27a10..8f28234 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt @@ -1372,8 +1372,8 @@ { "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" }, { "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" }, { "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, -{ "","" }, -{ "","" }, +{ "Print complete list","Drucke komplette Liste" }, +{ "Hide all selected","Verstecke Selektierte" }, { "","" }, { "","" }, { "","" }, diff --git a/desktop/rpm/kdepim_rpm b/desktop/rpm/kdepim_rpm index cf68670..ee00372 100644 --- a/desktop/rpm/kdepim_rpm +++ b/desktop/rpm/kdepim_rpm @@ -1,6 +1,6 @@ Summary: A collection of PIM programs Name: KDE-Pim-Pi -Version: 2.1.5 +Version: 2.1.6 Release: SuSE_9.2 Copyright:GPL Group: Productivity/Pim diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index bc52281..7022e02 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp @@ -34,6 +34,8 @@ #include #include #include +#include +#include #include #include @@ -63,6 +65,7 @@ #include "kfiledialog.h" #include "kolistview.h" +#include "koeventviewer.h" @@ -280,7 +283,18 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), i18n("Delete all selected"),this, SLOT(deleteAll()),true); +#ifdef DESKTOP_VERSION + mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), + i18n("Hide all selected"),this, + SLOT(hideAll()),true); +#endif + mPopupMenu->insertSeparator(); +#ifdef DESKTOP_VERSION + mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), + i18n("Print complete list"),this, + SLOT(printList()),true); mPopupMenu->insertSeparator(); +#endif QPopupMenu * exportPO = new QPopupMenu ( this ); mPopupMenu->insertItem( i18n("Export selected"), exportPO ); exportPO->insertItem( i18n("As iCal (ics) file..."),this, @@ -722,6 +736,27 @@ void KOListView::writeToFile( bool iCal ) } QTimer::singleShot( 1, this, SLOT ( resetFocus() ) ); } +void KOListView::hideAll() +{ + QPtrList delSel ; + QListViewItem *item = mListView->firstChild (); + while ( item ) { + if ( item->isSelected() ) { + delSel.append(item); + } + item = item->nextSibling(); + } + item = delSel.first() ; + while ( item ) { + QListViewItem * del = item; + item = delSel.next(); + delete del; + } +} +void KOListView::printList() +{ + mListView->printList(); +} void KOListView::deleteAll() { int icount = 0; @@ -1287,3 +1322,50 @@ void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) KListView::contentsMouseMoveEvent(e); } +#define protected public +#include +#undef protected +void KOListViewListView::printList() +{ +#ifdef DESKTOP_VERSION + KOPrintPrefs pp ( this ); + if (!pp.exec() ) + return; + int scaleval = pp.printMode() ; + + QPrinter printer; + if (!printer.setup() ) + return; + clearSelection (); + 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,m.width()/10 ); + if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) { + p.scale( scale, scale ); + } + + int cou = header()->count(); + int iii; + QRect rect ( 0,0,0, header()->height()); + for ( iii = 0; iii < cou; ++iii ) { + rect.setLeft ( header()->sectionPos( iii ) ); + rect.setRight ( header()->sectionPos( iii ) + header()->sectionSize (iii)); + header()->paintSection ( & p, header()->mapToIndex (iii), rect ); + } + p.translate( 0, header()->height()); + drawContentsOffset ( &p, 0,0, 0,0, contentsWidth (), contentsHeight () ); + p.end(); +#endif +} diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h index f4d6879..c25592d 100644 --- a/korganizer/kolistview.h +++ b/korganizer/kolistview.h @@ -216,6 +216,7 @@ class KOListViewListView : public KListView public: KOListViewListView(KOListView * lv ); bool hasMultiSelection(QListViewItem*); + void printList(); signals: void newEvent(); void showIncidence( Incidence* ); @@ -266,6 +267,8 @@ class KOListView : public KOEventView void beamIncidenceList(QPtrList); public slots: + void hideAll(); + void printList(); void resetFocus(); virtual void updateView(); virtual void showDates(const QDate &start, const QDate &end); diff --git a/version b/version index 3a546e2..f3e46b1 100644 --- a/version +++ b/version @@ -1 +1 @@ -version = "2.1.5"; +version = "2.1.6"; -- cgit v0.9.0.2