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 | |
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 @@ -11,17 +11,6 @@ * (at your option) any later version. * ***************************************************************************/ -#include <qpe/qpeapplication.h> - - - +#include <opie/oapplicationfactory.h> #include "opieftp.h" -int main(int argc, char *argv[]) -{ - QPEApplication a(argc, argv); - - OpieFtp opieftp; - a.showMainWidget( &opieftp); - return a.exec(); -} - +OPIE_EXPORT_APP( OApplicationFactory<OpieFtp> ) 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 *) } -OpieFtp::OpieFtp( ) - : QMainWindow( ) +OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) + : QMainWindow( parent, name, fl ) { setCaption( tr( "OpieFtp" ) ); @@ -82,5 +82,5 @@ OpieFtp::OpieFtp( ) remoteMenu = new QPopupMenu( this ); tabMenu = new QPopupMenu( this ); - + layout->addMultiCellWidget( menuBar, 0, 0, 0, 2 ); @@ -270,16 +270,16 @@ OpieFtp::OpieFtp( ) 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); @@ -320,5 +320,5 @@ OpieFtp::OpieFtp( ) // ServerComboBox->setCurrentItem(currentServerConfig); - + TabWidget->setCurrentPage(2); } @@ -358,5 +358,5 @@ void OpieFtp::tabChanged(QWidget *) if(homeButton->isHidden()) homeButton->show(); - + } if (TabWidget->currentPageIndex() == 1) { @@ -450,5 +450,5 @@ void OpieFtp::connector() // currentServerConfig=-1; // if(ftp_pass != cfg.readEntry(cfg.readEntry("Username"))) -// currentServerConfig=-1; +// currentServerConfig=-1; @@ -594,5 +594,5 @@ void OpieFtp::remoteDownload() Remote_View->clearSelection(); } - Remote_View->setFocus(); + Remote_View->setFocus(); TabWidget->setCurrentPage(0); populateLocalView(); @@ -670,5 +670,5 @@ void OpieFtp::populateLocalView() item = new QListViewItem( Local_View,fileL, fileDate, fileS ); QPixmap pm; - + if(isDir || fileL.find("/",0,TRUE) != -1) { if( !QDir( fi->filePath() ).isReadable()) @@ -730,5 +730,5 @@ bool OpieFtp::populateRemoteView( ) 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 @@ -816,6 +816,6 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) fillRemoteCombo( (const QString &)currentRemoteDir); // QCopEnvelope ( "QPE/System", "notBusy()" ); - Remote_View->ensureItemVisible(Remote_View->firstChild()); - + Remote_View->ensureItemVisible(Remote_View->firstChild()); + } } @@ -824,5 +824,5 @@ void OpieFtp::localListClicked(QListViewItem *selectedItem) { if(selectedItem!= NULL) { - + QString strItem=selectedItem->text(0); QString strSize=selectedItem->text(1); @@ -837,5 +837,5 @@ void OpieFtp::localListClicked(QListViewItem *selectedItem) } 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); @@ -859,5 +859,5 @@ void OpieFtp::localListClicked(QListViewItem *selectedItem) chdir(strItem.latin1()); } - Local_View->ensureItemVisible(Local_View->firstChild()); + Local_View->ensureItemVisible(Local_View->firstChild()); } } @@ -973,5 +973,5 @@ void OpieFtp::localDelete() QString f = it.current()->text(0); it.current()->setSelected(FALSE); - + // QString f = Local_View->currentItem()->text(0); if(QDir(f).exists() ) { @@ -998,5 +998,5 @@ void OpieFtp::localDelete() } break; - case 1: + case 1: // exit break; @@ -1006,5 +1006,5 @@ void OpieFtp::localDelete() } populateLocalView(); - + } @@ -1202,8 +1202,8 @@ void OpieFtp::readConfig() cfg.setGroup("Server"); currentServerConfig = cfg.readNumEntry("currentServer", -1); - + // qDebug("Reading %d", currentServerConfig); serverComboSelected( currentServerConfig-1); - + } @@ -1255,5 +1255,5 @@ void OpieFtp::writeConfig() cfg.writeEntry("numberOfEntries", QString::number(numberOfEntries + 1 )); - + } } @@ -1327,7 +1327,7 @@ void OpieFtp::serverComboSelected(int index) int portInt = port.toInt(&ok,10); if( portInt == 0) portInt = 21; - + ServerComboBox->lineEdit()->setText(remoteServerStr.left( remoteServerStr.find(":",0,TRUE))); - + PortSpinBox->setValue( portInt); @@ -1341,5 +1341,5 @@ void OpieFtp::serverComboSelected(int index) // UsernameComboBox // PasswordEdit - + cfg.setGroup("Server"); temp.sprintf("%d",currentServerConfig); @@ -1359,5 +1359,5 @@ void OpieFtp::deleteServer() username = UsernameComboBox->currentText(); servername=serverListView->currentText(); - + Config cfg("opieftp"); cfg.setGroup("Server"); @@ -1494,5 +1494,5 @@ void OpieFtp::NewServer() { currentServerConfig =-1; writeConfig(); - serverListView->insertItem( newServerName ); + serverListView->insertItem( newServerName ); serverListView->setCurrentItem( serverListView->count()); } 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 public: - OpieFtp( ); + OpieFtp( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ~OpieFtp(); + static QString appName() { return QString::fromLatin1("opieftp"); } QTabWidget *TabWidget; 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 @@ -TEMPLATE = app -CONFIG += qt warn_on release -HEADERS = opieftp.h inputDialog.h +CONFIG += qt warn_on release quick-app +HEADERS = opieftp.h inputDialog.h SOURCES = opieftp.cpp inputDialog.cpp main.cpp TARGET = opieftp -DESTDIR = $(OPIEDIR)/bin INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include |