Skip to content

Commit

Permalink
set maximum chars to 235
Browse files Browse the repository at this point in the history
  • Loading branch information
DenioD committed Jun 2, 2020
1 parent e2caf2b commit 98431ba
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/chatmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,14 +526,14 @@ void MainWindow::sendChat() {
return;
}

int max = 512;
int max = 235;
QString chattext = ui->memoTxtChat->toPlainText();
int size = chattext.size();

if (size > max){

QMessageBox msg(QMessageBox::Critical, tr("Your Message is too long"),
tr("You can only write messages with 512 character maximum \n") + tr("\n Please reduce your message to 512 character."),
tr("You can only write messages with 235 character maximum \n") + tr("\n Please reduce your message to 235 character."),
QMessageBox::Ok, this);

msg.exec();
Expand Down Expand Up @@ -790,7 +790,7 @@ void MainWindow::ContactRequest() {
return;
}

int max = 512;
int max = 235;
QString chattext = contactRequest.getMemo();;
int size = chattext.size();

Expand All @@ -799,7 +799,7 @@ void MainWindow::ContactRequest() {
// auto addr = "";
// if (! Settings::isZAddress(AddressBook::addressFromAddressLabel(addr->text()))) {
QMessageBox msg(QMessageBox::Critical, tr("Your Message is too long"),
tr("You can only write messages with 512 character maximum \n") + tr("\n Please reduce your message to 512 character."),
tr("You can only write messages with 235 character maximum \n") + tr("\n Please reduce your message to 235 character."),
QMessageBox::Ok, this);

msg.exec();
Expand Down
2 changes: 1 addition & 1 deletion src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class ChatMemoEdit : public QTextEdit
void updateDisplayChat();

private:
int maxlenchat = 512;
int maxlenchat = 235;
QLabel* lenDisplayLabelchat = nullptr;
QPushButton* sendChatButton = nullptr;
};
Expand Down
2 changes: 1 addition & 1 deletion src/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,7 @@
<enum>QFrame::Sunken</enum>
</property>
<property name="text">
<string notr="true">0 / 512</string>
<string notr="true">0 / 235</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
Expand Down
2 changes: 1 addition & 1 deletion src/requestdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<item row="11" column="3">
<widget class="QLabel" name="lblMemoLen">
<property name="text">
<string notr="true">0 / 512</string>
<string notr="true">0 / 235</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
Expand Down

0 comments on commit 98431ba

Please sign in to comment.