summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-gutenbrowser/NetworkDialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-gutenbrowser/NetworkDialog.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp b/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp
index 6e6b707..d629449 100644
--- a/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp
+++ b/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp
@@ -41,115 +41,115 @@ QPushButton* buttonCancel;
static netbuf *conn = NULL;
static int log_progress(netbuf *ctl, int xfered, void *arg) {
int fsz = *(int *)arg;
int pct = (xfered * 100) / fsz;
printf("%3d%%\r", pct);
fflush(stdout);
ProgressBar1->setProgress(xfered);
qApp->processEvents();
return 1;
}
NetworkDialog::NetworkDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QStringList netL)
: QDialog( parent, name, modal, fl )
{
ftp_host = netL[0];
networkUrl = strUrl = netL[0];
dir = ftp_base_dir = netL[1];
localFileName = netL[2];
s_partialFileName = netL[3];
- resize(240,110);
+ resize(240,120);
local_library = (QDir::homeDirPath ()) +"/Applications/gutenbrowser/";
// autoOk = autoDownload;
// if( networkUrl.find("ftp",0,false)== -1 ) {
// if ( !name )
// setName( "HTTP NetworkDialog" );
// setCaption( tr( "HTTP Download ) );
// qInitNetworkProtocols(); // registers ftp protocol // for now
// QNetworkProtocol::registerNetworkProtocol( "http", new QNetworkProtocolFactory<Http> );
// } else {
if ( !name )
setName( "FTP NetworkDialog" );
setCaption(tr("FTP Download"));
// }
initDialog(); //opens file to be written
}
NetworkDialog::~NetworkDialog() {
}
void NetworkDialog::initDialog() {
totalBytesDownloaded=0;
warnLabel = new QLabel( this, "TextLabel" );
warnLabel ->setText( tr( "Push Ok to download file...." ) );
TextLabel3 = new QLabel( this, "TextLabel3" );
TextLabel3->setText( "");
QWidget* Layout1 = new QWidget( this, "Layout1" );
hbox = new QHBoxLayout(Layout1);
hbox->setMargin(4);
ProgressBar1 = new QProgressBar( Layout1, "ProgressBar1" );
ProgressBar1->setProgress(0);
hbox->addWidget(ProgressBar1,10,AlignCenter);
- hbox->addStretch(1);
- buttonOk = new QPushButton( Layout1, "buttonOk" );
- buttonOk->setText( tr( "&OK" ) );
- hbox->addWidget(buttonOk,0,AlignRight);
- hbox->addSpacing(5);
+ // hbox->addStretch(1);
+// buttonOk = new QPushButton( Layout1, "buttonOk" );
+// buttonOk->setText( tr( "&OK" ) );
+// hbox->addWidget(buttonOk,0,AlignRight);
+// hbox->addSpacing(5);
buttonCancel = new QPushButton( Layout1, "buttonCancel" );
buttonCancel->setText( tr( "&Cancel" ) );
buttonCancel->setAutoDefault( TRUE );
buttonCancel->setDefault( TRUE );
hbox->addWidget(buttonCancel,0,AlignRight);
- ProgressBar1->setFixedSize(140,22);
- buttonOk->setFixedSize(35,22);
- buttonCancel->setFixedSize(35,22);
+ ProgressBar1->setFixedSize(150,25);
+// buttonOk->setFixedSize(35,22);
+ buttonCancel->setFixedSize(50,25);
warnLabel ->setGeometry( QRect( 5,1,230,25));
TextLabel3->setGeometry( QRect( 5,20,230,25));
Layout1->setGeometry( QRect(1,60,235,50)); //TODO check these!!
// timer= new QTimer(this,"vu timer");
// connectionTimer=new QTimer(this,"connectionTimeout");
- connect(buttonOk,SIGNAL(clicked()),this,SLOT(doOk()));
+// connect(buttonOk,SIGNAL(clicked()),this,SLOT(doOk()));
connect(buttonCancel,SIGNAL(clicked()),this,SLOT(reject()));
// connect( timer, SIGNAL(timeout()), this , SLOT(timeSlot()));
// connect( connectionTimer,SIGNAL( timeout()),this,SLOT( connectionTimeSlot()));
- if(autoOk) {
- owarn << "XXXXXXXXXXXXXXXXXXXXXXXX" << oendl;
- buttonOk->setDown(true);
- doOk();
- }
+// if(autoOk) {
+// buttonOk->setDown(true);
+ QTimer::singleShot( 1000, this, SLOT( doOk() ));
+// }
+
}
void NetworkDialog::timeSlot() {
// if(timerProgess < 19 && posTimer) {
// ProgressBar1->setProgress(timerProgess);
// timerProgess++;
// } else if(timerProgess > 19 && posTimer) {
// ProgressBar1->setProgress(timerProgess);
// timerProgess++;
// posTimer=FALSE;
// }
// if(timerProgess > 1 &&!posTimer) {
// ProgressBar1->setProgress(timerProgess);
// timerProgess--;
// } else if(timerProgess > 1 &&!posTimer){
// ProgressBar1->setProgress(timerProgess);
// timerProgess--;
// posTimer=TRUE;
// }
// // odebug << "timer event" << oendl;
// qApp->processEvents();
// repaint();
}