author | eilers <eilers> | 2003-03-07 14:33:36 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-03-07 14:33:36 (UTC) |
commit | eeb28ead6d3050d662783696661d9360a049104f (patch) (unidiff) | |
tree | 3a9f27185ecddcd1fe7a9dd20db49f87b4841556 | |
parent | 78a2773ef477a4ab7327350e5f1f6c07428ad8a4 (diff) | |
download | opie-eeb28ead6d3050d662783696661d9360a049104f.zip opie-eeb28ead6d3050d662783696661d9360a049104f.tar.gz opie-eeb28ead6d3050d662783696661d9360a049104f.tar.bz2 |
Removed unused files and starting with WhatsThis..
-rw-r--r-- | core/pim/addressbook/addresssettings.cpp | 136 | ||||
-rw-r--r-- | core/pim/addressbook/addresssettings.h | 47 | ||||
-rw-r--r-- | core/pim/addressbook/addresssettingsbase.ui | 170 | ||||
-rw-r--r-- | core/pim/addressbook/configdlg.cpp | 3 | ||||
-rw-r--r-- | core/pim/addressbook/configdlg_base.ui | 75 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 17 |
6 files changed, 92 insertions, 356 deletions
diff --git a/core/pim/addressbook/addresssettings.cpp b/core/pim/addressbook/addresssettings.cpp deleted file mode 100644 index 2a9413c..0000000 --- a/core/pim/addressbook/addresssettings.cpp +++ b/dev/null | |||
@@ -1,136 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qt Palmtop Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | |||
22 | #include "addresssettings.h" | ||
23 | |||
24 | #include <qpe/config.h> | ||
25 | #include <opie/ocontact.h> | ||
26 | |||
27 | #include <qfile.h> | ||
28 | #include <qlistbox.h> | ||
29 | |||
30 | #include <stdlib.h> | ||
31 | |||
32 | AddressSettings::AddressSettings( QWidget *parent, const char *name ) | ||
33 | : AddressSettingsBase( parent, name, TRUE ) | ||
34 | { | ||
35 | init(); | ||
36 | } | ||
37 | |||
38 | AddressSettings::~AddressSettings() | ||
39 | { | ||
40 | } | ||
41 | |||
42 | void AddressSettings::init() | ||
43 | { | ||
44 | QStringList slFields = OContact::trfields(); | ||
45 | // Make this match what is in initFields | ||
46 | slFields.remove( tr("Name Title") ); | ||
47 | slFields.remove( tr("First Name") ); | ||
48 | slFields.remove( tr("Last Name") ); | ||
49 | slFields.remove( tr("File As") ); | ||
50 | slFields.remove( tr("Default Email") ); | ||
51 | slFields.remove( tr("Notes") ); | ||
52 | slFields.remove( tr("Gender") ); | ||
53 | |||
54 | |||
55 | for( QStringList::Iterator it = slFields.begin(); | ||
56 | it != slFields.end(); ++it ) { | ||
57 | fieldListBox->insertItem( *it ); | ||
58 | } | ||
59 | |||
60 | Config cfg( "AddressBook" ); | ||
61 | |||
62 | cfg.setGroup( "Version" ); | ||
63 | int version; | ||
64 | version = cfg.readNumEntry( "version" ); | ||
65 | if ( version >= ADDRESSVERSION ) { | ||
66 | int i = 0; | ||
67 | int p = 0; | ||
68 | cfg.setGroup( "ImportantCategory" ); | ||
69 | QString zn = cfg.readEntry( "Category" + QString::number(i), | ||
70 | QString::null ); | ||
71 | while ( !zn.isNull() ) { | ||
72 | for ( int m = i; m < (int)fieldListBox->count(); m++ ) { | ||
73 | if ( fieldListBox->text( m ) == zn ) { | ||
74 | if ( m != p ) { | ||
75 | fieldListBox->removeItem( m ); | ||
76 | fieldListBox->insertItem( zn, p ); | ||
77 | } | ||
78 | p++; | ||
79 | break; | ||
80 | } | ||
81 | } | ||
82 | zn = cfg.readEntry( "Category" + QString::number(++i), | ||
83 | QString::null ); | ||
84 | } | ||
85 | |||
86 | fieldListBox->setCurrentItem( 0 ); | ||
87 | } else { | ||
88 | QString str; | ||
89 | str = getenv("HOME"); | ||
90 | |||
91 | str += "/Settings/AddressBook.conf"; | ||
92 | QFile::remove( str ); | ||
93 | } | ||
94 | } | ||
95 | |||
96 | void AddressSettings::itemUp() | ||
97 | { | ||
98 | int i = fieldListBox->currentItem(); | ||
99 | if ( i > 0 ) { | ||
100 | QString item = fieldListBox->currentText(); | ||
101 | fieldListBox->removeItem( i ); | ||
102 | fieldListBox->insertItem( item, i-1 ); | ||
103 | fieldListBox->setCurrentItem( i-1 ); | ||
104 | } | ||
105 | } | ||
106 | |||
107 | void AddressSettings::itemDown() | ||
108 | { | ||
109 | int i = fieldListBox->currentItem(); | ||
110 | if ( i < (int)fieldListBox->count() - 1 ) { | ||
111 | QString item = fieldListBox->currentText(); | ||
112 | fieldListBox->removeItem( i ); | ||
113 | fieldListBox->insertItem( item, i+1 ); | ||
114 | fieldListBox->setCurrentItem( i+1 ); | ||
115 | } | ||
116 | } | ||
117 | |||
118 | void AddressSettings::accept() | ||
119 | { | ||
120 | save(); | ||
121 | QDialog::accept(); | ||
122 | } | ||
123 | |||
124 | |||
125 | void AddressSettings::save() | ||
126 | { | ||
127 | Config cfg( "AddressBook" ); | ||
128 | cfg.setGroup( "Version" ); | ||
129 | // *** To change the version change it here... | ||
130 | cfg.writeEntry( "version", QString::number(ADDRESSVERSION) ); | ||
131 | cfg.setGroup( "ImportantCategory" ); | ||
132 | |||
133 | for ( int i = 0; i < (int)fieldListBox->count(); i++ ) { | ||
134 | cfg.writeEntry( "Category"+QString::number(i), fieldListBox->text(i) ); | ||
135 | } | ||
136 | } | ||
diff --git a/core/pim/addressbook/addresssettings.h b/core/pim/addressbook/addresssettings.h deleted file mode 100644 index 0fdfa77..0000000 --- a/core/pim/addressbook/addresssettings.h +++ b/dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qt Palmtop Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | #ifndef _ADDRESSSETTINGS_H_ | ||
22 | #define _ADDRESSSETTINGS_H_ | ||
23 | |||
24 | #include <qlist.h> | ||
25 | #include <qstringlist.h> | ||
26 | #include "addresssettingsbase.h" | ||
27 | |||
28 | const int ADDRESSVERSION = 3; | ||
29 | |||
30 | class AddressSettings : public AddressSettingsBase | ||
31 | { | ||
32 | Q_OBJECT | ||
33 | public: | ||
34 | AddressSettings( QWidget *parent = 0, const char *name = 0 ); | ||
35 | ~AddressSettings(); | ||
36 | |||
37 | protected: | ||
38 | void accept(); | ||
39 | virtual void itemUp(); | ||
40 | virtual void itemDown(); | ||
41 | |||
42 | private: | ||
43 | void init(); | ||
44 | void save(); | ||
45 | }; | ||
46 | |||
47 | #endif // _ADDRESSSETTINGS_H_ | ||
diff --git a/core/pim/addressbook/addresssettingsbase.ui b/core/pim/addressbook/addresssettingsbase.ui deleted file mode 100644 index f0eb7e8..0000000 --- a/core/pim/addressbook/addresssettingsbase.ui +++ b/dev/null | |||
@@ -1,170 +0,0 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>AddressSettingsBase</class> | ||
3 | <comment>/********************************************************************** | ||
4 | ** Copyright (C) 2001 Trolltech AS. All rights reserved. | ||
5 | ** | ||
6 | ** This file is part of Qt Palmtop Environment. | ||
7 | ** | ||
8 | ** This file may be distributed and/or modified under the terms of the | ||
9 | ** GNU General Public License version 2 as published by the Free Software | ||
10 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
11 | ** packaging of this file. | ||
12 | ** | ||
13 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
14 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
15 | ** | ||
16 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
17 | ** | ||
18 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
19 | ** not clear to you. | ||
20 | ** | ||
21 | ** $Id$ | ||
22 | ** | ||
23 | **********************************************************************/</comment> | ||
24 | <widget> | ||
25 | <class>QDialog</class> | ||
26 | <property stdset="1"> | ||
27 | <name>name</name> | ||
28 | <cstring>AddressSettingsBase</cstring> | ||
29 | </property> | ||
30 | <property stdset="1"> | ||
31 | <name>geometry</name> | ||
32 | <rect> | ||
33 | <x>0</x> | ||
34 | <y>0</y> | ||
35 | <width>240</width> | ||
36 | <height>207</height> | ||
37 | </rect> | ||
38 | </property> | ||
39 | <property stdset="1"> | ||
40 | <name>caption</name> | ||
41 | <string>Arrange Edit Fields</string> | ||
42 | </property> | ||
43 | <property> | ||
44 | <name>layoutMargin</name> | ||
45 | </property> | ||
46 | <property> | ||
47 | <name>layoutSpacing</name> | ||
48 | </property> | ||
49 | <grid> | ||
50 | <property stdset="1"> | ||
51 | <name>margin</name> | ||
52 | <number>6</number> | ||
53 | </property> | ||
54 | <property stdset="1"> | ||
55 | <name>spacing</name> | ||
56 | <number>6</number> | ||
57 | </property> | ||
58 | <widget row="1" column="0" rowspan="3" colspan="1" > | ||
59 | <class>QListBox</class> | ||
60 | <property stdset="1"> | ||
61 | <name>name</name> | ||
62 | <cstring>fieldListBox</cstring> | ||
63 | </property> | ||
64 | </widget> | ||
65 | <widget row="0" column="0" rowspan="1" colspan="2" > | ||
66 | <class>QLabel</class> | ||
67 | <property stdset="1"> | ||
68 | <name>name</name> | ||
69 | <cstring>lblExplain</cstring> | ||
70 | </property> | ||
71 | <property stdset="1"> | ||
72 | <name>sizePolicy</name> | ||
73 | <sizepolicy> | ||
74 | <hsizetype>1</hsizetype> | ||
75 | <vsizetype>1</vsizetype> | ||
76 | </sizepolicy> | ||
77 | </property> | ||
78 | <property stdset="1"> | ||
79 | <name>frameShape</name> | ||
80 | <enum>MShape</enum> | ||
81 | </property> | ||
82 | <property stdset="1"> | ||
83 | <name>frameShadow</name> | ||
84 | <enum>MShadow</enum> | ||
85 | </property> | ||
86 | <property stdset="1"> | ||
87 | <name>text</name> | ||
88 | <string>Select the field order:</string> | ||
89 | </property> | ||
90 | <property stdset="1"> | ||
91 | <name>alignment</name> | ||
92 | <set>AlignTop|AlignLeft</set> | ||
93 | </property> | ||
94 | <property> | ||
95 | <name>hAlign</name> | ||
96 | </property> | ||
97 | <property> | ||
98 | <name>vAlign</name> | ||
99 | </property> | ||
100 | </widget> | ||
101 | <widget row="1" column="1" > | ||
102 | <class>QPushButton</class> | ||
103 | <property stdset="1"> | ||
104 | <name>name</name> | ||
105 | <cstring>upButton</cstring> | ||
106 | </property> | ||
107 | <property stdset="1"> | ||
108 | <name>text</name> | ||
109 | <string>Up</string> | ||
110 | </property> | ||
111 | <property stdset="1"> | ||
112 | <name>autoRepeat</name> | ||
113 | <bool>true</bool> | ||
114 | </property> | ||
115 | </widget> | ||
116 | <widget row="2" column="1" > | ||
117 | <class>QPushButton</class> | ||
118 | <property stdset="1"> | ||
119 | <name>name</name> | ||
120 | <cstring>downButton</cstring> | ||
121 | </property> | ||
122 | <property stdset="1"> | ||
123 | <name>text</name> | ||
124 | <string>Down</string> | ||
125 | </property> | ||
126 | <property stdset="1"> | ||
127 | <name>autoRepeat</name> | ||
128 | <bool>true</bool> | ||
129 | </property> | ||
130 | </widget> | ||
131 | <spacer row="3" column="1" > | ||
132 | <property> | ||
133 | <name>name</name> | ||
134 | <cstring>Spacer2</cstring> | ||
135 | </property> | ||
136 | <property stdset="1"> | ||
137 | <name>orientation</name> | ||
138 | <enum>Vertical</enum> | ||
139 | </property> | ||
140 | <property stdset="1"> | ||
141 | <name>sizeType</name> | ||
142 | <enum>Expanding</enum> | ||
143 | </property> | ||
144 | <property> | ||
145 | <name>sizeHint</name> | ||
146 | <size> | ||
147 | <width>20</width> | ||
148 | <height>20</height> | ||
149 | </size> | ||
150 | </property> | ||
151 | </spacer> | ||
152 | </grid> | ||
153 | </widget> | ||
154 | <connections> | ||
155 | <connection> | ||
156 | <sender>upButton</sender> | ||
157 | <signal>clicked()</signal> | ||
158 | <receiver>AddressSettingsBase</receiver> | ||
159 | <slot>itemUp()</slot> | ||
160 | </connection> | ||
161 | <connection> | ||
162 | <sender>downButton</sender> | ||
163 | <signal>clicked()</signal> | ||
164 | <receiver>AddressSettingsBase</receiver> | ||
165 | <slot>itemDown()</slot> | ||
166 | </connection> | ||
167 | <slot access="protected">itemUp()</slot> | ||
168 | <slot access="protected">itemDown()</slot> | ||
169 | </connections> | ||
170 | </UI> | ||
diff --git a/core/pim/addressbook/configdlg.cpp b/core/pim/addressbook/configdlg.cpp index f5c0c5b..f2f4141 100644 --- a/core/pim/addressbook/configdlg.cpp +++ b/core/pim/addressbook/configdlg.cpp | |||
@@ -1,148 +1,151 @@ | |||
1 | #include "configdlg.h" | 1 | #include "configdlg.h" |
2 | #include "ocontactfields.h" | 2 | #include "ocontactfields.h" |
3 | 3 | ||
4 | #include <qcheckbox.h> | 4 | #include <qcheckbox.h> |
5 | #include <qradiobutton.h> | 5 | #include <qradiobutton.h> |
6 | #include <qlistbox.h> | 6 | #include <qlistbox.h> |
7 | #include <qpushbutton.h> | 7 | #include <qpushbutton.h> |
8 | #include <qiconset.h> | 8 | #include <qiconset.h> |
9 | 9 | ||
10 | #include <qpe/resource.h> | 10 | #include <qpe/resource.h> |
11 | 11 | ||
12 | #include <opie/ocontact.h> | 12 | #include <opie/ocontact.h> |
13 | 13 | ||
14 | ConfigDlg::ConfigDlg( QWidget *parent, const char *name): | 14 | ConfigDlg::ConfigDlg( QWidget *parent, const char *name): |
15 | ConfigDlg_Base(parent, name, true ) | 15 | ConfigDlg_Base(parent, name, true ) |
16 | { | 16 | { |
17 | contFields = OContactFields::trfields(); | 17 | contFields = OContactFields::trfields(); |
18 | 18 | ||
19 | // We add all Fields into the Listbox | 19 | // We add all Fields into the Listbox |
20 | for (uint i=0; i < contFields.count(); i++) { | 20 | for (uint i=0; i < contFields.count(); i++) { |
21 | allFieldListBox->insertItem( contFields[i] ); | 21 | allFieldListBox->insertItem( contFields[i] ); |
22 | } | 22 | } |
23 | 23 | ||
24 | // Reset Widget Flags: This was not changeable by designer :( | ||
25 | setWFlags ( WStyle_ContextHelp ); | ||
26 | |||
24 | // Set Pics to Buttons and Tabs | 27 | // Set Pics to Buttons and Tabs |
25 | m_upButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/up" ) ) ); | 28 | m_upButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/up" ) ) ); |
26 | m_downButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/down" ) ) ); | 29 | m_downButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/down" ) ) ); |
27 | m_addButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/add" ) ) ); | 30 | m_addButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/add" ) ) ); |
28 | m_removeButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/sub" ) ) ); | 31 | m_removeButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/sub" ) ) ); |
29 | 32 | ||
30 | 33 | ||
31 | // Get the translation maps between Field ID and translated strings | 34 | // Get the translation maps between Field ID and translated strings |
32 | m_mapStrToID = OContactFields::trFieldsToId(); | 35 | m_mapStrToID = OContactFields::trFieldsToId(); |
33 | m_mapIDToStr = OContactFields::idToTrFields(); | 36 | m_mapIDToStr = OContactFields::idToTrFields(); |
34 | 37 | ||
35 | connect ( m_addButton, SIGNAL( clicked() ), this, SLOT( slotItemAdd() ) ); | 38 | connect ( m_addButton, SIGNAL( clicked() ), this, SLOT( slotItemAdd() ) ); |
36 | connect ( m_removeButton, SIGNAL( clicked() ), this, SLOT( slotItemRemove() ) ); | 39 | connect ( m_removeButton, SIGNAL( clicked() ), this, SLOT( slotItemRemove() ) ); |
37 | connect ( m_upButton, SIGNAL( clicked() ), this, SLOT( slotItemUp() ) ); | 40 | connect ( m_upButton, SIGNAL( clicked() ), this, SLOT( slotItemUp() ) ); |
38 | connect ( m_downButton, SIGNAL( clicked() ), this, SLOT( slotItemDown() ) ); | 41 | connect ( m_downButton, SIGNAL( clicked() ), this, SLOT( slotItemDown() ) ); |
39 | } | 42 | } |
40 | 43 | ||
41 | void ConfigDlg::slotItemUp() | 44 | void ConfigDlg::slotItemUp() |
42 | { | 45 | { |
43 | qWarning( "void ConfigDlg::slotItemUp()" ); | 46 | qWarning( "void ConfigDlg::slotItemUp()" ); |
44 | 47 | ||
45 | int i = fieldListBox->currentItem(); | 48 | int i = fieldListBox->currentItem(); |
46 | if ( i > 0 ) { | 49 | if ( i > 0 ) { |
47 | QString item = fieldListBox->currentText(); | 50 | QString item = fieldListBox->currentText(); |
48 | fieldListBox->removeItem( i ); | 51 | fieldListBox->removeItem( i ); |
49 | fieldListBox->insertItem( item, i-1 ); | 52 | fieldListBox->insertItem( item, i-1 ); |
50 | fieldListBox->setCurrentItem( i-1 ); | 53 | fieldListBox->setCurrentItem( i-1 ); |
51 | } | 54 | } |
52 | 55 | ||
53 | } | 56 | } |
54 | 57 | ||
55 | void ConfigDlg::slotItemDown() | 58 | void ConfigDlg::slotItemDown() |
56 | { | 59 | { |
57 | qWarning( "void ConfigDlg::slotItemDown()" ); | 60 | qWarning( "void ConfigDlg::slotItemDown()" ); |
58 | 61 | ||
59 | int i = fieldListBox->currentItem(); | 62 | int i = fieldListBox->currentItem(); |
60 | if ( i < (int)fieldListBox->count() - 1 ) { | 63 | if ( i < (int)fieldListBox->count() - 1 ) { |
61 | QString item = fieldListBox->currentText(); | 64 | QString item = fieldListBox->currentText(); |
62 | fieldListBox->removeItem( i ); | 65 | fieldListBox->removeItem( i ); |
63 | fieldListBox->insertItem( item, i+1 ); | 66 | fieldListBox->insertItem( item, i+1 ); |
64 | fieldListBox->setCurrentItem( i+1 ); | 67 | fieldListBox->setCurrentItem( i+1 ); |
65 | } | 68 | } |
66 | } | 69 | } |
67 | 70 | ||
68 | void ConfigDlg::slotItemAdd() | 71 | void ConfigDlg::slotItemAdd() |
69 | { | 72 | { |
70 | qWarning( "void ConfigDlg::slotItemAdd()" ); | 73 | qWarning( "void ConfigDlg::slotItemAdd()" ); |
71 | 74 | ||
72 | int i = allFieldListBox->currentItem(); | 75 | int i = allFieldListBox->currentItem(); |
73 | if ( i > 0 ) { | 76 | if ( i > 0 ) { |
74 | QString item = allFieldListBox->currentText(); | 77 | QString item = allFieldListBox->currentText(); |
75 | qWarning("ADding %s", item.latin1()); | 78 | qWarning("ADding %s", item.latin1()); |
76 | fieldListBox->insertItem( item ); | 79 | fieldListBox->insertItem( item ); |
77 | } | 80 | } |
78 | } | 81 | } |
79 | 82 | ||
80 | void ConfigDlg::slotItemRemove() | 83 | void ConfigDlg::slotItemRemove() |
81 | { | 84 | { |
82 | qWarning( "void ConfigDlg::slotItemRemove()" ); | 85 | qWarning( "void ConfigDlg::slotItemRemove()" ); |
83 | 86 | ||
84 | int i = fieldListBox->currentItem(); | 87 | int i = fieldListBox->currentItem(); |
85 | if ( i > 0 ) { | 88 | if ( i > 0 ) { |
86 | fieldListBox->removeItem( i ); | 89 | fieldListBox->removeItem( i ); |
87 | } | 90 | } |
88 | } | 91 | } |
89 | 92 | ||
90 | void ConfigDlg::setConfig( const AbConfig& cnf ) | 93 | void ConfigDlg::setConfig( const AbConfig& cnf ) |
91 | { | 94 | { |
92 | m_config = cnf; | 95 | m_config = cnf; |
93 | 96 | ||
94 | m_useRegExp->setChecked( m_config.useRegExp() ); | 97 | m_useRegExp->setChecked( m_config.useRegExp() ); |
95 | m_useWildCard->setChecked( m_config.useWildCards() ); | 98 | m_useWildCard->setChecked( m_config.useWildCards() ); |
96 | m_useQtMail->setChecked( m_config.useQtMail() ); | 99 | m_useQtMail->setChecked( m_config.useQtMail() ); |
97 | m_useOpieMail->setChecked( m_config.useOpieMail() ); | 100 | m_useOpieMail->setChecked( m_config.useOpieMail() ); |
98 | m_useCaseSensitive->setChecked( m_config.beCaseSensitive() ); | 101 | m_useCaseSensitive->setChecked( m_config.beCaseSensitive() ); |
99 | 102 | ||
100 | switch( m_config.fontSize() ){ | 103 | switch( m_config.fontSize() ){ |
101 | case 0: | 104 | case 0: |
102 | m_smallFont->setChecked( true ); | 105 | m_smallFont->setChecked( true ); |
103 | m_normalFont->setChecked( false ); | 106 | m_normalFont->setChecked( false ); |
104 | m_largeFont->setChecked( false ); | 107 | m_largeFont->setChecked( false ); |
105 | break; | 108 | break; |
106 | case 1: | 109 | case 1: |
107 | m_smallFont->setChecked( false ); | 110 | m_smallFont->setChecked( false ); |
108 | m_normalFont->setChecked( true ); | 111 | m_normalFont->setChecked( true ); |
109 | m_largeFont->setChecked( false ); | 112 | m_largeFont->setChecked( false ); |
110 | break; | 113 | break; |
111 | case 2: | 114 | case 2: |
112 | m_smallFont->setChecked( false ); | 115 | m_smallFont->setChecked( false ); |
113 | m_normalFont->setChecked( false ); | 116 | m_normalFont->setChecked( false ); |
114 | m_largeFont->setChecked( true ); | 117 | m_largeFont->setChecked( true ); |
115 | break; | 118 | break; |
116 | } | 119 | } |
117 | 120 | ||
118 | for( uint i = 0; i < m_config.orderList().count(); i++ ) { | 121 | for( uint i = 0; i < m_config.orderList().count(); i++ ) { |
119 | fieldListBox -> insertItem ( m_mapIDToStr[ m_config.orderList()[i] ] ); | 122 | fieldListBox -> insertItem ( m_mapIDToStr[ m_config.orderList()[i] ] ); |
120 | } | 123 | } |
121 | 124 | ||
122 | 125 | ||
123 | } | 126 | } |
124 | 127 | ||
125 | AbConfig ConfigDlg::getConfig() | 128 | AbConfig ConfigDlg::getConfig() |
126 | { | 129 | { |
127 | m_config.setUseRegExp( m_useRegExp->isOn() ); | 130 | m_config.setUseRegExp( m_useRegExp->isOn() ); |
128 | m_config.setUseWildCards( m_useWildCard->isOn() ); | 131 | m_config.setUseWildCards( m_useWildCard->isOn() ); |
129 | m_config.setUseQtMail( m_useQtMail->isOn() ); | 132 | m_config.setUseQtMail( m_useQtMail->isOn() ); |
130 | m_config.setUseOpieMail( m_useOpieMail->isOn() ); | 133 | m_config.setUseOpieMail( m_useOpieMail->isOn() ); |
131 | m_config.setBeCaseSensitive( m_useCaseSensitive->isChecked() ); | 134 | m_config.setBeCaseSensitive( m_useCaseSensitive->isChecked() ); |
132 | 135 | ||
133 | if ( m_smallFont->isChecked() ) | 136 | if ( m_smallFont->isChecked() ) |
134 | m_config.setFontSize( 0 ); | 137 | m_config.setFontSize( 0 ); |
135 | if ( m_normalFont->isChecked() ) | 138 | if ( m_normalFont->isChecked() ) |
136 | m_config.setFontSize( 1 ); | 139 | m_config.setFontSize( 1 ); |
137 | if ( m_largeFont->isChecked() ) | 140 | if ( m_largeFont->isChecked() ) |
138 | m_config.setFontSize( 2 ); | 141 | m_config.setFontSize( 2 ); |
139 | 142 | ||
140 | QValueList<int> orderlist; | 143 | QValueList<int> orderlist; |
141 | for( int i = 0; i < (int)fieldListBox->count(); i++ ) { | 144 | for( int i = 0; i < (int)fieldListBox->count(); i++ ) { |
142 | orderlist.append( m_mapStrToID[ fieldListBox->text(i) ] ); | 145 | orderlist.append( m_mapStrToID[ fieldListBox->text(i) ] ); |
143 | } | 146 | } |
144 | m_config.setOrderList( orderlist ); | 147 | m_config.setOrderList( orderlist ); |
145 | 148 | ||
146 | return m_config; | 149 | return m_config; |
147 | } | 150 | } |
148 | 151 | ||
diff --git a/core/pim/addressbook/configdlg_base.ui b/core/pim/addressbook/configdlg_base.ui index 8ae2578..308e138 100644 --- a/core/pim/addressbook/configdlg_base.ui +++ b/core/pim/addressbook/configdlg_base.ui | |||
@@ -1,547 +1,620 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>ConfigDlg_Base</class> | 2 | <class>ConfigDlg_Base</class> |
3 | <author>Stefan Eilers</author> | 3 | <author>Stefan Eilers</author> |
4 | <include location="global">qwhatsthis.h</include> | ||
4 | <widget> | 5 | <widget> |
5 | <class>QDialog</class> | 6 | <class>QDialog</class> |
6 | <property stdset="1"> | 7 | <property stdset="1"> |
7 | <name>name</name> | 8 | <name>name</name> |
8 | <cstring>Configuration</cstring> | 9 | <cstring>Configuration</cstring> |
9 | </property> | 10 | </property> |
10 | <property stdset="1"> | 11 | <property stdset="1"> |
11 | <name>geometry</name> | 12 | <name>geometry</name> |
12 | <rect> | 13 | <rect> |
13 | <x>0</x> | 14 | <x>0</x> |
14 | <y>0</y> | 15 | <y>0</y> |
15 | <width>282</width> | 16 | <width>284</width> |
16 | <height>327</height> | 17 | <height>327</height> |
17 | </rect> | 18 | </rect> |
18 | </property> | 19 | </property> |
19 | <property stdset="1"> | 20 | <property stdset="1"> |
20 | <name>sizePolicy</name> | 21 | <name>sizePolicy</name> |
21 | <sizepolicy> | 22 | <sizepolicy> |
22 | <hsizetype>5</hsizetype> | 23 | <hsizetype>5</hsizetype> |
23 | <vsizetype>5</vsizetype> | 24 | <vsizetype>5</vsizetype> |
24 | </sizepolicy> | 25 | </sizepolicy> |
25 | </property> | 26 | </property> |
26 | <property stdset="1"> | 27 | <property stdset="1"> |
27 | <name>caption</name> | 28 | <name>caption</name> |
28 | <string>Configuration</string> | 29 | <string>Configuration</string> |
29 | </property> | 30 | </property> |
30 | <property stdset="1"> | 31 | <property stdset="1"> |
31 | <name>sizeGripEnabled</name> | 32 | <name>sizeGripEnabled</name> |
32 | <bool>true</bool> | 33 | <bool>true</bool> |
33 | </property> | 34 | </property> |
34 | <property> | 35 | <property> |
35 | <name>layoutMargin</name> | 36 | <name>layoutMargin</name> |
36 | </property> | 37 | </property> |
37 | <vbox> | 38 | <vbox> |
38 | <property stdset="1"> | 39 | <property stdset="1"> |
39 | <name>margin</name> | 40 | <name>margin</name> |
40 | <number>1</number> | 41 | <number>1</number> |
41 | </property> | 42 | </property> |
42 | <property stdset="1"> | 43 | <property stdset="1"> |
43 | <name>spacing</name> | 44 | <name>spacing</name> |
44 | <number>6</number> | 45 | <number>6</number> |
45 | </property> | 46 | </property> |
46 | <widget> | 47 | <widget> |
47 | <class>QTabWidget</class> | 48 | <class>QTabWidget</class> |
48 | <property stdset="1"> | 49 | <property stdset="1"> |
49 | <name>name</name> | 50 | <name>name</name> |
50 | <cstring>configDlg_base</cstring> | 51 | <cstring>configDlg_base</cstring> |
51 | </property> | 52 | </property> |
52 | <property stdset="1"> | 53 | <property stdset="1"> |
53 | <name>sizePolicy</name> | 54 | <name>sizePolicy</name> |
54 | <sizepolicy> | 55 | <sizepolicy> |
55 | <hsizetype>7</hsizetype> | 56 | <hsizetype>7</hsizetype> |
56 | <vsizetype>7</vsizetype> | 57 | <vsizetype>7</vsizetype> |
57 | </sizepolicy> | 58 | </sizepolicy> |
58 | </property> | 59 | </property> |
59 | <property> | 60 | <property> |
60 | <name>layoutMargin</name> | 61 | <name>layoutMargin</name> |
61 | </property> | 62 | </property> |
62 | <property> | 63 | <property> |
63 | <name>layoutSpacing</name> | 64 | <name>layoutSpacing</name> |
64 | </property> | 65 | </property> |
66 | <property> | ||
67 | <name>whatsThis</name> | ||
68 | <string>Click on tab to select one</string> | ||
69 | </property> | ||
65 | <widget> | 70 | <widget> |
66 | <class>QWidget</class> | 71 | <class>QWidget</class> |
67 | <property stdset="1"> | 72 | <property stdset="1"> |
68 | <name>name</name> | 73 | <name>name</name> |
69 | <cstring>Widget5</cstring> | 74 | <cstring>Widget5</cstring> |
70 | </property> | 75 | </property> |
71 | <attribute> | 76 | <attribute> |
72 | <name>title</name> | 77 | <name>title</name> |
73 | <string>Misc</string> | 78 | <string>Misc</string> |
74 | </attribute> | 79 | </attribute> |
75 | <vbox> | 80 | <vbox> |
76 | <property stdset="1"> | 81 | <property stdset="1"> |
77 | <name>margin</name> | 82 | <name>margin</name> |
78 | <number>5</number> | 83 | <number>5</number> |
79 | </property> | 84 | </property> |
80 | <property stdset="1"> | 85 | <property stdset="1"> |
81 | <name>spacing</name> | 86 | <name>spacing</name> |
82 | <number>6</number> | 87 | <number>6</number> |
83 | </property> | 88 | </property> |
84 | <widget> | 89 | <widget> |
85 | <class>QGroupBox</class> | 90 | <class>QGroupBox</class> |
86 | <property stdset="1"> | 91 | <property stdset="1"> |
87 | <name>name</name> | 92 | <name>name</name> |
88 | <cstring>GroupBox2</cstring> | 93 | <cstring>GroupBox2</cstring> |
89 | </property> | 94 | </property> |
90 | <property stdset="1"> | 95 | <property stdset="1"> |
91 | <name>title</name> | 96 | <name>title</name> |
92 | <string>Search Settings</string> | 97 | <string>Search Settings</string> |
93 | </property> | 98 | </property> |
94 | <vbox> | 99 | <vbox> |
95 | <property stdset="1"> | 100 | <property stdset="1"> |
96 | <name>margin</name> | 101 | <name>margin</name> |
97 | <number>11</number> | 102 | <number>11</number> |
98 | </property> | 103 | </property> |
99 | <property stdset="1"> | 104 | <property stdset="1"> |
100 | <name>spacing</name> | 105 | <name>spacing</name> |
101 | <number>6</number> | 106 | <number>6</number> |
102 | </property> | 107 | </property> |
103 | <widget> | 108 | <widget> |
104 | <class>QButtonGroup</class> | 109 | <class>QButtonGroup</class> |
105 | <property stdset="1"> | 110 | <property stdset="1"> |
106 | <name>name</name> | 111 | <name>name</name> |
107 | <cstring>ButtonGroup1</cstring> | 112 | <cstring>ButtonGroup1</cstring> |
108 | </property> | 113 | </property> |
109 | <property stdset="1"> | 114 | <property stdset="1"> |
110 | <name>title</name> | 115 | <name>title</name> |
111 | <string>Query Style</string> | 116 | <string>Query Style</string> |
112 | </property> | 117 | </property> |
118 | <property> | ||
119 | <name>whatsThis</name> | ||
120 | <string>Settings for the search query style</string> | ||
121 | </property> | ||
113 | <vbox> | 122 | <vbox> |
114 | <property stdset="1"> | 123 | <property stdset="1"> |
115 | <name>margin</name> | 124 | <name>margin</name> |
116 | <number>11</number> | 125 | <number>11</number> |
117 | </property> | 126 | </property> |
118 | <property stdset="1"> | 127 | <property stdset="1"> |
119 | <name>spacing</name> | 128 | <name>spacing</name> |
120 | <number>6</number> | 129 | <number>6</number> |
121 | </property> | 130 | </property> |
122 | <widget> | 131 | <widget> |
123 | <class>QRadioButton</class> | 132 | <class>QRadioButton</class> |
124 | <property stdset="1"> | 133 | <property stdset="1"> |
125 | <name>name</name> | 134 | <name>name</name> |
126 | <cstring>m_useRegExp</cstring> | 135 | <cstring>m_useRegExp</cstring> |
127 | </property> | 136 | </property> |
128 | <property stdset="1"> | 137 | <property stdset="1"> |
129 | <name>text</name> | 138 | <name>text</name> |
130 | <string>Use Regular Expressions</string> | 139 | <string>Use Regular Expressions</string> |
131 | </property> | 140 | </property> |
141 | <property> | ||
142 | <name>whatsThis</name> | ||
143 | <string>Search widget expects regular expressions if selected</string> | ||
144 | </property> | ||
132 | </widget> | 145 | </widget> |
133 | <widget> | 146 | <widget> |
134 | <class>QRadioButton</class> | 147 | <class>QRadioButton</class> |
135 | <property stdset="1"> | 148 | <property stdset="1"> |
136 | <name>name</name> | 149 | <name>name</name> |
137 | <cstring>m_useWildCard</cstring> | 150 | <cstring>m_useWildCard</cstring> |
138 | </property> | 151 | </property> |
139 | <property stdset="1"> | 152 | <property stdset="1"> |
140 | <name>text</name> | 153 | <name>text</name> |
141 | <string>Use Wildcards (*,?)</string> | 154 | <string>Use Wildcards (*,?)</string> |
142 | </property> | 155 | </property> |
143 | <property stdset="1"> | 156 | <property stdset="1"> |
144 | <name>checked</name> | 157 | <name>checked</name> |
145 | <bool>true</bool> | 158 | <bool>true</bool> |
146 | </property> | 159 | </property> |
160 | <property> | ||
161 | <name>whatsThis</name> | ||
162 | <string>Search widget just expects simple wildcards</string> | ||
163 | </property> | ||
147 | </widget> | 164 | </widget> |
148 | </vbox> | 165 | </vbox> |
149 | </widget> | 166 | </widget> |
150 | <widget> | 167 | <widget> |
151 | <class>QCheckBox</class> | 168 | <class>QCheckBox</class> |
152 | <property stdset="1"> | 169 | <property stdset="1"> |
153 | <name>name</name> | 170 | <name>name</name> |
154 | <cstring>m_useCaseSensitive</cstring> | 171 | <cstring>m_useCaseSensitive</cstring> |
155 | </property> | 172 | </property> |
156 | <property stdset="1"> | 173 | <property stdset="1"> |
157 | <name>text</name> | 174 | <name>text</name> |
158 | <string>Case Sensitive</string> | 175 | <string>Case Sensitive</string> |
159 | </property> | 176 | </property> |
177 | <property> | ||
178 | <name>whatsThis</name> | ||
179 | <string>If selected, search differs between upper and lower chars</string> | ||
180 | </property> | ||
160 | </widget> | 181 | </widget> |
161 | </vbox> | 182 | </vbox> |
162 | </widget> | 183 | </widget> |
163 | <widget> | 184 | <widget> |
164 | <class>QButtonGroup</class> | 185 | <class>QButtonGroup</class> |
165 | <property stdset="1"> | 186 | <property stdset="1"> |
166 | <name>name</name> | 187 | <name>name</name> |
167 | <cstring>ButtonGroup3</cstring> | 188 | <cstring>ButtonGroup3</cstring> |
168 | </property> | 189 | </property> |
169 | <property stdset="1"> | 190 | <property stdset="1"> |
170 | <name>title</name> | 191 | <name>title</name> |
171 | <string>Font</string> | 192 | <string>Font</string> |
172 | </property> | 193 | </property> |
194 | <property> | ||
195 | <name>whatsThis</name> | ||
196 | <string></string> | ||
197 | </property> | ||
173 | <hbox> | 198 | <hbox> |
174 | <property stdset="1"> | 199 | <property stdset="1"> |
175 | <name>margin</name> | 200 | <name>margin</name> |
176 | <number>11</number> | 201 | <number>11</number> |
177 | </property> | 202 | </property> |
178 | <property stdset="1"> | 203 | <property stdset="1"> |
179 | <name>spacing</name> | 204 | <name>spacing</name> |
180 | <number>6</number> | 205 | <number>6</number> |
181 | </property> | 206 | </property> |
182 | <widget> | 207 | <widget> |
183 | <class>QRadioButton</class> | 208 | <class>QRadioButton</class> |
184 | <property stdset="1"> | 209 | <property stdset="1"> |
185 | <name>name</name> | 210 | <name>name</name> |
186 | <cstring>m_smallFont</cstring> | 211 | <cstring>m_smallFont</cstring> |
187 | </property> | 212 | </property> |
188 | <property stdset="1"> | 213 | <property stdset="1"> |
189 | <name>text</name> | 214 | <name>text</name> |
190 | <string>Small</string> | 215 | <string>Small</string> |
191 | </property> | 216 | </property> |
217 | <property> | ||
218 | <name>whatsThis</name> | ||
219 | <string>Font size for list- and card view</string> | ||
220 | </property> | ||
192 | </widget> | 221 | </widget> |
193 | <widget> | 222 | <widget> |
194 | <class>QRadioButton</class> | 223 | <class>QRadioButton</class> |
195 | <property stdset="1"> | 224 | <property stdset="1"> |
196 | <name>name</name> | 225 | <name>name</name> |
197 | <cstring>m_normalFont</cstring> | 226 | <cstring>m_normalFont</cstring> |
198 | </property> | 227 | </property> |
199 | <property stdset="1"> | 228 | <property stdset="1"> |
200 | <name>text</name> | 229 | <name>text</name> |
201 | <string>Normal</string> | 230 | <string>Normal</string> |
202 | </property> | 231 | </property> |
203 | <property stdset="1"> | 232 | <property stdset="1"> |
204 | <name>checked</name> | 233 | <name>checked</name> |
205 | <bool>true</bool> | 234 | <bool>true</bool> |
206 | </property> | 235 | </property> |
236 | <property> | ||
237 | <name>whatsThis</name> | ||
238 | <string>Font size for list- and card view</string> | ||
239 | </property> | ||
207 | </widget> | 240 | </widget> |
208 | <widget> | 241 | <widget> |
209 | <class>QRadioButton</class> | 242 | <class>QRadioButton</class> |
210 | <property stdset="1"> | 243 | <property stdset="1"> |
211 | <name>name</name> | 244 | <name>name</name> |
212 | <cstring>m_largeFont</cstring> | 245 | <cstring>m_largeFont</cstring> |
213 | </property> | 246 | </property> |
214 | <property stdset="1"> | 247 | <property stdset="1"> |
215 | <name>text</name> | 248 | <name>text</name> |
216 | <string>Large</string> | 249 | <string>Large</string> |
217 | </property> | 250 | </property> |
251 | <property> | ||
252 | <name>whatsThis</name> | ||
253 | <string>Font size for list- and card view</string> | ||
254 | </property> | ||
218 | </widget> | 255 | </widget> |
219 | </hbox> | 256 | </hbox> |
220 | </widget> | 257 | </widget> |
221 | <spacer> | 258 | <spacer> |
222 | <property> | 259 | <property> |
223 | <name>name</name> | 260 | <name>name</name> |
224 | <cstring>Spacer3</cstring> | 261 | <cstring>Spacer3</cstring> |
225 | </property> | 262 | </property> |
226 | <property stdset="1"> | 263 | <property stdset="1"> |
227 | <name>orientation</name> | 264 | <name>orientation</name> |
228 | <enum>Vertical</enum> | 265 | <enum>Vertical</enum> |
229 | </property> | 266 | </property> |
230 | <property stdset="1"> | 267 | <property stdset="1"> |
231 | <name>sizeType</name> | 268 | <name>sizeType</name> |
232 | <enum>Expanding</enum> | 269 | <enum>Expanding</enum> |
233 | </property> | 270 | </property> |
234 | <property> | 271 | <property> |
235 | <name>sizeHint</name> | 272 | <name>sizeHint</name> |
236 | <size> | 273 | <size> |
237 | <width>20</width> | 274 | <width>20</width> |
238 | <height>20</height> | 275 | <height>20</height> |
239 | </size> | 276 | </size> |
240 | </property> | 277 | </property> |
241 | </spacer> | 278 | </spacer> |
242 | </vbox> | 279 | </vbox> |
243 | </widget> | 280 | </widget> |
244 | <widget> | 281 | <widget> |
245 | <class>QWidget</class> | 282 | <class>QWidget</class> |
246 | <property stdset="1"> | 283 | <property stdset="1"> |
247 | <name>name</name> | 284 | <name>name</name> |
248 | <cstring>tab</cstring> | 285 | <cstring>tab</cstring> |
249 | </property> | 286 | </property> |
250 | <attribute> | 287 | <attribute> |
251 | <name>title</name> | 288 | <name>title</name> |
252 | <string>Mail</string> | 289 | <string>Mail</string> |
253 | </attribute> | 290 | </attribute> |
254 | <vbox> | 291 | <vbox> |
255 | <property stdset="1"> | 292 | <property stdset="1"> |
256 | <name>margin</name> | 293 | <name>margin</name> |
257 | <number>5</number> | 294 | <number>5</number> |
258 | </property> | 295 | </property> |
259 | <property stdset="1"> | 296 | <property stdset="1"> |
260 | <name>spacing</name> | 297 | <name>spacing</name> |
261 | <number>6</number> | 298 | <number>6</number> |
262 | </property> | 299 | </property> |
263 | <widget> | 300 | <widget> |
264 | <class>QButtonGroup</class> | 301 | <class>QButtonGroup</class> |
265 | <property stdset="1"> | 302 | <property stdset="1"> |
266 | <name>name</name> | 303 | <name>name</name> |
267 | <cstring>ButtonGroup2</cstring> | 304 | <cstring>ButtonGroup2</cstring> |
268 | </property> | 305 | </property> |
269 | <property stdset="1"> | 306 | <property stdset="1"> |
270 | <name>title</name> | 307 | <name>title</name> |
271 | <string>Mail</string> | 308 | <string>Mail</string> |
272 | </property> | 309 | </property> |
310 | <property> | ||
311 | <name>whatsThis</name> | ||
312 | <string>Fontsettings for list and card view</string> | ||
313 | </property> | ||
273 | <vbox> | 314 | <vbox> |
274 | <property stdset="1"> | 315 | <property stdset="1"> |
275 | <name>margin</name> | 316 | <name>margin</name> |
276 | <number>11</number> | 317 | <number>11</number> |
277 | </property> | 318 | </property> |
278 | <property stdset="1"> | 319 | <property stdset="1"> |
279 | <name>spacing</name> | 320 | <name>spacing</name> |
280 | <number>6</number> | 321 | <number>6</number> |
281 | </property> | 322 | </property> |
282 | <widget> | 323 | <widget> |
283 | <class>QRadioButton</class> | 324 | <class>QRadioButton</class> |
284 | <property stdset="1"> | 325 | <property stdset="1"> |
285 | <name>name</name> | 326 | <name>name</name> |
286 | <cstring>m_useQtMail</cstring> | 327 | <cstring>m_useQtMail</cstring> |
287 | </property> | 328 | </property> |
288 | <property stdset="1"> | 329 | <property stdset="1"> |
289 | <name>text</name> | 330 | <name>text</name> |
290 | <string>Prefer QT-Mail </string> | 331 | <string>Prefer QT-Mail </string> |
291 | </property> | 332 | </property> |
292 | <property stdset="1"> | 333 | <property stdset="1"> |
293 | <name>checked</name> | 334 | <name>checked</name> |
294 | <bool>true</bool> | 335 | <bool>true</bool> |
295 | </property> | 336 | </property> |
337 | <property> | ||
338 | <name>whatsThis</name> | ||
339 | <string>Use Sharp's mail application if available</string> | ||
340 | </property> | ||
296 | </widget> | 341 | </widget> |
297 | <widget> | 342 | <widget> |
298 | <class>QRadioButton</class> | 343 | <class>QRadioButton</class> |
299 | <property stdset="1"> | 344 | <property stdset="1"> |
300 | <name>name</name> | 345 | <name>name</name> |
301 | <cstring>m_useOpieMail</cstring> | 346 | <cstring>m_useOpieMail</cstring> |
302 | </property> | 347 | </property> |
303 | <property stdset="1"> | 348 | <property stdset="1"> |
304 | <name>text</name> | 349 | <name>text</name> |
305 | <string>Prefer Opie-Mail</string> | 350 | <string>Prefer Opie-Mail</string> |
306 | </property> | 351 | </property> |
352 | <property> | ||
353 | <name>whatsThis</name> | ||
354 | <string>Use OPIE mail if installed</string> | ||
355 | </property> | ||
307 | </widget> | 356 | </widget> |
308 | <widget> | 357 | <widget> |
309 | <class>QLabel</class> | 358 | <class>QLabel</class> |
310 | <property stdset="1"> | 359 | <property stdset="1"> |
311 | <name>name</name> | 360 | <name>name</name> |
312 | <cstring>TextLabel1</cstring> | 361 | <cstring>TextLabel1</cstring> |
313 | </property> | 362 | </property> |
314 | <property stdset="1"> | 363 | <property stdset="1"> |
315 | <name>text</name> | 364 | <name>text</name> |
316 | <string>Notice: QT-Mail is just | 365 | <string>Notice: QT-Mail is just |
317 | provided in the SHARP | 366 | provided in the SHARP |
318 | default ROM. Opie-Mail | 367 | default ROM. Opie-Mail |
319 | is provided free !</string> | 368 | is provided free !</string> |
320 | </property> | 369 | </property> |
321 | </widget> | 370 | </widget> |
322 | </vbox> | 371 | </vbox> |
323 | </widget> | 372 | </widget> |
324 | <spacer> | 373 | <spacer> |
325 | <property> | 374 | <property> |
326 | <name>name</name> | 375 | <name>name</name> |
327 | <cstring>Spacer2</cstring> | 376 | <cstring>Spacer2</cstring> |
328 | </property> | 377 | </property> |
329 | <property stdset="1"> | 378 | <property stdset="1"> |
330 | <name>orientation</name> | 379 | <name>orientation</name> |
331 | <enum>Vertical</enum> | 380 | <enum>Vertical</enum> |
332 | </property> | 381 | </property> |
333 | <property stdset="1"> | 382 | <property stdset="1"> |
334 | <name>sizeType</name> | 383 | <name>sizeType</name> |
335 | <enum>Expanding</enum> | 384 | <enum>Expanding</enum> |
336 | </property> | 385 | </property> |
337 | <property> | 386 | <property> |
338 | <name>sizeHint</name> | 387 | <name>sizeHint</name> |
339 | <size> | 388 | <size> |
340 | <width>20</width> | 389 | <width>20</width> |
341 | <height>20</height> | 390 | <height>20</height> |
342 | </size> | 391 | </size> |
343 | </property> | 392 | </property> |
344 | </spacer> | 393 | </spacer> |
345 | </vbox> | 394 | </vbox> |
346 | </widget> | 395 | </widget> |
347 | <widget> | 396 | <widget> |
348 | <class>QWidget</class> | 397 | <class>QWidget</class> |
349 | <property stdset="1"> | 398 | <property stdset="1"> |
350 | <name>name</name> | 399 | <name>name</name> |
351 | <cstring>tab</cstring> | 400 | <cstring>tab</cstring> |
352 | </property> | 401 | </property> |
353 | <attribute> | 402 | <attribute> |
354 | <name>title</name> | 403 | <name>title</name> |
355 | <string>Order</string> | 404 | <string>Order</string> |
356 | </attribute> | 405 | </attribute> |
357 | <vbox> | 406 | <vbox> |
358 | <property stdset="1"> | 407 | <property stdset="1"> |
359 | <name>margin</name> | 408 | <name>margin</name> |
360 | <number>2</number> | 409 | <number>2</number> |
361 | </property> | 410 | </property> |
362 | <property stdset="1"> | 411 | <property stdset="1"> |
363 | <name>spacing</name> | 412 | <name>spacing</name> |
364 | <number>2</number> | 413 | <number>2</number> |
365 | </property> | 414 | </property> |
366 | <widget> | 415 | <widget> |
367 | <class>QGroupBox</class> | 416 | <class>QGroupBox</class> |
368 | <property stdset="1"> | 417 | <property stdset="1"> |
369 | <name>name</name> | 418 | <name>name</name> |
370 | <cstring>GroupBox9</cstring> | 419 | <cstring>GroupBox9</cstring> |
371 | </property> | 420 | </property> |
372 | <property stdset="1"> | 421 | <property stdset="1"> |
373 | <name>title</name> | 422 | <name>title</name> |
374 | <string>Select Contact Order:</string> | 423 | <string>Select Contact Order:</string> |
375 | </property> | 424 | </property> |
376 | <grid> | 425 | <grid> |
377 | <property stdset="1"> | 426 | <property stdset="1"> |
378 | <name>margin</name> | 427 | <name>margin</name> |
379 | <number>11</number> | 428 | <number>11</number> |
380 | </property> | 429 | </property> |
381 | <property stdset="1"> | 430 | <property stdset="1"> |
382 | <name>spacing</name> | 431 | <name>spacing</name> |
383 | <number>6</number> | 432 | <number>6</number> |
384 | </property> | 433 | </property> |
385 | <widget row="0" column="2" > | 434 | <widget row="0" column="2" > |
386 | <class>QPushButton</class> | 435 | <class>QPushButton</class> |
387 | <property stdset="1"> | 436 | <property stdset="1"> |
388 | <name>name</name> | 437 | <name>name</name> |
389 | <cstring>m_upButton</cstring> | 438 | <cstring>m_upButton</cstring> |
390 | </property> | 439 | </property> |
391 | <property stdset="1"> | 440 | <property stdset="1"> |
392 | <name>sizePolicy</name> | 441 | <name>sizePolicy</name> |
393 | <sizepolicy> | 442 | <sizepolicy> |
394 | <hsizetype>1</hsizetype> | 443 | <hsizetype>1</hsizetype> |
395 | <vsizetype>0</vsizetype> | 444 | <vsizetype>0</vsizetype> |
396 | </sizepolicy> | 445 | </sizepolicy> |
397 | </property> | 446 | </property> |
398 | <property stdset="1"> | 447 | <property stdset="1"> |
399 | <name>text</name> | 448 | <name>text</name> |
400 | <string>Up</string> | 449 | <string>Up</string> |
401 | </property> | 450 | </property> |
402 | <property stdset="1"> | 451 | <property stdset="1"> |
403 | <name>autoRepeat</name> | 452 | <name>autoRepeat</name> |
404 | <bool>true</bool> | 453 | <bool>true</bool> |
405 | </property> | 454 | </property> |
455 | <property> | ||
456 | <name>whatsThis</name> | ||
457 | <string>Move selected attribute one line up</string> | ||
458 | </property> | ||
406 | </widget> | 459 | </widget> |
407 | <widget row="1" column="2" > | 460 | <widget row="1" column="2" > |
408 | <class>QPushButton</class> | 461 | <class>QPushButton</class> |
409 | <property stdset="1"> | 462 | <property stdset="1"> |
410 | <name>name</name> | 463 | <name>name</name> |
411 | <cstring>m_downButton</cstring> | 464 | <cstring>m_downButton</cstring> |
412 | </property> | 465 | </property> |
413 | <property stdset="1"> | 466 | <property stdset="1"> |
414 | <name>sizePolicy</name> | 467 | <name>sizePolicy</name> |
415 | <sizepolicy> | 468 | <sizepolicy> |
416 | <hsizetype>1</hsizetype> | 469 | <hsizetype>1</hsizetype> |
417 | <vsizetype>0</vsizetype> | 470 | <vsizetype>0</vsizetype> |
418 | </sizepolicy> | 471 | </sizepolicy> |
419 | </property> | 472 | </property> |
420 | <property stdset="1"> | 473 | <property stdset="1"> |
421 | <name>text</name> | 474 | <name>text</name> |
422 | <string>Down</string> | 475 | <string>Down</string> |
423 | </property> | 476 | </property> |
424 | <property stdset="1"> | 477 | <property stdset="1"> |
425 | <name>autoRepeat</name> | 478 | <name>autoRepeat</name> |
426 | <bool>true</bool> | 479 | <bool>true</bool> |
427 | </property> | 480 | </property> |
481 | <property> | ||
482 | <name>whatsThis</name> | ||
483 | <string>Move selected attribute one line down</string> | ||
484 | </property> | ||
428 | </widget> | 485 | </widget> |
429 | <widget row="4" column="0" rowspan="1" colspan="2" > | 486 | <widget row="4" column="0" rowspan="1" colspan="2" > |
430 | <class>QListBox</class> | 487 | <class>QListBox</class> |
431 | <property stdset="1"> | 488 | <property stdset="1"> |
432 | <name>name</name> | 489 | <name>name</name> |
433 | <cstring>allFieldListBox</cstring> | 490 | <cstring>allFieldListBox</cstring> |
434 | </property> | 491 | </property> |
435 | <property stdset="1"> | 492 | <property stdset="1"> |
436 | <name>sizePolicy</name> | 493 | <name>sizePolicy</name> |
437 | <sizepolicy> | 494 | <sizepolicy> |
438 | <hsizetype>7</hsizetype> | 495 | <hsizetype>7</hsizetype> |
439 | <vsizetype>7</vsizetype> | 496 | <vsizetype>7</vsizetype> |
440 | </sizepolicy> | 497 | </sizepolicy> |
441 | </property> | 498 | </property> |
499 | <property> | ||
500 | <name>whatsThis</name> | ||
501 | <string>List of all available attributes</string> | ||
502 | </property> | ||
442 | </widget> | 503 | </widget> |
443 | <widget row="3" column="0" > | 504 | <widget row="3" column="0" > |
444 | <class>QPushButton</class> | 505 | <class>QPushButton</class> |
445 | <property stdset="1"> | 506 | <property stdset="1"> |
446 | <name>name</name> | 507 | <name>name</name> |
447 | <cstring>m_addButton</cstring> | 508 | <cstring>m_addButton</cstring> |
448 | </property> | 509 | </property> |
449 | <property stdset="1"> | 510 | <property stdset="1"> |
450 | <name>sizePolicy</name> | 511 | <name>sizePolicy</name> |
451 | <sizepolicy> | 512 | <sizepolicy> |
452 | <hsizetype>1</hsizetype> | 513 | <hsizetype>1</hsizetype> |
453 | <vsizetype>0</vsizetype> | 514 | <vsizetype>0</vsizetype> |
454 | </sizepolicy> | 515 | </sizepolicy> |
455 | </property> | 516 | </property> |
456 | <property stdset="1"> | 517 | <property stdset="1"> |
457 | <name>text</name> | 518 | <name>text</name> |
458 | <string>Add</string> | 519 | <string>Add</string> |
459 | </property> | 520 | </property> |
521 | <property> | ||
522 | <name>whatsThis</name> | ||
523 | <string>Add selected attribute from list below to the upper list</string> | ||
524 | </property> | ||
460 | </widget> | 525 | </widget> |
461 | <widget row="3" column="1" > | 526 | <widget row="3" column="1" > |
462 | <class>QPushButton</class> | 527 | <class>QPushButton</class> |
463 | <property stdset="1"> | 528 | <property stdset="1"> |
464 | <name>name</name> | 529 | <name>name</name> |
465 | <cstring>m_removeButton</cstring> | 530 | <cstring>m_removeButton</cstring> |
466 | </property> | 531 | </property> |
467 | <property stdset="1"> | 532 | <property stdset="1"> |
468 | <name>sizePolicy</name> | 533 | <name>sizePolicy</name> |
469 | <sizepolicy> | 534 | <sizepolicy> |
470 | <hsizetype>1</hsizetype> | 535 | <hsizetype>1</hsizetype> |
471 | <vsizetype>0</vsizetype> | 536 | <vsizetype>0</vsizetype> |
472 | </sizepolicy> | 537 | </sizepolicy> |
473 | </property> | 538 | </property> |
474 | <property stdset="1"> | 539 | <property stdset="1"> |
475 | <name>text</name> | 540 | <name>text</name> |
476 | <string>Remove</string> | 541 | <string>Remove</string> |
477 | </property> | 542 | </property> |
543 | <property> | ||
544 | <name>whatsThis</name> | ||
545 | <string>Remove the selected attribute from the upper list</string> | ||
546 | </property> | ||
478 | </widget> | 547 | </widget> |
479 | <spacer row="2" column="2" > | 548 | <spacer row="2" column="2" > |
480 | <property> | 549 | <property> |
481 | <name>name</name> | 550 | <name>name</name> |
482 | <cstring>Spacer23</cstring> | 551 | <cstring>Spacer23</cstring> |
483 | </property> | 552 | </property> |
484 | <property stdset="1"> | 553 | <property stdset="1"> |
485 | <name>orientation</name> | 554 | <name>orientation</name> |
486 | <enum>Vertical</enum> | 555 | <enum>Vertical</enum> |
487 | </property> | 556 | </property> |
488 | <property stdset="1"> | 557 | <property stdset="1"> |
489 | <name>sizeType</name> | 558 | <name>sizeType</name> |
490 | <enum>Expanding</enum> | 559 | <enum>Expanding</enum> |
491 | </property> | 560 | </property> |
492 | <property> | 561 | <property> |
493 | <name>sizeHint</name> | 562 | <name>sizeHint</name> |
494 | <size> | 563 | <size> |
495 | <width>20</width> | 564 | <width>20</width> |
496 | <height>20</height> | 565 | <height>20</height> |
497 | </size> | 566 | </size> |
498 | </property> | 567 | </property> |
499 | </spacer> | 568 | </spacer> |
500 | <spacer row="3" column="2" rowspan="2" colspan="1" > | 569 | <spacer row="3" column="2" rowspan="2" colspan="1" > |
501 | <property> | 570 | <property> |
502 | <name>name</name> | 571 | <name>name</name> |
503 | <cstring>Spacer2_2</cstring> | 572 | <cstring>Spacer2_2</cstring> |
504 | </property> | 573 | </property> |
505 | <property stdset="1"> | 574 | <property stdset="1"> |
506 | <name>orientation</name> | 575 | <name>orientation</name> |
507 | <enum>Vertical</enum> | 576 | <enum>Vertical</enum> |
508 | </property> | 577 | </property> |
509 | <property stdset="1"> | 578 | <property stdset="1"> |
510 | <name>sizeType</name> | 579 | <name>sizeType</name> |
511 | <enum>Expanding</enum> | 580 | <enum>Expanding</enum> |
512 | </property> | 581 | </property> |
513 | <property> | 582 | <property> |
514 | <name>sizeHint</name> | 583 | <name>sizeHint</name> |
515 | <size> | 584 | <size> |
516 | <width>20</width> | 585 | <width>20</width> |
517 | <height>20</height> | 586 | <height>20</height> |
518 | </size> | 587 | </size> |
519 | </property> | 588 | </property> |
520 | </spacer> | 589 | </spacer> |
521 | <widget row="0" column="0" rowspan="3" colspan="2" > | 590 | <widget row="0" column="0" rowspan="3" colspan="2" > |
522 | <class>QListBox</class> | 591 | <class>QListBox</class> |
523 | <property stdset="1"> | 592 | <property stdset="1"> |
524 | <name>name</name> | 593 | <name>name</name> |
525 | <cstring>fieldListBox</cstring> | 594 | <cstring>fieldListBox</cstring> |
526 | </property> | 595 | </property> |
527 | <property stdset="1"> | 596 | <property stdset="1"> |
528 | <name>sizePolicy</name> | 597 | <name>sizePolicy</name> |
529 | <sizepolicy> | 598 | <sizepolicy> |
530 | <hsizetype>7</hsizetype> | 599 | <hsizetype>7</hsizetype> |
531 | <vsizetype>7</vsizetype> | 600 | <vsizetype>7</vsizetype> |
532 | </sizepolicy> | 601 | </sizepolicy> |
533 | </property> | 602 | </property> |
603 | <property> | ||
604 | <name>whatsThis</name> | ||
605 | <string>Order (up -> down) defines the primary contact shown in the second column of the list view</string> | ||
606 | </property> | ||
534 | </widget> | 607 | </widget> |
535 | </grid> | 608 | </grid> |
536 | </widget> | 609 | </widget> |
537 | </vbox> | 610 | </vbox> |
538 | </widget> | 611 | </widget> |
539 | </widget> | 612 | </widget> |
540 | </vbox> | 613 | </vbox> |
541 | </widget> | 614 | </widget> |
542 | <tabstops> | 615 | <tabstops> |
543 | <tabstop>configDlg_base</tabstop> | 616 | <tabstop>configDlg_base</tabstop> |
544 | <tabstop>m_useQtMail</tabstop> | 617 | <tabstop>m_useQtMail</tabstop> |
545 | <tabstop>m_useOpieMail</tabstop> | 618 | <tabstop>m_useOpieMail</tabstop> |
546 | </tabstops> | 619 | </tabstops> |
547 | </UI> | 620 | </UI> |
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index 0b65a10..df97b85 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -1,1733 +1,1746 @@ | |||
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 | #include <qwhatsthis.h> | ||
50 | 51 | ||
51 | #include <assert.h> | 52 | #include <assert.h> |
52 | 53 | ||
53 | static inline bool containsAlphaNum( const QString &str ); | 54 | static inline bool containsAlphaNum( const QString &str ); |
54 | static inline bool constainsWhiteSpace( const QString &str ); | 55 | static inline bool constainsWhiteSpace( const QString &str ); |
55 | 56 | ||
56 | // helper functions, convert our comma delimited list to proper | 57 | // helper functions, convert our comma delimited list to proper |
57 | // file format... | 58 | // file format... |
58 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, | 59 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, |
59 | QString &strAll ); | 60 | QString &strAll ); |
60 | 61 | ||
61 | // helper convert from file format to comma delimited... | 62 | // helper convert from file format to comma delimited... |
62 | void parseEmailTo( const QString &strDefaultEmail, | 63 | void parseEmailTo( const QString &strDefaultEmail, |
63 | const QString &strOtherEmail, QString &strBack ); | 64 | const QString &strOtherEmail, QString &strBack ); |
64 | 65 | ||
65 | ContactEditor::ContactEditor(const OContact &entry, | 66 | ContactEditor::ContactEditor(const OContact &entry, |
66 | QWidget *parent, | 67 | QWidget *parent, |
67 | const char *name, | 68 | const char *name, |
68 | WFlags fl ) | 69 | WFlags ) |
69 | : QDialog( parent, name, TRUE, fl ), | 70 | : QDialog( parent, name, TRUE, WStyle_ContextHelp ), |
70 | defaultEmailChooserPosition( -1 ), | 71 | defaultEmailChooserPosition( -1 ), |
71 | m_personalView ( false ), | 72 | m_personalView ( false ), |
72 | cmbDefaultEmail( 0 ), | 73 | cmbDefaultEmail( 0 ), |
73 | initializing ( false ) | 74 | initializing ( false ) |
74 | { | 75 | { |
75 | 76 | ||
76 | initializing = true; | 77 | initializing = true; |
77 | 78 | ||
78 | init(); | 79 | init(); |
79 | setEntry( entry ); | 80 | setEntry( entry ); |
80 | // cmbDefaultEmail = 0; | 81 | // cmbDefaultEmail = 0; |
81 | // defaultEmailChooserPosition = -1; | 82 | // defaultEmailChooserPosition = -1; |
82 | 83 | ||
83 | initializing = false; | 84 | initializing = false; |
84 | } | 85 | } |
85 | 86 | ||
86 | ContactEditor::~ContactEditor() { | 87 | ContactEditor::~ContactEditor() { |
87 | } | 88 | } |
88 | 89 | ||
89 | void ContactEditor::init() { | 90 | void ContactEditor::init() { |
90 | qWarning("init() START"); | 91 | qWarning("init() START"); |
91 | 92 | ||
92 | uint i = 0; | 93 | uint i = 0; |
93 | 94 | ||
94 | QStringList trlChooserNames; | 95 | QStringList trlChooserNames; |
95 | 96 | ||
96 | for (i = 0; i <= 6; i++) { | 97 | for (i = 0; i <= 6; i++) { |
97 | slHomeAddress.append( "" ); | 98 | slHomeAddress.append( "" ); |
98 | slBusinessAddress.append( "" ); | 99 | slBusinessAddress.append( "" ); |
99 | } | 100 | } |
100 | 101 | ||
101 | trlChooserNames = OContactFields::trphonefields( false ); | 102 | trlChooserNames = OContactFields::trphonefields( false ); |
102 | slChooserNames = OContactFields::untrphonefields( false ); | 103 | slChooserNames = OContactFields::untrphonefields( false ); |
103 | slDynamicEntries = OContactFields::untrdetailsfields( false ); | 104 | slDynamicEntries = OContactFields::untrdetailsfields( false ); |
104 | trlDynamicEntries = OContactFields::trdetailsfields( false ); | 105 | trlDynamicEntries = OContactFields::trdetailsfields( false ); |
105 | 106 | ||
106 | // Ok, we have to remove elements from the list of dynamic entries | 107 | // Ok, we have to remove elements from the list of dynamic entries |
107 | // which are now stored in special (not dynamic) widgets.. | 108 | // which are now stored in special (not dynamic) widgets.. |
108 | // Otherwise we will get problems with field assignments! (se) | 109 | // Otherwise we will get problems with field assignments! (se) |
109 | slDynamicEntries.remove("Anniversary"); | 110 | slDynamicEntries.remove("Anniversary"); |
110 | slDynamicEntries.remove("Birthday"); | 111 | slDynamicEntries.remove("Birthday"); |
111 | slDynamicEntries.remove("Gender"); | 112 | slDynamicEntries.remove("Gender"); |
112 | 113 | ||
113 | // The same with translated fields.. But I will | 114 | // The same with translated fields.. But I will |
114 | // use the translation map to avoid mismatches.. | 115 | // use the translation map to avoid mismatches.. |
115 | QMap<int, QString> translMap = OContactFields::idToTrFields(); | 116 | QMap<int, QString> translMap = OContactFields::idToTrFields(); |
116 | trlDynamicEntries.remove( translMap[Qtopia::Anniversary] ); | 117 | trlDynamicEntries.remove( translMap[Qtopia::Anniversary] ); |
117 | trlDynamicEntries.remove( translMap[Qtopia::Birthday] ); | 118 | trlDynamicEntries.remove( translMap[Qtopia::Birthday] ); |
118 | trlDynamicEntries.remove( translMap[Qtopia::Gender] ); | 119 | trlDynamicEntries.remove( translMap[Qtopia::Gender] ); |
119 | 120 | ||
120 | // Last Check to be sure.. | 121 | // Last Check to be sure.. |
121 | assert( slDynamicEntries.count() == trlDynamicEntries.count() ); | 122 | assert( slDynamicEntries.count() == trlDynamicEntries.count() ); |
122 | assert( slChooserNames.count() == trlChooserNames.count() ); | 123 | assert( slChooserNames.count() == trlChooserNames.count() ); |
123 | 124 | ||
124 | for (i = 0; i < slChooserNames.count(); i++) | 125 | for (i = 0; i < slChooserNames.count(); i++) |
125 | slChooserValues.append(""); | 126 | slChooserValues.append(""); |
126 | 127 | ||
127 | 128 | ||
128 | QVBoxLayout *vb = new QVBoxLayout( this ); | 129 | QVBoxLayout *vb = new QVBoxLayout( this ); |
129 | 130 | ||
130 | tabMain = new QTabWidget( this ); | 131 | tabMain = new QTabWidget( this ); |
131 | vb->addWidget( tabMain ); | 132 | vb->addWidget( tabMain ); |
132 | 133 | ||
133 | QWidget *tabViewport = new QWidget ( tabMain ); | 134 | QWidget *tabViewport = new QWidget ( tabMain ); |
134 | 135 | ||
135 | vb = new QVBoxLayout( tabViewport ); | 136 | vb = new QVBoxLayout( tabViewport ); |
136 | 137 | ||
137 | svGeneral = new QScrollView( tabViewport ); | 138 | svGeneral = new QScrollView( tabViewport ); |
138 | vb->addWidget( svGeneral, 0, 0 ); | 139 | vb->addWidget( svGeneral, 0, 0 ); |
139 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); | 140 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); |
140 | // svGeneral->setHScrollBarMode( QScrollView::AlwaysOff ); | 141 | // svGeneral->setHScrollBarMode( QScrollView::AlwaysOff ); |
141 | // svGeneral->setVScrollBarMode( QScrollView::AlwaysOff ); | 142 | // svGeneral->setVScrollBarMode( QScrollView::AlwaysOff ); |
142 | svGeneral->setFrameStyle( QFrame::NoFrame ); | 143 | svGeneral->setFrameStyle( QFrame::NoFrame ); |
143 | 144 | ||
144 | QWidget *container = new QWidget( svGeneral->viewport() ); | 145 | QWidget *container = new QWidget( svGeneral->viewport() ); |
145 | svGeneral->addChild( container ); | 146 | svGeneral->addChild( container ); |
146 | 147 | ||
147 | QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); | 148 | QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); |
148 | gl->setResizeMode( QLayout::FreeResize ); | 149 | gl->setResizeMode( QLayout::FreeResize ); |
149 | 150 | ||
150 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); | 151 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); |
152 | QWhatsThis::add( btnFullName, tr( "Press to enter last- middle and firstname" ) ); | ||
151 | gl->addWidget( btnFullName, 0, 0 ); | 153 | gl->addWidget( btnFullName, 0, 0 ); |
152 | txtFullName = new QLineEdit( container ); | 154 | txtFullName = new QLineEdit( container ); |
155 | QWhatsThis::add( txtFullName, tr( "Enter fullname directly ! If you have a lastname with multiple words ( for instance \"de la Guerra\"), please write <lastname>,<firstnames> like this: \"de la Guerra, Carlos Pedro\"" ) ); | ||
153 | gl->addWidget( txtFullName, 0, 1 ); | 156 | gl->addWidget( txtFullName, 0, 1 ); |
154 | 157 | ||
155 | QLabel *l = new QLabel( tr( "Job Title" ), container ); | 158 | QLabel *l = new QLabel( tr( "Job Title" ), container ); |
159 | QWhatsThis::add( l, tr( "The jobtitle.." ) ); | ||
156 | gl->addWidget( l, 1, 0 ); | 160 | gl->addWidget( l, 1, 0 ); |
157 | txtJobTitle = new QLineEdit( container ); | 161 | txtJobTitle = new QLineEdit( container ); |
162 | QWhatsThis::add( txtJobTitle, tr( "The jobtitle.." ) ); | ||
158 | gl->addWidget( txtJobTitle, 1, 1 ); | 163 | gl->addWidget( txtJobTitle, 1, 1 ); |
159 | 164 | ||
160 | l = new QLabel( tr("Suffix"), container ); | 165 | l = new QLabel( tr("Suffix"), container ); |
166 | QWhatsThis::add( l, tr( "Something like \"jr.\".." ) ); | ||
161 | gl->addWidget( l, 2, 0 ); | 167 | gl->addWidget( l, 2, 0 ); |
162 | txtSuffix = new QLineEdit( container ); | 168 | txtSuffix = new QLineEdit( container ); |
169 | QWhatsThis::add( txtSuffix, tr( "Something like \"jr.\".." ) ); | ||
163 | gl->addWidget( txtSuffix, 2, 1 ); | 170 | gl->addWidget( txtSuffix, 2, 1 ); |
164 | 171 | ||
165 | l = new QLabel( tr( "Organization" ), container ); | 172 | l = new QLabel( tr( "Organization" ), container ); |
173 | QWhatsThis::add( l, tr( "The working place of the contact" ) ); | ||
166 | gl->addWidget( l, 3, 0 ); | 174 | gl->addWidget( l, 3, 0 ); |
167 | txtOrganization = new QLineEdit( container ); | 175 | txtOrganization = new QLineEdit( container ); |
176 | QWhatsThis::add( txtOrganization, tr( "The working place of the contact" ) ); | ||
168 | gl->addWidget( txtOrganization, 3, 1 ); | 177 | gl->addWidget( txtOrganization, 3, 1 ); |
169 | 178 | ||
170 | // Chooser 1 | 179 | // Chooser 1 |
171 | cmbChooserField1 = new QComboBox( FALSE, container ); | 180 | cmbChooserField1 = new QComboBox( FALSE, container ); |
181 | QWhatsThis::add( cmbChooserField1, tr( "Press to select attribute to change" ) ); | ||
172 | cmbChooserField1->setMaximumWidth( 90 ); | 182 | cmbChooserField1->setMaximumWidth( 90 ); |
173 | gl->addWidget( cmbChooserField1, 4, 0 ); | 183 | gl->addWidget( cmbChooserField1, 4, 0 ); |
174 | // Textfield for chooser 1. | 184 | // Textfield for chooser 1. |
175 | // Now use Widgetstack to contain the textfield and the default-email combo ! | 185 | // Now use Widgetstack to contain the textfield and the default-email combo ! |
176 | m_widgetStack1 = new QWidgetStack( container ); | 186 | m_widgetStack1 = new QWidgetStack( container ); |
177 | txtChooserField1 = new QLineEdit( m_widgetStack1 ); | 187 | txtChooserField1 = new QLineEdit( m_widgetStack1 ); |
178 | m_widgetStack1 -> addWidget( txtChooserField1, TextField ); | 188 | m_widgetStack1 -> addWidget( txtChooserField1, TextField ); |
179 | gl->addWidget( m_widgetStack1, 4, 1 ); | 189 | gl->addWidget( m_widgetStack1, 4, 1 ); |
180 | m_widgetStack1 -> raiseWidget( TextField ); | 190 | m_widgetStack1 -> raiseWidget( TextField ); |
181 | 191 | ||
182 | // Chooser 2 | 192 | // Chooser 2 |
183 | cmbChooserField2 = new QComboBox( FALSE, container ); | 193 | cmbChooserField2 = new QComboBox( FALSE, container ); |
194 | QWhatsThis::add( cmbChooserField2, tr( "Press to select attribute to change" ) ); | ||
184 | cmbChooserField2->setMaximumWidth( 90 ); | 195 | cmbChooserField2->setMaximumWidth( 90 ); |
185 | gl->addWidget( cmbChooserField2, 5, 0 ); | 196 | gl->addWidget( cmbChooserField2, 5, 0 ); |
186 | // Textfield for chooser 2 | 197 | // Textfield for chooser 2 |
187 | // Now use WidgetStack to contain the textfield and the default-email combo! | 198 | // Now use WidgetStack to contain the textfield and the default-email combo! |
188 | m_widgetStack2 = new QWidgetStack( container ); | 199 | m_widgetStack2 = new QWidgetStack( container ); |
189 | txtChooserField2 = new QLineEdit( m_widgetStack2 ); | 200 | txtChooserField2 = new QLineEdit( m_widgetStack2 ); |
190 | m_widgetStack2 -> addWidget( txtChooserField2, TextField ); | 201 | m_widgetStack2 -> addWidget( txtChooserField2, TextField ); |
191 | gl->addWidget( m_widgetStack2, 5, 1 ); | 202 | gl->addWidget( m_widgetStack2, 5, 1 ); |
192 | m_widgetStack2 -> raiseWidget( TextField ); | 203 | m_widgetStack2 -> raiseWidget( TextField ); |
193 | 204 | ||
194 | // Chooser 3 | 205 | // Chooser 3 |
195 | cmbChooserField3 = new QComboBox( FALSE, container ); | 206 | cmbChooserField3 = new QComboBox( FALSE, container ); |
207 | QWhatsThis::add( cmbChooserField3, tr( "Press to select attribute to change" ) ); | ||
196 | cmbChooserField3->setMaximumWidth( 90 ); | 208 | cmbChooserField3->setMaximumWidth( 90 ); |
197 | gl->addWidget( cmbChooserField3, 6, 0 ); | 209 | gl->addWidget( cmbChooserField3, 6, 0 ); |
198 | // Textfield for chooser 2 | 210 | // Textfield for chooser 2 |
199 | // Now use WidgetStack to contain the textfield and the default-email combo! | 211 | // Now use WidgetStack to contain the textfield and the default-email combo! |
200 | m_widgetStack3 = new QWidgetStack( container ); | 212 | m_widgetStack3 = new QWidgetStack( container ); |
201 | txtChooserField3 = new QLineEdit( m_widgetStack3 ); | 213 | txtChooserField3 = new QLineEdit( m_widgetStack3 ); |
202 | m_widgetStack3 -> addWidget( txtChooserField3, TextField ); | 214 | m_widgetStack3 -> addWidget( txtChooserField3, TextField ); |
203 | gl->addWidget( m_widgetStack3, 6, 1 ); | 215 | gl->addWidget( m_widgetStack3, 6, 1 ); |
204 | m_widgetStack3 -> raiseWidget( TextField ); | 216 | m_widgetStack3 -> raiseWidget( TextField ); |
205 | 217 | ||
206 | l = new QLabel( tr( "File As" ), container ); | 218 | l = new QLabel( tr( "File As" ), container ); |
219 | QWhatsThis::add( l, tr( "Press to select how to store the name (and howto show it in the listview)" ) ); | ||
207 | gl->addWidget( l, 7, 0 ); | 220 | gl->addWidget( l, 7, 0 ); |
208 | cmbFileAs = new QComboBox( TRUE, container ); | 221 | cmbFileAs = new QComboBox( TRUE, container ); |
209 | gl->addWidget( cmbFileAs, 7, 1 ); | 222 | gl->addWidget( cmbFileAs, 7, 1 ); |
210 | 223 | ||
211 | labCat = new QLabel( tr( "Category" ), container ); | 224 | labCat = new QLabel( tr( "Category" ), container ); |
212 | gl->addWidget( labCat, 8, 0 ); | 225 | gl->addWidget( labCat, 8, 0 ); |
213 | cmbCat = new CategorySelect( container ); | 226 | cmbCat = new CategorySelect( container ); |
214 | gl->addWidget( cmbCat, 8, 1 ); | 227 | gl->addWidget( cmbCat, 8, 1 ); |
215 | labCat->show(); | 228 | labCat->show(); |
216 | cmbCat->show(); | 229 | cmbCat->show(); |
217 | 230 | ||
218 | btnNote = new QPushButton( tr( "Notes..." ), container ); | 231 | btnNote = new QPushButton( tr( "Notes..." ), container ); |
219 | gl->addWidget( btnNote, 9, 1 ); | 232 | gl->addWidget( btnNote, 9, 1 ); |
220 | 233 | ||
221 | tabMain->insertTab( tabViewport, tr( "General" ) ); | 234 | tabMain->insertTab( tabViewport, tr( "General" ) ); |
222 | 235 | ||
223 | tabViewport = new QWidget ( tabMain ); | 236 | tabViewport = new QWidget ( tabMain ); |
224 | 237 | ||
225 | vb = new QVBoxLayout( tabViewport ); | 238 | vb = new QVBoxLayout( tabViewport ); |
226 | 239 | ||
227 | svAddress = new QScrollView( tabViewport ); | 240 | svAddress = new QScrollView( tabViewport ); |
228 | vb->addWidget( svAddress, 0, 0 ); | 241 | vb->addWidget( svAddress, 0, 0 ); |
229 | svAddress->setResizePolicy( QScrollView::AutoOneFit ); | 242 | svAddress->setResizePolicy( QScrollView::AutoOneFit ); |
230 | svAddress->setFrameStyle( QFrame::NoFrame ); | 243 | svAddress->setFrameStyle( QFrame::NoFrame ); |
231 | 244 | ||
232 | container = new QWidget( svAddress->viewport() ); | 245 | container = new QWidget( svAddress->viewport() ); |
233 | svAddress->addChild( container ); | 246 | svAddress->addChild( container ); |
234 | 247 | ||
235 | gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem | 248 | gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem |
236 | 249 | ||
237 | cmbAddress = new QComboBox( FALSE, container ); | 250 | cmbAddress = new QComboBox( FALSE, container ); |
238 | cmbAddress->insertItem( tr( "Business" ) ); | 251 | cmbAddress->insertItem( tr( "Business" ) ); |
239 | cmbAddress->insertItem( tr( "Home" ) ); | 252 | cmbAddress->insertItem( tr( "Home" ) ); |
240 | gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); | 253 | gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); |
241 | 254 | ||
242 | l = new QLabel( tr( "Address" ), container ); | 255 | l = new QLabel( tr( "Address" ), container ); |
243 | gl->addWidget( l, 1, 0 ); | 256 | gl->addWidget( l, 1, 0 ); |
244 | txtAddress = new QLineEdit( container ); | 257 | txtAddress = new QLineEdit( container ); |
245 | gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 ); | 258 | gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 ); |
246 | 259 | ||
247 | l = new QLabel( tr( "City" ), container ); | 260 | l = new QLabel( tr( "City" ), container ); |
248 | gl->addWidget( l, 2, 0 ); | 261 | gl->addWidget( l, 2, 0 ); |
249 | txtCity = new QLineEdit( container ); | 262 | txtCity = new QLineEdit( container ); |
250 | gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 ); | 263 | gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 ); |
251 | 264 | ||
252 | l = new QLabel( tr( "State" ), container ); | 265 | l = new QLabel( tr( "State" ), container ); |
253 | gl->addWidget( l, 3, 0 ); | 266 | gl->addWidget( l, 3, 0 ); |
254 | txtState = new QLineEdit( container ); | 267 | txtState = new QLineEdit( container ); |
255 | gl->addMultiCellWidget( txtState, 3, 3, 1, 2 ); | 268 | gl->addMultiCellWidget( txtState, 3, 3, 1, 2 ); |
256 | 269 | ||
257 | l = new QLabel( tr( "Zip Code" ), container ); | 270 | l = new QLabel( tr( "Zip Code" ), container ); |
258 | gl->addWidget( l, 4, 0 ); | 271 | gl->addWidget( l, 4, 0 ); |
259 | txtZip = new QLineEdit( container ); | 272 | txtZip = new QLineEdit( container ); |
260 | gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 ); | 273 | gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 ); |
261 | 274 | ||
262 | l = new QLabel( tr( "Country" ), container ); | 275 | l = new QLabel( tr( "Country" ), container ); |
263 | gl->addWidget( l, 5, 0 ); | 276 | gl->addWidget( l, 5, 0 ); |
264 | cmbCountry = new QComboBox( TRUE, container ); | 277 | cmbCountry = new QComboBox( TRUE, container ); |
265 | cmbCountry->insertItem( tr( "" ) ); | 278 | cmbCountry->insertItem( tr( "" ) ); |
266 | cmbCountry->insertItem( tr ( "United States" ) ); | 279 | cmbCountry->insertItem( tr ( "United States" ) ); |
267 | cmbCountry->insertItem( tr ( "United Kingdom" ) ); | 280 | cmbCountry->insertItem( tr ( "United Kingdom" ) ); |
268 | cmbCountry->insertItem( tr ( "Afghanistan" ) ); | 281 | cmbCountry->insertItem( tr ( "Afghanistan" ) ); |
269 | cmbCountry->insertItem( tr ( "Albania" ) ); | 282 | cmbCountry->insertItem( tr ( "Albania" ) ); |
270 | cmbCountry->insertItem( tr ( "Algeria" ) ); | 283 | cmbCountry->insertItem( tr ( "Algeria" ) ); |
271 | cmbCountry->insertItem( tr ( "American Samoa" ) ); | 284 | cmbCountry->insertItem( tr ( "American Samoa" ) ); |
272 | cmbCountry->insertItem( tr ( "Andorra" ) ); | 285 | cmbCountry->insertItem( tr ( "Andorra" ) ); |
273 | cmbCountry->insertItem( tr ( "Angola" ) ); | 286 | cmbCountry->insertItem( tr ( "Angola" ) ); |
274 | cmbCountry->insertItem( tr ( "Anguilla" ) ); | 287 | cmbCountry->insertItem( tr ( "Anguilla" ) ); |
275 | cmbCountry->insertItem( tr ( "Antarctica" ) ); | 288 | cmbCountry->insertItem( tr ( "Antarctica" ) ); |
276 | cmbCountry->insertItem( tr ( "Argentina" ) ); | 289 | cmbCountry->insertItem( tr ( "Argentina" ) ); |
277 | cmbCountry->insertItem( tr ( "Armenia" ) ); | 290 | cmbCountry->insertItem( tr ( "Armenia" ) ); |
278 | cmbCountry->insertItem( tr ( "Aruba" ) ); | 291 | cmbCountry->insertItem( tr ( "Aruba" ) ); |
279 | cmbCountry->insertItem( tr ( "Australia" ) ); | 292 | cmbCountry->insertItem( tr ( "Australia" ) ); |
280 | cmbCountry->insertItem( tr ( "Austria" ) ); | 293 | cmbCountry->insertItem( tr ( "Austria" ) ); |
281 | cmbCountry->insertItem( tr ( "Azerbaijan" ) ); | 294 | cmbCountry->insertItem( tr ( "Azerbaijan" ) ); |
282 | cmbCountry->insertItem( tr ( "Bahamas" ) ); | 295 | cmbCountry->insertItem( tr ( "Bahamas" ) ); |
283 | cmbCountry->insertItem( tr ( "Bahrain" ) ); | 296 | cmbCountry->insertItem( tr ( "Bahrain" ) ); |
284 | cmbCountry->insertItem( tr ( "Bangladesh" ) ); | 297 | cmbCountry->insertItem( tr ( "Bangladesh" ) ); |
285 | cmbCountry->insertItem( tr ( "Barbados" ) ); | 298 | cmbCountry->insertItem( tr ( "Barbados" ) ); |
286 | cmbCountry->insertItem( tr ( "Belarus" ) ); | 299 | cmbCountry->insertItem( tr ( "Belarus" ) ); |
287 | cmbCountry->insertItem( tr ( "Belgium" ) ); | 300 | cmbCountry->insertItem( tr ( "Belgium" ) ); |
288 | cmbCountry->insertItem( tr ( "Belize" ) ); | 301 | cmbCountry->insertItem( tr ( "Belize" ) ); |
289 | cmbCountry->insertItem( tr ( "Benin" ) ); | 302 | cmbCountry->insertItem( tr ( "Benin" ) ); |
290 | cmbCountry->insertItem( tr ( "Bermuda" ) ); | 303 | cmbCountry->insertItem( tr ( "Bermuda" ) ); |
291 | cmbCountry->insertItem( tr ( "Bhutan" ) ); | 304 | cmbCountry->insertItem( tr ( "Bhutan" ) ); |
292 | cmbCountry->insertItem( tr ( "Bolivia" ) ); | 305 | cmbCountry->insertItem( tr ( "Bolivia" ) ); |
293 | cmbCountry->insertItem( tr ( "Botswana" ) ); | 306 | cmbCountry->insertItem( tr ( "Botswana" ) ); |
294 | cmbCountry->insertItem( tr ( "Bouvet Island" ) ); | 307 | cmbCountry->insertItem( tr ( "Bouvet Island" ) ); |
295 | cmbCountry->insertItem( tr ( "Brazil" ) ); | 308 | cmbCountry->insertItem( tr ( "Brazil" ) ); |
296 | cmbCountry->insertItem( tr ( "Brunei Darussalam" ) ); | 309 | cmbCountry->insertItem( tr ( "Brunei Darussalam" ) ); |
297 | cmbCountry->insertItem( tr ( "Bulgaria" ) ); | 310 | cmbCountry->insertItem( tr ( "Bulgaria" ) ); |
298 | cmbCountry->insertItem( tr ( "Burkina Faso" ) ); | 311 | cmbCountry->insertItem( tr ( "Burkina Faso" ) ); |
299 | cmbCountry->insertItem( tr ( "Burundi" ) ); | 312 | cmbCountry->insertItem( tr ( "Burundi" ) ); |
300 | cmbCountry->insertItem( tr ( "Cambodia" ) ); | 313 | cmbCountry->insertItem( tr ( "Cambodia" ) ); |
301 | cmbCountry->insertItem( tr ( "Cameroon" ) ); | 314 | cmbCountry->insertItem( tr ( "Cameroon" ) ); |
302 | cmbCountry->insertItem( tr ( "Canada" ) ); | 315 | cmbCountry->insertItem( tr ( "Canada" ) ); |
303 | cmbCountry->insertItem( tr ( "Cape Verde" ) ); | 316 | cmbCountry->insertItem( tr ( "Cape Verde" ) ); |
304 | cmbCountry->insertItem( tr ( "Cayman Islands" ) ); | 317 | cmbCountry->insertItem( tr ( "Cayman Islands" ) ); |
305 | cmbCountry->insertItem( tr ( "Chad" ) ); | 318 | cmbCountry->insertItem( tr ( "Chad" ) ); |
306 | cmbCountry->insertItem( tr ( "Chile" ) ); | 319 | cmbCountry->insertItem( tr ( "Chile" ) ); |
307 | cmbCountry->insertItem( tr ( "China" ) ); | 320 | cmbCountry->insertItem( tr ( "China" ) ); |
308 | cmbCountry->insertItem( tr ( "Christmas Island" ) ); | 321 | cmbCountry->insertItem( tr ( "Christmas Island" ) ); |
309 | cmbCountry->insertItem( tr ( "Colombia" ) ); | 322 | cmbCountry->insertItem( tr ( "Colombia" ) ); |
310 | cmbCountry->insertItem( tr ( "Comoros" ) ); | 323 | cmbCountry->insertItem( tr ( "Comoros" ) ); |
311 | cmbCountry->insertItem( tr ( "Congo" ) ); | 324 | cmbCountry->insertItem( tr ( "Congo" ) ); |
312 | cmbCountry->insertItem( tr ( "Cook Island" ) ); | 325 | cmbCountry->insertItem( tr ( "Cook Island" ) ); |
313 | cmbCountry->insertItem( tr ( "Costa Rica" ) ); | 326 | cmbCountry->insertItem( tr ( "Costa Rica" ) ); |
314 | cmbCountry->insertItem( tr ( "Cote d'Ivoire" ) ); | 327 | cmbCountry->insertItem( tr ( "Cote d'Ivoire" ) ); |
315 | cmbCountry->insertItem( tr ( "Croatia" ) ); | 328 | cmbCountry->insertItem( tr ( "Croatia" ) ); |
316 | cmbCountry->insertItem( tr ( "Cuba" ) ); | 329 | cmbCountry->insertItem( tr ( "Cuba" ) ); |
317 | cmbCountry->insertItem( tr ( "Cyprus" ) ); | 330 | cmbCountry->insertItem( tr ( "Cyprus" ) ); |
318 | cmbCountry->insertItem( tr ( "Czech Republic" ) ); | 331 | cmbCountry->insertItem( tr ( "Czech Republic" ) ); |
319 | cmbCountry->insertItem( tr ( "Denmark" ) ); | 332 | cmbCountry->insertItem( tr ( "Denmark" ) ); |
320 | cmbCountry->insertItem( tr ( "Djibouti" ) ); | 333 | cmbCountry->insertItem( tr ( "Djibouti" ) ); |
321 | cmbCountry->insertItem( tr ( "Dominica" ) ); | 334 | cmbCountry->insertItem( tr ( "Dominica" ) ); |
322 | cmbCountry->insertItem( tr ( "Dominican Republic" ) ); | 335 | cmbCountry->insertItem( tr ( "Dominican Republic" ) ); |
323 | cmbCountry->insertItem( tr ( "East Timor" ) ); | 336 | cmbCountry->insertItem( tr ( "East Timor" ) ); |
324 | cmbCountry->insertItem( tr ( "Ecuador" ) ); | 337 | cmbCountry->insertItem( tr ( "Ecuador" ) ); |
325 | cmbCountry->insertItem( tr ( "Egypt" ) ); | 338 | cmbCountry->insertItem( tr ( "Egypt" ) ); |
326 | cmbCountry->insertItem( tr ( "El Salvador" ) ); | 339 | cmbCountry->insertItem( tr ( "El Salvador" ) ); |
327 | cmbCountry->insertItem( tr ( "Equatorial Guinea" ) ); | 340 | cmbCountry->insertItem( tr ( "Equatorial Guinea" ) ); |
328 | cmbCountry->insertItem( tr ( "Eritrea" ) ); | 341 | cmbCountry->insertItem( tr ( "Eritrea" ) ); |
329 | cmbCountry->insertItem( tr ( "Estonia" ) ); | 342 | cmbCountry->insertItem( tr ( "Estonia" ) ); |
330 | cmbCountry->insertItem( tr ( "Ethiopia" ) ); | 343 | cmbCountry->insertItem( tr ( "Ethiopia" ) ); |
331 | cmbCountry->insertItem( tr ( "Falkland Islands" ) ); | 344 | cmbCountry->insertItem( tr ( "Falkland Islands" ) ); |
332 | cmbCountry->insertItem( tr ( "Faroe Islands" ) ); | 345 | cmbCountry->insertItem( tr ( "Faroe Islands" ) ); |
333 | cmbCountry->insertItem( tr ( "Fiji" ) ); | 346 | cmbCountry->insertItem( tr ( "Fiji" ) ); |
334 | cmbCountry->insertItem( tr ( "Finland" ) ); | 347 | cmbCountry->insertItem( tr ( "Finland" ) ); |
335 | cmbCountry->insertItem( tr ( "France" ) ); | 348 | cmbCountry->insertItem( tr ( "France" ) ); |
336 | cmbCountry->insertItem( tr ( "French Guiana" ) ); | 349 | cmbCountry->insertItem( tr ( "French Guiana" ) ); |
337 | cmbCountry->insertItem( tr ( "French Polynesia" ) ); | 350 | cmbCountry->insertItem( tr ( "French Polynesia" ) ); |
338 | cmbCountry->insertItem( tr ( "Gabon" ) ); | 351 | cmbCountry->insertItem( tr ( "Gabon" ) ); |
339 | cmbCountry->insertItem( tr ( "Gambia" ) ); | 352 | cmbCountry->insertItem( tr ( "Gambia" ) ); |
340 | cmbCountry->insertItem( tr ( "Georgia" ) ); | 353 | cmbCountry->insertItem( tr ( "Georgia" ) ); |
341 | cmbCountry->insertItem( tr ( "Germany" ) ); | 354 | cmbCountry->insertItem( tr ( "Germany" ) ); |
342 | cmbCountry->insertItem( tr ( "Ghana" ) ); | 355 | cmbCountry->insertItem( tr ( "Ghana" ) ); |
343 | cmbCountry->insertItem( tr ( "Gibraltar" ) ); | 356 | cmbCountry->insertItem( tr ( "Gibraltar" ) ); |
344 | cmbCountry->insertItem( tr ( "Greece" ) ); | 357 | cmbCountry->insertItem( tr ( "Greece" ) ); |
345 | cmbCountry->insertItem( tr ( "Greenland" ) ); | 358 | cmbCountry->insertItem( tr ( "Greenland" ) ); |
346 | cmbCountry->insertItem( tr ( "Grenada" ) ); | 359 | cmbCountry->insertItem( tr ( "Grenada" ) ); |
347 | cmbCountry->insertItem( tr ( "Guadeloupe" ) ); | 360 | cmbCountry->insertItem( tr ( "Guadeloupe" ) ); |
348 | cmbCountry->insertItem( tr ( "Guam" ) ); | 361 | cmbCountry->insertItem( tr ( "Guam" ) ); |
349 | cmbCountry->insertItem( tr ( "Guatemala" ) ); | 362 | cmbCountry->insertItem( tr ( "Guatemala" ) ); |
350 | cmbCountry->insertItem( tr ( "Guinea" ) ); | 363 | cmbCountry->insertItem( tr ( "Guinea" ) ); |
351 | cmbCountry->insertItem( tr ( "Guinea-Bissau" ) ); | 364 | cmbCountry->insertItem( tr ( "Guinea-Bissau" ) ); |
352 | cmbCountry->insertItem( tr ( "Guyana" ) ); | 365 | cmbCountry->insertItem( tr ( "Guyana" ) ); |
353 | cmbCountry->insertItem( tr ( "Haiti" ) ); | 366 | cmbCountry->insertItem( tr ( "Haiti" ) ); |
354 | cmbCountry->insertItem( tr ( "Holy See" ) ); | 367 | cmbCountry->insertItem( tr ( "Holy See" ) ); |
355 | cmbCountry->insertItem( tr ( "Honduras" ) ); | 368 | cmbCountry->insertItem( tr ( "Honduras" ) ); |
356 | cmbCountry->insertItem( tr ( "Hong Kong" ) ); | 369 | cmbCountry->insertItem( tr ( "Hong Kong" ) ); |
357 | cmbCountry->insertItem( tr ( "Hungary" ) ); | 370 | cmbCountry->insertItem( tr ( "Hungary" ) ); |
358 | cmbCountry->insertItem( tr ( "Iceland" ) ); | 371 | cmbCountry->insertItem( tr ( "Iceland" ) ); |
359 | cmbCountry->insertItem( tr ( "India" ) ); | 372 | cmbCountry->insertItem( tr ( "India" ) ); |
360 | cmbCountry->insertItem( tr ( "Indonesia" ) ); | 373 | cmbCountry->insertItem( tr ( "Indonesia" ) ); |
361 | cmbCountry->insertItem( tr ( "Ireland" ) ); | 374 | cmbCountry->insertItem( tr ( "Ireland" ) ); |
362 | cmbCountry->insertItem( tr ( "Israel" ) ); | 375 | cmbCountry->insertItem( tr ( "Israel" ) ); |
363 | cmbCountry->insertItem( tr ( "Italy" ) ); | 376 | cmbCountry->insertItem( tr ( "Italy" ) ); |
364 | cmbCountry->insertItem( tr ( "Jamaica" ) ); | 377 | cmbCountry->insertItem( tr ( "Jamaica" ) ); |
365 | cmbCountry->insertItem( tr ( "Japan" ) ); | 378 | cmbCountry->insertItem( tr ( "Japan" ) ); |
366 | cmbCountry->insertItem( tr ( "Jordan" ) ); | 379 | cmbCountry->insertItem( tr ( "Jordan" ) ); |
367 | cmbCountry->insertItem( tr ( "Kazakhstan" ) ); | 380 | cmbCountry->insertItem( tr ( "Kazakhstan" ) ); |
368 | cmbCountry->insertItem( tr ( "Kenya" ) ); | 381 | cmbCountry->insertItem( tr ( "Kenya" ) ); |
369 | cmbCountry->insertItem( tr ( "Kiribati" ) ); | 382 | cmbCountry->insertItem( tr ( "Kiribati" ) ); |
370 | cmbCountry->insertItem( tr ( "Korea" ) ); | 383 | cmbCountry->insertItem( tr ( "Korea" ) ); |
371 | cmbCountry->insertItem( tr ( "Kuwait" ) ); | 384 | cmbCountry->insertItem( tr ( "Kuwait" ) ); |
372 | cmbCountry->insertItem( tr ( "Kyrgyzstan" ) ); | 385 | cmbCountry->insertItem( tr ( "Kyrgyzstan" ) ); |
373 | cmbCountry->insertItem( tr ( "Laos" ) ); | 386 | cmbCountry->insertItem( tr ( "Laos" ) ); |
374 | cmbCountry->insertItem( tr ( "Latvia" ) ); | 387 | cmbCountry->insertItem( tr ( "Latvia" ) ); |
375 | cmbCountry->insertItem( tr ( "Lebanon" ) ); | 388 | cmbCountry->insertItem( tr ( "Lebanon" ) ); |
376 | cmbCountry->insertItem( tr ( "Lesotho" ) ); | 389 | cmbCountry->insertItem( tr ( "Lesotho" ) ); |
377 | cmbCountry->insertItem( tr ( "Liberia" ) ); | 390 | cmbCountry->insertItem( tr ( "Liberia" ) ); |
378 | cmbCountry->insertItem( tr ( "Liechtenstein" ) ); | 391 | cmbCountry->insertItem( tr ( "Liechtenstein" ) ); |
379 | cmbCountry->insertItem( tr ( "Lithuania" ) ); | 392 | cmbCountry->insertItem( tr ( "Lithuania" ) ); |
380 | cmbCountry->insertItem( tr ( "Luxembourg" ) ); | 393 | cmbCountry->insertItem( tr ( "Luxembourg" ) ); |
381 | cmbCountry->insertItem( tr ( "Macau" ) ); | 394 | cmbCountry->insertItem( tr ( "Macau" ) ); |
382 | cmbCountry->insertItem( tr ( "Macedonia" ) ); | 395 | cmbCountry->insertItem( tr ( "Macedonia" ) ); |
383 | cmbCountry->insertItem( tr ( "Madagascar" ) ); | 396 | cmbCountry->insertItem( tr ( "Madagascar" ) ); |
384 | cmbCountry->insertItem( tr ( "Malawi" ) ); | 397 | cmbCountry->insertItem( tr ( "Malawi" ) ); |
385 | cmbCountry->insertItem( tr ( "Malaysia" ) ); | 398 | cmbCountry->insertItem( tr ( "Malaysia" ) ); |
386 | cmbCountry->insertItem( tr ( "Maldives" ) ); | 399 | cmbCountry->insertItem( tr ( "Maldives" ) ); |
387 | cmbCountry->insertItem( tr ( "Mali" ) ); | 400 | cmbCountry->insertItem( tr ( "Mali" ) ); |
388 | cmbCountry->insertItem( tr ( "Malta" ) ); | 401 | cmbCountry->insertItem( tr ( "Malta" ) ); |
389 | cmbCountry->insertItem( tr ( "Martinique" ) ); | 402 | cmbCountry->insertItem( tr ( "Martinique" ) ); |
390 | cmbCountry->insertItem( tr ( "Mauritania" ) ); | 403 | cmbCountry->insertItem( tr ( "Mauritania" ) ); |
391 | cmbCountry->insertItem( tr ( "Mauritius" ) ); | 404 | cmbCountry->insertItem( tr ( "Mauritius" ) ); |
392 | cmbCountry->insertItem( tr ( "Mayotte" ) ); | 405 | cmbCountry->insertItem( tr ( "Mayotte" ) ); |
393 | cmbCountry->insertItem( tr ( "Mexico" ) ); | 406 | cmbCountry->insertItem( tr ( "Mexico" ) ); |
394 | cmbCountry->insertItem( tr ( "Micronesia" ) ); | 407 | cmbCountry->insertItem( tr ( "Micronesia" ) ); |
395 | cmbCountry->insertItem( tr ( "Moldova" ) ); | 408 | cmbCountry->insertItem( tr ( "Moldova" ) ); |
396 | cmbCountry->insertItem( tr ( "Monaco" ) ); | 409 | cmbCountry->insertItem( tr ( "Monaco" ) ); |
397 | cmbCountry->insertItem( tr ( "Mongolia" ) ); | 410 | cmbCountry->insertItem( tr ( "Mongolia" ) ); |
398 | cmbCountry->insertItem( tr ( "Montserrat" ) ); | 411 | cmbCountry->insertItem( tr ( "Montserrat" ) ); |
399 | cmbCountry->insertItem( tr ( "Morocco" ) ); | 412 | cmbCountry->insertItem( tr ( "Morocco" ) ); |
400 | cmbCountry->insertItem( tr ( "Mozambique" ) ); | 413 | cmbCountry->insertItem( tr ( "Mozambique" ) ); |
401 | cmbCountry->insertItem( tr ( "Myanmar" ) ); | 414 | cmbCountry->insertItem( tr ( "Myanmar" ) ); |
402 | cmbCountry->insertItem( tr ( "Namibia" ) ); | 415 | cmbCountry->insertItem( tr ( "Namibia" ) ); |
403 | cmbCountry->insertItem( tr ( "Nauru" ) ); | 416 | cmbCountry->insertItem( tr ( "Nauru" ) ); |
404 | cmbCountry->insertItem( tr ( "Nepal" ) ); | 417 | cmbCountry->insertItem( tr ( "Nepal" ) ); |
405 | cmbCountry->insertItem( tr ( "Netherlands" ) ); | 418 | cmbCountry->insertItem( tr ( "Netherlands" ) ); |
406 | cmbCountry->insertItem( tr ( "New Caledonia" ) ); | 419 | cmbCountry->insertItem( tr ( "New Caledonia" ) ); |
407 | cmbCountry->insertItem( tr ( "New Zealand" ) ); | 420 | cmbCountry->insertItem( tr ( "New Zealand" ) ); |
408 | cmbCountry->insertItem( tr ( "Nicaragua" ) ); | 421 | cmbCountry->insertItem( tr ( "Nicaragua" ) ); |
409 | cmbCountry->insertItem( tr ( "Niger" ) ); | 422 | cmbCountry->insertItem( tr ( "Niger" ) ); |
410 | cmbCountry->insertItem( tr ( "Nigeria" ) ); | 423 | cmbCountry->insertItem( tr ( "Nigeria" ) ); |
411 | cmbCountry->insertItem( tr ( "Niue" ) ); | 424 | cmbCountry->insertItem( tr ( "Niue" ) ); |
412 | cmbCountry->insertItem( tr ( "Norway" ) ); | 425 | cmbCountry->insertItem( tr ( "Norway" ) ); |
413 | cmbCountry->insertItem( tr ( "Oman" ) ); | 426 | cmbCountry->insertItem( tr ( "Oman" ) ); |
414 | cmbCountry->insertItem( tr ( "Pakistan" ) ); | 427 | cmbCountry->insertItem( tr ( "Pakistan" ) ); |
415 | cmbCountry->insertItem( tr ( "Palau" ) ); | 428 | cmbCountry->insertItem( tr ( "Palau" ) ); |
416 | cmbCountry->insertItem( tr ( "Palestinian Sovereign Areas" ) ); | 429 | cmbCountry->insertItem( tr ( "Palestinian Sovereign Areas" ) ); |
417 | cmbCountry->insertItem( tr ( "Panama" ) ); | 430 | cmbCountry->insertItem( tr ( "Panama" ) ); |
418 | cmbCountry->insertItem( tr ( "Papua New Guinea" ) ); | 431 | cmbCountry->insertItem( tr ( "Papua New Guinea" ) ); |
419 | cmbCountry->insertItem( tr ( "Paraguay" ) ); | 432 | cmbCountry->insertItem( tr ( "Paraguay" ) ); |
420 | cmbCountry->insertItem( tr ( "Peru" ) ); | 433 | cmbCountry->insertItem( tr ( "Peru" ) ); |
421 | cmbCountry->insertItem( tr ( "Philippines" ) ); | 434 | cmbCountry->insertItem( tr ( "Philippines" ) ); |
422 | cmbCountry->insertItem( tr ( "Pitcairn Islands" ) ); | 435 | cmbCountry->insertItem( tr ( "Pitcairn Islands" ) ); |
423 | cmbCountry->insertItem( tr ( "Poland" ) ); | 436 | cmbCountry->insertItem( tr ( "Poland" ) ); |
424 | cmbCountry->insertItem( tr ( "Portugal" ) ); | 437 | cmbCountry->insertItem( tr ( "Portugal" ) ); |
425 | cmbCountry->insertItem( tr ( "Puerto Rico" ) ); | 438 | cmbCountry->insertItem( tr ( "Puerto Rico" ) ); |
426 | cmbCountry->insertItem( tr ( "Qatar" ) ); | 439 | cmbCountry->insertItem( tr ( "Qatar" ) ); |
427 | cmbCountry->insertItem( tr ( "Reunion" ) ); | 440 | cmbCountry->insertItem( tr ( "Reunion" ) ); |
428 | cmbCountry->insertItem( tr ( "Romania" ) ); | 441 | cmbCountry->insertItem( tr ( "Romania" ) ); |
429 | cmbCountry->insertItem( tr ( "Russia" ) ); | 442 | cmbCountry->insertItem( tr ( "Russia" ) ); |
430 | cmbCountry->insertItem( tr ( "Rwanda" ) ); | 443 | cmbCountry->insertItem( tr ( "Rwanda" ) ); |
431 | cmbCountry->insertItem( tr ( "Saint Lucia" ) ); | 444 | cmbCountry->insertItem( tr ( "Saint Lucia" ) ); |
432 | cmbCountry->insertItem( tr ( "Samoa" ) ); | 445 | cmbCountry->insertItem( tr ( "Samoa" ) ); |
433 | cmbCountry->insertItem( tr ( "San Marino" ) ); | 446 | cmbCountry->insertItem( tr ( "San Marino" ) ); |
434 | cmbCountry->insertItem( tr ( "Saudi Arabia" ) ); | 447 | cmbCountry->insertItem( tr ( "Saudi Arabia" ) ); |
435 | cmbCountry->insertItem( tr ( "Senegal" ) ); | 448 | cmbCountry->insertItem( tr ( "Senegal" ) ); |
436 | cmbCountry->insertItem( tr ( "Seychelles" ) ); | 449 | cmbCountry->insertItem( tr ( "Seychelles" ) ); |
437 | cmbCountry->insertItem( tr ( "Sierra Leone" ) ); | 450 | cmbCountry->insertItem( tr ( "Sierra Leone" ) ); |
438 | cmbCountry->insertItem( tr ( "Singapore" ) ); | 451 | cmbCountry->insertItem( tr ( "Singapore" ) ); |
439 | cmbCountry->insertItem( tr ( "Slovakia" ) ); | 452 | cmbCountry->insertItem( tr ( "Slovakia" ) ); |
440 | cmbCountry->insertItem( tr ( "Slovenia" ) ); | 453 | cmbCountry->insertItem( tr ( "Slovenia" ) ); |
441 | cmbCountry->insertItem( tr ( "Solomon Islands" ) ); | 454 | cmbCountry->insertItem( tr ( "Solomon Islands" ) ); |
442 | cmbCountry->insertItem( tr ( "Somalia" ) ); | 455 | cmbCountry->insertItem( tr ( "Somalia" ) ); |
443 | cmbCountry->insertItem( tr ( "South Africa" ) ); | 456 | cmbCountry->insertItem( tr ( "South Africa" ) ); |
444 | cmbCountry->insertItem( tr ( "Spain" ) ); | 457 | cmbCountry->insertItem( tr ( "Spain" ) ); |
445 | cmbCountry->insertItem( tr ( "Sri Lanka" ) ); | 458 | cmbCountry->insertItem( tr ( "Sri Lanka" ) ); |
446 | cmbCountry->insertItem( tr ( "St. Helena" ) ); | 459 | cmbCountry->insertItem( tr ( "St. Helena" ) ); |
447 | cmbCountry->insertItem( tr ( "Sudan" ) ); | 460 | cmbCountry->insertItem( tr ( "Sudan" ) ); |
448 | cmbCountry->insertItem( tr ( "Suriname" ) ); | 461 | cmbCountry->insertItem( tr ( "Suriname" ) ); |
449 | cmbCountry->insertItem( tr ( "Swaziland" ) ); | 462 | cmbCountry->insertItem( tr ( "Swaziland" ) ); |
450 | cmbCountry->insertItem( tr ( "Sweden" ) ); | 463 | cmbCountry->insertItem( tr ( "Sweden" ) ); |
451 | cmbCountry->insertItem( tr ( "Switzerland" ) ); | 464 | cmbCountry->insertItem( tr ( "Switzerland" ) ); |
452 | cmbCountry->insertItem( tr ( "Taiwan" ) ); | 465 | cmbCountry->insertItem( tr ( "Taiwan" ) ); |
453 | cmbCountry->insertItem( tr ( "Tajikistan" ) ); | 466 | cmbCountry->insertItem( tr ( "Tajikistan" ) ); |
454 | cmbCountry->insertItem( tr ( "Tanzania" ) ); | 467 | cmbCountry->insertItem( tr ( "Tanzania" ) ); |
455 | cmbCountry->insertItem( tr ( "Thailand" ) ); | 468 | cmbCountry->insertItem( tr ( "Thailand" ) ); |
456 | cmbCountry->insertItem( tr ( "Togo" ) ); | 469 | cmbCountry->insertItem( tr ( "Togo" ) ); |
457 | cmbCountry->insertItem( tr ( "Tokelau" ) ); | 470 | cmbCountry->insertItem( tr ( "Tokelau" ) ); |
458 | cmbCountry->insertItem( tr ( "Tonga" ) ); | 471 | cmbCountry->insertItem( tr ( "Tonga" ) ); |
459 | cmbCountry->insertItem( tr ( "Tunisia" ) ); | 472 | cmbCountry->insertItem( tr ( "Tunisia" ) ); |
460 | cmbCountry->insertItem( tr ( "Turkey" ) ); | 473 | cmbCountry->insertItem( tr ( "Turkey" ) ); |
461 | cmbCountry->insertItem( tr ( "Turkmenistan" ) ); | 474 | cmbCountry->insertItem( tr ( "Turkmenistan" ) ); |
462 | cmbCountry->insertItem( tr ( "Tuvalu" ) ); | 475 | cmbCountry->insertItem( tr ( "Tuvalu" ) ); |
463 | cmbCountry->insertItem( tr ( "Uganda" ) ); | 476 | cmbCountry->insertItem( tr ( "Uganda" ) ); |
464 | cmbCountry->insertItem( tr ( "Ukraine" ) ); | 477 | cmbCountry->insertItem( tr ( "Ukraine" ) ); |
465 | cmbCountry->insertItem( tr ( "Uruguay" ) ); | 478 | cmbCountry->insertItem( tr ( "Uruguay" ) ); |
466 | cmbCountry->insertItem( tr ( "Uzbekistan" ) ); | 479 | cmbCountry->insertItem( tr ( "Uzbekistan" ) ); |
467 | cmbCountry->insertItem( tr ( "Vanuatu" ) ); | 480 | cmbCountry->insertItem( tr ( "Vanuatu" ) ); |
468 | cmbCountry->insertItem( tr ( "Venezuela" ) ); | 481 | cmbCountry->insertItem( tr ( "Venezuela" ) ); |
469 | cmbCountry->insertItem( tr ( "Vietnam" ) ); | 482 | cmbCountry->insertItem( tr ( "Vietnam" ) ); |
470 | cmbCountry->insertItem( tr ( "Virgin Islands" ) ); | 483 | cmbCountry->insertItem( tr ( "Virgin Islands" ) ); |
471 | cmbCountry->insertItem( tr ( "Western Sahara" ) ); | 484 | cmbCountry->insertItem( tr ( "Western Sahara" ) ); |
472 | cmbCountry->insertItem( tr ( "Yemen" ) ); | 485 | cmbCountry->insertItem( tr ( "Yemen" ) ); |
473 | cmbCountry->insertItem( tr ( "Yugoslavia" ) ); | 486 | cmbCountry->insertItem( tr ( "Yugoslavia" ) ); |
474 | cmbCountry->insertItem( tr ( "Zambia" ) ); | 487 | cmbCountry->insertItem( tr ( "Zambia" ) ); |
475 | cmbCountry->insertItem( tr ( "Zimbabwe" ) ); | 488 | cmbCountry->insertItem( tr ( "Zimbabwe" ) ); |
476 | if (cmbCountry->listBox()!=0) | 489 | if (cmbCountry->listBox()!=0) |
477 | cmbCountry->listBox()->sort(); | 490 | cmbCountry->listBox()->sort(); |
478 | 491 | ||
479 | cmbCountry->setMaximumWidth( 135 ); | 492 | cmbCountry->setMaximumWidth( 135 ); |
480 | 493 | ||
481 | gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); | 494 | gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); |
482 | 495 | ||
483 | // Chooser 4 | 496 | // Chooser 4 |
484 | cmbChooserField4 = new QComboBox( FALSE, container ); | 497 | cmbChooserField4 = new QComboBox( FALSE, container ); |
485 | cmbChooserField4->setMaximumWidth( 90 ); | 498 | cmbChooserField4->setMaximumWidth( 90 ); |
486 | gl->addWidget( cmbChooserField4, 6, 0 ); | 499 | gl->addWidget( cmbChooserField4, 6, 0 ); |
487 | // Textfield for chooser 2 | 500 | // Textfield for chooser 2 |
488 | // Now use WidgetStack to contain the textfield and the default-email combo! | 501 | // Now use WidgetStack to contain the textfield and the default-email combo! |
489 | m_widgetStack4 = new QWidgetStack( container ); | 502 | m_widgetStack4 = new QWidgetStack( container ); |
490 | txtChooserField4 = new QLineEdit( m_widgetStack4 ); | 503 | txtChooserField4 = new QLineEdit( m_widgetStack4 ); |
491 | m_widgetStack4 -> addWidget( txtChooserField4, TextField ); | 504 | m_widgetStack4 -> addWidget( txtChooserField4, TextField ); |
492 | gl->addMultiCellWidget( m_widgetStack4, 6, 6, 1, 2 ); | 505 | gl->addMultiCellWidget( m_widgetStack4, 6, 6, 1, 2 ); |
493 | m_widgetStack4 -> raiseWidget( TextField ); | 506 | m_widgetStack4 -> raiseWidget( TextField ); |
494 | 507 | ||
495 | QSpacerItem *space = new QSpacerItem(1,1, | 508 | QSpacerItem *space = new QSpacerItem(1,1, |
496 | QSizePolicy::Maximum, | 509 | QSizePolicy::Maximum, |
497 | QSizePolicy::MinimumExpanding ); | 510 | QSizePolicy::MinimumExpanding ); |
498 | gl->addItem( space, 7, 0 ); | 511 | gl->addItem( space, 7, 0 ); |
499 | 512 | ||
500 | tabMain->insertTab( tabViewport, tr( "Address" ) ); | 513 | tabMain->insertTab( tabViewport, tr( "Address" ) ); |
501 | 514 | ||
502 | tabViewport = new QWidget ( tabMain ); | 515 | tabViewport = new QWidget ( tabMain ); |
503 | 516 | ||
504 | vb = new QVBoxLayout( tabViewport ); | 517 | vb = new QVBoxLayout( tabViewport ); |
505 | 518 | ||
506 | svDetails = new QScrollView( tabViewport ); | 519 | svDetails = new QScrollView( tabViewport ); |
507 | vb->addWidget( svDetails, 0, 0 ); | 520 | vb->addWidget( svDetails, 0, 0 ); |
508 | svDetails->setResizePolicy( QScrollView::AutoOneFit ); | 521 | svDetails->setResizePolicy( QScrollView::AutoOneFit ); |
509 | svDetails->setFrameStyle( QFrame::NoFrame ); | 522 | svDetails->setFrameStyle( QFrame::NoFrame ); |
510 | 523 | ||
511 | container = new QWidget( svDetails->viewport() ); | 524 | container = new QWidget( svDetails->viewport() ); |
512 | svDetails->addChild( container ); | 525 | svDetails->addChild( container ); |
513 | 526 | ||
514 | gl = new QGridLayout( container, 1, 2, 2, 4 ); | 527 | gl = new QGridLayout( container, 1, 2, 2, 4 ); |
515 | 528 | ||
516 | int counter = 0; | 529 | int counter = 0; |
517 | 530 | ||
518 | // Birthday | 531 | // Birthday |
519 | QHBox* hBox = new QHBox( container ); | 532 | QHBox* hBox = new QHBox( container ); |
520 | l = new QLabel( tr("Birthday"), container ); | 533 | l = new QLabel( tr("Birthday"), container ); |
521 | gl->addWidget( l, counter, 0 ); | 534 | gl->addWidget( l, counter, 0 ); |
522 | 535 | ||
523 | QPopupMenu* m1 = new QPopupMenu( container ); | 536 | QPopupMenu* m1 = new QPopupMenu( container ); |
524 | birthdayPicker = new DateBookMonth( m1, 0, TRUE ); | 537 | birthdayPicker = new DateBookMonth( m1, 0, TRUE ); |
525 | m1->insertItem( birthdayPicker ); | 538 | m1->insertItem( birthdayPicker ); |
526 | 539 | ||
527 | birthdayButton= new QToolButton( hBox, "buttonStart" ); | 540 | birthdayButton= new QToolButton( hBox, "buttonStart" ); |
528 | birthdayButton->setPopup( m1 ); | 541 | birthdayButton->setPopup( m1 ); |
529 | birthdayButton->setPopupDelay(0); | 542 | birthdayButton->setPopupDelay(0); |
530 | 543 | ||
531 | QPushButton* deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), | 544 | QPushButton* deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), |
532 | tr( "Delete" ), | 545 | tr( "Delete" ), |
533 | hBox, 0 ); | 546 | hBox, 0 ); |
534 | 547 | ||
535 | gl->addWidget( hBox, counter , 1 ); | 548 | gl->addWidget( hBox, counter , 1 ); |
536 | 549 | ||
537 | connect( birthdayPicker, SIGNAL( dateClicked( int, int, int ) ), | 550 | connect( birthdayPicker, SIGNAL( dateClicked( int, int, int ) ), |
538 | this, SLOT( slotBirthdayDateChanged( int, int, int ) ) ); | 551 | this, SLOT( slotBirthdayDateChanged( int, int, int ) ) ); |
539 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveBirthday() ) ); | 552 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveBirthday() ) ); |
540 | 553 | ||
541 | ++counter; | 554 | ++counter; |
542 | 555 | ||
543 | // Anniversary | 556 | // Anniversary |
544 | hBox = new QHBox( container ); | 557 | hBox = new QHBox( container ); |
545 | l = new QLabel( tr("Anniversary"), container ); | 558 | l = new QLabel( tr("Anniversary"), container ); |
546 | gl->addWidget( l, counter, 0 ); | 559 | gl->addWidget( l, counter, 0 ); |
547 | 560 | ||
548 | m1 = new QPopupMenu( container ); | 561 | m1 = new QPopupMenu( container ); |
549 | anniversaryPicker = new DateBookMonth( m1, 0, TRUE ); | 562 | anniversaryPicker = new DateBookMonth( m1, 0, TRUE ); |
550 | m1->insertItem( anniversaryPicker ); | 563 | m1->insertItem( anniversaryPicker ); |
551 | 564 | ||
552 | anniversaryButton= new QToolButton( hBox, "buttonStart" ); | 565 | anniversaryButton= new QToolButton( hBox, "buttonStart" ); |
553 | anniversaryButton->setPopup( m1 ); | 566 | anniversaryButton->setPopup( m1 ); |
554 | anniversaryButton->setPopupDelay(0); | 567 | anniversaryButton->setPopupDelay(0); |
555 | 568 | ||
556 | deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), | 569 | deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), |
557 | tr( "Delete" ), | 570 | tr( "Delete" ), |
558 | hBox, 0 ); | 571 | hBox, 0 ); |
559 | gl->addWidget( hBox, counter , 1 ); | 572 | gl->addWidget( hBox, counter , 1 ); |
560 | 573 | ||
561 | connect( anniversaryPicker, SIGNAL( dateClicked( int, int, int ) ), | 574 | connect( anniversaryPicker, SIGNAL( dateClicked( int, int, int ) ), |
562 | this, SLOT( slotAnniversaryDateChanged( int, int, int ) ) ); | 575 | this, SLOT( slotAnniversaryDateChanged( int, int, int ) ) ); |
563 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveAnniversary() ) ); | 576 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveAnniversary() ) ); |
564 | 577 | ||
565 | ++counter; | 578 | ++counter; |
566 | 579 | ||
567 | // Gender | 580 | // Gender |
568 | l = new QLabel( tr("Gender"), container ); | 581 | l = new QLabel( tr("Gender"), container ); |
569 | gl->addWidget( l, counter, 0 ); | 582 | gl->addWidget( l, counter, 0 ); |
570 | cmbGender = new QComboBox( container ); | 583 | cmbGender = new QComboBox( container ); |
571 | cmbGender->insertItem( "", 0 ); | 584 | cmbGender->insertItem( "", 0 ); |
572 | cmbGender->insertItem( tr("Male"), 1); | 585 | cmbGender->insertItem( tr("Male"), 1); |
573 | cmbGender->insertItem( tr("Female"), 2); | 586 | cmbGender->insertItem( tr("Female"), 2); |
574 | gl->addWidget( cmbGender, counter, 1 ); | 587 | gl->addWidget( cmbGender, counter, 1 ); |
575 | 588 | ||
576 | ++counter; | 589 | ++counter; |
577 | 590 | ||
578 | // Create Labels and lineedit fields for every dynamic entry | 591 | // Create Labels and lineedit fields for every dynamic entry |
579 | QStringList::ConstIterator it = slDynamicEntries.begin(); | 592 | QStringList::ConstIterator it = slDynamicEntries.begin(); |
580 | QMap<QString, int> mapStrToID = OContactFields::untrFieldsToId(); | 593 | QMap<QString, int> mapStrToID = OContactFields::untrFieldsToId(); |
581 | QMap<int, QString> mapIdToStr = OContactFields::idToTrFields(); | 594 | QMap<int, QString> mapIdToStr = OContactFields::idToTrFields(); |
582 | for (i = counter; it != slDynamicEntries.end(); i++, ++it ) { | 595 | for (i = counter; it != slDynamicEntries.end(); i++, ++it ) { |
583 | 596 | ||
584 | if (((*it) == "Anniversary") || | 597 | if (((*it) == "Anniversary") || |
585 | ((*it) == "Birthday")|| ((*it) == "Gender")) continue; | 598 | ((*it) == "Birthday")|| ((*it) == "Gender")) continue; |
586 | 599 | ||
587 | l = new QLabel( mapIdToStr[mapStrToID[*it]].utf8() , container ); | 600 | l = new QLabel( mapIdToStr[mapStrToID[*it]].utf8() , container ); |
588 | listName.append( l ); | 601 | listName.append( l ); |
589 | gl->addWidget( l, i, 0 ); | 602 | gl->addWidget( l, i, 0 ); |
590 | QLineEdit *e = new QLineEdit( container ); | 603 | QLineEdit *e = new QLineEdit( container ); |
591 | listValue.append( e ); | 604 | listValue.append( e ); |
592 | gl->addWidget( e, i, 1); | 605 | gl->addWidget( e, i, 1); |
593 | } | 606 | } |
594 | // Fill labels with names.. | 607 | // Fill labels with names.. |
595 | //loadFields(); | 608 | //loadFields(); |
596 | 609 | ||
597 | 610 | ||
598 | tabMain->insertTab( tabViewport, tr( "Details" ) ); | 611 | tabMain->insertTab( tabViewport, tr( "Details" ) ); |
599 | 612 | ||
600 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); | 613 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); |
601 | dlgNote->setCaption( tr("Enter Note") ); | 614 | dlgNote->setCaption( tr("Enter Note") ); |
602 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); | 615 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); |
603 | txtNote = new QMultiLineEdit( dlgNote ); | 616 | txtNote = new QMultiLineEdit( dlgNote ); |
604 | vbNote->addWidget( txtNote ); | 617 | vbNote->addWidget( txtNote ); |
605 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); | 618 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); |
606 | 619 | ||
607 | dlgName = new QDialog( this, "Name Dialog", TRUE ); | 620 | dlgName = new QDialog( this, "Name Dialog", TRUE ); |
608 | dlgName->setCaption( tr("Edit Name") ); | 621 | dlgName->setCaption( tr("Edit Name") ); |
609 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); | 622 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); |
610 | 623 | ||
611 | l = new QLabel( tr("First Name"), dlgName ); | 624 | l = new QLabel( tr("First Name"), dlgName ); |
612 | gl->addWidget( l, 0, 0 ); | 625 | gl->addWidget( l, 0, 0 ); |
613 | txtFirstName = new QLineEdit( dlgName ); | 626 | txtFirstName = new QLineEdit( dlgName ); |
614 | gl->addWidget( txtFirstName, 0, 1 ); | 627 | gl->addWidget( txtFirstName, 0, 1 ); |
615 | 628 | ||
616 | l = new QLabel( tr("Middle Name"), dlgName ); | 629 | l = new QLabel( tr("Middle Name"), dlgName ); |
617 | gl->addWidget( l, 1, 0 ); | 630 | gl->addWidget( l, 1, 0 ); |
618 | txtMiddleName = new QLineEdit( dlgName ); | 631 | txtMiddleName = new QLineEdit( dlgName ); |
619 | gl->addWidget( txtMiddleName, 1, 1 ); | 632 | gl->addWidget( txtMiddleName, 1, 1 ); |
620 | 633 | ||
621 | l = new QLabel( tr("Last Name"), dlgName ); | 634 | l = new QLabel( tr("Last Name"), dlgName ); |
622 | gl->addWidget( l, 2, 0 ); | 635 | gl->addWidget( l, 2, 0 ); |
623 | txtLastName = new QLineEdit( dlgName ); | 636 | txtLastName = new QLineEdit( dlgName ); |
624 | gl->addWidget( txtLastName, 2, 1 ); | 637 | gl->addWidget( txtLastName, 2, 1 ); |
625 | 638 | ||
626 | // l = new QLabel( tr("Suffix"), dlgName ); | 639 | // l = new QLabel( tr("Suffix"), dlgName ); |
627 | // gl->addWidget( l, 3, 0 ); | 640 | // gl->addWidget( l, 3, 0 ); |
628 | // txtSuffix = new QLineEdit( dlgName ); | 641 | // txtSuffix = new QLineEdit( dlgName ); |
629 | // gl->addWidget( txtSuffix, 3, 1 ); | 642 | // gl->addWidget( txtSuffix, 3, 1 ); |
630 | space = new QSpacerItem(1,1, | 643 | space = new QSpacerItem(1,1, |
631 | QSizePolicy::Maximum, | 644 | QSizePolicy::Maximum, |
632 | QSizePolicy::MinimumExpanding ); | 645 | QSizePolicy::MinimumExpanding ); |
633 | gl->addItem( space, 4, 0 ); | 646 | gl->addItem( space, 4, 0 ); |
634 | 647 | ||
635 | cmbChooserField1->insertStringList( trlChooserNames ); | 648 | cmbChooserField1->insertStringList( trlChooserNames ); |
636 | cmbChooserField2->insertStringList( trlChooserNames ); | 649 | cmbChooserField2->insertStringList( trlChooserNames ); |
637 | cmbChooserField3->insertStringList( trlChooserNames ); | 650 | cmbChooserField3->insertStringList( trlChooserNames ); |
638 | cmbChooserField4->insertStringList( trlChooserNames ); | 651 | cmbChooserField4->insertStringList( trlChooserNames ); |
639 | 652 | ||
640 | cmbChooserField1->setCurrentItem( 0 ); | 653 | cmbChooserField1->setCurrentItem( 0 ); |
641 | cmbChooserField2->setCurrentItem( 1 ); | 654 | cmbChooserField2->setCurrentItem( 1 ); |
642 | cmbChooserField3->setCurrentItem( 2 ); | 655 | cmbChooserField3->setCurrentItem( 2 ); |
643 | 656 | ||
644 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); | 657 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); |
645 | 658 | ||
646 | connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); | 659 | connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); |
647 | 660 | ||
648 | connect( txtSuffix, SIGNAL(textChanged(const QString &)), this, SLOT(slotSuffixChange(const QString &)) ); | 661 | connect( txtSuffix, SIGNAL(textChanged(const QString &)), this, SLOT(slotSuffixChange(const QString &)) ); |
649 | 662 | ||
650 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), | 663 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), |
651 | this, SLOT(slotChooser1Change(const QString &)) ); | 664 | this, SLOT(slotChooser1Change(const QString &)) ); |
652 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), | 665 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), |
653 | this, SLOT(slotChooser2Change(const QString &)) ); | 666 | this, SLOT(slotChooser2Change(const QString &)) ); |
654 | connect( txtChooserField3, SIGNAL(textChanged(const QString &)), | 667 | connect( txtChooserField3, SIGNAL(textChanged(const QString &)), |
655 | this, SLOT(slotChooser3Change(const QString &)) ); | 668 | this, SLOT(slotChooser3Change(const QString &)) ); |
656 | connect( txtChooserField4, SIGNAL(textChanged(const QString &)), | 669 | connect( txtChooserField4, SIGNAL(textChanged(const QString &)), |
657 | this, SLOT(slotChooser4Change(const QString &)) ); | 670 | this, SLOT(slotChooser4Change(const QString &)) ); |
658 | connect( txtAddress, SIGNAL(textChanged(const QString &)), | 671 | connect( txtAddress, SIGNAL(textChanged(const QString &)), |
659 | this, SLOT(slotAddressChange(const QString &)) ); | 672 | this, SLOT(slotAddressChange(const QString &)) ); |
660 | connect( txtCity, SIGNAL(textChanged(const QString &)), | 673 | connect( txtCity, SIGNAL(textChanged(const QString &)), |
661 | this, SLOT(slotCityChange(const QString &)) ); | 674 | this, SLOT(slotCityChange(const QString &)) ); |
662 | connect( txtState, SIGNAL(textChanged(const QString &)), | 675 | connect( txtState, SIGNAL(textChanged(const QString &)), |
663 | this, SLOT(slotStateChange(const QString &)) ); | 676 | this, SLOT(slotStateChange(const QString &)) ); |
664 | connect( txtZip, SIGNAL(textChanged(const QString &)), | 677 | connect( txtZip, SIGNAL(textChanged(const QString &)), |
665 | this, SLOT(slotZipChange(const QString &)) ); | 678 | this, SLOT(slotZipChange(const QString &)) ); |
666 | connect( cmbCountry, SIGNAL(textChanged(const QString &)), | 679 | connect( cmbCountry, SIGNAL(textChanged(const QString &)), |
667 | this, SLOT(slotCountryChange(const QString &)) ); | 680 | this, SLOT(slotCountryChange(const QString &)) ); |
668 | connect( cmbCountry, SIGNAL(activated(const QString &)), | 681 | connect( cmbCountry, SIGNAL(activated(const QString &)), |
669 | this, SLOT(slotCountryChange(const QString &)) ); | 682 | this, SLOT(slotCountryChange(const QString &)) ); |
670 | connect( cmbChooserField1, SIGNAL(activated(int)), | 683 | connect( cmbChooserField1, SIGNAL(activated(int)), |
671 | this, SLOT(slotCmbChooser1Change(int)) ); | 684 | this, SLOT(slotCmbChooser1Change(int)) ); |
672 | connect( cmbChooserField2, SIGNAL(activated(int)), | 685 | connect( cmbChooserField2, SIGNAL(activated(int)), |
673 | this, SLOT(slotCmbChooser2Change(int)) ); | 686 | this, SLOT(slotCmbChooser2Change(int)) ); |
674 | connect( cmbChooserField3, SIGNAL(activated(int)), | 687 | connect( cmbChooserField3, SIGNAL(activated(int)), |
675 | this, SLOT(slotCmbChooser3Change(int)) ); | 688 | this, SLOT(slotCmbChooser3Change(int)) ); |
676 | connect( cmbChooserField4, SIGNAL(activated(int)), | 689 | connect( cmbChooserField4, SIGNAL(activated(int)), |
677 | this, SLOT(slotCmbChooser4Change(int)) ); | 690 | this, SLOT(slotCmbChooser4Change(int)) ); |
678 | connect( cmbAddress, SIGNAL(activated(int)), | 691 | connect( cmbAddress, SIGNAL(activated(int)), |
679 | this, SLOT(slotAddressTypeChange(int)) ); | 692 | this, SLOT(slotAddressTypeChange(int)) ); |
680 | 693 | ||
681 | new QPEDialogListener(this); | 694 | new QPEDialogListener(this); |
682 | 695 | ||
683 | setPersonalView ( m_personalView ); | 696 | setPersonalView ( m_personalView ); |
684 | 697 | ||
685 | qWarning("init() END"); | 698 | qWarning("init() END"); |
686 | } | 699 | } |
687 | 700 | ||
688 | void ContactEditor::defaultEmailChanged(int i){ | 701 | void ContactEditor::defaultEmailChanged(int i){ |
689 | qDebug("defaultEmailChanged"); | 702 | qDebug("defaultEmailChanged"); |
690 | 703 | ||
691 | // was sollte das ? (se) | 704 | // was sollte das ? (se) |
692 | // int index = cmbChooserField1->currentItem(); | 705 | // int index = cmbChooserField1->currentItem(); |
693 | // slChooserValues[index] = cmbDefaultEmail->text(i); | 706 | // slChooserValues[index] = cmbDefaultEmail->text(i); |
694 | 707 | ||
695 | defaultEmail = cmbDefaultEmail->text(i); | 708 | defaultEmail = cmbDefaultEmail->text(i); |
696 | qDebug ("Changed to: %s", defaultEmail.latin1()); | 709 | qDebug ("Changed to: %s", defaultEmail.latin1()); |
697 | 710 | ||
698 | } | 711 | } |
699 | 712 | ||
700 | void ContactEditor::populateDefaultEmailCmb(){ | 713 | void ContactEditor::populateDefaultEmailCmb(){ |
701 | 714 | ||
702 | // if the default-email combo was not selected and therfore not created | 715 | // if the default-email combo was not selected and therfore not created |
703 | // we get a lot of trouble.. Therfore create an invisible one.. | 716 | // we get a lot of trouble.. Therfore create an invisible one.. |
704 | if ( !cmbDefaultEmail ){ | 717 | if ( !cmbDefaultEmail ){ |
705 | cmbDefaultEmail = new QComboBox(this); | 718 | cmbDefaultEmail = new QComboBox(this); |
706 | cmbDefaultEmail -> hide(); | 719 | cmbDefaultEmail -> hide(); |
707 | } | 720 | } |
708 | cmbDefaultEmail->clear(); | 721 | cmbDefaultEmail->clear(); |
709 | cmbDefaultEmail->insertStringList( emails ); | 722 | cmbDefaultEmail->insertStringList( emails ); |
710 | // cmbDefaultEmail->show(); | 723 | // cmbDefaultEmail->show(); |
711 | 724 | ||
712 | // Select default email in combo.. | 725 | // Select default email in combo.. |
713 | bool found = false; | 726 | bool found = false; |
714 | for ( int i = 0; i < cmbDefaultEmail->count(); i++){ | 727 | for ( int i = 0; i < cmbDefaultEmail->count(); i++){ |
715 | qDebug(" populateDefaultEmailCmb text >%s< defaultEmail >%s<", | 728 | qDebug(" populateDefaultEmailCmb text >%s< defaultEmail >%s<", |
716 | cmbDefaultEmail->text( i ).latin1(), defaultEmail.latin1()); | 729 | cmbDefaultEmail->text( i ).latin1(), defaultEmail.latin1()); |
717 | 730 | ||
718 | if ( cmbDefaultEmail->text( i ).stripWhiteSpace() == defaultEmail.stripWhiteSpace() ){ | 731 | if ( cmbDefaultEmail->text( i ).stripWhiteSpace() == defaultEmail.stripWhiteSpace() ){ |
719 | cmbDefaultEmail->setCurrentItem( i ); | 732 | cmbDefaultEmail->setCurrentItem( i ); |
720 | qDebug("set"); | 733 | qDebug("set"); |
721 | found = true; | 734 | found = true; |
722 | } | 735 | } |
723 | } | 736 | } |
724 | 737 | ||
725 | // If the current default email is not found in the list, we choose the | 738 | // If the current default email is not found in the list, we choose the |
726 | // first one.. | 739 | // first one.. |
727 | if ( !found ) | 740 | if ( !found ) |
728 | defaultEmail = cmbDefaultEmail->text(0); | 741 | defaultEmail = cmbDefaultEmail->text(0); |
729 | } | 742 | } |
730 | 743 | ||
731 | // Called when any combobox was changed. | 744 | // Called when any combobox was changed. |
732 | // "true" returned if the change was chandled by this function, else it should | 745 | // "true" returned if the change was chandled by this function, else it should |
733 | // be handled by something else.. | 746 | // be handled by something else.. |
734 | bool ContactEditor::cmbChooserChange( int index, QWidgetStack* inputStack, int widgetPos ) { | 747 | bool ContactEditor::cmbChooserChange( int index, QWidgetStack* inputStack, int widgetPos ) { |
735 | QString type = slChooserNames[index]; | 748 | QString type = slChooserNames[index]; |
736 | qWarning("ContactEditor::cmbChooserChange -> Type: %s, WidgetPos: %d", type.latin1(), widgetPos ); | 749 | qWarning("ContactEditor::cmbChooserChange -> Type: %s, WidgetPos: %d", type.latin1(), widgetPos ); |
737 | 750 | ||
738 | if ( !initializing ) | 751 | if ( !initializing ) |
739 | contactfields.setFieldOrder( widgetPos-1, index ); | 752 | contactfields.setFieldOrder( widgetPos-1, index ); |
740 | 753 | ||
741 | // Create and connect combobox for selecting the default email | 754 | // Create and connect combobox for selecting the default email |
742 | if ( type == "Default Email"){ | 755 | if ( type == "Default Email"){ |
743 | qWarning("Choosing default-email (defaultEmailChooserPosition= %d) ", defaultEmailChooserPosition); | 756 | qWarning("Choosing default-email (defaultEmailChooserPosition= %d) ", defaultEmailChooserPosition); |
744 | 757 | ||
745 | // More than one default-email chooser is not allowed ! | 758 | // More than one default-email chooser is not allowed ! |
746 | if ( ( defaultEmailChooserPosition != -1 ) && | 759 | if ( ( defaultEmailChooserPosition != -1 ) && |
747 | defaultEmailChooserPosition != widgetPos && !initializing){ | 760 | defaultEmailChooserPosition != widgetPos && !initializing){ |
748 | chooserError( widgetPos ); | 761 | chooserError( widgetPos ); |
749 | return true; | 762 | return true; |
750 | } | 763 | } |
751 | 764 | ||
752 | QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo ); | 765 | QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo ); |
753 | if ( cmbo ){ | 766 | if ( cmbo ){ |
754 | inputStack->raiseWidget( TextField ); | 767 | inputStack->raiseWidget( TextField ); |
755 | inputStack -> removeWidget( cmbo ); | 768 | inputStack -> removeWidget( cmbo ); |
756 | delete cmbo; | 769 | delete cmbo; |
757 | } | 770 | } |
758 | cmbo = new QComboBox( inputStack ); | 771 | cmbo = new QComboBox( inputStack ); |
759 | cmbo -> insertStringList( emails ); | 772 | cmbo -> insertStringList( emails ); |
760 | 773 | ||
761 | inputStack -> addWidget( cmbo, Combo ); | 774 | inputStack -> addWidget( cmbo, Combo ); |
762 | inputStack -> raiseWidget( Combo ); | 775 | inputStack -> raiseWidget( Combo ); |
763 | 776 | ||
764 | defaultEmailChooserPosition = widgetPos; | 777 | defaultEmailChooserPosition = widgetPos; |
765 | cmbDefaultEmail = cmbo; | 778 | cmbDefaultEmail = cmbo; |
766 | 779 | ||
767 | connect( cmbo,SIGNAL( activated(int) ), | 780 | connect( cmbo,SIGNAL( activated(int) ), |
768 | SLOT( defaultEmailChanged(int) ) ); | 781 | SLOT( defaultEmailChanged(int) ) ); |
769 | 782 | ||
770 | // Set current default email | 783 | // Set current default email |
771 | populateDefaultEmailCmb(); | 784 | populateDefaultEmailCmb(); |
772 | 785 | ||
773 | 786 | ||
774 | } else { | 787 | } else { |
775 | // Something else was selected: Hide combo.. | 788 | // Something else was selected: Hide combo.. |
776 | qWarning(" Hiding default-email combo" ); | 789 | qWarning(" Hiding default-email combo" ); |
777 | if ( defaultEmailChooserPosition == widgetPos ){ | 790 | if ( defaultEmailChooserPosition == widgetPos ){ |
778 | defaultEmailChooserPosition = -1; | 791 | defaultEmailChooserPosition = -1; |
779 | } | 792 | } |
780 | QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo ); | 793 | QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo ); |
781 | if ( cmbo ){ | 794 | if ( cmbo ){ |
782 | inputStack->raiseWidget( TextField ); | 795 | inputStack->raiseWidget( TextField ); |
783 | inputStack -> removeWidget( cmbo ); | 796 | inputStack -> removeWidget( cmbo ); |
784 | cmbDefaultEmail = 0l; | 797 | cmbDefaultEmail = 0l; |
785 | delete cmbo; | 798 | delete cmbo; |
786 | } | 799 | } |
787 | 800 | ||
788 | // Caller should initialize the responsible textfield, therefore | 801 | // Caller should initialize the responsible textfield, therefore |
789 | // "false" is returned | 802 | // "false" is returned |
790 | return false; | 803 | return false; |
791 | } | 804 | } |
792 | 805 | ||
793 | // Everything is worked off .. | 806 | // Everything is worked off .. |
794 | return true; | 807 | return true; |
795 | 808 | ||
796 | } | 809 | } |
797 | 810 | ||
798 | // Currently accessed when we select default-email more than once ! | 811 | // Currently accessed when we select default-email more than once ! |
799 | void ContactEditor::chooserError( int index ) | 812 | void ContactEditor::chooserError( int index ) |
800 | { | 813 | { |
801 | qWarning("ContactEditor::chooserError( %d )", index); | 814 | qWarning("ContactEditor::chooserError( %d )", index); |
802 | QMessageBox::warning( this, "Chooser Error", | 815 | QMessageBox::warning( this, "Chooser Error", |
803 | "Multiple selection of this\n" | 816 | "Multiple selection of this\n" |
804 | "Item is not allowed !\n\n" | 817 | "Item is not allowed !\n\n" |
805 | "First deselect the previous one !", | 818 | "First deselect the previous one !", |
806 | "&OK", 0, 0, | 819 | "&OK", 0, 0, |
807 | 0, 0 ); | 820 | 0, 0 ); |
808 | 821 | ||
809 | // Reset the selected Chooser. Unfortunately the chooser | 822 | // Reset the selected Chooser. Unfortunately the chooser |
810 | // generates no signal, therfore we have to | 823 | // generates no signal, therfore we have to |
811 | // call the cmbChooserChange function manually.. | 824 | // call the cmbChooserChange function manually.. |
812 | switch( index ){ | 825 | switch( index ){ |
813 | case 1: | 826 | case 1: |
814 | cmbChooserField1 -> setCurrentItem( 0 ); | 827 | cmbChooserField1 -> setCurrentItem( 0 ); |
815 | slotCmbChooser1Change( 0 ); | 828 | slotCmbChooser1Change( 0 ); |
816 | break; | 829 | break; |
817 | case 2: | 830 | case 2: |
818 | cmbChooserField2 -> setCurrentItem( 0 ); | 831 | cmbChooserField2 -> setCurrentItem( 0 ); |
819 | slotCmbChooser2Change( 0 ); | 832 | slotCmbChooser2Change( 0 ); |
820 | break; | 833 | break; |
821 | case 3: | 834 | case 3: |
822 | cmbChooserField3 -> setCurrentItem( 0 ); | 835 | cmbChooserField3 -> setCurrentItem( 0 ); |
823 | slotCmbChooser3Change( 0 ); | 836 | slotCmbChooser3Change( 0 ); |
824 | break; | 837 | break; |
825 | case 4: | 838 | case 4: |
826 | cmbChooserField4 -> setCurrentItem( 0 ); | 839 | cmbChooserField4 -> setCurrentItem( 0 ); |
827 | slotCmbChooser4Change( 0 ); | 840 | slotCmbChooser4Change( 0 ); |
828 | break; | 841 | break; |
829 | } | 842 | } |
830 | } | 843 | } |
831 | 844 | ||
832 | // Called when something was changed in a textfield (shouldn't it called textchanged? (se)) | 845 | // Called when something was changed in a textfield (shouldn't it called textchanged? (se)) |
833 | void ContactEditor::chooserChange( const QString &textChanged, int index, | 846 | void ContactEditor::chooserChange( const QString &textChanged, int index, |
834 | QLineEdit* , int widgetPos ) { | 847 | QLineEdit* , int widgetPos ) { |
835 | 848 | ||
836 | QString type = slChooserNames[index]; // :SX | 849 | QString type = slChooserNames[index]; // :SX |
837 | qDebug("ContactEditor::chooserChange( type=>%s<, textChanged=>%s< index=%i, widgetPos=%i", | 850 | qDebug("ContactEditor::chooserChange( type=>%s<, textChanged=>%s< index=%i, widgetPos=%i", |
838 | type.latin1(),textChanged.latin1(), index, widgetPos ); | 851 | type.latin1(),textChanged.latin1(), index, widgetPos ); |
839 | 852 | ||
840 | if ( type == "Default Email"){ | 853 | if ( type == "Default Email"){ |
841 | qWarning ("??? Wozu??: %s", textChanged.latin1()); | 854 | qWarning ("??? Wozu??: %s", textChanged.latin1()); |
842 | defaultEmail = textChanged; | 855 | defaultEmail = textChanged; |
843 | 856 | ||
844 | populateDefaultEmailCmb(); | 857 | populateDefaultEmailCmb(); |
845 | 858 | ||
846 | }else if (type == "Emails"){ | 859 | }else if (type == "Emails"){ |
847 | qDebug("emails"); | 860 | qDebug("emails"); |
848 | 861 | ||
849 | QString de; | 862 | QString de; |
850 | emails = QStringList::split (",", textChanged ); | 863 | emails = QStringList::split (",", textChanged ); |
851 | 864 | ||
852 | populateDefaultEmailCmb(); | 865 | populateDefaultEmailCmb(); |
853 | } | 866 | } |
854 | 867 | ||
855 | slChooserValues[index] = textChanged; | 868 | slChooserValues[index] = textChanged; |
856 | 869 | ||
857 | } | 870 | } |
858 | 871 | ||
859 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { | 872 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { |
860 | qWarning("ContactEditor::slotChooser1Change( %s )", textChanged.latin1()); | 873 | qWarning("ContactEditor::slotChooser1Change( %s )", textChanged.latin1()); |
861 | chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1); | 874 | chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1); |
862 | } | 875 | } |
863 | 876 | ||
864 | void ContactEditor::slotChooser2Change( const QString &textChanged ) { | 877 | void ContactEditor::slotChooser2Change( const QString &textChanged ) { |
865 | qWarning("ContactEditor::slotChooser2Change( %s )", textChanged.latin1()); | 878 | qWarning("ContactEditor::slotChooser2Change( %s )", textChanged.latin1()); |
866 | chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2, 2); | 879 | chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2, 2); |
867 | 880 | ||
868 | } | 881 | } |
869 | 882 | ||
870 | void ContactEditor::slotChooser3Change( const QString &textChanged ) { | 883 | void ContactEditor::slotChooser3Change( const QString &textChanged ) { |
871 | qWarning("ContactEditor::slotChooser3Change( %s )", textChanged.latin1()); | 884 | qWarning("ContactEditor::slotChooser3Change( %s )", textChanged.latin1()); |
872 | chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3, 3); | 885 | chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3, 3); |
873 | } | 886 | } |
874 | 887 | ||
875 | void ContactEditor::slotChooser4Change( const QString &textChanged ) { | 888 | void ContactEditor::slotChooser4Change( const QString &textChanged ) { |
876 | qWarning("ContactEditor::slotChooser4Change( %s )", textChanged.latin1()); | 889 | qWarning("ContactEditor::slotChooser4Change( %s )", textChanged.latin1()); |
877 | chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4, 4); | 890 | chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4, 4); |
878 | } | 891 | } |
879 | 892 | ||
880 | void ContactEditor::slotAddressChange( const QString &textChanged ) { | 893 | void ContactEditor::slotAddressChange( const QString &textChanged ) { |
881 | 894 | ||
882 | if ( cmbAddress->currentItem() == 0 ) { | 895 | if ( cmbAddress->currentItem() == 0 ) { |
883 | slBusinessAddress[0] = textChanged; | 896 | slBusinessAddress[0] = textChanged; |
884 | } else { | 897 | } else { |
885 | slHomeAddress[0] = textChanged; | 898 | slHomeAddress[0] = textChanged; |
886 | } | 899 | } |
887 | } | 900 | } |
888 | 901 | ||
889 | void ContactEditor::slotAddress2Change( const QString &textChanged ) { | 902 | void ContactEditor::slotAddress2Change( const QString &textChanged ) { |
890 | 903 | ||
891 | if ( cmbAddress->currentItem() == 0 ) { | 904 | if ( cmbAddress->currentItem() == 0 ) { |
892 | slBusinessAddress[1] = textChanged; | 905 | slBusinessAddress[1] = textChanged; |
893 | } else { | 906 | } else { |
894 | slHomeAddress[1] = textChanged; | 907 | slHomeAddress[1] = textChanged; |
895 | } | 908 | } |
896 | } | 909 | } |
897 | 910 | ||
898 | void ContactEditor::slotPOBoxChange( const QString &textChanged ) { | 911 | void ContactEditor::slotPOBoxChange( const QString &textChanged ) { |
899 | 912 | ||
900 | if ( cmbAddress->currentItem() == 0 ) { | 913 | if ( cmbAddress->currentItem() == 0 ) { |
901 | slBusinessAddress[2] = textChanged; | 914 | slBusinessAddress[2] = textChanged; |
902 | } else { | 915 | } else { |
903 | slHomeAddress[2] = textChanged; | 916 | slHomeAddress[2] = textChanged; |
904 | } | 917 | } |
905 | } | 918 | } |
906 | 919 | ||
907 | void ContactEditor::slotCityChange( const QString &textChanged ) { | 920 | void ContactEditor::slotCityChange( const QString &textChanged ) { |
908 | 921 | ||
909 | if ( cmbAddress->currentItem() == 0 ) { | 922 | if ( cmbAddress->currentItem() == 0 ) { |
910 | slBusinessAddress[3] = textChanged; | 923 | slBusinessAddress[3] = textChanged; |
911 | } else { | 924 | } else { |
912 | slHomeAddress[3] = textChanged; | 925 | slHomeAddress[3] = textChanged; |
913 | } | 926 | } |
914 | } | 927 | } |
915 | 928 | ||
916 | void ContactEditor::slotStateChange( const QString &textChanged ) { | 929 | void ContactEditor::slotStateChange( const QString &textChanged ) { |
917 | 930 | ||
918 | 931 | ||
919 | if ( cmbAddress->currentItem() == 0 ) { | 932 | if ( cmbAddress->currentItem() == 0 ) { |
920 | slBusinessAddress[4] = textChanged; | 933 | slBusinessAddress[4] = textChanged; |
921 | } else { | 934 | } else { |
922 | slHomeAddress[4] = textChanged; | 935 | slHomeAddress[4] = textChanged; |
923 | } | 936 | } |
924 | } | 937 | } |
925 | 938 | ||
926 | void ContactEditor::slotZipChange( const QString &textChanged ) { | 939 | void ContactEditor::slotZipChange( const QString &textChanged ) { |
927 | 940 | ||
928 | if ( cmbAddress->currentItem() == 0 ) { | 941 | if ( cmbAddress->currentItem() == 0 ) { |
929 | slBusinessAddress[5] = textChanged; | 942 | slBusinessAddress[5] = textChanged; |
930 | } else { | 943 | } else { |
931 | slHomeAddress[5] = textChanged; | 944 | slHomeAddress[5] = textChanged; |
932 | } | 945 | } |
933 | } | 946 | } |
934 | 947 | ||
935 | void ContactEditor::slotCountryChange( const QString &textChanged ) { | 948 | void ContactEditor::slotCountryChange( const QString &textChanged ) { |
936 | 949 | ||
937 | if ( cmbAddress->currentItem() == 0 ) { | 950 | if ( cmbAddress->currentItem() == 0 ) { |
938 | slBusinessAddress[6] = textChanged; | 951 | slBusinessAddress[6] = textChanged; |
939 | } else { | 952 | } else { |
940 | slHomeAddress[6] = textChanged; | 953 | slHomeAddress[6] = textChanged; |
941 | } | 954 | } |
942 | } | 955 | } |
943 | 956 | ||
944 | 957 | ||
945 | void ContactEditor::slotCmbChooser1Change( int index ) { | 958 | void ContactEditor::slotCmbChooser1Change( int index ) { |
946 | qWarning("ContactEditor::slotCmbChooser1Change( %d )", index); | 959 | qWarning("ContactEditor::slotCmbChooser1Change( %d )", index); |
947 | if ( !cmbChooserChange( cmbChooserField1->currentItem(), m_widgetStack1, 1) ){ | 960 | if ( !cmbChooserChange( cmbChooserField1->currentItem(), m_widgetStack1, 1) ){ |
948 | 961 | ||
949 | txtChooserField1->setText( slChooserValues[index] ); | 962 | txtChooserField1->setText( slChooserValues[index] ); |
950 | txtChooserField1->setFocus(); | 963 | txtChooserField1->setFocus(); |
951 | 964 | ||
952 | } | 965 | } |
953 | 966 | ||
954 | } | 967 | } |
955 | 968 | ||
956 | void ContactEditor::slotCmbChooser2Change( int index ) { | 969 | void ContactEditor::slotCmbChooser2Change( int index ) { |
957 | qWarning("ContactEditor::slotCmbChooser2Change( %d )", index); | 970 | qWarning("ContactEditor::slotCmbChooser2Change( %d )", index); |
958 | 971 | ||
959 | if ( !cmbChooserChange( cmbChooserField2->currentItem(), m_widgetStack2, 2) ){ | 972 | if ( !cmbChooserChange( cmbChooserField2->currentItem(), m_widgetStack2, 2) ){ |
960 | 973 | ||
961 | txtChooserField2->setText( slChooserValues[index] ); | 974 | txtChooserField2->setText( slChooserValues[index] ); |
962 | txtChooserField2->setFocus(); | 975 | txtChooserField2->setFocus(); |
963 | 976 | ||
964 | } | 977 | } |
965 | } | 978 | } |
966 | 979 | ||
967 | void ContactEditor::slotCmbChooser3Change( int index ) { | 980 | void ContactEditor::slotCmbChooser3Change( int index ) { |
968 | qWarning("ContactEditor::slotCmbChooser3Change( %d )", index); | 981 | qWarning("ContactEditor::slotCmbChooser3Change( %d )", index); |
969 | 982 | ||
970 | if ( !cmbChooserChange( cmbChooserField3->currentItem(), m_widgetStack3, 3) ){ | 983 | if ( !cmbChooserChange( cmbChooserField3->currentItem(), m_widgetStack3, 3) ){ |
971 | 984 | ||
972 | txtChooserField3->setText( slChooserValues[index] ); | 985 | txtChooserField3->setText( slChooserValues[index] ); |
973 | txtChooserField3->setFocus(); | 986 | txtChooserField3->setFocus(); |
974 | 987 | ||
975 | } | 988 | } |
976 | } | 989 | } |
977 | 990 | ||
978 | void ContactEditor::slotCmbChooser4Change( int index ) { | 991 | void ContactEditor::slotCmbChooser4Change( int index ) { |
979 | qWarning("ContactEditor::slotCmbChooser4Change( %d )", index); | 992 | qWarning("ContactEditor::slotCmbChooser4Change( %d )", index); |
980 | 993 | ||
981 | if ( !cmbChooserChange( cmbChooserField4->currentItem(), m_widgetStack4, 4) ){ | 994 | if ( !cmbChooserChange( cmbChooserField4->currentItem(), m_widgetStack4, 4) ){ |
982 | 995 | ||
983 | txtChooserField4->setText( slChooserValues[index] ); | 996 | txtChooserField4->setText( slChooserValues[index] ); |
984 | txtChooserField4->setFocus(); | 997 | txtChooserField4->setFocus(); |
985 | 998 | ||
986 | } | 999 | } |
987 | } | 1000 | } |
988 | 1001 | ||
989 | void ContactEditor::slotAddressTypeChange( int index ) { | 1002 | void ContactEditor::slotAddressTypeChange( int index ) { |
990 | 1003 | ||
991 | 1004 | ||
992 | if ( !initializing ) | 1005 | if ( !initializing ) |
993 | contactfields.setFieldOrder( 4, index ); | 1006 | contactfields.setFieldOrder( 4, index ); |
994 | 1007 | ||
995 | 1008 | ||
996 | if ( index == 0 ) { | 1009 | if ( index == 0 ) { |
997 | 1010 | ||
998 | txtAddress->setText( slBusinessAddress[0] ); | 1011 | txtAddress->setText( slBusinessAddress[0] ); |
999 | //txtAddress2->setText( (*slBusinessAddress)[1] ); | 1012 | //txtAddress2->setText( (*slBusinessAddress)[1] ); |
1000 | //txtPOBox->setText( (*slBusinessAddress)[2] ); | 1013 | //txtPOBox->setText( (*slBusinessAddress)[2] ); |
1001 | txtCity->setText( slBusinessAddress[3] ); | 1014 | txtCity->setText( slBusinessAddress[3] ); |
1002 | txtState->setText( slBusinessAddress[4] ); | 1015 | txtState->setText( slBusinessAddress[4] ); |
1003 | txtZip->setText( slBusinessAddress[5] ); | 1016 | txtZip->setText( slBusinessAddress[5] ); |
1004 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 1017 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
1005 | txtTmp->setText( slBusinessAddress[6] ); | 1018 | txtTmp->setText( slBusinessAddress[6] ); |
1006 | 1019 | ||
1007 | } else { | 1020 | } else { |
1008 | 1021 | ||
1009 | txtAddress->setText( slHomeAddress[0] ); | 1022 | txtAddress->setText( slHomeAddress[0] ); |
1010 | //txtAddress2->setText( (*slHomeAddress)[1] ); | 1023 | //txtAddress2->setText( (*slHomeAddress)[1] ); |
1011 | //txtPOBox->setText( (*slHomeAddress)[2] ); | 1024 | //txtPOBox->setText( (*slHomeAddress)[2] ); |
1012 | txtCity->setText( slHomeAddress[3] ); | 1025 | txtCity->setText( slHomeAddress[3] ); |
1013 | txtState->setText( slHomeAddress[4] ); | 1026 | txtState->setText( slHomeAddress[4] ); |
1014 | txtZip->setText( slHomeAddress[5] ); | 1027 | txtZip->setText( slHomeAddress[5] ); |
1015 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 1028 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
1016 | txtTmp->setText( slHomeAddress[6] ); | 1029 | txtTmp->setText( slHomeAddress[6] ); |
1017 | 1030 | ||
1018 | } | 1031 | } |
1019 | 1032 | ||
1020 | } | 1033 | } |
1021 | 1034 | ||
1022 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { | 1035 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { |
1023 | 1036 | ||
1024 | qWarning( "ContactEditor::slotFullNameChange( %s )", textChanged.latin1() ); | 1037 | qWarning( "ContactEditor::slotFullNameChange( %s )", textChanged.latin1() ); |
1025 | 1038 | ||
1026 | int index = cmbFileAs->currentItem(); | 1039 | int index = cmbFileAs->currentItem(); |
1027 | 1040 | ||
1028 | cmbFileAs->clear(); | 1041 | cmbFileAs->clear(); |
1029 | 1042 | ||
1030 | cmbFileAs->insertItem( parseName( textChanged, NAME_LF ) ); | 1043 | cmbFileAs->insertItem( parseName( textChanged, NAME_LF ) ); |
1031 | cmbFileAs->insertItem( parseName( textChanged, NAME_LFM ) ); | 1044 | cmbFileAs->insertItem( parseName( textChanged, NAME_LFM ) ); |
1032 | cmbFileAs->insertItem( parseName( textChanged, NAME_FL ) ); | 1045 | cmbFileAs->insertItem( parseName( textChanged, NAME_FL ) ); |
1033 | cmbFileAs->insertItem( parseName( textChanged, NAME_FML ) ); | 1046 | cmbFileAs->insertItem( parseName( textChanged, NAME_FML ) ); |
1034 | if ( ! txtSuffix->text().isEmpty() ) | 1047 | if ( ! txtSuffix->text().isEmpty() ) |
1035 | cmbFileAs->insertItem( parseName( textChanged, NAME_FML ) + " " + txtSuffix->text() ); | 1048 | cmbFileAs->insertItem( parseName( textChanged, NAME_FML ) + " " + txtSuffix->text() ); |
1036 | 1049 | ||
1037 | cmbFileAs->setCurrentItem( index ); | 1050 | cmbFileAs->setCurrentItem( index ); |
1038 | 1051 | ||
1039 | 1052 | ||
1040 | } | 1053 | } |
1041 | 1054 | ||
1042 | void ContactEditor::slotSuffixChange( const QString& ) { | 1055 | void ContactEditor::slotSuffixChange( const QString& ) { |
1043 | // Just want to update the FileAs combo if the suffix was changed.. | 1056 | // Just want to update the FileAs combo if the suffix was changed.. |
1044 | slotFullNameChange( txtFullName->text() ); | 1057 | slotFullNameChange( txtFullName->text() ); |
1045 | } | 1058 | } |
1046 | 1059 | ||
1047 | void ContactEditor::accept() { | 1060 | void ContactEditor::accept() { |
1048 | 1061 | ||
1049 | if ( isEmpty() ) { | 1062 | if ( isEmpty() ) { |
1050 | cleanupFields(); | 1063 | cleanupFields(); |
1051 | reject(); | 1064 | reject(); |
1052 | } else { | 1065 | } else { |
1053 | saveEntry(); | 1066 | saveEntry(); |
1054 | cleanupFields(); | 1067 | cleanupFields(); |
1055 | QDialog::accept(); | 1068 | QDialog::accept(); |
1056 | } | 1069 | } |
1057 | 1070 | ||
1058 | } | 1071 | } |
1059 | 1072 | ||
1060 | void ContactEditor::slotNote() { | 1073 | void ContactEditor::slotNote() { |
1061 | 1074 | ||
1062 | dlgNote->showMaximized(); | 1075 | dlgNote->showMaximized(); |
1063 | if ( !dlgNote->exec() ) { | 1076 | if ( !dlgNote->exec() ) { |
1064 | txtNote->setText( ent.notes() ); | 1077 | txtNote->setText( ent.notes() ); |
1065 | } | 1078 | } |
1066 | } | 1079 | } |
1067 | 1080 | ||
1068 | void ContactEditor::slotName() { | 1081 | void ContactEditor::slotName() { |
1069 | 1082 | ||
1070 | QString tmpName; | 1083 | QString tmpName; |
1071 | 1084 | ||
1072 | txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); | 1085 | txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); |
1073 | txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); | 1086 | txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); |
1074 | txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); | 1087 | txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); |
1075 | // txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); | 1088 | // txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); |
1076 | 1089 | ||
1077 | dlgName->showMaximized(); | 1090 | dlgName->showMaximized(); |
1078 | if ( dlgName->exec() ) { | 1091 | if ( dlgName->exec() ) { |
1079 | if ( txtLastName->text().contains( ' ', TRUE ) ) | 1092 | if ( txtLastName->text().contains( ' ', TRUE ) ) |
1080 | tmpName = txtLastName->text() + ", " + txtFirstName->text() + " " + txtMiddleName->text(); | 1093 | tmpName = txtLastName->text() + ", " + txtFirstName->text() + " " + txtMiddleName->text(); |
1081 | else | 1094 | else |
1082 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text(); | 1095 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text(); |
1083 | 1096 | ||
1084 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); | 1097 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); |
1085 | slotFullNameChange( txtFullName->text() ); | 1098 | slotFullNameChange( txtFullName->text() ); |
1086 | } | 1099 | } |
1087 | 1100 | ||
1088 | } | 1101 | } |
1089 | 1102 | ||
1090 | void ContactEditor::setNameFocus() { | 1103 | void ContactEditor::setNameFocus() { |
1091 | 1104 | ||
1092 | txtFullName->setFocus(); | 1105 | txtFullName->setFocus(); |
1093 | 1106 | ||
1094 | } | 1107 | } |
1095 | 1108 | ||
1096 | bool ContactEditor::isEmpty() { | 1109 | bool ContactEditor::isEmpty() { |
1097 | // Test and see if the record should be saved. | 1110 | // Test and see if the record should be saved. |
1098 | // More strict than the original qtopia, needs name or fileas to save | 1111 | // More strict than the original qtopia, needs name or fileas to save |
1099 | 1112 | ||
1100 | QString t = txtFullName->text(); | 1113 | QString t = txtFullName->text(); |
1101 | if ( !t.isEmpty() && containsAlphaNum( t ) ) | 1114 | if ( !t.isEmpty() && containsAlphaNum( t ) ) |
1102 | return false; | 1115 | return false; |
1103 | 1116 | ||
1104 | t = cmbFileAs->currentText(); | 1117 | t = cmbFileAs->currentText(); |
1105 | if ( !t.isEmpty() && containsAlphaNum( t ) ) | 1118 | if ( !t.isEmpty() && containsAlphaNum( t ) ) |
1106 | return false; | 1119 | return false; |
1107 | 1120 | ||
1108 | return true; | 1121 | return true; |
1109 | 1122 | ||
1110 | } | 1123 | } |
1111 | 1124 | ||
1112 | QString ContactEditor::parseName( const QString fullName, int type ) { | 1125 | QString ContactEditor::parseName( const QString fullName, int type ) { |
1113 | 1126 | ||
1114 | QString simplifiedName( fullName.simplifyWhiteSpace() ); | 1127 | QString simplifiedName( fullName.simplifyWhiteSpace() ); |
1115 | QString strFirstName; | 1128 | QString strFirstName; |
1116 | QString strMiddleName; | 1129 | QString strMiddleName; |
1117 | QString strLastName; | 1130 | QString strLastName; |
1118 | QString strTitle; | 1131 | QString strTitle; |
1119 | int commapos; | 1132 | int commapos; |
1120 | bool haveLastName = false; | 1133 | bool haveLastName = false; |
1121 | 1134 | ||
1122 | qWarning("Fullname: %s", simplifiedName.latin1()); | 1135 | qWarning("Fullname: %s", simplifiedName.latin1()); |
1123 | 1136 | ||
1124 | commapos = simplifiedName.find( ',', 0, TRUE); | 1137 | commapos = simplifiedName.find( ',', 0, TRUE); |
1125 | if ( commapos >= 0 ) { | 1138 | if ( commapos >= 0 ) { |
1126 | qWarning(" Commapos: %d", commapos ); | 1139 | qWarning(" Commapos: %d", commapos ); |
1127 | 1140 | ||
1128 | // A comma (",") separates the lastname from one or | 1141 | // A comma (",") separates the lastname from one or |
1129 | // many first names. Thus, remove the lastname from the | 1142 | // many first names. Thus, remove the lastname from the |
1130 | // String and parse the firstnames. | 1143 | // String and parse the firstnames. |
1131 | 1144 | ||
1132 | strLastName = simplifiedName.left( commapos ); | 1145 | strLastName = simplifiedName.left( commapos ); |
1133 | simplifiedName= simplifiedName.mid( commapos + 1 ); | 1146 | simplifiedName= simplifiedName.mid( commapos + 1 ); |
1134 | haveLastName = true; | 1147 | haveLastName = true; |
1135 | qWarning("Fullname without ',': %s", simplifiedName.latin1()); | 1148 | qWarning("Fullname without ',': %s", simplifiedName.latin1()); |
1136 | 1149 | ||
1137 | // If we have any lastname, we should now split all first names. | 1150 | // If we have any lastname, we should now split all first names. |
1138 | // The first one will be the used as first, the rest as "middle names" | 1151 | // The first one will be the used as first, the rest as "middle names" |
1139 | 1152 | ||
1140 | QStringList allFirstNames = QStringList::split(" ", simplifiedName); | 1153 | QStringList allFirstNames = QStringList::split(" ", simplifiedName); |
1141 | QStringList::Iterator it = allFirstNames.begin(); | 1154 | QStringList::Iterator it = allFirstNames.begin(); |
1142 | strFirstName = *it++; | 1155 | strFirstName = *it++; |
1143 | QStringList allSecondNames; | 1156 | QStringList allSecondNames; |
1144 | for ( ; it != allFirstNames.end(); ++it ) | 1157 | for ( ; it != allFirstNames.end(); ++it ) |
1145 | allSecondNames.append( *it ); | 1158 | allSecondNames.append( *it ); |
1146 | 1159 | ||
1147 | strMiddleName = allSecondNames.join(" "); | 1160 | strMiddleName = allSecondNames.join(" "); |
1148 | 1161 | ||
1149 | } else { | 1162 | } else { |
1150 | 1163 | ||
1151 | // No comma separator used: We use the first word as firstname, the | 1164 | // No comma separator used: We use the first word as firstname, the |
1152 | // last as second/lastname and everything in the middle as middlename | 1165 | // last as second/lastname and everything in the middle as middlename |
1153 | 1166 | ||
1154 | QStringList allNames = QStringList::split(" ", simplifiedName); | 1167 | QStringList allNames = QStringList::split(" ", simplifiedName); |
1155 | QStringList::Iterator it = allNames.begin(); | 1168 | QStringList::Iterator it = allNames.begin(); |
1156 | strFirstName = *it++; | 1169 | strFirstName = *it++; |
1157 | QStringList allSecondNames; | 1170 | QStringList allSecondNames; |
1158 | for ( ; it != --allNames.end(); ++it ) | 1171 | for ( ; it != --allNames.end(); ++it ) |
1159 | allSecondNames.append( *it ); | 1172 | allSecondNames.append( *it ); |
1160 | 1173 | ||
1161 | strMiddleName = allSecondNames.join(" "); | 1174 | strMiddleName = allSecondNames.join(" "); |
1162 | strLastName = *(--allNames.end()); | 1175 | strLastName = *(--allNames.end()); |
1163 | 1176 | ||
1164 | } | 1177 | } |
1165 | 1178 | ||
1166 | if ( strFirstName == strLastName ) | 1179 | if ( strFirstName == strLastName ) |
1167 | strFirstName = ""; | 1180 | strFirstName = ""; |
1168 | 1181 | ||
1169 | qWarning(" strFirstName: %s", strFirstName.latin1()); | 1182 | qWarning(" strFirstName: %s", strFirstName.latin1()); |
1170 | qWarning(" strMiddleName: %s", strMiddleName.latin1()); | 1183 | qWarning(" strMiddleName: %s", strMiddleName.latin1()); |
1171 | qWarning(" strLastName: %s", strLastName.latin1()); | 1184 | qWarning(" strLastName: %s", strLastName.latin1()); |
1172 | qWarning(" strTitle: %s", strTitle.latin1()); | 1185 | qWarning(" strTitle: %s", strTitle.latin1()); |
1173 | 1186 | ||
1174 | switch (type) { | 1187 | switch (type) { |
1175 | case NAME_FL: | 1188 | case NAME_FL: |
1176 | return strFirstName + " " + strLastName; | 1189 | return strFirstName + " " + strLastName; |
1177 | 1190 | ||
1178 | case NAME_LF: | 1191 | case NAME_LF: |
1179 | return strLastName + ", " + strFirstName; | 1192 | return strLastName + ", " + strFirstName; |
1180 | 1193 | ||
1181 | case NAME_LFM: | 1194 | case NAME_LFM: |
1182 | return strLastName + ", " + strFirstName + " " + strMiddleName; | 1195 | return strLastName + ", " + strFirstName + " " + strMiddleName; |
1183 | 1196 | ||
1184 | case NAME_FML: | 1197 | case NAME_FML: |
1185 | return strFirstName + " " + strMiddleName + " " + strLastName ; | 1198 | return strFirstName + " " + strMiddleName + " " + strLastName ; |
1186 | 1199 | ||
1187 | case NAME_F: | 1200 | case NAME_F: |
1188 | return strFirstName; | 1201 | return strFirstName; |
1189 | 1202 | ||
1190 | case NAME_M: | 1203 | case NAME_M: |
1191 | return strMiddleName; | 1204 | return strMiddleName; |
1192 | 1205 | ||
1193 | case NAME_L: | 1206 | case NAME_L: |
1194 | return strLastName; | 1207 | return strLastName; |
1195 | 1208 | ||
1196 | case NAME_S: | 1209 | case NAME_S: |
1197 | return txtSuffix->text(); | 1210 | return txtSuffix->text(); |
1198 | 1211 | ||
1199 | } | 1212 | } |
1200 | return QString::null; | 1213 | return QString::null; |
1201 | } | 1214 | } |
1202 | 1215 | ||
1203 | void ContactEditor::cleanupFields() { | 1216 | void ContactEditor::cleanupFields() { |
1204 | QStringList::Iterator it = slChooserValues.begin(); | 1217 | QStringList::Iterator it = slChooserValues.begin(); |
1205 | 1218 | ||
1206 | for ( int i = 0; it != slChooserValues.end(); i++, ++it ) { | 1219 | for ( int i = 0; it != slChooserValues.end(); i++, ++it ) { |
1207 | (*it) = ""; | 1220 | (*it) = ""; |
1208 | } | 1221 | } |
1209 | 1222 | ||
1210 | for ( int i = 0; i < 7; i++ ) { | 1223 | for ( int i = 0; i < 7; i++ ) { |
1211 | slHomeAddress[i] = ""; | 1224 | slHomeAddress[i] = ""; |
1212 | slBusinessAddress[i] = ""; | 1225 | slBusinessAddress[i] = ""; |
1213 | } | 1226 | } |
1214 | 1227 | ||
1215 | QListIterator<QLineEdit> itLV( listValue ); | 1228 | QListIterator<QLineEdit> itLV( listValue ); |
1216 | for ( ; itLV.current(); ++itLV ) { | 1229 | for ( ; itLV.current(); ++itLV ) { |
1217 | (*itLV)->setText( "" ); | 1230 | (*itLV)->setText( "" ); |
1218 | } | 1231 | } |
1219 | 1232 | ||
1220 | txtFirstName->setText(""); | 1233 | txtFirstName->setText(""); |
1221 | txtMiddleName->setText(""); | 1234 | txtMiddleName->setText(""); |
1222 | txtLastName->setText(""); | 1235 | txtLastName->setText(""); |
1223 | txtSuffix->setText(""); | 1236 | txtSuffix->setText(""); |
1224 | txtNote->setText(""); | 1237 | txtNote->setText(""); |
1225 | txtFullName->setText(""); | 1238 | txtFullName->setText(""); |
1226 | txtJobTitle->setText(""); | 1239 | txtJobTitle->setText(""); |
1227 | txtOrganization->setText(""); | 1240 | txtOrganization->setText(""); |
1228 | txtChooserField1->setText(""); | 1241 | txtChooserField1->setText(""); |
1229 | txtChooserField2->setText(""); | 1242 | txtChooserField2->setText(""); |
1230 | txtChooserField3->setText(""); | 1243 | txtChooserField3->setText(""); |
1231 | txtAddress->setText(""); | 1244 | txtAddress->setText(""); |
1232 | txtCity->setText(""); | 1245 | txtCity->setText(""); |
1233 | txtState->setText(""); | 1246 | txtState->setText(""); |
1234 | txtZip->setText(""); | 1247 | txtZip->setText(""); |
1235 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 1248 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
1236 | txtTmp->setText(""); | 1249 | txtTmp->setText(""); |
1237 | txtTmp = cmbFileAs->lineEdit(); | 1250 | txtTmp = cmbFileAs->lineEdit(); |
1238 | txtTmp->setText(""); | 1251 | txtTmp->setText(""); |
1239 | 1252 | ||
1240 | } | 1253 | } |
1241 | 1254 | ||
1242 | void ContactEditor::setEntry( const OContact &entry ) { | 1255 | void ContactEditor::setEntry( const OContact &entry ) { |
1243 | 1256 | ||
1244 | initializing = true; | 1257 | initializing = true; |
1245 | 1258 | ||
1246 | cleanupFields(); | 1259 | cleanupFields(); |
1247 | 1260 | ||
1248 | ent = entry; | 1261 | ent = entry; |
1249 | 1262 | ||
1250 | emails = QStringList(ent.emailList()); | 1263 | emails = QStringList(ent.emailList()); |
1251 | defaultEmail = ent.defaultEmail(); | 1264 | defaultEmail = ent.defaultEmail(); |
1252 | if (defaultEmail.isEmpty()) defaultEmail = emails[0]; | 1265 | if (defaultEmail.isEmpty()) defaultEmail = emails[0]; |
1253 | qDebug("default email=%s",defaultEmail.latin1()); | 1266 | qDebug("default email=%s",defaultEmail.latin1()); |
1254 | 1267 | ||
1255 | txtFirstName->setText( ent.firstName() ); | 1268 | txtFirstName->setText( ent.firstName() ); |
1256 | txtMiddleName->setText( ent.middleName() ); | 1269 | txtMiddleName->setText( ent.middleName() ); |
1257 | txtLastName->setText( ent.lastName() ); | 1270 | txtLastName->setText( ent.lastName() ); |
1258 | txtSuffix->setText( ent.suffix() ); | 1271 | txtSuffix->setText( ent.suffix() ); |
1259 | 1272 | ||
1260 | // QString *tmpString = new QString; | 1273 | // QString *tmpString = new QString; |
1261 | // *tmpString = ent.firstName() + " " + ent.middleName() + | 1274 | // *tmpString = ent.firstName() + " " + ent.middleName() + |
1262 | // + " " + ent.lastName() + " " + ent.suffix(); | 1275 | // + " " + ent.lastName() + " " + ent.suffix(); |
1263 | //txtFullName->setText( tmpString->simplifyWhiteSpace() ); | 1276 | //txtFullName->setText( tmpString->simplifyWhiteSpace() ); |
1264 | 1277 | ||
1265 | if ( !ent.isEmpty() ){ | 1278 | if ( !ent.isEmpty() ){ |
1266 | // Lastnames with multiple words need to be protected by a comma ! | 1279 | // Lastnames with multiple words need to be protected by a comma ! |
1267 | if ( ent.lastName().contains( ' ', TRUE ) ) | 1280 | if ( ent.lastName().contains( ' ', TRUE ) ) |
1268 | txtFullName->setText( ent.lastName() + ", " + ent.firstName() + " " + ent.middleName() ); | 1281 | txtFullName->setText( ent.lastName() + ", " + ent.firstName() + " " + ent.middleName() ); |
1269 | else | 1282 | else |
1270 | txtFullName->setText( ent.firstName() + " " + ent.middleName() + " " + ent.lastName() ); | 1283 | txtFullName->setText( ent.firstName() + " " + ent.middleName() + " " + ent.lastName() ); |
1271 | } | 1284 | } |
1272 | 1285 | ||
1273 | cmbFileAs->setEditText( ent.fileAs() ); | 1286 | cmbFileAs->setEditText( ent.fileAs() ); |
1274 | 1287 | ||
1275 | //if (hasTitle) | 1288 | //if (hasTitle) |
1276 | txtJobTitle->setText( ent.jobTitle() ); | 1289 | txtJobTitle->setText( ent.jobTitle() ); |
1277 | 1290 | ||
1278 | //if (hasCompany) | 1291 | //if (hasCompany) |
1279 | txtOrganization->setText( ent.company() ); | 1292 | txtOrganization->setText( ent.company() ); |
1280 | 1293 | ||
1281 | //if (hasNotes) | 1294 | //if (hasNotes) |
1282 | txtNote->setText( ent.notes() ); | 1295 | txtNote->setText( ent.notes() ); |
1283 | 1296 | ||
1284 | //if (hasStreet) { | 1297 | //if (hasStreet) { |
1285 | slHomeAddress[0] = ent.homeStreet(); | 1298 | slHomeAddress[0] = ent.homeStreet(); |
1286 | slBusinessAddress[0] = ent.businessStreet(); | 1299 | slBusinessAddress[0] = ent.businessStreet(); |
1287 | //} | 1300 | //} |
1288 | 1301 | ||
1289 | //if (hasCity) { | 1302 | //if (hasCity) { |
1290 | slHomeAddress[3] = ent.homeCity(); | 1303 | slHomeAddress[3] = ent.homeCity(); |
1291 | slBusinessAddress[3] = ent.businessCity(); | 1304 | slBusinessAddress[3] = ent.businessCity(); |
1292 | //} | 1305 | //} |
1293 | 1306 | ||
1294 | //if (hasState) { | 1307 | //if (hasState) { |
1295 | slHomeAddress[4] = ent.homeState(); | 1308 | slHomeAddress[4] = ent.homeState(); |
1296 | slBusinessAddress[4] = ent.businessState(); | 1309 | slBusinessAddress[4] = ent.businessState(); |
1297 | //} | 1310 | //} |
1298 | 1311 | ||
1299 | //if (hasZip) { | 1312 | //if (hasZip) { |
1300 | slHomeAddress[5] = ent.homeZip(); | 1313 | slHomeAddress[5] = ent.homeZip(); |
1301 | slBusinessAddress[5] = ent.businessZip(); | 1314 | slBusinessAddress[5] = ent.businessZip(); |
1302 | //} | 1315 | //} |
1303 | 1316 | ||
1304 | //if (hasCountry) { | 1317 | //if (hasCountry) { |
1305 | slHomeAddress[6] = ent.homeCountry(); | 1318 | slHomeAddress[6] = ent.homeCountry(); |
1306 | slBusinessAddress[6] = ent.businessCountry(); | 1319 | slBusinessAddress[6] = ent.businessCountry(); |
1307 | //} | 1320 | //} |
1308 | 1321 | ||
1309 | QStringList::ConstIterator it; | 1322 | QStringList::ConstIterator it; |
1310 | QListIterator<QLineEdit> itLE( listValue ); | 1323 | QListIterator<QLineEdit> itLE( listValue ); |
1311 | for ( it = slDynamicEntries.begin(); itLE.current()/* != slDynamicEntries.end()*/; ++it, ++itLE) { | 1324 | for ( it = slDynamicEntries.begin(); itLE.current()/* != slDynamicEntries.end()*/; ++it, ++itLE) { |
1312 | 1325 | ||
1313 | qWarning(" Filling dynamic Field: %s", (*it).latin1() ); | 1326 | qWarning(" Filling dynamic Field: %s", (*it).latin1() ); |
1314 | 1327 | ||
1315 | if ( *it == "Department" ) | 1328 | if ( *it == "Department" ) |
1316 | (*itLE)->setText( ent.department() ); | 1329 | (*itLE)->setText( ent.department() ); |
1317 | 1330 | ||
1318 | if ( *it == "Company" ) | 1331 | if ( *it == "Company" ) |
1319 | (*itLE)->setText( ent.company() ); | 1332 | (*itLE)->setText( ent.company() ); |
1320 | 1333 | ||
1321 | if ( *it == "Office" ) | 1334 | if ( *it == "Office" ) |
1322 | (*itLE)->setText( ent.office() ); | 1335 | (*itLE)->setText( ent.office() ); |
1323 | 1336 | ||
1324 | if ( *it == "Profession" ) | 1337 | if ( *it == "Profession" ) |
1325 | (*itLE)->setText( ent.profession() ); | 1338 | (*itLE)->setText( ent.profession() ); |
1326 | 1339 | ||
1327 | if ( *it == "Assistant" ) | 1340 | if ( *it == "Assistant" ) |
1328 | (*itLE)->setText( ent.assistant() ); | 1341 | (*itLE)->setText( ent.assistant() ); |
1329 | 1342 | ||
1330 | if ( *it == "Manager" ) | 1343 | if ( *it == "Manager" ) |
1331 | (*itLE)->setText( ent.manager() ); | 1344 | (*itLE)->setText( ent.manager() ); |
1332 | 1345 | ||
1333 | if ( *it == "Spouse" ) | 1346 | if ( *it == "Spouse" ) |
1334 | (*itLE)->setText( ent.spouse() ); | 1347 | (*itLE)->setText( ent.spouse() ); |
1335 | 1348 | ||
1336 | if ( *it == "Nickname" ){ | 1349 | if ( *it == "Nickname" ){ |
1337 | qWarning("**** Nichname: %s", ent.nickname().latin1() ); | 1350 | qWarning("**** Nichname: %s", ent.nickname().latin1() ); |
1338 | (*itLE)->setText( ent.nickname() ); | 1351 | (*itLE)->setText( ent.nickname() ); |
1339 | } | 1352 | } |
1340 | 1353 | ||
1341 | if ( *it == "Children" ) | 1354 | if ( *it == "Children" ) |
1342 | (*itLE)->setText( ent.children() ); | 1355 | (*itLE)->setText( ent.children() ); |
1343 | 1356 | ||
1344 | } | 1357 | } |
1345 | 1358 | ||
1346 | QStringList::Iterator itV; | 1359 | QStringList::Iterator itV; |
1347 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { | 1360 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { |
1348 | 1361 | ||
1349 | if ( ( *it == "Business Phone") || ( *it == "Work Phone" ) ) | 1362 | if ( ( *it == "Business Phone") || ( *it == "Work Phone" ) ) |
1350 | *itV = ent.businessPhone(); | 1363 | *itV = ent.businessPhone(); |
1351 | /* | 1364 | /* |
1352 | if ( *it == "Business 2 Phone" ) | 1365 | if ( *it == "Business 2 Phone" ) |
1353 | *itV = ent.business2Phone(); | 1366 | *itV = ent.business2Phone(); |
1354 | */ | 1367 | */ |
1355 | if ( ( *it == "Business Fax") || ( *it == "Work Fax" ) ) | 1368 | if ( ( *it == "Business Fax") || ( *it == "Work Fax" ) ) |
1356 | *itV = ent.businessFax(); | 1369 | *itV = ent.businessFax(); |
1357 | 1370 | ||
1358 | if ( ( *it == "Business Mobile" ) || ( *it == "work Mobile" ) ) | 1371 | if ( ( *it == "Business Mobile" ) || ( *it == "work Mobile" ) ) |
1359 | *itV = ent.businessMobile(); | 1372 | *itV = ent.businessMobile(); |
1360 | /* | 1373 | /* |
1361 | if ( *it == "Company Phone" ) | 1374 | if ( *it == "Company Phone" ) |
1362 | *itV = ent.companyPhone(); | 1375 | *itV = ent.companyPhone(); |
1363 | */ | 1376 | */ |
1364 | if ( *it == "Default Email" ) | 1377 | if ( *it == "Default Email" ) |
1365 | *itV = ent.defaultEmail(); | 1378 | *itV = ent.defaultEmail(); |
1366 | 1379 | ||
1367 | if ( *it == "Emails" ) | 1380 | if ( *it == "Emails" ) |
1368 | *itV = ent.emailList().join(", "); // :SX | 1381 | *itV = ent.emailList().join(", "); // :SX |
1369 | 1382 | ||
1370 | if ( *it == "Home Phone" ) | 1383 | if ( *it == "Home Phone" ) |
1371 | *itV = ent.homePhone(); | 1384 | *itV = ent.homePhone(); |
1372 | /* | 1385 | /* |
1373 | if ( *it == "Home 2 Phone" ) | 1386 | if ( *it == "Home 2 Phone" ) |
1374 | *itV = ent.home2Phone(); | 1387 | *itV = ent.home2Phone(); |
1375 | */ | 1388 | */ |
1376 | if ( *it == "Home Fax" ) | 1389 | if ( *it == "Home Fax" ) |
1377 | *itV = ent.homeFax(); | 1390 | *itV = ent.homeFax(); |
1378 | 1391 | ||
1379 | if ( *it == "Home Mobile" ) | 1392 | if ( *it == "Home Mobile" ) |
1380 | *itV = ent.homeMobile(); | 1393 | *itV = ent.homeMobile(); |
1381 | /* | 1394 | /* |
1382 | if ( *it == "Car Phone" ) | 1395 | if ( *it == "Car Phone" ) |
1383 | *itV = ent.carPhone(); | 1396 | *itV = ent.carPhone(); |
1384 | 1397 | ||
1385 | if ( *it == "ISDN Phone" ) | 1398 | if ( *it == "ISDN Phone" ) |
1386 | *itV = ent.ISDNPhone(); | 1399 | *itV = ent.ISDNPhone(); |
1387 | 1400 | ||
1388 | if ( *it == "Other Phone" ) | 1401 | if ( *it == "Other Phone" ) |
1389 | *itV = ent.otherPhone(); | 1402 | *itV = ent.otherPhone(); |
1390 | */ | 1403 | */ |
1391 | if ( ( *it == "Business Pager" ) || ( *it == "Work Pager" ) ) | 1404 | if ( ( *it == "Business Pager" ) || ( *it == "Work Pager" ) ) |
1392 | *itV = ent.businessPager(); | 1405 | *itV = ent.businessPager(); |
1393 | /* | 1406 | /* |
1394 | if ( *it == "Home Pager") | 1407 | if ( *it == "Home Pager") |
1395 | *itV = ent.homePager(); | 1408 | *itV = ent.homePager(); |
1396 | 1409 | ||
1397 | if ( *it == "AIM IM" ) | 1410 | if ( *it == "AIM IM" ) |
1398 | *itV = ent.AIMIM(); | 1411 | *itV = ent.AIMIM(); |
1399 | 1412 | ||
1400 | if ( *it == "ICQ IM" ) | 1413 | if ( *it == "ICQ IM" ) |
1401 | *itV = ent.ICQIM(); | 1414 | *itV = ent.ICQIM(); |
1402 | 1415 | ||
1403 | if ( *it == "Jabber IM" ) | 1416 | if ( *it == "Jabber IM" ) |
1404 | *itV = ent.jabberIM(); | 1417 | *itV = ent.jabberIM(); |
1405 | 1418 | ||
1406 | if ( *it == "MSN IM" ) | 1419 | if ( *it == "MSN IM" ) |
1407 | *itV = ent.MSNIM(); | 1420 | *itV = ent.MSNIM(); |
1408 | 1421 | ||
1409 | if ( *it == "Yahoo IM" ) | 1422 | if ( *it == "Yahoo IM" ) |
1410 | *itV = ent.yahooIM(); | 1423 | *itV = ent.yahooIM(); |
1411 | */ | 1424 | */ |
1412 | if ( *it == "Home Web Page" ) | 1425 | if ( *it == "Home Web Page" ) |
1413 | *itV = ent.homeWebpage(); | 1426 | *itV = ent.homeWebpage(); |
1414 | 1427 | ||
1415 | if ( ( *it == "Business WebPage" ) || ( *it == "Work Web Page" ) ) | 1428 | if ( ( *it == "Business WebPage" ) || ( *it == "Work Web Page" ) ) |
1416 | *itV = ent.businessWebpage(); | 1429 | *itV = ent.businessWebpage(); |
1417 | 1430 | ||
1418 | 1431 | ||
1419 | } | 1432 | } |
1420 | 1433 | ||
1421 | 1434 | ||
1422 | cmbCat->setCategories( ent.categories(), "Contacts", tr("Contacts") ); | 1435 | cmbCat->setCategories( ent.categories(), "Contacts", tr("Contacts") ); |
1423 | 1436 | ||
1424 | QString gender = ent.gender(); | 1437 | QString gender = ent.gender(); |
1425 | cmbGender->setCurrentItem( gender.toInt() ); | 1438 | cmbGender->setCurrentItem( gender.toInt() ); |
1426 | 1439 | ||
1427 | txtNote->setText( ent.notes() ); | 1440 | txtNote->setText( ent.notes() ); |
1428 | 1441 | ||
1429 | slotAddressTypeChange( cmbAddress->currentItem() ); | 1442 | slotAddressTypeChange( cmbAddress->currentItem() ); |
1430 | 1443 | ||
1431 | // Get combo-settings from contact and set preset.. | 1444 | // Get combo-settings from contact and set preset.. |
1432 | contactfields.loadFromRecord( ent ); | 1445 | contactfields.loadFromRecord( ent ); |
1433 | cmbChooserField1->setCurrentItem( contactfields.getFieldOrder(0, 7) ); | 1446 | cmbChooserField1->setCurrentItem( contactfields.getFieldOrder(0, 7) ); |
1434 | cmbChooserField2->setCurrentItem( contactfields.getFieldOrder(1, 9) ); | 1447 | cmbChooserField2->setCurrentItem( contactfields.getFieldOrder(1, 9) ); |
1435 | cmbChooserField3->setCurrentItem( contactfields.getFieldOrder(2, 0) ); | 1448 | cmbChooserField3->setCurrentItem( contactfields.getFieldOrder(2, 0) ); |
1436 | cmbChooserField4->setCurrentItem( contactfields.getFieldOrder(3, 6) ); | 1449 | cmbChooserField4->setCurrentItem( contactfields.getFieldOrder(3, 6) ); |
1437 | cmbAddress->setCurrentItem( contactfields.getFieldOrder(4, 1) ); | 1450 | cmbAddress->setCurrentItem( contactfields.getFieldOrder(4, 1) ); |
1438 | slotCmbChooser1Change( cmbChooserField1->currentItem() ); | 1451 | slotCmbChooser1Change( cmbChooserField1->currentItem() ); |
1439 | slotCmbChooser2Change( cmbChooserField2->currentItem() ); | 1452 | slotCmbChooser2Change( cmbChooserField2->currentItem() ); |
1440 | slotCmbChooser3Change( cmbChooserField3->currentItem() ); | 1453 | slotCmbChooser3Change( cmbChooserField3->currentItem() ); |
1441 | slotCmbChooser4Change( cmbChooserField4->currentItem() ); | 1454 | slotCmbChooser4Change( cmbChooserField4->currentItem() ); |
1442 | slotAddressTypeChange( cmbAddress->currentItem() ); | 1455 | slotAddressTypeChange( cmbAddress->currentItem() ); |
1443 | 1456 | ||
1444 | updateDatePicker(); | 1457 | updateDatePicker(); |
1445 | 1458 | ||
1446 | initializing = false; | 1459 | initializing = false; |
1447 | } | 1460 | } |
1448 | void ContactEditor::updateDatePicker() | 1461 | void ContactEditor::updateDatePicker() |
1449 | { | 1462 | { |
1450 | // Set DatePicker | 1463 | // Set DatePicker |
1451 | if ( !ent.birthday().isNull() ){ | 1464 | if ( !ent.birthday().isNull() ){ |
1452 | birthdayButton->setText( TimeString::numberDateString( ent.birthday() ) ); | 1465 | birthdayButton->setText( TimeString::numberDateString( ent.birthday() ) ); |
1453 | birthdayPicker->setDate( ent.birthday() ); | 1466 | birthdayPicker->setDate( ent.birthday() ); |
1454 | } else | 1467 | } else |
1455 | birthdayButton->setText( tr ("Unknown") ); | 1468 | birthdayButton->setText( tr ("Unknown") ); |
1456 | 1469 | ||
1457 | if ( !ent.anniversary().isNull() ){ | 1470 | if ( !ent.anniversary().isNull() ){ |
1458 | anniversaryButton->setText( TimeString::numberDateString( ent.anniversary() ) ); | 1471 | anniversaryButton->setText( TimeString::numberDateString( ent.anniversary() ) ); |
1459 | anniversaryPicker->setDate( ent.anniversary() ); | 1472 | anniversaryPicker->setDate( ent.anniversary() ); |
1460 | } else | 1473 | } else |
1461 | anniversaryButton->setText( tr ("Unknown") ); | 1474 | anniversaryButton->setText( tr ("Unknown") ); |
1462 | 1475 | ||
1463 | } | 1476 | } |
1464 | 1477 | ||
1465 | void ContactEditor::saveEntry() { | 1478 | void ContactEditor::saveEntry() { |
1466 | 1479 | ||
1467 | // Store current combo into contact | 1480 | // Store current combo into contact |
1468 | contactfields.saveToRecord( ent ); | 1481 | contactfields.saveToRecord( ent ); |
1469 | 1482 | ||
1470 | txtFirstName->setText( parseName( txtFullName->text(), NAME_F ) ); | 1483 | txtFirstName->setText( parseName( txtFullName->text(), NAME_F ) ); |
1471 | txtMiddleName->setText( parseName( txtFullName->text(), NAME_M ) ); | 1484 | txtMiddleName->setText( parseName( txtFullName->text(), NAME_M ) ); |
1472 | txtLastName->setText( parseName( txtFullName->text(), NAME_L ) ); | 1485 | txtLastName->setText( parseName( txtFullName->text(), NAME_L ) ); |
1473 | // txtSuffix->setText( parseName( txtFullName->text(), NAME_S ) ); | 1486 | // txtSuffix->setText( parseName( txtFullName->text(), NAME_S ) ); |
1474 | 1487 | ||
1475 | ent.setFirstName( txtFirstName->text() ); | 1488 | ent.setFirstName( txtFirstName->text() ); |
1476 | ent.setLastName( txtLastName->text() ); | 1489 | ent.setLastName( txtLastName->text() ); |
1477 | ent.setMiddleName( txtMiddleName->text() ); | 1490 | ent.setMiddleName( txtMiddleName->text() ); |
1478 | ent.setSuffix( txtSuffix->text() ); | 1491 | ent.setSuffix( txtSuffix->text() ); |
1479 | 1492 | ||
1480 | ent.setFileAs( cmbFileAs->currentText() ); | 1493 | ent.setFileAs( cmbFileAs->currentText() ); |
1481 | 1494 | ||
1482 | ent.setCategories( cmbCat->currentCategories() ); | 1495 | ent.setCategories( cmbCat->currentCategories() ); |
1483 | 1496 | ||
1484 | 1497 | ||
1485 | //if (hasTitle) | 1498 | //if (hasTitle) |
1486 | ent.setJobTitle( txtJobTitle->text() ); | 1499 | ent.setJobTitle( txtJobTitle->text() ); |
1487 | 1500 | ||
1488 | //if (hasCompany) | 1501 | //if (hasCompany) |
1489 | ent.setCompany( txtOrganization->text() ); | 1502 | ent.setCompany( txtOrganization->text() ); |
1490 | 1503 | ||
1491 | //if (hasNotes) | 1504 | //if (hasNotes) |
1492 | ent.setNotes( txtNote->text() ); | 1505 | ent.setNotes( txtNote->text() ); |
1493 | 1506 | ||
1494 | //if (hasStreet) { | 1507 | //if (hasStreet) { |
1495 | ent.setHomeStreet( slHomeAddress[0] ); | 1508 | ent.setHomeStreet( slHomeAddress[0] ); |
1496 | ent.setBusinessStreet( slBusinessAddress[0] ); | 1509 | ent.setBusinessStreet( slBusinessAddress[0] ); |
1497 | //} | 1510 | //} |
1498 | 1511 | ||
1499 | //if (hasCity) { | 1512 | //if (hasCity) { |
1500 | ent.setHomeCity( slHomeAddress[3] ); | 1513 | ent.setHomeCity( slHomeAddress[3] ); |
1501 | ent.setBusinessCity( slBusinessAddress[3] ); | 1514 | ent.setBusinessCity( slBusinessAddress[3] ); |
1502 | //} | 1515 | //} |
1503 | 1516 | ||
1504 | //if (hasState) { | 1517 | //if (hasState) { |
1505 | ent.setHomeState( slHomeAddress[4] ); | 1518 | ent.setHomeState( slHomeAddress[4] ); |
1506 | ent.setBusinessState( slBusinessAddress[4] ); | 1519 | ent.setBusinessState( slBusinessAddress[4] ); |
1507 | //} | 1520 | //} |
1508 | 1521 | ||
1509 | //if (hasZip) { | 1522 | //if (hasZip) { |
1510 | ent.setHomeZip( slHomeAddress[5] ); | 1523 | ent.setHomeZip( slHomeAddress[5] ); |
1511 | ent.setBusinessZip( slBusinessAddress[5] ); | 1524 | ent.setBusinessZip( slBusinessAddress[5] ); |
1512 | //} | 1525 | //} |
1513 | 1526 | ||
1514 | //if (hasCountry) { | 1527 | //if (hasCountry) { |
1515 | ent.setHomeCountry( slHomeAddress[6] ); | 1528 | ent.setHomeCountry( slHomeAddress[6] ); |
1516 | ent.setBusinessCountry( slBusinessAddress[6] ); | 1529 | ent.setBusinessCountry( slBusinessAddress[6] ); |
1517 | //} | 1530 | //} |
1518 | 1531 | ||
1519 | QStringList::ConstIterator it; | 1532 | QStringList::ConstIterator it; |
1520 | QListIterator<QLineEdit> itLE( listValue ); | 1533 | QListIterator<QLineEdit> itLE( listValue ); |
1521 | for ( it = slDynamicEntries.begin(); itLE.current() && it != slDynamicEntries.end(); ++it, ++itLE) { | 1534 | for ( it = slDynamicEntries.begin(); itLE.current() && it != slDynamicEntries.end(); ++it, ++itLE) { |
1522 | 1535 | ||
1523 | if ( *it == "Department" ) | 1536 | if ( *it == "Department" ) |
1524 | ent.setDepartment( (*itLE)->text() ); | 1537 | ent.setDepartment( (*itLE)->text() ); |
1525 | 1538 | ||
1526 | if ( *it == "Company" ) | 1539 | if ( *it == "Company" ) |
1527 | ent.setCompany( (*itLE)->text() ); | 1540 | ent.setCompany( (*itLE)->text() ); |
1528 | 1541 | ||
1529 | if ( *it == "Office" ) | 1542 | if ( *it == "Office" ) |
1530 | ent.setOffice( (*itLE)->text() ); | 1543 | ent.setOffice( (*itLE)->text() ); |
1531 | 1544 | ||
1532 | if ( *it == "Profession" ) | 1545 | if ( *it == "Profession" ) |
1533 | ent.setProfession( (*itLE)->text() ); | 1546 | ent.setProfession( (*itLE)->text() ); |
1534 | 1547 | ||
1535 | if ( *it == "Assistant" ) | 1548 | if ( *it == "Assistant" ) |
1536 | ent.setAssistant( (*itLE)->text() ); | 1549 | ent.setAssistant( (*itLE)->text() ); |
1537 | 1550 | ||
1538 | if ( *it == "Manager" ) | 1551 | if ( *it == "Manager" ) |
1539 | ent.setManager( (*itLE)->text() ); | 1552 | ent.setManager( (*itLE)->text() ); |
1540 | 1553 | ||
1541 | if ( *it == "Spouse" ) | 1554 | if ( *it == "Spouse" ) |
1542 | ent.setSpouse( (*itLE)->text() ); | 1555 | ent.setSpouse( (*itLE)->text() ); |
1543 | 1556 | ||
1544 | if ( *it == "Nickname" ) | 1557 | if ( *it == "Nickname" ) |
1545 | ent.setNickname( (*itLE)->text() ); | 1558 | ent.setNickname( (*itLE)->text() ); |
1546 | 1559 | ||
1547 | if ( *it == "Children" ) | 1560 | if ( *it == "Children" ) |
1548 | ent.setChildren( (*itLE)->text() ); | 1561 | ent.setChildren( (*itLE)->text() ); |
1549 | 1562 | ||
1550 | } | 1563 | } |
1551 | 1564 | ||
1552 | 1565 | ||
1553 | QStringList::ConstIterator itV; | 1566 | QStringList::ConstIterator itV; |
1554 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { | 1567 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { |
1555 | 1568 | ||
1556 | if ( ( *it == "Business Phone" ) || ( *it == "Work Phone" ) ) | 1569 | if ( ( *it == "Business Phone" ) || ( *it == "Work Phone" ) ) |
1557 | ent.setBusinessPhone( *itV ); | 1570 | ent.setBusinessPhone( *itV ); |
1558 | 1571 | ||
1559 | if ( ( *it == "Business Fax" ) || ( *it == "Work Fax" ) ) | 1572 | if ( ( *it == "Business Fax" ) || ( *it == "Work Fax" ) ) |
1560 | ent.setBusinessFax( *itV ); | 1573 | ent.setBusinessFax( *itV ); |
1561 | 1574 | ||
1562 | if ( ( *it == "Business Mobile" ) || ( *it == "Work Mobile" ) ) | 1575 | if ( ( *it == "Business Mobile" ) || ( *it == "Work Mobile" ) ) |
1563 | ent.setBusinessMobile( *itV ); | 1576 | ent.setBusinessMobile( *itV ); |
1564 | 1577 | ||
1565 | if ( *it == "Emails" ){ | 1578 | if ( *it == "Emails" ){ |
1566 | QString allemail; | 1579 | QString allemail; |
1567 | QString defaultmail; | 1580 | QString defaultmail; |
1568 | parseEmailFrom( emails.join(","), defaultmail, allemail ); | 1581 | parseEmailFrom( emails.join(","), defaultmail, allemail ); |
1569 | if ( defaultEmail.isEmpty() ){ | 1582 | if ( defaultEmail.isEmpty() ){ |
1570 | qWarning("Default email was not set by user!"); | 1583 | qWarning("Default email was not set by user!"); |
1571 | qWarning("Using first email in list: %s", defaultmail.latin1()); | 1584 | qWarning("Using first email in list: %s", defaultmail.latin1()); |
1572 | ent.setDefaultEmail( defaultmail ); | 1585 | ent.setDefaultEmail( defaultmail ); |
1573 | } | 1586 | } |
1574 | ent.setEmails( allemail ); | 1587 | ent.setEmails( allemail ); |
1575 | } | 1588 | } |
1576 | 1589 | ||
1577 | if ( *it == "Default Email") | 1590 | if ( *it == "Default Email") |
1578 | ent.setDefaultEmail( defaultEmail /* *itV */ ); | 1591 | ent.setDefaultEmail( defaultEmail /* *itV */ ); |
1579 | 1592 | ||
1580 | if ( *it == "Home Phone" ) | 1593 | if ( *it == "Home Phone" ) |
1581 | ent.setHomePhone( *itV ); | 1594 | ent.setHomePhone( *itV ); |
1582 | 1595 | ||
1583 | if ( *it == "Home Fax" ) | 1596 | if ( *it == "Home Fax" ) |
1584 | ent.setHomeFax( *itV ); | 1597 | ent.setHomeFax( *itV ); |
1585 | 1598 | ||
1586 | if ( *it == "Home Mobile" ) | 1599 | if ( *it == "Home Mobile" ) |
1587 | ent.setHomeMobile( *itV ); | 1600 | ent.setHomeMobile( *itV ); |
1588 | 1601 | ||
1589 | if ( ( *it == "Business Pager" ) || ( *it == "Work Pager" ) ) | 1602 | if ( ( *it == "Business Pager" ) || ( *it == "Work Pager" ) ) |
1590 | ent.setBusinessPager( *itV ); | 1603 | ent.setBusinessPager( *itV ); |
1591 | 1604 | ||
1592 | if ( *it == "Home Web Page" ) | 1605 | if ( *it == "Home Web Page" ) |
1593 | ent.setHomeWebpage( *itV ); | 1606 | ent.setHomeWebpage( *itV ); |
1594 | 1607 | ||
1595 | if ( ( *it == "Business WebPage" ) || ( *it == "Work Web Page" ) ) | 1608 | if ( ( *it == "Business WebPage" ) || ( *it == "Work Web Page" ) ) |
1596 | ent.setBusinessWebpage( *itV ); | 1609 | ent.setBusinessWebpage( *itV ); |
1597 | 1610 | ||
1598 | 1611 | ||
1599 | } | 1612 | } |
1600 | 1613 | ||
1601 | int gender = cmbGender->currentItem(); | 1614 | int gender = cmbGender->currentItem(); |
1602 | ent.setGender( QString::number( gender ) ); | 1615 | ent.setGender( QString::number( gender ) ); |
1603 | 1616 | ||
1604 | QString str = txtNote->text(); | 1617 | QString str = txtNote->text(); |
1605 | if ( !str.isNull() ) | 1618 | if ( !str.isNull() ) |
1606 | ent.setNotes( str ); | 1619 | ent.setNotes( str ); |
1607 | 1620 | ||
1608 | } | 1621 | } |
1609 | 1622 | ||
1610 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, | 1623 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, |
1611 | QString &strAll ) | 1624 | QString &strAll ) |
1612 | { | 1625 | { |
1613 | int where, | 1626 | int where, |
1614 | start; | 1627 | start; |
1615 | if ( txt.isEmpty() ) | 1628 | if ( txt.isEmpty() ) |
1616 | return; | 1629 | return; |
1617 | // find the first | 1630 | // find the first |
1618 | where = txt.find( ',' ); | 1631 | where = txt.find( ',' ); |
1619 | if ( where < 0 ) { | 1632 | if ( where < 0 ) { |
1620 | strDefaultEmail = txt; | 1633 | strDefaultEmail = txt; |
1621 | strAll = txt; | 1634 | strAll = txt; |
1622 | } else { | 1635 | } else { |
1623 | strDefaultEmail = txt.left( where ).stripWhiteSpace(); | 1636 | strDefaultEmail = txt.left( where ).stripWhiteSpace(); |
1624 | strAll = strDefaultEmail; | 1637 | strAll = strDefaultEmail; |
1625 | while ( where > -1 ) { | 1638 | while ( where > -1 ) { |
1626 | strAll.append(" "); | 1639 | strAll.append(" "); |
1627 | start = where; | 1640 | start = where; |
1628 | where = txt.find( ',', where + 1 ); | 1641 | where = txt.find( ',', where + 1 ); |
1629 | if ( where > - 1 ) | 1642 | if ( where > - 1 ) |
1630 | strAll.append( txt.mid(start + 1, where - start - 1).stripWhiteSpace() ); | 1643 | strAll.append( txt.mid(start + 1, where - start - 1).stripWhiteSpace() ); |
1631 | else // grab until the end... | 1644 | else // grab until the end... |
1632 | strAll.append( txt.right(txt.length() - start - 1).stripWhiteSpace() ); | 1645 | strAll.append( txt.right(txt.length() - start - 1).stripWhiteSpace() ); |
1633 | } | 1646 | } |
1634 | } | 1647 | } |
1635 | } | 1648 | } |
1636 | 1649 | ||
1637 | void parseEmailTo( const QString &strDefaultEmail, | 1650 | void parseEmailTo( const QString &strDefaultEmail, |
1638 | const QString &strOtherEmail, QString &strBack ) | 1651 | const QString &strOtherEmail, QString &strBack ) |
1639 | { | 1652 | { |
1640 | // create a comma dilimeted set of emails... | 1653 | // create a comma dilimeted set of emails... |
1641 | // use the power of short circuiting... | 1654 | // use the power of short circuiting... |
1642 | bool foundDefault = false; | 1655 | bool foundDefault = false; |
1643 | QString strTmp; | 1656 | QString strTmp; |
1644 | int start = 0; | 1657 | int start = 0; |
1645 | int where; | 1658 | int where; |
1646 | // start at the beginng. | 1659 | // start at the beginng. |
1647 | strBack = strDefaultEmail; | 1660 | strBack = strDefaultEmail; |
1648 | where = 0; | 1661 | where = 0; |
1649 | while ( where > -1 ) { | 1662 | while ( where > -1 ) { |
1650 | start = where; | 1663 | start = where; |
1651 | where = strOtherEmail.find( ' ', where + 1 ); | 1664 | where = strOtherEmail.find( ' ', where + 1 ); |
1652 | if ( where > 0 ) { | 1665 | if ( where > 0 ) { |
1653 | strTmp = strOtherEmail.mid( start, where - start ).stripWhiteSpace(); | 1666 | strTmp = strOtherEmail.mid( start, where - start ).stripWhiteSpace(); |
1654 | } else | 1667 | } else |
1655 | strTmp = strOtherEmail.right( strOtherEmail.length() - start ).stripWhiteSpace(); | 1668 | strTmp = strOtherEmail.right( strOtherEmail.length() - start ).stripWhiteSpace(); |
1656 | if ( foundDefault || strTmp != strDefaultEmail ) { | 1669 | if ( foundDefault || strTmp != strDefaultEmail ) { |
1657 | strBack.append( ", " ); | 1670 | strBack.append( ", " ); |
1658 | strBack.append( strTmp ); | 1671 | strBack.append( strTmp ); |
1659 | } else | 1672 | } else |
1660 | foundDefault = true; | 1673 | foundDefault = true; |
1661 | } | 1674 | } |
1662 | } | 1675 | } |
1663 | 1676 | ||
1664 | 1677 | ||
1665 | static inline bool containsAlphaNum( const QString &str ) | 1678 | static inline bool containsAlphaNum( const QString &str ) |
1666 | { | 1679 | { |
1667 | int i, | 1680 | int i, |
1668 | count = str.length(); | 1681 | count = str.length(); |
1669 | for ( i = 0; i < count; i++ ) | 1682 | for ( i = 0; i < count; i++ ) |
1670 | if ( !str[i].isSpace() ) | 1683 | if ( !str[i].isSpace() ) |
1671 | return TRUE; | 1684 | return TRUE; |
1672 | return FALSE; | 1685 | return FALSE; |
1673 | } | 1686 | } |
1674 | 1687 | ||
1675 | static inline bool constainsWhiteSpace( const QString &str ) | 1688 | static inline bool constainsWhiteSpace( const QString &str ) |
1676 | { | 1689 | { |
1677 | int i, | 1690 | int i, |
1678 | count = str.length(); | 1691 | count = str.length(); |
1679 | for (i = 0; i < count; i++ ) | 1692 | for (i = 0; i < count; i++ ) |
1680 | if ( str[i].isSpace() ) | 1693 | if ( str[i].isSpace() ) |
1681 | return TRUE; | 1694 | return TRUE; |
1682 | return FALSE; | 1695 | return FALSE; |
1683 | } | 1696 | } |
1684 | 1697 | ||
1685 | void ContactEditor::setPersonalView( bool personal ) | 1698 | void ContactEditor::setPersonalView( bool personal ) |
1686 | { | 1699 | { |
1687 | m_personalView = personal; | 1700 | m_personalView = personal; |
1688 | 1701 | ||
1689 | // Currently disbled due to the fact that | 1702 | // Currently disbled due to the fact that |
1690 | // show will not work... | 1703 | // show will not work... |
1691 | return; | 1704 | return; |
1692 | 1705 | ||
1693 | if ( personal ){ | 1706 | if ( personal ){ |
1694 | cmbCat->hide(); | 1707 | cmbCat->hide(); |
1695 | labCat->hide(); | 1708 | labCat->hide(); |
1696 | 1709 | ||
1697 | } else{ | 1710 | } else{ |
1698 | cmbCat->show(); | 1711 | cmbCat->show(); |
1699 | labCat->show(); | 1712 | labCat->show(); |
1700 | } | 1713 | } |
1701 | } | 1714 | } |
1702 | 1715 | ||
1703 | void ContactEditor::slotAnniversaryDateChanged( int year, int month, int day) | 1716 | void ContactEditor::slotAnniversaryDateChanged( int year, int month, int day) |
1704 | { | 1717 | { |
1705 | QDate date; | 1718 | QDate date; |
1706 | date.setYMD( year, month, day ); | 1719 | date.setYMD( year, month, day ); |
1707 | QString dateString = TimeString::numberDateString( date ); | 1720 | QString dateString = TimeString::numberDateString( date ); |
1708 | anniversaryButton->setText( dateString ); | 1721 | anniversaryButton->setText( dateString ); |
1709 | ent.setAnniversary ( date ); | 1722 | ent.setAnniversary ( date ); |
1710 | } | 1723 | } |
1711 | 1724 | ||
1712 | void ContactEditor::slotBirthdayDateChanged( int year, int month, int day) | 1725 | void ContactEditor::slotBirthdayDateChanged( int year, int month, int day) |
1713 | { | 1726 | { |
1714 | QDate date; | 1727 | QDate date; |
1715 | date.setYMD( year, month, day ); | 1728 | date.setYMD( year, month, day ); |
1716 | QString dateString = TimeString::numberDateString( date ); | 1729 | QString dateString = TimeString::numberDateString( date ); |
1717 | birthdayButton->setText( dateString ); | 1730 | birthdayButton->setText( dateString ); |
1718 | ent.setBirthday ( date ); | 1731 | ent.setBirthday ( date ); |
1719 | } | 1732 | } |
1720 | 1733 | ||
1721 | void ContactEditor::slotRemoveBirthday() | 1734 | void ContactEditor::slotRemoveBirthday() |
1722 | { | 1735 | { |
1723 | qWarning("void ContactEditor::slotRemoveBirthday()"); | 1736 | qWarning("void ContactEditor::slotRemoveBirthday()"); |
1724 | ent.setBirthday( QDate() ); | 1737 | ent.setBirthday( QDate() ); |
1725 | updateDatePicker(); | 1738 | updateDatePicker(); |
1726 | } | 1739 | } |
1727 | 1740 | ||
1728 | void ContactEditor::slotRemoveAnniversary() | 1741 | void ContactEditor::slotRemoveAnniversary() |
1729 | { | 1742 | { |
1730 | qWarning("void ContactEditor::slotRemoveAnniversary()"); | 1743 | qWarning("void ContactEditor::slotRemoveAnniversary()"); |
1731 | ent.setAnniversary( QDate() ); | 1744 | ent.setAnniversary( QDate() ); |
1732 | updateDatePicker(); | 1745 | updateDatePicker(); |
1733 | } | 1746 | } |