-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 | |||
@@ -1014,5 +1014,4 @@ void AbTable::setShowByLetter( char c ) | |||
1014 | { | 1014 | { |
1015 | showChar = tolower(c); | 1015 | showChar = tolower(c); |
1016 | qDebug( "AbTable::setShowByLetter %c", showChar); | ||
1017 | updateVisible(); | 1016 | updateVisible(); |
1018 | } | 1017 | } |
@@ -1078,10 +1077,87 @@ void AbTable::updateVisible() | |||
1078 | tmpStr = fileAsName.left(1); | 1077 | tmpStr = fileAsName.left(1); |
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 | } |
1087 | if ( hide ) { | 1163 | if ( hide ) { |
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 | |||
@@ -100,5 +100,4 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
100 | setToolBarsMovable( FALSE ); | 100 | setToolBarsMovable( FALSE ); |
101 | 101 | ||
102 | QBoxLayout *vb = new QVBoxLayout( this, 0, 0 ); | ||
103 | // Create Toolbars | 102 | // Create Toolbars |
104 | 103 | ||
@@ -191,6 +190,10 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
191 | } | 190 | } |
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 ); |
196 | connect( abList, SIGNAL( empty( bool ) ), | 199 | connect( abList, SIGNAL( empty( bool ) ), |
@@ -209,7 +212,7 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
209 | } | 212 | } |
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 ); |
215 | catMenu->setCheckable( TRUE ); | 218 | catMenu->setCheckable( TRUE ); |
@@ -218,5 +221,5 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
218 | 221 | ||
219 | mbList->insertItem( tr("View"), catMenu ); | 222 | mbList->insertItem( tr("View"), catMenu ); |
220 | setCentralWidget( abList ); | 223 | setCentralWidget( listContainer ); |
221 | 224 | ||
222 | fontMenu = new QPopupMenu(this); | 225 | fontMenu = new QPopupMenu(this); |
@@ -233,5 +236,5 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
233 | 236 | ||
234 | mbList->insertItem( tr("Font"), fontMenu); | 237 | mbList->insertItem( tr("Font"), fontMenu); |
235 | setCentralWidget(abList); | 238 | setCentralWidget(listContainer); |
236 | 239 | ||
237 | // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); | 240 | // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); |
@@ -295,5 +298,5 @@ void AddressbookWindow::resizeEvent( QResizeEvent *e ) | |||
295 | QMainWindow::resizeEvent( e ); | 298 | QMainWindow::resizeEvent( e ); |
296 | 299 | ||
297 | if ( centralWidget() == abList ) | 300 | if ( centralWidget() == listContainer ) |
298 | showList(); | 301 | showList(); |
299 | else if ( centralWidget() == mView ) | 302 | else if ( centralWidget() == mView ) |
@@ -317,6 +320,6 @@ void AddressbookWindow::showList() | |||
317 | { | 320 | { |
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!); |
322 | abList->setFocus(); | 325 | abList->setFocus(); |
@@ -326,5 +329,5 @@ void AddressbookWindow::showView() | |||
326 | { | 329 | { |
327 | if ( abList->numRows() > 0 ) { | 330 | if ( abList->numRows() > 0 ) { |
328 | abList->hide(); | 331 | listContainer->hide(); |
329 | setCentralWidget( abView() ); | 332 | setCentralWidget( abView() ); |
330 | mView->show(); | 333 | mView->show(); |
@@ -602,5 +605,5 @@ void AddressbookWindow::slotPersonalView() | |||
602 | abView()->init( me ); | 605 | abView()->init( me ); |
603 | abView()->sync(); | 606 | abView()->sync(); |
604 | abList->hide(); | 607 | listContainer->hide(); |
605 | setCentralWidget( abView() ); | 608 | setCentralWidget( abView() ); |
606 | mView->show(); | 609 | mView->show(); |
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 | |||
@@ -90,4 +90,5 @@ private: | |||
90 | LetterPicker *pLabel; | 90 | LetterPicker *pLabel; |
91 | AbTable *abList; | 91 | AbTable *abList; |
92 | QWidget *listContainer; | ||
92 | 93 | ||
93 | QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, | 94 | QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, |
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 | |||
@@ -80,8 +80,7 @@ void PickerLabel::mouseReleaseEvent( QMouseEvent *e ) | |||
80 | QString tmpStr; | 80 | QString tmpStr; |
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) { |
87 | case 0: | 86 | case 0: |
@@ -98,5 +97,4 @@ void PickerLabel::mouseReleaseEvent( QMouseEvent *e ) | |||
98 | lastLetter = letter1; | 97 | lastLetter = letter1; |
99 | emit selectedLetter( letter1 ); | 98 | emit selectedLetter( letter1 ); |
100 | qDebug( "PickerLabel::mouseReleaseEvent %c", letter1 ); | ||
101 | break; | 99 | break; |
102 | 100 | ||
@@ -115,5 +113,4 @@ void PickerLabel::mouseReleaseEvent( QMouseEvent *e ) | |||
115 | lastLetter = letter2; | 113 | lastLetter = letter2; |
116 | emit selectedLetter( letter2 ); | 114 | emit selectedLetter( letter2 ); |
117 | qDebug( "PickerLabel::mouseReleaseEvent %c", letter2 ); | ||
118 | break; | 115 | break; |
119 | 116 | ||
@@ -131,5 +128,4 @@ void PickerLabel::mouseReleaseEvent( QMouseEvent *e ) | |||
131 | lastLetter = letter3; | 128 | lastLetter = letter3; |
132 | emit selectedLetter( letter3 ); | 129 | emit selectedLetter( letter3 ); |
133 | qDebug( "PickerLabel::mouseReleaseEvent %c", letter3 ); | ||
134 | break; | 130 | break; |
135 | 131 | ||
@@ -229,5 +225,4 @@ void LetterPicker::clear() | |||
229 | void LetterPicker::newLetter( char letter ) | 225 | void LetterPicker::newLetter( char letter ) |
230 | { | 226 | { |
231 | qDebug( "LetterPicker::newLetter %c", letter ); | ||
232 | emit letterClicked( letter ); | 227 | emit letterClicked( letter ); |
233 | 228 | ||