mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 11:49:06 +00:00
Qt/NetPlay: Show feedback for index adding
This commit is contained in:
parent
d90d641ec7
commit
8b6bb39e82
6 changed files with 50 additions and 1 deletions
|
@ -142,6 +142,8 @@ void NetPlayIndex::NotificationLoop()
|
|||
if (!json)
|
||||
{
|
||||
m_last_error = "BAD_JSON";
|
||||
m_secret.clear();
|
||||
m_error_callback();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -150,6 +152,8 @@ void NetPlayIndex::NotificationLoop()
|
|||
if (status != "OK")
|
||||
{
|
||||
m_last_error = std::move(status);
|
||||
m_secret.clear();
|
||||
m_error_callback();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -318,3 +322,13 @@ const std::string& NetPlayIndex::GetLastError() const
|
|||
{
|
||||
return m_last_error;
|
||||
}
|
||||
|
||||
bool NetPlayIndex::HasActiveSession() const
|
||||
{
|
||||
return !m_secret.empty();
|
||||
}
|
||||
|
||||
void NetPlayIndex::SetErrorCallback(std::function<void()> function)
|
||||
{
|
||||
m_error_callback = function;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue