integrated Manual for rbutil

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13329 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Wenger 2007-05-05 18:28:18 +00:00
parent e9f08dc193
commit 5e7b140a09
8 changed files with 95 additions and 25 deletions

View file

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

View file

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

View file

@ -57,6 +57,8 @@
#include <wx/regex.h>
#include <wx/tokenzr.h>
#include <wx/notebook.h>
#include <wx/html/htmlwin.h>
#include <wx/hyperlink.h>
#ifdef __WXMSW__
#define PATH_SEP "\\"
@ -104,6 +106,7 @@ public:
wxString prog_name;
wxString bootloader_url;
wxString themes_url;
wxString manual_url;
// User configuration data.
wxString curplat;

View file

@ -8,6 +8,7 @@ last_release=2.5
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-
[platforms]
platform1=player

View file

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

View file

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

View file

@ -51,6 +51,9 @@ 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_UPDATE_UI (ID_MANUAL, rbutilFrm::OnManualUpdate)
END_EVENT_TABLE()
rbutilFrm::rbutilFrm( wxWindow *parent, wxWindowID id, const wxString &title,
@ -78,24 +81,26 @@ void rbutilFrm::CreateGUIControls(void)
mainPanel->SetSizer(WxBoxSizer0);
mainPanel->SetAutoLayout(TRUE);
wxBitmap rockboxbmp(rblogo_xpm);
ImageCtrl* rockboxbmpCtrl = new ImageCtrl(mainPanel,wxID_ANY);
rockboxbmpCtrl->SetBitmap(rockboxbmp);
WxBoxSizer0->Add(rockboxbmpCtrl,0,wxALIGN_CENTER_HORIZONTAL | wxALL,5);
wxBitmap rockboxbmp(rblogo_xpm);
ImageCtrl* rockboxbmpCtrl = new ImageCtrl(mainPanel,wxID_ANY);
rockboxbmpCtrl->SetBitmap(rockboxbmp);
WxBoxSizer0->Add(rockboxbmpCtrl,0,wxALIGN_CENTER_HORIZONTAL | wxALL,5);
myDeviceSelector = new DeviceSelectorCtrl(mainPanel,wxID_ANY);
myDeviceSelector->setDefault();
WxBoxSizer0->Add(myDeviceSelector,0,wxALL,5);
wxNotebook* tabwindow = new wxNotebook(mainPanel,wxID_ANY);
WxBoxSizer0->Add(tabwindow,0,wxALL,5);
wxNotebook* tabwindow = new wxNotebook(mainPanel,wxID_ANY);
WxBoxSizer0->Add(tabwindow,0,wxALL,5);
wxPanel* installpage = new wxPanel(tabwindow,wxID_ANY);
wxPanel* themepage = new wxPanel(tabwindow,wxID_ANY);
wxPanel* uninstallpage = new wxPanel(tabwindow,wxID_ANY);
tabwindow->AddPage(installpage,wxT("Installation"),true);
tabwindow->AddPage(themepage,wxT("Themes"));
tabwindow->AddPage(uninstallpage,wxT("Uninstallation"));
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);
tabwindow->AddPage(themepage,wxT("Themes"));
tabwindow->AddPage(uninstallpage,wxT("Uninstallation"));
tabwindow->AddPage(manualpage,wxT("Manual"));
/*********************
Install Page
@ -114,16 +119,16 @@ void rbutilFrm::CreateGUIControls(void)
wxFlexGridSizer* WxFlexGridSizer1 = new wxFlexGridSizer(2,2,0,0);
WxStaticBoxSizer3->Add(WxFlexGridSizer1,0,wxGROW | wxALL,0);
wxBitmap BootloaderInstallButton (tools2_3d_xpm);
WxBitmapButton4 = new wxBitmapButton(installpage, ID_BOOTLOADER_BTN,
wxBitmap BootloaderInstallButton (tools2_3d_xpm);
WxBitmapButton4 = new wxBitmapButton(installpage, ID_BOOTLOADER_BTN,
BootloaderInstallButton, wxPoint(0,0), wxSize(64,54),
wxRAISED_BORDER | wxBU_AUTODRAW);
WxBitmapButton4->SetToolTip(wxT("Instructions for installing the "
WxBitmapButton4->SetToolTip(wxT("Instructions for installing the "
"Rockbox bootloader on your audio device"));
WxFlexGridSizer1->Add(WxBitmapButton4, 0,
WxFlexGridSizer1->Add(WxBitmapButton4, 0,
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
wxStaticText* WxStaticText5 = new wxStaticText(installpage, wxID_ANY,
wxStaticText* WxStaticText5 = new wxStaticText(installpage, wxID_ANY,
wxT("Bootloader installation instructions\n\n"
"Before Rockbox can be installed on your audio player, you "
"may have to\ninstall a bootloader. This can not currently "
@ -239,6 +244,26 @@ void rbutilFrm::CreateGUIControls(void)
WxFlexGridSizer3->Add(WxStaticText4,0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
/*****************
* 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
**********/
WxMenuBar1 = new wxMenuBar();
wxMenu *ID_FILE_MENU_Mnu_Obj = new wxMenu(0);
WxMenuBar1->Append(ID_FILE_MENU_Mnu_Obj, wxT("&File"));
@ -274,6 +299,32 @@ 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 == curManualDevice)
return;
curManualDevice = tmp;
// construct link to pdf
wxString pdflink;
pdflink.Printf(wxT("%s%s.pdf"),gv->manual_url.c_str(),curManualDevice.c_str());
manuallink->SetURL(pdflink);
// 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);
}
void rbutilFrm::rbutilFrmClose(wxCloseEvent& event)
{
wxLogVerbose(wxT("=== begin rbutilFrm::rbutilFrmClose(event)"));

View file

@ -57,7 +57,11 @@ public:
virtual ~rbutilFrm();
public:
DeviceSelectorCtrl* myDeviceSelector;
wxMenuBar *WxMenuBar1;
wxHyperlinkCtrl* manuallink;
wxHtmlWindow* manual;
wxString curManualDevice;
wxMenuBar *WxMenuBar1;
wxStaticText *WxStaticText3;
wxBitmapButton *WxBitmapButton2;
wxStaticText *WxStaticText2;
@ -92,6 +96,8 @@ public:
ID_BOOTLOADER_BTN = 1129,
ID_WXPANEL1 = 1064,
ID_MANUAL = 1065,
ID_DUMMY_VALUE_
}; //End of Enum
public:
@ -108,7 +114,9 @@ public:
void OnBootloaderBtn(wxCommandEvent& event);
void OnPortableInstall(wxCommandEvent& event);
void OnBootloaderRemoveBtn(wxCommandEvent& event);
void OnManualUpdate(wxUpdateUIEvent& event);
};
#endif