summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (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
@@ -85,92 +85,36 @@ NetworkDialog::~NetworkDialog() {
void NetworkDialog::initDialog() {
+ QGridLayout *layout = new QGridLayout( this );
totalBytesDownloaded=0;
warnLabel = new QLabel( this, "TextLabel" );
- warnLabel ->setText( tr( "Push Ok to download file...." ) );
+ warnLabel ->setText( tr( "Download should start shortly" ) );
TextLabel3 = new QLabel( this, "TextLabel3" );
TextLabel3->setText( "");
- QWidget* Layout1 = new QWidget( this, "Layout1" );
+ layout->addMultiCellWidget( warnLabel, 0, 0, 0, 5 );
+ layout->addMultiCellWidget( TextLabel3, 1, 1, 0, 5 );
- hbox = new QHBoxLayout(Layout1);
- hbox->setMargin(4);
-
- ProgressBar1 = new QProgressBar( Layout1, "ProgressBar1" );
+ ProgressBar1 = new QProgressBar( this, "ProgressBar1" );
ProgressBar1->setProgress(0);
- hbox->addWidget(ProgressBar1,10,AlignCenter);
+ layout->addMultiCellWidget( ProgressBar1, 3, 3, 0, 4 );
// 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 = new QPushButton( this, "buttonCancel" );
buttonCancel->setText( tr( "&Cancel" ) );
buttonCancel->setAutoDefault( TRUE );
buttonCancel->setDefault( TRUE );
- hbox->addWidget(buttonCancel,0,AlignRight);
-
- 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");
+ layout->addMultiCellWidget( buttonCancel, 3, 3, 5, 5 );
-// 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) {
-// 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();
}
-void NetworkDialog::connectionTimeSlot() {
-// odebug << "Connections timed out" << oendl;
-// ftpQuit();
-// qApp->processEvents();
-// repaint();
-// reject();
-}
-
-
/*
downloads the file networkUrl */
bool NetworkDialog::downloadFile( QString networkUrl )
{
int fsz;
-// timer->start( 250 , FALSE);
-// posTimer=TRUE;
-// connectionTimer->start( 600 , FALSE);
warnLabel ->setText( "");
qApp->processEvents();
odebug << "Downloading: " << networkUrl << "" << oendl;