fixed share on channel code

This commit is contained in:
csoler 2017-10-21 23:48:27 +02:00
parent 770add8b8a
commit b6aeacbed4
3 changed files with 17 additions and 1 deletions

View File

@ -411,6 +411,11 @@ void CreateGxsChannelMsg::addExtraFile()
}
}
void CreateGxsChannelMsg::addHtmlText(const QString& text)
{
msgEdit->setHtml(text) ;
}
void CreateGxsChannelMsg::addAttachment(const std::string &path)
{
/* add a SubFileItem to the attachment section */

View File

@ -43,6 +43,7 @@ public:
/** Default Destructor */
~CreateGxsChannelMsg();
void addHtmlText(const QString& text) ;
void addAttachment(const std::string &path);
void addAttachment(const RsFileHash &hash, const std::string &fname, uint64_t size, bool local, const RsPeerId &srcId,bool assume_file_ready = false);

View File

@ -27,6 +27,7 @@
#include "GxsChannelDialog.h"
#include "GxsChannelGroupDialog.h"
#include "GxsChannelPostsWidget.h"
#include "CreateGxsChannelMsg.h"
#include "GxsChannelUserNotify.h"
#include "gui/gxs/GxsGroupShareKey.h"
#include "gui/feeds/GxsChannelPostItem.h"
@ -76,9 +77,18 @@ UserNotify *GxsChannelDialog::getUserNotify(QObject *parent)
return new GxsChannelUserNotify(rsGxsChannels, parent);
}
void GxsChannelDialog::shareOnChannel(const RsGxsGroupId& channel_id,const QList<RetroShareLink>& file_link)
void GxsChannelDialog::shareOnChannel(const RsGxsGroupId& channel_id,const QList<RetroShareLink>& file_links)
{
std::cerr << "Sharing file link on channel " << channel_id << ": Not yet implemented!" << std::endl;
CreateGxsChannelMsg *msgDialog = new CreateGxsChannelMsg(channel_id) ;
QString txt ;
for(QList<RetroShareLink>::const_iterator it(file_links.begin());it!=file_links.end();++it)
txt += (*it).toHtml() + "\n" ;
msgDialog->addHtmlText(txt);
msgDialog->show();
}
QString GxsChannelDialog::text(TextType type)