DolphinWX: show simple message about scanning in statusbar.

This commit is contained in:
Shawn Hoffman 2017-06-22 00:53:02 -07:00
parent c5fa470ad8
commit a66b747366
6 changed files with 22 additions and 13 deletions

View File

@ -337,7 +337,8 @@ CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, wxRect geo
wxFrame::CreateToolBar(wxTB_DEFAULT_STYLE | wxTB_TEXT | wxTB_FLAT)->Realize();
// Give it a status bar
SetStatusBar(CreateStatusBar(2, wxST_SIZEGRIP, ID_STATUSBAR));
SetStatusBar(
CreateStatusBar(2, wxSTB_SIZEGRIP | wxSTB_ELLIPSIZE_END | wxSTB_SHOW_TIPS, ID_STATUSBAR));
if (!SConfig::GetInstance().m_InterfaceStatusbar)
GetStatusBar()->Hide();

View File

@ -102,7 +102,7 @@ public:
void GameListRescan();
void ToggleLogWindow(bool bShow);
void ToggleLogConfigWindow(bool bShow);
void StatusBarMessage(const char* Text, ...);
void StatusBarMessage(const char* format, ...);
void ClearStatusBar();
void BootGame(const std::string& filename);
bool RendererHasFocus();

View File

@ -511,8 +511,7 @@ void CFrame::OnPerspectiveMenu(wxCommandEvent& event)
return;
}
SaveIniPerspectives();
GetStatusBar()->SetStatusText(
StrToWxStr(std::string("Saved " + m_perspectives[m_active_perspective].name)), 0);
StatusBarMessage("Saved %s", m_perspectives[m_active_perspective].name.c_str());
break;
case IDM_PERSPECTIVES_ADD_PANE_TOP:
AddPane(ADD_PANE_TOP);

View File

@ -1133,18 +1133,16 @@ void CFrame::ClearStatusBar()
}
}
void CFrame::StatusBarMessage(const char* Text, ...)
void CFrame::StatusBarMessage(const char* format, ...)
{
const int MAX_BYTES = 1024 * 10;
char Str[MAX_BYTES];
va_list ArgPtr;
va_start(ArgPtr, Text);
vsnprintf(Str, MAX_BYTES, Text, ArgPtr);
va_end(ArgPtr);
va_list args;
va_start(args, format);
std::string msg = StringFromFormatV(format, args);
va_end(args);
if (this->GetStatusBar()->IsEnabled())
{
this->GetStatusBar()->SetStatusText(StrToWxStr(Str), 0);
this->GetStatusBar()->SetStatusText(StrToWxStr(msg), 0);
}
}

View File

@ -740,6 +740,15 @@ bool GameListCtrl::SyncCacheFile(bool write)
void GameListCtrl::RescanList()
{
auto post_status = [&](const wxString& status) {
auto event = new wxCommandEvent(wxEVT_HOST_COMMAND, IDM_UPDATE_STATUS_BAR);
event->SetInt(0);
event->SetString(status);
QueueEvent(event);
};
post_status(_("Scanning..."));
const std::vector<std::string> search_extensions = {".gcm", ".tgc", ".iso", ".ciso", ".gcz",
".wbfs", ".wad", ".dol", ".elf"};
// TODO This could process paths iteratively as they are found
@ -783,6 +792,8 @@ void GameListCtrl::RescanList()
// Post UI event to update the displayed list
QueueEvent(new wxCommandEvent(DOLPHIN_EVT_REFRESH_GAMELIST));
post_status(_("Scan complete!"));
SyncCacheFile(true);
}

View File

@ -478,7 +478,7 @@ void Host_SetWiiMoteConnectionState(int _State)
event.SetString(_("Wii Remote Connected"));
break;
}
// Update field 1 or 2
// The second field is used for auxiliary info such as this
event.SetInt(1);
NOTICE_LOG(WIIMOTE, "%s", static_cast<const char*>(event.GetString().c_str()));