summaryrefslogtreecommitdiff
path: root/noncore/net/opieftp/opieftp.cpp
Unidiff
Diffstat (limited to 'noncore/net/opieftp/opieftp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp58
1 files changed, 29 insertions, 29 deletions
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
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" ) );
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
823void OpieFtp::localListClicked(QListViewItem *selectedItem) 823void 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
1011void OpieFtp::remoteMakDir() 1011void 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
1210void OpieFtp::writeConfig() 1210void 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}