Adds the option to change the path to the wii nand root

when nand root is changed the current sysconf is saved,
and the sysconf in the new location is either loaded (if exists)
or the default sysconf is created
wii menu item is updated when the root changes
small fix to saving gamelist paths to .ini paths that are removed from the gui are now removed from the ini instead of simply changing the number of paths

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7555 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
LPFaint99
2011-05-24 19:12:18 +00:00
parent 139a518e99
commit e4fa493a27
11 changed files with 112 additions and 44 deletions

View File

@ -179,6 +179,7 @@ EVT_BUTTON(ID_REMOVEISOPATH, CConfigMain::AddRemoveISOPaths)
EVT_FILEPICKER_CHANGED(ID_DEFAULTISO, CConfigMain::DefaultISOChanged)
EVT_DIRPICKER_CHANGED(ID_DVDROOT, CConfigMain::DVDRootChanged)
EVT_FILEPICKER_CHANGED(ID_APPLOADERPATH, CConfigMain::ApploaderPathChanged)
EVT_DIRPICKER_CHANGED(ID_NANDROOT, CConfigMain::NANDRootChanged)
EVT_CHOICE(ID_GRAPHIC_CB, CConfigMain::OnSelectionChanged)
@ -530,6 +531,7 @@ void CConfigMain::InitializeGUIValues()
DefaultISO->SetPath(wxString(startup_params.m_strDefaultGCM.c_str(), *wxConvCurrent));
DVDRoot->SetPath(wxString(startup_params.m_strDVDRoot.c_str(), *wxConvCurrent));
ApploaderPath->SetPath(wxString(startup_params.m_strApploader.c_str(), *wxConvCurrent));
NANDRoot->SetPath(wxString(SConfig::GetInstance().m_NANDPath.c_str(), *wxConvCurrent));
// video backend list
for (std::vector<VideoBackend*>::const_iterator it = g_available_video_backends.begin(); it != g_available_video_backends.end(); ++it)
@ -900,6 +902,7 @@ void CConfigMain::CreateGUIControls()
ApploaderPath = new wxFilePickerCtrl(PathsPage, ID_APPLOADERPATH, wxEmptyString, _("Choose file to use as apploader: (applies to discs constructed from directories only)"),
_("apploader (.img)") + wxString::Format(wxT("|*.img|%s"), wxGetTranslation(wxALL_FILES)),
wxDefaultPosition, wxDefaultSize, wxFLP_USE_TEXTCTRL|wxFLP_OPEN);
NANDRoot = new wxDirPickerCtrl(PathsPage, ID_NANDROOT, wxEmptyString, _("Choose a NAND root directory:"), wxDefaultPosition, wxDefaultSize, wxDIRP_USE_TEXTCTRL);
// Populate the settings
wxBoxSizer* sISOButtons = new wxBoxSizer(wxHORIZONTAL);
@ -921,6 +924,9 @@ void CConfigMain::CreateGUIControls()
sOtherPaths->Add(TEXT_BOX(PathsPage, _("Apploader:")),
wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5);
sOtherPaths->Add(ApploaderPath, wxGBPosition(2, 1), wxDefaultSpan, wxEXPAND|wxALL, 5);
sOtherPaths->Add(TEXT_BOX(PathsPage, _("Wii NAND Root:")),
wxGBPosition(3, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALL, 5);
sOtherPaths->Add(NANDRoot, wxGBPosition(3, 1), wxDefaultSpan, wxEXPAND|wxALL, 5);
sOtherPaths->AddGrowableCol(1);
// Populate the Paths page
@ -1376,6 +1382,14 @@ void CConfigMain::ApploaderPathChanged(wxFileDirPickerEvent& WXUNUSED (event))
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strApploader = ApploaderPath->GetPath().mb_str();
}
void CConfigMain::NANDRootChanged(wxFileDirPickerEvent& WXUNUSED (event))
{
std::string NANDPath =
SConfig::GetInstance().m_NANDPath = File::GetUserPath(D_WIIROOT_IDX, std::string(NANDRoot->GetPath().mb_str()));
NANDRoot->SetPath(wxString(NANDPath.c_str(), *wxConvCurrent));
SConfig::GetInstance().m_SYSCONF->UpdateLocation();
main_frame->UpdateWiiMenuChoice();
}
// GFX backend selection
void CConfigMain::OnSelectionChanged(wxCommandEvent& ev)

View File

@ -137,6 +137,7 @@ private:
ID_DEFAULTISO,
ID_DVDROOT,
ID_APPLOADERPATH,
ID_NANDROOT,
ID_GRAPHIC_CB,
@ -244,10 +245,11 @@ private:
wxButton* AddISOPath;
wxButton* RemoveISOPath;
// DefaultISO, DVD Root, Apploader
// DefaultISO, DVD Root, Apploader, NANDPath
wxFilePickerCtrl* DefaultISO;
wxDirPickerCtrl* DVDRoot;
wxFilePickerCtrl* ApploaderPath;
wxDirPickerCtrl* NANDRoot;
// Graphics
wxChoice* GraphicSelection;
@ -301,6 +303,7 @@ private:
void DefaultISOChanged(wxFileDirPickerEvent& event);
void DVDRootChanged(wxFileDirPickerEvent& event);
void ApploaderPathChanged(wxFileDirPickerEvent& WXUNUSED (event));
void NANDRootChanged(wxFileDirPickerEvent& event);
private:
DECLARE_EVENT_TABLE();

View File

@ -139,6 +139,7 @@ public:
bool RendererHasFocus();
void DoFullscreen(bool bF);
void ToggleDisplayMode (bool bFullscreen);
void UpdateWiiMenuChoice(wxMenuItem *WiiMenuItem=NULL);
static void ConnectWiimote(int wm_idx, bool connect);
const CGameListCtrl *GetGameListCtrl() const;

View File

@ -134,7 +134,7 @@ void CFrame::CreateMenu()
emulationMenu->Append(IDM_STOP, GetMenuLabel(HK_STOP));
emulationMenu->Append(IDM_RESET, GetMenuLabel(HK_RESET));
emulationMenu->AppendSeparator();
emulationMenu->Append(IDM_TOGGLE_FULLSCREEN, GetMenuLabel(HK_FULLSCREEN));
emulationMenu->Append(IDM_TOGGLE_FULLSCREEN, GetMenuLabel(HK_FULLSCREEN));
emulationMenu->AppendSeparator();
emulationMenu->Append(IDM_RECORD, GetMenuLabel(HK_START_RECORDING));
emulationMenu->Append(IDM_PLAYRECORD, GetMenuLabel(HK_PLAY_RECORDING));
@ -192,7 +192,7 @@ void CFrame::CreateMenu()
if (g_pCodeWindow)
{
pOptionsMenu->AppendSeparator();
g_pCodeWindow->CreateMenuOptions(pOptionsMenu);
g_pCodeWindow->CreateMenuOptions(pOptionsMenu);
}
m_MenuBar->Append(pOptionsMenu, _("&Options"));
@ -205,20 +205,7 @@ void CFrame::CreateMenu()
toolsMenu->Append(IDM_NETPLAY, _("Start &NetPlay"));
toolsMenu->Append(IDM_MENU_INSTALLWAD, _("Install WAD"));
const DiscIO::INANDContentLoader & SysMenu_Loader = DiscIO::CNANDContentManager::Access().GetNANDLoader(TITLEID_SYSMENU, true);
if (SysMenu_Loader.IsValid())
{
int sysmenuVersion = SysMenu_Loader.GetTitleVersion();
char sysmenuRegion = SysMenu_Loader.GetCountryChar();
toolsMenu->Append(IDM_LOAD_WII_MENU, wxString::Format(_("Load Wii System Menu %d%c"), sysmenuVersion, sysmenuRegion));
}
else
{
toolsMenu->Append(IDM_LOAD_WII_MENU, _("Load Wii System Menu"));
toolsMenu->Enable(IDM_LOAD_WII_MENU, false);
}
UpdateWiiMenuChoice(toolsMenu->Append(IDM_LOAD_WII_MENU));
toolsMenu->Append(IDM_FIFOPLAYER, _("Fifo Player"));
@ -305,7 +292,7 @@ void CFrame::CreateMenu()
viewMenu->AppendCheckItem(IDM_LISTDRIVES, _("Show Drives"));
viewMenu->Check(IDM_LISTDRIVES, SConfig::GetInstance().m_ListDrives);
viewMenu->Append(IDM_PURGECACHE, _("Purge Cache"));
m_MenuBar->Append(viewMenu, _("&View"));
m_MenuBar->Append(viewMenu, _("&View"));
if (g_pCodeWindow) g_pCodeWindow->CreateMenu(SConfig::GetInstance().m_LocalCoreStartupParameter, m_MenuBar);
@ -471,7 +458,7 @@ void CFrame::PopulateToolbarAui(wxAuiToolBar* ToolBar)
ToolBar->AddTool(IDM_EDIT_PERSPECTIVES, _("Edit"), g_pCodeWindow->m_Bitmaps[Toolbar_GotoPC], _("Edit current perspective"));
ToolBar->SetToolDropDown(IDM_SAVE_PERSPECTIVE, true);
ToolBar->SetToolDropDown(IDM_EDIT_PERSPECTIVES, true);
ToolBar->SetToolDropDown(IDM_EDIT_PERSPECTIVES, true);
ToolBar->Realize();
}
@ -1374,19 +1361,30 @@ void CFrame::OnInstallWAD(wxCommandEvent& event)
u64 titleID = DiscIO::CNANDContentManager::Access().Install_WiiWAD(fileName);
if (titleID == TITLEID_SYSMENU)
{
const DiscIO::INANDContentLoader & SysMenu_Loader = DiscIO::CNANDContentManager::Access().GetNANDLoader(TITLEID_SYSMENU, true);
if (SysMenu_Loader.IsValid())
{
int sysmenuVersion = SysMenu_Loader.GetTitleVersion();
char sysmenuRegion = SysMenu_Loader.GetCountryChar();
UpdateWiiMenuChoice();
}
}
GetMenuBar()->FindItem(IDM_LOAD_WII_MENU)->Enable();
GetMenuBar()->FindItem(IDM_LOAD_WII_MENU)->SetItemLabel(wxString::Format(_("Load Wii System Menu %d%c"), sysmenuVersion, sysmenuRegion));
}
else
{
GetMenuBar()->FindItem(IDM_LOAD_WII_MENU)->Enable(false);
}
void CFrame::UpdateWiiMenuChoice(wxMenuItem *WiiMenuItem)
{
if (!WiiMenuItem)
{
WiiMenuItem = GetMenuBar()->FindItem(IDM_LOAD_WII_MENU);
}
const DiscIO::INANDContentLoader & SysMenu_Loader = DiscIO::CNANDContentManager::Access().GetNANDLoader(TITLEID_SYSMENU, true);
if (SysMenu_Loader.IsValid())
{
int sysmenuVersion = SysMenu_Loader.GetTitleVersion();
char sysmenuRegion = SysMenu_Loader.GetCountryChar();
WiiMenuItem->Enable();
WiiMenuItem->SetItemLabel(wxString::Format(_("Load Wii System Menu %d%c"), sysmenuVersion, sysmenuRegion));
}
else
{
WiiMenuItem->Enable(false);
WiiMenuItem->SetItemLabel(_("Load Wii System Menu"));
}
}
@ -1602,7 +1600,7 @@ void CFrame::UpdateGUI()
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM.empty())
{
if (m_ToolBar)
m_ToolBar->EnableTool(IDM_PLAY, true);
m_ToolBar->EnableTool(IDM_PLAY, true);
GetMenuBar()->FindItem(IDM_PLAY)->Enable(true);
}
// Prepare to load last selected file, enable play button
@ -1610,7 +1608,7 @@ void CFrame::UpdateGUI()
&& wxFileExists(wxString(SConfig::GetInstance().m_LastFilename.c_str(), wxConvUTF8)))
{
if (m_ToolBar)
m_ToolBar->EnableTool(IDM_PLAY, true);
m_ToolBar->EnableTool(IDM_PLAY, true);
GetMenuBar()->FindItem(IDM_PLAY)->Enable(true);
}
else
@ -1635,7 +1633,7 @@ void CFrame::UpdateGUI()
{
if (m_ToolBar)
m_ToolBar->EnableTool(IDM_PLAY, true);
GetMenuBar()->FindItem(IDM_PLAY)->Enable(true);
GetMenuBar()->FindItem(IDM_PLAY)->Enable(true);
}
}
}