-rw-r--r-- | kaddressbook/kabcore.cpp | 27 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 1 |
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 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ mReadWrite( readWrite ), mModified( false ), mMainWindow(client) #else //KAB_EMBEDDED KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), mReadWrite( readWrite ), mModified( false ) #endif //KAB_EMBEDDED { // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); // syncManager->setBlockSave(false); + mMiniSplitter = 0; mExtensionBarSplitter = 0; mIsPart = !parent->inherits( "KAddressBookMain" ); mAddressBook = KABC::StdAddressBook::self(); KABC::StdAddressBook::setAutomaticSave( false ); #ifndef KAB_EMBEDDED mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); #endif //KAB_EMBEDDED connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), SLOT( addressBookChanged() ) ); @@ -351,25 +352,25 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const mMessageTimer = new QTimer( this ); connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); mEditorDialog = 0; createAddresseeEditorDialog( this ); setModified( false ); mBRdisabled = false; #ifndef DESKTOP_VERSION infrared = 0; #endif //toggleBeamReceive( ); // we have a toolbar repainting error on the Zaurus when starting KA/Pi - QTimer::singleShot( 1, this , SLOT ( updateToolBar())); + QTimer::singleShot( 1000, this , SLOT ( updateToolBar())); } void KABCore::updateToolBar() { mMainWindow->toolBar()->repaint(); } KABCore::~KABCore() { // save(); //saveSettings(); //KABPrefs::instance()->writeConfig(); delete AddresseeConfig::instance(); @@ -767,27 +768,51 @@ void KABCore::beamMySelf() if (!a.isEmpty()) { QStringList uids; uids << a.uid(); beamVCard(uids); } else { KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); } } +void KABCore::resizeEvent(QResizeEvent* e ) +{ + if ( !mMiniSplitter ) + return; + if ( QApplication::desktop()->width() >= 480 ) { + int fac = QApplication::desktop()->width()/QApplication::desktop()->height(); + if ( fac > 0 ) { // e.g. 640x480 + if ( mMiniSplitter->orientation() == Qt::Vertical ) { + mMiniSplitter->setOrientation( Qt::Horizontal); + mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); + if ( QApplication::desktop()->width() <= 640 ) + topLevelWidget()->showMaximized(); + } + } else {// e.g. 480x640 + if ( mMiniSplitter->orientation() == Qt::Horizontal ) { + mMiniSplitter->setOrientation( Qt::Vertical ); + mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); + if ( QApplication::desktop()->width() <= 640 ) + topLevelWidget()->showMaximized(); + } + } + } +} void KABCore::export2phone() { + QStringList uids; XXPortSelectDialog dlg( this, false, this ); if ( dlg.exec() ) uids = dlg.uids(); else return; if ( uids.isEmpty() ) return; // qDebug("count %d ", uids.count()); KAex2phonePrefs ex2phone; 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 void updateActionMenu(); void configureKeyBindings(); void removeVoice(); #ifdef KAB_EMBEDDED void configureResources(); #endif //KAB_EMBEDDED void slotEditorDestroyed( const QString &uid ); void configurationChanged(); void addressBookChanged(); private: + void resizeEvent(QResizeEvent* e ); bool mBRdisabled; #ifndef DESKTOP_VERSION QCopChannel* infrared; #endif QTimer *mMessageTimer; void initGUI(); void initActions(); QString getPhoneFile(); AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent, const char *name = 0 ); |