summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorspycrab <spycrab@users.noreply.github.com>2018-05-10 19:26:42 +0200
committerspycrab <spycrab@users.noreply.github.com>2018-05-10 20:51:12 +0200
commit6ea2b2e7e5f366374ecf2ab5a82a48e5903b7c00 (patch)
tree46c6c9229f4a15928be838bd5aebb09c543d7a51 /Source/Core
parent7550389c72433acc071ae101bc813c86f9670abb (diff)
Qt/NetPlayDialog: Fix duplicate messages
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp10
-rw-r--r--Source/Core/DolphinQt2/NetPlay/NetPlayDialog.h1
2 files changed, 9 insertions, 2 deletions
diff --git a/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp b/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp
index c8e48d14ab..9302e20b2a 100644
--- a/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp
+++ b/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp
@@ -18,7 +18,7 @@
#include <QProgressDialog>
#include <QPushButton>
#include <QSpinBox>
-#include <QTextEdit>
+#include <QTextBrowser>
#include <sstream>
@@ -96,7 +96,7 @@ void NetPlayDialog::CreateMainLayout()
void NetPlayDialog::CreateChatLayout()
{
m_chat_box = new QGroupBox(tr("Chat"));
- m_chat_edit = new QTextEdit;
+ m_chat_edit = new QTextBrowser;
m_chat_type_edit = new QLineEdit;
m_chat_send_button = new QPushButton(tr("Send"));
@@ -170,6 +170,9 @@ void NetPlayDialog::ConnectWidgets()
// Other
connect(m_buffer_size_box, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
[this](int value) {
+ if (value == m_buffer_size)
+ return;
+
if (Settings::Instance().GetNetPlayServer() != nullptr)
Settings::Instance().GetNetPlayServer()->AdjustPadBufferSize(value);
});
@@ -288,6 +291,7 @@ void NetPlayDialog::show(std::string nickname, bool use_traversal)
{
m_nickname = nickname;
m_use_traversal = use_traversal;
+ m_buffer_size = 0;
m_room_box->clear();
m_chat_edit->clear();
@@ -488,6 +492,8 @@ void NetPlayDialog::OnPadBufferChanged(u32 buffer)
{
QueueOnObject(this, [this, buffer] { m_buffer_size_box->setValue(buffer); });
DisplayMessage(tr("Buffer size changed to %1").arg(buffer), "");
+
+ m_buffer_size = static_cast<int>(buffer);
}
void NetPlayDialog::OnDesync(u32 frame, const std::string& player)
diff --git a/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.h b/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.h
index 593d65a3c5..8326c8be9a 100644
--- a/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.h
+++ b/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.h
@@ -106,4 +106,5 @@ private:
GameListModel* m_game_list_model = nullptr;
bool m_use_traversal = false;
bool m_is_copy_button_retry = false;
+ int m_buffer_size = 0;
};