diff --git a/retroshare-gui/src/gui/ChannelFeed.ui b/retroshare-gui/src/gui/ChannelFeed.ui
index 989666da5..04d552e2b 100644
--- a/retroshare-gui/src/gui/ChannelFeed.ui
+++ b/retroshare-gui/src/gui/ChannelFeed.ui
@@ -147,7 +147,7 @@ p, li { white-space: pre-wrap; }
- -
+
-
true
@@ -192,19 +192,6 @@ p, li { white-space: pre-wrap; }
-
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
Qt::Horizontal
@@ -217,20 +204,6 @@ p, li { white-space: pre-wrap; }
- -
-
-
-
-
-
-
- :/images/settings16.png:/images/settings16.png
-
-
- true
-
-
-
@@ -554,8 +527,8 @@ border-image: url(:/images/btn_26_pressed.png) 4;
0
0
- 429
- 331
+ 425
+ 325
diff --git a/retroshare-gui/src/gui/channels/CreateChannelMsg.cpp b/retroshare-gui/src/gui/channels/CreateChannelMsg.cpp
index 303c1cccc..b9fda8abf 100644
--- a/retroshare-gui/src/gui/channels/CreateChannelMsg.cpp
+++ b/retroshare-gui/src/gui/channels/CreateChannelMsg.cpp
@@ -250,7 +250,7 @@ void CreateChannelMsg::addAttachment(std::string hash, std::string fname, uint64
/* add widget in for new destination */
- uint32_t flags = SFI_TYPE_ATTACH;
+ uint32_t flags = SFI_TYPE_CHANNEL;
if (local)
{
flags |= SFI_STATE_LOCAL;
@@ -262,7 +262,7 @@ void CreateChannelMsg::addAttachment(std::string hash, std::string fname, uint64
return;
}
- SubFileItem *file = new SubFileItem(hash, fname, size, flags, srcId);
+ SubFileItem *file = new SubFileItem(hash, fname, "", size, flags, srcId); // destroyed when fileFrame (this subfileitem) is destroyed
mAttachments.push_back(file);
QLayout *layout = fileFrame->layout();
@@ -300,15 +300,17 @@ void CreateChannelMsg::addAttachment(std::string path)
std::cerr << "CreateChannelMsg::addAttachment()";
std::cerr << std::endl;
- /* add to ExtraList here,
- * use default TIMEOUT of 30 days (time to fetch it).
- */
- //uint32_t period = 30 * 24 * 60 * 60;
- //uint32_t flags = 0;
- //rsFiles->ExtraFileHash(localpath, period, flags);
-
/* add widget in for new destination */
- SubFileItem *file = new SubFileItem(path);
+ uint32_t flags = SFI_TYPE_CHANNEL | SFI_STATE_EXTRA;
+
+ // channels creates copy of file into channels directory and shares this
+
+ FileInfo fInfo;
+ rsChannels->channelExtraFileHash(path, mChannelId, fInfo);
+
+ // file is not innitial
+ SubFileItem *file = new SubFileItem(fInfo.hash, fInfo.fname, fInfo.path, fInfo.size,
+ flags, mChannelId); // destroyed when fileFrame (this subfileitem) is destroyed
mAttachments.push_back(file);
QLayout *layout = fileFrame->layout();
@@ -335,9 +337,12 @@ void CreateChannelMsg::checkAttachmentReady()
{
if (!(*fit)->ready())
{
- /*
+ /* ensure file is hashed or file will be hashed, thus
+ * recognized by librs but not correctly by gui (can't
+ * formally remove it)
*/
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
+ buttonBox->button(QDialogButtonBox::Cancel)->setEnabled(false);
break;
@@ -349,6 +354,7 @@ void CreateChannelMsg::checkAttachmentReady()
if (fit == mAttachments.end())
{
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
+ buttonBox->button(QDialogButtonBox::Cancel)->setEnabled(true);
}
/* repeat... */
@@ -359,8 +365,16 @@ void CreateChannelMsg::checkAttachmentReady()
void CreateChannelMsg::cancelMsg()
{
- std::cerr << "CreateChannelMsg::cancelMsg()";
+ std::cerr << "CreateChannelMsg::cancelMsg() :"
+ << "Deleting EXTRA attachments" << std::endl;
+
std::cerr << std::endl;
+
+ std::list::const_iterator it;
+
+ for(it = mAttachments.begin(); it != mAttachments.end(); it++)
+ rsChannels->channelExtraFileRemove((*it)->FileHash(), mChannelId);
+
close();
return;
}
@@ -410,13 +424,14 @@ void CreateChannelMsg::sendMsg()
files.push_back(fi);
/* commence downloads - if we don't have the file */
+
if (!(*fit)->done())
{
if ((*fit)->ready())
{
(*fit)->download();
}
- // Skips unhashed files.
+ // Skips unhashed files.
}
}
}
@@ -435,7 +450,7 @@ void CreateChannelMsg::sendMessage(std::wstring subject, std::wstring msg, std::
tr("Please add a Subject"),
QMessageBox::Ok, QMessageBox::Ok);
- return; //Don't add a empty Subject!!
+ return; //Don't add an empty Subject!!
}
else
diff --git a/retroshare-gui/src/gui/feeds/BlogMsgItem.cpp b/retroshare-gui/src/gui/feeds/BlogMsgItem.cpp
index 297354ccf..cf0431e2f 100644
--- a/retroshare-gui/src/gui/feeds/BlogMsgItem.cpp
+++ b/retroshare-gui/src/gui/feeds/BlogMsgItem.cpp
@@ -76,7 +76,7 @@ void BlogMsgItem::updateItemStatic()
for(i = 0; i < total; i++)
{
/* add file */
- SubFileItem *fi = new SubFileItem("dummyHash", "dummy_File", 1283918, SFI_STATE_REMOTE, mPeerId);
+ SubFileItem *fi = new SubFileItem("dummyHash", "dummy_File", "", 1283918, SFI_STATE_REMOTE, mPeerId);
mFileItems.push_back(fi);
QLayout *layout = expandFrame->layout();
diff --git a/retroshare-gui/src/gui/feeds/ChanMsgItem.cpp b/retroshare-gui/src/gui/feeds/ChanMsgItem.cpp
index eb89e2cc4..2a8bb78b3 100644
--- a/retroshare-gui/src/gui/feeds/ChanMsgItem.cpp
+++ b/retroshare-gui/src/gui/feeds/ChanMsgItem.cpp
@@ -113,8 +113,8 @@ void ChanMsgItem::updateItemStatic()
for(it = cmi.files.begin(); it != cmi.files.end(); it++)
{
/* add file */
- SubFileItem *fi = new SubFileItem(it->hash, it->fname, it->size,
- SFI_STATE_REMOTE | SFI_TYPE_CHANNEL, "");
+ SubFileItem *fi = new SubFileItem(it->hash, it->fname, it->path, it->size,
+ SFI_STATE_REMOTE | SFI_TYPE_CHANNEL, mChanId);
mFileItems.push_back(fi);
QLayout *layout = expandFrame->layout();
diff --git a/retroshare-gui/src/gui/feeds/MsgItem.cpp b/retroshare-gui/src/gui/feeds/MsgItem.cpp
index 04bd87ad1..66bc100e1 100644
--- a/retroshare-gui/src/gui/feeds/MsgItem.cpp
+++ b/retroshare-gui/src/gui/feeds/MsgItem.cpp
@@ -129,7 +129,7 @@ void MsgItem::updateItemStatic()
for(it = mi.files.begin(); it != mi.files.end(); it++)
{
/* add file */
- SubFileItem *fi = new SubFileItem(it->hash, it->fname, it->size, SFI_STATE_REMOTE, mi.srcId);
+ SubFileItem *fi = new SubFileItem(it->hash, it->fname, it->path, it->size, SFI_STATE_REMOTE, mi.srcId);
mFileItems.push_back(fi);
QLayout *layout = expandFrame->layout();
diff --git a/retroshare-gui/src/gui/feeds/SubFileItem.cpp b/retroshare-gui/src/gui/feeds/SubFileItem.cpp
index c8188b447..46bad5761 100644
--- a/retroshare-gui/src/gui/feeds/SubFileItem.cpp
+++ b/retroshare-gui/src/gui/feeds/SubFileItem.cpp
@@ -65,9 +65,10 @@
const uint32_t SFI_DEFAULT_PERIOD = (30 * 3600 * 24); /* 30 Days */
/** Constructor */
-SubFileItem::SubFileItem(std::string hash, std::string name, uint64_t size,
+SubFileItem::SubFileItem(std::string hash, std::string name, std::string path, uint64_t size,
uint32_t flags, std::string srcId)
-:QWidget(NULL), mFileHash(hash), mFileName(name), mFileSize(size), mSrcId(srcId)
+:QWidget(NULL), mFileHash(hash), mFileName(name), mFileSize(size), mSrcId(srcId),
+ mPath(path)
{
/* Invoke the Qt Designer generated object setup routine */
setupUi(this);
@@ -77,10 +78,6 @@ SubFileItem::SubFileItem(std::string hash, std::string name, uint64_t size,
mMode = flags & SFI_MASK_STATE;
mType = flags & SFI_MASK_TYPE;
- if (mMode == SFI_STATE_EXTRA)
- {
- mMode = SFI_STATE_ERROR;
- }
/**** Enable ****
*****/
@@ -94,25 +91,6 @@ SubFileItem::SubFileItem(std::string hash, std::string name, uint64_t size,
Setup();
}
-/** Constructor */
-SubFileItem::SubFileItem(std::string path)
-:QWidget(NULL), mPath(path), mFileSize(0)
-{
- /* Invoke the Qt Designer generated object setup routine */
- setupUi(this);
-
- mMode = SFI_STATE_EXTRA;
- mType = SFI_TYPE_ATTACH;
-
- /* ask for Files to hash/prepare it for us */
- if ((!rsFiles) || (!rsFiles->ExtraFileHash(path, SFI_DEFAULT_PERIOD, 0)))
- {
- mMode = SFI_STATE_ERROR;
- }
-
- Setup();
-}
-
void SubFileItem::Setup()
{
@@ -581,12 +559,33 @@ void SubFileItem::cancel()
void SubFileItem::play()
{
-#ifdef DEBUG_ITEM
- std::cerr << "SubFileItem::play() :" << mPath;
- std::cerr << std::endl;
-#endif
+ FileInfo info;
+ uint32_t flags = RS_FILE_HINTS_DOWNLOAD | RS_FILE_HINTS_EXTRA | RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_NETWORK_WIDE;
- //openFile(mPath);
+
+ if (!rsFiles->FileDetails( mFileHash, flags, info))
+ return;
+
+ if (done()) {
+
+ /* open file with a suitable application */
+ QFileInfo qinfo;
+ qinfo.setFile(info.path.c_str());
+ if (qinfo.exists()) {
+ if (!QDesktopServices::openUrl(QUrl::fromLocalFile(qinfo.absoluteFilePath()))) {
+ std::cerr << "openTransfer(): can't open file " << info.path << std::endl;
+ }
+ }else{
+ QMessageBox::information(this, tr("Play File"),
+ tr("File %1 does not exist at location.").arg(info.path.c_str()));
+ return;
+ }
+ } else {
+ /* rise a message box for incompleted download file */
+ QMessageBox::information(this, tr("Play File"),
+ tr("File %1 is not completed.").arg(info.fname.c_str()));
+ return;
+ }
}
diff --git a/retroshare-gui/src/gui/feeds/SubFileItem.h b/retroshare-gui/src/gui/feeds/SubFileItem.h
index ffcd2e8fd..783b82e39 100644
--- a/retroshare-gui/src/gui/feeds/SubFileItem.h
+++ b/retroshare-gui/src/gui/feeds/SubFileItem.h
@@ -41,14 +41,21 @@ const uint32_t SFI_STATE_UPLOAD = 0x0006;
const uint32_t SFI_TYPE_CHANNEL = 0x0010;
const uint32_t SFI_TYPE_ATTACH = 0x0020;
+
+//! This create a gui widget that allows users to access files shared by user
+/*!
+ * Widget that allows user to share files with a visual attachment interface
+ * Note: extra files (files not already shared/hashed in rs) need to
+ * be hashed by the clients of this class or else objects of this class will
+ * have reduced functionality
+ */
class SubFileItem : public QWidget, private Ui::SubFileItem
{
Q_OBJECT
public:
/** Default Constructor */
- SubFileItem(std::string localpath);
- SubFileItem(std::string hash, std::string name, uint64_t size,
+ SubFileItem(std::string hash, std::string name, std::string path, uint64_t size,
uint32_t flags, std::string srcId);
/** Default Destructor */
diff --git a/retroshare-gui/src/gui/unfinished/blogs/BlogsMsgItem.cpp b/retroshare-gui/src/gui/unfinished/blogs/BlogsMsgItem.cpp
index ac1fc7152..3dba49985 100644
--- a/retroshare-gui/src/gui/unfinished/blogs/BlogsMsgItem.cpp
+++ b/retroshare-gui/src/gui/unfinished/blogs/BlogsMsgItem.cpp
@@ -103,20 +103,6 @@ void BlogsMsgItem::updateItemStatic()
QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm:ss");
datetimelabel->setText(timestamp);
-
-
- std::list::iterator it;
- for(it = cmi.files.begin(); it != cmi.files.end(); it++)
- {
- /* add file */
- SubFileItem *fi = new SubFileItem(it->hash, it->fname, it->size,
- SFI_STATE_REMOTE | SFI_TYPE_CHANNEL, "");
- mFileItems.push_back(fi);
-
- QLayout *layout = expandFrame->layout();
- layout->addWidget(fi);
- }
-
//playButton->setEnabled(false);
if (mIsHome)
@@ -139,32 +125,11 @@ void BlogsMsgItem::updateItem()
{
/* fill in */
#ifdef DEBUG_ITEM
- std::cerr << "ChanMsgItem::updateItem()";
+ std::cerr << "BlogMsgItem::updateItem()";
std::cerr << std::endl;
#endif
- int msec_rate = 10000;
- /* Very slow Tick to check when all files are downloaded */
- std::list::iterator it;
- for(it = mFileItems.begin(); it != mFileItems.end(); it++)
- {
- if (!(*it)->done())
- {
- /* loop again */
- QTimer::singleShot( msec_rate, this, SLOT(updateItem( void ) ));
- return;
- }
- }
- /***
- * At this point cannot create a playlist....
- * so can't enable play for all.
-
- if (mFileItems.size() > 0)
- {
- playButton->setEnabled(true);
- }
- ***/
}
diff --git a/retroshare-gui/src/gui/unfinished/blogs/BlogsMsgItem.h b/retroshare-gui/src/gui/unfinished/blogs/BlogsMsgItem.h
index 58a135080..8bc84ca94 100644
--- a/retroshare-gui/src/gui/unfinished/blogs/BlogsMsgItem.h
+++ b/retroshare-gui/src/gui/unfinished/blogs/BlogsMsgItem.h
@@ -64,7 +64,6 @@ private:
bool mIsHome;
- std::list mFileItems;
};
diff --git a/retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.cpp b/retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.cpp
index 9a56c3808..ffc88aa66 100644
--- a/retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.cpp
+++ b/retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.cpp
@@ -61,7 +61,7 @@
/** Constructor */
CreateBlogMsg::CreateBlogMsg(std::string cId ,QWidget* parent, Qt::WFlags flags)
-: mBlogId(cId), QMainWindow (parent, flags) ,mCheckAttachment(true)
+: mBlogId(cId), QMainWindow (parent, flags)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
@@ -92,8 +92,6 @@ CreateBlogMsg::CreateBlogMsg(std::string cId ,QWidget* parent, Qt::WFlags flags)
connect(ui.actionPublish, SIGNAL(triggered()), this, SLOT(sendMsg()));
connect(ui.actionNew, SIGNAL(triggered()), this, SLOT (fileNew()));
-
- connect(ui.addFileButton, SIGNAL(clicked() ), this , SLOT(addExtraFile()));
connect(ui.actionIncreasefontsize, SIGNAL (triggered()), this, SLOT (fontSizeIncrease()));
connect(ui.actionDecreasefontsize, SIGNAL (triggered()), this, SLOT (fontSizeDecrease()));
@@ -169,306 +167,6 @@ CreateBlogMsg::CreateBlogMsg(std::string cId ,QWidget* parent, Qt::WFlags flags)
}
-/* Dropping */
-
-void CreateBlogMsg::dragEnterEvent(QDragEnterEvent *event)
-{
- /* print out mimeType */
- std::cerr << "CreateChannelMsg::dragEnterEvent() Formats";
- std::cerr << std::endl;
- QStringList formats = event->mimeData()->formats();
- QStringList::iterator it;
- for(it = formats.begin(); it != formats.end(); it++)
- {
- std::cerr << "Format: " << (*it).toStdString();
- std::cerr << std::endl;
- }
-
- if (event->mimeData()->hasFormat("text/plain"))
- {
- std::cerr << "CreateChannelMsg::dragEnterEvent() Accepting PlainText";
- std::cerr << std::endl;
- event->acceptProposedAction();
- }
- else if (event->mimeData()->hasUrls())
- {
- std::cerr << "CreateChannelMsg::dragEnterEvent() Accepting Urls";
- std::cerr << std::endl;
- event->acceptProposedAction();
- }
- else if (event->mimeData()->hasFormat("application/x-rsfilelist"))
- {
- std::cerr << "CreateChannelMsg::dragEnterEvent() accepting Application/x-qabs...";
- std::cerr << std::endl;
- event->acceptProposedAction();
- }
- else
- {
- std::cerr << "CreateChannelMsg::dragEnterEvent() No PlainText/Urls";
- std::cerr << std::endl;
- }
-}
-
-void CreateBlogMsg::dropEvent(QDropEvent *event)
-{
- if (!(Qt::CopyAction & event->possibleActions()))
- {
- std::cerr << "CreateChannelMsg::dropEvent() Rejecting uncopyable DropAction";
- std::cerr << std::endl;
-
- /* can't do it */
- return;
- }
-
- std::cerr << "CreateChannelMsg::dropEvent() Formats";
- std::cerr << std::endl;
- QStringList formats = event->mimeData()->formats();
- QStringList::iterator it;
- for(it = formats.begin(); it != formats.end(); it++)
- {
- std::cerr << "Format: " << (*it).toStdString();
- std::cerr << std::endl;
- }
-
- if (event->mimeData()->hasText())
- {
- std::cerr << "CreateChannelMsg::dropEvent() Plain Text:";
- std::cerr << std::endl;
- std::cerr << event->mimeData()->text().toStdString();
- std::cerr << std::endl;
- }
-
- if (event->mimeData()->hasUrls())
- {
- std::cerr << "CreateChannelMsg::dropEvent() Urls:";
- std::cerr << std::endl;
-
- QList urls = event->mimeData()->urls();
- QList::iterator uit;
- for(uit = urls.begin(); uit != urls.end(); uit++)
- {
- std::string localpath = uit->toLocalFile().toStdString();
- std::cerr << "Whole URL: " << uit->toString().toStdString();
- std::cerr << std::endl;
- std::cerr << "or As Local File: " << localpath;
- std::cerr << std::endl;
-
- if (localpath.size() > 0)
- {
-
- addAttachment(localpath);
- }
- }
- }
- else if (event->mimeData()->hasFormat("application/x-rsfilelist"))
- {
- std::cerr << "CreateChannelMsg::dropEvent() Application/x-rsfilelist";
- std::cerr << std::endl;
-
-
- QByteArray data = event->mimeData()->data("application/x-rsfilelist");
- std::cerr << "Data Len:" << data.length();
- std::cerr << std::endl;
- std::cerr << "Data is:" << data.data();
- std::cerr << std::endl;
-
- std::string newattachments(data.data());
- parseRsFileListAttachments(newattachments);
- }
-
-
- event->setDropAction(Qt::CopyAction);
- event->accept();
-}
-
-void CreateBlogMsg::parseRsFileListAttachments(std::string attachList)
-{
- /* split into lines */
- QString input = QString::fromStdString(attachList);
-
- QStringList attachItems = input.split("\n");
- QStringList::iterator it;
- QStringList::iterator it2;
-
- for(it = attachItems.begin(); it != attachItems.end(); it++)
- {
- std::cerr << "CreateBlogMsg::parseRsFileListAttachments() Entry: ";
-
- QStringList parts = (*it).split("/");
-
- bool ok = false;
- quint64 qsize = 0;
-
- std::string fname;
- std::string hash;
- uint64_t size = 0;
- std::string source;
-
- int i = 0;
- for(it2 = parts.begin(); it2 != parts.end(); it2++, i++)
- {
- std::cerr << "\"" << it2->toStdString() << "\" ";
- switch(i)
- {
- case 0:
- fname = it2->toStdString();
- break;
- case 1:
- hash = it2->toStdString();
- break;
- case 2:
- qsize = it2->toULongLong(&ok, 10);
- size = qsize;
- break;
- case 3:
- source = it2->toStdString();
- break;
- }
- }
-
- std::cerr << std::endl;
-
- std::cerr << "\tfname: " << fname << std::endl;
- std::cerr << "\thash: " << hash << std::endl;
- std::cerr << "\tsize: " << size << std::endl;
- std::cerr << "\tsource: " << source << std::endl;
-
- /* basic error checking */
- if ((ok) && (hash.size() == 40))
- {
- std::cerr << "Item Ok" << std::endl;
- if (source == "Local")
- {
- addAttachment(hash, fname, size, true, "");
- }
- else
- {
- // TEMP NOT ALLOWED UNTIL FT WORKING.
- addAttachment(hash, fname, size, false, source);
- }
-
- }
- else
- {
- std::cerr << "Error Decode: Hash size: " << hash.size() << std::endl;
- }
-
- }
-}
-
-
-void CreateBlogMsg::addAttachment(std::string hash, std::string fname, uint64_t size, bool local, std::string srcId)
-{
- /* add a SubFileItem to the attachment section */
- std::cerr << "CreateChannelMsg::addAttachment()";
- std::cerr << std::endl;
-
- /* add widget in for new destination */
-
- uint32_t flags = SFI_TYPE_ATTACH;
- if (local)
- {
- flags |= SFI_STATE_LOCAL;
- }
- else
- {
- flags |= SFI_STATE_REMOTE;
- // TMP REMOVED REMOTE ADD FOR DEMONSTRATOR
- return;
- }
-
- SubFileItem *file = new SubFileItem(hash, fname, size, flags, srcId);
-
- mAttachments.push_back(file);
- ui.verticalLayout_3->addWidget(file);
-
- if (mCheckAttachment)
- {
- checkAttachmentReady();
- }
-
- return;
-}
-
-
-void CreateBlogMsg::addExtraFile()
-{
- /* add a SubFileItem to the attachment section */
- std::cerr << "CreateChannelMsg::addExtraFile() opening file dialog";
- std::cerr << std::endl;
-
- // select a file
- QString qfile = QFileDialog::getOpenFileName(this, tr("Add Extra File"), "", "", 0,
- QFileDialog::DontResolveSymlinks);
- std::string filePath = qfile.toStdString();
- if (filePath != "")
- {
- addAttachment(filePath);
- }
-}
-
-
-void CreateBlogMsg::addAttachment(std::string path)
-{
- /* add a SubFileItem to the attachment section */
- std::cerr << "CreateChannelMsg::addAttachment()";
- std::cerr << std::endl;
-
- /* add to ExtraList here,
- * use default TIMEOUT of 30 days (time to fetch it).
- */
- //uint32_t period = 30 * 24 * 60 * 60;
- //uint32_t flags = 0;
- //rsFiles->ExtraFileHash(localpath, period, flags);
-
- /* add widget in for new destination */
- SubFileItem *file = new SubFileItem(path);
-
- mAttachments.push_back(file);
- ui.verticalLayout_3->addWidget(file);
-
- if (mCheckAttachment)
- {
- checkAttachmentReady();
- }
-
- return;
-
-}
-
-void CreateBlogMsg::checkAttachmentReady()
-{
- std::list::iterator fit;
-
- mCheckAttachment = false;
-
- for(fit = mAttachments.begin(); fit != mAttachments.end(); fit++)
- {
- if (!(*fit)->isHidden())
- {
- if (!(*fit)->ready())
- {
- /*
- */
- ui.actionPublish->setEnabled(false);
- break;
-
-
- return;
- }
- }
- }
-
- if (fit == mAttachments.end())
- {
- ui.actionPublish->setEnabled(true);
- }
-
- /* repeat... */
- int msec_rate = 1000;
- QTimer::singleShot( msec_rate, this, SLOT(checkAttachmentReady(void)));
-}
-
void CreateBlogMsg::cancelMsg()
{
@@ -493,8 +191,6 @@ void CreateBlogMsg::newBlogMsg()
ui.channelName->setText(QString::fromStdWString(ci.blogName));
-
-
}
@@ -507,38 +203,11 @@ void CreateBlogMsg::sendMsg()
std::wstring subject = ui.subjectEdit->text().toStdWString();
std::wstring msg = ui.msgEdit->toHtml().toStdWString();
- std::list files;
-
- std::list::iterator fit;
-
- for(fit = mAttachments.begin(); fit != mAttachments.end(); fit++)
- {
- if (!(*fit)->isHidden())
- {
- FileInfo fi;
- fi.hash = (*fit)->FileHash();
- fi.fname = (*fit)->FileName();
- fi.size = (*fit)->FileSize();
-
- files.push_back(fi);
-
- /* commence downloads - if we don't have the file */
- if (!(*fit)->done())
- {
- if ((*fit)->ready())
- {
- (*fit)->download();
- }
- // Skips unhashed files.
- }
- }
- }
-
- sendMessage(subject, msg, files);
+ sendMessage(subject, msg);
}
-void CreateBlogMsg::sendMessage(std::wstring subject, std::wstring msg, std::list &files)
+void CreateBlogMsg::sendMessage(std::wstring subject, std::wstring msg)
{
std::cerr << "CreateBlogMsg::sendMessage()" << std::endl;
@@ -564,7 +233,6 @@ void CreateBlogMsg::sendMessage(std::wstring subject, std::wstring msg, std::lis
msgInfo.subject = subject;
msgInfo.msg = msg;
- msgInfo.files = files;
msgInfo.msgIdReply = "nothing";
rsBlogs->BlogMessageSend(msgInfo);
}
@@ -1281,4 +949,4 @@ void CreateBlogMsg::Create_New_Image_Tag( const QString urlremoteorlocal )
ui.msgEdit->textCursor().insertFragment(fragment);
//emit statusMessage(QString("Image new :").arg(urlremoteorlocal));
//}
-}
\ No newline at end of file
+}
diff --git a/retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.h b/retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.h
index f33fd567e..ff775c866 100644
--- a/retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.h
+++ b/retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.h
@@ -61,13 +61,7 @@ public:
void Create_New_Image_Tag( const QString urlremoteorlocal );
-protected:
-virtual void dragEnterEvent(QDragEnterEvent *event);
-virtual void dropEvent(QDropEvent *event);
-
private slots:
- void addExtraFile();
- void checkAttachmentReady();
void cancelMsg();
void sendMsg();
@@ -129,15 +123,10 @@ private:
void colorChanged(const QColor &c);
void alignmentChanged(Qt::Alignment a);
- void parseRsFileListAttachments(std::string attachList);
- void sendMessage(std::wstring subject, std::wstring msg, std::list &files);
+ void sendMessage(std::wstring subject, std::wstring msg);
std::string mBlogId;
-
- std::list mAttachments;
-
- bool mCheckAttachment;
QAction *actionSave,
*actionTextBold,
diff --git a/retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.ui b/retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.ui
index 2aab28f5e..66874ee6e 100644
--- a/retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.ui
+++ b/retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.ui
@@ -14,7 +14,7 @@
New Blog Post
-
+
:/images/rstray3.png:/images/rstray3.png
@@ -94,7 +94,7 @@ border: 1px solid #CCCCCC;}
-
- 0
+ 1
@@ -149,145 +149,6 @@ border: 1px solid #CCCCCC;}
-
-
-
- :/images/attachment.png:/images/attachment.png
-
-
- Attachments
-
-
-
- 0
-
-
- 0
-
- -
-
-
- 0
-
-
- 6
-
-
- 6
-
-
-
-
-
-
-
-
- :/images/attachment.png
-
-
-
- -
-
-
-
- 16777215
- 26
-
-
-
-
- 75
- true
-
-
-
- Attachments
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 334
- 26
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 34
- 34
-
-
-
-
-
-
-
- :/images/add-share24.png:/images/add-share24.png
-
-
-
- 24
- 24
-
-
-
-
-
-
- -
-
-
- Qt::ScrollBarAlwaysOn
-
-
- true
-
-
-
-
- 0
- 0
- 639
- 341
-
-
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 438
- 137
-
-
-
-
-
-
-
-
-
-
@@ -301,7 +162,7 @@ border: 1px solid #CCCCCC;}
0
0
666
- 21
+ 25
@@ -348,7 +209,7 @@ border: 1px solid #CCCCCC;}
true
-
+
:/images/textedit/hi22-action-format-text-blockquote.png:/images/textedit/hi22-action-format-text-blockquote.png
@@ -357,7 +218,7 @@ border: 1px solid #CCCCCC;}
-
+
:/images/textedit/format_font_size_more.png:/images/textedit/format_font_size_more.png
@@ -366,7 +227,7 @@ border: 1px solid #CCCCCC;}
-
+
:/images/textedit/format_font_size_less.png:/images/textedit/format_font_size_less.png
@@ -375,7 +236,7 @@ border: 1px solid #CCCCCC;}
-
+
:/images/textedit/textbold.png:/images/textedit/textbold.png
@@ -384,7 +245,7 @@ border: 1px solid #CCCCCC;}
-
+
:/images/textedit/textunder.png:/images/textedit/textunder.png
@@ -393,7 +254,7 @@ border: 1px solid #CCCCCC;}
-
+
:/images/textedit/textitalic.png:/images/textedit/textitalic.png
@@ -412,7 +273,7 @@ border: 1px solid #CCCCCC;}
-
+
:/images/textedit/hi22-action-format-text-code.png:/images/textedit/hi22-action-format-text-code.png
@@ -421,7 +282,7 @@ border: 1px solid #CCCCCC;}
-
+
:/images/textedit/hi22-action-insert-more-mark.png:/images/textedit/hi22-action-insert-more-mark.png
@@ -430,7 +291,7 @@ border: 1px solid #CCCCCC;}
-
+
:/images/textedit/format-list-ordered.png:/images/textedit/format-list-ordered.png
@@ -439,7 +300,7 @@ border: 1px solid #CCCCCC;}
-
+
:/images/textedit/format-list-unordered.png:/images/textedit/format-list-unordered.png
@@ -451,7 +312,7 @@ border: 1px solid #CCCCCC;}
true
-
+
:/images/textedit/editcut.png:/images/textedit/editcut.png
@@ -460,7 +321,7 @@ border: 1px solid #CCCCCC;}
-
+
:/images/textedit/editundo.png:/images/textedit/editundo.png
@@ -475,9 +336,8 @@ border: 1px solid #CCCCCC;}
-
-
-
+
+