author | tux_mike <tux_mike> | 2002-04-02 02:19:00 (UTC) |
---|---|---|
committer | tux_mike <tux_mike> | 2002-04-02 02:19:00 (UTC) |
commit | 623ce8225b7f75755146601e2c8d7f1e7e9a65d0 (patch) (unidiff) | |
tree | 093fdf38af46e9c8c1090d32a0e81c45e2032c92 | |
parent | 44bfa84cc6d9bcd828f0b08c7bf59dde58dd5288 (diff) | |
download | opie-623ce8225b7f75755146601e2c8d7f1e7e9a65d0.zip opie-623ce8225b7f75755146601e2c8d7f1e7e9a65d0.tar.gz opie-623ce8225b7f75755146601e2c8d7f1e7e9a65d0.tar.bz2 |
Added a copyright notice... completley forgot... I gotta stop updating like this ;)
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 19 |
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 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2002 Michael R. Crawford <mike@tuxnami.org> | ||
3 | * | ||
4 | * This file is an add-on for the OPIE Palmtop Environment | ||
5 | * | ||
6 | * This file may be distributed and/or modified under the terms of the | ||
7 | * GNU General Public License version 2 as published by the Free Software | ||
8 | * Foundation and appearing in the file LICENSE.GPL included in the pacakaging | ||
9 | * of this file. | ||
10 | * | ||
11 | * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | * | ||
14 | * | ||
15 | * This is a rewrite of the abeditor.h file, modified to provide a more | ||
16 | * intuitive interface to TrollTech's original Address Book editor. This | ||
17 | * is made to operate exactly in interface with the exception of name. | ||
18 | * | ||
19 | */ | ||
1 | 20 | ||
2 | #include "contacteditor.h" | 21 | #include "contacteditor.h" |
3 | #include "addresspicker.h" | 22 | #include "addresspicker.h" |
4 | 23 | ||
5 | #include <qpe/categoryselect.h> | 24 | #include <qpe/categoryselect.h> |
6 | #include <qpe/qpeapplication.h> | 25 | #include <qpe/qpeapplication.h> |
7 | #include <qpe/qpedialog.h> | 26 | #include <qpe/qpedialog.h> |
8 | 27 | ||
9 | #include <qcombobox.h> | 28 | #include <qcombobox.h> |
10 | #include <qlabel.h> | 29 | #include <qlabel.h> |
11 | #include <qtabwidget.h> | 30 | #include <qtabwidget.h> |
12 | #include <qlayout.h> | 31 | #include <qlayout.h> |
13 | #include <qlineedit.h> | 32 | #include <qlineedit.h> |
14 | #include <qmultilineedit.h> | 33 | #include <qmultilineedit.h> |
15 | #include <qscrollview.h> | 34 | #include <qscrollview.h> |
16 | #include <qtoolbutton.h> | 35 | #include <qtoolbutton.h> |
17 | #include <qpushbutton.h> | 36 | #include <qpushbutton.h> |
18 | #include <qmainwindow.h> | 37 | #include <qmainwindow.h> |
19 | #include <qvaluelist.h> | 38 | #include <qvaluelist.h> |
20 | 39 | ||
21 | static inline bool containsAlphaNum( const QString &str ); | 40 | static inline bool containsAlphaNum( const QString &str ); |
22 | static inline bool constainsWhiteSpace( const QString &str ); | 41 | static inline bool constainsWhiteSpace( const QString &str ); |
23 | 42 | ||
24 | // helper functions, convert our comma delimited list to proper | 43 | // helper functions, convert our comma delimited list to proper |
25 | // file format... | 44 | // file format... |
26 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, | 45 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, |
27 | QString &strAll ); | 46 | QString &strAll ); |
28 | 47 | ||
29 | // helper convert from file format to comma delimited... | 48 | // helper convert from file format to comma delimited... |
30 | void parseEmailTo( const QString &strDefaultEmail, | 49 | void parseEmailTo( const QString &strDefaultEmail, |
31 | const QString &strOtherEmail, QString &strBack ); | 50 | const QString &strOtherEmail, QString &strBack ); |
32 | 51 | ||
33 | ContactEditor::ContactEditor(const Contact &entry, | 52 | ContactEditor::ContactEditor(const Contact &entry, |
34 | const QValueList<int> *newOrderedValues, | 53 | const QValueList<int> *newOrderedValues, |
35 | QStringList *slNewOrdered, | 54 | QStringList *slNewOrdered, |
36 | QWidget *parent = 0, | 55 | QWidget *parent = 0, |
37 | const char *name = 0, | 56 | const char *name = 0, |
38 | WFlags fl = 0 ) | 57 | WFlags fl = 0 ) |
39 | : QDialog( parent, name, TRUE, fl ), | 58 | : QDialog( parent, name, TRUE, fl ), |
40 | orderedValues( newOrderedValues ), | 59 | orderedValues( newOrderedValues ), |
41 | slOrdered( slNewOrdered ) | 60 | slOrdered( slNewOrdered ) |
42 | { | 61 | { |
43 | 62 | ||
44 | init(); | 63 | init(); |
45 | initMap(); | 64 | initMap(); |
46 | setEntry( entry ); | 65 | setEntry( entry ); |
47 | qDebug("finish"); | 66 | qDebug("finish"); |
48 | } | 67 | } |
49 | 68 | ||
50 | ContactEditor::~ContactEditor() { | 69 | ContactEditor::~ContactEditor() { |
51 | } | 70 | } |
52 | 71 | ||
53 | void ContactEditor::init() { | 72 | void ContactEditor::init() { |
54 | 73 | ||
55 | useFullName = TRUE; | 74 | useFullName = TRUE; |
56 | 75 | ||
57 | int i = 0; | 76 | int i = 0; |
58 | 77 | ||
59 | slHomeAddress = new QStringList; | 78 | slHomeAddress = new QStringList; |
60 | slBusinessAddress = new QStringList; | 79 | slBusinessAddress = new QStringList; |
61 | slChooserNames = new QStringList; | 80 | slChooserNames = new QStringList; |
62 | slChooserValues = new QStringList; | 81 | slChooserValues = new QStringList; |
63 | 82 | ||
64 | slDynamicEntries = new QStringList; | 83 | slDynamicEntries = new QStringList; |
65 | 84 | ||
66 | //*slDynamicEntries = *slOrdered; | 85 | //*slDynamicEntries = *slOrdered; |
67 | 86 | ||
68 | for (i = 0; i <= 6; i++) { | 87 | for (i = 0; i <= 6; i++) { |
69 | slHomeAddress->append( "" ); | 88 | slHomeAddress->append( "" ); |
70 | slBusinessAddress->append( "" ); | 89 | slBusinessAddress->append( "" ); |
71 | } | 90 | } |
72 | 91 | ||
73 | { | 92 | { |
74 | hasGender = FALSE; | 93 | hasGender = FALSE; |
75 | hasTitle = FALSE; | 94 | hasTitle = FALSE; |
76 | hasCompany = FALSE; | 95 | hasCompany = FALSE; |
77 | hasNotes = FALSE; | 96 | hasNotes = FALSE; |
78 | hasStreet = FALSE; | 97 | hasStreet = FALSE; |
79 | hasStreet2 = FALSE; | 98 | hasStreet2 = FALSE; |
80 | hasPOBox = FALSE; | 99 | hasPOBox = FALSE; |
81 | hasCity = FALSE; | 100 | hasCity = FALSE; |
82 | hasState = FALSE; | 101 | hasState = FALSE; |
83 | hasZip = FALSE; | 102 | hasZip = FALSE; |
84 | hasCountry = FALSE; | 103 | hasCountry = FALSE; |
85 | 104 | ||
86 | QStringList::ConstIterator it = slOrdered->begin(); | 105 | QStringList::ConstIterator it = slOrdered->begin(); |
87 | for ( i = 0; it != slOrdered->end(); i++, ++it ) { | 106 | for ( i = 0; it != slOrdered->end(); i++, ++it ) { |
88 | 107 | ||
89 | if ( (*it).right( 3 ) == tr( "Fax" ) ) { | 108 | if ( (*it).right( 3 ) == tr( "Fax" ) ) { |
90 | slChooserNames->append( *it ); | 109 | slChooserNames->append( *it ); |
91 | slChooserValues->append( tr( "" ) ); | 110 | slChooserValues->append( tr( "" ) ); |
92 | //slDynamicEntries->remove( it ); | 111 | //slDynamicEntries->remove( it ); |
93 | continue; | 112 | continue; |
94 | } | 113 | } |
95 | 114 | ||
96 | if ( (*it).right( 5 ) == tr( "Phone" ) ) { | 115 | if ( (*it).right( 5 ) == tr( "Phone" ) ) { |