author | eilers <eilers> | 2003-03-04 16:31:18 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-03-04 16:31:18 (UTC) |
commit | 628a783e5d7ec07b5c073c94a77b614439d937ba (patch) (unidiff) | |
tree | 30e64e15b94051b185b4c4eecb849e3767d7610b | |
parent | 8642232f4435bc5341037527d1eb12d1f39781f4 (diff) | |
download | opie-628a783e5d7ec07b5c073c94a77b614439d937ba.zip opie-628a783e5d7ec07b5c073c94a77b614439d937ba.tar.gz opie-628a783e5d7ec07b5c073c94a77b614439d937ba.tar.bz2 |
Name parser completely rewritten ! It is now possible to have as much middle
names as your parents payed for ;)
If you have a lastname which was build out of words like "Klara Anne Marie Freifrau von Lichtenstein" or
"Carlos Marcos del los Rios" you have to use a "," to separate between first andd last names like
this: "del los Rios, Carlos Marcos" or "Freifrau von Lichtenstein, Klara Anne Marie"..
-rw-r--r-- | core/pim/addressbook/TODO | 2 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 803 | ||||
-rw-r--r-- | core/pim/addressbook/version.h | 4 |
3 files changed, 363 insertions, 446 deletions
diff --git a/core/pim/addressbook/TODO b/core/pim/addressbook/TODO index a0d50a3..106747e 100644 --- a/core/pim/addressbook/TODO +++ b/core/pim/addressbook/TODO | |||
@@ -1,116 +1,116 @@ | |||
1 | Stuff todo until OPIE 1.0 : | 1 | Stuff todo until OPIE 1.0 : |
2 | =========================== | 2 | =========================== |
3 | 3 | ||
4 | Feature requests: | 4 | Feature requests: |
5 | ----------------- | 5 | ----------------- |
6 | - Dial by mobile phone by tapping the number.. | 6 | - Dial by mobile phone by tapping the number.. |
7 | (Maybe using gsmtool. And we may | 7 | (Maybe using gsmtool. And we may |
8 | add a library class for this) | 8 | add a library class for this) |
9 | - dial with dtmfdial in case it's installed and there's no mobile | 9 | - dial with dtmfdial in case it's installed and there's no mobile |
10 | - 3rd column for 2. Contact | 10 | - 3rd column for 2. Contact |
11 | - Implementing additional Views (Phonebook, ...) | 11 | - Implementing additional Views (Phonebook, ...) |
12 | - Birthday & Anniversary Reminder | 12 | - Birthday & Anniversary Reminder |
13 | - Beaming of multiple contacts (current list/ by search or by category) | 13 | - Beaming of multiple contacts (current list/ by search or by category) |
14 | - Configure the letter-picker: lastname/fullname search | 14 | - Configure the letter-picker: lastname/fullname search |
15 | - User center of the joypad to switch back from card to listview ! | 15 | - User center of the joypad to switch back from card to listview ! |
16 | - Cursor-UP/Down: Should additionally scroll cardview if it is too large | 16 | - Cursor-UP/Down: Should additionally scroll cardview if it is too large |
17 | (behaviour should be selectable by configuration) | 17 | (behaviour should be selectable by configuration) |
18 | 18 | ||
19 | Known Bugs: | 19 | Known Bugs: |
20 | ----------- | 20 | ----------- |
21 | 21 | ||
22 | Bugs but not in addressbook: | 22 | Bugs but not in addressbook: |
23 | ----------------------------- | 23 | ----------------------------- |
24 | - VCARD: If umlaut (äöüß) in address, the parser gets confused.. | 24 | - VCARD: If umlaut (äöüß) in address, the parser gets confused.. |
25 | 25 | ||
26 | 26 | ||
27 | Urgent: | 27 | Urgent: |
28 | -------- | 28 | -------- |
29 | - Category is on the wrong position after changing to personal and back to normal | 29 | - Category is on the wrong position after changing to personal and back to normal |
30 | ( Temporarily workaround: Category is never deactivated.. :S ) | 30 | ( Temporarily workaround: Category is never deactivated.. :S ) |
31 | 31 | ||
32 | - Fix handling of 3 Firstnames | ||
33 | 32 | ||
34 | Important: | 33 | Important: |
35 | ---------- | 34 | ---------- |
36 | 35 | ||
37 | - "What's this" should be added (Deleyed after Feature Freeze) | 36 | - "What's this" should be added (Deleyed after Feature Freeze) |
38 | 37 | ||
39 | Less important: | 38 | Less important: |
40 | --------------- | 39 | --------------- |
41 | - Reload if contacts were changed externally | 40 | - Reload if contacts were changed externally |
42 | - The picker (alphabetical sort widget) should be | 41 | - The picker (alphabetical sort widget) should be |
43 | placed verticaly or horizontally (configurable) | 42 | placed verticaly or horizontally (configurable) |
44 | - Find a smart solution for activating/deactivating the "send email" event | 43 | - Find a smart solution for activating/deactivating the "send email" event |
45 | - If new contact is added (contacteditor closed): focus (table, card) to | 44 | - If new contact is added (contacteditor closed): focus (table, card) to |
46 | this entry ! | 45 | this entry ! |
47 | - After search (Started with Return): KeyFocus should be on Tabelle | 46 | - After search (Started with Return): KeyFocus should be on Tabelle |
48 | 47 | ||
49 | ContactEditor: | 48 | ContactEditor: |
50 | - Redesign of Contacteditor | 49 | - Redesign of Contacteditor |
51 | 50 | ||
52 | Should be Fixed (not absolute sure, need further validation): | 51 | Should be Fixed (not absolute sure, need further validation): |
53 | ------------------------------------------------------------- | 52 | ------------------------------------------------------------- |
54 | 53 | ||
55 | 54 | ||
56 | Fixed/Ready: | 55 | Fixed/Ready: |
57 | ------- | 56 | ------- |
58 | - Syncing: abtable not reloaded after sync. | 57 | - Syncing: abtable not reloaded after sync. |
59 | - Find widget should be replaced by something like | 58 | - Find widget should be replaced by something like |
60 | qpdf has. | 59 | qpdf has. |
61 | - Adding a configuration dialog | 60 | - Adding a configuration dialog |
62 | - Picker: Activated letter schould be more visible | 61 | - Picker: Activated letter schould be more visible |
63 | - Advanced handling of cursor keys (search..) | 62 | - Advanced handling of cursor keys (search..) |
64 | - Mail-Icon is missing | 63 | - Mail-Icon is missing |
65 | - Use opie-mail insted of qt-mail if possible. | 64 | - Use opie-mail insted of qt-mail if possible. |
66 | - Font menu is invisible using german translation | 65 | - Font menu is invisible using german translation |
67 | - Personal contact editor: Disable categories | 66 | - Personal contact editor: Disable categories |
68 | - "Nonenglish" translation bug has to be fixed. | 67 | - "Nonenglish" translation bug has to be fixed. |
69 | - contacteditor: Birthday, annyversary, ... : Use Dateselector | 68 | - contacteditor: Birthday, annyversary, ... : Use Dateselector |
70 | - The names of the countries are sorted by there english names, only.. | 69 | - The names of the countries are sorted by there english names, only.. |
71 | Even if they are translated.. :S | 70 | Even if they are translated.. :S |
72 | - Cursor keys should work in detail-view (ablabel) | 71 | - Cursor keys should work in detail-view (ablabel) |
73 | -> Ablabel should be removed and Abtable should be increased with | 72 | -> Ablabel should be removed and Abtable should be increased with |
74 | different views (as started by darwin zins).. | 73 | different views (as started by darwin zins).. |
75 | - Use advanced database functions in abtable to decrease | 74 | - Use advanced database functions in abtable to decrease |
76 | memory footprint and to make everything more easy ! | 75 | memory footprint and to make everything more easy ! |
77 | (abtable should store Iterator for selected Category) | 76 | (abtable should store Iterator for selected Category) |
78 | - Abtable: Configure Contact column (internally already available, | 77 | - Abtable: Configure Contact column (internally already available, |
79 | need configuration) | 78 | need configuration) |
80 | - Select of primary contact (see #274 on mantis) | 79 | - Select of primary contact (see #274 on mantis) |
81 | - Category-select does not work completely: "Unfiled" is always in listview .. | 80 | - Category-select does not work completely: "Unfiled" is always in listview .. |
82 | - Return from Contacteditor: Category resettet to all | 81 | - Return from Contacteditor: Category resettet to all |
83 | - Personal Details not working | 82 | - Personal Details not working |
84 | - If category changed, the letterpicker should be resetted | 83 | - If category changed, the letterpicker should be resetted |
85 | - There should be some icons for List and Cardview | 84 | - There should be some icons for List and Cardview |
86 | - If in Cardview and a category change removes all entries: | 85 | - If in Cardview and a category change removes all entries: |
87 | There are already entries in Cardview after up/down | 86 | There are already entries in Cardview after up/down |
88 | - Personal Details: Anniversary zeigt Fantasie-Werte | 87 | - Personal Details: Anniversary zeigt Fantasie-Werte |
89 | - Unfiled shown just in Category "All" and "Unfiled". | 88 | - Unfiled shown just in Category "All" and "Unfiled". |
90 | - After finising search and after Edit: Clear Picker | 89 | - After finising search and after Edit: Clear Picker |
91 | - After Edit: Table position back to edited entry. | 90 | - After Edit: Table position back to edited entry. |
92 | - Optimize Table Update... | 91 | - Optimize Table Update... |
93 | - Change MyDialog to Config | 92 | - Change MyDialog to Config |
94 | - Store position and state of toolbar | 93 | - Store position and state of toolbar |
95 | - Searchwidget closed: Selected user is jumping | 94 | - Searchwidget closed: Selected user is jumping |
96 | - Wenn suchen beendet, dann dauert das Tabellenupdate (was überhaupt überflüssig ist) | 95 | - Wenn suchen beendet, dann dauert das Tabellenupdate (was überhaupt überflüssig ist) |
97 | zu lange.. | 96 | zu lange.. |
98 | - VCARD: Import of Anniversary does not work correctly (currently disabled) | 97 | - VCARD: Import of Anniversary does not work correctly (currently disabled) |
99 | - Name order selected in "contacteditor" not used in list view. | 98 | - Name order selected in "contacteditor" not used in list view. |
100 | - OK-Key does not switch from Detailview (ablable) to Listview | 99 | - OK-Key does not switch from Detailview (ablable) to Listview |
101 | - Receiving of beams should open a dialog | 100 | - Receiving of beams should open a dialog |
102 | - Fix start of opie-mail | 101 | - Fix start of opie-mail |
103 | - Implement Button Pics | 102 | - Implement Button Pics |
104 | - Add a dialog to accept and optionally edit received contacts by IRDA. | 103 | - Add a dialog to accept and optionally edit received contacts by IRDA. |
105 | - Language not English (tested with german opie-translation): | 104 | - Language not English (tested with german opie-translation): |
106 | 1. Configure nicht übersetzt (alles leer). | 105 | 1. Configure nicht übersetzt (alles leer). |
107 | 2. Contacteditor nur teilweise übersetzt. | 106 | 2. Contacteditor nur teilweise übersetzt. |
108 | 3. Kategorie-Picker geht nicht. | 107 | 3. Kategorie-Picker geht nicht. |
109 | - Plugin for Today for Birthdays and Anniversaries | 108 | - Plugin for Today for Birthdays and Anniversaries |
110 | - Implement a picker/combo for the default email. | 109 | - Implement a picker/combo for the default email. |
111 | - Overview window cleanup needed.. | 110 | - Overview window cleanup needed.. |
112 | - Store last settings of combo-boxes | 111 | - Store last settings of combo-boxes |
113 | - Personal and Business Web-page is not editable | 112 | - Personal and Business Web-page is not editable |
114 | - Default Email-button: A lot of problems: | 113 | - Default Email-button: A lot of problems: |
115 | If on second tab: The combo chooser is on the top left of the screen ! :( | 114 | If on second tab: The combo chooser is on the top left of the screen ! :( |
116 | - Default Email-Button: Sometimes not hiding the textfields completely | 115 | - Default Email-Button: Sometimes not hiding the textfields completely |
116 | - Fix handling of 3 Firstnames | ||
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index d1338f6..7bc5bde 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -1,1817 +1,1734 @@ | |||
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 | #include <qmessagebox.h> | 49 | #include <qmessagebox.h> |
50 | 50 | ||
51 | #include <assert.h> | 51 | #include <assert.h> |
52 | 52 | ||
53 | static inline bool containsAlphaNum( const QString &str ); | 53 | static inline bool containsAlphaNum( const QString &str ); |
54 | static inline bool constainsWhiteSpace( const QString &str ); | 54 | static inline bool constainsWhiteSpace( const QString &str ); |
55 | 55 | ||
56 | // helper functions, convert our comma delimited list to proper | 56 | // helper functions, convert our comma delimited list to proper |
57 | // file format... | 57 | // file format... |
58 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, | 58 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, |
59 | QString &strAll ); | 59 | QString &strAll ); |
60 | 60 | ||
61 | // helper convert from file format to comma delimited... | 61 | // helper convert from file format to comma delimited... |
62 | void parseEmailTo( const QString &strDefaultEmail, | 62 | void parseEmailTo( const QString &strDefaultEmail, |
63 | const QString &strOtherEmail, QString &strBack ); | 63 | const QString &strOtherEmail, QString &strBack ); |
64 | 64 | ||
65 | ContactEditor::ContactEditor(const OContact &entry, | 65 | ContactEditor::ContactEditor(const OContact &entry, |
66 | QWidget *parent, | 66 | QWidget *parent, |
67 | const char *name, | 67 | const char *name, |
68 | WFlags fl ) | 68 | WFlags fl ) |
69 | : QDialog( parent, name, TRUE, fl ), | 69 | : QDialog( parent, name, TRUE, fl ), |
70 | defaultEmailChooserPosition( -1 ), | 70 | defaultEmailChooserPosition( -1 ), |
71 | m_personalView ( false ), | 71 | m_personalView ( false ), |
72 | cmbDefaultEmail( 0 ), | 72 | cmbDefaultEmail( 0 ), |
73 | initializing ( false ) | 73 | initializing ( false ) |
74 | { | 74 | { |
75 | 75 | ||
76 | initializing = true; | 76 | initializing = true; |
77 | 77 | ||
78 | init(); | 78 | init(); |
79 | setEntry( entry ); | 79 | setEntry( entry ); |
80 | // cmbDefaultEmail = 0; | 80 | // cmbDefaultEmail = 0; |
81 | // defaultEmailChooserPosition = -1; | 81 | // defaultEmailChooserPosition = -1; |
82 | 82 | ||
83 | initializing = false; | 83 | initializing = false; |
84 | } | 84 | } |
85 | 85 | ||
86 | ContactEditor::~ContactEditor() { | 86 | ContactEditor::~ContactEditor() { |
87 | } | 87 | } |
88 | 88 | ||
89 | void ContactEditor::init() { | 89 | void ContactEditor::init() { |
90 | qWarning("init() START"); | 90 | qWarning("init() START"); |
91 | 91 | ||
92 | useFullName = true; | 92 | useFullName = true; |
93 | 93 | ||
94 | uint i = 0; | 94 | uint i = 0; |
95 | 95 | ||
96 | QStringList trlChooserNames; | 96 | QStringList trlChooserNames; |
97 | 97 | ||
98 | for (i = 0; i <= 6; i++) { | 98 | for (i = 0; i <= 6; i++) { |
99 | slHomeAddress.append( "" ); | 99 | slHomeAddress.append( "" ); |
100 | slBusinessAddress.append( "" ); | 100 | slBusinessAddress.append( "" ); |
101 | } | 101 | } |
102 | 102 | ||
103 | trlChooserNames = OContactFields::trphonefields( false ); | 103 | trlChooserNames = OContactFields::trphonefields( false ); |
104 | slChooserNames = OContactFields::untrphonefields( false ); | 104 | slChooserNames = OContactFields::untrphonefields( false ); |
105 | slDynamicEntries = OContactFields::untrdetailsfields( false ); | 105 | slDynamicEntries = OContactFields::untrdetailsfields( false ); |
106 | trlDynamicEntries = OContactFields::trdetailsfields( false ); | 106 | trlDynamicEntries = OContactFields::trdetailsfields( false ); |
107 | 107 | ||
108 | // Ok, we have to remove elements from the list of dynamic entries | 108 | // Ok, we have to remove elements from the list of dynamic entries |
109 | // which are now stored in special (not dynamic) widgets.. | 109 | // which are now stored in special (not dynamic) widgets.. |
110 | // Otherwise we will get problems with field assignments! (se) | 110 | // Otherwise we will get problems with field assignments! (se) |
111 | slDynamicEntries.remove("Anniversary"); | 111 | slDynamicEntries.remove("Anniversary"); |
112 | slDynamicEntries.remove("Birthday"); | 112 | slDynamicEntries.remove("Birthday"); |
113 | slDynamicEntries.remove("Gender"); | 113 | slDynamicEntries.remove("Gender"); |
114 | 114 | ||
115 | // The same with translated fields.. But I will | 115 | // The same with translated fields.. But I will |
116 | // use the translation map to avoid mismatches.. | 116 | // use the translation map to avoid mismatches.. |
117 | QMap<int, QString> translMap = OContactFields::idToTrFields(); | 117 | QMap<int, QString> translMap = OContactFields::idToTrFields(); |
118 | trlDynamicEntries.remove( translMap[Qtopia::Anniversary] ); | 118 | trlDynamicEntries.remove( translMap[Qtopia::Anniversary] ); |
119 | trlDynamicEntries.remove( translMap[Qtopia::Birthday] ); | 119 | trlDynamicEntries.remove( translMap[Qtopia::Birthday] ); |
120 | trlDynamicEntries.remove( translMap[Qtopia::Gender] ); | 120 | trlDynamicEntries.remove( translMap[Qtopia::Gender] ); |
121 | 121 | ||
122 | // Last Check to be sure.. | 122 | // Last Check to be sure.. |
123 | assert( slDynamicEntries.count() == trlDynamicEntries.count() ); | 123 | assert( slDynamicEntries.count() == trlDynamicEntries.count() ); |
124 | assert( slChooserNames.count() == trlChooserNames.count() ); | 124 | assert( slChooserNames.count() == trlChooserNames.count() ); |
125 | 125 | ||
126 | for (i = 0; i < slChooserNames.count(); i++) | 126 | for (i = 0; i < slChooserNames.count(); i++) |
127 | slChooserValues.append(""); | 127 | slChooserValues.append(""); |
128 | 128 | ||
129 | 129 | ||
130 | QVBoxLayout *vb = new QVBoxLayout( this ); | 130 | QVBoxLayout *vb = new QVBoxLayout( this ); |
131 | 131 | ||
132 | tabMain = new QTabWidget( this ); | 132 | tabMain = new QTabWidget( this ); |
133 | vb->addWidget( tabMain ); | 133 | vb->addWidget( tabMain ); |
134 | 134 | ||
135 | QWidget *tabViewport = new QWidget ( tabMain ); | 135 | QWidget *tabViewport = new QWidget ( tabMain ); |
136 | 136 | ||
137 | vb = new QVBoxLayout( tabViewport ); | 137 | vb = new QVBoxLayout( tabViewport ); |
138 | 138 | ||
139 | svGeneral = new QScrollView( tabViewport ); | 139 | svGeneral = new QScrollView( tabViewport ); |
140 | vb->addWidget( svGeneral, 0, 0 ); | 140 | vb->addWidget( svGeneral, 0, 0 ); |
141 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); | 141 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); |
142 | svGeneral->setFrameStyle( QFrame::NoFrame ); | 142 | svGeneral->setFrameStyle( QFrame::NoFrame ); |
143 | 143 | ||
144 | QWidget *container = new QWidget( svGeneral->viewport() ); | 144 | QWidget *container = new QWidget( svGeneral->viewport() ); |
145 | svGeneral->addChild( container ); | 145 | svGeneral->addChild( container ); |
146 | 146 | ||
147 | QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); | 147 | QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); |
148 | gl->setResizeMode( QLayout::FreeResize ); | 148 | gl->setResizeMode( QLayout::FreeResize ); |
149 | 149 | ||
150 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); | 150 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); |
151 | gl->addWidget( btnFullName, 0, 0 ); | 151 | gl->addWidget( btnFullName, 0, 0 ); |
152 | txtFullName = new QLineEdit( container ); | 152 | txtFullName = new QLineEdit( container ); |
153 | gl->addWidget( txtFullName, 0, 1 ); | 153 | gl->addWidget( txtFullName, 0, 1 ); |
154 | 154 | ||
155 | QLabel *l = new QLabel( tr( "Job Title" ), container ); | 155 | QLabel *l = new QLabel( tr( "Job Title" ), container ); |
156 | gl->addWidget( l, 1, 0 ); | 156 | gl->addWidget( l, 1, 0 ); |
157 | txtJobTitle = new QLineEdit( container ); | 157 | txtJobTitle = new QLineEdit( container ); |
158 | gl->addWidget( txtJobTitle, 1, 1 ); | 158 | gl->addWidget( txtJobTitle, 1, 1 ); |
159 | 159 | ||
160 | l = new QLabel( tr( "Organization" ), container ); | 160 | l = new QLabel( tr("Suffix"), container ); |
161 | gl->addWidget( l, 2, 0 ); | 161 | gl->addWidget( l, 2, 0 ); |
162 | txtSuffix = new QLineEdit( container ); | ||
163 | gl->addWidget( txtSuffix, 2, 1 ); | ||
164 | |||
165 | l = new QLabel( tr( "Organization" ), container ); | ||
166 | gl->addWidget( l, 3, 0 ); | ||
162 | txtOrganization = new QLineEdit( container ); | 167 | txtOrganization = new QLineEdit( container ); |
163 | gl->addWidget( txtOrganization, 2, 1 ); | 168 | gl->addWidget( txtOrganization, 3, 1 ); |
164 | 169 | ||
165 | // Chooser 1 | 170 | // Chooser 1 |
166 | cmbChooserField1 = new QComboBox( FALSE, container ); | 171 | cmbChooserField1 = new QComboBox( FALSE, container ); |
167 | cmbChooserField1->setMaximumWidth( 90 ); | 172 | cmbChooserField1->setMaximumWidth( 90 ); |
168 | gl->addWidget( cmbChooserField1, 3, 0 ); | 173 | gl->addWidget( cmbChooserField1, 4, 0 ); |
169 | // Textfield for chooser 1. | 174 | // Textfield for chooser 1. |
170 | // Now use Widgetstack to contain the textfield and the default-email combo ! | 175 | // Now use Widgetstack to contain the textfield and the default-email combo ! |
171 | m_widgetStack1 = new QWidgetStack( container ); | 176 | m_widgetStack1 = new QWidgetStack( container ); |
172 | txtChooserField1 = new QLineEdit( m_widgetStack1 ); | 177 | txtChooserField1 = new QLineEdit( m_widgetStack1 ); |
173 | m_widgetStack1 -> addWidget( txtChooserField1, TextField ); | 178 | m_widgetStack1 -> addWidget( txtChooserField1, TextField ); |
174 | gl->addWidget( m_widgetStack1, 3, 1 ); | 179 | gl->addWidget( m_widgetStack1, 4, 1 ); |
175 | m_widgetStack1 -> raiseWidget( TextField ); | 180 | m_widgetStack1 -> raiseWidget( TextField ); |
176 | 181 | ||
177 | // Chooser 2 | 182 | // Chooser 2 |
178 | cmbChooserField2 = new QComboBox( FALSE, container ); | 183 | cmbChooserField2 = new QComboBox( FALSE, container ); |
179 | cmbChooserField2->setMaximumWidth( 90 ); | 184 | cmbChooserField2->setMaximumWidth( 90 ); |
180 | gl->addWidget( cmbChooserField2, 4, 0 ); | 185 | gl->addWidget( cmbChooserField2, 5, 0 ); |
181 | // Textfield for chooser 2 | 186 | // Textfield for chooser 2 |
182 | // 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! |
183 | m_widgetStack2 = new QWidgetStack( container ); | 188 | m_widgetStack2 = new QWidgetStack( container ); |
184 | txtChooserField2 = new QLineEdit( m_widgetStack2 ); | 189 | txtChooserField2 = new QLineEdit( m_widgetStack2 ); |
185 | m_widgetStack2 -> addWidget( txtChooserField2, TextField ); | 190 | m_widgetStack2 -> addWidget( txtChooserField2, TextField ); |
186 | gl->addWidget( m_widgetStack2, 4, 1 ); | 191 | gl->addWidget( m_widgetStack2, 5, 1 ); |
187 | m_widgetStack2 -> raiseWidget( TextField ); | 192 | m_widgetStack2 -> raiseWidget( TextField ); |
188 | 193 | ||
189 | // Chooser 3 | 194 | // Chooser 3 |
190 | cmbChooserField3 = new QComboBox( FALSE, container ); | 195 | cmbChooserField3 = new QComboBox( FALSE, container ); |
191 | cmbChooserField3->setMaximumWidth( 90 ); | 196 | cmbChooserField3->setMaximumWidth( 90 ); |
192 | gl->addWidget( cmbChooserField3, 5, 0 ); | 197 | gl->addWidget( cmbChooserField3, 6, 0 ); |
193 | // Textfield for chooser 2 | 198 | // Textfield for chooser 2 |
194 | // Now use WidgetStack to contain the textfield and the default-email combo! | 199 | // Now use WidgetStack to contain the textfield and the default-email combo! |
195 | m_widgetStack3 = new QWidgetStack( container ); | 200 | m_widgetStack3 = new QWidgetStack( container ); |
196 | txtChooserField3 = new QLineEdit( m_widgetStack3 ); | 201 | txtChooserField3 = new QLineEdit( m_widgetStack3 ); |
197 | m_widgetStack3 -> addWidget( txtChooserField3, TextField ); | 202 | m_widgetStack3 -> addWidget( txtChooserField3, TextField ); |
198 | gl->addWidget( m_widgetStack3, 5, 1 ); | 203 | gl->addWidget( m_widgetStack3, 6, 1 ); |
199 | m_widgetStack3 -> raiseWidget( TextField ); | 204 | m_widgetStack3 -> raiseWidget( TextField ); |
200 | 205 | ||
201 | l = new QLabel( tr( "File As" ), container ); | 206 | l = new QLabel( tr( "File As" ), container ); |
202 | gl->addWidget( l, 6, 0 ); | 207 | gl->addWidget( l, 7, 0 ); |
203 | cmbFileAs = new QComboBox( TRUE, container ); | 208 | cmbFileAs = new QComboBox( TRUE, container ); |
204 | gl->addWidget( cmbFileAs, 6, 1 ); | 209 | gl->addWidget( cmbFileAs, 7, 1 ); |
205 | 210 | ||
206 | labCat = new QLabel( tr( "Category" ), container ); | 211 | labCat = new QLabel( tr( "Category" ), container ); |
207 | gl->addWidget( labCat, 7, 0 ); | 212 | gl->addWidget( labCat, 8, 0 ); |
208 | cmbCat = new CategorySelect( container ); | 213 | cmbCat = new CategorySelect( container ); |
209 | gl->addWidget( cmbCat, 7, 1 ); | 214 | gl->addWidget( cmbCat, 8, 1 ); |
210 | labCat->show(); | 215 | labCat->show(); |
211 | cmbCat->show(); | 216 | cmbCat->show(); |
212 | 217 | ||
213 | btnNote = new QPushButton( tr( "Notes..." ), container ); | 218 | btnNote = new QPushButton( tr( "Notes..." ), container ); |
214 | gl->addWidget( btnNote, 8, 1 ); | 219 | gl->addWidget( btnNote, 9, 1 ); |
215 | 220 | ||
216 | tabMain->insertTab( tabViewport, tr( "General" ) ); | 221 | tabMain->insertTab( tabViewport, tr( "General" ) ); |
217 | 222 | ||
218 | tabViewport = new QWidget ( tabMain ); | 223 | tabViewport = new QWidget ( tabMain ); |
219 | 224 | ||
220 | vb = new QVBoxLayout( tabViewport ); | 225 | vb = new QVBoxLayout( tabViewport ); |
221 | 226 | ||
222 | svAddress = new QScrollView( tabViewport ); | 227 | svAddress = new QScrollView( tabViewport ); |
223 | vb->addWidget( svAddress, 0, 0 ); | 228 | vb->addWidget( svAddress, 0, 0 ); |
224 | svAddress->setResizePolicy( QScrollView::AutoOneFit ); | 229 | svAddress->setResizePolicy( QScrollView::AutoOneFit ); |
225 | svAddress->setFrameStyle( QFrame::NoFrame ); | 230 | svAddress->setFrameStyle( QFrame::NoFrame ); |
226 | 231 | ||
227 | container = new QWidget( svAddress->viewport() ); | 232 | container = new QWidget( svAddress->viewport() ); |
228 | svAddress->addChild( container ); | 233 | svAddress->addChild( container ); |
229 | 234 | ||
230 | gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem | 235 | gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem |
231 | 236 | ||
232 | cmbAddress = new QComboBox( FALSE, container ); | 237 | cmbAddress = new QComboBox( FALSE, container ); |
233 | cmbAddress->insertItem( tr( "Business" ) ); | 238 | cmbAddress->insertItem( tr( "Business" ) ); |
234 | cmbAddress->insertItem( tr( "Home" ) ); | 239 | cmbAddress->insertItem( tr( "Home" ) ); |
235 | gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); | 240 | gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); |
236 | 241 | ||
237 | l = new QLabel( tr( "Address" ), container ); | 242 | l = new QLabel( tr( "Address" ), container ); |
238 | gl->addWidget( l, 1, 0 ); | 243 | gl->addWidget( l, 1, 0 ); |
239 | txtAddress = new QLineEdit( container ); | 244 | txtAddress = new QLineEdit( container ); |
240 | gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 ); | 245 | gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 ); |
241 | 246 | ||
242 | l = new QLabel( tr( "City" ), container ); | 247 | l = new QLabel( tr( "City" ), container ); |
243 | gl->addWidget( l, 2, 0 ); | 248 | gl->addWidget( l, 2, 0 ); |
244 | txtCity = new QLineEdit( container ); | 249 | txtCity = new QLineEdit( container ); |
245 | gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 ); | 250 | gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 ); |
246 | 251 | ||
247 | l = new QLabel( tr( "State" ), container ); | 252 | l = new QLabel( tr( "State" ), container ); |
248 | gl->addWidget( l, 3, 0 ); | 253 | gl->addWidget( l, 3, 0 ); |
249 | txtState = new QLineEdit( container ); | 254 | txtState = new QLineEdit( container ); |
250 | gl->addMultiCellWidget( txtState, 3, 3, 1, 2 ); | 255 | gl->addMultiCellWidget( txtState, 3, 3, 1, 2 ); |
251 | 256 | ||
252 | l = new QLabel( tr( "Zip Code" ), container ); | 257 | l = new QLabel( tr( "Zip Code" ), container ); |
253 | gl->addWidget( l, 4, 0 ); | 258 | gl->addWidget( l, 4, 0 ); |
254 | txtZip = new QLineEdit( container ); | 259 | txtZip = new QLineEdit( container ); |
255 | gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 ); | 260 | gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 ); |
256 | 261 | ||
257 | l = new QLabel( tr( "Country" ), container ); | 262 | l = new QLabel( tr( "Country" ), container ); |
258 | gl->addWidget( l, 5, 0 ); | 263 | gl->addWidget( l, 5, 0 ); |
259 | cmbCountry = new QComboBox( TRUE, container ); | 264 | cmbCountry = new QComboBox( TRUE, container ); |
260 | cmbCountry->insertItem( tr( "" ) ); | 265 | cmbCountry->insertItem( tr( "" ) ); |
261 | cmbCountry->insertItem( tr ( "United States" ) ); | 266 | cmbCountry->insertItem( tr ( "United States" ) ); |
262 | cmbCountry->insertItem( tr ( "United Kingdom" ) ); | 267 | cmbCountry->insertItem( tr ( "United Kingdom" ) ); |
263 | cmbCountry->insertItem( tr ( "Afghanistan" ) ); | 268 | cmbCountry->insertItem( tr ( "Afghanistan" ) ); |
264 | cmbCountry->insertItem( tr ( "Albania" ) ); | 269 | cmbCountry->insertItem( tr ( "Albania" ) ); |
265 | cmbCountry->insertItem( tr ( "Algeria" ) ); | 270 | cmbCountry->insertItem( tr ( "Algeria" ) ); |
266 | cmbCountry->insertItem( tr ( "American Samoa" ) ); | 271 | cmbCountry->insertItem( tr ( "American Samoa" ) ); |
267 | cmbCountry->insertItem( tr ( "Andorra" ) ); | 272 | cmbCountry->insertItem( tr ( "Andorra" ) ); |
268 | cmbCountry->insertItem( tr ( "Angola" ) ); | 273 | cmbCountry->insertItem( tr ( "Angola" ) ); |
269 | cmbCountry->insertItem( tr ( "Anguilla" ) ); | 274 | cmbCountry->insertItem( tr ( "Anguilla" ) ); |
270 | cmbCountry->insertItem( tr ( "Antarctica" ) ); | 275 | cmbCountry->insertItem( tr ( "Antarctica" ) ); |
271 | cmbCountry->insertItem( tr ( "Argentina" ) ); | 276 | cmbCountry->insertItem( tr ( "Argentina" ) ); |
272 | cmbCountry->insertItem( tr ( "Armenia" ) ); | 277 | cmbCountry->insertItem( tr ( "Armenia" ) ); |
273 | cmbCountry->insertItem( tr ( "Aruba" ) ); | 278 | cmbCountry->insertItem( tr ( "Aruba" ) ); |
274 | cmbCountry->insertItem( tr ( "Australia" ) ); | 279 | cmbCountry->insertItem( tr ( "Australia" ) ); |
275 | cmbCountry->insertItem( tr ( "Austria" ) ); | 280 | cmbCountry->insertItem( tr ( "Austria" ) ); |
276 | cmbCountry->insertItem( tr ( "Azerbaijan" ) ); | 281 | cmbCountry->insertItem( tr ( "Azerbaijan" ) ); |
277 | cmbCountry->insertItem( tr ( "Bahamas" ) ); | 282 | cmbCountry->insertItem( tr ( "Bahamas" ) ); |
278 | cmbCountry->insertItem( tr ( "Bahrain" ) ); | 283 | cmbCountry->insertItem( tr ( "Bahrain" ) ); |
279 | cmbCountry->insertItem( tr ( "Bangladesh" ) ); | 284 | cmbCountry->insertItem( tr ( "Bangladesh" ) ); |
280 | cmbCountry->insertItem( tr ( "Barbados" ) ); | 285 | cmbCountry->insertItem( tr ( "Barbados" ) ); |
281 | cmbCountry->insertItem( tr ( "Belarus" ) ); | 286 | cmbCountry->insertItem( tr ( "Belarus" ) ); |
282 | cmbCountry->insertItem( tr ( "Belgium" ) ); | 287 | cmbCountry->insertItem( tr ( "Belgium" ) ); |
283 | cmbCountry->insertItem( tr ( "Belize" ) ); | 288 | cmbCountry->insertItem( tr ( "Belize" ) ); |
284 | cmbCountry->insertItem( tr ( "Benin" ) ); | 289 | cmbCountry->insertItem( tr ( "Benin" ) ); |
285 | cmbCountry->insertItem( tr ( "Bermuda" ) ); | 290 | cmbCountry->insertItem( tr ( "Bermuda" ) ); |
286 | cmbCountry->insertItem( tr ( "Bhutan" ) ); | 291 | cmbCountry->insertItem( tr ( "Bhutan" ) ); |
287 | cmbCountry->insertItem( tr ( "Bolivia" ) ); | 292 | cmbCountry->insertItem( tr ( "Bolivia" ) ); |
288 | cmbCountry->insertItem( tr ( "Botswana" ) ); | 293 | cmbCountry->insertItem( tr ( "Botswana" ) ); |
289 | cmbCountry->insertItem( tr ( "Bouvet Island" ) ); | 294 | cmbCountry->insertItem( tr ( "Bouvet Island" ) ); |
290 | cmbCountry->insertItem( tr ( "Brazil" ) ); | 295 | cmbCountry->insertItem( tr ( "Brazil" ) ); |
291 | cmbCountry->insertItem( tr ( "Brunei Darussalam" ) ); | 296 | cmbCountry->insertItem( tr ( "Brunei Darussalam" ) ); |
292 | cmbCountry->insertItem( tr ( "Bulgaria" ) ); | 297 | cmbCountry->insertItem( tr ( "Bulgaria" ) ); |
293 | cmbCountry->insertItem( tr ( "Burkina Faso" ) ); | 298 | cmbCountry->insertItem( tr ( "Burkina Faso" ) ); |
294 | cmbCountry->insertItem( tr ( "Burundi" ) ); | 299 | cmbCountry->insertItem( tr ( "Burundi" ) ); |
295 | cmbCountry->insertItem( tr ( "Cambodia" ) ); | 300 | cmbCountry->insertItem( tr ( "Cambodia" ) ); |
296 | cmbCountry->insertItem( tr ( "Cameroon" ) ); | 301 | cmbCountry->insertItem( tr ( "Cameroon" ) ); |
297 | cmbCountry->insertItem( tr ( "Canada" ) ); | 302 | cmbCountry->insertItem( tr ( "Canada" ) ); |
298 | cmbCountry->insertItem( tr ( "Cape Verde" ) ); | 303 | cmbCountry->insertItem( tr ( "Cape Verde" ) ); |
299 | cmbCountry->insertItem( tr ( "Cayman Islands" ) ); | 304 | cmbCountry->insertItem( tr ( "Cayman Islands" ) ); |
300 | cmbCountry->insertItem( tr ( "Chad" ) ); | 305 | cmbCountry->insertItem( tr ( "Chad" ) ); |
301 | cmbCountry->insertItem( tr ( "Chile" ) ); | 306 | cmbCountry->insertItem( tr ( "Chile" ) ); |
302 | cmbCountry->insertItem( tr ( "China" ) ); | 307 | cmbCountry->insertItem( tr ( "China" ) ); |
303 | cmbCountry->insertItem( tr ( "Christmas Island" ) ); | 308 | cmbCountry->insertItem( tr ( "Christmas Island" ) ); |
304 | cmbCountry->insertItem( tr ( "Colombia" ) ); | 309 | cmbCountry->insertItem( tr ( "Colombia" ) ); |
305 | cmbCountry->insertItem( tr ( "Comoros" ) ); | 310 | cmbCountry->insertItem( tr ( "Comoros" ) ); |
306 | cmbCountry->insertItem( tr ( "Congo" ) ); | 311 | cmbCountry->insertItem( tr ( "Congo" ) ); |
307 | cmbCountry->insertItem( tr ( "Cook Island" ) ); | 312 | cmbCountry->insertItem( tr ( "Cook Island" ) ); |
308 | cmbCountry->insertItem( tr ( "Costa Rica" ) ); | 313 | cmbCountry->insertItem( tr ( "Costa Rica" ) ); |
309 | cmbCountry->insertItem( tr ( "Cote d'Ivoire" ) ); | 314 | cmbCountry->insertItem( tr ( "Cote d'Ivoire" ) ); |
310 | cmbCountry->insertItem( tr ( "Croatia" ) ); | 315 | cmbCountry->insertItem( tr ( "Croatia" ) ); |
311 | cmbCountry->insertItem( tr ( "Cuba" ) ); | 316 | cmbCountry->insertItem( tr ( "Cuba" ) ); |
312 | cmbCountry->insertItem( tr ( "Cyprus" ) ); | 317 | cmbCountry->insertItem( tr ( "Cyprus" ) ); |
313 | cmbCountry->insertItem( tr ( "Czech Republic" ) ); | 318 | cmbCountry->insertItem( tr ( "Czech Republic" ) ); |
314 | cmbCountry->insertItem( tr ( "Denmark" ) ); | 319 | cmbCountry->insertItem( tr ( "Denmark" ) ); |
315 | cmbCountry->insertItem( tr ( "Djibouti" ) ); | 320 | cmbCountry->insertItem( tr ( "Djibouti" ) ); |
316 | cmbCountry->insertItem( tr ( "Dominica" ) ); | 321 | cmbCountry->insertItem( tr ( "Dominica" ) ); |
317 | cmbCountry->insertItem( tr ( "Dominican Republic" ) ); | 322 | cmbCountry->insertItem( tr ( "Dominican Republic" ) ); |
318 | cmbCountry->insertItem( tr ( "East Timor" ) ); | 323 | cmbCountry->insertItem( tr ( "East Timor" ) ); |
319 | cmbCountry->insertItem( tr ( "Ecuador" ) ); | 324 | cmbCountry->insertItem( tr ( "Ecuador" ) ); |
320 | cmbCountry->insertItem( tr ( "Egypt" ) ); | 325 | cmbCountry->insertItem( tr ( "Egypt" ) ); |
321 | cmbCountry->insertItem( tr ( "El Salvador" ) ); | 326 | cmbCountry->insertItem( tr ( "El Salvador" ) ); |
322 | cmbCountry->insertItem( tr ( "Equatorial Guinea" ) ); | 327 | cmbCountry->insertItem( tr ( "Equatorial Guinea" ) ); |
323 | cmbCountry->insertItem( tr ( "Eritrea" ) ); | 328 | cmbCountry->insertItem( tr ( "Eritrea" ) ); |
324 | cmbCountry->insertItem( tr ( "Estonia" ) ); | 329 | cmbCountry->insertItem( tr ( "Estonia" ) ); |
325 | cmbCountry->insertItem( tr ( "Ethiopia" ) ); | 330 | cmbCountry->insertItem( tr ( "Ethiopia" ) ); |
326 | cmbCountry->insertItem( tr ( "Falkland Islands" ) ); | 331 | cmbCountry->insertItem( tr ( "Falkland Islands" ) ); |
327 | cmbCountry->insertItem( tr ( "Faroe Islands" ) ); | 332 | cmbCountry->insertItem( tr ( "Faroe Islands" ) ); |
328 | cmbCountry->insertItem( tr ( "Fiji" ) ); | 333 | cmbCountry->insertItem( tr ( "Fiji" ) ); |
329 | cmbCountry->insertItem( tr ( "Finland" ) ); | 334 | cmbCountry->insertItem( tr ( "Finland" ) ); |
330 | cmbCountry->insertItem( tr ( "France" ) ); | 335 | cmbCountry->insertItem( tr ( "France" ) ); |
331 | cmbCountry->insertItem( tr ( "French Guiana" ) ); | 336 | cmbCountry->insertItem( tr ( "French Guiana" ) ); |
332 | cmbCountry->insertItem( tr ( "French Polynesia" ) ); | 337 | cmbCountry->insertItem( tr ( "French Polynesia" ) ); |
333 | cmbCountry->insertItem( tr ( "Gabon" ) ); | 338 | cmbCountry->insertItem( tr ( "Gabon" ) ); |
334 | cmbCountry->insertItem( tr ( "Gambia" ) ); | 339 | cmbCountry->insertItem( tr ( "Gambia" ) ); |
335 | cmbCountry->insertItem( tr ( "Georgia" ) ); | 340 | cmbCountry->insertItem( tr ( "Georgia" ) ); |
336 | cmbCountry->insertItem( tr ( "Germany" ) ); | 341 | cmbCountry->insertItem( tr ( "Germany" ) ); |
337 | cmbCountry->insertItem( tr ( "Ghana" ) ); | 342 | cmbCountry->insertItem( tr ( "Ghana" ) ); |
338 | cmbCountry->insertItem( tr ( "Gibraltar" ) ); | 343 | cmbCountry->insertItem( tr ( "Gibraltar" ) ); |
339 | cmbCountry->insertItem( tr ( "Greece" ) ); | 344 | cmbCountry->insertItem( tr ( "Greece" ) ); |
340 | cmbCountry->insertItem( tr ( "Greenland" ) ); | 345 | cmbCountry->insertItem( tr ( "Greenland" ) ); |
341 | cmbCountry->insertItem( tr ( "Grenada" ) ); | 346 | cmbCountry->insertItem( tr ( "Grenada" ) ); |
342 | cmbCountry->insertItem( tr ( "Guadeloupe" ) ); | 347 | cmbCountry->insertItem( tr ( "Guadeloupe" ) ); |
343 | cmbCountry->insertItem( tr ( "Guam" ) ); | 348 | cmbCountry->insertItem( tr ( "Guam" ) ); |
344 | cmbCountry->insertItem( tr ( "Guatemala" ) ); | 349 | cmbCountry->insertItem( tr ( "Guatemala" ) ); |
345 | cmbCountry->insertItem( tr ( "Guinea" ) ); | 350 | cmbCountry->insertItem( tr ( "Guinea" ) ); |
346 | cmbCountry->insertItem( tr ( "Guinea-Bissau" ) ); | 351 | cmbCountry->insertItem( tr ( "Guinea-Bissau" ) ); |
347 | cmbCountry->insertItem( tr ( "Guyana" ) ); | 352 | cmbCountry->insertItem( tr ( "Guyana" ) ); |
348 | cmbCountry->insertItem( tr ( "Haiti" ) ); | 353 | cmbCountry->insertItem( tr ( "Haiti" ) ); |
349 | cmbCountry->insertItem( tr ( "Holy See" ) ); | 354 | cmbCountry->insertItem( tr ( "Holy See" ) ); |
350 | cmbCountry->insertItem( tr ( "Honduras" ) ); | 355 | cmbCountry->insertItem( tr ( "Honduras" ) ); |
351 | cmbCountry->insertItem( tr ( "Hong Kong" ) ); | 356 | cmbCountry->insertItem( tr ( "Hong Kong" ) ); |
352 | cmbCountry->insertItem( tr ( "Hungary" ) ); | 357 | cmbCountry->insertItem( tr ( "Hungary" ) ); |
353 | cmbCountry->insertItem( tr ( "Iceland" ) ); | 358 | cmbCountry->insertItem( tr ( "Iceland" ) ); |
354 | cmbCountry->insertItem( tr ( "India" ) ); | 359 | cmbCountry->insertItem( tr ( "India" ) ); |
355 | cmbCountry->insertItem( tr ( "Indonesia" ) ); | 360 | cmbCountry->insertItem( tr ( "Indonesia" ) ); |
356 | cmbCountry->insertItem( tr ( "Ireland" ) ); | 361 | cmbCountry->insertItem( tr ( "Ireland" ) ); |
357 | cmbCountry->insertItem( tr ( "Israel" ) ); | 362 | cmbCountry->insertItem( tr ( "Israel" ) ); |
358 | cmbCountry->insertItem( tr ( "Italy" ) ); | 363 | cmbCountry->insertItem( tr ( "Italy" ) ); |
359 | cmbCountry->insertItem( tr ( "Jamaica" ) ); | 364 | cmbCountry->insertItem( tr ( "Jamaica" ) ); |
360 | cmbCountry->insertItem( tr ( "Japan" ) ); | 365 | cmbCountry->insertItem( tr ( "Japan" ) ); |
361 | cmbCountry->insertItem( tr ( "Jordan" ) ); | 366 | cmbCountry->insertItem( tr ( "Jordan" ) ); |
362 | cmbCountry->insertItem( tr ( "Kazakhstan" ) ); | 367 | cmbCountry->insertItem( tr ( "Kazakhstan" ) ); |
363 | cmbCountry->insertItem( tr ( "Kenya" ) ); | 368 | cmbCountry->insertItem( tr ( "Kenya" ) ); |
364 | cmbCountry->insertItem( tr ( "Kiribati" ) ); | 369 | cmbCountry->insertItem( tr ( "Kiribati" ) ); |
365 | cmbCountry->insertItem( tr ( "Korea" ) ); | 370 | cmbCountry->insertItem( tr ( "Korea" ) ); |
366 | cmbCountry->insertItem( tr ( "Kuwait" ) ); | 371 | cmbCountry->insertItem( tr ( "Kuwait" ) ); |
367 | cmbCountry->insertItem( tr ( "Kyrgyzstan" ) ); | 372 | cmbCountry->insertItem( tr ( "Kyrgyzstan" ) ); |
368 | cmbCountry->insertItem( tr ( "Laos" ) ); | 373 | cmbCountry->insertItem( tr ( "Laos" ) ); |
369 | cmbCountry->insertItem( tr ( "Latvia" ) ); | 374 | cmbCountry->insertItem( tr ( "Latvia" ) ); |
370 | cmbCountry->insertItem( tr ( "Lebanon" ) ); | 375 | cmbCountry->insertItem( tr ( "Lebanon" ) ); |
371 | cmbCountry->insertItem( tr ( "Lesotho" ) ); | 376 | cmbCountry->insertItem( tr ( "Lesotho" ) ); |
372 | cmbCountry->insertItem( tr ( "Liberia" ) ); | 377 | cmbCountry->insertItem( tr ( "Liberia" ) ); |
373 | cmbCountry->insertItem( tr ( "Liechtenstein" ) ); | 378 | cmbCountry->insertItem( tr ( "Liechtenstein" ) ); |
374 | cmbCountry->insertItem( tr ( "Lithuania" ) ); | 379 | cmbCountry->insertItem( tr ( "Lithuania" ) ); |
375 | cmbCountry->insertItem( tr ( "Luxembourg" ) ); | 380 | cmbCountry->insertItem( tr ( "Luxembourg" ) ); |
376 | cmbCountry->insertItem( tr ( "Macau" ) ); | 381 | cmbCountry->insertItem( tr ( "Macau" ) ); |
377 | cmbCountry->insertItem( tr ( "Macedonia" ) ); | 382 | cmbCountry->insertItem( tr ( "Macedonia" ) ); |
378 | cmbCountry->insertItem( tr ( "Madagascar" ) ); | 383 | cmbCountry->insertItem( tr ( "Madagascar" ) ); |
379 | cmbCountry->insertItem( tr ( "Malawi" ) ); | 384 | cmbCountry->insertItem( tr ( "Malawi" ) ); |
380 | cmbCountry->insertItem( tr ( "Malaysia" ) ); | 385 | cmbCountry->insertItem( tr ( "Malaysia" ) ); |
381 | cmbCountry->insertItem( tr ( "Maldives" ) ); | 386 | cmbCountry->insertItem( tr ( "Maldives" ) ); |
382 | cmbCountry->insertItem( tr ( "Mali" ) ); | 387 | cmbCountry->insertItem( tr ( "Mali" ) ); |
383 | cmbCountry->insertItem( tr ( "Malta" ) ); | 388 | cmbCountry->insertItem( tr ( "Malta" ) ); |
384 | cmbCountry->insertItem( tr ( "Martinique" ) ); | 389 | cmbCountry->insertItem( tr ( "Martinique" ) ); |
385 | cmbCountry->insertItem( tr ( "Mauritania" ) ); | 390 | cmbCountry->insertItem( tr ( "Mauritania" ) ); |
386 | cmbCountry->insertItem( tr ( "Mauritius" ) ); | 391 | cmbCountry->insertItem( tr ( "Mauritius" ) ); |
387 | cmbCountry->insertItem( tr ( "Mayotte" ) ); | 392 | cmbCountry->insertItem( tr ( "Mayotte" ) ); |
388 | cmbCountry->insertItem( tr ( "Mexico" ) ); | 393 | cmbCountry->insertItem( tr ( "Mexico" ) ); |
389 | cmbCountry->insertItem( tr ( "Micronesia" ) ); | 394 | cmbCountry->insertItem( tr ( "Micronesia" ) ); |
390 | cmbCountry->insertItem( tr ( "Moldova" ) ); | 395 | cmbCountry->insertItem( tr ( "Moldova" ) ); |
391 | cmbCountry->insertItem( tr ( "Monaco" ) ); | 396 | cmbCountry->insertItem( tr ( "Monaco" ) ); |
392 | cmbCountry->insertItem( tr ( "Mongolia" ) ); | 397 | cmbCountry->insertItem( tr ( "Mongolia" ) ); |
393 | cmbCountry->insertItem( tr ( "Montserrat" ) ); | 398 | cmbCountry->insertItem( tr ( "Montserrat" ) ); |
394 | cmbCountry->insertItem( tr ( "Morocco" ) ); | 399 | cmbCountry->insertItem( tr ( "Morocco" ) ); |
395 | cmbCountry->insertItem( tr ( "Mozambique" ) ); | 400 | cmbCountry->insertItem( tr ( "Mozambique" ) ); |
396 | cmbCountry->insertItem( tr ( "Myanmar" ) ); | 401 | cmbCountry->insertItem( tr ( "Myanmar" ) ); |
397 | cmbCountry->insertItem( tr ( "Namibia" ) ); | 402 | cmbCountry->insertItem( tr ( "Namibia" ) ); |
398 | cmbCountry->insertItem( tr ( "Nauru" ) ); | 403 | cmbCountry->insertItem( tr ( "Nauru" ) ); |
399 | cmbCountry->insertItem( tr ( "Nepal" ) ); | 404 | cmbCountry->insertItem( tr ( "Nepal" ) ); |
400 | cmbCountry->insertItem( tr ( "Netherlands" ) ); | 405 | cmbCountry->insertItem( tr ( "Netherlands" ) ); |
401 | cmbCountry->insertItem( tr ( "New Caledonia" ) ); | 406 | cmbCountry->insertItem( tr ( "New Caledonia" ) ); |
402 | cmbCountry->insertItem( tr ( "New Zealand" ) ); | 407 | cmbCountry->insertItem( tr ( "New Zealand" ) ); |
403 | cmbCountry->insertItem( tr ( "Nicaragua" ) ); | 408 | cmbCountry->insertItem( tr ( "Nicaragua" ) ); |
404 | cmbCountry->insertItem( tr ( "Niger" ) ); | 409 | cmbCountry->insertItem( tr ( "Niger" ) ); |
405 | cmbCountry->insertItem( tr ( "Nigeria" ) ); | 410 | cmbCountry->insertItem( tr ( "Nigeria" ) ); |
406 | cmbCountry->insertItem( tr ( "Niue" ) ); | 411 | cmbCountry->insertItem( tr ( "Niue" ) ); |
407 | cmbCountry->insertItem( tr ( "Norway" ) ); | 412 | cmbCountry->insertItem( tr ( "Norway" ) ); |
408 | cmbCountry->insertItem( tr ( "Oman" ) ); | 413 | cmbCountry->insertItem( tr ( "Oman" ) ); |
409 | cmbCountry->insertItem( tr ( "Pakistan" ) ); | 414 | cmbCountry->insertItem( tr ( "Pakistan" ) ); |
410 | cmbCountry->insertItem( tr ( "Palau" ) ); | 415 | cmbCountry->insertItem( tr ( "Palau" ) ); |
411 | cmbCountry->insertItem( tr ( "Palestinian Sovereign Areas" ) ); | 416 | cmbCountry->insertItem( tr ( "Palestinian Sovereign Areas" ) ); |
412 | cmbCountry->insertItem( tr ( "Panama" ) ); | 417 | cmbCountry->insertItem( tr ( "Panama" ) ); |
413 | cmbCountry->insertItem( tr ( "Papua New Guinea" ) ); | 418 | cmbCountry->insertItem( tr ( "Papua New Guinea" ) ); |
414 | cmbCountry->insertItem( tr ( "Paraguay" ) ); | 419 | cmbCountry->insertItem( tr ( "Paraguay" ) ); |
415 | cmbCountry->insertItem( tr ( "Peru" ) ); | 420 | cmbCountry->insertItem( tr ( "Peru" ) ); |
416 | cmbCountry->insertItem( tr ( "Philippines" ) ); | 421 | cmbCountry->insertItem( tr ( "Philippines" ) ); |
417 | cmbCountry->insertItem( tr ( "Pitcairn Islands" ) ); | 422 | cmbCountry->insertItem( tr ( "Pitcairn Islands" ) ); |
418 | cmbCountry->insertItem( tr ( "Poland" ) ); | 423 | cmbCountry->insertItem( tr ( "Poland" ) ); |
419 | cmbCountry->insertItem( tr ( "Portugal" ) ); | 424 | cmbCountry->insertItem( tr ( "Portugal" ) ); |
420 | cmbCountry->insertItem( tr ( "Puerto Rico" ) ); | 425 | cmbCountry->insertItem( tr ( "Puerto Rico" ) ); |
421 | cmbCountry->insertItem( tr ( "Qatar" ) ); | 426 | cmbCountry->insertItem( tr ( "Qatar" ) ); |
422 | cmbCountry->insertItem( tr ( "Reunion" ) ); | 427 | cmbCountry->insertItem( tr ( "Reunion" ) ); |
423 | cmbCountry->insertItem( tr ( "Romania" ) ); | 428 | cmbCountry->insertItem( tr ( "Romania" ) ); |
424 | cmbCountry->insertItem( tr ( "Russia" ) ); | 429 | cmbCountry->insertItem( tr ( "Russia" ) ); |
425 | cmbCountry->insertItem( tr ( "Rwanda" ) ); | 430 | cmbCountry->insertItem( tr ( "Rwanda" ) ); |
426 | cmbCountry->insertItem( tr ( "Saint Lucia" ) ); | 431 | cmbCountry->insertItem( tr ( "Saint Lucia" ) ); |
427 | cmbCountry->insertItem( tr ( "Samoa" ) ); | 432 | cmbCountry->insertItem( tr ( "Samoa" ) ); |
428 | cmbCountry->insertItem( tr ( "San Marino" ) ); | 433 | cmbCountry->insertItem( tr ( "San Marino" ) ); |
429 | cmbCountry->insertItem( tr ( "Saudi Arabia" ) ); | 434 | cmbCountry->insertItem( tr ( "Saudi Arabia" ) ); |
430 | cmbCountry->insertItem( tr ( "Senegal" ) ); | 435 | cmbCountry->insertItem( tr ( "Senegal" ) ); |
431 | cmbCountry->insertItem( tr ( "Seychelles" ) ); | 436 | cmbCountry->insertItem( tr ( "Seychelles" ) ); |
432 | cmbCountry->insertItem( tr ( "Sierra Leone" ) ); | 437 | cmbCountry->insertItem( tr ( "Sierra Leone" ) ); |
433 | cmbCountry->insertItem( tr ( "Singapore" ) ); | 438 | cmbCountry->insertItem( tr ( "Singapore" ) ); |
434 | cmbCountry->insertItem( tr ( "Slovakia" ) ); | 439 | cmbCountry->insertItem( tr ( "Slovakia" ) ); |
435 | cmbCountry->insertItem( tr ( "Slovenia" ) ); | 440 | cmbCountry->insertItem( tr ( "Slovenia" ) ); |
436 | cmbCountry->insertItem( tr ( "Solomon Islands" ) ); | 441 | cmbCountry->insertItem( tr ( "Solomon Islands" ) ); |
437 | cmbCountry->insertItem( tr ( "Somalia" ) ); | 442 | cmbCountry->insertItem( tr ( "Somalia" ) ); |
438 | cmbCountry->insertItem( tr ( "South Africa" ) ); | 443 | cmbCountry->insertItem( tr ( "South Africa" ) ); |
439 | cmbCountry->insertItem( tr ( "Spain" ) ); | 444 | cmbCountry->insertItem( tr ( "Spain" ) ); |
440 | cmbCountry->insertItem( tr ( "Sri Lanka" ) ); | 445 | cmbCountry->insertItem( tr ( "Sri Lanka" ) ); |
441 | cmbCountry->insertItem( tr ( "St. Helena" ) ); | 446 | cmbCountry->insertItem( tr ( "St. Helena" ) ); |
442 | cmbCountry->insertItem( tr ( "Sudan" ) ); | 447 | cmbCountry->insertItem( tr ( "Sudan" ) ); |
443 | cmbCountry->insertItem( tr ( "Suriname" ) ); | 448 | cmbCountry->insertItem( tr ( "Suriname" ) ); |
444 | cmbCountry->insertItem( tr ( "Swaziland" ) ); | 449 | cmbCountry->insertItem( tr ( "Swaziland" ) ); |
445 | cmbCountry->insertItem( tr ( "Sweden" ) ); | 450 | cmbCountry->insertItem( tr ( "Sweden" ) ); |
446 | cmbCountry->insertItem( tr ( "Switzerland" ) ); | 451 | cmbCountry->insertItem( tr ( "Switzerland" ) ); |
447 | cmbCountry->insertItem( tr ( "Taiwan" ) ); | 452 | cmbCountry->insertItem( tr ( "Taiwan" ) ); |
448 | cmbCountry->insertItem( tr ( "Tajikistan" ) ); | 453 | cmbCountry->insertItem( tr ( "Tajikistan" ) ); |
449 | cmbCountry->insertItem( tr ( "Tanzania" ) ); | 454 | cmbCountry->insertItem( tr ( "Tanzania" ) ); |
450 | cmbCountry->insertItem( tr ( "Thailand" ) ); | 455 | cmbCountry->insertItem( tr ( "Thailand" ) ); |
451 | cmbCountry->insertItem( tr ( "Togo" ) ); | 456 | cmbCountry->insertItem( tr ( "Togo" ) ); |
452 | cmbCountry->insertItem( tr ( "Tokelau" ) ); | 457 | cmbCountry->insertItem( tr ( "Tokelau" ) ); |
453 | cmbCountry->insertItem( tr ( "Tonga" ) ); | 458 | cmbCountry->insertItem( tr ( "Tonga" ) ); |
454 | cmbCountry->insertItem( tr ( "Tunisia" ) ); | 459 | cmbCountry->insertItem( tr ( "Tunisia" ) ); |
455 | cmbCountry->insertItem( tr ( "Turkey" ) ); | 460 | cmbCountry->insertItem( tr ( "Turkey" ) ); |
456 | cmbCountry->insertItem( tr ( "Turkmenistan" ) ); | 461 | cmbCountry->insertItem( tr ( "Turkmenistan" ) ); |
457 | cmbCountry->insertItem( tr ( "Tuvalu" ) ); | 462 | cmbCountry->insertItem( tr ( "Tuvalu" ) ); |
458 | cmbCountry->insertItem( tr ( "Uganda" ) ); | 463 | cmbCountry->insertItem( tr ( "Uganda" ) ); |
459 | cmbCountry->insertItem( tr ( "Ukraine" ) ); | 464 | cmbCountry->insertItem( tr ( "Ukraine" ) ); |
460 | cmbCountry->insertItem( tr ( "Uruguay" ) ); | 465 | cmbCountry->insertItem( tr ( "Uruguay" ) ); |
461 | cmbCountry->insertItem( tr ( "Uzbekistan" ) ); | 466 | cmbCountry->insertItem( tr ( "Uzbekistan" ) ); |
462 | cmbCountry->insertItem( tr ( "Vanuatu" ) ); | 467 | cmbCountry->insertItem( tr ( "Vanuatu" ) ); |
463 | cmbCountry->insertItem( tr ( "Venezuela" ) ); | 468 | cmbCountry->insertItem( tr ( "Venezuela" ) ); |
464 | cmbCountry->insertItem( tr ( "Vietnam" ) ); | 469 | cmbCountry->insertItem( tr ( "Vietnam" ) ); |
465 | cmbCountry->insertItem( tr ( "Virgin Islands" ) ); | 470 | cmbCountry->insertItem( tr ( "Virgin Islands" ) ); |
466 | cmbCountry->insertItem( tr ( "Western Sahara" ) ); | 471 | cmbCountry->insertItem( tr ( "Western Sahara" ) ); |
467 | cmbCountry->insertItem( tr ( "Yemen" ) ); | 472 | cmbCountry->insertItem( tr ( "Yemen" ) ); |
468 | cmbCountry->insertItem( tr ( "Yugoslavia" ) ); | 473 | cmbCountry->insertItem( tr ( "Yugoslavia" ) ); |
469 | cmbCountry->insertItem( tr ( "Zambia" ) ); | 474 | cmbCountry->insertItem( tr ( "Zambia" ) ); |
470 | cmbCountry->insertItem( tr ( "Zimbabwe" ) ); | 475 | cmbCountry->insertItem( tr ( "Zimbabwe" ) ); |
471 | if (cmbCountry->listBox()!=0) | 476 | if (cmbCountry->listBox()!=0) |
472 | cmbCountry->listBox()->sort(); | 477 | cmbCountry->listBox()->sort(); |
473 | 478 | ||
474 | cmbCountry->setMaximumWidth( 135 ); | 479 | cmbCountry->setMaximumWidth( 135 ); |
475 | 480 | ||
476 | gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); | 481 | gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); |
477 | 482 | ||
478 | // Chooser 4 | 483 | // Chooser 4 |
479 | cmbChooserField4 = new QComboBox( FALSE, container ); | 484 | cmbChooserField4 = new QComboBox( FALSE, container ); |
480 | cmbChooserField4->setMaximumWidth( 90 ); | 485 | cmbChooserField4->setMaximumWidth( 90 ); |
481 | gl->addWidget( cmbChooserField4, 6, 0 ); | 486 | gl->addWidget( cmbChooserField4, 6, 0 ); |
482 | // Textfield for chooser 2 | 487 | // Textfield for chooser 2 |
483 | // Now use WidgetStack to contain the textfield and the default-email combo! | 488 | // Now use WidgetStack to contain the textfield and the default-email combo! |
484 | m_widgetStack4 = new QWidgetStack( container ); | 489 | m_widgetStack4 = new QWidgetStack( container ); |
485 | txtChooserField4 = new QLineEdit( m_widgetStack4 ); | 490 | txtChooserField4 = new QLineEdit( m_widgetStack4 ); |
486 | m_widgetStack4 -> addWidget( txtChooserField4, TextField ); | 491 | m_widgetStack4 -> addWidget( txtChooserField4, TextField ); |
487 | gl->addMultiCellWidget( m_widgetStack4, 6, 6, 1, 2 ); | 492 | gl->addMultiCellWidget( m_widgetStack4, 6, 6, 1, 2 ); |
488 | m_widgetStack4 -> raiseWidget( TextField ); | 493 | m_widgetStack4 -> raiseWidget( TextField ); |
489 | 494 | ||
490 | QSpacerItem *space = new QSpacerItem(1,1, | 495 | QSpacerItem *space = new QSpacerItem(1,1, |
491 | QSizePolicy::Maximum, | 496 | QSizePolicy::Maximum, |
492 | QSizePolicy::MinimumExpanding ); | 497 | QSizePolicy::MinimumExpanding ); |
493 | gl->addItem( space, 7, 0 ); | 498 | gl->addItem( space, 7, 0 ); |
494 | 499 | ||
495 | tabMain->insertTab( tabViewport, tr( "Address" ) ); | 500 | tabMain->insertTab( tabViewport, tr( "Address" ) ); |
496 | 501 | ||
497 | tabViewport = new QWidget ( tabMain ); | 502 | tabViewport = new QWidget ( tabMain ); |
498 | 503 | ||
499 | vb = new QVBoxLayout( tabViewport ); | 504 | vb = new QVBoxLayout( tabViewport ); |
500 | 505 | ||
501 | svDetails = new QScrollView( tabViewport ); | 506 | svDetails = new QScrollView( tabViewport ); |
502 | vb->addWidget( svDetails, 0, 0 ); | 507 | vb->addWidget( svDetails, 0, 0 ); |
503 | svDetails->setResizePolicy( QScrollView::AutoOneFit ); | 508 | svDetails->setResizePolicy( QScrollView::AutoOneFit ); |
504 | svDetails->setFrameStyle( QFrame::NoFrame ); | 509 | svDetails->setFrameStyle( QFrame::NoFrame ); |
505 | 510 | ||
506 | container = new QWidget( svDetails->viewport() ); | 511 | container = new QWidget( svDetails->viewport() ); |
507 | svDetails->addChild( container ); | 512 | svDetails->addChild( container ); |
508 | 513 | ||
509 | gl = new QGridLayout( container, 1, 2, 2, 4 ); | 514 | gl = new QGridLayout( container, 1, 2, 2, 4 ); |
510 | 515 | ||
511 | int counter = 0; | 516 | int counter = 0; |
512 | 517 | ||
513 | // Birthday | 518 | // Birthday |
514 | QHBox* hBox = new QHBox( container ); | 519 | QHBox* hBox = new QHBox( container ); |
515 | l = new QLabel( tr("Birthday"), container ); | 520 | l = new QLabel( tr("Birthday"), container ); |
516 | gl->addWidget( l, counter, 0 ); | 521 | gl->addWidget( l, counter, 0 ); |
517 | 522 | ||
518 | QPopupMenu* m1 = new QPopupMenu( container ); | 523 | QPopupMenu* m1 = new QPopupMenu( container ); |
519 | birthdayPicker = new DateBookMonth( m1, 0, TRUE ); | 524 | birthdayPicker = new DateBookMonth( m1, 0, TRUE ); |
520 | m1->insertItem( birthdayPicker ); | 525 | m1->insertItem( birthdayPicker ); |
521 | 526 | ||
522 | birthdayButton= new QToolButton( hBox, "buttonStart" ); | 527 | birthdayButton= new QToolButton( hBox, "buttonStart" ); |
523 | birthdayButton->setPopup( m1 ); | 528 | birthdayButton->setPopup( m1 ); |
524 | birthdayButton->setPopupDelay(0); | 529 | birthdayButton->setPopupDelay(0); |
525 | 530 | ||
526 | QPushButton* deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), | 531 | QPushButton* deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), |
527 | tr( "Delete" ), | 532 | tr( "Delete" ), |
528 | hBox, 0 ); | 533 | hBox, 0 ); |
529 | 534 | ||
530 | gl->addWidget( hBox, counter , 1 ); | 535 | gl->addWidget( hBox, counter , 1 ); |
531 | 536 | ||
532 | connect( birthdayPicker, SIGNAL( dateClicked( int, int, int ) ), | 537 | connect( birthdayPicker, SIGNAL( dateClicked( int, int, int ) ), |
533 | this, SLOT( slotBirthdayDateChanged( int, int, int ) ) ); | 538 | this, SLOT( slotBirthdayDateChanged( int, int, int ) ) ); |
534 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveBirthday() ) ); | 539 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveBirthday() ) ); |
535 | 540 | ||
536 | ++counter; | 541 | ++counter; |
537 | 542 | ||
538 | // Anniversary | 543 | // Anniversary |
539 | hBox = new QHBox( container ); | 544 | hBox = new QHBox( container ); |
540 | l = new QLabel( tr("Anniversary"), container ); | 545 | l = new QLabel( tr("Anniversary"), container ); |
541 | gl->addWidget( l, counter, 0 ); | 546 | gl->addWidget( l, counter, 0 ); |
542 | 547 | ||
543 | m1 = new QPopupMenu( container ); | 548 | m1 = new QPopupMenu( container ); |
544 | anniversaryPicker = new DateBookMonth( m1, 0, TRUE ); | 549 | anniversaryPicker = new DateBookMonth( m1, 0, TRUE ); |
545 | m1->insertItem( anniversaryPicker ); | 550 | m1->insertItem( anniversaryPicker ); |
546 | 551 | ||
547 | anniversaryButton= new QToolButton( hBox, "buttonStart" ); | 552 | anniversaryButton= new QToolButton( hBox, "buttonStart" ); |
548 | anniversaryButton->setPopup( m1 ); | 553 | anniversaryButton->setPopup( m1 ); |
549 | anniversaryButton->setPopupDelay(0); | 554 | anniversaryButton->setPopupDelay(0); |
550 | 555 | ||
551 | deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), | 556 | deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), |
552 | tr( "Delete" ), | 557 | tr( "Delete" ), |
553 | hBox, 0 ); | 558 | hBox, 0 ); |
554 | gl->addWidget( hBox, counter , 1 ); | 559 | gl->addWidget( hBox, counter , 1 ); |
555 | 560 | ||
556 | connect( anniversaryPicker, SIGNAL( dateClicked( int, int, int ) ), | 561 | connect( anniversaryPicker, SIGNAL( dateClicked( int, int, int ) ), |
557 | this, SLOT( slotAnniversaryDateChanged( int, int, int ) ) ); | 562 | this, SLOT( slotAnniversaryDateChanged( int, int, int ) ) ); |
558 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveAnniversary() ) ); | 563 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveAnniversary() ) ); |
559 | 564 | ||
560 | ++counter; | 565 | ++counter; |
561 | 566 | ||
562 | // Gender | 567 | // Gender |
563 | l = new QLabel( tr("Gender"), container ); | 568 | l = new QLabel( tr("Gender"), container ); |
564 | gl->addWidget( l, counter, 0 ); | 569 | gl->addWidget( l, counter, 0 ); |
565 | cmbGender = new QComboBox( container ); | 570 | cmbGender = new QComboBox( container ); |
566 | cmbGender->insertItem( "", 0 ); | 571 | cmbGender->insertItem( "", 0 ); |
567 | cmbGender->insertItem( tr("Male"), 1); | 572 | cmbGender->insertItem( tr("Male"), 1); |
568 | cmbGender->insertItem( tr("Female"), 2); | 573 | cmbGender->insertItem( tr("Female"), 2); |
569 | gl->addWidget( cmbGender, counter, 1 ); | 574 | gl->addWidget( cmbGender, counter, 1 ); |
570 | 575 | ||
571 | ++counter; | 576 | ++counter; |
572 | 577 | ||
573 | // Create Labels and lineedit fields for every dynamic entry | 578 | // Create Labels and lineedit fields for every dynamic entry |
574 | QStringList::ConstIterator it = slDynamicEntries.begin(); | 579 | QStringList::ConstIterator it = slDynamicEntries.begin(); |
575 | QMap<QString, int> mapStrToID = OContactFields::untrFieldsToId(); | 580 | QMap<QString, int> mapStrToID = OContactFields::untrFieldsToId(); |
576 | QMap<int, QString> mapIdToStr = OContactFields::idToTrFields(); | 581 | QMap<int, QString> mapIdToStr = OContactFields::idToTrFields(); |
577 | for (i = counter; it != slDynamicEntries.end(); i++, ++it ) { | 582 | for (i = counter; it != slDynamicEntries.end(); i++, ++it ) { |
578 | 583 | ||
579 | if (((*it) == "Anniversary") || | 584 | if (((*it) == "Anniversary") || |
580 | ((*it) == "Birthday")|| ((*it) == "Gender")) continue; | 585 | ((*it) == "Birthday")|| ((*it) == "Gender")) continue; |
581 | 586 | ||
582 | l = new QLabel( mapIdToStr[mapStrToID[*it]].utf8() , container ); | 587 | l = new QLabel( mapIdToStr[mapStrToID[*it]].utf8() , container ); |
583 | listName.append( l ); | 588 | listName.append( l ); |
584 | gl->addWidget( l, i, 0 ); | 589 | gl->addWidget( l, i, 0 ); |
585 | QLineEdit *e = new QLineEdit( container ); | 590 | QLineEdit *e = new QLineEdit( container ); |
586 | listValue.append( e ); | 591 | listValue.append( e ); |
587 | gl->addWidget( e, i, 1); | 592 | gl->addWidget( e, i, 1); |
588 | } | 593 | } |
589 | // Fill labels with names.. | 594 | // Fill labels with names.. |
590 | //loadFields(); | 595 | //loadFields(); |
591 | 596 | ||
592 | 597 | ||
593 | tabMain->insertTab( tabViewport, tr( "Details" ) ); | 598 | tabMain->insertTab( tabViewport, tr( "Details" ) ); |
594 | 599 | ||
595 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); | 600 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); |
596 | dlgNote->setCaption( tr("Enter Note") ); | 601 | dlgNote->setCaption( tr("Enter Note") ); |
597 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); | 602 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); |
598 | txtNote = new QMultiLineEdit( dlgNote ); | 603 | txtNote = new QMultiLineEdit( dlgNote ); |
599 | vbNote->addWidget( txtNote ); | 604 | vbNote->addWidget( txtNote ); |
600 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); | 605 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); |
601 | 606 | ||
602 | dlgName = new QDialog( this, "Name Dialog", TRUE ); | 607 | dlgName = new QDialog( this, "Name Dialog", TRUE ); |
603 | dlgName->setCaption( tr("Edit Name") ); | 608 | dlgName->setCaption( tr("Edit Name") ); |
604 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); | 609 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); |
605 | 610 | ||
606 | l = new QLabel( tr("First Name"), dlgName ); | 611 | l = new QLabel( tr("First Name"), dlgName ); |
607 | gl->addWidget( l, 0, 0 ); | 612 | gl->addWidget( l, 0, 0 ); |
608 | txtFirstName = new QLineEdit( dlgName ); | 613 | txtFirstName = new QLineEdit( dlgName ); |
609 | gl->addWidget( txtFirstName, 0, 1 ); | 614 | gl->addWidget( txtFirstName, 0, 1 ); |
610 | 615 | ||
611 | l = new QLabel( tr("Middle Name"), dlgName ); | 616 | l = new QLabel( tr("Middle Name"), dlgName ); |
612 | gl->addWidget( l, 1, 0 ); | 617 | gl->addWidget( l, 1, 0 ); |
613 | txtMiddleName = new QLineEdit( dlgName ); | 618 | txtMiddleName = new QLineEdit( dlgName ); |
614 | gl->addWidget( txtMiddleName, 1, 1 ); | 619 | gl->addWidget( txtMiddleName, 1, 1 ); |
615 | 620 | ||
616 | l = new QLabel( tr("Last Name"), dlgName ); | 621 | l = new QLabel( tr("Last Name"), dlgName ); |
617 | gl->addWidget( l, 2, 0 ); | 622 | gl->addWidget( l, 2, 0 ); |
618 | txtLastName = new QLineEdit( dlgName ); | 623 | txtLastName = new QLineEdit( dlgName ); |
619 | gl->addWidget( txtLastName, 2, 1 ); | 624 | gl->addWidget( txtLastName, 2, 1 ); |
620 | 625 | ||
621 | l = new QLabel( tr("Suffix"), dlgName ); | 626 | // l = new QLabel( tr("Suffix"), dlgName ); |
622 | gl->addWidget( l, 3, 0 ); | 627 | // gl->addWidget( l, 3, 0 ); |
623 | txtSuffix = new QLineEdit( dlgName ); | 628 | // txtSuffix = new QLineEdit( dlgName ); |
624 | gl->addWidget( txtSuffix, 3, 1 ); | 629 | // gl->addWidget( txtSuffix, 3, 1 ); |
625 | space = new QSpacerItem(1,1, | 630 | space = new QSpacerItem(1,1, |
626 | QSizePolicy::Maximum, | 631 | QSizePolicy::Maximum, |
627 | QSizePolicy::MinimumExpanding ); | 632 | QSizePolicy::MinimumExpanding ); |
628 | gl->addItem( space, 4, 0 ); | 633 | gl->addItem( space, 4, 0 ); |
629 | 634 | ||
630 | cmbChooserField1->insertStringList( trlChooserNames ); | 635 | cmbChooserField1->insertStringList( trlChooserNames ); |
631 | cmbChooserField2->insertStringList( trlChooserNames ); | 636 | cmbChooserField2->insertStringList( trlChooserNames ); |
632 | cmbChooserField3->insertStringList( trlChooserNames ); | 637 | cmbChooserField3->insertStringList( trlChooserNames ); |
633 | cmbChooserField4->insertStringList( trlChooserNames ); | 638 | cmbChooserField4->insertStringList( trlChooserNames ); |
634 | 639 | ||
635 | cmbChooserField1->setCurrentItem( 0 ); | 640 | cmbChooserField1->setCurrentItem( 0 ); |
636 | cmbChooserField2->setCurrentItem( 1 ); | 641 | cmbChooserField2->setCurrentItem( 1 ); |
637 | cmbChooserField3->setCurrentItem( 2 ); | 642 | cmbChooserField3->setCurrentItem( 2 ); |
638 | 643 | ||
639 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); | 644 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); |
640 | 645 | ||
641 | connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); | 646 | connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); |
642 | 647 | ||
643 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), | 648 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), |
644 | this, SLOT(slotChooser1Change(const QString &)) ); | 649 | this, SLOT(slotChooser1Change(const QString &)) ); |
645 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), | 650 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), |
646 | this, SLOT(slotChooser2Change(const QString &)) ); | 651 | this, SLOT(slotChooser2Change(const QString &)) ); |
647 | connect( txtChooserField3, SIGNAL(textChanged(const QString &)), | 652 | connect( txtChooserField3, SIGNAL(textChanged(const QString &)), |
648 | this, SLOT(slotChooser3Change(const QString &)) ); | 653 | this, SLOT(slotChooser3Change(const QString &)) ); |
649 | connect( txtChooserField4, SIGNAL(textChanged(const QString &)), | 654 | connect( txtChooserField4, SIGNAL(textChanged(const QString &)), |
650 | this, SLOT(slotChooser4Change(const QString &)) ); | 655 | this, SLOT(slotChooser4Change(const QString &)) ); |
651 | connect( txtAddress, SIGNAL(textChanged(const QString &)), | 656 | connect( txtAddress, SIGNAL(textChanged(const QString &)), |
652 | this, SLOT(slotAddressChange(const QString &)) ); | 657 | this, SLOT(slotAddressChange(const QString &)) ); |
653 | connect( txtCity, SIGNAL(textChanged(const QString &)), | 658 | connect( txtCity, SIGNAL(textChanged(const QString &)), |
654 | this, SLOT(slotCityChange(const QString &)) ); | 659 | this, SLOT(slotCityChange(const QString &)) ); |
655 | connect( txtState, SIGNAL(textChanged(const QString &)), | 660 | connect( txtState, SIGNAL(textChanged(const QString &)), |
656 | this, SLOT(slotStateChange(const QString &)) ); | 661 | this, SLOT(slotStateChange(const QString &)) ); |
657 | connect( txtZip, SIGNAL(textChanged(const QString &)), | 662 | connect( txtZip, SIGNAL(textChanged(const QString &)), |
658 | this, SLOT(slotZipChange(const QString &)) ); | 663 | this, SLOT(slotZipChange(const QString &)) ); |
659 | connect( cmbCountry, SIGNAL(textChanged(const QString &)), | 664 | connect( cmbCountry, SIGNAL(textChanged(const QString &)), |
660 | this, SLOT(slotCountryChange(const QString &)) ); | 665 | this, SLOT(slotCountryChange(const QString &)) ); |
661 | connect( cmbCountry, SIGNAL(activated(const QString &)), | 666 | connect( cmbCountry, SIGNAL(activated(const QString &)), |
662 | this, SLOT(slotCountryChange(const QString &)) ); | 667 | this, SLOT(slotCountryChange(const QString &)) ); |
663 | connect( cmbChooserField1, SIGNAL(activated(int)), | 668 | connect( cmbChooserField1, SIGNAL(activated(int)), |
664 | this, SLOT(slotCmbChooser1Change(int)) ); | 669 | this, SLOT(slotCmbChooser1Change(int)) ); |
665 | connect( cmbChooserField2, SIGNAL(activated(int)), | 670 | connect( cmbChooserField2, SIGNAL(activated(int)), |
666 | this, SLOT(slotCmbChooser2Change(int)) ); | 671 | this, SLOT(slotCmbChooser2Change(int)) ); |
667 | connect( cmbChooserField3, SIGNAL(activated(int)), | 672 | connect( cmbChooserField3, SIGNAL(activated(int)), |
668 | this, SLOT(slotCmbChooser3Change(int)) ); | 673 | this, SLOT(slotCmbChooser3Change(int)) ); |
669 | connect( cmbChooserField4, SIGNAL(activated(int)), | 674 | connect( cmbChooserField4, SIGNAL(activated(int)), |
670 | this, SLOT(slotCmbChooser4Change(int)) ); | 675 | this, SLOT(slotCmbChooser4Change(int)) ); |
671 | connect( cmbAddress, SIGNAL(activated(int)), | 676 | connect( cmbAddress, SIGNAL(activated(int)), |
672 | this, SLOT(slotAddressTypeChange(int)) ); | 677 | this, SLOT(slotAddressTypeChange(int)) ); |
673 | 678 | ||
674 | new QPEDialogListener(this); | 679 | new QPEDialogListener(this); |
675 | 680 | ||
676 | setPersonalView ( m_personalView ); | 681 | setPersonalView ( m_personalView ); |
677 | 682 | ||
678 | qWarning("init() END"); | 683 | qWarning("init() END"); |
679 | } | 684 | } |
680 | 685 | ||
681 | void ContactEditor::defaultEmailChanged(int i){ | 686 | void ContactEditor::defaultEmailChanged(int i){ |
682 | qDebug("defaultEmailChanged"); | 687 | qDebug("defaultEmailChanged"); |
683 | 688 | ||
684 | // was sollte das ? (se) | 689 | // was sollte das ? (se) |
685 | // int index = cmbChooserField1->currentItem(); | 690 | // int index = cmbChooserField1->currentItem(); |
686 | // slChooserValues[index] = cmbDefaultEmail->text(i); | 691 | // slChooserValues[index] = cmbDefaultEmail->text(i); |
687 | 692 | ||
688 | defaultEmail = cmbDefaultEmail->text(i); | 693 | defaultEmail = cmbDefaultEmail->text(i); |
689 | qDebug ("Changed to: %s", defaultEmail.latin1()); | 694 | qDebug ("Changed to: %s", defaultEmail.latin1()); |
690 | 695 | ||
691 | } | 696 | } |
692 | 697 | ||
693 | void ContactEditor::populateDefaultEmailCmb(){ | 698 | void ContactEditor::populateDefaultEmailCmb(){ |
694 | 699 | ||
695 | // if the default-email combo was not selected and therfore not created | 700 | // if the default-email combo was not selected and therfore not created |
696 | // we get a lot of trouble.. Therfore create an invisible one.. | 701 | // we get a lot of trouble.. Therfore create an invisible one.. |
697 | if ( !cmbDefaultEmail ){ | 702 | if ( !cmbDefaultEmail ){ |
698 | cmbDefaultEmail = new QComboBox(this); | 703 | cmbDefaultEmail = new QComboBox(this); |
699 | cmbDefaultEmail -> hide(); | 704 | cmbDefaultEmail -> hide(); |
700 | } | 705 | } |
701 | cmbDefaultEmail->clear(); | 706 | cmbDefaultEmail->clear(); |
702 | cmbDefaultEmail->insertStringList( emails ); | 707 | cmbDefaultEmail->insertStringList( emails ); |
703 | // cmbDefaultEmail->show(); | 708 | // cmbDefaultEmail->show(); |
704 | 709 | ||
705 | // Select default email in combo.. | 710 | // Select default email in combo.. |
706 | bool found = false; | 711 | bool found = false; |
707 | for ( int i = 0; i < cmbDefaultEmail->count(); i++){ | 712 | for ( int i = 0; i < cmbDefaultEmail->count(); i++){ |
708 | qDebug(" populateDefaultEmailCmb text >%s< defaultEmail >%s<", | 713 | qDebug(" populateDefaultEmailCmb text >%s< defaultEmail >%s<", |
709 | cmbDefaultEmail->text( i ).latin1(), defaultEmail.latin1()); | 714 | cmbDefaultEmail->text( i ).latin1(), defaultEmail.latin1()); |
710 | 715 | ||
711 | if ( cmbDefaultEmail->text( i ).stripWhiteSpace() == defaultEmail.stripWhiteSpace() ){ | 716 | if ( cmbDefaultEmail->text( i ).stripWhiteSpace() == defaultEmail.stripWhiteSpace() ){ |
712 | cmbDefaultEmail->setCurrentItem( i ); | 717 | cmbDefaultEmail->setCurrentItem( i ); |
713 | qDebug("set"); | 718 | qDebug("set"); |
714 | found = true; | 719 | found = true; |
715 | } | 720 | } |
716 | } | 721 | } |
717 | 722 | ||
718 | // If the current default email is not found in the list, we choose the | 723 | // If the current default email is not found in the list, we choose the |
719 | // first one.. | 724 | // first one.. |
720 | if ( !found ) | 725 | if ( !found ) |
721 | defaultEmail = cmbDefaultEmail->text(0); | 726 | defaultEmail = cmbDefaultEmail->text(0); |
722 | } | 727 | } |
723 | 728 | ||
724 | // Called when any combobox was changed. | 729 | // Called when any combobox was changed. |
725 | // "true" returned if the change was chandled by this function, else it should | 730 | // "true" returned if the change was chandled by this function, else it should |
726 | // be handled by something else.. | 731 | // be handled by something else.. |
727 | bool ContactEditor::cmbChooserChange( int index, QWidgetStack* inputStack, int widgetPos ) { | 732 | bool ContactEditor::cmbChooserChange( int index, QWidgetStack* inputStack, int widgetPos ) { |
728 | QString type = slChooserNames[index]; | 733 | QString type = slChooserNames[index]; |
729 | qWarning("ContactEditor::cmbChooserChange -> Type: %s, WidgetPos: %d", type.latin1(), widgetPos ); | 734 | qWarning("ContactEditor::cmbChooserChange -> Type: %s, WidgetPos: %d", type.latin1(), widgetPos ); |
730 | 735 | ||
731 | if ( !initializing ) | 736 | if ( !initializing ) |
732 | contactfields.setFieldOrder( widgetPos-1, index ); | 737 | contactfields.setFieldOrder( widgetPos-1, index ); |
733 | 738 | ||
734 | // Create and connect combobox for selecting the default email | 739 | // Create and connect combobox for selecting the default email |
735 | if ( type == "Default Email"){ | 740 | if ( type == "Default Email"){ |
736 | qWarning("Choosing default-email (defaultEmailChooserPosition= %d) ", defaultEmailChooserPosition); | 741 | qWarning("Choosing default-email (defaultEmailChooserPosition= %d) ", defaultEmailChooserPosition); |
737 | 742 | ||
738 | // More than one default-email chooser is not allowed ! | 743 | // More than one default-email chooser is not allowed ! |
739 | if ( ( defaultEmailChooserPosition != -1 ) && | 744 | if ( ( defaultEmailChooserPosition != -1 ) && |
740 | defaultEmailChooserPosition != widgetPos && !initializing){ | 745 | defaultEmailChooserPosition != widgetPos && !initializing){ |
741 | chooserError( widgetPos ); | 746 | chooserError( widgetPos ); |
742 | return true; | 747 | return true; |
743 | } | 748 | } |
744 | 749 | ||
745 | QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo ); | 750 | QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo ); |
746 | if ( cmbo ){ | 751 | if ( cmbo ){ |
747 | inputStack->raiseWidget( TextField ); | 752 | inputStack->raiseWidget( TextField ); |
748 | inputStack -> removeWidget( cmbo ); | 753 | inputStack -> removeWidget( cmbo ); |
749 | delete cmbo; | 754 | delete cmbo; |
750 | } | 755 | } |
751 | cmbo = new QComboBox( inputStack ); | 756 | cmbo = new QComboBox( inputStack ); |
752 | cmbo -> insertStringList( emails ); | 757 | cmbo -> insertStringList( emails ); |
753 | 758 | ||
754 | inputStack -> addWidget( cmbo, Combo ); | 759 | inputStack -> addWidget( cmbo, Combo ); |
755 | inputStack -> raiseWidget( Combo ); | 760 | inputStack -> raiseWidget( Combo ); |
756 | 761 | ||
757 | defaultEmailChooserPosition = widgetPos; | 762 | defaultEmailChooserPosition = widgetPos; |
758 | cmbDefaultEmail = cmbo; | 763 | cmbDefaultEmail = cmbo; |
759 | 764 | ||
760 | connect( cmbo,SIGNAL( activated(int) ), | 765 | connect( cmbo,SIGNAL( activated(int) ), |
761 | SLOT( defaultEmailChanged(int) ) ); | 766 | SLOT( defaultEmailChanged(int) ) ); |
762 | 767 | ||
763 | // Set current default email | 768 | // Set current default email |
764 | populateDefaultEmailCmb(); | 769 | populateDefaultEmailCmb(); |
765 | 770 | ||
766 | 771 | ||
767 | } else { | 772 | } else { |
768 | // Something else was selected: Hide combo.. | 773 | // Something else was selected: Hide combo.. |
769 | qWarning(" Hiding default-email combo" ); | 774 | qWarning(" Hiding default-email combo" ); |
770 | if ( defaultEmailChooserPosition == widgetPos ){ | 775 | if ( defaultEmailChooserPosition == widgetPos ){ |
771 | defaultEmailChooserPosition = -1; | 776 | defaultEmailChooserPosition = -1; |
772 | QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo ); | 777 | QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo ); |
773 | if ( cmbo ){ | 778 | if ( cmbo ){ |
774 | inputStack->raiseWidget( TextField ); | 779 | inputStack->raiseWidget( TextField ); |
775 | inputStack -> removeWidget( cmbo ); | 780 | inputStack -> removeWidget( cmbo ); |
776 | cmbDefaultEmail = 0l; | 781 | cmbDefaultEmail = 0l; |
777 | delete cmbo; | 782 | delete cmbo; |
778 | } | 783 | } |
779 | 784 | ||
780 | } | 785 | } |
781 | 786 | ||
782 | // Caller should initialize the responsible textfield, therefore | 787 | // Caller should initialize the responsible textfield, therefore |
783 | // "false" is returned | 788 | // "false" is returned |
784 | return false; | 789 | return false; |
785 | } | 790 | } |
786 | 791 | ||
787 | // Everything is worked off .. | 792 | // Everything is worked off .. |
788 | return true; | 793 | return true; |
789 | 794 | ||
790 | } | 795 | } |
791 | 796 | ||
792 | // Currently accessed when we select default-email more than once ! | 797 | // Currently accessed when we select default-email more than once ! |
793 | void ContactEditor::chooserError( int index ) | 798 | void ContactEditor::chooserError( int index ) |
794 | { | 799 | { |
795 | qWarning("ContactEditor::chooserError( %d )", index); | 800 | qWarning("ContactEditor::chooserError( %d )", index); |
796 | QMessageBox::warning( this, "Chooser Error", | 801 | QMessageBox::warning( this, "Chooser Error", |
797 | "Multiple selection of this\n" | 802 | "Multiple selection of this\n" |
798 | "Item is not allowed !\n\n" | 803 | "Item is not allowed !\n\n" |
799 | "First deselect the previous one !", | 804 | "First deselect the previous one !", |
800 | "&OK", 0, 0, | 805 | "&OK", 0, 0, |
801 | 0, 0 ); | 806 | 0, 0 ); |
802 | 807 | ||
803 | // Reset the selected Chooser. Unfortunately the chooser | 808 | // Reset the selected Chooser. Unfortunately the chooser |
804 | // generates no signal, therfore we have to | 809 | // generates no signal, therfore we have to |
805 | // call the cmbChooserChange function manually.. | 810 | // call the cmbChooserChange function manually.. |
806 | switch( index ){ | 811 | switch( index ){ |
807 | case 1: | 812 | case 1: |
808 | cmbChooserField1 -> setCurrentItem( 0 ); | 813 | cmbChooserField1 -> setCurrentItem( 0 ); |
809 | slotCmbChooser1Change( 0 ); | 814 | slotCmbChooser1Change( 0 ); |
810 | break; | 815 | break; |
811 | case 2: | 816 | case 2: |
812 | cmbChooserField2 -> setCurrentItem( 0 ); | 817 | cmbChooserField2 -> setCurrentItem( 0 ); |
813 | slotCmbChooser2Change( 0 ); | 818 | slotCmbChooser2Change( 0 ); |
814 | break; | 819 | break; |
815 | case 3: | 820 | case 3: |
816 | cmbChooserField3 -> setCurrentItem( 0 ); | 821 | cmbChooserField3 -> setCurrentItem( 0 ); |
817 | slotCmbChooser3Change( 0 ); | 822 | slotCmbChooser3Change( 0 ); |
818 | break; | 823 | break; |
819 | case 4: | 824 | case 4: |
820 | cmbChooserField4 -> setCurrentItem( 0 ); | 825 | cmbChooserField4 -> setCurrentItem( 0 ); |
821 | slotCmbChooser4Change( 0 ); | 826 | slotCmbChooser4Change( 0 ); |
822 | break; | 827 | break; |
823 | } | 828 | } |
824 | } | 829 | } |
825 | 830 | ||
826 | // Called when something was changed in a textfield (shouldn't it called textchanged? (se)) | 831 | // Called when something was changed in a textfield (shouldn't it called textchanged? (se)) |
827 | void ContactEditor::chooserChange( const QString &textChanged, int index, | 832 | void ContactEditor::chooserChange( const QString &textChanged, int index, |
828 | QLineEdit* , int widgetPos ) { | 833 | QLineEdit* , int widgetPos ) { |
829 | 834 | ||
830 | QString type = slChooserNames[index]; // :SX | 835 | QString type = slChooserNames[index]; // :SX |
831 | qDebug("ContactEditor::chooserChange( type=>%s<, textChanged=>%s< index=%i, widgetPos=%i", | 836 | qDebug("ContactEditor::chooserChange( type=>%s<, textChanged=>%s< index=%i, widgetPos=%i", |
832 | type.latin1(),textChanged.latin1(), index, widgetPos ); | 837 | type.latin1(),textChanged.latin1(), index, widgetPos ); |
833 | 838 | ||
834 | if ( type == "Default Email"){ | 839 | if ( type == "Default Email"){ |
835 | qWarning ("??? Wozu??: %s", textChanged.latin1()); | 840 | qWarning ("??? Wozu??: %s", textChanged.latin1()); |
836 | defaultEmail = textChanged; | 841 | defaultEmail = textChanged; |
837 | 842 | ||
838 | populateDefaultEmailCmb(); | 843 | populateDefaultEmailCmb(); |
839 | 844 | ||
840 | }else if (type == "Emails"){ | 845 | }else if (type == "Emails"){ |
841 | qDebug("emails"); | 846 | qDebug("emails"); |
842 | 847 | ||
843 | QString de; | 848 | QString de; |
844 | emails = QStringList::split (",", textChanged ); | 849 | emails = QStringList::split (",", textChanged ); |
845 | 850 | ||
846 | populateDefaultEmailCmb(); | 851 | populateDefaultEmailCmb(); |
847 | } | 852 | } |
848 | 853 | ||
849 | slChooserValues[index] = textChanged; | 854 | slChooserValues[index] = textChanged; |
850 | 855 | ||
851 | } | 856 | } |
852 | 857 | ||
853 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { | 858 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { |
854 | qWarning("ContactEditor::slotChooser1Change( %s )", textChanged.latin1()); | 859 | qWarning("ContactEditor::slotChooser1Change( %s )", textChanged.latin1()); |
855 | chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1); | 860 | chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1); |
856 | } | 861 | } |
857 | 862 | ||
858 | void ContactEditor::slotChooser2Change( const QString &textChanged ) { | 863 | void ContactEditor::slotChooser2Change( const QString &textChanged ) { |
859 | qWarning("ContactEditor::slotChooser2Change( %s )", textChanged.latin1()); | 864 | qWarning("ContactEditor::slotChooser2Change( %s )", textChanged.latin1()); |
860 | chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2, 2); | 865 | chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2, 2); |
861 | 866 | ||
862 | } | 867 | } |
863 | 868 | ||
864 | void ContactEditor::slotChooser3Change( const QString &textChanged ) { | 869 | void ContactEditor::slotChooser3Change( const QString &textChanged ) { |
865 | qWarning("ContactEditor::slotChooser3Change( %s )", textChanged.latin1()); | 870 | qWarning("ContactEditor::slotChooser3Change( %s )", textChanged.latin1()); |
866 | chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3, 3); | 871 | chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3, 3); |
867 | } | 872 | } |
868 | 873 | ||
869 | void ContactEditor::slotChooser4Change( const QString &textChanged ) { | 874 | void ContactEditor::slotChooser4Change( const QString &textChanged ) { |
870 | qWarning("ContactEditor::slotChooser4Change( %s )", textChanged.latin1()); | 875 | qWarning("ContactEditor::slotChooser4Change( %s )", textChanged.latin1()); |
871 | chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4, 4); | 876 | chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4, 4); |
872 | } | 877 | } |
873 | 878 | ||
874 | void ContactEditor::slotAddressChange( const QString &textChanged ) { | 879 | void ContactEditor::slotAddressChange( const QString &textChanged ) { |
875 | 880 | ||
876 | if ( cmbAddress->currentItem() == 0 ) { | 881 | if ( cmbAddress->currentItem() == 0 ) { |
877 | slBusinessAddress[0] = textChanged; | 882 | slBusinessAddress[0] = textChanged; |
878 | } else { | 883 | } else { |
879 | slHomeAddress[0] = textChanged; | 884 | slHomeAddress[0] = textChanged; |
880 | } | 885 | } |
881 | } | 886 | } |
882 | 887 | ||
883 | void ContactEditor::slotAddress2Change( const QString &textChanged ) { | 888 | void ContactEditor::slotAddress2Change( const QString &textChanged ) { |
884 | 889 | ||
885 | if ( cmbAddress->currentItem() == 0 ) { | 890 | if ( cmbAddress->currentItem() == 0 ) { |
886 | slBusinessAddress[1] = textChanged; | 891 | slBusinessAddress[1] = textChanged; |
887 | } else { | 892 | } else { |
888 | slHomeAddress[1] = textChanged; | 893 | slHomeAddress[1] = textChanged; |
889 | } | 894 | } |
890 | } | 895 | } |
891 | 896 | ||
892 | void ContactEditor::slotPOBoxChange( const QString &textChanged ) { | 897 | void ContactEditor::slotPOBoxChange( const QString &textChanged ) { |
893 | 898 | ||
894 | if ( cmbAddress->currentItem() == 0 ) { | 899 | if ( cmbAddress->currentItem() == 0 ) { |
895 | slBusinessAddress[2] = textChanged; | 900 | slBusinessAddress[2] = textChanged; |
896 | } else { | 901 | } else { |
897 | slHomeAddress[2] = textChanged; | 902 | slHomeAddress[2] = textChanged; |
898 | } | 903 | } |
899 | } | 904 | } |
900 | 905 | ||
901 | void ContactEditor::slotCityChange( const QString &textChanged ) { | 906 | void ContactEditor::slotCityChange( const QString &textChanged ) { |
902 | 907 | ||
903 | if ( cmbAddress->currentItem() == 0 ) { | 908 | if ( cmbAddress->currentItem() == 0 ) { |
904 | slBusinessAddress[3] = textChanged; | 909 | slBusinessAddress[3] = textChanged; |
905 | } else { | 910 | } else { |
906 | slHomeAddress[3] = textChanged; | 911 | slHomeAddress[3] = textChanged; |
907 | } | 912 | } |
908 | } | 913 | } |
909 | 914 | ||
910 | void ContactEditor::slotStateChange( const QString &textChanged ) { | 915 | void ContactEditor::slotStateChange( const QString &textChanged ) { |
911 | 916 | ||
912 | 917 | ||
913 | if ( cmbAddress->currentItem() == 0 ) { | 918 | if ( cmbAddress->currentItem() == 0 ) { |
914 | slBusinessAddress[4] = textChanged; | 919 | slBusinessAddress[4] = textChanged; |
915 | } else { | 920 | } else { |
916 | slHomeAddress[4] = textChanged; | 921 | slHomeAddress[4] = textChanged; |
917 | } | 922 | } |
918 | } | 923 | } |
919 | 924 | ||
920 | void ContactEditor::slotZipChange( const QString &textChanged ) { | 925 | void ContactEditor::slotZipChange( const QString &textChanged ) { |
921 | 926 | ||
922 | if ( cmbAddress->currentItem() == 0 ) { | 927 | if ( cmbAddress->currentItem() == 0 ) { |
923 | slBusinessAddress[5] = textChanged; | 928 | slBusinessAddress[5] = textChanged; |
924 | } else { | 929 | } else { |
925 | slHomeAddress[5] = textChanged; | 930 | slHomeAddress[5] = textChanged; |
926 | } | 931 | } |
927 | } | 932 | } |
928 | 933 | ||
929 | void ContactEditor::slotCountryChange( const QString &textChanged ) { | 934 | void ContactEditor::slotCountryChange( const QString &textChanged ) { |
930 | 935 | ||
931 | if ( cmbAddress->currentItem() == 0 ) { | 936 | if ( cmbAddress->currentItem() == 0 ) { |
932 | slBusinessAddress[6] = textChanged; | 937 | slBusinessAddress[6] = textChanged; |
933 | } else { | 938 | } else { |
934 | slHomeAddress[6] = textChanged; | 939 | slHomeAddress[6] = textChanged; |
935 | } | 940 | } |
936 | } | 941 | } |
937 | 942 | ||
938 | 943 | ||
939 | void ContactEditor::slotCmbChooser1Change( int index ) { | 944 | void ContactEditor::slotCmbChooser1Change( int index ) { |
940 | qWarning("ContactEditor::slotCmbChooser1Change( %d )", index); | 945 | qWarning("ContactEditor::slotCmbChooser1Change( %d )", index); |
941 | if ( !cmbChooserChange( cmbChooserField1->currentItem(), m_widgetStack1, 1) ){ | 946 | if ( !cmbChooserChange( cmbChooserField1->currentItem(), m_widgetStack1, 1) ){ |
942 | 947 | ||
943 | txtChooserField1->setText( slChooserValues[index] ); | 948 | txtChooserField1->setText( slChooserValues[index] ); |
944 | txtChooserField1->setFocus(); | 949 | txtChooserField1->setFocus(); |
945 | 950 | ||
946 | } | 951 | } |
947 | 952 | ||
948 | } | 953 | } |
949 | 954 | ||
950 | void ContactEditor::slotCmbChooser2Change( int index ) { | 955 | void ContactEditor::slotCmbChooser2Change( int index ) { |
951 | qWarning("ContactEditor::slotCmbChooser2Change( %d )", index); | 956 | qWarning("ContactEditor::slotCmbChooser2Change( %d )", index); |
952 | 957 | ||
953 | if ( !cmbChooserChange( cmbChooserField2->currentItem(), m_widgetStack2, 2) ){ | 958 | if ( !cmbChooserChange( cmbChooserField2->currentItem(), m_widgetStack2, 2) ){ |
954 | 959 | ||
955 | txtChooserField2->setText( slChooserValues[index] ); | 960 | txtChooserField2->setText( slChooserValues[index] ); |
956 | txtChooserField2->setFocus(); | 961 | txtChooserField2->setFocus(); |
957 | 962 | ||
958 | } | 963 | } |
959 | } | 964 | } |
960 | 965 | ||
961 | void ContactEditor::slotCmbChooser3Change( int index ) { | 966 | void ContactEditor::slotCmbChooser3Change( int index ) { |
962 | qWarning("ContactEditor::slotCmbChooser3Change( %d )", index); | 967 | qWarning("ContactEditor::slotCmbChooser3Change( %d )", index); |
963 | 968 | ||
964 | if ( !cmbChooserChange( cmbChooserField3->currentItem(), m_widgetStack3, 3) ){ | 969 | if ( !cmbChooserChange( cmbChooserField3->currentItem(), m_widgetStack3, 3) ){ |
965 | 970 | ||
966 | txtChooserField3->setText( slChooserValues[index] ); | 971 | txtChooserField3->setText( slChooserValues[index] ); |
967 | txtChooserField3->setFocus(); | 972 | txtChooserField3->setFocus(); |
968 | 973 | ||
969 | } | 974 | } |
970 | } | 975 | } |
971 | 976 | ||
972 | void ContactEditor::slotCmbChooser4Change( int index ) { | 977 | void ContactEditor::slotCmbChooser4Change( int index ) { |
973 | qWarning("ContactEditor::slotCmbChooser4Change( %d )", index); | 978 | qWarning("ContactEditor::slotCmbChooser4Change( %d )", index); |
974 | 979 | ||
975 | if ( !cmbChooserChange( cmbChooserField4->currentItem(), m_widgetStack4, 4) ){ | 980 | if ( !cmbChooserChange( cmbChooserField4->currentItem(), m_widgetStack4, 4) ){ |
976 | 981 | ||
977 | txtChooserField4->setText( slChooserValues[index] ); | 982 | txtChooserField4->setText( slChooserValues[index] ); |
978 | txtChooserField4->setFocus(); | 983 | txtChooserField4->setFocus(); |
979 | 984 | ||
980 | } | 985 | } |
981 | } | 986 | } |
982 | 987 | ||
983 | void ContactEditor::slotAddressTypeChange( int index ) { | 988 | void ContactEditor::slotAddressTypeChange( int index ) { |
984 | 989 | ||
985 | 990 | ||
986 | if ( !initializing ) | 991 | if ( !initializing ) |
987 | contactfields.setFieldOrder( 4, index ); | 992 | contactfields.setFieldOrder( 4, index ); |
988 | 993 | ||
989 | 994 | ||
990 | if ( index == 0 ) { | 995 | if ( index == 0 ) { |
991 | 996 | ||
992 | txtAddress->setText( slBusinessAddress[0] ); | 997 | txtAddress->setText( slBusinessAddress[0] ); |
993 | //txtAddress2->setText( (*slBusinessAddress)[1] ); | 998 | //txtAddress2->setText( (*slBusinessAddress)[1] ); |
994 | //txtPOBox->setText( (*slBusinessAddress)[2] ); | 999 | //txtPOBox->setText( (*slBusinessAddress)[2] ); |
995 | txtCity->setText( slBusinessAddress[3] ); | 1000 | txtCity->setText( slBusinessAddress[3] ); |
996 | txtState->setText( slBusinessAddress[4] ); | 1001 | txtState->setText( slBusinessAddress[4] ); |
997 | txtZip->setText( slBusinessAddress[5] ); | 1002 | txtZip->setText( slBusinessAddress[5] ); |
998 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 1003 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
999 | txtTmp->setText( slBusinessAddress[6] ); | 1004 | txtTmp->setText( slBusinessAddress[6] ); |
1000 | 1005 | ||
1001 | } else { | 1006 | } else { |
1002 | 1007 | ||
1003 | txtAddress->setText( slHomeAddress[0] ); | 1008 | txtAddress->setText( slHomeAddress[0] ); |
1004 | //txtAddress2->setText( (*slHomeAddress)[1] ); | 1009 | //txtAddress2->setText( (*slHomeAddress)[1] ); |
1005 | //txtPOBox->setText( (*slHomeAddress)[2] ); | 1010 | //txtPOBox->setText( (*slHomeAddress)[2] ); |
1006 | txtCity->setText( slHomeAddress[3] ); | 1011 | txtCity->setText( slHomeAddress[3] ); |
1007 | txtState->setText( slHomeAddress[4] ); | 1012 | txtState->setText( slHomeAddress[4] ); |
1008 | txtZip->setText( slHomeAddress[5] ); | 1013 | txtZip->setText( slHomeAddress[5] ); |
1009 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 1014 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
1010 | txtTmp->setText( slHomeAddress[6] ); | 1015 | txtTmp->setText( slHomeAddress[6] ); |
1011 | 1016 | ||
1012 | } | 1017 | } |
1013 | 1018 | ||
1014 | } | 1019 | } |
1015 | 1020 | ||
1016 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { | 1021 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { |
1017 | 1022 | ||
1023 | qWarning( "ContactEditor::slotFullNameChange( %s )", textChanged.latin1() ); | ||
1024 | |||
1018 | int index = cmbFileAs->currentItem(); | 1025 | int index = cmbFileAs->currentItem(); |
1019 | 1026 | ||
1020 | cmbFileAs->clear(); | 1027 | cmbFileAs->clear(); |
1021 | 1028 | ||
1022 | cmbFileAs->insertItem( parseName( textChanged, 0 ) ); | 1029 | cmbFileAs->insertItem( parseName( textChanged, NAME_FL ) ); |
1023 | cmbFileAs->insertItem( parseName( textChanged, 1 ) ); | 1030 | cmbFileAs->insertItem( parseName( textChanged, NAME_FMLS ) ); |
1024 | cmbFileAs->insertItem( parseName( textChanged, 2 ) ); | 1031 | cmbFileAs->insertItem( parseName( textChanged, NAME_LF ) ); |
1025 | cmbFileAs->insertItem( parseName( textChanged, 3 ) ); | 1032 | cmbFileAs->insertItem( parseName( textChanged, NAME_LFM ) ); |
1026 | 1033 | ||
1027 | cmbFileAs->setCurrentItem( index ); | 1034 | cmbFileAs->setCurrentItem( index ); |
1028 | 1035 | ||
1029 | useFullName = true; | 1036 | useFullName = true; |
1030 | 1037 | ||
1031 | } | 1038 | } |
1032 | 1039 | ||
1033 | void ContactEditor::accept() { | 1040 | void ContactEditor::accept() { |
1034 | 1041 | ||
1035 | if ( isEmpty() ) { | 1042 | if ( isEmpty() ) { |
1036 | cleanupFields(); | 1043 | cleanupFields(); |
1037 | reject(); | 1044 | reject(); |
1038 | } else { | 1045 | } else { |
1039 | saveEntry(); | 1046 | saveEntry(); |
1040 | cleanupFields(); | 1047 | cleanupFields(); |
1041 | QDialog::accept(); | 1048 | QDialog::accept(); |
1042 | } | 1049 | } |
1043 | 1050 | ||
1044 | } | 1051 | } |
1045 | 1052 | ||
1046 | void ContactEditor::slotNote() { | 1053 | void ContactEditor::slotNote() { |
1047 | 1054 | ||
1048 | dlgNote->showMaximized(); | 1055 | dlgNote->showMaximized(); |
1049 | if ( !dlgNote->exec() ) { | 1056 | if ( !dlgNote->exec() ) { |
1050 | txtNote->setText( ent.notes() ); | 1057 | txtNote->setText( ent.notes() ); |
1051 | } | 1058 | } |
1052 | } | 1059 | } |
1053 | 1060 | ||
1054 | void ContactEditor::slotName() { | 1061 | void ContactEditor::slotName() { |
1055 | 1062 | ||
1056 | QString tmpName; | 1063 | QString tmpName; |
1057 | if (useFullName) { | 1064 | if (useFullName) { |
1058 | txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); | 1065 | txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); |
1059 | txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); | 1066 | txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); |
1060 | txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); | 1067 | txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); |
1061 | txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); | 1068 | // txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); |
1062 | } | 1069 | } |
1063 | dlgName->showMaximized(); | 1070 | dlgName->showMaximized(); |
1064 | if ( dlgName->exec() ) { | 1071 | if ( dlgName->exec() ) { |
1065 | 1072 | ||
1066 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text() + " " + txtSuffix->text(); | 1073 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text() + " " + txtSuffix->text(); |
1067 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); | 1074 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); |
1068 | slotFullNameChange( txtFullName->text() ); | 1075 | slotFullNameChange( txtFullName->text() ); |
1069 | useFullName = false; | 1076 | useFullName = false; |
1070 | } | 1077 | } |
1071 | 1078 | ||
1072 | } | 1079 | } |
1073 | 1080 | ||
1074 | void ContactEditor::setNameFocus() { | 1081 | void ContactEditor::setNameFocus() { |
1075 | 1082 | ||
1076 | txtFullName->setFocus(); | 1083 | txtFullName->setFocus(); |
1077 | 1084 | ||
1078 | } | 1085 | } |
1079 | 1086 | ||
1080 | bool ContactEditor::isEmpty() { | 1087 | bool ContactEditor::isEmpty() { |
1081 | // Test and see if the record should be saved. | 1088 | // Test and see if the record should be saved. |
1082 | // More strict than the original qtopia, needs name or fileas to save | 1089 | // More strict than the original qtopia, needs name or fileas to save |
1083 | 1090 | ||
1084 | QString t = txtFullName->text(); | 1091 | QString t = txtFullName->text(); |
1085 | if ( !t.isEmpty() && containsAlphaNum( t ) ) | 1092 | if ( !t.isEmpty() && containsAlphaNum( t ) ) |
1086 | return false; | 1093 | return false; |
1087 | 1094 | ||
1088 | t = cmbFileAs->currentText(); | 1095 | t = cmbFileAs->currentText(); |
1089 | if ( !t.isEmpty() && containsAlphaNum( t ) ) | 1096 | if ( !t.isEmpty() && containsAlphaNum( t ) ) |
1090 | return false; | 1097 | return false; |
1091 | 1098 | ||
1092 | return true; | 1099 | return true; |
1093 | 1100 | ||
1094 | } | 1101 | } |
1095 | 1102 | ||
1096 | QString ContactEditor::parseName( const QString fullName, int type ) { | 1103 | QString ContactEditor::parseName( const QString fullName, int type ) { |
1097 | 1104 | ||
1098 | QString simplifiedName( fullName.simplifyWhiteSpace() ); | 1105 | QString simplifiedName( fullName.simplifyWhiteSpace() ); |
1099 | QString strFirstName; | 1106 | QString strFirstName; |
1100 | QString strMiddleName; | 1107 | QString strMiddleName; |
1101 | QString strLastName; | 1108 | QString strLastName; |
1102 | QString strSuffix; | 1109 | QString strSuffix; |
1103 | QString strTitle; | 1110 | QString strTitle; |
1104 | int commapos; | 1111 | int commapos; |
1105 | int spCount; | 1112 | bool haveLastName = false; |
1106 | int spPos; | ||
1107 | int spPos2; | ||
1108 | 1113 | ||
1114 | qWarning("Fullname: %s", simplifiedName.latin1()); | ||
1109 | 1115 | ||
1110 | commapos = simplifiedName.find( ',', 0, TRUE); | 1116 | commapos = simplifiedName.find( ',', 0, TRUE); |
1111 | spCount = simplifiedName.contains( ' ', TRUE ); | 1117 | if ( commapos >= 0 ) { |
1112 | 1118 | qWarning(" Commapos: %d", commapos ); | |
1113 | if ( commapos == -1 ) { | 1119 | |
1114 | 1120 | // A comma (",") separates the lastname from one or | |
1115 | switch (spCount) { | 1121 | // many first names. Thus, remove the lastname from the |
1116 | case 0: | 1122 | // String and parse the firstnames. |
1117 | //return simplifiedName; | 1123 | |
1118 | if (txtLastName->text() != "") { | 1124 | strLastName = simplifiedName.left( commapos ); |
1119 | strLastName = simplifiedName; | 1125 | simplifiedName= simplifiedName.mid( commapos + 1 ); |
1120 | break; | 1126 | haveLastName = true; |
1121 | } | 1127 | qWarning("Fullname without ',': %s", simplifiedName.latin1()); |
1122 | if (txtMiddleName->text() != "") { | 1128 | |
1123 | strMiddleName = simplifiedName; | 1129 | // If we have any lastname, we should now split all first names. |
1124 | break; | 1130 | // The first one will be the used as first, the rest as "middle names" |
1125 | } | 1131 | |
1126 | if (txtSuffix->text() != "") { | 1132 | QStringList allFirstNames = QStringList::split(" ", simplifiedName); |
1127 | strSuffix = simplifiedName; | 1133 | QStringList::Iterator it = allFirstNames.begin(); |
1128 | break; | 1134 | strFirstName = *it++; |
1129 | } | 1135 | QStringList allSecondNames; |
1130 | strFirstName = simplifiedName; | 1136 | for ( ; it != allFirstNames.end(); ++it ) |
1131 | break; | 1137 | allSecondNames.append( *it ); |
1132 | 1138 | ||
1133 | case 1: | 1139 | strMiddleName = allSecondNames.join(" "); |
1134 | spPos = simplifiedName.find( ' ', 0, TRUE ); | ||
1135 | strFirstName = simplifiedName.left( spPos ); | ||
1136 | strLastName = simplifiedName.mid( spPos + 1 ); | ||
1137 | break; | ||
1138 | |||
1139 | case 2: | ||
1140 | spPos = simplifiedName.find( ' ', 0, TRUE ); | ||
1141 | strFirstName = simplifiedName.left( spPos ); | ||
1142 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | ||
1143 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | ||
1144 | strLastName = simplifiedName.mid( spPos2 + 1 ); | ||
1145 | break; | ||
1146 | |||
1147 | case 3: | ||
1148 | spPos = simplifiedName.find( ' ', 0, TRUE ); | ||
1149 | strFirstName = simplifiedName.left( spPos ); | ||
1150 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | ||
1151 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | ||
1152 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); | ||
1153 | strLastName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); | ||
1154 | strSuffix = simplifiedName.mid( spPos + 1 ); | ||
1155 | break; | ||
1156 | |||
1157 | case 4: | ||
1158 | spPos = simplifiedName.find( ' ', 0, TRUE ); | ||
1159 | strTitle = simplifiedName.left( spPos ); | ||
1160 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | ||
1161 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | ||
1162 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); | ||
1163 | strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); | ||
1164 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | ||
1165 | strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | ||
1166 | strSuffix = simplifiedName.mid( spPos2 + 1 ); | ||
1167 | break; | ||
1168 | |||
1169 | default: | ||
1170 | spPos = simplifiedName.find( ' ', 0, TRUE ); | ||
1171 | strTitle = simplifiedName.left( spPos ); | ||
1172 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | ||
1173 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | ||
1174 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); | ||
1175 | strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); | ||
1176 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | ||
1177 | strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | ||
1178 | strSuffix = simplifiedName.mid( spPos2 + 1 ); | ||
1179 | break; | ||
1180 | } | ||
1181 | } else { | ||
1182 | simplifiedName.replace( commapos, 1, " " ); | ||
1183 | simplifiedName = simplifiedName.simplifyWhiteSpace(); | ||
1184 | |||
1185 | switch (spCount) { | ||
1186 | case 0: | ||
1187 | //return simplifiedName; | ||
1188 | if (txtLastName->text() != "") { | ||
1189 | strLastName = simplifiedName; | ||
1190 | break; | ||
1191 | } | ||
1192 | if (txtMiddleName->text() != "") { | ||
1193 | strMiddleName = simplifiedName; | ||
1194 | break; | ||
1195 | } | ||
1196 | if (txtSuffix->text() != "") { | ||
1197 | strSuffix = simplifiedName; | ||
1198 | break; | ||
1199 | } | ||
1200 | strFirstName = simplifiedName; | ||
1201 | break; | ||
1202 | |||
1203 | case 1: | ||
1204 | spPos = simplifiedName.find( ' ', 0, TRUE ); | ||
1205 | strLastName = simplifiedName.left( spPos ); | ||
1206 | strFirstName = simplifiedName.mid( spPos + 1 ); | ||
1207 | break; | ||
1208 | |||
1209 | case 2: | ||
1210 | spPos = simplifiedName.find( ' ', 0, TRUE ); | ||
1211 | strLastName = simplifiedName.left( spPos ); | ||
1212 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | ||
1213 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | ||
1214 | strMiddleName = simplifiedName.mid( spPos2 + 1 ); | ||
1215 | break; | ||
1216 | |||
1217 | case 3: | ||
1218 | spPos = simplifiedName.find( ' ', 0, TRUE ); | ||
1219 | strLastName = simplifiedName.left( spPos ); | ||
1220 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | ||
1221 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | ||
1222 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); | ||
1223 | strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); | ||
1224 | strSuffix = simplifiedName.mid( spPos + 1 ); | ||
1225 | break; | ||
1226 | |||
1227 | case 4: | ||
1228 | spPos = simplifiedName.find( ' ', 0, TRUE ); | ||
1229 | strLastName = simplifiedName.left( spPos ); | ||
1230 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | ||
1231 | strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | ||
1232 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); | ||
1233 | strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); | ||
1234 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | ||
1235 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | ||
1236 | strSuffix = simplifiedName.mid( spPos2 + 1 ); | ||
1237 | break; | ||
1238 | |||
1239 | default: | ||
1240 | spPos = simplifiedName.find( ' ', 0, TRUE ); | ||
1241 | strLastName = simplifiedName.left( spPos ); | ||
1242 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | ||
1243 | strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | ||
1244 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); | ||
1245 | strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos ); | ||
1246 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | ||
1247 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | ||
1248 | strSuffix = simplifiedName.mid( spPos2 + 1 ); | ||
1249 | break; | ||
1250 | } | ||
1251 | } | ||
1252 | switch (type) { | ||
1253 | case NAME_FL: | ||
1254 | return strFirstName + " " + strLastName; | ||
1255 | |||
1256 | case NAME_LF: | ||
1257 | return strLastName + ", " + strFirstName; | ||
1258 | |||
1259 | case NAME_LFM: | ||
1260 | return strLastName + ", " + strFirstName + " " + strMiddleName; | ||
1261 | 1140 | ||
1262 | case NAME_FMLS: | 1141 | } else { |
1263 | return strFirstName + " " + strMiddleName + " " + strLastName + " " + strSuffix; | ||
1264 | 1142 | ||
1265 | case NAME_F: | 1143 | // No comma separator used: We use the first word as firstname, the |
1266 | return strFirstName; | 1144 | // last as second/lastname and everything in the middle as middlename |
1267 | 1145 | ||
1268 | case NAME_M: | 1146 | QStringList allNames = QStringList::split(" ", simplifiedName); |
1269 | return strMiddleName; | 1147 | QStringList::Iterator it = allNames.begin(); |
1148 | strFirstName = *it++; | ||
1149 | QStringList allSecondNames; | ||
1150 | for ( ; it != --allNames.end(); ++it ) | ||
1151 | allSecondNames.append( *it ); | ||
1152 | |||
1153 | strMiddleName = allSecondNames.join(" "); | ||
1154 | strLastName = *(--allNames.end()); | ||
1270 | 1155 | ||
1271 | case NAME_L: | 1156 | } |
1272 | return strLastName; | ||
1273 | 1157 | ||
1274 | case NAME_S: | 1158 | qWarning(" strFirstName: %s", strFirstName.latin1()); |
1275 | return strSuffix; | 1159 | qWarning(" strMiddleName: %s", strMiddleName.latin1()); |
1160 | qWarning(" strLastName: %s", strLastName.latin1()); | ||
1161 | qWarning(" strSuffix: %s", strSuffix.latin1()); | ||
1162 | qWarning(" strTitle: %s", strTitle.latin1()); | ||
1276 | 1163 | ||
1164 | switch (type) { | ||
1165 | case NAME_FL: | ||
1166 | return strFirstName + " " + strLastName; | ||
1167 | |||
1168 | case NAME_LF: | ||
1169 | return strLastName + ", " + strFirstName; | ||
1170 | |||
1171 | case NAME_LFM: | ||
1172 | return strLastName + ", " + strFirstName + " " + strMiddleName; | ||
1173 | |||
1174 | case NAME_FMLS: | ||
1175 | return strFirstName + " " + strMiddleName + " " + strLastName + " " + strSuffix; | ||
1176 | |||
1177 | case NAME_F: | ||
1178 | return strFirstName; | ||
1179 | |||
1180 | case NAME_M: | ||
1181 | return strMiddleName; | ||
1182 | |||
1183 | case NAME_L: | ||
1184 | return strLastName; | ||
1185 | |||
1186 | case NAME_S: | ||
1187 | return strSuffix; | ||
1188 | |||
1277 | } | 1189 | } |
1278 | return QString::null; | 1190 | return QString::null; |
1279 | } | 1191 | } |
1280 | 1192 | ||
1281 | void ContactEditor::cleanupFields() { | 1193 | void ContactEditor::cleanupFields() { |
1282 | QStringList::Iterator it = slChooserValues.begin(); | 1194 | QStringList::Iterator it = slChooserValues.begin(); |
1283 | 1195 | ||
1284 | for ( int i = 0; it != slChooserValues.end(); i++, ++it ) { | 1196 | for ( int i = 0; it != slChooserValues.end(); i++, ++it ) { |
1285 | (*it) = ""; | 1197 | (*it) = ""; |
1286 | } | 1198 | } |
1287 | 1199 | ||
1288 | for ( int i = 0; i < 7; i++ ) { | 1200 | for ( int i = 0; i < 7; i++ ) { |
1289 | slHomeAddress[i] = ""; | 1201 | slHomeAddress[i] = ""; |
1290 | slBusinessAddress[i] = ""; | 1202 | slBusinessAddress[i] = ""; |
1291 | } | 1203 | } |
1292 | 1204 | ||
1293 | QListIterator<QLineEdit> itLV( listValue ); | 1205 | QListIterator<QLineEdit> itLV( listValue ); |
1294 | for ( ; itLV.current(); ++itLV ) { | 1206 | for ( ; itLV.current(); ++itLV ) { |
1295 | (*itLV)->setText( "" ); | 1207 | (*itLV)->setText( "" ); |
1296 | } | 1208 | } |
1297 | 1209 | ||
1298 | txtFirstName->setText(""); | 1210 | txtFirstName->setText(""); |
1299 | txtMiddleName->setText(""); | 1211 | txtMiddleName->setText(""); |
1300 | txtLastName->setText(""); | 1212 | txtLastName->setText(""); |
1301 | txtSuffix->setText(""); | 1213 | txtSuffix->setText(""); |
1302 | txtNote->setText(""); | 1214 | txtNote->setText(""); |
1303 | txtFullName->setText(""); | 1215 | txtFullName->setText(""); |
1304 | txtJobTitle->setText(""); | 1216 | txtJobTitle->setText(""); |
1305 | txtOrganization->setText(""); | 1217 | txtOrganization->setText(""); |
1306 | txtChooserField1->setText(""); | 1218 | txtChooserField1->setText(""); |
1307 | txtChooserField2->setText(""); | 1219 | txtChooserField2->setText(""); |
1308 | txtChooserField3->setText(""); | 1220 | txtChooserField3->setText(""); |
1309 | txtAddress->setText(""); | 1221 | txtAddress->setText(""); |
1310 | txtCity->setText(""); | 1222 | txtCity->setText(""); |
1311 | txtState->setText(""); | 1223 | txtState->setText(""); |
1312 | txtZip->setText(""); | 1224 | txtZip->setText(""); |
1313 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 1225 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
1314 | txtTmp->setText(""); | 1226 | txtTmp->setText(""); |
1315 | txtTmp = cmbFileAs->lineEdit(); | 1227 | txtTmp = cmbFileAs->lineEdit(); |
1316 | txtTmp->setText(""); | 1228 | txtTmp->setText(""); |
1317 | 1229 | ||
1318 | } | 1230 | } |
1319 | 1231 | ||
1320 | void ContactEditor::setEntry( const OContact &entry ) { | 1232 | void ContactEditor::setEntry( const OContact &entry ) { |
1321 | 1233 | ||
1322 | initializing = true; | 1234 | initializing = true; |
1323 | 1235 | ||
1324 | cleanupFields(); | 1236 | cleanupFields(); |
1325 | 1237 | ||
1326 | ent = entry; | 1238 | ent = entry; |
1327 | 1239 | ||
1328 | emails = QStringList(ent.emailList()); | 1240 | emails = QStringList(ent.emailList()); |
1329 | defaultEmail = ent.defaultEmail(); | 1241 | defaultEmail = ent.defaultEmail(); |
1330 | if (defaultEmail.isEmpty()) defaultEmail = emails[0]; | 1242 | if (defaultEmail.isEmpty()) defaultEmail = emails[0]; |
1331 | qDebug("default email=%s",defaultEmail.latin1()); | 1243 | qDebug("default email=%s",defaultEmail.latin1()); |
1332 | 1244 | ||
1333 | useFullName = false; | 1245 | useFullName = false; |
1334 | txtFirstName->setText( ent.firstName() ); | 1246 | txtFirstName->setText( ent.firstName() ); |
1335 | txtMiddleName->setText( ent.middleName() ); | 1247 | txtMiddleName->setText( ent.middleName() ); |
1336 | txtLastName->setText( ent.lastName() ); | 1248 | txtLastName->setText( ent.lastName() ); |
1337 | txtSuffix->setText( ent.suffix() ); | 1249 | txtSuffix->setText( ent.suffix() ); |
1338 | 1250 | ||
1339 | QString *tmpString = new QString; | 1251 | // QString *tmpString = new QString; |
1340 | *tmpString = ent.firstName() + " " + ent.middleName() + | 1252 | // *tmpString = ent.firstName() + " " + ent.middleName() + |
1341 | + " " + ent.lastName() + " " + ent.suffix(); | 1253 | // + " " + ent.lastName() + " " + ent.suffix(); |
1342 | 1254 | //txtFullName->setText( tmpString->simplifyWhiteSpace() ); | |
1343 | txtFullName->setText( tmpString->simplifyWhiteSpace() ); | 1255 | |
1344 | 1256 | // Lastnames with multiple words need to be protected by a comma ! | |
1257 | if ( ent.lastName().contains( ' ', TRUE ) ) | ||
1258 | txtFullName->setText( ent.lastName() + ", " + ent.firstName() + " " + ent.middleName() ); | ||
1259 | else | ||
1260 | txtFullName->setText( ent.firstName() + " " + ent.middleName() + " " + ent.lastName() ); | ||
1261 | |||
1345 | cmbFileAs->setEditText( ent.fileAs() ); | 1262 | cmbFileAs->setEditText( ent.fileAs() ); |
1346 | 1263 | ||
1347 | //if (hasTitle) | 1264 | //if (hasTitle) |
1348 | txtJobTitle->setText( ent.jobTitle() ); | 1265 | txtJobTitle->setText( ent.jobTitle() ); |
1349 | 1266 | ||
1350 | //if (hasCompany) | 1267 | //if (hasCompany) |
1351 | txtOrganization->setText( ent.company() ); | 1268 | txtOrganization->setText( ent.company() ); |
1352 | 1269 | ||
1353 | //if (hasNotes) | 1270 | //if (hasNotes) |
1354 | txtNote->setText( ent.notes() ); | 1271 | txtNote->setText( ent.notes() ); |
1355 | 1272 | ||
1356 | //if (hasStreet) { | 1273 | //if (hasStreet) { |
1357 | slHomeAddress[0] = ent.homeStreet(); | 1274 | slHomeAddress[0] = ent.homeStreet(); |
1358 | slBusinessAddress[0] = ent.businessStreet(); | 1275 | slBusinessAddress[0] = ent.businessStreet(); |
1359 | //} | 1276 | //} |
1360 | 1277 | ||
1361 | //if (hasCity) { | 1278 | //if (hasCity) { |
1362 | slHomeAddress[3] = ent.homeCity(); | 1279 | slHomeAddress[3] = ent.homeCity(); |
1363 | slBusinessAddress[3] = ent.businessCity(); | 1280 | slBusinessAddress[3] = ent.businessCity(); |
1364 | //} | 1281 | //} |
1365 | 1282 | ||
1366 | //if (hasState) { | 1283 | //if (hasState) { |
1367 | slHomeAddress[4] = ent.homeState(); | 1284 | slHomeAddress[4] = ent.homeState(); |
1368 | slBusinessAddress[4] = ent.businessState(); | 1285 | slBusinessAddress[4] = ent.businessState(); |
1369 | //} | 1286 | //} |
1370 | 1287 | ||
1371 | //if (hasZip) { | 1288 | //if (hasZip) { |
1372 | slHomeAddress[5] = ent.homeZip(); | 1289 | slHomeAddress[5] = ent.homeZip(); |
1373 | slBusinessAddress[5] = ent.businessZip(); | 1290 | slBusinessAddress[5] = ent.businessZip(); |
1374 | //} | 1291 | //} |
1375 | 1292 | ||
1376 | //if (hasCountry) { | 1293 | //if (hasCountry) { |
1377 | slHomeAddress[6] = ent.homeCountry(); | 1294 | slHomeAddress[6] = ent.homeCountry(); |
1378 | slBusinessAddress[6] = ent.businessCountry(); | 1295 | slBusinessAddress[6] = ent.businessCountry(); |
1379 | //} | 1296 | //} |
1380 | 1297 | ||
1381 | QStringList::ConstIterator it; | 1298 | QStringList::ConstIterator it; |
1382 | QListIterator<QLineEdit> itLE( listValue ); | 1299 | QListIterator<QLineEdit> itLE( listValue ); |
1383 | for ( it = slDynamicEntries.begin(); itLE.current()/* != slDynamicEntries.end()*/; ++it, ++itLE) { | 1300 | for ( it = slDynamicEntries.begin(); itLE.current()/* != slDynamicEntries.end()*/; ++it, ++itLE) { |
1384 | 1301 | ||
1385 | qWarning(" Filling dynamic Field: %s", (*it).latin1() ); | 1302 | qWarning(" Filling dynamic Field: %s", (*it).latin1() ); |
1386 | 1303 | ||
1387 | if ( *it == "Department" ) | 1304 | if ( *it == "Department" ) |
1388 | (*itLE)->setText( ent.department() ); | 1305 | (*itLE)->setText( ent.department() ); |
1389 | 1306 | ||
1390 | if ( *it == "Company" ) | 1307 | if ( *it == "Company" ) |
1391 | (*itLE)->setText( ent.company() ); | 1308 | (*itLE)->setText( ent.company() ); |
1392 | 1309 | ||
1393 | if ( *it == "Office" ) | 1310 | if ( *it == "Office" ) |
1394 | (*itLE)->setText( ent.office() ); | 1311 | (*itLE)->setText( ent.office() ); |
1395 | 1312 | ||
1396 | if ( *it == "Profession" ) | 1313 | if ( *it == "Profession" ) |
1397 | (*itLE)->setText( ent.profession() ); | 1314 | (*itLE)->setText( ent.profession() ); |
1398 | 1315 | ||
1399 | if ( *it == "Assistant" ) | 1316 | if ( *it == "Assistant" ) |
1400 | (*itLE)->setText( ent.assistant() ); | 1317 | (*itLE)->setText( ent.assistant() ); |
1401 | 1318 | ||
1402 | if ( *it == "Manager" ) | 1319 | if ( *it == "Manager" ) |
1403 | (*itLE)->setText( ent.manager() ); | 1320 | (*itLE)->setText( ent.manager() ); |
1404 | 1321 | ||
1405 | if ( *it == "Spouse" ) | 1322 | if ( *it == "Spouse" ) |
1406 | (*itLE)->setText( ent.spouse() ); | 1323 | (*itLE)->setText( ent.spouse() ); |
1407 | 1324 | ||
1408 | if ( *it == "Nickname" ){ | 1325 | if ( *it == "Nickname" ){ |
1409 | qWarning("**** Nichname: %s", ent.nickname().latin1() ); | 1326 | qWarning("**** Nichname: %s", ent.nickname().latin1() ); |
1410 | (*itLE)->setText( ent.nickname() ); | 1327 | (*itLE)->setText( ent.nickname() ); |
1411 | } | 1328 | } |
1412 | 1329 | ||
1413 | if ( *it == "Children" ) | 1330 | if ( *it == "Children" ) |
1414 | (*itLE)->setText( ent.children() ); | 1331 | (*itLE)->setText( ent.children() ); |
1415 | 1332 | ||
1416 | } | 1333 | } |
1417 | 1334 | ||
1418 | QStringList::Iterator itV; | 1335 | QStringList::Iterator itV; |
1419 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { | 1336 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { |
1420 | 1337 | ||
1421 | if ( ( *it == "Business Phone") || ( *it == "Work Phone" ) ) | 1338 | if ( ( *it == "Business Phone") || ( *it == "Work Phone" ) ) |
1422 | *itV = ent.businessPhone(); | 1339 | *itV = ent.businessPhone(); |
1423 | /* | 1340 | /* |
1424 | if ( *it == "Business 2 Phone" ) | 1341 | if ( *it == "Business 2 Phone" ) |
1425 | *itV = ent.business2Phone(); | 1342 | *itV = ent.business2Phone(); |
1426 | */ | 1343 | */ |
1427 | if ( ( *it == "Business Fax") || ( *it == "Work Fax" ) ) | 1344 | if ( ( *it == "Business Fax") || ( *it == "Work Fax" ) ) |
1428 | *itV = ent.businessFax(); | 1345 | *itV = ent.businessFax(); |
1429 | 1346 | ||
1430 | if ( ( *it == "Business Mobile" ) || ( *it == "work Mobile" ) ) | 1347 | if ( ( *it == "Business Mobile" ) || ( *it == "work Mobile" ) ) |
1431 | *itV = ent.businessMobile(); | 1348 | *itV = ent.businessMobile(); |
1432 | /* | 1349 | /* |
1433 | if ( *it == "Company Phone" ) | 1350 | if ( *it == "Company Phone" ) |
1434 | *itV = ent.companyPhone(); | 1351 | *itV = ent.companyPhone(); |
1435 | */ | 1352 | */ |
1436 | if ( *it == "Default Email" ) | 1353 | if ( *it == "Default Email" ) |
1437 | *itV = ent.defaultEmail(); | 1354 | *itV = ent.defaultEmail(); |
1438 | 1355 | ||
1439 | if ( *it == "Emails" ) | 1356 | if ( *it == "Emails" ) |
1440 | *itV = ent.emailList().join(", "); // :SX | 1357 | *itV = ent.emailList().join(", "); // :SX |
1441 | 1358 | ||
1442 | if ( *it == "Home Phone" ) | 1359 | if ( *it == "Home Phone" ) |
1443 | *itV = ent.homePhone(); | 1360 | *itV = ent.homePhone(); |
1444 | /* | 1361 | /* |
1445 | if ( *it == "Home 2 Phone" ) | 1362 | if ( *it == "Home 2 Phone" ) |
1446 | *itV = ent.home2Phone(); | 1363 | *itV = ent.home2Phone(); |
1447 | */ | 1364 | */ |
1448 | if ( *it == "Home Fax" ) | 1365 | if ( *it == "Home Fax" ) |
1449 | *itV = ent.homeFax(); | 1366 | *itV = ent.homeFax(); |
1450 | 1367 | ||
1451 | if ( *it == "Home Mobile" ) | 1368 | if ( *it == "Home Mobile" ) |
1452 | *itV = ent.homeMobile(); | 1369 | *itV = ent.homeMobile(); |
1453 | /* | 1370 | /* |
1454 | if ( *it == "Car Phone" ) | 1371 | if ( *it == "Car Phone" ) |
1455 | *itV = ent.carPhone(); | 1372 | *itV = ent.carPhone(); |
1456 | 1373 | ||
1457 | if ( *it == "ISDN Phone" ) | 1374 | if ( *it == "ISDN Phone" ) |
1458 | *itV = ent.ISDNPhone(); | 1375 | *itV = ent.ISDNPhone(); |
1459 | 1376 | ||
1460 | if ( *it == "Other Phone" ) | 1377 | if ( *it == "Other Phone" ) |
1461 | *itV = ent.otherPhone(); | 1378 | *itV = ent.otherPhone(); |
1462 | */ | 1379 | */ |
1463 | if ( ( *it == "Business Pager" ) || ( *it == "Work Pager" ) ) | 1380 | if ( ( *it == "Business Pager" ) || ( *it == "Work Pager" ) ) |
1464 | *itV = ent.businessPager(); | 1381 | *itV = ent.businessPager(); |
1465 | /* | 1382 | /* |
1466 | if ( *it == "Home Pager") | 1383 | if ( *it == "Home Pager") |
1467 | *itV = ent.homePager(); | 1384 | *itV = ent.homePager(); |
1468 | 1385 | ||
1469 | if ( *it == "AIM IM" ) | 1386 | if ( *it == "AIM IM" ) |
1470 | *itV = ent.AIMIM(); | 1387 | *itV = ent.AIMIM(); |
1471 | 1388 | ||
1472 | if ( *it == "ICQ IM" ) | 1389 | if ( *it == "ICQ IM" ) |
1473 | *itV = ent.ICQIM(); | 1390 | *itV = ent.ICQIM(); |
1474 | 1391 | ||
1475 | if ( *it == "Jabber IM" ) | 1392 | if ( *it == "Jabber IM" ) |
1476 | *itV = ent.jabberIM(); | 1393 | *itV = ent.jabberIM(); |
1477 | 1394 | ||
1478 | if ( *it == "MSN IM" ) | 1395 | if ( *it == "MSN IM" ) |
1479 | *itV = ent.MSNIM(); | 1396 | *itV = ent.MSNIM(); |
1480 | 1397 | ||
1481 | if ( *it == "Yahoo IM" ) | 1398 | if ( *it == "Yahoo IM" ) |
1482 | *itV = ent.yahooIM(); | 1399 | *itV = ent.yahooIM(); |
1483 | */ | 1400 | */ |
1484 | if ( *it == "Home Web Page" ) | 1401 | if ( *it == "Home Web Page" ) |
1485 | *itV = ent.homeWebpage(); | 1402 | *itV = ent.homeWebpage(); |
1486 | 1403 | ||
1487 | if ( ( *it == "Business WebPage" ) || ( *it == "Work Web Page" ) ) | 1404 | if ( ( *it == "Business WebPage" ) || ( *it == "Work Web Page" ) ) |
1488 | *itV = ent.businessWebpage(); | 1405 | *itV = ent.businessWebpage(); |
1489 | 1406 | ||
1490 | 1407 | ||
1491 | } | 1408 | } |
1492 | 1409 | ||
1493 | 1410 | ||
1494 | cmbCat->setCategories( ent.categories(), "Contacts", tr("Contacts") ); | 1411 | cmbCat->setCategories( ent.categories(), "Contacts", tr("Contacts") ); |
1495 | 1412 | ||
1496 | QString gender = ent.gender(); | 1413 | QString gender = ent.gender(); |
1497 | cmbGender->setCurrentItem( gender.toInt() ); | 1414 | cmbGender->setCurrentItem( gender.toInt() ); |
1498 | 1415 | ||
1499 | txtNote->setText( ent.notes() ); | 1416 | txtNote->setText( ent.notes() ); |
1500 | 1417 | ||
1501 | slotAddressTypeChange( cmbAddress->currentItem() ); | 1418 | slotAddressTypeChange( cmbAddress->currentItem() ); |
1502 | 1419 | ||
1503 | // Calling "show()" to arrange all widgets. Otherwise we will get | 1420 | // Calling "show()" to arrange all widgets. Otherwise we will get |
1504 | // a wrong position of the textfields and are unable to put our | 1421 | // a wrong position of the textfields and are unable to put our |
1505 | // default-email combo over it.. This is very ugly ! | 1422 | // default-email combo over it.. This is very ugly ! |
1506 | // Does anybody has a better solution ? | 1423 | // Does anybody has a better solution ? |
1507 | // Basically we should rethink the strategy to hide | 1424 | // Basically we should rethink the strategy to hide |
1508 | // a textfield with overwriting.. (se) | 1425 | // a textfield with overwriting.. (se) |
1509 | show(); | 1426 | show(); |
1510 | 1427 | ||
1511 | // Get combo-settings from contact and set preset.. | 1428 | // Get combo-settings from contact and set preset.. |
1512 | contactfields.loadFromRecord( ent ); | 1429 | contactfields.loadFromRecord( ent ); |
1513 | cmbChooserField1->setCurrentItem( contactfields.getFieldOrder(0, 7) ); | 1430 | cmbChooserField1->setCurrentItem( contactfields.getFieldOrder(0, 7) ); |
1514 | cmbChooserField2->setCurrentItem( contactfields.getFieldOrder(1, 9) ); | 1431 | cmbChooserField2->setCurrentItem( contactfields.getFieldOrder(1, 9) ); |
1515 | cmbChooserField3->setCurrentItem( contactfields.getFieldOrder(2, 0) ); | 1432 | cmbChooserField3->setCurrentItem( contactfields.getFieldOrder(2, 0) ); |
1516 | cmbChooserField4->setCurrentItem( contactfields.getFieldOrder(3, 6) ); | 1433 | cmbChooserField4->setCurrentItem( contactfields.getFieldOrder(3, 6) ); |
1517 | cmbAddress->setCurrentItem( contactfields.getFieldOrder(4, 1) ); | 1434 | cmbAddress->setCurrentItem( contactfields.getFieldOrder(4, 1) ); |
1518 | slotCmbChooser1Change( cmbChooserField1->currentItem() ); | 1435 | slotCmbChooser1Change( cmbChooserField1->currentItem() ); |
1519 | slotCmbChooser2Change( cmbChooserField2->currentItem() ); | 1436 | slotCmbChooser2Change( cmbChooserField2->currentItem() ); |
1520 | slotCmbChooser3Change( cmbChooserField3->currentItem() ); | 1437 | slotCmbChooser3Change( cmbChooserField3->currentItem() ); |
1521 | slotCmbChooser4Change( cmbChooserField4->currentItem() ); | 1438 | slotCmbChooser4Change( cmbChooserField4->currentItem() ); |
1522 | slotAddressTypeChange( cmbAddress->currentItem() ); | 1439 | slotAddressTypeChange( cmbAddress->currentItem() ); |
1523 | 1440 | ||
1524 | updateDatePicker(); | 1441 | updateDatePicker(); |
1525 | 1442 | ||
1526 | initializing = false; | 1443 | initializing = false; |
1527 | } | 1444 | } |
1528 | void ContactEditor::updateDatePicker() | 1445 | void ContactEditor::updateDatePicker() |
1529 | { | 1446 | { |
1530 | // Set DatePicker | 1447 | // Set DatePicker |
1531 | if ( !ent.birthday().isNull() ){ | 1448 | if ( !ent.birthday().isNull() ){ |
1532 | birthdayButton->setText( TimeString::numberDateString( ent.birthday() ) ); | 1449 | birthdayButton->setText( TimeString::numberDateString( ent.birthday() ) ); |
1533 | birthdayPicker->setDate( ent.birthday() ); | 1450 | birthdayPicker->setDate( ent.birthday() ); |
1534 | } else | 1451 | } else |
1535 | birthdayButton->setText( tr ("Unknown") ); | 1452 | birthdayButton->setText( tr ("Unknown") ); |
1536 | 1453 | ||
1537 | if ( !ent.anniversary().isNull() ){ | 1454 | if ( !ent.anniversary().isNull() ){ |
1538 | anniversaryButton->setText( TimeString::numberDateString( ent.anniversary() ) ); | 1455 | anniversaryButton->setText( TimeString::numberDateString( ent.anniversary() ) ); |
1539 | anniversaryPicker->setDate( ent.anniversary() ); | 1456 | anniversaryPicker->setDate( ent.anniversary() ); |
1540 | } else | 1457 | } else |
1541 | anniversaryButton->setText( tr ("Unknown") ); | 1458 | anniversaryButton->setText( tr ("Unknown") ); |
1542 | 1459 | ||
1543 | } | 1460 | } |
1544 | 1461 | ||
1545 | void ContactEditor::saveEntry() { | 1462 | void ContactEditor::saveEntry() { |
1546 | 1463 | ||
1547 | // Store current combo into contact | 1464 | // Store current combo into contact |
1548 | contactfields.saveToRecord( ent ); | 1465 | contactfields.saveToRecord( ent ); |
1549 | 1466 | ||
1550 | if ( useFullName ) { | 1467 | if ( useFullName ) { |
1551 | txtFirstName->setText( parseName( txtFullName->text(), NAME_F ) ); | 1468 | txtFirstName->setText( parseName( txtFullName->text(), NAME_F ) ); |
1552 | txtMiddleName->setText( parseName( txtFullName->text(), NAME_M ) ); | 1469 | txtMiddleName->setText( parseName( txtFullName->text(), NAME_M ) ); |
1553 | txtLastName->setText( parseName( txtFullName->text(), NAME_L ) ); | 1470 | txtLastName->setText( parseName( txtFullName->text(), NAME_L ) ); |
1554 | txtSuffix->setText( parseName( txtFullName->text(), NAME_S ) ); | 1471 | // txtSuffix->setText( parseName( txtFullName->text(), NAME_S ) ); |
1555 | 1472 | ||
1556 | useFullName = false; | 1473 | useFullName = false; |
1557 | } | 1474 | } |
1558 | 1475 | ||
1559 | ent.setFirstName( txtFirstName->text() ); | 1476 | ent.setFirstName( txtFirstName->text() ); |
1560 | ent.setLastName( txtLastName->text() ); | 1477 | ent.setLastName( txtLastName->text() ); |
1561 | ent.setMiddleName( txtMiddleName->text() ); | 1478 | ent.setMiddleName( txtMiddleName->text() ); |
1562 | ent.setSuffix( txtSuffix->text() ); | 1479 | ent.setSuffix( txtSuffix->text() ); |
1563 | 1480 | ||
1564 | ent.setFileAs( cmbFileAs->currentText() ); | 1481 | ent.setFileAs( cmbFileAs->currentText() ); |
1565 | 1482 | ||
1566 | ent.setCategories( cmbCat->currentCategories() ); | 1483 | ent.setCategories( cmbCat->currentCategories() ); |
1567 | 1484 | ||
1568 | 1485 | ||
1569 | //if (hasTitle) | 1486 | //if (hasTitle) |
1570 | ent.setJobTitle( txtJobTitle->text() ); | 1487 | ent.setJobTitle( txtJobTitle->text() ); |
1571 | 1488 | ||
1572 | //if (hasCompany) | 1489 | //if (hasCompany) |
1573 | ent.setCompany( txtOrganization->text() ); | 1490 | ent.setCompany( txtOrganization->text() ); |
1574 | 1491 | ||
1575 | //if (hasNotes) | 1492 | //if (hasNotes) |
1576 | ent.setNotes( txtNote->text() ); | 1493 | ent.setNotes( txtNote->text() ); |
1577 | 1494 | ||
1578 | //if (hasStreet) { | 1495 | //if (hasStreet) { |
1579 | ent.setHomeStreet( slHomeAddress[0] ); | 1496 | ent.setHomeStreet( slHomeAddress[0] ); |
1580 | ent.setBusinessStreet( slBusinessAddress[0] ); | 1497 | ent.setBusinessStreet( slBusinessAddress[0] ); |
1581 | //} | 1498 | //} |
1582 | 1499 | ||
1583 | //if (hasCity) { | 1500 | //if (hasCity) { |
1584 | ent.setHomeCity( slHomeAddress[3] ); | 1501 | ent.setHomeCity( slHomeAddress[3] ); |
1585 | ent.setBusinessCity( slBusinessAddress[3] ); | 1502 | ent.setBusinessCity( slBusinessAddress[3] ); |
1586 | //} | 1503 | //} |
1587 | 1504 | ||
1588 | //if (hasState) { | 1505 | //if (hasState) { |
1589 | ent.setHomeState( slHomeAddress[4] ); | 1506 | ent.setHomeState( slHomeAddress[4] ); |
1590 | ent.setBusinessState( slBusinessAddress[4] ); | 1507 | ent.setBusinessState( slBusinessAddress[4] ); |
1591 | //} | 1508 | //} |
1592 | 1509 | ||
1593 | //if (hasZip) { | 1510 | //if (hasZip) { |
1594 | ent.setHomeZip( slHomeAddress[5] ); | 1511 | ent.setHomeZip( slHomeAddress[5] ); |
1595 | ent.setBusinessZip( slBusinessAddress[5] ); | 1512 | ent.setBusinessZip( slBusinessAddress[5] ); |
1596 | //} | 1513 | //} |
1597 | 1514 | ||
1598 | //if (hasCountry) { | 1515 | //if (hasCountry) { |
1599 | ent.setHomeCountry( slHomeAddress[6] ); | 1516 | ent.setHomeCountry( slHomeAddress[6] ); |
1600 | ent.setBusinessCountry( slBusinessAddress[6] ); | 1517 | ent.setBusinessCountry( slBusinessAddress[6] ); |
1601 | //} | 1518 | //} |
1602 | 1519 | ||
1603 | QStringList::ConstIterator it; | 1520 | QStringList::ConstIterator it; |
1604 | QListIterator<QLineEdit> itLE( listValue ); | 1521 | QListIterator<QLineEdit> itLE( listValue ); |
1605 | for ( it = slDynamicEntries.begin(); itLE.current() && it != slDynamicEntries.end(); ++it, ++itLE) { | 1522 | for ( it = slDynamicEntries.begin(); itLE.current() && it != slDynamicEntries.end(); ++it, ++itLE) { |
1606 | 1523 | ||
1607 | if ( *it == "Department" ) | 1524 | if ( *it == "Department" ) |
1608 | ent.setDepartment( (*itLE)->text() ); | 1525 | ent.setDepartment( (*itLE)->text() ); |
1609 | 1526 | ||
1610 | if ( *it == "Company" ) | 1527 | if ( *it == "Company" ) |
1611 | ent.setCompany( (*itLE)->text() ); | 1528 | ent.setCompany( (*itLE)->text() ); |
1612 | 1529 | ||
1613 | if ( *it == "Office" ) | 1530 | if ( *it == "Office" ) |
1614 | ent.setOffice( (*itLE)->text() ); | 1531 | ent.setOffice( (*itLE)->text() ); |
1615 | 1532 | ||
1616 | if ( *it == "Profession" ) | 1533 | if ( *it == "Profession" ) |
1617 | ent.setProfession( (*itLE)->text() ); | 1534 | ent.setProfession( (*itLE)->text() ); |
1618 | 1535 | ||
1619 | if ( *it == "Assistant" ) | 1536 | if ( *it == "Assistant" ) |
1620 | ent.setAssistant( (*itLE)->text() ); | 1537 | ent.setAssistant( (*itLE)->text() ); |
1621 | 1538 | ||
1622 | if ( *it == "Manager" ) | 1539 | if ( *it == "Manager" ) |
1623 | ent.setManager( (*itLE)->text() ); | 1540 | ent.setManager( (*itLE)->text() ); |
1624 | 1541 | ||
1625 | if ( *it == "Spouse" ) | 1542 | if ( *it == "Spouse" ) |
1626 | ent.setSpouse( (*itLE)->text() ); | 1543 | ent.setSpouse( (*itLE)->text() ); |
1627 | 1544 | ||
1628 | if ( *it == "Nickname" ) | 1545 | if ( *it == "Nickname" ) |
1629 | ent.setNickname( (*itLE)->text() ); | 1546 | ent.setNickname( (*itLE)->text() ); |
1630 | 1547 | ||
1631 | if ( *it == "Children" ) | 1548 | if ( *it == "Children" ) |
1632 | ent.setChildren( (*itLE)->text() ); | 1549 | ent.setChildren( (*itLE)->text() ); |
1633 | 1550 | ||
1634 | } | 1551 | } |
1635 | 1552 | ||
1636 | 1553 | ||
1637 | QStringList::ConstIterator itV; | 1554 | QStringList::ConstIterator itV; |
1638 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { | 1555 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { |
1639 | 1556 | ||
1640 | if ( ( *it == "Business Phone" ) || ( *it == "Work Phone" ) ) | 1557 | if ( ( *it == "Business Phone" ) || ( *it == "Work Phone" ) ) |
1641 | ent.setBusinessPhone( *itV ); | 1558 | ent.setBusinessPhone( *itV ); |
1642 | 1559 | ||
1643 | if ( ( *it == "Business Fax" ) || ( *it == "Work Fax" ) ) | 1560 | if ( ( *it == "Business Fax" ) || ( *it == "Work Fax" ) ) |
1644 | ent.setBusinessFax( *itV ); | 1561 | ent.setBusinessFax( *itV ); |
1645 | 1562 | ||
1646 | if ( ( *it == "Business Mobile" ) || ( *it == "Work Mobile" ) ) | 1563 | if ( ( *it == "Business Mobile" ) || ( *it == "Work Mobile" ) ) |
1647 | ent.setBusinessMobile( *itV ); | 1564 | ent.setBusinessMobile( *itV ); |
1648 | 1565 | ||
1649 | if ( *it == "Emails" ){ | 1566 | if ( *it == "Emails" ){ |
1650 | QString allemail; | 1567 | QString allemail; |
1651 | QString defaultmail; | 1568 | QString defaultmail; |
1652 | parseEmailFrom( emails.join(","), defaultmail, allemail ); | 1569 | parseEmailFrom( emails.join(","), defaultmail, allemail ); |
1653 | if ( defaultEmail.isEmpty() ){ | 1570 | if ( defaultEmail.isEmpty() ){ |
1654 | qWarning("Default email was not set by user!"); | 1571 | qWarning("Default email was not set by user!"); |
1655 | qWarning("Using first email in list: %s", defaultmail.latin1()); | 1572 | qWarning("Using first email in list: %s", defaultmail.latin1()); |
1656 | ent.setDefaultEmail( defaultmail ); | 1573 | ent.setDefaultEmail( defaultmail ); |
1657 | } | 1574 | } |
1658 | ent.setEmails( allemail ); | 1575 | ent.setEmails( allemail ); |
1659 | } | 1576 | } |
1660 | 1577 | ||
1661 | if ( *it == "Default Email") | 1578 | if ( *it == "Default Email") |
1662 | ent.setDefaultEmail( defaultEmail /* *itV */ ); | 1579 | ent.setDefaultEmail( defaultEmail /* *itV */ ); |
1663 | 1580 | ||
1664 | if ( *it == "Home Phone" ) | 1581 | if ( *it == "Home Phone" ) |
1665 | ent.setHomePhone( *itV ); | 1582 | ent.setHomePhone( *itV ); |
1666 | 1583 | ||
1667 | if ( *it == "Home Fax" ) | 1584 | if ( *it == "Home Fax" ) |
1668 | ent.setHomeFax( *itV ); | 1585 | ent.setHomeFax( *itV ); |
1669 | 1586 | ||
1670 | if ( *it == "Home Mobile" ) | 1587 | if ( *it == "Home Mobile" ) |
1671 | ent.setHomeMobile( *itV ); | 1588 | ent.setHomeMobile( *itV ); |
1672 | 1589 | ||
1673 | if ( ( *it == "Business Pager" ) || ( *it == "Work Pager" ) ) | 1590 | if ( ( *it == "Business Pager" ) || ( *it == "Work Pager" ) ) |
1674 | ent.setBusinessPager( *itV ); | 1591 | ent.setBusinessPager( *itV ); |
1675 | 1592 | ||
1676 | if ( *it == "Home Web Page" ) | 1593 | if ( *it == "Home Web Page" ) |
1677 | ent.setHomeWebpage( *itV ); | 1594 | ent.setHomeWebpage( *itV ); |
1678 | 1595 | ||
1679 | if ( ( *it == "Business WebPage" ) || ( *it == "Work Web Page" ) ) | 1596 | if ( ( *it == "Business WebPage" ) || ( *it == "Work Web Page" ) ) |
1680 | ent.setBusinessWebpage( *itV ); | 1597 | ent.setBusinessWebpage( *itV ); |
1681 | 1598 | ||
1682 | 1599 | ||
1683 | } | 1600 | } |
1684 | 1601 | ||
1685 | int gender = cmbGender->currentItem(); | 1602 | int gender = cmbGender->currentItem(); |
1686 | ent.setGender( QString::number( gender ) ); | 1603 | ent.setGender( QString::number( gender ) ); |
1687 | 1604 | ||
1688 | QString str = txtNote->text(); | 1605 | QString str = txtNote->text(); |
1689 | if ( !str.isNull() ) | 1606 | if ( !str.isNull() ) |
1690 | ent.setNotes( str ); | 1607 | ent.setNotes( str ); |
1691 | 1608 | ||
1692 | } | 1609 | } |
1693 | 1610 | ||
1694 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, | 1611 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, |
1695 | QString &strAll ) | 1612 | QString &strAll ) |
1696 | { | 1613 | { |
1697 | int where, | 1614 | int where, |
1698 | start; | 1615 | start; |
1699 | if ( txt.isEmpty() ) | 1616 | if ( txt.isEmpty() ) |
1700 | return; | 1617 | return; |
1701 | // find the first | 1618 | // find the first |
1702 | where = txt.find( ',' ); | 1619 | where = txt.find( ',' ); |
1703 | if ( where < 0 ) { | 1620 | if ( where < 0 ) { |
1704 | strDefaultEmail = txt; | 1621 | strDefaultEmail = txt; |
1705 | strAll = txt; | 1622 | strAll = txt; |
1706 | } else { | 1623 | } else { |
1707 | strDefaultEmail = txt.left( where ).stripWhiteSpace(); | 1624 | strDefaultEmail = txt.left( where ).stripWhiteSpace(); |
1708 | strAll = strDefaultEmail; | 1625 | strAll = strDefaultEmail; |
1709 | while ( where > -1 ) { | 1626 | while ( where > -1 ) { |
1710 | strAll.append(" "); | 1627 | strAll.append(" "); |
1711 | start = where; | 1628 | start = where; |
1712 | where = txt.find( ',', where + 1 ); | 1629 | where = txt.find( ',', where + 1 ); |
1713 | if ( where > - 1 ) | 1630 | if ( where > - 1 ) |
1714 | strAll.append( txt.mid(start + 1, where - start - 1).stripWhiteSpace() ); | 1631 | strAll.append( txt.mid(start + 1, where - start - 1).stripWhiteSpace() ); |
1715 | else // grab until the end... | 1632 | else // grab until the end... |
1716 | strAll.append( txt.right(txt.length() - start - 1).stripWhiteSpace() ); | 1633 | strAll.append( txt.right(txt.length() - start - 1).stripWhiteSpace() ); |
1634 | } | ||
1717 | } | 1635 | } |
1718 | } | ||
1719 | } | 1636 | } |
1720 | 1637 | ||
1721 | void parseEmailTo( const QString &strDefaultEmail, | 1638 | void parseEmailTo( const QString &strDefaultEmail, |
1722 | const QString &strOtherEmail, QString &strBack ) | 1639 | const QString &strOtherEmail, QString &strBack ) |
1723 | { | 1640 | { |
1724 | // create a comma dilimeted set of emails... | 1641 | // create a comma dilimeted set of emails... |
1725 | // use the power of short circuiting... | 1642 | // use the power of short circuiting... |
1726 | bool foundDefault = false; | 1643 | bool foundDefault = false; |
1727 | QString strTmp; | 1644 | QString strTmp; |
1728 | int start = 0; | 1645 | int start = 0; |
1729 | int where; | 1646 | int where; |
1730 | // start at the beginng. | 1647 | // start at the beginng. |
1731 | strBack = strDefaultEmail; | 1648 | strBack = strDefaultEmail; |
1732 | where = 0; | 1649 | where = 0; |
1733 | while ( where > -1 ) { | 1650 | while ( where > -1 ) { |
1734 | start = where; | 1651 | start = where; |
1735 | where = strOtherEmail.find( ' ', where + 1 ); | 1652 | where = strOtherEmail.find( ' ', where + 1 ); |
1736 | if ( where > 0 ) { | 1653 | if ( where > 0 ) { |
1737 | strTmp = strOtherEmail.mid( start, where - start ).stripWhiteSpace(); | 1654 | strTmp = strOtherEmail.mid( start, where - start ).stripWhiteSpace(); |
1738 | } else | 1655 | } else |
1739 | strTmp = strOtherEmail.right( strOtherEmail.length() - start ).stripWhiteSpace(); | 1656 | strTmp = strOtherEmail.right( strOtherEmail.length() - start ).stripWhiteSpace(); |
1740 | if ( foundDefault || strTmp != strDefaultEmail ) { | 1657 | if ( foundDefault || strTmp != strDefaultEmail ) { |
1741 | strBack.append( ", " ); | 1658 | strBack.append( ", " ); |
1742 | strBack.append( strTmp ); | 1659 | strBack.append( strTmp ); |
1743 | } else | 1660 | } else |
1744 | foundDefault = true; | 1661 | foundDefault = true; |
1745 | } | 1662 | } |
1746 | } | 1663 | } |
1747 | 1664 | ||
1748 | 1665 | ||
1749 | static inline bool containsAlphaNum( const QString &str ) | 1666 | static inline bool containsAlphaNum( const QString &str ) |
1750 | { | 1667 | { |
1751 | int i, | 1668 | int i, |
1752 | count = str.length(); | 1669 | count = str.length(); |
1753 | for ( i = 0; i < count; i++ ) | 1670 | for ( i = 0; i < count; i++ ) |
1754 | if ( !str[i].isSpace() ) | 1671 | if ( !str[i].isSpace() ) |
1755 | return TRUE; | 1672 | return TRUE; |
1756 | return FALSE; | 1673 | return FALSE; |
1757 | } | 1674 | } |
1758 | 1675 | ||
1759 | static inline bool constainsWhiteSpace( const QString &str ) | 1676 | static inline bool constainsWhiteSpace( const QString &str ) |
1760 | { | 1677 | { |
1761 | int i, | 1678 | int i, |
1762 | count = str.length(); | 1679 | count = str.length(); |
1763 | for (i = 0; i < count; i++ ) | 1680 | for (i = 0; i < count; i++ ) |
1764 | if ( str[i].isSpace() ) | 1681 | if ( str[i].isSpace() ) |
1765 | return TRUE; | 1682 | return TRUE; |
1766 | return FALSE; | 1683 | return FALSE; |
1767 | } | 1684 | } |
1768 | 1685 | ||
1769 | void ContactEditor::setPersonalView( bool personal ) | 1686 | void ContactEditor::setPersonalView( bool personal ) |
1770 | { | 1687 | { |
1771 | m_personalView = personal; | 1688 | m_personalView = personal; |
1772 | 1689 | ||
1773 | // Currently disbled due to the fact that | 1690 | // Currently disbled due to the fact that |
1774 | // show will not work... | 1691 | // show will not work... |
1775 | return; | 1692 | return; |
1776 | 1693 | ||
1777 | if ( personal ){ | 1694 | if ( personal ){ |
1778 | cmbCat->hide(); | 1695 | cmbCat->hide(); |
1779 | labCat->hide(); | 1696 | labCat->hide(); |
1780 | 1697 | ||
1781 | } else{ | 1698 | } else{ |
1782 | cmbCat->show(); | 1699 | cmbCat->show(); |
1783 | labCat->show(); | 1700 | labCat->show(); |
1784 | } | 1701 | } |
1785 | } | 1702 | } |
1786 | 1703 | ||
1787 | void ContactEditor::slotAnniversaryDateChanged( int year, int month, int day) | 1704 | void ContactEditor::slotAnniversaryDateChanged( int year, int month, int day) |
1788 | { | 1705 | { |
1789 | QDate date; | 1706 | QDate date; |
1790 | date.setYMD( year, month, day ); | 1707 | date.setYMD( year, month, day ); |
1791 | QString dateString = TimeString::numberDateString( date ); | 1708 | QString dateString = TimeString::numberDateString( date ); |
1792 | anniversaryButton->setText( dateString ); | 1709 | anniversaryButton->setText( dateString ); |
1793 | ent.setAnniversary ( date ); | 1710 | ent.setAnniversary ( date ); |
1794 | } | 1711 | } |
1795 | 1712 | ||
1796 | void ContactEditor::slotBirthdayDateChanged( int year, int month, int day) | 1713 | void ContactEditor::slotBirthdayDateChanged( int year, int month, int day) |
1797 | { | 1714 | { |
1798 | QDate date; | 1715 | QDate date; |
1799 | date.setYMD( year, month, day ); | 1716 | date.setYMD( year, month, day ); |
1800 | QString dateString = TimeString::numberDateString( date ); | 1717 | QString dateString = TimeString::numberDateString( date ); |
1801 | birthdayButton->setText( dateString ); | 1718 | birthdayButton->setText( dateString ); |
1802 | ent.setBirthday ( date ); | 1719 | ent.setBirthday ( date ); |
1803 | } | 1720 | } |
1804 | 1721 | ||
1805 | void ContactEditor::slotRemoveBirthday() | 1722 | void ContactEditor::slotRemoveBirthday() |
1806 | { | 1723 | { |
1807 | qWarning("void ContactEditor::slotRemoveBirthday()"); | 1724 | qWarning("void ContactEditor::slotRemoveBirthday()"); |
1808 | ent.setBirthday( QDate() ); | 1725 | ent.setBirthday( QDate() ); |
1809 | updateDatePicker(); | 1726 | updateDatePicker(); |
1810 | } | 1727 | } |
1811 | 1728 | ||
1812 | void ContactEditor::slotRemoveAnniversary() | 1729 | void ContactEditor::slotRemoveAnniversary() |
1813 | { | 1730 | { |
1814 | qWarning("void ContactEditor::slotRemoveAnniversary()"); | 1731 | qWarning("void ContactEditor::slotRemoveAnniversary()"); |
1815 | ent.setAnniversary( QDate() ); | 1732 | ent.setAnniversary( QDate() ); |
1816 | updateDatePicker(); | 1733 | updateDatePicker(); |
1817 | } | 1734 | } |
diff --git a/core/pim/addressbook/version.h b/core/pim/addressbook/version.h index 3becfdc..c2ead05 100644 --- a/core/pim/addressbook/version.h +++ b/core/pim/addressbook/version.h | |||
@@ -1,10 +1,10 @@ | |||
1 | #ifndef _VERSION_H_ | 1 | #ifndef _VERSION_H_ |
2 | #define _VERSION_H_ | 2 | #define _VERSION_H_ |
3 | 3 | ||
4 | #define MAINVERSION "0" | 4 | #define MAINVERSION "0" |
5 | #define SUBVERSION "2" | 5 | #define SUBVERSION "3" |
6 | #define PATCHVERSION "2" | 6 | #define PATCHVERSION "0" |
7 | 7 | ||
8 | #define APPNAME "OPIE_ADDRESSBOOK" | 8 | #define APPNAME "OPIE_ADDRESSBOOK" |
9 | 9 | ||
10 | #endif | 10 | #endif |