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 /noncore/apps/advancedfm/advancedfmMenu.cpp | |
parent | 1a583682e8a49e65d5c478ab72dffb78d120c850 (diff) | |
download | opie-0535df00106c4e4c78e6ae8dde8f4f41f8487dae.zip opie-0535df00106c4e4c78e6ae8dde8f4f41f8487dae.tar.gz opie-0535df00106c4e4c78e6ae8dde8f4f41f8487dae.tar.bz2 |
converted to otab, and updated show hidden dir functions
Diffstat (limited to 'noncore/apps/advancedfm/advancedfmMenu.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 80 |
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 | |||
@@ -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 * ))); |