summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-03-16 15:16:58 (UTC)
committer llornkcor <llornkcor>2002-03-16 15:16:58 (UTC)
commit1d20ca78752b9da597950087438daa9ff8cb7951 (patch) (side-by-side diff)
tree5cce2048ba6cd8fd16e98bf9f4ab8c5ead4fe8b3
parent585373903040f7d283c8fef1841147739f0510d8 (diff)
downloadopie-1d20ca78752b9da597950087438daa9ff8cb7951.zip
opie-1d20ca78752b9da597950087438daa9ff8cb7951.tar.gz
opie-1d20ca78752b9da597950087438daa9ff8cb7951.tar.bz2
added cd to stylus hold, so user doesn't have to double click
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp29
-rw-r--r--noncore/net/opieftp/opieftp.h6
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
@@ -441,13 +441,14 @@ bool OpieFtp::populateRemoteView()
fileDate = s.mid( 42, 55-42);
fileDate = fileDate.stripWhiteSpace();
if(fileL.find("total",0,TRUE) == -1)
new QListViewItem( Remote_View, fileL, fileS, fileDate);
}
tmp.close();
- }
+ } else
+ qDebug("temp file not opened successfullly");
return true;
}
void OpieFtp::remoteListClicked(QListViewItem *selectedItem)
{
QCopEnvelope ( "QPE/System", "busy()" );
@@ -537,12 +538,23 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem)
}
} //end not symlink
chdir(strItem.latin1());
}
}
+void OpieFtp::doLocalCd()
+{
+ localListClicked( Local_View->currentItem());
+}
+
+void OpieFtp:: doRemoteCd()
+{
+ remoteListClicked( Remote_View->currentItem());
+
+}
+
void OpieFtp::showHidden()
{
if (!b) {
currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
b=TRUE;
@@ -558,43 +570,50 @@ void OpieFtp::showHidden()
void OpieFtp::ListPressed( int mouse, QListViewItem *item, const QPoint &point, int i)
{
switch (mouse) {
case 1:
break;
case 2:
- showLocalMenu();
+ showLocalMenu(item);
break;
};
}
void OpieFtp::RemoteListPressed( int mouse, QListViewItem *item, const QPoint &point, int i)
{
switch (mouse) {
case 1:
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() ));
m.insertItem( tr( "Rename" ), this, SLOT( remoteRename() ));
m.insertSeparator();
m.insertItem( tr( "Delete" ), this, SLOT( remoteDelete() ));
m.exec( QCursor::pos() );
}
-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() ));
m.insertItem( tr( "Rename" ), this, SLOT( localRename() ));
m.insertSeparator();
m.insertItem( tr( "Delete" ), this, SLOT( localDelete() ));
m.exec( QCursor::pos() );
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
@@ -58,14 +58,16 @@ public:
QString currentRemoteDir;
QString filterStr;
QListViewItem * item;
bool b;
protected slots:
- void showLocalMenu( );
- void showRemoteMenu( );
+ void showLocalMenu( QListViewItem *);
+ void showRemoteMenu( QListViewItem *);
+ void doLocalCd();
+ void doRemoteCd();
void localUpload();
void remoteDownload();
void newConnection();
void connector();
void disConnector();
void populateLocalView();