summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.cpp
Unidiff
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index f7766f8..c7ce8cb 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -211,97 +211,98 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
211 } else { 211 } else {
212 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); 212 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics");
213 finfo.setFile( oldFile ); 213 finfo.setFile( oldFile );
214 if (finfo.exists() ) { 214 if (finfo.exists() ) {
215 KMessageBox::information( this, message); 215 KMessageBox::information( this, message);
216 mView->openCalendar( oldFile ); 216 mView->openCalendar( oldFile );
217 qApp->processEvents(); 217 qApp->processEvents();
218 } 218 }
219 } 219 }
220 mView->saveCalendar( defaultFileName() ); 220 mView->saveCalendar( defaultFileName() );
221 newFile = true; 221 newFile = true;
222 } 222 }
223 223
224 QTime neededSaveTime = QDateTime::currentDateTime().time(); 224 QTime neededSaveTime = QDateTime::currentDateTime().time();
225 mView->openCalendar( defaultFileName() ); 225 mView->openCalendar( defaultFileName() );
226 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 226 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
227 qDebug("KO: Calendar loading time: %d ms",msNeeded ); 227 qDebug("KO: Calendar loading time: %d ms",msNeeded );
228 228
229 if ( KOPrefs::instance()->mLanguageChanged ) { 229 if ( KOPrefs::instance()->mLanguageChanged ) {
230 KOPrefs::instance()->setCategoryDefaults(); 230 KOPrefs::instance()->setCategoryDefaults();
231 int count = mView->addCategories(); 231 int count = mView->addCategories();
232 KOPrefs::instance()->mLanguageChanged = false; 232 KOPrefs::instance()->mLanguageChanged = false;
233 } 233 }
234 processIncidenceSelection( 0 ); 234 processIncidenceSelection( 0 );
235 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), 235 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ),
236 SLOT( processIncidenceSelection( Incidence * ) ) ); 236 SLOT( processIncidenceSelection( Incidence * ) ) );
237 connect( mView, SIGNAL( modifiedChanged( bool ) ), 237 connect( mView, SIGNAL( modifiedChanged( bool ) ),
238 SLOT( slotModifiedChanged( bool ) ) ); 238 SLOT( slotModifiedChanged( bool ) ) );
239 239
240 240
241 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); 241 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
242 mView->setModified( false ); 242 mView->setModified( false );
243 mBlockAtStartup = false; 243 mBlockAtStartup = false;
244 mView->setModified( false ); 244 mView->setModified( false );
245 setCentralWidget( mView ); 245 setCentralWidget( mView );
246 globalFlagBlockStartup = 0; 246 globalFlagBlockStartup = 0;
247 mView->show(); 247 mView->show();
248 delete splash; 248 delete splash;
249 if ( newFile ) 249 if ( newFile )
250 mView->updateConfig(); 250 mView->updateConfig();
251 // qApp->processEvents(); 251 // qApp->processEvents();
252 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 252 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
253 //fillSyncMenu(); 253 //fillSyncMenu();
254 254
255 255
256 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); 256 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) );
257 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); 257 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
258 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 258 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
259 mSyncManager->setDefaultFileName( defaultFileName()); 259 mSyncManager->setDefaultFileName( defaultFileName());
260 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) );
260 mSyncManager->fillSyncMenu(); 261 mSyncManager->fillSyncMenu();
261 262
262 263
263 264
264 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); 265 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins );
265 if ( showWarning ) { 266 if ( showWarning ) {
266 KMessageBox::information( this, 267 KMessageBox::information( this,
267 "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"); 268 "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");
268 qApp->processEvents(); 269 qApp->processEvents();
269 mView->dialogManager()->showSyncOptions(); 270 mView->dialogManager()->showSyncOptions();
270 } 271 }
271 272
272 //US listen for result adressed from Ka/Pi 273 //US listen for result adressed from Ka/Pi
273#ifndef DESKTOP_VERSION 274#ifndef DESKTOP_VERSION
274 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 275 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
275#endif 276#endif
276} 277}
277MainWindow::~MainWindow() 278MainWindow::~MainWindow()
278{ 279{
279 //qDebug("MainWindow::~MainWindow() "); 280 //qDebug("MainWindow::~MainWindow() ");
280 //save toolbar location 281 //save toolbar location
281 delete mServerSocket; 282 delete mServerSocket;
282 delete mCalendar; 283 delete mCalendar;
283 delete KOPrefs::instance(); 284 delete KOPrefs::instance();
284 delete KIncidenceFormatter::instance(); 285 delete KIncidenceFormatter::instance();
285 286
286 287
287} 288}
288void MainWindow::showMaximized () 289void MainWindow::showMaximized ()
289{ 290{
290#ifndef DESKTOP_VERSION 291#ifndef DESKTOP_VERSION
291 if ( ! globalFlagBlockStartup ) 292 if ( ! globalFlagBlockStartup )
292 if ( mClosed ) 293 if ( mClosed )
293 mView->goToday(); 294 mView->goToday();
294#endif 295#endif
295 QWidget::showMaximized () ; 296 QWidget::showMaximized () ;
296 mClosed = false; 297 mClosed = false;
297} 298}
298void MainWindow::closeEvent( QCloseEvent* ce ) 299void MainWindow::closeEvent( QCloseEvent* ce )
299{ 300{
300 301
301 302
302 303
303 if ( ! KOPrefs::instance()->mAskForQuit ) { 304 if ( ! KOPrefs::instance()->mAskForQuit ) {
304 saveOnClose(); 305 saveOnClose();
305 mClosed = true; 306 mClosed = true;
306 ce->accept(); 307 ce->accept();
307 return; 308 return;