2018-11-15 15:49:12 -05:00
|
|
|
/*******************************************************************************
|
|
|
|
* retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.h *
|
|
|
|
* *
|
|
|
|
* Copyright 2013 by Robert Fernie <retroshare.project@gmail.com> *
|
|
|
|
* *
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU Affero General Public License as *
|
|
|
|
* published by the Free Software Foundation, either version 3 of the *
|
|
|
|
* License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU Affero General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Affero General Public License *
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
2013-03-11 16:53:15 -04:00
|
|
|
|
|
|
|
#ifndef _CREATE_GXSCHANNEL_MSG_H
|
|
|
|
#define _CREATE_GXSCHANNEL_MSG_H
|
|
|
|
|
|
|
|
#include "ui_CreateGxsChannelMsg.h"
|
2013-03-12 20:33:14 -04:00
|
|
|
#include <retroshare/rsgxschannels.h>
|
2013-03-11 16:53:15 -04:00
|
|
|
|
|
|
|
#ifdef CHANNELS_FRAME_CATCHER
|
|
|
|
#include "util/framecatcher.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class SubFileItem;
|
|
|
|
|
2020-03-31 16:10:11 -04:00
|
|
|
class CreateGxsChannelMsg : public QDialog, private Ui::CreateGxsChannelMsg
|
2013-03-11 16:53:15 -04:00
|
|
|
{
|
2013-07-19 05:48:51 -04:00
|
|
|
Q_OBJECT
|
2013-03-11 16:53:15 -04:00
|
|
|
|
|
|
|
public:
|
2013-07-19 05:48:51 -04:00
|
|
|
/** Default Constructor */
|
2017-05-11 17:21:13 -04:00
|
|
|
CreateGxsChannelMsg(const RsGxsGroupId& cId, RsGxsMessageId existing_post = RsGxsMessageId());
|
2013-03-11 16:53:15 -04:00
|
|
|
|
2013-07-19 05:48:51 -04:00
|
|
|
/** Default Destructor */
|
|
|
|
~CreateGxsChannelMsg();
|
2013-03-11 16:53:15 -04:00
|
|
|
|
2020-10-24 08:07:45 -04:00
|
|
|
void reject() override;
|
|
|
|
|
|
|
|
void addHtmlText(const QString& text) ;
|
2020-12-14 15:48:43 -05:00
|
|
|
void addSubject(const QString& text) ;
|
|
|
|
|
|
|
|
// adds a file to be hashed and shared. Returns false if something goes wrong.
|
|
|
|
bool addAttachment(const std::string &path);
|
2017-05-15 15:37:22 -04:00
|
|
|
void addAttachment(const RsFileHash &hash, const std::string &fname, uint64_t size, bool local, const RsPeerId &srcId,bool assume_file_ready = false);
|
2013-03-11 16:53:15 -04:00
|
|
|
|
|
|
|
void newChannelMsg();
|
2013-07-19 05:48:51 -04:00
|
|
|
|
2013-03-11 16:53:15 -04:00
|
|
|
QPixmap picture;
|
|
|
|
|
|
|
|
protected:
|
2013-07-19 05:48:51 -04:00
|
|
|
virtual void dragEnterEvent(QDragEnterEvent *event);
|
|
|
|
virtual void dropEvent(QDropEvent *event);
|
2013-03-11 16:53:15 -04:00
|
|
|
|
|
|
|
private slots:
|
2020-11-16 15:55:00 -05:00
|
|
|
void toggle() ;
|
2013-03-11 16:53:15 -04:00
|
|
|
void addExtraFile();
|
|
|
|
void checkAttachmentReady();
|
2017-05-14 15:26:45 -04:00
|
|
|
void deleteAttachment();
|
2020-06-13 10:14:15 -04:00
|
|
|
void updatePreviewText(const QString &);
|
2020-10-23 18:02:26 -04:00
|
|
|
void clearAllAttachments();
|
2013-03-11 16:53:15 -04:00
|
|
|
|
|
|
|
void cancelMsg();
|
|
|
|
void sendMsg();
|
|
|
|
void pasteLink() ;
|
|
|
|
void contextMenu(QPoint) ;
|
2020-09-04 13:45:06 -04:00
|
|
|
void changeAspectRatio(int s);
|
2013-07-19 05:48:51 -04:00
|
|
|
|
2013-03-11 16:53:15 -04:00
|
|
|
void addThumbnail();
|
|
|
|
void allowAutoMediaThumbNail(bool);
|
|
|
|
|
2019-12-23 15:26:54 -05:00
|
|
|
void on_channelpostButton_clicked();
|
|
|
|
void on_attachmentsButton_clicked();
|
2020-11-22 09:41:06 -05:00
|
|
|
void on_removeButton_clicked();
|
2013-03-11 16:53:15 -04:00
|
|
|
private:
|
2020-09-12 08:08:18 -04:00
|
|
|
void processSettings(bool load);
|
2020-03-31 16:10:11 -04:00
|
|
|
void loadChannelInfo();
|
|
|
|
void loadOriginalChannelPostInfo();
|
2013-03-12 20:33:14 -04:00
|
|
|
void saveChannelInfo(const RsGroupMetaData &group);
|
2020-10-23 18:02:26 -04:00
|
|
|
void updateAttachmentCount();
|
2013-03-11 16:53:15 -04:00
|
|
|
|
2013-03-12 20:33:14 -04:00
|
|
|
void parseRsFileListAttachments(const std::string &attachList);
|
|
|
|
void sendMessage(const std::string &subject, const std::string &msg, const std::list<RsGxsFile> &files);
|
|
|
|
bool setThumbNail(const std::string& path, int frame);
|
2013-07-19 05:48:51 -04:00
|
|
|
|
2014-03-17 16:56:06 -04:00
|
|
|
RsGxsGroupId mChannelId;
|
2017-05-11 17:21:13 -04:00
|
|
|
RsGxsMessageId mOrigPostId;
|
2013-03-12 20:33:14 -04:00
|
|
|
RsGroupMetaData mChannelMeta;
|
2017-05-11 17:21:13 -04:00
|
|
|
RsMsgMetaData mOrigMeta;
|
2013-03-12 20:33:14 -04:00
|
|
|
bool mChannelMetaLoaded;
|
2013-03-11 16:53:15 -04:00
|
|
|
|
|
|
|
std::list<SubFileItem *> mAttachments;
|
|
|
|
|
|
|
|
bool mCheckAttachment;
|
2013-07-19 05:48:51 -04:00
|
|
|
bool mAutoMediaThumbNail;
|
2013-03-12 20:33:14 -04:00
|
|
|
|
2013-03-11 16:53:15 -04:00
|
|
|
#ifdef CHANNELS_FRAME_CATCHER
|
2013-07-19 05:48:51 -04:00
|
|
|
framecatcher* fCatcher;
|
2013-03-11 16:53:15 -04:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|