mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 07:29:33 -05:00
update the licence & added the changes for Channel message composer
This commit is contained in:
parent
096de94b00
commit
824fc5049b
@ -25,7 +25,7 @@
|
||||
|
||||
#include "util/misc.h"
|
||||
#include "util/TokenQueue.h"
|
||||
#include "util/MRichTextEdit.h"
|
||||
#include "util/RichTextEdit.h"
|
||||
#include "gui/feeds/SubFileItem.h"
|
||||
#include "util/rsdir.h"
|
||||
|
||||
@ -51,7 +51,7 @@ PostedCreatePostDialog::PostedCreatePostDialog(TokenQueue* tokenQ, RsPosted *pos
|
||||
|
||||
setAttribute ( Qt::WA_DeleteOnClose, true );
|
||||
|
||||
ui->MRichTextEditWidget->setPlaceHolderTextPosted();
|
||||
ui->RichTextEditWidget->setPlaceHolderTextPosted();
|
||||
|
||||
/* fill in the available OwnIds for signing */
|
||||
ui->idChooser->loadIds(IDCHOOSER_ID_REQUIRED, RsGxsId());
|
||||
@ -86,7 +86,7 @@ void PostedCreatePostDialog::createPost()
|
||||
post.mLink = std::string(ui->linkEdit->text().toUtf8());
|
||||
|
||||
QString text;
|
||||
text = ui->MRichTextEditWidget->toHtml();
|
||||
text = ui->RichTextEditWidget->toHtml();
|
||||
post.mNotes = std::string(text.toUtf8());
|
||||
|
||||
post.mMeta.mAuthorId = authorId;
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#include <QDialog>
|
||||
#include "retroshare/rsposted.h"
|
||||
#include "util/MRichTextEdit.h"
|
||||
#include "util/RichTextEdit.h"
|
||||
|
||||
class TokenQueue;
|
||||
|
||||
|
@ -278,7 +278,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="1" column="0">
|
||||
<widget class="MRichTextEdit" name="MRichTextEditWidget" native="true"/>
|
||||
<widget class="RichTextEdit" name="RichTextEditWidget" native="true"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLineEdit" name="titleEdit">
|
||||
@ -467,9 +467,9 @@
|
||||
<header>gui/gxs/GxsIdChooser.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>MRichTextEdit</class>
|
||||
<class>RichTextEdit</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>util/MRichTextEdit.h</header>
|
||||
<header>util/RichTextEdit.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "util/HandleRichText.h"
|
||||
#include "util/misc.h"
|
||||
#include "util/rsdir.h"
|
||||
#include "util/RichTextEdit.h"
|
||||
|
||||
#include <retroshare/rsfiles.h>
|
||||
|
||||
@ -55,7 +56,7 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId
|
||||
Settings->loadWidgetInformation(this);
|
||||
mChannelQueue = new TokenQueue(rsGxsChannels->getTokenService(), this);
|
||||
|
||||
headerFrame->setHeaderImage(QPixmap(":/images/channels.png"));
|
||||
headerFrame->setHeaderImage(QPixmap(":/icons/png/channel.png"));
|
||||
|
||||
if(!existing_post.isNull())
|
||||
headerFrame->setHeaderText(tr("Edit Channel Post"));
|
||||
@ -64,17 +65,19 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId
|
||||
|
||||
setAttribute ( Qt::WA_DeleteOnClose, true );
|
||||
|
||||
buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Post"));
|
||||
|
||||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(sendMsg()));
|
||||
connect(buttonBox, SIGNAL(rejected()), this, SLOT(cancelMsg()));
|
||||
|
||||
connect(addFileButton, SIGNAL(clicked() ), this , SLOT(addExtraFile()));
|
||||
connect(addfilepushButton, SIGNAL(clicked() ), this , SLOT(addExtraFile()));
|
||||
|
||||
connect(addThumbnailButton, SIGNAL(clicked() ), this , SLOT(addThumbnail()));
|
||||
connect(thumbNailCb, SIGNAL(toggled(bool)), this, SLOT(allowAutoMediaThumbNail(bool)));
|
||||
connect(tabWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenu(QPoint)));
|
||||
connect(stackedWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenu(QPoint)));
|
||||
connect(generateCheckBox, SIGNAL(toggled(bool)), generateSpinBox, SLOT(setEnabled(bool)));
|
||||
connect(addPictureButton, SIGNAL(clicked()), this, SLOT(addPicture()));
|
||||
connect(msgEdit, SIGNAL(textChanged()), this, SLOT(checkLength()));
|
||||
|
||||
generateSpinBox->setEnabled(false);
|
||||
|
||||
thumbNailCb->setVisible(false);
|
||||
@ -84,7 +87,6 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId
|
||||
thumbNailCb->setVisible(true);
|
||||
thumbNailCb->setEnabled(true);
|
||||
#endif
|
||||
//buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
||||
|
||||
setAcceptDrops(true);
|
||||
|
||||
@ -96,26 +98,6 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId
|
||||
#endif
|
||||
}
|
||||
|
||||
static const uint32_t MAX_ALLOWED_GXS_MESSAGE_SIZE = 199000;
|
||||
|
||||
void CreateGxsChannelMsg::checkLength()
|
||||
{
|
||||
QString text;
|
||||
RsHtml::optimizeHtml(msgEdit, text);
|
||||
std::wstring msg = text.toStdWString();
|
||||
int charRemains = MAX_ALLOWED_GXS_MESSAGE_SIZE - msg.length();
|
||||
if(charRemains >= 0) {
|
||||
text = tr("It remains %1 characters after HTML conversion.").arg(charRemains);
|
||||
infoLabel->setStyleSheet("QLabel#infoLabel { }");
|
||||
}else{
|
||||
text = tr("Warning: This message is too big of %1 characters after HTML conversion.").arg((0-charRemains));
|
||||
infoLabel->setStyleSheet("QLabel#infoLabel {color: red; font: bold; }");
|
||||
}
|
||||
buttonBox->button(QDialogButtonBox::Ok)->setToolTip(text);
|
||||
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(charRemains>=0);
|
||||
infoLabel->setText(text);
|
||||
}
|
||||
|
||||
CreateGxsChannelMsg::~CreateGxsChannelMsg()
|
||||
{
|
||||
Settings->saveWidgetInformation(this);
|
||||
@ -442,7 +424,7 @@ void CreateGxsChannelMsg::addSubject(const QString& text)
|
||||
|
||||
void CreateGxsChannelMsg::addHtmlText(const QString& text)
|
||||
{
|
||||
msgEdit->setHtml(text) ;
|
||||
RichTextEditWidget->setText(text) ;
|
||||
}
|
||||
|
||||
void CreateGxsChannelMsg::addAttachment(const std::string &path)
|
||||
@ -650,8 +632,9 @@ void CreateGxsChannelMsg::sendMsg()
|
||||
|
||||
/* construct message bits */
|
||||
std::string subject = std::string(misc::removeNewLine(subjectEdit->text()).toUtf8());
|
||||
|
||||
QString text;
|
||||
RsHtml::optimizeHtml(msgEdit, text);
|
||||
text = RichTextEditWidget->toHtml();
|
||||
std::string msg = std::string(text.toUtf8());
|
||||
|
||||
std::list<RsGxsFile> files;
|
||||
@ -763,18 +746,6 @@ void CreateGxsChannelMsg::addThumbnail()
|
||||
thumbnail_label->setPixmap(picture);
|
||||
}
|
||||
|
||||
void CreateGxsChannelMsg::addPicture()
|
||||
{
|
||||
QString file;
|
||||
if (misc::getOpenFileName(window(), RshareSettings::LASTDIR_IMAGES, tr("Load Picture File"), "Pictures (*.png *.xpm *.jpg *.jpeg)", file)) {
|
||||
QString encodedImage;
|
||||
if (RsHtml::makeEmbeddedImage(file, encodedImage, 640*480, MAX_ALLOWED_GXS_MESSAGE_SIZE - 200)) {
|
||||
QTextDocumentFragment fragment = QTextDocumentFragment::fromHtml(encodedImage);
|
||||
msgEdit->textCursor().insertFragment(fragment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CreateGxsChannelMsg::loadChannelPostInfo(const uint32_t &token)
|
||||
{
|
||||
#ifdef DEBUG_CREATE_GXS_MSG
|
||||
@ -801,13 +772,16 @@ void CreateGxsChannelMsg::loadChannelPostInfo(const uint32_t &token)
|
||||
}
|
||||
|
||||
subjectEdit->setText(QString::fromUtf8(post.mMeta.mMsgName.c_str())) ;
|
||||
msgEdit->setText(QString::fromUtf8(post.mMsg.c_str())) ;
|
||||
RichTextEditWidget->setText(QString::fromUtf8(post.mMsg.c_str()));
|
||||
|
||||
for(std::list<RsGxsFile>::const_iterator it(post.mFiles.begin());it!=post.mFiles.end();++it)
|
||||
addAttachment(it->mHash,it->mName,it->mSize,true,RsPeerId(),true);
|
||||
|
||||
if(post.mThumbnail.mData != NULL)
|
||||
{
|
||||
GxsIdDetails::loadPixmapFromData(post.mThumbnail.mData,post.mThumbnail.mSize,picture,GxsIdDetails::ORIGINAL);
|
||||
thumbnail_label->setPixmap(picture);
|
||||
}
|
||||
}
|
||||
|
||||
void CreateGxsChannelMsg::loadChannelInfo(const uint32_t &token)
|
||||
@ -856,3 +830,13 @@ void CreateGxsChannelMsg::loadRequest(const TokenQueue *queue, const TokenReques
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CreateGxsChannelMsg::on_channelpostButton_clicked()
|
||||
{
|
||||
stackedWidget->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
void CreateGxsChannelMsg::on_attachmentsButton_clicked()
|
||||
{
|
||||
stackedWidget->setCurrentIndex(1);
|
||||
}
|
||||
|
@ -69,10 +69,10 @@ private slots:
|
||||
void contextMenu(QPoint) ;
|
||||
|
||||
void addThumbnail();
|
||||
void addPicture();
|
||||
void checkLength();
|
||||
void allowAutoMediaThumbNail(bool);
|
||||
|
||||
void on_channelpostButton_clicked();
|
||||
void on_attachmentsButton_clicked();
|
||||
private:
|
||||
void loadChannelInfo(const uint32_t &token);
|
||||
void loadChannelPostInfo(const uint32_t &token);
|
||||
|
@ -37,7 +37,11 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="HeaderFrame" name="headerFrame"/>
|
||||
<widget class="HeaderFrame" name="headerFrame">
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QFrame" name="mainFrame">
|
||||
@ -47,9 +51,56 @@
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="mainFrameGLayout">
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<widget class="QPushButton" name="channelpostButton">
|
||||
<property name="text">
|
||||
<string>Channel Post</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/comment.png</normaloff>:/icons/png/comment.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="attachmentsButton">
|
||||
<property name="text">
|
||||
<string>Attachments</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/attachements.png</normaloff>:/icons/png/attachements.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>486</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="3">
|
||||
<widget class="QStackedWidget" name="stackedWidget">
|
||||
<property name="mouseTracking">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@ -62,15 +113,138 @@
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="channelPostTab">
|
||||
<attribute name="title">
|
||||
<string>Channel Post</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="channelPostTabGLayout">
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QWidget" name="stackedWidgetPage1">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="1" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QLabel" name="thumbnail_label">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>156</width>
|
||||
<height>107</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="sizeIncrement">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../images.qrc">:/images/thumb-default-video.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="4">
|
||||
<widget class="QLabel" name="channelAttachLabel">
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:600;">Attachments:</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/images/feedback_arrow.png" /><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> Use Drag and Drop / Add Files button, to Hash new files.</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/images/feedback_arrow.png" /><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> Copy/Paste RetroShare links from your shares</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="addThumbnailButton">
|
||||
<property name="text">
|
||||
<string>Add Channel Thumbnail</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/add-image.png</normaloff>:/icons/png/add-image.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="addfilepushButton">
|
||||
<property name="text">
|
||||
<string>Add File to Attach</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/add-file.png</normaloff>:/icons/png/add-file.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3" colspan="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QGroupBox" name="messageGBox">
|
||||
<property name="title">
|
||||
<string>Message</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLineEdit" name="subjectEdit">
|
||||
<property name="placeholderText">
|
||||
<string>Title</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="RichTextEdit" name="RichTextEditWidget" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="channelNameHLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="channelNameLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
@ -94,138 +268,22 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QGridLayout" name="channelAttachGLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="addfilepushButton">
|
||||
<property name="text">
|
||||
<string>Add File to Attach</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/add-share24.png</normaloff>:/images/add-share24.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="addThumbnailButton">
|
||||
<property name="text">
|
||||
<string>Add Channel Thumbnail</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/add_image24.png</normaloff>:/images/add_image24.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="addPictureButton">
|
||||
<property name="text">
|
||||
<string>Add Picture</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/add_image24.png</normaloff>:/images/add_image24.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QLabel" name="channelAttachLabel">
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:600;">Attachments:</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/images/feedback_arrow.png" /><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> Use Drag and Drop / Add Files button, to Hash new files.</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/images/feedback_arrow.png" /><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> Copy/Paste RetroShare links from your shares</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="thumbnail_label">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>156</width>
|
||||
<height>107</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="sizeIncrement">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../images.qrc">:/images/thumb-default-video.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>12</width>
|
||||
<height>98</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="3">
|
||||
<widget class="QGroupBox" name="messageGBox">
|
||||
<property name="title">
|
||||
<string>Message</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="messageGBoxVLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="subjectHLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="subjectLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Subject :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="subjectEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="MimeTextEdit" name="msgEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="infoLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="attachmentsTab">
|
||||
<attribute name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/attachment.png</normaloff>:/images/attachment.png</iconset>
|
||||
</attribute>
|
||||
<attribute name="title">
|
||||
<string>Attachments</string>
|
||||
</attribute>
|
||||
<widget class="QWidget" name="stackedWidgetPage2">
|
||||
<layout class="QGridLayout" name="attachmentsTabGLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="attachmentsPixLabel">
|
||||
<property name="text">
|
||||
@ -286,8 +344,8 @@ p, li { white-space: pre-wrap; }
|
||||
<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/add-file.png</normaloff>:/icons/png/add-file.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@ -320,7 +378,7 @@ p, li { white-space: pre-wrap; }
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>812</width>
|
||||
<width>81</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -371,7 +429,7 @@ p, li { white-space: pre-wrap; }
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="2" column="0" colspan="3">
|
||||
<layout class="QHBoxLayout" name="buttonHLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="generateCheckBox">
|
||||
@ -392,6 +450,9 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
@ -408,19 +469,21 @@ p, li { white-space: pre-wrap; }
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>MimeTextEdit</class>
|
||||
<extends>QTextEdit</extends>
|
||||
<header location="global">gui/common/MimeTextEdit.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>HeaderFrame</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>gui/common/HeaderFrame.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>RichTextEdit</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>util/RichTextEdit.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../icons.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
|
@ -306,5 +306,8 @@
|
||||
<file>icons/textedit/redo.png</file>
|
||||
<file>icons/textedit/undo.png</file>
|
||||
<file>icons/textedit/settings.png</file>
|
||||
<file>icons/png/add-file.png</file>
|
||||
<file>icons/png/add-image.png</file>
|
||||
<file>icons/png/attachements.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
BIN
retroshare-gui/src/gui/icons/png/add-file.png
Normal file
BIN
retroshare-gui/src/gui/icons/png/add-file.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
BIN
retroshare-gui/src/gui/icons/png/add-image.png
Normal file
BIN
retroshare-gui/src/gui/icons/png/add-image.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
BIN
retroshare-gui/src/gui/icons/png/attachements.png
Normal file
BIN
retroshare-gui/src/gui/icons/png/attachements.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
@ -626,7 +626,7 @@ HEADERS += rshare.h \
|
||||
gui/statistics/BWGraph.h \
|
||||
util/RsSyntaxHighlighter.h \
|
||||
util/imageutil.h \
|
||||
util/MRichTextEdit.h \
|
||||
util/RichTextEdit.h \
|
||||
gui/NetworkDialog/pgpid_item_model.h \
|
||||
gui/NetworkDialog/pgpid_item_proxy.h \
|
||||
gui/common/RsCollection.h \
|
||||
@ -749,7 +749,7 @@ FORMS += gui/StartDialog.ui \
|
||||
gui/statistics/BwCtrlWindow.ui \
|
||||
gui/statistics/RttStatistics.ui \
|
||||
gui/GetStartedDialog.ui \
|
||||
util/MRichTextEdit.ui
|
||||
util/RichTextEdit.ui
|
||||
|
||||
|
||||
# gui/ForumsDialog.ui \
|
||||
@ -827,7 +827,7 @@ SOURCES += main.cpp \
|
||||
util/HandleRichText.cpp \
|
||||
util/ObjectPainter.cpp \
|
||||
util/RsFile.cpp \
|
||||
util/MRichTextEdit.cpp \
|
||||
util/RichTextEdit.cpp \
|
||||
gui/profile/ProfileWidget.cpp \
|
||||
gui/profile/StatusMessage.cpp \
|
||||
gui/profile/ProfileManager.cpp \
|
||||
|
@ -1,29 +1,24 @@
|
||||
/*
|
||||
** Copyright (C) 2019 by defnax <retroshare.project@gmail.com>
|
||||
**
|
||||
** Copyright (C) 2013 Jiří Procházka (Hobrasoft)
|
||||
** Contact: http://www.hobrasoft.cz/
|
||||
**
|
||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** This file is under the terms of the GNU Lesser General Public License
|
||||
** version 2.1 as published by the Free Software Foundation and appearing
|
||||
** in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the
|
||||
** GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
*/
|
||||
/*******************************************************************************
|
||||
* util/RichTextEdit.cpp *
|
||||
* *
|
||||
* Copyright (c) 2019 Retroshare Team <retroshare.project@gmail.com> *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Affero General Public License as *
|
||||
* published by the Free Software Foundation, either version 3 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 Affero General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Affero General Public License *
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
#include "MRichTextEdit.h"
|
||||
#include "RichTextEdit.h"
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QMimeData>
|
||||
@ -47,7 +42,7 @@
|
||||
|
||||
static const uint32_t MAX_ALLOWED_GXS_MESSAGE_SIZE = 199000;
|
||||
|
||||
MRichTextEdit::MRichTextEdit(QWidget *parent) : QWidget(parent) {
|
||||
RichTextEdit::RichTextEdit(QWidget *parent) : QWidget(parent) {
|
||||
setupUi(this);
|
||||
m_lastBlockList = 0;
|
||||
f_textedit->setTabStopWidth(40);
|
||||
@ -203,7 +198,7 @@ MRichTextEdit::MRichTextEdit(QWidget *parent) : QWidget(parent) {
|
||||
}
|
||||
|
||||
|
||||
void MRichTextEdit::textSource() {
|
||||
void RichTextEdit::textSource() {
|
||||
QDialog *dialog = new QDialog(this);
|
||||
QPlainTextEdit *pte = new QPlainTextEdit(dialog);
|
||||
pte->setPlainText( f_textedit->toHtml() );
|
||||
@ -220,7 +215,7 @@ void MRichTextEdit::textSource() {
|
||||
}
|
||||
|
||||
|
||||
void MRichTextEdit::textRemoveFormat() {
|
||||
void RichTextEdit::textRemoveFormat() {
|
||||
QTextCharFormat fmt;
|
||||
fmt.setFontWeight(QFont::Normal);
|
||||
fmt.setFontUnderline (false);
|
||||
@ -246,7 +241,7 @@ void MRichTextEdit::textRemoveFormat() {
|
||||
}
|
||||
|
||||
|
||||
void MRichTextEdit::textRemoveAllFormat() {
|
||||
void RichTextEdit::textRemoveAllFormat() {
|
||||
f_bold ->setChecked(false);
|
||||
f_underline ->setChecked(false);
|
||||
f_italic ->setChecked(false);
|
||||
@ -257,37 +252,37 @@ void MRichTextEdit::textRemoveAllFormat() {
|
||||
}
|
||||
|
||||
|
||||
void MRichTextEdit::textBold() {
|
||||
void RichTextEdit::textBold() {
|
||||
QTextCharFormat fmt;
|
||||
fmt.setFontWeight(f_bold->isChecked() ? QFont::Bold : QFont::Normal);
|
||||
mergeFormatOnWordOrSelection(fmt);
|
||||
}
|
||||
|
||||
|
||||
void MRichTextEdit::focusInEvent(QFocusEvent *) {
|
||||
void RichTextEdit::focusInEvent(QFocusEvent *) {
|
||||
f_textedit->setFocus(Qt::TabFocusReason);
|
||||
}
|
||||
|
||||
|
||||
void MRichTextEdit::textUnderline() {
|
||||
void RichTextEdit::textUnderline() {
|
||||
QTextCharFormat fmt;
|
||||
fmt.setFontUnderline(f_underline->isChecked());
|
||||
mergeFormatOnWordOrSelection(fmt);
|
||||
}
|
||||
|
||||
void MRichTextEdit::textItalic() {
|
||||
void RichTextEdit::textItalic() {
|
||||
QTextCharFormat fmt;
|
||||
fmt.setFontItalic(f_italic->isChecked());
|
||||
mergeFormatOnWordOrSelection(fmt);
|
||||
}
|
||||
|
||||
void MRichTextEdit::textStrikeout() {
|
||||
void RichTextEdit::textStrikeout() {
|
||||
QTextCharFormat fmt;
|
||||
fmt.setFontStrikeOut(f_strikeout->isChecked());
|
||||
mergeFormatOnWordOrSelection(fmt);
|
||||
}
|
||||
|
||||
void MRichTextEdit::textSize(const QString &p) {
|
||||
void RichTextEdit::textSize(const QString &p) {
|
||||
qreal pointSize = p.toFloat();
|
||||
if (p.toFloat() > 0) {
|
||||
QTextCharFormat fmt;
|
||||
@ -296,7 +291,7 @@ void MRichTextEdit::textSize(const QString &p) {
|
||||
}
|
||||
}
|
||||
|
||||
void MRichTextEdit::textLink(bool checked) {
|
||||
void RichTextEdit::textLink(bool checked) {
|
||||
bool unlink = false;
|
||||
QTextCharFormat fmt;
|
||||
if (checked) {
|
||||
@ -325,7 +320,7 @@ void MRichTextEdit::textLink(bool checked) {
|
||||
mergeFormatOnWordOrSelection(fmt);
|
||||
}
|
||||
|
||||
void MRichTextEdit::textStyle(int index) {
|
||||
void RichTextEdit::textStyle(int index) {
|
||||
QTextCursor cursor = f_textedit->textCursor();
|
||||
cursor.beginEditBlock();
|
||||
|
||||
@ -371,7 +366,7 @@ void MRichTextEdit::textStyle(int index) {
|
||||
cursor.endEditBlock();
|
||||
}
|
||||
|
||||
void MRichTextEdit::textFgColor() {
|
||||
void RichTextEdit::textFgColor() {
|
||||
QColor col = QColorDialog::getColor(f_textedit->textColor(), this);
|
||||
QTextCursor cursor = f_textedit->textCursor();
|
||||
if (!cursor.hasSelection()) {
|
||||
@ -388,7 +383,7 @@ void MRichTextEdit::textFgColor() {
|
||||
fgColorChanged(col);
|
||||
}
|
||||
|
||||
void MRichTextEdit::textBgColor() {
|
||||
void RichTextEdit::textBgColor() {
|
||||
QColor col = QColorDialog::getColor(f_textedit->textBackgroundColor(), this);
|
||||
QTextCursor cursor = f_textedit->textCursor();
|
||||
if (!cursor.hasSelection()) {
|
||||
@ -405,21 +400,21 @@ void MRichTextEdit::textBgColor() {
|
||||
bgColorChanged(col);
|
||||
}
|
||||
|
||||
void MRichTextEdit::listBullet(bool checked) {
|
||||
void RichTextEdit::listBullet(bool checked) {
|
||||
if (checked) {
|
||||
f_list_ordered->setChecked(false);
|
||||
}
|
||||
list(checked, QTextListFormat::ListDisc);
|
||||
}
|
||||
|
||||
void MRichTextEdit::listOrdered(bool checked) {
|
||||
void RichTextEdit::listOrdered(bool checked) {
|
||||
if (checked) {
|
||||
f_list_bullet->setChecked(false);
|
||||
}
|
||||
list(checked, QTextListFormat::ListDecimal);
|
||||
}
|
||||
|
||||
void MRichTextEdit::list(bool checked, QTextListFormat::Style style) {
|
||||
void RichTextEdit::list(bool checked, QTextListFormat::Style style) {
|
||||
QTextCursor cursor = f_textedit->textCursor();
|
||||
cursor.beginEditBlock();
|
||||
if (!checked) {
|
||||
@ -438,7 +433,7 @@ void MRichTextEdit::list(bool checked, QTextListFormat::Style style) {
|
||||
cursor.endEditBlock();
|
||||
}
|
||||
|
||||
void MRichTextEdit::mergeFormatOnWordOrSelection(const QTextCharFormat &format) {
|
||||
void RichTextEdit::mergeFormatOnWordOrSelection(const QTextCharFormat &format) {
|
||||
QTextCursor cursor = f_textedit->textCursor();
|
||||
if (!cursor.hasSelection()) {
|
||||
cursor.select(QTextCursor::WordUnderCursor);
|
||||
@ -448,7 +443,7 @@ void MRichTextEdit::mergeFormatOnWordOrSelection(const QTextCharFormat &format)
|
||||
f_textedit->setFocus(Qt::TabFocusReason);
|
||||
}
|
||||
|
||||
void MRichTextEdit::slotCursorPositionChanged() {
|
||||
void RichTextEdit::slotCursorPositionChanged() {
|
||||
QTextList *l = f_textedit->textCursor().currentList();
|
||||
if (m_lastBlockList && (l == m_lastBlockList || (l != 0 && m_lastBlockList != 0
|
||||
&& l->format().style() == m_lastBlockList->format().style()))) {
|
||||
@ -473,7 +468,7 @@ void MRichTextEdit::slotCursorPositionChanged() {
|
||||
}
|
||||
}
|
||||
|
||||
void MRichTextEdit::fontChanged(const QFont &f) {
|
||||
void RichTextEdit::fontChanged(const QFont &f) {
|
||||
f_fontsize->setCurrentIndex(f_fontsize->findText(QString::number(f.pointSize())));
|
||||
f_bold->setChecked(f.bold());
|
||||
f_italic->setChecked(f.italic());
|
||||
@ -512,7 +507,7 @@ void MRichTextEdit::fontChanged(const QFont &f) {
|
||||
}
|
||||
}
|
||||
|
||||
void MRichTextEdit::fgColorChanged(const QColor &c) {
|
||||
void RichTextEdit::fgColorChanged(const QColor &c) {
|
||||
QPixmap pix(16, 16);
|
||||
if (c.isValid()) {
|
||||
pix.fill(c);
|
||||
@ -522,7 +517,7 @@ void MRichTextEdit::fgColorChanged(const QColor &c) {
|
||||
f_fgcolor->setIcon(pix);
|
||||
}
|
||||
|
||||
void MRichTextEdit::bgColorChanged(const QColor &c) {
|
||||
void RichTextEdit::bgColorChanged(const QColor &c) {
|
||||
QPixmap pix(16, 16);
|
||||
if (c.isValid()) {
|
||||
pix.fill(c);
|
||||
@ -532,21 +527,21 @@ void MRichTextEdit::bgColorChanged(const QColor &c) {
|
||||
f_bgcolor->setIcon(pix);
|
||||
}
|
||||
|
||||
void MRichTextEdit::slotCurrentCharFormatChanged(const QTextCharFormat &format) {
|
||||
void RichTextEdit::slotCurrentCharFormatChanged(const QTextCharFormat &format) {
|
||||
fontChanged(format.font());
|
||||
bgColorChanged((format.background().isOpaque()) ? format.background().color() : QColor());
|
||||
fgColorChanged((format.foreground().isOpaque()) ? format.foreground().color() : QColor());
|
||||
f_link->setChecked(format.isAnchor());
|
||||
}
|
||||
|
||||
void MRichTextEdit::slotClipboardDataChanged() {
|
||||
void RichTextEdit::slotClipboardDataChanged() {
|
||||
#ifndef QT_NO_CLIPBOARD
|
||||
if (const QMimeData *md = QApplication::clipboard()->mimeData())
|
||||
f_paste->setEnabled(md->hasText());
|
||||
#endif
|
||||
}
|
||||
|
||||
QString MRichTextEdit::toHtml() const {
|
||||
QString RichTextEdit::toHtml() const {
|
||||
QString s = f_textedit->toHtml();
|
||||
// convert emails to links
|
||||
s = s.replace(QRegExp("(<[^a][^>]+>(?:<span[^>]+>)?|\\s)([a-zA-Z\\d]+@[a-zA-Z\\d]+\\.[a-zA-Z]+)"), "\\1<a href=\"mailto:\\2\">\\2</a>");
|
||||
@ -556,15 +551,15 @@ QString MRichTextEdit::toHtml() const {
|
||||
return s;
|
||||
}
|
||||
|
||||
void MRichTextEdit::increaseIndentation() {
|
||||
void RichTextEdit::increaseIndentation() {
|
||||
indent(+1);
|
||||
}
|
||||
|
||||
void MRichTextEdit::decreaseIndentation() {
|
||||
void RichTextEdit::decreaseIndentation() {
|
||||
indent(-1);
|
||||
}
|
||||
|
||||
void MRichTextEdit::indent(int delta) {
|
||||
void RichTextEdit::indent(int delta) {
|
||||
QTextCursor cursor = f_textedit->textCursor();
|
||||
cursor.beginEditBlock();
|
||||
QTextBlockFormat bfmt = cursor.blockFormat();
|
||||
@ -576,7 +571,7 @@ void MRichTextEdit::indent(int delta) {
|
||||
cursor.endEditBlock();
|
||||
}
|
||||
|
||||
void MRichTextEdit::setText(const QString& text) {
|
||||
void RichTextEdit::setText(const QString& text) {
|
||||
if (text.isEmpty()) {
|
||||
setPlainText(text);
|
||||
return;
|
||||
@ -588,7 +583,7 @@ void MRichTextEdit::setText(const QString& text) {
|
||||
}
|
||||
}
|
||||
|
||||
void MRichTextEdit::insertImage() {
|
||||
void RichTextEdit::insertImage() {
|
||||
QString file;
|
||||
if (misc::getOpenFileName(window(), RshareSettings::LASTDIR_IMAGES, tr("Load Picture File"), "Pictures (*.png *.xpm *.jpg *.jpeg)", file)) {
|
||||
QString encodedImage;
|
||||
@ -599,7 +594,7 @@ void MRichTextEdit::insertImage() {
|
||||
}
|
||||
}
|
||||
|
||||
void MRichTextEdit::checkLength(){
|
||||
void RichTextEdit::checkLength(){
|
||||
QString text;
|
||||
RsHtml::optimizeHtml(f_textedit, text);
|
||||
std::wstring msg = text.toStdWString();
|
||||
@ -615,6 +610,7 @@ void MRichTextEdit::checkLength(){
|
||||
f_info->setText(text);
|
||||
}
|
||||
|
||||
void MRichTextEdit::setPlaceHolderTextPosted() {
|
||||
|
||||
void RichTextEdit::setPlaceHolderTextPosted() {
|
||||
f_textedit->setPlaceholderText(tr("Text (optional)"));
|
||||
}
|
@ -1,41 +1,36 @@
|
||||
/*
|
||||
** Copyright (C) 2019 by defnax <retroshare.project@gmail.com>
|
||||
**
|
||||
** Copyright (C) 2013 Jiří Procházka (Hobrasoft)
|
||||
** Contact: http://www.hobrasoft.cz/
|
||||
**
|
||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** This file is under the terms of the GNU Lesser General Public License
|
||||
** version 2.1 as published by the Free Software Foundation and appearing
|
||||
** in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the
|
||||
** GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
*/
|
||||
/*******************************************************************************
|
||||
* util/RichTextEdit.h *
|
||||
* *
|
||||
* Copyright (c) 2019 Retroshare Team <retroshare.project@gmail.com> *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Affero General Public License as *
|
||||
* published by the Free Software Foundation, either version 3 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 Affero General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Affero General Public License *
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef _MRICHTEXTEDIT_H_
|
||||
#define _MRICHTEXTEDIT_H_
|
||||
#ifndef _RICHTEXTEDIT_H_
|
||||
#define _RICHTEXTEDIT_H_
|
||||
|
||||
#include <QPointer>
|
||||
#include "ui_MRichTextEdit.h"
|
||||
#include "ui_RichTextEdit.h"
|
||||
|
||||
/**
|
||||
* @Brief A simple rich-text editor
|
||||
*/
|
||||
class MRichTextEdit : public QWidget, protected Ui::MRichTextEdit {
|
||||
class RichTextEdit : public QWidget, protected Ui::RichTextEdit {
|
||||
Q_OBJECT
|
||||
public:
|
||||
MRichTextEdit(QWidget *parent = 0);
|
||||
RichTextEdit(QWidget *parent = 0);
|
||||
|
||||
QString toPlainText() const { return f_textedit->toPlainText(); }
|
||||
QString toHtml() const;
|
@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MRichTextEdit</class>
|
||||
<widget class="QWidget" name="MRichTextEdit">
|
||||
<class>RichTextEdit</class>
|
||||
<widget class="QWidget" name="RichTextEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>699</width>
|
||||
<width>703</width>
|
||||
<height>312</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -62,6 +62,12 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="f_fontsize">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MS Sans Serif</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::ClickFocus</enum>
|
||||
</property>
|
||||
@ -557,6 +563,12 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="MimeTextEdit" name="f_textedit">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MS Sans Serif</family>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="autoFormatting">
|
||||
<set>QTextEdit::AutoNone</set>
|
||||
</property>
|
Loading…
Reference in New Issue
Block a user