summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show 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,184 +1,184 @@
/**********************************************************************
** 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 );
}
}