From 32718c673f4dd53ccbe1f6df966ccd9b3d2084a6 Mon Sep 17 00:00:00 2001 From: defnax Date: Sat, 12 Oct 2019 22:32:14 +0200 Subject: [PATCH] Changed the toolbar icons & hide hashing groupbox by default * Changed the toolbar icons * Hide the hashing group box when there is no file attached * Show the warning text color in red when the size is too big --- .../src/gui/gxsforums/CreateGxsForumMsg.cpp | 11 +++++++++-- .../src/gui/gxsforums/CreateGxsForumMsg.ui | 15 +++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp index f10332a30..22db0d97d 100644 --- a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp +++ b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp @@ -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 hashedFiles) } ui.forumMessage->setFocus( Qt::OtherFocusReason ); + ui.hashGroupBox->hide(); } void CreateGxsForumMsg::loadForumInfo(const uint32_t &token) diff --git a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.ui b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.ui index 4c6838558..1e3b45abf 100644 --- a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.ui +++ b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.ui @@ -139,14 +139,17 @@ QFrame::Sunken + + 0 + - 1 + 6 1 - 1 + 6 1 @@ -163,8 +166,8 @@ - - :/images/add-share24.png:/images/add-share24.png + + :/icons/png/attach.png:/icons/png/attach.png @@ -186,8 +189,8 @@ - - :/emojione/1F603.png:/emojione/1F603.png + + :/icons/png/smiley.png:/icons/png/smiley.png