author | llornkcor <llornkcor> | 2002-03-28 02:18:16 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-03-28 02:18:16 (UTC) |
commit | a2cd4f6515e590ef2e818929843e2923b75beef5 (patch) (unidiff) | |
tree | 918bcd4c46acd2c63ea7fa7ad40c212e1002e457 | |
parent | d360439051f476cd847c4d8cec27a52addcd72a2 (diff) | |
download | opie-a2cd4f6515e590ef2e818929843e2923b75beef5.zip opie-a2cd4f6515e590ef2e818929843e2923b75beef5.tar.gz opie-a2cd4f6515e590ef2e818929843e2923b75beef5.tar.bz2 |
wishy-washy on single vs double click
-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 907a812..efcaf84 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp | |||
@@ -128,50 +128,52 @@ OpieFtp::OpieFtp( ) | |||
128 | Local_View->addColumn( tr("File"),150); | 128 | Local_View->addColumn( tr("File"),150); |
129 | Local_View->addColumn( tr("Size"),-1); | 129 | Local_View->addColumn( tr("Size"),-1); |
130 | Local_View->setColumnAlignment(1,QListView::AlignRight); | 130 | Local_View->setColumnAlignment(1,QListView::AlignRight); |
131 | Local_View->addColumn( tr("Date"),-1); | 131 | Local_View->addColumn( tr("Date"),-1); |
132 | Local_View->setColumnAlignment(2,QListView::AlignRight); | 132 | Local_View->setColumnAlignment(2,QListView::AlignRight); |
133 | Local_View->setAllColumnsShowFocus(TRUE); | 133 | Local_View->setAllColumnsShowFocus(TRUE); |
134 | Local_View->setMultiSelection( TRUE ); | 134 | Local_View->setMultiSelection( TRUE ); |
135 | 135 | ||
136 | QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); | 136 | QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); |
137 | 137 | ||
138 | tabLayout->addWidget( Local_View, 0, 0 ); | 138 | tabLayout->addWidget( Local_View, 0, 0 ); |
139 | 139 | ||
140 | connect( Local_View, SIGNAL( doubleClicked( QListViewItem*)), | 140 | connect( Local_View, SIGNAL( clicked( QListViewItem*)), |
141 | this,SLOT( localListClicked(QListViewItem *)) ); | 141 | this,SLOT( localListClicked(QListViewItem *)) ); |
142 | // connect( Local_View, SIGNAL( doubleClicked( QListViewItem*)), | ||
143 | // this,SLOT( localListClicked(QListViewItem *)) ); | ||
142 | connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 144 | connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
143 | this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); | 145 | this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); |
144 | 146 | ||
145 | TabWidget->insertTab( tab, tr( "Local" ) ); | 147 | TabWidget->insertTab( tab, tr( "Local" ) ); |
146 | 148 | ||
147 | tab_2 = new QWidget( TabWidget, "tab_2" ); | 149 | tab_2 = new QWidget( TabWidget, "tab_2" ); |
148 | tabLayout_2 = new QGridLayout( tab_2 ); | 150 | tabLayout_2 = new QGridLayout( tab_2 ); |
149 | tabLayout_2->setSpacing( 2); | 151 | tabLayout_2->setSpacing( 2); |
150 | tabLayout_2->setMargin( 2); | 152 | tabLayout_2->setMargin( 2); |
151 | 153 | ||
152 | Remote_View = new QListView( tab_2, "Remote_View" ); | 154 | Remote_View = new QListView( tab_2, "Remote_View" ); |
153 | Remote_View->addColumn( tr("File"),150); | 155 | Remote_View->addColumn( tr("File"),150); |
154 | Remote_View->addColumn( tr("Size"),-1); | 156 | Remote_View->addColumn( tr("Size"),-1); |
155 | Remote_View->setColumnAlignment(1,QListView::AlignRight); | 157 | Remote_View->setColumnAlignment(1,QListView::AlignRight); |
156 | Remote_View->addColumn( tr("Date"),-1); | 158 | Remote_View->addColumn( tr("Date"),-1); |
157 | Remote_View->setColumnAlignment(2,QListView::AlignRight); | 159 | Remote_View->setColumnAlignment(2,QListView::AlignRight); |
158 | Remote_View->addColumn( tr("Dir"),-1); | 160 | Remote_View->addColumn( tr("Dir"),-1); |
159 | Remote_View->setColumnAlignment(4,QListView::AlignRight); | 161 | Remote_View->setColumnAlignment(4,QListView::AlignRight); |
160 | Remote_View->setAllColumnsShowFocus(TRUE); | 162 | Remote_View->setAllColumnsShowFocus(TRUE); |
161 | Remote_View->setMultiSelection( TRUE ); | 163 | Remote_View->setMultiSelection( TRUE ); |
162 | 164 | ||
163 | QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); | 165 | QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); |
164 | 166 | ||
165 | connect( Remote_View, SIGNAL( doubleClicked( QListViewItem*)), | 167 | connect( Remote_View, SIGNAL( clicked( QListViewItem*)), |
166 | this,SLOT( remoteListClicked(QListViewItem *)) ); | 168 | this,SLOT( remoteListClicked(QListViewItem *)) ); |
167 | connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 169 | connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
168 | this,SLOT( RemoteListPressed(int, QListViewItem *, const QPoint&, int)) ); | 170 | this,SLOT( RemoteListPressed(int, QListViewItem *, const QPoint&, int)) ); |
169 | 171 | ||
170 | tabLayout_2->addWidget( Remote_View, 0, 0 ); | 172 | tabLayout_2->addWidget( Remote_View, 0, 0 ); |
171 | 173 | ||
172 | TabWidget->insertTab( tab_2, tr( "Remote" ) ); | 174 | TabWidget->insertTab( tab_2, tr( "Remote" ) ); |
173 | 175 | ||
174 | tab_3 = new QWidget( TabWidget, "tab_3" ); | 176 | tab_3 = new QWidget( TabWidget, "tab_3" ); |
175 | tabLayout_3 = new QGridLayout( tab_3 ); | 177 | tabLayout_3 = new QGridLayout( tab_3 ); |
176 | tabLayout_3->setSpacing( 2); | 178 | tabLayout_3->setSpacing( 2); |
177 | tabLayout_3->setMargin( 2); | 179 | tabLayout_3->setMargin( 2); |
@@ -431,25 +433,25 @@ void OpieFtp::localUpload() | |||
431 | 433 | ||
432 | if( !FtpPut( localFile.latin1(), remoteFile.latin1(),FTPLIB_IMAGE, conn ) ) { | 434 | if( !FtpPut( localFile.latin1(), remoteFile.latin1(),FTPLIB_IMAGE, conn ) ) { |
433 | QString msg; | 435 | QString msg; |
434 | msg.sprintf(tr("Unable to upload\n")+"%s",FtpLastResponse(conn)); | 436 | msg.sprintf(tr("Unable to upload\n")+"%s",FtpLastResponse(conn)); |
435 | msg.replace(QRegExp(":"),"\n"); | 437 | msg.replace(QRegExp(":"),"\n"); |
436 | QMessageBox::message(tr("Note"),msg); | 438 | QMessageBox::message(tr("Note"),msg); |
437 | } | 439 | } |
438 | } else { | 440 | } else { |
439 | QMessageBox::message(tr("Note"),tr("Cannot upload directories")); | 441 | QMessageBox::message(tr("Note"),tr("Cannot upload directories")); |
440 | } | 442 | } |
441 | ProgressBar->reset(); | 443 | ProgressBar->reset(); |
442 | nullifyCallBack(); | 444 | nullifyCallBack(); |
443 | it.current()->setSelected(FALSE); | 445 | it.current()->setSelected(FALSE); |
444 | } //end currentSelected | 446 | } //end currentSelected |
445 | } | 447 | } |
446 | TabWidget->setCurrentPage(1); | 448 | TabWidget->setCurrentPage(1); |
447 | remoteDirList( (const QString &)currentRemoteDir); //this also calls populate | 449 | remoteDirList( (const QString &)currentRemoteDir); //this also calls populate |
448 | QCopEnvelope ( "QPE/System", "notBusy()" ); | 450 | QCopEnvelope ( "QPE/System", "notBusy()" ); |
449 | } | 451 | } |
450 | 452 | ||
451 | void OpieFtp::nullifyCallBack() | 453 | void OpieFtp::nullifyCallBack() |
452 | { | 454 | { |
453 | FtpOptions(FTPLIB_CALLBACK, NULL, conn); | 455 | FtpOptions(FTPLIB_CALLBACK, NULL, conn); |
454 | FtpOptions(FTPLIB_IDLETIME, NULL, conn); | 456 | FtpOptions(FTPLIB_IDLETIME, NULL, conn); |
455 | FtpOptions(FTPLIB_CALLBACKARG, NULL, conn); | 457 | FtpOptions(FTPLIB_CALLBACKARG, NULL, conn); |
@@ -485,25 +487,25 @@ void OpieFtp::remoteDownload() | |||
485 | FtpOptions(FTPLIB_CALLBACKARG, (long) &fsz, conn); | 487 | FtpOptions(FTPLIB_CALLBACKARG, (long) &fsz, conn); |
486 | FtpOptions(FTPLIB_CALLBACKBYTES, (long) fsz/10, conn); | 488 | FtpOptions(FTPLIB_CALLBACKBYTES, (long) fsz/10, conn); |
487 | qDebug("Get: %s, %s",localFile.latin1(),remoteFile.latin1()); | 489 | qDebug("Get: %s, %s",localFile.latin1(),remoteFile.latin1()); |
488 | 490 | ||
489 | if(!FtpGet( localFile.latin1(), remoteFile.latin1(),FTPLIB_IMAGE, conn ) ) { | 491 | if(!FtpGet( localFile.latin1(), remoteFile.latin1(),FTPLIB_IMAGE, conn ) ) { |
490 | QString msg; | 492 | QString msg; |
491 | msg.sprintf(tr("Unable to download \n")+"%s",FtpLastResponse(conn)); | 493 | msg.sprintf(tr("Unable to download \n")+"%s",FtpLastResponse(conn)); |
492 | msg.replace(QRegExp(":"),"\n"); | 494 | msg.replace(QRegExp(":"),"\n"); |
493 | QMessageBox::message(tr("Note"),msg); | 495 | QMessageBox::message(tr("Note"),msg); |
494 | } | 496 | } |
495 | ProgressBar->reset(); | 497 | ProgressBar->reset(); |
496 | nullifyCallBack(); | 498 | nullifyCallBack(); |
497 | it.current()->setSelected(FALSE); | 499 | it.current()->setSelected(FALSE); |
498 | } | 500 | } |
499 | } | 501 | } |
500 | TabWidget->setCurrentPage(0); | 502 | TabWidget->setCurrentPage(0); |
501 | populateLocalView(); | 503 | populateLocalView(); |
502 | QCopEnvelope ( "QPE/System", "notBusy()" ); | 504 | QCopEnvelope ( "QPE/System", "notBusy()" ); |
503 | } | 505 | } |
504 | 506 | ||
505 | bool OpieFtp::remoteDirList(const QString &dir) | 507 | bool OpieFtp::remoteDirList(const QString &dir) |
506 | { | 508 | { |
507 | QString tmp = QDir::homeDirPath(); | 509 | QString tmp = QDir::homeDirPath(); |
508 | if(tmp.right(1) != "/") | 510 | if(tmp.right(1) != "/") |
509 | tmp+="/._temp"; | 511 | tmp+="/._temp"; |
@@ -740,25 +742,25 @@ void OpieFtp::localListClicked(QListViewItem *selectedItem) | |||
740 | populateLocalView(); | 742 | populateLocalView(); |
741 | } else { | 743 | } else { |
742 | currentDir.cdUp(); | 744 | currentDir.cdUp(); |
743 | populateLocalView(); | 745 | populateLocalView(); |
744 | } | 746 | } |
745 | if(QDir(strItem).exists()){ | 747 | if(QDir(strItem).exists()){ |
746 | currentDir.cd(strItem, TRUE); | 748 | currentDir.cd(strItem, TRUE); |
747 | populateLocalView(); | 749 | populateLocalView(); |
748 | } | 750 | } |
749 | } else { | 751 | } else { |
750 | strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); | 752 | strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); |
751 | if( QFile::exists(strItem ) ) { | 753 | if( QFile::exists(strItem ) ) { |
752 | qDebug("upload "+strItem); | 754 | // qDebug("upload "+strItem); |
753 | } | 755 | } |
754 | } //end not symlink | 756 | } //end not symlink |
755 | chdir(strItem.latin1()); | 757 | chdir(strItem.latin1()); |
756 | } | 758 | } |
757 | } | 759 | } |
758 | } | 760 | } |
759 | 761 | ||
760 | void OpieFtp::doLocalCd() | 762 | void OpieFtp::doLocalCd() |
761 | { | 763 | { |
762 | localListClicked( Local_View->currentItem()); | 764 | localListClicked( Local_View->currentItem()); |
763 | } | 765 | } |
764 | 766 | ||