mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
gui: do not show the quote section of context menu in chat if
no text selected
This commit is contained in:
parent
b3fb7abf99
commit
74075fdded
@ -1103,11 +1103,8 @@ void ChatWidget::contextMenuTextBrowser(QPoint point)
|
||||
|
||||
contextMnu->addSeparator();
|
||||
contextMnu->addAction(ui->actionClearChatHistory);
|
||||
contextMnu->addAction(ui->actionQuote);
|
||||
if (ui->textBrowser->textCursor().selection().toPlainText().length() == 0)
|
||||
ui->actionQuote->setEnabled(false);
|
||||
else
|
||||
ui->actionQuote->setEnabled(true);
|
||||
if (ui->textBrowser->textCursor().selection().toPlainText().length())
|
||||
contextMnu->addAction(ui->actionQuote);
|
||||
contextMnu->addAction(ui->actionDropPlacemark);
|
||||
|
||||
if(ui->textBrowser->checkImage(point))
|
||||
@ -1829,13 +1826,10 @@ bool ChatWidget::setStyle()
|
||||
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> ");
|
||||
text.replace(QChar(-4)," ");//Char used when image on text.
|
||||
emit ui->chatTextEdit->append(QString("> ") + text);
|
||||
}
|
||||
QStringList sl = text.split(QRegExp("[\r\n]"), QString::SkipEmptyParts);
|
||||
text = sl.join("\n> ");
|
||||
text.replace(QChar(-4), " "); // Char used when image on text.
|
||||
emit ui->chatTextEdit->append(QString("> ") + text);
|
||||
}
|
||||
|
||||
void ChatWidget::dropPlacemark()
|
||||
|
Loading…
Reference in New Issue
Block a user