2006-12-13 21:11:24 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* Module: rbutil
|
|
|
|
* File: rbutilFrm.cpp
|
|
|
|
*
|
|
|
|
* Copyright (C) 2005 Christi Alice Scarborough
|
|
|
|
*
|
|
|
|
* All files in this archive are subject to the GNU General Public License.
|
|
|
|
* See the file COPYING in the source tree root for full license agreement.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
2006-12-11 21:25:37 +00:00
|
|
|
|
|
|
|
#include "rbutilFrm.h"
|
|
|
|
#include "credits.h"
|
|
|
|
|
|
|
|
#include "rbutilFrm_XPM.xpm"
|
2007-06-22 23:46:47 +00:00
|
|
|
#include "icons/rbinstall_btn.h"
|
|
|
|
#include "icons/remrb_btn.h"
|
|
|
|
#include "icons/font_btn.h"
|
|
|
|
#include "icons/bootloader_btn.h"
|
|
|
|
#include "icons/rembootloader_btn.h"
|
|
|
|
#include "icons/themes_btn.h"
|
|
|
|
#include "icons/doom_btn.h"
|
2007-07-15 22:15:28 +00:00
|
|
|
#include "icons/talkfile_btn.h"
|
2007-06-22 23:46:47 +00:00
|
|
|
|
2006-12-11 21:25:37 +00:00
|
|
|
#include "rblogo.xpm"
|
|
|
|
|
2007-02-21 20:27:14 +00:00
|
|
|
#include "bootloaders.h"
|
2007-05-03 17:10:28 +00:00
|
|
|
#include "install_dialogs.h"
|
2007-02-21 20:27:14 +00:00
|
|
|
|
2006-12-11 21:25:37 +00:00
|
|
|
|
2007-06-22 23:46:47 +00:00
|
|
|
|
2006-12-11 21:25:37 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// rbutilFrm
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
BEGIN_EVENT_TABLE(rbutilFrm,wxFrame)
|
|
|
|
EVT_BUTTON (ID_INSTALL_BTN, rbutilFrm::OnInstallBtn)
|
|
|
|
EVT_BUTTON (ID_REMOVE_BTN, rbutilFrm::OnRemoveBtn)
|
|
|
|
EVT_BUTTON (ID_FONT_BTN, rbutilFrm::OnFontBtn)
|
2007-03-15 14:02:37 +00:00
|
|
|
EVT_BUTTON (ID_THEMES_BTN, rbutilFrm::OnThemesBtn)
|
2006-12-11 21:25:37 +00:00
|
|
|
EVT_BUTTON (ID_BOOTLOADER_BTN, rbutilFrm::OnBootloaderBtn)
|
2007-02-21 20:27:14 +00:00
|
|
|
EVT_BUTTON (ID_BOOTLOADERREMOVE_BTN, rbutilFrm::OnBootloaderRemoveBtn)
|
2007-05-16 19:12:22 +00:00
|
|
|
EVT_BUTTON (ID_DOOM_BTN, rbutilFrm::OnDoomBtn)
|
2007-07-15 18:15:59 +00:00
|
|
|
EVT_BUTTON (ID_TALK_BTN, rbutilFrm::OnTalkBtn)
|
2006-12-11 21:25:37 +00:00
|
|
|
|
|
|
|
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)
|
2006-12-13 21:11:24 +00:00
|
|
|
EVT_MENU(ID_PORTABLE_INSTALL, rbutilFrm::OnPortableInstall)
|
2007-05-16 19:12:22 +00:00
|
|
|
|
2007-05-05 20:23:28 +00:00
|
|
|
EVT_MENU(ID_FILE_PROXY, rbutilFrm::OnFileProxy)
|
2007-05-05 18:28:18 +00:00
|
|
|
|
|
|
|
EVT_UPDATE_UI (ID_MANUAL, rbutilFrm::OnManualUpdate)
|
|
|
|
|
2006-12-11 21:25:37 +00:00
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
|
|
|
rbutilFrm::rbutilFrm( wxWindow *parent, wxWindowID id, const wxString &title,
|
|
|
|
const wxPoint &position, const wxSize& size, long style )
|
|
|
|
: wxFrame( parent, id, title, position, size, style)
|
|
|
|
{
|
|
|
|
wxLogVerbose(wxT("=== begin rbutilFrm::rbutilFrm(...)"));
|
|
|
|
CreateGUIControls();
|
|
|
|
wxLogVerbose(wxT("=== end rbutilFrm::rbutilFrm"));
|
|
|
|
}
|
|
|
|
|
|
|
|
rbutilFrm::~rbutilFrm() {}
|
|
|
|
|
|
|
|
void rbutilFrm::CreateGUIControls(void)
|
|
|
|
{
|
2007-06-24 20:16:40 +00:00
|
|
|
wxLogVerbose(wxT("=== begin rbutilFrm::CreateGUIControls()"));
|
2006-12-11 21:25:37 +00:00
|
|
|
|
2007-06-24 20:16:40 +00:00
|
|
|
wxBoxSizer* WxBoxSizer1 = new wxBoxSizer(wxVERTICAL);
|
2006-12-11 21:25:37 +00:00
|
|
|
this->SetSizer(WxBoxSizer1);
|
|
|
|
this->SetAutoLayout(TRUE);
|
2007-05-03 20:07:57 +00:00
|
|
|
|
2007-05-03 17:10:28 +00:00
|
|
|
wxPanel* mainPanel = new wxPanel(this,wxID_ANY);
|
2007-05-27 22:44:22 +00:00
|
|
|
WxBoxSizer1->Add(mainPanel,1,wxGROW|wxALL,0);
|
2007-05-03 17:10:28 +00:00
|
|
|
wxBoxSizer* WxBoxSizer0 = new wxBoxSizer(wxVERTICAL);
|
|
|
|
mainPanel->SetSizer(WxBoxSizer0);
|
|
|
|
mainPanel->SetAutoLayout(TRUE);
|
|
|
|
|
2007-05-05 18:28:18 +00:00
|
|
|
wxBitmap rockboxbmp(rblogo_xpm);
|
|
|
|
ImageCtrl* rockboxbmpCtrl = new ImageCtrl(mainPanel,wxID_ANY);
|
|
|
|
rockboxbmpCtrl->SetBitmap(rockboxbmp);
|
2007-06-09 20:34:00 +00:00
|
|
|
|
2007-05-05 18:28:18 +00:00
|
|
|
WxBoxSizer0->Add(rockboxbmpCtrl,0,wxALIGN_CENTER_HORIZONTAL | wxALL,5);
|
2007-05-03 17:10:28 +00:00
|
|
|
|
|
|
|
myDeviceSelector = new DeviceSelectorCtrl(mainPanel,wxID_ANY);
|
|
|
|
myDeviceSelector->setDefault();
|
2007-06-24 20:16:40 +00:00
|
|
|
myDeviceSelector->AutoDetect();
|
2007-05-27 22:44:22 +00:00
|
|
|
WxBoxSizer0->Add(myDeviceSelector,0,wxGROW|wxALL,5);
|
2007-05-03 17:10:28 +00:00
|
|
|
|
2007-06-24 20:16:40 +00:00
|
|
|
|
2007-05-05 18:28:18 +00:00
|
|
|
wxNotebook* tabwindow = new wxNotebook(mainPanel,wxID_ANY);
|
2007-05-27 22:44:22 +00:00
|
|
|
WxBoxSizer0->Add(tabwindow,1,wxGROW|wxALL,5);
|
2007-05-03 20:07:57 +00:00
|
|
|
|
2007-05-05 18:28:18 +00:00
|
|
|
wxPanel* installpage = new wxPanel(tabwindow,wxID_ANY);
|
|
|
|
wxPanel* themepage = new wxPanel(tabwindow,wxID_ANY);
|
|
|
|
wxPanel* uninstallpage = new wxPanel(tabwindow,wxID_ANY);
|
|
|
|
wxPanel* manualpage = new wxPanel(tabwindow,wxID_ANY);
|
|
|
|
tabwindow->AddPage(installpage,wxT("Installation"),true);
|
2007-05-16 19:12:22 +00:00
|
|
|
tabwindow->AddPage(themepage,wxT("Extras"));
|
2007-05-05 18:28:18 +00:00
|
|
|
tabwindow->AddPage(uninstallpage,wxT("Uninstallation"));
|
|
|
|
tabwindow->AddPage(manualpage,wxT("Manual"));
|
2007-05-03 20:07:57 +00:00
|
|
|
|
2007-05-03 17:10:28 +00:00
|
|
|
/*********************
|
|
|
|
Install Page
|
2007-05-03 20:07:57 +00:00
|
|
|
***********************/
|
|
|
|
|
2006-12-11 21:25:37 +00:00
|
|
|
wxBoxSizer* WxBoxSizer2 = new wxBoxSizer(wxVERTICAL);
|
2007-05-03 17:10:28 +00:00
|
|
|
installpage->SetSizer(WxBoxSizer2);
|
|
|
|
installpage->SetAutoLayout(TRUE);
|
2007-05-03 20:07:57 +00:00
|
|
|
|
2007-05-03 17:10:28 +00:00
|
|
|
wxStaticBox* WxStaticBoxSizer3_StaticBoxObj = new wxStaticBox(installpage,
|
2007-03-15 14:02:37 +00:00
|
|
|
wxID_ANY, wxT("Please choose an option"));
|
2006-12-11 21:25:37 +00:00
|
|
|
wxStaticBoxSizer* WxStaticBoxSizer3 =
|
|
|
|
new wxStaticBoxSizer(WxStaticBoxSizer3_StaticBoxObj,wxHORIZONTAL);
|
2007-05-05 16:55:04 +00:00
|
|
|
WxBoxSizer2->Add(WxStaticBoxSizer3,1,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
|
2006-12-11 21:25:37 +00:00
|
|
|
|
|
|
|
wxFlexGridSizer* WxFlexGridSizer1 = new wxFlexGridSizer(2,2,0,0);
|
|
|
|
WxStaticBoxSizer3->Add(WxFlexGridSizer1,0,wxGROW | wxALL,0);
|
|
|
|
|
2007-06-22 23:46:47 +00:00
|
|
|
|
|
|
|
wxBitmap BootloaderInstallButton (wxGetBitmapFromMemory(bootloader_btn_png,bootloader_btn_png_length));
|
2007-05-05 18:28:18 +00:00
|
|
|
WxBitmapButton4 = new wxBitmapButton(installpage, ID_BOOTLOADER_BTN,
|
2006-12-13 21:11:24 +00:00
|
|
|
BootloaderInstallButton, wxPoint(0,0), wxSize(64,54),
|
2007-06-17 20:15:18 +00:00
|
|
|
wxRAISED_BORDER | wxBU_AUTODRAW, wxDefaultValidator,wxT("Bootloader Installation"));
|
2007-06-09 20:34:00 +00:00
|
|
|
WxBitmapButton4->SetToolTip(wxT("Click here to install the Rockbox bootloader"));
|
2007-05-05 18:28:18 +00:00
|
|
|
WxFlexGridSizer1->Add(WxBitmapButton4, 0,
|
2006-12-11 21:25:37 +00:00
|
|
|
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
|
|
|
|
|
2007-05-05 18:28:18 +00:00
|
|
|
wxStaticText* WxStaticText5 = new wxStaticText(installpage, wxID_ANY,
|
2007-07-14 20:41:02 +00:00
|
|
|
wxT("Bootloader installation\n\n"
|
2006-12-11 21:25:37 +00:00
|
|
|
"Before Rockbox can be installed on your audio player, you "
|
2007-05-28 20:55:50 +00:00
|
|
|
"may have to\ninstall a bootloader.\nThis is only necessary the first time "
|
2006-12-11 21:25:37 +00:00
|
|
|
"Rockbox is installed."));
|
|
|
|
WxFlexGridSizer1->Add(WxStaticText5, 0,
|
|
|
|
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
|
|
|
|
|
2007-06-22 23:46:47 +00:00
|
|
|
wxBitmap WxBitmapButton1_BITMAP (wxGetBitmapFromMemory(rbinstall_btn_png,rbinstall_btn_png_length));
|
2007-05-03 17:10:28 +00:00
|
|
|
WxBitmapButton1 = new wxBitmapButton(installpage, ID_INSTALL_BTN,
|
2006-12-13 21:11:24 +00:00
|
|
|
WxBitmapButton1_BITMAP, wxPoint(0,0), wxSize(64,54),
|
2006-12-11 21:25:37 +00:00
|
|
|
wxRAISED_BORDER | wxBU_AUTODRAW, wxDefaultValidator,
|
2007-06-17 20:15:18 +00:00
|
|
|
wxT("Rockbox Installation"));
|
2007-06-09 20:34:00 +00:00
|
|
|
WxBitmapButton1->SetToolTip(wxT("Click here to install Rockbox"));
|
2006-12-11 21:25:37 +00:00
|
|
|
WxFlexGridSizer1->Add(WxBitmapButton1,0,
|
|
|
|
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
|
|
|
|
|
2007-05-03 17:10:28 +00:00
|
|
|
WxStaticText2 = new wxStaticText(installpage, ID_WXSTATICTEXT2,
|
2007-03-15 14:02:37 +00:00
|
|
|
wxT("Install Rockbox on your audio player"));
|
2006-12-11 21:25:37 +00:00
|
|
|
WxFlexGridSizer1->Add(WxStaticText2,0,
|
|
|
|
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
|
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
/*********************+
|
2007-05-16 19:12:22 +00:00
|
|
|
Extras Page
|
2007-05-03 17:10:28 +00:00
|
|
|
***********************/
|
|
|
|
|
|
|
|
wxBoxSizer* WxBoxSizer3 = new wxBoxSizer(wxVERTICAL);
|
|
|
|
themepage->SetSizer(WxBoxSizer3);
|
|
|
|
themepage->SetAutoLayout(TRUE);
|
2007-05-03 20:07:57 +00:00
|
|
|
|
2007-05-03 17:10:28 +00:00
|
|
|
wxStaticBox* WxStaticBoxSizer4_StaticBoxObj = new wxStaticBox(themepage,
|
|
|
|
wxID_ANY, wxT("Please choose an option"));
|
|
|
|
wxStaticBoxSizer* WxStaticBoxSizer4 =
|
|
|
|
new wxStaticBoxSizer(WxStaticBoxSizer4_StaticBoxObj,wxHORIZONTAL);
|
2007-05-05 16:55:04 +00:00
|
|
|
WxBoxSizer3->Add(WxStaticBoxSizer4,1,wxALIGN_CENTER_HORIZONTAL |wxGROW| wxALL, 5);
|
2007-05-03 20:07:57 +00:00
|
|
|
|
2007-05-03 17:10:28 +00:00
|
|
|
wxFlexGridSizer* WxFlexGridSizer2 = new wxFlexGridSizer(2,2,0,0);
|
|
|
|
WxStaticBoxSizer4->Add(WxFlexGridSizer2,0,wxGROW | wxALL,0);
|
|
|
|
|
2007-06-22 23:46:47 +00:00
|
|
|
wxBitmap FontInstallButton (wxGetBitmapFromMemory(font_btn_png,font_btn_png_length));
|
2007-05-03 17:10:28 +00:00
|
|
|
WxBitmapButton3 = new wxBitmapButton(themepage, ID_FONT_BTN,
|
2006-12-13 21:11:24 +00:00
|
|
|
FontInstallButton, wxPoint(0,0), wxSize(64,54),
|
2007-06-17 20:15:18 +00:00
|
|
|
wxRAISED_BORDER | wxBU_AUTODRAW,wxDefaultValidator, wxT("Font installation"));
|
2007-06-09 20:34:00 +00:00
|
|
|
WxBitmapButton3->SetToolTip(wxT("Click here to install the most up to date "
|
2006-12-11 21:25:37 +00:00
|
|
|
"Rockbox fonts."));
|
2007-05-03 17:10:28 +00:00
|
|
|
WxFlexGridSizer2->Add(WxBitmapButton3, 0,
|
2006-12-11 21:25:37 +00:00
|
|
|
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
|
|
|
|
|
2007-05-03 17:10:28 +00:00
|
|
|
wxStaticText* WxStaticText4 = new wxStaticText(themepage, wxID_ANY,
|
2007-03-15 14:02:37 +00:00
|
|
|
wxT("Install the Rockbox fonts package\n\n"
|
2007-05-28 20:55:50 +00:00
|
|
|
"This step is needed for many Themes. You "
|
2006-12-11 21:25:37 +00:00
|
|
|
"will not need to download these\nagain unless you uninstall "
|
|
|
|
"Rockbox."));
|
2007-05-03 17:10:28 +00:00
|
|
|
WxFlexGridSizer2->Add(WxStaticText4, 0,
|
2006-12-11 21:25:37 +00:00
|
|
|
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
|
|
|
|
|
2007-06-22 23:46:47 +00:00
|
|
|
wxBitmap ThemesInstallButton (wxGetBitmapFromMemory(themes_btn_png,themes_btn_png_length));
|
2007-05-03 17:10:28 +00:00
|
|
|
WxBitmapButton5 = new wxBitmapButton(themepage, ID_THEMES_BTN,
|
2007-03-15 14:02:37 +00:00
|
|
|
ThemesInstallButton, wxPoint(0,0), wxSize(64,54),
|
2007-06-17 20:15:18 +00:00
|
|
|
wxRAISED_BORDER | wxBU_AUTODRAW,wxDefaultValidator, wxT("Theme installation"));
|
2007-06-09 20:34:00 +00:00
|
|
|
WxBitmapButton5->SetToolTip(wxT("Click here to install themes for Rockbox."));
|
2007-05-03 17:10:28 +00:00
|
|
|
WxFlexGridSizer2->Add(WxBitmapButton5, 0,
|
2007-03-15 14:02:37 +00:00
|
|
|
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
|
|
|
|
|
2007-05-03 17:10:28 +00:00
|
|
|
wxStaticText* WxStaticText6 = new wxStaticText(themepage, wxID_ANY,
|
2007-03-15 14:02:37 +00:00
|
|
|
wxT("Install more Themes for Rockbox.\n\n"));
|
2007-05-03 17:10:28 +00:00
|
|
|
WxFlexGridSizer2->Add(WxStaticText6, 0,
|
2007-03-15 14:02:37 +00:00
|
|
|
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
|
2007-05-03 20:07:57 +00:00
|
|
|
|
2007-06-22 23:46:47 +00:00
|
|
|
wxBitmap DoomInstallButton (wxGetBitmapFromMemory(doom_btn_png,doom_btn_png_length));
|
2007-05-16 19:12:22 +00:00
|
|
|
WxBitmapButton6 = new wxBitmapButton(themepage, ID_DOOM_BTN,
|
|
|
|
DoomInstallButton, wxPoint(0,0), wxSize(64,54),
|
2007-06-17 20:15:18 +00:00
|
|
|
wxRAISED_BORDER | wxBU_AUTODRAW,wxDefaultValidator, wxT("Freedoom installation"));
|
2007-06-09 20:34:00 +00:00
|
|
|
WxBitmapButton6->SetToolTip(wxT("Click here to install the freedoom wad files."));
|
2007-05-16 19:12:22 +00:00
|
|
|
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);
|
|
|
|
|
2007-07-15 22:15:28 +00:00
|
|
|
wxBitmap TalkInstallButton (wxGetBitmapFromMemory(talkfile_btn_png,talkfile_btn_png_length));
|
2007-07-15 18:15:59 +00:00
|
|
|
WxBitmapButton7 = new wxBitmapButton(themepage, ID_TALK_BTN,
|
|
|
|
TalkInstallButton, wxPoint(0,0), wxSize(64,54),
|
|
|
|
wxRAISED_BORDER | wxBU_AUTODRAW,wxDefaultValidator, wxT("Create Talk Files"));
|
|
|
|
WxBitmapButton7->SetToolTip(wxT("Click here to create Talk files."));
|
|
|
|
WxFlexGridSizer2->Add(WxBitmapButton7, 0,
|
|
|
|
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
|
|
|
|
|
|
|
|
wxStaticText* WxStaticText8 = new wxStaticText(themepage, wxID_ANY,
|
|
|
|
wxT("Create Talk Files.\n\n"));
|
|
|
|
WxFlexGridSizer2->Add(WxStaticText8, 0,
|
|
|
|
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
/*********************+
|
2007-05-03 17:10:28 +00:00
|
|
|
Uninstall Page
|
|
|
|
***********************/
|
|
|
|
|
|
|
|
wxBoxSizer* WxBoxSizer4 = new wxBoxSizer(wxVERTICAL);
|
|
|
|
uninstallpage->SetSizer(WxBoxSizer4);
|
2007-05-03 20:07:57 +00:00
|
|
|
uninstallpage->SetAutoLayout(TRUE);
|
|
|
|
|
2007-05-03 17:10:28 +00:00
|
|
|
wxStaticBox* WxStaticBoxSizer5_StaticBoxObj = new wxStaticBox(uninstallpage,
|
|
|
|
wxID_ANY, wxT("Please choose an option"));
|
|
|
|
wxStaticBoxSizer* WxStaticBoxSizer5 =
|
|
|
|
new wxStaticBoxSizer(WxStaticBoxSizer5_StaticBoxObj,wxHORIZONTAL);
|
2007-05-05 16:55:04 +00:00
|
|
|
WxBoxSizer4->Add(WxStaticBoxSizer5,1,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
|
2007-05-03 20:07:57 +00:00
|
|
|
|
2007-05-03 17:10:28 +00:00
|
|
|
wxFlexGridSizer* WxFlexGridSizer3 = new wxFlexGridSizer(2,2,0,0);
|
|
|
|
WxStaticBoxSizer5->Add(WxFlexGridSizer3,0,wxGROW | wxALL,0);
|
2007-05-03 20:07:57 +00:00
|
|
|
|
2007-06-22 23:46:47 +00:00
|
|
|
wxBitmap WxBitmapButton2_BITMAP (wxGetBitmapFromMemory(remrb_btn_png,remrb_btn_png_length));
|
2007-05-03 17:10:28 +00:00
|
|
|
WxBitmapButton2 = new wxBitmapButton(uninstallpage, ID_REMOVE_BTN,
|
2006-12-13 21:11:24 +00:00
|
|
|
WxBitmapButton2_BITMAP, wxPoint(0,0), wxSize(64,54),
|
2007-06-17 20:15:18 +00:00
|
|
|
wxRAISED_BORDER | wxBU_AUTODRAW,wxDefaultValidator, wxT("Rockbox uninstallation"));
|
2007-06-09 20:34:00 +00:00
|
|
|
WxBitmapButton2->SetToolTip(wxT("Click here to uninstall Rockbox"));
|
2007-05-03 17:10:28 +00:00
|
|
|
WxFlexGridSizer3->Add(WxBitmapButton2,0,
|
2006-12-11 21:25:37 +00:00
|
|
|
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
|
|
|
|
|
2007-05-03 17:10:28 +00:00
|
|
|
WxStaticText3 = new wxStaticText(uninstallpage, ID_WXSTATICTEXT3,
|
2007-03-15 14:02:37 +00:00
|
|
|
wxT("Remove Rockbox from your audio player"));
|
2007-05-03 17:10:28 +00:00
|
|
|
WxFlexGridSizer3->Add(WxStaticText3,0,
|
2006-12-11 21:25:37 +00:00
|
|
|
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
|
|
|
|
|
2007-06-22 23:46:47 +00:00
|
|
|
wxBitmap WxBitmapButton4_BITMAP (wxGetBitmapFromMemory(rembootloader_btn_png,rembootloader_btn_png_length));
|
2007-05-03 17:10:28 +00:00
|
|
|
WxBitmapButton4 = new wxBitmapButton(uninstallpage, ID_BOOTLOADERREMOVE_BTN,
|
2007-02-21 20:27:14 +00:00
|
|
|
WxBitmapButton4_BITMAP, wxPoint(0,0), wxSize(64,54),
|
|
|
|
wxRAISED_BORDER | wxBU_AUTODRAW, wxDefaultValidator,
|
2007-06-17 20:15:18 +00:00
|
|
|
wxT("Bootloader uninstallation"));
|
2007-06-09 20:34:00 +00:00
|
|
|
WxBitmapButton4->SetToolTip(wxT("Click here to uninstall the Bootloader"));
|
2007-05-03 17:10:28 +00:00
|
|
|
WxFlexGridSizer3->Add(WxBitmapButton4,0,
|
2007-02-21 20:27:14 +00:00
|
|
|
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
|
|
|
|
|
2007-05-03 17:10:28 +00:00
|
|
|
WxStaticText4 = new wxStaticText(uninstallpage, ID_WXSTATICTEXT4,
|
2007-03-15 14:02:37 +00:00
|
|
|
wxT("Remove Rockbox Bootloader from your audio player"));
|
2007-05-03 17:10:28 +00:00
|
|
|
WxFlexGridSizer3->Add(WxStaticText4,0,
|
2007-02-21 20:27:14 +00:00
|
|
|
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
|
|
|
|
|
2007-05-05 18:28:18 +00:00
|
|
|
|
|
|
|
/*****************
|
|
|
|
* Manual Page
|
|
|
|
******************/
|
|
|
|
|
|
|
|
wxBoxSizer* WxBoxSizer5 = new wxBoxSizer(wxVERTICAL);
|
|
|
|
manualpage->SetSizer(WxBoxSizer5);
|
|
|
|
manualpage->SetAutoLayout(TRUE);
|
|
|
|
|
|
|
|
manuallink = new wxHyperlinkCtrl(manualpage,wxID_ANY,wxT("Rockbox PDF Manual"),wxT("http://www.rockbox.org"));
|
|
|
|
WxBoxSizer5->Add(manuallink,1,wxGROW | wxALL, 5);
|
|
|
|
|
|
|
|
manual =new wxHtmlWindow(manualpage,ID_MANUAL);
|
|
|
|
WxBoxSizer5->Add(manual,10,wxGROW | wxALL, 5);
|
|
|
|
|
|
|
|
|
|
|
|
/**********
|
|
|
|
** rest of the controls
|
|
|
|
**********/
|
|
|
|
|
2006-12-11 21:25:37 +00:00
|
|
|
WxMenuBar1 = new wxMenuBar();
|
|
|
|
wxMenu *ID_FILE_MENU_Mnu_Obj = new wxMenu(0);
|
2007-03-15 14:02:37 +00:00
|
|
|
WxMenuBar1->Append(ID_FILE_MENU_Mnu_Obj, wxT("&File"));
|
2006-12-11 21:25:37 +00:00
|
|
|
|
|
|
|
ID_FILE_MENU_Mnu_Obj->Append(ID_FILE_WIPECACHE,
|
2007-03-15 14:02:37 +00:00
|
|
|
wxT("&Empty local download cache"), wxT(""), wxITEM_NORMAL);
|
2006-12-13 21:11:24 +00:00
|
|
|
if (! gv->portable )
|
|
|
|
{
|
|
|
|
ID_FILE_MENU_Mnu_Obj->Append(ID_PORTABLE_INSTALL,
|
2007-03-15 14:02:37 +00:00
|
|
|
wxT("&Install Rockbox Utility on device"), wxT(""), wxITEM_NORMAL);
|
2006-12-13 21:11:24 +00:00
|
|
|
}
|
2007-05-05 20:23:28 +00:00
|
|
|
ID_FILE_MENU_Mnu_Obj->Append(ID_FILE_PROXY, wxT("Set &Proxy"), wxT(""),
|
|
|
|
wxITEM_NORMAL);
|
2007-03-15 14:02:37 +00:00
|
|
|
ID_FILE_MENU_Mnu_Obj->Append(ID_FILE_ABOUT, wxT("&About"), wxT(""),
|
2006-12-11 21:25:37 +00:00
|
|
|
wxITEM_NORMAL);
|
2007-03-15 14:02:37 +00:00
|
|
|
ID_FILE_MENU_Mnu_Obj->Append(ID_FILE_EXIT, wxT("E&xit\tCtrl+X"), wxT(""),
|
2006-12-11 21:25:37 +00:00
|
|
|
wxITEM_NORMAL);
|
|
|
|
|
|
|
|
this->SetMenuBar(WxMenuBar1);
|
2007-05-03 17:10:28 +00:00
|
|
|
Layout();
|
2006-12-11 21:25:37 +00:00
|
|
|
GetSizer()->Fit(this);
|
|
|
|
GetSizer()->SetSizeHints(this);
|
2006-12-13 21:11:24 +00:00
|
|
|
if (gv->portable)
|
|
|
|
{
|
2007-03-15 14:02:37 +00:00
|
|
|
this->SetTitle(wxT("Rockbox Utility (portable)"));
|
2006-12-13 21:11:24 +00:00
|
|
|
} else
|
|
|
|
{
|
2007-03-15 14:02:37 +00:00
|
|
|
this->SetTitle(wxT("Rockbox Utility"));
|
2006-12-13 21:11:24 +00:00
|
|
|
}
|
2006-12-11 21:25:37 +00:00
|
|
|
this->Center();
|
|
|
|
wxIcon rbutilFrm_ICON (rbutilFrm_XPM);
|
|
|
|
this->SetIcon(rbutilFrm_XPM);
|
|
|
|
this->SetToolTip(wxT("Install Rockbox"));
|
2007-05-03 20:07:57 +00:00
|
|
|
|
2007-03-15 14:02:37 +00:00
|
|
|
wxLogVerbose(wxT("=== end rbutilFrm::CreateGUIControls"));
|
2006-12-11 21:25:37 +00:00
|
|
|
}
|
|
|
|
|
2007-05-05 18:28:18 +00:00
|
|
|
void rbutilFrm::OnManualUpdate(wxUpdateUIEvent& event)
|
|
|
|
{
|
2007-07-01 17:15:50 +00:00
|
|
|
wxString tmp = wxT("/rockbox-") + gv->curplat;
|
2007-05-05 18:28:18 +00:00
|
|
|
|
2007-07-16 10:18:20 +00:00
|
|
|
int index = GetDeviceId(false);
|
|
|
|
if(index < 0) {
|
|
|
|
curManualDevice = tmp;
|
|
|
|
wxString pdflink;
|
|
|
|
pdflink = gv->manual_url;
|
|
|
|
manuallink->SetURL(pdflink);
|
|
|
|
manual->SetPage(wxT("<p><b>no device selected</b> — "
|
|
|
|
"You can find an overview of available manuals at "
|
|
|
|
"<a href='http://www.rockbox.org/manual.shtml'>"
|
|
|
|
"http://www.rockbox.org/manual.shtml</a></p>"));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-07-01 17:15:50 +00:00
|
|
|
if(gv->plat_manualname[index] != wxT(""))
|
|
|
|
tmp = wxT("/") + gv->plat_manualname[index];
|
2007-05-16 19:45:09 +00:00
|
|
|
|
2007-05-05 18:28:18 +00:00
|
|
|
if( tmp == curManualDevice)
|
|
|
|
return;
|
|
|
|
|
|
|
|
curManualDevice = tmp;
|
|
|
|
|
|
|
|
// construct link to pdf
|
|
|
|
wxString pdflink;
|
2007-07-01 17:15:50 +00:00
|
|
|
pdflink = gv->manual_url + tmp + wxT(".pdf");
|
2007-05-05 18:28:18 +00:00
|
|
|
manuallink->SetURL(pdflink);
|
|
|
|
|
|
|
|
// construct link to html
|
|
|
|
wxString htmllink;
|
2007-07-01 17:15:50 +00:00
|
|
|
htmllink = gv->manual_url + tmp + wxT("/rockbox-build.html");
|
2007-07-16 10:18:20 +00:00
|
|
|
if(gv->proxy_url == wxT(""))
|
|
|
|
if(manual->LoadPage(htmllink)) return;
|
|
|
|
manual->SetPage(wxT("<p>unable to display manual —"
|
|
|
|
"please use the PDF link above</p>"));
|
2007-05-05 20:23:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2007-05-05 18:28:18 +00:00
|
|
|
|
2007-05-05 20:23:28 +00:00
|
|
|
void rbutilFrm::OnFileProxy(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
|
2007-06-23 16:11:22 +00:00
|
|
|
wxTextEntryDialog proxydlg(this,wxT("Please enter your Proxy in the Format: URL:PORT"),wxT("Proxy Configuration"), gv->proxy_url);
|
2007-05-05 20:23:28 +00:00
|
|
|
|
|
|
|
if(proxydlg.ShowModal() == wxID_OK)
|
|
|
|
{
|
|
|
|
gv->proxy_url = proxydlg.GetValue();
|
|
|
|
}
|
2007-05-05 18:28:18 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-12-11 21:25:37 +00:00
|
|
|
void rbutilFrm::rbutilFrmClose(wxCloseEvent& event)
|
|
|
|
{
|
2007-03-15 14:02:37 +00:00
|
|
|
wxLogVerbose(wxT("=== begin rbutilFrm::rbutilFrmClose(event)"));
|
2006-12-11 21:25:37 +00:00
|
|
|
Destroy();
|
2007-03-15 14:02:37 +00:00
|
|
|
wxLogVerbose(wxT("=== end rbutilFrm::rbutilFrmClose"));
|
2006-12-11 21:25:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-05-03 17:10:28 +00:00
|
|
|
|
2006-12-11 21:25:37 +00:00
|
|
|
/*
|
|
|
|
* OnFileExit
|
|
|
|
*/
|
|
|
|
void rbutilFrm::OnFileExit(wxCommandEvent& event)
|
|
|
|
{
|
2007-03-15 14:02:37 +00:00
|
|
|
wxLogVerbose(wxT("=== begin rbutilFrm::OnFileExit(event)"));
|
2006-12-11 21:25:37 +00:00
|
|
|
Close();
|
2007-03-15 14:02:37 +00:00
|
|
|
wxLogVerbose(wxT("=== end rbutilFrm::OnFileExit"));
|
2006-12-11 21:25:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// The routines this code uses are in the wxWidgets documentation, but
|
|
|
|
// not yet the library (2.7.0-1). This code can be re-enabled later.
|
|
|
|
|
|
|
|
void rbutilFrm::OnFileAbout(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
wxAboutDialogInfo *info = new wxAboutDialogInfo();
|
|
|
|
|
2007-03-15 14:02:37 +00:00
|
|
|
info->SetName(wxT(RBUTIL_FULLNAME));
|
|
|
|
info->SetVersion(wxT(RBUTIL_VERSION));
|
|
|
|
info->SetCopyright(wxT(RBUTIL_COPYRIGHT));
|
|
|
|
info->SetDescription(wxT(RBUTIL_DESCRIPTION));
|
|
|
|
info->SetWebSite(wxT(RBUTIL_WEBSITE));
|
2006-12-14 06:11:29 +00:00
|
|
|
|
|
|
|
long i = 0;
|
|
|
|
while (rbutil_developers[i] != "")
|
|
|
|
{
|
|
|
|
info->AddDeveloper(wxT(rbutil_developers[i++]));
|
|
|
|
}
|
|
|
|
|
|
|
|
wxAboutBox(*info);
|
|
|
|
delete info;
|
2006-12-11 21:25:37 +00:00
|
|
|
*/
|
2006-12-14 06:11:29 +00:00
|
|
|
|
2006-12-11 21:25:37 +00:00
|
|
|
AboutDlg(this).ShowModal();
|
|
|
|
}
|
|
|
|
|
|
|
|
void rbutilFrm::OnFileWipeCache(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
wxString cacheloc, datadir;
|
|
|
|
|
|
|
|
datadir = gv->stdpaths->GetUserDataDir();
|
2007-03-15 18:02:15 +00:00
|
|
|
if (datadir == wxT(""))
|
2006-12-11 21:25:37 +00:00
|
|
|
{
|
2007-03-15 14:02:37 +00:00
|
|
|
ERR_DIALOG(wxT("Can't locate user data directory. Unable to delete "
|
|
|
|
"cache."), wxT("Delete download cache.") );
|
2006-12-11 21:25:37 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-06-10 22:08:48 +00:00
|
|
|
cacheloc = datadir + wxT("" PATH_SEP "download");
|
2006-12-11 21:25:37 +00:00
|
|
|
|
|
|
|
if (! rm_rf(cacheloc) )
|
|
|
|
{
|
2007-03-15 14:02:37 +00:00
|
|
|
wxMessageDialog* msg = new wxMessageDialog(this, wxT("Local download cache has been deleted.")
|
2007-03-15 18:02:15 +00:00
|
|
|
, wxT("Cache deletion"), wxOK |wxICON_INFORMATION);
|
2007-02-21 20:27:14 +00:00
|
|
|
msg->ShowModal();
|
|
|
|
delete msg;
|
2006-12-11 21:25:37 +00:00
|
|
|
}
|
|
|
|
else {
|
2007-03-15 14:02:37 +00:00
|
|
|
MESG_DIALOG(wxT("Errors occured deleting the local download cache."));
|
2006-12-11 21:25:37 +00:00
|
|
|
}
|
|
|
|
|
2006-12-14 03:55:15 +00:00
|
|
|
wxMkdir(cacheloc, 0777);
|
2006-12-11 21:25:37 +00:00
|
|
|
}
|
|
|
|
|
2007-02-21 20:27:14 +00:00
|
|
|
void rbutilFrm::OnBootloaderRemoveBtn(wxCommandEvent& event)
|
|
|
|
{
|
2007-03-15 14:02:37 +00:00
|
|
|
wxLogVerbose(wxT("=== begin rbutilFrm::OnBootloaderRemoveBtn(event)"));
|
2007-02-21 20:27:14 +00:00
|
|
|
|
2007-07-16 10:18:20 +00:00
|
|
|
int index = GetDeviceId(true);
|
2007-05-27 22:44:22 +00:00
|
|
|
if(index < 0)
|
|
|
|
return;
|
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
wxString bootloadermethod = gv->plat_bootloadermethod[index];
|
2007-02-21 20:27:14 +00:00
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
if(!gv->plat_needsbootloader[index])
|
2007-02-21 20:27:14 +00:00
|
|
|
{
|
2007-05-05 16:55:04 +00:00
|
|
|
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;
|
|
|
|
|
2007-02-21 20:27:14 +00:00
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
if(bootloadermethod == wxT("ipodpatcher"))
|
|
|
|
{
|
|
|
|
wxString bootloadername = wxT("bootloader-");
|
|
|
|
bootloadername.Append(gv->plat_bootloadername[index] );
|
|
|
|
if(ipodpatcher(BOOTLOADER_REM,bootloadername))
|
2007-05-03 17:10:28 +00:00
|
|
|
{
|
2007-05-05 16:55:04 +00:00
|
|
|
MESG_DIALOG(wxT("The Bootloader has been uninstalled.") );
|
2007-02-21 20:27:14 +00:00
|
|
|
}
|
2007-05-05 16:55:04 +00:00
|
|
|
else
|
2007-02-21 20:27:14 +00:00
|
|
|
{
|
2007-05-05 16:55:04 +00:00
|
|
|
MESG_DIALOG(wxT("The Uninstallation failed.") );
|
2007-02-21 20:27:14 +00:00
|
|
|
}
|
2007-05-05 16:55:04 +00:00
|
|
|
}
|
2007-07-05 20:12:53 +00:00
|
|
|
else if(bootloadermethod == wxT("sansapatcher"))
|
2007-05-05 16:55:04 +00:00
|
|
|
{
|
|
|
|
if(sansapatcher(BOOTLOADER_REM,gv->plat_bootloadername[index]))
|
2007-02-21 20:27:14 +00:00
|
|
|
{
|
2007-05-05 16:55:04 +00:00
|
|
|
MESG_DIALOG(wxT("The Bootloader has been uninstalled.") );
|
2007-02-21 20:27:14 +00:00
|
|
|
}
|
2007-05-05 16:55:04 +00:00
|
|
|
else
|
2007-02-21 20:27:14 +00:00
|
|
|
{
|
2007-05-05 16:55:04 +00:00
|
|
|
MESG_DIALOG(wxT("The Uninstallation failed.") );
|
2007-02-21 20:27:14 +00:00
|
|
|
}
|
2007-05-05 16:55:04 +00:00
|
|
|
}
|
|
|
|
else if(bootloadermethod== wxT("gigabeatf"))
|
|
|
|
{
|
|
|
|
|
|
|
|
if(gigabeatf(BOOTLOADER_REM,gv->plat_bootloadername[index],gv->curdestdir))
|
2007-02-21 20:27:14 +00:00
|
|
|
{
|
2007-05-05 16:55:04 +00:00
|
|
|
MESG_DIALOG(wxT("The Bootloader has been uninstalled."));
|
2007-02-21 20:27:14 +00:00
|
|
|
}
|
|
|
|
else
|
2007-05-05 16:55:04 +00:00
|
|
|
MESG_DIALOG(wxT("The Uninstallation failed.") );
|
|
|
|
}
|
|
|
|
else if(bootloadermethod == wxT("iaudio") )
|
|
|
|
{
|
|
|
|
MESG_DIALOG(wxT("To uninstall the Bootloader on this Device,\n"
|
|
|
|
"you need to download and install an Original Firmware from the Manufacturer."));
|
|
|
|
}
|
|
|
|
else if(bootloadermethod == wxT("fwpatcher"))
|
|
|
|
{
|
|
|
|
MESG_DIALOG(wxT("To uninstall the Bootloader on this Device,\n"
|
|
|
|
"you need to download and install an original Firmware from the Manufacturer.\n"
|
|
|
|
"To do this, you need to boot into the original Firmware."));
|
|
|
|
}
|
|
|
|
else if(bootloadermethod == wxT("h10"))
|
|
|
|
{
|
|
|
|
if(h10(BOOTLOADER_REM,gv->plat_bootloadername[index],gv->curdestdir))
|
2007-02-21 20:27:14 +00:00
|
|
|
{
|
2007-05-05 16:55:04 +00:00
|
|
|
MESG_DIALOG(wxT("The Bootloader has been uninstalled."));
|
2007-02-21 20:27:14 +00:00
|
|
|
}
|
2007-05-05 16:55:04 +00:00
|
|
|
else
|
|
|
|
MESG_DIALOG(wxT("The Uninstallation failed.") );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
MESG_DIALOG(wxT("Unsupported Bootloader Uninstall method.") );
|
2007-02-21 20:27:14 +00:00
|
|
|
}
|
|
|
|
|
2007-03-15 14:02:37 +00:00
|
|
|
wxLogVerbose(wxT("=== end rbutilFrm::OnBootloaderRemoveBtn"));
|
2007-02-21 20:27:14 +00:00
|
|
|
}
|
2006-12-11 21:25:37 +00:00
|
|
|
|
|
|
|
void rbutilFrm::OnBootloaderBtn(wxCommandEvent& event)
|
|
|
|
{
|
2007-03-15 14:02:37 +00:00
|
|
|
wxLogVerbose(wxT("=== begin rbutilFrm::OnBootloaderBtn(event)"));
|
2007-02-21 20:27:14 +00:00
|
|
|
|
2007-07-16 10:18:20 +00:00
|
|
|
int index = GetDeviceId(true);
|
2007-05-27 22:44:22 +00:00
|
|
|
if(index < 0)
|
|
|
|
return;
|
2007-06-10 20:52:20 +00:00
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
wxString bootloadermethod = gv->plat_bootloadermethod[index];
|
2007-05-03 17:10:28 +00:00
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
if(!gv->plat_needsbootloader[index])
|
2007-02-21 20:27:14 +00:00
|
|
|
{
|
2007-05-05 16:55:04 +00:00
|
|
|
WARN_DIALOG(wxT("This Device doesnt need a Bootloader"),
|
|
|
|
wxT("Bootloader"));
|
|
|
|
return;
|
|
|
|
}
|
2007-02-21 20:27:14 +00:00
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
// Bootloader dialog
|
|
|
|
if(bootloadermethod != wxT("ipodpatcher") && bootloadermethod != wxT("sansapatcher") )
|
|
|
|
{
|
|
|
|
bootloaderInstallDlg dialog(NULL, wxID_ANY,wxT("Bootloader Installation"));
|
|
|
|
if (dialog.ShowModal() != wxID_OK)
|
|
|
|
return;
|
|
|
|
}
|
2007-05-03 20:07:57 +00:00
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
// 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;
|
2007-02-21 20:27:14 +00:00
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
|
|
|
|
if(bootloadermethod == wxT("ipodpatcher"))
|
|
|
|
{
|
|
|
|
wxString bootloadername = wxT("bootloader-");
|
|
|
|
bootloadername.Append(gv->plat_bootloadername[index] );
|
|
|
|
if(ipodpatcher(BOOTLOADER_ADD,bootloadername))
|
|
|
|
{
|
|
|
|
MESG_DIALOG(wxT("The Bootloader has been installed on your device.") );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
MESG_DIALOG(wxT("The installation has failed.") );
|
|
|
|
}
|
|
|
|
}
|
2007-07-05 19:56:01 +00:00
|
|
|
else if(bootloadermethod == wxT("sansapatcher"))
|
2007-05-05 16:55:04 +00:00
|
|
|
{
|
|
|
|
if(sansapatcher(BOOTLOADER_ADD,gv->plat_bootloadername[index]))
|
|
|
|
{
|
|
|
|
MESG_DIALOG(wxT("The Bootloader has been installed on your device.") );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
MESG_DIALOG(wxT("The installation has failed.") );
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else if(bootloadermethod== wxT("gigabeatf"))
|
|
|
|
{
|
|
|
|
|
|
|
|
if(gigabeatf(BOOTLOADER_ADD,gv->plat_bootloadername[index],gv->curdestdir))
|
|
|
|
{
|
|
|
|
MESG_DIALOG(wxT("The Bootloader has been installed on your device."));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
MESG_DIALOG(wxT("The installation has failed.") );
|
|
|
|
}
|
|
|
|
else if(bootloadermethod == wxT("iaudio") )
|
|
|
|
{
|
|
|
|
if(iaudiox5(BOOTLOADER_ADD,gv->plat_bootloadername[index],gv->curdestdir))
|
|
|
|
{
|
|
|
|
MESG_DIALOG(wxT("The Bootloader has been installed on your device.\n"
|
|
|
|
"Now turn OFF your Device, unplug USB,and insert Charger\n"
|
|
|
|
"Your Device will automatically upgrade the flash with the Rockbox bootloader"));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
MESG_DIALOG(wxT("The installation has failed.") );
|
|
|
|
}
|
|
|
|
else if(bootloadermethod == wxT("fwpatcher"))
|
|
|
|
{
|
|
|
|
if(fwpatcher(BOOTLOADER_ADD,gv->plat_bootloadername[index],gv->curdestdir,gv->curfirmware))
|
|
|
|
{
|
|
|
|
MESG_DIALOG(wxT("The Bootloader has been patched and copied on your device.\n"
|
|
|
|
"Now use the Firmware upgrade option of your Device\n"));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
MESG_DIALOG(wxT("The installation has failed.") );
|
2007-02-21 20:27:14 +00:00
|
|
|
}
|
2007-05-05 16:55:04 +00:00
|
|
|
else if(bootloadermethod == wxT("h10"))
|
|
|
|
{
|
|
|
|
if(h10(BOOTLOADER_ADD,gv->plat_bootloadername[index],gv->curdestdir))
|
|
|
|
{
|
|
|
|
MESG_DIALOG(wxT("The Bootloader has been patched and copied on your device.\n"));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
MESG_DIALOG(wxT("The installation has failed.") );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
MESG_DIALOG(wxT("Unsupported Bootloader Install method.") );
|
|
|
|
}
|
|
|
|
|
2007-05-03 17:10:28 +00:00
|
|
|
|
2007-02-21 20:27:14 +00:00
|
|
|
|
2007-03-15 14:02:37 +00:00
|
|
|
wxLogVerbose(wxT("=== end rbutilFrm::OnBootloaderBtn"));
|
2007-02-21 20:27:14 +00:00
|
|
|
|
2006-12-11 21:25:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void rbutilFrm::OnInstallBtn(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
wxString src, dest, buf;
|
|
|
|
wxDateTime date;
|
|
|
|
wxTimeSpan day(24);
|
2007-03-15 14:02:37 +00:00
|
|
|
wxLogVerbose(wxT("=== begin rbutilFrm::OnInstallBtn(event)"));
|
2006-12-11 21:25:37 +00:00
|
|
|
wxFileSystem fs;
|
|
|
|
wxFileConfig* buildinfo;
|
|
|
|
wxDateSpan oneday;
|
|
|
|
|
2007-07-16 10:18:20 +00:00
|
|
|
int index = GetDeviceId(true);
|
2007-05-27 22:44:22 +00:00
|
|
|
if(index < 0)
|
|
|
|
return;
|
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
// rockbox install dialog
|
2007-05-03 17:10:28 +00:00
|
|
|
rockboxInstallDlg dialog(NULL, wxID_ANY,
|
|
|
|
wxT("Rockbox Installation"));
|
2007-05-05 16:55:04 +00:00
|
|
|
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;
|
2007-05-03 17:10:28 +00:00
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
|
|
|
|
switch (gv->curbuild)
|
2006-12-11 21:25:37 +00:00
|
|
|
{
|
2007-05-05 16:55:04 +00:00
|
|
|
case BUILD_RELEASE:
|
|
|
|
// This is a URL - don't use PATH_SEP
|
2007-06-10 22:08:48 +00:00
|
|
|
src = gv->download_url + gv->prog_name + wxT("-")
|
|
|
|
+ gv->last_release + wxT("-") + gv->curplat + wxT(".zip");
|
|
|
|
dest = gv->stdpaths->GetUserDataDir() + wxT("download" PATH_SEP)
|
|
|
|
+ gv->prog_name + wxT("-") + gv->last_release + wxT("-")
|
|
|
|
+ gv->curplat + wxT(".zip");
|
2007-05-05 16:55:04 +00:00
|
|
|
break;
|
|
|
|
case BUILD_DAILY:
|
2007-06-10 22:08:48 +00:00
|
|
|
dest = gv->stdpaths->GetUserDataDir()
|
|
|
|
+ PATH_SEP + wxT("download") + PATH_SEP + wxT("build-info");
|
2007-05-05 16:55:04 +00:00
|
|
|
if (DownloadURL(gv->server_conf_url, dest)) {
|
|
|
|
WARN_DIALOG(wxT("Unable to download build status."),
|
|
|
|
wxT("Install"));
|
|
|
|
buf = wxT("");
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
buildinfo = new wxFileConfig(wxEmptyString,
|
|
|
|
wxEmptyString, dest);
|
|
|
|
buf = buildinfo->Read(wxT("/dailies/date"));
|
|
|
|
buildinfo->DeleteAll();
|
2006-12-11 21:25:37 +00:00
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
if (buf.Len() != 8) {
|
2007-06-10 22:08:48 +00:00
|
|
|
dest = wxT("Invalid build date: ") + buf;
|
2007-05-05 16:55:04 +00:00
|
|
|
WARN_DIALOG(dest, wxT("Install"));
|
|
|
|
buf = wxT("");
|
2006-12-11 21:25:37 +00:00
|
|
|
}
|
2007-05-05 16:55:04 +00:00
|
|
|
}
|
2006-12-11 21:25:37 +00:00
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
if (buf == wxT("")) {
|
|
|
|
WARN_DIALOG(wxT("Can't get date of latest build from "
|
|
|
|
"server. Using yesterday's date."), wxT("Install") );
|
|
|
|
date = wxDateTime::Now();
|
|
|
|
date.Subtract(oneday.Day());
|
|
|
|
buf = date.Format(wxT("%Y%m%d")); // yes, we want UTC
|
2006-12-11 21:25:37 +00:00
|
|
|
}
|
|
|
|
|
2007-06-10 22:08:48 +00:00
|
|
|
src = gv->daily_url + gv->curplat + wxT("/") + gv->prog_name
|
|
|
|
+ wxT("-") + gv->curplat + wxT("-") + buf + wxT(".zip");
|
2007-05-05 16:55:04 +00:00
|
|
|
|
2007-06-10 22:08:48 +00:00
|
|
|
dest = gv->stdpaths->GetUserDataDir() + PATH_SEP wxT("download")
|
|
|
|
+ gv->prog_name + wxT("-") + gv->curplat + wxT("-")
|
|
|
|
+ buf + wxT(".zip");
|
2007-05-05 16:55:04 +00:00
|
|
|
break;
|
|
|
|
case BUILD_BLEEDING:
|
2007-06-10 22:08:48 +00:00
|
|
|
src = gv->bleeding_url + gv->curplat + wxT("/")
|
|
|
|
+ gv->prog_name + wxT(".zip");
|
|
|
|
dest = gv->stdpaths->GetUserDataDir()
|
|
|
|
+ PATH_SEP wxT("download") PATH_SEP
|
|
|
|
+ gv->prog_name + wxT(".zip");
|
2007-05-05 16:55:04 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
ERR_DIALOG(wxT("Something seriously odd has happened."),
|
|
|
|
wxT("Install"));
|
|
|
|
return;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gv->nocache || ( ! wxFileExists(dest) ) )
|
|
|
|
{
|
|
|
|
if ( DownloadURL(src, dest) )
|
2006-12-11 21:25:37 +00:00
|
|
|
{
|
|
|
|
wxRemoveFile(dest);
|
2007-06-10 22:08:48 +00:00
|
|
|
ERR_DIALOG(wxT("Unable to download ")+src, wxT("Install"));
|
2007-05-05 16:55:04 +00:00
|
|
|
return;
|
2006-12-11 21:25:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
if ( !UnzipFile(dest, gv->curdestdir, true) )
|
|
|
|
{
|
|
|
|
wxMessageDialog* msg = new wxMessageDialog(this, wxT("Rockbox has been installed on your device.")
|
|
|
|
,wxT("Installation"), wxOK |wxICON_INFORMATION);
|
|
|
|
msg->ShowModal();
|
|
|
|
delete msg;
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
wxRemoveFile(dest);
|
2007-06-10 22:08:48 +00:00
|
|
|
ERR_DIALOG(wxT("Unable to unzip ")+dest, wxT("Install"));
|
2007-05-05 16:55:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-03-15 14:02:37 +00:00
|
|
|
wxLogVerbose(wxT("=== end rbutilFrm::OnInstallBtn"));
|
2006-12-11 21:25:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void rbutilFrm::OnFontBtn(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
wxString src, dest, buf;
|
|
|
|
wxDateTime date;
|
|
|
|
wxTimeSpan day(24);
|
2007-03-15 14:02:37 +00:00
|
|
|
wxLogVerbose(wxT("=== begin rbutilFrm::OnFontBtn(event)"));
|
2006-12-11 21:25:37 +00:00
|
|
|
wxFileSystem fs;
|
|
|
|
wxFileConfig* buildinfo;
|
|
|
|
wxDateSpan oneday;
|
|
|
|
|
2007-07-16 10:18:20 +00:00
|
|
|
int index = GetDeviceId(true);
|
2007-05-27 22:44:22 +00:00
|
|
|
if(index < 0)
|
|
|
|
return;
|
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
// font install dialog
|
2007-05-03 17:10:28 +00:00
|
|
|
fontInstallDlg dialog(NULL, wxID_ANY,
|
|
|
|
wxT("Font Installation"));
|
2007-05-05 16:55:04 +00:00
|
|
|
if (dialog.ShowModal() != wxID_OK)
|
|
|
|
return;
|
2006-12-11 21:25:37 +00:00
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
// 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;
|
2006-12-14 03:55:15 +00:00
|
|
|
|
2006-12-11 21:25:37 +00:00
|
|
|
|
2007-06-10 22:08:48 +00:00
|
|
|
buf = gv->curdestdir + wxT("" PATH_SEP ".rockbox");
|
2007-05-05 16:55:04 +00:00
|
|
|
if (! wxDirExists(buf) )
|
|
|
|
{
|
2007-06-10 22:08:48 +00:00
|
|
|
WARN_DIALOG(wxT("Rockbox is not yet installed on ") + buf
|
|
|
|
+ wxT(" - install Rockbox first."),
|
|
|
|
wxT("Can't install fonts") );
|
2007-05-05 16:55:04 +00:00
|
|
|
return;
|
|
|
|
}
|
2006-12-11 21:25:37 +00:00
|
|
|
|
2007-06-10 22:08:48 +00:00
|
|
|
dest = gv->stdpaths->GetUserDataDir()
|
|
|
|
+ wxT( "" PATH_SEP "download" PATH_SEP "build-info");
|
2007-05-05 16:55:04 +00:00
|
|
|
if (DownloadURL(gv->server_conf_url, dest))
|
|
|
|
{
|
|
|
|
WARN_DIALOG(wxT("Unable to download build status."),
|
|
|
|
wxT("Font Install"));
|
|
|
|
buf = wxT("");
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
buildinfo = new wxFileConfig(wxEmptyString,
|
|
|
|
wxEmptyString, dest);
|
|
|
|
buf = buildinfo->Read(wxT("/dailies/date"));
|
|
|
|
buildinfo->DeleteAll();
|
|
|
|
|
|
|
|
if (buf.Len() != 8) {
|
2007-06-10 22:08:48 +00:00
|
|
|
WARN_DIALOG(wxT("Invalid build date: ") + buf, wxT("Font Install"));
|
2007-05-05 16:55:04 +00:00
|
|
|
buf = wxT("");
|
2006-12-11 21:25:37 +00:00
|
|
|
}
|
2007-05-05 16:55:04 +00:00
|
|
|
}
|
2006-12-11 21:25:37 +00:00
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
if (buf == wxT("")) {
|
|
|
|
WARN_DIALOG(wxT("Can't get date of latest build from "
|
|
|
|
"server. Using yesterday's date."),
|
|
|
|
wxT("Font Install") );
|
|
|
|
date = wxDateTime::Now();
|
|
|
|
date.Subtract(oneday.Day());
|
|
|
|
buf = date.Format(wxT("%Y%m%d")); // yes, we want UTC
|
|
|
|
}
|
2006-12-11 21:25:37 +00:00
|
|
|
|
2007-06-10 22:08:48 +00:00
|
|
|
src = gv->font_url + buf + wxT(".zip");
|
2006-12-11 21:25:37 +00:00
|
|
|
|
2007-06-10 22:08:48 +00:00
|
|
|
dest = gv->stdpaths->GetUserDataDir() + wxT( "" PATH_SEP "download"
|
|
|
|
PATH_SEP "rockbox-fonts-") + buf + wxT(".zip");
|
2006-12-11 21:25:37 +00:00
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
if ( ! wxFileExists(dest) )
|
|
|
|
{
|
|
|
|
if ( DownloadURL(src, dest) )
|
2006-12-11 21:25:37 +00:00
|
|
|
{
|
|
|
|
wxRemoveFile(dest);
|
2007-06-10 22:08:48 +00:00
|
|
|
ERR_DIALOG(wxT("Unable to download ") + src, wxT("Font Install"));
|
2007-05-05 16:55:04 +00:00
|
|
|
return;
|
2006-12-11 21:25:37 +00:00
|
|
|
}
|
|
|
|
}
|
2007-05-05 16:55:04 +00:00
|
|
|
|
|
|
|
if ( !UnzipFile(dest, gv->curdestdir, true) )
|
|
|
|
{
|
|
|
|
wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Rockbox fonts have been installed on your device.")
|
|
|
|
,wxT("Installation"), wxOK |wxICON_INFORMATION);
|
|
|
|
msg->ShowModal();
|
|
|
|
delete msg;
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
wxRemoveFile(dest);
|
2007-06-10 22:08:48 +00:00
|
|
|
ERR_DIALOG(wxT("Unable to unzip ") + dest, wxT("Font Install"));
|
2007-05-05 16:55:04 +00:00
|
|
|
}
|
|
|
|
|
2007-03-15 14:02:37 +00:00
|
|
|
wxLogVerbose(wxT("=== end rbutilFrm::OnFontBtn"));
|
2006-12-11 21:25:37 +00:00
|
|
|
}
|
|
|
|
|
2007-05-16 19:12:22 +00:00
|
|
|
void rbutilFrm::OnDoomBtn(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
wxString src, dest, buf;
|
|
|
|
wxLogVerbose(wxT("=== begin rbutilFrm::OnDoomBtn(event)"));
|
|
|
|
|
2007-07-16 10:18:20 +00:00
|
|
|
int index = GetDeviceId(true);
|
2007-05-27 22:44:22 +00:00
|
|
|
if(index < 0)
|
|
|
|
return;
|
|
|
|
|
2007-05-16 19:12:22 +00:00
|
|
|
// 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;
|
|
|
|
|
2007-06-10 22:08:48 +00:00
|
|
|
buf = gv->curdestdir + wxT("" PATH_SEP ".rockbox");
|
2007-05-16 19:12:22 +00:00
|
|
|
if (! wxDirExists(buf) )
|
|
|
|
{
|
2007-06-10 22:08:48 +00:00
|
|
|
WARN_DIALOG(wxT("Rockbox is not yet installed on ") + buf
|
|
|
|
+ wxT(" - install Rockbox first."),
|
|
|
|
wxT("Can't install freedoom wads") );
|
2007-05-16 19:12:22 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
src = gv->doom_url;
|
|
|
|
|
2007-06-10 22:08:48 +00:00
|
|
|
dest = gv->stdpaths->GetUserDataDir() + wxT("" PATH_SEP "download" PATH_SEP
|
|
|
|
"rockdoom.zip");
|
2007-05-16 19:12:22 +00:00
|
|
|
|
|
|
|
if ( ! wxFileExists(dest) )
|
|
|
|
{
|
|
|
|
if ( DownloadURL(src, dest) )
|
|
|
|
{
|
|
|
|
wxRemoveFile(dest);
|
2007-06-10 22:08:48 +00:00
|
|
|
ERR_DIALOG(wxT("Unable to download ") + src,
|
|
|
|
wxT("Freedoom Install"));
|
2007-05-16 19:12:22 +00:00
|
|
|
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);
|
2007-06-10 22:08:48 +00:00
|
|
|
ERR_DIALOG(wxT("Unable to unzip ") + dest, wxT("Freedoom Install"));
|
2007-05-16 19:12:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxLogVerbose(wxT("=== end rbutilFrm::OnDoomBtn"));
|
|
|
|
}
|
|
|
|
|
2007-03-15 14:02:37 +00:00
|
|
|
|
|
|
|
void rbutilFrm::OnThemesBtn(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
wxString src, dest, buf;
|
|
|
|
wxLogVerbose(wxT("=== begin rbutilFrm::OnThemesBtn(event)"));
|
|
|
|
|
2007-07-16 10:18:20 +00:00
|
|
|
int index = GetDeviceId(true);
|
2007-05-27 22:44:22 +00:00
|
|
|
if(index < 0)
|
|
|
|
return;
|
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
// Theme install dialog
|
2007-05-03 17:10:28 +00:00
|
|
|
themesInstallDlg dialog(NULL, wxID_ANY,
|
|
|
|
wxT("Theme Installation"));
|
2007-05-05 16:55:04 +00:00
|
|
|
if (dialog.ShowModal() != wxID_OK)
|
|
|
|
return;
|
2007-05-03 17:10:28 +00:00
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
// 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;
|
|
|
|
|
|
|
|
bool success=true;
|
|
|
|
for(unsigned int i=0 ;i < gv->themesToInstall.GetCount();i++)
|
2007-03-15 14:02:37 +00:00
|
|
|
{
|
2007-05-05 16:55:04 +00:00
|
|
|
if(!InstallTheme(gv->themesToInstall[i]))
|
2007-03-15 14:02:37 +00:00
|
|
|
{
|
2007-05-05 16:55:04 +00:00
|
|
|
MESG_DIALOG(wxT("The Themes installation has failed") );
|
|
|
|
success=false;
|
|
|
|
break;
|
2007-03-15 14:02:37 +00:00
|
|
|
}
|
|
|
|
}
|
2007-05-05 16:55:04 +00:00
|
|
|
if(success)
|
|
|
|
{
|
|
|
|
MESG_DIALOG(wxT("The Theme installation completed successfully.") );
|
|
|
|
}
|
2007-03-15 14:02:37 +00:00
|
|
|
|
2007-05-03 17:10:28 +00:00
|
|
|
|
2007-03-15 14:02:37 +00:00
|
|
|
wxLogVerbose(wxT("=== end rbutilFrm::OnThemesBtn(event)"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-12-11 21:25:37 +00:00
|
|
|
void rbutilFrm::OnRemoveBtn(wxCommandEvent& event)
|
|
|
|
{
|
2007-05-03 17:10:28 +00:00
|
|
|
wxLogVerbose(wxT("=== begin rbutilFrm::OnRemoveBtn(event)"));
|
2006-12-11 21:25:37 +00:00
|
|
|
|
2007-07-16 10:18:20 +00:00
|
|
|
int index = GetDeviceId(true);
|
2007-05-27 22:44:22 +00:00
|
|
|
if(index < 0)
|
|
|
|
return;
|
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
// Rockbox deinstall dialog
|
2007-05-03 17:10:28 +00:00
|
|
|
rockboxDeInstallDlg dialog(NULL, wxID_ANY,
|
|
|
|
wxT("Rockbox Deinstallation"));
|
2007-05-05 16:55:04 +00:00
|
|
|
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;
|
|
|
|
|
2006-12-11 21:25:37 +00:00
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
if (Uninstall(gv->curdestdir, gv->curisfull) )
|
2006-12-11 21:25:37 +00:00
|
|
|
{
|
2007-05-05 16:55:04 +00:00
|
|
|
MESG_DIALOG(
|
|
|
|
wxT("The uninstallation wizard was cancelled or completed with "
|
|
|
|
"some errors.") );
|
|
|
|
} else {
|
|
|
|
wxMessageDialog* msg = new wxMessageDialog(this, wxT("The uninstall wizard completed successfully\n"
|
|
|
|
"Depending on which Device you own, you also have to uninstall the Bootloader")
|
|
|
|
,wxT("Uninstallation"), wxOK |wxICON_INFORMATION);
|
|
|
|
msg->ShowModal();
|
|
|
|
delete msg;
|
2006-12-11 21:25:37 +00:00
|
|
|
}
|
|
|
|
|
2007-03-15 14:02:37 +00:00
|
|
|
wxLogVerbose(wxT("=== end rbutilFrm::OnRemoveBtn"));
|
2006-12-11 21:25:37 +00:00
|
|
|
}
|
|
|
|
|
2006-12-13 21:11:24 +00:00
|
|
|
void rbutilFrm::OnPortableInstall(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
wxString src, dest, buf;
|
2007-03-15 14:02:37 +00:00
|
|
|
wxLogVerbose(wxT("=== begin rbutilFrm::OnPortableInstall(event)"));
|
2006-12-13 21:11:24 +00:00
|
|
|
wxFileSystem fs;
|
|
|
|
wxDateSpan oneday;
|
|
|
|
|
2007-07-16 10:18:20 +00:00
|
|
|
int index = GetDeviceId(true);
|
2007-05-27 22:44:22 +00:00
|
|
|
if(index < 0)
|
|
|
|
return;
|
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
//portable install dialog ( reused font dialog)
|
2007-05-03 17:10:28 +00:00
|
|
|
fontInstallDlg dialog(NULL, wxID_ANY,
|
|
|
|
wxT("Rockbox Utility Portable Installation"));
|
2007-05-05 16:55:04 +00:00
|
|
|
if (dialog.ShowModal() != wxID_OK)
|
|
|
|
return;
|
2006-12-13 21:11:24 +00:00
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
// 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 ( InstallRbutil(gv->curdestdir) )
|
2006-12-13 21:11:24 +00:00
|
|
|
{
|
2007-05-05 16:55:04 +00:00
|
|
|
MESG_DIALOG(wxT("The Rockbox Utility has been installed on your device."));
|
2007-05-03 17:10:28 +00:00
|
|
|
|
2007-05-05 16:55:04 +00:00
|
|
|
} else
|
|
|
|
{
|
|
|
|
ERR_DIALOG(wxT("Installation failed"), wxT("Portable Install"));
|
2006-12-13 21:11:24 +00:00
|
|
|
}
|
|
|
|
|
2007-03-15 14:02:37 +00:00
|
|
|
wxLogVerbose(wxT("=== end rbutilFrm::OnUnstallPortable"));
|
2006-12-13 21:11:24 +00:00
|
|
|
}
|
2006-12-11 21:25:37 +00:00
|
|
|
|
2007-07-15 18:15:59 +00:00
|
|
|
void rbutilFrm::OnTalkBtn(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
wxLogVerbose(wxT("=== begin rbutilFrm::OnTalkBtn(event)"));
|
|
|
|
|
|
|
|
TalkFileCreator talk;
|
|
|
|
|
|
|
|
talkInstallDlg dialog(&talk,NULL,wxID_ANY);
|
|
|
|
|
|
|
|
if (dialog.ShowModal() != wxID_OK)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// really install ?
|
|
|
|
wxMessageDialog msg(this,wxT("Do you really want to create Talkfiles ?"),wxT("Talk file creation"),wxOK|wxCANCEL);
|
|
|
|
if(msg.ShowModal() != wxID_OK )
|
|
|
|
return;
|
|
|
|
|
|
|
|
if(talk.createTalkFiles())
|
|
|
|
{
|
|
|
|
MESG_DIALOG(wxT("Talk files have been successfully created."));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ERR_DIALOG(wxT("Talkfile creation failed"), wxT("Talk file creation"));
|
|
|
|
}
|
|
|
|
|
|
|
|
wxLogVerbose(wxT("=== end rbutilFrm::OnTalkBtn"));
|
|
|
|
}
|
|
|
|
|
2007-07-16 10:18:20 +00:00
|
|
|
int rbutilFrm::GetDeviceId(bool detect)
|
2007-06-10 20:52:20 +00:00
|
|
|
{
|
|
|
|
int index = gv->plat_id.Index(gv->curplat);
|
2007-07-16 10:18:20 +00:00
|
|
|
if(index < 0 && detect)
|
2007-06-10 20:52:20 +00:00
|
|
|
{
|
|
|
|
if( wxMessageBox(wxT("No device selected. Do you want to autodetect "
|
|
|
|
"the device?"),
|
|
|
|
wxT("Warning"), wxYES_NO ) == wxYES )
|
|
|
|
{
|
|
|
|
myDeviceSelector->AutoDetect();
|
|
|
|
index = gv->plat_id.Index(gv->curplat);
|
|
|
|
if(index < 0)
|
|
|
|
{
|
|
|
|
WARN_DIALOG( wxT("Aborting"), wxT("Auto detection failed") );
|
|
|
|
return index;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if( wxMessageBox(wxT("Found ") + gv->plat_name[index] +
|
|
|
|
wxT(". Do you want to continue?"),
|
|
|
|
wxT("Device found"), wxYES_NO ) == wxYES )
|
|
|
|
return index;
|
|
|
|
else
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return index;
|
|
|
|
}
|
|
|
|
|
2006-12-11 21:25:37 +00:00
|
|
|
AboutDlg::AboutDlg(rbutilFrm* parent)
|
2007-03-15 14:02:37 +00:00
|
|
|
: wxDialog(parent, -1, wxT("About"), wxDefaultPosition, wxDefaultSize,
|
2006-12-11 21:25:37 +00:00
|
|
|
wxDEFAULT_DIALOG_STYLE)
|
|
|
|
{
|
|
|
|
wxBoxSizer* WxBoxSizer1 = new wxBoxSizer(wxVERTICAL);
|
|
|
|
this->SetSizer(WxBoxSizer1);
|
|
|
|
this->SetAutoLayout(TRUE);
|
|
|
|
|
2006-12-14 06:11:29 +00:00
|
|
|
wxBoxSizer* WxBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
|
|
|
|
wxBitmap WxBitmap1 = wxBitmap(rbutilFrm_XPM);
|
2006-12-11 21:25:37 +00:00
|
|
|
wxStaticBitmap* WxStaticBitmap1 = new wxStaticBitmap(this, wxID_ANY,
|
|
|
|
WxBitmap1);
|
2006-12-14 06:11:29 +00:00
|
|
|
WxBoxSizer2->Add(WxStaticBitmap1, 0, wxALL | wxCENTER, 5);
|
2006-12-11 21:25:37 +00:00
|
|
|
|
|
|
|
wxStaticText* WxStaticText1 = new wxStaticText(this, wxID_ANY,
|
2007-03-15 14:02:37 +00:00
|
|
|
wxT(RBUTIL_FULLNAME), wxDefaultPosition, wxDefaultSize,
|
2006-12-14 06:11:29 +00:00
|
|
|
wxALIGN_CENTER | wxST_NO_AUTORESIZE );
|
|
|
|
WxBoxSizer2->Add(WxStaticText1, 0, wxALL | wxCENTER, 5);
|
|
|
|
WxBoxSizer1->Add(WxBoxSizer2, 0, wxALL, 5);
|
|
|
|
|
|
|
|
wxStaticText* WxStaticText2 = new wxStaticText(this, wxID_ANY,
|
2007-03-15 14:02:37 +00:00
|
|
|
wxT(RBUTIL_VERSION "\n" RBUTIL_DESCRIPTION "\n\n" RBUTIL_COPYRIGHT));
|
2006-12-14 06:11:29 +00:00
|
|
|
WxStaticText2->Wrap(400);
|
|
|
|
WxBoxSizer1->Add(WxStaticText2, 0, wxALL, 5);
|
2006-12-11 21:25:37 +00:00
|
|
|
|
|
|
|
wxHyperlinkCtrl* WxHyperlink1 = new wxHyperlinkCtrl(this, wxID_ANY,
|
|
|
|
wxT(RBUTIL_WEBSITE), wxT(RBUTIL_WEBSITE) );
|
|
|
|
WxBoxSizer1->Add(WxHyperlink1, 0, wxALL, 5);
|
|
|
|
|
2007-03-15 14:02:37 +00:00
|
|
|
wxStaticBox* WxStaticBox1 = new wxStaticBox(this, wxID_ANY, wxT("Contributors:"));
|
2006-12-14 06:11:29 +00:00
|
|
|
wxStaticBoxSizer* WxStaticBoxSizer2 = new wxStaticBoxSizer(WxStaticBox1,
|
|
|
|
wxVERTICAL);
|
|
|
|
wxTextCtrl* WxTextCtrl1 = new wxTextCtrl(this, wxID_ANY, wxEmptyString,
|
|
|
|
wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY);
|
|
|
|
|
|
|
|
long i = 0;
|
2007-03-15 18:02:15 +00:00
|
|
|
while ( rbutil_developers[i] != wxT(""))
|
2006-12-14 06:11:29 +00:00
|
|
|
{
|
|
|
|
WxTextCtrl1->AppendText(rbutil_developers[i++]);
|
2007-03-15 14:02:37 +00:00
|
|
|
WxTextCtrl1->AppendText(wxT("\n"));
|
2006-12-14 06:11:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
WxBoxSizer1->Add(WxStaticBoxSizer2, 1, wxGROW | wxALL, 5);
|
|
|
|
WxStaticBoxSizer2->Add(WxTextCtrl1, 1, wxGROW | wxALL, 0);
|
|
|
|
|
2006-12-11 21:25:37 +00:00
|
|
|
wxStdDialogButtonSizer* WxStdDialogButtonSizer1 = new wxStdDialogButtonSizer();
|
|
|
|
wxButton* WxOKButton = new wxButton(this, wxID_OK);
|
|
|
|
WxStdDialogButtonSizer1->AddButton(WxOKButton);
|
|
|
|
WxStdDialogButtonSizer1->Realize();
|
|
|
|
|
|
|
|
WxBoxSizer1->Add(WxStdDialogButtonSizer1, 0, wxALL | wxCENTER, 5);
|
|
|
|
|
|
|
|
GetSizer()->Fit(this);
|
|
|
|
GetSizer()->SetSizeHints(this);
|
|
|
|
|
|
|
|
//this->Center();
|
|
|
|
this->Show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
AboutDlg::~AboutDlg()
|
|
|
|
{
|
|
|
|
}
|