summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp27
-rw-r--r--kaddressbook/kabcore.h1
2 files changed, 27 insertions, 1 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 7be5db8..7acf1ee 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -251,24 +251,25 @@ KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, con
251 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), 251 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ),
252 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ 252 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/
253 mReadWrite( readWrite ), mModified( false ), mMainWindow(client) 253 mReadWrite( readWrite ), mModified( false ), mMainWindow(client)
254#else //KAB_EMBEDDED 254#else //KAB_EMBEDDED
255KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) 255KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name )
256 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), 256 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ),
257 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), 257 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ),
258 mReadWrite( readWrite ), mModified( false ) 258 mReadWrite( readWrite ), mModified( false )
259#endif //KAB_EMBEDDED 259#endif //KAB_EMBEDDED
260{ 260{
261 // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); 261 // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu);
262 // syncManager->setBlockSave(false); 262 // syncManager->setBlockSave(false);
263 mMiniSplitter = 0;
263 mExtensionBarSplitter = 0; 264 mExtensionBarSplitter = 0;
264 mIsPart = !parent->inherits( "KAddressBookMain" ); 265 mIsPart = !parent->inherits( "KAddressBookMain" );
265 mAddressBook = KABC::StdAddressBook::self(); 266 mAddressBook = KABC::StdAddressBook::self();
266 KABC::StdAddressBook::setAutomaticSave( false ); 267 KABC::StdAddressBook::setAutomaticSave( false );
267 268
268#ifndef KAB_EMBEDDED 269#ifndef KAB_EMBEDDED
269 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); 270 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler );
270#endif //KAB_EMBEDDED 271#endif //KAB_EMBEDDED
271 272
272 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), 273 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ),
273 SLOT( addressBookChanged() ) ); 274 SLOT( addressBookChanged() ) );
274 275
@@ -351,25 +352,25 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
351 mMessageTimer = new QTimer( this ); 352 mMessageTimer = new QTimer( this );
352 connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); 353 connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) );
353 mEditorDialog = 0; 354 mEditorDialog = 0;
354 createAddresseeEditorDialog( this ); 355 createAddresseeEditorDialog( this );
355 setModified( false ); 356 setModified( false );
356 mBRdisabled = false; 357 mBRdisabled = false;
357#ifndef DESKTOP_VERSION 358#ifndef DESKTOP_VERSION
358 infrared = 0; 359 infrared = 0;
359#endif 360#endif
360 //toggleBeamReceive( ); 361 //toggleBeamReceive( );
361 362
362 // we have a toolbar repainting error on the Zaurus when starting KA/Pi 363 // we have a toolbar repainting error on the Zaurus when starting KA/Pi
363 QTimer::singleShot( 1, this , SLOT ( updateToolBar())); 364 QTimer::singleShot( 1000, this , SLOT ( updateToolBar()));
364} 365}
365 366
366void KABCore::updateToolBar() 367void KABCore::updateToolBar()
367{ 368{
368 mMainWindow->toolBar()->repaint(); 369 mMainWindow->toolBar()->repaint();
369} 370}
370KABCore::~KABCore() 371KABCore::~KABCore()
371{ 372{
372 // save(); 373 // save();
373 //saveSettings(); 374 //saveSettings();
374 //KABPrefs::instance()->writeConfig(); 375 //KABPrefs::instance()->writeConfig();
375 delete AddresseeConfig::instance(); 376 delete AddresseeConfig::instance();
@@ -767,27 +768,51 @@ void KABCore::beamMySelf()
767 if (!a.isEmpty()) 768 if (!a.isEmpty())
768 { 769 {
769 QStringList uids; 770 QStringList uids;
770 uids << a.uid(); 771 uids << a.uid();
771 772
772 beamVCard(uids); 773 beamVCard(uids);
773 } else { 774 } else {
774 KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); 775 KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) );
775 776
776 777
777 } 778 }
778} 779}
780void KABCore::resizeEvent(QResizeEvent* e )
781{
782 if ( !mMiniSplitter )
783 return;
784 if ( QApplication::desktop()->width() >= 480 ) {
785 int fac = QApplication::desktop()->width()/QApplication::desktop()->height();
786 if ( fac > 0 ) { // e.g. 640x480
787 if ( mMiniSplitter->orientation() == Qt::Vertical ) {
788 mMiniSplitter->setOrientation( Qt::Horizontal);
789 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
790 if ( QApplication::desktop()->width() <= 640 )
791 topLevelWidget()->showMaximized();
792 }
793 } else {// e.g. 480x640
794 if ( mMiniSplitter->orientation() == Qt::Horizontal ) {
795 mMiniSplitter->setOrientation( Qt::Vertical );
796 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
797 if ( QApplication::desktop()->width() <= 640 )
798 topLevelWidget()->showMaximized();
799 }
800 }
801 }
779 802
803}
780void KABCore::export2phone() 804void KABCore::export2phone()
781{ 805{
806
782 QStringList uids; 807 QStringList uids;
783 XXPortSelectDialog dlg( this, false, this ); 808 XXPortSelectDialog dlg( this, false, this );
784 if ( dlg.exec() ) 809 if ( dlg.exec() )
785 uids = dlg.uids(); 810 uids = dlg.uids();
786 else 811 else
787 return; 812 return;
788 if ( uids.isEmpty() ) 813 if ( uids.isEmpty() )
789 return; 814 return;
790 // qDebug("count %d ", uids.count()); 815 // qDebug("count %d ", uids.count());
791 816
792 KAex2phonePrefs ex2phone; 817 KAex2phonePrefs ex2phone;
793 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); 818 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index 0a52838..fe2d3a2 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -373,24 +373,25 @@ class KABCore : public QWidget, public KSyncInterface
373 void updateActionMenu(); 373 void updateActionMenu();
374 void configureKeyBindings(); 374 void configureKeyBindings();
375 void removeVoice(); 375 void removeVoice();
376#ifdef KAB_EMBEDDED 376#ifdef KAB_EMBEDDED
377 void configureResources(); 377 void configureResources();
378#endif //KAB_EMBEDDED 378#endif //KAB_EMBEDDED
379 379
380 void slotEditorDestroyed( const QString &uid ); 380 void slotEditorDestroyed( const QString &uid );
381 void configurationChanged(); 381 void configurationChanged();
382 void addressBookChanged(); 382 void addressBookChanged();
383 383
384 private: 384 private:
385 void resizeEvent(QResizeEvent* e );
385 bool mBRdisabled; 386 bool mBRdisabled;
386#ifndef DESKTOP_VERSION 387#ifndef DESKTOP_VERSION
387 QCopChannel* infrared; 388 QCopChannel* infrared;
388#endif 389#endif
389 QTimer *mMessageTimer; 390 QTimer *mMessageTimer;
390 void initGUI(); 391 void initGUI();
391 void initActions(); 392 void initActions();
392 QString getPhoneFile(); 393 QString getPhoneFile();
393 394
394 AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent, 395 AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent,
395 const char *name = 0 ); 396 const char *name = 0 );
396 397