summaryrefslogtreecommitdiffstats
path: root/rbutil
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2007-05-05 20:23:28 +0000
committerDominik Wenger <domonoky@googlemail.com>2007-05-05 20:23:28 +0000
commit1b36be2946d276ab81d80cafcd4a39792f8a3272 (patch)
tree486f5fa70387086e8c739896116d1c61da10476b /rbutil
parent5e7b140a0935415a965ac13ea09f86363e651cd7 (diff)
downloadrockbox-1b36be2946d276ab81d80cafcd4a39792f8a3272.tar.gz
rockbox-1b36be2946d276ab81d80cafcd4a39792f8a3272.tar.bz2
rockbox-1b36be2946d276ab81d80cafcd4a39792f8a3272.zip
early proxy support on rbutil
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13330 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil')
-rw-r--r--rbutil/rbutil.cpp4
-rw-r--r--rbutil/rbutil.h1
-rw-r--r--rbutil/rbutilApp.cpp4
-rw-r--r--rbutil/rbutilFrm.cpp19
-rw-r--r--rbutil/rbutilFrm.h2
5 files changed, 28 insertions, 2 deletions
diff --git a/rbutil/rbutil.cpp b/rbutil/rbutil.cpp
index df496a1c42..e778cf404e 100644
--- a/rbutil/rbutil.cpp
+++ b/rbutil/rbutil.cpp
@@ -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)
{
diff --git a/rbutil/rbutil.h b/rbutil/rbutil.h
index 47a2803981..bae62afd2d 100644
--- a/rbutil/rbutil.h
+++ b/rbutil/rbutil.h
@@ -107,6 +107,7 @@ public:
wxString bootloader_url;
wxString themes_url;
wxString manual_url;
+ wxString proxy_url;
// User configuration data.
wxString curplat;
diff --git a/rbutil/rbutilApp.cpp b/rbutil/rbutilApp.cpp
index 15b012d041..8ecd4a0914 100644
--- a/rbutil/rbutilApp.cpp
+++ b/rbutil/rbutilApp.cpp
@@ -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;
diff --git a/rbutil/rbutilFrm.cpp b/rbutil/rbutilFrm.cpp
index 5db93b3996..913e22df14 100644
--- a/rbutil/rbutilFrm.cpp
+++ b/rbutil/rbutilFrm.cpp
@@ -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,8 +322,22 @@ 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();
+ }
}
diff --git a/rbutil/rbutilFrm.h b/rbutil/rbutilFrm.h
index ed7db30a20..2f31df8867 100644
--- a/rbutil/rbutilFrm.h
+++ b/rbutil/rbutilFrm.h
@@ -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);
};