mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-12 16:09:37 -05: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
@ -88,7 +88,7 @@ class RsStatus
|
||||
* This retrieves the status info one peer
|
||||
* @param statusInfo is populated with client's peer's status
|
||||
*/
|
||||
virtual bool getStatus(std::string &id, StatusInfo &statusInfo) = 0;
|
||||
virtual bool getStatus(const std::string &id, StatusInfo &statusInfo) = 0;
|
||||
|
||||
/**
|
||||
* send the client's status to his/her peers
|
||||
@ -96,7 +96,7 @@ class RsStatus
|
||||
* @param status the status of the peers
|
||||
* @return will return false if status info does not belong to client
|
||||
*/
|
||||
virtual bool sendStatus(std::string id, uint32_t status) = 0;
|
||||
virtual bool sendStatus(const std::string &id, uint32_t status) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
@ -47,12 +47,12 @@ bool p3Status::getStatusList(std::list<StatusInfo>& statusInfo){
|
||||
return mStatusSrv->getStatusList(statusInfo);
|
||||
}
|
||||
|
||||
bool p3Status::getStatus(std::string &id, StatusInfo &statusInfo)
|
||||
bool p3Status::getStatus(const std::string &id, StatusInfo &statusInfo)
|
||||
{
|
||||
return mStatusSrv->getStatus(id, statusInfo);
|
||||
}
|
||||
|
||||
bool p3Status::sendStatus(std::string id, uint32_t status){
|
||||
bool p3Status::sendStatus(const std::string &id, uint32_t status){
|
||||
|
||||
return mStatusSrv->sendStatus(id, status);
|
||||
}
|
||||
|
@ -45,8 +45,8 @@ public:
|
||||
|
||||
virtual bool getOwnStatus(StatusInfo& statusInfo);
|
||||
virtual bool getStatusList(std::list<StatusInfo>& statusInfo);
|
||||
virtual bool getStatus(std::string &id, StatusInfo &statusInfo);
|
||||
virtual bool sendStatus(std::string id, uint32_t status);
|
||||
virtual bool getStatus(const std::string &id, StatusInfo &statusInfo);
|
||||
virtual bool sendStatus(const std::string &id, uint32_t status);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -366,8 +366,9 @@ bool p3ChatService::isLobbyId(const std::string& id,ChatLobbyId& lobby_id)
|
||||
lobby_id = it->second ;
|
||||
return true ;
|
||||
}
|
||||
else
|
||||
return false ;
|
||||
|
||||
lobby_id = 0;
|
||||
return false ;
|
||||
}
|
||||
|
||||
bool p3ChatService::sendPrivateChat(const std::string &id, const std::wstring &msg)
|
||||
|
@ -106,7 +106,7 @@ bool p3StatusService::getStatusList(std::list<StatusInfo>& statusInfo)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool p3StatusService::getStatus(std::string &id, StatusInfo &statusInfo)
|
||||
bool p3StatusService::getStatus(const std::string &id, StatusInfo &statusInfo)
|
||||
{
|
||||
#ifdef STATUS_DEBUG
|
||||
std::cerr << "p3StatusService::getStatus() " << std::endl;
|
||||
|
@ -65,7 +65,7 @@ virtual void statusChange(const std::list<pqipeer> &plist);
|
||||
*/
|
||||
virtual bool getOwnStatus(StatusInfo& statusInfo);
|
||||
virtual bool getStatusList(std::list<StatusInfo>& statusInfo);
|
||||
virtual bool getStatus(std::string &id, StatusInfo &statusInfo);
|
||||
virtual bool getStatus(const std::string &id, StatusInfo &statusInfo);
|
||||
/* id = "", status is sent to all online peers */
|
||||
virtual bool sendStatus(const std::string &id, uint32_t status);
|
||||
|
||||
|
@ -271,6 +271,8 @@ HEADERS += rshare.h \
|
||||
gui/chat/PopupChatWindow.h \
|
||||
gui/chat/PopupChatDialog.h \
|
||||
gui/chat/ChatTabWidget.h \
|
||||
gui/chat/ChatWidget.h \
|
||||
gui/chat/ChatDialog.h \
|
||||
gui/ChatLobbyWidget.h \
|
||||
gui/chat/ChatLobbyDialog.h \
|
||||
gui/chat/CreateLobbyDialog.h \
|
||||
@ -413,6 +415,8 @@ FORMS += gui/StartDialog.ui \
|
||||
gui/chat/PopupChatWindow.ui \
|
||||
gui/chat/PopupChatDialog.ui \
|
||||
gui/chat/ChatTabWidget.ui \
|
||||
gui/chat/ChatWidget.ui \
|
||||
gui/chat/ChatLobbyDialog.ui \
|
||||
gui/chat/CreateLobbyDialog.ui \
|
||||
gui/ChatLobbyWidget.ui \
|
||||
gui/connect/ConfCertDialog.ui \
|
||||
@ -540,6 +544,8 @@ SOURCES += main.cpp \
|
||||
gui/chat/PopupChatWindow.cpp \
|
||||
gui/chat/PopupChatDialog.cpp \
|
||||
gui/chat/ChatTabWidget.cpp \
|
||||
gui/chat/ChatWidget.cpp \
|
||||
gui/chat/ChatDialog.cpp \
|
||||
gui/ChatLobbyWidget.cpp \
|
||||
gui/chat/ChatLobbyDialog.cpp \
|
||||
gui/chat/CreateLobbyDialog.cpp \
|
||||
|
@ -295,7 +295,7 @@ void ChatLobbyWidget::subscribeItem()
|
||||
if (rsMsgs->joinPublicChatLobby(id)) {
|
||||
std::string vpeer_id;
|
||||
if (rsMsgs->getVirtualPeerId(id, vpeer_id)) {
|
||||
PopupChatDialog::chatFriend(vpeer_id) ;
|
||||
ChatDialog::chatFriend(vpeer_id) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -311,7 +311,7 @@ void ChatLobbyWidget::unsubscribeItem()
|
||||
|
||||
std::string vpeer_id;
|
||||
if (rsMsgs->getVirtualPeerId(id, vpeer_id)) {
|
||||
PopupChatDialog::closeChat(vpeer_id);
|
||||
ChatDialog::closeChat(vpeer_id);
|
||||
}
|
||||
|
||||
rsMsgs->unsubscribeChatLobby(id);
|
||||
@ -339,7 +339,7 @@ void ChatLobbyWidget::displayChatLobbyEvent(qulonglong lobby_id, int event_type,
|
||||
|
||||
std::string vpid;
|
||||
if (rsMsgs->getVirtualPeerId(lobby_id, vpid)) {
|
||||
if (ChatLobbyDialog *cld = dynamic_cast<ChatLobbyDialog*>(PopupChatDialog::getExistingInstance(vpid))) {
|
||||
if (ChatLobbyDialog *cld = dynamic_cast<ChatLobbyDialog*>(ChatDialog::getExistingChat(vpid))) {
|
||||
cld->displayLobbyEvent(event_type, nickname, str);
|
||||
}
|
||||
}
|
||||
@ -351,14 +351,14 @@ void ChatLobbyWidget::readChatLobbyInvites()
|
||||
rsMsgs->getPendingChatLobbyInvites(invites);
|
||||
|
||||
for(std::list<ChatLobbyInvite>::const_iterator it(invites.begin());it!=invites.end();++it) {
|
||||
if (QMessageBox::Ok == QMessageBox::question(NULL, tr("Invitation to chat lobby"), QString::fromUtf8(rsPeers->getPeerName((*it).peer_id).c_str()) + QString(" invites you to chat lobby named ") + QString::fromUtf8((*it).lobby_name.c_str()), QMessageBox::Ok, QMessageBox::Ignore)) {
|
||||
if (QMessageBox::Ok == QMessageBox::question(this, tr("Invitation to chat lobby"), QString::fromUtf8(rsPeers->getPeerName((*it).peer_id).c_str()) + QString(" invites you to chat lobby named ") + QString::fromUtf8((*it).lobby_name.c_str()), QMessageBox::Ok, QMessageBox::Ignore)) {
|
||||
std::cerr << "Accepting invite to lobby " << (*it).lobby_name << std::endl;
|
||||
|
||||
rsMsgs->acceptLobbyInvite((*it).lobby_id);
|
||||
|
||||
std::string vpid;
|
||||
if(rsMsgs->getVirtualPeerId((*it).lobby_id,vpid )) {
|
||||
PopupChatDialog::chatFriend(vpid);
|
||||
ChatDialog::chatFriend(vpid);
|
||||
} else {
|
||||
std::cerr << "No lobby known with id 0x" << std::hex << (*it).lobby_id << std::dec << std::endl;
|
||||
}
|
||||
|
@ -89,11 +89,7 @@ p, li { white-space: pre-wrap; }
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Create new chat lobby</span></p></body></html></string>
|
||||
<string>Create new chat lobby</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton::menu-indicator {
|
||||
|
@ -37,9 +37,9 @@
|
||||
#include <retroshare/rshistory.h>
|
||||
|
||||
#include "channels/CreateChannel.h"
|
||||
#include "chat/PopupChatDialog.h"
|
||||
#include "common/Emoticons.h"
|
||||
#include "common/vmessagebox.h"
|
||||
#include "chat/ChatDialog.h"
|
||||
#include "connect/ConfCertDialog.h"
|
||||
#include "connect/ConnectFriendWizard.h"
|
||||
#include "forums/CreateForum.h"
|
||||
@ -320,15 +320,7 @@ void FriendsDialog::updateStatusString(const QString& peer_id, const QString& st
|
||||
|
||||
void FriendsDialog::updatePeerStatusString(const QString& peer_id,const QString& status_string,bool is_private_chat)
|
||||
{
|
||||
if(is_private_chat)
|
||||
{
|
||||
PopupChatDialog *pcd = PopupChatDialog::getExistingInstance(peer_id.toStdString());
|
||||
if (pcd) {
|
||||
pcd->updateStatusString(peer_id, status_string);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!is_private_chat) {
|
||||
#ifdef FRIENDS_DEBUG
|
||||
std::cerr << "Updating public chat msg from peer " << rsPeers->getPeerName(peer_id.toStdString()) << ": " << status_string.toStdString() << std::endl ;
|
||||
#endif
|
||||
@ -842,4 +834,4 @@ void FriendsDialog::createChatLobby()
|
||||
{
|
||||
std::list<std::string> friends;
|
||||
CreateLobbyDialog(friends).exec();
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@
|
||||
#include "ChannelFeed.h"
|
||||
#include "bwgraph/bwgraph.h"
|
||||
#include "help/browser/helpbrowser.h"
|
||||
#include "chat/PopupChatDialog.h"
|
||||
#include "chat/ChatDialog.h"
|
||||
#include "RetroShareLink.h"
|
||||
|
||||
#ifdef UNFINISHED
|
||||
@ -889,7 +889,7 @@ void MainWindow::updateStatus()
|
||||
void MainWindow::privateChatChanged(int list, int type)
|
||||
{
|
||||
/* first process the chat messages */
|
||||
PopupChatDialog::privateChatChanged(list, type);
|
||||
ChatDialog::chatChanged(list, type);
|
||||
|
||||
if (list == NOTIFY_LIST_PRIVATE_INCOMING_CHAT) {
|
||||
/* than count the chat messages */
|
||||
@ -1257,13 +1257,13 @@ void MainWindow::trayIconChannelsClicked(QSystemTrayIcon::ActivationReason e)
|
||||
void MainWindow::trayIconChatClicked(QSystemTrayIcon::ActivationReason e)
|
||||
{
|
||||
if(e == QSystemTrayIcon::Trigger || e == QSystemTrayIcon::DoubleClick) {
|
||||
PopupChatDialog *pcd = NULL;
|
||||
ChatDialog *chatDialog = NULL;
|
||||
std::list<std::string> ids;
|
||||
if (rsMsgs->getPrivateChatQueueIds(true, ids) && ids.size()) {
|
||||
pcd = PopupChatDialog::getPrivateChat(ids.front(), RS_CHAT_OPEN | RS_CHAT_FOCUS);
|
||||
chatDialog = ChatDialog::getChat(ids.front(), RS_CHAT_OPEN | RS_CHAT_FOCUS);
|
||||
}
|
||||
|
||||
if (pcd == NULL) {
|
||||
if (chatDialog == NULL) {
|
||||
showWindow(MainWindow::Friends);
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@
|
||||
#include "feeds/SecurityItem.h"
|
||||
|
||||
#include "settings/rsharesettings.h"
|
||||
#include "chat/PopupChatDialog.h"
|
||||
#include "chat/ChatDialog.h"
|
||||
|
||||
const uint32_t NEWSFEED_PEERLIST = 0x0001;
|
||||
const uint32_t NEWSFEED_FORUMNEWLIST = 0x0002;
|
||||
@ -548,7 +548,7 @@ void NewsFeed::openChat(std::string peerId)
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
PopupChatDialog::chatFriend(peerId);
|
||||
ChatDialog::chatFriend(peerId);
|
||||
}
|
||||
|
||||
void NewsFeed::itemDestroyed(QObject *item)
|
||||
|
351
retroshare-gui/src/gui/chat/ChatDialog.cpp
Normal file
351
retroshare-gui/src/gui/chat/ChatDialog.cpp
Normal file
@ -0,0 +1,351 @@
|
||||
/****************************************************************
|
||||
*
|
||||
* 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.
|
||||
****************************************************************/
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "ChatDialog.h"
|
||||
#include "gui/common/PeerDefs.h"
|
||||
#include "PopupChatDialog.h"
|
||||
#include "ChatLobbyDialog.h"
|
||||
#include "PopupChatWindow.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include "gui/msgs/MessageComposer.h"
|
||||
|
||||
#include <retroshare/rsiface.h>
|
||||
#include <retroshare/rsnotify.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
|
||||
static std::map<std::string, ChatDialog*> chatDialogs;
|
||||
|
||||
ChatDialog::ChatDialog(QWidget *parent, Qt::WFlags flags) :
|
||||
QWidget(parent, flags)
|
||||
{
|
||||
}
|
||||
|
||||
ChatDialog::~ChatDialog()
|
||||
{
|
||||
emit dialogClose(this);
|
||||
|
||||
std::map<std::string, ChatDialog *>::iterator it;
|
||||
if (chatDialogs.end() != (it = chatDialogs.find(getPeerId()))) {
|
||||
chatDialogs.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
void ChatDialog::init(const std::string &peerId, const QString &peerName)
|
||||
{
|
||||
this->peerId = peerId;
|
||||
|
||||
ChatWidget *cw = getChatWidget();
|
||||
if (cw) {
|
||||
cw->init(peerId, peerName);
|
||||
|
||||
connect(cw, SIGNAL(infoChanged(ChatWidget*)), this, SLOT(chatInfoChanged(ChatWidget*)));
|
||||
connect(cw, SIGNAL(newMessage(ChatWidget*)), this, SLOT(chatNewMessage(ChatWidget*)));
|
||||
}
|
||||
}
|
||||
|
||||
/*static*/ ChatDialog *ChatDialog::getExistingChat(const std::string &peerId)
|
||||
{
|
||||
std::map<std::string, ChatDialog*>::iterator it;
|
||||
if (chatDialogs.end() != (it = chatDialogs.find(peerId))) {
|
||||
/* exists already */
|
||||
return it->second;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*static*/ ChatDialog *ChatDialog::getChat(const std::string &peerId, uint chatflags)
|
||||
{
|
||||
/* see if it already exists */
|
||||
ChatDialog *cd = getExistingChat(peerId);
|
||||
|
||||
if (cd == NULL) {
|
||||
ChatLobbyId lobby_id;
|
||||
if (rsMsgs->isLobbyId(peerId, lobby_id)) {
|
||||
chatflags = RS_CHAT_OPEN | RS_CHAT_FOCUS; // use own flags
|
||||
}
|
||||
|
||||
if (chatflags & RS_CHAT_OPEN) {
|
||||
if (lobby_id) {
|
||||
std::list<ChatLobbyInfo> linfos;
|
||||
rsMsgs->getChatLobbyList(linfos);
|
||||
|
||||
for (std::list<ChatLobbyInfo>::const_iterator it(linfos.begin()); it != linfos.end(); ++it) {
|
||||
if ((*it).lobby_id == lobby_id) {
|
||||
cd = new ChatLobbyDialog(lobby_id);
|
||||
chatDialogs[peerId] = cd;
|
||||
cd->init(peerId, QString::fromUtf8((*it).lobby_name.c_str()));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
RsPeerDetails sslDetails;
|
||||
if (rsPeers->getPeerDetails(peerId, sslDetails)) {
|
||||
cd = new PopupChatDialog();
|
||||
chatDialogs[peerId] = cd;
|
||||
cd->init(peerId, PeerDefs::nameWithLocation(sslDetails));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cd == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cd->insertChatMsgs();
|
||||
cd->showDialog(chatflags);
|
||||
|
||||
return cd;
|
||||
}
|
||||
|
||||
/*static*/ void ChatDialog::cleanupChat()
|
||||
{
|
||||
PopupChatWindow::cleanup();
|
||||
|
||||
/* ChatDialog destuctor removes the entry from the map */
|
||||
std::list<ChatDialog*> list;
|
||||
|
||||
std::map<std::string, ChatDialog*>::iterator it;
|
||||
for (it = chatDialogs.begin(); it != chatDialogs.end(); it++) {
|
||||
if (it->second) {
|
||||
list.push_back(it->second);
|
||||
}
|
||||
}
|
||||
|
||||
chatDialogs.clear();
|
||||
|
||||
std::list<ChatDialog*>::iterator it1;
|
||||
for (it1 = list.begin(); it1 != list.end(); it1++) {
|
||||
delete (*it1);
|
||||
}
|
||||
}
|
||||
|
||||
/*static*/ void ChatDialog::chatChanged(int list, int type)
|
||||
{
|
||||
if (list == NOTIFY_LIST_PRIVATE_INCOMING_CHAT && type == NOTIFY_TYPE_ADD) {
|
||||
std::list<std::string> ids;
|
||||
if (rsMsgs->getPrivateChatQueueIds(true, ids)) {
|
||||
uint chatflags = Settings->getChatFlags();
|
||||
|
||||
std::list<std::string>::iterator id;
|
||||
for (id = ids.begin(); id != ids.end(); id++) {
|
||||
ChatDialog *cd = getChat(*id, chatflags);
|
||||
|
||||
if (cd) {
|
||||
cd->insertChatMsgs();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* now notify all open priavate chat windows */
|
||||
std::map<std::string, ChatDialog *>::iterator it;
|
||||
for (it = chatDialogs.begin (); it != chatDialogs.end(); it++) {
|
||||
if (it->second) {
|
||||
it->second->onChatChanged(list, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*static*/ void ChatDialog::closeChat(const std::string& peerId)
|
||||
{
|
||||
ChatDialog *chatDialog = getExistingChat(peerId);
|
||||
|
||||
if (chatDialog) {
|
||||
delete(chatDialog);
|
||||
}
|
||||
}
|
||||
|
||||
/*static*/ void ChatDialog::chatFriend(const std::string &peerId)
|
||||
{
|
||||
if (peerId.empty()){
|
||||
return;
|
||||
}
|
||||
|
||||
ChatLobbyId lid;
|
||||
if (rsMsgs->isLobbyId(peerId, lid)) {
|
||||
getChat(peerId, RS_CHAT_OPEN | RS_CHAT_FOCUS);
|
||||
return;
|
||||
}
|
||||
|
||||
RsPeerDetails detail;
|
||||
if (!rsPeers->getPeerDetails(peerId, detail))
|
||||
return;
|
||||
|
||||
std::string firstId;
|
||||
|
||||
if (detail.isOnlyGPGdetail) {
|
||||
//let's get the ssl child details, and open all the chat boxes
|
||||
std::list<std::string> sslIds;
|
||||
rsPeers->getAssociatedSSLIds(detail.gpg_id, sslIds);
|
||||
for (std::list<std::string>::iterator it = sslIds.begin(); it != sslIds.end(); it++) {
|
||||
if (firstId.empty()) {
|
||||
firstId = *it;
|
||||
}
|
||||
|
||||
RsPeerDetails sslDetails;
|
||||
if (rsPeers->getPeerDetails(*it, sslDetails)) {
|
||||
if (sslDetails.state & RS_PEER_STATE_CONNECTED) {
|
||||
getChat(*it, RS_CHAT_OPEN | RS_CHAT_FOCUS);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (detail.state & RS_PEER_STATE_CONNECTED) {
|
||||
getChat(peerId, RS_CHAT_OPEN | RS_CHAT_FOCUS);
|
||||
return;
|
||||
}
|
||||
firstId = peerId;
|
||||
}
|
||||
|
||||
/* info dialog */
|
||||
QMessageBox mb(QMessageBox::Question, tr("Friend not Online"), tr("Your Friend is offline \nDo you want to send them a Message instead"), QMessageBox::Yes | QMessageBox::No);
|
||||
mb.setWindowIcon(QIcon(":/images/rstray3.png"));
|
||||
if (mb.exec() == QMessageBox::Yes) {
|
||||
MessageComposer::msgFriend(peerId, false);
|
||||
} else {
|
||||
if (firstId.empty() == false) {
|
||||
getChat(firstId, RS_CHAT_OPEN | RS_CHAT_FOCUS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ChatDialog::addToParent(QWidget *newParent)
|
||||
{
|
||||
ChatWidget *cw = getChatWidget();
|
||||
if (cw) {
|
||||
cw->addToParent(newParent);
|
||||
}
|
||||
}
|
||||
|
||||
void ChatDialog::removeFromParent(QWidget *oldParent)
|
||||
{
|
||||
ChatWidget *cw = getChatWidget();
|
||||
if (cw) {
|
||||
cw->removeFromParent(oldParent);
|
||||
}
|
||||
}
|
||||
|
||||
bool ChatDialog::isTyping()
|
||||
{
|
||||
ChatWidget *cw = getChatWidget();
|
||||
if (cw) {
|
||||
return cw->isTyping();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ChatDialog::hasNewMessages()
|
||||
{
|
||||
ChatWidget *cw = getChatWidget();
|
||||
if (cw) {
|
||||
return cw->hasNewMessages();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int ChatDialog::getPeerStatus()
|
||||
{
|
||||
ChatWidget *cw = getChatWidget();
|
||||
if (cw) {
|
||||
return cw->getPeerStatus();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QString ChatDialog::getTitle()
|
||||
{
|
||||
ChatWidget *cw = getChatWidget();
|
||||
if (cw) {
|
||||
return cw->getPeerName();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
void ChatDialog::focusDialog()
|
||||
{
|
||||
ChatWidget *cw = getChatWidget();
|
||||
if (cw) {
|
||||
cw->focusDialog();
|
||||
}
|
||||
}
|
||||
|
||||
bool ChatDialog::setStyle()
|
||||
{
|
||||
ChatWidget *cw = getChatWidget();
|
||||
if (cw) {
|
||||
return cw->setStyle();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
const RSStyle *ChatDialog::getStyle()
|
||||
{
|
||||
ChatWidget *cw = getChatWidget();
|
||||
if (cw) {
|
||||
return cw->getStyle();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ChatDialog::chatInfoChanged(ChatWidget*)
|
||||
{
|
||||
emit infoChanged(this);
|
||||
}
|
||||
|
||||
void ChatDialog::chatNewMessage(ChatWidget*)
|
||||
{
|
||||
emit newMessage(this);
|
||||
}
|
||||
|
||||
void ChatDialog::insertChatMsgs()
|
||||
{
|
||||
std::string peerId = getPeerId();
|
||||
|
||||
std::list<ChatInfo> newchat;
|
||||
if (!rsMsgs->getPrivateChatQueue(true, peerId, newchat)) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::list<ChatInfo>::iterator it;
|
||||
for(it = newchat.begin(); it != newchat.end(); it++)
|
||||
{
|
||||
/* are they public? */
|
||||
if ((it->chatflags & RS_CHAT_PRIVATE) == 0) {
|
||||
/* this should not happen */
|
||||
continue;
|
||||
}
|
||||
|
||||
addIncomingChatMsg(*it);
|
||||
}
|
||||
|
||||
rsMsgs->clearPrivateChatQueue(true, peerId);
|
||||
}
|
87
retroshare-gui/src/gui/chat/ChatDialog.h
Normal file
87
retroshare-gui/src/gui/chat/ChatDialog.h
Normal file
@ -0,0 +1,87 @@
|
||||
/****************************************************************
|
||||
*
|
||||
* 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 CHATDIALOG_H
|
||||
#define CHATDIALOG_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <retroshare/rsmsgs.h>
|
||||
|
||||
class ChatWidget;
|
||||
class RSStyle;
|
||||
|
||||
class ChatDialog : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static ChatDialog *getExistingChat(const std::string &peerId);
|
||||
static ChatDialog *getChat(const std::string &peerId, uint chatflags);
|
||||
static void cleanupChat();
|
||||
static void chatFriend(const std::string &peerId);
|
||||
static void closeChat(const std::string &peerId);
|
||||
static void chatChanged(int list, int type);
|
||||
|
||||
virtual bool canClose() { return true; }
|
||||
virtual void showDialog(uint chatflags) {}
|
||||
|
||||
virtual ChatWidget *getChatWidget() = 0;
|
||||
virtual bool hasPeerStatus() = 0;
|
||||
|
||||
void addToParent(QWidget *newParent);
|
||||
void removeFromParent(QWidget *oldParent);
|
||||
|
||||
std::string getPeerId() { return peerId; }
|
||||
QString getTitle();
|
||||
bool hasNewMessages();
|
||||
bool isTyping();
|
||||
|
||||
bool setStyle();
|
||||
const RSStyle *getStyle();
|
||||
|
||||
void insertChatMsgs();
|
||||
int getPeerStatus();
|
||||
|
||||
void focusDialog();
|
||||
|
||||
signals:
|
||||
void dialogClose(ChatDialog *dialog);
|
||||
void infoChanged(ChatDialog *dialog);
|
||||
void newMessage(ChatDialog *dialog);
|
||||
|
||||
private slots:
|
||||
void chatInfoChanged(ChatWidget*);
|
||||
void chatNewMessage(ChatWidget*);
|
||||
|
||||
protected:
|
||||
explicit ChatDialog(QWidget *parent = 0, Qt::WFlags flags = 0);
|
||||
virtual ~ChatDialog();
|
||||
|
||||
virtual void init(const std::string &peerId, const QString &peerName);
|
||||
virtual void onChatChanged(int list, int type) {}
|
||||
|
||||
virtual void addIncomingChatMsg(const ChatInfo& info) = 0;
|
||||
|
||||
std::string peerId;
|
||||
};
|
||||
|
||||
#endif // CHATDIALOG_H
|
@ -21,52 +21,43 @@
|
||||
****************************************************************/
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QTimer>
|
||||
#include <QScrollBar>
|
||||
#include <QCloseEvent>
|
||||
#include <QColorDialog>
|
||||
#include <QDateTime>
|
||||
#include <QFontDialog>
|
||||
#include <QDir>
|
||||
#include <QBuffer>
|
||||
#include <QTextCodec>
|
||||
#include <QListWidget>
|
||||
#include <QSound>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "util/misc.h"
|
||||
#include "rshare.h"
|
||||
|
||||
#include <retroshare/rspeers.h>
|
||||
#include <retroshare/rsmsgs.h>
|
||||
#include <retroshare/rsstatus.h>
|
||||
|
||||
#include <time.h>
|
||||
#include <algorithm>
|
||||
|
||||
#include "ChatLobbyDialog.h"
|
||||
#include "gui/ChatLobbyWidget.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include "gui/settings/RsharePeerSettings.h"
|
||||
|
||||
#include <retroshare/rsnotify.h>
|
||||
|
||||
#include <time.h>
|
||||
|
||||
/** Default constructor */
|
||||
ChatLobbyDialog::ChatLobbyDialog(const std::string& dialog_id, const ChatLobbyId& lid, const QString &name, QWidget *parent, Qt::WFlags flags)
|
||||
: PopupChatDialog(dialog_id, name, parent, flags), lobby_id(lid)
|
||||
ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::WFlags flags)
|
||||
: ChatDialog(parent, flags), lobbyId(lid)
|
||||
{
|
||||
// remove the avatar widget. Replace it with a friends list.
|
||||
ui.avatarWidget->hide();
|
||||
ui.ownAvatarWidget->hide();
|
||||
PopupChatDialog::updateStatus(QString::fromStdString(getPeerId()),RS_STATUS_ONLINE);
|
||||
/* Invoke Qt Designer generated QObject setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
// hide history buttons
|
||||
ui.actionClearOfflineMessages->setVisible(false);
|
||||
ui.actionDelete_Chat_History->setVisible(false);
|
||||
ui.actionMessageHistory->setVisible(false);
|
||||
connect(ui.participantsFrameButton, SIGNAL(toggled(bool)), this, SLOT(showParticipantsFrame(bool)));
|
||||
}
|
||||
|
||||
ui.avatarFrameButton->setToolTip(tr("Hide participants"));
|
||||
void ChatLobbyDialog::init(const std::string &peerId, const QString &peerName)
|
||||
{
|
||||
ChatDialog::init(peerId, peerName);
|
||||
|
||||
ui.avatarframe->layout()->addWidget(new QLabel(tr("Participants:")));
|
||||
friendsListWidget = new QListWidget;
|
||||
ui.avatarframe->layout()->addWidget(friendsListWidget);
|
||||
ui.avatarframe->layout()->addItem(new QSpacerItem(12, 335, QSizePolicy::Minimum, QSizePolicy::Expanding));
|
||||
lastUpdateListTime = 0;
|
||||
|
||||
/* Hide or show the participants frames */
|
||||
showParticipantsFrame(PeerSettings->getShowParticipantsFrame(peerId));
|
||||
|
||||
// add to window
|
||||
ChatTabWidget *tabWidget = ChatLobbyWidget::getTabWidget();
|
||||
if (tabWidget) {
|
||||
tabWidget->addDialog(this);
|
||||
}
|
||||
|
||||
// load settings
|
||||
processSettings(true);
|
||||
}
|
||||
|
||||
/** Destructor. */
|
||||
@ -76,25 +67,35 @@ ChatLobbyDialog::~ChatLobbyDialog()
|
||||
|
||||
// check that the lobby still exists.
|
||||
ChatLobbyId lid;
|
||||
if (rsMsgs->isLobbyId(getPeerId(),lid)) {
|
||||
rsMsgs->unsubscribeChatLobby(lobby_id);
|
||||
if (rsMsgs->isLobbyId(getPeerId(), lid)) {
|
||||
rsMsgs->unsubscribeChatLobby(lobbyId);
|
||||
}
|
||||
|
||||
// save settings
|
||||
processSettings(false);
|
||||
}
|
||||
|
||||
bool ChatLobbyDialog::addToParent()
|
||||
ChatWidget *ChatLobbyDialog::getChatWidget()
|
||||
{
|
||||
ChatTabWidget *tabWidget = ChatLobbyWidget::getTabWidget();
|
||||
if (tabWidget) {
|
||||
tabWidget->addDialog(this);
|
||||
return true;
|
||||
return ui.chatWidget;
|
||||
}
|
||||
|
||||
void ChatLobbyDialog::processSettings(bool load)
|
||||
{
|
||||
Settings->beginGroup(QString("ChatLobbyDialog"));
|
||||
|
||||
if (load) {
|
||||
// load settings
|
||||
} else {
|
||||
// save settings
|
||||
}
|
||||
|
||||
return false;
|
||||
Settings->endGroup();
|
||||
}
|
||||
|
||||
void ChatLobbyDialog::setNickName(const QString& nick)
|
||||
{
|
||||
rsMsgs->setNickNameForChatLobby(lobby_id, nick.toUtf8().constData());
|
||||
rsMsgs->setNickNameForChatLobby(lobbyId, nick.toUtf8().constData());
|
||||
}
|
||||
|
||||
void ChatLobbyDialog::addIncomingChatMsg(const ChatInfo& info)
|
||||
@ -104,70 +105,89 @@ void ChatLobbyDialog::addIncomingChatMsg(const ChatInfo& info)
|
||||
QString message = QString::fromStdWString(info.msg);
|
||||
QString name = QString::fromUtf8(info.peer_nickname.c_str());
|
||||
|
||||
addChatMsg(true, name, sendTime, recvTime, message, TYPE_NORMAL);
|
||||
ui.chatWidget->addChatMsg(true, name, sendTime, recvTime, message, ChatWidget::TYPE_NORMAL);
|
||||
|
||||
// also update peer list.
|
||||
|
||||
static time_t last = 0 ;
|
||||
time_t now = time(NULL) ;
|
||||
time_t now = time(NULL);
|
||||
|
||||
if (now > last) {
|
||||
last = now;
|
||||
updateFriendsList();
|
||||
if (now > lastUpdateListTime) {
|
||||
lastUpdateListTime = now;
|
||||
updateParticipantsList();
|
||||
}
|
||||
}
|
||||
|
||||
void ChatLobbyDialog::updateFriendsList()
|
||||
void ChatLobbyDialog::updateParticipantsList()
|
||||
{
|
||||
friendsListWidget->clear();
|
||||
ui.participantsList->clear();
|
||||
|
||||
std::list<ChatLobbyInfo> linfos;
|
||||
rsMsgs->getChatLobbyList(linfos);
|
||||
|
||||
std::list<ChatLobbyInfo>::const_iterator it(linfos.begin());
|
||||
for (; it!=linfos.end() && (*it).lobby_id != lobby_id; ++it);
|
||||
for (; it!=linfos.end() && (*it).lobby_id != lobbyId; ++it);
|
||||
|
||||
if (it != linfos.end()) {
|
||||
for (std::map<std::string,time_t>::const_iterator it2((*it).nick_names.begin()); it2 != (*it).nick_names.end(); ++it2) {
|
||||
friendsListWidget->addItem(QString::fromUtf8((it2->first).c_str()));
|
||||
ui.participantsList->addItem(QString::fromUtf8((it2->first).c_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ChatLobbyDialog::displayLobbyEvent(int event_type, const QString& nickname, const QString& str)
|
||||
{
|
||||
switch(event_type)
|
||||
{
|
||||
case RS_CHAT_LOBBY_EVENT_PEER_LEFT:
|
||||
addChatMsg(true, tr("Lobby management"), QDateTime::currentDateTime(), QDateTime::currentDateTime(), tr("%1 has left the lobby.").arg(str), TYPE_NORMAL);
|
||||
break;
|
||||
case RS_CHAT_LOBBY_EVENT_PEER_JOINED:
|
||||
addChatMsg(true, tr("Lobby management"), QDateTime::currentDateTime(), QDateTime::currentDateTime(), tr("%1 joined the lobby.").arg(str), TYPE_NORMAL);
|
||||
break;
|
||||
case RS_CHAT_LOBBY_EVENT_PEER_STATUS:
|
||||
updateStatusString(nickname,str);
|
||||
break;
|
||||
default:
|
||||
std::cerr << "ChatLobbyDialog::displayLobbyEvent() Unhandled lobby event type " << event_type << std::endl;
|
||||
switch (event_type) {
|
||||
case RS_CHAT_LOBBY_EVENT_PEER_LEFT:
|
||||
ui.chatWidget->addChatMsg(true, tr("Lobby management"), QDateTime::currentDateTime(), QDateTime::currentDateTime(), tr("%1 has left the lobby.").arg(str), ChatWidget::TYPE_NORMAL);
|
||||
break;
|
||||
case RS_CHAT_LOBBY_EVENT_PEER_JOINED:
|
||||
ui.chatWidget->addChatMsg(true, tr("Lobby management"), QDateTime::currentDateTime(), QDateTime::currentDateTime(), tr("%1 joined the lobby.").arg(str), ChatWidget::TYPE_NORMAL);
|
||||
break;
|
||||
case RS_CHAT_LOBBY_EVENT_PEER_STATUS:
|
||||
ui.chatWidget->updateStatusString(nickname + " %1", str);
|
||||
break;
|
||||
default:
|
||||
std::cerr << "ChatLobbyDialog::displayLobbyEvent() Unhandled lobby event type " << event_type << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
QString ChatLobbyDialog::makeStatusString(const QString& peer_id, const QString& status_string) const
|
||||
{
|
||||
return QString::fromUtf8(peer_id.toStdString().c_str()) + " " + tr(status_string.toAscii());
|
||||
}
|
||||
|
||||
bool ChatLobbyDialog::canClose()
|
||||
{
|
||||
// check that the lobby still exists.
|
||||
ChatLobbyId lid;
|
||||
if (!rsMsgs->isLobbyId(getPeerId(),lid)) {
|
||||
if (!rsMsgs->isLobbyId(getPeerId(), lid)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (QMessageBox::Yes == QMessageBox::question(NULL, tr("Unsubscribe to lobby?"), tr("Do you want to unsubscribe to this chat lobby?"), QMessageBox::Yes | QMessageBox::No)) {
|
||||
if (QMessageBox::Yes == QMessageBox::question(this, tr("Unsubscribe to lobby"), tr("Do you want to unsubscribe to this chat lobby?"), QMessageBox::Yes | QMessageBox::No)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ChatLobbyDialog::showDialog(uint chatflags)
|
||||
{
|
||||
if (chatflags & RS_CHAT_FOCUS) {
|
||||
ChatTabWidget *tabWidget = ChatLobbyWidget::getTabWidget();
|
||||
if (tabWidget) {
|
||||
tabWidget->setCurrentWidget(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ChatLobbyDialog::showParticipantsFrame(bool show)
|
||||
{
|
||||
ui.participantsFrame->setVisible(show);
|
||||
ui.participantsFrameButton->setChecked(show);
|
||||
|
||||
if (show) {
|
||||
ui.participantsFrameButton->setToolTip(tr("Hide Participants"));
|
||||
ui.participantsFrameButton->setIcon(QIcon(":images/hide_toolbox_frame.png"));
|
||||
} else {
|
||||
ui.participantsFrameButton->setToolTip(tr("Show Participants"));
|
||||
ui.participantsFrameButton->setIcon(QIcon(":images/show_toolbox_frame.png"));
|
||||
}
|
||||
|
||||
PeerSettings->setShowParticipantsFrame(getPeerId(), show);
|
||||
}
|
||||
|
@ -23,59 +23,49 @@
|
||||
#ifndef _CHATLOBBYDIALOG_H
|
||||
#define _CHATLOBBYDIALOG_H
|
||||
|
||||
#include "ui_PopupChatDialog.h"
|
||||
#include "ui_ChatLobbyDialog.h"
|
||||
#include "ChatDialog.h"
|
||||
|
||||
class QAction;
|
||||
class QTextEdit;
|
||||
class QTextCharFormat;
|
||||
class AttachFileItem;
|
||||
class ChatInfo;
|
||||
class QListWidget ;
|
||||
|
||||
#include <retroshare/rsmsgs.h>
|
||||
#include "ChatStyle.h"
|
||||
#include "gui/style/RSStyle.h"
|
||||
#include "PopupChatDialog.h"
|
||||
|
||||
class ChatLobbyDialog: public PopupChatDialog
|
||||
class ChatLobbyDialog: public ChatDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
void displayLobbyEvent(int event_type,const QString& nickname,const QString& str) ;
|
||||
friend class ChatDialog;
|
||||
|
||||
public:
|
||||
void displayLobbyEvent(int event_type, const QString& nickname, const QString& str);
|
||||
|
||||
// The following methods are differentfrom those of the parent:
|
||||
//
|
||||
virtual bool hasPeerStatus() { return false; }
|
||||
virtual bool canClose();
|
||||
virtual void showDialog(uint chatflags);
|
||||
virtual ChatWidget *getChatWidget();
|
||||
virtual bool hasPeerStatus() { return false; }
|
||||
|
||||
private slots:
|
||||
void showParticipantsFrame(bool show);
|
||||
|
||||
protected:
|
||||
/** Default constructor */
|
||||
ChatLobbyDialog(const std::string& id,const ChatLobbyId& lid, const QString &name, QWidget *parent = 0, Qt::WFlags flags = 0);
|
||||
ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent = 0, Qt::WFlags flags = 0);
|
||||
|
||||
/** Default destructor */
|
||||
virtual ~ChatLobbyDialog();
|
||||
|
||||
// virtual void addChatMsg(bool incoming, const QString &name, const QDateTime &sendTime, const QDateTime &recvTime, const QString &message, enumChatType chatType);
|
||||
// virtual void sendChat();
|
||||
void processSettings(bool load);
|
||||
|
||||
friend class PopupChatDialog ;
|
||||
|
||||
// The following methods are differentfrom those of the parent:
|
||||
//
|
||||
virtual bool addToParent();
|
||||
virtual bool isChatLobby() { return true; }
|
||||
virtual void addIncomingChatMsg(const ChatInfo& info) ; //
|
||||
virtual QString makeStatusString(const QString& peer_id,const QString& status_string) const ;
|
||||
virtual void init(const std::string &peerId, const QString &peerName);
|
||||
virtual void addIncomingChatMsg(const ChatInfo& info);
|
||||
|
||||
protected slots:
|
||||
void setNickName(const QString&) ;
|
||||
void setNickName(const QString&);
|
||||
|
||||
private:
|
||||
void updateFriendsList() ;
|
||||
void updateParticipantsList();
|
||||
|
||||
ChatLobbyId lobby_id ;
|
||||
QListWidget *friendsListWidget ;
|
||||
ChatLobbyId lobbyId;
|
||||
time_t lastUpdateListTime;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::ChatLobbyDialog ui;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
182
retroshare-gui/src/gui/chat/ChatLobbyDialog.ui
Normal file
182
retroshare-gui/src/gui/chat/ChatLobbyDialog.ui
Normal file
@ -0,0 +1,182 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ChatLobbyDialog</class>
|
||||
<widget class="QWidget" name="ChatLobbyDialog">
|
||||
<property name="windowModality">
|
||||
<enum>Qt::NonModal</enum>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>531</width>
|
||||
<height>451</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">MainWindow</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item row="0" column="0" rowspan="4">
|
||||
<widget class="QFrame" name="leftsideframe">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>14</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QFrame#frame{border: transparent}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="participantsFrameButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>14</width>
|
||||
<height>31</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>14</width>
|
||||
<height>31</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>31</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>12</width>
|
||||
<height>335</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" rowspan="4">
|
||||
<widget class="QFrame" name="participantsFrame">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>132</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border: transparent;</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="_2">
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QListWidget" name="participantsList">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QListWidget{
|
||||
border: 1px solid #B8B6B1;
|
||||
border-radius: 6px;
|
||||
background: white;
|
||||
}</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" rowspan="4">
|
||||
<widget class="ChatWidget" name="chatWidget" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>ChatWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">gui/chat/ChatWidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,6 +1,28 @@
|
||||
/****************************************************************
|
||||
*
|
||||
* 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.
|
||||
****************************************************************/
|
||||
|
||||
#include "ChatTabWidget.h"
|
||||
#include "ui_ChatTabWidget.h"
|
||||
#include "PopupChatDialog.h"
|
||||
#include "ChatDialog.h"
|
||||
#include "gui/common/StatusDefs.h"
|
||||
|
||||
#define IMAGE_WINDOW ":/images/rstray3.png"
|
||||
@ -22,28 +44,30 @@ ChatTabWidget::~ChatTabWidget()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ChatTabWidget::addDialog(PopupChatDialog *dialog)
|
||||
void ChatTabWidget::addDialog(ChatDialog *dialog)
|
||||
{
|
||||
addTab(dialog, dialog->getTitle());
|
||||
dialog->addToParent(this);
|
||||
|
||||
QObject::connect(dialog, SIGNAL(infoChanged(PopupChatDialog*)), this, SLOT(tabInfoChanged(PopupChatDialog*)));
|
||||
QObject::connect(dialog, SIGNAL(infoChanged(ChatDialog*)), this, SLOT(tabInfoChanged(ChatDialog*)));
|
||||
|
||||
tabInfoChanged(dialog);
|
||||
}
|
||||
|
||||
void ChatTabWidget::removeDialog(PopupChatDialog *dialog)
|
||||
void ChatTabWidget::removeDialog(ChatDialog *dialog)
|
||||
{
|
||||
QObject::disconnect(dialog, SIGNAL(infoChanged(PopupChatDialog*)), this, SLOT(tabInfoChanged(PopupChatDialog*)));
|
||||
QObject::disconnect(dialog, SIGNAL(infoChanged(ChatDialog*)), this, SLOT(tabInfoChanged(ChatDialog*)));
|
||||
|
||||
int tab = indexOf(dialog);
|
||||
if (tab >= 0) {
|
||||
dialog->removeFromParent(this);
|
||||
removeTab(tab);
|
||||
}
|
||||
}
|
||||
|
||||
void ChatTabWidget::tabClose(int tab)
|
||||
{
|
||||
PopupChatDialog *dialog = dynamic_cast<PopupChatDialog*>(widget(tab));
|
||||
ChatDialog *dialog = dynamic_cast<ChatDialog*>(widget(tab));
|
||||
|
||||
if (dialog) {
|
||||
if (dialog->canClose()) {
|
||||
@ -54,15 +78,14 @@ void ChatTabWidget::tabClose(int tab)
|
||||
|
||||
void ChatTabWidget::tabChanged(int tab)
|
||||
{
|
||||
PopupChatDialog *dialog = dynamic_cast<PopupChatDialog*>(widget(tab));
|
||||
ChatDialog *dialog = dynamic_cast<ChatDialog*>(widget(tab));
|
||||
|
||||
if (dialog) {
|
||||
dialog->activate();
|
||||
emit tabChanged(dialog);
|
||||
}
|
||||
}
|
||||
|
||||
void ChatTabWidget::tabInfoChanged(PopupChatDialog *dialog)
|
||||
void ChatTabWidget::tabInfoChanged(ChatDialog *dialog)
|
||||
{
|
||||
int tab = indexOf(dialog);
|
||||
if (tab >= 0) {
|
||||
@ -85,15 +108,15 @@ void ChatTabWidget::getInfo(bool &isTyping, bool &hasNewMessage, QIcon *icon)
|
||||
isTyping = false;
|
||||
hasNewMessage = false;
|
||||
|
||||
PopupChatDialog *pcd;
|
||||
ChatDialog *cd;
|
||||
int tabCount = count();
|
||||
for (int i = 0; i < tabCount; i++) {
|
||||
pcd = dynamic_cast<PopupChatDialog*>(widget(i));
|
||||
if (pcd) {
|
||||
if (pcd->isTyping()) {
|
||||
cd = dynamic_cast<ChatDialog*>(widget(i));
|
||||
if (cd) {
|
||||
if (cd->isTyping()) {
|
||||
isTyping = true;
|
||||
}
|
||||
if (pcd->hasNewMessages()) {
|
||||
if (cd->hasNewMessages()) {
|
||||
hasNewMessage = true;
|
||||
}
|
||||
}
|
||||
@ -105,9 +128,9 @@ void ChatTabWidget::getInfo(bool &isTyping, bool &hasNewMessage, QIcon *icon)
|
||||
} else if (hasNewMessage) {
|
||||
*icon = QIcon(IMAGE_CHAT);
|
||||
} else {
|
||||
pcd = dynamic_cast<PopupChatDialog*>(currentWidget());
|
||||
if (pcd && pcd->hasPeerStatus()) {
|
||||
*icon = QIcon(StatusDefs::imageIM(pcd->getPeerStatus()));
|
||||
cd = dynamic_cast<ChatDialog*>(currentWidget());
|
||||
if (cd && cd->hasPeerStatus()) {
|
||||
*icon = QIcon(StatusDefs::imageIM(cd->getPeerStatus()));
|
||||
} else {
|
||||
*icon = QIcon();
|
||||
}
|
||||
|
@ -1,3 +1,25 @@
|
||||
/****************************************************************
|
||||
*
|
||||
* 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 CHATTABWIDGET_H
|
||||
#define CHATTABWIDGET_H
|
||||
|
||||
@ -7,7 +29,7 @@ namespace Ui {
|
||||
class ChatTabWidget;
|
||||
}
|
||||
|
||||
class PopupChatDialog;
|
||||
class ChatDialog;
|
||||
|
||||
class ChatTabWidget : public QTabWidget
|
||||
{
|
||||
@ -17,19 +39,19 @@ public:
|
||||
explicit ChatTabWidget(QWidget *parent = 0);
|
||||
~ChatTabWidget();
|
||||
|
||||
void addDialog(PopupChatDialog *dialog);
|
||||
void removeDialog(PopupChatDialog *dialog);
|
||||
void addDialog(ChatDialog *dialog);
|
||||
void removeDialog(ChatDialog *dialog);
|
||||
|
||||
void getInfo(bool &isTyping, bool &hasNewMessage, QIcon *icon);
|
||||
|
||||
signals:
|
||||
void tabChanged(PopupChatDialog *dialog);
|
||||
void tabChanged(ChatDialog *dialog);
|
||||
void infoChanged();
|
||||
|
||||
private slots:
|
||||
void tabClose(int tab);
|
||||
void tabChanged(int tab);
|
||||
void tabInfoChanged(PopupChatDialog *dialog);
|
||||
void tabClose(int tab);
|
||||
void tabChanged(int tab);
|
||||
void tabInfoChanged(ChatDialog *dialog);
|
||||
|
||||
private:
|
||||
Ui::ChatTabWidget *ui;
|
||||
|
689
retroshare-gui/src/gui/chat/ChatWidget.cpp
Normal file
689
retroshare-gui/src/gui/chat/ChatWidget.cpp
Normal file
@ -0,0 +1,689 @@
|
||||
/****************************************************************
|
||||
*
|
||||
* 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.
|
||||
****************************************************************/
|
||||
|
||||
#include <QApplication>
|
||||
#include <QMenu>
|
||||
#include <QKeyEvent>
|
||||
#include <QScrollBar>
|
||||
#include <QColorDialog>
|
||||
#include <QFontDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QSound>
|
||||
|
||||
#include "ChatWidget.h"
|
||||
#include "ui_ChatWidget.h"
|
||||
#include "gui/notifyqt.h"
|
||||
#include "gui/RetroShareLink.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include "gui/settings/RsharePeerSettings.h"
|
||||
#include "gui/im_history/ImHistoryBrowser.h"
|
||||
#include "HandleRichText.h"
|
||||
#include "gui/common/StatusDefs.h"
|
||||
#include "gui/common/FilesDefs.h"
|
||||
#include "gui/common/Emoticons.h"
|
||||
#include "util/misc.h"
|
||||
|
||||
#include <retroshare/rsstatus.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
#include <retroshare/rshistory.h>
|
||||
|
||||
#include <time.h>
|
||||
|
||||
/*****
|
||||
* #define CHAT_DEBUG 1
|
||||
*****/
|
||||
|
||||
// play sound when recv a message
|
||||
void playsound()
|
||||
{
|
||||
Settings->beginGroup("Sound");
|
||||
Settings->beginGroup("SoundFilePath");
|
||||
QString OnlineSound = Settings->value("NewChatMessage","").toString();
|
||||
Settings->endGroup();
|
||||
Settings->beginGroup("Enable");
|
||||
bool flag = Settings->value("NewChatMessage",false).toBool();
|
||||
Settings->endGroup();
|
||||
Settings->endGroup();
|
||||
|
||||
if (!OnlineSound.isEmpty() && flag) {
|
||||
if (QSound::isAvailable()) {
|
||||
QSound::play(OnlineSound);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ChatWidget::ChatWidget(QWidget *parent) :
|
||||
QWidget(parent), ui(new Ui::ChatWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
newMessages = false;
|
||||
typing = false;
|
||||
peerStatus = 0;
|
||||
isChatLobby = false;
|
||||
|
||||
lastStatusSendTime = 0 ;
|
||||
chatStyle.setStyleFromSettings(ChatStyle::TYPE_PRIVATE);
|
||||
|
||||
connect(ui->sendButton, SIGNAL(clicked()), this, SLOT(sendChat()));
|
||||
connect(ui->addFileButton, SIGNAL(clicked()), this , SLOT(addExtraFile()));
|
||||
|
||||
connect(ui->textboldButton, SIGNAL(clicked()), this, SLOT(setFont()));
|
||||
connect(ui->textunderlineButton, SIGNAL(clicked()), this, SLOT(setFont()));
|
||||
connect(ui->textitalicButton, SIGNAL(clicked()), this, SLOT(setFont()));
|
||||
connect(ui->attachPictureButton, SIGNAL(clicked()), this, SLOT(addExtraPicture()));
|
||||
connect(ui->fontButton, SIGNAL(clicked()), this, SLOT(getFont()));
|
||||
connect(ui->colorButton, SIGNAL(clicked()), this, SLOT(setColor()));
|
||||
connect(ui->emoteiconButton, SIGNAL(clicked()), this, SLOT(smileyWidget()));
|
||||
connect(ui->actionSaveChatHistory, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
|
||||
connect(ui->actionClearChatHistory, SIGNAL(triggered()), this, SLOT(clearChatHistory()));
|
||||
connect(ui->actionDeleteChatHistory, SIGNAL(triggered()), this, SLOT(deleteChatHistory()));
|
||||
connect(ui->actionMessageHistory, SIGNAL(triggered()), this, SLOT(messageHistory()));
|
||||
|
||||
connect(ui->hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
|
||||
|
||||
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(const QString&, int)), this, SLOT(updateStatus(const QString&, int)));
|
||||
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewCustomStateString(const QString&, const QString&)), this, SLOT(updatePeersCustomStateString(const QString&, const QString&)));
|
||||
|
||||
connect(ui->chattextEdit, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenu(QPoint)));
|
||||
|
||||
ui->infoframe->setVisible(false);
|
||||
ui->statusmessagelabel->hide();
|
||||
|
||||
ui->textboldButton->setIcon(QIcon(QString(":/images/edit-bold.png")));
|
||||
ui->textunderlineButton->setIcon(QIcon(QString(":/images/edit-underline.png")));
|
||||
ui->textitalicButton->setIcon(QIcon(QString(":/images/edit-italic.png")));
|
||||
ui->fontButton->setIcon(QIcon(QString(":/images/fonts.png")));
|
||||
ui->emoteiconButton->setIcon(QIcon(QString(":/images/emoticons/kopete/kopete020.png")));
|
||||
|
||||
ui->textboldButton->setCheckable(true);
|
||||
ui->textunderlineButton->setCheckable(true);
|
||||
ui->textitalicButton->setCheckable(true);
|
||||
|
||||
setAcceptDrops(true);
|
||||
ui->chattextEdit->setAcceptDrops(false);
|
||||
ui->hashBox->setDropWidget(this);
|
||||
ui->hashBox->setAutoHide(true);
|
||||
|
||||
QMenu *toolmenu = new QMenu();
|
||||
toolmenu->addAction(ui->actionClearChatHistory);
|
||||
toolmenu->addAction(ui->actionDeleteChatHistory);
|
||||
toolmenu->addAction(ui->actionSaveChatHistory);
|
||||
toolmenu->addAction(ui->actionMessageHistory);
|
||||
ui->pushtoolsButton->setMenu(toolmenu);
|
||||
|
||||
ui->chattextEdit->installEventFilter(this);
|
||||
|
||||
#ifdef RS_RELEASE_VERSION
|
||||
ui->attachPictureButton->setVisible(false);
|
||||
#endif
|
||||
|
||||
resetStatusBar();
|
||||
}
|
||||
|
||||
ChatWidget::~ChatWidget()
|
||||
{
|
||||
processSettings(false);
|
||||
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ChatWidget::init(const std::string &peerId, const QString &peerName)
|
||||
{
|
||||
this->peerId = peerId;
|
||||
this->peerName = peerName;
|
||||
|
||||
ui->friendnamelabel->setText(peerName);
|
||||
|
||||
ChatLobbyId lid;
|
||||
if (rsMsgs->isLobbyId(peerId, lid)) {
|
||||
isChatLobby = true;
|
||||
}
|
||||
|
||||
currentColor.setNamedColor(PeerSettings->getPrivateChatColor(peerId));
|
||||
currentFont.fromString(PeerSettings->getPrivateChatFont(peerId));
|
||||
|
||||
colorChanged(currentColor);
|
||||
fontChanged(currentFont);
|
||||
|
||||
// load style
|
||||
PeerSettings->getStyle(peerId, "ChatWidget", style);
|
||||
|
||||
if (!isChatLobby) {
|
||||
// initialize first status
|
||||
StatusInfo peerStatusInfo;
|
||||
// No check of return value. Non existing status info is handled as offline.
|
||||
rsStatus->getStatus(peerId, peerStatusInfo);
|
||||
updateStatus(QString::fromStdString(peerId), peerStatusInfo.status);
|
||||
|
||||
// initialize first custom state string
|
||||
QString customStateString = QString::fromUtf8(rsMsgs->getCustomStateString(peerId).c_str());
|
||||
updatePeersCustomStateString(QString::fromStdString(peerId), customStateString);
|
||||
} else {
|
||||
// currently not possible
|
||||
ui->actionDeleteChatHistory->setVisible(false);
|
||||
ui->actionMessageHistory->setVisible(false);
|
||||
}
|
||||
|
||||
if (rsHistory->getEnable(false)) {
|
||||
// get chat messages from history
|
||||
std::list<HistoryMsg> historyMsgs;
|
||||
int messageCount = Settings->getPrivateChatHistoryCount();
|
||||
if (messageCount > 0) {
|
||||
rsHistory->getMessages(peerId, historyMsgs, messageCount);
|
||||
|
||||
std::list<HistoryMsg>::iterator historyIt;
|
||||
for (historyIt = historyMsgs.begin(); historyIt != historyMsgs.end(); historyIt++) {
|
||||
addChatMsg(historyIt->incoming, QString::fromUtf8(historyIt->peerName.c_str()), QDateTime::fromTime_t(historyIt->sendTime), QDateTime::fromTime_t(historyIt->recvTime), QString::fromUtf8(historyIt->message.c_str()), TYPE_HISTORY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
processSettings(true);
|
||||
}
|
||||
|
||||
void ChatWidget::processSettings(bool load)
|
||||
{
|
||||
Settings->beginGroup(QString("ChatWidget"));
|
||||
|
||||
if (load) {
|
||||
// load settings
|
||||
|
||||
// state of splitter
|
||||
ui->chatsplitter->restoreState(Settings->value("ChatSplitter").toByteArray());
|
||||
} else {
|
||||
// save settings
|
||||
|
||||
// state of splitter
|
||||
Settings->setValue("ChatSplitter", ui->chatsplitter->saveState());
|
||||
}
|
||||
|
||||
Settings->endGroup();
|
||||
}
|
||||
|
||||
bool ChatWidget::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
if (obj == ui->chattextEdit) {
|
||||
if (event->type() == QEvent::KeyPress) {
|
||||
updateStatusTyping();
|
||||
|
||||
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
|
||||
if (keyEvent && (keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return)) {
|
||||
// Enter pressed
|
||||
if (Settings->getChatSendMessageWithCtrlReturn()) {
|
||||
if (keyEvent->modifiers() & Qt::ControlModifier) {
|
||||
// send message with Ctrl+Enter
|
||||
sendChat();
|
||||
return true; // eat event
|
||||
}
|
||||
} else {
|
||||
if (keyEvent->modifiers() & Qt::ControlModifier) {
|
||||
// insert return
|
||||
ui->chattextEdit->textCursor().insertText("\n");
|
||||
} else {
|
||||
// send message with Enter
|
||||
sendChat();
|
||||
}
|
||||
return true; // eat event
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (event->type() == QEvent::WindowActivate) {
|
||||
if (isVisible() && (window() == NULL || window()->isActiveWindow())) {
|
||||
newMessages = false;
|
||||
emit infoChanged(this);
|
||||
focusDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
// pass the event on to the parent class
|
||||
return QWidget::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
void ChatWidget::addToolsAction(QAction *action)
|
||||
{
|
||||
ui->pushtoolsButton->menu()->addAction(action);
|
||||
}
|
||||
|
||||
void ChatWidget::showEvent(QShowEvent */*event*/)
|
||||
{
|
||||
newMessages = false;
|
||||
emit infoChanged(this);
|
||||
focusDialog();
|
||||
}
|
||||
|
||||
void ChatWidget::resizeEvent(QResizeEvent */*event*/)
|
||||
{
|
||||
// Workaround: now the scroll position is correct calculated
|
||||
QScrollBar *scrollbar = ui->textBrowser->verticalScrollBar();
|
||||
scrollbar->setValue(scrollbar->maximum());
|
||||
}
|
||||
|
||||
void ChatWidget::addToParent(QWidget *newParent)
|
||||
{
|
||||
newParent->window()->installEventFilter(this);
|
||||
}
|
||||
|
||||
void ChatWidget::removeFromParent(QWidget *oldParent)
|
||||
{
|
||||
oldParent->window()->removeEventFilter(this);
|
||||
}
|
||||
|
||||
void ChatWidget::focusDialog()
|
||||
{
|
||||
ui->chattextEdit->setFocus();
|
||||
}
|
||||
|
||||
void ChatWidget::addChatMsg(bool incoming, const QString &name, const QDateTime &sendTime, const QDateTime &recvTime, const QString &message, enumChatType chatType)
|
||||
{
|
||||
#ifdef CHAT_DEBUG
|
||||
std::cout << "ChatWidget::addChatMsg message : " << message.toStdString() << std::endl;
|
||||
#endif
|
||||
|
||||
unsigned int formatFlag = CHAT_FORMATMSG_EMBED_LINKS;
|
||||
|
||||
// embed smileys ?
|
||||
if (Settings->valueFromGroup(QString("Chat"), QString::fromUtf8("Emoteicons_PrivatChat"), true).toBool()) {
|
||||
formatFlag |= CHAT_FORMATMSG_EMBED_SMILEYS;
|
||||
}
|
||||
|
||||
ChatStyle::enumFormatMessage type;
|
||||
if (chatType == TYPE_OFFLINE) {
|
||||
type = ChatStyle::FORMATMSG_OOUTGOING;
|
||||
} else if (chatType == TYPE_HISTORY) {
|
||||
type = incoming ? ChatStyle::FORMATMSG_HINCOMING : ChatStyle::FORMATMSG_HOUTGOING;
|
||||
} else {
|
||||
type = incoming ? ChatStyle::FORMATMSG_INCOMING : ChatStyle::FORMATMSG_OUTGOING;
|
||||
}
|
||||
|
||||
QString formatMsg = chatStyle.formatMessage(type, name, incoming ? sendTime : recvTime, message, formatFlag);
|
||||
|
||||
ui->textBrowser->append(formatMsg);
|
||||
|
||||
/* Scroll to the end */
|
||||
QScrollBar *scrollbar = ui->textBrowser->verticalScrollBar();
|
||||
scrollbar->setValue(scrollbar->maximum());
|
||||
|
||||
resetStatusBar();
|
||||
|
||||
if (incoming && chatType == TYPE_NORMAL) {
|
||||
playsound();
|
||||
|
||||
emit newMessage(this);
|
||||
|
||||
if (!isVisible() || (window() && (!window()->isActiveWindow() || window()->isMinimized()))) {
|
||||
newMessages = true;
|
||||
}
|
||||
|
||||
emit infoChanged(this);
|
||||
}
|
||||
}
|
||||
|
||||
void ChatWidget::pasteLink()
|
||||
{
|
||||
std::cerr << "In paste link" << std::endl;
|
||||
ui->chattextEdit->insertHtml(RSLinkClipboard::toHtml());
|
||||
}
|
||||
|
||||
void ChatWidget::contextMenu(QPoint /*point*/)
|
||||
{
|
||||
std::cerr << "In context menu" << std::endl;
|
||||
|
||||
QMenu *contextMnu = ui->chattextEdit->createStandardContextMenu();
|
||||
|
||||
contextMnu->addSeparator();
|
||||
QAction *action = contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink()));
|
||||
action->setDisabled(RSLinkClipboard::empty());
|
||||
|
||||
contextMnu->exec(QCursor::pos());
|
||||
delete(contextMnu);
|
||||
}
|
||||
|
||||
void ChatWidget::resetStatusBar()
|
||||
{
|
||||
ui->statusLabel->clear();
|
||||
ui->typingpixmapLabel->clear();
|
||||
|
||||
typing = false;
|
||||
|
||||
emit infoChanged(this);
|
||||
}
|
||||
|
||||
void ChatWidget::updateStatusTyping()
|
||||
{
|
||||
if (time(NULL) - lastStatusSendTime > 5) // limit 'peer is typing' packets to at most every 10 sec
|
||||
{
|
||||
#ifdef ONLY_FOR_LINGUIST
|
||||
tr("is typing...");
|
||||
#endif
|
||||
|
||||
rsMsgs->sendStatusString(peerId, "is typing...");
|
||||
lastStatusSendTime = time(NULL) ;
|
||||
}
|
||||
}
|
||||
|
||||
void ChatWidget::sendChat()
|
||||
{
|
||||
QTextEdit *chatWidget = ui->chattextEdit;
|
||||
|
||||
if (chatWidget->toPlainText().isEmpty()) {
|
||||
// nothing to send
|
||||
return;
|
||||
}
|
||||
|
||||
QString text;
|
||||
RsHtml::optimizeHtml(chatWidget, text);
|
||||
std::wstring msg = text.toStdWString();
|
||||
|
||||
if (msg.empty()) {
|
||||
// nothing to send
|
||||
return;
|
||||
}
|
||||
|
||||
std::string ownId = rsPeers->getOwnId();
|
||||
|
||||
#ifdef CHAT_DEBUG
|
||||
std::cout << "ChatWidget:sendChat " << std::endl;
|
||||
#endif
|
||||
|
||||
if (rsMsgs->sendPrivateChat(peerId, msg)) {
|
||||
QDateTime currentTime = QDateTime::currentDateTime();
|
||||
addChatMsg(false, QString::fromUtf8(rsPeers->getPeerName(ownId).c_str()), currentTime, currentTime, QString::fromStdWString(msg), TYPE_NORMAL);
|
||||
}
|
||||
|
||||
chatWidget->clear();
|
||||
// workaround for Qt bug - http://bugreports.qt.nokia.com/browse/QTBUG-2533
|
||||
// QTextEdit::clear() does not reset the CharFormat if document contains hyperlinks that have been accessed.
|
||||
chatWidget->setCurrentCharFormat(QTextCharFormat ());
|
||||
|
||||
setFont();
|
||||
}
|
||||
|
||||
void ChatWidget::on_closeInfoFrameButton_clicked()
|
||||
{
|
||||
ui->infoframe->setVisible(false);
|
||||
}
|
||||
|
||||
void ChatWidget::setColor()
|
||||
{
|
||||
bool ok;
|
||||
QRgb color = QColorDialog::getRgba(ui->chattextEdit->textColor().rgba(), &ok, window());
|
||||
if (ok) {
|
||||
currentColor = QColor(color);
|
||||
PeerSettings->setPrivateChatColor(peerId, currentColor.name());
|
||||
colorChanged(currentColor);
|
||||
}
|
||||
setFont();
|
||||
}
|
||||
|
||||
void ChatWidget::colorChanged(const QColor &c)
|
||||
{
|
||||
QPixmap pix(16, 16);
|
||||
pix.fill(c);
|
||||
ui->colorButton->setIcon(pix);
|
||||
}
|
||||
|
||||
void ChatWidget::getFont()
|
||||
{
|
||||
bool ok;
|
||||
QFont font = QFontDialog::getFont(&ok, currentFont, this);
|
||||
if (ok) {
|
||||
fontChanged(font);
|
||||
}
|
||||
}
|
||||
|
||||
void ChatWidget::fontChanged(const QFont &font)
|
||||
{
|
||||
currentFont = font;
|
||||
|
||||
ui->textboldButton->setChecked(currentFont.bold());
|
||||
ui->textunderlineButton->setChecked(currentFont.underline());
|
||||
ui->textitalicButton->setChecked(currentFont.italic());
|
||||
|
||||
setFont();
|
||||
}
|
||||
|
||||
void ChatWidget::setFont()
|
||||
{
|
||||
currentFont.setBold(ui->textboldButton->isChecked());
|
||||
currentFont.setUnderline(ui->textunderlineButton->isChecked());
|
||||
currentFont.setItalic(ui->textitalicButton->isChecked());
|
||||
|
||||
ui->chattextEdit->setFont(currentFont);
|
||||
ui->chattextEdit->setTextColor(currentColor);
|
||||
|
||||
ui->chattextEdit->setFocus();
|
||||
|
||||
PeerSettings->setPrivateChatFont(peerId, currentFont.toString());
|
||||
}
|
||||
|
||||
void ChatWidget::smileyWidget()
|
||||
{
|
||||
Emoticons::showSmileyWidget(this, ui->emoteiconButton, SLOT(addSmiley()), true);
|
||||
}
|
||||
|
||||
void ChatWidget::addSmiley()
|
||||
{
|
||||
ui->chattextEdit->textCursor().insertText(qobject_cast<QPushButton*>(sender())->toolTip().split("|").first());
|
||||
}
|
||||
|
||||
void ChatWidget::clearChatHistory()
|
||||
{
|
||||
ui->textBrowser->clear();
|
||||
}
|
||||
|
||||
void ChatWidget::deleteChatHistory()
|
||||
{
|
||||
if ((QMessageBox::question(this, "RetroShare", tr("Do you really want to physically delete the history?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes)) == QMessageBox::Yes) {
|
||||
clearChatHistory();
|
||||
rsHistory->clear(peerId);
|
||||
}
|
||||
}
|
||||
|
||||
void ChatWidget::messageHistory()
|
||||
{
|
||||
ImHistoryBrowser imBrowser(peerId, ui->chattextEdit, window());
|
||||
imBrowser.exec();
|
||||
}
|
||||
|
||||
void ChatWidget::addExtraFile()
|
||||
{
|
||||
QStringList files;
|
||||
if (misc::getOpenFileNames(this, RshareSettings::LASTDIR_EXTRAFILE, tr("Add Extra File"), "", files)) {
|
||||
ui->hashBox->addAttachments(files/*, 0*/);
|
||||
}
|
||||
}
|
||||
|
||||
void ChatWidget::addExtraPicture()
|
||||
{
|
||||
// select a picture file
|
||||
QString file;
|
||||
if (misc::getOpenFileName(window(), RshareSettings::LASTDIR_IMAGES, tr("Load Picture File"), "Pictures (*.png *.xpm *.jpg)", file)) {
|
||||
ui->hashBox->addAttachments(QStringList(file), HashedFile::Picture);
|
||||
}
|
||||
}
|
||||
|
||||
void ChatWidget::fileHashingFinished(QList<HashedFile> hashedFiles)
|
||||
{
|
||||
std::cerr << "ChatWidget::fileHashingFinished() started." << std::endl;
|
||||
|
||||
QString message;
|
||||
|
||||
QList<HashedFile>::iterator it;
|
||||
for (it = hashedFiles.begin(); it != hashedFiles.end(); ++it) {
|
||||
HashedFile& hashedFile = *it;
|
||||
QString ext = QFileInfo(hashedFile.filename).suffix();
|
||||
|
||||
RetroShareLink link;
|
||||
link.createFile(hashedFile.filename, hashedFile.size, QString::fromStdString(hashedFile.hash));
|
||||
|
||||
if (hashedFile.flag & HashedFile::Picture) {
|
||||
message += QString("<img src=\"file:///%1\" width=\"100\" height=\"100\">").arg(hashedFile.filepath);
|
||||
message+="<br>";
|
||||
} else {
|
||||
QString image = FilesDefs::getImageFromFilename(hashedFile.filename, false);
|
||||
if (!image.isEmpty()) {
|
||||
message += QString("<img src=\"%1\">").arg(image);
|
||||
}
|
||||
}
|
||||
message += link.toHtmlSize();
|
||||
if (it != hashedFiles.end()) {
|
||||
message += "<BR>";
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CHAT_DEBUG
|
||||
std::cerr << "ChatWidget::fileHashingFinished message : " << message.toStdString() << std::endl;
|
||||
#endif
|
||||
|
||||
/* convert to real html document */
|
||||
QTextBrowser textBrowser;
|
||||
textBrowser.setHtml(message);
|
||||
std::wstring msg = textBrowser.toHtml().toStdWString();
|
||||
|
||||
if (rsMsgs->sendPrivateChat(peerId, msg)) {
|
||||
std::string ownId = rsPeers->getOwnId();
|
||||
QDateTime currentTime = QDateTime::currentDateTime();
|
||||
addChatMsg(false, QString::fromUtf8(rsPeers->getPeerName(ownId).c_str()), currentTime, currentTime, QString::fromStdWString(msg), TYPE_NORMAL);
|
||||
}
|
||||
}
|
||||
|
||||
bool ChatWidget::fileSave()
|
||||
{
|
||||
if (fileName.isEmpty())
|
||||
return fileSaveAs();
|
||||
|
||||
QFile file(fileName);
|
||||
if (!file.open(QFile::WriteOnly))
|
||||
return false;
|
||||
QTextStream ts(&file);
|
||||
ts.setCodec(QTextCodec::codecForName("UTF-8"));
|
||||
ts << ui->textBrowser->document()->toPlainText();
|
||||
ui->textBrowser->document()->setModified(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatWidget::fileSaveAs()
|
||||
{
|
||||
QString fn;
|
||||
if (misc::getSaveFileName(window(), RshareSettings::LASTDIR_HISTORY, tr("Save as..."), tr("Text File (*.txt );;All Files (*)"), fn)) {
|
||||
setCurrentFileName(fn);
|
||||
return fileSave();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ChatWidget::setCurrentFileName(const QString &fileName)
|
||||
{
|
||||
this->fileName = fileName;
|
||||
ui->textBrowser->document()->setModified(false);
|
||||
|
||||
setWindowModified(false);
|
||||
}
|
||||
|
||||
void ChatWidget::updateStatus(const QString &peer_id, int status)
|
||||
{
|
||||
/* set font size for status */
|
||||
if (peer_id.toStdString() == peerId) {
|
||||
// the peers status has changed
|
||||
|
||||
switch (status) {
|
||||
case RS_STATUS_OFFLINE:
|
||||
ui->infoframe->setVisible(true);
|
||||
ui->infolabel->setText(peerName + " " + tr("apears to be Offline.") +"\n" + tr("Messages you send will be delivered after Friend is again Online"));
|
||||
break;
|
||||
|
||||
case RS_STATUS_INACTIVE:
|
||||
ui->infoframe->setVisible(true);
|
||||
ui->infolabel->setText(peerName + " " + tr("is Idle and may not reply"));
|
||||
break;
|
||||
|
||||
case RS_STATUS_ONLINE:
|
||||
ui->infoframe->setVisible(false);
|
||||
break;
|
||||
|
||||
case RS_STATUS_AWAY:
|
||||
ui->infolabel->setText(peerName + " " + tr("is Away and may not reply"));
|
||||
ui->infoframe->setVisible(true);
|
||||
break;
|
||||
|
||||
case RS_STATUS_BUSY:
|
||||
ui->infolabel->setText(peerName + " " + tr("is Busy and may not reply"));
|
||||
ui->infoframe->setVisible(true);
|
||||
break;
|
||||
}
|
||||
|
||||
QString statusString("<span style=\"font-size:11pt; font-weight:500;""\">%1</span>");
|
||||
ui->friendnamelabel->setText(peerName + " (" + statusString.arg(StatusDefs::name(status)) + ")") ;
|
||||
|
||||
peerStatus = status;
|
||||
|
||||
emit infoChanged(this);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// ignore status change
|
||||
}
|
||||
|
||||
void ChatWidget::updatePeersCustomStateString(const QString& peer_id, const QString& status_string)
|
||||
{
|
||||
std::string stdPeerId = peer_id.toStdString();
|
||||
QString status_text;
|
||||
|
||||
if (stdPeerId == peerId) {
|
||||
// the peers status string has changed
|
||||
if (status_string.isEmpty()) {
|
||||
ui->statusmessagelabel->hide();
|
||||
} else {
|
||||
ui->statusmessagelabel->show();
|
||||
status_text = RsHtml::formatText(status_string, RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS);
|
||||
ui->statusmessagelabel->setText(status_text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ChatWidget::updateStatusString(const QString &statusMask, const QString &statusString)
|
||||
{
|
||||
ui->statusLabel->setText(QString(statusMask).arg(tr(statusString.toAscii()))); // displays info for 5 secs.
|
||||
ui->typingpixmapLabel->setPixmap(QPixmap(":images/typing.png") );
|
||||
|
||||
if (statusString == "is typing...") {
|
||||
typing = true;
|
||||
|
||||
emit infoChanged(this);
|
||||
}
|
||||
|
||||
QTimer::singleShot(5000, this, SLOT(resetStatusBar())) ;
|
||||
}
|
||||
|
||||
bool ChatWidget::setStyle()
|
||||
{
|
||||
if (style.showDialog(window())) {
|
||||
PeerSettings->setStyle(peerId, "PopupChatDialog", style);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
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
|
794
retroshare-gui/src/gui/chat/ChatWidget.ui
Normal file
794
retroshare-gui/src/gui/chat/ChatWidget.ui
Normal file
@ -0,0 +1,794 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ChatWidget</class>
|
||||
<widget class="QWidget" name="ChatWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>535</width>
|
||||
<height>428</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item row="0" column="0" rowspan="5">
|
||||
<widget class="QFrame" name="leftsideframe">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>14</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QFrame#frame{border: transparent}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QFrame" name="statusframe">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QFrame#frame_2{border: transparent}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="friendnamelabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Arial</family>
|
||||
<pointsize>13</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
<kerning>true</kerning>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QLabel" name="statusmessagelabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Arial</family>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QFrame" name="infoframe">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QFrame#infoframe{border: 1px solid #DCDC41;
|
||||
border-radius: 6px;
|
||||
background: #FFFFD7;
|
||||
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
|
||||
stop:0 #FFFFD7, stop:1 #FFFFB2);}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="margin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../images.qrc">:/images/info16.png</pixmap>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="infolabel">
|
||||
<property name="text">
|
||||
<string notr="true">TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="closeInfoFrameButton">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolButton
|
||||
{
|
||||
border-image: url(:/images/closenormal.png)
|
||||
}
|
||||
|
||||
QToolButton:hover
|
||||
{
|
||||
border-image: url(:/images/closehover.png)
|
||||
}
|
||||
|
||||
QToolButton:pressed {
|
||||
border-image: url(:/images/closepressed.png)
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QFrame" name="Chatbuttonframe">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>347</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="_3">
|
||||
<property name="margin">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="9">
|
||||
<widget class="QPushButton" name="pushtoolsButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton::menu-indicator {
|
||||
subcontrol-origin: padding;
|
||||
subcontrol-position: bottom right;
|
||||
}
|
||||
|
||||
QPushButton::menu-indicator:pressed, QPushButton::menu-indicator:open {
|
||||
position: relative;
|
||||
top: 1px; left: 1px; /* shift the arrow by 2 px */
|
||||
}
|
||||
|
||||
QPushButton:hover {
|
||||
border: 1px solid #CCCCCC;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/configure.png</normaloff>:/images/configure.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>22</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="7">
|
||||
<widget class="QToolButton" name="attachPictureButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Attach a Picture</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/add_image24.png</normaloff>:/images/add_image24.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="8">
|
||||
<widget class="QToolButton" name="addFileButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Add a File for your Friend</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/add-share24.png</normaloff>:/images/add-share24.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="10">
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>190</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="11">
|
||||
<widget class="QPushButton" name="sendButton">
|
||||
<property name="text">
|
||||
<string>Send</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QToolButton" name="emoteiconButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QToolButton" name="textboldButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Bold</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../../../../../../../Dokumente und Einstellungen/Linux/.designer/backup</normaloff>../../../../../../../Dokumente und Einstellungen/Linux/.designer/backup</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QToolButton" name="textunderlineButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Underline</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../../../../../../../Dokumente und Einstellungen/Linux/.designer/backup</normaloff>../../../../../../../Dokumente und Einstellungen/Linux/.designer/backup</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QToolButton" name="textitalicButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Italic</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../../../../../../../Dokumente und Einstellungen/Linux/.designer/backup</normaloff>../../../../../../../Dokumente und Einstellungen/Linux/.designer/backup</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QToolButton" name="fontButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Font</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../../../../../../../Dokumente und Einstellungen/Linux/.designer/backup</normaloff>../../../../../../../Dokumente und Einstellungen/Linux/.designer/backup</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QToolButton" name="colorButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Text Color</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSplitter" name="chatsplitter">
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="handleWidth">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="childrenCollapsible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="verticalLayoutWidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="textBrowser">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QTextBrowser{border: 1px solid #B8B6B1;
|
||||
border-radius: 6px;
|
||||
background: white;}</string>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p></body></html></string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="openLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget_2">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="statusLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>3</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QTextEdit" name="chattextEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QTextEdit{border: 1px solid #B8B6B1;
|
||||
border-radius: 6px;
|
||||
background: white;}</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="typingpixmapLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">T</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="HashBox" name="hashBox">
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
<action name="actionBold">
|
||||
<property name="text">
|
||||
<string>Bold</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionItalic">
|
||||
<property name="text">
|
||||
<string>Italic</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionUnderline">
|
||||
<property name="text">
|
||||
<string>Underline</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionStrike">
|
||||
<property name="text">
|
||||
<string>Strike</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionClearChatHistory">
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/edit-clear-history.png</normaloff>:/images/edit-clear-history.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clear Chat History</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_Disable_Emoticons">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Disable Emoticons</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSaveChatHistory">
|
||||
<property name="text">
|
||||
<string>Save Chat History</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Save Chat History</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMessageHistory">
|
||||
<property name="text">
|
||||
<string>Browse Message History</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Browse History</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDeleteChatHistory">
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/edit-clear-history.png</normaloff>:/images/edit-clear-history.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete Chat History</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Deletes all stored and displayed chat history</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>HashBox</class>
|
||||
<extends>QScrollArea</extends>
|
||||
<header location="global">gui/common/HashBox.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
@ -28,56 +28,49 @@
|
||||
#include <retroshare/rspeers.h>
|
||||
|
||||
#include "gui/common/PeerDefs.h"
|
||||
#include "gui/chat/PopupChatDialog.h"
|
||||
#include "ChatDialog.h"
|
||||
|
||||
CreateLobbyDialog::CreateLobbyDialog(const std::list<std::string>& peer_list,QWidget *parent, Qt::WFlags flags, std::string grpId, int grpType) :
|
||||
QDialog(parent, flags), mGrpId(grpId), mGrpType(grpType)
|
||||
QDialog(parent, flags), mGrpId(grpId), mGrpType(grpType)
|
||||
{
|
||||
ui = new Ui::CreateLobbyDialog() ;
|
||||
ui->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
|
||||
std::string default_nick ;
|
||||
rsMsgs->getDefaultNickNameForChatLobby(default_nick) ;
|
||||
std::string default_nick ;
|
||||
rsMsgs->getDefaultNickNameForChatLobby(default_nick) ;
|
||||
|
||||
#if QT_VERSION >= 0x040700
|
||||
ui->lobbyName_LE->setPlaceholderText(tr("Put a sensible lobby name here")) ;
|
||||
ui->nickName_LE->setPlaceholderText(tr("Your nickname for this lobby (Change default name in options->chat)")) ;
|
||||
ui->lobbyName_LE->setPlaceholderText(tr("Put a sensible lobby name here")) ;
|
||||
ui->nickName_LE->setPlaceholderText(tr("Your nickname for this lobby (Change default name in options->chat)")) ;
|
||||
#endif
|
||||
ui->nickName_LE->setText(QString::fromStdString(default_nick)) ;
|
||||
ui->nickName_LE->setText(QString::fromStdString(default_nick)) ;
|
||||
|
||||
connect( ui->shareButton, SIGNAL( clicked ( bool ) ), this, SLOT( createLobby( ) ) );
|
||||
connect( ui->cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancel( ) ) );
|
||||
connect( ui->lobbyName_LE, SIGNAL( textChanged ( QString ) ), this, SLOT( checkTextFields( ) ) );
|
||||
connect( ui->nickName_LE, SIGNAL( textChanged ( QString ) ), this, SLOT( checkTextFields( ) ) );
|
||||
connect( ui->shareButton, SIGNAL( clicked ( bool ) ), this, SLOT( createLobby( ) ) );
|
||||
connect( ui->cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancel( ) ) );
|
||||
connect( ui->lobbyName_LE, SIGNAL( textChanged ( QString ) ), this, SLOT( checkTextFields( ) ) );
|
||||
connect( ui->nickName_LE, SIGNAL( textChanged ( QString ) ), this, SLOT( checkTextFields( ) ) );
|
||||
|
||||
connect(ui->keyShareList, SIGNAL(itemChanged( QTreeWidgetItem *, int ) ),
|
||||
this, SLOT(togglePersonItem( QTreeWidgetItem *, int ) ));
|
||||
connect(ui->keyShareList, SIGNAL(itemChanged( QTreeWidgetItem *, int ) ), this, SLOT(togglePersonItem( QTreeWidgetItem *, int ) ));
|
||||
|
||||
setShareList(peer_list);
|
||||
checkTextFields() ;
|
||||
setShareList(peer_list);
|
||||
checkTextFields() ;
|
||||
}
|
||||
|
||||
|
||||
CreateLobbyDialog::~CreateLobbyDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void CreateLobbyDialog::closeEvent (QCloseEvent * event)
|
||||
{
|
||||
QWidget::closeEvent(event);
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void CreateLobbyDialog::changeEvent(QEvent *e)
|
||||
{
|
||||
QDialog::changeEvent(e);
|
||||
switch (e->type()) {
|
||||
case QEvent::LanguageChange:
|
||||
ui->retranslateUi(this);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
QDialog::changeEvent(e);
|
||||
switch (e->type()) {
|
||||
case QEvent::LanguageChange:
|
||||
ui->retranslateUi(this);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CreateLobbyDialog::checkTextFields()
|
||||
@ -87,105 +80,104 @@ void CreateLobbyDialog::checkTextFields()
|
||||
else
|
||||
ui->shareButton->setEnabled(true) ;
|
||||
}
|
||||
|
||||
void CreateLobbyDialog::createLobby()
|
||||
{
|
||||
if(mShareList.empty())
|
||||
{
|
||||
QMessageBox::warning(this, tr("RetroShare"),tr("Please select at least one peer"),
|
||||
QMessageBox::Ok, QMessageBox::Ok);
|
||||
if(mShareList.empty())
|
||||
{
|
||||
QMessageBox::warning(this, "RetroShare", tr("Please select at least one friend"), QMessageBox::Ok, QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
// create chat lobby !!
|
||||
std::string lobby_name = ui->lobbyName_LE->text().toUtf8().constData() ;
|
||||
|
||||
// create chat lobby !!
|
||||
std::string lobby_name = ui->lobbyName_LE->text().toUtf8().constData() ;
|
||||
// add to group
|
||||
|
||||
// add to group
|
||||
int lobby_privacy_type = (ui->security_CB->currentIndex() == 0)?RS_CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC:RS_CHAT_LOBBY_PRIVACY_LEVEL_PRIVATE ;
|
||||
|
||||
int lobby_privacy_type = (ui->security_CB->currentIndex() == 0)?RS_CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC:RS_CHAT_LOBBY_PRIVACY_LEVEL_PRIVATE ;
|
||||
ChatLobbyId id = rsMsgs->createChatLobby(lobby_name, mShareList, lobby_privacy_type);
|
||||
|
||||
ChatLobbyId id = rsMsgs->createChatLobby(lobby_name, mShareList, lobby_privacy_type);
|
||||
std::cerr << "gui: Created chat lobby " << std::hex << id << std::endl ;
|
||||
|
||||
std::cerr << "gui: Created chat lobby " << std::hex << id << std::endl ;
|
||||
// set nick name !
|
||||
|
||||
// set nick name !
|
||||
rsMsgs->setNickNameForChatLobby(id,ui->nickName_LE->text().toStdString()) ;
|
||||
|
||||
rsMsgs->setNickNameForChatLobby(id,ui->nickName_LE->text().toStdString()) ;
|
||||
// open chat window !!
|
||||
std::string vpid ;
|
||||
|
||||
if(rsMsgs->getVirtualPeerId(id,vpid))
|
||||
ChatDialog::chatFriend(vpid) ;
|
||||
|
||||
// open chat window !!
|
||||
std::string vpid ;
|
||||
|
||||
if(rsMsgs->getVirtualPeerId(id,vpid))
|
||||
PopupChatDialog::chatFriend(vpid) ;
|
||||
|
||||
close();
|
||||
close();
|
||||
}
|
||||
|
||||
void CreateLobbyDialog::cancel()
|
||||
{
|
||||
close();
|
||||
close();
|
||||
}
|
||||
|
||||
void CreateLobbyDialog::setShareList(const std::list<std::string>& friend_list)
|
||||
{
|
||||
if (!rsPeers)
|
||||
{
|
||||
/* not ready yet! */
|
||||
return;
|
||||
}
|
||||
if (!rsPeers)
|
||||
{
|
||||
/* not ready yet! */
|
||||
return;
|
||||
}
|
||||
|
||||
std::list<std::string> peers;
|
||||
std::list<std::string>::iterator it;
|
||||
std::list<std::string> peers;
|
||||
std::list<std::string>::iterator it;
|
||||
|
||||
mShareList.clear() ;
|
||||
rsPeers->getFriendList(peers);
|
||||
mShareList.clear() ;
|
||||
rsPeers->getFriendList(peers);
|
||||
|
||||
/* get a link to the table */
|
||||
QTreeWidget *shareWidget = ui->keyShareList;
|
||||
/* get a link to the table */
|
||||
QTreeWidget *shareWidget = ui->keyShareList;
|
||||
|
||||
QList<QTreeWidgetItem *> items;
|
||||
QList<QTreeWidgetItem *> items;
|
||||
|
||||
for(it = peers.begin(); it != peers.end(); it++)
|
||||
{
|
||||
RsPeerDetails detail;
|
||||
if (!rsPeers->getPeerDetails(*it, detail))
|
||||
{
|
||||
continue; /* BAD */
|
||||
}
|
||||
for(it = peers.begin(); it != peers.end(); it++)
|
||||
{
|
||||
RsPeerDetails detail;
|
||||
if (!rsPeers->getPeerDetails(*it, detail))
|
||||
{
|
||||
continue; /* BAD */
|
||||
}
|
||||
|
||||
/* make a widget per friend */
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem((QTreeWidget*)0);
|
||||
/* make a widget per friend */
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem((QTreeWidget*)0);
|
||||
|
||||
item -> setText(0, PeerDefs::nameWithLocation(detail));
|
||||
if (detail.state & RS_PEER_STATE_CONNECTED) {
|
||||
item -> setTextColor(0,(Qt::darkBlue));
|
||||
}
|
||||
item -> setSizeHint(0, QSize( 17,17 ) );
|
||||
item -> setText(1, QString::fromStdString(detail.id));
|
||||
item -> setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
|
||||
item -> setText(0, PeerDefs::nameWithLocation(detail));
|
||||
if (detail.state & RS_PEER_STATE_CONNECTED) {
|
||||
item -> setTextColor(0,(Qt::darkBlue));
|
||||
}
|
||||
item -> setSizeHint(0, QSize( 17,17 ) );
|
||||
item -> setText(1, QString::fromStdString(detail.id));
|
||||
item -> setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
|
||||
|
||||
item -> setCheckState(0, Qt::Unchecked);
|
||||
item -> setCheckState(0, Qt::Unchecked);
|
||||
|
||||
for(std::list<std::string>::const_iterator it2(friend_list.begin());it2!=friend_list.end();++it2)
|
||||
if(*it == *it2)
|
||||
{
|
||||
item -> setCheckState(0, Qt::Checked);
|
||||
mShareList.push_back(*it) ;
|
||||
break ;
|
||||
}
|
||||
for(std::list<std::string>::const_iterator it2(friend_list.begin());it2!=friend_list.end();++it2)
|
||||
if(*it == *it2)
|
||||
{
|
||||
item -> setCheckState(0, Qt::Checked);
|
||||
mShareList.push_back(*it) ;
|
||||
break ;
|
||||
}
|
||||
|
||||
/* add to the list */
|
||||
items.append(item);
|
||||
}
|
||||
/* add to the list */
|
||||
items.append(item);
|
||||
}
|
||||
|
||||
/* remove old items */
|
||||
shareWidget->clear();
|
||||
shareWidget->setColumnCount(1);
|
||||
/* remove old items */
|
||||
shareWidget->clear();
|
||||
shareWidget->setColumnCount(1);
|
||||
|
||||
/* add the items in! */
|
||||
shareWidget->insertTopLevelItems(0, items);
|
||||
/* add the items in! */
|
||||
shareWidget->insertTopLevelItems(0, items);
|
||||
|
||||
shareWidget->update(); /* update display */
|
||||
shareWidget->update(); /* update display */
|
||||
}
|
||||
|
||||
void CreateLobbyDialog::togglePersonItem( QTreeWidgetItem *item, int /*col*/ )
|
||||
@ -206,4 +198,3 @@ void CreateLobbyDialog::togglePersonItem( QTreeWidgetItem *item, int /*col*/ )
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1,41 +1,36 @@
|
||||
#ifndef SHAREKEY_H
|
||||
#define SHAREKEY_H
|
||||
#ifndef CREATELOBBYDIALOG_H
|
||||
#define CREATELOBBYDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#include "ui_CreateLobbyDialog.h"
|
||||
|
||||
class CreateLobbyDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
public:
|
||||
/*
|
||||
*@param chanId The channel id to send request for
|
||||
*/
|
||||
CreateLobbyDialog(const std::list<std::string>& friends_list,QWidget *parent = 0, Qt::WFlags flags = 0, std::string grpId = "", int grpType = 0);
|
||||
~CreateLobbyDialog();
|
||||
/*
|
||||
*@param chanId The channel id to send request for
|
||||
*/
|
||||
CreateLobbyDialog(const std::list<std::string>& friends_list,QWidget *parent = 0, Qt::WFlags flags = 0, std::string grpId = "", int grpType = 0);
|
||||
~CreateLobbyDialog();
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
void closeEvent (QCloseEvent * event);
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
void setShareList(const std::list<std::string>&);
|
||||
|
||||
void setShareList(const std::list<std::string>&);
|
||||
Ui::CreateLobbyDialog *ui;
|
||||
|
||||
Ui::CreateLobbyDialog *ui;
|
||||
|
||||
std::string mGrpId;
|
||||
std::list<std::string> mShareList;
|
||||
int mGrpType;
|
||||
std::string mGrpId;
|
||||
std::list<std::string> mShareList;
|
||||
int mGrpType;
|
||||
|
||||
private slots:
|
||||
|
||||
void createLobby();
|
||||
void checkTextFields();
|
||||
void cancel();
|
||||
void togglePersonItem(QTreeWidgetItem* item, int col);
|
||||
|
||||
|
||||
void createLobby();
|
||||
void checkTextFields();
|
||||
void cancel();
|
||||
void togglePersonItem(QTreeWidgetItem* item, int col);
|
||||
};
|
||||
|
||||
#endif // SHAREKEY_H
|
||||
#endif // CREATELOBBYDIALOG_H
|
||||
|
@ -174,11 +174,7 @@ p, li { white-space: pre-wrap; }
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Select the Friends with which you want to group chat.</span></p></body></html></string>
|
||||
<string>Select the Friends with which you want to group chat.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -211,9 +207,6 @@ p, li { white-space: pre-wrap; }
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>check peers you would like to share private publish key with</string>
|
||||
</property>
|
||||
<property name="floating">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
@ -351,7 +344,6 @@ p, li { white-space: pre-wrap; }
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -24,151 +24,44 @@
|
||||
#define _POPUPCHATDIALOG_H
|
||||
|
||||
#include "ui_PopupChatDialog.h"
|
||||
|
||||
class QAction;
|
||||
class QTextEdit;
|
||||
class QTextCharFormat;
|
||||
class ChatInfo;
|
||||
#include "ChatDialog.h"
|
||||
|
||||
#include <retroshare/rsmsgs.h>
|
||||
#include "ChatStyle.h"
|
||||
#include "gui/style/RSStyle.h"
|
||||
|
||||
class PopupChatDialog : public QWidget
|
||||
class PopupChatDialog : public ChatDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum enumChatType { TYPE_NORMAL, TYPE_HISTORY, TYPE_OFFLINE };
|
||||
|
||||
public:
|
||||
static PopupChatDialog *getExistingInstance(const std::string &id);
|
||||
static PopupChatDialog *getPrivateChat(const std::string &id, uint chatflags);
|
||||
static void cleanupChat();
|
||||
static void chatFriend(const std::string &id);
|
||||
static void closeChat(const std::string &id);
|
||||
static void privateChatChanged(int list, int type);
|
||||
|
||||
void init();
|
||||
|
||||
void updateStatusString(const QString& peer_id, const QString& statusString);
|
||||
std::string getPeerId() { return dialogId; }
|
||||
QString getTitle() { return dialogName; }
|
||||
bool hasNewMessages() { return newMessages; }
|
||||
bool isTyping() { return typing; }
|
||||
int getPeerStatus() { return peerStatus; }
|
||||
void focusDialog();
|
||||
void activate();
|
||||
bool setStyle();
|
||||
const RSStyle &getStyle();
|
||||
virtual void updateStatus(const QString &peer_id, int status);
|
||||
|
||||
// derived in ChatLobbyDialog.
|
||||
//
|
||||
virtual bool hasPeerStatus() { return true; }
|
||||
virtual bool canClose() { return true; }
|
||||
|
||||
signals:
|
||||
void dialogClose(PopupChatDialog *dialog);
|
||||
void infoChanged(PopupChatDialog *dialog);
|
||||
void newMessage(PopupChatDialog *dialog);
|
||||
|
||||
public slots:
|
||||
void updateStatus_slot(const QString &peer_id, int status);
|
||||
|
||||
protected:
|
||||
/** Default constructor */
|
||||
PopupChatDialog(const std::string &id, const QString &name, QWidget *parent = 0, Qt::WFlags flags = 0);
|
||||
/** Default destructor */
|
||||
~PopupChatDialog();
|
||||
|
||||
virtual void resizeEvent(QResizeEvent *event);
|
||||
virtual void showEvent(QShowEvent *event);
|
||||
|
||||
bool eventFilter(QObject *obj, QEvent *ev);
|
||||
|
||||
void insertChatMsgs();
|
||||
void addChatMsg(bool incoming, const QString &name, const QDateTime &sendTime, const QDateTime &recvTime, const QString &message, enumChatType chatType);
|
||||
|
||||
// derived in ChatLobbyDialog.
|
||||
//
|
||||
virtual bool addToParent();
|
||||
virtual bool isChatLobby() { return false; } // TODO: spilt into a good base class
|
||||
virtual void addIncomingChatMsg(const ChatInfo& info);
|
||||
virtual QString makeStatusString(const QString& peer_id, const QString& status_string) const;
|
||||
friend class ChatDialog;
|
||||
|
||||
private slots:
|
||||
void pasteLink() ;
|
||||
void contextMenu(QPoint) ;
|
||||
|
||||
void fileHashingFinished(QList<HashedFile> hashedFiles);
|
||||
|
||||
void smileyWidget();
|
||||
void addSmiley();
|
||||
|
||||
void resetStatusBar() ;
|
||||
void updateStatusTyping() ;
|
||||
|
||||
void on_actionMessageHistory_triggered();
|
||||
void addExtraFile();
|
||||
void addExtraPicture();
|
||||
void showAvatarFrame(bool show);
|
||||
void on_closeInfoFrameButton_clicked();
|
||||
|
||||
void setColor();
|
||||
void getFont();
|
||||
void setFont();
|
||||
|
||||
void sendChat();
|
||||
|
||||
void updatePeersCustomStateString(const QString& peer_id, const QString& status_string) ;
|
||||
|
||||
void on_actionClear_Chat_History_triggered();
|
||||
void on_actionDelete_Chat_History_triggered();
|
||||
|
||||
bool fileSave();
|
||||
bool fileSaveAs();
|
||||
void clearOfflineMessages();
|
||||
|
||||
private:
|
||||
void setCurrentFileName(const QString &fileName);
|
||||
|
||||
void colorChanged(const QColor &c);
|
||||
void fontChanged(const QFont &font);
|
||||
void processSettings(bool bLoad);
|
||||
|
||||
void onPrivateChatChanged(int list, int type);
|
||||
|
||||
QAction *actionTextBold;
|
||||
QAction *actionTextUnderline;
|
||||
QAction *actionTextItalic;
|
||||
|
||||
std::string dialogId;
|
||||
QString dialogName;
|
||||
unsigned int lastChatTime;
|
||||
std::string lastChatName;
|
||||
|
||||
time_t last_status_send_time ;
|
||||
QColor mCurrentColor;
|
||||
QFont mCurrentFont;
|
||||
|
||||
std::list<ChatInfo> savedOfflineChat;
|
||||
QString wholeChat;
|
||||
QString fileName;
|
||||
|
||||
bool newMessages;
|
||||
bool typing;
|
||||
int peerStatus;
|
||||
ChatStyle chatStyle;
|
||||
bool manualDelete;
|
||||
|
||||
RSStyle style;
|
||||
void showAvatarFrame(bool show);
|
||||
void clearOfflineMessages();
|
||||
void chatStatusChanged(const QString &peerId, const QString &statusString, bool isPrivateChat);
|
||||
|
||||
protected:
|
||||
virtual bool sendPrivateChat(const std::wstring& msg) ; // can be derived to send chat to e.g. a chat lobby
|
||||
/** Default constructor */
|
||||
PopupChatDialog(QWidget *parent = 0, Qt::WFlags flags = 0);
|
||||
/** Default destructor */
|
||||
virtual ~PopupChatDialog();
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::PopupChatDialog ui;
|
||||
virtual void init(const std::string &peerId, const QString &peerName);
|
||||
virtual void showDialog(uint chatflags);
|
||||
virtual ChatWidget *getChatWidget();
|
||||
virtual bool hasPeerStatus() { return true; }
|
||||
|
||||
void processSettings(bool load);
|
||||
|
||||
protected:
|
||||
virtual void addIncomingChatMsg(const ChatInfo& info);
|
||||
virtual void onChatChanged(int list, int type);
|
||||
|
||||
private:
|
||||
bool manualDelete;
|
||||
std::list<ChatInfo> savedOfflineChat;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::PopupChatDialog ui;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -40,7 +40,7 @@
|
||||
<property name="verticalSpacing">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item row="0" column="0" rowspan="7">
|
||||
<item row="0" column="0" rowspan="4">
|
||||
<widget class="QFrame" name="leftsideframe">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
@ -111,7 +111,7 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" rowspan="7">
|
||||
<item row="0" column="1" rowspan="4">
|
||||
<widget class="QFrame" name="avatarframe">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@ -189,731 +189,24 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QFrame" name="statusframe">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QFrame#frame_2{border: transparent}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="friendnamelabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Arial</family>
|
||||
<pointsize>13</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
<kerning>true</kerning>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QLabel" name="statusmessagelabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Arial</family>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QFrame" name="infoframe">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QFrame#infoframe{border: 1px solid #DCDC41;
|
||||
border-radius: 6px;
|
||||
background: #FFFFD7;
|
||||
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
|
||||
stop:0 #FFFFD7, stop:1 #FFFFB2);}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="margin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../images.qrc">:/images/info16.png</pixmap>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="infolabel">
|
||||
<property name="text">
|
||||
<string notr="true">TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="closeInfoFrameButton">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolButton
|
||||
{
|
||||
border-image: url(:/images/closenormal.png)
|
||||
}
|
||||
|
||||
QToolButton:hover
|
||||
{
|
||||
border-image: url(:/images/closehover.png)
|
||||
}
|
||||
|
||||
QToolButton:pressed {
|
||||
border-image: url(:/images/closepressed.png)
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QFrame" name="Chatbuttonframe">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>347</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="_3">
|
||||
<property name="margin">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="9">
|
||||
<widget class="QPushButton" name="pushtoolsButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton::menu-indicator {
|
||||
subcontrol-origin: padding;
|
||||
subcontrol-position: bottom right;
|
||||
}
|
||||
|
||||
QPushButton::menu-indicator:pressed, QPushButton::menu-indicator:open {
|
||||
position: relative;
|
||||
top: 1px; left: 1px; /* shift the arrow by 2 px */
|
||||
}
|
||||
|
||||
QPushButton:hover {
|
||||
border: 1px solid #CCCCCC;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/configure.png</normaloff>:/images/configure.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>22</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="7">
|
||||
<widget class="QToolButton" name="attachPictureButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Attach a Picture</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/add_image24.png</normaloff>:/images/add_image24.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="8">
|
||||
<widget class="QToolButton" name="addFileButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Add a File for your Friend</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/add-share24.png</normaloff>:/images/add-share24.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="10">
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>190</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="11">
|
||||
<widget class="QPushButton" name="sendButton">
|
||||
<property name="text">
|
||||
<string>Send</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QToolButton" name="emoteiconButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QToolButton" name="textboldButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Bold</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../../../../../../../Dokumente und Einstellungen/Linux/.designer/backup</normaloff>../../../../../../../Dokumente und Einstellungen/Linux/.designer/backup</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QToolButton" name="textunderlineButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Underline</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../../../../../../../Dokumente und Einstellungen/Linux/.designer/backup</normaloff>../../../../../../../Dokumente und Einstellungen/Linux/.designer/backup</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QToolButton" name="textitalicButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Italic</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../../../../../../../Dokumente und Einstellungen/Linux/.designer/backup</normaloff>../../../../../../../Dokumente und Einstellungen/Linux/.designer/backup</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QToolButton" name="fontButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Font</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../../../../../../../Dokumente und Einstellungen/Linux/.designer/backup</normaloff>../../../../../../../Dokumente und Einstellungen/Linux/.designer/backup</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QToolButton" name="colorButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Text Color</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QSplitter" name="chatsplitter">
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="handleWidth">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="childrenCollapsible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="verticalLayoutWidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="textBrowser">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QTextBrowser{border: 1px solid #B8B6B1;
|
||||
border-radius: 6px;
|
||||
background: white;}</string>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;"></p></body></html></string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="openLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget_2">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="statusLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>3</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QTextEdit" name="chattextEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QTextEdit{border: 1px solid #B8B6B1;
|
||||
border-radius: 6px;
|
||||
background: white;}</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="typingpixmapLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">T</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="HashBox" name="hashBox">
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
<item row="0" column="2" rowspan="4">
|
||||
<widget class="ChatWidget" name="chatWidget" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
<action name="actionBold">
|
||||
<property name="text">
|
||||
<string>Bold</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionItalic">
|
||||
<property name="text">
|
||||
<string>Italic</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionUnderline">
|
||||
<property name="text">
|
||||
<string>Underline</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionStrike">
|
||||
<property name="text">
|
||||
<string>Strike</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionClear_Chat_History">
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/edit-clear-history.png</normaloff>:/images/edit-clear-history.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clear Chat History</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_Disable_Emoticons">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Disable Emoticons</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSave_Chat_History">
|
||||
<property name="text">
|
||||
<string>Save Chat History</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Save Chat History</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionClearOfflineMessages">
|
||||
<property name="text">
|
||||
<string>Clear offline messages</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMessageHistory">
|
||||
<property name="text">
|
||||
<string>Browse Message History</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Browse History</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDelete_Chat_History">
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/edit-clear-history.png</normaloff>:/images/edit-clear-history.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete Chat History</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Deletes all stored and displayed chat history</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
@ -923,14 +216,12 @@ background: white;}</string>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>HashBox</class>
|
||||
<extends>QScrollArea</extends>
|
||||
<header location="global">gui/common/HashBox.h</header>
|
||||
<class>ChatWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">gui/chat/ChatWidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
</resources>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -16,14 +16,14 @@
|
||||
*
|
||||
* 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,
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
#include <QPixmap>
|
||||
|
||||
#include "PopupChatWindow.h"
|
||||
#include "PopupChatDialog.h"
|
||||
#include "ChatDialog.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include "gui/settings/RsharePeerSettings.h"
|
||||
#include "gui/common/StatusDefs.h"
|
||||
@ -41,334 +41,331 @@ static PopupChatWindow *instance = NULL;
|
||||
|
||||
/*static*/ PopupChatWindow *PopupChatWindow::getWindow(bool needSingleWindow)
|
||||
{
|
||||
if (needSingleWindow == false && (Settings->getChatFlags() & RS_CHAT_TABBED_WINDOW)) {
|
||||
if (instance == NULL) {
|
||||
instance = new PopupChatWindow(true);
|
||||
}
|
||||
if (needSingleWindow == false && (Settings->getChatFlags() & RS_CHAT_TABBED_WINDOW)) {
|
||||
if (instance == NULL) {
|
||||
instance = new PopupChatWindow(true);
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
return new PopupChatWindow(false);
|
||||
return new PopupChatWindow(false);
|
||||
}
|
||||
|
||||
/*static*/ void PopupChatWindow::cleanup()
|
||||
{
|
||||
if (instance) {
|
||||
delete(instance);
|
||||
instance = NULL;
|
||||
}
|
||||
if (instance) {
|
||||
delete(instance);
|
||||
instance = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/** Default constructor */
|
||||
PopupChatWindow::PopupChatWindow(bool tabbed, QWidget *parent, Qt::WFlags flags) : QMainWindow(parent, flags)
|
||||
{
|
||||
/* Invoke Qt Designer generated QObject setup routine */
|
||||
ui.setupUi(this);
|
||||
/* Invoke Qt Designer generated QObject setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
tabbedWindow = tabbed;
|
||||
firstShow = true;
|
||||
chatDialog = NULL;
|
||||
tabbedWindow = tabbed;
|
||||
firstShow = true;
|
||||
chatDialog = NULL;
|
||||
|
||||
ui.tabWidget->setVisible(tabbedWindow);
|
||||
ui.tabWidget->setVisible(tabbedWindow);
|
||||
|
||||
if (Settings->getChatFlags() & RS_CHAT_TABBED_WINDOW) {
|
||||
ui.actionDockTab->setVisible(tabbedWindow == false);
|
||||
ui.actionUndockTab->setVisible(tabbedWindow);
|
||||
} else {
|
||||
ui.actionDockTab->setVisible(false);
|
||||
ui.actionUndockTab->setVisible(false);
|
||||
}
|
||||
if (Settings->getChatFlags() & RS_CHAT_TABBED_WINDOW) {
|
||||
ui.actionDockTab->setVisible(tabbedWindow == false);
|
||||
ui.actionUndockTab->setVisible(tabbedWindow);
|
||||
} else {
|
||||
ui.actionDockTab->setVisible(false);
|
||||
ui.actionUndockTab->setVisible(false);
|
||||
}
|
||||
|
||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
|
||||
connect(ui.actionAvatar, SIGNAL(triggered()),this, SLOT(getAvatar()));
|
||||
connect(ui.actionColor, SIGNAL(triggered()), this, SLOT(setStyle()));
|
||||
connect(ui.actionDockTab, SIGNAL(triggered()), this, SLOT(dockTab()));
|
||||
connect(ui.actionUndockTab, SIGNAL(triggered()), this, SLOT(undockTab()));
|
||||
connect(ui.actionSetOnTop, SIGNAL(toggled(bool)), this, SLOT(setOnTop()));
|
||||
connect(ui.actionAvatar, SIGNAL(triggered()),this, SLOT(getAvatar()));
|
||||
connect(ui.actionColor, SIGNAL(triggered()), this, SLOT(setStyle()));
|
||||
connect(ui.actionDockTab, SIGNAL(triggered()), this, SLOT(dockTab()));
|
||||
connect(ui.actionUndockTab, SIGNAL(triggered()), this, SLOT(undockTab()));
|
||||
connect(ui.actionSetOnTop, SIGNAL(toggled(bool)), this, SLOT(setOnTop()));
|
||||
|
||||
connect(ui.tabWidget, SIGNAL(tabChanged(PopupChatDialog*)), this, SLOT(tabChanged(PopupChatDialog*)));
|
||||
connect(ui.tabWidget, SIGNAL(tabChanged(ChatDialog*)), this, SLOT(tabChanged(ChatDialog*)));
|
||||
|
||||
if (tabbedWindow) {
|
||||
/* signal toggled is called */
|
||||
ui.actionSetOnTop->setChecked(Settings->valueFromGroup("ChatWindow", "OnTop", false).toBool());
|
||||
}
|
||||
if (tabbedWindow) {
|
||||
/* signal toggled is called */
|
||||
ui.actionSetOnTop->setChecked(Settings->valueFromGroup("ChatWindow", "OnTop", false).toBool());
|
||||
}
|
||||
|
||||
setWindowIcon(QIcon(IMAGE_WINDOW));
|
||||
setWindowIcon(QIcon(IMAGE_WINDOW));
|
||||
}
|
||||
|
||||
/** Destructor. */
|
||||
PopupChatWindow::~PopupChatWindow()
|
||||
{
|
||||
saveSettings();
|
||||
saveSettings();
|
||||
|
||||
if (this == instance) {
|
||||
instance = NULL;
|
||||
}
|
||||
if (this == instance) {
|
||||
instance = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void PopupChatWindow::saveSettings()
|
||||
{
|
||||
if (tabbedWindow) {
|
||||
Settings->saveWidgetInformation(this);
|
||||
if (tabbedWindow) {
|
||||
Settings->saveWidgetInformation(this);
|
||||
|
||||
Settings->setValueToGroup("ChatWindow", "OnTop", ui.actionSetOnTop->isChecked());
|
||||
} else {
|
||||
if (!peerId.empty()) {
|
||||
PeerSettings->saveWidgetInformation(peerId, this);
|
||||
PeerSettings->setPrivateChatOnTop(peerId, ui.actionSetOnTop->isChecked());
|
||||
}
|
||||
}
|
||||
Settings->setValueToGroup("ChatWindow", "OnTop", ui.actionSetOnTop->isChecked());
|
||||
} else {
|
||||
if (!peerId.empty()) {
|
||||
PeerSettings->saveWidgetInformation(peerId, this);
|
||||
PeerSettings->setPrivateChatOnTop(peerId, ui.actionSetOnTop->isChecked());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PopupChatWindow::showEvent(QShowEvent */*event*/)
|
||||
{
|
||||
if (firstShow) {
|
||||
firstShow = false;
|
||||
if (firstShow) {
|
||||
firstShow = false;
|
||||
|
||||
if (tabbedWindow) {
|
||||
Settings->loadWidgetInformation(this);
|
||||
} else {
|
||||
this->move(qrand()%100, qrand()%100); //avoid to stack multiple popup chat windows on the same position
|
||||
PeerSettings->loadWidgetInformation(peerId, this);
|
||||
}
|
||||
}
|
||||
if (tabbedWindow) {
|
||||
Settings->loadWidgetInformation(this);
|
||||
} else {
|
||||
this->move(qrand()%100, qrand()%100); //avoid to stack multiple popup chat windows on the same position
|
||||
PeerSettings->loadWidgetInformation(peerId, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PopupChatDialog *PopupChatWindow::getCurrentDialog()
|
||||
ChatDialog *PopupChatWindow::getCurrentDialog()
|
||||
{
|
||||
if (tabbedWindow) {
|
||||
return dynamic_cast<PopupChatDialog*>(ui.tabWidget->currentWidget());
|
||||
}
|
||||
if (tabbedWindow) {
|
||||
return dynamic_cast<ChatDialog*>(ui.tabWidget->currentWidget());
|
||||
}
|
||||
|
||||
return chatDialog;
|
||||
return chatDialog;
|
||||
}
|
||||
|
||||
void PopupChatWindow::changeEvent(QEvent *event)
|
||||
void PopupChatWindow::addDialog(ChatDialog *dialog)
|
||||
{
|
||||
if (event->type() == QEvent::ActivationChange) {
|
||||
PopupChatDialog *pcd = getCurrentDialog();
|
||||
if (pcd) {
|
||||
pcd->activate();
|
||||
}
|
||||
}
|
||||
if (tabbedWindow) {
|
||||
ui.tabWidget->addDialog(dialog);
|
||||
} else {
|
||||
ui.horizontalLayout->addWidget(dialog);
|
||||
dialog->addToParent(this);
|
||||
ui.horizontalLayout->setContentsMargins(0, 0, 0, 0);
|
||||
peerId = dialog->getPeerId();
|
||||
chatDialog = dialog;
|
||||
calculateStyle(dialog);
|
||||
|
||||
/* signal toggled is called */
|
||||
ui.actionSetOnTop->setChecked(PeerSettings->getPrivateChatOnTop(peerId));
|
||||
}
|
||||
|
||||
QObject::connect(dialog, SIGNAL(infoChanged(ChatDialog*)), this, SLOT(tabInfoChanged(ChatDialog*)));
|
||||
QObject::connect(dialog, SIGNAL(newMessage(ChatDialog*)), this, SLOT(tabNewMessage(ChatDialog*)));
|
||||
QObject::connect(dialog, SIGNAL(dialogClose(ChatDialog*)), this, SLOT(dialogClose(ChatDialog*)));
|
||||
}
|
||||
|
||||
void PopupChatWindow::addDialog(PopupChatDialog *dialog)
|
||||
void PopupChatWindow::removeDialog(ChatDialog *dialog)
|
||||
{
|
||||
if (tabbedWindow) {
|
||||
ui.tabWidget->addDialog(dialog);
|
||||
} else {
|
||||
ui.horizontalLayout->addWidget(dialog);
|
||||
ui.horizontalLayout->setContentsMargins(0, 0, 0, 0);
|
||||
peerId = dialog->getPeerId();
|
||||
chatDialog = dialog;
|
||||
calculateStyle(dialog);
|
||||
QObject::disconnect(dialog, SIGNAL(infoChanged(ChatDialog*)), this, SLOT(tabInfoChanged(ChatDialog*)));
|
||||
QObject::disconnect(dialog, SIGNAL(newMessage(ChatDialog*)), this, SLOT(tabNewMessage(ChatDialog*)));
|
||||
QObject::disconnect(dialog, SIGNAL(dialogClose(ChatDialog*)), this, SLOT(dialogClose(ChatDialog*)));
|
||||
|
||||
/* signal toggled is called */
|
||||
ui.actionSetOnTop->setChecked(PeerSettings->getPrivateChatOnTop(peerId));
|
||||
}
|
||||
if (tabbedWindow) {
|
||||
ui.tabWidget->removeDialog(dialog);
|
||||
|
||||
QObject::connect(dialog, SIGNAL(infoChanged(PopupChatDialog*)), this, SLOT(tabInfoChanged(PopupChatDialog*)));
|
||||
QObject::connect(dialog, SIGNAL(newMessage(PopupChatDialog*)), this, SLOT(tabNewMessage(PopupChatDialog*)));
|
||||
QObject::connect(dialog, SIGNAL(dialogClose(PopupChatDialog*)), this, SLOT(dialogClose(PopupChatDialog*)));
|
||||
if (ui.tabWidget->count() == 0) {
|
||||
deleteLater();
|
||||
}
|
||||
} else {
|
||||
if (chatDialog == dialog) {
|
||||
saveSettings();
|
||||
dialog->removeFromParent(this);
|
||||
ui.horizontalLayout->removeWidget(dialog);
|
||||
chatDialog = NULL;
|
||||
peerId.erase();
|
||||
deleteLater();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PopupChatWindow::removeDialog(PopupChatDialog *dialog)
|
||||
void PopupChatWindow::showDialog(ChatDialog *dialog, uint chatflags)
|
||||
{
|
||||
QObject::disconnect(dialog, SIGNAL(infoChanged(PopupChatDialog*)), this, SLOT(tabInfoChanged(PopupChatDialog*)));
|
||||
QObject::disconnect(dialog, SIGNAL(newMessage(PopupChatDialog*)), this, SLOT(tabNewMessage(PopupChatDialog*)));
|
||||
QObject::disconnect(dialog, SIGNAL(dialogClose(PopupChatDialog*)), this, SLOT(dialogClose(PopupChatDialog*)));
|
||||
|
||||
if (tabbedWindow) {
|
||||
ui.tabWidget->removeDialog(dialog);
|
||||
|
||||
if (ui.tabWidget->count() == 0) {
|
||||
deleteLater();
|
||||
}
|
||||
} else {
|
||||
if (chatDialog == dialog) {
|
||||
saveSettings();
|
||||
ui.horizontalLayout->removeWidget(dialog);
|
||||
chatDialog = NULL;
|
||||
peerId.erase();
|
||||
deleteLater();
|
||||
}
|
||||
}
|
||||
if (chatflags & RS_CHAT_FOCUS) {
|
||||
if (tabbedWindow) {
|
||||
ui.tabWidget->setCurrentWidget(dialog);
|
||||
}
|
||||
show();
|
||||
activateWindow();
|
||||
setWindowState((windowState() & (~Qt::WindowMinimized)) | Qt::WindowActive);
|
||||
raise();
|
||||
dialog->focusDialog();
|
||||
} else {
|
||||
if (isVisible() == false) {
|
||||
showMinimized();
|
||||
}
|
||||
alertDialog(dialog);
|
||||
}
|
||||
}
|
||||
|
||||
void PopupChatWindow::showDialog(PopupChatDialog *dialog, uint chatflags)
|
||||
void PopupChatWindow::alertDialog(ChatDialog */*dialog*/)
|
||||
{
|
||||
if (chatflags & RS_CHAT_FOCUS) {
|
||||
if (tabbedWindow) {
|
||||
ui.tabWidget->setCurrentWidget(dialog);
|
||||
}
|
||||
show();
|
||||
activateWindow();
|
||||
setWindowState((windowState() & (~Qt::WindowMinimized)) | Qt::WindowActive);
|
||||
raise();
|
||||
dialog->focusDialog();
|
||||
} else {
|
||||
if (isVisible() == false) {
|
||||
showMinimized();
|
||||
}
|
||||
alertDialog(dialog);
|
||||
}
|
||||
QApplication::alert(this);
|
||||
}
|
||||
|
||||
void PopupChatWindow::alertDialog(PopupChatDialog */*dialog*/)
|
||||
void PopupChatWindow::calculateTitle(ChatDialog *dialog)
|
||||
{
|
||||
QApplication::alert(this);
|
||||
}
|
||||
bool hasNewMessages = false;
|
||||
ChatDialog *cd;
|
||||
|
||||
void PopupChatWindow::calculateTitle(PopupChatDialog *dialog)
|
||||
{
|
||||
bool hasNewMessages = false;
|
||||
PopupChatDialog *pcd;
|
||||
/* is typing */
|
||||
bool isTyping = false;
|
||||
if (ui.tabWidget->isVisible()) {
|
||||
ui.tabWidget->getInfo(isTyping, hasNewMessages, NULL);
|
||||
} else {
|
||||
if (dialog) {
|
||||
isTyping = dialog->isTyping();
|
||||
hasNewMessages = dialog->hasNewMessages();
|
||||
}
|
||||
}
|
||||
|
||||
/* is typing */
|
||||
bool isTyping = false;
|
||||
if (ui.tabWidget->isVisible()) {
|
||||
ui.tabWidget->getInfo(isTyping, hasNewMessages, NULL);
|
||||
} else {
|
||||
if (dialog) {
|
||||
isTyping = dialog->isTyping();
|
||||
hasNewMessages = dialog->hasNewMessages();
|
||||
}
|
||||
}
|
||||
if (ui.tabWidget->isVisible()) {
|
||||
cd = dynamic_cast<ChatDialog*>(ui.tabWidget->currentWidget());
|
||||
} else {
|
||||
cd = dialog;
|
||||
}
|
||||
|
||||
if (ui.tabWidget->isVisible()) {
|
||||
pcd = dynamic_cast<PopupChatDialog*>(ui.tabWidget->currentWidget());
|
||||
} else {
|
||||
pcd = dialog;
|
||||
}
|
||||
QIcon icon;
|
||||
if (isTyping) {
|
||||
icon = QIcon(IMAGE_TYPING);
|
||||
} else if (hasNewMessages) {
|
||||
icon = QIcon(IMAGE_CHAT);
|
||||
} else {
|
||||
if (cd && cd->hasPeerStatus()) {
|
||||
icon = QIcon(StatusDefs::imageIM(cd->getPeerStatus()));
|
||||
} else {
|
||||
icon = QIcon(IMAGE_WINDOW);
|
||||
}
|
||||
}
|
||||
|
||||
QIcon icon;
|
||||
if (isTyping) {
|
||||
icon = QIcon(IMAGE_TYPING);
|
||||
} else if (hasNewMessages) {
|
||||
icon = QIcon(IMAGE_CHAT);
|
||||
} else {
|
||||
if (pcd && pcd->hasPeerStatus()) {
|
||||
icon = QIcon(StatusDefs::imageIM(pcd->getPeerStatus()));
|
||||
} else {
|
||||
icon = QIcon(IMAGE_WINDOW);
|
||||
}
|
||||
}
|
||||
setWindowIcon(icon);
|
||||
|
||||
setWindowIcon(icon);
|
||||
|
||||
if (pcd) {
|
||||
setWindowTitle(pcd->getTitle() + " (" + StatusDefs::name(pcd->getPeerStatus()) + ")");
|
||||
} else {
|
||||
setWindowTitle(tr("RetroShare"));
|
||||
}
|
||||
if (cd) {
|
||||
QString title = cd->getTitle();
|
||||
if (cd->hasPeerStatus()) {
|
||||
title += " (" + StatusDefs::name(cd->getPeerStatus()) + ")";
|
||||
}
|
||||
setWindowTitle(title);
|
||||
} else {
|
||||
setWindowTitle("RetroShare");
|
||||
}
|
||||
}
|
||||
|
||||
void PopupChatWindow::getAvatar()
|
||||
{
|
||||
QByteArray ba;
|
||||
if (misc::getOpenAvatarPicture(this, ba)) {
|
||||
std::cerr << "Avatar image size = " << ba.size() << std::endl ;
|
||||
QByteArray ba;
|
||||
if (misc::getOpenAvatarPicture(this, ba)) {
|
||||
std::cerr << "Avatar image size = " << ba.size() << std::endl ;
|
||||
|
||||
rsMsgs->setOwnAvatarData((unsigned char *)(ba.data()), ba.size()); // last char 0 included.
|
||||
}
|
||||
rsMsgs->setOwnAvatarData((unsigned char *)(ba.data()), ba.size()); // last char 0 included.
|
||||
}
|
||||
}
|
||||
|
||||
void PopupChatWindow::dialogClose(PopupChatDialog *dialog)
|
||||
void PopupChatWindow::dialogClose(ChatDialog *dialog)
|
||||
{
|
||||
removeDialog(dialog);
|
||||
removeDialog(dialog);
|
||||
}
|
||||
|
||||
void PopupChatWindow::tabChanged(PopupChatDialog *dialog)
|
||||
void PopupChatWindow::tabChanged(ChatDialog *dialog)
|
||||
{
|
||||
calculateStyle(dialog);
|
||||
calculateTitle(dialog);
|
||||
calculateStyle(dialog);
|
||||
calculateTitle(dialog);
|
||||
}
|
||||
|
||||
void PopupChatWindow::tabInfoChanged(PopupChatDialog *dialog)
|
||||
void PopupChatWindow::tabInfoChanged(ChatDialog *dialog)
|
||||
{
|
||||
calculateTitle(dialog);
|
||||
calculateTitle(dialog);
|
||||
}
|
||||
|
||||
void PopupChatWindow::tabNewMessage(PopupChatDialog *dialog)
|
||||
void PopupChatWindow::tabNewMessage(ChatDialog *dialog)
|
||||
{
|
||||
alertDialog(dialog);
|
||||
alertDialog(dialog);
|
||||
}
|
||||
|
||||
void PopupChatWindow::dockTab()
|
||||
{
|
||||
if ((Settings->getChatFlags() & RS_CHAT_TABBED_WINDOW) && chatDialog) {
|
||||
PopupChatWindow *pcw = getWindow(false);
|
||||
if (pcw) {
|
||||
PopupChatDialog *pcd = chatDialog;
|
||||
removeDialog(pcd);
|
||||
pcw->addDialog(pcd);
|
||||
pcw->show();
|
||||
pcw->calculateTitle(pcd);
|
||||
}
|
||||
}
|
||||
if ((Settings->getChatFlags() & RS_CHAT_TABBED_WINDOW) && chatDialog) {
|
||||
PopupChatWindow *pcw = getWindow(false);
|
||||
if (pcw) {
|
||||
ChatDialog *pcd = chatDialog;
|
||||
removeDialog(pcd);
|
||||
pcw->addDialog(pcd);
|
||||
pcw->show();
|
||||
pcw->calculateTitle(pcd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PopupChatWindow::undockTab()
|
||||
{
|
||||
PopupChatDialog *pcd = dynamic_cast<PopupChatDialog*>(ui.tabWidget->currentWidget());
|
||||
ChatDialog *cd = dynamic_cast<ChatDialog*>(ui.tabWidget->currentWidget());
|
||||
|
||||
if (pcd) {
|
||||
PopupChatWindow *pcw = getWindow(true);
|
||||
if (pcw) {
|
||||
removeDialog(pcd);
|
||||
pcw->addDialog(pcd);
|
||||
pcd->show();
|
||||
pcw->show();
|
||||
pcw->calculateTitle(pcd);
|
||||
}
|
||||
}
|
||||
if (cd) {
|
||||
PopupChatWindow *pcw = getWindow(true);
|
||||
if (pcw) {
|
||||
removeDialog(cd);
|
||||
pcw->addDialog(cd);
|
||||
cd->show();
|
||||
pcw->show();
|
||||
pcw->calculateTitle(cd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PopupChatWindow::setStyle()
|
||||
{
|
||||
PopupChatDialog *pcd = getCurrentDialog();
|
||||
ChatDialog *cd = getCurrentDialog();
|
||||
|
||||
if (pcd && pcd->setStyle()) {
|
||||
calculateStyle(pcd);
|
||||
}
|
||||
if (cd && cd->setStyle()) {
|
||||
calculateStyle(cd);
|
||||
}
|
||||
}
|
||||
|
||||
void PopupChatWindow::setOnTop()
|
||||
{
|
||||
Qt::WindowFlags flags = windowFlags();
|
||||
if (ui.actionSetOnTop->isChecked()) {
|
||||
flags |= Qt::WindowStaysOnTopHint;
|
||||
} else {
|
||||
flags &= ~Qt::WindowStaysOnTopHint;
|
||||
}
|
||||
setWindowFlags(flags);
|
||||
Qt::WindowFlags flags = windowFlags();
|
||||
if (ui.actionSetOnTop->isChecked()) {
|
||||
flags |= Qt::WindowStaysOnTopHint;
|
||||
} else {
|
||||
flags &= ~Qt::WindowStaysOnTopHint;
|
||||
}
|
||||
setWindowFlags(flags);
|
||||
|
||||
/* Show window again */
|
||||
show();
|
||||
/* Show window again */
|
||||
show();
|
||||
}
|
||||
|
||||
void PopupChatWindow::calculateStyle(PopupChatDialog *dialog)
|
||||
void PopupChatWindow::calculateStyle(ChatDialog *dialog)
|
||||
{
|
||||
QString toolSheet;
|
||||
QString statusSheet;
|
||||
QString widgetSheet;
|
||||
QString toolSheet;
|
||||
QString statusSheet;
|
||||
QString widgetSheet;
|
||||
|
||||
if (dialog) {
|
||||
const RSStyle &style = dialog->getStyle();
|
||||
if (dialog) {
|
||||
const RSStyle *style = dialog->getStyle();
|
||||
if (style) {
|
||||
QString styleSheet = style->getStyleSheet();
|
||||
|
||||
QString styleSheet = style.getStyleSheet();
|
||||
if (styleSheet.isEmpty() == false) {
|
||||
toolSheet = QString("QToolBar{%1}").arg(styleSheet);
|
||||
statusSheet = QString(".QStatusBar{%1}").arg(styleSheet);
|
||||
widgetSheet = QString(".QWidget{%1}").arg(styleSheet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (styleSheet.isEmpty() == false) {
|
||||
toolSheet = QString("QToolBar{%1}").arg(styleSheet);
|
||||
statusSheet = QString(".QStatusBar{%1}").arg(styleSheet);
|
||||
widgetSheet = QString(".QWidget{%1}").arg(styleSheet);
|
||||
}
|
||||
}
|
||||
|
||||
ui.chattoolBar->setStyleSheet(toolSheet);
|
||||
ui.chatstatusbar->setStyleSheet(statusSheet);
|
||||
ui.chatcentralwidget->setStyleSheet(widgetSheet);
|
||||
ui.chattoolBar->setStyleSheet(toolSheet);
|
||||
ui.chatstatusbar->setStyleSheet(statusSheet);
|
||||
ui.chatcentralwidget->setStyleSheet(widgetSheet);
|
||||
}
|
||||
|
@ -26,55 +26,54 @@
|
||||
#include <QTimer>
|
||||
#include "ui_PopupChatWindow.h"
|
||||
|
||||
class PopupChatDialog;
|
||||
class ChatDialog;
|
||||
|
||||
class PopupChatWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static PopupChatWindow *getWindow(bool needSingleWindow);
|
||||
static void cleanup();
|
||||
static PopupChatWindow *getWindow(bool needSingleWindow);
|
||||
static void cleanup();
|
||||
|
||||
public:
|
||||
void addDialog(PopupChatDialog *dialog);
|
||||
void removeDialog(PopupChatDialog *dialog);
|
||||
void showDialog(PopupChatDialog *dialog, uint chatflags);
|
||||
void alertDialog(PopupChatDialog *dialog);
|
||||
void calculateTitle(PopupChatDialog *dialog);
|
||||
void addDialog(ChatDialog *dialog);
|
||||
void removeDialog(ChatDialog *dialog);
|
||||
void showDialog(ChatDialog *dialog, uint chatflags);
|
||||
void alertDialog(ChatDialog *dialog);
|
||||
void calculateTitle(ChatDialog *dialog);
|
||||
|
||||
protected:
|
||||
/** Default constructor */
|
||||
PopupChatWindow(bool tabbed, QWidget *parent = 0, Qt::WFlags flags = 0);
|
||||
/** Default destructor */
|
||||
~PopupChatWindow();
|
||||
/** Default constructor */
|
||||
PopupChatWindow(bool tabbed, QWidget *parent = 0, Qt::WFlags flags = 0);
|
||||
/** Default destructor */
|
||||
~PopupChatWindow();
|
||||
|
||||
virtual void showEvent(QShowEvent *event);
|
||||
virtual void changeEvent(QEvent *event);
|
||||
virtual void showEvent(QShowEvent *event);
|
||||
|
||||
private slots:
|
||||
void getAvatar();
|
||||
void tabChanged(PopupChatDialog *dialog);
|
||||
void tabInfoChanged(PopupChatDialog *dialog);
|
||||
void tabNewMessage(PopupChatDialog *dialog);
|
||||
void dialogClose(PopupChatDialog *dialog);
|
||||
void dockTab();
|
||||
void undockTab();
|
||||
void setStyle();
|
||||
void setOnTop();
|
||||
void getAvatar();
|
||||
void tabChanged(ChatDialog *dialog);
|
||||
void tabInfoChanged(ChatDialog *dialog);
|
||||
void tabNewMessage(ChatDialog *dialog);
|
||||
void dialogClose(ChatDialog *dialog);
|
||||
void dockTab();
|
||||
void undockTab();
|
||||
void setStyle();
|
||||
void setOnTop();
|
||||
|
||||
private:
|
||||
bool tabbedWindow;
|
||||
bool firstShow;
|
||||
std::string peerId;
|
||||
PopupChatDialog *chatDialog;
|
||||
bool tabbedWindow;
|
||||
bool firstShow;
|
||||
std::string peerId;
|
||||
ChatDialog *chatDialog;
|
||||
|
||||
PopupChatDialog *getCurrentDialog();
|
||||
void saveSettings();
|
||||
void calculateStyle(PopupChatDialog *dialog);
|
||||
ChatDialog *getCurrentDialog();
|
||||
void saveSettings();
|
||||
void calculateStyle(ChatDialog *dialog);
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::PopupChatWindow ui;
|
||||
/** Qt Designer generated object */
|
||||
Ui::PopupChatWindow ui;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -25,12 +25,13 @@
|
||||
#include <QTimer>
|
||||
#include <QTreeWidgetItem>
|
||||
#include <QWidgetAction>
|
||||
#include <QDateTime>
|
||||
|
||||
#include "retroshare/rspeers.h"
|
||||
#include "retroshare/rsstatus.h"
|
||||
|
||||
#include "GroupDefs.h"
|
||||
#include "gui/chat/PopupChatDialog.h"
|
||||
#include "gui/chat/ChatDialog.h"
|
||||
#include "gui/chat/CreateLobbyDialog.h"
|
||||
#include "gui/common/AvatarDefs.h"
|
||||
#include "gui/connect/ConfCertDialog.h"
|
||||
@ -1209,7 +1210,7 @@ void FriendList::chatfriend(QTreeWidgetItem *pPeer)
|
||||
}
|
||||
|
||||
std::string id = getRsId(pPeer);
|
||||
PopupChatDialog::chatFriend(id);
|
||||
ChatDialog::chatFriend(id);
|
||||
}
|
||||
|
||||
void FriendList::addFriend()
|
||||
@ -1416,7 +1417,7 @@ void FriendList::showLobby()
|
||||
std::string vpeer_id ;
|
||||
|
||||
if(rsMsgs->getVirtualPeerId( ChatLobbyId(QString::fromStdString(lobby_id).toULongLong() ),vpeer_id))
|
||||
PopupChatDialog::chatFriend(vpeer_id) ;
|
||||
ChatDialog::chatFriend(vpeer_id) ;
|
||||
}
|
||||
void FriendList::unsubscribeToLobby()
|
||||
{
|
||||
@ -1433,7 +1434,7 @@ void FriendList::unsubscribeToLobby()
|
||||
|
||||
// we should also close existing windows.
|
||||
|
||||
PopupChatDialog::closeChat(vpeer_id) ;
|
||||
ChatDialog::closeChat(vpeer_id) ;
|
||||
}
|
||||
|
||||
|
||||
@ -1462,7 +1463,7 @@ void FriendList::inviteToLobby()
|
||||
|
||||
std::string vpeer_id ;
|
||||
if(rsMsgs->getVirtualPeerId( ChatLobbyId(QString::fromStdString(lobby_id).toULongLong() ),vpeer_id) )
|
||||
PopupChatDialog::chatFriend(vpeer_id) ;
|
||||
ChatDialog::chatFriend(vpeer_id) ;
|
||||
}
|
||||
|
||||
void FriendList::createchatlobby()
|
||||
|
@ -153,7 +153,7 @@ bool HashBox::eventFilter(QObject* object, QEvent* event)
|
||||
void HashBox::addAttachments(const QStringList& files, HashedFile::Flags flag)
|
||||
{
|
||||
/* add a AttachFileItem to the attachment section */
|
||||
std::cerr << "PopupChatDialog::addExtraFile() hashing file." << std::endl;
|
||||
std::cerr << "HashBox::addExtraFile() hashing file." << std::endl;
|
||||
|
||||
if (files.isEmpty()) {
|
||||
return;
|
||||
|
@ -29,6 +29,7 @@
|
||||
|
||||
#include <retroshare/rsinit.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
#include <retroshare/rsmsgs.h>
|
||||
|
||||
#include "RsharePeerSettings.h"
|
||||
#include "gui/style/RSStyle.h"
|
||||
@ -36,7 +37,7 @@
|
||||
/** The file in which all settings of he peers will read and written. */
|
||||
#define SETTINGS_FILE (QString::fromUtf8(RsInit::RsProfileConfigDirectory().c_str()) + "/RSPeers.conf")
|
||||
|
||||
/* clean dead gpg id's after these days */
|
||||
/* clean dead id's after these days */
|
||||
#define DAYS_TO_CLEAN 7
|
||||
|
||||
/* Group for general data */
|
||||
@ -56,10 +57,10 @@ RsharePeerSettings *PeerSettings = NULL;
|
||||
RsharePeerSettings::RsharePeerSettings()
|
||||
: QSettings(SETTINGS_FILE, QSettings::IniFormat)
|
||||
{
|
||||
cleanDeadGpgIds();
|
||||
cleanDeadIds();
|
||||
}
|
||||
|
||||
void RsharePeerSettings::cleanDeadGpgIds()
|
||||
void RsharePeerSettings::cleanDeadIds()
|
||||
{
|
||||
beginGroup(GROUP_GENERAL);
|
||||
QDateTime lastClean = value("lastClean").toDateTime();
|
||||
@ -75,6 +76,10 @@ void RsharePeerSettings::cleanDeadGpgIds()
|
||||
continue;
|
||||
}
|
||||
|
||||
ChatLobbyId lid;
|
||||
if (rsMsgs->isLobbyId((*group).toStdString(), lid)) {
|
||||
continue;
|
||||
}
|
||||
if (rsPeers->isGPGAccepted((*group).toStdString()) == false) {
|
||||
remove(*group);
|
||||
}
|
||||
@ -86,22 +91,27 @@ void RsharePeerSettings::cleanDeadGpgIds()
|
||||
}
|
||||
}
|
||||
|
||||
bool RsharePeerSettings::getGpgIdOfSslId(const std::string &sslId, std::string &gpgId)
|
||||
|
||||
bool RsharePeerSettings::getSettingsIdOfPeerId(const std::string &peerId, std::string &settingsId)
|
||||
{
|
||||
std::map<std::string, std::string>::iterator it = m_SslToGpg.find(sslId);
|
||||
ChatLobbyId lid;
|
||||
if (rsMsgs->isLobbyId(peerId, lid)) {
|
||||
settingsId = peerId;
|
||||
return true;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string>::iterator it = m_SslToGpg.find(peerId);
|
||||
if (it != m_SslToGpg.end()) {
|
||||
gpgId = it->second;
|
||||
settingsId = it->second;
|
||||
return true;
|
||||
}
|
||||
|
||||
RsPeerDetails details;
|
||||
if (rsPeers->getPeerDetails(sslId, details) == false) {
|
||||
if (rsPeers->getPeerDetails(peerId, details) == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
gpgId = details.gpg_id;
|
||||
m_SslToGpg[sslId] = gpgId;
|
||||
settingsId = details.gpg_id;
|
||||
m_SslToGpg[peerId] = settingsId;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -111,13 +121,13 @@ QVariant RsharePeerSettings::get(const std::string &peerId, const QString &key,
|
||||
{
|
||||
QVariant result;
|
||||
|
||||
std::string gpgId;
|
||||
if (getGpgIdOfSslId(peerId, gpgId) == false) {
|
||||
/* gpg id not found */
|
||||
std::string settingsId;
|
||||
if (getSettingsIdOfPeerId(peerId, settingsId) == false) {
|
||||
/* settings id not found */
|
||||
return result;
|
||||
}
|
||||
|
||||
beginGroup(QString::fromStdString(gpgId));
|
||||
beginGroup(QString::fromStdString(settingsId));
|
||||
result = value(key, defaultValue);
|
||||
endGroup();
|
||||
|
||||
@ -127,13 +137,13 @@ QVariant RsharePeerSettings::get(const std::string &peerId, const QString &key,
|
||||
/* set value of peer */
|
||||
void RsharePeerSettings::set(const std::string &peerId, const QString &key, const QVariant &value)
|
||||
{
|
||||
std::string gpgId;
|
||||
if (getGpgIdOfSslId(peerId, gpgId) == false) {
|
||||
/* gpg id not found */
|
||||
std::string settingsId;
|
||||
if (getSettingsIdOfPeerId(peerId, settingsId) == false) {
|
||||
/* settings id not found */
|
||||
return;
|
||||
}
|
||||
|
||||
beginGroup(QString::fromStdString(gpgId));
|
||||
beginGroup(QString::fromStdString(settingsId));
|
||||
setValue(key, value);
|
||||
endGroup();
|
||||
}
|
||||
@ -170,13 +180,13 @@ void RsharePeerSettings::setPrivateChatOnTop(const std::string &peerId, bool val
|
||||
|
||||
void RsharePeerSettings::saveWidgetInformation(const std::string &peerId, QWidget *widget)
|
||||
{
|
||||
std::string gpgId;
|
||||
if (getGpgIdOfSslId(peerId, gpgId) == false) {
|
||||
/* gpg id not found */
|
||||
std::string settingsId;
|
||||
if (getSettingsIdOfPeerId(peerId, settingsId) == false) {
|
||||
/* settings id not found */
|
||||
return;
|
||||
}
|
||||
|
||||
beginGroup(QString::fromStdString(gpgId));
|
||||
beginGroup(QString::fromStdString(settingsId));
|
||||
beginGroup("widgetInformation");
|
||||
beginGroup(widget->objectName());
|
||||
|
||||
@ -190,13 +200,13 @@ void RsharePeerSettings::saveWidgetInformation(const std::string &peerId, QWidge
|
||||
|
||||
void RsharePeerSettings::loadWidgetInformation(const std::string &peerId, QWidget *widget)
|
||||
{
|
||||
std::string gpgId;
|
||||
if (getGpgIdOfSslId(peerId, gpgId) == false) {
|
||||
/* gpg id not found */
|
||||
std::string settingsId;
|
||||
if (getSettingsIdOfPeerId(peerId, settingsId) == false) {
|
||||
/* settings id not found */
|
||||
return;
|
||||
}
|
||||
|
||||
beginGroup(QString::fromStdString(gpgId));
|
||||
beginGroup(QString::fromStdString(settingsId));
|
||||
beginGroup("widgetInformation");
|
||||
beginGroup(widget->objectName());
|
||||
|
||||
@ -218,15 +228,25 @@ void RsharePeerSettings::setShowAvatarFrame(const std::string &peerId, bool valu
|
||||
return set(peerId, "ShowAvatarFrame", value);
|
||||
}
|
||||
|
||||
bool RsharePeerSettings::getShowParticipantsFrame(const std::string &peerId)
|
||||
{
|
||||
return get(peerId, "ShowParticipantsFrame", true).toBool();
|
||||
}
|
||||
|
||||
void RsharePeerSettings::setShowParticipantsFrame(const std::string &peerId, bool value)
|
||||
{
|
||||
return set(peerId, "ShowParticipantsFrame", value);
|
||||
}
|
||||
|
||||
void RsharePeerSettings::getStyle(const std::string &peerId, const QString &name, RSStyle &style)
|
||||
{
|
||||
std::string gpgId;
|
||||
if (getGpgIdOfSslId(peerId, gpgId) == false) {
|
||||
/* gpg id not found */
|
||||
std::string settingsId;
|
||||
if (getSettingsIdOfPeerId(peerId, settingsId) == false) {
|
||||
/* settings id not found */
|
||||
return;
|
||||
}
|
||||
|
||||
beginGroup(QString::fromStdString(gpgId));
|
||||
beginGroup(QString::fromStdString(settingsId));
|
||||
beginGroup("style");
|
||||
beginGroup(name);
|
||||
|
||||
@ -239,13 +259,13 @@ void RsharePeerSettings::getStyle(const std::string &peerId, const QString &name
|
||||
|
||||
void RsharePeerSettings::setStyle(const std::string &peerId, const QString &name, RSStyle &style)
|
||||
{
|
||||
std::string gpgId;
|
||||
if (getGpgIdOfSslId(peerId, gpgId) == false) {
|
||||
/* gpg id not found */
|
||||
std::string settingsId;
|
||||
if (getSettingsIdOfPeerId(peerId, settingsId) == false) {
|
||||
/* settings id not found */
|
||||
return;
|
||||
}
|
||||
|
||||
beginGroup(QString::fromStdString(gpgId));
|
||||
beginGroup(QString::fromStdString(settingsId));
|
||||
beginGroup("style");
|
||||
beginGroup(name);
|
||||
|
||||
|
@ -48,6 +48,9 @@ public:
|
||||
bool getShowAvatarFrame(const std::string &peerId);
|
||||
void setShowAvatarFrame(const std::string &peerId, bool value);
|
||||
|
||||
bool getShowParticipantsFrame(const std::string &peerId);
|
||||
void setShowParticipantsFrame(const std::string &peerId, bool value);
|
||||
|
||||
void getStyle(const std::string &peerId, const QString &name, RSStyle &style);
|
||||
void setStyle(const std::string &peerId, const QString &name, RSStyle &style);
|
||||
|
||||
@ -55,8 +58,8 @@ protected:
|
||||
/** Default constructor. */
|
||||
RsharePeerSettings();
|
||||
|
||||
bool getGpgIdOfSslId(const std::string &sslId, std::string &gpgId);
|
||||
void cleanDeadGpgIds();
|
||||
bool getSettingsIdOfPeerId(const std::string &peerId, std::string &settingsId);
|
||||
void cleanDeadIds();
|
||||
|
||||
/* get value of peer */
|
||||
QVariant get(const std::string &peerId, const QString &key, const QVariant &defaultValue = QVariant());
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#include "OnlineToaster.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include "gui/chat/PopupChatDialog.h"
|
||||
#include "gui/chat/ChatDialog.h"
|
||||
#include "util/WidgetBackgroundImage.h"
|
||||
#include "gui/common/AvatarDefs.h"
|
||||
|
||||
@ -50,7 +50,7 @@ OnlineToaster::OnlineToaster(const std::string &peerId, const QString &name) : Q
|
||||
|
||||
void OnlineToaster::chatButtonSlot()
|
||||
{
|
||||
PopupChatDialog::chatFriend(peerId);
|
||||
ChatDialog::chatFriend(peerId);
|
||||
hide();
|
||||
}
|
||||
|
||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -31,7 +31,7 @@
|
||||
#include "gui/MessagesDialog.h"
|
||||
#include "gui/SharedFilesDialog.h"
|
||||
#include "gui/NetworkDialog.h"
|
||||
#include "gui/chat/PopupChatDialog.h"
|
||||
#include "gui/chat/ChatDialog.h"
|
||||
#include "gui/QuickStartWizard.h"
|
||||
#endif // MINIMAL_RSGUI
|
||||
#include "gui/MessengerWindow.h"
|
||||
@ -318,7 +318,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* cleanup */
|
||||
PopupChatDialog::cleanupChat();
|
||||
ChatDialog::cleanupChat();
|
||||
#endif // MINIMAL_RSGUI
|
||||
|
||||
rsicontrol->rsGlobalShutDown();
|
||||
|
Loading…
Reference in New Issue
Block a user