Diffstat (limited to 'korganizer/koeventviewerdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | korganizer/koeventviewerdialog.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp index be183eb..68c0e1a 100644 --- a/korganizer/koeventviewerdialog.cpp +++ b/korganizer/koeventviewerdialog.cpp | |||
@@ -134,106 +134,107 @@ void KOEventViewerDialog::setIncidence(Incidence *in ) | |||
134 | void KOEventViewerDialog::addIncidence(Incidence *in) | 134 | void KOEventViewerDialog::addIncidence(Incidence *in) |
135 | { | 135 | { |
136 | if ( in->type() == "Event" ) | 136 | if ( in->type() == "Event" ) |
137 | addEvent( (Event*) in ); | 137 | addEvent( (Event*) in ); |
138 | else if ( in->type() =="Todo" ) | 138 | else if ( in->type() =="Todo" ) |
139 | mEventViewer->setTodo( (Todo*) in, false ); | 139 | mEventViewer->setTodo( (Todo*) in, false ); |
140 | else if ( in->type() =="Journal" ) | 140 | else if ( in->type() =="Journal" ) |
141 | mEventViewer->setJournal( (Journal*) in, false ); | 141 | mEventViewer->setJournal( (Journal*) in, false ); |
142 | if ( mSyncMode ) { | 142 | if ( mSyncMode ) { |
143 | findButton( User1 )->setFocus(); | 143 | findButton( User1 )->setFocus(); |
144 | setCaption(i18n("Conflict! Please choose entry")); | 144 | setCaption(i18n("Conflict! Please choose entry")); |
145 | } | 145 | } |
146 | } | 146 | } |
147 | 147 | ||
148 | void KOEventViewerDialog::addEvent(Event *event) | 148 | void KOEventViewerDialog::addEvent(Event *event) |
149 | { | 149 | { |
150 | mEventViewer->addEvent(event); | 150 | mEventViewer->addEvent(event); |
151 | mIncidence = event; | 151 | mIncidence = event; |
152 | findButton( Close )->setFocus(); | 152 | findButton( Close )->setFocus(); |
153 | } | 153 | } |
154 | 154 | ||
155 | void KOEventViewerDialog::setTodo(Todo *event) | 155 | void KOEventViewerDialog::setTodo(Todo *event) |
156 | { | 156 | { |
157 | mEventViewer->setTodo(event); | 157 | mEventViewer->setTodo(event); |
158 | mIncidence = (Incidence*)event; | 158 | mIncidence = (Incidence*)event; |
159 | findButton( Close )->setFocus(); | 159 | findButton( Close )->setFocus(); |
160 | } | 160 | } |
161 | void KOEventViewerDialog::setJournal(Journal *j) | 161 | void KOEventViewerDialog::setJournal(Journal *j) |
162 | { | 162 | { |
163 | mEventViewer->setJournal(j); | 163 | mEventViewer->setJournal(j); |
164 | mIncidence = (Incidence*)j; | 164 | mIncidence = (Incidence*)j; |
165 | findButton( Close )->setFocus(); | 165 | findButton( Close )->setFocus(); |
166 | } | 166 | } |
167 | 167 | ||
168 | void KOEventViewerDialog::addText(QString text) | 168 | void KOEventViewerDialog::addText(QString text) |
169 | { | 169 | { |
170 | mEventViewer->addText(text); | 170 | mEventViewer->addText(text); |
171 | findButton( Close )->setFocus(); | 171 | findButton( Close )->setFocus(); |
172 | } | 172 | } |
173 | void KOEventViewerDialog::editIncidence() | 173 | void KOEventViewerDialog::editIncidence() |
174 | { | 174 | { |
175 | if ( mSyncMode ) { | 175 | if ( mSyncMode ) { |
176 | mSyncResult = 2; | 176 | mSyncResult = 2; |
177 | accept(); | 177 | accept(); |
178 | return; | 178 | return; |
179 | } | 179 | } |
180 | if ( mIncidence ){ | 180 | if ( mIncidence ){ |
181 | #ifndef DESKTOP_VERSION | 181 | #ifndef DESKTOP_VERSION |
182 | hide(); | 182 | hide(); |
183 | #endif | 183 | #endif |
184 | emit editIncidence( mIncidence ); | 184 | emit editIncidence( mIncidence ); |
185 | } | 185 | } |
186 | } | 186 | } |
187 | void KOEventViewerDialog::showIncidence() | 187 | void KOEventViewerDialog::showIncidence() |
188 | { | 188 | { |
189 | 189 | ||
190 | if ( mSyncMode ) { | 190 | if ( mSyncMode ) { |
191 | mSyncResult = 1; | 191 | mSyncResult = 1; |
192 | accept(); | 192 | accept(); |
193 | return; | 193 | return; |
194 | } | 194 | } |
195 | 195 | ||
196 | if ( mIncidence ){ | 196 | if ( mIncidence ){ |
197 | #ifndef DESKTOP_VERSION | 197 | #ifndef DESKTOP_VERSION |
198 | hide(); | 198 | hide(); |
199 | #endif | 199 | #endif |
200 | QDate date; | 200 | QDate date; |
201 | if ( mIncidence->type() == "Todo" ) { | 201 | if ( mIncidence->type() == "Todo" ) { |
202 | if ( ((Todo*)mIncidence)->hasDueDate() ) | 202 | if ( ((Todo*)mIncidence)->hasDueDate() ) |
203 | date = ((Todo*)mIncidence)->dtDue().date(); | 203 | date = ((Todo*)mIncidence)->dtDue().date(); |
204 | else { | 204 | else { |
205 | globalFlagBlockAgenda = 2; | 205 | globalFlagBlockAgenda = 2; |
206 | emit showAgendaView( false ); | 206 | emit showAgendaView( false ); |
207 | return; | 207 | return; |
208 | } | 208 | } |
209 | } else | 209 | } else |
210 | date = mIncidence->dtStart().date(); | 210 | date = mIncidence->dtStart().date(); |
211 | globalFlagBlockAgenda = 1; | 211 | globalFlagBlockAgenda = 1; |
212 | emit showAgendaView( false ); | 212 | emit showAgendaView( false ); |
213 | globalFlagBlockAgenda = 2; | 213 | globalFlagBlockAgenda = 2; |
214 | emit jumpToTime( date ); | 214 | emit jumpToTime( date ); |
215 | } | 215 | } |
216 | } | 216 | } |
217 | void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e ) | 217 | void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e ) |
218 | { | 218 | { |
219 | switch ( e->key() ) { | 219 | switch ( e->key() ) { |
220 | 220 | ||
221 | case Qt::Key_A : | 221 | case Qt::Key_A : |
222 | case Qt::Key_L : | 222 | case Qt::Key_L : |
223 | showIncidence(); | 223 | showIncidence(); |
224 | break; | 224 | break; |
225 | case Qt::Key_E : | 225 | case Qt::Key_E : |
226 | case Qt::Key_R : | 226 | case Qt::Key_R : |
227 | editIncidence(); | 227 | editIncidence(); |
228 | break; | 228 | break; |
229 | case Qt::Key_C: | 229 | case Qt::Key_C: |
230 | case Qt::Key_Escape: | ||
230 | close(); | 231 | close(); |
231 | break; | 232 | break; |
232 | case Qt::Key_I: | 233 | case Qt::Key_I: |
233 | accept(); | 234 | accept(); |
234 | break; | 235 | break; |
235 | default: | 236 | default: |
236 | break; | 237 | break; |
237 | } | 238 | } |
238 | 239 | ||
239 | } | 240 | } |