Merge pull request #1681 from defnax/changes-for-forum-message-creator

Changes for forum message creator
This commit is contained in:
csoler 2019-10-12 23:04:56 +02:00 committed by GitHub
commit b259ceba95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 8 deletions

View File

@ -117,6 +117,8 @@ CreateGxsForumMsg::CreateGxsForumMsg(const RsGxsGroupId &fId, const RsGxsMessage
mForumCircleLoaded = false;
newMsg();
ui.hashGroupBox->hide();
#ifndef ENABLE_GENERATE
ui.generateCheckBox->hide();
@ -348,10 +350,13 @@ void CreateGxsForumMsg::checkLength()
RsHtml::optimizeHtml(ui.forumMessage, text);
std::wstring msg = text.toStdWString();
int charRemains = MAX_ALLOWED_GXS_MESSAGE_SIZE - msg.length();
if(charRemains >= 0)
if(charRemains >= 0) {
text = tr("It remains %1 characters after HTML conversion.").arg(charRemains);
else
ui.infoLabel->setStyleSheet("QLabel#infoLabel { }");
}else{
text = tr("Warning: This message is too big of %1 characters after HTML conversion.").arg((0-charRemains));
ui.infoLabel->setStyleSheet("QLabel#infoLabel {color: red; font: bold; }");
}
ui.buttonBox->button(QDialogButtonBox::Ok)->setToolTip(text);
ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(charRemains>=0);
ui.infoLabel->setText(text);
@ -506,6 +511,7 @@ void CreateGxsForumMsg::addFile()
QStringList files;
if (misc::getOpenFileNames(this, RshareSettings::LASTDIR_EXTRAFILE, tr("Add Extra File"), "", files)) {
ui.hashBox->addAttachments(files,RS_FILE_REQ_ANONYMOUS_ROUTING);
ui.hashGroupBox->show();
}
}
@ -542,6 +548,7 @@ void CreateGxsForumMsg::fileHashingFinished(QList<HashedFile> hashedFiles)
}
ui.forumMessage->setFocus( Qt::OtherFocusReason );
ui.hashGroupBox->hide();
}
void CreateGxsForumMsg::loadForumInfo(const uint32_t &token)

View File

@ -139,14 +139,17 @@
<enum>QFrame::Sunken</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>1</number>
<number>6</number>
</property>
<property name="topMargin">
<number>1</number>
</property>
<property name="rightMargin">
<number>1</number>
<number>6</number>
</property>
<property name="bottomMargin">
<number>1</number>
@ -163,8 +166,8 @@
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/add-share24.png</normaloff>:/images/add-share24.png</iconset>
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/attach.png</normaloff>:/icons/png/attach.png</iconset>
</property>
<property name="iconSize">
<size>
@ -186,8 +189,8 @@
<string/>
</property>
<property name="icon">
<iconset resource="../emojione.qrc">
<normaloff>:/emojione/1F603.png</normaloff>:/emojione/1F603.png</iconset>
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/smiley.png</normaloff>:/icons/png/smiley.png</iconset>
</property>
<property name="iconSize">
<size>