Merge pull request #955 from PhenomRetroShare/Fix_CopyRSLinkWhenOnlyPlainTextInLobby

Fix copy of RSLink when on Only plain text mode in chat lobby. (sss find)
This commit is contained in:
csoler 2017-07-25 22:23:09 +02:00 committed by GitHub
commit 3ba0256d59
3 changed files with 10 additions and 1 deletions

View File

@ -201,6 +201,8 @@ ChatWidget::ChatWidget(QWidget *parent) :
menu->addMenu(fontmenu);
ui->actionSendAsPlainText->setChecked(Settings->getChatSendAsPlainTextByDef());
ui->chatTextEdit->setOnlyPlainText(ui->actionSendAsPlainText->isChecked());
connect(ui->actionSendAsPlainText, SIGNAL(toggled(bool)), ui->chatTextEdit, SLOT(setOnlyPlainText(bool)) );
ui->textBrowser->resetImagesStatus(Settings->getChatLoadEmbeddedImages());
ui->textBrowser->installEventFilter(this);

View File

@ -42,6 +42,7 @@ MimeTextEdit::MimeTextEdit(QWidget *parent)
mCompleterKey = Qt::Key_Space;
mForceCompleterShowNextKeyEvent = false;
highliter = new RsSyntaxHighlighter(this);
mOnlyPlainText = false;
}
bool MimeTextEdit::canInsertFromMimeData(const QMimeData* source) const
@ -85,7 +86,10 @@ void MimeTextEdit::insertFromMimeData(const QMimeData* source)
if(links.size() > 0)
{
for(int i = 0; i < links.size(); ++i)
insertHtml(links[i].toHtml() + "<br>");
if (mOnlyPlainText)
insertPlainText(links[i].toString());
else
insertHtml(links[i].toHtml() + "<br>");
return;
}

View File

@ -48,9 +48,11 @@ public:
void addContextMenuAction(QAction *action);
QColor textColorQuote() const { return highliter->textColorQuote();}
bool onlyPlainText() const {return mOnlyPlainText;}
public slots:
void setTextColorQuote(QColor textColorQuote) { highliter->setTextColorQuote(textColorQuote);}
void setOnlyPlainText(bool bOnlyPlainText) {mOnlyPlainText = bOnlyPlainText;}
signals:
void calculateContextMenuActions();
@ -80,6 +82,7 @@ private:
QString mCompleterStartString;
QList<QAction*> mContextMenuActions;
RsSyntaxHighlighter *highliter;
bool mOnlyPlainText;
};
#endif // MIMETEXTEDIT_H