summaryrefslogtreecommitdiff
path: root/rbutil/rbutilFrm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilFrm.cpp')
-rw-r--r--rbutil/rbutilFrm.cpp250
1 files changed, 236 insertions, 14 deletions
diff --git a/rbutil/rbutilFrm.cpp b/rbutil/rbutilFrm.cpp
index 0d56e9c5b1..738da27f2a 100644
--- a/rbutil/rbutilFrm.cpp
+++ b/rbutil/rbutilFrm.cpp
@@ -28,6 +28,8 @@
28#include "tools2_3d.xpm" 28#include "tools2_3d.xpm"
29#include "rblogo.xpm" 29#include "rblogo.xpm"
30 30
31#include "bootloaders.h"
32
31#include "wizard.xpm" 33#include "wizard.xpm"
32 34
33//---------------------------------------------------------------------------- 35//----------------------------------------------------------------------------
@@ -39,6 +41,7 @@ BEGIN_EVENT_TABLE(rbutilFrm,wxFrame)
39 EVT_BUTTON (ID_REMOVE_BTN, rbutilFrm::OnRemoveBtn) 41 EVT_BUTTON (ID_REMOVE_BTN, rbutilFrm::OnRemoveBtn)
40 EVT_BUTTON (ID_FONT_BTN, rbutilFrm::OnFontBtn) 42 EVT_BUTTON (ID_FONT_BTN, rbutilFrm::OnFontBtn)
41 EVT_BUTTON (ID_BOOTLOADER_BTN, rbutilFrm::OnBootloaderBtn) 43 EVT_BUTTON (ID_BOOTLOADER_BTN, rbutilFrm::OnBootloaderBtn)
44 EVT_BUTTON (ID_BOOTLOADERREMOVE_BTN, rbutilFrm::OnBootloaderRemoveBtn)
42 45
43 EVT_CLOSE(rbutilFrm::rbutilFrmClose) 46 EVT_CLOSE(rbutilFrm::rbutilFrmClose)
44 EVT_MENU(ID_FILE_EXIT, rbutilFrm::OnFileExit) 47 EVT_MENU(ID_FILE_EXIT, rbutilFrm::OnFileExit)
@@ -116,8 +119,7 @@ void rbutilFrm::CreateGUIControls(void)
116 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); 119 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
117 120
118 WxStaticText2 = new wxStaticText(WxPanel1, ID_WXSTATICTEXT2, 121 WxStaticText2 = new wxStaticText(WxPanel1, ID_WXSTATICTEXT2,
119 _("Install Rockbox on your audio player"), wxPoint(70,16), 122 _("Install Rockbox on your audio player"));
120 wxSize(175,17), 0, wxT("WxStaticText2"));
121 WxFlexGridSizer1->Add(WxStaticText2,0, 123 WxFlexGridSizer1->Add(WxStaticText2,0,
122 wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5); 124 wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
123 125
@@ -149,11 +151,24 @@ void rbutilFrm::CreateGUIControls(void)
149 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); 151 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
150 152
151 WxStaticText3 = new wxStaticText(WxPanel1, ID_WXSTATICTEXT3, 153 WxStaticText3 = new wxStaticText(WxPanel1, ID_WXSTATICTEXT3,
152 _("Remove Rockbox from your audio player"), wxPoint(60,66), 154 _("Remove Rockbox from your audio player"));
153 wxSize(196,17), 0, wxT("WxStaticText3"));
154 WxFlexGridSizer1->Add(WxStaticText3,0, 155 WxFlexGridSizer1->Add(WxStaticText3,0,
155 wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5); 156 wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
156 157
158 wxBitmap WxBitmapButton4_BITMAP (uninstall_3d_xpm);
159 WxBitmapButton4 = new wxBitmapButton(WxPanel1, ID_BOOTLOADERREMOVE_BTN,
160 WxBitmapButton4_BITMAP, wxPoint(0,0), wxSize(64,54),
161 wxRAISED_BORDER | wxBU_AUTODRAW, wxDefaultValidator,
162 wxT("WxBitmapButton4"));
163 WxBitmapButton4->SetToolTip(_("Uninstall Bootloader"));
164 WxFlexGridSizer1->Add(WxBitmapButton4,0,
165 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
166
167 WxStaticText4 = new wxStaticText(WxPanel1, ID_WXSTATICTEXT4,
168 _("Remove Rockbox Bootloader from your audio player"));
169 WxFlexGridSizer1->Add(WxStaticText4,0,
170 wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
171
157 WxMenuBar1 = new wxMenuBar(); 172 WxMenuBar1 = new wxMenuBar();
158 wxMenu *ID_FILE_MENU_Mnu_Obj = new wxMenu(0); 173 wxMenu *ID_FILE_MENU_Mnu_Obj = new wxMenu(0);
159 WxMenuBar1->Append(ID_FILE_MENU_Mnu_Obj, _("&File")); 174 WxMenuBar1->Append(ID_FILE_MENU_Mnu_Obj, _("&File"));
@@ -251,7 +266,10 @@ void rbutilFrm::OnFileWipeCache(wxCommandEvent& event)
251 266
252 if (! rm_rf(cacheloc) ) 267 if (! rm_rf(cacheloc) )
253 { 268 {
254 MESG_DIALOG(_("Local download cache has been deleted.")); 269 wxMessageDialog* msg = new wxMessageDialog(this, _("Local download cache has been deleted.")
270 ,"Cache deletion", wxOK |wxICON_INFORMATION);
271 msg->ShowModal();
272 delete msg;
255 } 273 }
256 else { 274 else {
257 MESG_DIALOG(_("Errors occured deleting the local download cache.")); 275 MESG_DIALOG(_("Errors occured deleting the local download cache."));
@@ -260,16 +278,207 @@ void rbutilFrm::OnFileWipeCache(wxCommandEvent& event)
260 wxMkdir(cacheloc, 0777); 278 wxMkdir(cacheloc, 0777);
261} 279}
262 280
281void rbutilFrm::OnBootloaderRemoveBtn(wxCommandEvent& event)
282{
283 wxLogVerbose("=== begin rbutilFrm::OnBootloaderRemoveBtn(event)");
284
285 wxWizard *wizard = new wxWizard(this, wxID_ANY,
286 _("Rockbox Bootloader Uninstallation Wizard"),
287 wxBitmap(wizard_xpm),
288 wxDefaultPosition,
289 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
290 wxBootPlatformPage* page1 = new wxBootPlatformPage(wizard);
291 wxBootLocationPage* page2 = new wxBootLocationPage(wizard); // Only one of these pages are shown
292 wxIpodLocationPage* page3 = new wxIpodLocationPage(wizard); // depending on Device selected
293
294 page1->SetNext(page2);
295 page2->SetPrev(page1);
296 page2->SetNext(page3);
297 page3->SetPrev(page2);
298
299 wizard->GetPageAreaSizer()->Add(page1);
300
301
302 if (wizard->RunWizard(page1) )
303 {
304 // uninstall the bootloader
305 if(gv->curbootloadermethod == "ipodpatcher")
306 {
307
308 if(ipodpatcher(BOOTLOADER_REM))
309 {
310 wxMessageDialog* msg = new wxMessageDialog(this, _("The Bootloader has been uninstalled.")
311 ,"Uninstallation", wxOK |wxICON_INFORMATION);
312 msg->ShowModal();
313 delete msg;
314 }
315 else
316 {
317 MESG_DIALOG(_("The Uninstallation has failed.") );
318 }
319 }
320 else if(gv->curbootloadermethod == "gigabeatf")
321 {
322
323 if(gigabeatf(BOOTLOADER_REM))
324 {
325 wxMessageDialog* msg = new wxMessageDialog(this, _("The Bootloader has been uninstalled.")
326 ,"Uninstallation", wxOK |wxICON_INFORMATION);
327 msg->ShowModal();
328 delete msg;
329 }
330 else
331 MESG_DIALOG(_("The Uninstallation has failed.") );
332 }
333 else if(gv->curbootloadermethod == "h10")
334 {
335 if(h10(BOOTLOADER_REM))
336 {
337 wxMessageDialog* msg = new wxMessageDialog(this, _("The Bootloader has been uninstalled.")
338 ,"Uninstallation", wxOK |wxICON_INFORMATION);
339 msg->ShowModal();
340 delete msg;
341 }
342 else
343 MESG_DIALOG(_("The Uninstallation has failed.") );
344
345 }
346 else if(gv->curbootloadermethod == "iaudio" )
347 {
348 wxMessageDialog* msg = new wxMessageDialog(this, _("To uninstall the Bootloader on this Device,\n"
349 "you need to download and install an Original Firmware from the Manufacturer.")
350 ,"Uninstallation", wxOK |wxICON_INFORMATION);
351 msg->ShowModal();
352 delete msg;
353 }
354 else if(gv->curbootloadermethod == "fwpatcher" )
355 {
356 wxMessageDialog* msg = new wxMessageDialog(this, _("To uninstall the Bootloader on this Device,\n"
357 "you need to download and install an original Firmware from the Manufacturer.\n"
358 "To do this, you need to boot into the original Firmware.")
359 ,"Uninstallation", wxOK |wxICON_INFORMATION);
360 msg->ShowModal();
361 delete msg;
362 }
363 else
364 {
365 MESG_DIALOG(_("Unsupported Bootloader Method") );
366 }
367 }
368 else
369 {
370 MESG_DIALOG(_("The bootloader Uninstallation wizard was cancelled") );
371 }
372
373 wxLogVerbose("=== end rbutilFrm::OnBootloaderRemoveBtn");
374}
263 375
264void rbutilFrm::OnBootloaderBtn(wxCommandEvent& event) 376void rbutilFrm::OnBootloaderBtn(wxCommandEvent& event)
265{ 377{
266 if (!wxLaunchDefaultBrowser(wxT( 378 wxLogVerbose("=== begin rbutilFrm::OnBootloaderBtn(event)");
267 "http://www.rockbox.org/twiki/bin/view/Main/" 379
268 "DocsIndex#Rockbox_Installation_Instruction") ) ) 380 wxWizard *wizard = new wxWizard(this, wxID_ANY,
381 _("Rockbox Installation Wizard"),
382 wxBitmap(wizard_xpm),
383 wxDefaultPosition,
384 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
385 wxBootPlatformPage* page1 = new wxBootPlatformPage(wizard);
386 wxFirmwareLocationPage* page2 = new wxFirmwareLocationPage(wizard); //this page is optional
387 wxBootLocationPage* page3 = new wxBootLocationPage(wizard); // Only one of these pages are shown
388 wxIpodLocationPage* page4 = new wxIpodLocationPage(wizard); // depending on Device selected
389
390 page1->SetNext(page2);
391 page2->SetPrev(page1);
392 page2->SetNext(page3);
393 page3->SetPrev(page2);
394 page3->SetNext(page4);
395 page4->SetPrev(page3);
396
397 wizard->GetPageAreaSizer()->Add(page1);
398
399 if (wizard->RunWizard(page1) )
400 {
401 // start installation depending on player
402 if(gv->curbootloadermethod == "ipodpatcher")
403 {
404
405 if(ipodpatcher(BOOTLOADER_ADD))
406 {
407 wxMessageDialog* msg = new wxMessageDialog(this, _("The Bootloader has been installed on your device.")
408 ,"Installation", wxOK |wxICON_INFORMATION);
409 msg->ShowModal();
410 delete msg;
411 }
412 else
413 {
414 MESG_DIALOG(_("The installation has failed.") );
415 }
416 }
417 else if(gv->curbootloadermethod == "gigabeatf")
418 {
419
420 if(gigabeatf(BOOTLOADER_ADD))
421 {
422 wxMessageDialog* msg = new wxMessageDialog(this, _("The Bootloader has been installed on your device.")
423 ,"Installation", wxOK |wxICON_INFORMATION);
424 msg->ShowModal();
425 delete msg;
426 }
427 else
428 MESG_DIALOG(_("The installation has failed.") );
429 }
430 else if(gv->curbootloadermethod == "iaudio" )
431 {
432 if(iaudiox5(BOOTLOADER_ADD))
433 {
434 wxMessageDialog* msg = new wxMessageDialog(this, _("The Bootloader has been installed on your device.\n"
435 "Now turn OFF your Device, unplug USB,and insert Charger\n"
436 "Your Device will automatically upgrade the flash with the Rockbox bootloader")
437 ,"Installation", wxOK |wxICON_INFORMATION);
438 msg->ShowModal();
439 delete msg;
440 }
441 else
442 MESG_DIALOG(_("The installation has failed.") );
443 }
444 else if(gv->curbootloadermethod == "fwpatcher")
445 {
446 if(fwpatcher(BOOTLOADER_ADD))
447 {
448 wxMessageDialog* msg = new wxMessageDialog(this, _("The Bootloader has been patched and copied on your device.\n"
449 "Now use the Firmware upgrade option of your Device\n")
450 ,"Installation", wxOK |wxICON_INFORMATION);
451 msg->ShowModal();
452 delete msg;
453 }
454 else
455 MESG_DIALOG(_("The installation has failed.") );
456 }
457 else if(gv->curbootloadermethod == "h10")
458 {
459 if(h10(BOOTLOADER_ADD))
460 {
461 wxMessageDialog* msg = new wxMessageDialog(this, _("The Bootloader has been patched and copied on your device.\n"
462 "Now use the Firmware upgrade option of your Device\n")
463 ,"Installation", wxOK |wxICON_INFORMATION);
464 msg->ShowModal();
465 delete msg;
466 }
467 else
468 MESG_DIALOG(_("The installation has failed.") );
469 }
470 else
471 {
472 MESG_DIALOG(_("Unsupported Bootloader Method") );
473 }
474 }
475 else
269 { 476 {
270 ERR_DIALOG(_("Unable to launch external browser"), 477 MESG_DIALOG(_("The bootloader installation wizard was cancelled") );
271 _("Boot loader install instructions."));
272 } 478 }
479
480 wxLogVerbose("=== end rbutilFrm::OnBootloaderBtn");
481
273} 482}
274 483
275void rbutilFrm::OnInstallBtn(wxCommandEvent& event) 484void rbutilFrm::OnInstallBtn(wxCommandEvent& event)
@@ -378,7 +587,10 @@ void rbutilFrm::OnInstallBtn(wxCommandEvent& event)
378 587
379 if ( !UnzipFile(dest, gv->curdestdir, true) ) 588 if ( !UnzipFile(dest, gv->curdestdir, true) )
380 { 589 {
381 MESG_DIALOG(_("Rockbox has been installed on your device.") ); 590 wxMessageDialog* msg = new wxMessageDialog(this, _("Rockbox has been installed on your device.")
591 ,"Installation", wxOK |wxICON_INFORMATION);
592 msg->ShowModal();
593 delete msg;
382 } else 594 } else
383 { 595 {
384 wxRemoveFile(dest); 596 wxRemoveFile(dest);
@@ -472,7 +684,10 @@ void rbutilFrm::OnFontBtn(wxCommandEvent& event)
472 684
473 if ( !UnzipFile(dest, gv->curdestdir, true) ) 685 if ( !UnzipFile(dest, gv->curdestdir, true) )
474 { 686 {
475 MESG_DIALOG(_("The Rockbox fonts have been installed on your device.") ); 687 wxMessageDialog* msg = new wxMessageDialog(this, _("The Rockbox fonts have been installed on your device.")
688 ,"Installation", wxOK |wxICON_INFORMATION);
689 msg->ShowModal();
690 delete msg;
476 } else 691 } else
477 { 692 {
478 wxRemoveFile(dest); 693 wxRemoveFile(dest);
@@ -511,7 +726,11 @@ void rbutilFrm::OnRemoveBtn(wxCommandEvent& event)
511 _("The uninstallation wizard was cancelled or completed with " 726 _("The uninstallation wizard was cancelled or completed with "
512 "some errors.") ); 727 "some errors.") );
513 } else { 728 } else {
514 MESG_DIALOG(_("The uninstall wizard completed successfully") ); 729 wxMessageDialog* msg = new wxMessageDialog(this, _("The uninstall wizard completed successfully\n"
730 "Depending on which Device you own, you also have to uninstall the Bootloader")
731 ,"Uninstallation", wxOK |wxICON_INFORMATION);
732 msg->ShowModal();
733 delete msg;
515 } 734 }
516 } else 735 } else
517 { 736 {
@@ -542,7 +761,10 @@ void rbutilFrm::OnPortableInstall(wxCommandEvent& event)
542 { 761 {
543 if ( InstallRbutil(gv->curdestdir) ) 762 if ( InstallRbutil(gv->curdestdir) )
544 { 763 {
545 MESG_DIALOG(_("The Rockbox Utility has been installed on your device.") ); 764 wxMessageDialog* msg = new wxMessageDialog(this, _("The Rockbox Utility has been installed on your device.")
765 ,"Installation", wxOK |wxICON_INFORMATION);
766 msg->ShowModal();
767 delete msg;
546 } else 768 } else
547 { 769 {
548 ERR_DIALOG(_("Installation failed"), _("Portable Install")); 770 ERR_DIALOG(_("Installation failed"), _("Portable Install"));