author | alwin <alwin> | 2004-03-01 14:05:40 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-01 14:05:40 (UTC) |
commit | 0f3d8aba2d2de77b1366ece1685cb720ea9b841f (patch) (side-by-side diff) | |
tree | 31a105cc9dca06e4a3339e1c684be773e497b3f5 | |
parent | aa4539e4ccc23c47f720819e23c9a6faf53a4df8 (diff) | |
download | opie-0f3d8aba2d2de77b1366ece1685cb720ea9b841f.zip opie-0f3d8aba2d2de77b1366ece1685cb720ea9b841f.tar.gz opie-0f3d8aba2d2de77b1366ece1685cb720ea9b841f.tar.bz2 |
just modified this way, that it not longer crashes when just startet.
but completly unusable. Who will maintain this stuff? If no one will
do it, we should remove this app in next opie release 'cause this
moment it makes no sense.
-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 2b29d83..24da195 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp @@ -35,12 +35,13 @@ extern "C" { #include <qspinbox.h> #include <qtabwidget.h> #include <qlayout.h> #include <qmessagebox.h> #include <qlineedit.h> #include <qlistbox.h> +#include <qvbox.h> #include <unistd.h> #include <stdlib.h> QProgressBar *ProgressBar; @@ -57,18 +58,24 @@ static int log_progress(netbuf *, int xfered, void *) return 1; } OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) : QMainWindow( parent, name, fl ) { + qDebug("OpieFtp constructor"); setCaption( tr( "OpieFtp" ) ); fuckeduphack=FALSE; - QGridLayout *layout = new QGridLayout( this ); + + QVBox* wrapperBox = new QVBox( this ); + setCentralWidget( wrapperBox ); + + QWidget *view = new QWidget( wrapperBox ); + + QGridLayout *layout = new QGridLayout( view ); layout->setSpacing( 2); layout->setMargin( 2); - connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); QMenuBar *menuBar = new QMenuBar(this); // QToolBar *menuBar = new QToolBar(this); // menuBar->setHorizontalStretchable( TRUE ); @@ -79,13 +86,15 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) connectionMenu = new QPopupMenu( this ); localMenu = new QPopupMenu( this ); remoteMenu = new QPopupMenu( this ); tabMenu = new QPopupMenu( this ); +#if 0 layout->addMultiCellWidget( menuBar, 0, 0, 0, 2 ); +#endif menuBar->insertItem( tr( "Connection" ), connectionMenu); // menuBar->insertItem( tr( "Local" ), localMenu); // menuBar->insertItem( tr( "Remote" ), remoteMenu); menuBar->insertItem( tr( "View" ), tabMenu); @@ -117,34 +126,33 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) tabMenu->insertItem( tr( "Switch to Config" ), this, SLOT( switchToConfigTab() )); tabMenu->insertSeparator(); // tabMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); tabMenu->setCheckable(TRUE); - - cdUpButton = new QToolButton( this,"cdUpButton"); + cdUpButton = new QToolButton( view,"cdUpButton"); cdUpButton->setPixmap(Resource::loadPixmap("up")); cdUpButton ->setFixedSize( QSize( 20, 20 ) ); connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); layout->addMultiCellWidget( cdUpButton, 0, 0, 3, 3 ); cdUpButton->hide(); -// docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton"); +// docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",view,"docsButton"); // docButton->setFixedSize( QSize( 20, 20 ) ); // connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); // docButton->setFlat(TRUE); // layout->addMultiCellWidget( docButton, 0, 0, 6, 6 ); - homeButton = new QToolButton(this,"homeButton"); + homeButton = new QToolButton(view,"homeButton"); homeButton->setPixmap( Resource::loadPixmap("home")); homeButton->setFixedSize( QSize( 20, 20 ) ); connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); layout->addMultiCellWidget( homeButton, 0, 0, 4, 4); homeButton->hide(); - TabWidget = new QTabWidget( this, "TabWidget" ); + TabWidget = new QTabWidget( view, "TabWidget" ); layout->addMultiCellWidget( TabWidget, 1, 1, 0, 4 ); // TabWidget->setTabShape(QTabWidget::Triangular); tab = new QWidget( TabWidget, "tab" ); tabLayout = new QGridLayout( tab ); @@ -288,42 +296,48 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); tabLayout_3->addItem( spacer, 5, 0 ); TabWidget->insertTab( tab_3, tr( "Config" ) ); +#if 0 connect(TabWidget,SIGNAL(currentChanged(QWidget *)), this,SLOT(tabChanged(QWidget*))); +#endif currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); currentDir.setPath( QDir::currentDirPath()); // currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); - currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); + currentPathCombo = new QComboBox( FALSE, view, "currentPathCombo" ); layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 4); currentPathCombo ->setFixedWidth(220); currentPathCombo->setEditable(TRUE); currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); +#if 0 connect( currentPathCombo, SIGNAL( activated( const QString & ) ), this, SLOT( currentPathComboActivated( const QString & ) ) ); connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), this,SLOT(currentPathComboChanged())); - - ProgressBar = new QProgressBar( this, "ProgressBar" ); +#endif + ProgressBar = new QProgressBar( view, "ProgressBar" ); layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 4); ProgressBar->setMaximumHeight(10); filterStr="*"; b=FALSE; +#if 0 populateLocalView(); +#endif readConfig(); // ServerComboBox->setCurrentItem(currentServerConfig); TabWidget->setCurrentPage(2); + qDebug("Constructor done"); } OpieFtp::~OpieFtp() { } @@ -647,26 +661,26 @@ void OpieFtp::populateLocalView() const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); QFileInfoListIterator it(*list); QFileInfo *fi; while ( (fi=it.current()) ) { if (fi->isSymLink() ){ QString symLink=fi->readLink(); -// qDebug("Symlink detected "+symLink); + qDebug("Symlink detected "+symLink); QFileInfo sym( symLink); fileS.sprintf( "%10i", sym.size() ); fileL.sprintf( "%s -> %s", fi->fileName().data(),sym.absFilePath().data() ); fileDate = sym.lastModified().toString(); } else { -// qDebug("Not a dir: "+currentDir.canonicalPath()+fileL); + qDebug("Not a dir: "+currentDir.canonicalPath()+fileL); fileS.sprintf( "%10i", fi->size() ); fileL.sprintf( "%s",fi->fileName().data() ); fileDate= fi->lastModified().toString(); if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) { fileL+="/"; isDir=TRUE; -// qDebug( fileL); + qDebug( fileL); } } if(fileL !="./" && fi->exists()) { item = new QListViewItem( Local_View,fileL, fileDate, fileS ); QPixmap pm; |