author | llornkcor <llornkcor> | 2002-10-20 15:51:08 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-10-20 15:51:08 (UTC) |
commit | 0535df00106c4e4c78e6ae8dde8f4f41f8487dae (patch) (unidiff) | |
tree | a00836456d62b54a2959c76276879d12efc5501e | |
parent | 1a583682e8a49e65d5c478ab72dffb78d120c850 (diff) | |
download | opie-0535df00106c4e4c78e6ae8dde8f4f41f8487dae.zip opie-0535df00106c4e4c78e6ae8dde8f4f41f8487dae.tar.gz opie-0535df00106c4e4c78e6ae8dde8f4f41f8487dae.tar.bz2 |
converted to otab, and updated show hidden dir functions
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 56 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 5 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.pro | 2 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 14 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 80 |
5 files changed, 99 insertions, 58 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index f23fd86..08dc24e 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -9,12 +9,13 @@ | |||
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | ***************************************************************************/ | 11 | ***************************************************************************/ |
12 | #define DEVELOPERS_VERSION | 12 | #define DEVELOPERS_VERSION |
13 | #include "advancedfm.h" | 13 | #include "advancedfm.h" |
14 | 14 | ||
15 | #include <opie/otabwidget.h> | ||
15 | // #include <opie/ofileselector.h> | 16 | // #include <opie/ofileselector.h> |
16 | // #include <opie/ofiledialog.h> | 17 | // #include <opie/ofiledialog.h> |
17 | 18 | ||
18 | #include <qpe/filemanager.h> | 19 | #include <qpe/filemanager.h> |
19 | #include <qpe/qcopenvelope_qws.h> | 20 | #include <qpe/qcopenvelope_qws.h> |
20 | #include <qpe/qpemenubar.h> | 21 | #include <qpe/qpemenubar.h> |
@@ -84,22 +85,25 @@ void AdvancedFm::cleanUp() { | |||
84 | QFile file( sfile); | 85 | QFile file( sfile); |
85 | if(file.exists()) | 86 | if(file.exists()) |
86 | file.remove(); | 87 | file.remove(); |
87 | } | 88 | } |
88 | 89 | ||
89 | void AdvancedFm::tabChanged(QWidget *) { | 90 | void AdvancedFm::tabChanged(QWidget *) { |
90 | if (TabWidget->currentPageIndex() == 0) { | 91 | if (TabWidget->getCurrentTab() == 0) { |
92 | // if (TabWidget->currentPageIndex() == 0) { | ||
91 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 93 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
92 | viewMenu->setItemChecked(viewMenu->idAt(0),TRUE); | 94 | viewMenu->setItemChecked(viewMenu->idAt(0),TRUE); |
93 | viewMenu->setItemChecked(viewMenu->idAt(1),FALSE); | 95 | viewMenu->setItemChecked(viewMenu->idAt(1),FALSE); |
94 | QString fs= getFileSystemType((const QString &) currentDir.canonicalPath()); | 96 | QString fs= getFileSystemType((const QString &) currentDir.canonicalPath()); |
95 | setCaption("AdvancedFm :: "+fs+" :: " | 97 | setCaption("AdvancedFm :: "+fs+" :: " |
96 | +checkDiskSpace((const QString &) currentDir.canonicalPath())+" kB free" ); | 98 | +checkDiskSpace((const QString &) currentDir.canonicalPath())+" kB free" ); |
97 | 99 | ||
98 | } | 100 | } |
99 | if (TabWidget->currentPageIndex() == 1) { | 101 | if (TabWidget->getCurrentTab() == 1) { |
102 | |||
103 | // if (TabWidget->currentPageIndex() == 1) { | ||
100 | currentPathCombo->lineEdit()->setText( currentRemoteDir.canonicalPath()); | 104 | currentPathCombo->lineEdit()->setText( currentRemoteDir.canonicalPath()); |
101 | viewMenu->setItemChecked(viewMenu->idAt(1),TRUE); | 105 | viewMenu->setItemChecked(viewMenu->idAt(1),TRUE); |
102 | viewMenu->setItemChecked(viewMenu->idAt(0),FALSE); | 106 | viewMenu->setItemChecked(viewMenu->idAt(0),FALSE); |
103 | QString fs= getFileSystemType((const QString &) currentRemoteDir.canonicalPath()); | 107 | QString fs= getFileSystemType((const QString &) currentRemoteDir.canonicalPath()); |
104 | setCaption("AdvancedFm :: "+fs+" :: " | 108 | setCaption("AdvancedFm :: "+fs+" :: " |
105 | +checkDiskSpace((const QString &) currentRemoteDir.canonicalPath())+" kB free" ); | 109 | +checkDiskSpace((const QString &) currentRemoteDir.canonicalPath())+" kB free" ); |
@@ -411,51 +415,54 @@ void AdvancedFm::remoteListPressed( int mouse, QListViewItem*, const QPoint&, in | |||
411 | break; | 415 | break; |
412 | }; | 416 | }; |
413 | } | 417 | } |
414 | 418 | ||
415 | 419 | ||
416 | void AdvancedFm::switchToLocalTab() { | 420 | void AdvancedFm::switchToLocalTab() { |
417 | TabWidget->setCurrentPage(0); | 421 | TabWidget->setCurrentTab(0); |
418 | Local_View->setFocus(); | 422 | Local_View->setFocus(); |
419 | } | 423 | } |
420 | 424 | ||
421 | void AdvancedFm::switchToRemoteTab() { | 425 | void AdvancedFm::switchToRemoteTab() { |
422 | TabWidget->setCurrentPage(1); | 426 | TabWidget->setCurrentTab(1); |
423 | Remote_View->setFocus(); | 427 | Remote_View->setFocus(); |
424 | } | 428 | } |
425 | 429 | ||
426 | void AdvancedFm::readConfig() { | 430 | void AdvancedFm::readConfig() { |
427 | Config cfg("AdvancedFm"); | 431 | Config cfg("AdvancedFm"); |
428 | } | 432 | } |
429 | 433 | ||
430 | void AdvancedFm::writeConfig() { | 434 | void AdvancedFm::writeConfig() { |
431 | Config cfg("AdvancedFm"); | 435 | Config cfg("AdvancedFm"); |
432 | } | 436 | } |
433 | 437 | ||
434 | void AdvancedFm::currentPathComboChanged() { | 438 | void AdvancedFm::currentPathComboChanged() { |
435 | if (TabWidget->currentPageIndex() == 0) { | 439 | if (TabWidget->getCurrentTab() == 0) { |
440 | // if (TabWidget->currentPageIndex() == 0) { | ||
436 | if(QDir( currentPathCombo->lineEdit()->text()).exists()) { | 441 | if(QDir( currentPathCombo->lineEdit()->text()).exists()) { |
437 | currentDir.setPath( currentPathCombo->lineEdit()->text() ); | 442 | currentDir.setPath( currentPathCombo->lineEdit()->text() ); |
438 | populateLocalView(); | 443 | populateLocalView(); |
439 | } else { | 444 | } else { |
440 | QMessageBox::message(tr("Note"),tr("That directory does not exist")); | 445 | QMessageBox::message(tr("Note"),tr("That directory does not exist")); |
441 | } | 446 | } |
442 | } | 447 | } |
443 | if (TabWidget->currentPageIndex() == 0) { | 448 | if (TabWidget->getCurrentTab() == 0) { |
449 | // if (TabWidget->currentPageIndex() == 0) { | ||
444 | if(QDir( currentPathCombo->lineEdit()->text()).exists()) { | 450 | if(QDir( currentPathCombo->lineEdit()->text()).exists()) { |
445 | currentRemoteDir.setPath( currentPathCombo->lineEdit()->text() ); | 451 | currentRemoteDir.setPath( currentPathCombo->lineEdit()->text() ); |
446 | populateRemoteView(); | 452 | populateRemoteView(); |
447 | } else { | 453 | } else { |
448 | QMessageBox::message(tr("Note"),tr("That directory does not exist")); | 454 | QMessageBox::message(tr("Note"),tr("That directory does not exist")); |
449 | } | 455 | } |
450 | } | 456 | } |
451 | } | 457 | } |
452 | 458 | ||
453 | void AdvancedFm::fillCombo(const QString ¤tPath) { | 459 | void AdvancedFm::fillCombo(const QString ¤tPath) { |
454 | 460 | ||
455 | if (TabWidget->currentPageIndex() == 0) { | 461 | if (TabWidget->getCurrentTab() == 0) { |
462 | // if (TabWidget->currentPageIndex() == 0) { | ||
456 | currentPathCombo->lineEdit()->setText( currentPath); | 463 | currentPathCombo->lineEdit()->setText( currentPath); |
457 | if( localDirPathStringList.grep(currentPath,TRUE).isEmpty() ) { | 464 | if( localDirPathStringList.grep(currentPath,TRUE).isEmpty() ) { |
458 | currentPathCombo->clear(); | 465 | currentPathCombo->clear(); |
459 | localDirPathStringList.prepend( currentPath ); | 466 | localDirPathStringList.prepend( currentPath ); |
460 | currentPathCombo->insertStringList( localDirPathStringList,-1); | 467 | currentPathCombo->insertStringList( localDirPathStringList,-1); |
461 | } | 468 | } |
@@ -467,13 +474,14 @@ void AdvancedFm::fillCombo(const QString ¤tPath) { | |||
467 | currentPathCombo->insertStringList( remoteDirPathStringList,-1); | 474 | currentPathCombo->insertStringList( remoteDirPathStringList,-1); |
468 | } | 475 | } |
469 | } | 476 | } |
470 | } | 477 | } |
471 | 478 | ||
472 | void AdvancedFm::currentPathComboActivated(const QString & currentPath) { | 479 | void AdvancedFm::currentPathComboActivated(const QString & currentPath) { |
473 | if (TabWidget->currentPageIndex() == 0) { | 480 | if (TabWidget->getCurrentTab() == 0) { |
481 | // if (TabWidget->currentPageIndex() == 0) { | ||
474 | chdir( currentPath.latin1() ); | 482 | chdir( currentPath.latin1() ); |
475 | currentDir.cd( currentPath, TRUE); | 483 | currentDir.cd( currentPath, TRUE); |
476 | populateLocalView(); | 484 | populateLocalView(); |
477 | update(); | 485 | update(); |
478 | } else { | 486 | } else { |
479 | chdir( currentPath.latin1() ); | 487 | chdir( currentPath.latin1() ); |
@@ -482,13 +490,14 @@ void AdvancedFm::currentPathComboActivated(const QString & currentPath) { | |||
482 | update(); | 490 | update(); |
483 | } | 491 | } |
484 | } | 492 | } |
485 | 493 | ||
486 | QStringList AdvancedFm::getPath() { | 494 | QStringList AdvancedFm::getPath() { |
487 | QStringList strList; | 495 | QStringList strList; |
488 | if (TabWidget->currentPageIndex() == 0) { | 496 | if (TabWidget->getCurrentTab() == 0) { |
497 | // if (TabWidget->currentPageIndex() == 0) { | ||
489 | QList<QListViewItem> * getSelectedItems( QListView * Local_View ); | 498 | QList<QListViewItem> * getSelectedItems( QListView * Local_View ); |
490 | QListViewItemIterator it( Local_View ); | 499 | QListViewItemIterator it( Local_View ); |
491 | for ( ; it.current(); ++it ) { | 500 | for ( ; it.current(); ++it ) { |
492 | if ( it.current()->isSelected() ) { | 501 | if ( it.current()->isSelected() ) { |
493 | strList << it.current()->text(0); | 502 | strList << it.current()->text(0); |
494 | qDebug(it.current()->text(0)); | 503 | qDebug(it.current()->text(0)); |
@@ -509,39 +518,43 @@ QStringList AdvancedFm::getPath() { | |||
509 | return ""; | 518 | return ""; |
510 | } | 519 | } |
511 | 520 | ||
512 | void AdvancedFm::homeButtonPushed() { | 521 | void AdvancedFm::homeButtonPushed() { |
513 | QString current = QDir::homeDirPath(); | 522 | QString current = QDir::homeDirPath(); |
514 | chdir( current.latin1() ); | 523 | chdir( current.latin1() ); |
515 | if (TabWidget->currentPageIndex() == 0) { | 524 | if (TabWidget->getCurrentTab() == 0) { |
525 | // if (TabWidget->currentPageIndex() == 0) { | ||
516 | currentDir.cd( current, TRUE); | 526 | currentDir.cd( current, TRUE); |
517 | populateLocalView(); | 527 | populateLocalView(); |
518 | } else { | 528 | } else { |
519 | currentRemoteDir.cd( current, TRUE); | 529 | currentRemoteDir.cd( current, TRUE); |
520 | populateRemoteView(); | 530 | populateRemoteView(); |
521 | } | 531 | } |
522 | update(); | 532 | update(); |
523 | } | 533 | } |
524 | 534 | ||
525 | void AdvancedFm::docButtonPushed() { | 535 | void AdvancedFm::docButtonPushed() { |
526 | QString current = QPEApplication::documentDir(); | 536 | QString current = QPEApplication::documentDir(); |
527 | chdir( current.latin1() ); | 537 | chdir( current.latin1() ); |
528 | if (TabWidget->currentPageIndex() == 0) { | 538 | |
539 | if (TabWidget->getCurrentTab() == 0) { | ||
540 | //if (TabWidget->currentPageIndex() == 0) { | ||
529 | currentDir.cd( current, TRUE); | 541 | currentDir.cd( current, TRUE); |
530 | populateLocalView(); | 542 | populateLocalView(); |
531 | } else { | 543 | } else { |
532 | currentRemoteDir.cd( current, TRUE); | 544 | currentRemoteDir.cd( current, TRUE); |
533 | populateRemoteView(); | 545 | populateRemoteView(); |
534 | } | 546 | } |
535 | update(); | 547 | update(); |
536 | } | 548 | } |
537 | 549 | ||
538 | void AdvancedFm::SDButtonPushed() { | 550 | void AdvancedFm::SDButtonPushed() { |
539 | QString current = "/mnt/card";// this can change so fix | 551 | QString current = "/mnt/card";// this can change so fix |
540 | chdir( current.latin1() ); | 552 | chdir( current.latin1() ); |
541 | if (TabWidget->currentPageIndex() == 0) { | 553 | if (TabWidget->getCurrentTab() == 0) { |
554 | // if (TabWidget->currentPageIndex() == 0) { | ||
542 | currentDir.cd( current, TRUE); | 555 | currentDir.cd( current, TRUE); |
543 | populateLocalView(); | 556 | populateLocalView(); |
544 | } else { | 557 | } else { |
545 | currentRemoteDir.cd( current, TRUE); | 558 | currentRemoteDir.cd( current, TRUE); |
546 | populateRemoteView(); | 559 | populateRemoteView(); |
547 | } | 560 | } |
@@ -554,13 +567,14 @@ void AdvancedFm::CFButtonPushed() { | |||
554 | if(zaurusDevice) | 567 | if(zaurusDevice) |
555 | current= "/mnt/cf"; //zaurus | 568 | current= "/mnt/cf"; //zaurus |
556 | else | 569 | else |
557 | current = "/mnt/hda"; //ipaq | 570 | current = "/mnt/hda"; //ipaq |
558 | 571 | ||
559 | chdir( current.latin1() ); | 572 | chdir( current.latin1() ); |
560 | if (TabWidget->currentPageIndex() == 0) { | 573 | if (TabWidget->getCurrentTab() == 0) { |
574 | // if (TabWidget->currentPageIndex() == 0) { | ||
561 | currentDir.cd( current, TRUE); | 575 | currentDir.cd( current, TRUE); |
562 | populateLocalView(); | 576 | populateLocalView(); |
563 | } else { | 577 | } else { |
564 | currentRemoteDir.cd( current, TRUE); | 578 | currentRemoteDir.cd( current, TRUE); |
565 | populateRemoteView(); | 579 | populateRemoteView(); |
566 | } | 580 | } |
@@ -642,13 +656,14 @@ void AdvancedFm::keyReleaseEvent( QKeyEvent *e) { | |||
642 | } | 656 | } |
643 | 657 | ||
644 | 658 | ||
645 | void AdvancedFm::QPEButtonPushed() { | 659 | void AdvancedFm::QPEButtonPushed() { |
646 | QString current = QPEApplication::qpeDir(); | 660 | QString current = QPEApplication::qpeDir(); |
647 | chdir( current.latin1() ); | 661 | chdir( current.latin1() ); |
648 | if (TabWidget->currentPageIndex() == 0) { | 662 | if (TabWidget->getCurrentTab() == 0) { |
663 | // if (TabWidget->currentPageIndex() == 0) { | ||
649 | currentDir.cd( current, TRUE); | 664 | currentDir.cd( current, TRUE); |
650 | populateLocalView(); | 665 | populateLocalView(); |
651 | } else { | 666 | } else { |
652 | currentRemoteDir.cd( current, TRUE); | 667 | currentRemoteDir.cd( current, TRUE); |
653 | populateRemoteView(); | 668 | populateRemoteView(); |
654 | } | 669 | } |
@@ -714,27 +729,31 @@ QString AdvancedFm::getDiskSpace( const QString &path) { | |||
714 | 729 | ||
715 | 730 | ||
716 | void AdvancedFm::showFileMenu() { | 731 | void AdvancedFm::showFileMenu() { |
717 | 732 | ||
718 | QString curApp; | 733 | QString curApp; |
719 | bool isLocalView = false; | 734 | bool isLocalView = false; |
720 | if (TabWidget->currentPageIndex() == 0) { | 735 | if (TabWidget->getCurrentTab() == 0) { |
736 | // if (TabWidget->currentPageIndex() == 0) { | ||
721 | isLocalView = TRUE; | 737 | isLocalView = TRUE; |
722 | curApp = Local_View->currentItem()->text(0); | 738 | curApp = Local_View->currentItem()->text(0); |
723 | } else { | 739 | } else { |
724 | curApp = Remote_View->currentItem()->text(0); | 740 | curApp = Remote_View->currentItem()->text(0); |
725 | } | 741 | } |
726 | 742 | ||
727 | MimeType mt( curApp ); | 743 | MimeType mt( curApp ); |
728 | const AppLnk* app = mt.application(); | 744 | const AppLnk* app = mt.application(); |
729 | QFile fi(curApp); | 745 | QFile fi(curApp); |
730 | QPopupMenu *m = new QPopupMenu(0); | 746 | QPopupMenu *m = new QPopupMenu(0); |
731 | QPopupMenu *n = new QPopupMenu(0); | 747 | QPopupMenu *n = new QPopupMenu(0); |
732 | // QPopupMenu *o = new QPopupMenu(0); | 748 | // QPopupMenu *o = new QPopupMenu(0); |
733 | m->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); | 749 | if (TabWidget->getCurrentTab() == 0) |
734 | 750 | m->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); | |
751 | else | ||
752 | m->insertItem( tr( "Show Hidden Files" ), this, SLOT( showRemoteHidden() )); | ||
753 | |||
735 | if ( QFileInfo(fi).isDir() ) { | 754 | if ( QFileInfo(fi).isDir() ) { |
736 | m->insertSeparator(); | 755 | m->insertSeparator(); |
737 | m->insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() )); | 756 | m->insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() )); |
738 | } else { | 757 | } else { |
739 | 758 | ||
740 | if ( app ) | 759 | if ( app ) |
@@ -826,13 +845,14 @@ QString AdvancedFm::checkDiskSpace(const QString &path) { | |||
826 | } | 845 | } |
827 | 846 | ||
828 | void AdvancedFm::addToDocs() { | 847 | void AdvancedFm::addToDocs() { |
829 | QStringList strListPaths = getPath(); | 848 | QStringList strListPaths = getPath(); |
830 | if( strListPaths.count() > 0) { | 849 | if( strListPaths.count() > 0) { |
831 | QString curFile; | 850 | QString curFile; |
832 | if (TabWidget->currentPageIndex() == 0) { | 851 | if (TabWidget->getCurrentTab() == 0) { |
852 | // if (TabWidget->currentPageIndex() == 0) { | ||
833 | for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it ) { | 853 | for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it ) { |
834 | curFile = currentDir.canonicalPath()+"/"+(*it); | 854 | curFile = currentDir.canonicalPath()+"/"+(*it); |
835 | qDebug(curFile); | 855 | qDebug(curFile); |
836 | DocLnk f; | 856 | DocLnk f; |
837 | // curFile.replace(QRegExp("\\..*"),""); | 857 | // curFile.replace(QRegExp("\\..*"),""); |
838 | f.setName((*it)); | 858 | f.setName((*it)); |
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index f846c66..12ebbf2 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h | |||
@@ -11,23 +11,25 @@ | |||
11 | ***************************************************************************/ | 11 | ***************************************************************************/ |
12 | #ifndef ADVANCEDFM_H | 12 | #ifndef ADVANCEDFM_H |
13 | #define ADVANCEDFM_H | 13 | #define ADVANCEDFM_H |
14 | #define QTOPIA_INTERNAL_FSLP // to get access to fileproperties | 14 | #define QTOPIA_INTERNAL_FSLP // to get access to fileproperties |
15 | #define QT_QWS_OPIE | 15 | #define QT_QWS_OPIE |
16 | 16 | ||
17 | //#include <opie/otabwidget.h> | ||
17 | #include <qpe/ir.h> | 18 | #include <qpe/ir.h> |
18 | 19 | ||
19 | #include <qvariant.h> | 20 | #include <qvariant.h> |
20 | #include <qdialog.h> | 21 | #include <qdialog.h> |
21 | #include <qmainwindow.h> | 22 | #include <qmainwindow.h> |
22 | #include <qstringlist.h> | 23 | #include <qstringlist.h> |
23 | #include <qdir.h> | 24 | #include <qdir.h> |
24 | #include <qstring.h> | 25 | #include <qstring.h> |
25 | #include <qpoint.h> | 26 | #include <qpoint.h> |
26 | #include <qtimer.h> | 27 | #include <qtimer.h> |
27 | 28 | ||
29 | class OTabWidget; | ||
28 | class QVBoxLayout; | 30 | class QVBoxLayout; |
29 | class QHBoxLayout; | 31 | class QHBoxLayout; |
30 | class QGridLayout; | 32 | class QGridLayout; |
31 | class QComboBox; | 33 | class QComboBox; |
32 | class QListView; | 34 | class QListView; |
33 | class QListviewItem; | 35 | class QListviewItem; |
@@ -50,13 +52,14 @@ class AdvancedFm : public QMainWindow | |||
50 | { | 52 | { |
51 | Q_OBJECT | 53 | Q_OBJECT |
52 | public: | 54 | public: |
53 | AdvancedFm(); | 55 | AdvancedFm(); |
54 | ~AdvancedFm(); | 56 | ~AdvancedFm(); |
55 | 57 | ||
56 | QTabWidget *TabWidget; | 58 | OTabWidget *TabWidget; |
59 | // QTabWidget *TabWidget; | ||
57 | QWidget *tab, *tab_2, *tab_3; | 60 | QWidget *tab, *tab_2, *tab_3; |
58 | QListView *Local_View, *Remote_View; | 61 | QListView *Local_View, *Remote_View; |
59 | 62 | ||
60 | QLineEdit *currentPathEdit; | 63 | QLineEdit *currentPathEdit; |
61 | QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu; | 64 | QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu; |
62 | QToolButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; | 65 | QToolButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; |
diff --git a/noncore/apps/advancedfm/advancedfm.pro b/noncore/apps/advancedfm/advancedfm.pro index eb4f122..3896f50 100644 --- a/noncore/apps/advancedfm/advancedfm.pro +++ b/noncore/apps/advancedfm/advancedfm.pro | |||
@@ -4,13 +4,13 @@ HEADERS = advancedfm.h inputDialog.h filePermissions.h output.h | |||
4 | SOURCES = advancedfm.cpp advancedfmData.cpp advancedfmMenu.cpp inputDialog.cpp filePermissions.cpp output.cpp main.cpp | 4 | SOURCES = advancedfm.cpp advancedfmData.cpp advancedfmMenu.cpp inputDialog.cpp filePermissions.cpp output.cpp main.cpp |
5 | TARGET = advancedfm | 5 | TARGET = advancedfm |
6 | REQUIRES=medium-config | 6 | REQUIRES=medium-config |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include | 8 | DEPENDPATH += $(OPIEDIR)/include |
9 | DESTDIR = $(OPIEDIR)/bin | 9 | DESTDIR = $(OPIEDIR)/bin |
10 | LIBS += -lqpe | 10 | LIBS += -lqpe -lopie |
11 | 11 | ||
12 | TRANSLATIONS = ../../../i18n/de/advancedfm.ts \ | 12 | TRANSLATIONS = ../../../i18n/de/advancedfm.ts \ |
13 | ../../../i18n/en/advancedfm.ts \ | 13 | ../../../i18n/en/advancedfm.ts \ |
14 | ../../../i18n/es/advancedfm.ts \ | 14 | ../../../i18n/es/advancedfm.ts \ |
15 | ../../../i18n/fr/advancedfm.ts \ | 15 | ../../../i18n/fr/advancedfm.ts \ |
16 | ../../../i18n/hu/advancedfm.ts \ | 16 | ../../../i18n/hu/advancedfm.ts \ |
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index 619a7a9..7188640 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp | |||
@@ -8,24 +8,24 @@ | |||
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | ***************************************************************************/ | 11 | ***************************************************************************/ |
12 | #include "advancedfm.h" | 12 | #include "advancedfm.h" |
13 | 13 | ||
14 | #include <opie/otabwidget.h> | ||
14 | #include <qpe/qpeapplication.h> | 15 | #include <qpe/qpeapplication.h> |
15 | #include <qpe/qpemenubar.h> | 16 | #include <qpe/qpemenubar.h> |
16 | #include <qpe/qpetoolbar.h> | 17 | #include <qpe/qpetoolbar.h> |
17 | #include <qpe/resource.h> | 18 | #include <qpe/resource.h> |
18 | 19 | ||
19 | #include <qlayout.h> | 20 | #include <qlayout.h> |
20 | #include <qpixmap.h> | 21 | #include <qpixmap.h> |
21 | #include <qcombobox.h> | 22 | #include <qcombobox.h> |
22 | #include <qpopupmenu.h> | 23 | #include <qpopupmenu.h> |
23 | #include <qtabwidget.h> | 24 | #include <qtabwidget.h> |
24 | #include <qtoolbutton.h> | 25 | #include <qtoolbutton.h> |
25 | #include <qtabwidget.h> | ||
26 | #include <qlineedit.h> | 26 | #include <qlineedit.h> |
27 | #include <qlistview.h> | 27 | #include <qlistview.h> |
28 | 28 | ||
29 | #include <sys/utsname.h> | 29 | #include <sys/utsname.h> |
30 | 30 | ||
31 | 31 | ||
@@ -105,13 +105,14 @@ void AdvancedFm::init() { | |||
105 | 105 | ||
106 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 106 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
107 | 107 | ||
108 | layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7); | 108 | layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7); |
109 | 109 | ||
110 | 110 | ||
111 | TabWidget = new QTabWidget( this, "TabWidget" ); | 111 | TabWidget = new OTabWidget( this, "TabWidget",/* OTabWidget::Global | */OTabWidget::IconTab); |
112 | // TabWidget = new QTabWidget( this, "TabWidget" ); | ||
112 | layout->addMultiCellWidget( TabWidget, 2, 2, 0, 7); | 113 | layout->addMultiCellWidget( TabWidget, 2, 2, 0, 7); |
113 | 114 | ||
114 | tab = new QWidget( TabWidget, "tab" ); | 115 | tab = new QWidget( TabWidget, "tab" ); |
115 | tabLayout = new QGridLayout( tab ); | 116 | tabLayout = new QGridLayout( tab ); |
116 | tabLayout->setSpacing( 2); | 117 | tabLayout->setSpacing( 2); |
117 | tabLayout->setMargin( 2); | 118 | tabLayout->setMargin( 2); |
@@ -127,13 +128,14 @@ void AdvancedFm::init() { | |||
127 | Local_View->setSelectionMode(QListView::Extended); | 128 | Local_View->setSelectionMode(QListView::Extended); |
128 | 129 | ||
129 | QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); | 130 | QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); |
130 | 131 | ||
131 | tabLayout->addWidget( Local_View, 0, 0 ); | 132 | tabLayout->addWidget( Local_View, 0, 0 ); |
132 | 133 | ||
133 | TabWidget->insertTab( tab, tr("1")); | 134 | TabWidget->addTab( tab,"advancedfm/smFileBrowser.png", tr("1")); |
135 | // TabWidget->insertTab( tab, tr("1")); | ||
134 | 136 | ||
135 | tab_2 = new QWidget( TabWidget, "tab_2" ); | 137 | tab_2 = new QWidget( TabWidget, "tab_2" ); |
136 | tabLayout_2 = new QGridLayout( tab_2 ); | 138 | tabLayout_2 = new QGridLayout( tab_2 ); |
137 | tabLayout_2->setSpacing( 2); | 139 | tabLayout_2->setSpacing( 2); |
138 | tabLayout_2->setMargin( 2); | 140 | tabLayout_2->setMargin( 2); |
139 | 141 | ||
@@ -149,14 +151,14 @@ void AdvancedFm::init() { | |||
149 | 151 | ||
150 | 152 | ||
151 | QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); | 153 | QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); |
152 | 154 | ||
153 | tabLayout_2->addWidget( Remote_View, 0, 0 ); | 155 | tabLayout_2->addWidget( Remote_View, 0, 0 ); |
154 | 156 | ||
155 | 157 | TabWidget->addTab( tab_2, "advancedfm/smFileBrowser.png",tr( "2")); | |
156 | TabWidget->insertTab( tab_2, tr( "2")); | 158 | // TabWidget->insertTab( tab_2, tr( "2")); |
157 | 159 | ||
158 | /* tab_3 = new QWidget( TabWidget, "tab_3" ); | 160 | /* tab_3 = new QWidget( TabWidget, "tab_3" ); |
159 | tabLayout_3 = new QGridLayout( tab_3 ); | 161 | tabLayout_3 = new QGridLayout( tab_3 ); |
160 | tabLayout_3->setSpacing( 2); | 162 | tabLayout_3->setSpacing( 2); |
161 | tabLayout_3->setMargin( 2); | 163 | tabLayout_3->setMargin( 2); |
162 | 164 | ||
@@ -196,13 +198,13 @@ void AdvancedFm::init() { | |||
196 | currentRemoteDir.setPath( QDir::currentDirPath()); | 198 | currentRemoteDir.setPath( QDir::currentDirPath()); |
197 | 199 | ||
198 | b = TRUE; | 200 | b = TRUE; |
199 | 201 | ||
200 | filterStr="*"; | 202 | filterStr="*"; |
201 | b=FALSE; | 203 | b=FALSE; |
202 | 204 | TabWidget->setCurrentTab(0); | |
203 | 205 | ||
204 | } | 206 | } |
205 | 207 | ||
206 | void AdvancedFm::initConnections() { | 208 | void AdvancedFm::initConnections() { |
207 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 209 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
208 | connect( qpeDirButton ,SIGNAL(released()),this,SLOT( QPEButtonPushed()) ); | 210 | connect( qpeDirButton ,SIGNAL(released()),this,SLOT( QPEButtonPushed()) ); |
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 5fa8d0c..27a119f 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -11,12 +11,14 @@ | |||
11 | ***************************************************************************/ | 11 | ***************************************************************************/ |
12 | #include "advancedfm.h" | 12 | #include "advancedfm.h" |
13 | #include "inputDialog.h" | 13 | #include "inputDialog.h" |
14 | #include "output.h" | 14 | #include "output.h" |
15 | #include "filePermissions.h" | 15 | #include "filePermissions.h" |
16 | 16 | ||
17 | #include <opie/otabwidget.h> | ||
18 | |||
17 | #include <qpe/lnkproperties.h> | 19 | #include <qpe/lnkproperties.h> |
18 | #include <qpe/qpeapplication.h> | 20 | #include <qpe/qpeapplication.h> |
19 | #include <qpe/qpemenubar.h> | 21 | #include <qpe/qpemenubar.h> |
20 | #include <qpe/qpetoolbar.h> | 22 | #include <qpe/qpetoolbar.h> |
21 | #include <qpe/resource.h> | 23 | #include <qpe/resource.h> |
22 | #include <qpe/qcopenvelope_qws.h> | 24 | #include <qpe/qcopenvelope_qws.h> |
@@ -50,29 +52,43 @@ void AdvancedFm::doLocalCd() { | |||
50 | 52 | ||
51 | void AdvancedFm::doRemoteCd() { | 53 | void AdvancedFm::doRemoteCd() { |
52 | localListClicked( Remote_View->currentItem()); | 54 | localListClicked( Remote_View->currentItem()); |
53 | } | 55 | } |
54 | 56 | ||
55 | void AdvancedFm::showMenuHidden() { | 57 | void AdvancedFm::showMenuHidden() { |
56 | if(TabWidget->currentPageIndex() == 0) | 58 | if (b) { |
57 | showHidden(); | 59 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
58 | else | 60 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
59 | showRemoteHidden(); | 61 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
62 | // b=FALSE; | ||
63 | |||
64 | } else { | ||
65 | currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | ||
66 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | ||
67 | fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); | ||
68 | // b=TRUE; | ||
69 | } | ||
70 | populateLocalView(); | ||
71 | populateRemoteView(); | ||
72 | // if(TabWidget->getCurrentTab() == 0) | ||
73 | // showHidden(); | ||
74 | // else | ||
75 | // showRemoteHidden(); | ||
60 | // if(b) qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<< true"); | 76 | // if(b) qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<< true"); |
61 | if(b) b = false; else b = true; | 77 | if(b) b = false; else b = true; |
62 | } | 78 | } |
63 | 79 | ||
64 | void AdvancedFm::showHidden() { | 80 | void AdvancedFm::showHidden() { |
65 | if (b) { | 81 | if (b) { |
66 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 82 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
67 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 83 | // fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
68 | // b=FALSE; | 84 | // b=FALSE; |
69 | 85 | ||
70 | } else { | 86 | } else { |
71 | currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 87 | currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
72 | fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); | 88 | // fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); |
73 | // b=TRUE; | 89 | // b=TRUE; |
74 | } | 90 | } |
75 | populateLocalView(); | 91 | populateLocalView(); |
76 | } | 92 | } |
77 | 93 | ||
78 | void AdvancedFm::showRemoteHidden() { | 94 | void AdvancedFm::showRemoteHidden() { |
@@ -86,13 +102,13 @@ void AdvancedFm::showRemoteHidden() { | |||
86 | } | 102 | } |
87 | populateRemoteView(); | 103 | populateRemoteView(); |
88 | } | 104 | } |
89 | 105 | ||
90 | void AdvancedFm::runThis() { | 106 | void AdvancedFm::runThis() { |
91 | QString fs; | 107 | QString fs; |
92 | if (TabWidget->currentPageIndex() == 0) { | 108 | if (TabWidget->getCurrentTab() == 0) { |
93 | QString curFile = Local_View->currentItem()->text(0); | 109 | QString curFile = Local_View->currentItem()->text(0); |
94 | if(curFile != "../") { | 110 | if(curFile != "../") { |
95 | 111 | ||
96 | fs= getFileSystemType((const QString &) currentDir.canonicalPath()); | 112 | fs= getFileSystemType((const QString &) currentDir.canonicalPath()); |
97 | QFileInfo fileInfo( currentDir.canonicalPath()+"/"+curFile); | 113 | QFileInfo fileInfo( currentDir.canonicalPath()+"/"+curFile); |
98 | qDebug( fileInfo.owner()); | 114 | qDebug( fileInfo.owner()); |
@@ -138,13 +154,13 @@ void AdvancedFm::runThis() { | |||
138 | } | 154 | } |
139 | } | 155 | } |
140 | } | 156 | } |
141 | } | 157 | } |
142 | 158 | ||
143 | void AdvancedFm::runText() { | 159 | void AdvancedFm::runText() { |
144 | if (TabWidget->currentPageIndex() == 0) { | 160 | if (TabWidget->getCurrentTab() == 0) { |
145 | QString curFile = Local_View->currentItem()->text(0); | 161 | QString curFile = Local_View->currentItem()->text(0); |
146 | if(curFile != "../") { | 162 | if(curFile != "../") { |
147 | curFile = currentDir.canonicalPath()+"/"+curFile; | 163 | curFile = currentDir.canonicalPath()+"/"+curFile; |
148 | QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); | 164 | QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); |
149 | e << curFile; | 165 | e << curFile; |
150 | } | 166 | } |
@@ -320,13 +336,13 @@ void AdvancedFm::remoteRename() | |||
320 | 336 | ||
321 | void AdvancedFm::filePerms() { | 337 | void AdvancedFm::filePerms() { |
322 | 338 | ||
323 | QStringList curFileList = getPath(); | 339 | QStringList curFileList = getPath(); |
324 | QString filePath; | 340 | QString filePath; |
325 | 341 | ||
326 | if (TabWidget->currentPageIndex() == 0) { | 342 | if (TabWidget->getCurrentTab() == 0) { |
327 | filePath = currentDir.canonicalPath()+"/"; | 343 | filePath = currentDir.canonicalPath()+"/"; |
328 | } else { | 344 | } else { |
329 | filePath= currentRemoteDir.canonicalPath()+"/"; | 345 | filePath= currentRemoteDir.canonicalPath()+"/"; |
330 | } | 346 | } |
331 | 347 | ||
332 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 348 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
@@ -334,26 +350,26 @@ void AdvancedFm::filePerms() { | |||
334 | filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)(filePath+*it)); | 350 | filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)(filePath+*it)); |
335 | filePerm->showMaximized(); | 351 | filePerm->showMaximized(); |
336 | filePerm->exec(); | 352 | filePerm->exec(); |
337 | if( filePerm) | 353 | if( filePerm) |
338 | delete filePerm; | 354 | delete filePerm; |
339 | } | 355 | } |
340 | if (TabWidget->currentPageIndex() == 0) { | 356 | if (TabWidget->getCurrentTab() == 0) { |
341 | populateLocalView(); | 357 | populateLocalView(); |
342 | } else { | 358 | } else { |
343 | populateRemoteView(); | 359 | populateRemoteView(); |
344 | } | 360 | } |
345 | } | 361 | } |
346 | 362 | ||
347 | void AdvancedFm::doProperties() { | 363 | void AdvancedFm::doProperties() { |
348 | #if defined(QT_QWS_OPIE) | 364 | #if defined(QT_QWS_OPIE) |
349 | 365 | ||
350 | QStringList curFileList = getPath(); | 366 | QStringList curFileList = getPath(); |
351 | 367 | ||
352 | QString filePath; | 368 | QString filePath; |
353 | if (TabWidget->currentPageIndex() == 0) { | 369 | if (TabWidget->getCurrentTab() == 0) { |
354 | filePath = currentDir.canonicalPath()+"/"; | 370 | filePath = currentDir.canonicalPath()+"/"; |
355 | } else { | 371 | } else { |
356 | filePath= currentRemoteDir.canonicalPath()+"/"; | 372 | filePath= currentRemoteDir.canonicalPath()+"/"; |
357 | } | 373 | } |
358 | qDebug("%d",curFileList.count()); | 374 | qDebug("%d",curFileList.count()); |
359 | 375 | ||
@@ -366,13 +382,13 @@ void AdvancedFm::doProperties() { | |||
366 | } | 382 | } |
367 | #endif | 383 | #endif |
368 | 384 | ||
369 | } | 385 | } |
370 | 386 | ||
371 | void AdvancedFm::upDir() { | 387 | void AdvancedFm::upDir() { |
372 | if (TabWidget->currentPageIndex() == 0) { | 388 | if (TabWidget->getCurrentTab() == 0) { |
373 | QString current = currentDir.canonicalPath(); | 389 | QString current = currentDir.canonicalPath(); |
374 | QDir dir(current); | 390 | QDir dir(current); |
375 | dir.cdUp(); | 391 | dir.cdUp(); |
376 | current = dir.canonicalPath(); | 392 | current = dir.canonicalPath(); |
377 | chdir( current.latin1() ); | 393 | chdir( current.latin1() ); |
378 | currentDir.cd( current, TRUE); | 394 | currentDir.cd( current, TRUE); |
@@ -392,13 +408,13 @@ void AdvancedFm::upDir() { | |||
392 | 408 | ||
393 | void AdvancedFm::copy() { | 409 | void AdvancedFm::copy() { |
394 | qApp->processEvents(); | 410 | qApp->processEvents(); |
395 | QStringList curFileList = getPath(); | 411 | QStringList curFileList = getPath(); |
396 | if( curFileList.count() > 0) { | 412 | if( curFileList.count() > 0) { |
397 | QString curFile, item, destFile; | 413 | QString curFile, item, destFile; |
398 | if (TabWidget->currentPageIndex() == 0) { | 414 | if (TabWidget->getCurrentTab() == 0) { |
399 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 415 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
400 | item=(*it); | 416 | item=(*it); |
401 | 417 | ||
402 | if(item.find("->",0,TRUE)) //symlink | 418 | if(item.find("->",0,TRUE)) //symlink |
403 | item = item.left(item.find("->",0,TRUE)); | 419 | item = item.left(item.find("->",0,TRUE)); |
404 | 420 | ||
@@ -424,13 +440,13 @@ void AdvancedFm::copy() { | |||
424 | if(!copyFile(destFile, curFile) ) { | 440 | if(!copyFile(destFile, curFile) ) { |
425 | QMessageBox::message("AdvancedFm","Could not copy\n"+curFile +"to\n"+destFile); | 441 | QMessageBox::message("AdvancedFm","Could not copy\n"+curFile +"to\n"+destFile); |
426 | return; | 442 | return; |
427 | } | 443 | } |
428 | } | 444 | } |
429 | populateRemoteView(); | 445 | populateRemoteView(); |
430 | TabWidget->setCurrentPage(1); | 446 | TabWidget->setCurrentTab(1); |
431 | 447 | ||
432 | } else { | 448 | } else { |
433 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 449 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
434 | item= (*it); | 450 | item= (*it); |
435 | 451 | ||
436 | if(item.find("->",0,TRUE)) //symlink | 452 | if(item.find("->",0,TRUE)) //symlink |
@@ -460,25 +476,25 @@ void AdvancedFm::copy() { | |||
460 | +curFile +tr("to\n")+destFile); | 476 | +curFile +tr("to\n")+destFile); |
461 | return; | 477 | return; |
462 | 478 | ||
463 | } | 479 | } |
464 | } | 480 | } |
465 | populateLocalView(); | 481 | populateLocalView(); |
466 | TabWidget->setCurrentPage(0); | 482 | TabWidget->setCurrentTab(0); |
467 | } | 483 | } |
468 | 484 | ||
469 | } | 485 | } |
470 | } | 486 | } |
471 | 487 | ||
472 | void AdvancedFm::copyAs() { | 488 | void AdvancedFm::copyAs() { |
473 | qApp->processEvents(); | 489 | qApp->processEvents(); |
474 | 490 | ||
475 | QStringList curFileList = getPath(); | 491 | QStringList curFileList = getPath(); |
476 | QString curFile; | 492 | QString curFile; |
477 | InputDialog *fileDlg; | 493 | InputDialog *fileDlg; |
478 | if (TabWidget->currentPageIndex() == 0) { | 494 | if (TabWidget->getCurrentTab() == 0) { |
479 | qDebug("tab 1"); | 495 | qDebug("tab 1"); |
480 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 496 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
481 | QString destFile; | 497 | QString destFile; |
482 | curFile = currentDir.canonicalPath()+"/"+(*it); | 498 | curFile = currentDir.canonicalPath()+"/"+(*it); |
483 | fileDlg = new InputDialog( this,tr("Copy "+curFile+" As"), TRUE, 0); | 499 | fileDlg = new InputDialog( this,tr("Copy "+curFile+" As"), TRUE, 0); |
484 | 500 | ||
@@ -509,13 +525,13 @@ void AdvancedFm::copyAs() { | |||
509 | } | 525 | } |
510 | } | 526 | } |
511 | delete fileDlg; | 527 | delete fileDlg; |
512 | 528 | ||
513 | } | 529 | } |
514 | populateRemoteView(); | 530 | populateRemoteView(); |
515 | TabWidget->setCurrentPage(1); | 531 | TabWidget->setCurrentTab(1); |
516 | 532 | ||
517 | } else { | 533 | } else { |
518 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 534 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
519 | 535 | ||
520 | curFile = currentRemoteDir.canonicalPath()+"/"+(*it); | 536 | curFile = currentRemoteDir.canonicalPath()+"/"+(*it); |
521 | fileDlg = new InputDialog( this,tr("Copy "+curFile+" As"), TRUE, 0); | 537 | fileDlg = new InputDialog( this,tr("Copy "+curFile+" As"), TRUE, 0); |
@@ -549,23 +565,23 @@ void AdvancedFm::copyAs() { | |||
549 | 565 | ||
550 | } | 566 | } |
551 | delete fileDlg; | 567 | delete fileDlg; |
552 | 568 | ||
553 | } | 569 | } |
554 | populateLocalView(); | 570 | populateLocalView(); |
555 | TabWidget->setCurrentPage(0); | 571 | TabWidget->setCurrentTab(0); |
556 | } | 572 | } |
557 | } | 573 | } |
558 | 574 | ||
559 | void AdvancedFm::copySameDir() { | 575 | void AdvancedFm::copySameDir() { |
560 | qApp->processEvents(); | 576 | qApp->processEvents(); |
561 | QStringList curFileList = getPath(); | 577 | QStringList curFileList = getPath(); |
562 | QString curFile, item, destFile; | 578 | QString curFile, item, destFile; |
563 | InputDialog *fileDlg; | 579 | InputDialog *fileDlg; |
564 | 580 | ||
565 | if (TabWidget->currentPageIndex() == 0) { | 581 | if (TabWidget->getCurrentTab() == 0) { |
566 | 582 | ||
567 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 583 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
568 | item=(*it); | 584 | item=(*it); |
569 | curFile = currentDir.canonicalPath()+"/"+ item; | 585 | curFile = currentDir.canonicalPath()+"/"+ item; |
570 | 586 | ||
571 | fileDlg = new InputDialog(this,tr("Copy ")+curFile+tr(" As"),TRUE, 0); | 587 | fileDlg = new InputDialog(this,tr("Copy ")+curFile+tr(" As"),TRUE, 0); |
@@ -646,13 +662,13 @@ void AdvancedFm::move() { | |||
646 | qApp->processEvents(); | 662 | qApp->processEvents(); |
647 | 663 | ||
648 | QStringList curFileList = getPath(); | 664 | QStringList curFileList = getPath(); |
649 | if( curFileList.count() > 0) { | 665 | if( curFileList.count() > 0) { |
650 | QString curFile, destFile, item; | 666 | QString curFile, destFile, item; |
651 | 667 | ||
652 | if (TabWidget->currentPageIndex() == 0) { | 668 | if (TabWidget->getCurrentTab() == 0) { |
653 | 669 | ||
654 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 670 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
655 | item=(*it); | 671 | item=(*it); |
656 | QString destFile = currentRemoteDir.canonicalPath(); | 672 | QString destFile = currentRemoteDir.canonicalPath(); |
657 | 673 | ||
658 | if(destFile.right(1).find("/",0,TRUE) == -1) | 674 | if(destFile.right(1).find("/",0,TRUE) == -1) |
@@ -675,13 +691,13 @@ void AdvancedFm::move() { | |||
675 | return; | 691 | return; |
676 | } else | 692 | } else |
677 | QFile::remove(curFile); | 693 | QFile::remove(curFile); |
678 | } | 694 | } |
679 | } | 695 | } |
680 | 696 | ||
681 | TabWidget->setCurrentPage(1); | 697 | TabWidget->setCurrentTab(1); |
682 | 698 | ||
683 | } else { //view 2 | 699 | } else { //view 2 |
684 | 700 | ||
685 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 701 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
686 | item = (*it); | 702 | item = (*it); |
687 | QString destFile = currentDir.canonicalPath(); | 703 | QString destFile = currentDir.canonicalPath(); |
@@ -705,13 +721,13 @@ void AdvancedFm::move() { | |||
705 | if(!copyFile( destFile, curFile) ) { | 721 | if(!copyFile( destFile, curFile) ) { |
706 | QMessageBox::message(tr("Note"),tr("Could not move\n") + curFile); | 722 | QMessageBox::message(tr("Note"),tr("Could not move\n") + curFile); |
707 | return; | 723 | return; |
708 | } else | 724 | } else |
709 | QFile::remove( curFile); | 725 | QFile::remove( curFile); |
710 | } | 726 | } |
711 | TabWidget->setCurrentPage(0); | 727 | TabWidget->setCurrentTab(0); |
712 | } | 728 | } |
713 | } | 729 | } |
714 | populateRemoteView(); | 730 | populateRemoteView(); |
715 | populateLocalView(); | 731 | populateLocalView(); |
716 | } | 732 | } |
717 | } | 733 | } |
@@ -746,13 +762,13 @@ bool AdvancedFm::copyFile( const QString & dest, const QString & src ) { | |||
746 | 762 | ||
747 | return success; | 763 | return success; |
748 | } | 764 | } |
749 | 765 | ||
750 | void AdvancedFm::runCommand() { | 766 | void AdvancedFm::runCommand() { |
751 | QString curFile; | 767 | QString curFile; |
752 | if (TabWidget->currentPageIndex() == 0) { | 768 | if (TabWidget->getCurrentTab() == 0) { |
753 | if( Local_View->currentItem()) | 769 | if( Local_View->currentItem()) |
754 | curFile = currentDir.canonicalPath() +"/"+ Local_View->currentItem()->text(0); | 770 | curFile = currentDir.canonicalPath() +"/"+ Local_View->currentItem()->text(0); |
755 | } else { | 771 | } else { |
756 | if(Remote_View->currentItem()) | 772 | if(Remote_View->currentItem()) |
757 | curFile = currentRemoteDir.canonicalPath() + "/"+Remote_View->currentItem()->text(0); | 773 | curFile = currentRemoteDir.canonicalPath() + "/"+Remote_View->currentItem()->text(0); |
758 | } | 774 | } |
@@ -792,13 +808,13 @@ void AdvancedFm::runCommand() { | |||
792 | 808 | ||
793 | } | 809 | } |
794 | } | 810 | } |
795 | 811 | ||
796 | void AdvancedFm::runCommandStd() { | 812 | void AdvancedFm::runCommandStd() { |
797 | QString curFile; | 813 | QString curFile; |
798 | if (TabWidget->currentPageIndex() == 0) { | 814 | if (TabWidget->getCurrentTab() == 0) { |
799 | if( Local_View->currentItem()) | 815 | if( Local_View->currentItem()) |
800 | curFile = currentDir.canonicalPath() +"/"+ Local_View->currentItem()->text(0); | 816 | curFile = currentDir.canonicalPath() +"/"+ Local_View->currentItem()->text(0); |
801 | } else { | 817 | } else { |
802 | if(Remote_View->currentItem()) | 818 | if(Remote_View->currentItem()) |
803 | curFile = currentRemoteDir.canonicalPath() +"/" | 819 | curFile = currentRemoteDir.canonicalPath() +"/" |
804 | + Remote_View->currentItem()->text(0); | 820 | + Remote_View->currentItem()->text(0); |
@@ -815,13 +831,13 @@ void AdvancedFm::runCommandStd() { | |||
815 | system(command.latin1()); | 831 | system(command.latin1()); |
816 | } | 832 | } |
817 | } | 833 | } |
818 | 834 | ||
819 | void AdvancedFm::fileStatus() { | 835 | void AdvancedFm::fileStatus() { |
820 | QString curFile; | 836 | QString curFile; |
821 | if (TabWidget->currentPageIndex() == 0) { | 837 | if (TabWidget->getCurrentTab() == 0) { |
822 | curFile = Local_View->currentItem()->text(0); | 838 | curFile = Local_View->currentItem()->text(0); |
823 | } else { | 839 | } else { |
824 | curFile = Remote_View->currentItem()->text(0); | 840 | curFile = Remote_View->currentItem()->text(0); |
825 | } | 841 | } |
826 | QString command = " stat -l "+ curFile +" 2>&1"; | 842 | QString command = " stat -l "+ curFile +" 2>&1"; |
827 | Output *outDlg; | 843 | Output *outDlg; |
@@ -847,52 +863,52 @@ void AdvancedFm::fileStatus() { | |||
847 | 863 | ||
848 | } | 864 | } |
849 | pclose(fp); | 865 | pclose(fp); |
850 | } | 866 | } |
851 | 867 | ||
852 | void AdvancedFm::mkDir() { | 868 | void AdvancedFm::mkDir() { |
853 | if (TabWidget->currentPageIndex() == 0) | 869 | if (TabWidget->getCurrentTab() == 0) |
854 | localMakDir(); | 870 | localMakDir(); |
855 | else | 871 | else |
856 | remoteMakDir(); | 872 | remoteMakDir(); |
857 | 873 | ||
858 | } | 874 | } |
859 | 875 | ||
860 | void AdvancedFm::rn() { | 876 | void AdvancedFm::rn() { |
861 | if (TabWidget->currentPageIndex() == 0) | 877 | if (TabWidget->getCurrentTab() == 0) |
862 | localRename(); | 878 | localRename(); |
863 | else | 879 | else |
864 | remoteRename(); | 880 | remoteRename(); |
865 | 881 | ||
866 | } | 882 | } |
867 | 883 | ||
868 | void AdvancedFm::del() { | 884 | void AdvancedFm::del() { |
869 | if (TabWidget->currentPageIndex() == 0) | 885 | if (TabWidget->getCurrentTab() == 0) |
870 | localDelete(); | 886 | localDelete(); |
871 | else | 887 | else |
872 | remoteDelete(); | 888 | remoteDelete(); |
873 | } | 889 | } |
874 | 890 | ||
875 | void AdvancedFm::mkSym() { | 891 | void AdvancedFm::mkSym() { |
876 | QString cmd; | 892 | QString cmd; |
877 | QStringList curFileList = getPath(); | 893 | QStringList curFileList = getPath(); |
878 | if( curFileList.count() > 0) { | 894 | if( curFileList.count() > 0) { |
879 | 895 | ||
880 | if (TabWidget->currentPageIndex() == 0) { | 896 | if (TabWidget->getCurrentTab() == 0) { |
881 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 897 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
882 | 898 | ||
883 | QString destName = currentRemoteDir.canonicalPath()+"/"+(*it); | 899 | QString destName = currentRemoteDir.canonicalPath()+"/"+(*it); |
884 | if(destName.right(1) == "/") destName = destName.left( destName.length() -1); | 900 | if(destName.right(1) == "/") destName = destName.left( destName.length() -1); |
885 | QString curFile = currentDir.canonicalPath()+"/"+(*it); | 901 | QString curFile = currentDir.canonicalPath()+"/"+(*it); |
886 | if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1); | 902 | if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1); |
887 | cmd = "ln -s "+curFile+" "+destName; | 903 | cmd = "ln -s "+curFile+" "+destName; |
888 | qDebug(cmd); | 904 | qDebug(cmd); |
889 | system(cmd.latin1() ); | 905 | system(cmd.latin1() ); |
890 | } | 906 | } |
891 | populateRemoteView(); | 907 | populateRemoteView(); |
892 | TabWidget->setCurrentPage(1); | 908 | TabWidget->setCurrentTab(1); |
893 | } else { | 909 | } else { |
894 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 910 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
895 | 911 | ||
896 | QString destName = currentDir.canonicalPath()+"/"+(*it); | 912 | QString destName = currentDir.canonicalPath()+"/"+(*it); |
897 | if(destName.right(1) == "/") destName = destName.left( destName.length() -1); | 913 | if(destName.right(1) == "/") destName = destName.left( destName.length() -1); |
898 | QString curFile = currentRemoteDir.canonicalPath()+"/"+(*it); | 914 | QString curFile = currentRemoteDir.canonicalPath()+"/"+(*it); |
@@ -900,26 +916,26 @@ void AdvancedFm::mkSym() { | |||
900 | 916 | ||
901 | cmd = "ln -s "+curFile+" "+destName; | 917 | cmd = "ln -s "+curFile+" "+destName; |
902 | qDebug(cmd); | 918 | qDebug(cmd); |
903 | system(cmd.latin1() ); | 919 | system(cmd.latin1() ); |
904 | } | 920 | } |
905 | populateLocalView(); | 921 | populateLocalView(); |
906 | TabWidget->setCurrentPage(0); | 922 | TabWidget->setCurrentTab(0); |
907 | } | 923 | } |
908 | } | 924 | } |
909 | } | 925 | } |
910 | 926 | ||
911 | void AdvancedFm::doBeam() { | 927 | void AdvancedFm::doBeam() { |
912 | Ir ir; | 928 | Ir ir; |
913 | if(!ir.supported()){ | 929 | if(!ir.supported()){ |
914 | } else { | 930 | } else { |
915 | 931 | ||
916 | QStringList curFileList = getPath(); | 932 | QStringList curFileList = getPath(); |
917 | if( curFileList.count() > 0) { | 933 | if( curFileList.count() > 0) { |
918 | 934 | ||
919 | if (TabWidget->currentPageIndex() == 0) { | 935 | if (TabWidget->getCurrentTab() == 0) { |
920 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 936 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
921 | 937 | ||
922 | QString curFile = currentDir.canonicalPath()+"/"+(*it); | 938 | QString curFile = currentDir.canonicalPath()+"/"+(*it); |
923 | if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1); | 939 | if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1); |
924 | Ir *file = new Ir(this, "IR"); | 940 | Ir *file = new Ir(this, "IR"); |
925 | connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * ))); | 941 | connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * ))); |