mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 17:09:34 -05:00
Disable the Send button when the limit is exceeded
This commit is contained in:
parent
39a89dd2a9
commit
44fc3ea50c
@ -393,7 +393,7 @@ void MessageComposer::updateCells(int,int)
|
||||
{
|
||||
int rowCount = ui.recipientWidget->rowCount();
|
||||
int row;
|
||||
bool has_gxs = false ;
|
||||
has_gxs = false ;
|
||||
|
||||
for (row = 0; row < rowCount; ++row)
|
||||
{
|
||||
@ -410,6 +410,7 @@ void MessageComposer::updateCells(int,int)
|
||||
ui.respond_to_CB->show();
|
||||
ui.distantFrame->show();
|
||||
ui.fromLabel->show();
|
||||
checkLength();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2880,15 +2881,17 @@ void MessageComposer::checkLength()
|
||||
|
||||
lineLabel->setText("|");
|
||||
|
||||
if(charRemains >= 0) {
|
||||
text = tr("It remains %1 characters after HTML conversion.").arg(charRemains);
|
||||
infoLabel->setStyleSheet("QStatusBar QLabel#infoLabel { }");
|
||||
}else{
|
||||
text = tr("Warning: This message is too big of %1 characters after HTML conversion.").arg((0-charRemains));
|
||||
infoLabel->setStyleSheet("QStatusBar QLabel#infoLabel {color: red; font: bold; }");
|
||||
if(has_gxs) {
|
||||
if(charRemains >= 0) {
|
||||
text = tr("It remains %1 characters after HTML conversion.").arg(charRemains);
|
||||
}else{
|
||||
text = tr("Warning: This message is too big of %1 characters after HTML conversion.").arg((0-charRemains));
|
||||
}
|
||||
ui.actionSend->setEnabled(charRemains>=0);
|
||||
infoLabel->setText(text);
|
||||
}
|
||||
else {
|
||||
infoLabel->setText("");
|
||||
ui.actionSend->setEnabled(true);
|
||||
}
|
||||
|
||||
//ui.actionSend->setEnabled(charRemains>=0);
|
||||
|
||||
infoLabel->setText(text);
|
||||
}
|
||||
|
@ -263,6 +263,8 @@ private:
|
||||
QLabel *lengthLabel;
|
||||
QLabel *lineLabel;
|
||||
|
||||
bool has_gxs;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::MessageComposer ui;
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
</property>
|
||||
<widget class="QWidget" name="tabFeed">
|
||||
<attribute name="title">
|
||||
<string>Log</string>
|
||||
<string>Activity</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="tabFeedVLayout">
|
||||
<item>
|
||||
|
Loading…
Reference in New Issue
Block a user