summaryrefslogtreecommitdiffabout
path: root/korganizer/kojournalview.cpp
authorzautrix <zautrix>2004-06-26 19:01:18 (UTC)
committer zautrix <zautrix>2004-06-26 19:01:18 (UTC)
commitb9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (unidiff)
tree2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /korganizer/kojournalview.cpp
downloadkdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2
Initial revision
Diffstat (limited to 'korganizer/kojournalview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kojournalview.cpp113
1 files changed, 113 insertions, 0 deletions
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp
new file mode 100644
index 0000000..579f24d
--- a/dev/null
+++ b/korganizer/kojournalview.cpp
@@ -0,0 +1,113 @@
1/*
2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4
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
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
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
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution.
22*/
23
24//
25// View of Journal entries
26
27#include <qlayout.h>
28#include <qpopupmenu.h>
29
30#include <klocale.h>
31#include <kdebug.h>
32#include "koprefs.h"
33
34#include <libkcal/calendar.h>
35
36#include "journalentry.h"
37
38#include "kojournalview.h"
39using namespace KOrg;
40#include "kojournalview.moc"
41
42KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent,
43 const char *name)
44 : KOrg::BaseView(calendar, parent, name)
45{
46 mEntry = new JournalEntry(calendar,this);
47 mEntry->setFont ( KOPrefs::instance()->mJornalViewFont );
48 QBoxLayout *topLayout = new QVBoxLayout(this);
49 topLayout->addWidget(mEntry);
50 connect ( mEntry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ;
51}
52
53KOJournalView::~KOJournalView()
54{
55}
56
57int KOJournalView::currentDateCount()
58{
59 return 0;
60}
61
62QPtrList<Incidence> KOJournalView::selectedIncidences()
63{
64 QPtrList<Incidence> eventList;
65
66 return eventList;
67}
68void KOJournalView::updateConfig()
69{
70 mEntry->setFont ( KOPrefs::instance()->mJornalViewFont );
71}
72void KOJournalView::updateView()
73{
74 mEntry->setFont ( KOPrefs::instance()->mJornalViewFont );
75}
76
77void KOJournalView::flushView()
78{
79 mEntry->flushEntry();
80}
81
82void KOJournalView::showDates(const QDate &start, const QDate &)
83{
84// kdDebug() << "KOJournalView::selectDates()" << endl;
85
86 mEntry->setDate(start);
87
88 Journal *j = calendar()->journal(start);
89 if (j) mEntry->setJournal(j);
90 else mEntry->clear();
91
92// emit incidenceSelected( 0 );
93}
94
95void KOJournalView::showEvents(QPtrList<Event>)
96{
97 // After new creation of list view no events are selected.
98// emit incidenceSelected( 0 );
99}
100
101void KOJournalView::changeEventDisplay(Event *, int /*action*/)
102{
103 updateView();
104}
105
106void KOJournalView::keyPressEvent ( QKeyEvent * e )
107{
108 //qDebug("keyPressEven ");
109 if ( e->state() == Qt::ControlButton ) {
110 if ( e->key () == Qt::Key_Right || e->key () == Qt::Key_Left )
111 e->ignore();
112 }
113}