summaryrefslogtreecommitdiffabout
path: root/korganizer/kojournalview.cpp
Unidiff
Diffstat (limited to 'korganizer/kojournalview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kojournalview.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp
index fae59d6..9e354d3 100644
--- a/korganizer/kojournalview.cpp
+++ b/korganizer/kojournalview.cpp
@@ -1,108 +1,115 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24// 24//
25// View of Journal entries 25// View of Journal entries
26 26
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qscrollview.h>
28#include <qpopupmenu.h> 29#include <qpopupmenu.h>
29 30
30#include <klocale.h> 31#include <klocale.h>
31#include <kdebug.h> 32#include <kdebug.h>
32#include "koprefs.h" 33#include "koprefs.h"
33 34
34#include <libkcal/calendar.h> 35#include <libkcal/calendar.h>
35 36
36#include "journalentry.h" 37#include "journalentry.h"
37 38
38#include "kojournalview.h" 39#include "kojournalview.h"
39using namespace KOrg; 40using namespace KOrg;
40 41
41KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, 42KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent,
42 const char *name) 43 const char *name)
43 : KOrg::BaseView(calendar, parent, name) 44 : KOrg::BaseView(calendar, parent, name)
44{ 45{
45 mCalendar = calendar; 46 mCalendar = calendar;
46 mTopLayout = new QVBoxLayout(this); 47 QScrollView * sv = new QScrollView( this );
48 QHBoxLayout * hbl = new QHBoxLayout( this );
49 hbl->addWidget( sv );
50 parWid = new QWidget( sv->viewport() );
51 sv->addChild(parWid);
52 sv->setResizePolicy( QScrollView:: AutoOneFit );
53 mTopLayout = new QVBoxLayout(parWid);
47 getNewEntry(); 54 getNewEntry();
48} 55}
49 56
50KOJournalView::~KOJournalView() 57KOJournalView::~KOJournalView()
51{ 58{
52} 59}
53 60
54int KOJournalView::currentDateCount() 61int KOJournalView::currentDateCount()
55{ 62{
56 return 0; 63 return 0;
57} 64}
58JournalEntry* KOJournalView::getNewEntry() 65JournalEntry* KOJournalView::getNewEntry()
59{ 66{
60 JournalEntry* Entry = new JournalEntry(mCalendar,this); 67 JournalEntry* Entry = new JournalEntry(mCalendar,parWid);
61 jEntries.append( Entry ); 68 jEntries.append( Entry );
62 mTopLayout->addWidget(Entry); 69 mTopLayout->addWidget(Entry);
63 Entry->setFont ( KOPrefs::instance()->mJornalViewFont ); 70 Entry->setFont ( KOPrefs::instance()->mJornalViewFont );
64 connect ( Entry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ; 71 connect ( Entry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ;
65 connect ( Entry,SIGNAL(newJournal() ),this ,SLOT(newJournal() ) ) ; 72 connect ( Entry,SIGNAL(newJournal() ),this ,SLOT(newJournal() ) ) ;
66 connect ( Entry,SIGNAL(showJournalOnly( Journal * ) ),this ,SLOT(showOnly ( Journal* ) ) ) ; 73 connect ( Entry,SIGNAL(showJournalOnly( Journal * ) ),this ,SLOT(showOnly ( Journal* ) ) ) ;
67 return Entry; 74 return Entry;
68} 75}
69 76
70QPtrList<Incidence> KOJournalView::selectedIncidences() 77QPtrList<Incidence> KOJournalView::selectedIncidences()
71{ 78{
72 QPtrList<Incidence> eventList; 79 QPtrList<Incidence> eventList;
73 80
74 return eventList; 81 return eventList;
75} 82}
76void KOJournalView::updateConfig() 83void KOJournalView::updateConfig()
77{ 84{
78 JournalEntry* mEntry = jEntries.first(); 85 JournalEntry* mEntry = jEntries.first();
79 while ( mEntry ) { 86 while ( mEntry ) {
80 mEntry->setFont ( KOPrefs::instance()->mJornalViewFont ); 87 mEntry->setFont ( KOPrefs::instance()->mJornalViewFont );
81 mEntry = jEntries.next(); 88 mEntry = jEntries.next();
82 } 89 }
83} 90}
84void KOJournalView::updateView() 91void KOJournalView::updateView()
85{ 92{
86 JournalEntry* mEntry = jEntries.first(); 93 JournalEntry* mEntry = jEntries.first();
87 while ( mEntry ) { 94 while ( mEntry ) {
88 mEntry->setFont ( KOPrefs::instance()->mJornalViewFont ); 95 mEntry->setFont ( KOPrefs::instance()->mJornalViewFont );
89 mEntry = jEntries.next(); 96 mEntry = jEntries.next();
90 } 97 }
91 showDates( mDate, QDate() ); 98 showDates( mDate, QDate() );
92} 99}
93 100
94void KOJournalView::flushView() 101void KOJournalView::flushView()
95{ 102{
96 JournalEntry* mEntry = jEntries.first(); 103 JournalEntry* mEntry = jEntries.first();
97 while ( mEntry ) { 104 while ( mEntry ) {
98 mEntry->flushEntry(); 105 mEntry->flushEntry();
99 mEntry = jEntries.next(); 106 mEntry = jEntries.next();
100 } 107 }
101} 108}
102 109
103void KOJournalView::clearList() 110void KOJournalView::clearList()
104{ 111{
105 JournalEntry* mEntry = jEntries.first(); 112 JournalEntry* mEntry = jEntries.first();
106 while ( mEntry ) { 113 while ( mEntry ) {
107 mEntry->clear(); 114 mEntry->clear();
108 mEntry = jEntries.next(); 115 mEntry = jEntries.next();