Diffstat (limited to 'korganizer/koeventviewerdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeventviewerdialog.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp index 2e936f3..3a37852 100644 --- a/korganizer/koeventviewerdialog.cpp +++ b/korganizer/koeventviewerdialog.cpp | |||
@@ -1,126 +1,129 @@ | |||
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 <qtimer.h> | 23 | #include <qtimer.h> |
24 | #include <qpushbutton.h> | 24 | #include <qpushbutton.h> |
25 | //Added by qt3to4: | ||
26 | #include <QHideEvent> | ||
27 | #include <QKeyEvent> | ||
25 | 28 | ||
26 | #include "koeventviewer.h" | 29 | #include "koeventviewer.h" |
27 | #include <kmessagebox.h> | 30 | #include <kmessagebox.h> |
28 | #include "koprefs.h" | 31 | #include "koprefs.h" |
29 | #include <libkcal/todo.h> | 32 | #include <libkcal/todo.h> |
30 | #include "qapp.h" | 33 | #include "qapplication.h" |
31 | 34 | ||
32 | #include "koeventviewerdialog.h" | 35 | #include "koeventviewerdialog.h" |
33 | extern int globalFlagBlockAgenda; | 36 | extern int globalFlagBlockAgenda; |
34 | 37 | ||
35 | KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name) | 38 | KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name) |
36 | : KDialogBase(parent,name, | 39 | : KDialogBase(parent,name, |
37 | #ifndef DESKTOP_VERSION | 40 | #ifndef DESKTOP_VERSION |
38 | true , | 41 | true , |
39 | #else | 42 | #else |
40 | false, | 43 | false, |
41 | #endif | 44 | #endif |
42 | i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda")) | 45 | i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda")) |
43 | { | 46 | { |
44 | sendSignalViewerClosed = true; | 47 | sendSignalViewerClosed = true; |
45 | mEventViewer = new KOEventViewer(this); | 48 | mEventViewer = new KOEventViewer(this); |
46 | mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); | 49 | mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); |
47 | setMainWidget(mEventViewer); | 50 | setMainWidget(mEventViewer); |
48 | setButtonText(Ok, i18n("Edit") ); | 51 | setButtonText(Ok, i18n("Edit") ); |
49 | 52 | ||
50 | QObject::connect(findButton( Ok ),SIGNAL(clicked()), | 53 | QObject::connect(findButton( Ok ),SIGNAL(clicked()), |
51 | SLOT(editIncidence())); | 54 | SLOT(editIncidence())); |
52 | QObject::connect(this,SIGNAL(user1Clicked()), | 55 | QObject::connect(this,SIGNAL(user1Clicked()), |
53 | SLOT(showIncidence())); | 56 | SLOT(showIncidence())); |
54 | connect( mEventViewer, SIGNAL( showIncidence( QString ) ),SIGNAL( showIncidence( QString ) )); | 57 | connect( mEventViewer, SIGNAL( showIncidence( QString ) ),SIGNAL( showIncidence( QString ) )); |
55 | mIncidence = 0; | 58 | mIncidence = 0; |
56 | // TODO: Set a sensible size (based on the content?). | 59 | // TODO: Set a sensible size (based on the content?). |
57 | //showMaximized(); | 60 | //showMaximized(); |
58 | //qDebug("++++++++++++KOEventViewerDialog() "); | 61 | //qDebug("++++++++++++KOEventViewerDialog() "); |
59 | // if ( KOPrefs::instance()->mCompactDialogs ) { | 62 | // if ( KOPrefs::instance()->mCompactDialogs ) { |
60 | // setFixedSize( 240,284 ); | 63 | // setFixedSize( 240,284 ); |
61 | // move( 0, 15 ); | 64 | // move( 0, 15 ); |
62 | // } else { | 65 | // } else { |
63 | // setMinimumSize(300,200); | 66 | // setMinimumSize(300,200); |
64 | // resize(320,300); | 67 | // resize(320,300); |
65 | // } | 68 | // } |
66 | mSyncMode = false; | 69 | mSyncMode = false; |
67 | mSyncResult = 0; | 70 | mSyncResult = 0; |
68 | 71 | ||
69 | } | 72 | } |
70 | 73 | ||
71 | KOEventViewerDialog::~KOEventViewerDialog() | 74 | KOEventViewerDialog::~KOEventViewerDialog() |
72 | { | 75 | { |
73 | //qDebug("-------~KOEventViewerDialog() "); | 76 | //qDebug("-------~KOEventViewerDialog() "); |
74 | } | 77 | } |
75 | void KOEventViewerDialog::showMe() | 78 | void KOEventViewerDialog::showMe() |
76 | { | 79 | { |
77 | 80 | ||
78 | #ifdef DESKTOP_VERSION | 81 | #ifdef DESKTOP_VERSION |
79 | int x,y,w,h; | 82 | int x,y,w,h; |
80 | x = geometry().x(); | 83 | x = geometry().x(); |
81 | y = geometry().y(); | 84 | y = geometry().y(); |
82 | w = width(); | 85 | w = width(); |
83 | h = height(); | 86 | h = height(); |
84 | show(); | 87 | show(); |
85 | setGeometry(x,y,w,h); | 88 | setGeometry(x,y,w,h); |
86 | raise(); | 89 | raise(); |
87 | #else | 90 | #else |
88 | showMaximized(); | 91 | showMaximized(); |
89 | #endif | 92 | #endif |
90 | QTimer::singleShot( 1, this, SLOT ( setMyFocus() ) ); | 93 | QTimer::singleShot( 1, this, SLOT ( setMyFocus() ) ); |
91 | 94 | ||
92 | } | 95 | } |
93 | void KOEventViewerDialog::setMyFocus() | 96 | void KOEventViewerDialog::setMyFocus() |
94 | { | 97 | { |
95 | 98 | ||
96 | setActiveWindow(); | 99 | setActiveWindow(); |
97 | mEventViewer->setFocus(); | 100 | mEventViewer->setFocus(); |
98 | 101 | ||
99 | } | 102 | } |
100 | void KOEventViewerDialog::print() | 103 | void KOEventViewerDialog::print() |
101 | { | 104 | { |
102 | mEventViewer->printMe(); | 105 | mEventViewer->printMe(); |
103 | 106 | ||
104 | } | 107 | } |
105 | void KOEventViewerDialog::setSyncMode( bool b ) | 108 | void KOEventViewerDialog::setSyncMode( bool b ) |
106 | { | 109 | { |
107 | mSyncMode = b; | 110 | mSyncMode = b; |
108 | //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode ); | 111 | //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode ); |
109 | if ( mSyncMode ) { | 112 | if ( mSyncMode ) { |
110 | findButton( Close )->setText( i18n("Cancel Sync")); | 113 | findButton( Close )->setText( i18n("Cancel Sync")); |
111 | findButton( Ok )->setText( i18n("Remote")); | 114 | findButton( Ok )->setText( i18n("Remote")); |
112 | findButton( User1 )->setText( i18n("Local")); | 115 | findButton( User1 )->setText( i18n("Local")); |
113 | } else { | 116 | } else { |
114 | findButton( Close )->setText( i18n("Close")); | 117 | findButton( Close )->setText( i18n("Close")); |
115 | findButton( Ok )->setText( i18n("Edit")); | 118 | findButton( Ok )->setText( i18n("Edit")); |
116 | findButton( User1 )->setText( i18n("Agenda")); | 119 | findButton( User1 )->setText( i18n("Agenda")); |
117 | } | 120 | } |
118 | mEventViewer->setSyncMode( b ); | 121 | mEventViewer->setSyncMode( b ); |
119 | } | 122 | } |
120 | void KOEventViewerDialog::setColorMode( int m ) | 123 | void KOEventViewerDialog::setColorMode( int m ) |
121 | { | 124 | { |
122 | mEventViewer->setColorMode( m ); | 125 | mEventViewer->setColorMode( m ); |
123 | } | 126 | } |
124 | int KOEventViewerDialog::executeS( bool local ) | 127 | int KOEventViewerDialog::executeS( bool local ) |
125 | { | 128 | { |
126 | mSyncResult = 3; | 129 | mSyncResult = 3; |