summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-07 20:23:54 (UTC)
committer zautrix <zautrix>2005-06-07 20:23:54 (UTC)
commit041729646fdaabd2ed69b4fc77c839efa81a7d2e (patch) (unidiff)
tree82c78d5c25d18a79a8ae76aabf75ea40b91c26f2
parentaa9a9368a7b38e34118b65a4e8efa7ea7ec0e8e4 (diff)
downloadkdepimpi-041729646fdaabd2ed69b4fc77c839efa81a7d2e.zip
kdepimpi-041729646fdaabd2ed69b4fc77c839efa81a7d2e.tar.gz
kdepimpi-041729646fdaabd2ed69b4fc77c839efa81a7d2e.tar.bz2
print list added to kopi
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt6
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt4
-rw-r--r--desktop/rpm/kdepim_rpm2
-rw-r--r--korganizer/kolistview.cpp82
-rw-r--r--korganizer/kolistview.h3
-rw-r--r--version2
6 files changed, 95 insertions, 4 deletions
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
@@ -2,2 +2,8 @@ Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 2.1.6 ************
4
5KO/Pi:
6Added to the list view (the list view is used in search dialog as well) the possibility to print it.
7Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view.
8
3********** VERSION 2.1.5 ************ 9********** VERSION 2.1.5 ************
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
@@ -1374,4 +1374,4 @@
1374{ "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, 1374{ "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" },
1375{ "","" }, 1375{ "Print complete list","Drucke komplette Liste" },
1376{ "","" }, 1376{ "Hide all selected","Verstecke Selektierte" },
1377{ "","" }, 1377{ "","" },
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
@@ -2,3 +2,3 @@ Summary: A collection of PIM programs
2Name: KDE-Pim-Pi 2Name: KDE-Pim-Pi
3Version: 2.1.5 3Version: 2.1.6
4Release: SuSE_9.2 4Release: SuSE_9.2
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index bc52281..7022e02 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -36,2 +36,4 @@
36#include <qregexp.h> 36#include <qregexp.h>
37#include <qpainter.h>
38#include <qpaintdevicemetrics.h>
37 39
@@ -65,2 +67,3 @@
65#include "kolistview.h" 67#include "kolistview.h"
68#include "koeventviewer.h"
66 69
@@ -282,3 +285,14 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
282 SLOT(deleteAll()),true); 285 SLOT(deleteAll()),true);
286#ifdef DESKTOP_VERSION
287 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
288 i18n("Hide all selected"),this,
289 SLOT(hideAll()),true);
290#endif
291 mPopupMenu->insertSeparator();
292#ifdef DESKTOP_VERSION
293 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
294 i18n("Print complete list"),this,
295 SLOT(printList()),true);
283 mPopupMenu->insertSeparator(); 296 mPopupMenu->insertSeparator();
297#endif
284 QPopupMenu * exportPO = new QPopupMenu ( this ); 298 QPopupMenu * exportPO = new QPopupMenu ( this );
@@ -724,2 +738,23 @@ void KOListView::writeToFile( bool iCal )
724} 738}
739void KOListView::hideAll()
740{
741 QPtrList<QListViewItem> delSel ;
742 QListViewItem *item = mListView->firstChild ();
743 while ( item ) {
744 if ( item->isSelected() ) {
745 delSel.append(item);
746 }
747 item = item->nextSibling();
748 }
749 item = delSel.first() ;
750 while ( item ) {
751 QListViewItem * del = item;
752 item = delSel.next();
753 delete del;
754 }
755}
756void KOListView::printList()
757{
758 mListView->printList();
759}
725void KOListView::deleteAll() 760void KOListView::deleteAll()
@@ -1289 +1324,48 @@ void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e)
1289 1324
1325#define protected public
1326#include <qheader.h>
1327#undef protected
1328void KOListViewListView::printList()
1329{
1330#ifdef DESKTOP_VERSION
1331 KOPrintPrefs pp ( this );
1332 if (!pp.exec() )
1333 return;
1334 int scaleval = pp.printMode() ;
1335
1336 QPrinter printer;
1337 if (!printer.setup() )
1338 return;
1339 clearSelection ();
1340 QPainter p;
1341 p.begin ( &printer );
1342 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer );
1343 float dx, dy;
1344 int wid = (m.width() * 9)/10;
1345 dx = (float) wid/(float)contentsWidth ();
1346 dy = (float)(m.height()) / (float)contentsHeight ();
1347 float scale;
1348 // scale to fit the width or height of the paper
1349 if ( dx < dy )
1350 scale = dx;
1351 else
1352 scale = dy;
1353
1354 p.translate( m.width()/10,m.width()/10 );
1355 if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) {
1356 p.scale( scale, scale );
1357 }
1358
1359 int cou = header()->count();
1360 int iii;
1361 QRect rect ( 0,0,0, header()->height());
1362 for ( iii = 0; iii < cou; ++iii ) {
1363 rect.setLeft ( header()->sectionPos( iii ) );
1364 rect.setRight ( header()->sectionPos( iii ) + header()->sectionSize (iii));
1365 header()->paintSection ( & p, header()->mapToIndex (iii), rect );
1366 }
1367 p.translate( 0, header()->height());
1368 drawContentsOffset ( &p, 0,0, 0,0, contentsWidth (), contentsHeight () );
1369 p.end();
1370#endif
1371}
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h
index f4d6879..c25592d 100644
--- a/korganizer/kolistview.h
+++ b/korganizer/kolistview.h
@@ -218,2 +218,3 @@ class KOListViewListView : public KListView
218 bool hasMultiSelection(QListViewItem*); 218 bool hasMultiSelection(QListViewItem*);
219 void printList();
219 signals: 220 signals:
@@ -268,2 +269,4 @@ class KOListView : public KOEventView
268 public slots: 269 public slots:
270 void hideAll();
271 void printList();
269 void resetFocus(); 272 void resetFocus();
diff --git a/version b/version
index 3a546e2..f3e46b1 100644
--- a/version
+++ b/version
@@ -1 +1 @@
version = "2.1.5"; version = "2.1.6";