diff options
Diffstat (limited to 'rbutil/rbutilFrm.cpp')
-rw-r--r-- | rbutil/rbutilFrm.cpp | 86 |
1 files changed, 82 insertions, 4 deletions
diff --git a/rbutil/rbutilFrm.cpp b/rbutil/rbutilFrm.cpp index 913e22df14..4e5d0c834c 100644 --- a/rbutil/rbutilFrm.cpp +++ b/rbutil/rbutilFrm.cpp | |||
@@ -29,6 +29,7 @@ | |||
29 | #include "rblogo.xpm" | 29 | #include "rblogo.xpm" |
30 | #include "untools2_3d.xpm" | 30 | #include "untools2_3d.xpm" |
31 | #include "themes_3d.xpm" | 31 | #include "themes_3d.xpm" |
32 | #include "doom_3d.xpm" | ||
32 | 33 | ||
33 | #include "bootloaders.h" | 34 | #include "bootloaders.h" |
34 | #include "install_dialogs.h" | 35 | #include "install_dialogs.h" |
@@ -45,12 +46,15 @@ BEGIN_EVENT_TABLE(rbutilFrm,wxFrame) | |||
45 | EVT_BUTTON (ID_THEMES_BTN, rbutilFrm::OnThemesBtn) | 46 | EVT_BUTTON (ID_THEMES_BTN, rbutilFrm::OnThemesBtn) |
46 | EVT_BUTTON (ID_BOOTLOADER_BTN, rbutilFrm::OnBootloaderBtn) | 47 | EVT_BUTTON (ID_BOOTLOADER_BTN, rbutilFrm::OnBootloaderBtn) |
47 | EVT_BUTTON (ID_BOOTLOADERREMOVE_BTN, rbutilFrm::OnBootloaderRemoveBtn) | 48 | EVT_BUTTON (ID_BOOTLOADERREMOVE_BTN, rbutilFrm::OnBootloaderRemoveBtn) |
49 | EVT_BUTTON (ID_DOOM_BTN, rbutilFrm::OnDoomBtn) | ||
50 | |||
48 | 51 | ||
49 | EVT_CLOSE(rbutilFrm::rbutilFrmClose) | 52 | EVT_CLOSE(rbutilFrm::rbutilFrmClose) |
50 | EVT_MENU(ID_FILE_EXIT, rbutilFrm::OnFileExit) | 53 | EVT_MENU(ID_FILE_EXIT, rbutilFrm::OnFileExit) |
51 | EVT_MENU(ID_FILE_ABOUT, rbutilFrm::OnFileAbout) | 54 | EVT_MENU(ID_FILE_ABOUT, rbutilFrm::OnFileAbout) |
52 | EVT_MENU(ID_FILE_WIPECACHE, rbutilFrm::OnFileWipeCache) | 55 | EVT_MENU(ID_FILE_WIPECACHE, rbutilFrm::OnFileWipeCache) |
53 | EVT_MENU(ID_PORTABLE_INSTALL, rbutilFrm::OnPortableInstall) | 56 | EVT_MENU(ID_PORTABLE_INSTALL, rbutilFrm::OnPortableInstall) |
57 | |||
54 | EVT_MENU(ID_FILE_PROXY, rbutilFrm::OnFileProxy) | 58 | EVT_MENU(ID_FILE_PROXY, rbutilFrm::OnFileProxy) |
55 | 59 | ||
56 | EVT_UPDATE_UI (ID_MANUAL, rbutilFrm::OnManualUpdate) | 60 | EVT_UPDATE_UI (ID_MANUAL, rbutilFrm::OnManualUpdate) |
@@ -99,7 +103,7 @@ void rbutilFrm::CreateGUIControls(void) | |||
99 | wxPanel* uninstallpage = new wxPanel(tabwindow,wxID_ANY); | 103 | wxPanel* uninstallpage = new wxPanel(tabwindow,wxID_ANY); |
100 | wxPanel* manualpage = new wxPanel(tabwindow,wxID_ANY); | 104 | wxPanel* manualpage = new wxPanel(tabwindow,wxID_ANY); |
101 | tabwindow->AddPage(installpage,wxT("Installation"),true); | 105 | tabwindow->AddPage(installpage,wxT("Installation"),true); |
102 | tabwindow->AddPage(themepage,wxT("Themes")); | 106 | tabwindow->AddPage(themepage,wxT("Extras")); |
103 | tabwindow->AddPage(uninstallpage,wxT("Uninstallation")); | 107 | tabwindow->AddPage(uninstallpage,wxT("Uninstallation")); |
104 | tabwindow->AddPage(manualpage,wxT("Manual")); | 108 | tabwindow->AddPage(manualpage,wxT("Manual")); |
105 | 109 | ||
@@ -153,7 +157,7 @@ void rbutilFrm::CreateGUIControls(void) | |||
153 | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5); | 157 | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5); |
154 | 158 | ||
155 | /*********************+ | 159 | /*********************+ |
156 | Theme Page | 160 | Extras Page |
157 | ***********************/ | 161 | ***********************/ |
158 | 162 | ||
159 | wxBoxSizer* WxBoxSizer3 = new wxBoxSizer(wxVERTICAL); | 163 | wxBoxSizer* WxBoxSizer3 = new wxBoxSizer(wxVERTICAL); |
@@ -200,6 +204,20 @@ void rbutilFrm::CreateGUIControls(void) | |||
200 | WxFlexGridSizer2->Add(WxStaticText6, 0, | 204 | WxFlexGridSizer2->Add(WxStaticText6, 0, |
201 | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5); | 205 | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5); |
202 | 206 | ||
207 | |||
208 | wxBitmap DoomInstallButton (doom_3d_xpm); | ||
209 | WxBitmapButton6 = new wxBitmapButton(themepage, ID_DOOM_BTN, | ||
210 | DoomInstallButton, wxPoint(0,0), wxSize(64,54), | ||
211 | wxRAISED_BORDER | wxBU_AUTODRAW); | ||
212 | WxBitmapButton6->SetToolTip(wxT("Download freedoom wad files.")); | ||
213 | WxFlexGridSizer2->Add(WxBitmapButton6, 0, | ||
214 | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); | ||
215 | |||
216 | wxStaticText* WxStaticText7 = new wxStaticText(themepage, wxID_ANY, | ||
217 | wxT("Install the freedoom wad files.\n\n")); | ||
218 | WxFlexGridSizer2->Add(WxStaticText7, 0, | ||
219 | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5); | ||
220 | |||
203 | /*********************+ | 221 | /*********************+ |
204 | Uninstall Page | 222 | Uninstall Page |
205 | ***********************/ | 223 | ***********************/ |
@@ -302,13 +320,15 @@ void rbutilFrm::CreateGUIControls(void) | |||
302 | wxLogVerbose(wxT("=== end rbutilFrm::CreateGUIControls")); | 320 | wxLogVerbose(wxT("=== end rbutilFrm::CreateGUIControls")); |
303 | } | 321 | } |
304 | 322 | ||
305 | |||
306 | void rbutilFrm::OnManualUpdate(wxUpdateUIEvent& event) | 323 | void rbutilFrm::OnManualUpdate(wxUpdateUIEvent& event) |
307 | { | 324 | { |
308 | wxString tmp = gv->curplat; | 325 | wxString tmp = gv->curplat; |
309 | 326 | ||
310 | if(tmp == wxT("h120")) tmp = wxT("h100"); //h120 has the h100 manual | 327 | if(tmp == wxT("h120")) tmp = wxT("h100"); //h120 has the h100 manual |
311 | 328 | if(tmp == wxT("fmrecorder8mb")) tmp = wxT("fmrecorder"); | |
329 | if(tmp == wxT("ipodmini1g")) tmp = wxT("ipodmini2g"); | ||
330 | if(tmp == wxT("recorder8mb")) tmp = wxT("recorderg"); | ||
331 | |||
312 | if( tmp == curManualDevice) | 332 | if( tmp == curManualDevice) |
313 | return; | 333 | return; |
314 | 334 | ||
@@ -813,6 +833,64 @@ void rbutilFrm::OnFontBtn(wxCommandEvent& event) | |||
813 | wxLogVerbose(wxT("=== end rbutilFrm::OnFontBtn")); | 833 | wxLogVerbose(wxT("=== end rbutilFrm::OnFontBtn")); |
814 | } | 834 | } |
815 | 835 | ||
836 | void rbutilFrm::OnDoomBtn(wxCommandEvent& event) | ||
837 | { | ||
838 | wxString src, dest, buf; | ||
839 | wxLogVerbose(wxT("=== begin rbutilFrm::OnDoomBtn(event)")); | ||
840 | |||
841 | // font install dialog, reused | ||
842 | fontInstallDlg dialog(NULL, wxID_ANY, | ||
843 | wxT("Freedoom wad file Installation")); | ||
844 | if (dialog.ShowModal() != wxID_OK) | ||
845 | return; | ||
846 | |||
847 | // really install ? | ||
848 | wxMessageDialog msg(this,wxT("Do you really want to install the Freedoom wads ?"),wxT("Freedoom installation"),wxOK|wxCANCEL); | ||
849 | if(msg.ShowModal() != wxID_OK ) | ||
850 | return; | ||
851 | |||
852 | buf.Printf(wxT("%s" PATH_SEP ".rockbox"), gv->curdestdir.c_str()) ; | ||
853 | if (! wxDirExists(buf) ) | ||
854 | { | ||
855 | buf.Printf(wxT("Rockbox is not yet installed on %s - install " | ||
856 | "Rockbox first."), buf.c_str() ); | ||
857 | WARN_DIALOG(buf, wxT("Can't install freedoom wads") ); | ||
858 | return; | ||
859 | } | ||
860 | |||
861 | src = gv->doom_url; | ||
862 | |||
863 | dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP | ||
864 | "rockdoom.zip"), gv->stdpaths->GetUserDataDir().c_str()); | ||
865 | |||
866 | if ( ! wxFileExists(dest) ) | ||
867 | { | ||
868 | if ( DownloadURL(src, dest) ) | ||
869 | { | ||
870 | wxRemoveFile(dest); | ||
871 | buf.Printf(wxT("Unable to download %s"), src.c_str() ); | ||
872 | ERR_DIALOG(buf, wxT("Freedoom Install")); | ||
873 | return; | ||
874 | } | ||
875 | } | ||
876 | |||
877 | if ( !UnzipFile(dest, gv->curdestdir, true) ) | ||
878 | { | ||
879 | wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Freedoom wads have been installed on your device.") | ||
880 | ,wxT("Installation"), wxOK |wxICON_INFORMATION); | ||
881 | msg->ShowModal(); | ||
882 | delete msg; | ||
883 | } else | ||
884 | { | ||
885 | wxRemoveFile(dest); | ||
886 | buf.Printf(wxT("Unable to unzip %s"), dest.c_str() ); | ||
887 | ERR_DIALOG(buf, wxT("Freedoom Install")); | ||
888 | } | ||
889 | |||
890 | |||
891 | wxLogVerbose(wxT("=== end rbutilFrm::OnDoomBtn")); | ||
892 | } | ||
893 | |||
816 | 894 | ||
817 | void rbutilFrm::OnThemesBtn(wxCommandEvent& event) | 895 | void rbutilFrm::OnThemesBtn(wxCommandEvent& event) |
818 | { | 896 | { |