author | eilers <eilers> | 2003-05-11 12:36:30 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-05-11 12:36:30 (UTC) |
commit | 37084d3961026893840ef9891132bdf193a312b3 (patch) (unidiff) | |
tree | 342792abd777eb11a378cc5e06e0436ab48f6d89 | |
parent | b068a42c89af19f5642b68060c1d085afa78e7b1 (diff) | |
download | opie-37084d3961026893840ef9891132bdf193a312b3.zip opie-37084d3961026893840ef9891132bdf193a312b3.tar.gz opie-37084d3961026893840ef9891132bdf193a312b3.tar.bz2 |
Some improvements in handling of organizations:
- If you enter a organization name and no Fullname is entered, the
organization name will be used.
Thus, the organization is shown correctly in the listview..
- The letterpicker now searches for the SaveAs Entry (configurable)
instead for lastname. Ths guarantees that the organization is found
as expected..
This addresses bugreport #590 and #895..
-rw-r--r-- | core/pim/addressbook/TODO | 13 | ||||
-rw-r--r-- | core/pim/addressbook/abconfig.cpp | 19 | ||||
-rw-r--r-- | core/pim/addressbook/abconfig.h | 11 | ||||
-rw-r--r-- | core/pim/addressbook/abview.cpp | 24 | ||||
-rw-r--r-- | core/pim/addressbook/abview.h | 3 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 3 | ||||
-rw-r--r-- | core/pim/addressbook/configdlg_base.ui | 2 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 20 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.h | 1 | ||||
-rw-r--r-- | core/pim/addressbook/version.h | 2 |
10 files changed, 79 insertions, 19 deletions
diff --git a/core/pim/addressbook/TODO b/core/pim/addressbook/TODO index a3cffa7..383f8c5 100644 --- a/core/pim/addressbook/TODO +++ b/core/pim/addressbook/TODO | |||
@@ -11,7 +11,6 @@ Feature requests: | |||
11 | - Implementing additional Views (Phonebook, ...) | 11 | - Implementing additional Views (Phonebook, ...) |
12 | - Birthday & Anniversary Reminder | 12 | - Birthday & Anniversary Reminder |
13 | - Beaming of multiple contacts (current list/ by search or by category) | 13 | - Beaming of multiple contacts (current list/ by search or by category) |
14 | - Configure the letter-picker: lastname/fullname search | ||
15 | - Optionally put scrollbars left. | 14 | - Optionally put scrollbars left. |
16 | 15 | ||
17 | Known Bugs: | 16 | Known Bugs: |
@@ -26,17 +25,18 @@ Urgent: | |||
26 | Important: | 25 | Important: |
27 | ---------- | 26 | ---------- |
28 | 27 | ||
29 | - "What's this" should be added (Deleyed after Feature Freeze) | 28 | - Configure the letter-picker: lastname/fullname search |
29 | -> Currently just behind the scenes .. | ||
30 | - Implement a correct handling of Organizations. They are currently | ||
31 | handled as normal persons.. :( | ||
30 | 32 | ||
31 | Less important: | 33 | Less important: |
32 | --------------- | 34 | --------------- |
33 | - Reload if contacts were changed externally | 35 | - Reload if contacts were changed externally |
34 | - The picker (alphabetical sort widget) should be | 36 | - The picker (alphabetical sort widget) should be |
35 | placed verticaly or horizontally (configurable) | 37 | placed verticaly or horizontally (configurable) |
36 | - Find a smart solution for activating/deactivating the "send email" event | ||
37 | - If new contact is added (contacteditor closed): focus (table, card) to | ||
38 | this entry ! | ||
39 | - After search (Started with Return): KeyFocus should be on Tabelle | 38 | - After search (Started with Return): KeyFocus should be on Tabelle |
39 | - Find a smart solution for activating/deactivating the "send email" event | ||
40 | 40 | ||
41 | ContactEditor: | 41 | ContactEditor: |
42 | - Redesign of Contacteditor | 42 | - Redesign of Contacteditor |
@@ -110,3 +110,6 @@ Fixed/Ready: | |||
110 | - Cursor-UP/Down: Should additionally scroll cardview if it is too large | 110 | - Cursor-UP/Down: Should additionally scroll cardview if it is too large |
111 | (behaviour should be selectable by configuration) | 111 | (behaviour should be selectable by configuration) |
112 | - User center of the joypad to switch back from card to listview ! | 112 | - User center of the joypad to switch back from card to listview ! |
113 | - If new contact is added (contacteditor closed): focus (table, card) to | ||
114 | this entry ! | ||
115 | - Typo: Mov_e_able in Config-Dlg | ||
diff --git a/core/pim/addressbook/abconfig.cpp b/core/pim/addressbook/abconfig.cpp index 0b61614..4a0875b 100644 --- a/core/pim/addressbook/abconfig.cpp +++ b/core/pim/addressbook/abconfig.cpp | |||
@@ -12,6 +12,7 @@ AbConfig::AbConfig( ): | |||
12 | m_fontSize( 1 ), | 12 | m_fontSize( 1 ), |
13 | m_barPos( QMainWindow::Top ), | 13 | m_barPos( QMainWindow::Top ), |
14 | m_fixedBars( true ), | 14 | m_fixedBars( true ), |
15 | m_lpSearchMode( LastName ), | ||
15 | m_changed( false ) | 16 | m_changed( false ) |
16 | { | 17 | { |
17 | } | 18 | } |
@@ -60,6 +61,11 @@ bool AbConfig::fixedBars() const | |||
60 | return m_fixedBars; | 61 | return m_fixedBars; |
61 | } | 62 | } |
62 | 63 | ||
64 | AbConfig::LPSearchMode AbConfig::letterPickerSearch() const | ||
65 | { | ||
66 | return ( AbConfig::LPSearchMode ) m_lpSearchMode; | ||
67 | } | ||
68 | |||
63 | void AbConfig::setUseRegExp( bool v ) | 69 | void AbConfig::setUseRegExp( bool v ) |
64 | { | 70 | { |
65 | m_useRegExp = v ; | 71 | m_useRegExp = v ; |
@@ -109,6 +115,12 @@ void AbConfig::setFixedBars( const bool fixed ) | |||
109 | m_changed = true; | 115 | m_changed = true; |
110 | } | 116 | } |
111 | 117 | ||
118 | void AbConfig::setLetterPickerSearch( const AbConfig::LPSearchMode mode ) | ||
119 | { | ||
120 | m_lpSearchMode = mode; | ||
121 | m_changed = true; | ||
122 | } | ||
123 | |||
112 | void AbConfig::load() | 124 | void AbConfig::load() |
113 | { | 125 | { |
114 | // Read Config settings | 126 | // Read Config settings |
@@ -118,8 +130,9 @@ void AbConfig::load() | |||
118 | m_fontSize = cfg.readNumEntry( "fontSize", 1 ); | 130 | m_fontSize = cfg.readNumEntry( "fontSize", 1 ); |
119 | 131 | ||
120 | cfg.setGroup("Search"); | 132 | cfg.setGroup("Search"); |
121 | m_useRegExp = cfg.readBoolEntry( "useRegExp" ); | 133 | m_useRegExp = cfg.readBoolEntry( "useRegExp", false ); |
122 | m_beCaseSensitive = cfg.readBoolEntry( "caseSensitive" ); | 134 | m_beCaseSensitive = cfg.readBoolEntry( "caseSensitive", false ); |
135 | m_lpSearchMode = cfg.readNumEntry( "lpSearchMode", FullName ); | ||
123 | 136 | ||
124 | cfg.setGroup("Mail"); | 137 | cfg.setGroup("Mail"); |
125 | m_useQtMail = cfg.readBoolEntry( "useQtMail", true ); | 138 | m_useQtMail = cfg.readBoolEntry( "useQtMail", true ); |
@@ -159,6 +172,7 @@ void AbConfig::save() | |||
159 | cfg.setGroup("Search"); | 172 | cfg.setGroup("Search"); |
160 | cfg.writeEntry("useRegExp", m_useRegExp); | 173 | cfg.writeEntry("useRegExp", m_useRegExp); |
161 | cfg.writeEntry("caseSensitive", m_beCaseSensitive); | 174 | cfg.writeEntry("caseSensitive", m_beCaseSensitive); |
175 | cfg.writeEntry("lpSearchMode", m_lpSearchMode ); | ||
162 | 176 | ||
163 | cfg.setGroup("Mail"); | 177 | cfg.setGroup("Mail"); |
164 | cfg.writeEntry( "useQtMail", m_useQtMail ); | 178 | cfg.writeEntry( "useQtMail", m_useQtMail ); |
@@ -194,5 +208,6 @@ void AbConfig::operator= ( const AbConfig& cnf ) | |||
194 | m_ordered = cnf.m_ordered; | 208 | m_ordered = cnf.m_ordered; |
195 | m_barPos = cnf.m_barPos; | 209 | m_barPos = cnf.m_barPos; |
196 | m_fixedBars = cnf.m_fixedBars; | 210 | m_fixedBars = cnf.m_fixedBars; |
211 | m_lpSearchMode = cnf.m_lpSearchMode; | ||
197 | } | 212 | } |
198 | 213 | ||
diff --git a/core/pim/addressbook/abconfig.h b/core/pim/addressbook/abconfig.h index ce51b4c..93764f2 100644 --- a/core/pim/addressbook/abconfig.h +++ b/core/pim/addressbook/abconfig.h | |||
@@ -7,6 +7,14 @@ | |||
7 | class AbConfig | 7 | class AbConfig |
8 | { | 8 | { |
9 | public: | 9 | public: |
10 | enum LPSearchMode{ | ||
11 | LastName = 0, | ||
12 | FullName, | ||
13 | LASTELEMENT | ||
14 | }; | ||
15 | |||
16 | |||
17 | |||
10 | AbConfig(); | 18 | AbConfig(); |
11 | ~AbConfig(); | 19 | ~AbConfig(); |
12 | 20 | ||
@@ -20,6 +28,7 @@ public: | |||
20 | QValueList<int> orderList() const; | 28 | QValueList<int> orderList() const; |
21 | QMainWindow::ToolBarDock getToolBarPos() const; | 29 | QMainWindow::ToolBarDock getToolBarPos() const; |
22 | bool fixedBars() const; | 30 | bool fixedBars() const; |
31 | LPSearchMode letterPickerSearch() const; | ||
23 | 32 | ||
24 | void setUseRegExp( bool v ); | 33 | void setUseRegExp( bool v ); |
25 | void setUseWildCards( bool v ); | 34 | void setUseWildCards( bool v ); |
@@ -30,6 +39,7 @@ public: | |||
30 | void setOrderList( const QValueList<int>& list ); | 39 | void setOrderList( const QValueList<int>& list ); |
31 | void setToolBarDock( const QMainWindow::ToolBarDock v ); | 40 | void setToolBarDock( const QMainWindow::ToolBarDock v ); |
32 | void setFixedBars( const bool fixed ); | 41 | void setFixedBars( const bool fixed ); |
42 | void setLetterPickerSearch( const LPSearchMode mode ); | ||
33 | 43 | ||
34 | void operator= ( const AbConfig& cnf ); | 44 | void operator= ( const AbConfig& cnf ); |
35 | 45 | ||
@@ -50,6 +60,7 @@ protected: | |||
50 | QValueList<int> m_ordered; | 60 | QValueList<int> m_ordered; |
51 | int m_barPos; | 61 | int m_barPos; |
52 | bool m_fixedBars; | 62 | bool m_fixedBars; |
63 | int m_lpSearchMode; | ||
53 | 64 | ||
54 | bool m_changed; | 65 | bool m_changed; |
55 | }; | 66 | }; |
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp index d3ca783..664bd3f 100644 --- a/core/pim/addressbook/abview.cpp +++ b/core/pim/addressbook/abview.cpp | |||
@@ -22,6 +22,8 @@ | |||
22 | 22 | ||
23 | #include <opie/ocontactaccessbackend_vcard.h> | 23 | #include <opie/ocontactaccessbackend_vcard.h> |
24 | 24 | ||
25 | #include <assert.h> | ||
26 | |||
25 | 27 | ||
26 | // Is defined in LibQPE | 28 | // Is defined in LibQPE |
27 | extern QString categoryFileName(); | 29 | extern QString categoryFileName(); |
@@ -160,7 +162,7 @@ void AbView::load() | |||
160 | clearForCategory(); | 162 | clearForCategory(); |
161 | } | 163 | } |
162 | 164 | ||
163 | //qWarning ("Number of contacts: %d", m_list.count()); | 165 | qWarning ("Number of contacts: %d", m_list.count()); |
164 | 166 | ||
165 | updateView( true ); | 167 | updateView( true ); |
166 | 168 | ||
@@ -218,9 +220,12 @@ void AbView::setShowToView( Views view ) | |||
218 | 220 | ||
219 | } | 221 | } |
220 | 222 | ||
221 | void AbView::setShowByLetter( char c ) | 223 | void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode ) |
222 | { | 224 | { |
223 | //qWarning("void AbView::setShowByLetter( %c )", c ); | 225 | qWarning("void AbView::setShowByLetter( %c, %d )", c, mode ); |
226 | |||
227 | assert( mode < AbConfig::LASTELEMENT ); | ||
228 | |||
224 | OContact query; | 229 | OContact query; |
225 | if ( c == 0 ){ | 230 | if ( c == 0 ){ |
226 | load(); | 231 | load(); |
@@ -232,7 +237,18 @@ void AbView::setShowByLetter( char c ) | |||
232 | return; | 237 | return; |
233 | } | 238 | } |
234 | 239 | ||
235 | query.setLastName( QString("%1*").arg(c) ); | 240 | switch( mode ){ |
241 | case AbConfig::LastName: | ||
242 | query.setLastName( QString("%1*").arg(c) ); | ||
243 | break; | ||
244 | case AbConfig::FullName: | ||
245 | query.setFileAs( QString("%1*").arg(c) ); | ||
246 | break; | ||
247 | default: | ||
248 | qWarning( "Unknown Searchmode for AbView::setShowByLetter ! -> %d", mode ); | ||
249 | qWarning( "I will ignore it.." ); | ||
250 | return; | ||
251 | } | ||
236 | m_list = m_contactdb->queryByExample( query, OContactAccess::WildCards | OContactAccess::IgnoreCase ); | 252 | m_list = m_contactdb->queryByExample( query, OContactAccess::WildCards | OContactAccess::IgnoreCase ); |
237 | clearForCategory(); | 253 | clearForCategory(); |
238 | m_curr_Contact = 0; | 254 | m_curr_Contact = 0; |
diff --git a/core/pim/addressbook/abview.h b/core/pim/addressbook/abview.h index 55c63cc..49bb4be 100644 --- a/core/pim/addressbook/abview.h +++ b/core/pim/addressbook/abview.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include "contacteditor.h" | 11 | #include "contacteditor.h" |
12 | #include "abtable.h" | 12 | #include "abtable.h" |
13 | #include "ablabel.h" | 13 | #include "ablabel.h" |
14 | #include "abconfig.h" | ||
14 | 15 | ||
15 | class AbView: public QWidget | 16 | class AbView: public QWidget |
16 | { | 17 | { |
@@ -32,7 +33,7 @@ public: | |||
32 | void setCurrentUid( int uid ); | 33 | void setCurrentUid( int uid ); |
33 | void setShowByCategory( const QString& cat ); | 34 | void setShowByCategory( const QString& cat ); |
34 | void setShowToView( Views view ); | 35 | void setShowToView( Views view ); |
35 | void setShowByLetter( char c ); | 36 | void setShowByLetter( char c, AbConfig::LPSearchMode mode = AbConfig::LastName ); |
36 | void setListOrder( const QValueList<int>& ordered ); | 37 | void setListOrder( const QValueList<int>& ordered ); |
37 | 38 | ||
38 | // Add Entry and put to current | 39 | // Add Entry and put to current |
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 25c6f3a..34bf7f1 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp | |||
@@ -752,6 +752,7 @@ void AddressbookWindow::editEntry( EntryMode entryMode ) | |||
752 | OContact insertEntry = abEditor->entry(); | 752 | OContact insertEntry = abEditor->entry(); |
753 | insertEntry.assignUid(); | 753 | insertEntry.assignUid(); |
754 | m_abView -> addEntry( insertEntry ); | 754 | m_abView -> addEntry( insertEntry ); |
755 | m_abView -> setCurrentUid( insertEntry.uid() ); | ||
755 | } else { | 756 | } else { |
756 | OContact replEntry = abEditor->entry(); | 757 | OContact replEntry = abEditor->entry(); |
757 | 758 | ||
@@ -1011,7 +1012,7 @@ void AddressbookWindow::slotCardView() | |||
1011 | 1012 | ||
1012 | void AddressbookWindow::slotSetLetter( char c ) { | 1013 | void AddressbookWindow::slotSetLetter( char c ) { |
1013 | 1014 | ||
1014 | m_abView->setShowByLetter( c ); | 1015 | m_abView->setShowByLetter( c, m_config.letterPickerSearch() ); |
1015 | 1016 | ||
1016 | } | 1017 | } |
1017 | 1018 | ||
diff --git a/core/pim/addressbook/configdlg_base.ui b/core/pim/addressbook/configdlg_base.ui index 1b5ac17..f892d08 100644 --- a/core/pim/addressbook/configdlg_base.ui +++ b/core/pim/addressbook/configdlg_base.ui | |||
@@ -305,7 +305,7 @@ | |||
305 | </property> | 305 | </property> |
306 | <property stdset="1"> | 306 | <property stdset="1"> |
307 | <name>text</name> | 307 | <name>text</name> |
308 | <string>Movable</string> | 308 | <string>Moveable</string> |
309 | </property> | 309 | </property> |
310 | <property> | 310 | <property> |
311 | <name>whatsThis</name> | 311 | <name>whatsThis</name> |
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index f33ee0a..ce14f98 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -656,10 +656,12 @@ void ContactEditor::init() { | |||
656 | 656 | ||
657 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); | 657 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); |
658 | 658 | ||
659 | connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); | 659 | connect( txtFullName, SIGNAL(textChanged(const QString &)), |
660 | 660 | this, SLOT(slotFullNameChange(const QString &)) ); | |
661 | connect( txtSuffix, SIGNAL(textChanged(const QString &)), this, SLOT(slotSuffixChange(const QString &)) ); | 661 | connect( txtSuffix, SIGNAL(textChanged(const QString &)), |
662 | 662 | this, SLOT(slotSuffixChange(const QString &)) ); | |
663 | connect( txtOrganization, SIGNAL(textChanged(const QString &)), | ||
664 | this, SLOT(slotOrganizationChange(const QString &)) ); | ||
663 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), | 665 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), |
664 | this, SLOT(slotChooser1Change(const QString &)) ); | 666 | this, SLOT(slotChooser1Change(const QString &)) ); |
665 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), | 667 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), |
@@ -1057,6 +1059,16 @@ void ContactEditor::slotSuffixChange( const QString& ) { | |||
1057 | slotFullNameChange( txtFullName->text() ); | 1059 | slotFullNameChange( txtFullName->text() ); |
1058 | } | 1060 | } |
1059 | 1061 | ||
1062 | void ContactEditor::slotOrganizationChange( const QString &textChanged ){ | ||
1063 | qWarning( "ContactEditor::slotOrganizationChange( %s )", textChanged.latin1() ); | ||
1064 | // Special handling for storing Companies: | ||
1065 | // If no Fullname is given, we store the Company-Name as lastname | ||
1066 | // to handle it like a person.. | ||
1067 | if ( txtFullName->text() == txtOrganization->text().left( txtFullName->text().length() ) ) | ||
1068 | txtFullName->setText( textChanged ); | ||
1069 | |||
1070 | } | ||
1071 | |||
1060 | void ContactEditor::accept() { | 1072 | void ContactEditor::accept() { |
1061 | 1073 | ||
1062 | if ( isEmpty() ) { | 1074 | if ( isEmpty() ) { |
diff --git a/core/pim/addressbook/contacteditor.h b/core/pim/addressbook/contacteditor.h index c6fa48f..e7432ee 100644 --- a/core/pim/addressbook/contacteditor.h +++ b/core/pim/addressbook/contacteditor.h | |||
@@ -101,6 +101,7 @@ class ContactEditor : public QDialog { | |||
101 | void slotCountryChange( const QString &textChanged ); | 101 | void slotCountryChange( const QString &textChanged ); |
102 | void slotFullNameChange( const QString &textChanged ); | 102 | void slotFullNameChange( const QString &textChanged ); |
103 | void slotSuffixChange( const QString &textChanged ); | 103 | void slotSuffixChange( const QString &textChanged ); |
104 | void slotOrganizationChange( const QString &textChanged ); | ||
104 | void slotAnniversaryDateChanged( int year, int month, int day); | 105 | void slotAnniversaryDateChanged( int year, int month, int day); |
105 | void slotBirthdayDateChanged( int year, int month, int day); | 106 | void slotBirthdayDateChanged( int year, int month, int day); |
106 | void slotRemoveBirthday(); | 107 | void slotRemoveBirthday(); |
diff --git a/core/pim/addressbook/version.h b/core/pim/addressbook/version.h index c0465b5..4c93584 100644 --- a/core/pim/addressbook/version.h +++ b/core/pim/addressbook/version.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | #define MAINVERSION "0" | 4 | #define MAINVERSION "0" |
5 | #define SUBVERSION "9" | 5 | #define SUBVERSION "9" |
6 | #define PATCHVERSION "4" | 6 | #define PATCHVERSION "5" |
7 | 7 | ||
8 | #define APPNAME "OPIE_ADDRESSBOOK" | 8 | #define APPNAME "OPIE_ADDRESSBOOK" |
9 | 9 | ||