-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 49 |
1 files changed, 31 insertions, 18 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index b703217..64146cb 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp | |||
@@ -40,4 +40,6 @@ using namespace Opie::Core; | |||
40 | #include <qmessagebox.h> | 40 | #include <qmessagebox.h> |
41 | #include <qmenubar.h> | 41 | #include <qmenubar.h> |
42 | #include <qpe/qpemenubar.h> | ||
43 | |||
42 | #include <qlineedit.h> | 44 | #include <qlineedit.h> |
43 | #include <qlistbox.h> | 45 | #include <qlistbox.h> |
@@ -74,10 +76,11 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) | |||
74 | 76 | ||
75 | QGridLayout *layout = new QGridLayout( view ); | 77 | QGridLayout *layout = new QGridLayout( view ); |
76 | layout->setSpacing( 2); | 78 | layout->setSpacing( 1); |
77 | layout->setMargin( 2); | 79 | layout->setMargin( 1); |
78 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 80 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
79 | 81 | ||
80 | QMenuBar *menuBar = new QMenuBar(this); | 82 | QPEMenuBar *menuBar = new QPEMenuBar(view); |
81 | // QToolBar *menuBar = new QToolBar(this); | 83 | // QMenuBar *menuBar = new QMenuBar(this); |
84 | // QPEToolBar *menuBar = new QPEToolBar(this); | ||
82 | // menuBar->setHorizontalStretchable( TRUE ); | 85 | // menuBar->setHorizontalStretchable( TRUE ); |
83 | 86 | ||
@@ -136,5 +139,5 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) | |||
136 | cdUpButton ->setFixedSize( QSize( 20, 20 ) ); | 139 | cdUpButton ->setFixedSize( QSize( 20, 20 ) ); |
137 | connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); | 140 | connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); |
138 | layout->addMultiCellWidget( cdUpButton, 0, 0, 3, 3 ); | 141 | layout->addMultiCellWidget( cdUpButton, 0, 0, 4, 4 ); |
139 | cdUpButton->hide(); | 142 | cdUpButton->hide(); |
140 | 143 | ||
@@ -145,10 +148,10 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) | |||
145 | // layout->addMultiCellWidget( docButton, 0, 0, 6, 6 ); | 148 | // layout->addMultiCellWidget( docButton, 0, 0, 6, 6 ); |
146 | 149 | ||
147 | homeButton = new QToolButton(view,"homeButton"); | 150 | homeButton = new QToolButton( view,"homeButton"); |
148 | homeButton->setPixmap( Resource::loadPixmap("home")); | 151 | homeButton->setPixmap( Resource::loadPixmap("home")); |
149 | homeButton->setFixedSize( QSize( 20, 20 ) ); | 152 | homeButton->setFixedSize( QSize( 20, 20 ) ); |
150 | connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); | 153 | connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); |
151 | layout->addMultiCellWidget( homeButton, 0, 0, 4, 4); | 154 | layout->addMultiCellWidget( homeButton, 0, 0, 3, 3); |
152 | homeButton->hide(); | 155 | homeButton->hide(); |
153 | 156 | ||
154 | TabWidget = new QTabWidget( view, "TabWidget" ); | 157 | TabWidget = new QTabWidget( view, "TabWidget" ); |
@@ -253,4 +256,7 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) | |||
253 | ServerComboBox = new QComboBox( FALSE, tab_3, "ServerComboBox" ); | 256 | ServerComboBox = new QComboBox( FALSE, tab_3, "ServerComboBox" ); |
254 | ServerComboBox->setEditable(TRUE); | 257 | ServerComboBox->setEditable(TRUE); |
258 | ServerComboBox->setAutoCompletion(true); | ||
259 | // ServerComboBox->blockSignals(true); | ||
260 | |||
255 | tabLayout_3->addMultiCellWidget( ServerComboBox, 3, 3, 0, 1 ); | 261 | tabLayout_3->addMultiCellWidget( ServerComboBox, 3, 3, 0, 1 ); |
256 | 262 | ||
@@ -1327,8 +1333,10 @@ void OpieFtp::fillCombos() | |||
1327 | void OpieFtp::serverComboSelected(int index) | 1333 | void OpieFtp::serverComboSelected(int index) |
1328 | { | 1334 | { |
1335 | QString servername; | ||
1329 | currentServerConfig = index+1; | 1336 | currentServerConfig = index+1; |
1330 | odebug << "server combo selected " << index+1 << "" << oendl; | 1337 | odebug << "server combo selected " << index + 1 << "" << oendl; |
1331 | QString username, remoteServerStr, remotePathStr, password, port, temp; | 1338 | QString username, remoteServerStr, remotePathStr, password, port, temp; |
1332 | // remoteServerStr = ServerComboBox->text(index); | 1339 | servername = remoteServerStr = ServerComboBox->text(index); |
1340 | qDebug("server text " + remoteServerStr); | ||
1333 | 1341 | ||
1334 | Config cfg("opieftp"); | 1342 | Config cfg("opieftp"); |
@@ -1336,10 +1344,13 @@ void OpieFtp::serverComboSelected(int index) | |||
1336 | // int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); | 1344 | // int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); |
1337 | 1345 | ||
1338 | temp.setNum(index+1); | 1346 | // for (int i = 1; i <= numberOfEntries; i++) { |
1347 | // int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); | ||
1348 | |||
1349 | temp.setNum(index + 1); | ||
1339 | remoteServerStr = cfg.readEntry( temp,""); | 1350 | remoteServerStr = cfg.readEntry( temp,""); |
1340 | 1351 | ||
1341 | odebug << "Group" +temp << oendl; | 1352 | odebug << "Group " +temp << oendl; |
1342 | cfg.setGroup(temp); | 1353 | cfg.setGroup(temp); |
1343 | // odebug << temp << oendl; | 1354 | |
1344 | int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE); | 1355 | int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE); |
1345 | port = remoteServerStr.right( divider - 1); | 1356 | port = remoteServerStr.right( divider - 1); |
@@ -1347,5 +1358,4 @@ void OpieFtp::serverComboSelected(int index) | |||
1347 | int portInt = port.toInt(&ok,10); | 1358 | int portInt = port.toInt(&ok,10); |
1348 | if( portInt == 0) portInt = 21; | 1359 | if( portInt == 0) portInt = 21; |
1349 | |||
1350 | ServerComboBox->lineEdit()->setText(remoteServerStr.left( remoteServerStr.find(":",0,TRUE))); | 1360 | ServerComboBox->lineEdit()->setText(remoteServerStr.left( remoteServerStr.find(":",0,TRUE))); |
1351 | 1361 | ||
@@ -1354,5 +1364,5 @@ void OpieFtp::serverComboSelected(int index) | |||
1354 | remotePath->setText(cfg.readEntry("RemotePath", "/")); | 1364 | remotePath->setText(cfg.readEntry("RemotePath", "/")); |
1355 | 1365 | ||
1356 | username = cfg.readEntry("Username", "anonymous"); | 1366 | username = cfg.readEntry("Username", "anonymous"); |
1357 | UsernameComboBox->lineEdit()->setText(username); | 1367 | UsernameComboBox->lineEdit()->setText(username); |
1358 | odebug << username << oendl; | 1368 | odebug << username << oendl; |
@@ -1363,11 +1373,14 @@ void OpieFtp::serverComboSelected(int index) | |||
1363 | 1373 | ||
1364 | cfg.setGroup("Server"); | 1374 | cfg.setGroup("Server"); |
1365 | temp.sprintf("%d",currentServerConfig); | 1375 | temp.sprintf("%d", currentServerConfig); |
1366 | cfg.writeEntry("currentServer", temp); | 1376 | cfg.writeEntry("currentServer", temp); |
1377 | cfg.writeEntry(temp,servername); | ||
1367 | 1378 | ||
1379 | |||
1368 | fuckeduphack = TRUE; | 1380 | fuckeduphack = TRUE; |
1369 | serverListView->setCurrentItem( index); | 1381 | serverListView->setCurrentItem( index); |
1370 | fuckeduphack=FALSE; | 1382 | fuckeduphack = FALSE; |
1371 | odebug << "server list set selected " << index << "" << oendl; | 1383 | qDebug( "server list set selected %d "+temp, index); |
1384 | ServerComboBox->lineEdit()->setText(servername); | ||
1372 | update(); | 1385 | update(); |
1373 | } | 1386 | } |