author | andyq <andyq> | 2002-12-17 22:30:59 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-12-17 22:30:59 (UTC) |
commit | 01640bfdce16d2fd23722a59004a6efd4600c0cf (patch) (unidiff) | |
tree | 399d5da7706ab89b41b7da0eb5fec025d0d3db05 | |
parent | f18839182d493a49e9411e3dbc070952da7dead9 (diff) | |
download | opie-01640bfdce16d2fd23722a59004a6efd4600c0cf.zip opie-01640bfdce16d2fd23722a59004a6efd4600c0cf.tar.gz opie-01640bfdce16d2fd23722a59004a6efd4600c0cf.tar.bz2 |
When ipkg process is run - start/close button changes to abort
-rw-r--r-- | noncore/settings/aqpkg/installdlgimpl.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp index bfb4f62..80c06ba 100644 --- a/noncore/settings/aqpkg/installdlgimpl.cpp +++ b/noncore/settings/aqpkg/installdlgimpl.cpp | |||
@@ -132,42 +132,55 @@ void InstallDlgImpl :: optionsSelected() | |||
132 | { | 132 | { |
133 | InstallOptionsDlgImpl opt( flags, this, "Option", true ); | 133 | InstallOptionsDlgImpl opt( flags, this, "Option", true ); |
134 | opt.exec(); | 134 | opt.exec(); |
135 | 135 | ||
136 | // set options selected from dialog | 136 | // set options selected from dialog |
137 | flags = opt.getFlags(); | 137 | flags = opt.getFlags(); |
138 | 138 | ||
139 | #ifdef QWS | 139 | #ifdef QWS |
140 | Config cfg( "aqpkg" ); | 140 | Config cfg( "aqpkg" ); |
141 | cfg.setGroup( "settings" ); | 141 | cfg.setGroup( "settings" ); |
142 | cfg.writeEntry( "installFlags", flags ); | 142 | cfg.writeEntry( "installFlags", flags ); |
143 | #endif | 143 | #endif |
144 | } | 144 | } |
145 | 145 | ||
146 | void InstallDlgImpl :: installSelected() | 146 | void InstallDlgImpl :: installSelected() |
147 | { | 147 | { |
148 | 148 | if ( btnInstall->text() == "Abort" ) | |
149 | if ( btnInstall->text() == "Close" ) | 149 | { |
150 | if ( pIpkg ) | ||
151 | { | ||
152 | displayText( "\n**** User Clicked ABORT ***" ); | ||
153 | pIpkg->abort(); | ||
154 | displayText( "**** Process Aborted ****" ); | ||
155 | } | ||
156 | |||
157 | btnInstall->setText( tr( "Close" ) ); | ||
158 | return; | ||
159 | } | ||
160 | else if ( btnInstall->text() == "Close" ) | ||
150 | { | 161 | { |
151 | done( 1 ); | 162 | done( 1 ); |
152 | return; | 163 | return; |
153 | } | 164 | } |
154 | 165 | ||
155 | // Disable buttons | 166 | // Disable buttons |
156 | btnOptions->setEnabled( false ); | 167 | btnOptions->setEnabled( false ); |
157 | btnInstall->setEnabled( false ); | 168 | // btnInstall->setEnabled( false ); |
169 | |||
170 | btnInstall->setText( "Abort" ); | ||
158 | 171 | ||
159 | if ( pIpkg ) | 172 | if ( pIpkg ) |
160 | { | 173 | { |
161 | output->setText( "" ); | 174 | output->setText( "" ); |
162 | 175 | ||
163 | connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); | 176 | connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); |
164 | pIpkg->runIpkg(); | 177 | pIpkg->runIpkg(); |
165 | } | 178 | } |
166 | else | 179 | else |
167 | { | 180 | { |
168 | output->setText( "" ); | 181 | output->setText( "" ); |
169 | vector<Destination>::iterator d = dataMgr->getDestination( destination->currentText() ); | 182 | vector<Destination>::iterator d = dataMgr->getDestination( destination->currentText() ); |
170 | QString dest = d->getDestinationName(); | 183 | QString dest = d->getDestinationName(); |
171 | QString destDir = d->getDestinationPath(); | 184 | QString destDir = d->getDestinationPath(); |
172 | int instFlags = flags; | 185 | int instFlags = flags; |
173 | if ( d->linkToRoot() ) | 186 | if ( d->linkToRoot() ) |
@@ -219,36 +232,37 @@ void InstallDlgImpl :: installSelected() | |||
219 | pIpkg->setOption( "upgrade" ); | 232 | pIpkg->setOption( "upgrade" ); |
220 | pIpkg->setDestination( it->destination->getDestinationName() ); | 233 | pIpkg->setDestination( it->destination->getDestinationName() ); |
221 | pIpkg->setDestinationDir( it->destination->getDestinationPath() ); | 234 | pIpkg->setDestinationDir( it->destination->getDestinationPath() ); |
222 | pIpkg->setPackage( it->packageName ); | 235 | pIpkg->setPackage( it->packageName ); |
223 | 236 | ||
224 | int tmpFlags = flags; | 237 | int tmpFlags = flags; |
225 | if ( it->destination->linkToRoot() && it->recreateLinks ) | 238 | if ( it->destination->linkToRoot() && it->recreateLinks ) |
226 | tmpFlags |= MAKE_LINKS; | 239 | tmpFlags |= MAKE_LINKS; |
227 | pIpkg->setFlags( tmpFlags ); | 240 | pIpkg->setFlags( tmpFlags ); |
228 | pIpkg->runIpkg(); | 241 | pIpkg->runIpkg(); |
229 | } | 242 | } |
230 | 243 | ||
231 | delete pIpkg; | 244 | delete pIpkg; |
232 | } | 245 | } |
233 | 246 | ||
234 | btnOptions->setEnabled( true ); | 247 | btnOptions->setEnabled( true ); |
235 | btnInstall->setEnabled( true ); | 248 | // btnInstall->setEnabled( true ); |
236 | btnInstall->setText( tr( "Close" ) ); | 249 | btnInstall->setText( tr( "Close" ) ); |
237 | } | 250 | } |
238 | 251 | ||
252 | |||
239 | void InstallDlgImpl :: displayText(const QString &text ) | 253 | void InstallDlgImpl :: displayText(const QString &text ) |
240 | { | 254 | { |
241 | QString t = output->text() + "\n" + text; | 255 | QString t = output->text() + "\n" + text; |
242 | output->setText( t ); | 256 | output->setText( t ); |
243 | output->setCursorPosition( output->numLines(), 0 ); | 257 | output->setCursorPosition( output->numLines(), 0 ); |
244 | } | 258 | } |
245 | 259 | ||
246 | 260 | ||
247 | void InstallDlgImpl :: displayAvailableSpace( const QString &text ) | 261 | void InstallDlgImpl :: displayAvailableSpace( const QString &text ) |
248 | { | 262 | { |
249 | vector<Destination>::iterator d = dataMgr->getDestination( text ); | 263 | vector<Destination>::iterator d = dataMgr->getDestination( text ); |
250 | QString destDir = d->getDestinationPath(); | 264 | QString destDir = d->getDestinationPath(); |
251 | 265 | ||
252 | long blockSize = 0; | 266 | long blockSize = 0; |
253 | long totalBlocks = 0; | 267 | long totalBlocks = 0; |
254 | long availBlocks = 0; | 268 | long availBlocks = 0; |