summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2005-06-29 16:14:46 (UTC)
committer zautrix <zautrix>2005-06-29 16:14:46 (UTC)
commit77aa480c9891a90c9b492618ebfd2b20f2d0727a (patch) (side-by-side diff)
tree4f2c278d016fe21f280f8ee6abbca34685aada96 /kaddressbook
parente0fa858c284dddf0d47146e666c4ece7158487be (diff)
downloadkdepimpi-77aa480c9891a90c9b492618ebfd2b20f2d0727a.zip
kdepimpi-77aa480c9891a90c9b492618ebfd2b20f2d0727a.tar.gz
kdepimpi-77aa480c9891a90c9b492618ebfd2b20f2d0727a.tar.bz2
many sync fixes
Diffstat (limited to 'kaddressbook') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp6
-rw-r--r--kaddressbook/kabcore.cpp5
-rw-r--r--kaddressbook/kabcore.h1
3 files changed, 8 insertions, 4 deletions
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp
index bd32859..5334a0e 100644
--- a/kaddressbook/addresseeeditorwidget.cpp
+++ b/kaddressbook/addresseeeditorwidget.cpp
@@ -638,71 +638,71 @@ void AddresseeEditorWidget::setupTab2()
++iii;
label = new QLabel( i18n( "Spouse's name:" ), tab2 );
layout->addWidget( label, iii, 1 );
mSpouseEdit = new KLineEdit( tab2 );
connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ),
SLOT( textChanged( const QString& ) ) );
label->setBuddy( mSpouseEdit );
layout->addWidget( mSpouseEdit, iii, 2 );
++iii;
}
label = new QLabel( i18n( "Children's names:" ), tab2 );
layout->addWidget( label, iii, 1 );
mChildEdit = new KLineEdit( tab2 );
connect( mChildEdit, SIGNAL( textChanged( const QString& ) ),
SLOT( textChanged( const QString& ) ) );
label->setBuddy( mChildEdit );
layout->addWidget( mChildEdit, iii, 2 );
++iii;
if ( QApplication::desktop()->width() == 640 ) {
QHBox * nbox = new QHBox ( tab2 );
label = new QLabel( i18n( "Birthday:" )+" ", nbox );
mBirthdayPicker = new KDateEdit( nbox );
- mBirthdayPicker->toggleDateFormat();
+ //mBirthdayPicker->toggleDateFormat();
mBirthdayPicker->setHandleInvalid( true );
connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
SLOT( dateChanged( QDate ) ) );
label->setBuddy( mBirthdayPicker );
label = new QLabel( " "+i18n( "Anniversary:" )+" ", nbox );
mAnniversaryPicker = new KDateEdit( nbox );
mAnniversaryPicker->setHandleInvalid( true );
connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ),
SLOT( dateChanged( QDate ) ) );
label->setBuddy( mAnniversaryPicker );
layout->addMultiCellWidget( nbox, iii, iii, 1, 2 );
++iii;
} else {
label = new QLabel( i18n( "Birthday:" ), tab2 );
layout->addWidget( label, iii, 1 );
mBirthdayPicker = new KDateEdit( tab2 );
- mBirthdayPicker->toggleDateFormat();
+ //mBirthdayPicker->toggleDateFormat();
mBirthdayPicker->setHandleInvalid( true );
connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
SLOT( dateChanged( QDate ) ) );
label->setBuddy( mBirthdayPicker );
layout->addWidget( mBirthdayPicker, iii, 2 );
++iii;
label = new QLabel( i18n( "Anniversary:" ), tab2 );
layout->addWidget( label, iii, 1 );
mAnniversaryPicker = new KDateEdit( tab2 );
mAnniversaryPicker->setHandleInvalid( true );
connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ),
SLOT( dateChanged( QDate ) ) );
label->setBuddy( mAnniversaryPicker );
layout->addWidget( mAnniversaryPicker, iii, 2 );
++iii;
}
label = new QLabel( i18n( "Gender:" ), tab2 );
layout->addWidget( label, iii, 1 );
mGenderBox = new QComboBox ( tab2 );
@@ -1058,50 +1058,48 @@ void AddresseeEditorWidget::load()
else if ( gen == "male" )
mGenderBox->setCurrentItem ( 2 );
else
mGenderBox->setCurrentItem ( 0 );
blockSignals( block );
mBlockSignals = false;
mDirty = false;
}
void AddresseeEditorWidget::save()
{
if ( !dirty() ) {
return;
}
mAddressee.setRevision( QDateTime::currentDateTime() );
mAddressee.setRole( mRoleEdit->text() );
mAddressee.setOrganization( mOrgEdit->text() );
mAddressee.setUrl( KURL( mURLEdit->text() ) );
mAddressee.setNote( mNoteEdit->text() );
if ( mBirthdayPicker->inputIsValid() ) {
QDate da = mBirthdayPicker->date();
- if ( da > QDate::currentDate() )
- da.setYMD(da.year()-100, da.month(), da.day() );
mAddressee.setBirthday( QDateTime( da ) );
//qDebug("bday %s ",da.toString().latin1());
}
else {
mAddressee.setBirthday( QDateTime() );
mBirthdayPicker->clear();
}
mAddressee.setNickName( mNicknameEdit->text() );
mAddressee.setCategories( QStringList::split( ",", mCategoryEdit->text() ) );
mAddressee.setGeo( mGeoWidget->geo() );
mAddressee.setPhoto( mImageWidget->photo() );
mAddressee.setLogo( mImageWidget->logo() );
mAddressee.setKeys( mKeyWidget->keys() );
#ifndef KAB_EMBEDDED
mAddressee.setSound( mSoundWidget->sound() );
#else //KAB_EMBEDDED
//US qDebug("AddresseeEditorWidget::save sound not supported");
#endif //KAB_EMBEDDED
mAddressee.setSecrecy( mSecrecyWidget->secrecy() );
// save custom fields
mAddressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", mIMAddressEdit->text() );
mAddressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", mSpouseEdit->text() );
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 3715786..046cb63 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -354,48 +354,49 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
connect( mViewManager, SIGNAL( deleteRequest( ) ),
SLOT( deleteContacts( ) ) );
connect( mViewManager, SIGNAL( modified() ),
SLOT( setModified() ) );
connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) );
connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) );
connect( mXXPortManager, SIGNAL( modified() ),
SLOT( setModified() ) );
connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ),
SLOT( incrementalSearchJump( const QString& ) ) );
connect( mIncSearchWidget, SIGNAL( fieldChanged() ),
mJumpButtonBar, SLOT( recreateButtons() ) );
connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
SLOT( sendMail( const QString& ) ) );
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()));
+ connect( ExternalAppHandler::instance(), SIGNAL (doRingSync()),this, SLOT( doRingSync()));
connect( ExternalAppHandler::instance(), SIGNAL (callContactdialog()),this, SLOT(callContactdialog()));
#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
@@ -2559,48 +2560,52 @@ void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QSt
message( i18n("Resizing, please wait...") );
mMainWindow->showMinimized();
/*
{
QCopEnvelope e("QPE/Application/kapi", "callContactdialog()");
}
*/
QTimer::singleShot( 1,this, SLOT ( resizeAndCallContactdialog() ) );
return;
}
} else {
qDebug("KABCore::requestForNameEmailUidList:: Got invalid uid ");
}
callContactdialog();
//QCopEnvelope e("QPE/Application/kapi", "callContactdialog()");
#endif
}
void KABCore::resizeAndCallContactdialog()
{
updateMainWindow();
QTimer::singleShot( 10,this, SLOT ( callContactdialog() ) );
}
+void KABCore::doRingSync()
+{
+ syncManager->multiSync( false );
+}
void KABCore::callContactdialog()
{
static bool running = false;
if (running) return;
running = true;
QStringList nameList;
QStringList emailList;
QStringList uidList;
qDebug(" KABCore::callContactdialog:DESKTOP WIDTH %d ", QApplication::desktop()->width() );
KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
uint i=0;
for (i=0; i < list.count(); i++)
{
nameList.append(list[i].realName());
emailList.append(list[i].preferredEmail());
uidList.append(list[i].uid());
}
QString uid = mEmailSourceUID;
//qDebug("%s %s ", sourceChannel.latin1(), uid.latin1());
bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(mEmailSourceChannel, uid, nameList, emailList, uidList);
running = false;
}
/* this method will be called through the QCop interface from Ko/Pi to select birthdays
* to put them into the calendar.
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index 6479a58..ceeeda7 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -352,48 +352,49 @@ class KABCore : public QWidget, public KSyncInterface
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 saveSettings();
private slots:
void updateToolBar();
void updateMainWindow();
void receive( const QCString& cmsg, const QByteArray& data );
void toggleBeamReceive( );
void disableBR(bool);
void setJumpButtonBarVisible( bool visible );
void setJumpButtonBar( bool visible );
void setCaptionBack();
void resizeAndCallContactdialog();
void callContactdialog();
+ void doRingSync();
void importFromOL();
void extensionModified( const KABC::Addressee::List &list );
void extensionChanged( int id );
void clipboardDataChanged();
void updateActionMenu();
void configureKeyBindings();
void removeVoice();
void setFormattedName();
#ifdef KAB_EMBEDDED
void configureResources();
#endif //KAB_EMBEDDED
void slotEditorDestroyed( const QString &uid );
void configurationChanged();
void addressBookChanged();
private:
QString mEmailSourceChannel;
QString mEmailSourceUID;
void resizeEvent(QResizeEvent* e );
bool mBRdisabled;
#ifndef DESKTOP_VERSION
QCopChannel* infrared;