author | tux_mike <tux_mike> | 2002-04-17 20:46:18 (UTC) |
---|---|---|
committer | tux_mike <tux_mike> | 2002-04-17 20:46:18 (UTC) |
commit | 7b19e1d98d5acf01102ac057ec077fc036c034c6 (patch) (unidiff) | |
tree | a5ec8752ba8cbf9c5c037f1ec3552be544cc8b3f /core/pim/addressbook | |
parent | 106073977316103f057930daf45f3a083114d48d (diff) | |
download | opie-7b19e1d98d5acf01102ac057ec077fc036c034c6.zip opie-7b19e1d98d5acf01102ac057ec077fc036c034c6.tar.gz opie-7b19e1d98d5acf01102ac057ec077fc036c034c6.tar.bz2 |
Added a Letter Picker
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 86 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 27 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.h | 1 | ||||
-rw-r--r-- | core/pim/addressbook/picker.cpp | 7 |
4 files changed, 98 insertions, 23 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index 759cb48..124ff6c 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp | |||
@@ -1015,3 +1015,2 @@ void AbTable::setShowByLetter( char c ) | |||
1015 | showChar = tolower(c); | 1015 | showChar = tolower(c); |
1016 | qDebug( "AbTable::setShowByLetter %c", showChar); | ||
1017 | updateVisible(); | 1016 | updateVisible(); |
@@ -1079,8 +1078,85 @@ void AbTable::updateVisible() | |||
1079 | tmpStr = tmpStr.lower(); | 1078 | tmpStr = tmpStr.lower(); |
1080 | qDebug( "updateVisible "); | 1079 | if ( tmpStr != QString(QChar(showChar)) && showChar != '#' ) { |
1081 | qDebug( tmpStr ); | ||
1082 | qDebug( "updateVisible2 %c", showChar ); | ||
1083 | if ( tmpStr != QString(QChar(showChar)) ) { | ||
1084 | hide = true; | 1080 | hide = true; |
1085 | } | 1081 | } |
1082 | if ( showChar == '#' ) { | ||
1083 | if (tmpStr == "a") | ||
1084 | hide = true; | ||
1085 | |||
1086 | if (tmpStr == "b") | ||
1087 | hide = true; | ||
1088 | |||
1089 | if (tmpStr == "c") | ||
1090 | hide = true; | ||
1091 | |||
1092 | if (tmpStr == "d") | ||
1093 | hide = true; | ||
1094 | |||
1095 | if (tmpStr == "e") | ||
1096 | hide = true; | ||
1097 | |||
1098 | if (tmpStr == "f") | ||
1099 | hide = true; | ||
1100 | |||
1101 | if (tmpStr == "g") | ||
1102 | hide = true; | ||
1103 | |||
1104 | if (tmpStr == "h") | ||
1105 | hide = true; | ||
1106 | |||
1107 | if (tmpStr == "i") | ||
1108 | hide = true; | ||
1109 | |||
1110 | if (tmpStr == "j") | ||
1111 | hide = true; | ||
1112 | |||
1113 | if (tmpStr == "k") | ||
1114 | hide = true; | ||
1115 | |||
1116 | if (tmpStr == "l") | ||
1117 | hide = true; | ||
1118 | |||
1119 | if (tmpStr == "m") | ||
1120 | hide = true; | ||
1121 | |||
1122 | if (tmpStr == "n") | ||
1123 | hide = true; | ||
1124 | |||
1125 | if (tmpStr == "o") | ||
1126 | hide = true; | ||
1127 | |||
1128 | if (tmpStr == "p") | ||
1129 | hide = true; | ||
1130 | |||
1131 | if (tmpStr == "q") | ||
1132 | hide = true; | ||
1133 | |||
1134 | if (tmpStr == "r") | ||
1135 | hide = true; | ||
1136 | |||
1137 | if (tmpStr == "s") | ||
1138 | hide = true; | ||
1139 | |||
1140 | if (tmpStr == "t") | ||
1141 | hide = true; | ||
1142 | |||
1143 | if (tmpStr == "u") | ||
1144 | hide = true; | ||
1145 | |||
1146 | if (tmpStr == "v") | ||
1147 | hide = true; | ||
1148 | |||
1149 | if (tmpStr == "w") | ||
1150 | hide = true; | ||
1151 | |||
1152 | if (tmpStr == "x") | ||
1153 | hide = true; | ||
1154 | |||
1155 | if (tmpStr == "y") | ||
1156 | hide = true; | ||
1157 | |||
1158 | if (tmpStr == "z") | ||
1159 | hide = true; | ||
1160 | } | ||
1161 | |||
1086 | } | 1162 | } |
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index e502cf6..beb953a 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp | |||
@@ -101,3 +101,2 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
101 | 101 | ||
102 | QBoxLayout *vb = new QVBoxLayout( this, 0, 0 ); | ||
103 | // Create Toolbars | 102 | // Create Toolbars |
@@ -192,4 +191,8 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
192 | 191 | ||
193 | abList = new AbTable( &orderedFields, this, "table" ); | 192 | listContainer = new QWidget( this ); |
194 | vb->insertWidget(0,abList); | 193 | |
194 | QVBoxLayout *vb = new QVBoxLayout( listContainer ); | ||
195 | |||
196 | abList = new AbTable( &orderedFields, listContainer, "table" ); | ||
197 | vb->addWidget(abList); | ||
195 | abList->setHScrollBarMode( QScrollView::AlwaysOff ); | 198 | abList->setHScrollBarMode( QScrollView::AlwaysOff ); |
@@ -210,5 +213,5 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
210 | 213 | ||
211 | pLabel = new LetterPicker( abList ); | 214 | pLabel = new LetterPicker( listContainer ); |
212 | connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); | 215 | connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); |
213 | vb->insertWidget(1,pLabel); | 216 | vb->addWidget(pLabel); |
214 | catMenu = new QPopupMenu( this ); | 217 | catMenu = new QPopupMenu( this ); |
@@ -219,3 +222,3 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
219 | mbList->insertItem( tr("View"), catMenu ); | 222 | mbList->insertItem( tr("View"), catMenu ); |
220 | setCentralWidget( abList ); | 223 | setCentralWidget( listContainer ); |
221 | 224 | ||
@@ -234,3 +237,3 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
234 | mbList->insertItem( tr("Font"), fontMenu); | 237 | mbList->insertItem( tr("Font"), fontMenu); |
235 | setCentralWidget(abList); | 238 | setCentralWidget(listContainer); |
236 | 239 | ||
@@ -296,3 +299,3 @@ void AddressbookWindow::resizeEvent( QResizeEvent *e ) | |||
296 | 299 | ||
297 | if ( centralWidget() == abList ) | 300 | if ( centralWidget() == listContainer ) |
298 | showList(); | 301 | showList(); |
@@ -318,4 +321,4 @@ void AddressbookWindow::showList() | |||
318 | if ( mView ) mView->hide(); | 321 | if ( mView ) mView->hide(); |
319 | setCentralWidget( abList ); | 322 | setCentralWidget( listContainer ); |
320 | abList->show(); | 323 | listContainer->show(); |
321 | // update our focues... (or use a stack widget!); | 324 | // update our focues... (or use a stack widget!); |
@@ -327,3 +330,3 @@ void AddressbookWindow::showView() | |||
327 | if ( abList->numRows() > 0 ) { | 330 | if ( abList->numRows() > 0 ) { |
328 | abList->hide(); | 331 | listContainer->hide(); |
329 | setCentralWidget( abView() ); | 332 | setCentralWidget( abView() ); |
@@ -603,3 +606,3 @@ void AddressbookWindow::slotPersonalView() | |||
603 | abView()->sync(); | 606 | abView()->sync(); |
604 | abList->hide(); | 607 | listContainer->hide(); |
605 | setCentralWidget( abView() ); | 608 | setCentralWidget( abView() ); |
diff --git a/core/pim/addressbook/addressbook.h b/core/pim/addressbook/addressbook.h index 31c4660..8e8c883 100644 --- a/core/pim/addressbook/addressbook.h +++ b/core/pim/addressbook/addressbook.h | |||
@@ -91,2 +91,3 @@ private: | |||
91 | AbTable *abList; | 91 | AbTable *abList; |
92 | QWidget *listContainer; | ||
92 | 93 | ||
diff --git a/core/pim/addressbook/picker.cpp b/core/pim/addressbook/picker.cpp index 06dcc7d..a165451 100644 --- a/core/pim/addressbook/picker.cpp +++ b/core/pim/addressbook/picker.cpp | |||
@@ -81,6 +81,5 @@ void PickerLabel::mouseReleaseEvent( QMouseEvent *e ) | |||
81 | 81 | ||
82 | if (lastLetter != letter1 && lastLetter != letter2 && lastLetter != letter3) | 82 | if (lastLetter != letter1 && lastLetter != letter2 && lastLetter != letter3 && lastLetter != '\0') |
83 | QTimer::singleShot( 0, this, SLOT(emitClearSignal()) ); | 83 | QTimer::singleShot( 0, this, SLOT(emitClearSignal()) ); |
84 | 84 | ||
85 | qDebug( "a" ); | ||
86 | switch (currentLetter) { | 85 | switch (currentLetter) { |
@@ -99,3 +98,2 @@ void PickerLabel::mouseReleaseEvent( QMouseEvent *e ) | |||
99 | emit selectedLetter( letter1 ); | 98 | emit selectedLetter( letter1 ); |
100 | qDebug( "PickerLabel::mouseReleaseEvent %c", letter1 ); | ||
101 | break; | 99 | break; |
@@ -116,3 +114,2 @@ void PickerLabel::mouseReleaseEvent( QMouseEvent *e ) | |||
116 | emit selectedLetter( letter2 ); | 114 | emit selectedLetter( letter2 ); |
117 | qDebug( "PickerLabel::mouseReleaseEvent %c", letter2 ); | ||
118 | break; | 115 | break; |
@@ -132,3 +129,2 @@ void PickerLabel::mouseReleaseEvent( QMouseEvent *e ) | |||
132 | emit selectedLetter( letter3 ); | 129 | emit selectedLetter( letter3 ); |
133 | qDebug( "PickerLabel::mouseReleaseEvent %c", letter3 ); | ||
134 | break; | 130 | break; |
@@ -230,3 +226,2 @@ void LetterPicker::newLetter( char letter ) | |||
230 | { | 226 | { |
231 | qDebug( "LetterPicker::newLetter %c", letter ); | ||
232 | emit letterClicked( letter ); | 227 | emit letterClicked( letter ); |