mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-10 15:42:49 -04:00
Added new action "Load images always for this message" to image blocking.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6760 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
0a3419c692
commit
6a9dfed408
16 changed files with 255 additions and 97 deletions
|
@ -37,6 +37,7 @@
|
||||||
#define FORUM_MSG_STATUS_MASK 0x000f
|
#define FORUM_MSG_STATUS_MASK 0x000f
|
||||||
#define FORUM_MSG_STATUS_READ 0x0001
|
#define FORUM_MSG_STATUS_READ 0x0001
|
||||||
#define FORUM_MSG_STATUS_UNREAD_BY_USER 0x0002
|
#define FORUM_MSG_STATUS_UNREAD_BY_USER 0x0002
|
||||||
|
#define FORUM_MSG_STATUS_LOAD_EMBEDDED_IMAGES 0x0004
|
||||||
|
|
||||||
class ForumInfo
|
class ForumInfo
|
||||||
{
|
{
|
||||||
|
|
|
@ -61,6 +61,7 @@
|
||||||
#define RS_MSG_ENCRYPTED 0x1000 /* message is encrypted */
|
#define RS_MSG_ENCRYPTED 0x1000 /* message is encrypted */
|
||||||
#define RS_MSG_SIGNATURE_CHECKS 0x2000 /* message was signed, and signature checked */
|
#define RS_MSG_SIGNATURE_CHECKS 0x2000 /* message was signed, and signature checked */
|
||||||
#define RS_MSG_SIGNED 0x4000 /* message was signed and signature didn't check */
|
#define RS_MSG_SIGNED 0x4000 /* message was signed and signature didn't check */
|
||||||
|
#define RS_MSG_LOAD_EMBEDDED_IMAGES 0x8000 /* load embedded images */
|
||||||
|
|
||||||
#define RS_CHAT_LOBBY_EVENT_PEER_LEFT 0x01
|
#define RS_CHAT_LOBBY_EVENT_PEER_LEFT 0x01
|
||||||
#define RS_CHAT_LOBBY_EVENT_PEER_STATUS 0x02
|
#define RS_CHAT_LOBBY_EVENT_PEER_STATUS 0x02
|
||||||
|
@ -264,6 +265,7 @@ virtual bool MessageRead(const std::string &mid, bool unreadByUser) = 0;
|
||||||
virtual bool MessageReplied(const std::string &mid, bool replied) = 0;
|
virtual bool MessageReplied(const std::string &mid, bool replied) = 0;
|
||||||
virtual bool MessageForwarded(const std::string &mid, bool forwarded) = 0;
|
virtual bool MessageForwarded(const std::string &mid, bool forwarded) = 0;
|
||||||
virtual bool MessageStar(const std::string &mid, bool mark) = 0;
|
virtual bool MessageStar(const std::string &mid, bool mark) = 0;
|
||||||
|
virtual bool MessageLoadEmbeddedImages(const std::string &mid, bool load) = 0;
|
||||||
|
|
||||||
/* message tagging */
|
/* message tagging */
|
||||||
|
|
||||||
|
|
|
@ -169,6 +169,11 @@ bool p3Msgs::MessageForwarded(const std::string &mid, bool forwarded)
|
||||||
return mMsgSrv->setMsgFlag(mid, forwarded ? RS_MSG_FLAGS_FORWARDED : 0, RS_MSG_FLAGS_FORWARDED);
|
return mMsgSrv->setMsgFlag(mid, forwarded ? RS_MSG_FLAGS_FORWARDED : 0, RS_MSG_FLAGS_FORWARDED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool p3Msgs::MessageLoadEmbeddedImages(const std::string &mid, bool load)
|
||||||
|
{
|
||||||
|
return mMsgSrv->setMsgFlag(mid, load ? RS_MSG_FLAGS_LOAD_EMBEDDED_IMAGES : 0, RS_MSG_FLAGS_LOAD_EMBEDDED_IMAGES);
|
||||||
|
}
|
||||||
|
|
||||||
bool p3Msgs::getMessageTagTypes(MsgTagType& tags)
|
bool p3Msgs::getMessageTagTypes(MsgTagType& tags)
|
||||||
{
|
{
|
||||||
return mMsgSrv->getMessageTagTypes(tags);
|
return mMsgSrv->getMessageTagTypes(tags);
|
||||||
|
|
|
@ -67,6 +67,7 @@ class p3Msgs: public RsMsgs
|
||||||
virtual bool MessageReplied(const std::string &mid, bool replied);
|
virtual bool MessageReplied(const std::string &mid, bool replied);
|
||||||
virtual bool MessageForwarded(const std::string &mid, bool forwarded);
|
virtual bool MessageForwarded(const std::string &mid, bool forwarded);
|
||||||
virtual bool MessageStar(const std::string &mid, bool star);
|
virtual bool MessageStar(const std::string &mid, bool star);
|
||||||
|
virtual bool MessageLoadEmbeddedImages(const std::string &mid, bool load);
|
||||||
virtual bool getMsgParentId(const std::string &msgId, std::string &msgParentId);
|
virtual bool getMsgParentId(const std::string &msgId, std::string &msgParentId);
|
||||||
|
|
||||||
virtual bool getMessageTagTypes(MsgTagType& tags);
|
virtual bool getMessageTagTypes(MsgTagType& tags);
|
||||||
|
|
|
@ -431,6 +431,7 @@ const uint32_t RS_MSG_FLAGS_ENCRYPTED = 0x00004000;
|
||||||
const uint32_t RS_MSG_FLAGS_DISTANT = 0x00008000;
|
const uint32_t RS_MSG_FLAGS_DISTANT = 0x00008000;
|
||||||
const uint32_t RS_MSG_FLAGS_SIGNATURE_CHECKS = 0x00010000;
|
const uint32_t RS_MSG_FLAGS_SIGNATURE_CHECKS = 0x00010000;
|
||||||
const uint32_t RS_MSG_FLAGS_SIGNED = 0x00020000;
|
const uint32_t RS_MSG_FLAGS_SIGNED = 0x00020000;
|
||||||
|
const uint32_t RS_MSG_FLAGS_LOAD_EMBEDDED_IMAGES = 0x00040000;
|
||||||
|
|
||||||
class RsMessageItem: public RsItem
|
class RsMessageItem: public RsItem
|
||||||
{
|
{
|
||||||
|
|
|
@ -362,7 +362,7 @@ bool p3Forums::ForumMessageSend(ForumMsgInfo &info)
|
||||||
// return id
|
// return id
|
||||||
info.msgId = mId;
|
info.msgId = mId;
|
||||||
|
|
||||||
return setMessageStatus(info.forumId, mId, FORUM_MSG_STATUS_READ, FORUM_MSG_STATUS_MASK);
|
return setMessageStatus(info.forumId, mId, FORUM_MSG_STATUS_READ | FORUM_MSG_STATUS_LOAD_EMBEDDED_IMAGES, FORUM_MSG_STATUS_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool p3Forums::setMessageStatus(const std::string& fId,const std::string& mId,const uint32_t status, const uint32_t statusMask)
|
bool p3Forums::setMessageStatus(const std::string& fId,const std::string& mId,const uint32_t status, const uint32_t statusMask)
|
||||||
|
|
|
@ -1539,6 +1539,10 @@ void p3MsgService::initRsMI(RsMsgItem *msg, MessageInfo &mi)
|
||||||
{
|
{
|
||||||
mi.msgflags |= RS_MSG_FRIEND_RECOMMENDATION;
|
mi.msgflags |= RS_MSG_FRIEND_RECOMMENDATION;
|
||||||
}
|
}
|
||||||
|
if (msg->msgFlags & RS_MSG_FLAGS_LOAD_EMBEDDED_IMAGES)
|
||||||
|
{
|
||||||
|
mi.msgflags |= RS_MSG_LOAD_EMBEDDED_IMAGES;
|
||||||
|
}
|
||||||
|
|
||||||
mi.ts = msg->sendTime;
|
mi.ts = msg->sendTime;
|
||||||
mi.srcId = msg->PeerId();
|
mi.srcId = msg->PeerId();
|
||||||
|
@ -1652,6 +1656,10 @@ void p3MsgService::initRsMIS(RsMsgItem *msg, MsgInfoSummary &mis)
|
||||||
{
|
{
|
||||||
mis.msgflags |= RS_MSG_FRIEND_RECOMMENDATION;
|
mis.msgflags |= RS_MSG_FRIEND_RECOMMENDATION;
|
||||||
}
|
}
|
||||||
|
if (msg->msgFlags & RS_MSG_FLAGS_LOAD_EMBEDDED_IMAGES)
|
||||||
|
{
|
||||||
|
mis.msgflags |= RS_MSG_LOAD_EMBEDDED_IMAGES;
|
||||||
|
}
|
||||||
|
|
||||||
mis.srcId = msg->PeerId();
|
mis.srcId = msg->PeerId();
|
||||||
{
|
{
|
||||||
|
@ -1726,6 +1734,9 @@ RsMsgItem *p3MsgService::initMIRsMsg(MessageInfo &info, const std::string &to)
|
||||||
if (info.msgflags & RS_MSG_SIGNED)
|
if (info.msgflags & RS_MSG_SIGNED)
|
||||||
msg->msgFlags |= RS_MSG_FLAGS_SIGNED;
|
msg->msgFlags |= RS_MSG_FLAGS_SIGNED;
|
||||||
|
|
||||||
|
/* load embedded images from own messages */
|
||||||
|
msg->msgFlags |= RS_MSG_FLAGS_LOAD_EMBEDDED_IMAGES;
|
||||||
|
|
||||||
// See if we need to encrypt this message. If so, we replace the msg text
|
// See if we need to encrypt this message. If so, we replace the msg text
|
||||||
// by the whole message serialized and binary encrypted, so as to obfuscate
|
// by the whole message serialized and binary encrypted, so as to obfuscate
|
||||||
// all its content.
|
// all its content.
|
||||||
|
|
|
@ -139,6 +139,7 @@ ForumsDialog::ForumsDialog(QWidget *parent)
|
||||||
|
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(forumMsgReadSatusChanged(QString,QString,int)), this, SLOT(forumMsgReadSatusChanged(QString,QString,int)));
|
connect(NotifyQt::getInstance(), SIGNAL(forumMsgReadSatusChanged(QString,QString,int)), this, SLOT(forumMsgReadSatusChanged(QString,QString,int)));
|
||||||
|
|
||||||
|
ui.imageBlockWidget->addButtonAction(tr("Load images always for this message"), this, SLOT(loadImagesAlways()), true);
|
||||||
ui.postText->setImageBlockWidget(ui.imageBlockWidget);
|
ui.postText->setImageBlockWidget(ui.imageBlockWidget);
|
||||||
|
|
||||||
/* Set initial size the splitter */
|
/* Set initial size the splitter */
|
||||||
|
@ -481,11 +482,11 @@ void ForumsDialog::togglethreadview()
|
||||||
void ForumsDialog::togglethreadview_internal()
|
void ForumsDialog::togglethreadview_internal()
|
||||||
{
|
{
|
||||||
if (ui.expandButton->isChecked()) {
|
if (ui.expandButton->isChecked()) {
|
||||||
ui.postText->setVisible(true);
|
ui.postFrame->setVisible(true);
|
||||||
ui.expandButton->setIcon(QIcon(QString(":/images/edit_remove24.png")));
|
ui.expandButton->setIcon(QIcon(QString(":/images/edit_remove24.png")));
|
||||||
ui.expandButton->setToolTip(tr("Hide"));
|
ui.expandButton->setToolTip(tr("Hide"));
|
||||||
} else {
|
} else {
|
||||||
ui.postText->setVisible(false);
|
ui.postFrame->setVisible(false);
|
||||||
ui.expandButton->setIcon(QIcon(QString(":/images/edit_add24.png")));
|
ui.expandButton->setIcon(QIcon(QString(":/images/edit_add24.png")));
|
||||||
ui.expandButton->setToolTip(tr("Expand"));
|
ui.expandButton->setToolTip(tr("Expand"));
|
||||||
}
|
}
|
||||||
|
@ -1210,7 +1211,16 @@ void ForumsDialog::insertPost()
|
||||||
|
|
||||||
QString extraTxt = RsHtml().formatText(ui.postText->document(), messageFromInfo(msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS);
|
QString extraTxt = RsHtml().formatText(ui.postText->document(), messageFromInfo(msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS);
|
||||||
|
|
||||||
ui.postText->resetImagesStatus(Settings->getForumLoadEmbeddedImages());
|
bool loadEmbeddedImages = Settings->getForumLoadEmbeddedImages();
|
||||||
|
if (!loadEmbeddedImages) {
|
||||||
|
uint32_t status = 0;
|
||||||
|
rsForums->getMessageStatus(mCurrForumId, mCurrThreadId, status);
|
||||||
|
if (status & FORUM_MSG_STATUS_LOAD_EMBEDDED_IMAGES) {
|
||||||
|
loadEmbeddedImages = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ui.postText->resetImagesStatus(loadEmbeddedImages);
|
||||||
ui.postText->setHtml(extraTxt);
|
ui.postText->setHtml(extraTxt);
|
||||||
ui.threadTitle->setText(titleFromInfo(msg));
|
ui.threadTitle->setText(titleFromInfo(msg));
|
||||||
}
|
}
|
||||||
|
@ -2119,3 +2129,12 @@ void ForumsFillThread::run()
|
||||||
std::cerr << "ForumsFillThread::run() stopped: " << (wasStopped() ? "yes" : "no") << std::endl;
|
std::cerr << "ForumsFillThread::run() stopped: " << (wasStopped() ? "yes" : "no") << std::endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ForumsDialog::loadImagesAlways()
|
||||||
|
{
|
||||||
|
if (mCurrForumId.empty() || mCurrThreadId.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
rsForums->setMessageStatus(mCurrForumId, mCurrThreadId, FORUM_MSG_STATUS_LOAD_EMBEDDED_IMAGES, FORUM_MSG_STATUS_LOAD_EMBEDDED_IMAGES);
|
||||||
|
}
|
||||||
|
|
|
@ -128,6 +128,8 @@ private slots:
|
||||||
|
|
||||||
void shareKey();
|
void shareKey();
|
||||||
|
|
||||||
|
void loadImagesAlways();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void insertForums();
|
void insertForums();
|
||||||
void insertThreads();
|
void insertThreads();
|
||||||
|
|
|
@ -113,8 +113,8 @@
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="layoutWidget">
|
<widget class="QWidget" name="layoutWidget">
|
||||||
<layout class="QGridLayout">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item row="0" column="0">
|
<item>
|
||||||
<widget class="QFrame" name="toolBarFrame">
|
<widget class="QFrame" name="toolBarFrame">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||||
|
@ -200,7 +200,7 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item>
|
||||||
<layout class="QHBoxLayout">
|
<layout class="QHBoxLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_17">
|
<widget class="QLabel" name="label_17">
|
||||||
|
@ -278,7 +278,54 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item>
|
||||||
|
<widget class="QTreeWidget" name="threadTreeWidget">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>9</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="contextMenuPolicy">
|
||||||
|
<enum>Qt::CustomContextMenu</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sortingEnabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="allColumnsShowFocus">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Title</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="images.qrc">
|
||||||
|
<normaloff>:/images/message-state-header.png</normaloff>:/images/message-state-header.png</iconset>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Date</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Author</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Signed</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
<layout class="QHBoxLayout" name="progressBarLayOut">
|
<layout class="QHBoxLayout" name="progressBarLayOut">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="progLayOutTxt">
|
<widget class="QLabel" name="progLayOutTxt">
|
||||||
|
@ -311,7 +358,7 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item>
|
||||||
<layout class="QGridLayout">
|
<layout class="QGridLayout">
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QLabel" name="threadlabel">
|
<widget class="QLabel" name="threadlabel">
|
||||||
|
@ -487,60 +534,16 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QTreeWidget" name="threadTreeWidget">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>9</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="contextMenuPolicy">
|
|
||||||
<enum>Qt::CustomContextMenu</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sortingEnabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="allColumnsShowFocus">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>Title</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="images.qrc">
|
|
||||||
<normaloff>:/images/message-state-header.png</normaloff>:/images/message-state-header.png</iconset>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>Date</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>Author</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>Signed</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="verticalLayoutWidget">
|
<widget class="QFrame" name="postFrame">
|
||||||
<layout class="QVBoxLayout" name="postLayout">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="RSImageBlockWidget" name="imageBlockWidget" native="true">
|
<widget class="RSImageBlockWidget" name="imageBlockWidget" native="true">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/****************************************************************
|
||||||
|
* RetroShare is distributed under the following license:
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 RetroShare Team
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
****************************************************************/
|
||||||
|
|
||||||
|
#include <QMenu>
|
||||||
|
|
||||||
#include "RSImageBlockWidget.h"
|
#include "RSImageBlockWidget.h"
|
||||||
#include "ui_RSImageBlockWidget.h"
|
#include "ui_RSImageBlockWidget.h"
|
||||||
|
|
||||||
|
@ -14,3 +37,30 @@ RSImageBlockWidget::~RSImageBlockWidget()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RSImageBlockWidget::addButtonAction(const QString &text, const QObject *receiver, const char *member, bool standardAction)
|
||||||
|
{
|
||||||
|
QMenu *menu = ui->loadImagesButton->menu();
|
||||||
|
if (!menu) {
|
||||||
|
/* Set popup mode */
|
||||||
|
ui->loadImagesButton->setPopupMode(QToolButton::MenuButtonPopup);
|
||||||
|
ui->loadImagesButton->setIcon(ui->loadImagesButton->icon()); // Sometimes Qt doesn't recalculate sizeHint
|
||||||
|
|
||||||
|
/* Create popup menu */
|
||||||
|
menu = new QMenu;
|
||||||
|
ui->loadImagesButton->setMenu(menu);
|
||||||
|
|
||||||
|
/* Add 'click' action as action */
|
||||||
|
QAction *action = menu->addAction(ui->loadImagesButton->text(), this, SIGNAL(showImages()));
|
||||||
|
menu->setDefaultAction(action);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add new action */
|
||||||
|
QAction *action = menu->addAction(text, receiver, member);
|
||||||
|
ui->loadImagesButton->addAction(action);
|
||||||
|
|
||||||
|
if (standardAction) {
|
||||||
|
/* Connect standard action */
|
||||||
|
connect(action, SIGNAL(triggered()), this, SIGNAL(showImages()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,3 +1,24 @@
|
||||||
|
/****************************************************************
|
||||||
|
* RetroShare is distributed under the following license:
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 RetroShare Team
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
****************************************************************/
|
||||||
|
|
||||||
#ifndef RSIMAGEBLOCKWIDGET_H
|
#ifndef RSIMAGEBLOCKWIDGET_H
|
||||||
#define RSIMAGEBLOCKWIDGET_H
|
#define RSIMAGEBLOCKWIDGET_H
|
||||||
|
|
||||||
|
@ -15,6 +36,8 @@ public:
|
||||||
explicit RSImageBlockWidget(QWidget *parent = 0);
|
explicit RSImageBlockWidget(QWidget *parent = 0);
|
||||||
~RSImageBlockWidget();
|
~RSImageBlockWidget();
|
||||||
|
|
||||||
|
void addButtonAction(const QString &text, const QObject *receiver, const char *member, bool standardAction);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void showImages();
|
void showImages();
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>476</width>
|
<width>476</width>
|
||||||
<height>37</height>
|
<height>34</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -110,14 +110,14 @@
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>162</width>
|
<width>40</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="loadImagesButton">
|
<widget class="QToolButton" name="loadImagesButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Load images</string>
|
<string>Load images</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -135,6 +135,7 @@ MessageWidget::MessageWidget(bool controlled, QWidget *parent, Qt::WFlags flags)
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(messagesTagsChanged()), this, SLOT(messagesTagsChanged()));
|
connect(NotifyQt::getInstance(), SIGNAL(messagesTagsChanged()), this, SLOT(messagesTagsChanged()));
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(messagesChanged()), this, SLOT(messagesChanged()));
|
connect(NotifyQt::getInstance(), SIGNAL(messagesChanged()), this, SLOT(messagesChanged()));
|
||||||
|
|
||||||
|
ui.imageBlockWidget->addButtonAction(tr("Load images always for this message"), this, SLOT(loadImagesAlways()), true);
|
||||||
ui.msgText->setImageBlockWidget(ui.imageBlockWidget);
|
ui.msgText->setImageBlockWidget(ui.imageBlockWidget);
|
||||||
|
|
||||||
/* hide the Tree +/- */
|
/* hide the Tree +/- */
|
||||||
|
@ -560,7 +561,7 @@ void MessageWidget::fill(const std::string &msgId)
|
||||||
ui.subjectText->setText(QString::fromStdWString(msgInfo.title));
|
ui.subjectText->setText(QString::fromStdWString(msgInfo.title));
|
||||||
|
|
||||||
text = RsHtmlMsg(msgInfo.msgflags).formatText(ui.msgText->document(), QString::fromStdWString(msgInfo.msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS | RSHTML_FORMATTEXT_REPLACE_LINKS);
|
text = RsHtmlMsg(msgInfo.msgflags).formatText(ui.msgText->document(), QString::fromStdWString(msgInfo.msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS | RSHTML_FORMATTEXT_REPLACE_LINKS);
|
||||||
ui.msgText->resetImagesStatus(Settings->getMsgLoadEmbeddedImages());
|
ui.msgText->resetImagesStatus(Settings->getMsgLoadEmbeddedImages() || (msgInfo.msgflags & RS_MSG_LOAD_EMBEDDED_IMAGES));
|
||||||
ui.msgText->setHtml(text);
|
ui.msgText->setHtml(text);
|
||||||
|
|
||||||
ui.filesText->setText(QString("(%1 %2)").arg(msgInfo.count).arg(msgInfo.count == 1 ? tr("File") : tr("Files")));
|
ui.filesText->setText(QString("(%1 %2)").arg(msgInfo.count).arg(msgInfo.count == 1 ? tr("File") : tr("Files")));
|
||||||
|
@ -713,3 +714,12 @@ void MessageWidget::anchorClicked(const QUrl &url)
|
||||||
links.append(link);
|
links.append(link);
|
||||||
RetroShareLink::process(links);
|
RetroShareLink::process(links);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MessageWidget::loadImagesAlways()
|
||||||
|
{
|
||||||
|
if (currMsgId.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
rsMsgs->MessageLoadEmbeddedImages(currMsgId, true);
|
||||||
|
}
|
||||||
|
|
|
@ -78,6 +78,8 @@ private slots:
|
||||||
|
|
||||||
void anchorClicked(const QUrl &url);
|
void anchorClicked(const QUrl &url);
|
||||||
|
|
||||||
|
void loadImagesAlways();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void clearTagLabels();
|
void clearTagLabels();
|
||||||
void showTagLabels();
|
void showTagLabels();
|
||||||
|
|
|
@ -1343,22 +1343,6 @@ Please choose one of it to chat with.</source>
|
||||||
<source>Selected lobby info</source>
|
<source>Selected lobby info</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>Lobby name: </source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Lobby Id: </source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Topic: </source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Type: </source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Private</source>
|
<source>Private</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
|
@ -1367,22 +1351,10 @@ Please choose one of it to chat with.</source>
|
||||||
<source>Public</source>
|
<source>Public</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>Peers: </source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>You're not subscribed to this lobby; Double click-it to enter and chat.</source>
|
<source>You're not subscribed to this lobby; Double click-it to enter and chat.</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>No lobby selected.
|
|
||||||
|
|
||||||
Select lobbies at left to show details.
|
|
||||||
|
|
||||||
Double click lobbies to enter and chat.</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Invitation to chat lobby</source>
|
<source>Invitation to chat lobby</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
|
@ -1435,6 +1407,36 @@ Double click lobbies to enter and chat.</source>
|
||||||
<source>No</source>
|
<source>No</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Lobby Name:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Lobby Id:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Topic:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Type:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Peers:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>TextLabel</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>No lobby selected.
|
||||||
|
Select lobbies at left to show details.
|
||||||
|
Double click lobbies to enter and chat.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ChatMsgItem</name>
|
<name>ChatMsgItem</name>
|
||||||
|
@ -5671,6 +5673,10 @@ p, li { white-space: pre-wrap; }
|
||||||
<source> <h1><img width="32" src=":/images/64px_help.png">&nbsp;&nbsp;Forums</h1> <p>Retroshare Forums look like internet forums, but they work in a decentralized way: You see forums your friends are subscribed to, and you forward subscribed forums to your friends. This automatically promotes interesting forums in the network.</p> <p>Forums are either Authenticated (<img src=":/images/konv_message2.png" width="12"/>) in which case you need to cryptographically sign your posts, or anonymous (<img src=":/images/konversation.png" width="12"/>). The former class is more resistant to spamming.</p> <p>Forum posts propagate from friend to friend using small cache file exchanges. When you first connect to a new friend, it's likely you will receive many such cache files, and new forums will appear. </p> </source>
|
<source> <h1><img width="32" src=":/images/64px_help.png">&nbsp;&nbsp;Forums</h1> <p>Retroshare Forums look like internet forums, but they work in a decentralized way: You see forums your friends are subscribed to, and you forward subscribed forums to your friends. This automatically promotes interesting forums in the network.</p> <p>Forums are either Authenticated (<img src=":/images/konv_message2.png" width="12"/>) in which case you need to cryptographically sign your posts, or anonymous (<img src=":/images/konversation.png" width="12"/>). The former class is more resistant to spamming.</p> <p>Forum posts propagate from friend to friend using small cache file exchanges. When you first connect to a new friend, it's likely you will receive many such cache files, and new forums will appear. </p> </source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Load images always for this message</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ForumsFillThread</name>
|
<name>ForumsFillThread</name>
|
||||||
|
@ -6269,10 +6275,6 @@ anonymous, you can use a fake email.</source>
|
||||||
<source>Location</source>
|
<source>Location</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>Put a meaningful location. ex : home, laptop, etc. This field will be used to differentiate different installations with the same identity (PGP key).</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Create new identity</source>
|
<source>Create new identity</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
|
@ -6423,6 +6425,28 @@ Fill in your PGP password when asked, to sign your new key.</source>
|
||||||
<source>Failed to Generate your new Certificate, maybe PGP password is wrong!</source>
|
<source>Failed to Generate your new Certificate, maybe PGP password is wrong!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Password (check)</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source><html><head/><body><p align="justify">Before proceeding, move your mouse around to help Retroshare collect as much randomness as possible. Filling the progressbar to 20% is needed, 100% is advised.</p></body></html></source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>[Required] Type the same password again here.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Put a meaningful location. ex : home, laptop, etc.
|
||||||
|
This field will be used to differentiate different installations with
|
||||||
|
the same identity (PGP key).</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Passwords to not match</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>GeneralPage</name>
|
<name>GeneralPage</name>
|
||||||
|
@ -9075,6 +9099,10 @@ Do you want to save message ?</source>
|
||||||
<source>HTML-Files (*.htm *.html);;All Files (*)</source>
|
<source>HTML-Files (*.htm *.html);;All Files (*)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Load images always for this message</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>MessageWindow</name>
|
<name>MessageWindow</name>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue