summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/pim/addressbook/contacteditor.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index 0e752ca..6edab2c 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -1,96 +1,115 @@
+/*
+ * Copyright (c) 2002 Michael R. Crawford <mike@tuxnami.org>
+ *
+ * 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>
#include <qcombobox.h>
#include <qlabel.h>
#include <qtabwidget.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qmultilineedit.h>
#include <qscrollview.h>
#include <qtoolbutton.h>
#include <qpushbutton.h>
#include <qmainwindow.h>
#include <qvaluelist.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 );
ContactEditor::ContactEditor( const Contact &entry,
const QValueList<int> *newOrderedValues,
QStringList *slNewOrdered,
QWidget *parent = 0,
const char *name = 0,
WFlags fl = 0 )
: QDialog( parent, name, TRUE, fl ),
orderedValues( newOrderedValues ),
slOrdered( slNewOrdered )
{
init();
initMap();
setEntry( entry );
qDebug("finish");
}
ContactEditor::~ContactEditor() {
}
void ContactEditor::init() {
useFullName = TRUE;
int i = 0;
slHomeAddress = new QStringList;
slBusinessAddress = new QStringList;
slChooserNames = new QStringList;
slChooserValues = new QStringList;
slDynamicEntries = new QStringList;
//*slDynamicEntries = *slOrdered;
for (i = 0; i <= 6; i++) {
slHomeAddress->append( "" );
slBusinessAddress->append( "" );
}
{
hasGender = FALSE;
hasTitle = FALSE;
hasCompany = FALSE;
hasNotes = FALSE;
hasStreet = FALSE;
hasStreet2 = FALSE;
hasPOBox = FALSE;
hasCity = FALSE;
hasState = FALSE;
hasZip = FALSE;
hasCountry = FALSE;
QStringList::ConstIterator it = slOrdered->begin();
for ( i = 0; it != slOrdered->end(); i++, ++it ) {
if ( (*it).right( 3 ) == tr( "Fax" ) ) {
slChooserNames->append( *it );
slChooserValues->append( tr( "" ) );
//slDynamicEntries->remove( it );
continue;
}
if ( (*it).right( 5 ) == tr( "Phone" ) ) {