author | llornkcor <llornkcor> | 2002-02-24 15:30:25 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-02-24 15:30:25 (UTC) |
commit | d4592dd8d9cb451c780b71b9aebaa53b2e58f2c3 (patch) (unidiff) | |
tree | 7ea4e5bf47467510c35c08e4cd4114d46ffd4e1b | |
parent | a43106c752dae2404f33a07dc80851c4a745d2bc (diff) | |
download | opie-d4592dd8d9cb451c780b71b9aebaa53b2e58f2c3.zip opie-d4592dd8d9cb451c780b71b9aebaa53b2e58f2c3.tar.gz opie-d4592dd8d9cb451c780b71b9aebaa53b2e58f2c3.tar.bz2 |
changed capitalization of new menu item
-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 | |||
@@ -561,193 +561,193 @@ void FileView::itemClicked( QListViewItem * i) | |||
561 | 561 | ||
562 | void FileView::itemDblClicked( QListViewItem * i) | 562 | void FileView::itemDblClicked( QListViewItem * i) |
563 | { | 563 | { |
564 | FileItem * t = (FileItem *) i; | 564 | FileItem * t = (FileItem *) i; |
565 | 565 | ||
566 | if(t == NULL) return; | 566 | if(t == NULL) return; |
567 | if(t->launch() == -1){ | 567 | if(t->launch() == -1){ |
568 | QMessageBox::warning( this, tr( "Launch Application" ), | 568 | QMessageBox::warning( this, tr( "Launch Application" ), |
569 | tr( "Launch failed!" ), tr( "Ok" ) ); | 569 | tr( "Launch failed!" ), tr( "Ok" ) ); |
570 | } | 570 | } |
571 | } | 571 | } |
572 | 572 | ||
573 | void FileView::parentDir() | 573 | void FileView::parentDir() |
574 | { | 574 | { |
575 | setDir( currentDir + "./.." ); | 575 | setDir( currentDir + "./.." ); |
576 | } | 576 | } |
577 | 577 | ||
578 | void FileView::lastDir() | 578 | void FileView::lastDir() |
579 | { | 579 | { |
580 | if( dirHistory.count() == 0 ) return; | 580 | if( dirHistory.count() == 0 ) return; |
581 | 581 | ||
582 | QString newDir = dirHistory.last(); | 582 | QString newDir = dirHistory.last(); |
583 | dirHistory.remove( dirHistory.last() ); | 583 | dirHistory.remove( dirHistory.last() ); |
584 | generateDir( newDir ); | 584 | generateDir( newDir ); |
585 | } | 585 | } |
586 | 586 | ||
587 | void FileView::contentsMousePressEvent( QMouseEvent * e ) | 587 | void FileView::contentsMousePressEvent( QMouseEvent * e ) |
588 | { | 588 | { |
589 | QListView::contentsMousePressEvent( e ); | 589 | QListView::contentsMousePressEvent( e ); |
590 | menuTimer.start( 750, TRUE ); | 590 | menuTimer.start( 750, TRUE ); |
591 | } | 591 | } |
592 | 592 | ||
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" ), |
722 | QString::null, 0, this, 0 ); | 722 | QString::null, 0, this, 0 ); |
723 | connect( upAction, SIGNAL( activated() ), fileView, SLOT( parentDir() ) ); | 723 | connect( upAction, SIGNAL( activated() ), fileView, SLOT( parentDir() ) ); |
724 | upAction->addTo( toolBar ); | 724 | upAction->addTo( toolBar ); |
725 | 725 | ||
726 | QAction *a = new QAction( tr("New folder"), Resource::loadPixmap( "newfolder" ), | 726 | QAction *a = new QAction( tr("New folder"), Resource::loadPixmap( "newfolder" ), |
727 | QString::null, 0, this, 0 ); | 727 | QString::null, 0, this, 0 ); |
728 | connect( a, SIGNAL( activated() ), fileView, SLOT( newFolder() ) ); | 728 | connect( a, SIGNAL( activated() ), fileView, SLOT( newFolder() ) ); |
729 | a->addTo( toolBar ); | 729 | a->addTo( toolBar ); |
730 | 730 | ||
731 | a = new QAction( tr("Cut"), Resource::loadPixmap( "cut" ), | 731 | a = new QAction( tr("Cut"), Resource::loadPixmap( "cut" ), |
732 | QString::null, 0, this, 0 ); | 732 | QString::null, 0, this, 0 ); |
733 | connect( a, SIGNAL( activated() ), fileView, SLOT( cut() ) ); | 733 | connect( a, SIGNAL( activated() ), fileView, SLOT( cut() ) ); |
734 | a->addTo( toolBar ); | 734 | a->addTo( toolBar ); |
735 | 735 | ||
736 | a = new QAction( tr("Copy"), Resource::loadPixmap( "copy" ), | 736 | a = new QAction( tr("Copy"), Resource::loadPixmap( "copy" ), |
737 | QString::null, 0, this, 0 ); | 737 | QString::null, 0, this, 0 ); |
738 | connect( a, SIGNAL( activated() ), fileView, SLOT( copy() ) ); | 738 | connect( a, SIGNAL( activated() ), fileView, SLOT( copy() ) ); |
739 | a->addTo( toolBar ); | 739 | a->addTo( toolBar ); |
740 | 740 | ||
741 | pasteAction = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), | 741 | pasteAction = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), |
742 | QString::null, 0, this, 0 ); | 742 | QString::null, 0, this, 0 ); |
743 | connect( pasteAction, SIGNAL( activated() ), fileView, SLOT( paste() ) ); | 743 | connect( pasteAction, SIGNAL( activated() ), fileView, SLOT( paste() ) ); |
744 | pasteAction->addTo( toolBar ); | 744 | pasteAction->addTo( toolBar ); |
745 | 745 | ||
746 | 746 | ||
747 | connect( fileView, SIGNAL( dirChanged() ), SLOT( updateDirMenu() ) ); | 747 | connect( fileView, SIGNAL( dirChanged() ), SLOT( updateDirMenu() ) ); |
748 | updateDirMenu(); | 748 | updateDirMenu(); |
749 | 749 | ||
750 | QCopChannel* pcmciaChannel = new QCopChannel( "QPE/Card", this ); | 750 | QCopChannel* pcmciaChannel = new QCopChannel( "QPE/Card", this ); |
751 | connect( pcmciaChannel, SIGNAL(received(const QCString &, const QByteArray &)), | 751 | connect( pcmciaChannel, SIGNAL(received(const QCString &, const QByteArray &)), |
752 | this, SLOT(pcmciaMessage( const QCString &, const QByteArray &)) ); | 752 | this, SLOT(pcmciaMessage( const QCString &, const QByteArray &)) ); |
753 | } | 753 | } |