author | llornkcor <llornkcor> | 2002-03-27 05:25:47 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-03-27 05:25:47 (UTC) |
commit | 531e1365f5ae7ffcbfc9c9ebe92274282358025e (patch) (side-by-side diff) | |
tree | dc597d8bc5a5a2ada4acbe695f2e48604e9b85f2 | |
parent | 7d6828df281631bce0aaa2aaa229b69b9329e03c (diff) | |
download | opie-531e1365f5ae7ffcbfc9c9ebe92274282358025e.zip opie-531e1365f5ae7ffcbfc9c9ebe92274282358025e.tar.gz opie-531e1365f5ae7ffcbfc9c9ebe92274282358025e.tar.bz2 |
added some icon handling code, and added combo (?), fixed some goofy thing.
-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 52 | ||||
-rw-r--r-- | noncore/net/opieftp/opieftp.h | 9 |
2 files changed, 36 insertions, 25 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 37e2134..fd6b028 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp @@ -23,2 +23,3 @@ #include <qpe/config.h> +#include <qpe/mimetype.h> @@ -204,2 +205,3 @@ OpieFtp::OpieFtp( ) + remotePath = new QLineEdit( "/", tab_3, "remotePath" ); @@ -227,3 +229,2 @@ OpieFtp::OpieFtp( ) - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); @@ -242,3 +243,3 @@ OpieFtp::OpieFtp( ) layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 3 ); - + currentPathCombo->setEditable(TRUE); currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); @@ -246,3 +247,3 @@ OpieFtp::OpieFtp( ) connect( currentPathCombo, SIGNAL( activated( const QString & ) ), - this, SLOT( currentPathComboChanged()currentPathCombo( const QString & ) ) ); + this, SLOT( currentPathComboActivated( const QString & ) ) ); @@ -267,2 +268,3 @@ OpieFtp::OpieFtp( ) #endif + filterStr="*"; @@ -328,3 +330,3 @@ void OpieFtp::serverComboEdited(const QString & edit) { currentServerConfig = -1; - qDebug("comboedited"); +// qDebug("comboedited"); } @@ -552,6 +554,5 @@ void OpieFtp::populateLocalView() } - if(fileL !="./") { - item= new QListViewItem( ListView,fileL,fileS , fileDate); + if(fileL !="./" && fi->exists()) { + item= new QListViewItem( Local_View,fileL,fileS , fileDate); QPixmap pm; - pm= Resource::loadPixmap( "folder" ); @@ -560,2 +561,4 @@ void OpieFtp::populateLocalView() pm = Resource::loadPixmap( "lockedfolder" ); + else + pm= Resource::loadPixmap( "folder" ); item->setPixmap( 0,pm ); @@ -564,8 +567,13 @@ void OpieFtp::populateLocalView() pm = Resource::loadPixmap( "locked" ); - else - pm = Resource::loadPixmap( "fileopen" ); + else { + MimeType mt(fi->filePath()); + pm=mt.pixmap(); + if(pm.isNull()) + pm = Resource::loadPixmap( "UnknownDocument-14" ); item->setPixmap( 0,pm); } + } if( fileL.find("->",0,TRUE) != -1) { // overlay link image + pm= Resource::loadPixmap( "folder" ); QPixmap lnk = Resource::loadPixmap( "symlink" ); @@ -642,2 +650,3 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) { + if(item) { QCopEnvelope ( "QPE/System", "busy()" ); @@ -694,2 +703,3 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) } +} @@ -697,2 +707,3 @@ void OpieFtp::localListClicked(QListViewItem *selectedItem) { + if(item) { QString strItem=selectedItem->text(0); @@ -730,2 +741,3 @@ void OpieFtp::localListClicked(QListViewItem *selectedItem) } +} @@ -966,3 +978,3 @@ void OpieFtp::currentPathComboActivated(const QString & currentPath) { currentDir.cd( currentPath, TRUE); - populateLocalList(); + populateLocalView(); update(); @@ -979,13 +991,13 @@ void OpieFtp::fillCombo(const QString ¤tPath) { - currentPathComboBox->lineEdit()->setText(currentPath); + currentPathCombo->lineEdit()->setText(currentPath); if( localDirPathStringList.grep(currentPath,TRUE).isEmpty() ) { - currentPathComboBox->clear(); + currentPathCombo->clear(); localDirPathStringList.prepend(currentPath ); - currentPathComboBox->insertStringList( localDirPathStringList,-1); + currentPathCombo->insertStringList( localDirPathStringList,-1); } - currentPathComboBox->lineEdit()->setText(currentPath); + currentPathCombo->lineEdit()->setText(currentPath); if( remoteDirPathStringList.grep(currentPath,TRUE).isEmpty() ) { - currentPathComboBox->clear(); + currentPathCombo->clear(); remoteDirPathStringList.prepend(currentPath ); - currentPathComboBox->insertStringList( remoteDirPathStringList,-1); + currentPathCombo->insertStringList( remoteDirPathStringList,-1); } @@ -995,7 +1007,7 @@ void OpieFtp::fillRemoteCombo(const QString ¤tPath) { - dirPathCombo->lineEdit()->setText(currentPath); + currentPathCombo->lineEdit()->setText(currentPath); if( remoteDirPathStringList.grep(currentPath,TRUE).isEmpty() ) { - dirPathCombo->clear(); + currentPathCombo->clear(); remoteDirPathStringList.prepend(currentPath ); - dirPathCombo->insertStringList( remoteDirPathStringList,-1); + currentPathCombo->insertStringList( remoteDirPathStringList,-1); } @@ -1129,3 +1141,3 @@ void OpieFtp::serverComboSelected(int index) cfg.setGroup(temp); - qDebug(temp); +// qDebug(temp); int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE); diff --git a/noncore/net/opieftp/opieftp.h b/noncore/net/opieftp/opieftp.h index 57599b7..32862c7 100644 --- a/noncore/net/opieftp/opieftp.h +++ b/noncore/net/opieftp/opieftp.h @@ -54,3 +54,3 @@ public: QComboBox *UsernameComboBox, *ServerComboBox, *currentPathCombo; - QLineEdit *PasswordEdit, *remotePath, *currentPathEdit; + QLineEdit *PasswordEdit, *remotePath; QLabel *TextLabel2, *TextLabel1, *TextLabel3, *TextLabel4;; @@ -96,4 +96,2 @@ protected slots: void currentPathComboChanged(); - void fillCombos(); - void fillCombo(const QString &); void currentPathComboActivated(const QString &); @@ -102,4 +100,5 @@ protected slots: void switchToConfigTab(); - void fillCombo(); - void fillRemoteCombo(); + void fillCombos(); + void fillRemoteCombo(const QString&); + void fillCombo(const QString &); void serverComboSelected(int); |