summaryrefslogtreecommitdiff
path: root/noncore/net/opieftp
authormickeyl <mickeyl>2003-10-29 18:18:19 (UTC)
committer mickeyl <mickeyl>2003-10-29 18:18:19 (UTC)
commit1af1f1d9f398d38a2bc666cd2edff5725da7a770 (patch) (unidiff)
treeb3bb0d90cafc1e933b5b9297a7b2669ce3b184ea /noncore/net/opieftp
parent35615947e11575a61456c8483e7f6d67fe59d5ed (diff)
downloadopie-1af1f1d9f398d38a2bc666cd2edff5725da7a770.zip
opie-1af1f1d9f398d38a2bc666cd2edff5725da7a770.tar.gz
opie-1af1f1d9f398d38a2bc666cd2edff5725da7a770.tar.bz2
mrege noncore/net/*
Diffstat (limited to 'noncore/net/opieftp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieftp/main.cpp15
-rw-r--r--noncore/net/opieftp/opieftp.cpp58
-rw-r--r--noncore/net/opieftp/opieftp.h3
-rw-r--r--noncore/net/opieftp/opieftp.pro6
4 files changed, 35 insertions, 47 deletions
diff --git a/noncore/net/opieftp/main.cpp b/noncore/net/opieftp/main.cpp
index 4f5a7d4..0217e41 100644
--- a/noncore/net/opieftp/main.cpp
+++ b/noncore/net/opieftp/main.cpp
@@ -11,17 +11,6 @@
11 * (at your option) any later version. * 11 * (at your option) any later version. *
12 ***************************************************************************/ 12 ***************************************************************************/
13#include <qpe/qpeapplication.h> 13#include <opie/oapplicationfactory.h>
14
15
16
17#include "opieftp.h" 14#include "opieftp.h"
18 15
19int main(int argc, char *argv[]) 16OPIE_EXPORT_APP( OApplicationFactory<OpieFtp> )
20{
21 QPEApplication a(argc, argv);
22
23 OpieFtp opieftp;
24 a.showMainWidget( &opieftp);
25 return a.exec();
26}
27
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index 269449e..ee7d32f 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -58,6 +58,6 @@ static int log_progress(netbuf *, int xfered, void *)
58} 58}
59 59
60OpieFtp::OpieFtp( ) 60OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl)
61 : QMainWindow( ) 61 : QMainWindow( parent, name, fl )
62{ 62{
63 setCaption( tr( "OpieFtp" ) ); 63 setCaption( tr( "OpieFtp" ) );
@@ -82,5 +82,5 @@ OpieFtp::OpieFtp( )
82 remoteMenu = new QPopupMenu( this ); 82 remoteMenu = new QPopupMenu( this );
83 tabMenu = new QPopupMenu( this ); 83 tabMenu = new QPopupMenu( this );
84 84
85 layout->addMultiCellWidget( menuBar, 0, 0, 0, 2 ); 85 layout->addMultiCellWidget( menuBar, 0, 0, 0, 2 );
86 86
@@ -270,16 +270,16 @@ OpieFtp::OpieFtp( )
270 connect( serverListView, SIGNAL( highlighted( const QString &)), 270 connect( serverListView, SIGNAL( highlighted( const QString &)),
271 this,SLOT( serverListClicked( const QString &) ) ); 271 this,SLOT( serverListClicked( const QString &) ) );
272 272
273 connectServerBtn = new QPushButton( "Connect", tab_3 , "ConnectButton" ); 273 connectServerBtn = new QPushButton( tr("Connect"), tab_3 , "ConnectButton" );
274 tabLayout_3->addMultiCellWidget( connectServerBtn, 6, 6, 0, 1); 274 tabLayout_3->addMultiCellWidget( connectServerBtn, 6, 6, 0, 1);
275 connectServerBtn->setToggleButton(TRUE); 275 connectServerBtn->setToggleButton(TRUE);
276 connect(connectServerBtn,SIGNAL( toggled( bool)),SLOT( connectorBtnToggled(bool) )); 276 connect(connectServerBtn,SIGNAL( toggled( bool)),SLOT( connectorBtnToggled(bool) ));
277 277
278 newServerButton= new QPushButton( "Add", tab_3 , "NewServerButton" ); 278 newServerButton= new QPushButton( tr("Add"), tab_3 , "NewServerButton" );
279 tabLayout_3->addMultiCellWidget( newServerButton, 6, 6, 2, 2); 279 tabLayout_3->addMultiCellWidget( newServerButton, 6, 6, 2, 2);
280 connect( newServerButton,SIGNAL( clicked()),SLOT( NewServer() )); 280 connect( newServerButton,SIGNAL( clicked()),SLOT( NewServer() ));
281 281
282 QPushButton *deleteServerBtn; 282 QPushButton *deleteServerBtn;
283 deleteServerBtn = new QPushButton( "Delete", tab_3 , "OpenButton" ); 283 deleteServerBtn = new QPushButton( tr("Delete"), tab_3 , "OpenButton" );
284 tabLayout_3->addMultiCellWidget( deleteServerBtn, 6, 6, 3, 3); 284 tabLayout_3->addMultiCellWidget( deleteServerBtn, 6, 6, 3, 3);
285 285
@@ -320,5 +320,5 @@ OpieFtp::OpieFtp( )
320 320
321// ServerComboBox->setCurrentItem(currentServerConfig); 321// ServerComboBox->setCurrentItem(currentServerConfig);
322 322
323 TabWidget->setCurrentPage(2); 323 TabWidget->setCurrentPage(2);
324} 324}
@@ -358,5 +358,5 @@ void OpieFtp::tabChanged(QWidget *)
358 if(homeButton->isHidden()) 358 if(homeButton->isHidden())
359 homeButton->show(); 359 homeButton->show();
360 360
361 } 361 }
362 if (TabWidget->currentPageIndex() == 1) { 362 if (TabWidget->currentPageIndex() == 1) {
@@ -450,5 +450,5 @@ void OpieFtp::connector()
450// currentServerConfig=-1; 450// currentServerConfig=-1;
451// if(ftp_pass != cfg.readEntry(cfg.readEntry("Username"))) 451// if(ftp_pass != cfg.readEntry(cfg.readEntry("Username")))
452// currentServerConfig=-1; 452// currentServerConfig=-1;
453 453
454 454
@@ -594,5 +594,5 @@ void OpieFtp::remoteDownload()
594 Remote_View->clearSelection(); 594 Remote_View->clearSelection();
595 } 595 }
596 Remote_View->setFocus(); 596 Remote_View->setFocus();
597 TabWidget->setCurrentPage(0); 597 TabWidget->setCurrentPage(0);
598 populateLocalView(); 598 populateLocalView();
@@ -670,5 +670,5 @@ void OpieFtp::populateLocalView()
670 item = new QListViewItem( Local_View,fileL, fileDate, fileS ); 670 item = new QListViewItem( Local_View,fileL, fileDate, fileS );
671 QPixmap pm; 671 QPixmap pm;
672 672
673 if(isDir || fileL.find("/",0,TRUE) != -1) { 673 if(isDir || fileL.find("/",0,TRUE) != -1) {
674 if( !QDir( fi->filePath() ).isReadable()) 674 if( !QDir( fi->filePath() ).isReadable())
@@ -730,5 +730,5 @@ bool OpieFtp::populateRemoteView( )
730 fileDate = s.mid(month + 1, len - 2); // minus spaces 730 fileDate = s.mid(month + 1, len - 2); // minus spaces
731 fileL = s.right(s.length() - month - len); 731 fileL = s.right(s.length() - month - len);
732 if(s.left(1) == "d") 732 if(s.left(1) == "d")
733 fileL = fileL+"/"; 733 fileL = fileL+"/";
734 fileS = s.mid(month - 8, 8); // FIXME 734 fileS = s.mid(month - 8, 8); // FIXME
@@ -816,6 +816,6 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem)
816 fillRemoteCombo( (const QString &)currentRemoteDir); 816 fillRemoteCombo( (const QString &)currentRemoteDir);
817// QCopEnvelope ( "QPE/System", "notBusy()" ); 817// QCopEnvelope ( "QPE/System", "notBusy()" );
818 Remote_View->ensureItemVisible(Remote_View->firstChild()); 818 Remote_View->ensureItemVisible(Remote_View->firstChild());
819 819
820 } 820 }
821} 821}
@@ -824,5 +824,5 @@ void OpieFtp::localListClicked(QListViewItem *selectedItem)
824{ 824{
825 if(selectedItem!= NULL) { 825 if(selectedItem!= NULL) {
826 826
827 QString strItem=selectedItem->text(0); 827 QString strItem=selectedItem->text(0);
828 QString strSize=selectedItem->text(1); 828 QString strSize=selectedItem->text(1);
@@ -837,5 +837,5 @@ void OpieFtp::localListClicked(QListViewItem *selectedItem)
837 } else { // not a symlink 837 } else { // not a symlink
838 if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { 838 if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) {
839 839
840 if(QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem)).exists() ) { 840 if(QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem)).exists() ) {
841 strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); 841 strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem);
@@ -859,5 +859,5 @@ void OpieFtp::localListClicked(QListViewItem *selectedItem)
859 chdir(strItem.latin1()); 859 chdir(strItem.latin1());
860 } 860 }
861 Local_View->ensureItemVisible(Local_View->firstChild()); 861 Local_View->ensureItemVisible(Local_View->firstChild());
862 } 862 }
863} 863}
@@ -973,5 +973,5 @@ void OpieFtp::localDelete()
973 QString f = it.current()->text(0); 973 QString f = it.current()->text(0);
974 it.current()->setSelected(FALSE); 974 it.current()->setSelected(FALSE);
975 975
976// QString f = Local_View->currentItem()->text(0); 976// QString f = Local_View->currentItem()->text(0);
977 if(QDir(f).exists() ) { 977 if(QDir(f).exists() ) {
@@ -998,5 +998,5 @@ void OpieFtp::localDelete()
998 } 998 }
999 break; 999 break;
1000 case 1: 1000 case 1:
1001 // exit 1001 // exit
1002 break; 1002 break;
@@ -1006,5 +1006,5 @@ void OpieFtp::localDelete()
1006 } 1006 }
1007 populateLocalView(); 1007 populateLocalView();
1008 1008
1009} 1009}
1010 1010
@@ -1202,8 +1202,8 @@ void OpieFtp::readConfig()
1202 cfg.setGroup("Server"); 1202 cfg.setGroup("Server");
1203 currentServerConfig = cfg.readNumEntry("currentServer", -1); 1203 currentServerConfig = cfg.readNumEntry("currentServer", -1);
1204 1204
1205// qDebug("Reading %d", currentServerConfig); 1205// qDebug("Reading %d", currentServerConfig);
1206 serverComboSelected( currentServerConfig-1); 1206 serverComboSelected( currentServerConfig-1);
1207 1207
1208} 1208}
1209 1209
@@ -1255,5 +1255,5 @@ void OpieFtp::writeConfig()
1255 1255
1256 cfg.writeEntry("numberOfEntries", QString::number(numberOfEntries + 1 )); 1256 cfg.writeEntry("numberOfEntries", QString::number(numberOfEntries + 1 ));
1257 1257
1258 } 1258 }
1259} 1259}
@@ -1327,7 +1327,7 @@ void OpieFtp::serverComboSelected(int index)
1327 int portInt = port.toInt(&ok,10); 1327 int portInt = port.toInt(&ok,10);
1328 if( portInt == 0) portInt = 21; 1328 if( portInt == 0) portInt = 21;
1329 1329
1330 ServerComboBox->lineEdit()->setText(remoteServerStr.left( remoteServerStr.find(":",0,TRUE))); 1330 ServerComboBox->lineEdit()->setText(remoteServerStr.left( remoteServerStr.find(":",0,TRUE)));
1331 1331
1332 PortSpinBox->setValue( portInt); 1332 PortSpinBox->setValue( portInt);
1333 1333
@@ -1341,5 +1341,5 @@ void OpieFtp::serverComboSelected(int index)
1341// UsernameComboBox 1341// UsernameComboBox
1342// PasswordEdit 1342// PasswordEdit
1343 1343
1344 cfg.setGroup("Server"); 1344 cfg.setGroup("Server");
1345 temp.sprintf("%d",currentServerConfig); 1345 temp.sprintf("%d",currentServerConfig);
@@ -1359,5 +1359,5 @@ void OpieFtp::deleteServer()
1359 username = UsernameComboBox->currentText(); 1359 username = UsernameComboBox->currentText();
1360 servername=serverListView->currentText(); 1360 servername=serverListView->currentText();
1361 1361
1362 Config cfg("opieftp"); 1362 Config cfg("opieftp");
1363 cfg.setGroup("Server"); 1363 cfg.setGroup("Server");
@@ -1494,5 +1494,5 @@ void OpieFtp::NewServer() {
1494 currentServerConfig =-1; 1494 currentServerConfig =-1;
1495 writeConfig(); 1495 writeConfig();
1496 serverListView->insertItem( newServerName ); 1496 serverListView->insertItem( newServerName );
1497 serverListView->setCurrentItem( serverListView->count()); 1497 serverListView->setCurrentItem( serverListView->count());
1498 } 1498 }
diff --git a/noncore/net/opieftp/opieftp.h b/noncore/net/opieftp/opieftp.h
index 9d5d211..7bd615a 100644
--- a/noncore/net/opieftp/opieftp.h
+++ b/noncore/net/opieftp/opieftp.h
@@ -48,7 +48,8 @@ class OpieFtp : public QMainWindow
48 48
49public: 49public:
50 OpieFtp( ); 50 OpieFtp( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
51 ~OpieFtp(); 51 ~OpieFtp();
52 52
53 static QString appName() { return QString::fromLatin1("opieftp"); }
53 QTabWidget *TabWidget; 54 QTabWidget *TabWidget;
54 QWidget *tab, *tab_2, *tab_3; 55 QWidget *tab, *tab_2, *tab_3;
diff --git a/noncore/net/opieftp/opieftp.pro b/noncore/net/opieftp/opieftp.pro
index ac16819..185c341 100644
--- a/noncore/net/opieftp/opieftp.pro
+++ b/noncore/net/opieftp/opieftp.pro
@@ -1,8 +1,6 @@
1TEMPLATE = app 1CONFIG += qt warn_on release quick-app
2CONFIG += qt warn_on release 2HEADERS = opieftp.h inputDialog.h
3HEADERS = opieftp.h inputDialog.h
4SOURCES = opieftp.cpp inputDialog.cpp main.cpp 3SOURCES = opieftp.cpp inputDialog.cpp main.cpp
5TARGET = opieftp 4TARGET = opieftp
6DESTDIR = $(OPIEDIR)/bin
7INCLUDEPATH += $(OPIEDIR)/include 5INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += $(OPIEDIR)/include 6DEPENDPATH += $(OPIEDIR)/include