Browse Source

set maximum chars to 235

pull/130/head
DenioD 4 years ago
parent
commit
98431babb3
  1. 8
      src/chatmodel.cpp
  2. 2
      src/mainwindow.h
  3. 2
      src/mainwindow.ui
  4. 2
      src/requestdialog.ui

8
src/chatmodel.cpp

@ -526,14 +526,14 @@ void MainWindow::sendChat() {
return; return;
} }
int max = 512; int max = 235;
QString chattext = ui->memoTxtChat->toPlainText(); QString chattext = ui->memoTxtChat->toPlainText();
int size = chattext.size(); int size = chattext.size();
if (size > max){ if (size > max){
QMessageBox msg(QMessageBox::Critical, tr("Your Message is too long"), 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); QMessageBox::Ok, this);
msg.exec(); msg.exec();
@ -790,7 +790,7 @@ void MainWindow::ContactRequest() {
return; return;
} }
int max = 512; int max = 235;
QString chattext = contactRequest.getMemo();; QString chattext = contactRequest.getMemo();;
int size = chattext.size(); int size = chattext.size();
@ -799,7 +799,7 @@ void MainWindow::ContactRequest() {
// auto addr = ""; // auto addr = "";
// if (! Settings::isZAddress(AddressBook::addressFromAddressLabel(addr->text()))) { // if (! Settings::isZAddress(AddressBook::addressFromAddressLabel(addr->text()))) {
QMessageBox msg(QMessageBox::Critical, tr("Your Message is too long"), 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); QMessageBox::Ok, this);
msg.exec(); msg.exec();

2
src/mainwindow.h

@ -211,7 +211,7 @@ public:
void updateDisplayChat(); void updateDisplayChat();
private: private:
int maxlenchat = 512; int maxlenchat = 235;
QLabel* lenDisplayLabelchat = nullptr; QLabel* lenDisplayLabelchat = nullptr;
QPushButton* sendChatButton = nullptr; QPushButton* sendChatButton = nullptr;
}; };

2
src/mainwindow.ui

@ -1697,7 +1697,7 @@
<enum>QFrame::Sunken</enum> <enum>QFrame::Sunken</enum>
</property> </property>
<property name="text"> <property name="text">
<string notr="true">0 / 512</string> <string notr="true">0 / 235</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>

2
src/requestdialog.ui

@ -101,7 +101,7 @@
<item row="11" column="3"> <item row="11" column="3">
<widget class="QLabel" name="lblMemoLen"> <widget class="QLabel" name="lblMemoLen">
<property name="text"> <property name="text">
<string notr="true">0 / 512</string> <string notr="true">0 / 235</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>

Loading…
Cancel
Save