dolphin/Source/Core/DolphinQt2/Host.cpp
Léo Lam 91f8283a1d Remove Wii Remote connection status from status bar
Showing the Wii remote connection status leads to inconsistent UX,
because we don't do anything like that for GameCube controllers
or with Bluetooth passthrough.

It's also questionable how useful it is given that:

* it doesn't print the number of connected remotes, just that one
  remote is connected, connecting or not connected, so the only info
  it provides is actually wrong when using multiple remotes;

* this user-facing feature is actually broken in master and no one has
  complained AFAIK, which means people don't really rely on it;

* the status bar isn't visible most of the time unless the user is
  using render to main or deliberately keeping the main window's
  status bar visible by moving the render window and they're not too
  far away from their screen;

* emulated Wii remotes now reconnect on input, which means that there
  is less of a need to actually know at all times whether a remote
  is connected, since pressing any button will reconnect it and provide
  immediate, visible feedback via OSD messages and the Wii remote
  pointer appearing.
2017-07-15 13:01:56 +08:00

116 lines
2.1 KiB
C++

// Copyright 2015 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#include <QAbstractEventDispatcher>
#include <QApplication>
#include "Common/Common.h"
#include "Core/Host.h"
#include "DolphinQt2/Host.h"
Host::Host() = default;
Host* Host::GetInstance()
{
static Host* s_instance = new Host();
return s_instance;
}
void* Host::GetRenderHandle()
{
return m_render_handle;
}
void Host::SetRenderHandle(void* handle)
{
m_render_handle = handle;
}
bool Host::GetRenderFocus()
{
return m_render_focus;
}
void Host::SetRenderFocus(bool focus)
{
m_render_focus = focus;
}
bool Host::GetRenderFullscreen()
{
return m_render_fullscreen;
}
void Host::SetRenderFullscreen(bool fullscreen)
{
m_render_fullscreen = fullscreen;
}
void Host_Message(int id)
{
if (id == WM_USER_STOP)
{
emit Host::GetInstance()->RequestStop();
}
else if (id == WM_USER_JOB_DISPATCH)
{
// Just poke the main thread to get it to wake up, job dispatch
// will happen automatically before it goes back to sleep again.
QAbstractEventDispatcher::instance(qApp->thread())->wakeUp();
}
}
void Host_UpdateTitle(const std::string& title)
{
emit Host::GetInstance()->RequestTitle(QString::fromStdString(title));
}
void* Host_GetRenderHandle()
{
return Host::GetInstance()->GetRenderHandle();
}
bool Host_RendererHasFocus()
{
return Host::GetInstance()->GetRenderFocus();
}
bool Host_RendererIsFullscreen()
{
return Host::GetInstance()->GetRenderFullscreen();
}
void Host_YieldToUI()
{
qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
}
// We ignore these, and their purpose should be questioned individually.
// In particular, RequestRenderWindowSize, RequestFullscreen, and
// UpdateMainFrame should almost certainly be removed.
void Host_UpdateMainFrame()
{
}
void Host_RequestRenderWindowSize(int w, int h)
{
}
bool Host_UINeedsControllerState()
{
return false;
}
void Host_NotifyMapLoaded()
{
}
void Host_UpdateDisasmDialog()
{
}
void Host_ConnectWiimote(int wm_idx, bool connect)
{
}
void Host_ShowVideoConfig(void* parent, const std::string& backend_name)
{
}
void Host_RefreshDSPDebuggerWindow()
{
}