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 | |||
@@ -1,112 +1,115 @@ | |||
1 | Stuff todo until OPIE 1.0 : | 1 | Stuff todo until OPIE 1.0 : |
2 | =========================== | 2 | =========================== |
3 | 3 | ||
4 | Feature requests: | 4 | Feature requests: |
5 | ----------------- | 5 | ----------------- |
6 | - Dial by mobile phone by tapping the number.. | 6 | - Dial by mobile phone by tapping the number.. |
7 | (Maybe using gsmtool. And we may | 7 | (Maybe using gsmtool. And we may |
8 | add a library class for this) | 8 | add a library class for this) |
9 | - dial with dtmfdial in case it's installed and there's no mobile | 9 | - dial with dtmfdial in case it's installed and there's no mobile |
10 | - 3rd column for 2. Contact | 10 | - 3rd column for 2. Contact |
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: |
18 | ----------- | 17 | ----------- |
19 | 18 | ||
20 | Urgent: | 19 | Urgent: |
21 | -------- | 20 | -------- |
22 | - Category is on the wrong position after changing to personal and back to normal | 21 | - Category is on the wrong position after changing to personal and back to normal |
23 | ( Temporarily workaround: Category is never deactivated.. :S ) | 22 | ( Temporarily workaround: Category is never deactivated.. :S ) |
24 | 23 | ||
25 | 24 | ||
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 |
43 | 43 | ||
44 | Should be Fixed (not absolute sure, need further validation): | 44 | Should be Fixed (not absolute sure, need further validation): |
45 | ------------------------------------------------------------- | 45 | ------------------------------------------------------------- |
46 | 46 | ||
47 | 47 | ||
48 | Fixed/Ready: | 48 | Fixed/Ready: |
49 | ------- | 49 | ------- |
50 | - Syncing: abtable not reloaded after sync. | 50 | - Syncing: abtable not reloaded after sync. |
51 | - Find widget should be replaced by something like | 51 | - Find widget should be replaced by something like |
52 | qpdf has. | 52 | qpdf has. |
53 | - Adding a configuration dialog | 53 | - Adding a configuration dialog |
54 | - Picker: Activated letter schould be more visible | 54 | - Picker: Activated letter schould be more visible |
55 | - Advanced handling of cursor keys (search..) | 55 | - Advanced handling of cursor keys (search..) |
56 | - Mail-Icon is missing | 56 | - Mail-Icon is missing |
57 | - Use opie-mail insted of qt-mail if possible. | 57 | - Use opie-mail insted of qt-mail if possible. |
58 | - Font menu is invisible using german translation | 58 | - Font menu is invisible using german translation |
59 | - Personal contact editor: Disable categories | 59 | - Personal contact editor: Disable categories |
60 | - "Nonenglish" translation bug has to be fixed. | 60 | - "Nonenglish" translation bug has to be fixed. |
61 | - contacteditor: Birthday, annyversary, ... : Use Dateselector | 61 | - contacteditor: Birthday, annyversary, ... : Use Dateselector |
62 | - The names of the countries are sorted by there english names, only.. | 62 | - The names of the countries are sorted by there english names, only.. |
63 | Even if they are translated.. :S | 63 | Even if they are translated.. :S |
64 | - Cursor keys should work in detail-view (ablabel) | 64 | - Cursor keys should work in detail-view (ablabel) |
65 | -> Ablabel should be removed and Abtable should be increased with | 65 | -> Ablabel should be removed and Abtable should be increased with |
66 | different views (as started by darwin zins).. | 66 | different views (as started by darwin zins).. |
67 | - Use advanced database functions in abtable to decrease | 67 | - Use advanced database functions in abtable to decrease |
68 | memory footprint and to make everything more easy ! | 68 | memory footprint and to make everything more easy ! |
69 | (abtable should store Iterator for selected Category) | 69 | (abtable should store Iterator for selected Category) |
70 | - Abtable: Configure Contact column (internally already available, | 70 | - Abtable: Configure Contact column (internally already available, |
71 | need configuration) | 71 | need configuration) |
72 | - Select of primary contact (see #274 on mantis) | 72 | - Select of primary contact (see #274 on mantis) |
73 | - Category-select does not work completely: "Unfiled" is always in listview .. | 73 | - Category-select does not work completely: "Unfiled" is always in listview .. |
74 | - Return from Contacteditor: Category resettet to all | 74 | - Return from Contacteditor: Category resettet to all |
75 | - Personal Details not working | 75 | - Personal Details not working |
76 | - If category changed, the letterpicker should be resetted | 76 | - If category changed, the letterpicker should be resetted |
77 | - There should be some icons for List and Cardview | 77 | - There should be some icons for List and Cardview |
78 | - If in Cardview and a category change removes all entries: | 78 | - If in Cardview and a category change removes all entries: |
79 | There are already entries in Cardview after up/down | 79 | There are already entries in Cardview after up/down |
80 | - Personal Details: Anniversary zeigt Fantasie-Werte | 80 | - Personal Details: Anniversary zeigt Fantasie-Werte |
81 | - Unfiled shown just in Category "All" and "Unfiled". | 81 | - Unfiled shown just in Category "All" and "Unfiled". |
82 | - After finising search and after Edit: Clear Picker | 82 | - After finising search and after Edit: Clear Picker |
83 | - After Edit: Table position back to edited entry. | 83 | - After Edit: Table position back to edited entry. |
84 | - Optimize Table Update... | 84 | - Optimize Table Update... |
85 | - Change MyDialog to Config | 85 | - Change MyDialog to Config |
86 | - Store position and state of toolbar | 86 | - Store position and state of toolbar |
87 | - Searchwidget closed: Selected user is jumping | 87 | - Searchwidget closed: Selected user is jumping |
88 | - Wenn suchen beendet, dann dauert das Tabellenupdate (was überhaupt überflüssig ist) | 88 | - Wenn suchen beendet, dann dauert das Tabellenupdate (was überhaupt überflüssig ist) |
89 | zu lange.. | 89 | zu lange.. |
90 | - VCARD: Import of Anniversary does not work correctly (currently disabled) | 90 | - VCARD: Import of Anniversary does not work correctly (currently disabled) |
91 | - Name order selected in "contacteditor" not used in list view. | 91 | - Name order selected in "contacteditor" not used in list view. |
92 | - OK-Key does not switch from Detailview (ablable) to Listview | 92 | - OK-Key does not switch from Detailview (ablable) to Listview |
93 | - Receiving of beams should open a dialog | 93 | - Receiving of beams should open a dialog |
94 | - Fix start of opie-mail | 94 | - Fix start of opie-mail |
95 | - Implement Button Pics | 95 | - Implement Button Pics |
96 | - Add a dialog to accept and optionally edit received contacts by IRDA. | 96 | - Add a dialog to accept and optionally edit received contacts by IRDA. |
97 | - Language not English (tested with german opie-translation): | 97 | - Language not English (tested with german opie-translation): |
98 | 1. Configure nicht übersetzt (alles leer). | 98 | 1. Configure nicht übersetzt (alles leer). |
99 | 2. Contacteditor nur teilweise übersetzt. | 99 | 2. Contacteditor nur teilweise übersetzt. |
100 | 3. Kategorie-Picker geht nicht. | 100 | 3. Kategorie-Picker geht nicht. |
101 | - Plugin for Today for Birthdays and Anniversaries | 101 | - Plugin for Today for Birthdays and Anniversaries |
102 | - Implement a picker/combo for the default email. | 102 | - Implement a picker/combo for the default email. |
103 | - Overview window cleanup needed.. | 103 | - Overview window cleanup needed.. |
104 | - Store last settings of combo-boxes | 104 | - Store last settings of combo-boxes |
105 | - Personal and Business Web-page is not editable | 105 | - Personal and Business Web-page is not editable |
106 | - Default Email-button: A lot of problems: | 106 | - Default Email-button: A lot of problems: |
107 | If on second tab: The combo chooser is on the top left of the screen ! :( | 107 | If on second tab: The combo chooser is on the top left of the screen ! :( |
108 | - Default Email-Button: Sometimes not hiding the textfields completely | 108 | - Default Email-Button: Sometimes not hiding the textfields completely |
109 | - Fix handling of 3 Firstnames | 109 | - Fix handling of 3 Firstnames |
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 | |||
@@ -1,198 +1,213 @@ | |||
1 | #include "abconfig.h" | 1 | #include "abconfig.h" |
2 | #include "version.h" | 2 | #include "version.h" |
3 | 3 | ||
4 | #include <qpe/config.h> | 4 | #include <qpe/config.h> |
5 | #include <qpe/recordfields.h> | 5 | #include <qpe/recordfields.h> |
6 | 6 | ||
7 | AbConfig::AbConfig( ): | 7 | AbConfig::AbConfig( ): |
8 | m_useQtMail( true ), | 8 | m_useQtMail( true ), |
9 | m_useOpieMail( false ), | 9 | m_useOpieMail( false ), |
10 | m_useRegExp( false ), | 10 | m_useRegExp( false ), |
11 | m_beCaseSensitive( false ), | 11 | m_beCaseSensitive( false ), |
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 | } |
18 | 19 | ||
19 | AbConfig::~AbConfig() | 20 | AbConfig::~AbConfig() |
20 | { | 21 | { |
21 | } | 22 | } |
22 | 23 | ||
23 | bool AbConfig::useRegExp() const | 24 | bool AbConfig::useRegExp() const |
24 | { | 25 | { |
25 | return m_useRegExp; | 26 | return m_useRegExp; |
26 | } | 27 | } |
27 | bool AbConfig::useWildCards() const | 28 | bool AbConfig::useWildCards() const |
28 | { | 29 | { |
29 | return !m_useRegExp; | 30 | return !m_useRegExp; |
30 | } | 31 | } |
31 | bool AbConfig::useQtMail() const | 32 | bool AbConfig::useQtMail() const |
32 | { | 33 | { |
33 | return m_useQtMail; | 34 | return m_useQtMail; |
34 | } | 35 | } |
35 | bool AbConfig::useOpieMail() const | 36 | bool AbConfig::useOpieMail() const |
36 | { | 37 | { |
37 | return m_useOpieMail; | 38 | return m_useOpieMail; |
38 | } | 39 | } |
39 | bool AbConfig::beCaseSensitive() const | 40 | bool AbConfig::beCaseSensitive() const |
40 | { | 41 | { |
41 | return m_beCaseSensitive; | 42 | return m_beCaseSensitive; |
42 | } | 43 | } |
43 | int AbConfig::fontSize() const | 44 | int AbConfig::fontSize() const |
44 | { | 45 | { |
45 | return m_fontSize; | 46 | return m_fontSize; |
46 | } | 47 | } |
47 | 48 | ||
48 | QValueList<int> AbConfig::orderList() const | 49 | QValueList<int> AbConfig::orderList() const |
49 | { | 50 | { |
50 | return m_ordered; | 51 | return m_ordered; |
51 | } | 52 | } |
52 | 53 | ||
53 | QMainWindow::ToolBarDock AbConfig::getToolBarPos() const | 54 | QMainWindow::ToolBarDock AbConfig::getToolBarPos() const |
54 | { | 55 | { |
55 | return (QMainWindow::ToolBarDock) m_barPos; | 56 | return (QMainWindow::ToolBarDock) m_barPos; |
56 | } | 57 | } |
57 | 58 | ||
58 | bool AbConfig::fixedBars() const | 59 | bool AbConfig::fixedBars() const |
59 | { | 60 | { |
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 ; |
66 | m_changed = true; | 72 | m_changed = true; |
67 | } | 73 | } |
68 | void AbConfig::setUseWildCards( bool v ) | 74 | void AbConfig::setUseWildCards( bool v ) |
69 | { | 75 | { |
70 | m_useRegExp = !v; | 76 | m_useRegExp = !v; |
71 | m_changed = true; | 77 | m_changed = true; |
72 | } | 78 | } |
73 | void AbConfig::setBeCaseSensitive( bool v ) | 79 | void AbConfig::setBeCaseSensitive( bool v ) |
74 | { | 80 | { |
75 | m_beCaseSensitive = v; | 81 | m_beCaseSensitive = v; |
76 | m_changed = true; | 82 | m_changed = true; |
77 | } | 83 | } |
78 | void AbConfig::setUseQtMail( bool v ) | 84 | void AbConfig::setUseQtMail( bool v ) |
79 | { | 85 | { |
80 | m_useQtMail = v; | 86 | m_useQtMail = v; |
81 | m_changed = true; | 87 | m_changed = true; |
82 | } | 88 | } |
83 | void AbConfig::setUseOpieMail( bool v ) | 89 | void AbConfig::setUseOpieMail( bool v ) |
84 | { | 90 | { |
85 | m_useOpieMail = v; | 91 | m_useOpieMail = v; |
86 | m_changed = true; | 92 | m_changed = true; |
87 | } | 93 | } |
88 | void AbConfig::setFontSize( int v ) | 94 | void AbConfig::setFontSize( int v ) |
89 | { | 95 | { |
90 | m_fontSize = v; | 96 | m_fontSize = v; |
91 | m_changed = true; | 97 | m_changed = true; |
92 | } | 98 | } |
93 | 99 | ||
94 | void AbConfig::setOrderList( const QValueList<int>& list ) | 100 | void AbConfig::setOrderList( const QValueList<int>& list ) |
95 | { | 101 | { |
96 | m_ordered = list; | 102 | m_ordered = list; |
97 | m_changed = true; | 103 | m_changed = true; |
98 | } | 104 | } |
99 | 105 | ||
100 | void AbConfig::setToolBarDock( const QMainWindow::ToolBarDock v ) | 106 | void AbConfig::setToolBarDock( const QMainWindow::ToolBarDock v ) |
101 | { | 107 | { |
102 | m_barPos = v; | 108 | m_barPos = v; |
103 | m_changed = true; | 109 | m_changed = true; |
104 | } | 110 | } |
105 | 111 | ||
106 | void AbConfig::setFixedBars( const bool fixed ) | 112 | void AbConfig::setFixedBars( const bool fixed ) |
107 | { | 113 | { |
108 | m_fixedBars = fixed; | 114 | m_fixedBars = 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 |
115 | Config cfg("AddressBook"); | 127 | Config cfg("AddressBook"); |
116 | 128 | ||
117 | cfg.setGroup("Font"); | 129 | cfg.setGroup("Font"); |
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 ); |
126 | m_useOpieMail=cfg.readBoolEntry( "useOpieMail" ); | 139 | m_useOpieMail=cfg.readBoolEntry( "useOpieMail" ); |
127 | 140 | ||
128 | cfg.setGroup("ContactOrder"); | 141 | cfg.setGroup("ContactOrder"); |
129 | int ID = 0; | 142 | int ID = 0; |
130 | int i = 0; | 143 | int i = 0; |
131 | ID = cfg.readNumEntry( "ContactID_"+QString::number(i++), 0 ); | 144 | ID = cfg.readNumEntry( "ContactID_"+QString::number(i++), 0 ); |
132 | while ( ID != 0 ){ | 145 | while ( ID != 0 ){ |
133 | m_ordered.append( ID ); | 146 | m_ordered.append( ID ); |
134 | ID = cfg.readNumEntry( "ContactID_"+QString::number(i++), 0 ); | 147 | ID = cfg.readNumEntry( "ContactID_"+QString::number(i++), 0 ); |
135 | } | 148 | } |
136 | 149 | ||
137 | // If no contact order is defined, we set the default | 150 | // If no contact order is defined, we set the default |
138 | if ( m_ordered.count() == 0 ) { | 151 | if ( m_ordered.count() == 0 ) { |
139 | m_ordered.append( Qtopia::DefaultEmail ); | 152 | m_ordered.append( Qtopia::DefaultEmail ); |
140 | m_ordered.append( Qtopia::HomePhone); | 153 | m_ordered.append( Qtopia::HomePhone); |
141 | m_ordered.append( Qtopia::HomeMobile); | 154 | m_ordered.append( Qtopia::HomeMobile); |
142 | m_ordered.append( Qtopia::BusinessPhone); | 155 | m_ordered.append( Qtopia::BusinessPhone); |
143 | } | 156 | } |
144 | 157 | ||
145 | cfg.setGroup("ToolBar"); | 158 | cfg.setGroup("ToolBar"); |
146 | m_barPos = cfg.readNumEntry( "Position", QMainWindow::Top ); | 159 | m_barPos = cfg.readNumEntry( "Position", QMainWindow::Top ); |
147 | m_fixedBars= cfg.readBoolEntry( "fixedBars", true ); | 160 | m_fixedBars= cfg.readBoolEntry( "fixedBars", true ); |
148 | 161 | ||
149 | m_changed = false; | 162 | m_changed = false; |
150 | } | 163 | } |
151 | 164 | ||
152 | void AbConfig::save() | 165 | void AbConfig::save() |
153 | { | 166 | { |
154 | if ( m_changed ){ | 167 | if ( m_changed ){ |
155 | Config cfg("AddressBook"); | 168 | Config cfg("AddressBook"); |
156 | cfg.setGroup("Font"); | 169 | cfg.setGroup("Font"); |
157 | cfg.writeEntry("fontSize", m_fontSize); | 170 | cfg.writeEntry("fontSize", m_fontSize); |
158 | 171 | ||
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 ); |
165 | cfg.writeEntry( "useOpieMail", m_useOpieMail); | 179 | cfg.writeEntry( "useOpieMail", m_useOpieMail); |
166 | 180 | ||
167 | cfg.setGroup("ContactOrder"); | 181 | cfg.setGroup("ContactOrder"); |
168 | cfg.clearGroup(); | 182 | cfg.clearGroup(); |
169 | for ( uint i = 0; i < m_ordered.count(); i++ ){ | 183 | for ( uint i = 0; i < m_ordered.count(); i++ ){ |
170 | cfg.writeEntry( "ContactID_"+QString::number(i), m_ordered[i] ); | 184 | cfg.writeEntry( "ContactID_"+QString::number(i), m_ordered[i] ); |
171 | } | 185 | } |
172 | 186 | ||
173 | cfg.setGroup("ToolBar"); | 187 | cfg.setGroup("ToolBar"); |
174 | cfg.writeEntry( "Position", m_barPos ); | 188 | cfg.writeEntry( "Position", m_barPos ); |
175 | cfg.writeEntry( "fixedBars", m_fixedBars ); | 189 | cfg.writeEntry( "fixedBars", m_fixedBars ); |
176 | 190 | ||
177 | cfg.setGroup("Version"); | 191 | cfg.setGroup("Version"); |
178 | cfg.writeEntry( "AppName", APPNAME + QString(" V" ) + MAINVERSION + QString(".") + SUBVERSION + QString(".") + PATCHVERSION); | 192 | cfg.writeEntry( "AppName", APPNAME + QString(" V" ) + MAINVERSION + QString(".") + SUBVERSION + QString(".") + PATCHVERSION); |
179 | cfg.writeEntry( "Mainversion", MAINVERSION ); | 193 | cfg.writeEntry( "Mainversion", MAINVERSION ); |
180 | cfg.writeEntry( "SubVersion", SUBVERSION ); | 194 | cfg.writeEntry( "SubVersion", SUBVERSION ); |
181 | cfg.writeEntry( "PatchVersion", PATCHVERSION ); | 195 | cfg.writeEntry( "PatchVersion", PATCHVERSION ); |
182 | 196 | ||
183 | } | 197 | } |
184 | 198 | ||
185 | } | 199 | } |
186 | 200 | ||
187 | void AbConfig::operator= ( const AbConfig& cnf ) | 201 | void AbConfig::operator= ( const AbConfig& cnf ) |
188 | { | 202 | { |
189 | m_useQtMail = cnf.m_useQtMail; | 203 | m_useQtMail = cnf.m_useQtMail; |
190 | m_useOpieMail = cnf.m_useOpieMail; | 204 | m_useOpieMail = cnf.m_useOpieMail; |
191 | m_useRegExp = cnf.m_useRegExp; | 205 | m_useRegExp = cnf.m_useRegExp; |
192 | m_beCaseSensitive = cnf.m_beCaseSensitive; | 206 | m_beCaseSensitive = cnf.m_beCaseSensitive; |
193 | m_fontSize = cnf.m_fontSize; | 207 | m_fontSize = cnf.m_fontSize; |
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 | |||
@@ -1,58 +1,69 @@ | |||
1 | #ifndef _ABCONFIG_H_ | 1 | #ifndef _ABCONFIG_H_ |
2 | #define _ABCONFIG_H_ | 2 | #define _ABCONFIG_H_ |
3 | 3 | ||
4 | #include <qstringlist.h> | 4 | #include <qstringlist.h> |
5 | #include <qmainwindow.h> | 5 | #include <qmainwindow.h> |
6 | 6 | ||
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 | ||
13 | // Search Settings | 21 | // Search Settings |
14 | bool useRegExp() const; | 22 | bool useRegExp() const; |
15 | bool useWildCards() const; | 23 | bool useWildCards() const; |
16 | bool beCaseSensitive() const; | 24 | bool beCaseSensitive() const; |
17 | bool useQtMail() const; | 25 | bool useQtMail() const; |
18 | bool useOpieMail() const; | 26 | bool useOpieMail() const; |
19 | int fontSize() const; | 27 | int fontSize() const; |
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 ); |
26 | void setBeCaseSensitive( bool v ); | 35 | void setBeCaseSensitive( bool v ); |
27 | void setUseQtMail( bool v ); | 36 | void setUseQtMail( bool v ); |
28 | void setUseOpieMail( bool v ); | 37 | void setUseOpieMail( bool v ); |
29 | void setFontSize( int v ); | 38 | void setFontSize( int v ); |
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 | ||
36 | void load(); | 46 | void load(); |
37 | void save(); | 47 | void save(); |
38 | 48 | ||
39 | protected: | 49 | protected: |
40 | /* virtual void itemUp(); */ | 50 | /* virtual void itemUp(); */ |
41 | /* virtual void itemDown(); */ | 51 | /* virtual void itemDown(); */ |
42 | 52 | ||
43 | QStringList contFields; | 53 | QStringList contFields; |
44 | 54 | ||
45 | bool m_useQtMail; | 55 | bool m_useQtMail; |
46 | bool m_useOpieMail; | 56 | bool m_useOpieMail; |
47 | bool m_useRegExp; | 57 | bool m_useRegExp; |
48 | bool m_beCaseSensitive; | 58 | bool m_beCaseSensitive; |
49 | int m_fontSize; | 59 | int m_fontSize; |
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 | }; |
56 | 67 | ||
57 | 68 | ||
58 | #endif | 69 | #endif |
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 | |||
@@ -1,88 +1,90 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (c) 2002 Stefan Eilers (eilers.stefan@epost.de) | 2 | ** Copyright (c) 2002 Stefan Eilers (eilers.stefan@epost.de) |
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 | ** | 14 | ** |
15 | **********************************************************************/ | 15 | **********************************************************************/ |
16 | 16 | ||
17 | #include "abview.h" | 17 | #include "abview.h" |
18 | 18 | ||
19 | #include <qlayout.h> | 19 | #include <qlayout.h> |
20 | 20 | ||
21 | #include <qpe/global.h> | 21 | #include <qpe/global.h> |
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(); |
28 | 30 | ||
29 | QString addressbookPersonalVCardName() | 31 | QString addressbookPersonalVCardName() |
30 | { | 32 | { |
31 | QString filename = Global::applicationFileName("addressbook", | 33 | QString filename = Global::applicationFileName("addressbook", |
32 | "businesscard.vcf"); | 34 | "businesscard.vcf"); |
33 | return filename; | 35 | return filename; |
34 | } | 36 | } |
35 | 37 | ||
36 | 38 | ||
37 | AbView::AbView ( QWidget* parent, const QValueList<int>& ordered ): | 39 | AbView::AbView ( QWidget* parent, const QValueList<int>& ordered ): |
38 | QWidget(parent), | 40 | QWidget(parent), |
39 | mCat(0), | 41 | mCat(0), |
40 | m_inSearch( false ), | 42 | m_inSearch( false ), |
41 | m_inPersonal( false ), | 43 | m_inPersonal( false ), |
42 | m_curr_category( -1 ), | 44 | m_curr_category( -1 ), |
43 | m_curr_View( TableView ), | 45 | m_curr_View( TableView ), |
44 | m_prev_View( TableView ), | 46 | m_prev_View( TableView ), |
45 | m_curr_Contact ( 0 ), | 47 | m_curr_Contact ( 0 ), |
46 | m_contactdb ( 0l ), | 48 | m_contactdb ( 0l ), |
47 | m_storedDB ( 0l ), | 49 | m_storedDB ( 0l ), |
48 | m_viewStack( 0l ), | 50 | m_viewStack( 0l ), |
49 | m_abTable( 0l ), | 51 | m_abTable( 0l ), |
50 | m_orderedFields( ordered ) | 52 | m_orderedFields( ordered ) |
51 | { | 53 | { |
52 | // Load default database and handle syncing myself.. ! | 54 | // Load default database and handle syncing myself.. ! |
53 | m_contactdb = new OContactAccess ( "addressbook", 0l, 0l, false ), | 55 | m_contactdb = new OContactAccess ( "addressbook", 0l, 0l, false ), |
54 | mCat.load( categoryFileName() ); | 56 | mCat.load( categoryFileName() ); |
55 | 57 | ||
56 | // Create Layout and put WidgetStack into it. | 58 | // Create Layout and put WidgetStack into it. |
57 | QVBoxLayout *vb = new QVBoxLayout( this ); | 59 | QVBoxLayout *vb = new QVBoxLayout( this ); |
58 | m_viewStack = new QWidgetStack( this ); | 60 | m_viewStack = new QWidgetStack( this ); |
59 | vb->addWidget( m_viewStack ); | 61 | vb->addWidget( m_viewStack ); |
60 | 62 | ||
61 | // Creat TableView | 63 | // Creat TableView |
62 | QVBox* tableBox = new QVBox( m_viewStack ); | 64 | QVBox* tableBox = new QVBox( m_viewStack ); |
63 | m_abTable = new AbTable( m_orderedFields, tableBox, "table" ); | 65 | m_abTable = new AbTable( m_orderedFields, tableBox, "table" ); |
64 | m_abTable->setCurrentCell( 0, 0 ); | 66 | m_abTable->setCurrentCell( 0, 0 ); |
65 | m_abTable->setFocus(); | 67 | m_abTable->setFocus(); |
66 | 68 | ||
67 | // Add TableView to WidgetStack and raise it | 69 | // Add TableView to WidgetStack and raise it |
68 | m_viewStack -> addWidget( tableBox , TableView ); | 70 | m_viewStack -> addWidget( tableBox , TableView ); |
69 | 71 | ||
70 | // Create CardView and add it to WidgetStack | 72 | // Create CardView and add it to WidgetStack |
71 | QVBox* cardBox = new QVBox( m_viewStack ); | 73 | QVBox* cardBox = new QVBox( m_viewStack ); |
72 | m_ablabel = new AbLabel( cardBox, "CardView"); | 74 | m_ablabel = new AbLabel( cardBox, "CardView"); |
73 | m_viewStack -> addWidget( cardBox , CardView ); | 75 | m_viewStack -> addWidget( cardBox , CardView ); |
74 | 76 | ||
75 | // Connect views to me | 77 | // Connect views to me |
76 | connect ( m_abTable, SIGNAL( signalSwitch( void ) ), | 78 | connect ( m_abTable, SIGNAL( signalSwitch( void ) ), |
77 | this, SLOT( slotSwitch( void ) ) ); | 79 | this, SLOT( slotSwitch( void ) ) ); |
78 | connect ( m_ablabel, SIGNAL( signalOkPressed( void ) ), | 80 | connect ( m_ablabel, SIGNAL( signalOkPressed( void ) ), |
79 | this, SLOT( slotSwitch( void ) ) ); | 81 | this, SLOT( slotSwitch( void ) ) ); |
80 | 82 | ||
81 | load(); | 83 | load(); |
82 | } | 84 | } |
83 | 85 | ||
84 | AbView::~AbView() | 86 | AbView::~AbView() |
85 | { | 87 | { |
86 | m_contactdb -> save(); | 88 | m_contactdb -> save(); |
87 | delete m_contactdb; | 89 | delete m_contactdb; |
88 | 90 | ||
@@ -99,201 +101,215 @@ void AbView::setView( Views view ) | |||
99 | m_curr_View = view; | 101 | m_curr_View = view; |
100 | load(); | 102 | load(); |
101 | } | 103 | } |
102 | 104 | ||
103 | void AbView::addEntry( const OContact &newContact ) | 105 | void AbView::addEntry( const OContact &newContact ) |
104 | { | 106 | { |
105 | //qWarning("abview:AddContact"); | 107 | //qWarning("abview:AddContact"); |
106 | m_contactdb->add ( newContact ); | 108 | m_contactdb->add ( newContact ); |
107 | load(); | 109 | load(); |
108 | 110 | ||
109 | } | 111 | } |
110 | void AbView::removeEntry( const int UID ) | 112 | void AbView::removeEntry( const int UID ) |
111 | { | 113 | { |
112 | //qWarning("abview:RemoveContact"); | 114 | //qWarning("abview:RemoveContact"); |
113 | m_contactdb->remove( UID ); | 115 | m_contactdb->remove( UID ); |
114 | load(); | 116 | load(); |
115 | } | 117 | } |
116 | 118 | ||
117 | void AbView::replaceEntry( const OContact &contact ) | 119 | void AbView::replaceEntry( const OContact &contact ) |
118 | { | 120 | { |
119 | //qWarning("abview:ReplaceContact"); | 121 | //qWarning("abview:ReplaceContact"); |
120 | m_contactdb->replace( contact ); | 122 | m_contactdb->replace( contact ); |
121 | load(); | 123 | load(); |
122 | 124 | ||
123 | } | 125 | } |
124 | 126 | ||
125 | OContact AbView::currentEntry() | 127 | OContact AbView::currentEntry() |
126 | { | 128 | { |
127 | OContact currentContact; | 129 | OContact currentContact; |
128 | 130 | ||
129 | switch ( (int) m_curr_View ) { | 131 | switch ( (int) m_curr_View ) { |
130 | case TableView: | 132 | case TableView: |
131 | currentContact = m_abTable -> currentEntry(); | 133 | currentContact = m_abTable -> currentEntry(); |
132 | break; | 134 | break; |
133 | case CardView: | 135 | case CardView: |
134 | currentContact = m_ablabel -> currentEntry(); | 136 | currentContact = m_ablabel -> currentEntry(); |
135 | break; | 137 | break; |
136 | } | 138 | } |
137 | m_curr_Contact = currentContact.uid(); | 139 | m_curr_Contact = currentContact.uid(); |
138 | return currentContact; | 140 | return currentContact; |
139 | } | 141 | } |
140 | 142 | ||
141 | bool AbView::save() | 143 | bool AbView::save() |
142 | { | 144 | { |
143 | //qWarning("abView:Save data"); | 145 | //qWarning("abView:Save data"); |
144 | 146 | ||
145 | return m_contactdb->save(); | 147 | return m_contactdb->save(); |
146 | } | 148 | } |
147 | 149 | ||
148 | void AbView::load() | 150 | void AbView::load() |
149 | { | 151 | { |
150 | //qWarning("abView:Load data"); | 152 | //qWarning("abView:Load data"); |
151 | 153 | ||
152 | // Letter Search is stopped at this place | 154 | // Letter Search is stopped at this place |
153 | emit signalClearLetterPicker(); | 155 | emit signalClearLetterPicker(); |
154 | 156 | ||
155 | if ( m_inPersonal ) | 157 | if ( m_inPersonal ) |
156 | // VCard Backend does not sort.. | 158 | // VCard Backend does not sort.. |
157 | m_list = m_contactdb->allRecords(); | 159 | m_list = m_contactdb->allRecords(); |
158 | else{ | 160 | else{ |
159 | m_list = m_contactdb->sorted( true, 0, 0, 0 ); | 161 | m_list = m_contactdb->sorted( true, 0, 0, 0 ); |
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 | ||
167 | } | 169 | } |
168 | 170 | ||
169 | void AbView::reload() | 171 | void AbView::reload() |
170 | { | 172 | { |
171 | //qWarning( "void AbView::reload()" ); | 173 | //qWarning( "void AbView::reload()" ); |
172 | 174 | ||
173 | m_contactdb->reload(); | 175 | m_contactdb->reload(); |
174 | load(); | 176 | load(); |
175 | } | 177 | } |
176 | 178 | ||
177 | void AbView::clear() | 179 | void AbView::clear() |
178 | { | 180 | { |
179 | // :SX | 181 | // :SX |
180 | } | 182 | } |
181 | 183 | ||
182 | void AbView::setShowByCategory( const QString& cat ) | 184 | void AbView::setShowByCategory( const QString& cat ) |
183 | { | 185 | { |
184 | //qWarning("AbView::setShowCategory( const QString& cat )"); | 186 | //qWarning("AbView::setShowCategory( const QString& cat )"); |
185 | 187 | ||
186 | int intCat = 0; | 188 | int intCat = 0; |
187 | 189 | ||
188 | // All (cat == NULL) will be stored as -1 | 190 | // All (cat == NULL) will be stored as -1 |
189 | if ( cat.isNull() ) | 191 | if ( cat.isNull() ) |
190 | intCat = -1; | 192 | intCat = -1; |
191 | else | 193 | else |
192 | intCat = mCat.id("Contacts", cat ); | 194 | intCat = mCat.id("Contacts", cat ); |
193 | 195 | ||
194 | // Just do anything if we really change the category | 196 | // Just do anything if we really change the category |
195 | if ( intCat != m_curr_category ){ | 197 | if ( intCat != m_curr_category ){ |
196 | // qWarning ("Categories: Selected %s.. Number: %d", cat.latin1(), m_curr_category); | 198 | // qWarning ("Categories: Selected %s.. Number: %d", cat.latin1(), m_curr_category); |
197 | 199 | ||
198 | m_curr_category = intCat; | 200 | m_curr_category = intCat; |
199 | emit signalClearLetterPicker(); | 201 | emit signalClearLetterPicker(); |
200 | 202 | ||
201 | load(); | 203 | load(); |
202 | } | 204 | } |
203 | 205 | ||
204 | } | 206 | } |
205 | 207 | ||
206 | void AbView::setShowToView( Views view ) | 208 | void AbView::setShowToView( Views view ) |
207 | { | 209 | { |
208 | //qWarning("void AbView::setShowToView( View %d )", view); | 210 | //qWarning("void AbView::setShowToView( View %d )", view); |
209 | 211 | ||
210 | //qWarning ("Change the View (Category is: %d)", m_curr_category); | 212 | //qWarning ("Change the View (Category is: %d)", m_curr_category); |
211 | 213 | ||
212 | if ( m_curr_View != view ){ | 214 | if ( m_curr_View != view ){ |
213 | m_prev_View = m_curr_View; | 215 | m_prev_View = m_curr_View; |
214 | m_curr_View = view; | 216 | m_curr_View = view; |
215 | 217 | ||
216 | updateView(); | 218 | updateView(); |
217 | } | 219 | } |
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(); |
227 | return; | 232 | return; |
228 | }else{ | 233 | }else{ |
229 | // If the current Backend is unable to solve the query, we will | 234 | // If the current Backend is unable to solve the query, we will |
230 | // ignore the request .. | 235 | // ignore the request .. |
231 | if ( ! m_contactdb->hasQuerySettings( OContactAccess::WildCards | OContactAccess::IgnoreCase ) ){ | 236 | if ( ! m_contactdb->hasQuerySettings( OContactAccess::WildCards | OContactAccess::IgnoreCase ) ){ |
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; |
239 | } | 255 | } |
240 | updateView( true ); | 256 | updateView( true ); |
241 | } | 257 | } |
242 | 258 | ||
243 | void AbView::setListOrder( const QValueList<int>& ordered ) | 259 | void AbView::setListOrder( const QValueList<int>& ordered ) |
244 | { | 260 | { |
245 | m_orderedFields = ordered; | 261 | m_orderedFields = ordered; |
246 | if ( m_abTable ){ | 262 | if ( m_abTable ){ |
247 | m_abTable->setOrderedList( ordered ); | 263 | m_abTable->setOrderedList( ordered ); |
248 | m_abTable->refresh(); | 264 | m_abTable->refresh(); |
249 | } | 265 | } |
250 | updateView(); | 266 | updateView(); |
251 | } | 267 | } |
252 | 268 | ||
253 | 269 | ||
254 | QString AbView::showCategory() const | 270 | QString AbView::showCategory() const |
255 | { | 271 | { |
256 | return mCat.label( "Contacts", m_curr_category ); | 272 | return mCat.label( "Contacts", m_curr_category ); |
257 | } | 273 | } |
258 | 274 | ||
259 | void AbView::showPersonal( bool personal ) | 275 | void AbView::showPersonal( bool personal ) |
260 | { | 276 | { |
261 | //qWarning ("void AbView::showPersonal( %d )", personal); | 277 | //qWarning ("void AbView::showPersonal( %d )", personal); |
262 | 278 | ||
263 | if ( personal ){ | 279 | if ( personal ){ |
264 | 280 | ||
265 | if ( m_inPersonal ) | 281 | if ( m_inPersonal ) |
266 | return; | 282 | return; |
267 | 283 | ||
268 | // Now switch to vCard Backend and load data. | 284 | // Now switch to vCard Backend and load data. |
269 | // The current default backend will be stored | 285 | // The current default backend will be stored |
270 | // to avoid unneeded load/stores. | 286 | // to avoid unneeded load/stores. |
271 | m_storedDB = m_contactdb; | 287 | m_storedDB = m_contactdb; |
272 | 288 | ||
273 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, | 289 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, |
274 | addressbookPersonalVCardName() ); | 290 | addressbookPersonalVCardName() ); |
275 | m_contactdb = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); | 291 | m_contactdb = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); |
276 | 292 | ||
277 | m_inPersonal = true; | 293 | m_inPersonal = true; |
278 | m_curr_View = CardView; | 294 | m_curr_View = CardView; |
279 | 295 | ||
280 | }else{ | 296 | }else{ |
281 | 297 | ||
282 | if ( !m_inPersonal ) | 298 | if ( !m_inPersonal ) |
283 | return; | 299 | return; |
284 | 300 | ||
285 | // Remove vCard Backend and restore default | 301 | // Remove vCard Backend and restore default |
286 | m_contactdb->save(); | 302 | m_contactdb->save(); |
287 | delete m_contactdb; | 303 | delete m_contactdb; |
288 | 304 | ||
289 | m_contactdb = m_storedDB; | 305 | m_contactdb = m_storedDB; |
290 | m_storedDB = 0l; | 306 | m_storedDB = 0l; |
291 | 307 | ||
292 | m_curr_View = TableView; | 308 | m_curr_View = TableView; |
293 | m_inPersonal = false; | 309 | m_inPersonal = false; |
294 | 310 | ||
295 | } | 311 | } |
296 | load(); | 312 | load(); |
297 | } | 313 | } |
298 | 314 | ||
299 | void AbView::setCurrentUid( int uid ){ | 315 | void AbView::setCurrentUid( int uid ){ |
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 | |||
@@ -1,88 +1,89 @@ | |||
1 | #ifndef _ABVIEW_H_ | 1 | #ifndef _ABVIEW_H_ |
2 | #define _ABVIEW_H_ | 2 | #define _ABVIEW_H_ |
3 | 3 | ||
4 | #include <qwidget.h> | 4 | #include <qwidget.h> |
5 | #include <qwidgetstack.h> | 5 | #include <qwidgetstack.h> |
6 | 6 | ||
7 | #include <qpe/categories.h> | 7 | #include <qpe/categories.h> |
8 | #include <opie/ocontact.h> | 8 | #include <opie/ocontact.h> |
9 | #include <opie/ocontactaccess.h> | 9 | #include <opie/ocontactaccess.h> |
10 | 10 | ||
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 | { |
17 | Q_OBJECT | 18 | Q_OBJECT |
18 | 19 | ||
19 | public: | 20 | public: |
20 | enum Views{ TableView=0, CardView, PersonalView }; | 21 | enum Views{ TableView=0, CardView, PersonalView }; |
21 | 22 | ||
22 | AbView( QWidget* parent, const QValueList<int>& ordered ); | 23 | AbView( QWidget* parent, const QValueList<int>& ordered ); |
23 | ~AbView(); | 24 | ~AbView(); |
24 | 25 | ||
25 | bool save(); | 26 | bool save(); |
26 | void load(); | 27 | void load(); |
27 | void reload(); | 28 | void reload(); |
28 | void clear(); | 29 | void clear(); |
29 | 30 | ||
30 | void setView( Views view ); | 31 | void setView( Views view ); |
31 | void showPersonal( bool personal ); | 32 | void showPersonal( bool personal ); |
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 |
39 | void addEntry( const OContact &newContact ); | 40 | void addEntry( const OContact &newContact ); |
40 | void removeEntry( const int UID ); | 41 | void removeEntry( const int UID ); |
41 | void replaceEntry( const OContact &contact ); | 42 | void replaceEntry( const OContact &contact ); |
42 | OContact currentEntry(); | 43 | OContact currentEntry(); |
43 | 44 | ||
44 | void inSearch() { m_inSearch = true; } | 45 | void inSearch() { m_inSearch = true; } |
45 | void offSearch(); | 46 | void offSearch(); |
46 | 47 | ||
47 | QString showCategory() const; | 48 | QString showCategory() const; |
48 | QStringList categories(); | 49 | QStringList categories(); |
49 | 50 | ||
50 | signals: | 51 | signals: |
51 | void signalNotFound(); | 52 | void signalNotFound(); |
52 | void signalClearLetterPicker(); | 53 | void signalClearLetterPicker(); |
53 | void signalViewSwitched ( int ); | 54 | void signalViewSwitched ( int ); |
54 | 55 | ||
55 | public slots: | 56 | public slots: |
56 | void slotDoFind( const QString &str, bool caseSensitive, bool useRegExp, | 57 | void slotDoFind( const QString &str, bool caseSensitive, bool useRegExp, |
57 | bool backwards, QString category = QString::null ); | 58 | bool backwards, QString category = QString::null ); |
58 | void slotSwitch(); | 59 | void slotSwitch(); |
59 | 60 | ||
60 | private: | 61 | private: |
61 | void updateListinViews(); | 62 | void updateListinViews(); |
62 | void updateView( bool newdata = false ); | 63 | void updateView( bool newdata = false ); |
63 | void clearForCategory(); | 64 | void clearForCategory(); |
64 | bool contactCompare( const OContact &cnt, int category ); | 65 | bool contactCompare( const OContact &cnt, int category ); |
65 | void parseName( const QString& name, QString *first, QString *middle, | 66 | void parseName( const QString& name, QString *first, QString *middle, |
66 | QString * last ); | 67 | QString * last ); |
67 | 68 | ||
68 | Categories mCat; | 69 | Categories mCat; |
69 | bool m_inSearch; | 70 | bool m_inSearch; |
70 | bool m_inPersonal; | 71 | bool m_inPersonal; |
71 | int m_curr_category; | 72 | int m_curr_category; |
72 | Views m_curr_View; | 73 | Views m_curr_View; |
73 | Views m_prev_View; | 74 | Views m_prev_View; |
74 | int m_curr_Contact; | 75 | int m_curr_Contact; |
75 | 76 | ||
76 | OContactAccess* m_contactdb; | 77 | OContactAccess* m_contactdb; |
77 | OContactAccess* m_storedDB; | 78 | OContactAccess* m_storedDB; |
78 | OContactAccess::List m_list; | 79 | OContactAccess::List m_list; |
79 | 80 | ||
80 | QWidgetStack* m_viewStack; | 81 | QWidgetStack* m_viewStack; |
81 | AbTable* m_abTable; | 82 | AbTable* m_abTable; |
82 | AbLabel* m_ablabel; | 83 | AbLabel* m_ablabel; |
83 | 84 | ||
84 | QValueList<int> m_orderedFields; | 85 | QValueList<int> m_orderedFields; |
85 | }; | 86 | }; |
86 | 87 | ||
87 | 88 | ||
88 | #endif | 89 | #endif |
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 | |||
@@ -691,128 +691,129 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data) | |||
691 | } else if ( msg == "show(int)" ) { | 691 | } else if ( msg == "show(int)" ) { |
692 | QDataStream stream(data,IO_ReadOnly); | 692 | QDataStream stream(data,IO_ReadOnly); |
693 | int uid; | 693 | int uid; |
694 | stream >> uid; | 694 | stream >> uid; |
695 | 695 | ||
696 | qWarning( "Showing uid: %d" , uid ); | 696 | qWarning( "Showing uid: %d" , uid ); |
697 | 697 | ||
698 | // Deactivate Personal View.. | 698 | // Deactivate Personal View.. |
699 | if ( actionPersonal->isOn() ){ | 699 | if ( actionPersonal->isOn() ){ |
700 | actionPersonal->setOn( false ); | 700 | actionPersonal->setOn( false ); |
701 | slotPersonalView(); | 701 | slotPersonalView(); |
702 | } | 702 | } |
703 | 703 | ||
704 | // Reset category and show as card.. | 704 | // Reset category and show as card.. |
705 | m_abView -> setShowByCategory( QString::null ); | 705 | m_abView -> setShowByCategory( QString::null ); |
706 | m_abView -> setCurrentUid( uid ); | 706 | m_abView -> setCurrentUid( uid ); |
707 | slotViewSwitched ( AbView::CardView ); | 707 | slotViewSwitched ( AbView::CardView ); |
708 | 708 | ||
709 | showMaximized(); | 709 | showMaximized(); |
710 | qApp->exec(); | 710 | qApp->exec(); |
711 | 711 | ||
712 | } else if ( msg == "edit(int)" ) { | 712 | } else if ( msg == "edit(int)" ) { |
713 | QDataStream stream(data,IO_ReadOnly); | 713 | QDataStream stream(data,IO_ReadOnly); |
714 | int uid; | 714 | int uid; |
715 | stream >> uid; | 715 | stream >> uid; |
716 | 716 | ||
717 | // Deactivate Personal View.. | 717 | // Deactivate Personal View.. |
718 | if ( actionPersonal->isOn() ){ | 718 | if ( actionPersonal->isOn() ){ |
719 | actionPersonal->setOn( false ); | 719 | actionPersonal->setOn( false ); |
720 | slotPersonalView(); | 720 | slotPersonalView(); |
721 | } | 721 | } |
722 | 722 | ||
723 | // Reset category and edit.. | 723 | // Reset category and edit.. |
724 | m_abView -> setShowByCategory( QString::null ); | 724 | m_abView -> setShowByCategory( QString::null ); |
725 | m_abView -> setCurrentUid( uid ); | 725 | m_abView -> setCurrentUid( uid ); |
726 | slotViewEdit(); | 726 | slotViewEdit(); |
727 | } | 727 | } |
728 | 728 | ||
729 | } | 729 | } |
730 | 730 | ||
731 | void AddressbookWindow::editEntry( EntryMode entryMode ) | 731 | void AddressbookWindow::editEntry( EntryMode entryMode ) |
732 | { | 732 | { |
733 | OContact entry; | 733 | OContact entry; |
734 | if ( !abEditor ) { | 734 | if ( !abEditor ) { |
735 | abEditor = new ContactEditor( entry, this, "editor" ); | 735 | abEditor = new ContactEditor( entry, this, "editor" ); |
736 | } | 736 | } |
737 | if ( entryMode == EditEntry ) | 737 | if ( entryMode == EditEntry ) |
738 | abEditor->setEntry( m_abView -> currentEntry() ); | 738 | abEditor->setEntry( m_abView -> currentEntry() ); |
739 | else if ( entryMode == NewEntry ) | 739 | else if ( entryMode == NewEntry ) |
740 | abEditor->setEntry( entry ); | 740 | abEditor->setEntry( entry ); |
741 | // other things may change the caption. | 741 | // other things may change the caption. |
742 | abEditor->setCaption( tr("Edit Address") ); | 742 | abEditor->setCaption( tr("Edit Address") ); |
743 | 743 | ||
744 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 744 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) |
745 | abEditor->showMaximized(); | 745 | abEditor->showMaximized(); |
746 | #endif | 746 | #endif |
747 | // fix the foxus... | 747 | // fix the foxus... |
748 | abEditor->setNameFocus(); | 748 | abEditor->setNameFocus(); |
749 | if ( abEditor->exec() ) { | 749 | if ( abEditor->exec() ) { |
750 | setFocus(); | 750 | setFocus(); |
751 | if ( entryMode == NewEntry ) { | 751 | if ( entryMode == NewEntry ) { |
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 | ||
758 | if ( !replEntry.isValidUid() ) | 759 | if ( !replEntry.isValidUid() ) |
759 | replEntry.assignUid(); | 760 | replEntry.assignUid(); |
760 | 761 | ||
761 | m_abView -> replaceEntry( replEntry ); | 762 | m_abView -> replaceEntry( replEntry ); |
762 | } | 763 | } |
763 | } | 764 | } |
764 | // populateCategories(); | 765 | // populateCategories(); |
765 | 766 | ||
766 | } | 767 | } |
767 | 768 | ||
768 | void AddressbookWindow::editPersonal() | 769 | void AddressbookWindow::editPersonal() |
769 | { | 770 | { |
770 | OContact entry; | 771 | OContact entry; |
771 | 772 | ||
772 | // Switch to personal view if not selected | 773 | // Switch to personal view if not selected |
773 | // but take care of the menu, too | 774 | // but take care of the menu, too |
774 | if ( ! actionPersonal->isOn() ){ | 775 | if ( ! actionPersonal->isOn() ){ |
775 | qWarning("*** ++++"); | 776 | qWarning("*** ++++"); |
776 | actionPersonal->setOn( true ); | 777 | actionPersonal->setOn( true ); |
777 | slotPersonalView(); | 778 | slotPersonalView(); |
778 | } | 779 | } |
779 | 780 | ||
780 | if ( !abEditor ) { | 781 | if ( !abEditor ) { |
781 | abEditor = new ContactEditor( entry, this, "editor" ); | 782 | abEditor = new ContactEditor( entry, this, "editor" ); |
782 | } | 783 | } |
783 | 784 | ||
784 | abEditor->setCaption(tr("Edit My Personal Details")); | 785 | abEditor->setCaption(tr("Edit My Personal Details")); |
785 | abEditor->setPersonalView( true ); | 786 | abEditor->setPersonalView( true ); |
786 | editEntry( EditEntry ); | 787 | editEntry( EditEntry ); |
787 | abEditor->setPersonalView( false ); | 788 | abEditor->setPersonalView( false ); |
788 | 789 | ||
789 | } | 790 | } |
790 | 791 | ||
791 | 792 | ||
792 | void AddressbookWindow::slotPersonalView() | 793 | void AddressbookWindow::slotPersonalView() |
793 | { | 794 | { |
794 | qWarning("slotPersonalView()"); | 795 | qWarning("slotPersonalView()"); |
795 | if (!actionPersonal->isOn()) { | 796 | if (!actionPersonal->isOn()) { |
796 | // we just turned it off | 797 | // we just turned it off |
797 | qWarning("slotPersonalView()-> OFF"); | 798 | qWarning("slotPersonalView()-> OFF"); |
798 | setCaption( tr("Contacts") ); | 799 | setCaption( tr("Contacts") ); |
799 | actionNew->setEnabled(TRUE); | 800 | actionNew->setEnabled(TRUE); |
800 | actionTrash->setEnabled(TRUE); | 801 | actionTrash->setEnabled(TRUE); |
801 | actionFind->setEnabled(TRUE); | 802 | actionFind->setEnabled(TRUE); |
802 | actionMail->setEnabled(TRUE); | 803 | actionMail->setEnabled(TRUE); |
803 | // slotUpdateToolbar(); | 804 | // slotUpdateToolbar(); |
804 | 805 | ||
805 | m_abView->showPersonal( false ); | 806 | m_abView->showPersonal( false ); |
806 | 807 | ||
807 | return; | 808 | return; |
808 | } | 809 | } |
809 | 810 | ||
810 | qWarning("slotPersonalView()-> ON"); | 811 | qWarning("slotPersonalView()-> ON"); |
811 | // XXX need to disable some QActions. | 812 | // XXX need to disable some QActions. |
812 | actionNew->setEnabled(FALSE); | 813 | actionNew->setEnabled(FALSE); |
813 | actionTrash->setEnabled(FALSE); | 814 | actionTrash->setEnabled(FALSE); |
814 | actionFind->setEnabled(FALSE); | 815 | actionFind->setEnabled(FALSE); |
815 | actionMail->setEnabled(FALSE); | 816 | actionMail->setEnabled(FALSE); |
816 | 817 | ||
817 | setCaption( tr("Contacts - My Personal Details") ); | 818 | setCaption( tr("Contacts - My Personal Details") ); |
818 | 819 | ||
@@ -950,102 +951,102 @@ void AddressbookWindow::slotSetCategory( int c ) | |||
950 | }else if ( i == (unsigned int)catMenu->count() - 1 ){ // last menu option (seperator is counted, too) will be Unfiled | 951 | }else if ( i == (unsigned int)catMenu->count() - 1 ){ // last menu option (seperator is counted, too) will be Unfiled |
951 | cat = "Unfiled"; | 952 | cat = "Unfiled"; |
952 | qWarning ("Unfiled selected!!!"); | 953 | qWarning ("Unfiled selected!!!"); |
953 | }else{ | 954 | }else{ |
954 | cat = m_abView->categories()[i - 4]; | 955 | cat = m_abView->categories()[i - 4]; |
955 | } | 956 | } |
956 | } | 957 | } |
957 | } | 958 | } |
958 | 959 | ||
959 | // Switch to the selected View | 960 | // Switch to the selected View |
960 | slotViewSwitched( view ); | 961 | slotViewSwitched( view ); |
961 | 962 | ||
962 | // Tell the view about the selected category | 963 | // Tell the view about the selected category |
963 | m_abView -> setShowByCategory( cat ); | 964 | m_abView -> setShowByCategory( cat ); |
964 | 965 | ||
965 | if ( book.isEmpty() ) | 966 | if ( book.isEmpty() ) |
966 | book = "List"; | 967 | book = "List"; |
967 | if ( cat.isEmpty() ) | 968 | if ( cat.isEmpty() ) |
968 | cat = "All"; | 969 | cat = "All"; |
969 | 970 | ||
970 | setCaption( tr( "Contacts" ) + " - " + book + " - " + tr( cat ) ); | 971 | setCaption( tr( "Contacts" ) + " - " + book + " - " + tr( cat ) ); |
971 | } | 972 | } |
972 | 973 | ||
973 | void AddressbookWindow::slotViewSwitched( int view ) | 974 | void AddressbookWindow::slotViewSwitched( int view ) |
974 | { | 975 | { |
975 | qWarning( "void AddressbookWindow::slotViewSwitched( %d )", view ); | 976 | qWarning( "void AddressbookWindow::slotViewSwitched( %d )", view ); |
976 | int menu = 0; | 977 | int menu = 0; |
977 | 978 | ||
978 | // Switch to selected view | 979 | // Switch to selected view |
979 | switch ( view ){ | 980 | switch ( view ){ |
980 | case AbView::TableView: | 981 | case AbView::TableView: |
981 | menu = 1; | 982 | menu = 1; |
982 | m_tableViewButton->setOn(true); | 983 | m_tableViewButton->setOn(true); |
983 | m_cardViewButton->setOn(false); | 984 | m_cardViewButton->setOn(false); |
984 | break; | 985 | break; |
985 | case AbView::CardView: | 986 | case AbView::CardView: |
986 | menu = 2; | 987 | menu = 2; |
987 | m_tableViewButton->setOn(false); | 988 | m_tableViewButton->setOn(false); |
988 | m_cardViewButton->setOn(true); | 989 | m_cardViewButton->setOn(true); |
989 | break; | 990 | break; |
990 | } | 991 | } |
991 | for ( unsigned int i = 1; i < 3; i++ ){ | 992 | for ( unsigned int i = 1; i < 3; i++ ){ |
992 | if ( catMenu ) | 993 | if ( catMenu ) |
993 | catMenu->setItemChecked( i, menu == (int)i ); | 994 | catMenu->setItemChecked( i, menu == (int)i ); |
994 | } | 995 | } |
995 | 996 | ||
996 | // Tell the view about the selected view | 997 | // Tell the view about the selected view |
997 | m_abView -> setShowToView ( (AbView::Views) view ); | 998 | m_abView -> setShowToView ( (AbView::Views) view ); |
998 | active_view = view; | 999 | active_view = view; |
999 | } | 1000 | } |
1000 | 1001 | ||
1001 | 1002 | ||
1002 | void AddressbookWindow::slotListView() | 1003 | void AddressbookWindow::slotListView() |
1003 | { | 1004 | { |
1004 | slotViewSwitched( AbView::TableView ); | 1005 | slotViewSwitched( AbView::TableView ); |
1005 | } | 1006 | } |
1006 | 1007 | ||
1007 | void AddressbookWindow::slotCardView() | 1008 | void AddressbookWindow::slotCardView() |
1008 | { | 1009 | { |
1009 | slotViewSwitched( AbView::CardView ); | 1010 | slotViewSwitched( AbView::CardView ); |
1010 | } | 1011 | } |
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 | ||
1018 | 1019 | ||
1019 | void AddressbookWindow::populateCategories() | 1020 | void AddressbookWindow::populateCategories() |
1020 | { | 1021 | { |
1021 | catMenu->clear(); | 1022 | catMenu->clear(); |
1022 | 1023 | ||
1023 | int id, rememberId; | 1024 | int id, rememberId; |
1024 | id = 1; | 1025 | id = 1; |
1025 | rememberId = 0; | 1026 | rememberId = 0; |
1026 | 1027 | ||
1027 | catMenu->insertItem( Resource::loadPixmap( "datebook/weeklst" ), tr( "List" ), id++ ); | 1028 | catMenu->insertItem( Resource::loadPixmap( "datebook/weeklst" ), tr( "List" ), id++ ); |
1028 | catMenu->insertItem( Resource::loadPixmap( "day" ), tr( "Cards" ), id++ ); | 1029 | catMenu->insertItem( Resource::loadPixmap( "day" ), tr( "Cards" ), id++ ); |
1029 | // catMenu->insertItem( tr( "Personal" ), id++ ); | 1030 | // catMenu->insertItem( tr( "Personal" ), id++ ); |
1030 | catMenu->insertSeparator(); | 1031 | catMenu->insertSeparator(); |
1031 | 1032 | ||
1032 | catMenu->insertItem( tr( "All" ), id++ ); | 1033 | catMenu->insertItem( tr( "All" ), id++ ); |
1033 | QStringList categories = m_abView->categories(); | 1034 | QStringList categories = m_abView->categories(); |
1034 | categories.append( tr( "Unfiled" ) ); | 1035 | categories.append( tr( "Unfiled" ) ); |
1035 | for ( QStringList::Iterator it = categories.begin(); | 1036 | for ( QStringList::Iterator it = categories.begin(); |
1036 | it != categories.end(); ++it ) { | 1037 | it != categories.end(); ++it ) { |
1037 | catMenu->insertItem( *it, id ); | 1038 | catMenu->insertItem( *it, id ); |
1038 | if ( *it == m_abView -> showCategory() ) | 1039 | if ( *it == m_abView -> showCategory() ) |
1039 | rememberId = id; | 1040 | rememberId = id; |
1040 | ++id; | 1041 | ++id; |
1041 | } | 1042 | } |
1042 | 1043 | ||
1043 | 1044 | ||
1044 | if ( m_abView -> showCategory().isEmpty() ) { | 1045 | if ( m_abView -> showCategory().isEmpty() ) { |
1045 | slotSetCategory( 3 ); | 1046 | slotSetCategory( 3 ); |
1046 | } | 1047 | } |
1047 | else { | 1048 | else { |
1048 | slotSetCategory( rememberId ); | 1049 | slotSetCategory( rememberId ); |
1049 | } | 1050 | } |
1050 | } | 1051 | } |
1051 | 1052 | ||
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 | |||
@@ -244,129 +244,129 @@ | |||
244 | <name>name</name> | 244 | <name>name</name> |
245 | <cstring>m_largeFont</cstring> | 245 | <cstring>m_largeFont</cstring> |
246 | </property> | 246 | </property> |
247 | <property stdset="1"> | 247 | <property stdset="1"> |
248 | <name>text</name> | 248 | <name>text</name> |
249 | <string>Large</string> | 249 | <string>Large</string> |
250 | </property> | 250 | </property> |
251 | <property> | 251 | <property> |
252 | <name>whatsThis</name> | 252 | <name>whatsThis</name> |
253 | <string>Font size for list- and card view</string> | 253 | <string>Font size for list- and card view</string> |
254 | </property> | 254 | </property> |
255 | </widget> | 255 | </widget> |
256 | </hbox> | 256 | </hbox> |
257 | </widget> | 257 | </widget> |
258 | <widget> | 258 | <widget> |
259 | <class>QButtonGroup</class> | 259 | <class>QButtonGroup</class> |
260 | <property stdset="1"> | 260 | <property stdset="1"> |
261 | <name>name</name> | 261 | <name>name</name> |
262 | <cstring>ButtonGroup4</cstring> | 262 | <cstring>ButtonGroup4</cstring> |
263 | </property> | 263 | </property> |
264 | <property stdset="1"> | 264 | <property stdset="1"> |
265 | <name>title</name> | 265 | <name>title</name> |
266 | <string>Tool-/Menubar</string> | 266 | <string>Tool-/Menubar</string> |
267 | </property> | 267 | </property> |
268 | <hbox> | 268 | <hbox> |
269 | <property stdset="1"> | 269 | <property stdset="1"> |
270 | <name>margin</name> | 270 | <name>margin</name> |
271 | <number>11</number> | 271 | <number>11</number> |
272 | </property> | 272 | </property> |
273 | <property stdset="1"> | 273 | <property stdset="1"> |
274 | <name>spacing</name> | 274 | <name>spacing</name> |
275 | <number>6</number> | 275 | <number>6</number> |
276 | </property> | 276 | </property> |
277 | <widget> | 277 | <widget> |
278 | <class>QRadioButton</class> | 278 | <class>QRadioButton</class> |
279 | <property stdset="1"> | 279 | <property stdset="1"> |
280 | <name>name</name> | 280 | <name>name</name> |
281 | <cstring>m_fixedBars</cstring> | 281 | <cstring>m_fixedBars</cstring> |
282 | </property> | 282 | </property> |
283 | <property stdset="1"> | 283 | <property stdset="1"> |
284 | <name>text</name> | 284 | <name>text</name> |
285 | <string>Fixed</string> | 285 | <string>Fixed</string> |
286 | </property> | 286 | </property> |
287 | <property stdset="1"> | 287 | <property stdset="1"> |
288 | <name>checked</name> | 288 | <name>checked</name> |
289 | <bool>true</bool> | 289 | <bool>true</bool> |
290 | </property> | 290 | </property> |
291 | <property> | 291 | <property> |
292 | <name>toolTip</name> | 292 | <name>toolTip</name> |
293 | <string></string> | 293 | <string></string> |
294 | </property> | 294 | </property> |
295 | <property> | 295 | <property> |
296 | <name>whatsThis</name> | 296 | <name>whatsThis</name> |
297 | <string>Switch to fixed menu-/toolbars after restarting application !</string> | 297 | <string>Switch to fixed menu-/toolbars after restarting application !</string> |
298 | </property> | 298 | </property> |
299 | </widget> | 299 | </widget> |
300 | <widget> | 300 | <widget> |
301 | <class>QRadioButton</class> | 301 | <class>QRadioButton</class> |
302 | <property stdset="1"> | 302 | <property stdset="1"> |
303 | <name>name</name> | 303 | <name>name</name> |
304 | <cstring>m_moveBars</cstring> | 304 | <cstring>m_moveBars</cstring> |
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> |
312 | <string>Switch to moveable menu-/toolbars after restarting application !</string> | 312 | <string>Switch to moveable menu-/toolbars after restarting application !</string> |
313 | </property> | 313 | </property> |
314 | </widget> | 314 | </widget> |
315 | </hbox> | 315 | </hbox> |
316 | </widget> | 316 | </widget> |
317 | <spacer> | 317 | <spacer> |
318 | <property> | 318 | <property> |
319 | <name>name</name> | 319 | <name>name</name> |
320 | <cstring>Spacer3</cstring> | 320 | <cstring>Spacer3</cstring> |
321 | </property> | 321 | </property> |
322 | <property stdset="1"> | 322 | <property stdset="1"> |
323 | <name>orientation</name> | 323 | <name>orientation</name> |
324 | <enum>Vertical</enum> | 324 | <enum>Vertical</enum> |
325 | </property> | 325 | </property> |
326 | <property stdset="1"> | 326 | <property stdset="1"> |
327 | <name>sizeType</name> | 327 | <name>sizeType</name> |
328 | <enum>Expanding</enum> | 328 | <enum>Expanding</enum> |
329 | </property> | 329 | </property> |
330 | <property> | 330 | <property> |
331 | <name>sizeHint</name> | 331 | <name>sizeHint</name> |
332 | <size> | 332 | <size> |
333 | <width>20</width> | 333 | <width>20</width> |
334 | <height>20</height> | 334 | <height>20</height> |
335 | </size> | 335 | </size> |
336 | </property> | 336 | </property> |
337 | </spacer> | 337 | </spacer> |
338 | </vbox> | 338 | </vbox> |
339 | </widget> | 339 | </widget> |
340 | <widget> | 340 | <widget> |
341 | <class>QWidget</class> | 341 | <class>QWidget</class> |
342 | <property stdset="1"> | 342 | <property stdset="1"> |
343 | <name>name</name> | 343 | <name>name</name> |
344 | <cstring>tab</cstring> | 344 | <cstring>tab</cstring> |
345 | </property> | 345 | </property> |
346 | <attribute> | 346 | <attribute> |
347 | <name>title</name> | 347 | <name>title</name> |
348 | <string>Mail</string> | 348 | <string>Mail</string> |
349 | </attribute> | 349 | </attribute> |
350 | <vbox> | 350 | <vbox> |
351 | <property stdset="1"> | 351 | <property stdset="1"> |
352 | <name>margin</name> | 352 | <name>margin</name> |
353 | <number>5</number> | 353 | <number>5</number> |
354 | </property> | 354 | </property> |
355 | <property stdset="1"> | 355 | <property stdset="1"> |
356 | <name>spacing</name> | 356 | <name>spacing</name> |
357 | <number>6</number> | 357 | <number>6</number> |
358 | </property> | 358 | </property> |
359 | <widget> | 359 | <widget> |
360 | <class>QButtonGroup</class> | 360 | <class>QButtonGroup</class> |
361 | <property stdset="1"> | 361 | <property stdset="1"> |
362 | <name>name</name> | 362 | <name>name</name> |
363 | <cstring>ButtonGroup2</cstring> | 363 | <cstring>ButtonGroup2</cstring> |
364 | </property> | 364 | </property> |
365 | <property stdset="1"> | 365 | <property stdset="1"> |
366 | <name>title</name> | 366 | <name>title</name> |
367 | <string>Mail</string> | 367 | <string>Mail</string> |
368 | </property> | 368 | </property> |
369 | <property> | 369 | <property> |
370 | <name>whatsThis</name> | 370 | <name>whatsThis</name> |
371 | <string>Fontsettings for list and card view</string> | 371 | <string>Fontsettings for list and card view</string> |
372 | </property> | 372 | </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 | |||
@@ -595,132 +595,134 @@ void ContactEditor::init() { | |||
595 | for (i = counter; it != slDynamicEntries.end(); i++, ++it ) { | 595 | for (i = counter; it != slDynamicEntries.end(); i++, ++it ) { |
596 | 596 | ||
597 | if (((*it) == "Anniversary") || | 597 | if (((*it) == "Anniversary") || |
598 | ((*it) == "Birthday")|| ((*it) == "Gender")) continue; | 598 | ((*it) == "Birthday")|| ((*it) == "Gender")) continue; |
599 | 599 | ||
600 | l = new QLabel( mapIdToStr[mapStrToID[*it]].utf8() , container ); | 600 | l = new QLabel( mapIdToStr[mapStrToID[*it]].utf8() , container ); |
601 | listName.append( l ); | 601 | listName.append( l ); |
602 | gl->addWidget( l, i, 0 ); | 602 | gl->addWidget( l, i, 0 ); |
603 | QLineEdit *e = new QLineEdit( container ); | 603 | QLineEdit *e = new QLineEdit( container ); |
604 | listValue.append( e ); | 604 | listValue.append( e ); |
605 | gl->addWidget( e, i, 1); | 605 | gl->addWidget( e, i, 1); |
606 | } | 606 | } |
607 | // Fill labels with names.. | 607 | // Fill labels with names.. |
608 | //loadFields(); | 608 | //loadFields(); |
609 | 609 | ||
610 | 610 | ||
611 | tabMain->insertTab( tabViewport, tr( "Details" ) ); | 611 | tabMain->insertTab( tabViewport, tr( "Details" ) ); |
612 | 612 | ||
613 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); | 613 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); |
614 | dlgNote->setCaption( tr("Enter Note") ); | 614 | dlgNote->setCaption( tr("Enter Note") ); |
615 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); | 615 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); |
616 | txtNote = new QMultiLineEdit( dlgNote ); | 616 | txtNote = new QMultiLineEdit( dlgNote ); |
617 | vbNote->addWidget( txtNote ); | 617 | vbNote->addWidget( txtNote ); |
618 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); | 618 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); |
619 | 619 | ||
620 | dlgName = new QDialog( this, "Name Dialog", TRUE ); | 620 | dlgName = new QDialog( this, "Name Dialog", TRUE ); |
621 | dlgName->setCaption( tr("Edit Name") ); | 621 | dlgName->setCaption( tr("Edit Name") ); |
622 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); | 622 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); |
623 | 623 | ||
624 | l = new QLabel( tr("First Name"), dlgName ); | 624 | l = new QLabel( tr("First Name"), dlgName ); |
625 | gl->addWidget( l, 0, 0 ); | 625 | gl->addWidget( l, 0, 0 ); |
626 | txtFirstName = new QLineEdit( dlgName ); | 626 | txtFirstName = new QLineEdit( dlgName ); |
627 | gl->addWidget( txtFirstName, 0, 1 ); | 627 | gl->addWidget( txtFirstName, 0, 1 ); |
628 | 628 | ||
629 | l = new QLabel( tr("Middle Name"), dlgName ); | 629 | l = new QLabel( tr("Middle Name"), dlgName ); |
630 | gl->addWidget( l, 1, 0 ); | 630 | gl->addWidget( l, 1, 0 ); |
631 | txtMiddleName = new QLineEdit( dlgName ); | 631 | txtMiddleName = new QLineEdit( dlgName ); |
632 | gl->addWidget( txtMiddleName, 1, 1 ); | 632 | gl->addWidget( txtMiddleName, 1, 1 ); |
633 | 633 | ||
634 | l = new QLabel( tr("Last Name"), dlgName ); | 634 | l = new QLabel( tr("Last Name"), dlgName ); |
635 | gl->addWidget( l, 2, 0 ); | 635 | gl->addWidget( l, 2, 0 ); |
636 | txtLastName = new QLineEdit( dlgName ); | 636 | txtLastName = new QLineEdit( dlgName ); |
637 | gl->addWidget( txtLastName, 2, 1 ); | 637 | gl->addWidget( txtLastName, 2, 1 ); |
638 | 638 | ||
639 | // l = new QLabel( tr("Suffix"), dlgName ); | 639 | // l = new QLabel( tr("Suffix"), dlgName ); |
640 | // gl->addWidget( l, 3, 0 ); | 640 | // gl->addWidget( l, 3, 0 ); |
641 | // txtSuffix = new QLineEdit( dlgName ); | 641 | // txtSuffix = new QLineEdit( dlgName ); |
642 | // gl->addWidget( txtSuffix, 3, 1 ); | 642 | // gl->addWidget( txtSuffix, 3, 1 ); |
643 | space = new QSpacerItem(1,1, | 643 | space = new QSpacerItem(1,1, |
644 | QSizePolicy::Maximum, | 644 | QSizePolicy::Maximum, |
645 | QSizePolicy::MinimumExpanding ); | 645 | QSizePolicy::MinimumExpanding ); |
646 | gl->addItem( space, 4, 0 ); | 646 | gl->addItem( space, 4, 0 ); |
647 | 647 | ||
648 | cmbChooserField1->insertStringList( trlChooserNames ); | 648 | cmbChooserField1->insertStringList( trlChooserNames ); |
649 | cmbChooserField2->insertStringList( trlChooserNames ); | 649 | cmbChooserField2->insertStringList( trlChooserNames ); |
650 | cmbChooserField3->insertStringList( trlChooserNames ); | 650 | cmbChooserField3->insertStringList( trlChooserNames ); |
651 | cmbChooserField4->insertStringList( trlChooserNames ); | 651 | cmbChooserField4->insertStringList( trlChooserNames ); |
652 | 652 | ||
653 | cmbChooserField1->setCurrentItem( 0 ); | 653 | cmbChooserField1->setCurrentItem( 0 ); |
654 | cmbChooserField2->setCurrentItem( 1 ); | 654 | cmbChooserField2->setCurrentItem( 1 ); |
655 | cmbChooserField3->setCurrentItem( 2 ); | 655 | cmbChooserField3->setCurrentItem( 2 ); |
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 &)), |
666 | this, SLOT(slotChooser2Change(const QString &)) ); | 668 | this, SLOT(slotChooser2Change(const QString &)) ); |
667 | connect( txtChooserField3, SIGNAL(textChanged(const QString &)), | 669 | connect( txtChooserField3, SIGNAL(textChanged(const QString &)), |
668 | this, SLOT(slotChooser3Change(const QString &)) ); | 670 | this, SLOT(slotChooser3Change(const QString &)) ); |
669 | connect( txtChooserField4, SIGNAL(textChanged(const QString &)), | 671 | connect( txtChooserField4, SIGNAL(textChanged(const QString &)), |
670 | this, SLOT(slotChooser4Change(const QString &)) ); | 672 | this, SLOT(slotChooser4Change(const QString &)) ); |
671 | connect( txtAddress, SIGNAL(textChanged(const QString &)), | 673 | connect( txtAddress, SIGNAL(textChanged(const QString &)), |
672 | this, SLOT(slotAddressChange(const QString &)) ); | 674 | this, SLOT(slotAddressChange(const QString &)) ); |
673 | connect( txtCity, SIGNAL(textChanged(const QString &)), | 675 | connect( txtCity, SIGNAL(textChanged(const QString &)), |
674 | this, SLOT(slotCityChange(const QString &)) ); | 676 | this, SLOT(slotCityChange(const QString &)) ); |
675 | connect( txtState, SIGNAL(textChanged(const QString &)), | 677 | connect( txtState, SIGNAL(textChanged(const QString &)), |
676 | this, SLOT(slotStateChange(const QString &)) ); | 678 | this, SLOT(slotStateChange(const QString &)) ); |
677 | connect( txtZip, SIGNAL(textChanged(const QString &)), | 679 | connect( txtZip, SIGNAL(textChanged(const QString &)), |
678 | this, SLOT(slotZipChange(const QString &)) ); | 680 | this, SLOT(slotZipChange(const QString &)) ); |
679 | connect( cmbCountry, SIGNAL(textChanged(const QString &)), | 681 | connect( cmbCountry, SIGNAL(textChanged(const QString &)), |
680 | this, SLOT(slotCountryChange(const QString &)) ); | 682 | this, SLOT(slotCountryChange(const QString &)) ); |
681 | connect( cmbCountry, SIGNAL(activated(const QString &)), | 683 | connect( cmbCountry, SIGNAL(activated(const QString &)), |
682 | this, SLOT(slotCountryChange(const QString &)) ); | 684 | this, SLOT(slotCountryChange(const QString &)) ); |
683 | connect( cmbChooserField1, SIGNAL(activated(int)), | 685 | connect( cmbChooserField1, SIGNAL(activated(int)), |
684 | this, SLOT(slotCmbChooser1Change(int)) ); | 686 | this, SLOT(slotCmbChooser1Change(int)) ); |
685 | connect( cmbChooserField2, SIGNAL(activated(int)), | 687 | connect( cmbChooserField2, SIGNAL(activated(int)), |
686 | this, SLOT(slotCmbChooser2Change(int)) ); | 688 | this, SLOT(slotCmbChooser2Change(int)) ); |
687 | connect( cmbChooserField3, SIGNAL(activated(int)), | 689 | connect( cmbChooserField3, SIGNAL(activated(int)), |
688 | this, SLOT(slotCmbChooser3Change(int)) ); | 690 | this, SLOT(slotCmbChooser3Change(int)) ); |
689 | connect( cmbChooserField4, SIGNAL(activated(int)), | 691 | connect( cmbChooserField4, SIGNAL(activated(int)), |
690 | this, SLOT(slotCmbChooser4Change(int)) ); | 692 | this, SLOT(slotCmbChooser4Change(int)) ); |
691 | connect( cmbAddress, SIGNAL(activated(int)), | 693 | connect( cmbAddress, SIGNAL(activated(int)), |
692 | this, SLOT(slotAddressTypeChange(int)) ); | 694 | this, SLOT(slotAddressTypeChange(int)) ); |
693 | 695 | ||
694 | new QPEDialogListener(this); | 696 | new QPEDialogListener(this); |
695 | 697 | ||
696 | setPersonalView ( m_personalView ); | 698 | setPersonalView ( m_personalView ); |
697 | 699 | ||
698 | qWarning("init() END"); | 700 | qWarning("init() END"); |
699 | } | 701 | } |
700 | 702 | ||
701 | void ContactEditor::defaultEmailChanged(int i){ | 703 | void ContactEditor::defaultEmailChanged(int i){ |
702 | qDebug("defaultEmailChanged"); | 704 | qDebug("defaultEmailChanged"); |
703 | 705 | ||
704 | // was sollte das ? (se) | 706 | // was sollte das ? (se) |
705 | // int index = cmbChooserField1->currentItem(); | 707 | // int index = cmbChooserField1->currentItem(); |
706 | // slChooserValues[index] = cmbDefaultEmail->text(i); | 708 | // slChooserValues[index] = cmbDefaultEmail->text(i); |
707 | 709 | ||
708 | defaultEmail = cmbDefaultEmail->text(i); | 710 | defaultEmail = cmbDefaultEmail->text(i); |
709 | qDebug ("Changed to: %s", defaultEmail.latin1()); | 711 | qDebug ("Changed to: %s", defaultEmail.latin1()); |
710 | 712 | ||
711 | } | 713 | } |
712 | 714 | ||
713 | void ContactEditor::populateDefaultEmailCmb(){ | 715 | void ContactEditor::populateDefaultEmailCmb(){ |
714 | 716 | ||
715 | // if the default-email combo was not selected and therfore not created | 717 | // if the default-email combo was not selected and therfore not created |
716 | // we get a lot of trouble.. Therfore create an invisible one.. | 718 | // we get a lot of trouble.. Therfore create an invisible one.. |
717 | if ( !cmbDefaultEmail ){ | 719 | if ( !cmbDefaultEmail ){ |
718 | cmbDefaultEmail = new QComboBox(this); | 720 | cmbDefaultEmail = new QComboBox(this); |
719 | cmbDefaultEmail -> hide(); | 721 | cmbDefaultEmail -> hide(); |
720 | } | 722 | } |
721 | cmbDefaultEmail->clear(); | 723 | cmbDefaultEmail->clear(); |
722 | cmbDefaultEmail->insertStringList( emails ); | 724 | cmbDefaultEmail->insertStringList( emails ); |
723 | // cmbDefaultEmail->show(); | 725 | // cmbDefaultEmail->show(); |
724 | 726 | ||
725 | // Select default email in combo.. | 727 | // Select default email in combo.. |
726 | bool found = false; | 728 | bool found = false; |
@@ -996,128 +998,138 @@ void ContactEditor::slotCmbChooser4Change( int index ) { | |||
996 | txtChooserField4->setText( slChooserValues[index] ); | 998 | txtChooserField4->setText( slChooserValues[index] ); |
997 | txtChooserField4->setFocus(); | 999 | txtChooserField4->setFocus(); |
998 | 1000 | ||
999 | } | 1001 | } |
1000 | } | 1002 | } |
1001 | 1003 | ||
1002 | void ContactEditor::slotAddressTypeChange( int index ) { | 1004 | void ContactEditor::slotAddressTypeChange( int index ) { |
1003 | 1005 | ||
1004 | 1006 | ||
1005 | if ( !initializing ) | 1007 | if ( !initializing ) |
1006 | contactfields.setFieldOrder( 4, index ); | 1008 | contactfields.setFieldOrder( 4, index ); |
1007 | 1009 | ||
1008 | 1010 | ||
1009 | if ( index == 0 ) { | 1011 | if ( index == 0 ) { |
1010 | 1012 | ||
1011 | txtAddress->setText( slBusinessAddress[0] ); | 1013 | txtAddress->setText( slBusinessAddress[0] ); |
1012 | //txtAddress2->setText( (*slBusinessAddress)[1] ); | 1014 | //txtAddress2->setText( (*slBusinessAddress)[1] ); |
1013 | //txtPOBox->setText( (*slBusinessAddress)[2] ); | 1015 | //txtPOBox->setText( (*slBusinessAddress)[2] ); |
1014 | txtCity->setText( slBusinessAddress[3] ); | 1016 | txtCity->setText( slBusinessAddress[3] ); |
1015 | txtState->setText( slBusinessAddress[4] ); | 1017 | txtState->setText( slBusinessAddress[4] ); |
1016 | txtZip->setText( slBusinessAddress[5] ); | 1018 | txtZip->setText( slBusinessAddress[5] ); |
1017 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 1019 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
1018 | txtTmp->setText( slBusinessAddress[6] ); | 1020 | txtTmp->setText( slBusinessAddress[6] ); |
1019 | 1021 | ||
1020 | } else { | 1022 | } else { |
1021 | 1023 | ||
1022 | txtAddress->setText( slHomeAddress[0] ); | 1024 | txtAddress->setText( slHomeAddress[0] ); |
1023 | //txtAddress2->setText( (*slHomeAddress)[1] ); | 1025 | //txtAddress2->setText( (*slHomeAddress)[1] ); |
1024 | //txtPOBox->setText( (*slHomeAddress)[2] ); | 1026 | //txtPOBox->setText( (*slHomeAddress)[2] ); |
1025 | txtCity->setText( slHomeAddress[3] ); | 1027 | txtCity->setText( slHomeAddress[3] ); |
1026 | txtState->setText( slHomeAddress[4] ); | 1028 | txtState->setText( slHomeAddress[4] ); |
1027 | txtZip->setText( slHomeAddress[5] ); | 1029 | txtZip->setText( slHomeAddress[5] ); |
1028 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 1030 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
1029 | txtTmp->setText( slHomeAddress[6] ); | 1031 | txtTmp->setText( slHomeAddress[6] ); |
1030 | 1032 | ||
1031 | } | 1033 | } |
1032 | 1034 | ||
1033 | } | 1035 | } |
1034 | 1036 | ||
1035 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { | 1037 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { |
1036 | 1038 | ||
1037 | qWarning( "ContactEditor::slotFullNameChange( %s )", textChanged.latin1() ); | 1039 | qWarning( "ContactEditor::slotFullNameChange( %s )", textChanged.latin1() ); |
1038 | 1040 | ||
1039 | int index = cmbFileAs->currentItem(); | 1041 | int index = cmbFileAs->currentItem(); |
1040 | 1042 | ||
1041 | cmbFileAs->clear(); | 1043 | cmbFileAs->clear(); |
1042 | 1044 | ||
1043 | cmbFileAs->insertItem( parseName( textChanged, NAME_LF ) ); | 1045 | cmbFileAs->insertItem( parseName( textChanged, NAME_LF ) ); |
1044 | cmbFileAs->insertItem( parseName( textChanged, NAME_LFM ) ); | 1046 | cmbFileAs->insertItem( parseName( textChanged, NAME_LFM ) ); |
1045 | cmbFileAs->insertItem( parseName( textChanged, NAME_FL ) ); | 1047 | cmbFileAs->insertItem( parseName( textChanged, NAME_FL ) ); |
1046 | cmbFileAs->insertItem( parseName( textChanged, NAME_FML ) ); | 1048 | cmbFileAs->insertItem( parseName( textChanged, NAME_FML ) ); |
1047 | if ( ! txtSuffix->text().isEmpty() ) | 1049 | if ( ! txtSuffix->text().isEmpty() ) |
1048 | cmbFileAs->insertItem( parseName( textChanged, NAME_FML ) + " " + txtSuffix->text() ); | 1050 | cmbFileAs->insertItem( parseName( textChanged, NAME_FML ) + " " + txtSuffix->text() ); |
1049 | 1051 | ||
1050 | cmbFileAs->setCurrentItem( index ); | 1052 | cmbFileAs->setCurrentItem( index ); |
1051 | 1053 | ||
1052 | 1054 | ||
1053 | } | 1055 | } |
1054 | 1056 | ||
1055 | void ContactEditor::slotSuffixChange( const QString& ) { | 1057 | void ContactEditor::slotSuffixChange( const QString& ) { |
1056 | // Just want to update the FileAs combo if the suffix was changed.. | 1058 | // Just want to update the FileAs combo if the suffix was changed.. |
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() ) { |
1063 | cleanupFields(); | 1075 | cleanupFields(); |
1064 | reject(); | 1076 | reject(); |
1065 | } else { | 1077 | } else { |
1066 | saveEntry(); | 1078 | saveEntry(); |
1067 | cleanupFields(); | 1079 | cleanupFields(); |
1068 | QDialog::accept(); | 1080 | QDialog::accept(); |
1069 | } | 1081 | } |
1070 | 1082 | ||
1071 | } | 1083 | } |
1072 | 1084 | ||
1073 | void ContactEditor::slotNote() { | 1085 | void ContactEditor::slotNote() { |
1074 | 1086 | ||
1075 | dlgNote->showMaximized(); | 1087 | dlgNote->showMaximized(); |
1076 | if ( !dlgNote->exec() ) { | 1088 | if ( !dlgNote->exec() ) { |
1077 | txtNote->setText( ent.notes() ); | 1089 | txtNote->setText( ent.notes() ); |
1078 | } | 1090 | } |
1079 | } | 1091 | } |
1080 | 1092 | ||
1081 | void ContactEditor::slotName() { | 1093 | void ContactEditor::slotName() { |
1082 | 1094 | ||
1083 | QString tmpName; | 1095 | QString tmpName; |
1084 | 1096 | ||
1085 | txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); | 1097 | txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); |
1086 | txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); | 1098 | txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); |
1087 | txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); | 1099 | txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); |
1088 | // txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); | 1100 | // txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); |
1089 | 1101 | ||
1090 | dlgName->showMaximized(); | 1102 | dlgName->showMaximized(); |
1091 | if ( dlgName->exec() ) { | 1103 | if ( dlgName->exec() ) { |
1092 | if ( txtLastName->text().contains( ' ', TRUE ) ) | 1104 | if ( txtLastName->text().contains( ' ', TRUE ) ) |
1093 | tmpName = txtLastName->text() + ", " + txtFirstName->text() + " " + txtMiddleName->text(); | 1105 | tmpName = txtLastName->text() + ", " + txtFirstName->text() + " " + txtMiddleName->text(); |
1094 | else | 1106 | else |
1095 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text(); | 1107 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text(); |
1096 | 1108 | ||
1097 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); | 1109 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); |
1098 | slotFullNameChange( txtFullName->text() ); | 1110 | slotFullNameChange( txtFullName->text() ); |
1099 | } | 1111 | } |
1100 | 1112 | ||
1101 | } | 1113 | } |
1102 | 1114 | ||
1103 | void ContactEditor::setNameFocus() { | 1115 | void ContactEditor::setNameFocus() { |
1104 | 1116 | ||
1105 | txtFullName->setFocus(); | 1117 | txtFullName->setFocus(); |
1106 | 1118 | ||
1107 | } | 1119 | } |
1108 | 1120 | ||
1109 | bool ContactEditor::isEmpty() { | 1121 | bool ContactEditor::isEmpty() { |
1110 | // Test and see if the record should be saved. | 1122 | // Test and see if the record should be saved. |
1111 | // More strict than the original qtopia, needs name or fileas to save | 1123 | // More strict than the original qtopia, needs name or fileas to save |
1112 | 1124 | ||
1113 | QString t = txtFullName->text(); | 1125 | QString t = txtFullName->text(); |
1114 | if ( !t.isEmpty() && containsAlphaNum( t ) ) | 1126 | if ( !t.isEmpty() && containsAlphaNum( t ) ) |
1115 | return false; | 1127 | return false; |
1116 | 1128 | ||
1117 | t = cmbFileAs->currentText(); | 1129 | t = cmbFileAs->currentText(); |
1118 | if ( !t.isEmpty() && containsAlphaNum( t ) ) | 1130 | if ( !t.isEmpty() && containsAlphaNum( t ) ) |
1119 | return false; | 1131 | return false; |
1120 | 1132 | ||
1121 | return true; | 1133 | return true; |
1122 | 1134 | ||
1123 | } | 1135 | } |
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 | |||
@@ -40,128 +40,129 @@ const int NAME_FML = 3; | |||
40 | 40 | ||
41 | const int NAME_F = 4; | 41 | const int NAME_F = 4; |
42 | const int NAME_M = 5; | 42 | const int NAME_M = 5; |
43 | const int NAME_L = 6; | 43 | const int NAME_L = 6; |
44 | const int NAME_S = 7; | 44 | const int NAME_S = 7; |
45 | 45 | ||
46 | 46 | ||
47 | class QScrollView; | 47 | class QScrollView; |
48 | class QTabWidget; | 48 | class QTabWidget; |
49 | class QMultiLineEdit; | 49 | class QMultiLineEdit; |
50 | class QLineEdit; | 50 | class QLineEdit; |
51 | class QComboBox; | 51 | class QComboBox; |
52 | class QPushButton; | 52 | class QPushButton; |
53 | class CategorySelect; | 53 | class CategorySelect; |
54 | class QLabel; | 54 | class QLabel; |
55 | 55 | ||
56 | class ContactEditor : public QDialog { | 56 | class ContactEditor : public QDialog { |
57 | Q_OBJECT | 57 | Q_OBJECT |
58 | 58 | ||
59 | public: | 59 | public: |
60 | ContactEditor(const OContact &entry, | 60 | ContactEditor(const OContact &entry, |
61 | QWidget *parent = 0, | 61 | QWidget *parent = 0, |
62 | const char *name = 0, | 62 | const char *name = 0, |
63 | WFlags fl = 0 ); | 63 | WFlags fl = 0 ); |
64 | ~ContactEditor(); | 64 | ~ContactEditor(); |
65 | void setNameFocus(); | 65 | void setNameFocus(); |
66 | void setPersonalView( bool personal = true ); | 66 | void setPersonalView( bool personal = true ); |
67 | OContact entry() const { return ent; } | 67 | OContact entry() const { return ent; } |
68 | 68 | ||
69 | public slots: | 69 | public slots: |
70 | void slotNote(); | 70 | void slotNote(); |
71 | void slotName(); | 71 | void slotName(); |
72 | void setEntry(const OContact &entry); | 72 | void setEntry(const OContact &entry); |
73 | 73 | ||
74 | protected slots: | 74 | protected slots: |
75 | void accept(); | 75 | void accept(); |
76 | 76 | ||
77 | private: | 77 | private: |
78 | void init(); | 78 | void init(); |
79 | void saveEntry(); | 79 | void saveEntry(); |
80 | bool isEmpty(); | 80 | bool isEmpty(); |
81 | void cleanupFields(); | 81 | void cleanupFields(); |
82 | void updateDatePicker(); | 82 | void updateDatePicker(); |
83 | QString parseName( QString fullName, int type ); | 83 | QString parseName( QString fullName, int type ); |
84 | void chooserError( int index ); | 84 | void chooserError( int index ); |
85 | private slots: | 85 | private slots: |
86 | void slotChooser1Change( const QString &textChanged ); | 86 | void slotChooser1Change( const QString &textChanged ); |
87 | void slotChooser2Change( const QString &textChanged ); | 87 | void slotChooser2Change( const QString &textChanged ); |
88 | void slotChooser3Change( const QString &textChanged ); | 88 | void slotChooser3Change( const QString &textChanged ); |
89 | void slotChooser4Change( const QString &textChanged ); | 89 | void slotChooser4Change( const QString &textChanged ); |
90 | void slotCmbChooser1Change( int index ); | 90 | void slotCmbChooser1Change( int index ); |
91 | void slotCmbChooser2Change( int index ); | 91 | void slotCmbChooser2Change( int index ); |
92 | void slotCmbChooser3Change( int index ); | 92 | void slotCmbChooser3Change( int index ); |
93 | void slotCmbChooser4Change( int index ); | 93 | void slotCmbChooser4Change( int index ); |
94 | void slotAddressTypeChange( int index ); | 94 | void slotAddressTypeChange( int index ); |
95 | void slotAddressChange( const QString &textChanged ); | 95 | void slotAddressChange( const QString &textChanged ); |
96 | void slotAddress2Change( const QString &textChanged ); | 96 | void slotAddress2Change( const QString &textChanged ); |
97 | void slotPOBoxChange( const QString &textChanged ); | 97 | void slotPOBoxChange( const QString &textChanged ); |
98 | void slotCityChange( const QString &textChanged ); | 98 | void slotCityChange( const QString &textChanged ); |
99 | void slotStateChange( const QString &textChanged ); | 99 | void slotStateChange( const QString &textChanged ); |
100 | void slotZipChange( const QString &textChanged ); | 100 | void slotZipChange( const QString &textChanged ); |
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(); |
107 | void slotRemoveAnniversary(); | 108 | void slotRemoveAnniversary(); |
108 | void defaultEmailChanged(int); | 109 | void defaultEmailChanged(int); |
109 | 110 | ||
110 | private: | 111 | private: |
111 | enum StackWidgets { TextField = 1, Combo }; | 112 | enum StackWidgets { TextField = 1, Combo }; |
112 | int defaultEmailChooserPosition; | 113 | int defaultEmailChooserPosition; |
113 | void populateDefaultEmailCmb(); | 114 | void populateDefaultEmailCmb(); |
114 | void chooserChange( const QString&, int , QLineEdit*, int ); | 115 | void chooserChange( const QString&, int , QLineEdit*, int ); |
115 | bool cmbChooserChange( int , QWidgetStack*, int ); | 116 | bool cmbChooserChange( int , QWidgetStack*, int ); |
116 | OContactFields contactfields; | 117 | OContactFields contactfields; |
117 | 118 | ||
118 | OContact ent; | 119 | OContact ent; |
119 | 120 | ||
120 | QDialog *dlgNote; | 121 | QDialog *dlgNote; |
121 | QDialog *dlgName; | 122 | QDialog *dlgName; |
122 | 123 | ||
123 | QList<QLineEdit> listValue; | 124 | QList<QLineEdit> listValue; |
124 | QList<QLabel> listName; | 125 | QList<QLabel> listName; |
125 | 126 | ||
126 | QStringList slDynamicEntries; | 127 | QStringList slDynamicEntries; |
127 | QStringList trlDynamicEntries; | 128 | QStringList trlDynamicEntries; |
128 | 129 | ||
129 | bool m_personalView; | 130 | bool m_personalView; |
130 | 131 | ||
131 | QStringList slHomeAddress; | 132 | QStringList slHomeAddress; |
132 | QStringList slBusinessAddress; | 133 | QStringList slBusinessAddress; |
133 | QStringList slChooserNames; | 134 | QStringList slChooserNames; |
134 | QStringList slChooserValues; | 135 | QStringList slChooserValues; |
135 | QStringList emails; | 136 | QStringList emails; |
136 | QString defaultEmail; | 137 | QString defaultEmail; |
137 | 138 | ||
138 | QMultiLineEdit *txtNote; | 139 | QMultiLineEdit *txtNote; |
139 | QLabel *lblNote; | 140 | QLabel *lblNote; |
140 | 141 | ||
141 | //QLineEdit *txtTitle; | 142 | //QLineEdit *txtTitle; |
142 | QLineEdit *txtFirstName; | 143 | QLineEdit *txtFirstName; |
143 | QLineEdit *txtMiddleName; | 144 | QLineEdit *txtMiddleName; |
144 | QLineEdit *txtLastName; | 145 | QLineEdit *txtLastName; |
145 | QLineEdit *txtSuffix; | 146 | QLineEdit *txtSuffix; |
146 | 147 | ||
147 | QTabWidget *tabMain; | 148 | QTabWidget *tabMain; |
148 | QScrollView *svGeneral; | 149 | QScrollView *svGeneral; |
149 | QPushButton *btnFullName; | 150 | QPushButton *btnFullName; |
150 | QPushButton *btnNote; | 151 | QPushButton *btnNote; |
151 | QLineEdit *txtFullName; | 152 | QLineEdit *txtFullName; |
152 | QLineEdit *txtJobTitle; | 153 | QLineEdit *txtJobTitle; |
153 | QLineEdit *txtOrganization; | 154 | QLineEdit *txtOrganization; |
154 | QLineEdit *txtChooserField1; | 155 | QLineEdit *txtChooserField1; |
155 | QLineEdit *txtChooserField2; | 156 | QLineEdit *txtChooserField2; |
156 | QLineEdit *txtChooserField3; | 157 | QLineEdit *txtChooserField3; |
157 | QLineEdit *txtChooserField4; | 158 | QLineEdit *txtChooserField4; |
158 | QWidgetStack* m_widgetStack1; | 159 | QWidgetStack* m_widgetStack1; |
159 | QWidgetStack* m_widgetStack2; | 160 | QWidgetStack* m_widgetStack2; |
160 | QWidgetStack* m_widgetStack3; | 161 | QWidgetStack* m_widgetStack3; |
161 | QWidgetStack* m_widgetStack4; | 162 | QWidgetStack* m_widgetStack4; |
162 | QComboBox *cmbChooserField1; | 163 | QComboBox *cmbChooserField1; |
163 | QComboBox *cmbChooserField2; | 164 | QComboBox *cmbChooserField2; |
164 | QComboBox *cmbChooserField3; | 165 | QComboBox *cmbChooserField3; |
165 | QComboBox *cmbChooserField4; | 166 | QComboBox *cmbChooserField4; |
166 | QComboBox *cmbDefaultEmail; | 167 | QComboBox *cmbDefaultEmail; |
167 | QComboBox *cmbFileAs; | 168 | QComboBox *cmbFileAs; |
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 | |||
@@ -1,10 +1,10 @@ | |||
1 | #ifndef _VERSION_H_ | 1 | #ifndef _VERSION_H_ |
2 | #define _VERSION_H_ | 2 | #define _VERSION_H_ |
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 | ||
10 | #endif | 10 | #endif |