author | llornkcor <llornkcor> | 2004-06-16 09:00:30 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-06-16 09:00:30 (UTC) |
commit | 80ca3700b54c886d761cf1cd32a529a558541d5c (patch) (unidiff) | |
tree | 8612c2b07ef31f6c9a415ba0cb132c2ea7dd3389 | |
parent | 80bf424ffc8394026c8bea825d91413b472d502a (diff) | |
download | opie-80ca3700b54c886d761cf1cd32a529a558541d5c.zip opie-80ca3700b54c886d761cf1cd32a529a558541d5c.tar.gz opie-80ca3700b54c886d761cf1cd32a529a558541d5c.tar.bz2 |
dynamic layout and reformat whitespace
-rw-r--r-- | noncore/apps/opie-gutenbrowser/NetworkDialog.cpp | 72 |
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 | |||
@@ -87,22 +87,17 @@ void 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" ) ); |
@@ -110,57 +105,9 @@ void NetworkDialog::initDialog() { | |||
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 | ||
134 | void 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 | ||
157 | void NetworkDialog::connectionTimeSlot() { | ||
158 | // odebug << "Connections timed out" << oendl; | ||
159 | // ftpQuit(); | ||
160 | // qApp->processEvents(); | ||
161 | // repaint(); | ||
162 | // reject(); | ||
163 | } | ||
164 | |||
165 | |||
166 | /* | 113 | /* |
@@ -170,5 +117,2 @@ bool NetworkDialog::downloadFile( QString networkUrl ) | |||
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( ""); |