summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/abtable.cpp5
-rw-r--r--core/pim/addressbook/contacteditor.cpp34
2 files changed, 20 insertions, 19 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp
index 4feadeb..5222f16 100644
--- a/core/pim/addressbook/abtable.cpp
+++ b/core/pim/addressbook/abtable.cpp
@@ -3,48 +3,49 @@
**
** This file is part of Qt Palmtop Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#define QTOPIA_INTERNAL_CONTACT_MRE
#include <qpe/categoryselect.h>
#include <qpe/config.h>
#include <qpe/stringutil.h>
#include <qpe/qcopenvelope_qws.h>
+#include <qpe/timestring.h>
#include <opie/orecordlist.h>
#include <qasciidict.h>
#include <qdatetime.h>
#include <qfile.h>
#include <qregexp.h>
#include <qmessagebox.h>
#include "abtable.h"
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <ctype.h> //toupper() for key hack
static bool contactCompare( const OContact &cnt, const QRegExp &r, int category );
/*!
\class AbTableItem abtable.h
@@ -429,52 +430,52 @@ QString AbTable::findContactContact( const OContact &entry, int /* row */ )
value = entry.businessFax();
break;
case Qtopia::BusinessMobile:
value = entry.businessMobile();
break;
case Qtopia::BusinessPager:
value = entry.businessPager();
break;
case Qtopia::Profession:
value = entry.profession();
break;
case Qtopia::Assistant:
value = entry.assistant();
break;
case Qtopia::Manager:
value = entry.manager();
break;
case Qtopia::Spouse:
value = entry.spouse();
break;
case Qtopia::Gender:
value = entry.gender();
break;
case Qtopia::Birthday:
- value = entry.birthday();
+ value = TimeString::numberDateString( entry.birthday() );
break;
case Qtopia::Anniversary:
- value = entry.anniversary();
+ value = TimeString::numberDateString( entry.anniversary() );
break;
case Qtopia::Nickname:
value = entry.nickname();
break;
case Qtopia::Children:
value = entry.children();
break;
case Qtopia::Notes:
value = entry.notes();
break;
}
if ( !value.isEmpty() )
break;
}
return value;
}
void AbTable::addEntry( const OContact &newCnt )
{
int row = numRows();
setNumRows( row + 1 );
insertIntoTable( newCnt, row );
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index 52ab0f2..e034b35 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -1,26 +1,27 @@
/*
* Copyright (c) 2002 Michael R. Crawford <mike@tuxnami.org>
+ * Copyright (C) 2002 by Stefan Eilers (eilers.stefan@epost.de)
*
* This file is an add-on for the OPIE Palmtop Environment
*
* This file may be distributed and/or modified under the terms of the
* GNU General Public License version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the pacakaging
* of this file.
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*
* This is a rewrite of the abeditor.h file, modified to provide a more
* intuitive interface to TrollTech's original Address Book editor. This
* is made to operate exactly in interface with the exception of name.
*
*/
#include "contacteditor.h"
#include "addresspicker.h"
#include <qpe/categoryselect.h>
#include <qpe/qpeapplication.h>
#include <qpe/qpedialog.h>
@@ -1087,62 +1088,48 @@ void ContactEditor::loadFields() {
if ( *it == "Company" )
(*lit)->setText( tr( "Company" ) );
if ( *it == "Office" )
(*lit)->setText( tr( "Office" ) );
if ( *it == "Profession" )
(*lit)->setText( tr( "Profession" ) );
if ( *it == "Assistant" )
(*lit)->setText( tr( "Assistant" ) );
if ( *it == "Manager" )
(*lit)->setText( tr( "Manager" ) );
if ( *it == "Spouse" )
(*lit)->setText( tr( "Spouse" ) );
if ( *it == "Nickname" )
(*lit)->setText( tr( "Nickname" ) );
if ( *it == "Children" )
(*lit)->setText( tr( "Children" ) );
}
- // Set DatePicker
- qWarning ("**Info: %s", ent.birthday().latin1() );
- if ( !ent.birthday().isEmpty() ){
- birthdayButton->setText( ent.birthday() );
- birthdayPicker->setDate( TimeConversion::fromString ( ent.birthday() ) );
- } else
- birthdayButton->setText( tr ("Unknown") );
-
- qWarning ("**Info: %s", ent.anniversary().latin1() );
- if ( !ent.anniversary().isEmpty() ){
- anniversaryButton->setText( ent.anniversary() );
- anniversaryPicker->setDate( TimeConversion::fromString ( ent.birthday() ) );
- } else
- anniversaryButton->setText( tr ("Unknown") );
}
void ContactEditor::accept() {
if ( isEmpty() ) {
cleanupFields();
reject();
} else {
saveEntry();
cleanupFields();
QDialog::accept();
}
}
void ContactEditor::slotNote() {
dlgNote->showMaximized();
if ( !dlgNote->exec() ) {
txtNote->setText( ent.notes() );
}
}
@@ -1580,49 +1567,62 @@ void ContactEditor::setEntry( const OContact &entry ) {
*/
if ( *it == "Home Web Page" )
*itV = ent.homeWebpage();
if ( ( *it == "Business WebPage" ) || ( *it == "Work Web Page" ) )
*itV = ent.businessWebpage();
}
cmbCat->setCategories( ent.categories(), "Contacts", tr("Contacts") );
QString gender = ent.gender();
cmbGender->setCurrentItem( gender.toInt() );
txtNote->setText( ent.notes() );
slotCmbChooser1Change( cmbChooserField1->currentItem() );
slotCmbChooser2Change( cmbChooserField2->currentItem() );
slotCmbChooser3Change( cmbChooserField3->currentItem() );
slotAddressTypeChange( cmbAddress->currentItem() );
- loadFields();
+ // loadFields(); :SX
+
+ // Set DatePicker
+ if ( !ent.birthday().isNull() ){
+ birthdayButton->setText( TimeString::numberDateString( ent.birthday() ) );
+ birthdayPicker->setDate( ent.birthday() );
+ } else
+ birthdayButton->setText( tr ("Unknown") );
+
+ if ( !ent.anniversary().isNull() ){
+ anniversaryButton->setText( TimeString::numberDateString( ent.anniversary() ) );
+ anniversaryPicker->setDate( ent.anniversary() );
+ } else
+ anniversaryButton->setText( tr ("Unknown") );
}
void ContactEditor::saveEntry() {
if ( useFullName == TRUE ) {
txtFirstName->setText( parseName( txtFullName->text(), NAME_F ) );
txtMiddleName->setText( parseName( txtFullName->text(), NAME_M ) );
txtLastName->setText( parseName( txtFullName->text(), NAME_L ) );
txtSuffix->setText( parseName( txtFullName->text(), NAME_S ) );
useFullName = FALSE;
}
/*if ( ent.firstName() != txtFirstName->text() ||
ent.lastName != txtLastName->text() ||
ent.middleName != txtMiddleName->text() ) {
*/
ent.setFirstName( txtFirstName->text() );
ent.setLastName( txtLastName->text() );
ent.setMiddleName( txtMiddleName->text() );
ent.setSuffix( txtSuffix->text() );
//}
@@ -1870,35 +1870,35 @@ static inline bool constainsWhiteSpace( const QString &str )
if ( str[i].isSpace() )
return TRUE;
return FALSE;
}
void ContactEditor::setPersonalView( bool personal )
{
m_personalView = personal;
if ( personal ){
cmbCat->hide();
labCat->hide();
} else{
cmbCat->show();
labCat->show();
}
}
void ContactEditor::slotAnniversaryDateChanged( int year, int month, int day)
{
QDate date;
date.setYMD( year, month, day );
QString dateString = TimeString::numberDateString( date );
anniversaryButton->setText( dateString );
- ent.setAnniversary ( dateString );
+ ent.setAnniversary ( date );
}
void ContactEditor::slotBirthdayDateChanged( int year, int month, int day)
{
QDate date;
date.setYMD( year, month, day );
QString dateString = TimeString::numberDateString( date );
birthdayButton->setText( dateString );
- ent.setBirthday ( dateString );
+ ent.setBirthday ( date );
}