-rw-r--r-- | korganizer/koeventeditor.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp index 337db9b..e23e680 100644 --- a/korganizer/koeventeditor.cpp +++ b/korganizer/koeventeditor.cpp | |||
@@ -141,97 +141,96 @@ void KOEventEditor::setupGeneral() | |||
141 | 141 | ||
142 | QFrame *topFrame2 = addPage(i18n("Details")); | 142 | QFrame *topFrame2 = addPage(i18n("Details")); |
143 | 143 | ||
144 | QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); | 144 | QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); |
145 | topLayout2->setSpacing(spacingHint()); | 145 | topLayout2->setSpacing(spacingHint()); |
146 | 146 | ||
147 | mGeneral->initClass(topFrame2,topLayout2); | 147 | mGeneral->initClass(topFrame2,topLayout2); |
148 | mGeneral->initSecrecy( topFrame2, topLayout2 ); | 148 | mGeneral->initSecrecy( topFrame2, topLayout2 ); |
149 | mGeneral->initDescription(topFrame2,topLayout2); | 149 | mGeneral->initDescription(topFrame2,topLayout2); |
150 | 150 | ||
151 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); | 151 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); |
152 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); | 152 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); |
153 | } else { | 153 | } else { |
154 | QFrame *topFrame = addPage(i18n("General")); | 154 | QFrame *topFrame = addPage(i18n("General")); |
155 | 155 | ||
156 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); | 156 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); |
157 | topLayout->setSpacing(spacingHint()); | 157 | topLayout->setSpacing(spacingHint()); |
158 | 158 | ||
159 | mGeneral->initHeader(topFrame,topLayout); | 159 | mGeneral->initHeader(topFrame,topLayout); |
160 | mGeneral->initTime(topFrame,topLayout); | 160 | mGeneral->initTime(topFrame,topLayout); |
161 | QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); | 161 | QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); |
162 | mGeneral->initAlarm(topFrame,alarmLineLayout); | 162 | mGeneral->initAlarm(topFrame,alarmLineLayout); |
163 | mGeneral->initClass(topFrame,alarmLineLayout); | 163 | mGeneral->initClass(topFrame,alarmLineLayout); |
164 | mGeneral->initDescription(topFrame,topLayout); | 164 | mGeneral->initDescription(topFrame,topLayout); |
165 | QBoxLayout *detailsLayout = new QHBoxLayout(topLayout); | 165 | QBoxLayout *detailsLayout = new QHBoxLayout(topLayout); |
166 | mGeneral->initCategories( topFrame, detailsLayout ); | 166 | mGeneral->initCategories( topFrame, detailsLayout ); |
167 | mGeneral->initSecrecy( topFrame, detailsLayout ); | 167 | mGeneral->initSecrecy( topFrame, detailsLayout ); |
168 | } | 168 | } |
169 | 169 | ||
170 | mGeneral->finishSetup(); | 170 | mGeneral->finishSetup(); |
171 | 171 | ||
172 | } | 172 | } |
173 | 173 | ||
174 | void KOEventEditor::setupRecurrence() | 174 | void KOEventEditor::setupRecurrence() |
175 | { | 175 | { |
176 | QFrame *topFrame = addPage( i18n("Recurrence") ); | 176 | QFrame *topFrame = addPage( i18n("Recurrence") ); |
177 | QBoxLayout *topLayout = new QVBoxLayout( topFrame ); | 177 | QBoxLayout *topLayout = new QVBoxLayout( topFrame ); |
178 | 178 | ||
179 | mRecurrence = new KOEditorRecurrence( topFrame ); | 179 | mRecurrence = new KOEditorRecurrence( topFrame ); |
180 | topLayout->addWidget( mRecurrence ); | 180 | topLayout->addWidget( mRecurrence ); |
181 | } | 181 | } |
182 | 182 | ||
183 | void KOEventEditor::editEvent(Event *event, bool showDescription) | 183 | void KOEventEditor::editEvent(Event *event, bool showDescription) |
184 | { | 184 | { |
185 | // init(); | 185 | // init(); |
186 | 186 | ||
187 | mEvent = event; | 187 | mEvent = event; |
188 | readEvent(mEvent); | 188 | readEvent(mEvent); |
189 | qApp->processEvents(); | ||
190 | if ( showDescription ) { | 189 | if ( showDescription ) { |
191 | showPage( 1 ); | 190 | showPage( 1 ); |
192 | mGeneral->setFocusOn( 1 ); | 191 | mGeneral->setFocusOn( 1 ); |
193 | } else { | 192 | } else { |
194 | showPage( 0 ); | 193 | showPage( 0 ); |
195 | mGeneral->setFocusOn( 2 ); | 194 | mGeneral->setFocusOn( 2 ); |
196 | } | 195 | } |
197 | } | 196 | } |
198 | 197 | ||
199 | void KOEventEditor::newEvent( QDateTime from, QDateTime to, bool allDay ) | 198 | void KOEventEditor::newEvent( QDateTime from, QDateTime to, bool allDay ) |
200 | { | 199 | { |
201 | // init(); | 200 | // init(); |
202 | 201 | ||
203 | mEvent = 0; | 202 | mEvent = 0; |
204 | setDefaults(from,to,allDay); | 203 | setDefaults(from,to,allDay); |
205 | } | 204 | } |
206 | 205 | ||
207 | void KOEventEditor::loadDefaults() | 206 | void KOEventEditor::loadDefaults() |
208 | { | 207 | { |
209 | int fmt = KOPrefs::instance()->mStartTime; | 208 | int fmt = KOPrefs::instance()->mStartTime; |
210 | 209 | ||
211 | QDateTime from(QDate::currentDate(), QTime(fmt,0,0)); | 210 | QDateTime from(QDate::currentDate(), QTime(fmt,0,0)); |
212 | QDateTime to(QDate::currentDate(), | 211 | QDateTime to(QDate::currentDate(), |
213 | QTime(fmt+KOPrefs::instance()->mDefaultDuration,0,0)); | 212 | QTime(fmt+KOPrefs::instance()->mDefaultDuration,0,0)); |
214 | 213 | ||
215 | setDefaults(from,to,false); | 214 | setDefaults(from,to,false); |
216 | } | 215 | } |
217 | 216 | ||
218 | bool KOEventEditor::processInput( bool emitTime ) | 217 | bool KOEventEditor::processInput( bool emitTime ) |
219 | { | 218 | { |
220 | if (!validateInput()) return false; | 219 | if (!validateInput()) return false; |
221 | 220 | ||
222 | Event *event = 0; | 221 | Event *event = 0; |
223 | 222 | ||
224 | if (mEvent) event = mEvent; | 223 | if (mEvent) event = mEvent; |
225 | else { | 224 | else { |
226 | event = new Event; | 225 | event = new Event; |
227 | event->setOrganizer(KOPrefs::instance()->email()); | 226 | event->setOrganizer(KOPrefs::instance()->email()); |
228 | } | 227 | } |
229 | 228 | ||
230 | writeEvent(event); | 229 | writeEvent(event); |
231 | if ( emitTime ) { | 230 | if ( emitTime ) { |
232 | globalFlagBlockAgenda = 1; | 231 | globalFlagBlockAgenda = 1; |
233 | emit showAgendaView( false ); | 232 | emit showAgendaView( false ); |
234 | emit jumpToTime( event->dtStart().date() ); | 233 | emit jumpToTime( event->dtStart().date() ); |
235 | globalFlagBlockAgenda = 2; | 234 | globalFlagBlockAgenda = 2; |
236 | 235 | ||
237 | } | 236 | } |