-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index d7bad51..b6e7a30 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -704,66 +704,69 @@ QString AdvancedFm::getDiskSpace( const QString &path) { | |||
704 | 704 | ||
705 | long mult = blkSize / 1024; | 705 | long mult = blkSize / 1024; |
706 | long div = 1024 / blkSize; | 706 | long div = 1024 / blkSize; |
707 | if ( !mult ) mult = 1; | 707 | if ( !mult ) mult = 1; |
708 | if ( !div ) div = 1; | 708 | if ( !div ) div = 1; |
709 | 709 | ||
710 | return QString::number(availBlks * mult / div); | 710 | return QString::number(availBlks * mult / div); |
711 | } | 711 | } |
712 | return ""; | 712 | return ""; |
713 | } | 713 | } |
714 | 714 | ||
715 | 715 | ||
716 | void AdvancedFm::showFileMenu() { | 716 | void AdvancedFm::showFileMenu() { |
717 | 717 | ||
718 | QString curApp; | 718 | QString curApp; |
719 | bool isLocalView = false; | 719 | bool isLocalView = false; |
720 | if (TabWidget->currentPageIndex() == 0) { | 720 | if (TabWidget->currentPageIndex() == 0) { |
721 | isLocalView = TRUE; | 721 | isLocalView = TRUE; |
722 | curApp = Local_View->currentItem()->text(0); | 722 | curApp = Local_View->currentItem()->text(0); |
723 | } else { | 723 | } else { |
724 | curApp = Remote_View->currentItem()->text(0); | 724 | curApp = Remote_View->currentItem()->text(0); |
725 | } | 725 | } |
726 | 726 | ||
727 | MimeType mt( curApp ); | 727 | MimeType mt( curApp ); |
728 | |||
728 | const AppLnk* app = mt.application(); | 729 | const AppLnk* app = mt.application(); |
730 | |||
729 | QFile fi(curApp); | 731 | QFile fi(curApp); |
730 | 732 | ||
731 | QPopupMenu *m = new QPopupMenu(0); | 733 | QPopupMenu *m = new QPopupMenu(0); |
732 | QPopupMenu *n = new QPopupMenu(0); | 734 | QPopupMenu *n = new QPopupMenu(0); |
733 | // QPopupMenu *o = new QPopupMenu(0); | 735 | // QPopupMenu *o = new QPopupMenu(0); |
734 | 736 | ||
735 | m->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); | 737 | m->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); |
736 | if ( !QFileInfo(fi).isDir() ) { | 738 | |
737 | // m->insertSeparator(); | 739 | if ( QFileInfo(fi).isDir() ) { |
738 | // m->insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() )); | 740 | m->insertSeparator(); |
739 | // } else { | 741 | m->insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() )); |
742 | } else { | ||
740 | 743 | ||
741 | if ( app ) | 744 | if ( app ) |
742 | m->insertItem( app->pixmap(), tr( "Open in " | 745 | m->insertItem( app->pixmap(), tr( "Open in " |
743 | + app->name() ), this, SLOT( runThis() ) ); | 746 | + app->name() ), this, SLOT( runThis() ) ); |
744 | else if( QFileInfo(fi).isExecutable() ) | 747 | else if( QFileInfo(fi).isExecutable() ) //damn opie doesnt like this |
745 | m->insertItem( Resource::loadPixmap( app->name()), tr( "Execute" ), this, SLOT( runThis() ) ); | 748 | m->insertItem( /*Resource::loadPixmap( app->name()),*/ tr( "Execute" ), this, SLOT( runThis() ) ); |
746 | 749 | ||
747 | m->insertItem( Resource::loadPixmap( "txt" ), tr( "Open as text" ),this, SLOT( runText() ) ); | 750 | m->insertItem( Resource::loadPixmap( "txt" ), tr( "Open as text" ),this, SLOT( runText() ) ); |
748 | } | 751 | } |
749 | 752 | ||
750 | m->insertItem(tr("Actions"),n); | 753 | m->insertItem(tr("Actions"),n); |
751 | if(isLocalView) | 754 | if(isLocalView) |
752 | n->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); | 755 | n->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); |
753 | else | 756 | else |
754 | n->insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); | 757 | n->insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); |
755 | 758 | ||
756 | n->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); | 759 | n->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); |
757 | 760 | ||
758 | n->insertSeparator(); | 761 | n->insertSeparator(); |
759 | 762 | ||
760 | 763 | ||
761 | if(isLocalView) | 764 | if(isLocalView) |
762 | n->insertItem( tr( "Rename" ), this, SLOT( localRename() )); | 765 | n->insertItem( tr( "Rename" ), this, SLOT( localRename() )); |
763 | else | 766 | else |
764 | n->insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); | 767 | n->insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); |
765 | 768 | ||
766 | n->insertItem( tr( "Copy" ), this, SLOT( copy() )); | 769 | n->insertItem( tr( "Copy" ), this, SLOT( copy() )); |
767 | n->insertItem( tr( "Copy As" ), this, SLOT( copyAs() )); | 770 | n->insertItem( tr( "Copy As" ), this, SLOT( copyAs() )); |
768 | n->insertItem( tr( "Copy Same Dir" ), this, SLOT( copySameDir() )); | 771 | n->insertItem( tr( "Copy Same Dir" ), this, SLOT( copySameDir() )); |
769 | n->insertItem( tr( "Move" ), this, SLOT( move() )); | 772 | n->insertItem( tr( "Move" ), this, SLOT( move() )); |