mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-04 15:15:15 -04:00
added attach picture system to broadcast (Patch from Phenom)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6611 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
2d3cb91cd8
commit
d1d2fbb869
3 changed files with 74 additions and 17 deletions
|
@ -30,6 +30,7 @@
|
|||
#include <QTextCodec>
|
||||
#include <QTimer>
|
||||
#include <QMessageBox>
|
||||
#include <QTextDocumentFragment>
|
||||
|
||||
#include "retroshare/rspeers.h"
|
||||
#include <retroshare/rshistory.h>
|
||||
|
@ -131,6 +132,7 @@ FriendsDialog::FriendsDialog(QWidget *parent)
|
|||
connect(ui.textitalicChatButton, SIGNAL(clicked()), this, SLOT(setFont()));
|
||||
connect(ui.fontsButton, SIGNAL(clicked()), this, SLOT(chooseFont()));
|
||||
connect(ui.colorChatButton, SIGNAL(clicked()), this, SLOT(chooseColor()));
|
||||
connect(ui.attachPictureButton, SIGNAL(clicked()), this, SLOT(addExtraPicture()));
|
||||
connect(ui.actionSave_History, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
|
||||
|
||||
connect(ui.hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
|
||||
|
@ -232,6 +234,11 @@ FriendsDialog::FriendsDialog(QWidget *parent)
|
|||
#ifdef Q_WS_WIN
|
||||
|
||||
#endif
|
||||
|
||||
#if QT_VERSION < 0x040700
|
||||
// embedded images are not supported before QT 4.7.0
|
||||
ui->attachPictureButton->setVisible(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
FriendsDialog::~FriendsDialog ()
|
||||
|
@ -800,6 +807,19 @@ void FriendsDialog::addExtraFile()
|
|||
}
|
||||
}
|
||||
|
||||
void FriendsDialog::addExtraPicture()
|
||||
{
|
||||
// select a picture file
|
||||
QString file;
|
||||
if (misc::getOpenFileName(window(), RshareSettings::LASTDIR_IMAGES, tr("Load Picture File"), "Pictures (*.png *.xpm *.jpg)", file)) {
|
||||
QString encodedImage;
|
||||
if (RsHtml::makeEmbeddedImage(file, encodedImage, 640*480)) {
|
||||
QTextDocumentFragment fragment = QTextDocumentFragment::fromHtml(encodedImage);
|
||||
ui.lineEdit->textCursor().insertFragment(fragment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FriendsDialog::fileHashingFinished(QList<HashedFile> hashedFiles)
|
||||
{
|
||||
std::cerr << "FriendsDialog::fileHashingFinished() started." << std::endl;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue