mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
Extracted a new widget ChatWidget for the basic chat handling from the PopupChatDialog and use it in ChatLobbyDialog too.
Added an own ui for the ChatLobbyDialog. Saved settings of the ChatLobbyDialog. Changed parameters of RsStatus interface from "std::string" to "const std::string&" Fixed german language. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4806 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
7d7101a62d
commit
35c7605704
38 changed files with 3720 additions and 2552 deletions
143
retroshare-gui/src/gui/chat/ChatWidget.h
Normal file
143
retroshare-gui/src/gui/chat/ChatWidget.h
Normal file
|
@ -0,0 +1,143 @@
|
|||
/****************************************************************
|
||||
*
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2011, RetroShare Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
#ifndef CHATWIDGET_H
|
||||
#define CHATWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "gui/common/HashBox.h"
|
||||
#include "ChatStyle.h"
|
||||
#include "gui/style/RSStyle.h"
|
||||
|
||||
#include <retroshare/rsmsgs.h>
|
||||
|
||||
class QAction;
|
||||
class QTextEdit;
|
||||
|
||||
namespace Ui {
|
||||
class ChatWidget;
|
||||
}
|
||||
|
||||
class ChatWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum enumChatType { TYPE_NORMAL, TYPE_HISTORY, TYPE_OFFLINE };
|
||||
|
||||
public:
|
||||
explicit ChatWidget(QWidget *parent = 0);
|
||||
~ChatWidget();
|
||||
|
||||
void init(const std::string &peerId, const QString &peerName);
|
||||
|
||||
bool hasNewMessages() { return newMessages; }
|
||||
bool isTyping() { return typing; }
|
||||
|
||||
void focusDialog();
|
||||
void addToParent(QWidget *newParent);
|
||||
void removeFromParent(QWidget *oldParent);
|
||||
|
||||
void addChatMsg(bool incoming, const QString &name, const QDateTime &sendTime, const QDateTime &recvTime, const QString &message, enumChatType chatType);
|
||||
void updateStatusString(const QString &statusMask, const QString &statusString);
|
||||
|
||||
void addToolsAction(QAction *action);
|
||||
|
||||
std::string getPeerId() { return peerId; }
|
||||
QString getPeerName() { return peerName; }
|
||||
int getPeerStatus() { return peerStatus; }
|
||||
|
||||
bool setStyle();
|
||||
const RSStyle *getStyle() { return &style; }
|
||||
|
||||
private slots:
|
||||
void clearChatHistory();
|
||||
void deleteChatHistory();
|
||||
void messageHistory();
|
||||
|
||||
signals:
|
||||
void infoChanged(ChatWidget*);
|
||||
void newMessage(ChatWidget*);
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *obj, QEvent *event);
|
||||
virtual void showEvent(QShowEvent *event);
|
||||
virtual void resizeEvent(QResizeEvent *event);
|
||||
|
||||
private slots:
|
||||
void pasteLink();
|
||||
void contextMenu(QPoint);
|
||||
|
||||
void fileHashingFinished(QList<HashedFile> hashedFiles);
|
||||
|
||||
void smileyWidget();
|
||||
void addSmiley();
|
||||
|
||||
void resetStatusBar() ;
|
||||
|
||||
void addExtraFile();
|
||||
void addExtraPicture();
|
||||
void on_closeInfoFrameButton_clicked();
|
||||
|
||||
void setColor();
|
||||
void getFont();
|
||||
void setFont();
|
||||
|
||||
void sendChat();
|
||||
|
||||
void updateStatus(const QString &peer_id, int status);
|
||||
void updatePeersCustomStateString(const QString& peer_id, const QString& status_string) ;
|
||||
|
||||
bool fileSave();
|
||||
bool fileSaveAs();
|
||||
|
||||
private:
|
||||
void updateStatusTyping();
|
||||
void setCurrentFileName(const QString &fileName);
|
||||
|
||||
void colorChanged(const QColor &c);
|
||||
void fontChanged(const QFont &font);
|
||||
void processSettings(bool load);
|
||||
|
||||
std::string peerId;
|
||||
QString peerName;
|
||||
|
||||
QColor currentColor;
|
||||
QFont currentFont;
|
||||
|
||||
QString fileName;
|
||||
|
||||
bool newMessages;
|
||||
bool typing;
|
||||
int peerStatus;
|
||||
bool isChatLobby;
|
||||
|
||||
time_t lastStatusSendTime;
|
||||
|
||||
ChatStyle chatStyle;
|
||||
RSStyle style;
|
||||
|
||||
Ui::ChatWidget *ui;
|
||||
};
|
||||
|
||||
#endif // CHATWIDGET_H
|
Loading…
Add table
Add a link
Reference in a new issue