summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabcore.cpp
authorzautrix <zautrix>2005-03-29 13:52:41 (UTC)
committer zautrix <zautrix>2005-03-29 13:52:41 (UTC)
commit7046b36fb5dd14598ece00b575554eba2956ef84 (patch) (unidiff)
tree934579f9f61f09563dfcbfef207d314d510d57ea /kaddressbook/kabcore.cpp
parent894717798a8d129f4b991a2fe856d2f1e8e9624a (diff)
downloadkdepimpi-7046b36fb5dd14598ece00b575554eba2956ef84.zip
kdepimpi-7046b36fb5dd14598ece00b575554eba2956ef84.tar.gz
kdepimpi-7046b36fb5dd14598ece00b575554eba2956ef84.tar.bz2
kapi fixes
Diffstat (limited to 'kaddressbook/kabcore.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp37
1 files changed, 26 insertions, 11 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 59aa5a5..09d8523 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -289,24 +289,25 @@ KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, con
289 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), 289 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ),
290 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ 290 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/
291 mReadWrite( readWrite ), mModified( false ), mMainWindow(client) 291 mReadWrite( readWrite ), mModified( false ), mMainWindow(client)
292#else //KAB_EMBEDDED 292#else //KAB_EMBEDDED
293KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) 293KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name )
294 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), 294 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ),
295 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), 295 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ),
296 mReadWrite( readWrite ), mModified( false ) 296 mReadWrite( readWrite ), mModified( false )
297#endif //KAB_EMBEDDED 297#endif //KAB_EMBEDDED
298{ 298{
299 // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); 299 // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu);
300 // syncManager->setBlockSave(false); 300 // syncManager->setBlockSave(false);
301 mIncSearchWidget = 0;
301 mMiniSplitter = 0; 302 mMiniSplitter = 0;
302 mExtensionBarSplitter = 0; 303 mExtensionBarSplitter = 0;
303 mIsPart = !parent->inherits( "KAddressBookMain" ); 304 mIsPart = !parent->inherits( "KAddressBookMain" );
304 mAddressBook = KABC::StdAddressBook::self(); 305 mAddressBook = KABC::StdAddressBook::self();
305 KABC::StdAddressBook::setAutomaticSave( false ); 306 KABC::StdAddressBook::setAutomaticSave( false );
306 307
307#ifndef KAB_EMBEDDED 308#ifndef KAB_EMBEDDED
308 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); 309 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler );
309#endif //KAB_EMBEDDED 310#endif //KAB_EMBEDDED
310 311
311 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), 312 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ),
312 SLOT( addressBookChanged() ) ); 313 SLOT( addressBookChanged() ) );
@@ -810,54 +811,62 @@ void KABCore::beamMySelf()
810 QStringList uids; 811 QStringList uids;
811 uids << a.uid(); 812 uids << a.uid();
812 813
813 beamVCard(uids); 814 beamVCard(uids);
814 } else { 815 } else {
815 KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); 816 KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) );
816 817
817 818
818 } 819 }
819} 820}
820void KABCore::updateMainWindow() 821void KABCore::updateMainWindow()
821{ 822{
822
823 mMainWindow->showMaximized(); 823 mMainWindow->showMaximized();
824 mMainWindow->update(); 824 mMainWindow->update();
825} 825}
826void KABCore::resizeEvent(QResizeEvent* e ) 826void KABCore::resizeEvent(QResizeEvent* e )
827{ 827{
828 if ( !mMiniSplitter ) 828 if ( !mMiniSplitter )
829 return; 829 return;
830 //qDebug("KABCore::resizeEvent(QResizeEvent* e ) "); 830 //qDebug("KABCore::resizeEvent(QResizeEvent* e ) ");
831 if ( QApplication::desktop()->width() >= 480 ) { 831 if ( QApplication::desktop()->width() >= 480 ) {
832 if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480 832 if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480
833 if ( mMiniSplitter->orientation() == Qt::Vertical ) { 833 if ( mMiniSplitter->orientation() == Qt::Vertical ) {
834 mMiniSplitter->setOrientation( Qt::Horizontal); 834 mMiniSplitter->setOrientation( Qt::Horizontal);
835 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 835 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
836 if ( QApplication::desktop()->width() <= 640 ) {
837 //mMainWindow->setMaximumSize( QApplication::desktop()->size() );
838 mViewManager->getFilterAction()->setComboWidth( 150 );
839 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
840 }
841 } 836 }
837 if ( QApplication::desktop()->width() <= 640 ) {
838 //mMainWindow->setMaximumSize( QApplication::desktop()->size() );
839 mViewManager->getFilterAction()->setComboWidth( 150 );
840 if ( mIncSearchWidget )
841 mIncSearchWidget->setSize();
842 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
843 }
844
842 } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640 845 } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640
843 if ( mMiniSplitter->orientation() == Qt::Horizontal ) { 846 if ( mMiniSplitter->orientation() == Qt::Horizontal ) {
844 mMiniSplitter->setOrientation( Qt::Vertical ); 847 mMiniSplitter->setOrientation( Qt::Vertical );
845 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 848 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
846 if ( QApplication::desktop()->width() <= 640 ) { 849 }
847 //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); 850 if ( QApplication::desktop()->width() <= 640 ) {
848 mMainWindow->showMinimized(); 851 //mMainWindow->setMaximumSize( QApplication::desktop()->size() );
852 mMainWindow->showMinimized();
853 if ( KABPrefs::instance()->mHideSearchOnSwitch ) {
854 if ( mIncSearchWidget ) {
855 mIncSearchWidget->setSize();
856 }
857 } else {
849 mViewManager->getFilterAction()->setComboWidth( 0 ); 858 mViewManager->getFilterAction()->setComboWidth( 0 );
850 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
851 } 859 }
860 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
852 } 861 }
853 } 862 }
854 } 863 }
855 864
856} 865}
857void KABCore::export2phone() 866void KABCore::export2phone()
858{ 867{
859 868
860 QStringList uids; 869 QStringList uids;
861 XXPortSelectDialog dlg( this, false, this ); 870 XXPortSelectDialog dlg( this, false, this );
862 if ( dlg.exec() ) 871 if ( dlg.exec() )
863 uids = dlg.uids(); 872 uids = dlg.uids();
@@ -1144,25 +1153,31 @@ void KABCore::setCategories()
1144 if ( uids.count() > 0 ) 1153 if ( uids.count() > 0 )
1145 setModified( true ); 1154 setModified( true );
1146 message( i18n("Setting categories completed!") ); 1155 message( i18n("Setting categories completed!") );
1147} 1156}
1148 1157
1149void KABCore::setSearchFields( const KABC::Field::List &fields ) 1158void KABCore::setSearchFields( const KABC::Field::List &fields )
1150{ 1159{
1151 mIncSearchWidget->setFields( fields ); 1160 mIncSearchWidget->setFields( fields );
1152} 1161}
1153 1162
1154void KABCore::incrementalSearch( const QString& text ) 1163void KABCore::incrementalSearch( const QString& text )
1155{ 1164{
1156 mViewManager->doSearch( text, mIncSearchWidget->currentField() ); 1165 QString stext;
1166 if ( KABPrefs::instance()->mAutoSearchWithWildcard ) {
1167 stext = "*" + text;
1168 } else {
1169 stext = text;
1170 }
1171 mViewManager->doSearch( stext, mIncSearchWidget->currentField() );
1157} 1172}
1158 1173
1159void KABCore::setModified() 1174void KABCore::setModified()
1160{ 1175{
1161 setModified( true ); 1176 setModified( true );
1162} 1177}
1163 1178
1164void KABCore::setModifiedWOrefresh() 1179void KABCore::setModifiedWOrefresh()
1165{ 1180{
1166 // qDebug("KABCore::setModifiedWOrefresh() "); 1181 // qDebug("KABCore::setModifiedWOrefresh() ");
1167 mModified = true; 1182 mModified = true;
1168 mActionSave->setEnabled( mModified ); 1183 mActionSave->setEnabled( mModified );