author | eilers <eilers> | 2002-10-14 16:53:10 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-10-14 16:53:10 (UTC) |
commit | a2795a80a9421ae15cded191755dc8e4701f0c77 (patch) (unidiff) | |
tree | f556efc4a91786425c9a1597f22b9f77edc78237 | |
parent | 03d355295dd4fd6c37e54d281280127c0cf8a068 (diff) | |
download | opie-a2795a80a9421ae15cded191755dc8e4701f0c77.zip opie-a2795a80a9421ae15cded191755dc8e4701f0c77.tar.gz opie-a2795a80a9421ae15cded191755dc8e4701f0c77.tar.bz2 |
Some final language fixes
-rw-r--r-- | core/pim/addressbook/TODO | 3 | ||||
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 2 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 84 |
3 files changed, 63 insertions, 26 deletions
diff --git a/core/pim/addressbook/TODO b/core/pim/addressbook/TODO index 83e3c6b..a4fc29a 100644 --- a/core/pim/addressbook/TODO +++ b/core/pim/addressbook/TODO | |||
@@ -1,16 +1,19 @@ | |||
1 | Stuff todo: | 1 | Stuff todo: |
2 | 2 | ||
3 | Urgent: | 3 | Urgent: |
4 | - "Nonenglish" translation bug has to be fixed. | 4 | - "Nonenglish" translation bug has to be fixed. |
5 | 5 | ||
6 | Important: | 6 | Important: |
7 | 7 | ||
8 | - Finishing of new View functions (List, Phonebook...) | 8 | - Finishing of new View functions (List, Phonebook...) |
9 | - Reload if contacts were changed externally | 9 | - Reload if contacts were changed externally |
10 | - "What's this" should be added | ||
11 | - The names of the countries are sorted by there english names, only.. | ||
12 | Even if they are translated.. :S | ||
10 | 13 | ||
11 | Less important: | 14 | Less important: |
12 | 15 | ||
13 | - Find widget should be replaced by something like | 16 | - Find widget should be replaced by something like |
14 | qpdf has. | 17 | qpdf has. |
15 | - The picker (alphabetical sort widget) should be | 18 | - The picker (alphabetical sort widget) should be |
16 | placed verticaly or horizontally (configurable) \ No newline at end of file | 19 | placed verticaly or horizontally (configurable) \ No newline at end of file |
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index 08c6d0a..70c070f 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp | |||
@@ -85,97 +85,97 @@ void AbTableItem::setItem( const QString &txt, const QString &secondKey ) | |||
85 | */ | 85 | */ |
86 | 86 | ||
87 | AbPickItem::AbPickItem( QTable *t ) : | 87 | AbPickItem::AbPickItem( QTable *t ) : |
88 | QTableItem(t, WhenCurrent, "?") | 88 | QTableItem(t, WhenCurrent, "?") |
89 | { | 89 | { |
90 | } | 90 | } |
91 | 91 | ||
92 | QWidget *AbPickItem::createEditor() const | 92 | QWidget *AbPickItem::createEditor() const |
93 | { | 93 | { |
94 | QComboBox* combo = new QComboBox( table()->viewport() ); | 94 | QComboBox* combo = new QComboBox( table()->viewport() ); |
95 | ( (AbPickItem*)this )->cb = combo; | 95 | ( (AbPickItem*)this )->cb = combo; |
96 | AbTable* t = static_cast<AbTable*>(table()); | 96 | AbTable* t = static_cast<AbTable*>(table()); |
97 | QStringList c = t->choiceNames(); | 97 | QStringList c = t->choiceNames(); |
98 | int cur = 0; | 98 | int cur = 0; |
99 | for (QStringList::ConstIterator it = c.begin(); it!=c.end(); ++it) { | 99 | for (QStringList::ConstIterator it = c.begin(); it!=c.end(); ++it) { |
100 | if ( *it == text() ) | 100 | if ( *it == text() ) |
101 | cur = combo->count(); | 101 | cur = combo->count(); |
102 | combo->insertItem(*it); | 102 | combo->insertItem(*it); |
103 | } | 103 | } |
104 | combo->setCurrentItem(cur); | 104 | combo->setCurrentItem(cur); |
105 | return combo; | 105 | return combo; |
106 | } | 106 | } |
107 | 107 | ||
108 | void AbPickItem::setContentFromEditor( QWidget *w ) | 108 | void AbPickItem::setContentFromEditor( QWidget *w ) |
109 | { | 109 | { |
110 | if ( w->inherits("QComboBox") ) | 110 | if ( w->inherits("QComboBox") ) |
111 | setText( ( (QComboBox*)w )->currentText() ); | 111 | setText( ( (QComboBox*)w )->currentText() ); |
112 | else | 112 | else |
113 | QTableItem::setContentFromEditor( w ); | 113 | QTableItem::setContentFromEditor( w ); |
114 | } | 114 | } |
115 | 115 | ||
116 | /*! | 116 | /*! |
117 | \class AbTable abtable.h | 117 | \class AbTable abtable.h |
118 | 118 | ||
119 | \brief QTable based class for showing a list of entries | 119 | \brief QTable based class for showing a list of entries |
120 | */ | 120 | */ |
121 | 121 | ||
122 | AbTable::AbTable( const QValueList<int> *order, QWidget *parent, const char *name ) | 122 | AbTable::AbTable( const QValueList<int> *order, QWidget *parent, const char *name ) |
123 | // #ifdef QT_QTABLE_NOHEADER_CONSTRUCTOR | 123 | // #ifdef QT_QTABLE_NOHEADER_CONSTRUCTOR |
124 | // : QTable( 0, 0, parent, name, TRUE ), | 124 | // : QTable( 0, 0, parent, name, TRUE ), |
125 | // #else | 125 | // #else |
126 | : QTable( parent, name ), | 126 | : QTable( parent, name ), |
127 | // #endif | 127 | // #endif |
128 | lastSortCol( -1 ), | 128 | lastSortCol( -1 ), |
129 | asc( TRUE ), | 129 | asc( TRUE ), |
130 | intFields( order ), | 130 | intFields( order ), |
131 | currFindRow( -2 ), | 131 | currFindRow( -2 ), |
132 | mCat( 0 ), | 132 | mCat( 0 ), |
133 | m_contactdb ("addressbook") | 133 | m_contactdb ("addressbook", 0l, 0l, false) // Handle syncing myself.. ! |
134 | { | 134 | { |
135 | mCat.load( categoryFileName() ); | 135 | mCat.load( categoryFileName() ); |
136 | setSelectionMode( NoSelection ); | 136 | setSelectionMode( NoSelection ); |
137 | init(); | 137 | init(); |
138 | setSorting( TRUE ); | 138 | setSorting( TRUE ); |
139 | connect( this, SIGNAL(clicked(int,int,int,const QPoint &)), | 139 | connect( this, SIGNAL(clicked(int,int,int,const QPoint &)), |
140 | this, SLOT(itemClicked(int,int)) ); | 140 | this, SLOT(itemClicked(int,int)) ); |
141 | } | 141 | } |
142 | 142 | ||
143 | AbTable::~AbTable() | 143 | AbTable::~AbTable() |
144 | { | 144 | { |
145 | } | 145 | } |
146 | 146 | ||
147 | void AbTable::init() | 147 | void AbTable::init() |
148 | { | 148 | { |
149 | showChar = '\0'; | 149 | showChar = '\0'; |
150 | setNumRows( 0 ); | 150 | setNumRows( 0 ); |
151 | setNumCols( 2 ); | 151 | setNumCols( 2 ); |
152 | 152 | ||
153 | horizontalHeader()->setLabel( 0, tr( "Full Name" )); | 153 | horizontalHeader()->setLabel( 0, tr( "Full Name" )); |
154 | horizontalHeader()->setLabel( 1, tr( "Contact" )); | 154 | horizontalHeader()->setLabel( 1, tr( "Contact" )); |
155 | setLeftMargin( 0 ); | 155 | setLeftMargin( 0 ); |
156 | verticalHeader()->hide(); | 156 | verticalHeader()->hide(); |
157 | columnVisible = true; | 157 | columnVisible = true; |
158 | } | 158 | } |
159 | 159 | ||
160 | void AbTable::columnClicked( int col ) | 160 | void AbTable::columnClicked( int col ) |
161 | { | 161 | { |
162 | if ( !sorting() ) | 162 | if ( !sorting() ) |
163 | return; | 163 | return; |
164 | 164 | ||
165 | if ( lastSortCol == -1 ) | 165 | if ( lastSortCol == -1 ) |
166 | lastSortCol = col; | 166 | lastSortCol = col; |
167 | 167 | ||
168 | if ( col == lastSortCol ) { | 168 | if ( col == lastSortCol ) { |
169 | asc = !asc; | 169 | asc = !asc; |
170 | } else { | 170 | } else { |
171 | lastSortCol = col; | 171 | lastSortCol = col; |
172 | asc = TRUE; | 172 | asc = TRUE; |
173 | } | 173 | } |
174 | //QMessageBox::information( this, "resort", "columnClicked" ); | 174 | //QMessageBox::information( this, "resort", "columnClicked" ); |
175 | resort(); | 175 | resort(); |
176 | } | 176 | } |
177 | 177 | ||
178 | void AbTable::resort() | 178 | void AbTable::resort() |
179 | { | 179 | { |
180 | if ( sorting() ) { | 180 | if ( sorting() ) { |
181 | if ( lastSortCol == -1 ) | 181 | if ( lastSortCol == -1 ) |
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index bae3a2b..e7f2ebd 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -295,97 +295,96 @@ void ContactEditor::init() { | |||
295 | if ( (*it) == "Business City" ) { | 295 | if ( (*it) == "Business City" ) { |
296 | hasCity = TRUE; | 296 | hasCity = TRUE; |
297 | //slDynamicEntries->remove( it ); | 297 | //slDynamicEntries->remove( it ); |
298 | continue; | 298 | continue; |
299 | } | 299 | } |
300 | 300 | ||
301 | if ( (*it) == "Business State" ) { | 301 | if ( (*it) == "Business State" ) { |
302 | hasState = TRUE; | 302 | hasState = TRUE; |
303 | //slDynamicEntries->remove( it ); | 303 | //slDynamicEntries->remove( it ); |
304 | continue; | 304 | continue; |
305 | } | 305 | } |
306 | 306 | ||
307 | if ( (*it) == "Business Zip" ) { | 307 | if ( (*it) == "Business Zip" ) { |
308 | hasZip = TRUE; | 308 | hasZip = TRUE; |
309 | //slDynamicEntries->remove( it ); | 309 | //slDynamicEntries->remove( it ); |
310 | continue; | 310 | continue; |
311 | } | 311 | } |
312 | 312 | ||
313 | if ( (*it) == "Business Country" ) { | 313 | if ( (*it) == "Business Country" ) { |
314 | hasCountry = TRUE; | 314 | hasCountry = TRUE; |
315 | //slDynamicEntries->remove( it ); | 315 | //slDynamicEntries->remove( it ); |
316 | continue; | 316 | continue; |
317 | } | 317 | } |
318 | 318 | ||
319 | if ( (*it) == "Home City" ) { | 319 | if ( (*it) == "Home City" ) { |
320 | hasCity = TRUE; | 320 | hasCity = TRUE; |
321 | //slDynamicEntries->remove( it ); | 321 | //slDynamicEntries->remove( it ); |
322 | continue; | 322 | continue; |
323 | } | 323 | } |
324 | 324 | ||
325 | if ( (*it) == "Home State" ) { | 325 | if ( (*it) == "Home State" ) { |
326 | hasState = TRUE; | 326 | hasState = TRUE; |
327 | //slDynamicEntries->remove( it ); | 327 | //slDynamicEntries->remove( it ); |
328 | continue; | 328 | continue; |
329 | } | 329 | } |
330 | 330 | ||
331 | if ( (*it) == "Home Zip" ) { | 331 | if ( (*it) == "Home Zip" ) { |
332 | hasZip = TRUE; | 332 | hasZip = TRUE; |
333 | //slDynamicEntries->remove( it ); | 333 | //slDynamicEntries->remove( it ); |
334 | continue; | 334 | continue; |
335 | } | 335 | } |
336 | 336 | ||
337 | if ( (*it) == "Home Country" ) { | 337 | if ( (*it) == "Home Country" ) { |
338 | hasCountry = TRUE; | 338 | hasCountry = TRUE; |
339 | //slDynamicEntries->remove( it ); | 339 | //slDynamicEntries->remove( it ); |
340 | continue; | 340 | continue; |
341 | } | 341 | } |
342 | 342 | ||
343 | |||
344 | slDynamicEntries.append( *it ); | 343 | slDynamicEntries.append( *it ); |
345 | } | 344 | } |
346 | } | 345 | } |
347 | 346 | ||
348 | QVBoxLayout *vb = new QVBoxLayout( this ); | 347 | QVBoxLayout *vb = new QVBoxLayout( this ); |
349 | 348 | ||
350 | tabMain = new QTabWidget( this ); | 349 | tabMain = new QTabWidget( this ); |
351 | vb->addWidget( tabMain ); | 350 | vb->addWidget( tabMain ); |
352 | 351 | ||
353 | QWidget *tabViewport = new QWidget ( tabMain ); | 352 | QWidget *tabViewport = new QWidget ( tabMain ); |
354 | 353 | ||
355 | vb = new QVBoxLayout( tabViewport ); | 354 | vb = new QVBoxLayout( tabViewport ); |
356 | 355 | ||
357 | svGeneral = new QScrollView( tabViewport ); | 356 | svGeneral = new QScrollView( tabViewport ); |
358 | vb->addWidget( svGeneral, 0, 0 ); | 357 | vb->addWidget( svGeneral, 0, 0 ); |
359 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); | 358 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); |
360 | svGeneral->setFrameStyle( QFrame::NoFrame ); | 359 | svGeneral->setFrameStyle( QFrame::NoFrame ); |
361 | 360 | ||
362 | QWidget *container = new QWidget( svGeneral->viewport() ); | 361 | QWidget *container = new QWidget( svGeneral->viewport() ); |
363 | svGeneral->addChild( container ); | 362 | svGeneral->addChild( container ); |
364 | 363 | ||
365 | QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); | 364 | QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); |
366 | gl->setResizeMode( QLayout::FreeResize ); | 365 | gl->setResizeMode( QLayout::FreeResize ); |
367 | 366 | ||
368 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); | 367 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); |
369 | gl->addWidget( btnFullName, 0, 0 ); | 368 | gl->addWidget( btnFullName, 0, 0 ); |
370 | txtFullName = new QLineEdit( container ); | 369 | txtFullName = new QLineEdit( container ); |
371 | gl->addWidget( txtFullName, 0, 1 ); | 370 | gl->addWidget( txtFullName, 0, 1 ); |
372 | 371 | ||
373 | QLabel *l = new QLabel( tr( "Job Title" ), container ); | 372 | QLabel *l = new QLabel( tr( "Job Title" ), container ); |
374 | gl->addWidget( l, 1, 0 ); | 373 | gl->addWidget( l, 1, 0 ); |
375 | txtJobTitle = new QLineEdit( container ); | 374 | txtJobTitle = new QLineEdit( container ); |
376 | gl->addWidget( txtJobTitle, 1, 1 ); | 375 | gl->addWidget( txtJobTitle, 1, 1 ); |
377 | 376 | ||
378 | l = new QLabel( tr( "Organization" ), container ); | 377 | l = new QLabel( tr( "Organization" ), container ); |
379 | gl->addWidget( l, 2, 0 ); | 378 | gl->addWidget( l, 2, 0 ); |
380 | txtOrganization = new QLineEdit( container ); | 379 | txtOrganization = new QLineEdit( container ); |
381 | gl->addWidget( txtOrganization, 2, 1 ); | 380 | gl->addWidget( txtOrganization, 2, 1 ); |
382 | 381 | ||
383 | cmbChooserField1 = new QComboBox( FALSE, container ); | 382 | cmbChooserField1 = new QComboBox( FALSE, container ); |
384 | cmbChooserField1->setMaximumWidth( 90 ); | 383 | cmbChooserField1->setMaximumWidth( 90 ); |
385 | gl->addWidget( cmbChooserField1, 3, 0 ); | 384 | gl->addWidget( cmbChooserField1, 3, 0 ); |
386 | txtChooserField1 = new QLineEdit( container ); | 385 | txtChooserField1 = new QLineEdit( container ); |
387 | gl->addWidget( txtChooserField1, 3, 1 ); | 386 | gl->addWidget( txtChooserField1, 3, 1 ); |
388 | 387 | ||
389 | cmbChooserField2 = new QComboBox( FALSE, container ); | 388 | cmbChooserField2 = new QComboBox( FALSE, container ); |
390 | cmbChooserField2->setMaximumWidth( 90 ); | 389 | cmbChooserField2->setMaximumWidth( 90 ); |
391 | gl->addWidget( cmbChooserField2, 4, 0 ); | 390 | gl->addWidget( cmbChooserField2, 4, 0 ); |
@@ -663,105 +662,108 @@ void ContactEditor::init() { | |||
663 | cmbCountry->insertItem( tr ( "Turkey" ) ); | 662 | cmbCountry->insertItem( tr ( "Turkey" ) ); |
664 | cmbCountry->insertItem( tr ( "Turkmenistan" ) ); | 663 | cmbCountry->insertItem( tr ( "Turkmenistan" ) ); |
665 | cmbCountry->insertItem( tr ( "Tuvalu" ) ); | 664 | cmbCountry->insertItem( tr ( "Tuvalu" ) ); |
666 | cmbCountry->insertItem( tr ( "Uganda" ) ); | 665 | cmbCountry->insertItem( tr ( "Uganda" ) ); |
667 | cmbCountry->insertItem( tr ( "Ukraine" ) ); | 666 | cmbCountry->insertItem( tr ( "Ukraine" ) ); |
668 | cmbCountry->insertItem( tr ( "Uruguay" ) ); | 667 | cmbCountry->insertItem( tr ( "Uruguay" ) ); |
669 | cmbCountry->insertItem( tr ( "Uzbekistan" ) ); | 668 | cmbCountry->insertItem( tr ( "Uzbekistan" ) ); |
670 | cmbCountry->insertItem( tr ( "Vanuatu" ) ); | 669 | cmbCountry->insertItem( tr ( "Vanuatu" ) ); |
671 | cmbCountry->insertItem( tr ( "Venezuela" ) ); | 670 | cmbCountry->insertItem( tr ( "Venezuela" ) ); |
672 | cmbCountry->insertItem( tr ( "Viet Nam" ) ); | 671 | cmbCountry->insertItem( tr ( "Viet Nam" ) ); |
673 | cmbCountry->insertItem( tr ( "Virgin Islands" ) ); | 672 | cmbCountry->insertItem( tr ( "Virgin Islands" ) ); |
674 | cmbCountry->insertItem( tr ( "Western Sahara" ) ); | 673 | cmbCountry->insertItem( tr ( "Western Sahara" ) ); |
675 | cmbCountry->insertItem( tr ( "Yemen" ) ); | 674 | cmbCountry->insertItem( tr ( "Yemen" ) ); |
676 | cmbCountry->insertItem( tr ( "Yugoslavia" ) ); | 675 | cmbCountry->insertItem( tr ( "Yugoslavia" ) ); |
677 | cmbCountry->insertItem( tr ( "Zambia" ) ); | 676 | cmbCountry->insertItem( tr ( "Zambia" ) ); |
678 | cmbCountry->insertItem( tr ( "Zimbabwe" ) ); | 677 | cmbCountry->insertItem( tr ( "Zimbabwe" ) ); |
679 | 678 | ||
680 | cmbCountry->setMaximumWidth( 135 ); | 679 | cmbCountry->setMaximumWidth( 135 ); |
681 | 680 | ||
682 | gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); | 681 | gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); |
683 | 682 | ||
684 | cmbChooserField4 = new QComboBox( FALSE, container ); | 683 | cmbChooserField4 = new QComboBox( FALSE, container ); |
685 | cmbChooserField4->setMaximumWidth( 90 ); | 684 | cmbChooserField4->setMaximumWidth( 90 ); |
686 | gl->addWidget( cmbChooserField4, 6, 0 ); | 685 | gl->addWidget( cmbChooserField4, 6, 0 ); |
687 | txtChooserField4 = new QLineEdit( container ); | 686 | txtChooserField4 = new QLineEdit( container ); |
688 | gl->addMultiCellWidget( txtChooserField4, 6, 6, 1, 2 ); | 687 | gl->addMultiCellWidget( txtChooserField4, 6, 6, 1, 2 ); |
689 | 688 | ||
690 | QSpacerItem *space = new QSpacerItem(1,1, | 689 | QSpacerItem *space = new QSpacerItem(1,1, |
691 | QSizePolicy::Maximum, | 690 | QSizePolicy::Maximum, |
692 | QSizePolicy::MinimumExpanding ); | 691 | QSizePolicy::MinimumExpanding ); |
693 | gl->addItem( space, 7, 0 ); | 692 | gl->addItem( space, 7, 0 ); |
694 | 693 | ||
695 | tabMain->insertTab( tabViewport, tr( "Address" ) ); | 694 | tabMain->insertTab( tabViewport, tr( "Address" ) ); |
696 | 695 | ||
697 | tabViewport = new QWidget ( tabMain ); | 696 | tabViewport = new QWidget ( tabMain ); |
698 | 697 | ||
699 | vb = new QVBoxLayout( tabViewport ); | 698 | vb = new QVBoxLayout( tabViewport ); |
700 | 699 | ||
701 | svDetails = new QScrollView( tabViewport ); | 700 | svDetails = new QScrollView( tabViewport ); |
702 | vb->addWidget( svDetails, 0, 0 ); | 701 | vb->addWidget( svDetails, 0, 0 ); |
703 | svDetails->setResizePolicy( QScrollView::AutoOneFit ); | 702 | svDetails->setResizePolicy( QScrollView::AutoOneFit ); |
704 | svDetails->setFrameStyle( QFrame::NoFrame ); | 703 | svDetails->setFrameStyle( QFrame::NoFrame ); |
705 | 704 | ||
706 | container = new QWidget( svDetails->viewport() ); | 705 | container = new QWidget( svDetails->viewport() ); |
707 | svDetails->addChild( container ); | 706 | svDetails->addChild( container ); |
708 | 707 | ||
709 | gl = new QGridLayout( container, 1, 2, 2, 4 ); | 708 | gl = new QGridLayout( container, 1, 2, 2, 4 ); |
710 | 709 | ||
710 | // Create Labels and lineedit fields for every dynamic entry | ||
711 | QStringList::ConstIterator it = slDynamicEntries.begin(); | 711 | QStringList::ConstIterator it = slDynamicEntries.begin(); |
712 | for (i = 0; it != slDynamicEntries.end(); i++, ++it) { | 712 | for (i = 0; it != slDynamicEntries.end(); i++, ++it) { |
713 | l = new QLabel( *it, container ); | 713 | l = new QLabel( QString::null , container ); |
714 | listName.append( l ); | 714 | listName.append( l ); |
715 | gl->addWidget( l, i, 0 ); | 715 | gl->addWidget( l, i, 0 ); |
716 | QLineEdit *e = new QLineEdit( container ); | 716 | QLineEdit *e = new QLineEdit( container ); |
717 | listValue.append( e ); | 717 | listValue.append( e ); |
718 | gl->addWidget( e, i, 1); | 718 | gl->addWidget( e, i, 1); |
719 | } | 719 | } |
720 | // Fill labels with names.. | ||
721 | loadFields(); | ||
720 | 722 | ||
721 | l = new QLabel( tr("Gender"), container ); | 723 | l = new QLabel( tr("Gender"), container ); |
722 | gl->addWidget( l, slDynamicEntries.count(), 0 ); | 724 | gl->addWidget( l, slDynamicEntries.count(), 0 ); |
723 | cmbGender = new QComboBox( container ); | 725 | cmbGender = new QComboBox( container ); |
724 | cmbGender->insertItem( "", 0 ); | 726 | cmbGender->insertItem( "", 0 ); |
725 | cmbGender->insertItem( tr("Male"), 1); | 727 | cmbGender->insertItem( tr("Male"), 1); |
726 | cmbGender->insertItem( tr("Female"), 2); | 728 | cmbGender->insertItem( tr("Female"), 2); |
727 | gl->addWidget( cmbGender, slDynamicEntries.count(), 1 ); | 729 | gl->addWidget( cmbGender, slDynamicEntries.count(), 1 ); |
728 | 730 | ||
729 | tabMain->insertTab( tabViewport, tr( "Details" ) ); | 731 | tabMain->insertTab( tabViewport, tr( "Details" ) ); |
730 | 732 | ||
731 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); | 733 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); |
732 | dlgNote->setCaption( tr("Enter Note") ); | 734 | dlgNote->setCaption( tr("Enter Note") ); |
733 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); | 735 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); |
734 | txtNote = new QMultiLineEdit( dlgNote ); | 736 | txtNote = new QMultiLineEdit( dlgNote ); |
735 | vbNote->addWidget( txtNote ); | 737 | vbNote->addWidget( txtNote ); |
736 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); | 738 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); |
737 | 739 | ||
738 | dlgName = new QDialog( this, "Name Dialog", TRUE ); | 740 | dlgName = new QDialog( this, "Name Dialog", TRUE ); |
739 | dlgName->setCaption( tr("Edit Name") ); | 741 | dlgName->setCaption( tr("Edit Name") ); |
740 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); | 742 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); |
741 | 743 | ||
742 | l = new QLabel( tr("First Name"), dlgName ); | 744 | l = new QLabel( tr("First Name"), dlgName ); |
743 | gl->addWidget( l, 0, 0 ); | 745 | gl->addWidget( l, 0, 0 ); |
744 | txtFirstName = new QLineEdit( dlgName ); | 746 | txtFirstName = new QLineEdit( dlgName ); |
745 | gl->addWidget( txtFirstName, 0, 1 ); | 747 | gl->addWidget( txtFirstName, 0, 1 ); |
746 | 748 | ||
747 | l = new QLabel( tr("Middle Name"), dlgName ); | 749 | l = new QLabel( tr("Middle Name"), dlgName ); |
748 | gl->addWidget( l, 1, 0 ); | 750 | gl->addWidget( l, 1, 0 ); |
749 | txtMiddleName = new QLineEdit( dlgName ); | 751 | txtMiddleName = new QLineEdit( dlgName ); |
750 | gl->addWidget( txtMiddleName, 1, 1 ); | 752 | gl->addWidget( txtMiddleName, 1, 1 ); |
751 | 753 | ||
752 | l = new QLabel( tr("Last Name"), dlgName ); | 754 | l = new QLabel( tr("Last Name"), dlgName ); |
753 | gl->addWidget( l, 2, 0 ); | 755 | gl->addWidget( l, 2, 0 ); |
754 | txtLastName = new QLineEdit( dlgName ); | 756 | txtLastName = new QLineEdit( dlgName ); |
755 | gl->addWidget( txtLastName, 2, 1 ); | 757 | gl->addWidget( txtLastName, 2, 1 ); |
756 | 758 | ||
757 | l = new QLabel( tr("Suffix"), dlgName ); | 759 | l = new QLabel( tr("Suffix"), dlgName ); |
758 | gl->addWidget( l, 3, 0 ); | 760 | gl->addWidget( l, 3, 0 ); |
759 | txtSuffix = new QLineEdit( dlgName ); | 761 | txtSuffix = new QLineEdit( dlgName ); |
760 | gl->addWidget( txtSuffix, 3, 1 ); | 762 | gl->addWidget( txtSuffix, 3, 1 ); |
761 | space = new QSpacerItem(1,1, | 763 | space = new QSpacerItem(1,1, |
762 | QSizePolicy::Maximum, | 764 | QSizePolicy::Maximum, |
763 | QSizePolicy::MinimumExpanding ); | 765 | QSizePolicy::MinimumExpanding ); |
764 | gl->addItem( space, 4, 0 ); | 766 | gl->addItem( space, 4, 0 ); |
765 | 767 | ||
766 | cmbChooserField1->insertStringList( trlChooserNames ); | 768 | cmbChooserField1->insertStringList( trlChooserNames ); |
767 | cmbChooserField2->insertStringList( trlChooserNames ); | 769 | cmbChooserField2->insertStringList( trlChooserNames ); |
@@ -967,97 +969,129 @@ void ContactEditor::slotAddressTypeChange( int index ) { | |||
967 | if ( index == 0 ) { | 969 | if ( index == 0 ) { |
968 | 970 | ||
969 | txtAddress->setText( slBusinessAddress[0] ); | 971 | txtAddress->setText( slBusinessAddress[0] ); |
970 | //txtAddress2->setText( (*slBusinessAddress)[1] ); | 972 | //txtAddress2->setText( (*slBusinessAddress)[1] ); |
971 | //txtPOBox->setText( (*slBusinessAddress)[2] ); | 973 | //txtPOBox->setText( (*slBusinessAddress)[2] ); |
972 | txtCity->setText( slBusinessAddress[3] ); | 974 | txtCity->setText( slBusinessAddress[3] ); |
973 | txtState->setText( slBusinessAddress[4] ); | 975 | txtState->setText( slBusinessAddress[4] ); |
974 | txtZip->setText( slBusinessAddress[5] ); | 976 | txtZip->setText( slBusinessAddress[5] ); |
975 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 977 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
976 | txtTmp->setText( slBusinessAddress[6] ); | 978 | txtTmp->setText( slBusinessAddress[6] ); |
977 | 979 | ||
978 | } else { | 980 | } else { |
979 | 981 | ||
980 | txtAddress->setText( slHomeAddress[0] ); | 982 | txtAddress->setText( slHomeAddress[0] ); |
981 | //txtAddress2->setText( (*slHomeAddress)[1] ); | 983 | //txtAddress2->setText( (*slHomeAddress)[1] ); |
982 | //txtPOBox->setText( (*slHomeAddress)[2] ); | 984 | //txtPOBox->setText( (*slHomeAddress)[2] ); |
983 | txtCity->setText( slHomeAddress[3] ); | 985 | txtCity->setText( slHomeAddress[3] ); |
984 | txtState->setText( slHomeAddress[4] ); | 986 | txtState->setText( slHomeAddress[4] ); |
985 | txtZip->setText( slHomeAddress[5] ); | 987 | txtZip->setText( slHomeAddress[5] ); |
986 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 988 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
987 | txtTmp->setText( slHomeAddress[6] ); | 989 | txtTmp->setText( slHomeAddress[6] ); |
988 | 990 | ||
989 | } | 991 | } |
990 | 992 | ||
991 | } | 993 | } |
992 | 994 | ||
993 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { | 995 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { |
994 | 996 | ||
995 | int index = cmbFileAs->currentItem(); | 997 | int index = cmbFileAs->currentItem(); |
996 | 998 | ||
997 | cmbFileAs->clear(); | 999 | cmbFileAs->clear(); |
998 | 1000 | ||
999 | cmbFileAs->insertItem( parseName( textChanged, 0 ) ); | 1001 | cmbFileAs->insertItem( parseName( textChanged, 0 ) ); |
1000 | cmbFileAs->insertItem( parseName( textChanged, 1 ) ); | 1002 | cmbFileAs->insertItem( parseName( textChanged, 1 ) ); |
1001 | cmbFileAs->insertItem( parseName( textChanged, 2 ) ); | 1003 | cmbFileAs->insertItem( parseName( textChanged, 2 ) ); |
1002 | cmbFileAs->insertItem( parseName( textChanged, 3 ) ); | 1004 | cmbFileAs->insertItem( parseName( textChanged, 3 ) ); |
1003 | 1005 | ||
1004 | cmbFileAs->setCurrentItem( index ); | 1006 | cmbFileAs->setCurrentItem( index ); |
1005 | 1007 | ||
1006 | useFullName = TRUE; | 1008 | useFullName = TRUE; |
1007 | 1009 | ||
1008 | } | 1010 | } |
1009 | 1011 | ||
1010 | void ContactEditor::loadFields() { | 1012 | void ContactEditor::loadFields() { |
1011 | 1013 | ||
1012 | QStringList::ConstIterator it; | 1014 | QStringList::ConstIterator it; |
1013 | QListIterator<QLabel> lit( listName ); | 1015 | QListIterator<QLabel> lit( listName ); |
1014 | for ( it = slDynamicEntries.begin(); *lit; ++lit, ++it) { | 1016 | for ( it = slDynamicEntries.begin(); *lit; ++lit, ++it) { |
1015 | (*lit)->setText( *it ); | 1017 | |
1018 | if ( *it == "Department" ) | ||
1019 | (*lit)->setText( tr( "Department" ) ); | ||
1020 | |||
1021 | if ( *it == "Company" ) | ||
1022 | (*lit)->setText( tr( "Company" ) ); | ||
1023 | |||
1024 | if ( *it == "Office" ) | ||
1025 | (*lit)->setText( tr( "Office" ) ); | ||
1026 | |||
1027 | if ( *it == "Profession" ) | ||
1028 | (*lit)->setText( tr( "Profession" ) ); | ||
1029 | |||
1030 | if ( *it == "Assistant" ) | ||
1031 | (*lit)->setText( tr( "Assistant" ) ); | ||
1032 | |||
1033 | if ( *it == "Manager" ) | ||
1034 | (*lit)->setText( tr( "Manager" ) ); | ||
1035 | |||
1036 | if ( *it == "Spouse" ) | ||
1037 | (*lit)->setText( tr( "Spouse" ) ); | ||
1038 | |||
1039 | if ( *it == "Birthday" ) | ||
1040 | (*lit)->setText( tr( "Birthday" ) ); | ||
1041 | |||
1042 | if ( *it == "Anniversary" ) | ||
1043 | (*lit)->setText( tr( "Anniversary" ) ); | ||
1044 | |||
1045 | if ( *it == "Nickname" ) | ||
1046 | (*lit)->setText( tr( "Nickname" ) ); | ||
1047 | |||
1048 | if ( *it == "Children" ) | ||
1049 | (*lit)->setText( tr( "Children" ) ); | ||
1016 | } | 1050 | } |
1017 | } | 1051 | } |
1018 | 1052 | ||
1019 | void ContactEditor::accept() { | 1053 | void ContactEditor::accept() { |
1020 | 1054 | ||
1021 | if ( isEmpty() ) { | 1055 | if ( isEmpty() ) { |
1022 | cleanupFields(); | 1056 | cleanupFields(); |
1023 | reject(); | 1057 | reject(); |
1024 | } else { | 1058 | } else { |
1025 | saveEntry(); | 1059 | saveEntry(); |
1026 | cleanupFields(); | 1060 | cleanupFields(); |
1027 | QDialog::accept(); | 1061 | QDialog::accept(); |
1028 | } | 1062 | } |
1029 | 1063 | ||
1030 | } | 1064 | } |
1031 | 1065 | ||
1032 | void ContactEditor::slotNote() { | 1066 | void ContactEditor::slotNote() { |
1033 | 1067 | ||
1034 | dlgNote->showMaximized(); | 1068 | dlgNote->showMaximized(); |
1035 | if ( !dlgNote->exec() ) { | 1069 | if ( !dlgNote->exec() ) { |
1036 | txtNote->setText( ent.notes() ); | 1070 | txtNote->setText( ent.notes() ); |
1037 | } | 1071 | } |
1038 | } | 1072 | } |
1039 | 1073 | ||
1040 | void ContactEditor::slotName() { | 1074 | void ContactEditor::slotName() { |
1041 | 1075 | ||
1042 | QString tmpName; | 1076 | QString tmpName; |
1043 | if (useFullName == TRUE) { | 1077 | if (useFullName == TRUE) { |
1044 | txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); | 1078 | txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); |
1045 | txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); | 1079 | txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); |
1046 | txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); | 1080 | txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); |
1047 | txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); | 1081 | txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); |
1048 | } | 1082 | } |
1049 | dlgName->showMaximized(); | 1083 | dlgName->showMaximized(); |
1050 | if ( dlgName->exec() ) { | 1084 | if ( dlgName->exec() ) { |
1051 | 1085 | ||
1052 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text() + " " + txtSuffix->text(); | 1086 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text() + " " + txtSuffix->text(); |
1053 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); | 1087 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); |
1054 | slotFullNameChange( txtFullName->text() ); | 1088 | slotFullNameChange( txtFullName->text() ); |
1055 | useFullName = FALSE; | 1089 | useFullName = FALSE; |
1056 | } | 1090 | } |
1057 | 1091 | ||
1058 | } | 1092 | } |
1059 | 1093 | ||
1060 | void ContactEditor::setNameFocus() { | 1094 | void ContactEditor::setNameFocus() { |
1061 | 1095 | ||
1062 | txtFullName->setFocus(); | 1096 | txtFullName->setFocus(); |
1063 | 1097 | ||
@@ -1329,127 +1363,127 @@ void ContactEditor::setEntry( const OContact &entry ) { | |||
1329 | 1363 | ||
1330 | if (hasTitle) | 1364 | if (hasTitle) |
1331 | txtJobTitle->setText( ent.jobTitle() ); | 1365 | txtJobTitle->setText( ent.jobTitle() ); |
1332 | 1366 | ||
1333 | if (hasCompany) | 1367 | if (hasCompany) |
1334 | txtOrganization->setText( ent.company() ); | 1368 | txtOrganization->setText( ent.company() ); |
1335 | 1369 | ||
1336 | if (hasNotes) | 1370 | if (hasNotes) |
1337 | txtNote->setText( ent.notes() ); | 1371 | txtNote->setText( ent.notes() ); |
1338 | 1372 | ||
1339 | if (hasStreet) { | 1373 | if (hasStreet) { |
1340 | slHomeAddress[0] = ent.homeStreet(); | 1374 | slHomeAddress[0] = ent.homeStreet(); |
1341 | slBusinessAddress[0] = ent.businessStreet(); | 1375 | slBusinessAddress[0] = ent.businessStreet(); |
1342 | } | 1376 | } |
1343 | /* | 1377 | /* |
1344 | if (hasStreet2) { | 1378 | if (hasStreet2) { |
1345 | (*slHomeAddress)[1] = ent.homeStreet2(); | 1379 | (*slHomeAddress)[1] = ent.homeStreet2(); |
1346 | (*slBusinessAddress)[1] = ent.businessStreet2(); | 1380 | (*slBusinessAddress)[1] = ent.businessStreet2(); |
1347 | } | 1381 | } |
1348 | 1382 | ||
1349 | if (hasPOBox) { | 1383 | if (hasPOBox) { |
1350 | (*slHomeAddress)[2] = ent.homePOBox(); | 1384 | (*slHomeAddress)[2] = ent.homePOBox(); |
1351 | (*slBusinessAddress)[2] = ent.businessPOBox(); | 1385 | (*slBusinessAddress)[2] = ent.businessPOBox(); |
1352 | } | 1386 | } |
1353 | */ | 1387 | */ |
1354 | if (hasCity) { | 1388 | if (hasCity) { |
1355 | slHomeAddress[3] = ent.homeCity(); | 1389 | slHomeAddress[3] = ent.homeCity(); |
1356 | slBusinessAddress[3] = ent.businessCity(); | 1390 | slBusinessAddress[3] = ent.businessCity(); |
1357 | } | 1391 | } |
1358 | 1392 | ||
1359 | if (hasState) { | 1393 | if (hasState) { |
1360 | slHomeAddress[4] = ent.homeState(); | 1394 | slHomeAddress[4] = ent.homeState(); |
1361 | slBusinessAddress[4] = ent.businessState(); | 1395 | slBusinessAddress[4] = ent.businessState(); |
1362 | } | 1396 | } |
1363 | 1397 | ||
1364 | if (hasZip) { | 1398 | if (hasZip) { |
1365 | slHomeAddress[5] = ent.homeZip(); | 1399 | slHomeAddress[5] = ent.homeZip(); |
1366 | slBusinessAddress[5] = ent.businessZip(); | 1400 | slBusinessAddress[5] = ent.businessZip(); |
1367 | } | 1401 | } |
1368 | 1402 | ||
1369 | if (hasCountry) { | 1403 | if (hasCountry) { |
1370 | slHomeAddress[6] = ent.homeCountry(); | 1404 | slHomeAddress[6] = ent.homeCountry(); |
1371 | slBusinessAddress[6] = ent.businessCountry(); | 1405 | slBusinessAddress[6] = ent.businessCountry(); |
1372 | } | 1406 | } |
1373 | 1407 | ||
1374 | QStringList::ConstIterator it; | 1408 | QStringList::ConstIterator it; |
1375 | QListIterator<QLineEdit> itLE( listValue ); | 1409 | QListIterator<QLineEdit> itLE( listValue ); |
1376 | for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) { | 1410 | for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) { |
1377 | if ( *it == tr( "Department" ) ) | 1411 | if ( *it == "Department" ) |
1378 | (*itLE)->setText( ent.department() ); | 1412 | (*itLE)->setText( ent.department() ); |
1379 | 1413 | ||
1380 | if ( *it == tr( "Company" ) ) | 1414 | if ( *it == "Company" ) |
1381 | (*itLE)->setText( ent.company() ); | 1415 | (*itLE)->setText( ent.company() ); |
1382 | 1416 | ||
1383 | if ( *it == tr( "Office" ) ) | 1417 | if ( *it == "Office" ) |
1384 | (*itLE)->setText( ent.office() ); | 1418 | (*itLE)->setText( ent.office() ); |
1385 | 1419 | ||
1386 | if ( *it == tr( "Profession" ) ) | 1420 | if ( *it == "Profession" ) |
1387 | (*itLE)->setText( ent.profession() ); | 1421 | (*itLE)->setText( ent.profession() ); |
1388 | 1422 | ||
1389 | if ( *it == tr( "Assistant" ) ) | 1423 | if ( *it == "Assistant" ) |
1390 | (*itLE)->setText( ent.assistant() ); | 1424 | (*itLE)->setText( ent.assistant() ); |
1391 | 1425 | ||
1392 | if ( *it == tr( "Manager" ) ) | 1426 | if ( *it == "Manager" ) |
1393 | (*itLE)->setText( ent.manager() ); | 1427 | (*itLE)->setText( ent.manager() ); |
1394 | 1428 | ||
1395 | if ( *it == tr( "Spouse" ) ) | 1429 | if ( *it == "Spouse" ) |
1396 | (*itLE)->setText( ent.spouse() ); | 1430 | (*itLE)->setText( ent.spouse() ); |
1397 | 1431 | ||
1398 | if ( *it == tr( "Birthday" ) ) | 1432 | if ( *it == "Birthday" ) |
1399 | (*itLE)->setText( ent.birthday() ); | 1433 | (*itLE)->setText( ent.birthday() ); |
1400 | 1434 | ||
1401 | if ( *it == tr( "Anniversary" ) ) | 1435 | if ( *it == "Anniversary" ) |
1402 | (*itLE)->setText( ent.anniversary() ); | 1436 | (*itLE)->setText( ent.anniversary() ); |
1403 | 1437 | ||
1404 | if ( *it == tr( "Nickname" ) ) | 1438 | if ( *it == "Nickname" ) |
1405 | (*itLE)->setText( ent.nickname() ); | 1439 | (*itLE)->setText( ent.nickname() ); |
1406 | 1440 | ||
1407 | if ( *it == tr( "Children" ) ) | 1441 | if ( *it == "Children" ) |
1408 | (*itLE)->setText( ent.children() ); | 1442 | (*itLE)->setText( ent.children() ); |
1409 | 1443 | ||
1410 | } | 1444 | } |
1411 | 1445 | ||
1412 | QStringList::Iterator itV; | 1446 | QStringList::Iterator itV; |
1413 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { | 1447 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { |
1414 | 1448 | ||
1415 | if ( ( *it == "Business Phone") || ( *it == "Work Phone" ) ) | 1449 | if ( ( *it == "Business Phone") || ( *it == "Work Phone" ) ) |
1416 | *itV = ent.businessPhone(); | 1450 | *itV = ent.businessPhone(); |
1417 | /* | 1451 | /* |
1418 | if ( *it == "Business 2 Phone" ) | 1452 | if ( *it == "Business 2 Phone" ) |
1419 | *itV = ent.business2Phone(); | 1453 | *itV = ent.business2Phone(); |
1420 | */ | 1454 | */ |
1421 | if ( ( *it == "Business Fax") || ( *it == "Work Fax" ) ) | 1455 | if ( ( *it == "Business Fax") || ( *it == "Work Fax" ) ) |
1422 | *itV = ent.businessFax(); | 1456 | *itV = ent.businessFax(); |
1423 | 1457 | ||
1424 | if ( ( *it == "Business Mobile" ) || ( *it == "work Mobile" ) ) | 1458 | if ( ( *it == "Business Mobile" ) || ( *it == "work Mobile" ) ) |
1425 | *itV = ent.businessMobile(); | 1459 | *itV = ent.businessMobile(); |
1426 | /* | 1460 | /* |
1427 | if ( *it == "Company Phone" ) | 1461 | if ( *it == "Company Phone" ) |
1428 | *itV = ent.companyPhone(); | 1462 | *itV = ent.companyPhone(); |
1429 | */ | 1463 | */ |
1430 | if ( *it == "Default Email" ) | 1464 | if ( *it == "Default Email" ) |
1431 | *itV = ent.defaultEmail(); | 1465 | *itV = ent.defaultEmail(); |
1432 | 1466 | ||
1433 | if ( *it == "Emails" ) | 1467 | if ( *it == "Emails" ) |
1434 | *itV = ent.emailList().join(", "); // :SX | 1468 | *itV = ent.emailList().join(", "); // :SX |
1435 | 1469 | ||
1436 | if ( *it == "Home Phone" ) | 1470 | if ( *it == "Home Phone" ) |
1437 | *itV = ent.homePhone(); | 1471 | *itV = ent.homePhone(); |
1438 | /* | 1472 | /* |
1439 | if ( *it == "Home 2 Phone" ) | 1473 | if ( *it == "Home 2 Phone" ) |
1440 | *itV = ent.home2Phone(); | 1474 | *itV = ent.home2Phone(); |
1441 | */ | 1475 | */ |
1442 | if ( *it == "Home Fax" ) | 1476 | if ( *it == "Home Fax" ) |
1443 | *itV = ent.homeFax(); | 1477 | *itV = ent.homeFax(); |
1444 | 1478 | ||
1445 | if ( *it == "Home Mobile" ) | 1479 | if ( *it == "Home Mobile" ) |
1446 | *itV = ent.homeMobile(); | 1480 | *itV = ent.homeMobile(); |
1447 | /* | 1481 | /* |
1448 | if ( *it == "Car Phone" ) | 1482 | if ( *it == "Car Phone" ) |
1449 | *itV = ent.carPhone(); | 1483 | *itV = ent.carPhone(); |
1450 | 1484 | ||
1451 | if ( *it == "ISDN Phone" ) | 1485 | if ( *it == "ISDN Phone" ) |
1452 | *itV = ent.ISDNPhone(); | 1486 | *itV = ent.ISDNPhone(); |
1453 | 1487 | ||
1454 | if ( *it == "Other Phone" ) | 1488 | if ( *it == "Other Phone" ) |
1455 | *itV = ent.otherPhone(); | 1489 | *itV = ent.otherPhone(); |
@@ -1527,127 +1561,127 @@ void ContactEditor::saveEntry() { | |||
1527 | 1561 | ||
1528 | if (hasTitle) | 1562 | if (hasTitle) |
1529 | ent.setJobTitle( txtJobTitle->text() ); | 1563 | ent.setJobTitle( txtJobTitle->text() ); |
1530 | 1564 | ||
1531 | if (hasCompany) | 1565 | if (hasCompany) |
1532 | ent.setCompany( txtOrganization->text() ); | 1566 | ent.setCompany( txtOrganization->text() ); |
1533 | 1567 | ||
1534 | if (hasNotes) | 1568 | if (hasNotes) |
1535 | ent.setNotes( txtNote->text() ); | 1569 | ent.setNotes( txtNote->text() ); |
1536 | 1570 | ||
1537 | if (hasStreet) { | 1571 | if (hasStreet) { |
1538 | ent.setHomeStreet( slHomeAddress[0] ); | 1572 | ent.setHomeStreet( slHomeAddress[0] ); |
1539 | ent.setBusinessStreet( slBusinessAddress[0] ); | 1573 | ent.setBusinessStreet( slBusinessAddress[0] ); |
1540 | } | 1574 | } |
1541 | /* | 1575 | /* |
1542 | if (hasStreet2) { | 1576 | if (hasStreet2) { |
1543 | ent.setHomeStreet2( (*slHomeAddress)[1] ); | 1577 | ent.setHomeStreet2( (*slHomeAddress)[1] ); |
1544 | ent.setBusinessStreet2( (*slBusinessAddress)[1] ); | 1578 | ent.setBusinessStreet2( (*slBusinessAddress)[1] ); |
1545 | } | 1579 | } |
1546 | 1580 | ||
1547 | if (hasPOBox) { | 1581 | if (hasPOBox) { |
1548 | ent.setHomePOBox( (*slHomeAddress)[2] ); | 1582 | ent.setHomePOBox( (*slHomeAddress)[2] ); |
1549 | ent.setBusinessPOBox( (*slBusinessAddress)[2] ); | 1583 | ent.setBusinessPOBox( (*slBusinessAddress)[2] ); |
1550 | } | 1584 | } |
1551 | */ | 1585 | */ |
1552 | if (hasCity) { | 1586 | if (hasCity) { |
1553 | ent.setHomeCity( slHomeAddress[3] ); | 1587 | ent.setHomeCity( slHomeAddress[3] ); |
1554 | ent.setBusinessCity( slBusinessAddress[3] ); | 1588 | ent.setBusinessCity( slBusinessAddress[3] ); |
1555 | } | 1589 | } |
1556 | 1590 | ||
1557 | if (hasState) { | 1591 | if (hasState) { |
1558 | ent.setHomeState( slHomeAddress[4] ); | 1592 | ent.setHomeState( slHomeAddress[4] ); |
1559 | ent.setBusinessState( slBusinessAddress[4] ); | 1593 | ent.setBusinessState( slBusinessAddress[4] ); |
1560 | } | 1594 | } |
1561 | 1595 | ||
1562 | if (hasZip) { | 1596 | if (hasZip) { |
1563 | ent.setHomeZip( slHomeAddress[5] ); | 1597 | ent.setHomeZip( slHomeAddress[5] ); |
1564 | ent.setBusinessZip( slBusinessAddress[5] ); | 1598 | ent.setBusinessZip( slBusinessAddress[5] ); |
1565 | } | 1599 | } |
1566 | 1600 | ||
1567 | if (hasCountry) { | 1601 | if (hasCountry) { |
1568 | ent.setHomeCountry( slHomeAddress[6] ); | 1602 | ent.setHomeCountry( slHomeAddress[6] ); |
1569 | ent.setBusinessCountry( slBusinessAddress[6] ); | 1603 | ent.setBusinessCountry( slBusinessAddress[6] ); |
1570 | } | 1604 | } |
1571 | 1605 | ||
1572 | QStringList::ConstIterator it; | 1606 | QStringList::ConstIterator it; |
1573 | QListIterator<QLineEdit> itLE( listValue ); | 1607 | QListIterator<QLineEdit> itLE( listValue ); |
1574 | for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) { | 1608 | for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) { |
1575 | if ( *it == tr( "Department" ) ) | 1609 | if ( *it == "Department" ) |
1576 | ent.setDepartment( (*itLE)->text() ); | 1610 | ent.setDepartment( (*itLE)->text() ); |
1577 | 1611 | ||
1578 | if ( *it == tr( "Company" ) ) | 1612 | if ( *it == "Company" ) |
1579 | ent.setCompany( (*itLE)->text() ); | 1613 | ent.setCompany( (*itLE)->text() ); |
1580 | 1614 | ||
1581 | if ( *it == tr( "Office" ) ) | 1615 | if ( *it == "Office" ) |
1582 | ent.setOffice( (*itLE)->text() ); | 1616 | ent.setOffice( (*itLE)->text() ); |
1583 | 1617 | ||
1584 | if ( *it == tr( "Profession" ) ) | 1618 | if ( *it == "Profession" ) |
1585 | ent.setProfession( (*itLE)->text() ); | 1619 | ent.setProfession( (*itLE)->text() ); |
1586 | 1620 | ||
1587 | if ( *it == tr( "Assistant" ) ) | 1621 | if ( *it == "Assistant" ) |
1588 | ent.setAssistant( (*itLE)->text() ); | 1622 | ent.setAssistant( (*itLE)->text() ); |
1589 | 1623 | ||
1590 | if ( *it == tr( "Manager" ) ) | 1624 | if ( *it == "Manager" ) |
1591 | ent.setManager( (*itLE)->text() ); | 1625 | ent.setManager( (*itLE)->text() ); |
1592 | 1626 | ||
1593 | if ( *it == tr( "Spouse" ) ) | 1627 | if ( *it == "Spouse" ) |
1594 | ent.setSpouse( (*itLE)->text() ); | 1628 | ent.setSpouse( (*itLE)->text() ); |
1595 | 1629 | ||
1596 | if ( *it == tr( "Birthday" ) ) | 1630 | if ( *it == "Birthday" ) |
1597 | ent.setBirthday( (*itLE)->text() ); | 1631 | ent.setBirthday( (*itLE)->text() ); |
1598 | 1632 | ||
1599 | if ( *it == tr( "Anniversary" ) ) | 1633 | if ( *it == "Anniversary" ) |
1600 | ent.setAnniversary( (*itLE)->text() ); | 1634 | ent.setAnniversary( (*itLE)->text() ); |
1601 | 1635 | ||
1602 | if ( *it == tr( "Nickname" ) ) | 1636 | if ( *it == "Nickname" ) |
1603 | ent.setNickname( (*itLE)->text() ); | 1637 | ent.setNickname( (*itLE)->text() ); |
1604 | 1638 | ||
1605 | if ( *it == tr( "Children" ) ) | 1639 | if ( *it == "Children" ) |
1606 | ent.setChildren( (*itLE)->text() ); | 1640 | ent.setChildren( (*itLE)->text() ); |
1607 | 1641 | ||
1608 | } | 1642 | } |
1609 | 1643 | ||
1610 | QStringList::ConstIterator itV; | 1644 | QStringList::ConstIterator itV; |
1611 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { | 1645 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { |
1612 | 1646 | ||
1613 | if ( ( *it == "Business Phone" ) || ( *it == "Work Phone" ) ) | 1647 | if ( ( *it == "Business Phone" ) || ( *it == "Work Phone" ) ) |
1614 | ent.setBusinessPhone( *itV ); | 1648 | ent.setBusinessPhone( *itV ); |
1615 | /* | 1649 | /* |
1616 | if ( *it == tr("Business 2 Phone" ) | 1650 | if ( *it == tr("Business 2 Phone" ) |
1617 | ent.setBusiness2Phone( *itV ); | 1651 | ent.setBusiness2Phone( *itV ); |
1618 | */ | 1652 | */ |
1619 | if ( ( *it == "Business Fax" ) || ( *it == "Work Fax" ) ) | 1653 | if ( ( *it == "Business Fax" ) || ( *it == "Work Fax" ) ) |
1620 | ent.setBusinessFax( *itV ); | 1654 | ent.setBusinessFax( *itV ); |
1621 | 1655 | ||
1622 | if ( ( *it == "Business Mobile" ) || ( *it == "Work Mobile" ) ) | 1656 | if ( ( *it == "Business Mobile" ) || ( *it == "Work Mobile" ) ) |
1623 | ent.setBusinessMobile( *itV ); | 1657 | ent.setBusinessMobile( *itV ); |
1624 | /* | 1658 | /* |
1625 | if ( *it == "Company Phone" ) | 1659 | if ( *it == "Company Phone" ) |
1626 | ent.setCompanyPhone( *itV ); | 1660 | ent.setCompanyPhone( *itV ); |
1627 | */ | 1661 | */ |
1628 | //if ( *it == "Default Email" ) | 1662 | //if ( *it == "Default Email" ) |
1629 | //ent.setDefaultEmail( *itV ); | 1663 | //ent.setDefaultEmail( *itV ); |
1630 | 1664 | ||
1631 | if ( *it == "Emails" ){ | 1665 | if ( *it == "Emails" ){ |
1632 | QString allemail; | 1666 | QString allemail; |
1633 | QString defaultmail; | 1667 | QString defaultmail; |
1634 | parseEmailFrom( *itV, defaultmail, allemail ); | 1668 | parseEmailFrom( *itV, defaultmail, allemail ); |
1635 | // ent.clearEmails(); | 1669 | // ent.clearEmails(); |
1636 | ent.setDefaultEmail( defaultmail ); | 1670 | ent.setDefaultEmail( defaultmail ); |
1637 | ent.setEmails( allemail ); | 1671 | ent.setEmails( allemail ); |
1638 | } | 1672 | } |
1639 | 1673 | ||
1640 | if ( *it == "Home Phone" ) | 1674 | if ( *it == "Home Phone" ) |
1641 | ent.setHomePhone( *itV ); | 1675 | ent.setHomePhone( *itV ); |
1642 | /* | 1676 | /* |
1643 | if ( *it == "Home 2 Phone" ) | 1677 | if ( *it == "Home 2 Phone" ) |
1644 | ent.setHome2Phone( *itV ); | 1678 | ent.setHome2Phone( *itV ); |
1645 | */ | 1679 | */ |
1646 | if ( *it == "Home Fax" ) | 1680 | if ( *it == "Home Fax" ) |
1647 | ent.setHomeFax( *itV ); | 1681 | ent.setHomeFax( *itV ); |
1648 | 1682 | ||
1649 | if ( *it == "Home Mobile" ) | 1683 | if ( *it == "Home Mobile" ) |
1650 | ent.setHomeMobile( *itV ); | 1684 | ent.setHomeMobile( *itV ); |
1651 | /* | 1685 | /* |
1652 | if ( *it == "Car Phone" ) | 1686 | if ( *it == "Car Phone" ) |
1653 | ent.setCarPhone( *itV ); | 1687 | ent.setCarPhone( *itV ); |