diff options
| author | Lioncash <mathew1800@gmail.com> | 2014-11-11 21:19:24 -0500 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2014-11-11 21:19:24 -0500 |
| commit | 5a89ba20d75b17b1aeec090544934b95bdb0ec74 (patch) | |
| tree | 4e0be3beb0b43b2a53d748d65dbe68ba31abb105 /Source | |
| parent | 1095d3fc333ce3d0bea104e4b9226eb4421cc651 (diff) | |
| parent | ec82f02580245548e41036666970be9c6977a046 (diff) | |
Merge pull request #1528 from lioncash/netplay
Small Netplay dialog cleanups.
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/DolphinWX/NetWindow.cpp | 20 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/NetWindow.h | 4 |
2 files changed, 9 insertions, 15 deletions
diff --git a/Source/Core/DolphinWX/NetWindow.cpp b/Source/Core/DolphinWX/NetWindow.cpp index bd959a59e7..e925b19dc5 100644 --- a/Source/Core/DolphinWX/NetWindow.cpp +++ b/Source/Core/DolphinWX/NetWindow.cpp @@ -47,13 +47,8 @@ #include "DolphinWX/NetWindow.h" #include "DolphinWX/WxUtils.h" -#define NETPLAY_TITLEBAR "Dolphin NetPlay" #define INITIAL_PAD_BUFFER_SIZE 5 -BEGIN_EVENT_TABLE(NetPlayDiag, wxFrame) - EVT_COMMAND(wxID_ANY, wxEVT_THREAD, NetPlayDiag::OnThread) -END_EVENT_TABLE() - static NetPlayServer* netplay_server = nullptr; static NetPlayClient* netplay_client = nullptr; NetPlayDiag *NetPlayDiag::npd = nullptr; @@ -78,7 +73,7 @@ static void FillWithGameNames(wxListBox* game_lbox, const CGameListCtrl& game_li } NetPlaySetupDiag::NetPlaySetupDiag(wxWindow* const parent, const CGameListCtrl* const game_list) - : wxFrame(parent, wxID_ANY, NETPLAY_TITLEBAR) + : wxFrame(parent, wxID_ANY, _("Dolphin NetPlay Setup")) , m_game_list(game_list) { IniFile inifile; @@ -305,11 +300,13 @@ void NetPlaySetupDiag::OnQuit(wxCommandEvent&) NetPlayDiag::NetPlayDiag(wxWindow* const parent, const CGameListCtrl* const game_list, const std::string& game, const bool is_hosting) - : wxFrame(parent, wxID_ANY, NETPLAY_TITLEBAR) + : wxFrame(parent, wxID_ANY, _("Dolphin NetPlay")) , m_selected_game(game) , m_start_btn(nullptr) , m_game_list(game_list) { + Bind(wxEVT_THREAD, &NetPlayDiag::OnThread, this); + wxPanel* const panel = new wxPanel(this); // top crap @@ -428,9 +425,6 @@ void NetPlayDiag::OnChat(wxCommandEvent&) if (!text.empty()) { - if (text.length() > 2000) - text.erase(2000); - netplay_client->SendChatMessage(WxStrToStr(text)); m_chat_text->AppendText(text.Prepend(" >> ").Append('\n')); m_chat_msg_text->Clear(); @@ -535,7 +529,7 @@ void NetPlayDiag::OnQuit(wxCommandEvent&) } // update gui -void NetPlayDiag::OnThread(wxCommandEvent& event) +void NetPlayDiag::OnThread(wxThreadEvent& event) { // player list m_playerids.clear(); @@ -583,7 +577,9 @@ void NetPlayDiag::OnThread(wxCommandEvent& event) // update selected game :/ { m_selected_game.assign(WxStrToStr(event.GetString())); - m_game_btn->SetLabel(event.GetString().Prepend(_(" Game : "))); + + wxString button_label = event.GetString(); + m_game_btn->SetLabel(button_label.Prepend(_(" Game : "))); } break; case NP_GUI_EVT_START_GAME : diff --git a/Source/Core/DolphinWX/NetWindow.h b/Source/Core/DolphinWX/NetWindow.h index a0ea37e47d..90d0dbd8c4 100644 --- a/Source/Core/DolphinWX/NetWindow.h +++ b/Source/Core/DolphinWX/NetWindow.h @@ -82,11 +82,9 @@ public: bool IsRecording() override; private: - DECLARE_EVENT_TABLE() - void OnChat(wxCommandEvent& event); void OnQuit(wxCommandEvent& event); - void OnThread(wxCommandEvent& event); + void OnThread(wxThreadEvent& event); void OnChangeGame(wxCommandEvent& event); void OnAdjustBuffer(wxCommandEvent& event); void OnConfigPads(wxCommandEvent& event); |
