rbutil can now install the Freedoom wads. Thanks to M.Arnold for the pic on the doom install button

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13397 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Wenger 2007-05-16 19:12:22 +00:00
parent 8c2bcf1bff
commit 4544c43794
11 changed files with 1489 additions and 28 deletions

View file

@ -9,7 +9,7 @@
# Unix-style Makefile for rbutil
CXX=$(shell $(PREFIX)wx-config --cxx)
CXX=$(shell $(PREFIX)wx-config --version=2.8 --cxx)
INC =
CFLAGS = -Wall -Wundef -DRBUTIL
OBJS=rbutil.o rbutilApp.o rbutilFrm.o rbutilCtrls.o install_dialogs.o bootloaders.o installlog.o ipodpatcher/ipodpatcher.o ipodpatcher/ipodio-posix.o sansapatcher/sansapatcher.o sansapatcher/sansaio-posix.o irivertools.o md5sum.o
@ -32,16 +32,16 @@ endif
all: rbutil$(EXT)
.cpp.o :
$(CXX) $(CFLAGS) $(INC) -c `$(PREFIX)wx-config --cxxflags` -o $@ $<
$(CXX) $(CFLAGS) $(INC) -c `$(PREFIX)wx-config --version=2.8 --cxxflags` -o $@ $<
.c.o :
$(CC) $(CFLAGS) $(INC) -c `$(PREFIX)wx-config --cxxflags` -o $@ $<
$(CC) $(CFLAGS) $(INC) -c `$(PREFIX)wx-config --version=2.8 --cxxflags` -o $@ $<
rbutil-rc.o: rbutil-rc.rc
$(WINDRES) `$(PREFIX)wx-config --cxxflags` -O coff -F pe-i386 -o $@ $<
$(WINDRES) `$(PREFIX)wx-config --version=2.8 --cxxflags` -O coff -F pe-i386 -o $@ $<
rbutil$(EXT): $(OBJS)
$(CXX) -o $@ $(OBJS) `$(PREFIX)wx-config --libs`
$(CXX) -o $@ $(OBJS) `$(PREFIX)wx-config --version=2.8 --libs`
.PHONY: clean
clean:

View file

@ -22,7 +22,7 @@
#define CREDITS_H_INCLUDED
#define RBUTIL_FULLNAME "The Rockbox Utility"
#define RBUTIL_VERSION "Version 0.3.2.2"
#define RBUTIL_VERSION "Version 0.3.2.3"
static const wxString rbutil_developers[] = {
wxT("Christi Alice Scarborough"),

1374
rbutil/doom_3d.xpm Normal file

File diff suppressed because it is too large Load diff

View file

@ -106,7 +106,8 @@ bool bootloaderInstallDlg::TransferDataFromWindow()
return false;
}
}
return true;
}
@ -652,7 +653,7 @@ bool rockboxInstallDlg::TransferDataToWindow()
wxRadioBox* BuildRadioBox = (wxRadioBox*) FindWindow(ID_BUILD_BOX);
int index =gv->plat_id.Index(gv->curplat);
wxCommandEvent updateradiobox(wxEVT_COMMAND_RADIOBOX_SELECTED,
ID_BUILD_BOX);

View file

@ -1,8 +1,8 @@
#define RBUTIL 1
#include <wx/msw/wx.rc>
RBUTIL VERSIONINFO
FILEVERSION 0,3,2,2
PRODUCTVERSION 0,3,2,2
FILEVERSION 0,3,2,3
PRODUCTVERSION 0,3,2,3
FILEOS 0x00000004
FILETYPE 0x00000001
BEGIN
@ -10,8 +10,8 @@ BEGIN
BEGIN
BLOCK "FFFF0000"
BEGIN
VALUE "FileVersion", "0.3.2.2\0"
VALUE "ProductVersion", "0.3.2.2\0"
VALUE "FileVersion", "0.3.2.3\0"
VALUE "ProductVersion", "0.3.2.3\0"
VALUE "CompanyName", "Rockbox Team\0"
VALUE "FileDescription", "Rockbox Utility\0"
VALUE "InternalName", "rbutil\0"

View file

@ -107,8 +107,10 @@ public:
wxString bootloader_url;
wxString themes_url;
wxString manual_url;
wxString doom_url;
wxString proxy_url;
// User configuration data.
wxString curplat;
// unsigned int curplatnum;

View file

@ -9,6 +9,7 @@ prog_name=rockbox
bootloader_url=http://download.rockbox.org/bootloader
themes_url=http://www.rockbox-themes.org/
manual_url=http://download.rockbox.org/manual/rockbox-
doom_url=http://download.rockbox.org/useful/rockdoom.zip
[platforms]
platform1=player

View file

@ -215,6 +215,9 @@ bool rbutilFrmApp::ReadGlobalConfig(rbutilFrm* myFrame)
gv->GlobalConfig->Read(wxT("manual_url"), &tmpstr);
gv->manual_url = tmpstr;
gv->GlobalConfig->Read(wxT("doom_url"), &tmpstr);
gv->doom_url = tmpstr;
#ifdef __WXMSW__
gv->curdestdir = wxT("D:\\");
#else

View file

@ -402,11 +402,12 @@ void DeviceSelectorCtrl::setDefault()
void DeviceSelectorCtrl::OnComboBox(wxCommandEvent& event)
{
int index = gv->plat_name.Index(m_deviceCbx->GetValue());
if(index == -1)
{
m_currentDevice = wxT("");
return;
}
m_currentDevice = wxT("");
return;
}
gv->curplat = gv->plat_id[index];
}

View file

@ -29,6 +29,7 @@
#include "rblogo.xpm"
#include "untools2_3d.xpm"
#include "themes_3d.xpm"
#include "doom_3d.xpm"
#include "bootloaders.h"
#include "install_dialogs.h"
@ -45,12 +46,15 @@ BEGIN_EVENT_TABLE(rbutilFrm,wxFrame)
EVT_BUTTON (ID_THEMES_BTN, rbutilFrm::OnThemesBtn)
EVT_BUTTON (ID_BOOTLOADER_BTN, rbutilFrm::OnBootloaderBtn)
EVT_BUTTON (ID_BOOTLOADERREMOVE_BTN, rbutilFrm::OnBootloaderRemoveBtn)
EVT_BUTTON (ID_DOOM_BTN, rbutilFrm::OnDoomBtn)
EVT_CLOSE(rbutilFrm::rbutilFrmClose)
EVT_MENU(ID_FILE_EXIT, rbutilFrm::OnFileExit)
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)
@ -99,7 +103,7 @@ void rbutilFrm::CreateGUIControls(void)
wxPanel* uninstallpage = new wxPanel(tabwindow,wxID_ANY);
wxPanel* manualpage = new wxPanel(tabwindow,wxID_ANY);
tabwindow->AddPage(installpage,wxT("Installation"),true);
tabwindow->AddPage(themepage,wxT("Themes"));
tabwindow->AddPage(themepage,wxT("Extras"));
tabwindow->AddPage(uninstallpage,wxT("Uninstallation"));
tabwindow->AddPage(manualpage,wxT("Manual"));
@ -153,7 +157,7 @@ void rbutilFrm::CreateGUIControls(void)
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
/*********************+
Theme Page
Extras Page
***********************/
wxBoxSizer* WxBoxSizer3 = new wxBoxSizer(wxVERTICAL);
@ -200,6 +204,20 @@ void rbutilFrm::CreateGUIControls(void)
WxFlexGridSizer2->Add(WxStaticText6, 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
wxBitmap DoomInstallButton (doom_3d_xpm);
WxBitmapButton6 = new wxBitmapButton(themepage, ID_DOOM_BTN,
DoomInstallButton, wxPoint(0,0), wxSize(64,54),
wxRAISED_BORDER | wxBU_AUTODRAW);
WxBitmapButton6->SetToolTip(wxT("Download freedoom wad files."));
WxFlexGridSizer2->Add(WxBitmapButton6, 0,
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
wxStaticText* WxStaticText7 = new wxStaticText(themepage, wxID_ANY,
wxT("Install the freedoom wad files.\n\n"));
WxFlexGridSizer2->Add(WxStaticText7, 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
/*********************+
Uninstall Page
***********************/
@ -302,13 +320,15 @@ void rbutilFrm::CreateGUIControls(void)
wxLogVerbose(wxT("=== end rbutilFrm::CreateGUIControls"));
}
void rbutilFrm::OnManualUpdate(wxUpdateUIEvent& event)
{
wxString tmp = gv->curplat;
if(tmp == wxT("h120")) tmp = wxT("h100"); //h120 has the h100 manual
if(tmp == wxT("fmrecorder8mb")) tmp = wxT("fmrecorder");
if(tmp == wxT("ipodmini1g")) tmp = wxT("ipodmini2g");
if(tmp == wxT("recorder8mb")) tmp = wxT("recorderg");
if( tmp == curManualDevice)
return;
@ -813,6 +833,64 @@ void rbutilFrm::OnFontBtn(wxCommandEvent& event)
wxLogVerbose(wxT("=== end rbutilFrm::OnFontBtn"));
}
void rbutilFrm::OnDoomBtn(wxCommandEvent& event)
{
wxString src, dest, buf;
wxLogVerbose(wxT("=== begin rbutilFrm::OnDoomBtn(event)"));
// font install dialog, reused
fontInstallDlg dialog(NULL, wxID_ANY,
wxT("Freedoom wad file Installation"));
if (dialog.ShowModal() != wxID_OK)
return;
// really install ?
wxMessageDialog msg(this,wxT("Do you really want to install the Freedoom wads ?"),wxT("Freedoom installation"),wxOK|wxCANCEL);
if(msg.ShowModal() != wxID_OK )
return;
buf.Printf(wxT("%s" PATH_SEP ".rockbox"), gv->curdestdir.c_str()) ;
if (! wxDirExists(buf) )
{
buf.Printf(wxT("Rockbox is not yet installed on %s - install "
"Rockbox first."), buf.c_str() );
WARN_DIALOG(buf, wxT("Can't install freedoom wads") );
return;
}
src = gv->doom_url;
dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP
"rockdoom.zip"), gv->stdpaths->GetUserDataDir().c_str());
if ( ! wxFileExists(dest) )
{
if ( DownloadURL(src, dest) )
{
wxRemoveFile(dest);
buf.Printf(wxT("Unable to download %s"), src.c_str() );
ERR_DIALOG(buf, wxT("Freedoom Install"));
return;
}
}
if ( !UnzipFile(dest, gv->curdestdir, true) )
{
wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Freedoom wads have been installed on your device.")
,wxT("Installation"), wxOK |wxICON_INFORMATION);
msg->ShowModal();
delete msg;
} else
{
wxRemoveFile(dest);
buf.Printf(wxT("Unable to unzip %s"), dest.c_str() );
ERR_DIALOG(buf, wxT("Freedoom Install"));
}
wxLogVerbose(wxT("=== end rbutilFrm::OnDoomBtn"));
}
void rbutilFrm::OnThemesBtn(wxCommandEvent& event)
{

View file

@ -91,15 +91,16 @@ public:
ID_WXSTATICTEXT2 = 1029,
ID_INSTALL_BTN = 1028,
ID_WXSTATICBITMAP1 = 1053,
ID_FONT_BTN = 1128,
ID_THEMES_BTN = 1139,
ID_BOOTLOADER_BTN = 1129,
ID_FONT_BTN = 1128,
ID_THEMES_BTN = 1139,
ID_DOOM_BTN = 1140,
ID_BOOTLOADER_BTN = 1129,
ID_WXPANEL1 = 1064,
ID_MANUAL = 1065,
ID_FILE_PROXY = 1066,
ID_MANUAL = 1065,
ID_FILE_PROXY = 1066,
ID_DUMMY_VALUE_
ID_DUMMY_VALUE_
}; //End of Enum
public:
void rbutilFrmClose(wxCloseEvent& event);
@ -115,9 +116,9 @@ public:
void OnBootloaderBtn(wxCommandEvent& event);
void OnPortableInstall(wxCommandEvent& event);
void OnBootloaderRemoveBtn(wxCommandEvent& event);
void OnManualUpdate(wxUpdateUIEvent& event);
void OnFileProxy(wxCommandEvent& event);
void OnManualUpdate(wxUpdateUIEvent& event);
void OnFileProxy(wxCommandEvent& event);
void OnDoomBtn(wxCommandEvent& event);
};