summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-gutenbrowser/NetworkDialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-gutenbrowser/NetworkDialog.cpp78
1 files changed, 42 insertions, 36 deletions
diff --git a/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp b/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp
index aed53c6..6e6b707 100644
--- a/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp
+++ b/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp
@@ -12,7 +12,3 @@
12// /* Created: Sun Aug 27 15:24:52 2000*/ 12// /* Created: Sun Aug 27 15:24:52 2000*/
13#include <unistd.h>
14 13
15extern "C" {
16#include <ftplib.h>
17}
18 14
@@ -21,2 +17,6 @@ extern "C" {
21 17
18/* OPIE */
19#include <opie2/odebug.h>
20
21/* QT */
22#include <qprogressbar.h> 22#include <qprogressbar.h>
@@ -32,2 +32,8 @@ extern "C" {
32 32
33/* STD */
34#include <unistd.h>
35extern "C" {
36#include <ftplib.h>
37}
38
33QProgressBar* ProgressBar1; 39QProgressBar* ProgressBar1;
@@ -48,3 +54,3 @@ static int log_progress(netbuf *ctl, int xfered, void *arg) {
48NetworkDialog::NetworkDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QStringList netL) 54NetworkDialog::NetworkDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QStringList netL)
49 : QDialog( parent, name, modal, fl ) 55 : QDialog( parent, name, modal, fl )
50{ 56{
@@ -55,9 +61,9 @@ NetworkDialog::NetworkDialog( QWidget* parent, const char* name, bool modal, WF
55 dir = ftp_base_dir = netL[1]; 61 dir = ftp_base_dir = netL[1];
56 localFileName = netL[2]; 62 localFileName = netL[2];
57 s_partialFileName = netL[3]; 63 s_partialFileName = netL[3];
58 64
59 resize(240,110); 65 resize(240,110);
60 66
61 local_library = (QDir::homeDirPath ()) +"/Applications/gutenbrowser/"; 67 local_library = (QDir::homeDirPath ()) +"/Applications/gutenbrowser/";
62 // autoOk = autoDownload; 68// autoOk = autoDownload;
63// if( networkUrl.find("ftp",0,false)== -1 ) { 69// if( networkUrl.find("ftp",0,false)== -1 ) {
@@ -120,7 +126,7 @@ void NetworkDialog::initDialog() {
120// connect( connectionTimer,SIGNAL( timeout()),this,SLOT( connectionTimeSlot())); 126// connect( connectionTimer,SIGNAL( timeout()),this,SLOT( connectionTimeSlot()));
121 if(autoOk) { 127 if(autoOk) {
122 qWarning("XXXXXXXXXXXXXXXXXXXXXXXX"); 128 owarn << "XXXXXXXXXXXXXXXXXXXXXXXX" << oendl;
123 buttonOk->setDown(true); 129 buttonOk->setDown(true);
124 doOk(); 130 doOk();
125 } 131 }
126} 132}
@@ -145,3 +151,3 @@ void NetworkDialog::timeSlot() {
145// } 151// }
146// // qDebug("timer event"); 152// // odebug << "timer event" << oendl;
147// qApp->processEvents(); 153// qApp->processEvents();
@@ -151,3 +157,3 @@ void NetworkDialog::timeSlot() {
151void NetworkDialog::connectionTimeSlot() { 157void NetworkDialog::connectionTimeSlot() {
152// qDebug("Connections timed out"); 158// odebug << "Connections timed out" << oendl;
153// ftpQuit(); 159// ftpQuit();
@@ -169,4 +175,4 @@ bool NetworkDialog::downloadFile( QString networkUrl )
169 qApp->processEvents(); 175 qApp->processEvents();
170 qDebug("Downloading: %s",networkUrl.latin1()); 176 odebug << "Downloading: " << networkUrl << "" << oendl;
171 qDebug("Into: %s",localFileName.latin1()); 177 odebug << "Into: " << localFileName << "" << oendl;
172 if( networkUrl.length() > 5) { 178 if( networkUrl.length() > 5) {
@@ -176,3 +182,3 @@ bool NetworkDialog::downloadFile( QString networkUrl )
176 if(ftp_host.length() < 2) { 182 if(ftp_host.length() < 2) {
177 qDebug("Please select an ftp host" ); 183 odebug << "Please select an ftp host" << oendl;
178 successDownload=false; 184 successDownload=false;
@@ -182,4 +188,4 @@ bool NetworkDialog::downloadFile( QString networkUrl )
182 QString msg; 188 QString msg;
183 qDebug(ftp_host); 189 odebug << ftp_host << oendl;
184 qDebug("Opening ftp connection."); 190 odebug << "Opening ftp connection." << oendl;
185 warnLabel->setText("connecting to: "+ftp_host ); 191 warnLabel->setText("connecting to: "+ftp_host );
@@ -202,3 +208,3 @@ bool NetworkDialog::downloadFile( QString networkUrl )
202 } 208 }
203 qDebug("Changing directories."); 209 odebug << "Changing directories." << oendl;
204 TextLabel3->setText("Changing directories."); 210 TextLabel3->setText("Changing directories.");
@@ -219,3 +225,3 @@ bool NetworkDialog::downloadFile( QString networkUrl )
219// } 225// }
220 qDebug("Requesting directory list."); 226 odebug << "Requesting directory list." << oendl;
221 TextLabel3->setText("Getting directory list."); 227 TextLabel3->setText("Getting directory list.");
@@ -234,3 +240,3 @@ bool NetworkDialog::downloadFile( QString networkUrl )
234 QTextStream t( &tmp ); // use a text stream 240 QTextStream t( &tmp ); // use a text stream
235 qDebug("Finding partial filename "+s_partialFileName); 241 odebug << "Finding partial filename "+s_partialFileName << oendl;
236 while ( !t.eof()) { 242 while ( !t.eof()) {
@@ -243,3 +249,3 @@ bool NetworkDialog::downloadFile( QString networkUrl )
243 File_Name = str; 249 File_Name = str;
244 qDebug("Found file_name "+ File_Name); 250 odebug << "Found file_name "+ File_Name << oendl;
245 break; 251 break;
@@ -248,6 +254,6 @@ bool NetworkDialog::downloadFile( QString networkUrl )
248// File_Name = str; 254// File_Name = str;
249// qDebug("Found file_name "+ File_Name); 255// odebug << "Found file_name "+ File_Name << oendl;
250// break; 256// break;
251// } 257// }
252 258
253 } 259 }
@@ -258,3 +264,3 @@ bool NetworkDialog::downloadFile( QString networkUrl )
258 else 264 else
259 qDebug("Error opening temp file."); 265 odebug << "Error opening temp file." << oendl;
260 266
@@ -265,4 +271,4 @@ bool NetworkDialog::downloadFile( QString networkUrl )
265 localFileName = temp+File_Name; 271 localFileName = temp+File_Name;
266 qDebug("Requesting file "+ File_Name); 272 odebug << "Requesting file "+ File_Name << oendl;
267 qDebug( "Saving as "+localFileName); 273 odebug << "Saving as "+localFileName << oendl;
268 msg="Requesting file "+ File_Name; 274 msg="Requesting file "+ File_Name;
@@ -274,5 +280,5 @@ bool NetworkDialog::downloadFile( QString networkUrl )
274 QString temp; 280 QString temp;
275 temp.sprintf( File_Name+" "+" %dkb", fsz); 281 temp.sprintf( File_Name+" "+" %dkb", fsz);
276 TextLabel3->setText(temp); 282 TextLabel3->setText(temp);
277 283
278 ProgressBar1->setTotalSteps(fsz); 284 ProgressBar1->setTotalSteps(fsz);
@@ -295,3 +301,3 @@ bool NetworkDialog::downloadFile( QString networkUrl )
295 } 301 }
296 qDebug("Ftp session successful"); 302 odebug << "Ftp session successful" << oendl;
297 successDownload=TRUE; 303 successDownload=TRUE;
@@ -304,3 +310,3 @@ bool NetworkDialog::downloadFile( QString networkUrl )
304void NetworkDialog::doOk() { 310void NetworkDialog::doOk() {
305 qWarning("Do OK"); 311 owarn << "Do OK" << oendl;
306 QString loginStr; 312 QString loginStr;
@@ -316,3 +322,3 @@ void NetworkDialog::doOk() {
316 successDownload = false; 322 successDownload = false;
317 reject(); 323 reject();
318 } 324 }