summaryrefslogtreecommitdiff
path: root/noncore/apps/advancedfm/advancedfmMenu.cpp
Unidiff
Diffstat (limited to 'noncore/apps/advancedfm/advancedfmMenu.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp80
1 files changed, 48 insertions, 32 deletions
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
@@ -14,6 +14,8 @@
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>
@@ -53,10 +55,24 @@ void AdvancedFm::doRemoteCd() {
53} 55}
54 56
55void AdvancedFm::showMenuHidden() { 57void 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}
@@ -64,12 +80,12 @@ void AdvancedFm::showMenuHidden() {
64void AdvancedFm::showHidden() { 80void 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();
@@ -89,7 +105,7 @@ void AdvancedFm::showRemoteHidden() {
89 105
90void AdvancedFm::runThis() { 106void 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
@@ -141,7 +157,7 @@ void AdvancedFm::runThis() {
141} 157}
142 158
143void AdvancedFm::runText() { 159void 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;
@@ -323,7 +339,7 @@ void AdvancedFm::filePerms() {
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()+"/";
@@ -337,7 +353,7 @@ void AdvancedFm::filePerms() {
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();
@@ -350,7 +366,7 @@ void AdvancedFm::doProperties() {
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()+"/";
@@ -369,7 +385,7 @@ void AdvancedFm::doProperties() {
369} 385}
370 386
371void AdvancedFm::upDir() { 387void 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();
@@ -395,7 +411,7 @@ void AdvancedFm::copy() {
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
@@ -427,7 +443,7 @@ void AdvancedFm::copy() {
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 ) {
@@ -463,7 +479,7 @@ void AdvancedFm::copy() {
463 } 479 }
464 } 480 }
465 populateLocalView(); 481 populateLocalView();
466 TabWidget->setCurrentPage(0); 482 TabWidget->setCurrentTab(0);
467 } 483 }
468 484
469 } 485 }
@@ -475,7 +491,7 @@ void AdvancedFm::copyAs() {
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;
@@ -512,7 +528,7 @@ void AdvancedFm::copyAs() {
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 ) {
@@ -552,7 +568,7 @@ void AdvancedFm::copyAs() {
552 568
553 } 569 }
554 populateLocalView(); 570 populateLocalView();
555 TabWidget->setCurrentPage(0); 571 TabWidget->setCurrentTab(0);
556 } 572 }
557} 573}
558 574
@@ -562,7 +578,7 @@ void AdvancedFm::copySameDir() {
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);
@@ -649,7 +665,7 @@ void AdvancedFm::move() {
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);
@@ -678,7 +694,7 @@ void AdvancedFm::move() {
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
@@ -708,7 +724,7 @@ void AdvancedFm::move() {
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();
@@ -749,7 +765,7 @@ bool AdvancedFm::copyFile( const QString & dest, const QString & src ) {
749 765
750void AdvancedFm::runCommand() { 766void 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 {
@@ -795,7 +811,7 @@ void AdvancedFm::runCommand() {
795 811
796void AdvancedFm::runCommandStd() { 812void 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 {
@@ -818,7 +834,7 @@ void AdvancedFm::runCommandStd() {
818 834
819void AdvancedFm::fileStatus() { 835void 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);
@@ -850,7 +866,7 @@ void AdvancedFm::fileStatus() {
850} 866}
851 867
852void AdvancedFm::mkDir() { 868void AdvancedFm::mkDir() {
853 if (TabWidget->currentPageIndex() == 0) 869 if (TabWidget->getCurrentTab() == 0)
854 localMakDir(); 870 localMakDir();
855 else 871 else
856 remoteMakDir(); 872 remoteMakDir();
@@ -858,7 +874,7 @@ void AdvancedFm::mkDir() {
858} 874}
859 875
860void AdvancedFm::rn() { 876void AdvancedFm::rn() {
861 if (TabWidget->currentPageIndex() == 0) 877 if (TabWidget->getCurrentTab() == 0)
862 localRename(); 878 localRename();
863 else 879 else
864 remoteRename(); 880 remoteRename();
@@ -866,7 +882,7 @@ void AdvancedFm::rn() {
866} 882}
867 883
868void AdvancedFm::del() { 884void AdvancedFm::del() {
869 if (TabWidget->currentPageIndex() == 0) 885 if (TabWidget->getCurrentTab() == 0)
870 localDelete(); 886 localDelete();
871 else 887 else
872 remoteDelete(); 888 remoteDelete();
@@ -877,7 +893,7 @@ void AdvancedFm::mkSym() {
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);
@@ -889,7 +905,7 @@ void AdvancedFm::mkSym() {
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
@@ -903,7 +919,7 @@ void AdvancedFm::mkSym() {
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}
@@ -916,7 +932,7 @@ void AdvancedFm::doBeam() {
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);