mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-06 08:05:18 -04:00
Added save image function into chat
This commit is contained in:
parent
0b92c79eb0
commit
ff44965e2c
6 changed files with 87 additions and 3 deletions
|
@ -51,6 +51,7 @@
|
|||
#include "util/HandleRichText.h"
|
||||
#include "gui/chat/ChatUserNotify.h"//For BradCast
|
||||
#include "util/DateTime.h"
|
||||
#include "util/imageutil.h"
|
||||
|
||||
#include <retroshare/rsstatus.h>
|
||||
#include <retroshare/rsidentity.h>
|
||||
|
@ -126,6 +127,7 @@ ChatWidget::ChatWidget(QWidget *parent) :
|
|||
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->actionSave_image, SIGNAL(triggered()), this, SLOT(saveImage()));
|
||||
|
||||
connect(ui->hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
|
||||
|
||||
|
@ -977,6 +979,9 @@ void ChatWidget::contextMenuTextBrowser(QPoint point)
|
|||
contextMnu->addAction(ui->actionClearChatHistory);
|
||||
contextMnu->addAction(ui->actionQuote);
|
||||
|
||||
ui->actionSave_image->setData(point);
|
||||
contextMnu->addAction(ui->actionSave_image);
|
||||
|
||||
contextMnu->exec(ui->textBrowser->viewport()->mapToGlobal(point));
|
||||
delete(contextMnu);
|
||||
}
|
||||
|
@ -1674,3 +1679,10 @@ void ChatWidget::quote()
|
|||
emit ui->chatTextEdit->append(QString(">") + text);
|
||||
}
|
||||
}
|
||||
|
||||
void ChatWidget::saveImage()
|
||||
{
|
||||
QPoint point = ui->actionSave_image->data().toPoint();
|
||||
QTextCursor cursor = ui->textBrowser->cursorForPosition(point);
|
||||
ImageUtil::extractImage(window(), cursor);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue