author | andyq <andyq> | 2002-11-11 22:13:45 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-11-11 22:13:45 (UTC) |
commit | 99232d320496b78e92f9bd9a3c1af064940592a6 (patch) (unidiff) | |
tree | d41bc5235f2d4a62d8c3f4a8a9811116920acc81 | |
parent | 503bb111313dfb62ee6341069a75dad56bbd47bf (diff) | |
download | opie-99232d320496b78e92f9bd9a3c1af064940592a6.zip opie-99232d320496b78e92f9bd9a3c1af064940592a6.tar.gz opie-99232d320496b78e92f9bd9a3c1af064940592a6.tar.bz2 |
Fixed a bug where you couldn't download from installed pgks view
and another where buttons looked crap
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index d43c6ac..188f90d 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp | |||
@@ -241,129 +241,129 @@ void NetworkPackageManager :: serverSelected( int ) | |||
241 | 241 | ||
242 | // If the local server, only display installed packages | 242 | // If the local server, only display installed packages |
243 | if ( serverName == LOCAL_SERVER && !it->isInstalled() ) | 243 | if ( serverName == LOCAL_SERVER && !it->isInstalled() ) |
244 | continue; | 244 | continue; |
245 | 245 | ||
246 | 246 | ||
247 | text += it->getPackageName(); | 247 | text += it->getPackageName(); |
248 | if ( it->isInstalled() ) | 248 | if ( it->isInstalled() ) |
249 | { | 249 | { |
250 | text += " (installed)"; | 250 | text += " (installed)"; |
251 | 251 | ||
252 | // If a different version of package is available, postfix it with an * | 252 | // If a different version of package is available, postfix it with an * |
253 | if ( it->getVersion() != it->getInstalledVersion() ) | 253 | if ( it->getVersion() != it->getInstalledVersion() ) |
254 | { | 254 | { |
255 | 255 | ||
256 | if ( compareVersions( it->getInstalledVersion(), it->getVersion() ) == 1 ) | 256 | if ( compareVersions( it->getInstalledVersion(), it->getVersion() ) == 1 ) |
257 | text += "*"; | 257 | text += "*"; |
258 | } | 258 | } |
259 | } | 259 | } |
260 | 260 | ||
261 | QCheckListItem *item = new QCheckListItem( packagesList, text, QCheckListItem::CheckBox ); | 261 | QCheckListItem *item = new QCheckListItem( packagesList, text, QCheckListItem::CheckBox ); |
262 | 262 | ||
263 | if ( it->isInstalled() ) | 263 | if ( it->isInstalled() ) |
264 | { | 264 | { |
265 | QString destName = ""; | 265 | QString destName = ""; |
266 | if ( it->getLocalPackage() ) | 266 | if ( it->getLocalPackage() ) |
267 | { | 267 | { |
268 | if ( it->getLocalPackage()->getInstalledTo() ) | 268 | if ( it->getLocalPackage()->getInstalledTo() ) |
269 | destName = it->getLocalPackage()->getInstalledTo()->getDestinationName(); | 269 | destName = it->getLocalPackage()->getInstalledTo()->getDestinationName(); |
270 | } | 270 | } |
271 | else | 271 | else |
272 | { | 272 | { |
273 | if ( it->getInstalledTo() ) | 273 | if ( it->getInstalledTo() ) |
274 | destName = it->getInstalledTo()->getDestinationName(); | 274 | destName = it->getInstalledTo()->getDestinationName(); |
275 | } | 275 | } |
276 | if ( destName != "" ) | 276 | if ( destName != "" ) |
277 | new QCheckListItem( item, QString( "Installed To - " ) + destName ); | 277 | new QCheckListItem( item, QString( "Installed To - " ) + destName ); |
278 | } | 278 | } |
279 | 279 | ||
280 | if ( !it->isPackageStoredLocally() ) | 280 | if ( !it->isPackageStoredLocally() ) |
281 | new QCheckListItem( item, QString( "Description - " ) + it->getDescription() ); | 281 | new QCheckListItem( item, QString( "Description - " ) + it->getDescription() ); |
282 | else | 282 | else |
283 | new QCheckListItem( item, QString( "Filename - " ) + it->getFilename() ); | 283 | new QCheckListItem( item, QString( "Filename - " ) + it->getFilename() ); |
284 | 284 | ||
285 | if ( serverName == LOCAL_SERVER ) | 285 | if ( serverName == LOCAL_SERVER ) |
286 | { | 286 | { |
287 | new QCheckListItem( item, QString( "V. Installed - " ) + it->getVersion() ); | 287 | new QCheckListItem( item, QString( "V. Installed - " ) + it->getVersion() ); |
288 | } | 288 | } |
289 | else | 289 | else |
290 | { | 290 | { |
291 | new QCheckListItem( item, QString( "V. Available - " ) + it->getVersion() ); | 291 | new QCheckListItem( item, QString( "V. Available - " ) + it->getVersion() ); |
292 | if ( it->getLocalPackage() ) | 292 | if ( it->getLocalPackage() ) |
293 | { | 293 | { |
294 | if ( it->isInstalled() ) | 294 | if ( it->isInstalled() ) |
295 | new QCheckListItem( item, QString( "V. Installed - " ) + it->getInstalledVersion() ); | 295 | new QCheckListItem( item, QString( "V. Installed - " ) + it->getInstalledVersion() ); |
296 | } | 296 | } |
297 | } | 297 | } |
298 | packagesList->insertItem( item ); | 298 | packagesList->insertItem( item ); |
299 | } | 299 | } |
300 | 300 | ||
301 | // If the local server or the local ipkgs server disable the download button | 301 | // If the local server or the local ipkgs server disable the download button |
302 | if ( serverName == LOCAL_SERVER ) | 302 | if ( serverName == LOCAL_SERVER ) |
303 | { | 303 | { |
304 | upgrade->setEnabled( false ); | 304 | upgrade->setEnabled( false ); |
305 | download->setText( "Install Remote" ); | 305 | download->setText( "Download" ); |
306 | download->setEnabled( true ); | 306 | download->setEnabled( true ); |
307 | } | 307 | } |
308 | else if ( serverName == LOCAL_IPKGS ) | 308 | else if ( serverName == LOCAL_IPKGS ) |
309 | { | 309 | { |
310 | upgrade->setEnabled( false ); | 310 | upgrade->setEnabled( false ); |
311 | download->setEnabled( true ); | 311 | download->setEnabled( true ); |
312 | download->setText( "Remove" ); | 312 | download->setText( "Remove" ); |
313 | } | 313 | } |
314 | else | 314 | else |
315 | { | 315 | { |
316 | upgrade->setEnabled( true ); | 316 | upgrade->setEnabled( true ); |
317 | download->setEnabled( true ); | 317 | download->setEnabled( true ); |
318 | download->setText( "Download" ); | 318 | download->setText( "Download" ); |
319 | } | 319 | } |
320 | } | 320 | } |
321 | 321 | ||
322 | void NetworkPackageManager :: updateServer() | 322 | void NetworkPackageManager :: updateServer() |
323 | { | 323 | { |
324 | QString serverName = serversList->currentText(); | 324 | QString serverName = serversList->currentText(); |
325 | 325 | ||
326 | // Update the current server | 326 | // Update the current server |
327 | // Display dialog | 327 | // Display dialog |
328 | // ProgressDlg *progDlg = new ProgressDlg( this ); | 328 | // ProgressDlg *progDlg = new ProgressDlg( this ); |
329 | // QString status = "Updating package lists..."; | 329 | // QString status = "Updating package lists..."; |
330 | // progDlg->show(); | 330 | // progDlg->show(); |
331 | // progDlg->setText( status ); | 331 | // progDlg->setText( status ); |
332 | 332 | ||
333 | // Disable buttons to stop silly people clicking lots on them :) | 333 | // Disable buttons to stop silly people clicking lots on them :) |
334 | 334 | ||
335 | // First, write out ipkg_conf file so that ipkg can use it | 335 | // First, write out ipkg_conf file so that ipkg can use it |
336 | dataMgr->writeOutIpkgConf(); | 336 | dataMgr->writeOutIpkgConf(); |
337 | 337 | ||
338 | Ipkg ipkg; | 338 | Ipkg ipkg; |
339 | ipkg.setOption( "update" ); | 339 | ipkg.setOption( "update" ); |
340 | 340 | ||
341 | InstallDlgImpl dlg( &ipkg, "Refreshing server package lists", this, "Upgrade", true ); | 341 | InstallDlgImpl dlg( &ipkg, "Refreshing server package lists", this, "Upgrade", true ); |
342 | dlg.showDlg(); | 342 | dlg.showDlg(); |
343 | 343 | ||
344 | // Reload data | 344 | // Reload data |
345 | dataMgr->reloadServerData(); | 345 | dataMgr->reloadServerData(); |
346 | serverSelected(-1); | 346 | serverSelected(-1); |
347 | // delete progDlg; | 347 | // delete progDlg; |
348 | } | 348 | } |
349 | 349 | ||
350 | void NetworkPackageManager :: upgradePackages() | 350 | void NetworkPackageManager :: upgradePackages() |
351 | { | 351 | { |
352 | // We're gonna do an upgrade of all packages | 352 | // We're gonna do an upgrade of all packages |
353 | // First warn user that this isn't recommended | 353 | // First warn user that this isn't recommended |
354 | QString text = "WARNING: Upgrading while\nOpie/Qtopia is running\nis NOT recommended!\n\nAre you sure?\n"; | 354 | QString text = "WARNING: Upgrading while\nOpie/Qtopia is running\nis NOT recommended!\n\nAre you sure?\n"; |
355 | QMessageBox warn("Warning", text, QMessageBox::Warning, | 355 | QMessageBox warn("Warning", text, QMessageBox::Warning, |
356 | QMessageBox::Yes, | 356 | QMessageBox::Yes, |
357 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default , | 357 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default , |
358 | 0, this ); | 358 | 0, this ); |
359 | warn.adjustSize(); | 359 | warn.adjustSize(); |
360 | 360 | ||
361 | if ( warn.exec() == QMessageBox::Yes ) | 361 | if ( warn.exec() == QMessageBox::Yes ) |
362 | { | 362 | { |
363 | // First, write out ipkg_conf file so that ipkg can use it | 363 | // First, write out ipkg_conf file so that ipkg can use it |
364 | dataMgr->writeOutIpkgConf(); | 364 | dataMgr->writeOutIpkgConf(); |
365 | 365 | ||
366 | // Now run upgrade | 366 | // Now run upgrade |
367 | Ipkg ipkg; | 367 | Ipkg ipkg; |
368 | ipkg.setOption( "upgrade" ); | 368 | ipkg.setOption( "upgrade" ); |
369 | 369 | ||