summaryrefslogtreecommitdiff
path: root/noncore/net/opieftp/opieftp.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/opieftp/opieftp.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp41
1 files changed, 28 insertions, 13 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index fd6b028..907a812 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -126,5 +126,5 @@ OpieFtp::OpieFtp( )
Local_View = new QListView( tab, "Local_View" );
// Local_View->setResizePolicy( QListView::AutoOneFit );
- Local_View->addColumn( tr("File"),120);
+ Local_View->addColumn( tr("File"),150);
Local_View->addColumn( tr("Size"),-1);
Local_View->setColumnAlignment(1,QListView::AlignRight);
@@ -132,9 +132,11 @@ OpieFtp::OpieFtp( )
Local_View->setColumnAlignment(2,QListView::AlignRight);
Local_View->setAllColumnsShowFocus(TRUE);
+ Local_View->setMultiSelection( TRUE );
+
QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold);
tabLayout->addWidget( Local_View, 0, 0 );
- connect( Local_View, SIGNAL( clicked( QListViewItem*)),
+ connect( Local_View, SIGNAL( doubleClicked( QListViewItem*)),
this,SLOT( localListClicked(QListViewItem *)) );
connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
@@ -149,5 +151,5 @@ OpieFtp::OpieFtp( )
Remote_View = new QListView( tab_2, "Remote_View" );
- Remote_View->addColumn( tr("File"),120);
+ Remote_View->addColumn( tr("File"),150);
Remote_View->addColumn( tr("Size"),-1);
Remote_View->setColumnAlignment(1,QListView::AlignRight);
@@ -157,7 +159,9 @@ OpieFtp::OpieFtp( )
Remote_View->setColumnAlignment(4,QListView::AlignRight);
Remote_View->setAllColumnsShowFocus(TRUE);
+ Remote_View->setMultiSelection( TRUE );
+
QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold);
- connect( Remote_View, SIGNAL( clicked( QListViewItem*)),
+ connect( Remote_View, SIGNAL( doubleClicked( QListViewItem*)),
this,SLOT( remoteListClicked(QListViewItem *)) );
connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
@@ -408,5 +412,9 @@ void OpieFtp::localUpload()
QCopEnvelope ( "QPE/System", "busy()" );
// qApp->processEvents();
- QString strItem = Local_View->currentItem()->text(0);
+ QList<QListViewItem> * getSelectedItems( QListView * Local_View );
+ QListViewItemIterator it( Local_View );
+ for ( ; it.current(); ++it ) {
+ if ( it.current()->isSelected() ) {
+ QString strItem = it.current()->text(0);
QString localFile = currentDir.canonicalPath()+"/"+strItem;
QString remoteFile= currentRemoteDir+strItem;
@@ -428,9 +436,12 @@ void OpieFtp::localUpload()
QMessageBox::message(tr("Note"),msg);
}
- ProgressBar->reset();
- nullifyCallBack();
} else {
QMessageBox::message(tr("Note"),tr("Cannot upload directories"));
}
+ ProgressBar->reset();
+ nullifyCallBack();
+ it.current()->setSelected(FALSE);
+ } //end currentSelected
+ }
TabWidget->setCurrentPage(1);
remoteDirList( (const QString &)currentRemoteDir); //this also calls populate
@@ -444,5 +455,4 @@ void OpieFtp::nullifyCallBack()
FtpOptions(FTPLIB_CALLBACKARG, NULL, conn);
FtpOptions(FTPLIB_CALLBACKBYTES, NULL, conn);
-
}
@@ -452,7 +462,11 @@ void OpieFtp::remoteDownload()
int fsz;
QCopEnvelope ( "QPE/System", "busy()" );
- QString strItem = Remote_View->currentItem()->text(0);
-// strItem=strItem.right(strItem.length()-1);
+ QList<QListViewItem> * getSelectedItems( QListView * Remote_View );
+ QListViewItemIterator it( Remote_View );
+ for ( ; it.current(); ++it ) {
+ if ( it.current()->isSelected() ) {
+ QString strItem = it.current()->text(0);
+// strItem=strItem.right(strItem.length()-1);
QString localFile = currentDir.canonicalPath();
if(localFile.right(1).find("/",0,TRUE) == -1)
@@ -481,4 +495,7 @@ void OpieFtp::remoteDownload()
ProgressBar->reset();
nullifyCallBack();
+ it.current()->setSelected(FALSE);
+ }
+ }
TabWidget->setCurrentPage(0);
populateLocalView();
@@ -568,5 +585,5 @@ void OpieFtp::populateLocalView()
else {
MimeType mt(fi->filePath());
- pm=mt.pixmap();
+ pm=mt.pixmap(); //sets the correct pixmap for mimetype
if(pm.isNull())
pm = Resource::loadPixmap( "UnknownDocument-14" );
@@ -590,5 +607,4 @@ void OpieFtp::populateLocalView()
currentPathCombo->lineEdit()->setText( currentDir.canonicalPath() );
fillCombo( (const QString &)currentDir);
-
}
@@ -912,5 +928,4 @@ void OpieFtp::remoteDelete()
}
remoteDirList( (const QString &)currentRemoteDir); //this also calls populate
-
}
break;