early proxy support on rbutil

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13330 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Wenger 2007-05-05 20:23:28 +00:00
parent 5e7b140a09
commit 1b36be2946
5 changed files with 28 additions and 2 deletions

View file

@ -131,6 +131,10 @@ int DownloadURL(wxString src, wxString dest)
input = true;
wxURL* in_http = new wxURL(src);
if(gv->proxy_url != wxT(""))
in_http->SetProxy(gv->proxy_url);
if (in_http->GetError() == wxURL_NOERR)
{

View file

@ -107,6 +107,7 @@ public:
wxString bootloader_url;
wxString themes_url;
wxString manual_url;
wxString proxy_url;
// User configuration data.
wxString curplat;

View file

@ -253,6 +253,7 @@ void rbutilFrmApp::ReadUserConfig()
if (gv->UserConfig->Read(wxT("curdestdir"), &str) ) gv->curdestdir = str;
if (gv->UserConfig->Read(wxT("curplatform"), &str) ) gv->curplat = str;
if (gv->UserConfig->Read(wxT("curfirmware"), &str) ) gv->curfirmware = str;
if (gv->UserConfig->Read(wxT("proxy_url"), &str) ) gv->proxy_url = str;
gv->UserConfig->SetPath(stack);
}
@ -261,7 +262,8 @@ void rbutilFrmApp::WriteUserConfig()
gv->UserConfig->SetPath(wxT("/defaults"));
gv->UserConfig->Write(wxT("curdestdir"), gv->curdestdir);
gv->UserConfig->Write(wxT("curplatform"), gv->curplat);
gv->UserConfig->Write(wxT("curfirmware"), gv->curfirmware);
gv->UserConfig->Write(wxT("curfirmware"), gv->curfirmware);
gv->UserConfig->Write(wxT("proxy_url"), gv->proxy_url);
delete gv->UserConfig;

View file

@ -51,6 +51,7 @@ BEGIN_EVENT_TABLE(rbutilFrm,wxFrame)
EVT_MENU(ID_FILE_ABOUT, rbutilFrm::OnFileAbout)
EVT_MENU(ID_FILE_WIPECACHE, rbutilFrm::OnFileWipeCache)
EVT_MENU(ID_PORTABLE_INSTALL, rbutilFrm::OnPortableInstall)
EVT_MENU(ID_FILE_PROXY, rbutilFrm::OnFileProxy)
EVT_UPDATE_UI (ID_MANUAL, rbutilFrm::OnManualUpdate)
@ -275,6 +276,8 @@ void rbutilFrm::CreateGUIControls(void)
ID_FILE_MENU_Mnu_Obj->Append(ID_PORTABLE_INSTALL,
wxT("&Install Rockbox Utility on device"), wxT(""), wxITEM_NORMAL);
}
ID_FILE_MENU_Mnu_Obj->Append(ID_FILE_PROXY, wxT("Set &Proxy"), wxT(""),
wxITEM_NORMAL);
ID_FILE_MENU_Mnu_Obj->Append(ID_FILE_ABOUT, wxT("&About"), wxT(""),
wxITEM_NORMAL);
ID_FILE_MENU_Mnu_Obj->Append(ID_FILE_EXIT, wxT("E&xit\tCtrl+X"), wxT(""),
@ -319,12 +322,26 @@ void rbutilFrm::OnManualUpdate(wxUpdateUIEvent& event)
// construct link to html
wxString htmllink;
htmllink.Printf(wxT("%s%s/rockbox-build.html"),gv->manual_url.c_str(),curManualDevice.c_str());
manual->LoadPage(htmllink);
if(!manual->LoadPage(htmllink))
manual->SetPage(wxT("<p>unable to display manual -- please use the PDF link above</p>"));
}
void rbutilFrm::OnFileProxy(wxCommandEvent& event)
{
wxTextEntryDialog proxydlg(this,wxT("Please enter your Proxy in the Format: URL:PORT"),wxT("Proxy Configuration"));
if(proxydlg.ShowModal() == wxID_OK)
{
gv->proxy_url = proxydlg.GetValue();
}
}
void rbutilFrm::rbutilFrmClose(wxCloseEvent& event)
{
wxLogVerbose(wxT("=== begin rbutilFrm::rbutilFrmClose(event)"));

View file

@ -97,6 +97,7 @@ public:
ID_WXPANEL1 = 1064,
ID_MANUAL = 1065,
ID_FILE_PROXY = 1066,
ID_DUMMY_VALUE_
}; //End of Enum
@ -116,6 +117,7 @@ public:
void OnBootloaderRemoveBtn(wxCommandEvent& event);
void OnManualUpdate(wxUpdateUIEvent& event);
void OnFileProxy(wxCommandEvent& event);
};