-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 37 | ||||
-rw-r--r-- | noncore/net/opieftp/opieftp.h | 6 |
2 files changed, 32 insertions, 11 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 523a36c..ed7f4bb 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp | |||
@@ -423,7 +423,7 @@ void OpieFtp::populateLocalView() | |||
423 | 423 | ||
424 | bool OpieFtp::populateRemoteView() | 424 | bool OpieFtp::populateRemoteView() |
425 | { | 425 | { |
426 | Remote_View->clear(); | 426 | Remote_View->clear(); |
427 | QFile tmp("./._temp"); | 427 | QFile tmp("./._temp"); |
428 | QString s, File_Name; | 428 | QString s, File_Name; |
429 | QString fileL, fileS, fileDate; | 429 | QString fileL, fileS, fileDate; |
@@ -444,7 +444,8 @@ bool OpieFtp::populateRemoteView() | |||
444 | new QListViewItem( Remote_View, fileL, fileS, fileDate); | 444 | new QListViewItem( Remote_View, fileL, fileS, fileDate); |
445 | } | 445 | } |
446 | tmp.close(); | 446 | tmp.close(); |
447 | } | 447 | } else |
448 | qDebug("temp file not opened successfullly"); | ||
448 | return true; | 449 | return true; |
449 | } | 450 | } |
450 | 451 | ||
@@ -504,7 +505,7 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) | |||
504 | QCopEnvelope ( "QPE/System", "notBusy()" ); | 505 | QCopEnvelope ( "QPE/System", "notBusy()" ); |
505 | } | 506 | } |
506 | 507 | ||
507 | void OpieFtp::localListClicked(QListViewItem *selectedItem) | 508 | void OpieFtp::localListClicked(QListViewItem *selectedItem) |
508 | { | 509 | { |
509 | QString strItem=selectedItem->text(0); | 510 | QString strItem=selectedItem->text(0); |
510 | QString strSize=selectedItem->text(1); | 511 | QString strSize=selectedItem->text(1); |
@@ -540,6 +541,17 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) | |||
540 | } | 541 | } |
541 | } | 542 | } |
542 | 543 | ||
544 | void OpieFtp::doLocalCd() | ||
545 | { | ||
546 | localListClicked( Local_View->currentItem()); | ||
547 | } | ||
548 | |||
549 | void OpieFtp:: doRemoteCd() | ||
550 | { | ||
551 | remoteListClicked( Remote_View->currentItem()); | ||
552 | |||
553 | } | ||
554 | |||
543 | void OpieFtp::showHidden() | 555 | void OpieFtp::showHidden() |
544 | { | 556 | { |
545 | if (!b) { | 557 | if (!b) { |
@@ -560,8 +572,8 @@ void OpieFtp::ListPressed( int mouse, QListViewItem *item, const QPoint &point, | |||
560 | switch (mouse) { | 572 | switch (mouse) { |
561 | case 1: | 573 | case 1: |
562 | break; | 574 | break; |
563 | case 2: | 575 | case 2: |
564 | showLocalMenu(); | 576 | showLocalMenu(item); |
565 | break; | 577 | break; |
566 | }; | 578 | }; |
567 | } | 579 | } |
@@ -571,15 +583,18 @@ void OpieFtp::RemoteListPressed( int mouse, QListViewItem *item, const QPoint &p | |||
571 | switch (mouse) { | 583 | switch (mouse) { |
572 | case 1: | 584 | case 1: |
573 | break; | 585 | break; |
574 | case 2: | 586 | case 2: |
575 | showRemoteMenu(); | 587 | showRemoteMenu(item); |
576 | break; | 588 | break; |
577 | }; | 589 | }; |
578 | } | 590 | } |
579 | 591 | ||
580 | void OpieFtp::showRemoteMenu() | 592 | void OpieFtp::showRemoteMenu(QListViewItem * item) |
581 | { | 593 | { |
582 | QPopupMenu m;// = new QPopupMenu( Local_View ); | 594 | QPopupMenu m;// = new QPopupMenu( Local_View ); |
595 | if(item->text(0).right(1) == "/") | ||
596 | m.insertItem( tr( "Change Directory" ), this, SLOT( doRemoteCd() )); | ||
597 | else | ||
583 | m.insertItem( tr( "Download" ), this, SLOT( remoteDownload() )); | 598 | m.insertItem( tr( "Download" ), this, SLOT( remoteDownload() )); |
584 | m.insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); | 599 | m.insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); |
585 | m.insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); | 600 | m.insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); |
@@ -588,10 +603,14 @@ void OpieFtp::showRemoteMenu() | |||
588 | m.exec( QCursor::pos() ); | 603 | m.exec( QCursor::pos() ); |
589 | } | 604 | } |
590 | 605 | ||
591 | void OpieFtp::showLocalMenu() | 606 | void OpieFtp::showLocalMenu(QListViewItem * item) |
592 | { | 607 | { |
593 | QPopupMenu m; | 608 | QPopupMenu m; |
594 | m.insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); | 609 | m.insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); |
610 | m.insertSeparator(); | ||
611 | if(item->text(0).right(1) == "/") | ||
612 | m.insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() )); | ||
613 | else | ||
595 | m.insertItem( tr( "Upload" ), this, SLOT( localUpload() )); | 614 | m.insertItem( tr( "Upload" ), this, SLOT( localUpload() )); |
596 | m.insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); | 615 | m.insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); |
597 | m.insertItem( tr( "Rename" ), this, SLOT( localRename() )); | 616 | m.insertItem( tr( "Rename" ), this, SLOT( localRename() )); |
diff --git a/noncore/net/opieftp/opieftp.h b/noncore/net/opieftp/opieftp.h index e00a398..5d1c63d 100644 --- a/noncore/net/opieftp/opieftp.h +++ b/noncore/net/opieftp/opieftp.h | |||
@@ -61,8 +61,10 @@ public: | |||
61 | bool b; | 61 | bool b; |
62 | 62 | ||
63 | protected slots: | 63 | protected slots: |
64 | void showLocalMenu( ); | 64 | void showLocalMenu( QListViewItem *); |
65 | void showRemoteMenu( ); | 65 | void showRemoteMenu( QListViewItem *); |
66 | void doLocalCd(); | ||
67 | void doRemoteCd(); | ||
66 | void localUpload(); | 68 | void localUpload(); |
67 | void remoteDownload(); | 69 | void remoteDownload(); |
68 | void newConnection(); | 70 | void newConnection(); |