author | zautrix <zautrix> | 2005-11-12 22:23:02 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-11-12 22:23:02 (UTC) |
commit | 9e47202fd38512cc523c09cf8878f4c5d836e777 (patch) (unidiff) | |
tree | fa35760dc12d7176e3c2e63c22c6482601f7e59d /korganizer/kolistview.cpp | |
parent | f1b53f2c08c2ce384f663ae6f0a818104db8c53e (diff) | |
download | kdepimpi-9e47202fd38512cc523c09cf8878f4c5d836e777.zip kdepimpi-9e47202fd38512cc523c09cf8878f4c5d836e777.tar.gz kdepimpi-9e47202fd38512cc523c09cf8878f4c5d836e777.tar.bz2 |
fix
-rw-r--r-- | korganizer/kolistview.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 4fc1194..b378330 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -1232,129 +1232,130 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) | |||
1232 | cn = currentItem(); | 1232 | cn = currentItem(); |
1233 | if ( ! cn ) | 1233 | if ( ! cn ) |
1234 | return; | 1234 | return; |
1235 | if ( jump == 0 ) | 1235 | if ( jump == 0 ) |
1236 | jump = 1; | 1236 | jump = 1; |
1237 | while ( jump && cn->itemAbove ()) { | 1237 | while ( jump && cn->itemAbove ()) { |
1238 | cn = cn->itemAbove (); | 1238 | cn = cn->itemAbove (); |
1239 | --jump; | 1239 | --jump; |
1240 | } | 1240 | } |
1241 | setCurrentItem ( cn ); | 1241 | setCurrentItem ( cn ); |
1242 | ensureItemVisible ( cn ); | 1242 | ensureItemVisible ( cn ); |
1243 | } else | 1243 | } else |
1244 | QListView::keyPressEvent ( e ) ; | 1244 | QListView::keyPressEvent ( e ) ; |
1245 | e->accept(); | 1245 | e->accept(); |
1246 | break; | 1246 | break; |
1247 | case Qt::Key_I: { | 1247 | case Qt::Key_I: { |
1248 | QListViewItem* cn; | 1248 | QListViewItem* cn; |
1249 | cn = currentItem(); | 1249 | cn = currentItem(); |
1250 | if ( cn ) { | 1250 | if ( cn ) { |
1251 | KOListViewItem* ci = (KOListViewItem*)( cn ); | 1251 | KOListViewItem* ci = (KOListViewItem*)( cn ); |
1252 | if ( ci ){ | 1252 | if ( ci ){ |
1253 | //emit showIncidence( ci->data()); | 1253 | //emit showIncidence( ci->data()); |
1254 | cn = cn->nextSibling(); | 1254 | cn = cn->nextSibling(); |
1255 | if ( cn ) { | 1255 | if ( cn ) { |
1256 | setCurrentItem ( cn ); | 1256 | setCurrentItem ( cn ); |
1257 | ensureItemVisible ( cn ); | 1257 | ensureItemVisible ( cn ); |
1258 | } | 1258 | } |
1259 | emit showIncidence( ci->data()); | 1259 | emit showIncidence( ci->data()); |
1260 | } | 1260 | } |
1261 | } | 1261 | } |
1262 | e->accept(); | 1262 | e->accept(); |
1263 | } | 1263 | } |
1264 | break; | 1264 | break; |
1265 | case Qt::Key_Return: | 1265 | case Qt::Key_Return: |
1266 | case Qt::Key_Enter: | 1266 | case Qt::Key_Enter: |
1267 | { | 1267 | { |
1268 | QListViewItem* cn; | 1268 | QListViewItem* cn; |
1269 | cn = currentItem(); | 1269 | cn = currentItem(); |
1270 | if ( cn ) { | 1270 | if ( cn ) { |
1271 | KOListViewItem* ci = (KOListViewItem*)( cn ); | 1271 | KOListViewItem* ci = (KOListViewItem*)( cn ); |
1272 | if ( ci ){ | 1272 | if ( ci ){ |
1273 | if ( e->state() == ShiftButton ) | 1273 | if ( e->state() == ShiftButton ) |
1274 | ci->setSelected( false ); | 1274 | ci->setSelected( false ); |
1275 | else | 1275 | else |
1276 | ci->setSelected( true ); | 1276 | ci->setSelected( true ); |
1277 | cn = cn->nextSibling(); | 1277 | cn = cn->nextSibling(); |
1278 | if ( cn ) { | 1278 | if ( cn ) { |
1279 | setCurrentItem ( cn ); | 1279 | setCurrentItem ( cn ); |
1280 | ensureItemVisible ( cn ); | 1280 | ensureItemVisible ( cn ); |
1281 | } else { | 1281 | } else { |
1282 | emit currentChanged( ci ); | 1282 | emit currentChanged( ci ); |
1283 | } | 1283 | } |
1284 | } | 1284 | } |
1285 | } | 1285 | } |
1286 | e->accept(); | 1286 | e->accept(); |
1287 | } | 1287 | } |
1288 | break; | 1288 | break; |
1289 | default: | 1289 | default: |
1290 | e->ignore(); | 1290 | e->ignore(); |
1291 | } | 1291 | } |
1292 | } | 1292 | } |
1293 | KOListViewListView::KOListViewListView(KOListView * lv ) | 1293 | KOListViewListView::KOListViewListView(KOListView * lv ) |
1294 | : KListView( lv, "kolistlistview", false ) | 1294 | : KListView( lv, "kolistlistview", false ) |
1295 | { | 1295 | { |
1296 | mYMousePos = 0; | 1296 | mYMousePos = 0; |
1297 | setAllColumnsShowFocus( true ); | ||
1297 | mPopupTimer = new QTimer(this); | 1298 | mPopupTimer = new QTimer(this); |
1298 | connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); | 1299 | connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); |
1299 | #ifndef DESKTOP_VERSION | 1300 | #ifndef DESKTOP_VERSION |
1300 | //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); | 1301 | //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); |
1301 | #endif | 1302 | #endif |
1302 | setSelectionMode( QListView::Multi ); | 1303 | setSelectionMode( QListView::Multi ); |
1303 | setMultiSelection( true); | 1304 | setMultiSelection( true); |
1304 | } | 1305 | } |
1305 | bool KOListViewListView::hasMultiSelection(QListViewItem* item) | 1306 | bool KOListViewListView::hasMultiSelection(QListViewItem* item) |
1306 | { | 1307 | { |
1307 | QListViewItem *qitem = firstChild (); | 1308 | QListViewItem *qitem = firstChild (); |
1308 | while ( qitem ) { | 1309 | while ( qitem ) { |
1309 | if ( qitem->isSelected() && item != qitem ) | 1310 | if ( qitem->isSelected() && item != qitem ) |
1310 | return true; | 1311 | return true; |
1311 | qitem = qitem->nextSibling(); | 1312 | qitem = qitem->nextSibling(); |
1312 | } | 1313 | } |
1313 | return false; | 1314 | return false; |
1314 | } | 1315 | } |
1315 | void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) | 1316 | void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) |
1316 | { | 1317 | { |
1317 | if (!e) return; | 1318 | if (!e) return; |
1318 | QPoint vp = contentsToViewport(e->pos()); | 1319 | QPoint vp = contentsToViewport(e->pos()); |
1319 | QListViewItem *item = itemAt(vp); | 1320 | QListViewItem *item = itemAt(vp); |
1320 | if (!item) { | 1321 | if (!item) { |
1321 | emit newEvent(); | 1322 | emit newEvent(); |
1322 | return; | 1323 | return; |
1323 | } | 1324 | } |
1324 | KListView::contentsMouseDoubleClickEvent(e); | 1325 | KListView::contentsMouseDoubleClickEvent(e); |
1325 | } | 1326 | } |
1326 | #if 0 | 1327 | #if 0 |
1327 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) | 1328 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) |
1328 | { | 1329 | { |
1329 | //qDebug("contentsMousePressEvent++++ "); | 1330 | //qDebug("contentsMousePressEvent++++ "); |
1330 | KListView::contentsMousePressEvent( e ); | 1331 | KListView::contentsMousePressEvent( e ); |
1331 | if ( e->button() == RightButton ) { | 1332 | if ( e->button() == RightButton ) { |
1332 | QListViewItem* ci = currentItem(); | 1333 | QListViewItem* ci = currentItem(); |
1333 | clearSelection () ; | 1334 | clearSelection () ; |
1334 | if ( ci ) | 1335 | if ( ci ) |
1335 | ci->setSelected( true ); | 1336 | ci->setSelected( true ); |
1336 | } | 1337 | } |
1337 | } | 1338 | } |
1338 | void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) | 1339 | void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) |
1339 | { | 1340 | { |
1340 | KListView::contentsMouseReleaseEvent(e); | 1341 | KListView::contentsMouseReleaseEvent(e); |
1341 | } | 1342 | } |
1342 | void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) | 1343 | void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) |
1343 | { | 1344 | { |
1344 | KListView::contentsMouseMoveEvent(e); | 1345 | KListView::contentsMouseMoveEvent(e); |
1345 | } | 1346 | } |
1346 | #endif | 1347 | #endif |
1347 | void KOListViewListView::popupMenu() | 1348 | void KOListViewListView::popupMenu() |
1348 | { | 1349 | { |
1349 | mPopupTimer->stop(); | 1350 | mPopupTimer->stop(); |
1350 | QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, mEventPos ,mEventGlobalPos, RightButton , RightButton ); | 1351 | QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, mEventPos ,mEventGlobalPos, RightButton , RightButton ); |
1351 | QApplication::postEvent( this->viewport(), e ); | 1352 | QApplication::postEvent( this->viewport(), e ); |
1352 | 1353 | ||
1353 | } | 1354 | } |
1354 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) | 1355 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) |
1355 | { | 1356 | { |
1356 | //qDebug("contentsMousePressEvent++++ %d %d", e->pos().y(), e->globalPos().y()); | 1357 | //qDebug("contentsMousePressEvent++++ %d %d", e->pos().y(), e->globalPos().y()); |
1357 | mYMousePos = mapToGlobal( (e->pos())).y(); | 1358 | mYMousePos = mapToGlobal( (e->pos())).y(); |
1358 | if ( e->button() == LeftButton ) { | 1359 | if ( e->button() == LeftButton ) { |
1359 | mPopupTimer->start( 600 ); | 1360 | mPopupTimer->start( 600 ); |
1360 | mEventPos = contentsToViewport(e->pos()); | 1361 | mEventPos = contentsToViewport(e->pos()); |