-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 29 | ||||
-rw-r--r-- | noncore/net/opieftp/opieftp.h | 6 |
2 files changed, 28 insertions, 7 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 @@ -445,5 +445,6 @@ bool OpieFtp::populateRemoteView() } tmp.close(); - } + } else + qDebug("temp file not opened successfullly"); return true; } @@ -541,4 +542,15 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) } +void OpieFtp::doLocalCd() +{ + localListClicked( Local_View->currentItem()); +} + +void OpieFtp:: doRemoteCd() +{ + remoteListClicked( Remote_View->currentItem()); + +} + void OpieFtp::showHidden() { @@ -562,5 +574,5 @@ void OpieFtp::ListPressed( int mouse, QListViewItem *item, const QPoint &point, break; case 2: - showLocalMenu(); + showLocalMenu(item); break; }; @@ -573,12 +585,15 @@ void OpieFtp::RemoteListPressed( int mouse, QListViewItem *item, const QPoint &p break; case 2: - showRemoteMenu(); + showRemoteMenu(item); break; }; } -void OpieFtp::showRemoteMenu() +void OpieFtp::showRemoteMenu(QListViewItem * item) { QPopupMenu m;// = new QPopupMenu( Local_View ); + if(item->text(0).right(1) == "/") + m.insertItem( tr( "Change Directory" ), this, SLOT( doRemoteCd() )); + else m.insertItem( tr( "Download" ), this, SLOT( remoteDownload() )); m.insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); @@ -589,8 +604,12 @@ void OpieFtp::showRemoteMenu() } -void OpieFtp::showLocalMenu() +void OpieFtp::showLocalMenu(QListViewItem * item) { QPopupMenu m; m.insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); + m.insertSeparator(); + if(item->text(0).right(1) == "/") + m.insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() )); + else m.insertItem( tr( "Upload" ), this, SLOT( localUpload() )); m.insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); 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 @@ -62,6 +62,8 @@ public: protected slots: - void showLocalMenu( ); - void showRemoteMenu( ); + void showLocalMenu( QListViewItem *); + void showRemoteMenu( QListViewItem *); + void doLocalCd(); + void doRemoteCd(); void localUpload(); void remoteDownload(); |