mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-04 17:15:31 -05:00
Quote function on chat
select text --> right click --> Quote
This commit is contained in:
parent
0aa82c852b
commit
0b92c79eb0
@ -125,6 +125,7 @@ ChatWidget::ChatWidget(QWidget *parent) :
|
||||
connect(ui->actionChooseFont, SIGNAL(triggered()), this, SLOT(chooseFont()));
|
||||
connect(ui->actionChooseColor, SIGNAL(triggered()), this, SLOT(chooseColor()));
|
||||
connect(ui->actionResetFont, SIGNAL(triggered()), this, SLOT(resetFont()));
|
||||
connect(ui->actionQuote, SIGNAL(triggered()), this, SLOT(quote()));
|
||||
|
||||
connect(ui->hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
|
||||
|
||||
@ -974,6 +975,7 @@ void ChatWidget::contextMenuTextBrowser(QPoint point)
|
||||
|
||||
contextMnu->addSeparator();
|
||||
contextMnu->addAction(ui->actionClearChatHistory);
|
||||
contextMnu->addAction(ui->actionQuote);
|
||||
|
||||
contextMnu->exec(ui->textBrowser->viewport()->mapToGlobal(point));
|
||||
delete(contextMnu);
|
||||
@ -1661,3 +1663,14 @@ bool ChatWidget::setStyle()
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ChatWidget::quote()
|
||||
{
|
||||
QString text = ui->textBrowser->textCursor().selection().toPlainText();
|
||||
if(text.length() > 0)
|
||||
{
|
||||
QStringList sl = text.split(QRegExp("[\r\n]"),QString::SkipEmptyParts);
|
||||
text = sl.join("\n>");
|
||||
emit ui->chatTextEdit->append(QString(">") + text);
|
||||
}
|
||||
}
|
||||
|
@ -133,6 +133,7 @@ private slots:
|
||||
void messageHistory();
|
||||
void resetStatusBar() ;
|
||||
void searchHistory();
|
||||
void quote();
|
||||
|
||||
|
||||
signals:
|
||||
|
@ -972,6 +972,14 @@ border-image: url(:/images/closepressed.png)
|
||||
<string>Search Box</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionQuote">
|
||||
<property name="text">
|
||||
<string>Quote</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Quotes the selected text</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
Loading…
x
Reference in New Issue
Block a user