From 7564ad8efa6b7abd853003168d2b62525e8393e4 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Mon, 16 Jul 2007 10:18:20 +0000 Subject: - 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 --- rbutil/rbutilFrm.cpp | 40 +++++++++++++++++++++++++++------------- 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) { wxString tmp = wxT("/rockbox-") + gv->curplat; - int index = GetDeviceId(); + int index = GetDeviceId(false); + if(index < 0) { + curManualDevice = tmp; + wxString pdflink; + pdflink = gv->manual_url; + manuallink->SetURL(pdflink); + manual->SetPage(wxT("

no device selected — " + "You can find an overview of available manuals at " + "" + "http://www.rockbox.org/manual.shtml

")); + return; + } + if(gv->plat_manualname[index] != wxT("")) tmp = wxT("/") + gv->plat_manualname[index]; @@ -358,8 +370,10 @@ void rbutilFrm::OnManualUpdate(wxUpdateUIEvent& event) // construct link to html wxString htmllink; htmllink = gv->manual_url + tmp + wxT("/rockbox-build.html"); - if(!manual->LoadPage(htmllink)) - manual->SetPage(wxT("

unable to display manual -- please use the PDF link above

")); + if(gv->proxy_url == wxT("")) + if(manual->LoadPage(htmllink)) return; + manual->SetPage(wxT("

unable to display manual —" + "please use the PDF link above

")); } @@ -456,7 +470,7 @@ void rbutilFrm::OnBootloaderRemoveBtn(wxCommandEvent& event) { wxLogVerbose(wxT("=== begin rbutilFrm::OnBootloaderRemoveBtn(event)")); - int index = GetDeviceId(); + int index = GetDeviceId(true); if(index < 0) return; @@ -541,7 +555,7 @@ void rbutilFrm::OnBootloaderBtn(wxCommandEvent& event) { wxLogVerbose(wxT("=== begin rbutilFrm::OnBootloaderBtn(event)")); - int index = GetDeviceId(); + int index = GetDeviceId(true); if(index < 0) return; @@ -654,7 +668,7 @@ void rbutilFrm::OnInstallBtn(wxCommandEvent& event) wxFileConfig* buildinfo; wxDateSpan oneday; - int index = GetDeviceId(); + int index = GetDeviceId(true); if(index < 0) return; @@ -766,7 +780,7 @@ void rbutilFrm::OnFontBtn(wxCommandEvent& event) wxFileConfig* buildinfo; wxDateSpan oneday; - int index = GetDeviceId(); + int index = GetDeviceId(true); if(index < 0) return; @@ -855,7 +869,7 @@ void rbutilFrm::OnDoomBtn(wxCommandEvent& event) wxString src, dest, buf; wxLogVerbose(wxT("=== begin rbutilFrm::OnDoomBtn(event)")); - int index = GetDeviceId(); + int index = GetDeviceId(true); if(index < 0) return; @@ -917,7 +931,7 @@ void rbutilFrm::OnThemesBtn(wxCommandEvent& event) wxString src, dest, buf; wxLogVerbose(wxT("=== begin rbutilFrm::OnThemesBtn(event)")); - int index = GetDeviceId(); + int index = GetDeviceId(true); if(index < 0) return; @@ -956,7 +970,7 @@ void rbutilFrm::OnRemoveBtn(wxCommandEvent& event) { wxLogVerbose(wxT("=== begin rbutilFrm::OnRemoveBtn(event)")); - int index = GetDeviceId(); + int index = GetDeviceId(true); if(index < 0) return; @@ -995,7 +1009,7 @@ void rbutilFrm::OnPortableInstall(wxCommandEvent& event) wxFileSystem fs; wxDateSpan oneday; - int index = GetDeviceId(); + int index = GetDeviceId(true); if(index < 0) return; @@ -1050,10 +1064,10 @@ void rbutilFrm::OnTalkBtn(wxCommandEvent& event) wxLogVerbose(wxT("=== end rbutilFrm::OnTalkBtn")); } -int rbutilFrm::GetDeviceId() +int rbutilFrm::GetDeviceId(bool detect) { int index = gv->plat_id.Index(gv->curplat); - if(index < 0) + if(index < 0 && detect) { if( wxMessageBox(wxT("No device selected. Do you want to autodetect " "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: void OnDoomBtn(wxCommandEvent& event); void OnTalkBtn(wxCommandEvent& event); - int GetDeviceId(); + int GetDeviceId(bool); }; -- cgit v1.2.3