diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2007-07-16 10:18:20 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2007-07-16 10:18:20 +0000 |
commit | 7564ad8efa6b7abd853003168d2b62525e8393e4 (patch) | |
tree | 0d22b6177bdd1a724fee26df60a02d4abd62ab90 | |
parent | ad9db0c145791a10a054e39079186212b283b7db (diff) | |
download | rockbox-7564ad8efa6b7abd853003168d2b62525e8393e4.tar.gz rockbox-7564ad8efa6b7abd853003168d2b62525e8393e4.zip |
- fix an endless autodetection loop when no user configuration is present
- don't try to load the manual if a proxy is set -- wx' html view doesn't honor the proxy
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13914 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | rbutil/rbutilFrm.cpp | 40 | ||||
-rw-r--r-- | rbutil/rbutilFrm.h | 2 |
2 files changed, 28 insertions, 14 deletions
diff --git a/rbutil/rbutilFrm.cpp b/rbutil/rbutilFrm.cpp index 13f246f1e2..306f955d46 100644 --- a/rbutil/rbutilFrm.cpp +++ b/rbutil/rbutilFrm.cpp | |||
@@ -341,7 +341,19 @@ void rbutilFrm::OnManualUpdate(wxUpdateUIEvent& event) | |||
341 | { | 341 | { |
342 | wxString tmp = wxT("/rockbox-") + gv->curplat; | 342 | wxString tmp = wxT("/rockbox-") + gv->curplat; |
343 | 343 | ||
344 | int index = GetDeviceId(); | 344 | int index = GetDeviceId(false); |
345 | if(index < 0) { | ||
346 | curManualDevice = tmp; | ||
347 | wxString pdflink; | ||
348 | pdflink = gv->manual_url; | ||
349 | manuallink->SetURL(pdflink); | ||
350 | manual->SetPage(wxT("<p><b>no device selected</b> — " | ||
351 | "You can find an overview of available manuals at " | ||
352 | "<a href='http://www.rockbox.org/manual.shtml'>" | ||
353 | "http://www.rockbox.org/manual.shtml</a></p>")); | ||
354 | return; | ||
355 | } | ||
356 | |||
345 | if(gv->plat_manualname[index] != wxT("")) | 357 | if(gv->plat_manualname[index] != wxT("")) |
346 | tmp = wxT("/") + gv->plat_manualname[index]; | 358 | tmp = wxT("/") + gv->plat_manualname[index]; |
347 | 359 | ||
@@ -358,8 +370,10 @@ void rbutilFrm::OnManualUpdate(wxUpdateUIEvent& event) | |||
358 | // construct link to html | 370 | // construct link to html |
359 | wxString htmllink; | 371 | wxString htmllink; |
360 | htmllink = gv->manual_url + tmp + wxT("/rockbox-build.html"); | 372 | htmllink = gv->manual_url + tmp + wxT("/rockbox-build.html"); |
361 | if(!manual->LoadPage(htmllink)) | 373 | if(gv->proxy_url == wxT("")) |
362 | manual->SetPage(wxT("<p>unable to display manual -- please use the PDF link above</p>")); | 374 | if(manual->LoadPage(htmllink)) return; |
375 | manual->SetPage(wxT("<p>unable to display manual —" | ||
376 | "please use the PDF link above</p>")); | ||
363 | 377 | ||
364 | 378 | ||
365 | } | 379 | } |
@@ -456,7 +470,7 @@ void rbutilFrm::OnBootloaderRemoveBtn(wxCommandEvent& event) | |||
456 | { | 470 | { |
457 | wxLogVerbose(wxT("=== begin rbutilFrm::OnBootloaderRemoveBtn(event)")); | 471 | wxLogVerbose(wxT("=== begin rbutilFrm::OnBootloaderRemoveBtn(event)")); |
458 | 472 | ||
459 | int index = GetDeviceId(); | 473 | int index = GetDeviceId(true); |
460 | if(index < 0) | 474 | if(index < 0) |
461 | return; | 475 | return; |
462 | 476 | ||
@@ -541,7 +555,7 @@ void rbutilFrm::OnBootloaderBtn(wxCommandEvent& event) | |||
541 | { | 555 | { |
542 | wxLogVerbose(wxT("=== begin rbutilFrm::OnBootloaderBtn(event)")); | 556 | wxLogVerbose(wxT("=== begin rbutilFrm::OnBootloaderBtn(event)")); |
543 | 557 | ||
544 | int index = GetDeviceId(); | 558 | int index = GetDeviceId(true); |
545 | if(index < 0) | 559 | if(index < 0) |
546 | return; | 560 | return; |
547 | 561 | ||
@@ -654,7 +668,7 @@ void rbutilFrm::OnInstallBtn(wxCommandEvent& event) | |||
654 | wxFileConfig* buildinfo; | 668 | wxFileConfig* buildinfo; |
655 | wxDateSpan oneday; | 669 | wxDateSpan oneday; |
656 | 670 | ||
657 | int index = GetDeviceId(); | 671 | int index = GetDeviceId(true); |
658 | if(index < 0) | 672 | if(index < 0) |
659 | return; | 673 | return; |
660 | 674 | ||
@@ -766,7 +780,7 @@ void rbutilFrm::OnFontBtn(wxCommandEvent& event) | |||
766 | wxFileConfig* buildinfo; | 780 | wxFileConfig* buildinfo; |
767 | wxDateSpan oneday; | 781 | wxDateSpan oneday; |
768 | 782 | ||
769 | int index = GetDeviceId(); | 783 | int index = GetDeviceId(true); |
770 | if(index < 0) | 784 | if(index < 0) |
771 | return; | 785 | return; |
772 | 786 | ||
@@ -855,7 +869,7 @@ void rbutilFrm::OnDoomBtn(wxCommandEvent& event) | |||
855 | wxString src, dest, buf; | 869 | wxString src, dest, buf; |
856 | wxLogVerbose(wxT("=== begin rbutilFrm::OnDoomBtn(event)")); | 870 | wxLogVerbose(wxT("=== begin rbutilFrm::OnDoomBtn(event)")); |
857 | 871 | ||
858 | int index = GetDeviceId(); | 872 | int index = GetDeviceId(true); |
859 | if(index < 0) | 873 | if(index < 0) |
860 | return; | 874 | return; |
861 | 875 | ||
@@ -917,7 +931,7 @@ void rbutilFrm::OnThemesBtn(wxCommandEvent& event) | |||
917 | wxString src, dest, buf; | 931 | wxString src, dest, buf; |
918 | wxLogVerbose(wxT("=== begin rbutilFrm::OnThemesBtn(event)")); | 932 | wxLogVerbose(wxT("=== begin rbutilFrm::OnThemesBtn(event)")); |
919 | 933 | ||
920 | int index = GetDeviceId(); | 934 | int index = GetDeviceId(true); |
921 | if(index < 0) | 935 | if(index < 0) |
922 | return; | 936 | return; |
923 | 937 | ||
@@ -956,7 +970,7 @@ void rbutilFrm::OnRemoveBtn(wxCommandEvent& event) | |||
956 | { | 970 | { |
957 | wxLogVerbose(wxT("=== begin rbutilFrm::OnRemoveBtn(event)")); | 971 | wxLogVerbose(wxT("=== begin rbutilFrm::OnRemoveBtn(event)")); |
958 | 972 | ||
959 | int index = GetDeviceId(); | 973 | int index = GetDeviceId(true); |
960 | if(index < 0) | 974 | if(index < 0) |
961 | return; | 975 | return; |
962 | 976 | ||
@@ -995,7 +1009,7 @@ void rbutilFrm::OnPortableInstall(wxCommandEvent& event) | |||
995 | wxFileSystem fs; | 1009 | wxFileSystem fs; |
996 | wxDateSpan oneday; | 1010 | wxDateSpan oneday; |
997 | 1011 | ||
998 | int index = GetDeviceId(); | 1012 | int index = GetDeviceId(true); |
999 | if(index < 0) | 1013 | if(index < 0) |
1000 | return; | 1014 | return; |
1001 | 1015 | ||
@@ -1050,10 +1064,10 @@ void rbutilFrm::OnTalkBtn(wxCommandEvent& event) | |||
1050 | wxLogVerbose(wxT("=== end rbutilFrm::OnTalkBtn")); | 1064 | wxLogVerbose(wxT("=== end rbutilFrm::OnTalkBtn")); |
1051 | } | 1065 | } |
1052 | 1066 | ||
1053 | int rbutilFrm::GetDeviceId() | 1067 | int rbutilFrm::GetDeviceId(bool detect) |
1054 | { | 1068 | { |
1055 | int index = gv->plat_id.Index(gv->curplat); | 1069 | int index = gv->plat_id.Index(gv->curplat); |
1056 | if(index < 0) | 1070 | if(index < 0 && detect) |
1057 | { | 1071 | { |
1058 | if( wxMessageBox(wxT("No device selected. Do you want to autodetect " | 1072 | if( wxMessageBox(wxT("No device selected. Do you want to autodetect " |
1059 | "the device?"), | 1073 | "the device?"), |
diff --git a/rbutil/rbutilFrm.h b/rbutil/rbutilFrm.h index 63e1ee34dc..7341323bd9 100644 --- a/rbutil/rbutilFrm.h +++ b/rbutil/rbutilFrm.h | |||
@@ -124,7 +124,7 @@ public: | |||
124 | void OnDoomBtn(wxCommandEvent& event); | 124 | void OnDoomBtn(wxCommandEvent& event); |
125 | void OnTalkBtn(wxCommandEvent& event); | 125 | void OnTalkBtn(wxCommandEvent& event); |
126 | 126 | ||
127 | int GetDeviceId(); | 127 | int GetDeviceId(bool); |
128 | 128 | ||
129 | }; | 129 | }; |
130 | 130 | ||