author | drw <drw> | 2005-02-06 23:12:25 (UTC) |
---|---|---|
committer | drw <drw> | 2005-02-06 23:12:25 (UTC) |
commit | 5652634e4ff03370564925ce0856b260c001dc0f (patch) (unidiff) | |
tree | 614cbdec8ff9f4f674a9cb4e5caf44cce1def4f8 /core/pim/addressbook/contacteditor.cpp | |
parent | 266d71ee80151b3c97671acc95275aa65b682388 (diff) | |
download | opie-5652634e4ff03370564925ce0856b260c001dc0f.zip opie-5652634e4ff03370564925ce0856b260c001dc0f.tar.gz opie-5652634e4ff03370564925ce0856b260c001dc0f.tar.bz2 |
Convert to OPimMainWindow and UI tweaks. There is still a couple items yet to do...
Diffstat (limited to 'core/pim/addressbook/contacteditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 62 |
1 files changed, 30 insertions, 32 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index b078968..dec4c7c 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -28,13 +28,12 @@ | |||
28 | #include <qpe/categoryselect.h> | 28 | #include <qpe/categoryselect.h> |
29 | #include <qpe/qpeapplication.h> | 29 | #include <qpe/qpeapplication.h> |
30 | #include <qpe/qpedialog.h> | 30 | #include <qpe/qpedialog.h> |
31 | #include <qpe/resource.h> | 31 | #include <qpe/resource.h> |
32 | 32 | ||
33 | #include <qlabel.h> | 33 | #include <qlabel.h> |
34 | #include <qtabwidget.h> | ||
35 | #include <qlayout.h> | 34 | #include <qlayout.h> |
36 | #include <qlineedit.h> | 35 | #include <qlineedit.h> |
37 | #include <qmultilineedit.h> | 36 | #include <qmultilineedit.h> |
38 | #include <qtoolbutton.h> | 37 | #include <qtoolbutton.h> |
39 | #include <qlistbox.h> | 38 | #include <qlistbox.h> |
40 | #include <qmessagebox.h> | 39 | #include <qmessagebox.h> |
@@ -55,13 +54,13 @@ void parseEmailTo( const QString &strDefaultEmail, | |||
55 | const QString &strOtherEmail, QString &strBack ); | 54 | const QString &strOtherEmail, QString &strBack ); |
56 | 55 | ||
57 | ContactEditor::ContactEditor(const Opie::OPimContact &entry, | 56 | ContactEditor::ContactEditor(const Opie::OPimContact &entry, |
58 | QWidget *parent, | 57 | QWidget *parent, |
59 | const char *name, | 58 | const char *name, |
60 | WFlags ) | 59 | WFlags ) |
61 | : QDialog( parent, name, TRUE, WStyle_ContextHelp ), | 60 | : QDialog( parent, name, true, WStyle_ContextHelp ), |
62 | defaultEmailChooserPosition( -1 ), | 61 | defaultEmailChooserPosition( -1 ), |
63 | m_personalView ( false ), | 62 | m_personalView ( false ), |
64 | cmbDefaultEmail( 0 ), | 63 | cmbDefaultEmail( 0 ), |
65 | initializing ( false ) | 64 | initializing ( false ) |
66 | { | 65 | { |
67 | 66 | ||
@@ -116,31 +115,30 @@ void ContactEditor::init() { | |||
116 | for (i = 0; i < slChooserNames.count(); i++) | 115 | for (i = 0; i < slChooserNames.count(); i++) |
117 | slChooserValues.append(""); | 116 | slChooserValues.append(""); |
118 | 117 | ||
119 | 118 | ||
120 | QVBoxLayout *vb = new QVBoxLayout( this ); | 119 | QVBoxLayout *vb = new QVBoxLayout( this ); |
121 | 120 | ||
122 | tabMain = new QTabWidget( this ); | 121 | tabMain = new Opie::Ui::OTabWidget( this ); |
123 | vb->addWidget( tabMain ); | 122 | vb->addWidget( tabMain ); |
124 | 123 | ||
125 | QWidget *tabViewport = new QWidget ( tabMain ); | 124 | m_generalWidget = new QWidget ( tabMain ); |
126 | 125 | ||
127 | vb = new QVBoxLayout( tabViewport ); | 126 | vb = new QVBoxLayout( m_generalWidget ); |
128 | 127 | ||
129 | svGeneral = new QScrollView( tabViewport ); | 128 | svGeneral = new QScrollView( m_generalWidget ); |
130 | vb->addWidget( svGeneral, 0, 0 ); | 129 | vb->addWidget( svGeneral, 0, 0 ); |
131 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); | 130 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); |
132 | // svGeneral->setHScrollBarMode( QScrollView::AlwaysOff ); | 131 | // svGeneral->setHScrollBarMode( QScrollView::AlwaysOff ); |
133 | // svGeneral->setVScrollBarMode( QScrollView::AlwaysOff ); | 132 | // svGeneral->setVScrollBarMode( QScrollView::AlwaysOff ); |
134 | svGeneral->setFrameStyle( QFrame::NoFrame ); | 133 | svGeneral->setFrameStyle( QFrame::NoFrame ); |
135 | 134 | ||
136 | QWidget *container = new QWidget( svGeneral->viewport() ); | 135 | QWidget *container = new QWidget( svGeneral->viewport() ); |
137 | svGeneral->addChild( container ); | 136 | svGeneral->addChild( container ); |
138 | 137 | ||
139 | QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); | 138 | QGridLayout *gl = new QGridLayout( container, 10, 2, 2, 4 ); |
140 | gl->setResizeMode( QLayout::FreeResize ); | ||
141 | 139 | ||
142 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); | 140 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); |
143 | QWhatsThis::add( btnFullName, tr( "Press to enter last- middle and firstname" ) ); | 141 | QWhatsThis::add( btnFullName, tr( "Press to enter last- middle and firstname" ) ); |
144 | gl->addWidget( btnFullName, 0, 0 ); | 142 | gl->addWidget( btnFullName, 0, 0 ); |
145 | txtFullName = new ABOOK::NameLineEdit( container ); | 143 | txtFullName = new ABOOK::NameLineEdit( container ); |
146 | QWhatsThis::add( txtFullName, tr( "Enter fullname directly ! If you have a lastname with multiple words ( for instance \"de la Guerra\"), please write <lastname>,<firstnames> like this: \"de la Guerra, Carlos Pedro\"" ) ); | 144 | QWhatsThis::add( txtFullName, tr( "Enter fullname directly ! If you have a lastname with multiple words ( for instance \"de la Guerra\"), please write <lastname>,<firstnames> like this: \"de la Guerra, Carlos Pedro\"" ) ); |
@@ -165,39 +163,39 @@ void ContactEditor::init() { | |||
165 | gl->addWidget( l, 3, 0 ); | 163 | gl->addWidget( l, 3, 0 ); |
166 | txtOrganization = new QLineEdit( container ); | 164 | txtOrganization = new QLineEdit( container ); |
167 | QWhatsThis::add( txtOrganization, tr( "The working place of the contact" ) ); | 165 | QWhatsThis::add( txtOrganization, tr( "The working place of the contact" ) ); |
168 | gl->addWidget( txtOrganization, 3, 1 ); | 166 | gl->addWidget( txtOrganization, 3, 1 ); |
169 | 167 | ||
170 | // Chooser 1 | 168 | // Chooser 1 |
171 | cmbChooserField1 = new QComboBox( FALSE, container ); | 169 | cmbChooserField1 = new QComboBox( false, container ); |
172 | QWhatsThis::add( cmbChooserField1, tr( "Press to select attribute to change" ) ); | 170 | QWhatsThis::add( cmbChooserField1, tr( "Press to select attribute to change" ) ); |
173 | cmbChooserField1->setMaximumWidth( 90 ); | 171 | cmbChooserField1->setMaximumWidth( 90 ); |
174 | gl->addWidget( cmbChooserField1, 4, 0 ); | 172 | gl->addWidget( cmbChooserField1, 4, 0 ); |
175 | // Textfield for chooser 1. | 173 | // Textfield for chooser 1. |
176 | // Now use Widgetstack to contain the textfield and the default-email combo ! | 174 | // Now use Widgetstack to contain the textfield and the default-email combo ! |
177 | m_widgetStack1 = new QWidgetStack( container ); | 175 | m_widgetStack1 = new QWidgetStack( container ); |
178 | txtChooserField1 = new QLineEdit( m_widgetStack1 ); | 176 | txtChooserField1 = new QLineEdit( m_widgetStack1 ); |
179 | m_widgetStack1 -> addWidget( txtChooserField1, TextField ); | 177 | m_widgetStack1 -> addWidget( txtChooserField1, TextField ); |
180 | gl->addWidget( m_widgetStack1, 4, 1 ); | 178 | gl->addWidget( m_widgetStack1, 4, 1 ); |
181 | m_widgetStack1 -> raiseWidget( TextField ); | 179 | m_widgetStack1 -> raiseWidget( TextField ); |
182 | 180 | ||
183 | // Chooser 2 | 181 | // Chooser 2 |
184 | cmbChooserField2 = new QComboBox( FALSE, container ); | 182 | cmbChooserField2 = new QComboBox( false, container ); |
185 | QWhatsThis::add( cmbChooserField2, tr( "Press to select attribute to change" ) ); | 183 | QWhatsThis::add( cmbChooserField2, tr( "Press to select attribute to change" ) ); |
186 | cmbChooserField2->setMaximumWidth( 90 ); | 184 | cmbChooserField2->setMaximumWidth( 90 ); |
187 | gl->addWidget( cmbChooserField2, 5, 0 ); | 185 | gl->addWidget( cmbChooserField2, 5, 0 ); |
188 | // Textfield for chooser 2 | 186 | // Textfield for chooser 2 |
189 | // Now use WidgetStack to contain the textfield and the default-email combo! | 187 | // Now use WidgetStack to contain the textfield and the default-email combo! |
190 | m_widgetStack2 = new QWidgetStack( container ); | 188 | m_widgetStack2 = new QWidgetStack( container ); |
191 | txtChooserField2 = new QLineEdit( m_widgetStack2 ); | 189 | txtChooserField2 = new QLineEdit( m_widgetStack2 ); |
192 | m_widgetStack2 -> addWidget( txtChooserField2, TextField ); | 190 | m_widgetStack2 -> addWidget( txtChooserField2, TextField ); |
193 | gl->addWidget( m_widgetStack2, 5, 1 ); | 191 | gl->addWidget( m_widgetStack2, 5, 1 ); |
194 | m_widgetStack2 -> raiseWidget( TextField ); | 192 | m_widgetStack2 -> raiseWidget( TextField ); |
195 | 193 | ||
196 | // Chooser 3 | 194 | // Chooser 3 |
197 | cmbChooserField3 = new QComboBox( FALSE, container ); | 195 | cmbChooserField3 = new QComboBox( false, container ); |
198 | QWhatsThis::add( cmbChooserField3, tr( "Press to select attribute to change" ) ); | 196 | QWhatsThis::add( cmbChooserField3, tr( "Press to select attribute to change" ) ); |
199 | cmbChooserField3->setMaximumWidth( 90 ); | 197 | cmbChooserField3->setMaximumWidth( 90 ); |
200 | gl->addWidget( cmbChooserField3, 6, 0 ); | 198 | gl->addWidget( cmbChooserField3, 6, 0 ); |
201 | // Textfield for chooser 2 | 199 | // Textfield for chooser 2 |
202 | // Now use WidgetStack to contain the textfield and the default-email combo! | 200 | // Now use WidgetStack to contain the textfield and the default-email combo! |
203 | m_widgetStack3 = new QWidgetStack( container ); | 201 | m_widgetStack3 = new QWidgetStack( container ); |
@@ -206,28 +204,28 @@ void ContactEditor::init() { | |||
206 | gl->addWidget( m_widgetStack3, 6, 1 ); | 204 | gl->addWidget( m_widgetStack3, 6, 1 ); |
207 | m_widgetStack3 -> raiseWidget( TextField ); | 205 | m_widgetStack3 -> raiseWidget( TextField ); |
208 | 206 | ||
209 | l = new QLabel( tr( "File As" ), container ); | 207 | l = new QLabel( tr( "File As" ), container ); |
210 | QWhatsThis::add( l, tr( "Press to select how to store the name (and howto show it in the listview)" ) ); | 208 | QWhatsThis::add( l, tr( "Press to select how to store the name (and howto show it in the listview)" ) ); |
211 | gl->addWidget( l, 7, 0 ); | 209 | gl->addWidget( l, 7, 0 ); |
212 | cmbFileAs = new QComboBox( TRUE, container ); | 210 | cmbFileAs = new QComboBox( true, container ); |
213 | gl->addWidget( cmbFileAs, 7, 1 ); | 211 | gl->addWidget( cmbFileAs, 7, 1 ); |
214 | 212 | ||
215 | labCat = new QLabel( tr( "Category" ), container ); | 213 | labCat = new QLabel( tr( "Category" ), container ); |
216 | gl->addWidget( labCat, 8, 0 ); | 214 | gl->addWidget( labCat, 8, 0 ); |
217 | cmbCat = new CategorySelect( container ); | 215 | cmbCat = new CategorySelect( container ); |
218 | gl->addWidget( cmbCat, 8, 1 ); | 216 | gl->addWidget( cmbCat, 8, 1 ); |
219 | labCat->show(); | 217 | labCat->show(); |
220 | cmbCat->show(); | 218 | cmbCat->show(); |
221 | 219 | ||
222 | btnNote = new QPushButton( tr( "Notes..." ), container ); | 220 | btnNote = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Notes..." ), container ); |
223 | gl->addWidget( btnNote, 9, 1 ); | 221 | gl->addWidget( btnNote, 9, 1 ); |
224 | 222 | ||
225 | tabMain->insertTab( tabViewport, tr( "General" ) ); | 223 | tabMain->addTab( m_generalWidget, "addressbook/AddressBookSmall", tr( "General" ) ); |
226 | 224 | ||
227 | tabViewport = new QWidget ( tabMain ); | 225 | QWidget *tabViewport = new QWidget ( tabMain ); |
228 | 226 | ||
229 | vb = new QVBoxLayout( tabViewport ); | 227 | vb = new QVBoxLayout( tabViewport ); |
230 | 228 | ||
231 | svAddress = new QScrollView( tabViewport ); | 229 | svAddress = new QScrollView( tabViewport ); |
232 | vb->addWidget( svAddress, 0, 0 ); | 230 | vb->addWidget( svAddress, 0, 0 ); |
233 | svAddress->setResizePolicy( QScrollView::AutoOneFit ); | 231 | svAddress->setResizePolicy( QScrollView::AutoOneFit ); |
@@ -235,13 +233,13 @@ void ContactEditor::init() { | |||
235 | 233 | ||
236 | container = new QWidget( svAddress->viewport() ); | 234 | container = new QWidget( svAddress->viewport() ); |
237 | svAddress->addChild( container ); | 235 | svAddress->addChild( container ); |
238 | 236 | ||
239 | gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem | 237 | gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem |
240 | 238 | ||
241 | cmbAddress = new QComboBox( FALSE, container ); | 239 | cmbAddress = new QComboBox( false, container ); |
242 | cmbAddress->insertItem( tr( "Business" ) ); | 240 | cmbAddress->insertItem( tr( "Business" ) ); |
243 | cmbAddress->insertItem( tr( "Home" ) ); | 241 | cmbAddress->insertItem( tr( "Home" ) ); |
244 | gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); | 242 | gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); |
245 | 243 | ||
246 | l = new QLabel( tr( "Address" ), container ); | 244 | l = new QLabel( tr( "Address" ), container ); |
247 | gl->addWidget( l, 1, 0 ); | 245 | gl->addWidget( l, 1, 0 ); |
@@ -262,13 +260,13 @@ void ContactEditor::init() { | |||
262 | gl->addWidget( l, 4, 0 ); | 260 | gl->addWidget( l, 4, 0 ); |
263 | txtZip = new QLineEdit( container ); | 261 | txtZip = new QLineEdit( container ); |
264 | gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 ); | 262 | gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 ); |
265 | 263 | ||
266 | l = new QLabel( tr( "Country" ), container ); | 264 | l = new QLabel( tr( "Country" ), container ); |
267 | gl->addWidget( l, 5, 0 ); | 265 | gl->addWidget( l, 5, 0 ); |
268 | cmbCountry = new QComboBox( TRUE, container ); | 266 | cmbCountry = new QComboBox( true, container ); |
269 | cmbCountry->insertItem( "" ); | 267 | cmbCountry->insertItem( "" ); |
270 | cmbCountry->insertItem( tr ( "United States" ) ); | 268 | cmbCountry->insertItem( tr ( "United States" ) ); |
271 | cmbCountry->insertItem( tr ( "United Kingdom" ) ); | 269 | cmbCountry->insertItem( tr ( "United Kingdom" ) ); |
272 | cmbCountry->insertItem( tr ( "Afghanistan" ) ); | 270 | cmbCountry->insertItem( tr ( "Afghanistan" ) ); |
273 | cmbCountry->insertItem( tr ( "Albania" ) ); | 271 | cmbCountry->insertItem( tr ( "Albania" ) ); |
274 | cmbCountry->insertItem( tr ( "Algeria" ) ); | 272 | cmbCountry->insertItem( tr ( "Algeria" ) ); |
@@ -482,13 +480,13 @@ void ContactEditor::init() { | |||
482 | 480 | ||
483 | cmbCountry->setMaximumWidth( 135 ); | 481 | cmbCountry->setMaximumWidth( 135 ); |
484 | 482 | ||
485 | gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); | 483 | gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); |
486 | 484 | ||
487 | // Chooser 4 | 485 | // Chooser 4 |
488 | cmbChooserField4 = new QComboBox( FALSE, container ); | 486 | cmbChooserField4 = new QComboBox( false, container ); |
489 | cmbChooserField4->setMaximumWidth( 90 ); | 487 | cmbChooserField4->setMaximumWidth( 90 ); |
490 | gl->addWidget( cmbChooserField4, 6, 0 ); | 488 | gl->addWidget( cmbChooserField4, 6, 0 ); |
491 | // Textfield for chooser 2 | 489 | // Textfield for chooser 2 |
492 | // Now use WidgetStack to contain the textfield and the default-email combo! | 490 | // Now use WidgetStack to contain the textfield and the default-email combo! |
493 | m_widgetStack4 = new QWidgetStack( container ); | 491 | m_widgetStack4 = new QWidgetStack( container ); |
494 | txtChooserField4 = new QLineEdit( m_widgetStack4 ); | 492 | txtChooserField4 = new QLineEdit( m_widgetStack4 ); |
@@ -498,13 +496,13 @@ void ContactEditor::init() { | |||
498 | 496 | ||
499 | QSpacerItem *space = new QSpacerItem(1,1, | 497 | QSpacerItem *space = new QSpacerItem(1,1, |
500 | QSizePolicy::Maximum, | 498 | QSizePolicy::Maximum, |
501 | QSizePolicy::MinimumExpanding ); | 499 | QSizePolicy::MinimumExpanding ); |
502 | gl->addItem( space, 7, 0 ); | 500 | gl->addItem( space, 7, 0 ); |
503 | 501 | ||
504 | tabMain->insertTab( tabViewport, tr( "Address" ) ); | 502 | tabMain->addTab( tabViewport, "home", tr( "Address" ) ); |
505 | 503 | ||
506 | tabViewport = new QWidget ( tabMain ); | 504 | tabViewport = new QWidget ( tabMain ); |
507 | 505 | ||
508 | vb = new QVBoxLayout( tabViewport ); | 506 | vb = new QVBoxLayout( tabViewport ); |
509 | 507 | ||
510 | svDetails = new QScrollView( tabViewport ); | 508 | svDetails = new QScrollView( tabViewport ); |
@@ -522,13 +520,13 @@ void ContactEditor::init() { | |||
522 | // Birthday | 520 | // Birthday |
523 | QHBox* hBox = new QHBox( container ); | 521 | QHBox* hBox = new QHBox( container ); |
524 | l = new QLabel( tr("Birthday"), container ); | 522 | l = new QLabel( tr("Birthday"), container ); |
525 | gl->addWidget( l, counter, 0 ); | 523 | gl->addWidget( l, counter, 0 ); |
526 | 524 | ||
527 | QPopupMenu* m1 = new QPopupMenu( container ); | 525 | QPopupMenu* m1 = new QPopupMenu( container ); |
528 | birthdayPicker = new DateBookMonth( m1, 0, TRUE ); | 526 | birthdayPicker = new DateBookMonth( m1, 0, true ); |
529 | m1->insertItem( birthdayPicker ); | 527 | m1->insertItem( birthdayPicker ); |
530 | 528 | ||
531 | birthdayButton= new QToolButton( hBox, "buttonStart" ); | 529 | birthdayButton= new QToolButton( hBox, "buttonStart" ); |
532 | birthdayButton->setPopup( m1 ); | 530 | birthdayButton->setPopup( m1 ); |
533 | birthdayButton->setPopupDelay(0); | 531 | birthdayButton->setPopupDelay(0); |
534 | 532 | ||
@@ -547,13 +545,13 @@ void ContactEditor::init() { | |||
547 | // Anniversary | 545 | // Anniversary |
548 | hBox = new QHBox( container ); | 546 | hBox = new QHBox( container ); |
549 | l = new QLabel( tr("Anniversary"), container ); | 547 | l = new QLabel( tr("Anniversary"), container ); |
550 | gl->addWidget( l, counter, 0 ); | 548 | gl->addWidget( l, counter, 0 ); |
551 | 549 | ||
552 | m1 = new QPopupMenu( container ); | 550 | m1 = new QPopupMenu( container ); |
553 | anniversaryPicker = new DateBookMonth( m1, 0, TRUE ); | 551 | anniversaryPicker = new DateBookMonth( m1, 0, true ); |
554 | m1->insertItem( anniversaryPicker ); | 552 | m1->insertItem( anniversaryPicker ); |
555 | 553 | ||
556 | anniversaryButton= new QToolButton( hBox, "buttonStart" ); | 554 | anniversaryButton= new QToolButton( hBox, "buttonStart" ); |
557 | anniversaryButton->setPopup( m1 ); | 555 | anniversaryButton->setPopup( m1 ); |
558 | anniversaryButton->setPopupDelay(0); | 556 | anniversaryButton->setPopupDelay(0); |
559 | 557 | ||
@@ -596,22 +594,22 @@ void ContactEditor::init() { | |||
596 | gl->addWidget( e, i, 1); | 594 | gl->addWidget( e, i, 1); |
597 | } | 595 | } |
598 | // Fill labels with names.. | 596 | // Fill labels with names.. |
599 | //loadFields(); | 597 | //loadFields(); |
600 | 598 | ||
601 | 599 | ||
602 | tabMain->insertTab( tabViewport, tr( "Details" ) ); | 600 | tabMain->addTab( tabViewport, "UtilsIcon", tr( "Details" ) ); |
603 | 601 | ||
604 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); | 602 | dlgNote = new QDialog( this, "Note Dialog", true ); |
605 | dlgNote->setCaption( tr("Enter Note") ); | 603 | dlgNote->setCaption( tr("Enter Note") ); |
606 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); | 604 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); |
607 | txtNote = new QMultiLineEdit( dlgNote ); | 605 | txtNote = new QMultiLineEdit( dlgNote ); |
608 | vbNote->addWidget( txtNote ); | 606 | vbNote->addWidget( txtNote ); |
609 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); | 607 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); |
610 | 608 | ||
611 | dlgName = new QDialog( this, "Name Dialog", TRUE ); | 609 | dlgName = new QDialog( this, "Name Dialog", true ); |
612 | dlgName->setCaption( tr("Edit Name") ); | 610 | dlgName->setCaption( tr("Edit Name") ); |
613 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); | 611 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); |
614 | 612 | ||
615 | l = new QLabel( tr("First Name"), dlgName ); | 613 | l = new QLabel( tr("First Name"), dlgName ); |
616 | gl->addWidget( l, 0, 0 ); | 614 | gl->addWidget( l, 0, 0 ); |
617 | txtFirstName = new ABOOK::NameLineEdit( dlgName ); | 615 | txtFirstName = new ABOOK::NameLineEdit( dlgName ); |
@@ -1090,13 +1088,13 @@ void ContactEditor::slotName() { | |||
1090 | txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); | 1088 | txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); |
1091 | txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); | 1089 | txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); |
1092 | txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); | 1090 | txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); |
1093 | // txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); | 1091 | // txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); |
1094 | 1092 | ||
1095 | if ( QPEApplication::execDialog( dlgName ) ) { | 1093 | if ( QPEApplication::execDialog( dlgName ) ) { |
1096 | if ( txtLastName->text().contains( ' ', TRUE ) ) | 1094 | if ( txtLastName->text().contains( ' ', true ) ) |
1097 | tmpName = txtLastName->text() + ", " + txtFirstName->text() + " " + txtMiddleName->text(); | 1095 | tmpName = txtLastName->text() + ", " + txtFirstName->text() + " " + txtMiddleName->text(); |
1098 | else | 1096 | else |
1099 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text(); | 1097 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text(); |
1100 | 1098 | ||
1101 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); | 1099 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); |
1102 | slotFullNameChange( txtFullName->text() ); | 1100 | slotFullNameChange( txtFullName->text() ); |
@@ -1135,13 +1133,13 @@ QString ContactEditor::parseName( const QString fullName, int type ) { | |||
1135 | QString strTitle; | 1133 | QString strTitle; |
1136 | int commapos; | 1134 | int commapos; |
1137 | bool haveLastName = false; | 1135 | bool haveLastName = false; |
1138 | 1136 | ||
1139 | odebug << "Fullname: " << simplifiedName << oendl; | 1137 | odebug << "Fullname: " << simplifiedName << oendl; |
1140 | 1138 | ||
1141 | commapos = simplifiedName.find( ',', 0, TRUE); | 1139 | commapos = simplifiedName.find( ',', 0, true); |
1142 | if ( commapos >= 0 ) { | 1140 | if ( commapos >= 0 ) { |
1143 | odebug << " Commapos: " << commapos << oendl; | 1141 | odebug << " Commapos: " << commapos << oendl; |
1144 | 1142 | ||
1145 | // A comma (",") separates the lastname from one or | 1143 | // A comma (",") separates the lastname from one or |
1146 | // many first names. Thus, remove the lastname from the | 1144 | // many first names. Thus, remove the lastname from the |
1147 | // String and parse the firstnames. | 1145 | // String and parse the firstnames. |
@@ -1259,13 +1257,13 @@ void ContactEditor::cleanupFields() { | |||
1259 | void ContactEditor::setEntry( const Opie::OPimContact &entry ) { | 1257 | void ContactEditor::setEntry( const Opie::OPimContact &entry ) { |
1260 | 1258 | ||
1261 | initializing = true; | 1259 | initializing = true; |
1262 | 1260 | ||
1263 | // Cleanup and activate the general Page .. | 1261 | // Cleanup and activate the general Page .. |
1264 | cleanupFields(); | 1262 | cleanupFields(); |
1265 | tabMain->setCurrentPage( 0 ); | 1263 | tabMain->setCurrentTab( m_generalWidget ); |
1266 | 1264 | ||
1267 | ent = entry; | 1265 | ent = entry; |
1268 | 1266 | ||
1269 | emails = QStringList(ent.emailList()); | 1267 | emails = QStringList(ent.emailList()); |
1270 | defaultEmail = ent.defaultEmail(); | 1268 | defaultEmail = ent.defaultEmail(); |
1271 | if (defaultEmail.isEmpty()) defaultEmail = emails[0]; | 1269 | if (defaultEmail.isEmpty()) defaultEmail = emails[0]; |
@@ -1280,13 +1278,13 @@ void ContactEditor::setEntry( const Opie::OPimContact &entry ) { | |||
1280 | // *tmpString = ent.firstName() + " " + ent.middleName() + | 1278 | // *tmpString = ent.firstName() + " " + ent.middleName() + |
1281 | // + " " + ent.lastName() + " " + ent.suffix(); | 1279 | // + " " + ent.lastName() + " " + ent.suffix(); |
1282 | //txtFullName->setText( tmpString->simplifyWhiteSpace() ); | 1280 | //txtFullName->setText( tmpString->simplifyWhiteSpace() ); |
1283 | 1281 | ||
1284 | if ( !ent.isEmpty() ){ | 1282 | if ( !ent.isEmpty() ){ |
1285 | // Lastnames with multiple words need to be protected by a comma ! | 1283 | // Lastnames with multiple words need to be protected by a comma ! |
1286 | if ( ent.lastName().contains( ' ', TRUE ) ) | 1284 | if ( ent.lastName().contains( ' ', true ) ) |
1287 | txtFullName->setText( ent.lastName() + ", " + ent.firstName() + " " + ent.middleName() ); | 1285 | txtFullName->setText( ent.lastName() + ", " + ent.firstName() + " " + ent.middleName() ); |
1288 | else | 1286 | else |
1289 | txtFullName->setText( ent.firstName() + " " + ent.middleName() + " " + ent.lastName() ); | 1287 | txtFullName->setText( ent.firstName() + " " + ent.middleName() + " " + ent.lastName() ); |
1290 | } | 1288 | } |
1291 | 1289 | ||
1292 | cmbFileAs->setEditText( ent.fileAs() ); | 1290 | cmbFileAs->setEditText( ent.fileAs() ); |
@@ -1684,24 +1682,24 @@ void parseEmailTo( const QString &strDefaultEmail, | |||
1684 | static inline bool containsAlphaNum( const QString &str ) | 1682 | static inline bool containsAlphaNum( const QString &str ) |
1685 | { | 1683 | { |
1686 | int i, | 1684 | int i, |
1687 | count = str.length(); | 1685 | count = str.length(); |
1688 | for ( i = 0; i < count; i++ ) | 1686 | for ( i = 0; i < count; i++ ) |
1689 | if ( !str[i].isSpace() ) | 1687 | if ( !str[i].isSpace() ) |
1690 | return TRUE; | 1688 | return true; |
1691 | return FALSE; | 1689 | return false; |
1692 | } | 1690 | } |
1693 | 1691 | ||
1694 | static inline bool constainsWhiteSpace( const QString &str ) | 1692 | static inline bool constainsWhiteSpace( const QString &str ) |
1695 | { | 1693 | { |
1696 | int i, | 1694 | int i, |
1697 | count = str.length(); | 1695 | count = str.length(); |
1698 | for (i = 0; i < count; i++ ) | 1696 | for (i = 0; i < count; i++ ) |
1699 | if ( str[i].isSpace() ) | 1697 | if ( str[i].isSpace() ) |
1700 | return TRUE; | 1698 | return true; |
1701 | return FALSE; | 1699 | return false; |
1702 | } | 1700 | } |
1703 | 1701 | ||
1704 | void ContactEditor::setPersonalView( bool personal ) | 1702 | void ContactEditor::setPersonalView( bool personal ) |
1705 | { | 1703 | { |
1706 | m_personalView = personal; | 1704 | m_personalView = personal; |
1707 | 1705 | ||