summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abview.cpp
authoreilers <eilers>2002-11-30 18:13:34 (UTC)
committer eilers <eilers>2002-11-30 18:13:34 (UTC)
commit6afb59b5950c8fdd24dc93ac4ee370a3c8437f9a (patch) (unidiff)
treea873946a9b52edaab8f374918c7e0b468c2353b3 /core/pim/addressbook/abview.cpp
parentfe672fd88ead7a987d66f03439eb860e67aeaca6 (diff)
downloadopie-6afb59b5950c8fdd24dc93ac4ee370a3c8437f9a.zip
opie-6afb59b5950c8fdd24dc93ac4ee370a3c8437f9a.tar.gz
opie-6afb59b5950c8fdd24dc93ac4ee370a3c8437f9a.tar.bz2
Fixed a lot of usability stuff .. Some minor bugs were fixed, too ..
Diffstat (limited to 'core/pim/addressbook/abview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/abview.cpp55
1 files changed, 32 insertions, 23 deletions
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp
index 0f4bd5f..7226e82 100644
--- a/core/pim/addressbook/abview.cpp
+++ b/core/pim/addressbook/abview.cpp
@@ -124,15 +124,18 @@ void AbView::replaceEntry( const OContact &contact )
124 124
125OContact AbView::currentEntry() 125OContact AbView::currentEntry()
126{ 126{
127 OContact currentContact;
128
127 switch ( (int) m_curr_View ) { 129 switch ( (int) m_curr_View ) {
128 case TableView: 130 case TableView:
129 return ( m_abTable -> currentEntry() ); 131 currentContact = m_abTable -> currentEntry();
130 break; 132 break;
131 case CardView: 133 case CardView:
132 return ( m_ablabel -> currentEntry() ); 134 currentContact = m_ablabel -> currentEntry();
133 break; 135 break;
134 } 136 }
135 return OContact(); 137 m_curr_Contact = currentContact.uid();
138 return currentContact;
136} 139}
137 140
138bool AbView::save() 141bool AbView::save()
@@ -145,17 +148,20 @@ bool AbView::save()
145void AbView::load() 148void AbView::load()
146{ 149{
147 qWarning("abView:Load data"); 150 qWarning("abView:Load data");
151
152 // Letter Search is stopped at this place
153 emit signalClearLetterPicker();
148 154
149 if ( m_inPersonal ) 155 if ( m_inPersonal )
150 m_list = m_contactdb->allRecords(); 156 m_list = m_contactdb->allRecords();
151 else 157 else{
152 m_list = m_contactdb->sorted( true, 0, 0, 0 ); 158 m_list = m_contactdb->sorted( true, 0, 0, 0 );
153 159 clearForCategory();
154 clearForCategory(); 160 }
155 161
156 qWarning ("Number of contacts: %d", m_list.count()); 162 qWarning ("Number of contacts: %d", m_list.count());
157 163
158 updateView(); 164 updateView( true );
159 165
160} 166}
161 167
@@ -224,7 +230,7 @@ void AbView::setShowByLetter( char c )
224 clearForCategory(); 230 clearForCategory();
225 m_curr_Contact = 0; 231 m_curr_Contact = 0;
226 } 232 }
227 updateView(); 233 updateView( true );
228} 234}
229 235
230void AbView::setListOrder( const QValueList<int>& ordered ) 236void AbView::setListOrder( const QValueList<int>& ordered )
@@ -325,7 +331,7 @@ void AbView::slotDoFind( const QString &str, bool caseSensitive, bool useRegExp,
325 clearForCategory(); 331 clearForCategory();
326 332
327 // Now show all found entries 333 // Now show all found entries
328 updateView(); 334 updateView( true );
329} 335}
330 336
331void AbView::offSearch() 337void AbView::offSearch()
@@ -407,7 +413,7 @@ void AbView::updateListinViews()
407 m_ablabel -> setContacts( m_list ); 413 m_ablabel -> setContacts( m_list );
408} 414}
409 415
410void AbView::updateView() 416void AbView::updateView( bool newdata )
411{ 417{
412 qWarning("AbView::updateView()"); 418 qWarning("AbView::updateView()");
413 419
@@ -416,22 +422,25 @@ void AbView::updateView()
416 } 422 }
417 423
418 // If we switching the view, we have to store some information 424 // If we switching the view, we have to store some information
419 if ( m_list.count() ){ 425 if ( !newdata ){
420 switch ( (int) m_prev_View ) { 426 if ( m_list.count() ){
421 case TableView: 427 switch ( (int) m_prev_View ) {
422 m_curr_Contact = m_abTable -> currentEntry_UID(); 428 case TableView:
423 break; 429 m_curr_Contact = m_abTable -> currentEntry_UID();
424 case CardView: 430 break;
425 m_curr_Contact = m_ablabel -> currentEntry_UID(); 431 case CardView:
426 break; 432 m_curr_Contact = m_ablabel -> currentEntry_UID();
427 } 433 break;
428 }else 434 }
429 m_curr_Contact = 0; 435 }else
436 m_curr_Contact = 0;
437 }
430 438
431 // Feed all views with new lists 439 // Feed all views with new lists
432 updateListinViews(); 440 if ( newdata )
441 updateListinViews();
433 442
434 // Inform the world that the view is changed 443 // Tell the world that the view is changed
435 if ( m_curr_View != m_prev_View ) 444 if ( m_curr_View != m_prev_View )
436 emit signalViewSwitched ( (int) m_curr_View ); 445 emit signalViewSwitched ( (int) m_curr_View );
437 446