-rw-r--r-- | core/pim/addressbook/TODO | 11 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 9 | ||||
-rw-r--r-- | core/pim/addressbook/configdlg_base.ui | 6 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 153 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.h | 16 |
5 files changed, 154 insertions, 41 deletions
diff --git a/core/pim/addressbook/TODO b/core/pim/addressbook/TODO index 96134f4..100a6fd 100644 --- a/core/pim/addressbook/TODO +++ b/core/pim/addressbook/TODO | |||
@@ -9,5 +9,3 @@ Important: | |||
9 | 9 | ||
10 | - Personal contact editor: Disable categories | ||
11 | - Name order selected in "contacteditor" not used in list view. | 10 | - Name order selected in "contacteditor" not used in list view. |
12 | - contacteditor: Birthday, annyversary, ... : Use Dateselector | ||
13 | 11 | ||
@@ -15,3 +13,4 @@ Important: | |||
15 | - Cursor keys should work in detail-view (ablabel) | 13 | - Cursor keys should work in detail-view (ablabel) |
16 | - "What's this" should be added | 14 | -> Ablabel should be removed and Abtable should be increased with |
15 | different views (as started by darwin zins).. | ||
17 | - Store last settings of combo-boxes | 16 | - Store last settings of combo-boxes |
@@ -21,2 +20,3 @@ Important: | |||
21 | - Reload if contacts were changed externally | 20 | - Reload if contacts were changed externally |
21 | - "What's this" should be added | ||
22 | 22 | ||
@@ -31,3 +31,3 @@ Less important: | |||
31 | Should be Fixed (not absolute sure, need further validation): | 31 | Should be Fixed (not absolute sure, need further validation): |
32 | - "Nonenglish" translation bug has to be fixed. | 32 | |
33 | 33 | ||
@@ -43 +43,4 @@ Fixed: | |||
43 | - Font menu is invisible using german translation | 43 | - Font menu is invisible using german translation |
44 | - Personal contact editor: Disable categories | ||
45 | - "Nonenglish" translation bug has to be fixed. | ||
46 | - contacteditor: Birthday, annyversary, ... : Use Dateselector | ||
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 39d8321..108e66d 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp | |||
@@ -96,3 +96,3 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
96 | cfg.setGroup("Mail"); | 96 | cfg.setGroup("Mail"); |
97 | m_useQtMail = cfg.readBoolEntry( "useQtMail" ); | 97 | m_useQtMail = cfg.readBoolEntry( "useQtMail", true ); |
98 | m_useOpieMail=cfg.readBoolEntry( "useOpieMail" ); | 98 | m_useOpieMail=cfg.readBoolEntry( "useOpieMail" ); |
@@ -675,2 +675,3 @@ void AddressbookWindow::editPersonal() | |||
675 | if (bAbEditFirstTime) { | 675 | if (bAbEditFirstTime) { |
676 | qWarning("Editing personal data"); | ||
676 | abEditor = new ContactEditor( me, &orderedFields, &slOrderedFields, | 677 | abEditor = new ContactEditor( me, &orderedFields, &slOrderedFields, |
@@ -679,4 +680,7 @@ void AddressbookWindow::editPersonal() | |||
679 | bAbEditFirstTime = FALSE; | 680 | bAbEditFirstTime = FALSE; |
680 | } else | 681 | } else{ |
681 | abEditor->setEntry( me ); | 682 | abEditor->setEntry( me ); |
683 | } | ||
684 | |||
685 | abEditor->setPersonalView( true ); | ||
682 | 686 | ||
@@ -696,2 +700,3 @@ void AddressbookWindow::editPersonal() | |||
696 | abEditor->setCaption( tr("Edit Address") ); | 700 | abEditor->setCaption( tr("Edit Address") ); |
701 | abEditor->setPersonalView( false ); | ||
697 | } | 702 | } |
diff --git a/core/pim/addressbook/configdlg_base.ui b/core/pim/addressbook/configdlg_base.ui index d3ea12e..a6fcffa 100644 --- a/core/pim/addressbook/configdlg_base.ui +++ b/core/pim/addressbook/configdlg_base.ui | |||
@@ -14,4 +14,4 @@ | |||
14 | <y>0</y> | 14 | <y>0</y> |
15 | <width>217</width> | 15 | <width>244</width> |
16 | <height>287</height> | 16 | <height>298</height> |
17 | </rect> | 17 | </rect> |
@@ -331,2 +331,4 @@ is provided free !</string> | |||
331 | <tabstop>m_signalWrapAround</tabstop> | 331 | <tabstop>m_signalWrapAround</tabstop> |
332 | <tabstop>m_useQtMail</tabstop> | ||
333 | <tabstop>m_useOpieMail</tabstop> | ||
332 | <tabstop>buttonOk</tabstop> | 334 | <tabstop>buttonOk</tabstop> |
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index e7f2ebd..a59a927 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -26,2 +26,3 @@ | |||
26 | #include <qpe/qpedialog.h> | 26 | #include <qpe/qpedialog.h> |
27 | #include <qpe/timeconversion.h> | ||
27 | 28 | ||
@@ -38,2 +39,3 @@ | |||
38 | #include <qvaluelist.h> | 39 | #include <qvaluelist.h> |
40 | #include <qpopupmenu.h> | ||
39 | 41 | ||
@@ -59,3 +61,4 @@ ContactEditor::ContactEditor( const OContact &entry, | |||
59 | orderedValues( newOrderedValues ), | 61 | orderedValues( newOrderedValues ), |
60 | slOrdered( *slNewOrdered ) | 62 | slOrdered( *slNewOrdered ), |
63 | m_personalView ( false ) | ||
61 | { | 64 | { |
@@ -208,3 +211,12 @@ void ContactEditor::init() { | |||
208 | 211 | ||
209 | if ( *it == "Name Title" || *it == "First Name" || *it == "Middle Name" || *it == "Last Name" || *it == "File As" || *it == "Default Email" || *it == "Emails" || *it == "Groups" ) | 212 | if ( *it == "Name Title" || |
213 | *it == "First Name" || | ||
214 | *it == "Middle Name" || | ||
215 | *it == "Last Name" || | ||
216 | *it == "File As" || | ||
217 | *it == "Default Email" || | ||
218 | *it == "Emails" || | ||
219 | *it == "Groups" || | ||
220 | *it == "Anniversary" || | ||
221 | *it == "Birthday" ) | ||
210 | continue; | 222 | continue; |
@@ -404,4 +416,4 @@ void ContactEditor::init() { | |||
404 | 416 | ||
405 | l = new QLabel( tr( "Category" ), container ); | 417 | labCat = new QLabel( tr( "Category" ), container ); |
406 | gl->addWidget( l, 7, 0 ); | 418 | gl->addWidget( labCat, 7, 0 ); |
407 | cmbCat = new CategorySelect( container ); | 419 | cmbCat = new CategorySelect( container ); |
@@ -409,2 +421,12 @@ void ContactEditor::init() { | |||
409 | 421 | ||
422 | // We don't need categories for the personal view | ||
423 | if ( m_personalView ){ | ||
424 | qWarning("Disable Category.."); | ||
425 | labCat->hide(); | ||
426 | cmbCat->hide(); | ||
427 | } else { | ||
428 | labCat->show(); | ||
429 | cmbCat->show(); | ||
430 | } | ||
431 | |||
410 | btnNote = new QPushButton( tr( "Notes..." ), container ); | 432 | btnNote = new QPushButton( tr( "Notes..." ), container ); |
@@ -709,5 +731,52 @@ void ContactEditor::init() { | |||
709 | 731 | ||
732 | int counter = 0; | ||
733 | |||
734 | // Birthday | ||
735 | l = new QLabel( tr("Birthday"), container ); | ||
736 | gl->addWidget( l, counter, 0 ); | ||
737 | |||
738 | QPopupMenu* m1 = new QPopupMenu( container ); | ||
739 | birthdayPicker = new DateBookMonth( m1, 0, TRUE ); | ||
740 | m1->insertItem( birthdayPicker ); | ||
741 | |||
742 | birthdayButton= new QToolButton( container, "buttonStart" ); | ||
743 | birthdayButton->setPopup( m1 ); | ||
744 | birthdayButton->setPopupDelay(0); | ||
745 | gl->addWidget( birthdayButton, counter , 1 ); | ||
746 | connect( birthdayPicker, SIGNAL( dateClicked( int, int, int ) ), | ||
747 | this, SLOT( slotBirthdayDateChanged( int, int, int ) ) ); | ||
748 | |||
749 | ++counter; | ||
750 | |||
751 | // Anniversary | ||
752 | l = new QLabel( tr("Anniversary"), container ); | ||
753 | gl->addWidget( l, counter, 0 ); | ||
754 | |||
755 | m1 = new QPopupMenu( container ); | ||
756 | anniversaryPicker = new DateBookMonth( m1, 0, TRUE ); | ||
757 | m1->insertItem( anniversaryPicker ); | ||
758 | |||
759 | anniversaryButton= new QToolButton( container, "buttonStart" ); | ||
760 | anniversaryButton->setPopup( m1 ); | ||
761 | anniversaryButton->setPopupDelay(0); | ||
762 | gl->addWidget( anniversaryButton, counter , 1 ); | ||
763 | connect( anniversaryPicker, SIGNAL( dateClicked( int, int, int ) ), | ||
764 | this, SLOT( slotAnniversaryDateChanged( int, int, int ) ) ); | ||
765 | |||
766 | ++counter; | ||
767 | |||
768 | // Gender | ||
769 | l = new QLabel( tr("Gender"), container ); | ||
770 | gl->addWidget( l, counter, 0 ); | ||
771 | cmbGender = new QComboBox( container ); | ||
772 | cmbGender->insertItem( "", 0 ); | ||
773 | cmbGender->insertItem( tr("Male"), 1); | ||
774 | cmbGender->insertItem( tr("Female"), 2); | ||
775 | gl->addWidget( cmbGender, counter, 1 ); | ||
776 | |||
777 | ++counter; | ||
778 | |||
710 | // Create Labels and lineedit fields for every dynamic entry | 779 | // Create Labels and lineedit fields for every dynamic entry |
711 | QStringList::ConstIterator it = slDynamicEntries.begin(); | 780 | QStringList::ConstIterator it = slDynamicEntries.begin(); |
712 | for (i = 0; it != slDynamicEntries.end(); i++, ++it) { | 781 | for (i = counter; it != slDynamicEntries.end(); i++, ++it) { |
713 | l = new QLabel( QString::null , container ); | 782 | l = new QLabel( QString::null , container ); |
@@ -722,9 +791,2 @@ void ContactEditor::init() { | |||
722 | 791 | ||
723 | l = new QLabel( tr("Gender"), container ); | ||
724 | gl->addWidget( l, slDynamicEntries.count(), 0 ); | ||
725 | cmbGender = new QComboBox( container ); | ||
726 | cmbGender->insertItem( "", 0 ); | ||
727 | cmbGender->insertItem( tr("Male"), 1); | ||
728 | cmbGender->insertItem( tr("Female"), 2); | ||
729 | gl->addWidget( cmbGender, slDynamicEntries.count(), 1 ); | ||
730 | 792 | ||
@@ -1011,2 +1073,3 @@ void ContactEditor::slotFullNameChange( const QString &textChanged ) { | |||
1011 | 1073 | ||
1074 | // Loads the detail fields | ||
1012 | void ContactEditor::loadFields() { | 1075 | void ContactEditor::loadFields() { |
@@ -1038,8 +1101,2 @@ void ContactEditor::loadFields() { | |||
1038 | 1101 | ||
1039 | if ( *it == "Birthday" ) | ||
1040 | (*lit)->setText( tr( "Birthday" ) ); | ||
1041 | |||
1042 | if ( *it == "Anniversary" ) | ||
1043 | (*lit)->setText( tr( "Anniversary" ) ); | ||
1044 | |||
1045 | if ( *it == "Nickname" ) | 1102 | if ( *it == "Nickname" ) |
@@ -1050,2 +1107,17 @@ void ContactEditor::loadFields() { | |||
1050 | } | 1107 | } |
1108 | // Set DatePicker | ||
1109 | qWarning ("**Info: %s", ent.birthday().latin1() ); | ||
1110 | if ( !ent.birthday().isEmpty() ){ | ||
1111 | birthdayButton->setText( ent.birthday() ); | ||
1112 | birthdayPicker->setDate( TimeConversion::fromString ( ent.birthday() ) ); | ||
1113 | } else | ||
1114 | birthdayButton->setText( tr ("Unknown") ); | ||
1115 | |||
1116 | qWarning ("**Info: %s", ent.anniversary().latin1() ); | ||
1117 | if ( !ent.anniversary().isEmpty() ){ | ||
1118 | anniversaryButton->setText( ent.anniversary() ); | ||
1119 | anniversaryPicker->setDate( TimeConversion::fromString ( ent.birthday() ) ); | ||
1120 | } else | ||
1121 | anniversaryButton->setText( tr ("Unknown") ); | ||
1122 | |||
1051 | } | 1123 | } |
@@ -1431,8 +1503,2 @@ void ContactEditor::setEntry( const OContact &entry ) { | |||
1431 | 1503 | ||
1432 | if ( *it == "Birthday" ) | ||
1433 | (*itLE)->setText( ent.birthday() ); | ||
1434 | |||
1435 | if ( *it == "Anniversary" ) | ||
1436 | (*itLE)->setText( ent.anniversary() ); | ||
1437 | |||
1438 | if ( *it == "Nickname" ) | 1504 | if ( *it == "Nickname" ) |
@@ -1520,2 +1586,3 @@ void ContactEditor::setEntry( const OContact &entry ) { | |||
1520 | 1586 | ||
1587 | |||
1521 | cmbCat->setCategories( ent.categories(), "Contacts", tr("Contacts") ); | 1588 | cmbCat->setCategories( ent.categories(), "Contacts", tr("Contacts") ); |
@@ -1533,2 +1600,4 @@ void ContactEditor::setEntry( const OContact &entry ) { | |||
1533 | 1600 | ||
1601 | loadFields(); | ||
1602 | |||
1534 | } | 1603 | } |
@@ -1629,8 +1698,2 @@ void ContactEditor::saveEntry() { | |||
1629 | 1698 | ||
1630 | if ( *it == "Birthday" ) | ||
1631 | ent.setBirthday( (*itLE)->text() ); | ||
1632 | |||
1633 | if ( *it == "Anniversary" ) | ||
1634 | ent.setAnniversary( (*itLE)->text() ); | ||
1635 | |||
1636 | if ( *it == "Nickname" ) | 1699 | if ( *it == "Nickname" ) |
@@ -1808 +1871,31 @@ static inline bool constainsWhiteSpace( const QString &str ) | |||
1808 | 1871 | ||
1872 | void ContactEditor::setPersonalView( bool personal ) | ||
1873 | { | ||
1874 | m_personalView = personal; | ||
1875 | if ( personal ){ | ||
1876 | cmbCat->hide(); | ||
1877 | labCat->hide(); | ||
1878 | } else{ | ||
1879 | cmbCat->show(); | ||
1880 | labCat->show(); | ||
1881 | |||
1882 | } | ||
1883 | } | ||
1884 | |||
1885 | void ContactEditor::slotAnniversaryDateChanged( int year, int month, int day) | ||
1886 | { | ||
1887 | QDate date; | ||
1888 | date.setYMD( year, month, day ); | ||
1889 | QString dateString = TimeString::numberDateString( date ); | ||
1890 | anniversaryButton->setText( dateString ); | ||
1891 | ent.setAnniversary ( dateString ); | ||
1892 | } | ||
1893 | |||
1894 | void ContactEditor::slotBirthdayDateChanged( int year, int month, int day) | ||
1895 | { | ||
1896 | QDate date; | ||
1897 | date.setYMD( year, month, day ); | ||
1898 | QString dateString = TimeString::numberDateString( date ); | ||
1899 | birthdayButton->setText( dateString ); | ||
1900 | ent.setBirthday ( dateString ); | ||
1901 | } | ||
diff --git a/core/pim/addressbook/contacteditor.h b/core/pim/addressbook/contacteditor.h index 8ed8553..40ce864 100644 --- a/core/pim/addressbook/contacteditor.h +++ b/core/pim/addressbook/contacteditor.h | |||
@@ -25,2 +25,4 @@ | |||
25 | 25 | ||
26 | #include <qpe/datebookmonth.h> | ||
27 | |||
26 | #include <qdialog.h> | 28 | #include <qdialog.h> |
@@ -63,2 +65,3 @@ class ContactEditor : public QDialog { | |||
63 | void setNameFocus(); | 65 | void setNameFocus(); |
66 | void setPersonalView( bool personal = true ); | ||
64 | OContact entry() const { return ent; } | 67 | OContact entry() const { return ent; } |
@@ -80,3 +83,2 @@ class ContactEditor : public QDialog { | |||
80 | QString parseName( QString fullName, int type ); | 83 | QString parseName( QString fullName, int type ); |
81 | |||
82 | private slots: | 84 | private slots: |
@@ -99,2 +101,4 @@ class ContactEditor : public QDialog { | |||
99 | void slotFullNameChange( const QString &textChanged ); | 101 | void slotFullNameChange( const QString &textChanged ); |
102 | void slotAnniversaryDateChanged( int year, int month, int day); | ||
103 | void slotBirthdayDateChanged( int year, int month, int day); | ||
100 | 104 | ||
@@ -114,2 +118,4 @@ class ContactEditor : public QDialog { | |||
114 | 118 | ||
119 | bool m_personalView; | ||
120 | |||
115 | QStringList slHomeAddress; | 121 | QStringList slHomeAddress; |
@@ -145,2 +151,3 @@ class ContactEditor : public QDialog { | |||
145 | CategorySelect *cmbCat; | 151 | CategorySelect *cmbCat; |
152 | QLabel *labCat; | ||
146 | 153 | ||
@@ -158,4 +165,7 @@ class ContactEditor : public QDialog { | |||
158 | QComboBox *cmbGender; | 165 | QComboBox *cmbGender; |
159 | 166 | DateBookMonth* birthdayPicker; | |
160 | }; | 167 | QToolButton* birthdayButton; |
168 | DateBookMonth* anniversaryPicker; | ||
169 | QToolButton* anniversaryButton; | ||
170 | }; | ||
161 | 171 | ||