-rw-r--r-- | kaddressbook/kabcore.cpp | 1 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 3ab06c4..2e408b7 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -289,96 +289,97 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const | |||
289 | 289 | ||
290 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), | 290 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), |
291 | SLOT( sendMail( const QString& ) ) ); | 291 | SLOT( sendMail( const QString& ) ) ); |
292 | 292 | ||
293 | 293 | ||
294 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); | 294 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); |
295 | connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); | 295 | connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); |
296 | connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); | 296 | connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); |
297 | 297 | ||
298 | 298 | ||
299 | #ifndef KAB_EMBEDDED | 299 | #ifndef KAB_EMBEDDED |
300 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), | 300 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), |
301 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); | 301 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); |
302 | 302 | ||
303 | connect( mDetails, SIGNAL( browse( const QString& ) ), | 303 | connect( mDetails, SIGNAL( browse( const QString& ) ), |
304 | SLOT( browse( const QString& ) ) ); | 304 | SLOT( browse( const QString& ) ) ); |
305 | 305 | ||
306 | 306 | ||
307 | mAddressBookService = new KAddressBookService( this ); | 307 | mAddressBookService = new KAddressBookService( this ); |
308 | 308 | ||
309 | #endif //KAB_EMBEDDED | 309 | #endif //KAB_EMBEDDED |
310 | 310 | ||
311 | mMessageTimer = new QTimer( this ); | 311 | mMessageTimer = new QTimer( this ); |
312 | connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); | 312 | connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); |
313 | mEditorDialog = 0; | 313 | mEditorDialog = 0; |
314 | createAddresseeEditorDialog( this ); | 314 | createAddresseeEditorDialog( this ); |
315 | setModified( false ); | 315 | setModified( false ); |
316 | } | 316 | } |
317 | 317 | ||
318 | KABCore::~KABCore() | 318 | KABCore::~KABCore() |
319 | { | 319 | { |
320 | // save(); | 320 | // save(); |
321 | //saveSettings(); | 321 | //saveSettings(); |
322 | //KABPrefs::instance()->writeConfig(); | 322 | //KABPrefs::instance()->writeConfig(); |
323 | delete AddresseeConfig::instance(); | 323 | delete AddresseeConfig::instance(); |
324 | mAddressBook = 0; | 324 | mAddressBook = 0; |
325 | KABC::StdAddressBook::close(); | 325 | KABC::StdAddressBook::close(); |
326 | 326 | ||
327 | delete syncManager; | 327 | delete syncManager; |
328 | 328 | ||
329 | } | 329 | } |
330 | 330 | ||
331 | void KABCore::recieve( QString fn ) | 331 | void KABCore::recieve( QString fn ) |
332 | { | 332 | { |
333 | //qDebug("KABCore::recieve "); | 333 | //qDebug("KABCore::recieve "); |
334 | int count = mAddressBook->importFromFile( fn, true ); | 334 | int count = mAddressBook->importFromFile( fn, true ); |
335 | mViewManager->refreshView(); | 335 | mViewManager->refreshView(); |
336 | message(i18n("%1 contact(s) received!").arg( count )); | 336 | message(i18n("%1 contact(s) received!").arg( count )); |
337 | topLevelWidget()->showMaximized(); | ||
337 | topLevelWidget()->raise(); | 338 | topLevelWidget()->raise(); |
338 | } | 339 | } |
339 | void KABCore::restoreSettings() | 340 | void KABCore::restoreSettings() |
340 | { | 341 | { |
341 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; | 342 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; |
342 | 343 | ||
343 | bool state; | 344 | bool state; |
344 | 345 | ||
345 | if (mMultipleViewsAtOnce) | 346 | if (mMultipleViewsAtOnce) |
346 | state = KABPrefs::instance()->mDetailsPageVisible; | 347 | state = KABPrefs::instance()->mDetailsPageVisible; |
347 | else | 348 | else |
348 | state = false; | 349 | state = false; |
349 | 350 | ||
350 | mActionDetails->setChecked( state ); | 351 | mActionDetails->setChecked( state ); |
351 | setDetailsVisible( state ); | 352 | setDetailsVisible( state ); |
352 | 353 | ||
353 | state = KABPrefs::instance()->mJumpButtonBarVisible; | 354 | state = KABPrefs::instance()->mJumpButtonBarVisible; |
354 | 355 | ||
355 | mActionJumpBar->setChecked( state ); | 356 | mActionJumpBar->setChecked( state ); |
356 | setJumpButtonBarVisible( state ); | 357 | setJumpButtonBarVisible( state ); |
357 | /*US | 358 | /*US |
358 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; | 359 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; |
359 | if ( splitterSize.count() == 0 ) { | 360 | if ( splitterSize.count() == 0 ) { |
360 | splitterSize.append( width() / 2 ); | 361 | splitterSize.append( width() / 2 ); |
361 | splitterSize.append( width() / 2 ); | 362 | splitterSize.append( width() / 2 ); |
362 | } | 363 | } |
363 | mMiniSplitter->setSizes( splitterSize ); | 364 | mMiniSplitter->setSizes( splitterSize ); |
364 | if ( mExtensionBarSplitter ) { | 365 | if ( mExtensionBarSplitter ) { |
365 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 366 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; |
366 | if ( splitterSize.count() == 0 ) { | 367 | if ( splitterSize.count() == 0 ) { |
367 | splitterSize.append( width() / 2 ); | 368 | splitterSize.append( width() / 2 ); |
368 | splitterSize.append( width() / 2 ); | 369 | splitterSize.append( width() / 2 ); |
369 | } | 370 | } |
370 | mExtensionBarSplitter->setSizes( splitterSize ); | 371 | mExtensionBarSplitter->setSizes( splitterSize ); |
371 | 372 | ||
372 | } | 373 | } |
373 | */ | 374 | */ |
374 | mViewManager->restoreSettings(); | 375 | mViewManager->restoreSettings(); |
375 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); | 376 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); |
376 | mExtensionManager->restoreSettings(); | 377 | mExtensionManager->restoreSettings(); |
377 | #ifdef DESKTOP_VERSION | 378 | #ifdef DESKTOP_VERSION |
378 | int wid = width(); | 379 | int wid = width(); |
379 | if ( wid < 10 ) | 380 | if ( wid < 10 ) |
380 | wid = 400; | 381 | wid = 400; |
381 | #else | 382 | #else |
382 | int wid = QApplication::desktop()->width(); | 383 | int wid = QApplication::desktop()->width(); |
383 | if ( wid < 640 ) | 384 | if ( wid < 640 ) |
384 | wid = QApplication::desktop()->height(); | 385 | wid = QApplication::desktop()->height(); |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 58d8d34..30c0d2f 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -294,97 +294,99 @@ void MainWindow::showMaximized () | |||
294 | mClosed = false; | 294 | mClosed = false; |
295 | } | 295 | } |
296 | void MainWindow::closeEvent( QCloseEvent* ce ) | 296 | void MainWindow::closeEvent( QCloseEvent* ce ) |
297 | { | 297 | { |
298 | 298 | ||
299 | 299 | ||
300 | 300 | ||
301 | if ( ! KOPrefs::instance()->mAskForQuit ) { | 301 | if ( ! KOPrefs::instance()->mAskForQuit ) { |
302 | saveOnClose(); | 302 | saveOnClose(); |
303 | mClosed = true; | 303 | mClosed = true; |
304 | ce->accept(); | 304 | ce->accept(); |
305 | return; | 305 | return; |
306 | 306 | ||
307 | } | 307 | } |
308 | 308 | ||
309 | switch( QMessageBox::information( this, "KO/Pi", | 309 | switch( QMessageBox::information( this, "KO/Pi", |
310 | i18n("Do you really want\nto close KO/Pi?"), | 310 | i18n("Do you really want\nto close KO/Pi?"), |
311 | i18n("Close"), i18n("No"), | 311 | i18n("Close"), i18n("No"), |
312 | 0, 0 ) ) { | 312 | 0, 0 ) ) { |
313 | case 0: | 313 | case 0: |
314 | saveOnClose(); | 314 | saveOnClose(); |
315 | mClosed = true; | 315 | mClosed = true; |
316 | ce->accept(); | 316 | ce->accept(); |
317 | break; | 317 | break; |
318 | case 1: | 318 | case 1: |
319 | ce->ignore(); | 319 | ce->ignore(); |
320 | break; | 320 | break; |
321 | case 2: | 321 | case 2: |
322 | 322 | ||
323 | default: | 323 | default: |
324 | break; | 324 | break; |
325 | } | 325 | } |
326 | 326 | ||
327 | 327 | ||
328 | } | 328 | } |
329 | 329 | ||
330 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | 330 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) |
331 | { | 331 | { |
332 | QDataStream stream( data, IO_ReadOnly ); | 332 | QDataStream stream( data, IO_ReadOnly ); |
333 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); | 333 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); |
334 | //QString datamess; | 334 | //QString datamess; |
335 | //qDebug("message "); | 335 | //qDebug("message "); |
336 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); | 336 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); |
337 | 337 | ||
338 | if ( cmsg == "setDocument(QString)" ) { | 338 | if ( cmsg == "setDocument(QString)" ) { |
339 | QDataStream stream( data, IO_ReadOnly ); | 339 | QDataStream stream( data, IO_ReadOnly ); |
340 | QString fileName; | 340 | QString fileName; |
341 | stream >> fileName; | 341 | stream >> fileName; |
342 | qDebug("filename %s ", fileName.latin1()); | 342 | //qDebug("filename %s ", fileName.latin1()); |
343 | showMaximized(); | ||
344 | raise(); | ||
343 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; | 345 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; |
344 | mSyncManager->slotSyncMenu( 1002 ); | 346 | mSyncManager->slotSyncMenu( 1002 ); |
345 | return; | 347 | return; |
346 | } | 348 | } |
347 | 349 | ||
348 | if ( cmsg == "-writeFile" ) { | 350 | if ( cmsg == "-writeFile" ) { |
349 | // I made from the "-writeFile" an "-writeAlarm" | 351 | // I made from the "-writeFile" an "-writeAlarm" |
350 | mView->viewManager()->showWhatsNextView(); | 352 | mView->viewManager()->showWhatsNextView(); |
351 | mCalendar->checkAlarmForIncidence( 0, true); | 353 | mCalendar->checkAlarmForIncidence( 0, true); |
352 | showMaximized(); | 354 | showMaximized(); |
353 | raise(); | 355 | raise(); |
354 | return; | 356 | return; |
355 | 357 | ||
356 | } | 358 | } |
357 | if ( cmsg == "-writeFileSilent" ) { | 359 | if ( cmsg == "-writeFileSilent" ) { |
358 | // I made from the "-writeFile" an "-writeAlarm" | 360 | // I made from the "-writeFile" an "-writeAlarm" |
359 | // mView->viewManager()->showWhatsNextView(); | 361 | // mView->viewManager()->showWhatsNextView(); |
360 | mCalendar->checkAlarmForIncidence( 0, true); | 362 | mCalendar->checkAlarmForIncidence( 0, true); |
361 | //showMaximized(); | 363 | //showMaximized(); |
362 | //raise(); | 364 | //raise(); |
363 | hide(); | 365 | hide(); |
364 | return; | 366 | return; |
365 | } | 367 | } |
366 | if ( cmsg == "-newCountdown" ) { | 368 | if ( cmsg == "-newCountdown" ) { |
367 | qDebug("newCountdown "); | 369 | qDebug("newCountdown "); |
368 | 370 | ||
369 | } | 371 | } |
370 | QString msg ; | 372 | QString msg ; |
371 | QString allmsg = cmsg; | 373 | QString allmsg = cmsg; |
372 | while ( allmsg.length() > 0 ) { | 374 | while ( allmsg.length() > 0 ) { |
373 | int nextC = allmsg.find( "-", 1 ); | 375 | int nextC = allmsg.find( "-", 1 ); |
374 | if ( nextC == -1 ) { | 376 | if ( nextC == -1 ) { |
375 | msg = allmsg; | 377 | msg = allmsg; |
376 | allmsg = ""; | 378 | allmsg = ""; |
377 | } else{ | 379 | } else{ |
378 | msg = allmsg.left( nextC ); | 380 | msg = allmsg.left( nextC ); |
379 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); | 381 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); |
380 | } | 382 | } |
381 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); | 383 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); |
382 | if ( msg == "-newEvent" ) { | 384 | if ( msg == "-newEvent" ) { |
383 | mView->newEvent(); | 385 | mView->newEvent(); |
384 | } | 386 | } |
385 | if ( msg == "-newTodo" ) { | 387 | if ( msg == "-newTodo" ) { |
386 | mView->newTodo(); | 388 | mView->newTodo(); |
387 | 389 | ||
388 | } | 390 | } |
389 | if ( msg == "-showWN" ) { | 391 | if ( msg == "-showWN" ) { |
390 | mView->viewManager()->showWhatsNextView(); | 392 | mView->viewManager()->showWhatsNextView(); |