-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 38 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 3 |
2 files changed, 5 insertions, 36 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 8cc5d7b..56e3282 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -328,112 +328,80 @@ void AdvancedFm::homeButtonPushed() { | |||
328 | changeTo(QDir::homeDirPath()); | 328 | changeTo(QDir::homeDirPath()); |
329 | } | 329 | } |
330 | 330 | ||
331 | void AdvancedFm::docButtonPushed() { | 331 | void AdvancedFm::docButtonPushed() { |
332 | changeTo(QPEApplication::documentDir()); | 332 | changeTo(QPEApplication::documentDir()); |
333 | } | 333 | } |
334 | 334 | ||
335 | void AdvancedFm::SDButtonPushed() { | 335 | void AdvancedFm::SDButtonPushed() { |
336 | Opie::Core::OStorageInfo info; | 336 | Opie::Core::OStorageInfo info; |
337 | changeTo(info.sdPath()); | 337 | changeTo(info.sdPath()); |
338 | } | 338 | } |
339 | 339 | ||
340 | void AdvancedFm::CFButtonPushed() { | 340 | void AdvancedFm::CFButtonPushed() { |
341 | Opie::Core::OStorageInfo info; | 341 | Opie::Core::OStorageInfo info; |
342 | changeTo(info.cfPath()); | 342 | changeTo(info.cfPath()); |
343 | } | 343 | } |
344 | 344 | ||
345 | void AdvancedFm::QPEButtonPushed() { | 345 | void AdvancedFm::QPEButtonPushed() { |
346 | changeTo(QPEApplication::qpeDir()); | 346 | changeTo(QPEApplication::qpeDir()); |
347 | } | 347 | } |
348 | 348 | ||
349 | void AdvancedFm::doAbout() { | 349 | void AdvancedFm::doAbout() { |
350 | QMessageBox::message("AdvancedFm",tr("<P>Advanced FileManager is copyright 2002-2003 by L.J.Potter<llornkcor@handhelds.org> and is licensed by the GPL</P>")); | 350 | QMessageBox::message("AdvancedFm",tr("<P>Advanced FileManager is copyright 2002-2003 by L.J.Potter<llornkcor@handhelds.org> and is licensed by the GPL</P>")); |
351 | } | 351 | } |
352 | 352 | ||
353 | void AdvancedFm::keyPressEvent( QKeyEvent *e) { | 353 | void AdvancedFm::keyPressEvent( QKeyEvent *e) { |
354 | Q_UNUSED(e); | 354 | Q_UNUSED(e); |
355 | } | 355 | } |
356 | 356 | ||
357 | void AdvancedFm::keyReleaseEvent( QKeyEvent *e) { | 357 | void AdvancedFm::keyReleaseEvent( QKeyEvent *e) { |
358 | // if( CurrentView()->hasFocus() ) | 358 | // if( CurrentView()->hasFocus() ) |
359 | // e->ignore(); | 359 | // e->ignore(); |
360 | if( currentPathCombo->lineEdit()->hasFocus()) { | 360 | |
361 | if( currentPathCombo->lineEdit()->hasFocus()) { | ||
361 | // qDebug("shout!"); | 362 | // qDebug("shout!"); |
362 | } | 363 | } |
363 | 364 | ||
364 | else if( e->key() == Key_Left ) | 365 | else if( e->key() == Key_Left ) |
365 | upDir(); | 366 | upDir(); |
366 | else if( e->key() == Key_Return || e->key() == Key_Enter) | 367 | else if( e->key() == Key_Return || e->key() == Key_Enter) |
367 | navigateToSelected(); | 368 | navigateToSelected(); |
368 | else if( e->key() == Key_Tab) | 369 | else if( e->key() == Key_Tab) |
369 | setOtherTabCurrent(); | 370 | setOtherTabCurrent(); |
370 | else if( e->key() == Key_Delete ) | 371 | else if( e->key() == Key_Delete ) |
371 | del(); | 372 | del(); |
372 | else if( e->key() == Key_A) | ||
373 | copyAs(); | ||
374 | else if( e->key() == Key_C) | ||
375 | copy(); | ||
376 | else if( e->key() == Key_E) | ||
377 | runThis(); | ||
378 | else if( e->key() == Key_G) | ||
379 | currentPathCombo->lineEdit()->setFocus(); | ||
380 | else if( e->key() == Key_H ) | ||
381 | showHidden(); | ||
382 | else if( e->key() == Key_I) | ||
383 | fileStatus(); | ||
384 | else if( e->key() == Key_M) | ||
385 | move(); | ||
386 | else if( e->key() == Key_N ) | ||
387 | mkDir(); | ||
388 | else if( e->key() == Key_P) | ||
389 | filePerms(); | ||
390 | else if( e->key() == Key_R ) | ||
391 | rn(); | ||
392 | else if( e->key() == Key_U ) | ||
393 | upDir(); | ||
394 | else if( e->key() == Key_1) | ||
395 | switchToLocalTab(); | ||
396 | else if( e->key() == Key_2) | ||
397 | switchToRemoteTab(); | ||
398 | else if( e->key() == Key_3) | ||
399 | CFButtonPushed(); | ||
400 | else if( e->key() == Key_4) | ||
401 | SDButtonPushed(); | ||
402 | else if( e->key() == Key_5 ) | ||
403 | homeButtonPushed(); | ||
404 | else if( e->key() == Key_6 ) | ||
405 | docButtonPushed(); | ||
406 | else | 373 | else |
407 | e->accept(); | 374 | e->accept(); |
375 | |||
408 | } | 376 | } |
409 | 377 | ||
410 | 378 | ||
411 | void AdvancedFm::parsetab(const QString &fileName) { | 379 | void AdvancedFm::parsetab(const QString &fileName) { |
412 | 380 | ||
413 | fileSystemTypeList.clear(); | 381 | fileSystemTypeList.clear(); |
414 | fsList.clear(); | 382 | fsList.clear(); |
415 | struct mntent *me; | 383 | struct mntent *me; |
416 | FILE *mntfp = setmntent( fileName.latin1(), "r" ); | 384 | FILE *mntfp = setmntent( fileName.latin1(), "r" ); |
417 | if ( mntfp ) { | 385 | if ( mntfp ) { |
418 | while ( (me = getmntent( mntfp )) != 0 ) { | 386 | while ( (me = getmntent( mntfp )) != 0 ) { |
419 | QString deviceName = me->mnt_fsname; | 387 | QString deviceName = me->mnt_fsname; |
420 | QString filesystemType = me->mnt_type; | 388 | QString filesystemType = me->mnt_type; |
421 | QString mountDir = me->mnt_dir; | 389 | QString mountDir = me->mnt_dir; |
422 | if(deviceName != "none") { | 390 | if(deviceName != "none") { |
423 | if( fsList.contains(filesystemType) == 0 | 391 | if( fsList.contains(filesystemType) == 0 |
424 | & filesystemType.find("proc",0,TRUE) == -1 | 392 | & filesystemType.find("proc",0,TRUE) == -1 |
425 | & filesystemType.find("cramfs",0,TRUE) == -1 | 393 | & filesystemType.find("cramfs",0,TRUE) == -1 |
426 | & filesystemType.find("auto",0,TRUE) == -1) | 394 | & filesystemType.find("auto",0,TRUE) == -1) |
427 | fsList << filesystemType; | 395 | fsList << filesystemType; |
428 | fileSystemTypeList << mountDir+"::"+filesystemType; | 396 | fileSystemTypeList << mountDir+"::"+filesystemType; |
429 | } | 397 | } |
430 | } | 398 | } |
431 | } | 399 | } |
432 | endmntent( mntfp ); | 400 | endmntent( mntfp ); |
433 | } | 401 | } |
434 | 402 | ||
435 | QString AdvancedFm::getFileSystemType(const QString ¤tText) { | 403 | QString AdvancedFm::getFileSystemType(const QString ¤tText) { |
436 | parsetab("/etc/mtab"); //why did TT forget filesystem type? | 404 | parsetab("/etc/mtab"); //why did TT forget filesystem type? |
437 | QString current = currentText;//.right( currentText.length()-1); | 405 | QString current = currentText;//.right( currentText.length()-1); |
438 | QString baseFs; | 406 | QString baseFs; |
439 | for ( QStringList::Iterator it = fileSystemTypeList.begin(); it != fileSystemTypeList.end(); ++it ) { | 407 | for ( QStringList::Iterator it = fileSystemTypeList.begin(); it != fileSystemTypeList.end(); ++it ) { |
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 6abdc85..80324eb 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -836,38 +836,39 @@ void AdvancedFm::doRename(QListView * view) { | |||
836 | renameBox->resize( r.size() ); | 836 | renameBox->resize( r.size() ); |
837 | view->viewport()->setFocusProxy( renameBox ); | 837 | view->viewport()->setFocusProxy( renameBox ); |
838 | renameBox->setFocus(); | 838 | renameBox->setFocus(); |
839 | renameBox->show(); | 839 | renameBox->show(); |
840 | } | 840 | } |
841 | 841 | ||
842 | 842 | ||
843 | void AdvancedFm::renameIt() { | 843 | void AdvancedFm::renameIt() { |
844 | if( !CurrentView()->currentItem()) return; | 844 | if( !CurrentView()->currentItem()) return; |
845 | 845 | ||
846 | QListView *thisView = CurrentView(); | 846 | QListView *thisView = CurrentView(); |
847 | oldName = thisView->currentItem()->text(0); | 847 | oldName = thisView->currentItem()->text(0); |
848 | doRename( thisView ); | 848 | doRename( thisView ); |
849 | } | 849 | } |
850 | 850 | ||
851 | void AdvancedFm::okRename() { | 851 | void AdvancedFm::okRename() { |
852 | qDebug("okrename"); | 852 | qDebug("okrename"); |
853 | if( !renameBox) return; | 853 | if( !renameBox) return; |
854 | 854 | ||
855 | QString newName = renameBox->text(); | 855 | QString newName = renameBox->text(); |
856 | cancelRename(); | 856 | cancelRename(); |
857 | QListView * view = CurrentView(); | 857 | QListView * view = CurrentView(); |
858 | QString path = CurrentDir()->canonicalPath() + "/"; | 858 | QString path = CurrentDir()->canonicalPath() + "/"; |
859 | oldName = path + oldName; | 859 | oldName = path + oldName; |
860 | newName = path + newName; | 860 | newName = path + newName; |
861 | if( rename( oldName.latin1(), newName.latin1())== -1) | 861 | if( rename( oldName.latin1(), newName.latin1())== -1) |
862 | QMessageBox::message(tr("Note"),tr("Could not rename")); | 862 | QMessageBox::message(tr("Note"),tr("Could not rename")); |
863 | else | 863 | else |
864 | oldName = ""; | 864 | oldName = ""; |
865 | QListViewItem *item = view->currentItem(); | 865 | QListViewItem *item = view->currentItem(); |
866 | view->takeItem( item ); | 866 | view->takeItem( item ); |
867 | delete item; | 867 | delete item; |
868 | rePopulate(); | 868 | populateView(); |
869 | |||
869 | } | 870 | } |
870 | 871 | ||
871 | void AdvancedFm::openSearch() { | 872 | void AdvancedFm::openSearch() { |
872 | QMessageBox::message(tr("Note"),tr("Not Yet Implemented")); | 873 | QMessageBox::message(tr("Note"),tr("Not Yet Implemented")); |
873 | } | 874 | } |