NetPlay: Limit nickname length

Ridiculously long nicknames cause UI silliness, so 30 characters seems
like a reasonable limit, as it's the same as the forum.
This commit is contained in:
Techjar
2018-11-21 00:15:44 -05:00
parent 92812d0b0b
commit 037aa2192f
6 changed files with 24 additions and 4 deletions

View File

@ -17,9 +17,11 @@
#include <QTabWidget>
#include "Core/Config/NetplaySettings.h"
#include "Core/NetPlayProto.h"
#include "DolphinQt/GameList/GameListModel.h"
#include "DolphinQt/QtUtils/ModalMessageBox.h"
#include "DolphinQt/QtUtils/UTF8CodePointCountValidator.h"
#include "DolphinQt/Settings.h"
#include "UICommon/NetPlayIndex.h"
@ -87,6 +89,9 @@ void NetPlaySetupDialog::CreateMainLayout()
m_reset_traversal_button = new QPushButton(tr("Reset Traversal Settings"));
m_tab_widget = new QTabWidget;
m_nickname_edit->setValidator(
new UTF8CodePointCountValidator(NetPlay::MAX_NAME_LENGTH, m_nickname_edit));
// Connection widget
auto* connection_widget = new QWidget;
auto* connection_layout = new QGridLayout;