summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/contacteditor.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index 4e73114..254cff7 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -1,192 +1,192 @@
1/* 1/*
2 * Copyright (c) 2002 Michael R. Crawford <mike@tuxnami.org> 2 * Copyright (c) 2002 Michael R. Crawford <mike@tuxnami.org>
3 * Copyright (C) 2002 by Stefan Eilers (eilers.stefan@epost.de) 3 * Copyright (C) 2002 by Stefan Eilers (eilers.stefan@epost.de)
4 * 4 *
5 * This file is an add-on for the OPIE Palmtop Environment 5 * This file is an add-on for the OPIE Palmtop Environment
6 * 6 *
7 * This file may be distributed and/or modified under the terms of the 7 * This file may be distributed and/or modified under the terms of the
8 * GNU General Public License version 2 as published by the Free Software 8 * GNU General Public License version 2 as published by the Free Software
9 * Foundation and appearing in the file LICENSE.GPL included in the pacakaging 9 * Foundation and appearing in the file LICENSE.GPL included in the pacakaging
10 * of this file. 10 * of this file.
11 * 11 *
12 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 12 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
13 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 13 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14 * 14 *
15 * 15 *
16 * This is a rewrite of the abeditor.h file, modified to provide a more 16 * This is a rewrite of the abeditor.h file, modified to provide a more
17 * intuitive interface to TrollTech's original Address Book editor. This 17 * intuitive interface to TrollTech's original Address Book editor. This
18 * is made to operate exactly in interface with the exception of name. 18 * is made to operate exactly in interface with the exception of name.
19 * 19 *
20 */ 20 */
21 21
22#include "contacteditor.h" 22#include "contacteditor.h"
23#include "addresspicker.h" 23#include "addresspicker.h"
24#include "ocontactfields.h" 24#include "ocontactfields.h"
25 25
26#include <qpe/categoryselect.h> 26#include <qpe/categoryselect.h>
27#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
28#include <qpe/qpedialog.h> 28#include <qpe/qpedialog.h>
29#include <qpe/timeconversion.h> 29#include <qpe/timeconversion.h>
30#include <opie/ocontact.h> 30#include <opie/ocontact.h>
31#include <qpe/resource.h> 31#include <qpe/resource.h>
32 32
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qlabel.h> 34#include <qlabel.h>
35#include <qtabwidget.h> 35#include <qtabwidget.h>
36#include <qlayout.h> 36#include <qlayout.h>
37#include <qlineedit.h> 37#include <qlineedit.h>
38#include <qmultilineedit.h> 38#include <qmultilineedit.h>
39#include <qscrollview.h> 39#include <qscrollview.h>
40#include <qtoolbutton.h> 40#include <qtoolbutton.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qmainwindow.h> 42#include <qmainwindow.h>
43#include <qvaluelist.h> 43#include <qvaluelist.h>
44#include <qpopupmenu.h> 44#include <qpopupmenu.h>
45#include <qlistbox.h> 45#include <qlistbox.h>
46#include <qhbox.h> 46#include <qhbox.h>
47#include <qaction.h> 47#include <qaction.h>
48#include <qiconset.h> 48#include <qiconset.h>
49 49
50static inline bool containsAlphaNum( const QString &str ); 50static inline bool containsAlphaNum( const QString &str );
51static inline bool constainsWhiteSpace( const QString &str ); 51static inline bool constainsWhiteSpace( const QString &str );
52 52
53// helper functions, convert our comma delimited list to proper 53// helper functions, convert our comma delimited list to proper
54// file format... 54// file format...
55void parseEmailFrom( const QString &txt, QString &strDefaultEmail, 55void parseEmailFrom( const QString &txt, QString &strDefaultEmail,
56 QString &strAll ); 56 QString &strAll );
57 57
58// helper convert from file format to comma delimited... 58// helper convert from file format to comma delimited...
59void parseEmailTo( const QString &strDefaultEmail, 59void parseEmailTo( const QString &strDefaultEmail,
60 const QString &strOtherEmail, QString &strBack ); 60 const QString &strOtherEmail, QString &strBack );
61 61
62 ContactEditor::ContactEditor(const OContact &entry, 62 ContactEditor::ContactEditor(const OContact &entry,
63 QWidget *parent, 63 QWidget *parent,
64 const char *name, 64 const char *name,
65 WFlags fl ) 65 WFlags fl )
66 : QDialog( parent, name, TRUE, fl ), 66 : QDialog( parent, name, TRUE, fl ),
67 m_personalView ( false ) 67 m_personalView ( false )
68 68
69{ 69{
70 70
71 init(); 71 init();
72 setEntry( entry ); 72 setEntry( entry );
73 cmbDefaultEmail = 0; 73 cmbDefaultEmail = 0;
74 defaultEmailChooserPosition = -1; 74 defaultEmailChooserPosition = -1;
75} 75}
76 76
77ContactEditor::~ContactEditor() { 77ContactEditor::~ContactEditor() {
78} 78}
79 79
80void ContactEditor::init() { 80void ContactEditor::init() {
81 81
82 useFullName = true; 82 useFullName = true;
83 83
84 uint i = 0; 84 uint i = 0;
85 85
86 QStringList trlChooserNames; 86 QStringList trlChooserNames;
87 87
88 for (i = 0; i <= 6; i++) { 88 for (i = 0; i <= 6; i++) {
89 slHomeAddress.append( "" ); 89 slHomeAddress.append( "" );
90 slBusinessAddress.append( "" ); 90 slBusinessAddress.append( "" );
91 } 91 }
92 92
93 trlChooserNames = OContactFields::trphonefields(); 93 trlChooserNames = OContactFields::trphonefields( false );
94 slChooserNames = OContactFields::untrphonefields(); 94 slChooserNames = OContactFields::untrphonefields( false );
95 slDynamicEntries = OContactFields::untrdetailsfields(); 95 slDynamicEntries = OContactFields::untrdetailsfields( false );
96 trlDynamicEntries = OContactFields::trdetailsfields(); 96 trlDynamicEntries = OContactFields::trdetailsfields( false );
97 for (i = 0; i < slChooserNames.count(); i++) 97 for (i = 0; i < slChooserNames.count(); i++)
98 slChooserValues.append(""); 98 slChooserValues.append("");
99 99
100 100
101 QVBoxLayout *vb = new QVBoxLayout( this ); 101 QVBoxLayout *vb = new QVBoxLayout( this );
102 102
103 tabMain = new QTabWidget( this ); 103 tabMain = new QTabWidget( this );
104 vb->addWidget( tabMain ); 104 vb->addWidget( tabMain );
105 105
106 QWidget *tabViewport = new QWidget ( tabMain ); 106 QWidget *tabViewport = new QWidget ( tabMain );
107 107
108 vb = new QVBoxLayout( tabViewport ); 108 vb = new QVBoxLayout( tabViewport );
109 109
110 svGeneral = new QScrollView( tabViewport ); 110 svGeneral = new QScrollView( tabViewport );
111 vb->addWidget( svGeneral, 0, 0 ); 111 vb->addWidget( svGeneral, 0, 0 );
112 svGeneral->setResizePolicy( QScrollView::AutoOneFit ); 112 svGeneral->setResizePolicy( QScrollView::AutoOneFit );
113 svGeneral->setFrameStyle( QFrame::NoFrame ); 113 svGeneral->setFrameStyle( QFrame::NoFrame );
114 114
115 QWidget *container = new QWidget( svGeneral->viewport() ); 115 QWidget *container = new QWidget( svGeneral->viewport() );
116 svGeneral->addChild( container ); 116 svGeneral->addChild( container );
117 117
118 QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); 118 QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 );
119 gl->setResizeMode( QLayout::FreeResize ); 119 gl->setResizeMode( QLayout::FreeResize );
120 120
121 btnFullName = new QPushButton( tr( "Full Name..." ), container ); 121 btnFullName = new QPushButton( tr( "Full Name..." ), container );
122 gl->addWidget( btnFullName, 0, 0 ); 122 gl->addWidget( btnFullName, 0, 0 );
123 txtFullName = new QLineEdit( container ); 123 txtFullName = new QLineEdit( container );
124 gl->addWidget( txtFullName, 0, 1 ); 124 gl->addWidget( txtFullName, 0, 1 );
125 125
126 QLabel *l = new QLabel( tr( "Job Title" ), container ); 126 QLabel *l = new QLabel( tr( "Job Title" ), container );
127 gl->addWidget( l, 1, 0 ); 127 gl->addWidget( l, 1, 0 );
128 txtJobTitle = new QLineEdit( container ); 128 txtJobTitle = new QLineEdit( container );
129 gl->addWidget( txtJobTitle, 1, 1 ); 129 gl->addWidget( txtJobTitle, 1, 1 );
130 130
131 l = new QLabel( tr( "Organization" ), container ); 131 l = new QLabel( tr( "Organization" ), container );
132 gl->addWidget( l, 2, 0 ); 132 gl->addWidget( l, 2, 0 );
133 txtOrganization = new QLineEdit( container ); 133 txtOrganization = new QLineEdit( container );
134 gl->addWidget( txtOrganization, 2, 1 ); 134 gl->addWidget( txtOrganization, 2, 1 );
135 135
136 cmbChooserField1 = new QComboBox( FALSE, container ); 136 cmbChooserField1 = new QComboBox( FALSE, container );
137 cmbChooserField1->setMaximumWidth( 90 ); 137 cmbChooserField1->setMaximumWidth( 90 );
138 gl->addWidget( cmbChooserField1, 3, 0 ); 138 gl->addWidget( cmbChooserField1, 3, 0 );
139 txtChooserField1 = new QLineEdit( container ); 139 txtChooserField1 = new QLineEdit( container );
140 gl->addWidget( txtChooserField1, 3, 1 ); 140 gl->addWidget( txtChooserField1, 3, 1 );
141 141
142 cmbChooserField2 = new QComboBox( FALSE, container ); 142 cmbChooserField2 = new QComboBox( FALSE, container );
143 cmbChooserField2->setMaximumWidth( 90 ); 143 cmbChooserField2->setMaximumWidth( 90 );
144 gl->addWidget( cmbChooserField2, 4, 0 ); 144 gl->addWidget( cmbChooserField2, 4, 0 );
145 txtChooserField2 = new QLineEdit( container ); 145 txtChooserField2 = new QLineEdit( container );
146 gl->addWidget( txtChooserField2, 4, 1 ); 146 gl->addWidget( txtChooserField2, 4, 1 );
147 147
148 cmbChooserField3 = new QComboBox( FALSE, container ); 148 cmbChooserField3 = new QComboBox( FALSE, container );
149 cmbChooserField3->setMaximumWidth( 90 ); 149 cmbChooserField3->setMaximumWidth( 90 );
150 gl->addWidget( cmbChooserField3, 5, 0 ); 150 gl->addWidget( cmbChooserField3, 5, 0 );
151 txtChooserField3 = new QLineEdit( container ); 151 txtChooserField3 = new QLineEdit( container );
152 gl->addWidget( txtChooserField3, 5, 1 ); 152 gl->addWidget( txtChooserField3, 5, 1 );
153 153
154 l = new QLabel( tr( "File As" ), container ); 154 l = new QLabel( tr( "File As" ), container );
155 gl->addWidget( l, 6, 0 ); 155 gl->addWidget( l, 6, 0 );
156 cmbFileAs = new QComboBox( TRUE, container ); 156 cmbFileAs = new QComboBox( TRUE, container );
157 gl->addWidget( cmbFileAs, 6, 1 ); 157 gl->addWidget( cmbFileAs, 6, 1 );
158 158
159 labCat = new QLabel( tr( "Category" ), container ); 159 labCat = new QLabel( tr( "Category" ), container );
160 gl->addWidget( labCat, 7, 0 ); 160 gl->addWidget( labCat, 7, 0 );
161 cmbCat = new CategorySelect( container ); 161 cmbCat = new CategorySelect( container );
162 gl->addWidget( cmbCat, 7, 1 ); 162 gl->addWidget( cmbCat, 7, 1 );
163 labCat->show(); 163 labCat->show();
164 cmbCat->show(); 164 cmbCat->show();
165 165
166 btnNote = new QPushButton( tr( "Notes..." ), container ); 166 btnNote = new QPushButton( tr( "Notes..." ), container );
167 gl->addWidget( btnNote, 8, 1 ); 167 gl->addWidget( btnNote, 8, 1 );
168 168
169 tabMain->insertTab( tabViewport, tr( "General" ) ); 169 tabMain->insertTab( tabViewport, tr( "General" ) );
170 170
171 tabViewport = new QWidget ( tabMain ); 171 tabViewport = new QWidget ( tabMain );
172 172
173 vb = new QVBoxLayout( tabViewport ); 173 vb = new QVBoxLayout( tabViewport );
174 174
175 svAddress = new QScrollView( tabViewport ); 175 svAddress = new QScrollView( tabViewport );
176 vb->addWidget( svAddress, 0, 0 ); 176 vb->addWidget( svAddress, 0, 0 );
177 svAddress->setResizePolicy( QScrollView::AutoOneFit ); 177 svAddress->setResizePolicy( QScrollView::AutoOneFit );
178 svAddress->setFrameStyle( QFrame::NoFrame ); 178 svAddress->setFrameStyle( QFrame::NoFrame );
179 179
180 container = new QWidget( svAddress->viewport() ); 180 container = new QWidget( svAddress->viewport() );
181 svAddress->addChild( container ); 181 svAddress->addChild( container );
182 182
183 gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem 183 gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem
184 184
185 cmbAddress = new QComboBox( FALSE, container ); 185 cmbAddress = new QComboBox( FALSE, container );
186 cmbAddress->insertItem( tr( "Business" ) ); 186 cmbAddress->insertItem( tr( "Business" ) );
187 cmbAddress->insertItem( tr( "Home" ) ); 187 cmbAddress->insertItem( tr( "Home" ) );
188 gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); 188 gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 );
189 189
190 l = new QLabel( tr( "Address" ), container ); 190 l = new QLabel( tr( "Address" ), container );
191 gl->addWidget( l, 1, 0 ); 191 gl->addWidget( l, 1, 0 );
192 txtAddress = new QLineEdit( container ); 192 txtAddress = new QLineEdit( container );