author | zautrix <zautrix> | 2004-11-08 23:23:02 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-11-08 23:23:02 (UTC) |
commit | c20c85c383cb36c7ece87af9e3a60d14b36a9de5 (patch) (side-by-side diff) | |
tree | ec1d983fbeb9b719f1871683b47862b528e50c0d /kaddressbook | |
parent | d92ceb39af0bf0c655b68cb166dfea44cd688f1c (diff) | |
download | kdepimpi-c20c85c383cb36c7ece87af9e3a60d14b36a9de5.zip kdepimpi-c20c85c383cb36c7ece87af9e3a60d14b36a9de5.tar.gz kdepimpi-c20c85c383cb36c7ece87af9e3a60d14b36a9de5.tar.bz2 |
fixed orientation change in kapi
-rw-r--r-- | kaddressbook/incsearchwidget.cpp | 1 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 30 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 1 |
3 files changed, 23 insertions, 9 deletions
diff --git a/kaddressbook/incsearchwidget.cpp b/kaddressbook/incsearchwidget.cpp index 78eaf65..dd2121a 100644 --- a/kaddressbook/incsearchwidget.cpp +++ b/kaddressbook/incsearchwidget.cpp @@ -27,64 +27,65 @@ #include <qcombobox.h> #include <kdialog.h> #include <klineedit.h> #include <klocale.h> #include <kglobal.h> #include <kglobal.h> #include "kabprefs.h" #include "incsearchwidget.h" IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { #ifndef KAB_EMBEDDED //US setCaption( i18n( "Incremental Search" ) ); #endif //KAB_EMBEDDED QHBoxLayout *layout = new QHBoxLayout( this, 2, KDialog::spacingHint() ); #ifdef DESKTOP_VERSION QLabel *label = new QLabel( i18n( "Search:" ), this ); label->setAlignment( QLabel::AlignVCenter | QLabel::AlignRight ); layout->addWidget( label ); #endif //KAB_EMBEDDED mSearchText = new KLineEdit( this ); layout->addWidget( mSearchText ); // #ifdef KAB_EMBEDDED // if (KGlobal::getOrientation() == KGlobal::Portrait) // mSearchText->setMaximumWidth(30); // #endif //KAB_EMBEDDED + //mSearchText->setMaximumWidth(60); mFieldCombo = new QComboBox( false, this ); layout->addWidget( mFieldCombo ); mFieldCombo->setMaximumHeight( 34 ); QToolTip::add( mFieldCombo, i18n( "Select Incremental Search Field" ) ); // #ifndef KAB_EMBEDDED // resize( QSize(420, 50).expandedTo( sizeHint() ) ); // #else //KAB_EMBEDDED // resize( QSize(30, 10).expandedTo( sizeHint() ) ); // #endif //KAB_EMBEDDED // for performance reasons, we do a search on the pda only after return is pressed connect( mSearchText, SIGNAL( textChanged( const QString& ) ), SLOT( announceDoSearch2() ) ); connect( mFieldCombo, SIGNAL( activated( const QString& ) ), SLOT( announceDoSearch2() ) ); connect( mSearchText, SIGNAL( returnPressed() ), SLOT( announceDoSearch() ) ); connect( mFieldCombo, SIGNAL( activated( const QString& ) ), SLOT( announceFieldChanged() ) ); connect( mSearchText, SIGNAL( scrollUP() ), this, SIGNAL( scrollUP() )); connect( mSearchText, SIGNAL( scrollDOWN() ), this, SIGNAL( scrollDOWN() )); setFocusProxy( mSearchText ); diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 7acf1ee..a6fc677 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -332,70 +332,70 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); 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&))); connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); #ifndef KAB_EMBEDDED connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), mXXPortManager, SLOT( importVCard( const KURL& ) ) ); connect( mDetails, SIGNAL( browse( const QString& ) ), SLOT( browse( const QString& ) ) ); mAddressBookService = new KAddressBookService( this ); #endif //KAB_EMBEDDED 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( 1000, this , SLOT ( updateToolBar())); + QTimer::singleShot( 10000, this , SLOT ( updateToolBar())); } void KABCore::updateToolBar() { - mMainWindow->toolBar()->repaint(); + mMainWindow->toolBar()->update(); } KABCore::~KABCore() { // save(); //saveSettings(); //KABPrefs::instance()->writeConfig(); delete AddresseeConfig::instance(); mAddressBook = 0; KABC::StdAddressBook::close(); delete syncManager; #ifndef DESKTOP_VERSION if ( infrared ) delete infrared; #endif } void KABCore::receive( const QCString& cmsg, const QByteArray& data ) { qDebug("KA: QCOP message received: %s ", cmsg.data() ); if ( cmsg == "setDocument(QString)" ) { QDataStream stream( data, IO_ReadOnly ); QString fileName; stream >> fileName; recieve( fileName ); return; } } void KABCore::toggleBeamReceive( ) { if ( mBRdisabled ) return; #ifndef DESKTOP_VERSION @@ -748,83 +748,95 @@ void KABCore::mailVCard( const QStringList& uids ) bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") ); /*US kapp->invokeMailer( QString::null, QString::null, QString::null, QString::null, // subject QString::null, // body QString::null, urls ); // attachments */ } /** Beams the "WhoAmI contact. */ void KABCore::beamMySelf() { KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI(); 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::updateMainWindow() +{ + + mMainWindow->showMaximized(); + mMainWindow->update(); +} 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 (QApplication::desktop()->width() == 640 ) { // e.g. 640x480 if ( mMiniSplitter->orientation() == Qt::Vertical ) { mMiniSplitter->setOrientation( Qt::Horizontal); mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); - if ( QApplication::desktop()->width() <= 640 ) - topLevelWidget()->showMaximized(); + if ( QApplication::desktop()->width() <= 640 ) { + //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); + mViewManager->getFilterAction()->setComboWidth( 150 ); + QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); + } } - } else {// e.g. 480x640 + } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640 if ( mMiniSplitter->orientation() == Qt::Horizontal ) { mMiniSplitter->setOrientation( Qt::Vertical ); mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); - if ( QApplication::desktop()->width() <= 640 ) - topLevelWidget()->showMaximized(); + if ( QApplication::desktop()->width() <= 640 ) { + //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); + mMainWindow->showMinimized(); + mViewManager->getFilterAction()->setComboWidth( 0 ); + QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); + } } } } } 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 ); ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); if ( !ex2phone.exec() ) { return; } KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index fe2d3a2..88e83f0 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -332,64 +332,65 @@ class KABCore : public QWidget, public KSyncInterface Launches the ldap search dialog. */ void openLDAPDialog(); /** Creates a KAddressBookPrinter, which will display the print dialog and do the printing. */ void print(); /** Registers a new GUI client, so plugins can register its actions. */ void addGUIClient( KXMLGUIClient *client ); void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid); void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid); signals: void contactSelected( const QString &name ); void contactSelected( const QPixmap &pixmap ); public slots: void recieve(QString cmsg ); void getFile( bool success ); void syncFileRequest(); void setDetailsVisible( bool visible ); void setDetailsToState(); // void slotSyncMenu( int ); private slots: void updateToolBar(); + void updateMainWindow(); void receive( const QCString& cmsg, const QByteArray& data ); void toggleBeamReceive( ); void disableBR(bool); void setJumpButtonBarVisible( bool visible ); void setCaptionBack(); void importFromOL(); void extensionModified( const KABC::Addressee::List &list ); void extensionChanged( int id ); void clipboardDataChanged(); 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, |