author | llornkcor <llornkcor> | 2002-10-06 20:59:04 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-10-06 20:59:04 (UTC) |
commit | 2623a1e2fddf0bfb91191ea7224f016032336ed5 (patch) (unidiff) | |
tree | 3ee4d0330368bc3508778298b907ade1cfdf0ac1 | |
parent | e334186122e512a57bd27026014f01f501db93fc (diff) | |
download | opie-2623a1e2fddf0bfb91191ea7224f016032336ed5.zip opie-2623a1e2fddf0bfb91191ea7224f016032336ed5.tar.gz opie-2623a1e2fddf0bfb91191ea7224f016032336ed5.tar.bz2 |
fix select and scroll
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 3aa516c..ec475a4 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -311,84 +311,89 @@ void AdvancedFm::localListClicked(QListViewItem *selectedItem) { | |||
311 | QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); | 311 | QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); |
312 | if(QDir(strItem2).exists() ) { | 312 | if(QDir(strItem2).exists() ) { |
313 | currentDir.cd(strItem2, TRUE); | 313 | currentDir.cd(strItem2, TRUE); |
314 | populateLocalView(); | 314 | populateLocalView(); |
315 | 315 | ||
316 | } | 316 | } |
317 | } else { // not a symlink | 317 | } else { // not a symlink |
318 | if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { | 318 | if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { |
319 | if(QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem)).exists() ) { | 319 | if(QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem)).exists() ) { |
320 | strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); | 320 | strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); |
321 | currentDir.cd(strItem,FALSE); | 321 | currentDir.cd(strItem,FALSE); |
322 | populateLocalView(); | 322 | populateLocalView(); |
323 | Local_View->ensureItemVisible(Local_View->firstChild()); | ||
324 | |||
323 | } else { | 325 | } else { |
324 | currentDir.cdUp(); | 326 | currentDir.cdUp(); |
325 | populateLocalView(); | 327 | populateLocalView(); |
328 | Local_View->ensureItemVisible(Local_View->firstChild()); | ||
326 | } | 329 | } |
327 | if(QDir(strItem).exists()){ | 330 | if(QDir(strItem).exists()){ |
328 | currentDir.cd(strItem, TRUE); | 331 | currentDir.cd(strItem, TRUE); |
332 | Local_View->ensureItemVisible(Local_View->firstChild()); | ||
329 | populateLocalView(); | 333 | populateLocalView(); |
330 | } | 334 | } |
331 | } else { | 335 | } else { |
332 | strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); | 336 | strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); |
333 | if( QFile::exists(strItem ) ) { | 337 | if( QFile::exists(strItem ) ) { |
334 | // qDebug("clicked item "+strItem); | 338 | // qDebug("clicked item "+strItem); |
335 | // DocLnk doc( strItem, FALSE ); | 339 | // DocLnk doc( strItem, FALSE ); |
336 | // doc.execute(); | 340 | // doc.execute(); |
337 | // Local_View->clearSelection(); | 341 | // Local_View->clearSelection(); |
338 | } | 342 | } |
339 | } //end not symlink | 343 | } //end not symlink |
340 | chdir(strItem.latin1()); | 344 | chdir(strItem.latin1()); |
341 | } | 345 | } |
342 | Local_View->ensureItemVisible(Local_View->firstChild()); | ||
343 | 346 | ||
344 | } | 347 | } |
345 | } | 348 | } |
346 | 349 | ||
347 | void AdvancedFm::remoteListClicked(QListViewItem *selectedItem) { | 350 | void AdvancedFm::remoteListClicked(QListViewItem *selectedItem) { |
348 | 351 | ||
349 | if(selectedItem) { | 352 | if(selectedItem) { |
350 | QString strItem=selectedItem->text(0); | 353 | QString strItem=selectedItem->text(0); |
351 | QString strSize=selectedItem->text(1); | 354 | QString strSize=selectedItem->text(1); |
352 | strSize=strSize.stripWhiteSpace(); | 355 | strSize=strSize.stripWhiteSpace(); |
353 | if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink | 356 | if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink |
354 | QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); | 357 | QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); |
355 | currentRemoteDir.cd(strItem2, TRUE); | 358 | currentRemoteDir.cd(strItem2, TRUE); |
356 | populateRemoteView(); | 359 | populateRemoteView(); |
357 | } else { // not a symlink | 360 | } else { // not a symlink |
358 | if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { | 361 | if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { |
359 | if(QDir(QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem)).exists() ) { | 362 | if(QDir(QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem)).exists() ) { |
360 | strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem); | 363 | strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem); |
361 | currentRemoteDir.cd(strItem,FALSE); | 364 | currentRemoteDir.cd(strItem,FALSE); |
362 | populateRemoteView(); | 365 | populateRemoteView(); |
366 | Remote_View->ensureItemVisible(Remote_View->firstChild()); | ||
363 | } else { | 367 | } else { |
364 | currentRemoteDir.cdUp(); | 368 | currentRemoteDir.cdUp(); |
365 | populateRemoteView(); | 369 | populateRemoteView(); |
370 | Remote_View->ensureItemVisible(Remote_View->firstChild()); | ||
366 | } | 371 | } |
367 | if(QDir(strItem).exists()){ | 372 | if(QDir(strItem).exists()){ |
368 | currentRemoteDir.cd(strItem, TRUE); | 373 | currentRemoteDir.cd(strItem, TRUE); |
369 | populateRemoteView(); | 374 | populateRemoteView(); |
375 | Remote_View->ensureItemVisible(Remote_View->firstChild()); | ||
370 | } | 376 | } |
371 | } else { | 377 | } else { |
372 | strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem); | 378 | strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem); |
373 | if( QFile::exists(strItem ) ) { | 379 | if( QFile::exists(strItem ) ) { |
374 | // qDebug("clicked item "+strItem); | 380 | // qDebug("clicked item "+strItem); |
375 | // DocLnk doc( strItem, FALSE ); | 381 | // DocLnk doc( strItem, FALSE ); |
376 | // doc.execute(); | 382 | // doc.execute(); |
377 | // Remote_View->clearSelection(); | 383 | // Remote_View->clearSelection(); |
378 | } | 384 | } |
379 | } //end not symlink | 385 | } //end not symlink |
380 | chdir(strItem.latin1()); | 386 | chdir(strItem.latin1()); |
381 | } | 387 | } |
382 | Remote_View->ensureItemVisible(Remote_View->firstChild()); | ||
383 | } | 388 | } |
384 | } | 389 | } |
385 | 390 | ||
386 | 391 | ||
387 | void AdvancedFm::localListPressed( int mouse, QListViewItem *, const QPoint& , int ) { | 392 | void AdvancedFm::localListPressed( int mouse, QListViewItem *, const QPoint& , int ) { |
388 | // qDebug("list pressed"); | 393 | // qDebug("list pressed"); |
389 | switch (mouse) { | 394 | switch (mouse) { |
390 | case 1: | 395 | case 1: |
391 | break; | 396 | break; |
392 | case 2: | 397 | case 2: |
393 | menuTimer.start( 750, TRUE ); | 398 | menuTimer.start( 750, TRUE ); |
394 | qDebug("Start menu timer\n"); | 399 | qDebug("Start menu timer\n"); |
@@ -771,25 +776,27 @@ void AdvancedFm::showFileMenu() { | |||
771 | m->insertItem( tr( "Run Command" ), this, SLOT( runCommand() )); | 776 | m->insertItem( tr( "Run Command" ), this, SLOT( runCommand() )); |
772 | m->insertItem( tr( "File Info" ), this, SLOT( fileStatus() )); | 777 | m->insertItem( tr( "File Info" ), this, SLOT( fileStatus() )); |
773 | m->insertSeparator(); | 778 | m->insertSeparator(); |
774 | 779 | ||
775 | if(isLocalView) | 780 | if(isLocalView) |
776 | m->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); | 781 | m->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); |
777 | else | 782 | else |
778 | m->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); | 783 | m->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); |
779 | 784 | ||
780 | m->insertSeparator(); | 785 | m->insertSeparator(); |
781 | m->insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() )); | 786 | m->insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() )); |
782 | 787 | ||
788 | #if defined(QT_QWS_OPIE) | ||
783 | m->insertItem( tr( "Properties" ), this, SLOT( doProperties() )); | 789 | m->insertItem( tr( "Properties" ), this, SLOT( doProperties() )); |
790 | #endif | ||
784 | m->setCheckable(TRUE); | 791 | m->setCheckable(TRUE); |
785 | if (!b) | 792 | if (!b) |
786 | m->setItemChecked(m->idAt(0),TRUE); | 793 | m->setItemChecked(m->idAt(0),TRUE); |
787 | else | 794 | else |
788 | m->setItemChecked(m->idAt(0),FALSE); | 795 | m->setItemChecked(m->idAt(0),FALSE); |
789 | 796 | ||
790 | if(Ir::supported()) | 797 | if(Ir::supported()) |
791 | m->insertItem( tr( "Beam File" ), this, SLOT( doBeam() )); | 798 | m->insertItem( tr( "Beam File" ), this, SLOT( doBeam() )); |
792 | m->setFocus(); | 799 | m->setFocus(); |
793 | m->exec( QCursor::pos() ); | 800 | m->exec( QCursor::pos() ); |
794 | sleep(1); | 801 | sleep(1); |
795 | if(m) delete m; | 802 | if(m) delete m; |