summaryrefslogtreecommitdiff
path: root/noncore/net/opieftp/opieftp.cpp
authorllornkcor <llornkcor>2002-03-24 22:41:21 (UTC)
committer llornkcor <llornkcor>2002-03-24 22:41:21 (UTC)
commitd8820a9f2bdf9bc98c99542e3613ca9b5d2c6e0c (patch) (unidiff)
tree195a7cbe7f9577a118d1bc05fb028fbc010279f7 /noncore/net/opieftp/opieftp.cpp
parent8cada0d43b00686567295e712f9c5c89e3977a7d (diff)
downloadopie-d8820a9f2bdf9bc98c99542e3613ca9b5d2c6e0c.zip
opie-d8820a9f2bdf9bc98c99542e3613ca9b5d2c6e0c.tar.gz
opie-d8820a9f2bdf9bc98c99542e3613ca9b5d2c6e0c.tar.bz2
added lock icons
Diffstat (limited to 'noncore/net/opieftp/opieftp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp109
1 files changed, 89 insertions, 20 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index e97a9bf..37e2134 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -24,2 +24,3 @@
24 24
25#include <qstringlist.h>
25#include <qtextstream.h> 26#include <qtextstream.h>
@@ -238,7 +239,13 @@ OpieFtp::OpieFtp( )
238// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); 239// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
239 currentPathEdit = new QLineEdit( "/", this, "currentPathEdit" );
240 layout->addMultiCellWidget( currentPathEdit, 3, 3, 0, 3 );
241 240
242 currentPathEdit->setText( currentDir.canonicalPath()); 241 currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" );
243 connect( currentPathEdit,SIGNAL(returnPressed()),this,SLOT(currentPathEditChanged())); 242 layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 3 );
243
244 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
245
246 connect( currentPathCombo, SIGNAL( activated( const QString & ) ),
247 this, SLOT( currentPathComboChanged()currentPathCombo( const QString & ) ) );
248
249 connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()),
250 this,SLOT(currentPathComboChanged()));
244 251
@@ -289,3 +296,3 @@ void OpieFtp::tabChanged(QWidget *w)
289 if (TabWidget->currentPageIndex() == 0) { 296 if (TabWidget->currentPageIndex() == 0) {
290 currentPathEdit->setText( currentDir.canonicalPath()); 297 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
291 tabMenu->setItemChecked(tabMenu->idAt(0),TRUE); 298 tabMenu->setItemChecked(tabMenu->idAt(0),TRUE);
@@ -295,3 +302,3 @@ void OpieFtp::tabChanged(QWidget *w)
295 if (TabWidget->currentPageIndex() == 1) { 302 if (TabWidget->currentPageIndex() == 1) {
296 currentPathEdit->setText( currentRemoteDir ); 303 currentPathCombo->lineEdit()->setText( currentRemoteDir );
297 tabMenu->setItemChecked(tabMenu->idAt(1),TRUE); 304 tabMenu->setItemChecked(tabMenu->idAt(1),TRUE);
@@ -546,7 +553,25 @@ void OpieFtp::populateLocalView()
546 if(fileL !="./") { 553 if(fileL !="./") {
547 item = new QListViewItem( Local_View,fileL,fileS, fileDate); 554 item= new QListViewItem( ListView,fileL,fileS , fileDate);
548 if(isDir || fileL.find("/",0,TRUE) != -1) 555 QPixmap pm;
549 item->setPixmap( 0, Resource::loadPixmap( "folder" )); 556 pm= Resource::loadPixmap( "folder" );
550 else 557
551 item->setPixmap( 0, Resource::loadPixmap( "fileopen" )); 558 if(isDir || fileL.find("/",0,TRUE) != -1) {
559 if( !QDir( fi->filePath() ).isReadable())
560 pm = Resource::loadPixmap( "lockedfolder" );
561 item->setPixmap( 0,pm );
562 } else {
563 if( !fi->isReadable() )
564 pm = Resource::loadPixmap( "locked" );
565 else
566 pm = Resource::loadPixmap( "fileopen" );
567 item->setPixmap( 0,pm);
568 }
569 if( fileL.find("->",0,TRUE) != -1) {
570 // overlay link image
571 QPixmap lnk = Resource::loadPixmap( "symlink" );
572 QPainter painter( &pm );
573 painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk );
574 pm.setMask( pm.createHeuristicMask( FALSE ) );
575 item->setPixmap( 0, pm);
576 }
552 } 577 }
@@ -554,5 +579,7 @@ void OpieFtp::populateLocalView()
554 ++it; 579 ++it;
555 } 580 }
556 Local_View->setSorting( 3,FALSE); 581 Local_View->setSorting( 3,FALSE);
557 currentPathEdit->setText( currentDir.canonicalPath() ); 582 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath() );
583 fillCombo( (const QString &)currentDir);
584
558} 585}
@@ -663,3 +690,4 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem)
663 currentRemoteDir +="/"; 690 currentRemoteDir +="/";
664 currentPathEdit->setText( currentRemoteDir ); 691 currentPathCombo->lineEdit()->setText( currentRemoteDir );
692 fillRemoteCombo( (const QString &)currentDir);
665 QCopEnvelope ( "QPE/System", "notBusy()" ); 693 QCopEnvelope ( "QPE/System", "notBusy()" );
@@ -934,3 +962,44 @@ void OpieFtp::localRename()
934 962
935void OpieFtp::currentPathEditChanged() 963void OpieFtp::currentPathComboActivated(const QString & currentPath) {
964 if (TabWidget->currentPageIndex() == 0) {
965 chdir( currentPath.latin1() );
966 currentDir.cd( currentPath, TRUE);
967 populateLocalList();
968 update();
969 } else {
970// chdir( currentPath.latin1() );
971// currentDir.cd( currentPath, TRUE);
972// populateList();
973// update();
974
975 }
976}
977
978void OpieFtp::fillCombo(const QString &currentPath) {
979
980 currentPathComboBox->lineEdit()->setText(currentPath);
981 if( localDirPathStringList.grep(currentPath,TRUE).isEmpty() ) {
982 currentPathComboBox->clear();
983 localDirPathStringList.prepend(currentPath );
984 currentPathComboBox->insertStringList( localDirPathStringList,-1);
985 }
986 currentPathComboBox->lineEdit()->setText(currentPath);
987 if( remoteDirPathStringList.grep(currentPath,TRUE).isEmpty() ) {
988 currentPathComboBox->clear();
989 remoteDirPathStringList.prepend(currentPath );
990 currentPathComboBox->insertStringList( remoteDirPathStringList,-1);
991 }
992}
993
994void OpieFtp::fillRemoteCombo(const QString &currentPath) {
995
996 dirPathCombo->lineEdit()->setText(currentPath);
997 if( remoteDirPathStringList.grep(currentPath,TRUE).isEmpty() ) {
998 dirPathCombo->clear();
999 remoteDirPathStringList.prepend(currentPath );
1000 dirPathCombo->insertStringList( remoteDirPathStringList,-1);
1001 }
1002}
1003
1004void OpieFtp::currentPathComboChanged()
936{ 1005{
@@ -939,4 +1008,4 @@ void OpieFtp::currentPathEditChanged()
939 if (TabWidget->currentPageIndex() == 0) { 1008 if (TabWidget->currentPageIndex() == 0) {
940 if(QDir( currentPathEdit->text()).exists()) { 1009 if(QDir( currentPathCombo->lineEdit()->text()).exists()) {
941 currentDir.setPath( currentPathEdit->text() ); 1010 currentDir.setPath( currentPathCombo->lineEdit()->text() );
942 populateLocalView(); 1011 populateLocalView();
@@ -947,6 +1016,6 @@ void OpieFtp::currentPathEditChanged()
947 if (TabWidget->currentPageIndex() == 1) { 1016 if (TabWidget->currentPageIndex() == 1) {
948 currentRemoteDir = currentPathEdit->text(); 1017 currentRemoteDir = currentPathCombo->lineEdit()->text();
949 if(currentRemoteDir.right(1) !="/") { 1018 if(currentRemoteDir.right(1) !="/") {
950 currentRemoteDir = currentRemoteDir +"/"; 1019 currentRemoteDir = currentRemoteDir +"/";
951 currentPathEdit->setText( currentRemoteDir ); 1020 currentPathCombo->lineEdit()->setText( currentRemoteDir );
952 } 1021 }
@@ -954,3 +1023,3 @@ void OpieFtp::currentPathEditChanged()
954 currentRemoteDir = oldRemoteCurrentDir; 1023 currentRemoteDir = oldRemoteCurrentDir;
955 currentPathEdit->setText( currentRemoteDir ); 1024 currentPathCombo->lineEdit()->setText( currentRemoteDir );
956 } 1025 }