Core: Move the titlebar / statusbar abstraction to DolphinWX

The concept of a "title bar" / "status bar" shouldn't be a core concept,
so remove the Host_UpdateStatusBar function, and move the code handles
whether to update the status bar or titlebar into DolphinWX.
This commit is contained in:
Jasper St. Pierre 2014-08-19 10:17:33 -04:00
parent 3bad4bcfdb
commit 6dbafa9238
7 changed files with 18 additions and 29 deletions

View File

@ -682,7 +682,6 @@ void UpdateTitle()
}
// This is our final "frame counter" string
std::string SMessage = StringFromFormat("%s | %s", SSettings.c_str(), SFPS.c_str());
std::string TMessage = StringFromFormat("%s | %s", scm_rev_str, SMessage.c_str());
// Update the audio timestretcher with the current speed
if (soundStream)
@ -691,16 +690,7 @@ void UpdateTitle()
pMixer->UpdateSpeed((float)Speed / 100);
}
if (_CoreParameter.bRenderToMain &&
SConfig::GetInstance().m_InterfaceStatusbar)
{
Host_UpdateStatusBar(SMessage);
Host_UpdateTitle(scm_rev_str);
}
else
{
Host_UpdateTitle(TMessage);
}
Host_UpdateTitle(SMessage);
}
void Shutdown()

View File

@ -37,7 +37,6 @@ void Host_SetWiiMoteConnectionState(int _State);
void Host_SysMessage(const char *fmt, ...);
void Host_UpdateDisasmDialog();
void Host_UpdateMainFrame();
void Host_UpdateStatusBar(const std::string& text, int Filed = 0);
void Host_UpdateTitle(const std::string& title);
void Host_ShowVideoConfig(void* parent, const std::string& backend_name,
const std::string& config_name);

View File

@ -628,6 +628,21 @@ WXLRESULT CFrame::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
}
#endif
void CFrame::UpdateTitle(const std::string &str)
{
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain &&
SConfig::GetInstance().m_InterfaceStatusbar)
{
GetStatusBar()->SetStatusText(str, 0);
m_RenderFrame->SetTitle(scm_rev_str);
}
else
{
std::string titleStr = StringFromFormat("%s | %s", scm_rev_str, str.c_str());
m_RenderFrame->SetTitle(titleStr);
}
}
void CFrame::OnHostMessage(wxCommandEvent& event)
{
switch (event.GetId())
@ -642,8 +657,7 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
break;
case IDM_UPDATETITLE:
if (m_RenderFrame != nullptr)
m_RenderFrame->SetTitle(event.GetString());
SetTitle(event.GetString());
break;
case IDM_WINDOWSIZEREQUEST:

View File

@ -126,6 +126,7 @@ public:
void UpdateWiiMenuChoice(wxMenuItem *WiiMenuItem=nullptr);
void PopulateSavedPerspectives();
static void ConnectWiimote(int wm_idx, bool connect);
void UpdateTitle(const std::string &str);
const CGameListCtrl *GetGameListCtrl() const;

View File

@ -607,17 +607,6 @@ void Host_SetStartupDebuggingParameters()
StartUp.bEnableDebugging = main_frame->g_pCodeWindow ? true : false; // RUNNING_DEBUG
}
void Host_UpdateStatusBar(const std::string& text, int Field)
{
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATESTATUSBAR);
// Set the event string
event.SetString(StrToWxStr(text));
// Update statusbar field
event.SetInt(Field);
// Post message
main_frame->GetEventHandler()->AddPendingEvent(event);
}
void Host_SetWiiMoteConnectionState(int _State)
{
static int currentState = -1;

View File

@ -104,8 +104,6 @@ bool Host_RendererHasFocus()
void Host_ConnectWiimote(int wm_idx, bool connect) {}
void Host_UpdateStatusBar(const std::string& text, int filed){}
void Host_SysMessage(const char *fmt, ...)
{
va_list args;

View File

@ -102,8 +102,6 @@ bool Host_RendererHasFocus()
void Host_ConnectWiimote(int wm_idx, bool connect) {}
void Host_UpdateStatusBar(const std::string& text, int filed){}
void Host_SysMessage(const char *fmt, ...)
{
va_list list;