From f14f4f58d70811aefe98ee3c4bc433d14812d5c4 Mon Sep 17 00:00:00 2001 From: defnax Date: Mon, 8 Feb 2010 13:18:09 +0000 Subject: [PATCH] use for Attachments on GeneralMessage AttachFileItem git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2238 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/GeneralMsgDialog.cpp | 26 ++++++++++----------- retroshare-gui/src/gui/GeneralMsgDialog.h | 4 ++-- retroshare-gui/src/gui/GeneralMsgDialog.ui | 3 +++ 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/retroshare-gui/src/gui/GeneralMsgDialog.cpp b/retroshare-gui/src/gui/GeneralMsgDialog.cpp index 83dea889c..6509bf6d1 100644 --- a/retroshare-gui/src/gui/GeneralMsgDialog.cpp +++ b/retroshare-gui/src/gui/GeneralMsgDialog.cpp @@ -23,7 +23,7 @@ #include "GeneralMsgDialog.h" #include "gui/feeds/FeedHolder.h" -#include "gui/feeds/SubFileItem.h" +#include "gui/feeds/AttachFileItem.h" #include "gui/feeds/SubDestItem.h" #include "rsiface/rstypes.h" @@ -258,28 +258,27 @@ void GeneralMsgDialog::parseRsFileListAttachments(std::string attachList) void GeneralMsgDialog::addAttachment(std::string hash, std::string fname, uint64_t size, bool local, std::string srcId) { - /* add a SubFileItem to the attachment section */ + /* add a AttachFileItem to the attachment section */ std::cerr << "GeneralMsgDialog::addAttachment()"; std::cerr << std::endl; /* add widget in for new destination */ - uint32_t flags = SFI_TYPE_ATTACH; + uint32_t flags = AFI_TYPE_ATTACH; if (local) { - flags |= SFI_STATE_LOCAL; + flags |= AFI_STATE_LOCAL; } else { - flags |= SFI_STATE_REMOTE; + flags |= AFI_STATE_REMOTE; // TMP REMOVED REMOTE ADD FOR DEMONSTRATOR return; } - SubFileItem *file = new SubFileItem(hash, fname, size, flags, srcId); + AttachFileItem *file = new AttachFileItem(hash, fname, size, flags, srcId); mAttachments.push_back(file); - //QLayout *layout = fileFrame->layout(); verticalLayout_2->addWidget(file); if (mCheckAttachment) @@ -293,7 +292,7 @@ void GeneralMsgDialog::addAttachment(std::string hash, std::string fname, uint64 void GeneralMsgDialog::addExtraFile() { - /* add a SubFileItem to the attachment section */ + /* add a AttachFileItem to the attachment section */ std::cerr << "GeneralMsgDialog::addExtraFile() opening file dialog"; std::cerr << std::endl; @@ -310,7 +309,7 @@ void GeneralMsgDialog::addExtraFile() void GeneralMsgDialog::addAttachment(std::string path) { - /* add a SubFileItem to the attachment section */ + /* add a AttachFileItem to the attachment section */ std::cerr << "GeneralMsgDialog::addAttachment()"; std::cerr << std::endl; @@ -322,10 +321,9 @@ void GeneralMsgDialog::addAttachment(std::string path) //rsFiles->ExtraFileHash(localpath, period, flags); /* add widget in for new destination */ - SubFileItem *file = new SubFileItem(path); + AttachFileItem *file = new AttachFileItem(path); mAttachments.push_back(file); - //QLayout *layout = fileFrame->layout(); verticalLayout_2->addWidget(file); if (mCheckAttachment) @@ -339,7 +337,7 @@ void GeneralMsgDialog::addAttachment(std::string path) void GeneralMsgDialog::checkAttachmentReady() { - std::list::iterator fit; + std::list::iterator fit; mCheckAttachment = false; @@ -546,7 +544,7 @@ void GeneralMsgDialog::sendMsg() std::list files; std::list::iterator it; - std::list::iterator fit; + std::list::iterator fit; for(fit = mAttachments.begin(); fit != mAttachments.end(); fit++) { @@ -564,7 +562,7 @@ void GeneralMsgDialog::sendMsg() { if ((*fit)->ready()) { - (*fit)->download(); + //(*fit)->download(); } // Skips unhashed files. } diff --git a/retroshare-gui/src/gui/GeneralMsgDialog.h b/retroshare-gui/src/gui/GeneralMsgDialog.h index 8e75588be..252eec262 100644 --- a/retroshare-gui/src/gui/GeneralMsgDialog.h +++ b/retroshare-gui/src/gui/GeneralMsgDialog.h @@ -26,7 +26,7 @@ #include class SubDestItem; -class SubFileItem; +class AttachFileItem; class FileInfo; const uint32_t GMD_TYPE_MESSAGE_IDX = 0; @@ -72,7 +72,7 @@ void sendMessage(uint32_t type, std::string grpId, std::string inReplyTo, /* maps of files and destinations */ std::list mDestinations; - std::list mAttachments; + std::list mAttachments; bool mCheckAttachment; }; diff --git a/retroshare-gui/src/gui/GeneralMsgDialog.ui b/retroshare-gui/src/gui/GeneralMsgDialog.ui index 6cf69c6cf..598fc3846 100644 --- a/retroshare-gui/src/gui/GeneralMsgDialog.ui +++ b/retroshare-gui/src/gui/GeneralMsgDialog.ui @@ -86,6 +86,9 @@ Qt::Horizontal + + QSizePolicy::Minimum + 40