mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-19 06:20:44 -04:00
Reworked MessageComposer
- Added To, Cc, Bcc and Recommend friends - Added group support - Show state of the friends in real time - Save state of the window in profile - Translated into german Added "Message group" to PeersDialog git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3541 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
baac505c15
commit
627b0ca54a
16 changed files with 2361 additions and 1447 deletions
|
@ -23,7 +23,6 @@
|
|||
#define _MESSAGECOMPOSER_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QSettings>
|
||||
#include <retroshare/rstypes.h>
|
||||
#include "ui_MessageComposer.h"
|
||||
|
||||
|
@ -33,108 +32,123 @@ class QFontComboBox;
|
|||
class QTextEdit;
|
||||
class QTextCharFormat;
|
||||
class AttachFileItem;
|
||||
class RSTreeWidgetItemCompareRole;
|
||||
|
||||
class MessageComposer : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/** Default Constructor */
|
||||
enum enumType { TO, CC, BCC };
|
||||
|
||||
MessageComposer(QWidget *parent = 0, Qt::WFlags flags = 0);
|
||||
public:
|
||||
/** Default Constructor */
|
||||
|
||||
static void msgFriend(std::string id);
|
||||
static void recommendFriend(std::list <std::string> &peerids);
|
||||
MessageComposer(QWidget *parent = 0, Qt::WFlags flags = 0);
|
||||
~MessageComposer();
|
||||
|
||||
void newMsg(std::string msgId = "");
|
||||
static void msgFriend(std::string id, bool group);
|
||||
static void recommendFriend(std::list <std::string> &peerids);
|
||||
|
||||
/* worker fns */
|
||||
void insertSendList();
|
||||
void insertFileList(const std::list<DirDetails>&);
|
||||
void insertFileList(const std::list<FileInfo>&);
|
||||
void insertTitleText(std::string title);
|
||||
void insertPastedText(std::string msg) ;
|
||||
void insertForwardPastedText(std::string msg);
|
||||
void insertHtmlText(std::string msg);
|
||||
void insertMsgText(std::string msg);
|
||||
void addRecipient(std::string id) ;
|
||||
void Create_New_Image_Tag( const QString urlremoteorlocal );
|
||||
QSettings setter;
|
||||
void newMsg(std::string msgId = "");
|
||||
|
||||
/* worker fns */
|
||||
void insertSendList();
|
||||
void insertFileList(const std::list<DirDetails>&);
|
||||
void insertFileList(const std::list<FileInfo>&);
|
||||
void insertTitleText(std::string title);
|
||||
void insertPastedText(std::string msg) ;
|
||||
void insertForwardPastedText(std::string msg);
|
||||
void insertHtmlText(std::string msg);
|
||||
void insertMsgText(std::string msg);
|
||||
void addRecipient(enumType type, const std::string &id, bool group);
|
||||
void Create_New_Image_Tag(const QString urlremoteorlocal);
|
||||
|
||||
public slots:
|
||||
|
||||
/* actions to take.... */
|
||||
void sendMessage();
|
||||
void cancelMessage();
|
||||
void addImage();
|
||||
/* actions to take.... */
|
||||
void sendMessage();
|
||||
void cancelMessage();
|
||||
void addImage();
|
||||
|
||||
void changeFormatType(int styleIndex );
|
||||
void changeFormatType(int styleIndex );
|
||||
|
||||
|
||||
protected:
|
||||
void closeEvent (QCloseEvent * event);
|
||||
void closeEvent (QCloseEvent * event);
|
||||
bool eventFilter(QObject *obj, QEvent *ev);
|
||||
|
||||
private slots:
|
||||
|
||||
/* toggle Contacts DockWidget */
|
||||
void toggleContacts();
|
||||
|
||||
/* for toggling flags */
|
||||
void togglePersonItem( QTreeWidgetItem *item, int col );
|
||||
void toggleRecommendItem( QTreeWidgetItem *item, int col );
|
||||
|
||||
void fileNew();
|
||||
void fileOpen();
|
||||
bool fileSave();
|
||||
bool fileSaveAs();
|
||||
void filePrint();
|
||||
void saveasDraft();
|
||||
/* toggle Contacts DockWidget */
|
||||
void on_contactsdockWidget_visibilityChanged(bool visible);
|
||||
void toggleContacts();
|
||||
|
||||
//void filePrintPreview();
|
||||
void filePrintPdf();
|
||||
|
||||
void textBold();
|
||||
void textUnderline();
|
||||
void textItalic();
|
||||
void textFamily(const QString &f);
|
||||
void textSize(const QString &p);
|
||||
void textStyle(int styleIndex);
|
||||
void textColor();
|
||||
void textAlign(QAction *a);
|
||||
/* for toggling flags */
|
||||
void toggleRecommendItem( QTreeWidgetItem *item, int col );
|
||||
|
||||
void currentCharFormatChanged(const QTextCharFormat &format);
|
||||
void cursorPositionChanged();
|
||||
|
||||
void clipboardDataChanged();
|
||||
|
||||
void fileHashingFinished(AttachFileItem* file);
|
||||
void fileNew();
|
||||
void fileOpen();
|
||||
bool fileSave();
|
||||
bool fileSaveAs();
|
||||
void filePrint();
|
||||
void saveasDraft();
|
||||
|
||||
void attachFile();
|
||||
void addAttachment(std::string);
|
||||
void checkAttachmentReady();
|
||||
//void filePrintPreview();
|
||||
void filePrintPdf();
|
||||
|
||||
void fontSizeIncrease();
|
||||
void fontSizeDecrease();
|
||||
void blockQuote();
|
||||
void toggleCode();
|
||||
void addPostSplitter();
|
||||
void textBold();
|
||||
void textUnderline();
|
||||
void textItalic();
|
||||
void textFamily(const QString &f);
|
||||
void textSize(const QString &p);
|
||||
void textStyle(int styleIndex);
|
||||
void textColor();
|
||||
void textAlign(QAction *a);
|
||||
|
||||
void filterRegExpChanged();
|
||||
void clearFilter();
|
||||
void titleChanged();
|
||||
void currentCharFormatChanged(const QTextCharFormat &format);
|
||||
void cursorPositionChanged();
|
||||
|
||||
void clipboardDataChanged();
|
||||
|
||||
void fileHashingFinished(AttachFileItem* file);
|
||||
|
||||
void attachFile();
|
||||
void addAttachment(std::string);
|
||||
void checkAttachmentReady();
|
||||
|
||||
void fontSizeIncrease();
|
||||
void fontSizeDecrease();
|
||||
void blockQuote();
|
||||
void toggleCode();
|
||||
void addPostSplitter();
|
||||
|
||||
void filterRegExpChanged();
|
||||
void clearFilter();
|
||||
void titleChanged();
|
||||
|
||||
// Add to To/Cc/Bcc address fields
|
||||
void btnClickEvent();
|
||||
void recommendButtonClicked();
|
||||
void editingRecipientFinished();
|
||||
|
||||
void groupsChanged(int type);
|
||||
void peerStatusChanged(const QString& peer_id, int status);
|
||||
|
||||
private:
|
||||
void setTextColor(const QColor& col) ;
|
||||
void setupFileActions();
|
||||
void setupEditActions();
|
||||
void setupViewActions();
|
||||
void setupInsertActions();
|
||||
void setupFormatActions();
|
||||
|
||||
bool load(const QString &f);
|
||||
bool maybeSave();
|
||||
//bool image_extension( QString nametomake );
|
||||
void setCurrentFileName(const QString &fileName);
|
||||
void processSettings(bool bLoad);
|
||||
|
||||
void setTextColor(const QColor& col) ;
|
||||
void setupFileActions();
|
||||
void setupEditActions();
|
||||
void setupViewActions();
|
||||
void setupInsertActions();
|
||||
void setupFormatActions();
|
||||
|
||||
bool load(const QString &f);
|
||||
bool maybeSave();
|
||||
//bool image_extension( QString nametomake );
|
||||
void setCurrentFileName(const QString &fileName);
|
||||
|
||||
void mergeFormatOnWordOrSelection(const QTextCharFormat &format);
|
||||
void fontChanged(const QFont &f);
|
||||
|
@ -143,55 +157,55 @@ private:
|
|||
|
||||
void sendMessage_internal(bool bDraftbox);
|
||||
|
||||
void FilterItems();
|
||||
bool FilterItem(QTreeWidgetItem *pItem, QString &sPattern);
|
||||
void FilterItems();
|
||||
bool FilterItem(QTreeWidgetItem *pItem, QString &sPattern);
|
||||
|
||||
void calculateTitle();
|
||||
void calculateTitle();
|
||||
void addEmptyRecipient();
|
||||
|
||||
/** Define the popup menus for the Context menu */
|
||||
QMenu* contextMnu;
|
||||
|
||||
/** Defines the actions for the context menu */
|
||||
QAction* deletechannelAct;
|
||||
QAction* createchannelmsgAct;
|
||||
|
||||
QAction *actionSave,
|
||||
*actionAlignLeft,
|
||||
*actionAlignCenter,
|
||||
*actionAlignRight,
|
||||
*actionAlignJustify,
|
||||
*actionUndo,
|
||||
*actionRedo,
|
||||
*actionCut,
|
||||
*actionCopy,
|
||||
*actionPaste;
|
||||
bool getRecipientFromRow(int row, enumType &type, std::string &id, bool &group);
|
||||
void setRecipientToRow(int row, enumType type, std::string id, bool group);
|
||||
|
||||
QTreeView *channelstreeView;
|
||||
|
||||
QString fileName;
|
||||
QString nametomake;
|
||||
|
||||
QColor codeBackground;
|
||||
QTextCharFormat defaultCharFormat;
|
||||
|
||||
QHash<QString, QString> autoLinkDictionary;
|
||||
QHash<QString, QString> autoLinkTitleDictionary;
|
||||
QHash<QString, int> autoLinkTargetDictionary;
|
||||
QAction *actionSave,
|
||||
*actionAlignLeft,
|
||||
*actionAlignCenter,
|
||||
*actionAlignRight,
|
||||
*actionAlignJustify,
|
||||
*actionUndo,
|
||||
*actionRedo,
|
||||
*actionCut,
|
||||
*actionCopy,
|
||||
*actionPaste;
|
||||
|
||||
std::string m_sMsgId; // existing message id
|
||||
std::string m_sDraftMsgId; // existing message id
|
||||
QAction *contactSidebarAction;
|
||||
|
||||
/* maps of files */
|
||||
std::list<AttachFileItem *> mAttachments;
|
||||
std::list<std::string> m_sslIds;
|
||||
QTreeView *channelstreeView;
|
||||
|
||||
bool mCheckAttachment;
|
||||
QString fileName;
|
||||
QString nametomake;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::MessageComposer ui;
|
||||
QColor codeBackground;
|
||||
QTextCharFormat defaultCharFormat;
|
||||
|
||||
std::list<FileInfo> _recList ;
|
||||
QHash<QString, QString> autoLinkDictionary;
|
||||
QHash<QString, QString> autoLinkTitleDictionary;
|
||||
QHash<QString, int> autoLinkTargetDictionary;
|
||||
|
||||
std::string m_sMsgId; // existing message id
|
||||
std::string m_sDraftMsgId; // existing message id
|
||||
|
||||
/* maps of files */
|
||||
std::list<AttachFileItem *> mAttachments;
|
||||
|
||||
bool mCheckAttachment;
|
||||
|
||||
RSTreeWidgetItemCompareRole *m_compareRole;
|
||||
QCompleter *m_completer;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::MessageComposer ui;
|
||||
|
||||
std::list<FileInfo> _recList ;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue