mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-25 14:50:54 -04:00
Added a insertPastedText() method to ChanMsgDialog to allow inserting blue text while responding to msg
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@721 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9b0bfb26c2
commit
787159debe
3 changed files with 11 additions and 5 deletions
|
@ -230,11 +230,7 @@ void MessagesDialog::replytomessage()
|
||||||
doc.setHtml(QString::fromStdWString(msgInfo.msg)) ;
|
doc.setHtml(QString::fromStdWString(msgInfo.msg)) ;
|
||||||
std::string cited_text(doc.toPlainText().toStdString()) ;
|
std::string cited_text(doc.toPlainText().toStdString()) ;
|
||||||
|
|
||||||
std::string::size_type i=0 ;
|
nMsgDialog->insertPastedText(cited_text) ;
|
||||||
while( (i=cited_text.find_first_of('\n',i+1)) < cited_text.size())
|
|
||||||
cited_text.replace(i,1,std::string("\n> ")) ;
|
|
||||||
|
|
||||||
nMsgDialog->insertMsgText( std::string("> ") + cited_text ) ;
|
|
||||||
nMsgDialog->addRecipient( msgInfo.srcId ) ;
|
nMsgDialog->addRecipient( msgInfo.srcId ) ;
|
||||||
nMsgDialog->show();
|
nMsgDialog->show();
|
||||||
nMsgDialog->activateWindow();
|
nMsgDialog->activateWindow();
|
||||||
|
|
|
@ -505,6 +505,14 @@ void ChanMsgDialog::insertTitleText(std::string title)
|
||||||
ui.titleEdit->setText(QString::fromStdString(title));
|
ui.titleEdit->setText(QString::fromStdString(title));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ChanMsgDialog::insertPastedText(std::string msg)
|
||||||
|
{
|
||||||
|
std::string::size_type i=0 ;
|
||||||
|
while( (i=msg.find_first_of('\n',i+1)) < msg.size())
|
||||||
|
msg.replace(i,1,std::string("\n<BR/>> ")) ;
|
||||||
|
|
||||||
|
ui.msgText->setHtml(QString("<HTML><font color=\"blue\">")+QString::fromStdString(std::string("> ") + msg)+"</font><br/><br/></HTML>") ;
|
||||||
|
}
|
||||||
|
|
||||||
void ChanMsgDialog::insertMsgText(std::string msg)
|
void ChanMsgDialog::insertMsgText(std::string msg)
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,6 +53,7 @@ void insertSendList(); /* for Msgs */
|
||||||
void insertChannelSendList(); /* for Channels */
|
void insertChannelSendList(); /* for Channels */
|
||||||
void insertFileList(); /* for Both */
|
void insertFileList(); /* for Both */
|
||||||
void insertTitleText(std::string title);
|
void insertTitleText(std::string title);
|
||||||
|
void insertPastedText(std::string msg) ;
|
||||||
void insertMsgText(std::string msg);
|
void insertMsgText(std::string msg);
|
||||||
void addRecipient(std::string id) ;
|
void addRecipient(std::string id) ;
|
||||||
void Create_New_Image_Tag( const QString urlremoteorlocal );
|
void Create_New_Image_Tag( const QString urlremoteorlocal );
|
||||||
|
@ -110,6 +111,7 @@ private slots:
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void setTextColor(const QColor& col) ;
|
||||||
void setupFileActions();
|
void setupFileActions();
|
||||||
void setupEditActions();
|
void setupEditActions();
|
||||||
void setupViewActions();
|
void setupViewActions();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue