1
0
Fork 0
forked from len0rd/rockbox

rbutil now ask before doing anything, plus minor gui changes

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13328 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Wenger 2007-05-05 16:55:04 +00:00
parent a967523b2b
commit e9f08dc193
6 changed files with 393 additions and 462 deletions

View file

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

View file

@ -106,7 +106,8 @@ bool bootloaderInstallDlg::TransferDataFromWindow()
return false;
}
}
return true;
}
// tranver data to the controls
@ -147,90 +148,6 @@ bool bootloaderInstallDlg::TransferDataToWindow()
return true;
}
////////////////////////////////////////////////
//// Bootloader Deinstallation
/////////////////////////////////////////////////
IMPLEMENT_CLASS( bootloaderDeInstallDlg, wxDialog )
BEGIN_EVENT_TABLE( bootloaderDeInstallDlg, wxDialog )
END_EVENT_TABLE()
bootloaderDeInstallDlg::bootloaderDeInstallDlg( )
{
Init();
}
bootloaderDeInstallDlg::bootloaderDeInstallDlg( wxWindow* parent,
wxWindowID id, const wxString& caption,
const wxPoint& pos, const wxSize& size, long style )
{
Init();
Create(parent, id, caption, pos, size, style);
}
void bootloaderDeInstallDlg::CreateControls()
{
// A top-level sizer
wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
this->SetSizer(topSizer);
wxBoxSizer* wxBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
topSizer->Add(wxBoxSizer2, 0, wxALIGN_LEFT|wxALL, 5);
// bitmap
wxBitmap sidebmp(wizard_xpm);
ImageCtrl* sideimage = new ImageCtrl(this,wxID_ANY);
sideimage->SetBitmap(sidebmp);
wxBoxSizer2->Add(sideimage,0,wxALIGN_LEFT | wxALL,5);
wxBoxSizer* wxBoxSizer3 = new wxBoxSizer(wxVERTICAL);
wxBoxSizer2->Add(wxBoxSizer3, 0, wxALIGN_LEFT|wxALL, 5);
// controls at the bottom
OkCancelCtrl* okCancel = new OkCancelCtrl(this,wxID_ANY);
topSizer->Add(okCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
}
//init the local variables
void bootloaderDeInstallDlg::Init()
{
}
// create the window
bool bootloaderDeInstallDlg::Create( wxWindow* parent,
wxWindowID id, const wxString& caption,
const wxPoint& pos, const wxSize& size, long style )
{
if (!wxDialog::Create( parent, id, caption, pos, size, style ))
return false;
CreateControls();
GetSizer()->Fit(this);
GetSizer()->SetSizeHints(this);
Centre();
return true;
}
// tranver data from the controls
bool bootloaderDeInstallDlg::TransferDataFromWindow()
{
return true;
}
// tranver data to the controls
bool bootloaderDeInstallDlg::TransferDataToWindow()
{
if(gv->curplat == wxT(""))
{
WARN_DIALOG(wxT("You have not selected a audio device"),
wxT("Select a Device"));
return false;
}
return true;
}
////////////////////////////////////////////////
//// Font Installation

View file

@ -44,42 +44,6 @@ private:
};
class bootloaderDeInstallDlg : public wxDialog
{
DECLARE_CLASS( bootloaderDeInstallDlg )
DECLARE_EVENT_TABLE()
public:
enum {
ID_DEVICE = 1001,
}; //End of Enum
public:
bootloaderDeInstallDlg( );
bootloaderDeInstallDlg( wxWindow* parent,
wxWindowID id = wxID_ANY,
const wxString& caption = wxT("Bootloader Deinstallation"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE |wxRESIZE_BORDER );
/// Member initialization
void Init();
/// Creation
bool Create( wxWindow* parent,
wxWindowID id = wxID_ANY,
const wxString& caption = wxT("Bootloader Deinstallation"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style =wxDEFAULT_DIALOG_STYLE |wxRESIZE_BORDER );
/// Creates the controls and sizers
void CreateControls();
bool TransferDataFromWindow();
bool TransferDataToWindow();
private:
DeviceSelectorCtrl* m_deviceselector;
};
class fontInstallDlg : public wxDialog
{

View file

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

View file

@ -139,12 +139,12 @@
<Unit filename="sansapatcher\parttypes.h" />
<Unit filename="sansapatcher\sansaio-win32.c">
<Option compilerVar="CC" />
<Option compiler="gcc" use="1" buildCommand="mingw32-gcc.exe -W -g -pipe -mthreads -Winvalid-pch -D__GNUWIN32__ -D__WXMSW__ -DUSE_PCH -g -I.\ -IC:\Dev-Cpp\include -c $file -o .objs\sansapatcher\sansaio-win32.o" />
<Option compiler="gcc" use="1" buildCommand="mingw32-gcc.exe -W -g -pipe -mthreads -Winvalid-pch -D__GNUWIN32__ -D__WXMSW__ -DUSE_PCH -DRBUTIL -g -I.\ -IC:\Dev-Cpp\include -c $file -o .objs\sansapatcher\sansaio-win32.o" />
</Unit>
<Unit filename="sansapatcher\sansaio.h" />
<Unit filename="sansapatcher\sansapatcher.c">
<Option compilerVar="CC" />
<Option compiler="gcc" use="1" buildCommand="mingw32-gcc.exe -W -g -pipe -mthreads -Winvalid-pch -D__GNUWIN32__ -D__WXMSW__ -DUSE_PCH -g -I.\ -IC:\Dev-Cpp\include -c $file -o .objs\sansapatcher\sansapatcher.o" />
<Option compiler="gcc" use="1" buildCommand="mingw32-gcc.exe -W -g -pipe -mthreads -Winvalid-pch -D__GNUWIN32__ -D__WXMSW__ -DUSE_PCH -g -DRBUTIL -I.\ -IC:\Dev-Cpp\include -c $file -o .objs\sansapatcher\sansapatcher.o" />
</Unit>
<Unit filename="sansapatcher\sansapatcher.h" />
<Unit filename="themes_3d.xpm" />

View file

@ -109,7 +109,7 @@ void rbutilFrm::CreateGUIControls(void)
wxID_ANY, wxT("Please choose an option"));
wxStaticBoxSizer* WxStaticBoxSizer3 =
new wxStaticBoxSizer(WxStaticBoxSizer3_StaticBoxObj,wxHORIZONTAL);
WxBoxSizer2->Add(WxStaticBoxSizer3,1,wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
WxBoxSizer2->Add(WxStaticBoxSizer3,1,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
wxFlexGridSizer* WxFlexGridSizer1 = new wxFlexGridSizer(2,2,0,0);
WxStaticBoxSizer3->Add(WxFlexGridSizer1,0,wxGROW | wxALL,0);
@ -158,7 +158,7 @@ void rbutilFrm::CreateGUIControls(void)
wxID_ANY, wxT("Please choose an option"));
wxStaticBoxSizer* WxStaticBoxSizer4 =
new wxStaticBoxSizer(WxStaticBoxSizer4_StaticBoxObj,wxHORIZONTAL);
WxBoxSizer3->Add(WxStaticBoxSizer4,1,wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
WxBoxSizer3->Add(WxStaticBoxSizer4,1,wxALIGN_CENTER_HORIZONTAL |wxGROW| wxALL, 5);
wxFlexGridSizer* WxFlexGridSizer2 = new wxFlexGridSizer(2,2,0,0);
WxStaticBoxSizer4->Add(WxFlexGridSizer2,0,wxGROW | wxALL,0);
@ -206,7 +206,7 @@ void rbutilFrm::CreateGUIControls(void)
wxID_ANY, wxT("Please choose an option"));
wxStaticBoxSizer* WxStaticBoxSizer5 =
new wxStaticBoxSizer(WxStaticBoxSizer5_StaticBoxObj,wxHORIZONTAL);
WxBoxSizer4->Add(WxStaticBoxSizer5,1,wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
WxBoxSizer4->Add(WxStaticBoxSizer5,1,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
wxFlexGridSizer* WxFlexGridSizer3 = new wxFlexGridSizer(2,2,0,0);
WxStaticBoxSizer5->Add(WxFlexGridSizer3,0,wxGROW | wxALL,0);
@ -353,14 +353,22 @@ void rbutilFrm::OnBootloaderRemoveBtn(wxCommandEvent& event)
{
wxLogVerbose(wxT("=== begin rbutilFrm::OnBootloaderRemoveBtn(event)"));
bootloaderDeInstallDlg dialog(NULL, wxID_ANY,
wxT("Bootloader Deinstallation"));
if (dialog.ShowModal() == wxID_OK)
{
int index = gv->plat_id.Index(gv->curplat);
wxString bootloadermethod = gv->plat_bootloadermethod[index];
if(!gv->plat_needsbootloader[index])
{
WARN_DIALOG(wxT("This Device doesnt need a Bootloader"),
wxT("Bootloader"));
return;
}
// really deinstall ?
wxMessageDialog msg(this,wxT("Do you really want to deinstall the Bootloader ?"),wxT("Bootloader deinstallation"),wxOK|wxCANCEL);
if(msg.ShowModal() != wxID_OK )
return;
if(bootloadermethod == wxT("ipodpatcher"))
{
wxString bootloadername = wxT("bootloader-");
@ -419,8 +427,6 @@ void rbutilFrm::OnBootloaderRemoveBtn(wxCommandEvent& event)
{
MESG_DIALOG(wxT("Unsupported Bootloader Uninstall method.") );
}
}
wxLogVerbose(wxT("=== end rbutilFrm::OnBootloaderRemoveBtn"));
}
@ -429,14 +435,30 @@ void rbutilFrm::OnBootloaderBtn(wxCommandEvent& event)
{
wxLogVerbose(wxT("=== begin rbutilFrm::OnBootloaderBtn(event)"));
bootloaderInstallDlg dialog(NULL, wxID_ANY,
wxT("Bootloader Installation"));
if (dialog.ShowModal() == wxID_OK)
{
int index = gv->plat_id.Index(gv->curplat);
wxString bootloadermethod = gv->plat_bootloadermethod[index];
if(!gv->plat_needsbootloader[index])
{
WARN_DIALOG(wxT("This Device doesnt need a Bootloader"),
wxT("Bootloader"));
return;
}
// Bootloader dialog
if(bootloadermethod != wxT("ipodpatcher") && bootloadermethod != wxT("sansapatcher") )
{
bootloaderInstallDlg dialog(NULL, wxID_ANY,wxT("Bootloader Installation"));
if (dialog.ShowModal() != wxID_OK)
return;
}
// really install ?
wxMessageDialog msg(this,wxT("Do you really want to install the Bootloader ?"),wxT("Bootloader installation"),wxOK|wxCANCEL);
if(msg.ShowModal() != wxID_OK )
return;
if(bootloadermethod == wxT("ipodpatcher"))
{
wxString bootloadername = wxT("bootloader-");
@ -506,7 +528,7 @@ void rbutilFrm::OnBootloaderBtn(wxCommandEvent& event)
{
MESG_DIALOG(wxT("Unsupported Bootloader Install method.") );
}
}
wxLogVerbose(wxT("=== end rbutilFrm::OnBootloaderBtn"));
@ -523,11 +545,18 @@ void rbutilFrm::OnInstallBtn(wxCommandEvent& event)
wxFileConfig* buildinfo;
wxDateSpan oneday;
// rockbox install dialog
rockboxInstallDlg dialog(NULL, wxID_ANY,
wxT("Rockbox Installation"));
if (dialog.ShowModal() != wxID_OK)
return;
// really install
wxMessageDialog msg(this,wxT("Do you really want to install Rockbox ?"),wxT("rockbox installation"),wxOK|wxCANCEL);
if(msg.ShowModal() != wxID_OK )
return;
if (dialog.ShowModal() == wxID_OK)
{
switch (gv->curbuild)
{
case BUILD_RELEASE:
@ -617,7 +646,7 @@ void rbutilFrm::OnInstallBtn(wxCommandEvent& event)
buf.Printf(wxT("Unable to unzip %s"), dest.c_str() );
ERR_DIALOG(buf, wxT("Install"));
}
}
wxLogVerbose(wxT("=== end rbutilFrm::OnInstallBtn"));
}
@ -632,11 +661,17 @@ void rbutilFrm::OnFontBtn(wxCommandEvent& event)
wxFileConfig* buildinfo;
wxDateSpan oneday;
// font install dialog
fontInstallDlg dialog(NULL, wxID_ANY,
wxT("Font Installation"));
if (dialog.ShowModal() != wxID_OK)
return;
// really install ?
wxMessageDialog msg(this,wxT("Do you really want to install the Fonts ?"),wxT("Font installation"),wxOK|wxCANCEL);
if(msg.ShowModal() != wxID_OK )
return;
if (dialog.ShowModal() == wxID_OK)
{
buf.Printf(wxT("%s" PATH_SEP ".rockbox"), gv->curdestdir.c_str()) ;
if (! wxDirExists(buf) )
@ -706,7 +741,7 @@ void rbutilFrm::OnFontBtn(wxCommandEvent& event)
buf.Printf(wxT("Unable to unzip %s"), dest.c_str() );
ERR_DIALOG(buf, wxT("Font Install"));
}
}
wxLogVerbose(wxT("=== end rbutilFrm::OnFontBtn"));
}
@ -716,12 +751,17 @@ void rbutilFrm::OnThemesBtn(wxCommandEvent& event)
wxString src, dest, buf;
wxLogVerbose(wxT("=== begin rbutilFrm::OnThemesBtn(event)"));
// Theme install dialog
themesInstallDlg dialog(NULL, wxID_ANY,
wxT("Theme Installation"));
if (dialog.ShowModal() != wxID_OK)
return;
// really install ?
wxMessageDialog msg(this,wxT("Do you really want to install the selected Themes ?"),wxT("Theme installation"),wxOK|wxCANCEL);
if(msg.ShowModal() != wxID_OK )
return;
if (dialog.ShowModal() == wxID_OK)
{
bool success=true;
for(unsigned int i=0 ;i < gv->themesToInstall.GetCount();i++)
{
@ -736,7 +776,6 @@ void rbutilFrm::OnThemesBtn(wxCommandEvent& event)
{
MESG_DIALOG(wxT("The Theme installation completed successfully.") );
}
}
wxLogVerbose(wxT("=== end rbutilFrm::OnThemesBtn(event)"));
@ -747,11 +786,18 @@ void rbutilFrm::OnRemoveBtn(wxCommandEvent& event)
{
wxLogVerbose(wxT("=== begin rbutilFrm::OnRemoveBtn(event)"));
// Rockbox deinstall dialog
rockboxDeInstallDlg dialog(NULL, wxID_ANY,
wxT("Rockbox Deinstallation"));
if (dialog.ShowModal() != wxID_OK)
return;
// really install ?
wxMessageDialog msg(this,wxT("Do you really want to deinstall Rockbox ?"),wxT("Rockbox deinstallation"),wxOK|wxCANCEL);
if(msg.ShowModal() != wxID_OK )
return;
if (dialog.ShowModal() == wxID_OK)
{
if (Uninstall(gv->curdestdir, gv->curisfull) )
{
MESG_DIALOG(
@ -764,7 +810,6 @@ void rbutilFrm::OnRemoveBtn(wxCommandEvent& event)
msg->ShowModal();
delete msg;
}
}
wxLogVerbose(wxT("=== end rbutilFrm::OnRemoveBtn"));
}
@ -776,11 +821,17 @@ void rbutilFrm::OnPortableInstall(wxCommandEvent& event)
wxFileSystem fs;
wxDateSpan oneday;
//portable install dialog ( reused font dialog)
fontInstallDlg dialog(NULL, wxID_ANY,
wxT("Rockbox Utility Portable Installation"));
if (dialog.ShowModal() != wxID_OK)
return;
// really install ?
wxMessageDialog msg(this,wxT("Do you really want a portable install of rbutil ?"),wxT("rbutil installation"),wxOK|wxCANCEL);
if(msg.ShowModal() != wxID_OK )
return;
if (dialog.ShowModal() == wxID_OK)
{
if ( InstallRbutil(gv->curdestdir) )
{
MESG_DIALOG(wxT("The Rockbox Utility has been installed on your device."));
@ -789,7 +840,6 @@ void rbutilFrm::OnPortableInstall(wxCommandEvent& event)
{
ERR_DIALOG(wxT("Installation failed"), wxT("Portable Install"));
}
}
wxLogVerbose(wxT("=== end rbutilFrm::OnUnstallPortable"));
}