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->actionChooseFont, SIGNAL(triggered()), this, SLOT(chooseFont()));
|
||||||
connect(ui->actionChooseColor, SIGNAL(triggered()), this, SLOT(chooseColor()));
|
connect(ui->actionChooseColor, SIGNAL(triggered()), this, SLOT(chooseColor()));
|
||||||
connect(ui->actionResetFont, SIGNAL(triggered()), this, SLOT(resetFont()));
|
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>)));
|
connect(ui->hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
|
||||||
|
|
||||||
@ -974,6 +975,7 @@ void ChatWidget::contextMenuTextBrowser(QPoint point)
|
|||||||
|
|
||||||
contextMnu->addSeparator();
|
contextMnu->addSeparator();
|
||||||
contextMnu->addAction(ui->actionClearChatHistory);
|
contextMnu->addAction(ui->actionClearChatHistory);
|
||||||
|
contextMnu->addAction(ui->actionQuote);
|
||||||
|
|
||||||
contextMnu->exec(ui->textBrowser->viewport()->mapToGlobal(point));
|
contextMnu->exec(ui->textBrowser->viewport()->mapToGlobal(point));
|
||||||
delete(contextMnu);
|
delete(contextMnu);
|
||||||
@ -1661,3 +1663,14 @@ bool ChatWidget::setStyle()
|
|||||||
|
|
||||||
return false;
|
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 messageHistory();
|
||||||
void resetStatusBar() ;
|
void resetStatusBar() ;
|
||||||
void searchHistory();
|
void searchHistory();
|
||||||
|
void quote();
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@ -972,6 +972,14 @@ border-image: url(:/images/closepressed.png)
|
|||||||
<string>Search Box</string>
|
<string>Search Box</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionQuote">
|
||||||
|
<property name="text">
|
||||||
|
<string>Quote</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Quotes the selected text</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user