use AttachFileItem for Forums and Chat too, use SubFileItem only for Channels

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2124 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-01-25 14:35:32 +00:00
parent 6cb925016a
commit bb3a1ba8b1
4 changed files with 20 additions and 19 deletions

View File

@ -40,7 +40,7 @@
#include "rsiface/rsmsgs.h" #include "rsiface/rsmsgs.h"
#include "rsiface/rsfiles.h" #include "rsiface/rsfiles.h"
#include "gui/feeds/SubFileItem.h" #include "gui/feeds/AttachFileItem.h"
#include <time.h> #include <time.h>
#define appDir QApplication::applicationDirPath() #define appDir QApplication::applicationDirPath()
@ -717,30 +717,30 @@ void PopupChatDialog::addExtraFile()
} }
void PopupChatDialog::addAttachment(std::string filePath) { void PopupChatDialog::addAttachment(std::string filePath) {
/* add a SubFileItem to the attachment section */ /* add a AttachFileItem to the attachment section */
std::cerr << "PopupChatDialog::addExtraFile() hashing file."; std::cerr << "PopupChatDialog::addExtraFile() hashing file.";
std::cerr << std::endl; std::cerr << std::endl;
/* add widget in for new destination */ /* add widget in for new destination */
SubFileItem *file = new SubFileItem(filePath); AttachFileItem *file = new AttachFileItem(filePath);
//file-> //file->
ui.vboxLayout->addWidget(file, 1, 0); ui.vboxLayout->addWidget(file, 1, 0);
//when the file is local or is finished hashing, call the fileHashingFinished method to send a chat message //when the file is local or is finished hashing, call the fileHashingFinished method to send a chat message
if (file->getState() == SFI_STATE_LOCAL) { if (file->getState() == AFI_STATE_LOCAL) {
fileHashingFinished(file); fileHashingFinished(file);
} else { } else {
QObject::connect(file,SIGNAL(fileFinished(SubFileItem *)), SLOT(fileHashingFinished(SubFileItem *))) ; QObject::connect(file,SIGNAL(fileFinished(AttachFileItem *)), SLOT(fileHashingFinished(AttachFileItem *))) ;
} }
} }
void PopupChatDialog::fileHashingFinished(SubFileItem* file) { void PopupChatDialog::fileHashingFinished(AttachFileItem* file) {
std::cerr << "PopupChatDialog::fileHashingFinished() started."; std::cerr << "PopupChatDialog::fileHashingFinished() started.";
std::cerr << std::endl; std::cerr << std::endl;
//check that the file is ok tos end //check that the file is ok tos end
if (file->getState() == SFI_STATE_ERROR) { if (file->getState() == AFI_STATE_ERROR) {
#ifdef CHAT_DEBUG #ifdef CHAT_DEBUG
std::cerr << "PopupChatDialog::fileHashingFinished error file is not hashed."; std::cerr << "PopupChatDialog::fileHashingFinished error file is not hashed.";
#endif #endif

View File

@ -30,7 +30,7 @@
#include <gui/settings/rsharesettings.h> #include <gui/settings/rsharesettings.h>
#include "rsiface/rsiface.h" #include "rsiface/rsiface.h"
#include "gui/feeds/SubFileItem.h" #include "gui/feeds/AttachFileItem.h"
@ -77,7 +77,7 @@ public slots:
void addSmiley(); void addSmiley();
void changeStyle(); void changeStyle();
void fileHashingFinished(SubFileItem* file); void fileHashingFinished(AttachFileItem* file);
void resetStatusBar() ; void resetStatusBar() ;
void updateStatusTyping() ; void updateStatusTyping() ;

View File

@ -41,7 +41,7 @@
#include "rsiface/rsforums.h" #include "rsiface/rsforums.h"
#include "rsiface/rsfiles.h" #include "rsiface/rsfiles.h"
#include "gui/feeds/SubFileItem.h" #include "gui/feeds/AttachFileItem.h"
#include <sstream> #include <sstream>
@ -315,30 +315,30 @@ void CreateForumMsg::addFile()
} }
void CreateForumMsg::addAttachment(std::string filePath) { void CreateForumMsg::addAttachment(std::string filePath) {
/* add a SubFileItem to the attachment section */ /* add a AttachFileItem to the attachment section */
std::cerr << "CreateForumMsg::addFile() hashing file."; std::cerr << "CreateForumMsg::addFile() hashing file.";
std::cerr << std::endl; std::cerr << std::endl;
/* add widget in for new destination */ /* add widget in for new destination */
SubFileItem *file = new SubFileItem(filePath); AttachFileItem *file = new AttachFileItem(filePath);
//file-> //file->
ui.verticalLayout->addWidget(file, 1, 0); ui.verticalLayout->addWidget(file, 1, 0);
//when the file is local or is finished hashing, call the fileHashingFinished method to send a chat message //when the file is local or is finished hashing, call the fileHashingFinished method to send a forum message
if (file->getState() == SFI_STATE_LOCAL) { if (file->getState() == AFI_STATE_LOCAL) {
fileHashingFinished(file); fileHashingFinished(file);
} else { } else {
QObject::connect(file,SIGNAL(fileFinished(SubFileItem *)),this, SLOT(fileHashingFinished(SubFileItem *))) ; QObject::connect(file,SIGNAL(fileFinished(AttachFileItem *)),this, SLOT(fileHashingFinished(AttachFileItem *))) ;
} }
} }
void CreateForumMsg::fileHashingFinished(SubFileItem* file) { void CreateForumMsg::fileHashingFinished(AttachFileItem* file) {
std::cerr << "CreateForumMsg::fileHashingFinished() started."; std::cerr << "CreateForumMsg::fileHashingFinished() started.";
std::cerr << std::endl; std::cerr << std::endl;
//check that the file is ok tos end //check that the file is ok tos end
if (file->getState() == SFI_STATE_ERROR) { if (file->getState() == AFI_STATE_ERROR) {
#ifdef CHAT_DEBUG #ifdef CHAT_DEBUG
std::cerr << "CreateForumMsg::fileHashingFinished error file is not hashed."; std::cerr << "CreateForumMsg::fileHashingFinished error file is not hashed.";
#endif #endif

View File

@ -23,10 +23,11 @@
#ifndef _CREATE_FORUM_MSG_DIALOG_H #ifndef _CREATE_FORUM_MSG_DIALOG_H
#define _CREATE_FORUM_MSG_DIALOG_H #define _CREATE_FORUM_MSG_DIALOG_H
#include <QtGui>
#include <QWidget> #include <QWidget>
#include <string> #include <string>
#include "gui/feeds/SubFileItem.h" #include "gui/feeds/AttachFileItem.h"
#include "ui_CreateForumMsg.h" #include "ui_CreateForumMsg.h"
@ -43,7 +44,7 @@ public:
private slots: private slots:
void fileHashingFinished(SubFileItem* file); void fileHashingFinished(AttachFileItem* file);
/* actions to take.... */ /* actions to take.... */
void createMsg(); void createMsg();
void cancelMsg(); void cancelMsg();