summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebook.cpp
Unidiff
Diffstat (limited to 'core/pim/datebook/datebook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebook.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp
index 8ae4f84..70dd7b5 100644
--- a/core/pim/datebook/datebook.cpp
+++ b/core/pim/datebook/datebook.cpp
@@ -218,96 +218,97 @@ void DateBook::receive( const QCString &msg, const QByteArray &data )
218 else if ( weekAction->isOn() ) 218 else if ( weekAction->isOn() )
219 viewWeek(); 219 viewWeek();
220 else if ( monthAction->isOn() ) 220 else if ( monthAction->isOn() )
221 viewMonth(); 221 viewMonth();
222 } 222 }
223 else if (msg == "editEvent(int)") { 223 else if (msg == "editEvent(int)") {
224 int uid; 224 int uid;
225 stream >> uid; 225 stream >> uid;
226 Event e=db->eventByUID(uid); 226 Event e=db->eventByUID(uid);
227 editEvent(e); 227 editEvent(e);
228 }else if (msg == "viewDefault(QDate)"){ 228 }else if (msg == "viewDefault(QDate)"){
229 QDate day; 229 QDate day;
230 stream >> day; 230 stream >> day;
231 viewDefault(day); 231 viewDefault(day);
232 } 232 }
233} 233}
234 234
235DateBook::~DateBook() 235DateBook::~DateBook()
236{ 236{
237 delete db_holiday; 237 delete db_holiday;
238} 238}
239 239
240void DateBook::slotSettings() 240void DateBook::slotSettings()
241{ 241{
242 DateBookSettings frmSettings( ampm, this ); 242 DateBookSettings frmSettings( ampm, this );
243 frmSettings.setStartTime( startTime ); 243 frmSettings.setStartTime( startTime );
244 frmSettings.setAlarmPreset( aPreset, presetTime ); 244 frmSettings.setAlarmPreset( aPreset, presetTime );
245 frmSettings.setJumpToCurTime( bJumpToCurTime ); 245 frmSettings.setJumpToCurTime( bJumpToCurTime );
246 frmSettings.setRowStyle( rowStyle ); 246 frmSettings.setRowStyle( rowStyle );
247 frmSettings.comboDefaultView->setCurrentItem(defaultView-1); 247 frmSettings.comboDefaultView->setCurrentItem(defaultView-1);
248 frmSettings.comboWeekListView->setCurrentItem(weeklistviewconfig); 248 frmSettings.comboWeekListView->setCurrentItem(weeklistviewconfig);
249 frmSettings.setPluginList(db_holiday->pluginManager(),db_holiday->pluginLoader()); 249 frmSettings.setPluginList(db_holiday->pluginManager(),db_holiday->pluginLoader());
250 250
251 bool found=false; 251 bool found=false;
252 for (int i=0; i<(frmSettings.comboLocation->count()); i++) { 252 for (int i=0; i<(frmSettings.comboLocation->count()); i++) {
253 if ( frmSettings.comboLocation->text(i) == defaultLocation ) { 253 if ( frmSettings.comboLocation->text(i) == defaultLocation ) {
254 frmSettings.comboLocation->setCurrentItem(i); 254 frmSettings.comboLocation->setCurrentItem(i);
255 found=true; 255 found=true;
256 break; 256 break;
257 } 257 }
258 } 258 }
259 if(!found) { 259 if(!found) {
260 frmSettings.comboLocation->insertItem(defaultLocation); 260 frmSettings.comboLocation->insertItem(defaultLocation);
261 frmSettings.comboLocation->setCurrentItem(frmSettings.comboLocation->count()-1); 261 frmSettings.comboLocation->setCurrentItem(frmSettings.comboLocation->count()-1);
262 } 262 }
263 frmSettings.comboCategory->setCategories(defaultCategories,"Calendar", tr("Calendar")); 263 frmSettings.comboCategory->setCategories(defaultCategories,"Calendar", tr("Calendar"));
264 264
265 if ( QPEApplication::execDialog( &frmSettings ) ) { 265 if ( QPEApplication::execDialog( &frmSettings ) ) {
266 frmSettings.savePlugins();
266 db_holiday->pluginManager()->save(); 267 db_holiday->pluginManager()->save();
267 db_holiday->reloadPlugins(); 268 db_holiday->reloadPlugins();
268 269
269 aPreset = frmSettings.alarmPreset(); 270 aPreset = frmSettings.alarmPreset();
270 presetTime = frmSettings.presetTime(); 271 presetTime = frmSettings.presetTime();
271 startTime = frmSettings.startTime(); 272 startTime = frmSettings.startTime();
272 bJumpToCurTime = frmSettings.jumpToCurTime(); 273 bJumpToCurTime = frmSettings.jumpToCurTime();
273 rowStyle = frmSettings.rowStyle(); 274 rowStyle = frmSettings.rowStyle();
274 defaultView=frmSettings.comboDefaultView->currentItem()+1; 275 defaultView=frmSettings.comboDefaultView->currentItem()+1;
275 weeklistviewconfig=frmSettings.comboWeekListView->currentItem(); 276 weeklistviewconfig=frmSettings.comboWeekListView->currentItem();
276 defaultLocation=frmSettings.comboLocation->currentText(); 277 defaultLocation=frmSettings.comboLocation->currentText();
277 defaultCategories=frmSettings.comboCategory->currentCategories(); 278 defaultCategories=frmSettings.comboCategory->currentCategories();
278 279
279 if ( dayView ) { 280 if ( dayView ) {
280 dayView->setStartViewTime( startTime ); 281 dayView->setStartViewTime( startTime );
281 dayView->setJumpToCurTime( bJumpToCurTime ); 282 dayView->setJumpToCurTime( bJumpToCurTime );
282 dayView->setRowStyle( rowStyle ); 283 dayView->setRowStyle( rowStyle );
283 } 284 }
284 if ( weekView ) { 285 if ( weekView ) {
285 weekView->setStartViewTime( startTime ); 286 weekView->setStartViewTime( startTime );
286 } 287 }
287 saveSettings(); 288 saveSettings();
288 289
289 // make the change obvious 290 // make the change obvious
290 if ( views->visibleWidget() ) { 291 if ( views->visibleWidget() ) {
291 if ( views->visibleWidget() == dayView ) 292 if ( views->visibleWidget() == dayView )
292 dayView->redraw(); 293 dayView->redraw();
293 else if ( views->visibleWidget() == weekView ) 294 else if ( views->visibleWidget() == weekView )
294 weekView->redraw(); 295 weekView->redraw();
295 else if ( views->visibleWidget() == weekLstView ) 296 else if ( views->visibleWidget() == weekLstView )
296 weekLstView->redraw(); 297 weekLstView->redraw();
297 } 298 }
298 } 299 }
299} 300}
300 301
301void DateBook::fileNew() 302void DateBook::fileNew()
302{ 303{
303 slotNewEventFromKey(""); 304 slotNewEventFromKey("");
304} 305}
305 306
306QString DateBook::checkEvent(const Event &e) 307QString DateBook::checkEvent(const Event &e)
307{ 308{
308 /* check if overlaps with itself */ 309 /* check if overlaps with itself */
309 bool checkFailed = FALSE; 310 bool checkFailed = FALSE;
310 311
311 /* check the next 12 repeats. should catch most problems */ 312 /* check the next 12 repeats. should catch most problems */
312 QDate current_date = e.start().date(); 313 QDate current_date = e.start().date();
313 Event previous = e; 314 Event previous = e;