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 | |||
@@ -13,3 +13,2 @@ Feature requests: | |||
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. |
@@ -28,3 +27,6 @@ Important: | |||
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 | ||
@@ -35,6 +37,4 @@ Less important: | |||
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 | ||
@@ -112 +112,4 @@ Fixed/Ready: | |||
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 | |||
@@ -14,2 +14,3 @@ AbConfig::AbConfig( ): | |||
14 | m_fixedBars( true ), | 14 | m_fixedBars( true ), |
15 | m_lpSearchMode( LastName ), | ||
15 | m_changed( false ) | 16 | m_changed( false ) |
@@ -62,2 +63,7 @@ bool AbConfig::fixedBars() const | |||
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 ) |
@@ -111,2 +117,8 @@ void AbConfig::setFixedBars( const bool fixed ) | |||
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() |
@@ -120,4 +132,5 @@ void AbConfig::load() | |||
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 | ||
@@ -161,2 +174,3 @@ void AbConfig::save() | |||
161 | cfg.writeEntry("caseSensitive", m_beCaseSensitive); | 174 | cfg.writeEntry("caseSensitive", m_beCaseSensitive); |
175 | cfg.writeEntry("lpSearchMode", m_lpSearchMode ); | ||
162 | 176 | ||
@@ -196,2 +210,3 @@ void AbConfig::operator= ( const AbConfig& cnf ) | |||
196 | m_fixedBars = cnf.m_fixedBars; | 210 | m_fixedBars = cnf.m_fixedBars; |
211 | m_lpSearchMode = cnf.m_lpSearchMode; | ||
197 | } | 212 | } |
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 | |||
@@ -9,2 +9,10 @@ class AbConfig | |||
9 | public: | 9 | public: |
10 | enum LPSearchMode{ | ||
11 | LastName = 0, | ||
12 | FullName, | ||
13 | LASTELEMENT | ||
14 | }; | ||
15 | |||
16 | |||
17 | |||
10 | AbConfig(); | 18 | AbConfig(); |
@@ -22,2 +30,3 @@ public: | |||
22 | bool fixedBars() const; | 30 | bool fixedBars() const; |
31 | LPSearchMode letterPickerSearch() const; | ||
23 | 32 | ||
@@ -32,2 +41,3 @@ public: | |||
32 | void setFixedBars( const bool fixed ); | 41 | void setFixedBars( const bool fixed ); |
42 | void setLetterPickerSearch( const LPSearchMode mode ); | ||
33 | 43 | ||
@@ -52,2 +62,3 @@ protected: | |||
52 | bool m_fixedBars; | 62 | bool m_fixedBars; |
63 | int m_lpSearchMode; | ||
53 | 64 | ||
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 | |||
@@ -24,2 +24,4 @@ | |||
24 | 24 | ||
25 | #include <assert.h> | ||
26 | |||
25 | 27 | ||
@@ -162,3 +164,3 @@ void AbView::load() | |||
162 | 164 | ||
163 | //qWarning ("Number of contacts: %d", m_list.count()); | 165 | qWarning ("Number of contacts: %d", m_list.count()); |
164 | 166 | ||
@@ -220,5 +222,8 @@ void AbView::setShowToView( Views view ) | |||
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; |
@@ -234,3 +239,14 @@ void AbView::setShowByLetter( char c ) | |||
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 ); |
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 | |||
@@ -13,2 +13,3 @@ | |||
13 | #include "ablabel.h" | 13 | #include "ablabel.h" |
14 | #include "abconfig.h" | ||
14 | 15 | ||
@@ -34,3 +35,3 @@ public: | |||
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 ); |
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 | |||
@@ -754,2 +754,3 @@ void AddressbookWindow::editEntry( EntryMode entryMode ) | |||
754 | m_abView -> addEntry( insertEntry ); | 754 | m_abView -> addEntry( insertEntry ); |
755 | m_abView -> setCurrentUid( insertEntry.uid() ); | ||
755 | } else { | 756 | } else { |
@@ -1013,3 +1014,3 @@ void AddressbookWindow::slotSetLetter( char c ) { | |||
1013 | 1014 | ||
1014 | m_abView->setShowByLetter( c ); | 1015 | m_abView->setShowByLetter( c, m_config.letterPickerSearch() ); |
1015 | 1016 | ||
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 | |||
@@ -307,3 +307,3 @@ | |||
307 | <name>text</name> | 307 | <name>text</name> |
308 | <string>Movable</string> | 308 | <string>Moveable</string> |
309 | </property> | 309 | </property> |
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 | |||
@@ -658,6 +658,8 @@ void ContactEditor::init() { | |||
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 &)), |
@@ -1059,2 +1061,12 @@ void ContactEditor::slotSuffixChange( const QString& ) { | |||
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() { |
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 | |||
@@ -103,2 +103,3 @@ class ContactEditor : public QDialog { | |||
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); |
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 | |||
@@ -5,3 +5,3 @@ | |||
5 | #define SUBVERSION "9" | 5 | #define SUBVERSION "9" |
6 | #define PATCHVERSION "4" | 6 | #define PATCHVERSION "5" |
7 | 7 | ||