summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abtable.cpp
authortux_mike <tux_mike>2002-04-17 19:45:48 (UTC)
committer tux_mike <tux_mike>2002-04-17 19:45:48 (UTC)
commitc2c343110573bd8b4d59fbff577969ff23d5c544 (patch) (side-by-side diff)
tree79cff133d04fa7df83783482e27557191ee2e199 /core/pim/addressbook/abtable.cpp
parentb94bcfb586b838885d7d0503623ea36ee0054464 (diff)
downloadopie-c2c343110573bd8b4d59fbff577969ff23d5c544.zip
opie-c2c343110573bd8b4d59fbff577969ff23d5c544.tar.gz
opie-c2c343110573bd8b4d59fbff577969ff23d5c544.tar.bz2
Added preliminary version of the Picker
Diffstat (limited to 'core/pim/addressbook/abtable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/abtable.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp
index 17277b4..759cb48 100644
--- a/core/pim/addressbook/abtable.cpp
+++ b/core/pim/addressbook/abtable.cpp
@@ -150,6 +150,7 @@ AbTable::~AbTable()
void AbTable::init()
{
+ showChar = '\0';
setNumRows( 0 );
setNumCols( 2 );
@@ -452,12 +453,13 @@ void AbTable::addEntry( const Contact &newCnt )
}
void AbTable::resizeRows( int size ) {
-
+/*
if (numRows()) {
for (int i = 0; i < numRows(); i++) {
setRowHeight( i, size );
}
- }
+ }*/
+ updateVisible();
}
void AbTable::updateJournal( const Contact &cnt,
@@ -1008,6 +1010,13 @@ void AbTable::setShowCategory( const QString &c )
updateVisible();
}
+void AbTable::setShowByLetter( char c )
+{
+ showChar = tolower(c);
+ qDebug( "AbTable::setShowByLetter %c", showChar);
+ updateVisible();
+}
+
QString AbTable::showCategory() const
{
return showCat;
@@ -1032,6 +1041,8 @@ void AbTable::updateVisible()
bool hide;
AbTableItem *ati;
Contact *cnt;
+ QString fileAsName;
+ QString tmpStr;
visible = 0;
setPaintingEnabled( FALSE );
@@ -1043,6 +1054,7 @@ void AbTable::updateVisible()
ati = static_cast<AbTableItem*>( item(row, 0) );
cnt = &contactList[ati];
cats = cnt->categories();
+ fileAsName = cnt->fileAs();
hide = false;
if ( !showCat.isEmpty() ) {
if ( showCat == tr( "Unfiled" ) ) {
@@ -1062,6 +1074,16 @@ void AbTable::updateVisible()
}
}
}
+ if ( showChar != '\0' ) {
+ tmpStr = fileAsName.left(1);
+ tmpStr = tmpStr.lower();
+ qDebug( "updateVisible ");
+ qDebug( tmpStr );
+ qDebug( "updateVisible2 %c", showChar );
+ if ( tmpStr != QString(QChar(showChar)) ) {
+ hide = true;
+ }
+ }
if ( hide ) {
if ( currentRow() == row )
setCurrentCell( -1, 0 );