mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 16:39:29 -05:00
Merge branch 'master' of https://github.com/RetroShare/RetroShare
This commit is contained in:
commit
5f7327f87e
@ -31,6 +31,7 @@
|
||||
#include "GxsForumsDialog.h"
|
||||
#include "gui/RetroShareLink.h"
|
||||
#include "gui/common/RSTreeWidgetItem.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include "gui/common/RSElidedItemDelegate.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include "gui/gxs/GxsIdTreeWidgetItem.h"
|
||||
@ -1622,7 +1623,11 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg)
|
||||
}
|
||||
else
|
||||
{
|
||||
QString extraTxt = RsHtml().formatText(ui->postText->document(), QString::fromUtf8(msg.mMsg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS);
|
||||
uint32_t flags = RSHTML_FORMATTEXT_EMBED_LINKS;
|
||||
if(Settings->getForumLoadEmoticons())
|
||||
flags |= RSHTML_FORMATTEXT_EMBED_SMILEYS ;
|
||||
|
||||
QString extraTxt = RsHtml().formatText(ui->postText->document(), QString::fromUtf8(msg.mMsg.c_str()),flags);
|
||||
ui->postText->setHtml(extraTxt);
|
||||
}
|
||||
// ui->threadTitle->setText(QString::fromUtf8(msg.mMeta.mMsgName.c_str()));
|
||||
|
@ -42,6 +42,7 @@ bool ForumPage::save(QString &/*errmsg*/)
|
||||
Settings->setForumMsgSetToReadOnActivate(ui.setMsgToReadOnActivate->isChecked());
|
||||
Settings->setForumExpandNewMessages(ui.expandNewMessages->isChecked());
|
||||
Settings->setForumLoadEmbeddedImages(ui.loadEmbeddedImages->isChecked());
|
||||
Settings->setForumLoadEmoticons(ui.loadEmoticons->isChecked());
|
||||
|
||||
ui.groupFrameSettingsWidget->saveSettings(GroupFrameSettings::Forum);
|
||||
|
||||
@ -54,6 +55,7 @@ void ForumPage::load()
|
||||
ui.setMsgToReadOnActivate->setChecked(Settings->getForumMsgSetToReadOnActivate());
|
||||
ui.expandNewMessages->setChecked(Settings->getForumExpandNewMessages());
|
||||
ui.loadEmbeddedImages->setChecked(Settings->getForumLoadEmbeddedImages());
|
||||
ui.loadEmoticons->setChecked(Settings->getForumLoadEmoticons());
|
||||
|
||||
ui.groupFrameSettingsWidget->loadSettings(GroupFrameSettings::Forum);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>423</width>
|
||||
<width>507</width>
|
||||
<height>340</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -38,6 +38,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="loadEmoticons">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>This option is costly and it's in the dev's plans to improve it. In the mean time it's disabled by default. If you enable it and long forum posts take a while to display, then disable it again. </p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load emoticons (costly)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -1041,12 +1041,18 @@ bool RshareSettings::getForumLoadEmbeddedImages()
|
||||
{
|
||||
return valueFromGroup("Forum", "LoadEmbeddedImages", false).toBool();
|
||||
}
|
||||
|
||||
bool RshareSettings::getForumLoadEmoticons()
|
||||
{
|
||||
return valueFromGroup("Forum", "LoadEmoticons", false).toBool();
|
||||
}
|
||||
void RshareSettings::setForumLoadEmbeddedImages(bool value)
|
||||
{
|
||||
setValueToGroup("Forum", "LoadEmbeddedImages", value);
|
||||
}
|
||||
|
||||
void RshareSettings::setForumLoadEmoticons(bool value)
|
||||
{
|
||||
setValueToGroup("Forum", "LoadEmoticons", value);
|
||||
}
|
||||
/* Channel */
|
||||
bool RshareSettings::getChannelLoadThread()
|
||||
{
|
||||
|
@ -305,6 +305,8 @@ public:
|
||||
void setForumExpandNewMessages(bool value);
|
||||
bool getForumLoadEmbeddedImages();
|
||||
void setForumLoadEmbeddedImages(bool value);
|
||||
bool getForumLoadEmoticons();
|
||||
void setForumLoadEmoticons(bool value);
|
||||
|
||||
/* Channel */
|
||||
bool getChannelLoadThread();
|
||||
|
@ -1004,13 +1004,17 @@ void RsHtml::optimizeHtml(QTextEdit *textEdit, QString &text, unsigned int flag
|
||||
{
|
||||
if (textEdit->toHtml() == QTextDocument(textEdit->toPlainText()).toHtml()) {
|
||||
text = textEdit->toPlainText();
|
||||
// std::cerr << "Optimized text to " << text.length() << " bytes , instead of " << textEdit->toHtml().length() << std::endl;
|
||||
//std::cerr << "Optimized text to " << text.length() << " bytes , instead of " << textEdit->toHtml().length() << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
text = textEdit->toHtml();
|
||||
|
||||
//std::cerr << "Optimized text from " << text.length() << " bytes , into " ;
|
||||
|
||||
optimizeHtml(text, flag);
|
||||
|
||||
//std::cerr << text.length() << " bytes" << std::endl;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user