mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-24 07:33:54 -07:00
implement max lengths for input dialogs that are sent to the server (#4522)
* implement max lengths for input dialogs that are sent to the server * missed a double setMaxLength * implement max string lengths server side * add custom getText dialog with max length * fix deck storage tab and miscellaneous server side * add max size for deck uploads * final pass on client side limits
This commit is contained in:
parent
d61c604bf4
commit
994704d353
37 changed files with 564 additions and 348 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "pb/serverinfo_user.pb.h"
|
||||
#include "settingscache.h"
|
||||
#include "stringsizes.h"
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QDebug>
|
||||
|
|
@ -20,32 +21,39 @@ DlgRegister::DlgRegister(QWidget *parent) : QDialog(parent)
|
|||
|
||||
hostLabel = new QLabel(tr("&Host:"));
|
||||
hostEdit = new QLineEdit(servers.getHostname());
|
||||
hostEdit->setMaxLength(MAX_NAME_LENGTH);
|
||||
hostLabel->setBuddy(hostEdit);
|
||||
|
||||
portLabel = new QLabel(tr("&Port:"));
|
||||
portEdit = new QLineEdit(servers.getPort());
|
||||
portEdit->setValidator(new QIntValidator(0, 0xffff, portEdit));
|
||||
portLabel->setBuddy(portEdit);
|
||||
|
||||
playernameLabel = new QLabel(tr("Player &name:"));
|
||||
playernameEdit = new QLineEdit(servers.getPlayerName());
|
||||
playernameEdit->setMaxLength(MAX_NAME_LENGTH);
|
||||
playernameLabel->setBuddy(playernameEdit);
|
||||
|
||||
passwordLabel = new QLabel(tr("P&assword:"));
|
||||
passwordEdit = new QLineEdit();
|
||||
passwordEdit->setMaxLength(MAX_NAME_LENGTH);
|
||||
passwordLabel->setBuddy(passwordEdit);
|
||||
passwordEdit->setEchoMode(QLineEdit::Password);
|
||||
|
||||
passwordConfirmationLabel = new QLabel(tr("Password (again):"));
|
||||
passwordConfirmationEdit = new QLineEdit();
|
||||
passwordConfirmationEdit->setMaxLength(MAX_NAME_LENGTH);
|
||||
passwordConfirmationLabel->setBuddy(passwordConfirmationEdit);
|
||||
passwordConfirmationEdit->setEchoMode(QLineEdit::Password);
|
||||
|
||||
emailLabel = new QLabel(tr("Email:"));
|
||||
emailEdit = new QLineEdit();
|
||||
emailEdit->setMaxLength(MAX_NAME_LENGTH);
|
||||
emailLabel->setBuddy(emailEdit);
|
||||
|
||||
emailConfirmationLabel = new QLabel(tr("Email (again):"));
|
||||
emailConfirmationEdit = new QLineEdit();
|
||||
emailConfirmationEdit->setMaxLength(MAX_NAME_LENGTH);
|
||||
emailConfirmationLabel->setBuddy(emailConfirmationEdit);
|
||||
|
||||
countryLabel = new QLabel(tr("Country:"));
|
||||
|
|
@ -308,6 +316,7 @@ DlgRegister::DlgRegister(QWidget *parent) : QDialog(parent)
|
|||
|
||||
realnameLabel = new QLabel(tr("Real name:"));
|
||||
realnameEdit = new QLineEdit();
|
||||
realnameEdit->setMaxLength(MAX_NAME_LENGTH);
|
||||
realnameLabel->setBuddy(realnameEdit);
|
||||
|
||||
QGridLayout *grid = new QGridLayout;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue