author | mickeyl <mickeyl> | 2003-10-29 18:18:19 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-10-29 18:18:19 (UTC) |
commit | 1af1f1d9f398d38a2bc666cd2edff5725da7a770 (patch) (side-by-side diff) | |
tree | b3bb0d90cafc1e933b5b9297a7b2669ce3b184ea /noncore/net/opieftp/opieftp.cpp | |
parent | 35615947e11575a61456c8483e7f6d67fe59d5ed (diff) | |
download | opie-1af1f1d9f398d38a2bc666cd2edff5725da7a770.zip opie-1af1f1d9f398d38a2bc666cd2edff5725da7a770.tar.gz opie-1af1f1d9f398d38a2bc666cd2edff5725da7a770.tar.bz2 |
mrege noncore/net/*
Diffstat (limited to 'noncore/net/opieftp/opieftp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 58 |
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 @@ -56,10 +56,10 @@ static int log_progress(netbuf *, int xfered, void *) qApp->processEvents(); return 1; } -OpieFtp::OpieFtp( ) - : QMainWindow( ) +OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) + : QMainWindow( parent, name, fl ) { setCaption( tr( "OpieFtp" ) ); fuckeduphack=FALSE; QGridLayout *layout = new QGridLayout( this ); @@ -80,9 +80,9 @@ OpieFtp::OpieFtp( ) 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); @@ -268,20 +268,20 @@ OpieFtp::OpieFtp( ) tabLayout_3->addMultiCellWidget( serverListView , 5, 5, 0, 5); connect( serverListView, SIGNAL( highlighted( const QString &)), this,SLOT( serverListClicked( const QString &) ) ); - - connectServerBtn = new QPushButton( "Connect", tab_3 , "ConnectButton" ); + + connectServerBtn = new QPushButton( tr("Connect"), tab_3 , "ConnectButton" ); tabLayout_3->addMultiCellWidget( connectServerBtn, 6, 6, 0, 1); connectServerBtn->setToggleButton(TRUE); connect(connectServerBtn,SIGNAL( toggled( bool)),SLOT( connectorBtnToggled(bool) )); - newServerButton= new QPushButton( "Add", tab_3 , "NewServerButton" ); + newServerButton= new QPushButton( tr("Add"), tab_3 , "NewServerButton" ); tabLayout_3->addMultiCellWidget( newServerButton, 6, 6, 2, 2); connect( newServerButton,SIGNAL( clicked()),SLOT( NewServer() )); QPushButton *deleteServerBtn; - deleteServerBtn = new QPushButton( "Delete", tab_3 , "OpenButton" ); + deleteServerBtn = new QPushButton( tr("Delete"), tab_3 , "OpenButton" ); tabLayout_3->addMultiCellWidget( deleteServerBtn, 6, 6, 3, 3); connect(deleteServerBtn,SIGNAL(clicked()),SLOT(deleteServer())); @@ -318,9 +318,9 @@ OpieFtp::OpieFtp( ) populateLocalView(); readConfig(); // ServerComboBox->setCurrentItem(currentServerConfig); - + TabWidget->setCurrentPage(2); } OpieFtp::~OpieFtp() @@ -356,9 +356,9 @@ void OpieFtp::tabChanged(QWidget *) if(cdUpButton->isHidden()) cdUpButton->show(); if(homeButton->isHidden()) homeButton->show(); - + } if (TabWidget->currentPageIndex() == 1) { currentPathCombo->lineEdit()->setText( currentRemoteDir ); tabMenu->setItemChecked(tabMenu->idAt(1),TRUE); @@ -448,9 +448,9 @@ void OpieFtp::connector() // cfg.setGroup(QString::number(current)); // if( ftp_user != cfg.readEntry("Username")) // currentServerConfig=-1; // if(ftp_pass != cfg.readEntry(cfg.readEntry("Username"))) -// currentServerConfig=-1; +// currentServerConfig=-1; if(ftp_host.find("ftp://",0, TRUE) != -1 ) ftp_host=ftp_host.right(ftp_host.length()-6); @@ -592,9 +592,9 @@ void OpieFtp::remoteDownload() } for ( ; it.current(); ++it ) { Remote_View->clearSelection(); } - Remote_View->setFocus(); + Remote_View->setFocus(); TabWidget->setCurrentPage(0); populateLocalView(); // QCopEnvelope ( "QPE/System", "notBusy()" ); } @@ -668,9 +668,9 @@ void OpieFtp::populateLocalView() } if(fileL !="./" && fi->exists()) { 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 @@ -728,9 +728,9 @@ bool OpieFtp::populateRemoteView( ) int len, month = monthRe.match(s, 0, &len); fileDate = s.mid(month + 1, len - 2); // minus spaces fileL = s.right(s.length() - month - len); - if(s.left(1) == "d") + if(s.left(1) == "d") fileL = fileL+"/"; fileS = s.mid(month - 8, 8); // FIXME fileS = fileS.stripWhiteSpace(); @@ -814,17 +814,17 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) currentRemoteDir +="/"; currentPathCombo->lineEdit()->setText( currentRemoteDir); fillRemoteCombo( (const QString &)currentRemoteDir); // QCopEnvelope ( "QPE/System", "notBusy()" ); - Remote_View->ensureItemVisible(Remote_View->firstChild()); - + Remote_View->ensureItemVisible(Remote_View->firstChild()); + } } void OpieFtp::localListClicked(QListViewItem *selectedItem) { if(selectedItem!= NULL) { - + QString strItem=selectedItem->text(0); QString strSize=selectedItem->text(1); strSize=strSize.stripWhiteSpace(); if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink @@ -835,9 +835,9 @@ void OpieFtp::localListClicked(QListViewItem *selectedItem) populateLocalView(); } } else { // not a symlink if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { - + if(QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem)).exists() ) { strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); currentDir.cd(strItem,FALSE); populateLocalView(); @@ -857,9 +857,9 @@ void OpieFtp::localListClicked(QListViewItem *selectedItem) } } //end not symlink chdir(strItem.latin1()); } - Local_View->ensureItemVisible(Local_View->firstChild()); + Local_View->ensureItemVisible(Local_View->firstChild()); } } void OpieFtp::doLocalCd() @@ -971,9 +971,9 @@ void OpieFtp::localDelete() for ( ; it.current(); ++it ) { if ( it.current()->isSelected() ) { QString f = it.current()->text(0); it.current()->setSelected(FALSE); - + // QString f = Local_View->currentItem()->text(0); if(QDir(f).exists() ) { switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+ tr(" ?\nIt must be empty"),tr("Yes"),tr("No"),0,0,1) ) { @@ -996,17 +996,17 @@ void OpieFtp::localDelete() QString cmd="rm "+f; system( cmd.latin1()); } break; - case 1: + case 1: // exit break; }; } } } populateLocalView(); - + } void OpieFtp::remoteMakDir() { @@ -1200,12 +1200,12 @@ void OpieFtp::readConfig() fillCombos(); Config cfg("opieftp"); cfg.setGroup("Server"); currentServerConfig = cfg.readNumEntry("currentServer", -1); - + // qDebug("Reading %d", currentServerConfig); serverComboSelected( currentServerConfig-1); - + } void OpieFtp::writeConfig() { @@ -1253,9 +1253,9 @@ void OpieFtp::writeConfig() cfg.writeEntryCrypt( UsernameComboBox->currentText(), PasswordEdit->text()); cfg.setGroup("Server"); cfg.writeEntry("numberOfEntries", QString::number(numberOfEntries + 1 )); - + } } void OpieFtp::clearCombos() { @@ -1325,11 +1325,11 @@ void OpieFtp::serverComboSelected(int index) port = remoteServerStr.right( divider - 1); bool ok; int portInt = port.toInt(&ok,10); if( portInt == 0) portInt = 21; - + ServerComboBox->lineEdit()->setText(remoteServerStr.left( remoteServerStr.find(":",0,TRUE))); - + PortSpinBox->setValue( portInt); remotePath->setText(cfg.readEntry("RemotePath", "/")); @@ -1339,9 +1339,9 @@ void OpieFtp::serverComboSelected(int index) // qDebug("Password is "+cfg.readEntryCrypt(username, "me@opieftp.org")); PasswordEdit->setText(cfg.readEntryCrypt(username, "me@opieftp.org")); // UsernameComboBox // PasswordEdit - + cfg.setGroup("Server"); temp.sprintf("%d",currentServerConfig); cfg.writeEntry("currentServer", temp); @@ -1357,9 +1357,9 @@ void OpieFtp::deleteServer() QString username, remoteServerStr, remotePathStr, password, port, temp, servername; remoteServerStr = ServerComboBox->currentText( ); username = UsernameComboBox->currentText(); servername=serverListView->currentText(); - + Config cfg("opieftp"); cfg.setGroup("Server"); QString tempname; int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); @@ -1492,9 +1492,9 @@ void OpieFtp::NewServer() { } } currentServerConfig =-1; writeConfig(); - serverListView->insertItem( newServerName ); + serverListView->insertItem( newServerName ); serverListView->setCurrentItem( serverListView->count()); } } |