-rw-r--r-- | noncore/unsupported/filebrowser/filebrowser.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/unsupported/filebrowser/filebrowser.cpp b/noncore/unsupported/filebrowser/filebrowser.cpp index 384d7da..eaf5eeb 100644 --- a/noncore/unsupported/filebrowser/filebrowser.cpp +++ b/noncore/unsupported/filebrowser/filebrowser.cpp | |||
@@ -593,129 +593,129 @@ void FileView::contentsMousePressEvent( QMouseEvent * e ) | |||
593 | void FileView::contentsMouseReleaseEvent( QMouseEvent * e ) | 593 | void FileView::contentsMouseReleaseEvent( QMouseEvent * e ) |
594 | { | 594 | { |
595 | QListView::contentsMouseReleaseEvent( e ); | 595 | QListView::contentsMouseReleaseEvent( e ); |
596 | menuTimer.stop(); | 596 | menuTimer.stop(); |
597 | } | 597 | } |
598 | 598 | ||
599 | void FileView::cancelMenuTimer() | 599 | void FileView::cancelMenuTimer() |
600 | { | 600 | { |
601 | if( menuTimer.isActive() ) | 601 | if( menuTimer.isActive() ) |
602 | menuTimer.stop(); | 602 | menuTimer.stop(); |
603 | } | 603 | } |
604 | 604 | ||
605 | void FileView::addToDocuments() | 605 | void FileView::addToDocuments() |
606 | { | 606 | { |
607 | FileItem * i = (FileItem *) currentItem(); | 607 | FileItem * i = (FileItem *) currentItem(); |
608 | DocLnk f; | 608 | DocLnk f; |
609 | QString n = i->text(0); | 609 | QString n = i->text(0); |
610 | n.replace(QRegExp("\\..*"),""); | 610 | n.replace(QRegExp("\\..*"),""); |
611 | f.setName( n ); | 611 | f.setName( n ); |
612 | f.setFile( i->getFilePath() ); | 612 | f.setFile( i->getFilePath() ); |
613 | f.writeLink(); | 613 | f.writeLink(); |
614 | } | 614 | } |
615 | 615 | ||
616 | void FileView::run() | 616 | void FileView::run() |
617 | { | 617 | { |
618 | FileItem * i = (FileItem *) currentItem(); | 618 | FileItem * i = (FileItem *) currentItem(); |
619 | i->launch(); | 619 | i->launch(); |
620 | } | 620 | } |
621 | 621 | ||
622 | void FileView::showFileMenu() | 622 | void FileView::showFileMenu() |
623 | { | 623 | { |
624 | FileItem * i = (FileItem *) currentItem(); | 624 | FileItem * i = (FileItem *) currentItem(); |
625 | if ( !i ) | 625 | if ( !i ) |
626 | return; | 626 | return; |
627 | 627 | ||
628 | QPopupMenu * m = new QPopupMenu( this ); | 628 | QPopupMenu * m = new QPopupMenu( this ); |
629 | 629 | ||
630 | if ( !i->isDir() ) { | 630 | if ( !i->isDir() ) { |
631 | m->insertItem( tr( "Add to Documents" ), this, SLOT( addToDocuments() ) ); | 631 | m->insertItem( tr( "Add to Documents" ), this, SLOT( addToDocuments() ) ); |
632 | m->insertSeparator(); | 632 | m->insertSeparator(); |
633 | } | 633 | } |
634 | 634 | ||
635 | MimeType mt(i->getFilePath()); | 635 | MimeType mt(i->getFilePath()); |
636 | const AppLnk* app = mt.application(); | 636 | const AppLnk* app = mt.application(); |
637 | 637 | ||
638 | if ( !i->isDir() ) { | 638 | if ( !i->isDir() ) { |
639 | if ( app ) | 639 | if ( app ) |
640 | m->insertItem( app->pixmap(), tr( "Open in " + app->name() ), this, SLOT( run() ) ); | 640 | m->insertItem( app->pixmap(), tr( "Open in " + app->name() ), this, SLOT( run() ) ); |
641 | else if( i->isExecutable() ) | 641 | else if( i->isExecutable() ) |
642 | m->insertItem( Resource::loadPixmap( i->text( 0 ) ), tr( "Run" ), this, SLOT( run() ) ); | 642 | m->insertItem( Resource::loadPixmap( i->text( 0 ) ), tr( "Run" ), this, SLOT( run() ) ); |
643 | 643 | ||
644 | m->insertItem( Resource::loadPixmap( "txt" ), tr( "View as text" ), | 644 | m->insertItem( Resource::loadPixmap( "txt" ), tr( "View as text" ), |
645 | this, SLOT( viewAsText() ) ); | 645 | this, SLOT( viewAsText() ) ); |
646 | 646 | ||
647 | m->insertSeparator(); | 647 | m->insertSeparator(); |
648 | } | 648 | } |
649 | 649 | ||
650 | m->insertItem( tr( "Rename" ), this, SLOT( rename() ) ); | 650 | m->insertItem( tr( "Rename" ), this, SLOT( rename() ) ); |
651 | m->insertItem( Resource::loadPixmap("cut"), | 651 | m->insertItem( Resource::loadPixmap("cut"), |
652 | tr( "Cut" ), this, SLOT( cut() ) ); | 652 | tr( "Cut" ), this, SLOT( cut() ) ); |
653 | m->insertItem( Resource::loadPixmap("copy"), | 653 | m->insertItem( Resource::loadPixmap("copy"), |
654 | tr( "Copy" ), this, SLOT( copy() ) ); | 654 | tr( "Copy" ), this, SLOT( copy() ) ); |
655 | m->insertItem( Resource::loadPixmap("paste"), | 655 | m->insertItem( Resource::loadPixmap("paste"), |
656 | tr( "Paste" ), this, SLOT( paste() ) ); | 656 | tr( "Paste" ), this, SLOT( paste() ) ); |
657 | m->insertItem( tr( "change permissions" ), this, SLOT( chPerm() ) ); | 657 | m->insertItem( tr( "Change Permissions" ), this, SLOT( chPerm() ) ); |
658 | m->insertItem( tr( "Delete" ), this, SLOT( del() ) ); | 658 | m->insertItem( tr( "Delete" ), this, SLOT( del() ) ); |
659 | m->insertSeparator(); | 659 | m->insertSeparator(); |
660 | m->insertItem( tr( "Select all" ), this, SLOT( selectAll() ) ); | 660 | m->insertItem( tr( "Select all" ), this, SLOT( selectAll() ) ); |
661 | m->insertItem( tr( "Deselect all" ), this, SLOT( deselectAll() ) ); | 661 | m->insertItem( tr( "Deselect all" ), this, SLOT( deselectAll() ) ); |
662 | m->popup( QCursor::pos() ); | 662 | m->popup( QCursor::pos() ); |
663 | } | 663 | } |
664 | 664 | ||
665 | // | 665 | // |
666 | // FileBrowser | 666 | // FileBrowser |
667 | // | 667 | // |
668 | 668 | ||
669 | FileBrowser::FileBrowser( QWidget * parent, | 669 | FileBrowser::FileBrowser( QWidget * parent, |
670 | const char * name, WFlags f ) : | 670 | const char * name, WFlags f ) : |
671 | QMainWindow( parent, name, f ) | 671 | QMainWindow( parent, name, f ) |
672 | { | 672 | { |
673 | init( QDir::current().canonicalPath() ); | 673 | init( QDir::current().canonicalPath() ); |
674 | } | 674 | } |
675 | 675 | ||
676 | FileBrowser::FileBrowser( const QString & dir, QWidget * parent, | 676 | FileBrowser::FileBrowser( const QString & dir, QWidget * parent, |
677 | const char * name, WFlags f ) : | 677 | const char * name, WFlags f ) : |
678 | QMainWindow( parent, name, f ) | 678 | QMainWindow( parent, name, f ) |
679 | { | 679 | { |
680 | init( dir ); | 680 | init( dir ); |
681 | } | 681 | } |
682 | 682 | ||
683 | void FileBrowser::init(const QString & dir) | 683 | void FileBrowser::init(const QString & dir) |
684 | { | 684 | { |
685 | setCaption( tr("File Manager") ); | 685 | setCaption( tr("File Manager") ); |
686 | setIcon( Resource::loadPixmap( "filebrowser_icon" ) ); | 686 | setIcon( Resource::loadPixmap( "filebrowser_icon" ) ); |
687 | 687 | ||
688 | fileView = new FileView( dir, this ); | 688 | fileView = new FileView( dir, this ); |
689 | fileView->setAllColumnsShowFocus( TRUE ); | 689 | fileView->setAllColumnsShowFocus( TRUE ); |
690 | 690 | ||
691 | setCentralWidget( fileView ); | 691 | setCentralWidget( fileView ); |
692 | setToolBarsMovable( FALSE ); | 692 | setToolBarsMovable( FALSE ); |
693 | 693 | ||
694 | QPEToolBar* toolBar = new QPEToolBar( this ); | 694 | QPEToolBar* toolBar = new QPEToolBar( this ); |
695 | toolBar->setHorizontalStretchable( TRUE ); | 695 | toolBar->setHorizontalStretchable( TRUE ); |
696 | 696 | ||
697 | QPEMenuBar* menuBar = new QPEMenuBar( toolBar ); | 697 | QPEMenuBar* menuBar = new QPEMenuBar( toolBar ); |
698 | 698 | ||
699 | dirMenu = new QPopupMenu( this ); | 699 | dirMenu = new QPopupMenu( this ); |
700 | menuBar->insertItem( tr( "Dir" ), dirMenu ); | 700 | menuBar->insertItem( tr( "Dir" ), dirMenu ); |
701 | 701 | ||
702 | sortMenu = new QPopupMenu( this ); | 702 | sortMenu = new QPopupMenu( this ); |
703 | menuBar->insertItem( tr( "Sort" ), sortMenu ); | 703 | menuBar->insertItem( tr( "Sort" ), sortMenu ); |
704 | sortMenu->insertItem( tr( "by Name "), this, SLOT( sortName() ) ); | 704 | sortMenu->insertItem( tr( "by Name "), this, SLOT( sortName() ) ); |
705 | sortMenu->insertItem( tr( "by Size "), this, SLOT( sortSize() ) ); | 705 | sortMenu->insertItem( tr( "by Size "), this, SLOT( sortSize() ) ); |
706 | sortMenu->insertItem( tr( "by Date "), this, SLOT( sortDate() ) ); | 706 | sortMenu->insertItem( tr( "by Date "), this, SLOT( sortDate() ) ); |
707 | sortMenu->insertItem( tr( "by Type "), this, SLOT( sortType() ) ); | 707 | sortMenu->insertItem( tr( "by Type "), this, SLOT( sortType() ) ); |
708 | sortMenu->insertSeparator(); | 708 | sortMenu->insertSeparator(); |
709 | sortMenu->insertItem( tr( "Ascending" ), this, SLOT( updateSorting() ) ); | 709 | sortMenu->insertItem( tr( "Ascending" ), this, SLOT( updateSorting() ) ); |
710 | sortMenu->setItemChecked( sortMenu->idAt( 5 ), TRUE ); | 710 | sortMenu->setItemChecked( sortMenu->idAt( 5 ), TRUE ); |
711 | sortMenu->setItemChecked( sortMenu->idAt( 0 ), TRUE ); | 711 | sortMenu->setItemChecked( sortMenu->idAt( 0 ), TRUE ); |
712 | 712 | ||
713 | toolBar = new QPEToolBar( this ); | 713 | toolBar = new QPEToolBar( this ); |
714 | 714 | ||
715 | lastAction = new QAction( tr("Previous dir"), Resource::loadIconSet( "back" ), | 715 | lastAction = new QAction( tr("Previous dir"), Resource::loadIconSet( "back" ), |
716 | QString::null, 0, this, 0 ); | 716 | QString::null, 0, this, 0 ); |
717 | connect( lastAction, SIGNAL( activated() ), fileView, SLOT( lastDir() ) ); | 717 | connect( lastAction, SIGNAL( activated() ), fileView, SLOT( lastDir() ) ); |
718 | lastAction->addTo( toolBar ); | 718 | lastAction->addTo( toolBar ); |
719 | lastAction->setEnabled( FALSE ); | 719 | lastAction->setEnabled( FALSE ); |
720 | 720 | ||
721 | upAction = new QAction( tr("Parent dir"), Resource::loadIconSet( "up" ), | 721 | upAction = new QAction( tr("Parent dir"), Resource::loadIconSet( "up" ), |