|
|
@ -191,6 +191,10 @@ GenericChatForm::GenericChatForm(QWidget *parent) |
|
|
|
QString(), this, SLOT(onSaveLogClicked())); |
|
|
|
QString(), this, SLOT(onSaveLogClicked())); |
|
|
|
clearAction = menu.addAction(QIcon::fromTheme("edit-clear"), |
|
|
|
clearAction = menu.addAction(QIcon::fromTheme("edit-clear"), |
|
|
|
QString(), this, SLOT(clearChatArea(bool))); |
|
|
|
QString(), this, SLOT(clearChatArea(bool))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
quoteAction = menu.addAction(QIcon(), |
|
|
|
|
|
|
|
QString(), this, SLOT(quoteSelectedText())); |
|
|
|
|
|
|
|
|
|
|
|
menu.addSeparator(); |
|
|
|
menu.addSeparator(); |
|
|
|
|
|
|
|
|
|
|
|
connect(emoteButton, &QPushButton::clicked, |
|
|
|
connect(emoteButton, &QPushButton::clicked, |
|
|
@ -199,6 +203,7 @@ GenericChatForm::GenericChatForm(QWidget *parent) |
|
|
|
this, &GenericChatForm::onChatContextMenuRequested); |
|
|
|
this, &GenericChatForm::onChatContextMenuRequested); |
|
|
|
|
|
|
|
|
|
|
|
new QShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_L, this, SLOT(clearChatArea())); |
|
|
|
new QShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_L, this, SLOT(clearChatArea())); |
|
|
|
|
|
|
|
new QShortcut(Qt::ALT + Qt::Key_Q, this, SLOT(quoteSelectedText())); |
|
|
|
|
|
|
|
|
|
|
|
chatWidget->setStyleSheet(Style::getStylesheet(":/ui/chatArea/chatArea.css")); |
|
|
|
chatWidget->setStyleSheet(Style::getStylesheet(":/ui/chatArea/chatArea.css")); |
|
|
|
headWidget->setStyleSheet(Style::getStylesheet(":/ui/chatArea/chatHead.css")); |
|
|
|
headWidget->setStyleSheet(Style::getStylesheet(":/ui/chatArea/chatHead.css")); |
|
|
@ -562,6 +567,26 @@ void GenericChatForm::onShowMessagesClicked() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GenericChatForm::quoteSelectedText() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
QString selectedText = chatWidget->getSelectedText(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (selectedText.isEmpty()) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// forming pretty quote text
|
|
|
|
|
|
|
|
// 1. insert "> " to the begining of quote;
|
|
|
|
|
|
|
|
// 2. replace all possible line terminators with "\n> ";
|
|
|
|
|
|
|
|
// 3. append new line to the end of quote.
|
|
|
|
|
|
|
|
QString quote = selectedText; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
quote.insert(0, "> "); |
|
|
|
|
|
|
|
quote.replace(QRegExp(QString("\r\n|[\r\n\u2028\u2029]")), QString("\n> ")); |
|
|
|
|
|
|
|
quote.append("\n"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msgEdit->append(quote); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void GenericChatForm::retranslateUi() |
|
|
|
void GenericChatForm::retranslateUi() |
|
|
|
{ |
|
|
|
{ |
|
|
|
QString callObjectName = callButton->objectName(); |
|
|
|
QString callObjectName = callButton->objectName(); |
|
|
@ -587,6 +612,7 @@ void GenericChatForm::retranslateUi() |
|
|
|
screenshotButton->setToolTip(tr("Send a screenshot")); |
|
|
|
screenshotButton->setToolTip(tr("Send a screenshot")); |
|
|
|
saveChatAction->setText(tr("Save chat log")); |
|
|
|
saveChatAction->setText(tr("Save chat log")); |
|
|
|
clearAction->setText(tr("Clear displayed messages")); |
|
|
|
clearAction->setText(tr("Clear displayed messages")); |
|
|
|
|
|
|
|
quoteAction->setText(tr("Quote selected text")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void GenericChatForm::showNetcam() |
|
|
|
void GenericChatForm::showNetcam() |
|
|
|