summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Cellerier <dionoea@videolan.org>2007-09-15 22:32:14 +0000
committerAntoine Cellerier <dionoea@videolan.org>2007-09-15 22:32:14 +0000
commitef425feeb36909e92c9a5e5d4646ac6b3e71beca (patch)
treea6221eca401ff84ddcec10c73787899ddebb2286
parent78d7ece5e914c3f307c42aea2dbb36cf33e7d81c (diff)
downloadrockbox-ef425feeb36909e92c9a5e5d4646ac6b3e71beca.tar.gz
rockbox-ef425feeb36909e92c9a5e5d4646ac6b3e71beca.zip
Fixes to the Complete and Small Installation routines: Don't try installing a bootloader if the target doesn't have one, Don't install doom WADs if the target doesn't have a doom plugin.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14717 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp78
-rw-r--r--rbutil/rbutilqt/rbutilqt.h1
2 files changed, 46 insertions, 33 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index 6a561e1b85..13f004de5a 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -327,18 +327,20 @@ void RbUtilQt::completeInstall()
327 return; 327 return;
328 } 328 }
329 // Bootloader 329 // Bootloader
330 m_error = false; 330 if(devices->value("needsbootloader", "") == "yes") {
331 m_installed = false; 331 m_error = false;
332 if(!installBootloaderAuto()) 332 m_installed = false;
333 return; 333 if(!installBootloaderAuto())
334 else 334 return;
335 { 335 else
336 // wait for boot loader installation finished 336 {
337 while(!m_installed) 337 // wait for boot loader installation finished
338 QApplication::processEvents(); 338 while(!m_installed)
339 QApplication::processEvents();
340 }
341 if(m_error) return;
342 logger->undoAbort();
339 } 343 }
340 if(m_error) return;
341 logger->undoAbort();
342 344
343 // Rockbox 345 // Rockbox
344 m_error = false; 346 m_error = false;
@@ -369,17 +371,20 @@ void RbUtilQt::completeInstall()
369 logger->undoAbort(); 371 logger->undoAbort();
370 372
371 // Doom 373 // Doom
372 m_error = false; 374 if(hasDoom())
373 m_installed = false;
374 if(!installDoomAuto())
375 return;
376 else
377 { 375 {
378 // wait for boot loader installation finished 376 m_error = false;
379 while(!m_installed) 377 m_installed = false;
380 QApplication::processEvents(); 378 if(!installDoomAuto())
379 return;
380 else
381 {
382 // wait for boot loader installation finished
383 while(!m_installed)
384 QApplication::processEvents();
385 }
386 if(m_error) return;
381 } 387 }
382 if(m_error) return;
383 388
384 389
385 // theme 390 // theme
@@ -408,18 +413,20 @@ void RbUtilQt::smallInstall()
408 return; 413 return;
409 } 414 }
410 // Bootloader 415 // Bootloader
411 m_error = false; 416 if(devices->value("needsbootloader", "") == "yes") {
412 m_installed = false; 417 m_error = false;
413 if(!installBootloaderAuto()) 418 m_installed = false;
414 return; 419 if(!installBootloaderAuto())
415 else 420 return;
416 { 421 else
417 // wait for boot loader installation finished 422 {
418 while(!m_installed) 423 // wait for boot loader installation finished
419 QApplication::processEvents(); 424 while(!m_installed)
425 QApplication::processEvents();
426 }
427 if(m_error) return;
428 logger->undoAbort();
420 } 429 }
421 if(m_error) return;
422 logger->undoAbort();
423 430
424 // Rockbox 431 // Rockbox
425 m_error = false; 432 m_error = false;
@@ -677,8 +684,7 @@ void RbUtilQt::installVoice()
677 684
678void RbUtilQt::installDoomBtn() 685void RbUtilQt::installDoomBtn()
679{ 686{
680 QFile doomrock(userSettings->value("mountpoint").toString()+"/.rockbox/rocks/games/doom.rock"); 687 if(!hasDoom()){
681 if(!doomrock.exists()){
682 QMessageBox::critical(this, tr("Error"), tr("Your device doesn't have a doom plugin. Aborting.")); 688 QMessageBox::critical(this, tr("Error"), tr("Your device doesn't have a doom plugin. Aborting."));
683 return; 689 return;
684 } 690 }
@@ -699,6 +705,12 @@ bool RbUtilQt::installDoomAuto()
699 return !m_error; 705 return !m_error;
700} 706}
701 707
708bool RbUtilQt::hasDoom()
709{
710 QFile doomrock(userSettings->value("mountpoint").toString()+"/.rockbox/rocks/games/doom.rock");
711 return doomrock.exists();
712}
713
702void RbUtilQt::installDoom() 714void RbUtilQt::installDoom()
703{ 715{
704 // create zip installer 716 // create zip installer
diff --git a/rbutil/rbutilqt/rbutilqt.h b/rbutil/rbutilqt/rbutilqt.h
index 4d889284a3..d30732bb99 100644
--- a/rbutil/rbutilqt/rbutilqt.h
+++ b/rbutil/rbutilqt/rbutilqt.h
@@ -83,6 +83,7 @@ class RbUtilQt : public QMainWindow
83 bool installFontsAuto(void); 83 bool installFontsAuto(void);
84 void installFonts(void); 84 void installFonts(void);
85 85
86 bool hasDoom(void);
86 void installDoomBtn(void); 87 void installDoomBtn(void);
87 bool installDoomAuto(void); 88 bool installDoomAuto(void);
88 void installDoom(void); 89 void installDoom(void);