-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 | |||
@@ -39,4 +39,5 @@ extern "C" { | |||
39 | #include <qlineedit.h> | 39 | #include <qlineedit.h> |
40 | #include <qlistbox.h> | 40 | #include <qlistbox.h> |
41 | #include <qvbox.h> | ||
41 | 42 | ||
42 | #include <unistd.h> | 43 | #include <unistd.h> |
@@ -61,10 +62,16 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) | |||
61 | : QMainWindow( parent, name, fl ) | 62 | : QMainWindow( parent, name, fl ) |
62 | { | 63 | { |
64 | qDebug("OpieFtp constructor"); | ||
63 | setCaption( tr( "OpieFtp" ) ); | 65 | setCaption( tr( "OpieFtp" ) ); |
64 | fuckeduphack=FALSE; | 66 | fuckeduphack=FALSE; |
65 | QGridLayout *layout = new QGridLayout( this ); | 67 | |
68 | QVBox* wrapperBox = new QVBox( this ); | ||
69 | setCentralWidget( wrapperBox ); | ||
70 | |||
71 | QWidget *view = new QWidget( wrapperBox ); | ||
72 | |||
73 | QGridLayout *layout = new QGridLayout( view ); | ||
66 | layout->setSpacing( 2); | 74 | layout->setSpacing( 2); |
67 | layout->setMargin( 2); | 75 | layout->setMargin( 2); |
68 | |||
69 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 76 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
70 | 77 | ||
@@ -83,5 +90,7 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) | |||
83 | tabMenu = new QPopupMenu( this ); | 90 | tabMenu = new QPopupMenu( this ); |
84 | 91 | ||
92 | #if 0 | ||
85 | layout->addMultiCellWidget( menuBar, 0, 0, 0, 2 ); | 93 | layout->addMultiCellWidget( menuBar, 0, 0, 0, 2 ); |
94 | #endif | ||
86 | 95 | ||
87 | menuBar->insertItem( tr( "Connection" ), connectionMenu); | 96 | menuBar->insertItem( tr( "Connection" ), connectionMenu); |
@@ -121,6 +130,5 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) | |||
121 | 130 | ||
122 | 131 | ||
123 | 132 | cdUpButton = new QToolButton( view,"cdUpButton"); | |
124 | cdUpButton = new QToolButton( this,"cdUpButton"); | ||
125 | cdUpButton->setPixmap(Resource::loadPixmap("up")); | 133 | cdUpButton->setPixmap(Resource::loadPixmap("up")); |
126 | cdUpButton ->setFixedSize( QSize( 20, 20 ) ); | 134 | cdUpButton ->setFixedSize( QSize( 20, 20 ) ); |
@@ -129,5 +137,5 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) | |||
129 | cdUpButton->hide(); | 137 | cdUpButton->hide(); |
130 | 138 | ||
131 | // docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton"); | 139 | // docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",view,"docsButton"); |
132 | // docButton->setFixedSize( QSize( 20, 20 ) ); | 140 | // docButton->setFixedSize( QSize( 20, 20 ) ); |
133 | // connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); | 141 | // connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); |
@@ -135,5 +143,5 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) | |||
135 | // layout->addMultiCellWidget( docButton, 0, 0, 6, 6 ); | 143 | // layout->addMultiCellWidget( docButton, 0, 0, 6, 6 ); |
136 | 144 | ||
137 | homeButton = new QToolButton(this,"homeButton"); | 145 | homeButton = new QToolButton(view,"homeButton"); |
138 | homeButton->setPixmap( Resource::loadPixmap("home")); | 146 | homeButton->setPixmap( Resource::loadPixmap("home")); |
139 | homeButton->setFixedSize( QSize( 20, 20 ) ); | 147 | homeButton->setFixedSize( QSize( 20, 20 ) ); |
@@ -142,5 +150,5 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) | |||
142 | homeButton->hide(); | 150 | homeButton->hide(); |
143 | 151 | ||
144 | TabWidget = new QTabWidget( this, "TabWidget" ); | 152 | TabWidget = new QTabWidget( view, "TabWidget" ); |
145 | layout->addMultiCellWidget( TabWidget, 1, 1, 0, 4 ); | 153 | layout->addMultiCellWidget( TabWidget, 1, 1, 0, 4 ); |
146 | 154 | ||
@@ -292,6 +300,8 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) | |||
292 | TabWidget->insertTab( tab_3, tr( "Config" ) ); | 300 | TabWidget->insertTab( tab_3, tr( "Config" ) ); |
293 | 301 | ||
302 | #if 0 | ||
294 | connect(TabWidget,SIGNAL(currentChanged(QWidget *)), | 303 | connect(TabWidget,SIGNAL(currentChanged(QWidget *)), |
295 | this,SLOT(tabChanged(QWidget*))); | 304 | this,SLOT(tabChanged(QWidget*))); |
305 | #endif | ||
296 | 306 | ||
297 | currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 307 | currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
@@ -299,5 +309,5 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) | |||
299 | // currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | 309 | // currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); |
300 | 310 | ||
301 | currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); | 311 | currentPathCombo = new QComboBox( FALSE, view, "currentPathCombo" ); |
302 | layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 4); | 312 | layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 4); |
303 | currentPathCombo ->setFixedWidth(220); | 313 | currentPathCombo ->setFixedWidth(220); |
@@ -305,4 +315,5 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) | |||
305 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 315 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
306 | 316 | ||
317 | #if 0 | ||
307 | connect( currentPathCombo, SIGNAL( activated( const QString & ) ), | 318 | connect( currentPathCombo, SIGNAL( activated( const QString & ) ), |
308 | this, SLOT( currentPathComboActivated( const QString & ) ) ); | 319 | this, SLOT( currentPathComboActivated( const QString & ) ) ); |
@@ -310,11 +321,13 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) | |||
310 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), | 321 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), |
311 | this,SLOT(currentPathComboChanged())); | 322 | this,SLOT(currentPathComboChanged())); |
312 | 323 | #endif | |
313 | ProgressBar = new QProgressBar( this, "ProgressBar" ); | 324 | ProgressBar = new QProgressBar( view, "ProgressBar" ); |
314 | layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 4); | 325 | layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 4); |
315 | ProgressBar->setMaximumHeight(10); | 326 | ProgressBar->setMaximumHeight(10); |
316 | filterStr="*"; | 327 | filterStr="*"; |
317 | b=FALSE; | 328 | b=FALSE; |
329 | #if 0 | ||
318 | populateLocalView(); | 330 | populateLocalView(); |
331 | #endif | ||
319 | readConfig(); | 332 | readConfig(); |
320 | 333 | ||
@@ -322,4 +335,5 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) | |||
322 | 335 | ||
323 | TabWidget->setCurrentPage(2); | 336 | TabWidget->setCurrentPage(2); |
337 | qDebug("Constructor done"); | ||
324 | } | 338 | } |
325 | 339 | ||
@@ -651,5 +665,5 @@ void OpieFtp::populateLocalView() | |||
651 | if (fi->isSymLink() ){ | 665 | if (fi->isSymLink() ){ |
652 | QString symLink=fi->readLink(); | 666 | QString symLink=fi->readLink(); |
653 | // qDebug("Symlink detected "+symLink); | 667 | qDebug("Symlink detected "+symLink); |
654 | QFileInfo sym( symLink); | 668 | QFileInfo sym( symLink); |
655 | fileS.sprintf( "%10i", sym.size() ); | 669 | fileS.sprintf( "%10i", sym.size() ); |
@@ -657,5 +671,5 @@ void OpieFtp::populateLocalView() | |||
657 | fileDate = sym.lastModified().toString(); | 671 | fileDate = sym.lastModified().toString(); |
658 | } else { | 672 | } else { |
659 | // qDebug("Not a dir: "+currentDir.canonicalPath()+fileL); | 673 | qDebug("Not a dir: "+currentDir.canonicalPath()+fileL); |
660 | fileS.sprintf( "%10i", fi->size() ); | 674 | fileS.sprintf( "%10i", fi->size() ); |
661 | fileL.sprintf( "%s",fi->fileName().data() ); | 675 | fileL.sprintf( "%s",fi->fileName().data() ); |
@@ -664,5 +678,5 @@ void OpieFtp::populateLocalView() | |||
664 | fileL+="/"; | 678 | fileL+="/"; |
665 | isDir=TRUE; | 679 | isDir=TRUE; |
666 | // qDebug( fileL); | 680 | qDebug( fileL); |
667 | } | 681 | } |
668 | } | 682 | } |