author | zautrix <zautrix> | 2004-10-20 12:05:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-20 12:05:18 (UTC) |
commit | 5cf3c1bce58a6487af166e637e54571e98156fd0 (patch) (unidiff) | |
tree | 2e1ba14350aa322bb21729cf462b96e658fa6929 /korganizer/mainwindow.cpp | |
parent | e2a0df411042d986adb31b28f9e0a2f17395358c (diff) | |
download | kdepimpi-5cf3c1bce58a6487af166e637e54571e98156fd0.zip kdepimpi-5cf3c1bce58a6487af166e637e54571e98156fd0.tar.gz kdepimpi-5cf3c1bce58a6487af166e637e54571e98156fd0.tar.bz2 |
OL import fixes
-rw-r--r-- | korganizer/mainwindow.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 9e215b9..63484d6 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -243,115 +243,121 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
243 | mView->setModified( false ); | 243 | mView->setModified( false ); |
244 | mBlockAtStartup = false; | 244 | mBlockAtStartup = false; |
245 | mView->setModified( false ); | 245 | mView->setModified( false ); |
246 | setCentralWidget( mView ); | 246 | setCentralWidget( mView ); |
247 | globalFlagBlockStartup = 0; | 247 | globalFlagBlockStartup = 0; |
248 | mView->show(); | 248 | mView->show(); |
249 | delete splash; | 249 | delete splash; |
250 | if ( newFile ) | 250 | if ( newFile ) |
251 | mView->updateConfig(); | 251 | mView->updateConfig(); |
252 | // qApp->processEvents(); | 252 | // qApp->processEvents(); |
253 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 253 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
254 | //fillSyncMenu(); | 254 | //fillSyncMenu(); |
255 | 255 | ||
256 | 256 | ||
257 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); | 257 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); |
258 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 258 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); |
259 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 259 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
260 | mSyncManager->setDefaultFileName( defaultFileName()); | 260 | mSyncManager->setDefaultFileName( defaultFileName()); |
261 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); | 261 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); |
262 | mSyncManager->fillSyncMenu(); | 262 | mSyncManager->fillSyncMenu(); |
263 | 263 | ||
264 | 264 | ||
265 | 265 | ||
266 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); | 266 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); |
267 | if ( showWarning ) { | 267 | if ( showWarning ) { |
268 | KMessageBox::information( this, | 268 | KMessageBox::information( this, |
269 | "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"); | 269 | "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"); |
270 | qApp->processEvents(); | 270 | qApp->processEvents(); |
271 | mView->dialogManager()->showSyncOptions(); | 271 | mView->dialogManager()->showSyncOptions(); |
272 | } | 272 | } |
273 | 273 | ||
274 | //US listen for result adressed from Ka/Pi | 274 | //US listen for result adressed from Ka/Pi |
275 | #ifndef DESKTOP_VERSION | 275 | #ifndef DESKTOP_VERSION |
276 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 276 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
277 | #endif | 277 | #endif |
278 | #ifndef DESKTOP_VERSION | 278 | #ifndef DESKTOP_VERSION |
279 | infrared = 0; | 279 | infrared = 0; |
280 | #endif | 280 | #endif |
281 | 281 | ||
282 | mBRdisabled = false; | 282 | mBRdisabled = false; |
283 | toggleBeamReceive(); | 283 | toggleBeamReceive(); |
284 | } | 284 | } |
285 | MainWindow::~MainWindow() | 285 | MainWindow::~MainWindow() |
286 | { | 286 | { |
287 | //qDebug("MainWindow::~MainWindow() "); | 287 | //qDebug("MainWindow::~MainWindow() "); |
288 | //save toolbar location | 288 | //save toolbar location |
289 | delete mCalendar; | 289 | delete mCalendar; |
290 | delete mSyncManager; | 290 | delete mSyncManager; |
291 | #ifndef DESKTOP_VERSION | ||
291 | if ( infrared ) | 292 | if ( infrared ) |
292 | delete infrared; | 293 | delete infrared; |
294 | #endif | ||
293 | 295 | ||
294 | 296 | ||
295 | } | 297 | } |
296 | 298 | ||
297 | void MainWindow::disableBR(bool b) | 299 | void MainWindow::disableBR(bool b) |
298 | { | 300 | { |
301 | #ifndef DESKTOP_VERSION | ||
299 | if ( b ) { | 302 | if ( b ) { |
300 | if ( infrared ) { | 303 | if ( infrared ) { |
301 | toggleBeamReceive(); | 304 | toggleBeamReceive(); |
302 | mBRdisabled = true; | 305 | mBRdisabled = true; |
303 | } | 306 | } |
307 | mBRdisabled = true; | ||
304 | } else { | 308 | } else { |
305 | if ( mBRdisabled ) { | 309 | if ( mBRdisabled ) { |
306 | mBRdisabled = false; | 310 | mBRdisabled = false; |
307 | toggleBeamReceive(); | 311 | //makes no sense,because other cal ap is probably running |
312 | // toggleBeamReceive(); | ||
308 | } | 313 | } |
309 | } | 314 | } |
315 | #endif | ||
310 | 316 | ||
311 | } | 317 | } |
312 | bool MainWindow::beamReceiveEnabled() | 318 | bool MainWindow::beamReceiveEnabled() |
313 | { | 319 | { |
314 | #ifndef DESKTOP_VERSION | 320 | #ifndef DESKTOP_VERSION |
315 | return ( infrared != 0 ); | 321 | return ( infrared != 0 ); |
316 | #endif | 322 | #endif |
317 | return false; | 323 | return false; |
318 | } | 324 | } |
319 | 325 | ||
320 | void MainWindow::toggleBeamReceive() | 326 | void MainWindow::toggleBeamReceive() |
321 | { | 327 | { |
322 | if ( mBRdisabled ) | 328 | if ( mBRdisabled ) |
323 | return; | 329 | return; |
324 | #ifndef DESKTOP_VERSION | 330 | #ifndef DESKTOP_VERSION |
325 | if ( infrared ) { | 331 | if ( infrared ) { |
326 | qDebug("disable BeamReceive "); | 332 | qDebug("disable BeamReceive "); |
327 | delete infrared; | 333 | delete infrared; |
328 | infrared = 0; | 334 | infrared = 0; |
329 | brAction->setOn(false); | 335 | brAction->setOn(false); |
330 | return; | 336 | return; |
331 | } | 337 | } |
332 | qDebug("enable BeamReceive "); | 338 | qDebug("enable BeamReceive "); |
333 | brAction->setOn(true); | 339 | brAction->setOn(true); |
334 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; | 340 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; |
335 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); | 341 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); |
336 | #endif | 342 | #endif |
337 | } | 343 | } |
338 | void MainWindow::showMaximized () | 344 | void MainWindow::showMaximized () |
339 | { | 345 | { |
340 | #ifndef DESKTOP_VERSION | 346 | #ifndef DESKTOP_VERSION |
341 | if ( ! globalFlagBlockStartup ) | 347 | if ( ! globalFlagBlockStartup ) |
342 | if ( mClosed ) | 348 | if ( mClosed ) |
343 | mView->goToday(); | 349 | mView->goToday(); |
344 | #endif | 350 | #endif |
345 | QWidget::showMaximized () ; | 351 | QWidget::showMaximized () ; |
346 | mClosed = false; | 352 | mClosed = false; |
347 | } | 353 | } |
348 | void MainWindow::closeEvent( QCloseEvent* ce ) | 354 | void MainWindow::closeEvent( QCloseEvent* ce ) |
349 | { | 355 | { |
350 | 356 | ||
351 | 357 | ||
352 | 358 | ||
353 | if ( ! KOPrefs::instance()->mAskForQuit ) { | 359 | if ( ! KOPrefs::instance()->mAskForQuit ) { |
354 | saveOnClose(); | 360 | saveOnClose(); |
355 | mClosed = true; | 361 | mClosed = true; |
356 | ce->accept(); | 362 | ce->accept(); |
357 | return; | 363 | return; |