Chat service:

- Added send time to ChatInfo.

Chat:
- Reworked IMHistoryKeeper to save only needed data as raw data (not formatted from PeersDialog).
- Renamed the public chat history file from "his1.xml" to "chatPublic.xml" and moved it from data dir to config dir. The current history is lost. Please delete the file "his1.xml" manually.
- Optimized save of the history. Save only when changed, also during the runtime.
- Clear the history in PeersDialog clears the IMHistoryKeeper too.
- New setting to send chat message with Ctrl+Return. Changed the check for Enter in PeersDialog and PopupChatDialog from textChanged to eventFilter.
- Smileys are inserted at the current cursor position, not added at the end.
- Don't send emty messages.

New class ChatStyle:
- Created a new class for the work with chat styles and smileys.
- Currently only two internal styles are available - private and public. Later more external styles planned.
- Moved functions for loading and showing the emoticons from PeersDialog and PopupChatDialog to the new class.

Private chat:
- Split private chat style into incoming.htm and outgoing.htm.
- Removed style change.

Public chat:
- New chat style incoming.htm, outgoing.htm, hincoming.htm and houtgoing.htm.

Chat feed:
- Show links and emoticons if they are enabled for public chat.

PeersDialog:
- Show the own name and location only once at start and not with QTimer every 1.5 second.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3441 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-09-04 14:23:30 +00:00
parent 73f3fa3223
commit 8213a2aa77
33 changed files with 1167 additions and 1061 deletions

View file

@ -31,6 +31,8 @@ class QTextCharFormat;
class AttachFileItem;
class ChatInfo;
#include "ChatStyle.h"
class PopupChatDialog : public QMainWindow
{
Q_OBJECT
@ -79,16 +81,13 @@ protected:
virtual void dragEnterEvent(QDragEnterEvent *event);
virtual void dropEvent(QDropEvent *event);
void insertChatMsgs();
void addChatMsg(std::string &id, std::wstring &msg);
bool eventFilter(QObject *obj, QEvent *ev);
void loadEmoticons();
void loadEmoticons2();
void insertChatMsgs();
void addChatMsg(std::string &id, uint sendTime, std::wstring &msg);
void updateAvatar();
QString loadEmptyStyle();
QPixmap picture;
private slots:
@ -101,7 +100,6 @@ private slots:
void getFont();
void setFont();
void checkChat();
void sendChat();
void updatePeersCustomStateString(const QString& peer_id, const QString& status_string) ;
@ -130,17 +128,15 @@ private:
std::string lastChatName;
time_t last_status_send_time ;
QHash<QString, QString> smileys;
QColor mCurrentColor;
QFont mCurrentFont;
QString styleHtm;
QString emptyStyle;
QStringList history;
// QStringList history;
QString wholeChat;
QString fileName;
bool m_bInsertOnVisible;
ChatStyle style;
/** Qt Designer generated object */
Ui::PopupChatDialog ui;