summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp28
-rw-r--r--noncore/net/opieftp/opieftp.h4
-rw-r--r--noncore/net/opieftp/opieftp.pro4
3 files changed, 24 insertions, 12 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index 7f5d71c..e15bbef 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -19,12 +19,13 @@
#include <qpe/qpetoolbar.h>
#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/config.h>
#include <qpe/mimetype.h>
+#include <qpe/qpemessagebox.h>
#include <qstringlist.h>
#include <qtextstream.h>
#include <qpushbutton.h>
#include <qtoolbutton.h>
#include <qdatetime.h>
@@ -81,13 +82,13 @@ OpieFtp::OpieFtp( )
// menuBar->setHorizontalStretchable( TRUE );
connectionMenu = new QPopupMenu( this );
localMenu = new QPopupMenu( this );
remoteMenu = new QPopupMenu( this );
tabMenu = new QPopupMenu( this );
-
+
layout->addMultiCellWidget( menuBar, 0, 0, 0, 2 );
menuBar->insertItem( tr( "Connection" ), connectionMenu);
menuBar->insertItem( tr( "Local" ), localMenu);
menuBar->insertItem( tr( "Remote" ), remoteMenu);
menuBar->insertItem( tr( "View" ), tabMenu);
@@ -111,15 +112,18 @@ OpieFtp::OpieFtp( )
remoteMenu->insertSeparator();
remoteMenu->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() ));
tabMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() ));
tabMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() ));
tabMenu->insertItem( tr( "Switch to Config" ), this, SLOT( switchToConfigTab() ));
+ tabMenu->insertSeparator();
+ tabMenu->insertItem( tr( "About" ), this, SLOT( doAbout() ));
tabMenu->setCheckable(TRUE);
+
cdUpButton = new QPushButton(Resource::loadIconSet("up"),"",this,"cdUpButton");
cdUpButton ->setFixedSize( QSize( 20, 20 ) );
connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) );
cdUpButton ->setFlat(TRUE);
layout->addMultiCellWidget( cdUpButton, 0, 0, 3, 3 );
cdUpButton->hide();
@@ -147,15 +151,15 @@ OpieFtp::OpieFtp( )
tabLayout->setSpacing( 2);
tabLayout->setMargin( 2);
Local_View = new QListView( tab, "Local_View" );
// Local_View->setResizePolicy( QListView::AutoOneFit );
Local_View->addColumn( tr("File"),150);
- Local_View->addColumn( tr("Size"),-1);
- Local_View->setColumnAlignment(1,QListView::AlignRight);
Local_View->addColumn( tr("Date"),-1);
+ Local_View->setColumnAlignment(1,QListView::AlignRight);
+ Local_View->addColumn( tr("Size"),-1);
Local_View->setColumnAlignment(2,QListView::AlignRight);
Local_View->setAllColumnsShowFocus(TRUE);
Local_View->setMultiSelection( TRUE);
Local_View->setSelectionMode(QListView::Extended);
Local_View->setFocusPolicy(QWidget::ClickFocus);
@@ -177,15 +181,15 @@ OpieFtp::OpieFtp( )
tabLayout_2 = new QGridLayout( tab_2 );
tabLayout_2->setSpacing( 2);
tabLayout_2->setMargin( 2);
Remote_View = new QListView( tab_2, "Remote_View" );
Remote_View->addColumn( tr("File"),150);
- Remote_View->addColumn( tr("Size"),-1);
- Remote_View->setColumnAlignment(1,QListView::AlignRight);
Remote_View->addColumn( tr("Date"),-1);
+ Remote_View->setColumnAlignment(1,QListView::AlignRight);
+ Remote_View->addColumn( tr("Size"),-1);
Remote_View->setColumnAlignment(2,QListView::AlignRight);
Remote_View->addColumn( tr("Dir"),-1);
Remote_View->setColumnAlignment(4,QListView::AlignRight);
Remote_View->setAllColumnsShowFocus(TRUE);
Remote_View->setMultiSelection( FALSE);
@@ -608,13 +612,13 @@ void OpieFtp::populateLocalView()
fileL+="/";
isDir=TRUE;
// qDebug( fileL);
}
}
if(fileL !="./" && fi->exists()) {
- item= new QListViewItem( Local_View,fileL,fileS , fileDate);
+ item= new QListViewItem( Local_View,fileL, fileDate, fileS );
QPixmap pm;
if(isDir || fileL.find("/",0,TRUE) != -1) {
if( !QDir( fi->filePath() ).isReadable())
pm = Resource::loadPixmap( "lockedfolder" );
else
@@ -674,19 +678,19 @@ bool OpieFtp::populateRemoteView( )
fileS = s.mid( 30, 42-30);
fileS = fileS.stripWhiteSpace();
fileDate = s.mid( 42, 55-42);
fileDate = fileDate.stripWhiteSpace();
if(fileL.find("total",0,TRUE) == -1) {
if(s.left(1) == "d" || fileL.find("/",0,TRUE) != -1) {
- QListViewItem * item = new QListViewItem( Remote_View, fileL, fileS, fileDate,"d");
+ QListViewItem * item = new QListViewItem( Remote_View, fileL, fileDate, fileS,"d");
item->setPixmap( 0, Resource::loadPixmap( "folder" ));
// if(itemDir)
item->moveItem(itemDir);
itemDir=item;
} else {
- QListViewItem * item = new QListViewItem( Remote_View, fileL, fileS, fileDate,"f");
+ QListViewItem * item = new QListViewItem( Remote_View, fileL, fileDate, fileS,"f");
item->setPixmap( 0, Resource::loadPixmap( "fileopen" ));
// if(itemFile)
item->moveItem(itemDir);
item->moveItem(itemFile);
itemFile=item;
}
@@ -1310,6 +1314,14 @@ void OpieFtp::homeButtonPushed() {
QString current = QDir::homeDirPath();
chdir( current.latin1() );
currentDir.cd( current, TRUE);
populateLocalView();
update();
}
+
+void OpieFtp::doAbout() {
+ QMessageBox::message("OpieFtp","Opie ftp client is copyright 2002 by\n"
+ "L.J.Potter<llornkcor@handhelds.org>\n"
+ "and uses ftplib copyright 1996-2000\n"
+ "by Thomas Pfau, pfau@cnj.digex.net\n\n"
+ "and is licensed by the GPL");
+}
diff --git a/noncore/net/opieftp/opieftp.h b/noncore/net/opieftp/opieftp.h
index 6852b1c..218a958 100644
--- a/noncore/net/opieftp/opieftp.h
+++ b/noncore/net/opieftp/opieftp.h
@@ -52,25 +52,25 @@ public:
QListView *Local_View, *Remote_View;
QComboBox *UsernameComboBox, *ServerComboBox, *currentPathCombo;
QLineEdit *PasswordEdit, *remotePath;
QLabel *TextLabel2, *TextLabel1, *TextLabel3, *TextLabel4;;
QSpinBox* PortSpinBox;
- QPopupMenu *connectionMenu, *localMenu, *remoteMenu, *tabMenu;
+ QPopupMenu *connectionMenu, *localMenu, *remoteMenu, *tabMenu, *aboutMenu;
QDir currentDir;
QString currentRemoteDir;
QString filterStr;
QListViewItem * item;
QPushButton *connectServerBtn, *cdUpButton, *homeButton, *docButton;
bool b;
int currentServerConfig;
protected slots:
void upDir();
void homeButtonPushed();
void docButtonPushed();
-
+ void doAbout();
void serverComboEdited(const QString & );
void showLocalMenu( QListViewItem *);
void showRemoteMenu( QListViewItem *);
void doLocalCd();
void doRemoteCd();
void localUpload();
diff --git a/noncore/net/opieftp/opieftp.pro b/noncore/net/opieftp/opieftp.pro
index f25d15f..7aead00 100644
--- a/noncore/net/opieftp/opieftp.pro
+++ b/noncore/net/opieftp/opieftp.pro
@@ -1,10 +1,10 @@
TEMPLATE = app
CONFIG += qt warn_on release
-HEADERS = opieftp.h inputDialog.h ftplib.h
-SOURCES = opieftp.cpp inputDialog.cpp ftplib.c main.cpp
+HEADERS = opieftp.h inputDialog.h ftplib.h filePermissions.h
+SOURCES = opieftp.cpp inputDialog.cpp ftplib.c filePermissions.cpp main.cpp
TARGET = opieftp
REQUIRES=medium-config
DESTDIR = $(OPIEDIR)/bin
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe