korganizer

kocounterdialog.cpp
1 /*
2  This file is part of KOrganizer.
3 
4  Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 
20  As a special exception, permission is given to link this program
21  with any edition of TQt, and distribute the resulting executable,
22  without including the source code for TQt in the source distribution.
23 */
24 
25 
26 #include <tdelocale.h>
27 
28 #include <libkcal/event.h>
29 #include <libkcal/todo.h>
30 #include "koeventviewer.h"
31 
32 #include "kocounterdialog.h"
33 #include "kocounterdialog.moc"
34 
35 KOCounterDialog::KOCounterDialog( Calendar *calendar, TQWidget *parent, const char *name )
36  : KDialogBase( parent, name, false, i18n("Counter-Event Viewer"),
37  User1 | User2, User1, false, i18n("Decline"), i18n("Accept") )
38 {
39  mEventViewer = new KOEventViewer( calendar, this );
40  setMainWidget( mEventViewer );
41 
42  connect( this, TQ_SIGNAL( user1Clicked() ), TQ_SLOT( slotCancel() ) );
43  connect( this, TQ_SIGNAL( user2Clicked() ), TQ_SLOT( slotOk( ) ) );
44 
45  // FIXME: Set a sensible size (based on the content?).
46  setMinimumSize( 300, 200 );
47  resize( 320, 300 );
48 }
49 
50 KOCounterDialog::~KOCounterDialog()
51 {
52 }
53 
54 void KOCounterDialog::setIncidence( Incidence *incidence )
55 {
56  mEventViewer->setIncidence( incidence );
57 }
58 
59 void KOCounterDialog::addIncidence( Incidence *incidence )
60 {
61  mEventViewer->appendIncidence( incidence );
62 }
63 
64 void KOCounterDialog::addText( const TQString &text )
65 {
66  mEventViewer->addText( text );
67 }
Viewer widget for events.
Definition: koeventviewer.h:41
void setIncidence(Incidence *incidence, const TQDate &date)
Show given incidence in viewer.
void addText(const TQString &text)
Add given text to currently shown content.