mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-21 05:44:29 -05:00
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:
parent
6cb925016a
commit
bb3a1ba8b1
@ -40,7 +40,7 @@
|
||||
#include "rsiface/rsmsgs.h"
|
||||
#include "rsiface/rsfiles.h"
|
||||
|
||||
#include "gui/feeds/SubFileItem.h"
|
||||
#include "gui/feeds/AttachFileItem.h"
|
||||
#include <time.h>
|
||||
|
||||
#define appDir QApplication::applicationDirPath()
|
||||
@ -717,30 +717,30 @@ void PopupChatDialog::addExtraFile()
|
||||
}
|
||||
|
||||
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 << std::endl;
|
||||
|
||||
/* add widget in for new destination */
|
||||
SubFileItem *file = new SubFileItem(filePath);
|
||||
AttachFileItem *file = new AttachFileItem(filePath);
|
||||
//file->
|
||||
|
||||
ui.vboxLayout->addWidget(file, 1, 0);
|
||||
|
||||
//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);
|
||||
} 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 << std::endl;
|
||||
|
||||
//check that the file is ok tos end
|
||||
if (file->getState() == SFI_STATE_ERROR) {
|
||||
if (file->getState() == AFI_STATE_ERROR) {
|
||||
#ifdef CHAT_DEBUG
|
||||
std::cerr << "PopupChatDialog::fileHashingFinished error file is not hashed.";
|
||||
#endif
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include <gui/settings/rsharesettings.h>
|
||||
|
||||
#include "rsiface/rsiface.h"
|
||||
#include "gui/feeds/SubFileItem.h"
|
||||
#include "gui/feeds/AttachFileItem.h"
|
||||
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@ public slots:
|
||||
void addSmiley();
|
||||
|
||||
void changeStyle();
|
||||
void fileHashingFinished(SubFileItem* file);
|
||||
void fileHashingFinished(AttachFileItem* file);
|
||||
|
||||
void resetStatusBar() ;
|
||||
void updateStatusTyping() ;
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include "rsiface/rsforums.h"
|
||||
#include "rsiface/rsfiles.h"
|
||||
|
||||
#include "gui/feeds/SubFileItem.h"
|
||||
#include "gui/feeds/AttachFileItem.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
@ -315,30 +315,30 @@ void CreateForumMsg::addFile()
|
||||
}
|
||||
|
||||
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 << std::endl;
|
||||
|
||||
/* add widget in for new destination */
|
||||
SubFileItem *file = new SubFileItem(filePath);
|
||||
AttachFileItem *file = new AttachFileItem(filePath);
|
||||
//file->
|
||||
|
||||
ui.verticalLayout->addWidget(file, 1, 0);
|
||||
|
||||
//when the file is local or is finished hashing, call the fileHashingFinished method to send a chat message
|
||||
if (file->getState() == SFI_STATE_LOCAL) {
|
||||
//when the file is local or is finished hashing, call the fileHashingFinished method to send a forum message
|
||||
if (file->getState() == AFI_STATE_LOCAL) {
|
||||
fileHashingFinished(file);
|
||||
} 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 << std::endl;
|
||||
|
||||
//check that the file is ok tos end
|
||||
if (file->getState() == SFI_STATE_ERROR) {
|
||||
if (file->getState() == AFI_STATE_ERROR) {
|
||||
#ifdef CHAT_DEBUG
|
||||
std::cerr << "CreateForumMsg::fileHashingFinished error file is not hashed.";
|
||||
#endif
|
||||
|
@ -23,10 +23,11 @@
|
||||
#ifndef _CREATE_FORUM_MSG_DIALOG_H
|
||||
#define _CREATE_FORUM_MSG_DIALOG_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QWidget>
|
||||
#include <string>
|
||||
|
||||
#include "gui/feeds/SubFileItem.h"
|
||||
#include "gui/feeds/AttachFileItem.h"
|
||||
|
||||
#include "ui_CreateForumMsg.h"
|
||||
|
||||
@ -43,7 +44,7 @@ public:
|
||||
|
||||
private slots:
|
||||
|
||||
void fileHashingFinished(SubFileItem* file);
|
||||
void fileHashingFinished(AttachFileItem* file);
|
||||
/* actions to take.... */
|
||||
void createMsg();
|
||||
void cancelMsg();
|
||||
|
Loading…
Reference in New Issue
Block a user