mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 14:45:12 -04:00
* Cleaned up more debug output.
* Fixed Popup Chats with new Peer Dialog. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@645 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d36b15d526
commit
67a27744f8
8 changed files with 65 additions and 41 deletions
|
@ -41,17 +41,20 @@
|
|||
|
||||
/* Define the format used for displaying the date and time */
|
||||
#define DATETIME_FMT "MMM dd hh:mm:ss"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
|
||||
/** Default constructor */
|
||||
PopupChatDialog::PopupChatDialog(std::string id, std::string name,
|
||||
QWidget *parent, Qt::WFlags flags)
|
||||
: QMainWindow(parent, flags), dialogId(id), dialogName(name),
|
||||
lastChatTime(0), lastChatName("")
|
||||
|
||||
{
|
||||
|
||||
#include <sstream>
|
||||
|
||||
/*****
|
||||
* #define CHAT_DEBUG 1
|
||||
*****/
|
||||
|
||||
/** Default constructor */
|
||||
PopupChatDialog::PopupChatDialog(std::string id, std::string name,
|
||||
QWidget *parent, Qt::WFlags flags)
|
||||
: QMainWindow(parent, flags), dialogId(id), dialogName(name),
|
||||
lastChatTime(0), lastChatName("")
|
||||
|
||||
{
|
||||
/* Invoke Qt Designer generated QObject setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
|
@ -163,7 +166,9 @@ void PopupChatDialog::addChatMsg(ChatInfo *ci)
|
|||
RsPeerDetails detail;
|
||||
if (!rsPeers->getPeerDetails(dialogId, detail))
|
||||
{
|
||||
#ifdef CHAT_DEBUG
|
||||
std::cerr << "WARNING CANNOT GET PEER INFO!!!!" << std::endl;
|
||||
#endif
|
||||
}
|
||||
else if (detail.state & RS_PEER_STATE_CONNECTED)
|
||||
{
|
||||
|
@ -250,7 +255,9 @@ void PopupChatDialog::sendChat()
|
|||
ci.msg = chatWidget->toHtml().toStdWString();
|
||||
ci.chatflags = RS_CHAT_PRIVATE;
|
||||
|
||||
#ifdef CHAT_DEBUG
|
||||
std::cout << "PopupChatDialog:sendChat " << styleHtm.toStdString() << std::endl;
|
||||
#endif
|
||||
|
||||
addChatMsg(&ci);
|
||||
|
||||
|
@ -380,7 +387,9 @@ void PopupChatDialog::addSmiley()
|
|||
|
||||
QString PopupChatDialog::loadEmptyStyle()
|
||||
{
|
||||
#ifdef CHAT_DEBUG
|
||||
std::cout << "PopupChatDialog:loadEmptyStyle " << styleHtm.toStdString() << std::endl;
|
||||
#endif
|
||||
QString ret;
|
||||
QFile file(styleHtm);
|
||||
//file.open(QIODevice::ReadOnly);
|
||||
|
@ -397,14 +406,18 @@ QString PopupChatDialog::loadEmptyStyle()
|
|||
css.close();
|
||||
}
|
||||
else {
|
||||
#ifdef CHAT_DEBUG
|
||||
std::cerr << "PopupChatDialog:loadEmptyStyle " << "Missing file of default css " << std::endl;
|
||||
#endif
|
||||
tmp = "";
|
||||
}
|
||||
ret.replace("%css-style%", tmp);
|
||||
return ret;
|
||||
}
|
||||
else {
|
||||
#ifdef CHAT_DEBUG
|
||||
std::cerr << "PopupChatDialog:loadEmptyStyle " << "Missing file of default style " << std::endl;
|
||||
#endif
|
||||
ret="%timestamp% %name% \n %message% ";
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue