summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/contacteditor.cpp
Unidiff
Diffstat (limited to 'core/pim/addressbook/contacteditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/contacteditor.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index 312c663..b078968 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -76,13 +76,13 @@ ContactEditor::ContactEditor( const Opie::OPimContact &entry,
76} 76}
77 77
78ContactEditor::~ContactEditor() { 78ContactEditor::~ContactEditor() {
79} 79}
80 80
81void ContactEditor::init() { 81void ContactEditor::init() {
82 owarn << "init() START" << oendl; 82 odebug << "init() START" << oendl;
83 83
84 uint i = 0; 84 uint i = 0;
85 85
86 QStringList trlChooserNames; 86 QStringList trlChooserNames;
87 87
88 for (i = 0; i <= 6; i++) { 88 for (i = 0; i <= 6; i++) {
@@ -685,13 +685,13 @@ void ContactEditor::init() {
685 this, SLOT(slotAddressTypeChange(int)) ); 685 this, SLOT(slotAddressTypeChange(int)) );
686 686
687 new QPEDialogListener(this); 687 new QPEDialogListener(this);
688 688
689 setPersonalView ( m_personalView ); 689 setPersonalView ( m_personalView );
690 690
691 owarn << "init() END" << oendl; 691 odebug << "init() END" << oendl;
692} 692}
693 693
694void ContactEditor::defaultEmailChanged(int i){ 694void ContactEditor::defaultEmailChanged(int i){
695 odebug << "defaultEmailChanged" << oendl; 695 odebug << "defaultEmailChanged" << oendl;
696 696
697 // was sollte das ? (se) 697 // was sollte das ? (se)
@@ -736,21 +736,21 @@ void ContactEditor::populateDefaultEmailCmb(){
736 736
737// Called when any combobox was changed. 737// Called when any combobox was changed.
738// "true" returned if the change was chandled by this function, else it should 738// "true" returned if the change was chandled by this function, else it should
739// be handled by something else.. 739// be handled by something else..
740bool ContactEditor::cmbChooserChange( int index, QWidgetStack* inputStack, int widgetPos ) { 740bool ContactEditor::cmbChooserChange( int index, QWidgetStack* inputStack, int widgetPos ) {
741 QString type = slChooserNames[index]; 741 QString type = slChooserNames[index];
742 owarn << "ContactEditor::cmbChooserChange -> Type: " << type 742 odebug << "ContactEditor::cmbChooserChange -> Type: " << type
743 << ", WidgetPos: " << widgetPos << oendl; 743 << ", WidgetPos: " << widgetPos << oendl;
744 744
745 if ( !initializing ) 745 if ( !initializing )
746 contactfields.setFieldOrder( widgetPos-1, index ); 746 contactfields.setFieldOrder( widgetPos-1, index );
747 747
748 // Create and connect combobox for selecting the default email 748 // Create and connect combobox for selecting the default email
749 if ( type == "Default Email"){ 749 if ( type == "Default Email"){
750 owarn << "Choosing default-email (defaultEmailChooserPosition= " 750 odebug << "Choosing default-email (defaultEmailChooserPosition= "
751 << defaultEmailChooserPosition << ") " << oendl; 751 << defaultEmailChooserPosition << ") " << oendl;
752 752
753 // More than one default-email chooser is not allowed ! 753 // More than one default-email chooser is not allowed !
754 if ( ( defaultEmailChooserPosition != -1 ) && 754 if ( ( defaultEmailChooserPosition != -1 ) &&
755 defaultEmailChooserPosition != widgetPos && !initializing){ 755 defaultEmailChooserPosition != widgetPos && !initializing){
756 chooserError( widgetPos ); 756 chooserError( widgetPos );
@@ -778,13 +778,13 @@ bool ContactEditor::cmbChooserChange( int index, QWidgetStack* inputStack, int w
778 // Set current default email 778 // Set current default email
779 populateDefaultEmailCmb(); 779 populateDefaultEmailCmb();
780 780
781 781
782 } else { 782 } else {
783 // Something else was selected: Hide combo.. 783 // Something else was selected: Hide combo..
784 owarn << " Hiding default-email combo" << oendl; 784 odebug << " Hiding default-email combo" << oendl;
785 if ( defaultEmailChooserPosition == widgetPos ){ 785 if ( defaultEmailChooserPosition == widgetPos ){
786 defaultEmailChooserPosition = -1; 786 defaultEmailChooserPosition = -1;
787 } 787 }
788 QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo ); 788 QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo );
789 if ( cmbo ){ 789 if ( cmbo ){
790 inputStack->raiseWidget( TextField ); 790 inputStack->raiseWidget( TextField );
@@ -844,13 +844,13 @@ void ContactEditor::chooserChange( const QString &textChanged, int index,
844 QString type = slChooserNames[index]; // :SX 844 QString type = slChooserNames[index]; // :SX
845 odebug << "ContactEditor::chooserChange( type=>" << type << "<, textChanged=>" 845 odebug << "ContactEditor::chooserChange( type=>" << type << "<, textChanged=>"
846 << textChanged << "< index=" << index << ", widgetPos=" << widgetPos 846 << textChanged << "< index=" << index << ", widgetPos=" << widgetPos
847 << " )" << oendl; 847 << " )" << oendl;
848 848
849 if ( type == "Default Email"){ 849 if ( type == "Default Email"){
850 owarn << "??? Wozu??: " << textChanged << oendl; 850 odebug << "??? Wozu??: " << textChanged << oendl;
851 defaultEmail = textChanged; 851 defaultEmail = textChanged;
852 852
853 populateDefaultEmailCmb(); 853 populateDefaultEmailCmb();
854 854
855 }else if (type == "Emails"){ 855 }else if (type == "Emails"){
856 odebug << "emails" << oendl; 856 odebug << "emails" << oendl;
@@ -863,29 +863,29 @@ void ContactEditor::chooserChange( const QString &textChanged, int index,
863 863
864 slChooserValues[index] = textChanged; 864 slChooserValues[index] = textChanged;
865 865
866} 866}
867 867
868void ContactEditor::slotChooser1Change( const QString &textChanged ) { 868void ContactEditor::slotChooser1Change( const QString &textChanged ) {
869 owarn << "ContactEditor::slotChooser1Change( " << textChanged << " )" << oendl; 869 odebug << "ContactEditor::slotChooser1Change( " << textChanged << " )" << oendl;
870 chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1); 870 chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1);
871} 871}
872 872
873void ContactEditor::slotChooser2Change( const QString &textChanged ) { 873void ContactEditor::slotChooser2Change( const QString &textChanged ) {
874 owarn << "ContactEditor::slotChooser2Change( " << textChanged << " )" << oendl; 874 odebug << "ContactEditor::slotChooser2Change( " << textChanged << " )" << oendl;
875 chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2, 2); 875 chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2, 2);
876 876
877} 877}
878 878
879void ContactEditor::slotChooser3Change( const QString &textChanged ) { 879void ContactEditor::slotChooser3Change( const QString &textChanged ) {
880 owarn << "ContactEditor::slotChooser3Change( " << textChanged << " )" << oendl; 880 odebug << "ContactEditor::slotChooser3Change( " << textChanged << " )" << oendl;
881 chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3, 3); 881 chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3, 3);
882} 882}
883 883
884void ContactEditor::slotChooser4Change( const QString &textChanged ) { 884void ContactEditor::slotChooser4Change( const QString &textChanged ) {
885 owarn << "ContactEditor::slotChooser4Change( " << textChanged << " )" << oendl; 885 odebug << "ContactEditor::slotChooser4Change( " << textChanged << " )" << oendl;
886 chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4, 4); 886 chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4, 4);
887} 887}
888 888
889void ContactEditor::slotAddressChange( const QString &textChanged ) { 889void ContactEditor::slotAddressChange( const QString &textChanged ) {
890 890
891 if ( cmbAddress->currentItem() == 0 ) { 891 if ( cmbAddress->currentItem() == 0 ) {
@@ -949,46 +949,46 @@ void ContactEditor::slotCountryChange( const QString &textChanged ) {
949 slHomeAddress[6] = textChanged; 949 slHomeAddress[6] = textChanged;
950 } 950 }
951} 951}
952 952
953 953
954void ContactEditor::slotCmbChooser1Change( int index ) { 954void ContactEditor::slotCmbChooser1Change( int index ) {
955 owarn << "ContactEditor::slotCmbChooser1Change( " << index << " )" << oendl; 955 odebug << "ContactEditor::slotCmbChooser1Change( " << index << " )" << oendl;
956 if ( !cmbChooserChange( cmbChooserField1->currentItem(), m_widgetStack1, 1) ){ 956 if ( !cmbChooserChange( cmbChooserField1->currentItem(), m_widgetStack1, 1) ){
957 957
958 txtChooserField1->setText( slChooserValues[index] ); 958 txtChooserField1->setText( slChooserValues[index] );
959 txtChooserField1->setFocus(); 959 txtChooserField1->setFocus();
960 960
961 } 961 }
962 962
963} 963}
964 964
965void ContactEditor::slotCmbChooser2Change( int index ) { 965void ContactEditor::slotCmbChooser2Change( int index ) {
966 owarn << "ContactEditor::slotCmbChooser2Change( " << index << " )" << oendl; 966 odebug << "ContactEditor::slotCmbChooser2Change( " << index << " )" << oendl;
967 967
968 if ( !cmbChooserChange( cmbChooserField2->currentItem(), m_widgetStack2, 2) ){ 968 if ( !cmbChooserChange( cmbChooserField2->currentItem(), m_widgetStack2, 2) ){
969 969
970 txtChooserField2->setText( slChooserValues[index] ); 970 txtChooserField2->setText( slChooserValues[index] );
971 txtChooserField2->setFocus(); 971 txtChooserField2->setFocus();
972 972
973 } 973 }
974} 974}
975 975
976void ContactEditor::slotCmbChooser3Change( int index ) { 976void ContactEditor::slotCmbChooser3Change( int index ) {
977 owarn << "ContactEditor::slotCmbChooser3Change( " << index << " )" << oendl; 977 odebug << "ContactEditor::slotCmbChooser3Change( " << index << " )" << oendl;
978 978
979 if ( !cmbChooserChange( cmbChooserField3->currentItem(), m_widgetStack3, 3) ){ 979 if ( !cmbChooserChange( cmbChooserField3->currentItem(), m_widgetStack3, 3) ){
980 980
981 txtChooserField3->setText( slChooserValues[index] ); 981 txtChooserField3->setText( slChooserValues[index] );
982 txtChooserField3->setFocus(); 982 txtChooserField3->setFocus();
983 983
984 } 984 }
985} 985}
986 986
987void ContactEditor::slotCmbChooser4Change( int index ) { 987void ContactEditor::slotCmbChooser4Change( int index ) {
988 owarn << "ContactEditor::slotCmbChooser4Change( " << index << " )" << oendl; 988 odebug << "ContactEditor::slotCmbChooser4Change( " << index << " )" << oendl;
989 989
990 if ( !cmbChooserChange( cmbChooserField4->currentItem(), m_widgetStack4, 4) ){ 990 if ( !cmbChooserChange( cmbChooserField4->currentItem(), m_widgetStack4, 4) ){
991 991
992 txtChooserField4->setText( slChooserValues[index] ); 992 txtChooserField4->setText( slChooserValues[index] );
993 txtChooserField4->setFocus(); 993 txtChooserField4->setFocus();
994 994
@@ -1027,13 +1027,13 @@ void ContactEditor::slotAddressTypeChange( int index ) {
1027 } 1027 }
1028 1028
1029} 1029}
1030 1030
1031void ContactEditor::slotFullNameChange( const QString &textChanged ) { 1031void ContactEditor::slotFullNameChange( const QString &textChanged ) {
1032 1032
1033 owarn << "ContactEditor::slotFullNameChange( " << textChanged << " )" << oendl; 1033 odebug << "ContactEditor::slotFullNameChange( " << textChanged << " )" << oendl;
1034 1034
1035 int index = cmbFileAs->currentItem(); 1035 int index = cmbFileAs->currentItem();
1036 1036
1037 cmbFileAs->clear(); 1037 cmbFileAs->clear();
1038 1038
1039 cmbFileAs->insertItem( parseName( textChanged, NAME_LF ) ); 1039 cmbFileAs->insertItem( parseName( textChanged, NAME_LF ) );
@@ -1051,13 +1051,13 @@ void ContactEditor::slotFullNameChange( const QString &textChanged ) {
1051void ContactEditor::slotSuffixChange( const QString& ) { 1051void ContactEditor::slotSuffixChange( const QString& ) {
1052 // Just want to update the FileAs combo if the suffix was changed.. 1052 // Just want to update the FileAs combo if the suffix was changed..
1053 slotFullNameChange( txtFullName->text() ); 1053 slotFullNameChange( txtFullName->text() );
1054} 1054}
1055 1055
1056void ContactEditor::slotOrganizationChange( const QString &textChanged ){ 1056void ContactEditor::slotOrganizationChange( const QString &textChanged ){
1057 owarn << "ContactEditor::slotOrganizationChange( " << textChanged << " )" << oendl; 1057 odebug << "ContactEditor::slotOrganizationChange( " << textChanged << " )" << oendl;
1058 // Special handling for storing Companies: 1058 // Special handling for storing Companies:
1059 // If no Fullname is given, we store the Company-Name as lastname 1059 // If no Fullname is given, we store the Company-Name as lastname
1060 // to handle it like a person.. 1060 // to handle it like a person..
1061 if ( txtFullName->text() == txtOrganization->text().left( txtFullName->text().length() ) ) 1061 if ( txtFullName->text() == txtOrganization->text().left( txtFullName->text().length() ) )
1062 txtFullName->setText( textChanged ); 1062 txtFullName->setText( textChanged );
1063 1063
@@ -1133,26 +1133,26 @@ QString ContactEditor::parseName( const QString fullName, int type ) {
1133 QString strMiddleName; 1133 QString strMiddleName;
1134 QString strLastName; 1134 QString strLastName;
1135 QString strTitle; 1135 QString strTitle;
1136 int commapos; 1136 int commapos;
1137 bool haveLastName = false; 1137 bool haveLastName = false;
1138 1138
1139 owarn << "Fullname: " << simplifiedName << oendl; 1139 odebug << "Fullname: " << simplifiedName << oendl;
1140 1140
1141 commapos = simplifiedName.find( ',', 0, TRUE); 1141 commapos = simplifiedName.find( ',', 0, TRUE);
1142 if ( commapos >= 0 ) { 1142 if ( commapos >= 0 ) {
1143 owarn << " Commapos: " << commapos << oendl; 1143 odebug << " Commapos: " << commapos << oendl;
1144 1144
1145 // A comma (",") separates the lastname from one or 1145 // A comma (",") separates the lastname from one or
1146 // many first names. Thus, remove the lastname from the 1146 // many first names. Thus, remove the lastname from the
1147 // String and parse the firstnames. 1147 // String and parse the firstnames.
1148 1148
1149 strLastName = simplifiedName.left( commapos ); 1149 strLastName = simplifiedName.left( commapos );
1150 simplifiedName= simplifiedName.mid( commapos + 1 ); 1150 simplifiedName= simplifiedName.mid( commapos + 1 );
1151 haveLastName = true; 1151 haveLastName = true;
1152 owarn << "Fullname without ',': " << simplifiedName << oendl; 1152 odebug << "Fullname without ',': " << simplifiedName << oendl;
1153 1153
1154 // If we have any lastname, we should now split all first names. 1154 // If we have any lastname, we should now split all first names.
1155 // The first one will be the used as first, the rest as "middle names" 1155 // The first one will be the used as first, the rest as "middle names"
1156 1156
1157 QStringList allFirstNames = QStringList::split(" ", simplifiedName); 1157 QStringList allFirstNames = QStringList::split(" ", simplifiedName);
1158 QStringList::Iterator it = allFirstNames.begin(); 1158 QStringList::Iterator it = allFirstNames.begin();
@@ -1180,16 +1180,16 @@ QString ContactEditor::parseName( const QString fullName, int type ) {
1180 1180
1181 } 1181 }
1182 1182
1183 if ( strFirstName == strLastName ) 1183 if ( strFirstName == strLastName )
1184 strFirstName = ""; 1184 strFirstName = "";
1185 1185
1186 owarn << "strFirstName: " << strFirstName << oendl; 1186 odebug << "strFirstName: " << strFirstName << oendl;
1187 owarn << "strMiddletName: " << strMiddleName << oendl; 1187 odebug << "strMiddletName: " << strMiddleName << oendl;
1188 owarn << "strLastName: " << strLastName << oendl; 1188 odebug << "strLastName: " << strLastName << oendl;
1189 owarn << "strTitle: " << strTitle << oendl; 1189 odebug << "strTitle: " << strTitle << oendl;
1190 1190
1191 switch (type) { 1191 switch (type) {
1192 case NAME_FL: 1192 case NAME_FL:
1193 return strFirstName + " " + strLastName; 1193 return strFirstName + " " + strLastName;
1194 1194
1195 case NAME_LF: 1195 case NAME_LF:
@@ -1326,13 +1326,13 @@ void ContactEditor::setEntry( const Opie::OPimContact &entry ) {
1326 //} 1326 //}
1327 1327
1328 QStringList::ConstIterator it; 1328 QStringList::ConstIterator it;
1329 QListIterator<QLineEdit> itLE( listValue ); 1329 QListIterator<QLineEdit> itLE( listValue );
1330 for ( it = slDynamicEntries.begin(); itLE.current()/* != slDynamicEntries.end()*/; ++it, ++itLE) { 1330 for ( it = slDynamicEntries.begin(); itLE.current()/* != slDynamicEntries.end()*/; ++it, ++itLE) {
1331 1331
1332 owarn << " Filling dynamic Field: " << (*it) << oendl; 1332 odebug << " Filling dynamic Field: " << (*it) << oendl;
1333 1333
1334 if ( *it == "Department" ) 1334 if ( *it == "Department" )
1335 (*itLE)->setText( ent.department() ); 1335 (*itLE)->setText( ent.department() );
1336 1336
1337 if ( *it == "Company" ) 1337 if ( *it == "Company" )
1338 (*itLE)->setText( ent.company() ); 1338 (*itLE)->setText( ent.company() );
@@ -1350,13 +1350,13 @@ void ContactEditor::setEntry( const Opie::OPimContact &entry ) {
1350 (*itLE)->setText( ent.manager() ); 1350 (*itLE)->setText( ent.manager() );
1351 1351
1352 if ( *it == "Spouse" ) 1352 if ( *it == "Spouse" )
1353 (*itLE)->setText( ent.spouse() ); 1353 (*itLE)->setText( ent.spouse() );
1354 1354
1355 if ( *it == "Nickname" ){ 1355 if ( *it == "Nickname" ){
1356 owarn << "**** Nichname: " << ent.nickname() << oendl; 1356 odebug << "**** Nichname: " << ent.nickname() << oendl;
1357 (*itLE)->setText( ent.nickname() ); 1357 (*itLE)->setText( ent.nickname() );
1358 } 1358 }
1359 1359
1360 if ( *it == "Children" ) 1360 if ( *it == "Children" )
1361 (*itLE)->setText( ent.children() ); 1361 (*itLE)->setText( ent.children() );
1362 1362
@@ -1583,14 +1583,14 @@ void ContactEditor::saveEntry() {
1583 1583
1584 if ( *it == "Emails" ){ 1584 if ( *it == "Emails" ){
1585 QString allemail; 1585 QString allemail;
1586 QString defaultmail; 1586 QString defaultmail;
1587 parseEmailFrom( emails.join(","), defaultmail, allemail ); 1587 parseEmailFrom( emails.join(","), defaultmail, allemail );
1588 if ( defaultEmail.isEmpty() ){ 1588 if ( defaultEmail.isEmpty() ){
1589 owarn << "Default email was not set by user!" << oendl; 1589 odebug << "Default email was not set by user!" << oendl;
1590 owarn << "Using first email in list: " << defaultmail << oendl; 1590 odebug << "Using first email in list: " << defaultmail << oendl;
1591 ent.setDefaultEmail( defaultmail ); 1591 ent.setDefaultEmail( defaultmail );
1592 } 1592 }
1593 ent.setEmails( allemail ); 1593 ent.setEmails( allemail );
1594 } 1594 }
1595 1595
1596 if ( *it == "Default Email") 1596 if ( *it == "Default Email")
@@ -1736,17 +1736,17 @@ void ContactEditor::slotBirthdayDateChanged( int year, int month, int day)
1736 birthdayButton->setText( dateString ); 1736 birthdayButton->setText( dateString );
1737 ent.setBirthday ( date ); 1737 ent.setBirthday ( date );
1738} 1738}
1739 1739
1740void ContactEditor::slotRemoveBirthday() 1740void ContactEditor::slotRemoveBirthday()
1741{ 1741{
1742 owarn << "void ContactEditor::slotRemoveBirthday()" << oendl; 1742 odebug << "void ContactEditor::slotRemoveBirthday()" << oendl;
1743 ent.setBirthday( QDate() ); 1743 ent.setBirthday( QDate() );
1744 updateDatePicker(); 1744 updateDatePicker();
1745} 1745}
1746 1746
1747void ContactEditor::slotRemoveAnniversary() 1747void ContactEditor::slotRemoveAnniversary()
1748{ 1748{
1749 owarn << "void ContactEditor::slotRemoveAnniversary()" << oendl; 1749 odebug << "void ContactEditor::slotRemoveAnniversary()" << oendl;
1750 ent.setAnniversary( QDate() ); 1750 ent.setAnniversary( QDate() );
1751 updateDatePicker(); 1751 updateDatePicker();
1752} 1752}