summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-gutenbrowser
Unidiff
Diffstat (limited to 'noncore/apps/opie-gutenbrowser') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-gutenbrowser/NetworkDialog.cpp72
1 files changed, 8 insertions, 64 deletions
diff --git a/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp b/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp
index d629449..af14aac 100644
--- a/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp
+++ b/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp
@@ -82,98 +82,42 @@ NetworkDialog::NetworkDialog( QWidget* parent, const char* name, bool modal, WF
82 82
83NetworkDialog::~NetworkDialog() { 83NetworkDialog::~NetworkDialog() {
84} 84}
85 85
86void NetworkDialog::initDialog() { 86void NetworkDialog::initDialog() {
87 87
88 QGridLayout *layout = new QGridLayout( this );
88 totalBytesDownloaded=0; 89 totalBytesDownloaded=0;
89 warnLabel = new QLabel( this, "TextLabel" ); 90 warnLabel = new QLabel( this, "TextLabel" );
90 warnLabel ->setText( tr( "Push Ok to download file...." ) ); 91 warnLabel ->setText( tr( "Download should start shortly" ) );
91 TextLabel3 = new QLabel( this, "TextLabel3" ); 92 TextLabel3 = new QLabel( this, "TextLabel3" );
92 TextLabel3->setText( ""); 93 TextLabel3->setText( "");
93 QWidget* Layout1 = new QWidget( this, "Layout1" ); 94 layout->addMultiCellWidget( warnLabel, 0, 0, 0, 5 );
95 layout->addMultiCellWidget( TextLabel3, 1, 1, 0, 5 );
94 96
95 hbox = new QHBoxLayout(Layout1); 97 ProgressBar1 = new QProgressBar( this, "ProgressBar1" );
96 hbox->setMargin(4);
97
98 ProgressBar1 = new QProgressBar( Layout1, "ProgressBar1" );
99 ProgressBar1->setProgress(0); 98 ProgressBar1->setProgress(0);
100 hbox->addWidget(ProgressBar1,10,AlignCenter); 99 layout->addMultiCellWidget( ProgressBar1, 3, 3, 0, 4 );
101 100
102 // hbox->addStretch(1); 101 // hbox->addStretch(1);
103// buttonOk = new QPushButton( Layout1, "buttonOk" ); 102 buttonCancel = new QPushButton( this, "buttonCancel" );
104// buttonOk->setText( tr( "&OK" ) );
105// hbox->addWidget(buttonOk,0,AlignRight);
106// hbox->addSpacing(5);
107 buttonCancel = new QPushButton( Layout1, "buttonCancel" );
108 buttonCancel->setText( tr( "&Cancel" ) ); 103 buttonCancel->setText( tr( "&Cancel" ) );
109 buttonCancel->setAutoDefault( TRUE ); 104 buttonCancel->setAutoDefault( TRUE );
110 buttonCancel->setDefault( TRUE ); 105 buttonCancel->setDefault( TRUE );
111 hbox->addWidget(buttonCancel,0,AlignRight); 106 layout->addMultiCellWidget( buttonCancel, 3, 3, 5, 5 );
112
113 ProgressBar1->setFixedSize(150,25);
114// buttonOk->setFixedSize(35,22);
115 buttonCancel->setFixedSize(50,25);
116 warnLabel ->setGeometry( QRect( 5,1,230,25));
117 TextLabel3->setGeometry( QRect( 5,20,230,25));
118 Layout1->setGeometry( QRect(1,60,235,50)); //TODO check these!!
119
120// timer= new QTimer(this,"vu timer");
121// connectionTimer=new QTimer(this,"connectionTimeout");
122 107
123// connect(buttonOk,SIGNAL(clicked()),this,SLOT(doOk()));
124 connect(buttonCancel,SIGNAL(clicked()),this,SLOT(reject())); 108 connect(buttonCancel,SIGNAL(clicked()),this,SLOT(reject()));
125// connect( timer, SIGNAL(timeout()), this , SLOT(timeSlot()));
126// connect( connectionTimer,SIGNAL( timeout()),this,SLOT( connectionTimeSlot()));
127// if(autoOk) {
128// buttonOk->setDown(true);
129 QTimer::singleShot( 1000, this, SLOT( doOk() )); 109 QTimer::singleShot( 1000, this, SLOT( doOk() ));
130// }
131
132}
133 110
134void NetworkDialog::timeSlot() {
135
136// if(timerProgess < 19 && posTimer) {
137// ProgressBar1->setProgress(timerProgess);
138// timerProgess++;
139// } else if(timerProgess > 19 && posTimer) {
140// ProgressBar1->setProgress(timerProgess);
141// timerProgess++;
142// posTimer=FALSE;
143// }
144// if(timerProgess > 1 &&!posTimer) {
145// ProgressBar1->setProgress(timerProgess);
146// timerProgess--;
147// } else if(timerProgess > 1 &&!posTimer){
148// ProgressBar1->setProgress(timerProgess);
149// timerProgess--;
150// posTimer=TRUE;
151// }
152// // odebug << "timer event" << oendl;
153// qApp->processEvents();
154// repaint();
155} 111}
156 112
157void NetworkDialog::connectionTimeSlot() {
158// odebug << "Connections timed out" << oendl;
159// ftpQuit();
160// qApp->processEvents();
161// repaint();
162// reject();
163}
164
165
166/* 113/*
167downloads the file networkUrl */ 114downloads the file networkUrl */
168bool NetworkDialog::downloadFile( QString networkUrl ) 115bool NetworkDialog::downloadFile( QString networkUrl )
169{ 116{
170 int fsz; 117 int fsz;
171// timer->start( 250 , FALSE);
172// posTimer=TRUE;
173// connectionTimer->start( 600 , FALSE);
174 warnLabel ->setText( ""); 118 warnLabel ->setText( "");
175 qApp->processEvents(); 119 qApp->processEvents();
176 odebug << "Downloading: " << networkUrl << "" << oendl; 120 odebug << "Downloading: " << networkUrl << "" << oendl;
177 odebug << "Into: " << localFileName << "" << oendl; 121 odebug << "Into: " << localFileName << "" << oendl;
178 if( networkUrl.length() > 5) { 122 if( networkUrl.length() > 5) {
179 QString ftp_user = "anonymous"; 123 QString ftp_user = "anonymous";