summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventviewerdialog.cpp
Unidiff
Diffstat (limited to 'korganizer/koeventviewerdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventviewerdialog.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index 64ab94d..be183eb 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -1,127 +1,126 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,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 19
20#include <klocale.h> 20#include <klocale.h>
21 21
22#include <libkcal/event.h> 22#include <libkcal/event.h>
23#include <qpushbutton.h> 23#include <qpushbutton.h>
24 24
25#include "koeventviewer.h" 25#include "koeventviewer.h"
26#include "koprefs.h" 26#include "koprefs.h"
27#include <libkcal/todo.h> 27#include <libkcal/todo.h>
28#include "qapp.h" 28#include "qapp.h"
29 29
30#include "koeventviewerdialog.h" 30#include "koeventviewerdialog.h"
31#include "koeventviewerdialog.moc"
32extern int globalFlagBlockAgenda; 31extern int globalFlagBlockAgenda;
33 32
34KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name) 33KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name)
35 : KDialogBase(parent,name, 34 : KDialogBase(parent,name,
36#ifndef DESKTOP_VERSION 35#ifndef DESKTOP_VERSION
37 true , 36 true ,
38#else 37#else
39 false, 38 false,
40#endif 39#endif
41 i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda")) 40 i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda"))
42{ 41{
43 42
44 mEventViewer = new KOEventViewer(this); 43 mEventViewer = new KOEventViewer(this);
45 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); 44 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont );
46 setMainWidget(mEventViewer); 45 setMainWidget(mEventViewer);
47 setButtonText(Ok, i18n("Edit") ); 46 setButtonText(Ok, i18n("Edit") );
48 47
49 QObject::connect(findButton( Ok ),SIGNAL(clicked()), 48 QObject::connect(findButton( Ok ),SIGNAL(clicked()),
50 SLOT(editIncidence())); 49 SLOT(editIncidence()));
51 QObject::connect(this,SIGNAL(user1Clicked()), 50 QObject::connect(this,SIGNAL(user1Clicked()),
52 SLOT(showIncidence())); 51 SLOT(showIncidence()));
53 mIncidence = 0; 52 mIncidence = 0;
54 // TODO: Set a sensible size (based on the content?). 53 // TODO: Set a sensible size (based on the content?).
55 //showMaximized(); 54 //showMaximized();
56 //qDebug("++++++++++++KOEventViewerDialog() "); 55 //qDebug("++++++++++++KOEventViewerDialog() ");
57 // if ( KOPrefs::instance()->mCompactDialogs ) { 56 // if ( KOPrefs::instance()->mCompactDialogs ) {
58// setFixedSize( 240,284 ); 57// setFixedSize( 240,284 );
59// move( 0, 15 ); 58// move( 0, 15 );
60// } else { 59// } else {
61// setMinimumSize(300,200); 60// setMinimumSize(300,200);
62// resize(320,300); 61// resize(320,300);
63// } 62// }
64 mSyncMode = false; 63 mSyncMode = false;
65 mSyncResult = 0; 64 mSyncResult = 0;
66 65
67} 66}
68 67
69KOEventViewerDialog::~KOEventViewerDialog() 68KOEventViewerDialog::~KOEventViewerDialog()
70{ 69{
71 //qDebug("-------~KOEventViewerDialog() "); 70 //qDebug("-------~KOEventViewerDialog() ");
72} 71}
73void KOEventViewerDialog::showMe() 72void KOEventViewerDialog::showMe()
74{ 73{
75 74
76#ifdef DESKTOP_VERSION 75#ifdef DESKTOP_VERSION
77 show(); 76 show();
78#else 77#else
79 showMaximized(); 78 showMaximized();
80#endif 79#endif
81 setFocus(); 80 setFocus();
82 setActiveWindow(); 81 setActiveWindow();
83 82
84} 83}
85void KOEventViewerDialog::setSyncMode( bool b ) 84void KOEventViewerDialog::setSyncMode( bool b )
86{ 85{
87 mSyncMode = b; 86 mSyncMode = b;
88 //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode ); 87 //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode );
89 if ( mSyncMode ) { 88 if ( mSyncMode ) {
90 findButton( Close )->setText( i18n("Cancel Sync")); 89 findButton( Close )->setText( i18n("Cancel Sync"));
91 findButton( Ok )->setText( i18n("Remote")); 90 findButton( Ok )->setText( i18n("Remote"));
92 findButton( User1 )->setText( i18n("Local")); 91 findButton( User1 )->setText( i18n("Local"));
93 } else { 92 } else {
94 findButton( Close )->setText( i18n("Close")); 93 findButton( Close )->setText( i18n("Close"));
95 findButton( Ok )->setText( i18n("Edit")); 94 findButton( Ok )->setText( i18n("Edit"));
96 findButton( User1 )->setText( i18n("Agenda")); 95 findButton( User1 )->setText( i18n("Agenda"));
97 } 96 }
98 mEventViewer->setSyncMode( b ); 97 mEventViewer->setSyncMode( b );
99} 98}
100void KOEventViewerDialog::setColorMode( int m ) 99void KOEventViewerDialog::setColorMode( int m )
101{ 100{
102 mEventViewer->setColorMode( m ); 101 mEventViewer->setColorMode( m );
103} 102}
104int KOEventViewerDialog::executeS( bool local ) 103int KOEventViewerDialog::executeS( bool local )
105{ 104{
106 mSyncResult = 3; 105 mSyncResult = 3;
107 if ( local ) 106 if ( local )
108 findButton( User1 )->setFocus(); 107 findButton( User1 )->setFocus();
109 else 108 else
110 findButton( Ok )->setFocus(); 109 findButton( Ok )->setFocus();
111 exec(); 110 exec();
112 return mSyncResult; 111 return mSyncResult;
113} 112}
114 113
115void KOEventViewerDialog::updateConfig() 114void KOEventViewerDialog::updateConfig()
116{ 115{
117 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); 116 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont );
118 117
119} 118}
120void KOEventViewerDialog::setEvent(Event *event) 119void KOEventViewerDialog::setEvent(Event *event)
121{ 120{
122 mEventViewer->setEvent(event); 121 mEventViewer->setEvent(event);
123 mIncidence = event; 122 mIncidence = event;
124 findButton( Close )->setFocus(); 123 findButton( Close )->setFocus();
125} 124}
126void KOEventViewerDialog::setIncidence(Incidence *in ) 125void KOEventViewerDialog::setIncidence(Incidence *in )
127{ 126{