summaryrefslogtreecommitdiff
path: root/core
authorsimon <simon>2002-03-25 20:18:22 (UTC)
committer simon <simon>2002-03-25 20:18:22 (UTC)
commitfb6b1e63a784a6724e05f16269126ea49a7ad54b (patch) (side-by-side diff)
tree371aa324f17cd3615ff8ece5c85abffd902b5c31 /core
parentb001d834cd1259ea17fd1faf82111a1efdf607db (diff)
downloadopie-fb6b1e63a784a6724e05f16269126ea49a7ad54b.zip
opie-fb6b1e63a784a6724e05f16269126ea49a7ad54b.tar.gz
opie-fb6b1e63a784a6724e05f16269126ea49a7ad54b.tar.bz2
- no default argument in method implementations
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/abeditor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/pim/addressbook/abeditor.cpp b/core/pim/addressbook/abeditor.cpp
index 6354db9..94baa71 100644
--- a/core/pim/addressbook/abeditor.cpp
+++ b/core/pim/addressbook/abeditor.cpp
@@ -1,248 +1,248 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** 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.
**
**********************************************************************/
#include "abeditor.h"
#include "addresspicker.h"
#include <qpe/categoryselect.h>
#include <qpe/qpeapplication.h>
#include <qpe/qpedialog.h>
#include <qcombobox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qmultilineedit.h>
#include <qscrollview.h>
#include <qtoolbutton.h>
#include <qpushbutton.h>
#include <qmainwindow.h>
static inline bool containsAlphaNum( const QString &str );
static inline bool constainsWhiteSpace( const QString &str );
// helper functions, convert our comma delimited list to proper
// file format...
void parseEmailFrom( const QString &txt, QString &strDefaultEmail,
QString &strAll );
// helper convert from file format to comma delimited...
void parseEmailTo( const QString &strDefaultEmail,
const QString &strOtherEmail, QString &strBack );
AbEditor::AbEditor( const Contact &entry, const QValueList<int> *newOrdered,
QStringList *slNewOrdered,
- QWidget *parent = 0, const char *name = 0, WFlags fl = 0 )
+ QWidget *parent, const char *name, WFlags fl )
: QDialog( parent, name, TRUE, fl ),
orderedValues( newOrdered ),
slOrdered( slNewOrdered )
{
init();
initMap();
setEntry( entry );
}
AbEditor::~AbEditor()
{
}
void AbEditor::init()
{
middleEdit = 0;
QVBoxLayout *vb = new QVBoxLayout( this );
svPage = new QScrollView( this );
svPage->setHScrollBarMode( QScrollView::AlwaysOff );
vb->addWidget( svPage );
svPage->setResizePolicy( QScrollView::AutoOneFit );
svPage->setFrameStyle( QFrame::NoFrame );
QWidget *container = new QWidget( svPage->viewport() );
svPage->addChild( container );
QGridLayout *gl = new QGridLayout( container, 20, 2, 4, 2 );
QLabel *l = new QLabel( tr("First Name"), container );
gl->addWidget( l, 0, 0 );
firstEdit = new QLineEdit( container );
gl->addWidget( firstEdit, 0, 1 );
l = new QLabel( tr("Last Name"), container );
gl->addWidget( l, 1, 0 );
lastEdit = new QLineEdit( container );
gl->addWidget( lastEdit, 1, 1 );
l = new QLabel( tr("Categories"), container );
gl->addWidget( l, 2, 0 );
cmbCat = new CategorySelect( container );
gl->addWidget( cmbCat, 2, 1 );
int i;
bool foundGender,
foundNotes;
foundGender = foundNotes = false;
QStringList::ConstIterator it = slOrdered->begin();
for ( i = 0; it != slOrdered->end(); i++, ++it ) {
if ( !foundGender && *it == tr("Gender") ) {
foundGender = true;
} else if ( !foundNotes && *it == tr("Notes") ) {
foundNotes = true;
} else {
l = new QLabel( *it, container );
listName.append( l );
gl->addWidget( l, i + 3, 0 );
QLineEdit *e = new QLineEdit( container );
listValue.append( e );
gl->addWidget( e, i + 3, 1 );
if ( *it == tr( "Middle Name" ) )
middleEdit = e;
}
}
l = new QLabel( tr("Gender"), container );
gl->addWidget( l, slOrdered->count() + 3, 0 );
genderCombo = new QComboBox( container );
genderCombo->insertItem( "", 0 );
genderCombo->insertItem( tr( "Male" ), 1 );
genderCombo->insertItem( tr( "Female" ), 2 );
gl->addWidget( genderCombo, slOrdered->count() + 3, 1 );
dlgNote = new QDialog( this, "Note Dialog", TRUE );
dlgNote->setCaption( tr("Enter Note") );
QVBoxLayout *vbNote = new QVBoxLayout( dlgNote );
// lblNote = new QLabel( dlgNote );
// lblNote->setMinimumSize( lblNote->sizeHint() + QSize( 0, 4 ) );
// vbNote->addWidget( lblNote );
txtNote = new QMultiLineEdit( dlgNote );
vbNote->addWidget( txtNote );
QHBoxLayout *hb = new QHBoxLayout( vb );
hb->addStretch( 2 );
QPushButton *pb = new QPushButton( tr("Notes..."), this );
hb->addWidget( pb );
connect( pb, SIGNAL(clicked()), this, SLOT(slotNote()) );
new QPEDialogListener(this);
}
void AbEditor::initMap()
{
/*
// since the fields and the XML fields exist, create a map
// between them...
Config cfg1( "AddressBook" );
Config cfg2( "AddressBook" );
QString strCfg1,
strCfg2;
int i;
// This stuff better exist...
cfg1.setGroup( "AddressFields" );
cfg2.setGroup( "XMLFields" );
i = 0;
strCfg1 = cfg1.readEntry( "Field" + QString::number(i), QString::null );
strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++),
QString::null );
while ( !strCfg1.isNull() && !strCfg2.isNull() ) {
mapField.insert( strCfg1, strCfg2 );
strCfg1 = cfg1.readEntry( "Field" + QString::number(i),
QString::null );
strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++),
QString::null );
}
*/
}
void AbEditor::loadFields()
{
QStringList::ConstIterator it;
QListIterator<QLabel> lit( listName );
for ( it = slOrdered->begin(); *lit; ++lit, ++it ) {
(*lit)->setText( *it );
}
}
void AbEditor::setEntry( const Contact &entry )
{
ent = entry;
QListIterator<QLineEdit> it( listValue );
firstEdit->setText( ent.firstName() );
lastEdit->setText( ent.lastName() );
cmbCat->setCategories( ent.categories(), "Contacts", tr("Contacts") );
// ### Fix...
QValueList<int>::ConstIterator itVl;
for ( itVl = orderedValues->begin(); *it && itVl != orderedValues->end();
++itVl, ++it ) {
switch( *itVl ) {
case Qtopia::Title:
(*it)->setText(ent.title());
break;
case Qtopia::MiddleName:
(*it)->setText( ent.middleName() );
break;
case Qtopia::Suffix:
(*it)->setText( ent.suffix() );
break;
// email
case Qtopia::DefaultEmail:
case Qtopia::Emails:
{
QString strDefEmail = ent.defaultEmail();
QString strAllEmail = ent.emails();
QString strFinal;
parseEmailTo( strDefEmail, strAllEmail, strFinal );
(*it)->setText( strFinal );
// make sure we see the "default"
(*it)->home( false );
break;
}
// home
case Qtopia::HomeStreet:
(*it)->setText(ent.homeStreet() );
break;
case Qtopia::HomeCity:
(*it)->setText( ent.homeCity() );
break;
case Qtopia::HomeState:
(*it)->setText( ent.homeState() );
break;
case Qtopia::HomeZip:
(*it)->setText( ent.homeZip() );
break;
case Qtopia::HomeCountry:
(*it)->setText( ent.homeCountry() );
break;
case Qtopia::HomePhone:
(*it)->setText( ent.homePhone() );
break;
case Qtopia::HomeFax:
(*it)->setText( ent.homeFax() );
break;
case Qtopia::HomeMobile:
(*it)->setText( ent.homeMobile() );
break;
case Qtopia::HomeWebPage:
(*it)->setText( ent.homeWebpage() );