mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-06 08:05:18 -04:00
merged with latest master before creating PR
This commit is contained in:
commit
9193d3579b
294 changed files with 13080 additions and 8470 deletions
|
@ -214,7 +214,7 @@ void ChatWidget::setDefaultExtraFileFlags(TransferRequestFlags fl)
|
|||
|
||||
void ChatWidget::addChatHorizontalWidget(QWidget *w)
|
||||
{
|
||||
ui->verticalLayout_2->addWidget(w) ;
|
||||
ui->vl_Plugins->addWidget(w) ;
|
||||
update() ;
|
||||
}
|
||||
|
||||
|
@ -223,9 +223,15 @@ void ChatWidget::addChatBarWidget(QWidget *w)
|
|||
ui->pluginButtonFrame->layout()->addWidget(w) ;
|
||||
}
|
||||
|
||||
void ChatWidget::addVOIPBarWidget(QWidget *w)
|
||||
void ChatWidget::addTitleBarWidget(QWidget *w)
|
||||
{
|
||||
ui->titleBarFrame->layout()->addWidget(w) ;
|
||||
ui->pluginTitleFrame->layout()->addWidget(w) ;
|
||||
}
|
||||
|
||||
void ChatWidget::hideChatText(bool hidden)
|
||||
{
|
||||
ui->frame_ChatText->setHidden(hidden); ;
|
||||
ui->searchframe->setVisible(ui->actionSearch_History->isChecked() && !hidden); ;
|
||||
}
|
||||
|
||||
RSButtonOnText* ChatWidget::getNewButtonOnTextBrowser()
|
||||
|
@ -489,10 +495,10 @@ bool ChatWidget::eventFilter(QObject *obj, QEvent *event)
|
|||
|
||||
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
|
||||
if (keyEvent) {
|
||||
if (notify && keyEvent->key() == Qt::Key_Delete) {
|
||||
if (keyEvent->key() == Qt::Key_Delete) {
|
||||
// Delete key pressed
|
||||
if (ui->textBrowser->textCursor().selectedText().length() > 0) {
|
||||
if (chatType() == CHATTYPE_LOBBY) {
|
||||
if (notify && chatType() == CHATTYPE_LOBBY) {
|
||||
QRegExp rx("<a name=\"(.*)\"",Qt::CaseSensitive, QRegExp::RegExp2);
|
||||
rx.setMinimal(true);
|
||||
QString sel=ui->textBrowser->textCursor().selection().toHtml();
|
||||
|
@ -840,6 +846,13 @@ void ChatWidget::setWelcomeMessage(QString &text)
|
|||
}
|
||||
|
||||
void ChatWidget::addChatMsg(bool incoming, const QString &name, const QDateTime &sendTime, const QDateTime &recvTime, const QString &message, MsgType chatType)
|
||||
{
|
||||
addChatMsg(incoming, name, RsGxsId(), sendTime, recvTime, message, chatType);
|
||||
}
|
||||
|
||||
void ChatWidget::addChatMsg(bool incoming, const QString &name, const RsGxsId gxsId
|
||||
, const QDateTime &sendTime, const QDateTime &recvTime
|
||||
, const QString &message, MsgType chatType)
|
||||
{
|
||||
#ifdef CHAT_DEBUG
|
||||
std::cout << "ChatWidget::addChatMsg message : " << message.toStdString() << std::endl;
|
||||
|
@ -871,6 +884,7 @@ void ChatWidget::addChatMsg(bool incoming, const QString &name, const QDateTime
|
|||
if (!Settings->valueFromGroup("Chat", "EnableCustomFontSize", true).toBool()) {
|
||||
formatTextFlag |= RSHTML_FORMATTEXT_REMOVE_FONT_SIZE;
|
||||
}
|
||||
int desiredMinimumFontSize = Settings->valueFromGroup("Chat", "MinimumFontSize", 10).toInt();
|
||||
if (!Settings->valueFromGroup("Chat", "EnableBold", true).toBool()) {
|
||||
formatTextFlag |= RSHTML_FORMATTEXT_REMOVE_FONT_WEIGHT;
|
||||
}
|
||||
|
@ -894,13 +908,20 @@ void ChatWidget::addChatMsg(bool incoming, const QString &name, const QDateTime
|
|||
formatFlag |= CHAT_FORMATMSG_SYSTEM;
|
||||
}
|
||||
|
||||
QString formattedMessage = RsHtml().formatText(ui->textBrowser->document(), message, formatTextFlag, backgroundColor, desiredContrast);
|
||||
QString formattedMessage = RsHtml().formatText(ui->textBrowser->document(), message, formatTextFlag, backgroundColor, desiredContrast, desiredMinimumFontSize);
|
||||
QDateTime dtTimestamp=incoming ? sendTime : recvTime;
|
||||
QString formatMsg = chatStyle.formatMessage(type, name, dtTimestamp, formattedMessage, formatFlag);
|
||||
QString timeStamp = dtTimestamp.toString(Qt::ISODate);
|
||||
|
||||
formatMsg.prepend(QString("<a name=\"%1\"/>").arg(timeStamp));
|
||||
//To call this anchor do: ui->textBrowser->scrollToAnchor(QString("%1_%2").arg(timeStamp).arg(name));
|
||||
//replace Date and Time anchors
|
||||
formatMsg.replace(QString("<a name=\"date\">"),QString("<a name=\"%1\">").arg(timeStamp));
|
||||
formatMsg.replace(QString("<a name=\"time\">"),QString("<a name=\"%1\">").arg(timeStamp));
|
||||
//replace Name anchors with GXS Id
|
||||
QString strGxsId = "";
|
||||
if (!gxsId.isNull())
|
||||
strGxsId = QString::fromStdString(gxsId.toStdString());
|
||||
formatMsg.replace(QString("<a name=\"name\">"),QString("<a name=\"%1\">").arg(strGxsId));
|
||||
|
||||
QTextCursor textCursor = QTextCursor(ui->textBrowser->textCursor());
|
||||
textCursor.movePosition(QTextCursor::End);
|
||||
textCursor.setBlockFormat(QTextBlockFormat ());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue