author | eilers <eilers> | 2002-10-14 09:26:18 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-10-14 09:26:18 (UTC) |
commit | 0bccef01b70fec98e744fab286f5ea443287cdad (patch) (unidiff) | |
tree | 3a602e633dcbe81eca22f490402d39467c4eb32a | |
parent | 59d6018e53537e15d27cd0174adefba2ec8b8f6e (diff) | |
download | opie-0bccef01b70fec98e744fab286f5ea443287cdad.zip opie-0bccef01b70fec98e744fab286f5ea443287cdad.tar.gz opie-0bccef01b70fec98e744fab286f5ea443287cdad.tar.bz2 |
Last patch for language bug. I am not really happy with it, but it should work now.
Please use the current release of libopie with this application. Otherwise the
app will fail !
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 3 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 88 |
2 files changed, 53 insertions, 38 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 472b13e..2eb9ddf 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp | |||
@@ -1,82 +1,82 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qt Palmtop Environment. | 4 | ** This file is part of Qt Palmtop Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 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 | 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 | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 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. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** OContact info@trolltech.com if any conditions of this licensing are | 16 | ** OContact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #define QTOPIA_INTERNAL_FD | 21 | #define QTOPIA_INTERNAL_FD |
22 | 22 | ||
23 | #include "contacteditor.h" | 23 | #include "contacteditor.h" |
24 | #include "ablabel.h" | 24 | #include "ablabel.h" |
25 | #include "abtable.h" | 25 | #include "abtable.h" |
26 | #include "addresssettings.h" | 26 | #include "addresssettings.h" |
27 | #include "addressbook.h" | 27 | #include "addressbook.h" |
28 | 28 | ||
29 | 29 | ||
30 | #include <opie/ofileselector.h> | 30 | #include <opie/ofileselector.h> |
31 | #include <opie/ofiledialog.h> | 31 | #include <opie/ofiledialog.h> |
32 | #include <qpe/qpeapplication.h> | 32 | #include <qpe/qpeapplication.h> |
33 | #include <qpe/config.h> | 33 | #include <qpe/config.h> |
34 | #include <qpe/contact.h> | 34 | #include <opie/ocontact.h> |
35 | 35 | ||
36 | #ifndef MAKE_FOR_SHARP_ROM | 36 | #ifndef MAKE_FOR_SHARP_ROM |
37 | #include <qpe/finddialog.h> | 37 | #include <qpe/finddialog.h> |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | #include <qpe/global.h> | 40 | #include <qpe/global.h> |
41 | #include <qpe/resource.h> | 41 | #include <qpe/resource.h> |
42 | #include <qpe/ir.h> | 42 | #include <qpe/ir.h> |
43 | #include <qpe/qpemessagebox.h> | 43 | #include <qpe/qpemessagebox.h> |
44 | #include <qpe/qcopenvelope_qws.h> | 44 | #include <qpe/qcopenvelope_qws.h> |
45 | 45 | ||
46 | #include <qaction.h> | 46 | #include <qaction.h> |
47 | #include <qdialog.h> | 47 | #include <qdialog.h> |
48 | #include <qdir.h> | 48 | #include <qdir.h> |
49 | #include <qfile.h> | 49 | #include <qfile.h> |
50 | #include <qimage.h> | 50 | #include <qimage.h> |
51 | #include <qlayout.h> | 51 | #include <qlayout.h> |
52 | #include <qpe/qpemenubar.h> | 52 | #include <qpe/qpemenubar.h> |
53 | #include <qmessagebox.h> | 53 | #include <qmessagebox.h> |
54 | #include <qpixmap.h> | 54 | #include <qpixmap.h> |
55 | #include <qpopupmenu.h> | 55 | #include <qpopupmenu.h> |
56 | #include <qpe/qpetoolbar.h> | 56 | #include <qpe/qpetoolbar.h> |
57 | #include <qstringlist.h> | 57 | #include <qstringlist.h> |
58 | #include <qtoolbutton.h> | 58 | #include <qtoolbutton.h> |
59 | #include <qwhatsthis.h> | 59 | #include <qwhatsthis.h> |
60 | 60 | ||
61 | #include <stdlib.h> | 61 | #include <stdlib.h> |
62 | #include <sys/stat.h> | 62 | #include <sys/stat.h> |
63 | #include <sys/types.h> | 63 | #include <sys/types.h> |
64 | #include <fcntl.h> | 64 | #include <fcntl.h> |
65 | #include <unistd.h> | 65 | #include <unistd.h> |
66 | 66 | ||
67 | #include <qdatetime.h> | 67 | #include <qdatetime.h> |
68 | 68 | ||
69 | #include "picker.h" | 69 | #include "picker.h" |
70 | static QString addressbookOldXMLFilename() | 70 | static QString addressbookOldXMLFilename() |
71 | { | 71 | { |
72 | QString filename = QPEApplication::documentDir() + "addressbook.xml"; | 72 | QString filename = QPEApplication::documentDir() + "addressbook.xml"; |
73 | return filename; | 73 | return filename; |
74 | } | 74 | } |
75 | 75 | ||
76 | static QString addressbookXMLFilename() | 76 | static QString addressbookXMLFilename() |
77 | { | 77 | { |
78 | QString filename = Global::applicationFileName("addressbook", | 78 | QString filename = Global::applicationFileName("addressbook", |
79 | "addressbook.xml"); | 79 | "addressbook.xml"); |
80 | return filename; | 80 | return filename; |
81 | } | 81 | } |
82 | 82 | ||
@@ -812,96 +812,97 @@ void AddressbookWindow::initFields() | |||
812 | // Call the contact functions that correspond to these old functions... | 812 | // Call the contact functions that correspond to these old functions... |
813 | 813 | ||
814 | QStringList xmlFields = OContact::fields(); | 814 | QStringList xmlFields = OContact::fields(); |
815 | QStringList visibleFields = OContact::untrfields(); | 815 | QStringList visibleFields = OContact::untrfields(); |
816 | // QStringList trFields = OContact::trfields(); | 816 | // QStringList trFields = OContact::trfields(); |
817 | 817 | ||
818 | xmlFields.remove( "Title" ); | 818 | xmlFields.remove( "Title" ); |
819 | visibleFields.remove( "Name Title" ); | 819 | visibleFields.remove( "Name Title" ); |
820 | visibleFields.remove( "Notes" ); | 820 | visibleFields.remove( "Notes" ); |
821 | 821 | ||
822 | int i, version; | 822 | int i, version; |
823 | Config cfg( "AddressBook" ); | 823 | Config cfg( "AddressBook" ); |
824 | QString zn; | 824 | QString zn; |
825 | 825 | ||
826 | // ### Write a function to keep this from happening again... | 826 | // ### Write a function to keep this from happening again... |
827 | QStringList::ConstIterator it; | 827 | QStringList::ConstIterator it; |
828 | for ( i = 0, it = xmlFields.begin(); it != xmlFields.end(); ++it, i++ ) { | 828 | for ( i = 0, it = xmlFields.begin(); it != xmlFields.end(); ++it, i++ ) { |
829 | allFields.append( i + 3 ); | 829 | allFields.append( i + 3 ); |
830 | } | 830 | } |
831 | 831 | ||
832 | cfg.setGroup( "Version" ); | 832 | cfg.setGroup( "Version" ); |
833 | version = cfg.readNumEntry( "version" ); | 833 | version = cfg.readNumEntry( "version" ); |
834 | i = 0; | 834 | i = 0; |
835 | startFontSize = 1; | 835 | startFontSize = 1; |
836 | 836 | ||
837 | if ( version >= ADDRESSVERSION ) { | 837 | if ( version >= ADDRESSVERSION ) { |
838 | 838 | ||
839 | cfg.setGroup( "ImportantCategory" ); | 839 | cfg.setGroup( "ImportantCategory" ); |
840 | 840 | ||
841 | zn = cfg.readEntry( "Category" + QString::number(i), QString::null ); | 841 | zn = cfg.readEntry( "Category" + QString::number(i), QString::null ); |
842 | while ( !zn.isNull() ) { | 842 | while ( !zn.isNull() ) { |
843 | if ( zn.contains( "Work" ) || zn.contains( "Mb" ) ) { | 843 | if ( zn.contains( "Work" ) || zn.contains( "Mb" ) ) { |
844 | slOrderedFields.clear(); | 844 | slOrderedFields.clear(); |
845 | break; | 845 | break; |
846 | } | 846 | } |
847 | slOrderedFields.append( zn ); | 847 | slOrderedFields.append( zn ); |
848 | zn = cfg.readEntry( "Category" + QString::number(++i), QString::null ); | 848 | zn = cfg.readEntry( "Category" + QString::number(++i), QString::null ); |
849 | } | 849 | } |
850 | cfg.setGroup( "Font" ); | 850 | cfg.setGroup( "Font" ); |
851 | startFontSize = cfg.readNumEntry( "fontSize", 1 ); | 851 | startFontSize = cfg.readNumEntry( "fontSize", 1 ); |
852 | 852 | ||
853 | 853 | ||
854 | } else { | 854 | } else { |
855 | QString str; | 855 | QString str; |
856 | str = getenv("HOME"); | 856 | str = getenv("HOME"); |
857 | str += "/Settings/AddressBook.conf"; | 857 | str += "/Settings/AddressBook.conf"; |
858 | QFile::remove( str ); | 858 | QFile::remove( str ); |
859 | } | 859 | } |
860 | |||
860 | if ( slOrderedFields.count() > 0 ) { | 861 | if ( slOrderedFields.count() > 0 ) { |
861 | for( QStringList::ConstIterator it = slOrderedFields.begin(); | 862 | for( QStringList::ConstIterator it = slOrderedFields.begin(); |
862 | it != slOrderedFields.end(); ++it ) { | 863 | it != slOrderedFields.end(); ++it ) { |
863 | QValueList<int>::ConstIterator itVl; | 864 | QValueList<int>::ConstIterator itVl; |
864 | QStringList::ConstIterator itVis; | 865 | QStringList::ConstIterator itVis; |
865 | itVl = allFields.begin(); | 866 | itVl = allFields.begin(); |
866 | for ( itVis = visibleFields.begin(); | 867 | for ( itVis = visibleFields.begin(); |
867 | itVis != visibleFields.end() && itVl != allFields.end(); | 868 | itVis != visibleFields.end() && itVl != allFields.end(); |
868 | ++itVis, ++itVl ) { | 869 | ++itVis, ++itVl ) { |
869 | if ( *it == *itVis && itVl != allFields.end() ) { | 870 | if ( *it == *itVis && itVl != allFields.end() ) { |
870 | orderedFields.append( *itVl ); | 871 | orderedFields.append( *itVl ); |
871 | } | 872 | } |
872 | } | 873 | } |
873 | } | 874 | } |
874 | } else { | 875 | } else { |
875 | QValueList<int>::ConstIterator it; | 876 | QValueList<int>::ConstIterator it; |
876 | for ( it = allFields.begin(); it != allFields.end(); ++it ) | 877 | for ( it = allFields.begin(); it != allFields.end(); ++it ) |
877 | orderedFields.append( *it ); | 878 | orderedFields.append( *it ); |
878 | 879 | ||
879 | slOrderedFields = visibleFields; | 880 | slOrderedFields = visibleFields; |
880 | orderedFields.remove( Qtopia::AddressUid ); | 881 | orderedFields.remove( Qtopia::AddressUid ); |
881 | orderedFields.remove( Qtopia::Title ); | 882 | orderedFields.remove( Qtopia::Title ); |
882 | orderedFields.remove( Qtopia::Groups ); | 883 | orderedFields.remove( Qtopia::Groups ); |
883 | orderedFields.remove( Qtopia::AddressCategory ); | 884 | orderedFields.remove( Qtopia::AddressCategory ); |
884 | orderedFields.remove( Qtopia::FirstName ); | 885 | orderedFields.remove( Qtopia::FirstName ); |
885 | orderedFields.remove( Qtopia::LastName ); | 886 | orderedFields.remove( Qtopia::LastName ); |
886 | orderedFields.remove( Qtopia::DefaultEmail ); | 887 | orderedFields.remove( Qtopia::DefaultEmail ); |
887 | orderedFields.remove( Qtopia::FileAs ); | 888 | orderedFields.remove( Qtopia::FileAs ); |
888 | orderedFields.remove( Qtopia::Notes ); | 889 | orderedFields.remove( Qtopia::Notes ); |
889 | orderedFields.remove( Qtopia::Gender ); | 890 | orderedFields.remove( Qtopia::Gender ); |
890 | slOrderedFields.remove( "Name Title" ); | 891 | slOrderedFields.remove( "Name Title" ); |
891 | slOrderedFields.remove( "First Name" ); | 892 | slOrderedFields.remove( "First Name" ); |
892 | slOrderedFields.remove( "Last Name" ); | 893 | slOrderedFields.remove( "Last Name" ); |
893 | slOrderedFields.remove( "File As" ); | 894 | slOrderedFields.remove( "File As" ); |
894 | slOrderedFields.remove( "Default Email" ); | 895 | slOrderedFields.remove( "Default Email" ); |
895 | slOrderedFields.remove( "Notes" ); | 896 | slOrderedFields.remove( "Notes" ); |
896 | slOrderedFields.remove( "Gender" ); | 897 | slOrderedFields.remove( "Gender" ); |
897 | 898 | ||
898 | } | 899 | } |
899 | } | 900 | } |
900 | 901 | ||
901 | 902 | ||
902 | AbLabel *AddressbookWindow::abView() | 903 | AbLabel *AddressbookWindow::abView() |
903 | { | 904 | { |
904 | if ( !mView ) { | 905 | if ( !mView ) { |
905 | mView = new AbLabel( this, "viewer" ); | 906 | mView = new AbLabel( this, "viewer" ); |
906 | mView->init( OContact() ); | 907 | mView->init( OContact() ); |
907 | connect( mView, SIGNAL( okPressed() ), this, SLOT( slotListView() ) ); | 908 | connect( mView, SIGNAL( okPressed() ), this, SLOT( slotListView() ) ); |
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index b01583f..bae3a2b 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -39,199 +39,213 @@ | |||
39 | 39 | ||
40 | static inline bool containsAlphaNum( const QString &str ); | 40 | static inline bool containsAlphaNum( const QString &str ); |
41 | static inline bool constainsWhiteSpace( const QString &str ); | 41 | static inline bool constainsWhiteSpace( const QString &str ); |
42 | 42 | ||
43 | // helper functions, convert our comma delimited list to proper | 43 | // helper functions, convert our comma delimited list to proper |
44 | // file format... | 44 | // file format... |
45 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, | 45 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, |
46 | QString &strAll ); | 46 | QString &strAll ); |
47 | 47 | ||
48 | // helper convert from file format to comma delimited... | 48 | // helper convert from file format to comma delimited... |
49 | void parseEmailTo( const QString &strDefaultEmail, | 49 | void parseEmailTo( const QString &strDefaultEmail, |
50 | const QString &strOtherEmail, QString &strBack ); | 50 | const QString &strOtherEmail, QString &strBack ); |
51 | 51 | ||
52 | ContactEditor::ContactEditor(const OContact &entry, | 52 | ContactEditor::ContactEditor(const OContact &entry, |
53 | const QValueList<int> *newOrderedValues, | 53 | const QValueList<int> *newOrderedValues, |
54 | QStringList *slNewOrdered, | 54 | QStringList *slNewOrdered, |
55 | QWidget *parent, | 55 | QWidget *parent, |
56 | const char *name, | 56 | const char *name, |
57 | WFlags fl ) | 57 | WFlags fl ) |
58 | : QDialog( parent, name, TRUE, fl ), | 58 | : QDialog( parent, name, TRUE, fl ), |
59 | orderedValues( newOrderedValues ), | 59 | orderedValues( newOrderedValues ), |
60 | slOrdered( *slNewOrdered ) | 60 | slOrdered( *slNewOrdered ) |
61 | { | 61 | { |
62 | 62 | ||
63 | init(); | 63 | init(); |
64 | initMap(); | 64 | initMap(); |
65 | setEntry( entry ); | 65 | setEntry( entry ); |
66 | qDebug("finish"); | 66 | qDebug("finish"); |
67 | } | 67 | } |
68 | 68 | ||
69 | ContactEditor::~ContactEditor() { | 69 | ContactEditor::~ContactEditor() { |
70 | } | 70 | } |
71 | 71 | ||
72 | void ContactEditor::init() { | 72 | void ContactEditor::init() { |
73 | 73 | ||
74 | useFullName = TRUE; | 74 | useFullName = TRUE; |
75 | 75 | ||
76 | int i = 0; | 76 | int i = 0; |
77 | /** SHut up and stop leaking | 77 | /** SHut up and stop leaking |
78 | slHomeAddress = new QStringList; | 78 | slHomeAddress = new QStringList; |
79 | slBusinessAddress = new QStringList; | 79 | slBusinessAddress = new QStringList; |
80 | slChooserNames = new QStringList; | 80 | slChooserNames = new QStringList; |
81 | slChooserValues = new QStringList; | 81 | slChooserValues = new QStringList; |
82 | 82 | ||
83 | slDynamicEntries = new QStringList; | 83 | slDynamicEntries = new QStringList; |
84 | */ | 84 | */ |
85 | //*slDynamicEntries = *slOrdered; | 85 | //*slDynamicEntries = *slOrdered; |
86 | 86 | ||
87 | QStringList trlChooserNames; | ||
88 | |||
87 | for (i = 0; i <= 6; i++) { | 89 | for (i = 0; i <= 6; i++) { |
88 | slHomeAddress.append( "" ); | 90 | slHomeAddress.append( "" ); |
89 | slBusinessAddress.append( "" ); | 91 | slBusinessAddress.append( "" ); |
90 | } | 92 | } |
91 | 93 | ||
92 | { | 94 | { |
93 | hasGender = FALSE; | 95 | hasGender = FALSE; |
94 | hasTitle = FALSE; | 96 | hasTitle = FALSE; |
95 | hasCompany = FALSE; | 97 | hasCompany = FALSE; |
96 | hasNotes = FALSE; | 98 | hasNotes = FALSE; |
97 | hasStreet = FALSE; | 99 | hasStreet = FALSE; |
98 | hasStreet2 = FALSE; | 100 | hasStreet2 = FALSE; |
99 | hasPOBox = FALSE; | 101 | hasPOBox = FALSE; |
100 | hasCity = FALSE; | 102 | hasCity = FALSE; |
101 | hasState = FALSE; | 103 | hasState = FALSE; |
102 | hasZip = FALSE; | 104 | hasZip = FALSE; |
103 | hasCountry = FALSE; | 105 | hasCountry = FALSE; |
104 | 106 | ||
105 | QStringList::ConstIterator it = slOrdered.begin(); | 107 | QStringList::ConstIterator it = slOrdered.begin(); |
108 | |||
106 | for ( i = 0; it != slOrdered.end(); i++, ++it ) { | 109 | for ( i = 0; it != slOrdered.end(); i++, ++it ) { |
107 | 110 | ||
108 | if ( (*it) == "Business Fax" ) { | 111 | if ( (*it) == "Business Fax" ) { |
109 | slChooserNames.append( tr( "Business Fax" ) ); | 112 | trlChooserNames.append( tr( "Business Fax" ) ); |
113 | slChooserNames.append( *it ); | ||
110 | slChooserValues.append("" ); | 114 | slChooserValues.append("" ); |
111 | //slDynamicEntries->remove( it ); | 115 | //slDynamicEntries->remove( it ); |
112 | continue; | 116 | continue; |
113 | } | 117 | } |
114 | 118 | ||
115 | if ( (*it) == "Home Fax" ) { | 119 | if ( (*it) == "Home Fax" ) { |
116 | slChooserNames.append( tr( "Home Fax" ) ); | 120 | trlChooserNames.append( tr( "Home Fax" ) ); |
121 | slChooserNames.append( *it ); | ||
117 | slChooserValues.append("" ); | 122 | slChooserValues.append("" ); |
118 | //slDynamicEntries->remove( it ); | 123 | //slDynamicEntries->remove( it ); |
119 | continue; | 124 | continue; |
120 | } | 125 | } |
121 | 126 | ||
122 | 127 | ||
123 | if ( (*it) == "Business Phone" ) { | 128 | if ( (*it) == "Business Phone" ) { |
124 | slChooserNames.append( tr( "Business Phone" ) ); | 129 | trlChooserNames.append( tr( "Business Phone" ) ); |
130 | slChooserNames.append( *it ); | ||
125 | slChooserValues.append( "" ); | 131 | slChooserValues.append( "" ); |
126 | //slDynamicEntries->remove( it ); | 132 | //slDynamicEntries->remove( it ); |
127 | continue; | 133 | continue; |
128 | } | 134 | } |
129 | 135 | ||
130 | if ( (*it) == "Home Phone" ) { | 136 | if ( (*it) == "Home Phone" ) { |
131 | slChooserNames.append( tr( "Home Phone" ) ); | 137 | trlChooserNames.append( tr( "Home Phone" ) ); |
138 | slChooserNames.append( *it ); | ||
132 | slChooserValues.append( "" ); | 139 | slChooserValues.append( "" ); |
133 | //slDynamicEntries->remove( it ); | 140 | //slDynamicEntries->remove( it ); |
134 | continue; | 141 | continue; |
135 | } | 142 | } |
136 | 143 | ||
137 | /* | 144 | /* |
138 | if ( (*it).right( 2 ) == tr( "IM" ) ) { | 145 | if ( (*it).right( 2 ) == tr( "IM" ) ) { |
139 | slChooserNames.append( *it ); | 146 | slChooserNames.append( *it ); |
140 | slChooserValues.append( "" ); | 147 | slChooserValues.append( "" ); |
141 | //slDynamicEntries->remove( it ); | 148 | //slDynamicEntries->remove( it ); |
142 | continue; | 149 | continue; |
143 | } */ | 150 | } */ |
144 | 151 | ||
145 | if ( (*it) == "Business Mobile" ) { | 152 | if ( (*it) == "Business Mobile" ) { |
146 | slChooserNames.append( tr( "Business Mobile" ) ); | 153 | trlChooserNames.append( tr( "Business Mobile" ) ); |
154 | slChooserNames.append( *it ); | ||
147 | slChooserValues.append( "" ); | 155 | slChooserValues.append( "" ); |
148 | //slDynamicEntries->remove( it ); | 156 | //slDynamicEntries->remove( it ); |
149 | continue; | 157 | continue; |
150 | } | 158 | } |
151 | 159 | ||
152 | if ( (*it) == "Home Mobile" ) { | 160 | if ( (*it) == "Home Mobile" ) { |
153 | slChooserNames.append( tr( "Home Mobile" ) ); | 161 | trlChooserNames.append( tr( "Home Mobile" ) ); |
162 | slChooserNames.append( *it ); | ||
154 | slChooserValues.append( "" ); | 163 | slChooserValues.append( "" ); |
155 | //slDynamicEntries->remove( it ); | 164 | //slDynamicEntries->remove( it ); |
156 | continue; | 165 | continue; |
157 | } | 166 | } |
158 | 167 | ||
159 | 168 | ||
160 | if ( (*it) == "Business WebPage" ) { | 169 | if ( (*it) == "Business WebPage" ) { |
161 | slChooserNames.append( tr( "Business WebPage" ) ); | 170 | trlChooserNames.append( tr( "Business WebPage" ) ); |
171 | slChooserNames.append( *it ); | ||
162 | slChooserValues.append( "" ); | 172 | slChooserValues.append( "" ); |
163 | //slDynamicEntries->remove( it ); | 173 | //slDynamicEntries->remove( it ); |
164 | continue; | 174 | continue; |
165 | } | 175 | } |
166 | 176 | ||
167 | if ( (*it) == "Home Web Page" ) { | 177 | if ( (*it) == "Home Web Page" ) { |
168 | slChooserNames.append( tr( "Home Web Page" ) ); | 178 | trlChooserNames.append( tr( "Home Web Page" ) ); |
179 | slChooserNames.append( *it ); | ||
169 | slChooserValues.append( "" ); | 180 | slChooserValues.append( "" ); |
170 | //slDynamicEntries->remove( it ); | 181 | //slDynamicEntries->remove( it ); |
171 | continue; | 182 | continue; |
172 | } | 183 | } |
173 | 184 | ||
174 | if ( (*it) == "Business Pager" ) { | 185 | if ( (*it) == "Business Pager" ) { |
175 | slChooserNames.append( tr( "Business Pager" ) ); | 186 | trlChooserNames.append( tr( "Business Pager" ) ); |
187 | slChooserNames.append( *it ); | ||
176 | slChooserValues.append( "" ); | 188 | slChooserValues.append( "" ); |
177 | //slDynamicEntries->remove( it ); | 189 | //slDynamicEntries->remove( it ); |
178 | continue; | 190 | continue; |
179 | } | 191 | } |
180 | 192 | ||
181 | if ( *it == "Default Email" ) { | 193 | if ( *it == "Default Email" ) { |
182 | slChooserNames.append( tr( "Default Email" ) ); | 194 | trlChooserNames.append( tr( "Default Email" ) ); |
195 | slChooserNames.append( *it ); | ||
183 | slChooserValues.append( "" ); | 196 | slChooserValues.append( "" ); |
184 | //slDynamicEntries->remove( it ); | 197 | //slDynamicEntries->remove( it ); |
185 | continue; | 198 | continue; |
186 | } | 199 | } |
187 | 200 | ||
188 | if ( *it == "Emails" ) { | 201 | if ( *it == "Emails" ) { |
189 | slChooserNames.append( tr( "Emails" ) ); | 202 | trlChooserNames.append( tr( "Emails" ) ); |
203 | slChooserNames.append( *it ); | ||
190 | slChooserValues.append( "" ); | 204 | slChooserValues.append( "" ); |
191 | //slDynamicEntries->remove( it ); | 205 | //slDynamicEntries->remove( it ); |
192 | continue; | 206 | continue; |
193 | } | 207 | } |
194 | 208 | ||
195 | if ( *it == "Name Title" || *it == "First Name" || *it == "Middle Name" || *it == "Last Name" || *it == "File As" || *it == "Default Email" || *it == "Emails" || *it == "Groups" ) | 209 | if ( *it == "Name Title" || *it == "First Name" || *it == "Middle Name" || *it == "Last Name" || *it == "File As" || *it == "Default Email" || *it == "Emails" || *it == "Groups" ) |
196 | continue; | 210 | continue; |
197 | 211 | ||
198 | if ( *it == "Name Title" ) { | 212 | if ( *it == "Name Title" ) { |
199 | //slDynamicEntries->remove( it ); | 213 | //slDynamicEntries->remove( it ); |
200 | continue; | 214 | continue; |
201 | } | 215 | } |
202 | 216 | ||
203 | if ( *it == "First Name" ) { | 217 | if ( *it == "First Name" ) { |
204 | //slDynamicEntries->remove( it ); | 218 | //slDynamicEntries->remove( it ); |
205 | continue; | 219 | continue; |
206 | } | 220 | } |
207 | 221 | ||
208 | if ( *it == "Middle Name" ) { | 222 | if ( *it == "Middle Name" ) { |
209 | //slDynamicEntries->remove( it ); | 223 | //slDynamicEntries->remove( it ); |
210 | continue; | 224 | continue; |
211 | } | 225 | } |
212 | 226 | ||
213 | if ( *it == "Last Name" ) { | 227 | if ( *it == "Last Name" ) { |
214 | //slDynamicEntries->remove( it ); | 228 | //slDynamicEntries->remove( it ); |
215 | continue; | 229 | continue; |
216 | } | 230 | } |
217 | 231 | ||
218 | if ( *it == "Suffix" ) { | 232 | if ( *it == "Suffix" ) { |
219 | //slDynamicEntries->remove( it ); | 233 | //slDynamicEntries->remove( it ); |
220 | continue; | 234 | continue; |
221 | } | 235 | } |
222 | 236 | ||
223 | if ( *it == "File As" ) { | 237 | if ( *it == "File As" ) { |
224 | //slDynamicEntries->remove( it ); | 238 | //slDynamicEntries->remove( it ); |
225 | continue; | 239 | continue; |
226 | } | 240 | } |
227 | 241 | ||
228 | if ( *it == "Gender" ) { | 242 | if ( *it == "Gender" ) { |
229 | hasGender = TRUE; | 243 | hasGender = TRUE; |
230 | //slDynamicEntries->remove( it ); | 244 | //slDynamicEntries->remove( it ); |
231 | continue; | 245 | continue; |
232 | } | 246 | } |
233 | 247 | ||
234 | if ( *it == "Job Title" ) { | 248 | if ( *it == "Job Title" ) { |
235 | hasTitle = TRUE; | 249 | hasTitle = TRUE; |
236 | //slDynamicEntries->remove( it ); | 250 | //slDynamicEntries->remove( it ); |
237 | continue; | 251 | continue; |
@@ -704,100 +718,100 @@ void ContactEditor::init() { | |||
704 | gl->addWidget( e, i, 1); | 718 | gl->addWidget( e, i, 1); |
705 | } | 719 | } |
706 | 720 | ||
707 | l = new QLabel( tr("Gender"), container ); | 721 | l = new QLabel( tr("Gender"), container ); |
708 | gl->addWidget( l, slDynamicEntries.count(), 0 ); | 722 | gl->addWidget( l, slDynamicEntries.count(), 0 ); |
709 | cmbGender = new QComboBox( container ); | 723 | cmbGender = new QComboBox( container ); |
710 | cmbGender->insertItem( "", 0 ); | 724 | cmbGender->insertItem( "", 0 ); |
711 | cmbGender->insertItem( tr("Male"), 1); | 725 | cmbGender->insertItem( tr("Male"), 1); |
712 | cmbGender->insertItem( tr("Female"), 2); | 726 | cmbGender->insertItem( tr("Female"), 2); |
713 | gl->addWidget( cmbGender, slDynamicEntries.count(), 1 ); | 727 | gl->addWidget( cmbGender, slDynamicEntries.count(), 1 ); |
714 | 728 | ||
715 | tabMain->insertTab( tabViewport, tr( "Details" ) ); | 729 | tabMain->insertTab( tabViewport, tr( "Details" ) ); |
716 | 730 | ||
717 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); | 731 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); |
718 | dlgNote->setCaption( tr("Enter Note") ); | 732 | dlgNote->setCaption( tr("Enter Note") ); |
719 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); | 733 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); |
720 | txtNote = new QMultiLineEdit( dlgNote ); | 734 | txtNote = new QMultiLineEdit( dlgNote ); |
721 | vbNote->addWidget( txtNote ); | 735 | vbNote->addWidget( txtNote ); |
722 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); | 736 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); |
723 | 737 | ||
724 | dlgName = new QDialog( this, "Name Dialog", TRUE ); | 738 | dlgName = new QDialog( this, "Name Dialog", TRUE ); |
725 | dlgName->setCaption( tr("Edit Name") ); | 739 | dlgName->setCaption( tr("Edit Name") ); |
726 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); | 740 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); |
727 | 741 | ||
728 | l = new QLabel( tr("First Name"), dlgName ); | 742 | l = new QLabel( tr("First Name"), dlgName ); |
729 | gl->addWidget( l, 0, 0 ); | 743 | gl->addWidget( l, 0, 0 ); |
730 | txtFirstName = new QLineEdit( dlgName ); | 744 | txtFirstName = new QLineEdit( dlgName ); |
731 | gl->addWidget( txtFirstName, 0, 1 ); | 745 | gl->addWidget( txtFirstName, 0, 1 ); |
732 | 746 | ||
733 | l = new QLabel( tr("Middle Name"), dlgName ); | 747 | l = new QLabel( tr("Middle Name"), dlgName ); |
734 | gl->addWidget( l, 1, 0 ); | 748 | gl->addWidget( l, 1, 0 ); |
735 | txtMiddleName = new QLineEdit( dlgName ); | 749 | txtMiddleName = new QLineEdit( dlgName ); |
736 | gl->addWidget( txtMiddleName, 1, 1 ); | 750 | gl->addWidget( txtMiddleName, 1, 1 ); |
737 | 751 | ||
738 | l = new QLabel( tr("Last Name"), dlgName ); | 752 | l = new QLabel( tr("Last Name"), dlgName ); |
739 | gl->addWidget( l, 2, 0 ); | 753 | gl->addWidget( l, 2, 0 ); |
740 | txtLastName = new QLineEdit( dlgName ); | 754 | txtLastName = new QLineEdit( dlgName ); |
741 | gl->addWidget( txtLastName, 2, 1 ); | 755 | gl->addWidget( txtLastName, 2, 1 ); |
742 | 756 | ||
743 | l = new QLabel( tr("Suffix"), dlgName ); | 757 | l = new QLabel( tr("Suffix"), dlgName ); |
744 | gl->addWidget( l, 3, 0 ); | 758 | gl->addWidget( l, 3, 0 ); |
745 | txtSuffix = new QLineEdit( dlgName ); | 759 | txtSuffix = new QLineEdit( dlgName ); |
746 | gl->addWidget( txtSuffix, 3, 1 ); | 760 | gl->addWidget( txtSuffix, 3, 1 ); |
747 | space = new QSpacerItem(1,1, | 761 | space = new QSpacerItem(1,1, |
748 | QSizePolicy::Maximum, | 762 | QSizePolicy::Maximum, |
749 | QSizePolicy::MinimumExpanding ); | 763 | QSizePolicy::MinimumExpanding ); |
750 | gl->addItem( space, 4, 0 ); | 764 | gl->addItem( space, 4, 0 ); |
751 | 765 | ||
752 | cmbChooserField1->insertStringList( slChooserNames ); | 766 | cmbChooserField1->insertStringList( trlChooserNames ); |
753 | cmbChooserField2->insertStringList( slChooserNames ); | 767 | cmbChooserField2->insertStringList( trlChooserNames ); |
754 | cmbChooserField3->insertStringList( slChooserNames ); | 768 | cmbChooserField3->insertStringList( trlChooserNames ); |
755 | cmbChooserField4->insertStringList( slChooserNames ); | 769 | cmbChooserField4->insertStringList( trlChooserNames ); |
756 | 770 | ||
757 | cmbChooserField1->setCurrentItem( 0 ); | 771 | cmbChooserField1->setCurrentItem( 0 ); |
758 | cmbChooserField2->setCurrentItem( 1 ); | 772 | cmbChooserField2->setCurrentItem( 1 ); |
759 | cmbChooserField3->setCurrentItem( 2 ); | 773 | cmbChooserField3->setCurrentItem( 2 ); |
760 | 774 | ||
761 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); | 775 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); |
762 | 776 | ||
763 | connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); | 777 | connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); |
764 | 778 | ||
765 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), | 779 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), |
766 | this, SLOT(slotChooser1Change(const QString &)) ); | 780 | this, SLOT(slotChooser1Change(const QString &)) ); |
767 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), | 781 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), |
768 | this, SLOT(slotChooser2Change(const QString &)) ); | 782 | this, SLOT(slotChooser2Change(const QString &)) ); |
769 | connect( txtChooserField3, SIGNAL(textChanged(const QString &)), | 783 | connect( txtChooserField3, SIGNAL(textChanged(const QString &)), |
770 | this, SLOT(slotChooser3Change(const QString &)) ); | 784 | this, SLOT(slotChooser3Change(const QString &)) ); |
771 | connect( txtChooserField4, SIGNAL(textChanged(const QString &)), | 785 | connect( txtChooserField4, SIGNAL(textChanged(const QString &)), |
772 | this, SLOT(slotChooser4Change(const QString &)) ); | 786 | this, SLOT(slotChooser4Change(const QString &)) ); |
773 | connect( txtAddress, SIGNAL(textChanged(const QString &)), | 787 | connect( txtAddress, SIGNAL(textChanged(const QString &)), |
774 | this, SLOT(slotAddressChange(const QString &)) ); | 788 | this, SLOT(slotAddressChange(const QString &)) ); |
775 | //connect( txtAddress2, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddress2Change(const QString &)) ); | 789 | //connect( txtAddress2, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddress2Change(const QString &)) ); |
776 | //connect( txtPOBox, SIGNAL(textChanged(const QString &)), this, SLOT(slotPOBoxChange(const QString &)) ); | 790 | //connect( txtPOBox, SIGNAL(textChanged(const QString &)), this, SLOT(slotPOBoxChange(const QString &)) ); |
777 | connect( txtCity, SIGNAL(textChanged(const QString &)), | 791 | connect( txtCity, SIGNAL(textChanged(const QString &)), |
778 | this, SLOT(slotCityChange(const QString &)) ); | 792 | this, SLOT(slotCityChange(const QString &)) ); |
779 | connect( txtState, SIGNAL(textChanged(const QString &)), | 793 | connect( txtState, SIGNAL(textChanged(const QString &)), |
780 | this, SLOT(slotStateChange(const QString &)) ); | 794 | this, SLOT(slotStateChange(const QString &)) ); |
781 | connect( txtZip, SIGNAL(textChanged(const QString &)), | 795 | connect( txtZip, SIGNAL(textChanged(const QString &)), |
782 | this, SLOT(slotZipChange(const QString &)) ); | 796 | this, SLOT(slotZipChange(const QString &)) ); |
783 | connect( cmbCountry, SIGNAL(textChanged(const QString &)), | 797 | connect( cmbCountry, SIGNAL(textChanged(const QString &)), |
784 | this, SLOT(slotCountryChange(const QString &)) ); | 798 | this, SLOT(slotCountryChange(const QString &)) ); |
785 | connect( cmbCountry, SIGNAL(activated(const QString &)), | 799 | connect( cmbCountry, SIGNAL(activated(const QString &)), |
786 | this, SLOT(slotCountryChange(const QString &)) ); | 800 | this, SLOT(slotCountryChange(const QString &)) ); |
787 | connect( cmbChooserField1, SIGNAL(activated(int)), | 801 | connect( cmbChooserField1, SIGNAL(activated(int)), |
788 | this, SLOT(slotCmbChooser1Change(int)) ); | 802 | this, SLOT(slotCmbChooser1Change(int)) ); |
789 | connect( cmbChooserField2, SIGNAL(activated(int)), | 803 | connect( cmbChooserField2, SIGNAL(activated(int)), |
790 | this, SLOT(slotCmbChooser2Change(int)) ); | 804 | this, SLOT(slotCmbChooser2Change(int)) ); |
791 | connect( cmbChooserField3, SIGNAL(activated(int)), | 805 | connect( cmbChooserField3, SIGNAL(activated(int)), |
792 | this, SLOT(slotCmbChooser3Change(int)) ); | 806 | this, SLOT(slotCmbChooser3Change(int)) ); |
793 | connect( cmbChooserField4, SIGNAL(activated(int)), | 807 | connect( cmbChooserField4, SIGNAL(activated(int)), |
794 | this, SLOT(slotCmbChooser4Change(int)) ); | 808 | this, SLOT(slotCmbChooser4Change(int)) ); |
795 | connect( cmbAddress, SIGNAL(activated(int)), | 809 | connect( cmbAddress, SIGNAL(activated(int)), |
796 | this, SLOT(slotAddressTypeChange(int)) ); | 810 | this, SLOT(slotAddressTypeChange(int)) ); |
797 | 811 | ||
798 | new QPEDialogListener(this); | 812 | new QPEDialogListener(this); |
799 | } | 813 | } |
800 | 814 | ||
801 | void ContactEditor::initMap() | 815 | void ContactEditor::initMap() |
802 | { | 816 | { |
803 | /* | 817 | /* |
@@ -1315,127 +1329,127 @@ void ContactEditor::setEntry( const OContact &entry ) { | |||
1315 | 1329 | ||
1316 | if (hasTitle) | 1330 | if (hasTitle) |
1317 | txtJobTitle->setText( ent.jobTitle() ); | 1331 | txtJobTitle->setText( ent.jobTitle() ); |
1318 | 1332 | ||
1319 | if (hasCompany) | 1333 | if (hasCompany) |
1320 | txtOrganization->setText( ent.company() ); | 1334 | txtOrganization->setText( ent.company() ); |
1321 | 1335 | ||
1322 | if (hasNotes) | 1336 | if (hasNotes) |
1323 | txtNote->setText( ent.notes() ); | 1337 | txtNote->setText( ent.notes() ); |
1324 | 1338 | ||
1325 | if (hasStreet) { | 1339 | if (hasStreet) { |
1326 | slHomeAddress[0] = ent.homeStreet(); | 1340 | slHomeAddress[0] = ent.homeStreet(); |
1327 | slBusinessAddress[0] = ent.businessStreet(); | 1341 | slBusinessAddress[0] = ent.businessStreet(); |
1328 | } | 1342 | } |
1329 | /* | 1343 | /* |
1330 | if (hasStreet2) { | 1344 | if (hasStreet2) { |
1331 | (*slHomeAddress)[1] = ent.homeStreet2(); | 1345 | (*slHomeAddress)[1] = ent.homeStreet2(); |
1332 | (*slBusinessAddress)[1] = ent.businessStreet2(); | 1346 | (*slBusinessAddress)[1] = ent.businessStreet2(); |
1333 | } | 1347 | } |
1334 | 1348 | ||
1335 | if (hasPOBox) { | 1349 | if (hasPOBox) { |
1336 | (*slHomeAddress)[2] = ent.homePOBox(); | 1350 | (*slHomeAddress)[2] = ent.homePOBox(); |
1337 | (*slBusinessAddress)[2] = ent.businessPOBox(); | 1351 | (*slBusinessAddress)[2] = ent.businessPOBox(); |
1338 | } | 1352 | } |
1339 | */ | 1353 | */ |
1340 | if (hasCity) { | 1354 | if (hasCity) { |
1341 | slHomeAddress[3] = ent.homeCity(); | 1355 | slHomeAddress[3] = ent.homeCity(); |
1342 | slBusinessAddress[3] = ent.businessCity(); | 1356 | slBusinessAddress[3] = ent.businessCity(); |
1343 | } | 1357 | } |
1344 | 1358 | ||
1345 | if (hasState) { | 1359 | if (hasState) { |
1346 | slHomeAddress[4] = ent.homeState(); | 1360 | slHomeAddress[4] = ent.homeState(); |
1347 | slBusinessAddress[4] = ent.businessState(); | 1361 | slBusinessAddress[4] = ent.businessState(); |
1348 | } | 1362 | } |
1349 | 1363 | ||
1350 | if (hasZip) { | 1364 | if (hasZip) { |
1351 | slHomeAddress[5] = ent.homeZip(); | 1365 | slHomeAddress[5] = ent.homeZip(); |
1352 | slBusinessAddress[5] = ent.businessZip(); | 1366 | slBusinessAddress[5] = ent.businessZip(); |
1353 | } | 1367 | } |
1354 | 1368 | ||
1355 | if (hasCountry) { | 1369 | if (hasCountry) { |
1356 | slHomeAddress[6] = ent.homeCountry(); | 1370 | slHomeAddress[6] = ent.homeCountry(); |
1357 | slBusinessAddress[6] = ent.businessCountry(); | 1371 | slBusinessAddress[6] = ent.businessCountry(); |
1358 | } | 1372 | } |
1359 | 1373 | ||
1360 | QStringList::ConstIterator it; | 1374 | QStringList::ConstIterator it; |
1361 | QListIterator<QLineEdit> itLE( listValue ); | 1375 | QListIterator<QLineEdit> itLE( listValue ); |
1362 | for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) { | 1376 | for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) { |
1363 | if ( *it =="Department" ) | 1377 | if ( *it == tr( "Department" ) ) |
1364 | (*itLE)->setText( ent.department() ); | 1378 | (*itLE)->setText( ent.department() ); |
1365 | 1379 | ||
1366 | if ( *it == "Company" ) | 1380 | if ( *it == tr( "Company" ) ) |
1367 | (*itLE)->setText( ent.company() ); | 1381 | (*itLE)->setText( ent.company() ); |
1368 | 1382 | ||
1369 | if ( *it == "Office" ) | 1383 | if ( *it == tr( "Office" ) ) |
1370 | (*itLE)->setText( ent.office() ); | 1384 | (*itLE)->setText( ent.office() ); |
1371 | 1385 | ||
1372 | if ( *it == "Profession" ) | 1386 | if ( *it == tr( "Profession" ) ) |
1373 | (*itLE)->setText( ent.profession() ); | 1387 | (*itLE)->setText( ent.profession() ); |
1374 | 1388 | ||
1375 | if ( *it == "Assistant" ) | 1389 | if ( *it == tr( "Assistant" ) ) |
1376 | (*itLE)->setText( ent.assistant() ); | 1390 | (*itLE)->setText( ent.assistant() ); |
1377 | 1391 | ||
1378 | if ( *it == "Manager" ) | 1392 | if ( *it == tr( "Manager" ) ) |
1379 | (*itLE)->setText( ent.manager() ); | 1393 | (*itLE)->setText( ent.manager() ); |
1380 | 1394 | ||
1381 | if ( *it == "Spouse" ) | 1395 | if ( *it == tr( "Spouse" ) ) |
1382 | (*itLE)->setText( ent.spouse() ); | 1396 | (*itLE)->setText( ent.spouse() ); |
1383 | 1397 | ||
1384 | if ( *it == "Birthday" ) | 1398 | if ( *it == tr( "Birthday" ) ) |
1385 | (*itLE)->setText( ent.birthday() ); | 1399 | (*itLE)->setText( ent.birthday() ); |
1386 | 1400 | ||
1387 | if ( *it == "Anniversary" ) | 1401 | if ( *it == tr( "Anniversary" ) ) |
1388 | (*itLE)->setText( ent.anniversary() ); | 1402 | (*itLE)->setText( ent.anniversary() ); |
1389 | 1403 | ||
1390 | if ( *it == "Nickname" ) | 1404 | if ( *it == tr( "Nickname" ) ) |
1391 | (*itLE)->setText( ent.nickname() ); | 1405 | (*itLE)->setText( ent.nickname() ); |
1392 | 1406 | ||
1393 | if ( *it == "Children" ) | 1407 | if ( *it == tr( "Children" ) ) |
1394 | (*itLE)->setText( ent.children() ); | 1408 | (*itLE)->setText( ent.children() ); |
1395 | 1409 | ||
1396 | } | 1410 | } |
1397 | 1411 | ||
1398 | QStringList::Iterator itV; | 1412 | QStringList::Iterator itV; |
1399 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { | 1413 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { |
1400 | 1414 | ||
1401 | if ( ( *it == "Business Phone") || ( *it == "Work Phone" ) ) | 1415 | if ( ( *it == "Business Phone") || ( *it == "Work Phone" ) ) |
1402 | *itV = ent.businessPhone(); | 1416 | *itV = ent.businessPhone(); |
1403 | /* | 1417 | /* |
1404 | if ( *it == "Business 2 Phone" ) | 1418 | if ( *it == "Business 2 Phone" ) |
1405 | *itV = ent.business2Phone(); | 1419 | *itV = ent.business2Phone(); |
1406 | */ | 1420 | */ |
1407 | if ( ( *it == "Business Fax") || ( *it == "Work Fax" ) ) | 1421 | if ( ( *it == "Business Fax") || ( *it == "Work Fax" ) ) |
1408 | *itV = ent.businessFax(); | 1422 | *itV = ent.businessFax(); |
1409 | 1423 | ||
1410 | if ( ( *it == "Business Mobile" ) || ( *it == "work Mobile" ) ) | 1424 | if ( ( *it == "Business Mobile" ) || ( *it == "work Mobile" ) ) |
1411 | *itV = ent.businessMobile(); | 1425 | *itV = ent.businessMobile(); |
1412 | /* | 1426 | /* |
1413 | if ( *it == "Company Phone" ) | 1427 | if ( *it == "Company Phone" ) |
1414 | *itV = ent.companyPhone(); | 1428 | *itV = ent.companyPhone(); |
1415 | */ | 1429 | */ |
1416 | if ( *it == "Default Email" ) | 1430 | if ( *it == "Default Email" ) |
1417 | *itV = ent.defaultEmail(); | 1431 | *itV = ent.defaultEmail(); |
1418 | 1432 | ||
1419 | if ( *it == "Emails" ) | 1433 | if ( *it == "Emails" ) |
1420 | *itV = ent.emailList().join(", "); // :SX | 1434 | *itV = ent.emailList().join(", "); // :SX |
1421 | 1435 | ||
1422 | if ( *it == "Home Phone" ) | 1436 | if ( *it == "Home Phone" ) |
1423 | *itV = ent.homePhone(); | 1437 | *itV = ent.homePhone(); |
1424 | /* | 1438 | /* |
1425 | if ( *it == "Home 2 Phone" ) | 1439 | if ( *it == "Home 2 Phone" ) |
1426 | *itV = ent.home2Phone(); | 1440 | *itV = ent.home2Phone(); |
1427 | */ | 1441 | */ |
1428 | if ( *it == "Home Fax" ) | 1442 | if ( *it == "Home Fax" ) |
1429 | *itV = ent.homeFax(); | 1443 | *itV = ent.homeFax(); |
1430 | 1444 | ||
1431 | if ( *it == "Home Mobile" ) | 1445 | if ( *it == "Home Mobile" ) |
1432 | *itV = ent.homeMobile(); | 1446 | *itV = ent.homeMobile(); |
1433 | /* | 1447 | /* |
1434 | if ( *it == "Car Phone" ) | 1448 | if ( *it == "Car Phone" ) |
1435 | *itV = ent.carPhone(); | 1449 | *itV = ent.carPhone(); |
1436 | 1450 | ||
1437 | if ( *it == "ISDN Phone" ) | 1451 | if ( *it == "ISDN Phone" ) |
1438 | *itV = ent.ISDNPhone(); | 1452 | *itV = ent.ISDNPhone(); |
1439 | 1453 | ||
1440 | if ( *it == "Other Phone" ) | 1454 | if ( *it == "Other Phone" ) |
1441 | *itV = ent.otherPhone(); | 1455 | *itV = ent.otherPhone(); |
@@ -1513,127 +1527,127 @@ void ContactEditor::saveEntry() { | |||
1513 | 1527 | ||
1514 | if (hasTitle) | 1528 | if (hasTitle) |
1515 | ent.setJobTitle( txtJobTitle->text() ); | 1529 | ent.setJobTitle( txtJobTitle->text() ); |
1516 | 1530 | ||
1517 | if (hasCompany) | 1531 | if (hasCompany) |
1518 | ent.setCompany( txtOrganization->text() ); | 1532 | ent.setCompany( txtOrganization->text() ); |
1519 | 1533 | ||
1520 | if (hasNotes) | 1534 | if (hasNotes) |
1521 | ent.setNotes( txtNote->text() ); | 1535 | ent.setNotes( txtNote->text() ); |
1522 | 1536 | ||
1523 | if (hasStreet) { | 1537 | if (hasStreet) { |
1524 | ent.setHomeStreet( slHomeAddress[0] ); | 1538 | ent.setHomeStreet( slHomeAddress[0] ); |
1525 | ent.setBusinessStreet( slBusinessAddress[0] ); | 1539 | ent.setBusinessStreet( slBusinessAddress[0] ); |
1526 | } | 1540 | } |
1527 | /* | 1541 | /* |
1528 | if (hasStreet2) { | 1542 | if (hasStreet2) { |
1529 | ent.setHomeStreet2( (*slHomeAddress)[1] ); | 1543 | ent.setHomeStreet2( (*slHomeAddress)[1] ); |
1530 | ent.setBusinessStreet2( (*slBusinessAddress)[1] ); | 1544 | ent.setBusinessStreet2( (*slBusinessAddress)[1] ); |
1531 | } | 1545 | } |
1532 | 1546 | ||
1533 | if (hasPOBox) { | 1547 | if (hasPOBox) { |
1534 | ent.setHomePOBox( (*slHomeAddress)[2] ); | 1548 | ent.setHomePOBox( (*slHomeAddress)[2] ); |
1535 | ent.setBusinessPOBox( (*slBusinessAddress)[2] ); | 1549 | ent.setBusinessPOBox( (*slBusinessAddress)[2] ); |
1536 | } | 1550 | } |
1537 | */ | 1551 | */ |
1538 | if (hasCity) { | 1552 | if (hasCity) { |
1539 | ent.setHomeCity( slHomeAddress[3] ); | 1553 | ent.setHomeCity( slHomeAddress[3] ); |
1540 | ent.setBusinessCity( slBusinessAddress[3] ); | 1554 | ent.setBusinessCity( slBusinessAddress[3] ); |
1541 | } | 1555 | } |
1542 | 1556 | ||
1543 | if (hasState) { | 1557 | if (hasState) { |
1544 | ent.setHomeState( slHomeAddress[4] ); | 1558 | ent.setHomeState( slHomeAddress[4] ); |
1545 | ent.setBusinessState( slBusinessAddress[4] ); | 1559 | ent.setBusinessState( slBusinessAddress[4] ); |
1546 | } | 1560 | } |
1547 | 1561 | ||
1548 | if (hasZip) { | 1562 | if (hasZip) { |
1549 | ent.setHomeZip( slHomeAddress[5] ); | 1563 | ent.setHomeZip( slHomeAddress[5] ); |
1550 | ent.setBusinessZip( slBusinessAddress[5] ); | 1564 | ent.setBusinessZip( slBusinessAddress[5] ); |
1551 | } | 1565 | } |
1552 | 1566 | ||
1553 | if (hasCountry) { | 1567 | if (hasCountry) { |
1554 | ent.setHomeCountry( slHomeAddress[6] ); | 1568 | ent.setHomeCountry( slHomeAddress[6] ); |
1555 | ent.setBusinessCountry( slBusinessAddress[6] ); | 1569 | ent.setBusinessCountry( slBusinessAddress[6] ); |
1556 | } | 1570 | } |
1557 | 1571 | ||
1558 | QStringList::ConstIterator it; | 1572 | QStringList::ConstIterator it; |
1559 | QListIterator<QLineEdit> itLE( listValue ); | 1573 | QListIterator<QLineEdit> itLE( listValue ); |
1560 | for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) { | 1574 | for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) { |
1561 | if ( *it == "Department" ) | 1575 | if ( *it == tr( "Department" ) ) |
1562 | ent.setDepartment( (*itLE)->text() ); | 1576 | ent.setDepartment( (*itLE)->text() ); |
1563 | 1577 | ||
1564 | if ( *it == "Company" ) | 1578 | if ( *it == tr( "Company" ) ) |
1565 | ent.setCompany( (*itLE)->text() ); | 1579 | ent.setCompany( (*itLE)->text() ); |
1566 | 1580 | ||
1567 | if ( *it == "Office" ) | 1581 | if ( *it == tr( "Office" ) ) |
1568 | ent.setOffice( (*itLE)->text() ); | 1582 | ent.setOffice( (*itLE)->text() ); |
1569 | 1583 | ||
1570 | if ( *it == "Profession" ) | 1584 | if ( *it == tr( "Profession" ) ) |
1571 | ent.setProfession( (*itLE)->text() ); | 1585 | ent.setProfession( (*itLE)->text() ); |
1572 | 1586 | ||
1573 | if ( *it == "Assistant" ) | 1587 | if ( *it == tr( "Assistant" ) ) |
1574 | ent.setAssistant( (*itLE)->text() ); | 1588 | ent.setAssistant( (*itLE)->text() ); |
1575 | 1589 | ||
1576 | if ( *it == "Manager" ) | 1590 | if ( *it == tr( "Manager" ) ) |
1577 | ent.setManager( (*itLE)->text() ); | 1591 | ent.setManager( (*itLE)->text() ); |
1578 | 1592 | ||
1579 | if ( *it == "Spouse" ) | 1593 | if ( *it == tr( "Spouse" ) ) |
1580 | ent.setSpouse( (*itLE)->text() ); | 1594 | ent.setSpouse( (*itLE)->text() ); |
1581 | 1595 | ||
1582 | if ( *it == "Birthday" ) | 1596 | if ( *it == tr( "Birthday" ) ) |
1583 | ent.setBirthday( (*itLE)->text() ); | 1597 | ent.setBirthday( (*itLE)->text() ); |
1584 | 1598 | ||
1585 | if ( *it == "Anniversary" ) | 1599 | if ( *it == tr( "Anniversary" ) ) |
1586 | ent.setAnniversary( (*itLE)->text() ); | 1600 | ent.setAnniversary( (*itLE)->text() ); |
1587 | 1601 | ||
1588 | if ( *it == "Nickname" ) | 1602 | if ( *it == tr( "Nickname" ) ) |
1589 | ent.setNickname( (*itLE)->text() ); | 1603 | ent.setNickname( (*itLE)->text() ); |
1590 | 1604 | ||
1591 | if ( *it == "Children" ) | 1605 | if ( *it == tr( "Children" ) ) |
1592 | ent.setChildren( (*itLE)->text() ); | 1606 | ent.setChildren( (*itLE)->text() ); |
1593 | 1607 | ||
1594 | } | 1608 | } |
1595 | 1609 | ||
1596 | QStringList::ConstIterator itV; | 1610 | QStringList::ConstIterator itV; |
1597 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { | 1611 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { |
1598 | 1612 | ||
1599 | if ( ( *it == "Business Phone" ) || ( *it == "Work Phone" ) ) | 1613 | if ( ( *it == "Business Phone" ) || ( *it == "Work Phone" ) ) |
1600 | ent.setBusinessPhone( *itV ); | 1614 | ent.setBusinessPhone( *itV ); |
1601 | /* | 1615 | /* |
1602 | if ( *it == tr("Business 2 Phone" ) | 1616 | if ( *it == tr("Business 2 Phone" ) |
1603 | ent.setBusiness2Phone( *itV ); | 1617 | ent.setBusiness2Phone( *itV ); |
1604 | */ | 1618 | */ |
1605 | if ( ( *it == "Business Fax" ) || ( *it == "Work Fax" ) ) | 1619 | if ( ( *it == "Business Fax" ) || ( *it == "Work Fax" ) ) |
1606 | ent.setBusinessFax( *itV ); | 1620 | ent.setBusinessFax( *itV ); |
1607 | 1621 | ||
1608 | if ( ( *it == "Business Mobile" ) || ( *it == "Work Mobile" ) ) | 1622 | if ( ( *it == "Business Mobile" ) || ( *it == "Work Mobile" ) ) |
1609 | ent.setBusinessMobile( *itV ); | 1623 | ent.setBusinessMobile( *itV ); |
1610 | /* | 1624 | /* |
1611 | if ( *it == "Company Phone" ) | 1625 | if ( *it == "Company Phone" ) |
1612 | ent.setCompanyPhone( *itV ); | 1626 | ent.setCompanyPhone( *itV ); |
1613 | */ | 1627 | */ |
1614 | //if ( *it == "Default Email" ) | 1628 | //if ( *it == "Default Email" ) |
1615 | //ent.setDefaultEmail( *itV ); | 1629 | //ent.setDefaultEmail( *itV ); |
1616 | 1630 | ||
1617 | if ( *it == "Emails" ){ | 1631 | if ( *it == "Emails" ){ |
1618 | QString allemail; | 1632 | QString allemail; |
1619 | QString defaultmail; | 1633 | QString defaultmail; |
1620 | parseEmailFrom( *itV, defaultmail, allemail ); | 1634 | parseEmailFrom( *itV, defaultmail, allemail ); |
1621 | // ent.clearEmails(); | 1635 | // ent.clearEmails(); |
1622 | ent.setDefaultEmail( defaultmail ); | 1636 | ent.setDefaultEmail( defaultmail ); |
1623 | ent.setEmails( allemail ); | 1637 | ent.setEmails( allemail ); |
1624 | } | 1638 | } |
1625 | 1639 | ||
1626 | if ( *it == "Home Phone" ) | 1640 | if ( *it == "Home Phone" ) |
1627 | ent.setHomePhone( *itV ); | 1641 | ent.setHomePhone( *itV ); |
1628 | /* | 1642 | /* |
1629 | if ( *it == "Home 2 Phone" ) | 1643 | if ( *it == "Home 2 Phone" ) |
1630 | ent.setHome2Phone( *itV ); | 1644 | ent.setHome2Phone( *itV ); |
1631 | */ | 1645 | */ |
1632 | if ( *it == "Home Fax" ) | 1646 | if ( *it == "Home Fax" ) |
1633 | ent.setHomeFax( *itV ); | 1647 | ent.setHomeFax( *itV ); |
1634 | 1648 | ||
1635 | if ( *it == "Home Mobile" ) | 1649 | if ( *it == "Home Mobile" ) |
1636 | ent.setHomeMobile( *itV ); | 1650 | ent.setHomeMobile( *itV ); |
1637 | /* | 1651 | /* |
1638 | if ( *it == "Car Phone" ) | 1652 | if ( *it == "Car Phone" ) |
1639 | ent.setCarPhone( *itV ); | 1653 | ent.setCarPhone( *itV ); |