author | mickeyl <mickeyl> | 2003-10-29 18:18:19 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-10-29 18:18:19 (UTC) |
commit | 1af1f1d9f398d38a2bc666cd2edff5725da7a770 (patch) (unidiff) | |
tree | b3bb0d90cafc1e933b5b9297a7b2669ce3b184ea /noncore/net/opieftp | |
parent | 35615947e11575a61456c8483e7f6d67fe59d5ed (diff) | |
download | opie-1af1f1d9f398d38a2bc666cd2edff5725da7a770.zip opie-1af1f1d9f398d38a2bc666cd2edff5725da7a770.tar.gz opie-1af1f1d9f398d38a2bc666cd2edff5725da7a770.tar.bz2 |
mrege noncore/net/*
-rw-r--r-- | noncore/net/opieftp/main.cpp | 15 | ||||
-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 58 | ||||
-rw-r--r-- | noncore/net/opieftp/opieftp.h | 3 | ||||
-rw-r--r-- | noncore/net/opieftp/opieftp.pro | 6 |
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 | |||
@@ -10,18 +10,7 @@ | |||
10 | * the Free Software Foundation; either version 2 of the License, or * | 10 | * the Free Software Foundation; either version 2 of the License, or * |
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 | ||
19 | int main(int argc, char *argv[]) | 16 | OPIE_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 | |||
@@ -57,8 +57,8 @@ static int log_progress(netbuf *, int xfered, void *) | |||
57 | return 1; | 57 | return 1; |
58 | } | 58 | } |
59 | 59 | ||
60 | OpieFtp::OpieFtp( ) | 60 | OpieFtp::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" ) ); |
64 | fuckeduphack=FALSE; | 64 | fuckeduphack=FALSE; |
@@ -81,7 +81,7 @@ OpieFtp::OpieFtp( ) | |||
81 | localMenu = new QPopupMenu( this ); | 81 | localMenu = new QPopupMenu( this ); |
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 | ||
87 | menuBar->insertItem( tr( "Connection" ), connectionMenu); | 87 | menuBar->insertItem( tr( "Connection" ), connectionMenu); |
@@ -269,18 +269,18 @@ OpieFtp::OpieFtp( ) | |||
269 | 269 | ||
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 | ||
286 | connect(deleteServerBtn,SIGNAL(clicked()),SLOT(deleteServer())); | 286 | connect(deleteServerBtn,SIGNAL(clicked()),SLOT(deleteServer())); |
@@ -319,7 +319,7 @@ OpieFtp::OpieFtp( ) | |||
319 | readConfig(); | 319 | readConfig(); |
320 | 320 | ||
321 | // ServerComboBox->setCurrentItem(currentServerConfig); | 321 | // ServerComboBox->setCurrentItem(currentServerConfig); |
322 | 322 | ||
323 | TabWidget->setCurrentPage(2); | 323 | TabWidget->setCurrentPage(2); |
324 | } | 324 | } |
325 | 325 | ||
@@ -357,7 +357,7 @@ void OpieFtp::tabChanged(QWidget *) | |||
357 | cdUpButton->show(); | 357 | cdUpButton->show(); |
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) { |
363 | currentPathCombo->lineEdit()->setText( currentRemoteDir ); | 363 | currentPathCombo->lineEdit()->setText( currentRemoteDir ); |
@@ -449,7 +449,7 @@ void OpieFtp::connector() | |||
449 | // if( ftp_user != cfg.readEntry("Username")) | 449 | // if( ftp_user != cfg.readEntry("Username")) |
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 | ||
455 | if(ftp_host.find("ftp://",0, TRUE) != -1 ) | 455 | if(ftp_host.find("ftp://",0, TRUE) != -1 ) |
@@ -593,7 +593,7 @@ void OpieFtp::remoteDownload() | |||
593 | for ( ; it.current(); ++it ) { | 593 | for ( ; it.current(); ++it ) { |
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(); |
599 | // QCopEnvelope ( "QPE/System", "notBusy()" ); | 599 | // QCopEnvelope ( "QPE/System", "notBusy()" ); |
@@ -669,7 +669,7 @@ void OpieFtp::populateLocalView() | |||
669 | if(fileL !="./" && fi->exists()) { | 669 | if(fileL !="./" && fi->exists()) { |
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()) |
675 | pm = Resource::loadPixmap( "lockedfolder" ); | 675 | pm = Resource::loadPixmap( "lockedfolder" ); |
@@ -729,7 +729,7 @@ bool OpieFtp::populateRemoteView( ) | |||
729 | int len, month = monthRe.match(s, 0, &len); | 729 | int len, month = monthRe.match(s, 0, &len); |
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 |
735 | fileS = fileS.stripWhiteSpace(); | 735 | fileS = fileS.stripWhiteSpace(); |
@@ -815,15 +815,15 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) | |||
815 | currentPathCombo->lineEdit()->setText( currentRemoteDir); | 815 | currentPathCombo->lineEdit()->setText( currentRemoteDir); |
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 | } |
822 | 822 | ||
823 | void OpieFtp::localListClicked(QListViewItem *selectedItem) | 823 | 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); |
829 | strSize=strSize.stripWhiteSpace(); | 829 | strSize=strSize.stripWhiteSpace(); |
@@ -836,7 +836,7 @@ void OpieFtp::localListClicked(QListViewItem *selectedItem) | |||
836 | } | 836 | } |
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); |
842 | currentDir.cd(strItem,FALSE); | 842 | currentDir.cd(strItem,FALSE); |
@@ -858,7 +858,7 @@ void OpieFtp::localListClicked(QListViewItem *selectedItem) | |||
858 | } //end not symlink | 858 | } //end not symlink |
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 | } |
864 | 864 | ||
@@ -972,7 +972,7 @@ void OpieFtp::localDelete() | |||
972 | if ( it.current()->isSelected() ) { | 972 | if ( it.current()->isSelected() ) { |
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() ) { |
978 | switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+ | 978 | switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+ |
@@ -997,7 +997,7 @@ void OpieFtp::localDelete() | |||
997 | system( cmd.latin1()); | 997 | system( cmd.latin1()); |
998 | } | 998 | } |
999 | break; | 999 | break; |
1000 | case 1: | 1000 | case 1: |
1001 | // exit | 1001 | // exit |
1002 | break; | 1002 | break; |
1003 | }; | 1003 | }; |
@@ -1005,7 +1005,7 @@ void OpieFtp::localDelete() | |||
1005 | } | 1005 | } |
1006 | } | 1006 | } |
1007 | populateLocalView(); | 1007 | populateLocalView(); |
1008 | 1008 | ||
1009 | } | 1009 | } |
1010 | 1010 | ||
1011 | void OpieFtp::remoteMakDir() | 1011 | void OpieFtp::remoteMakDir() |
@@ -1201,10 +1201,10 @@ void OpieFtp::readConfig() | |||
1201 | Config cfg("opieftp"); | 1201 | Config cfg("opieftp"); |
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 | ||
1210 | void OpieFtp::writeConfig() | 1210 | void OpieFtp::writeConfig() |
@@ -1254,7 +1254,7 @@ void OpieFtp::writeConfig() | |||
1254 | cfg.setGroup("Server"); | 1254 | cfg.setGroup("Server"); |
1255 | 1255 | ||
1256 | cfg.writeEntry("numberOfEntries", QString::number(numberOfEntries + 1 )); | 1256 | cfg.writeEntry("numberOfEntries", QString::number(numberOfEntries + 1 )); |
1257 | 1257 | ||
1258 | } | 1258 | } |
1259 | } | 1259 | } |
1260 | 1260 | ||
@@ -1326,9 +1326,9 @@ void OpieFtp::serverComboSelected(int index) | |||
1326 | bool ok; | 1326 | bool ok; |
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 | ||
1334 | remotePath->setText(cfg.readEntry("RemotePath", "/")); | 1334 | remotePath->setText(cfg.readEntry("RemotePath", "/")); |
@@ -1340,7 +1340,7 @@ void OpieFtp::serverComboSelected(int index) | |||
1340 | PasswordEdit->setText(cfg.readEntryCrypt(username, "me@opieftp.org")); | 1340 | PasswordEdit->setText(cfg.readEntryCrypt(username, "me@opieftp.org")); |
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); |
1346 | cfg.writeEntry("currentServer", temp); | 1346 | cfg.writeEntry("currentServer", temp); |
@@ -1358,7 +1358,7 @@ void OpieFtp::deleteServer() | |||
1358 | remoteServerStr = ServerComboBox->currentText( ); | 1358 | remoteServerStr = ServerComboBox->currentText( ); |
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"); |
1364 | QString tempname; | 1364 | QString tempname; |
@@ -1493,7 +1493,7 @@ void OpieFtp::NewServer() { | |||
1493 | } | 1493 | } |
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 | } |
1499 | } | 1499 | } |
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 | |||
@@ -47,9 +47,10 @@ class OpieFtp : public QMainWindow | |||
47 | Q_OBJECT | 47 | Q_OBJECT |
48 | 48 | ||
49 | public: | 49 | public: |
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; |
55 | QListView *Local_View, *Remote_View; | 56 | QListView *Local_View, *Remote_View; |
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,9 +1,7 @@ | |||
1 | TEMPLATE = app | 1 | CONFIG += qt warn_on release quick-app |
2 | CONFIG += qt warn_on release | 2 | HEADERS = opieftp.h inputDialog.h |
3 | HEADERS = opieftp.h inputDialog.h | ||
4 | SOURCES = opieftp.cpp inputDialog.cpp main.cpp | 3 | SOURCES = opieftp.cpp inputDialog.cpp main.cpp |
5 | TARGET = opieftp | 4 | TARGET = opieftp |
6 | DESTDIR = $(OPIEDIR)/bin | ||
7 | INCLUDEPATH += $(OPIEDIR)/include | 5 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include | 6 | DEPENDPATH += $(OPIEDIR)/include |
9 | LIBS += -lqpe -lftplib | 7 | LIBS += -lqpe -lftplib |