summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 8c72d89..70baf5c 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -268,60 +268,61 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) :
268 else 268 else
269 tbd = Left; 269 tbd = Left;
270 } 270 }
271 viewToolBar = new QPEToolBar( this ); 271 viewToolBar = new QPEToolBar( this );
272 addToolBar (viewToolBar , tbd ); 272 addToolBar (viewToolBar , tbd );
273 if ( p->mToolBarHorN ) { 273 if ( p->mToolBarHorN ) {
274 if ( p->mToolBarUpN ) 274 if ( p->mToolBarUpN )
275 tbd = Bottom; 275 tbd = Bottom;
276 else 276 else
277 tbd = Top; 277 tbd = Top;
278 } 278 }
279 else { 279 else {
280 if ( p->mToolBarUpN ) 280 if ( p->mToolBarUpN )
281 tbd = Right; 281 tbd = Right;
282 else 282 else
283 tbd = Left; 283 tbd = Left;
284 } 284 }
285 navigatorToolBar = new QPEToolBar( this ); 285 navigatorToolBar = new QPEToolBar( this );
286 addToolBar (navigatorToolBar , tbd ); 286 addToolBar (navigatorToolBar , tbd );
287 } 287 }
288 288
289 289
290 290
291 mCalendarModifiedFlag = false; 291 mCalendarModifiedFlag = false;
292 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); 292 // QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this );
293 splash->setAlignment ( AlignCenter ); 293 //splash->setAlignment ( AlignCenter );
294 setCentralWidget( splash ); 294 //setCentralWidget( splash );
295#ifndef DESKTOP_VERSION 295#ifndef DESKTOP_VERSION
296 showMaximized(); 296 //showMaximized();
297#endif 297#endif
298 298
299 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); 299 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ());
300 setDefaultPreferences(); 300 setDefaultPreferences();
301 mCalendar = new CalendarLocal(); 301 mCalendar = new CalendarLocal();
302 mView = new CalendarView( mCalendar, this,"mCalendar " ); 302 mView = new CalendarView( mCalendar, this,"mCalendar " );
303 mView->hide(); 303 setCentralWidget( mView );
304 //mView->hide();
304 //mView->resize(splash->size() ); 305 //mView->resize(splash->size() );
305 initActions(); 306 initActions();
306 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); 307 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu);
307 mSyncManager->setBlockSave(false); 308 mSyncManager->setBlockSave(false);
308 mView->setSyncManager(mSyncManager); 309 mView->setSyncManager(mSyncManager);
309#ifndef DESKTOP_VERSION 310#ifndef DESKTOP_VERSION
310 iconToolBar->show(); 311 iconToolBar->show();
311 qApp->processEvents(); 312 qApp->processEvents();
312#endif 313#endif
313 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); 314 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ());
314 int vh = height() ; 315 int vh = height() ;
315 int vw = width(); 316 int vw = width();
316 //qDebug("Toolbar hei %d ",iconToolBar->height() ); 317 //qDebug("Toolbar hei %d ",iconToolBar->height() );
317 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 318 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
318 vh -= iconToolBar->height(); 319 vh -= iconToolBar->height();
319 } else { 320 } else {
320 vw -= iconToolBar->height(); 321 vw -= iconToolBar->height();
321 } 322 }
322 //mView->setMaximumSize( splash->size() ); 323 //mView->setMaximumSize( splash->size() );
323 //mView->resize( splash->size() ); 324 //mView->resize( splash->size() );
324 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 325 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
325 mView->readSettings(); 326 mView->readSettings();
326 bool newFile = false; 327 bool newFile = false;
327 if( !QFile::exists( defaultFileName() ) ) { 328 if( !QFile::exists( defaultFileName() ) ) {
@@ -340,50 +341,50 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) :
340 KMessageBox::information( this, message); 341 KMessageBox::information( this, message);
341 mView->openCalendar( oldFile ); 342 mView->openCalendar( oldFile );
342 qApp->processEvents(); 343 qApp->processEvents();
343 } 344 }
344 } 345 }
345 mView->saveCalendar( defaultFileName() ); 346 mView->saveCalendar( defaultFileName() );
346 newFile = true; 347 newFile = true;
347 } 348 }
348 349
349 //QTime neededSaveTime = QDateTime::currentDateTime().time(); 350 //QTime neededSaveTime = QDateTime::currentDateTime().time();
350 //mView->loadCalendars(); 351 //mView->loadCalendars();
351 //int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 352 //int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
352 //qDebug("KO: Calendar loading time: %d ms",msNeeded ); 353 //qDebug("KO: Calendar loading time: %d ms",msNeeded );
353 354
354 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { 355 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) {
355 KOPrefs::instance()->setAllDefaults(); 356 KOPrefs::instance()->setAllDefaults();
356 } 357 }
357 358
358 359
359 connect( mView, SIGNAL( tempDisableBR(bool) ), 360 connect( mView, SIGNAL( tempDisableBR(bool) ),
360 SLOT( disableBR(bool) ) ); 361 SLOT( disableBR(bool) ) );
361 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); 362 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
362 setCentralWidget( mView ); 363 setCentralWidget( mView );
363 globalFlagBlockStartup = 0; 364 globalFlagBlockStartup = 0;
364 mView->show(); 365 //mView->show();
365 delete splash; 366 //delete splash;
366 if ( newFile ) 367 if ( newFile )
367 mView->updateConfig(); 368 mView->updateConfig();
368 // qApp->processEvents(); 369 // qApp->processEvents();
369 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 370 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
370 //fillSyncMenu(); 371 //fillSyncMenu();
371 372
372 373
373 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); 374 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) );
374 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); 375 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) );
375 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); 376 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
376 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 377 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
377 mSyncManager->setDefaultFileName( sentSyncFile()); 378 mSyncManager->setDefaultFileName( sentSyncFile());
378 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); 379 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) );
379 mSyncManager->fillSyncMenu(); 380 mSyncManager->fillSyncMenu();
380 381
381 382
382 383
383 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); 384 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins );
384 if ( showWarning ) { 385 if ( showWarning ) {
385 KMessageBox::information( this, 386 KMessageBox::information( this,
386 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); 387 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information");
387 qApp->processEvents(); 388 qApp->processEvents();
388 mView->dialogManager()->showSyncOptions(); 389 mView->dialogManager()->showSyncOptions();
389 } 390 }