mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 00:54:53 -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
|
|
@ -10,6 +10,7 @@
|
|||
#include "deck_loader.h"
|
||||
#include "dlg_create_token.h"
|
||||
#include "gamescene.h"
|
||||
#include "gettextwithmax.h"
|
||||
#include "handcounter.h"
|
||||
#include "handzone.h"
|
||||
#include "main.h"
|
||||
|
|
@ -56,6 +57,7 @@
|
|||
#include "playertarget.h"
|
||||
#include "settingscache.h"
|
||||
#include "stackzone.h"
|
||||
#include "stringsizes.h"
|
||||
#include "tab_game.h"
|
||||
#include "tablezone.h"
|
||||
#include "thememanager.h"
|
||||
|
|
@ -3034,8 +3036,8 @@ void Player::actSetPT()
|
|||
}
|
||||
bool ok;
|
||||
dialogSemaphore = true;
|
||||
QString pt = QInputDialog::getText(game, tr("Change power/toughness"), tr("Change stats to:"), QLineEdit::Normal,
|
||||
oldPT, &ok);
|
||||
QString pt =
|
||||
getTextWithMax(game, tr("Change power/toughness"), tr("Change stats to:"), QLineEdit::Normal, oldPT, &ok);
|
||||
dialogSemaphore = false;
|
||||
if (clearCardsToDelete() || !ok) {
|
||||
return;
|
||||
|
|
@ -3141,7 +3143,8 @@ void Player::actSetAnnotation()
|
|||
bool ok;
|
||||
dialogSemaphore = true;
|
||||
QString annotation = QInputDialog::getMultiLineText(game, tr("Set annotation"),
|
||||
tr("Please enter the new annotation:"), oldAnnotation, &ok);
|
||||
tr("Please enter the new annotation:"), oldAnnotation, &ok)
|
||||
.left(MAX_NAME_LENGTH);
|
||||
dialogSemaphore = false;
|
||||
if (clearCardsToDelete() || !ok) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue