* 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:
drbob 2008-07-10 18:52:56 +00:00
parent d36b15d526
commit 67a27744f8
8 changed files with 65 additions and 41 deletions

View File

@ -145,7 +145,7 @@ void ChatDialog::insertChat()
for(it = newchat.begin(); it != newchat.end(); it++)
{
std::string msg(it->msg.begin(), it->msg.end());
std::cerr << "ChatDialog::insertChat(): " << msg << std::endl;
//std::cerr << "ChatDialog::insertChat(): " << msg << std::endl;
/* are they private? */
if (it->chatflags & RS_CHAT_PRIVATE)
@ -219,7 +219,7 @@ void ChatDialog::sendMsg()
ci.chatflags = RS_CHAT_PUBLIC;
std::string msg(ci.msg.begin(), ci.msg.end());
std::cerr << "ChatDialog::sendMsg(): " << msg << std::endl;
//std::cerr << "ChatDialog::sendMsg(): " << msg << std::endl;
rsMsgs -> ChatSend(ci);
ui.lineEdit->clear();
@ -301,7 +301,7 @@ void ChatDialog::insertSendList()
void ChatDialog::toggleSendItem( QTreeWidgetItem *item, int col )
{
std::cerr << "ToggleSendItem()" << std::endl;
//std::cerr << "ToggleSendItem()" << std::endl;
/* extract id */
std::string id = (item -> text(4)).toStdString();

View File

@ -198,8 +198,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
// createPageAction(QIcon(IMAGE_STATISTIC), tr("Statistics"), grp));
/* also an empty list of chat windows */
peersDialog->setChatDialog(chatDialog);
messengerWindow->setChatDialog(chatDialog);
messengerWindow->setChatDialog(peersDialog);
/* Create the toolbar */
ui.toolBar->addActions(grp->actions());
@ -691,8 +690,15 @@ void MainWindow::showsmplayer()
void MainWindow::playFiles(QStringList files)
{
std::cerr << "MainWindow::playFiles()" << std::endl;
showsmplayer();
std::cerr << "MainWindow::playFiles() showsmplayer() done" << std::endl;
mSMPlayer->gui()->openFiles(files);
std::cerr << "MainWindow::playFiles() done" << std::endl;
}

View File

@ -31,7 +31,7 @@
#include "chat/PopupChatDialog.h"
#include "msgs/ChanMsgDialog.h"
#include "ChatDialog.h"
#include "PeersDialog.h"
#include "connect/ConfCertDialog.h"
#include "util/PixmapMerging.h"
#include "LogoBar.h"
@ -359,7 +359,7 @@ void MessengerWindow::closeEvent (QCloseEvent * event)
void MessengerWindow::setChatDialog(ChatDialog *cd)
void MessengerWindow::setChatDialog(PeersDialog *cd)
{
chatDialog = cd;
}

View File

@ -29,7 +29,7 @@
#include <config/rsharesettings.h>
class LogoBar;
class ChatDialog;
class PeersDialog;
class MessengerWindow : public QWidget
{
@ -41,7 +41,7 @@ public:
/** Default Destructor */
void insertPeers();
void setChatDialog(ChatDialog *cd);
void setChatDialog(PeersDialog *cd);
NetworkDialog *networkDialog2;
@ -93,7 +93,7 @@ private:
/* (2) Utility Fns */
QTreeWidgetItem *getCurrentPeer(bool &isOnline);
ChatDialog *chatDialog;
PeersDialog *chatDialog;
/** Define the popup menus for the Context menu */
QMenu* contextMnu;

View File

@ -423,26 +423,22 @@ void PeersDialog::chatfriend()
return;
}
/*if (detail.state & RS_PEER_STATE_CONNECTED)
{*/
/* must reference ChatDialog */
if (chatDialog)
{
chatDialog->getPrivateChat(id, name, true);
}
/*}
if (detail.state & RS_PEER_STATE_CONNECTED)
{
getPrivateChat(id, name, true);
}
else
{*/
{
/* info dialog */
// QMessageBox::StandardButton sb = QMessageBox::question ( NULL,
// "Friend Not Online",
//"Your Friend is offline \nDo you want to send them a Message instead",
// (QMessageBox::Yes | QMessageBox::No));
/*if (sb == QMessageBox::Yes)
QMessageBox::StandardButton sb = QMessageBox::question ( NULL,
"Friend Not Online",
"Your Friend is offline \nDo you want to send them a Message instead",
(QMessageBox::Yes | QMessageBox::No));
if (sb == QMessageBox::Yes)
{
msgfriend();
}
}*/
}
return;
}
@ -643,7 +639,9 @@ void PeersDialog::insertChat()
for(it = newchat.begin(); it != newchat.end(); it++)
{
std::string msg(it->msg.begin(), it->msg.end());
std::cerr << "ChatDialog::insertChat(): " << msg << std::endl;
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog::insertChat(): " << msg << std::endl;
#endif
/* are they private? */
if (it->chatflags & RS_CHAT_PRIVATE)
@ -717,7 +715,9 @@ void PeersDialog::sendMsg()
ci.chatflags = RS_CHAT_PUBLIC;
std::string msg(ci.msg.begin(), ci.msg.end());
std::cerr << "ChatDialog::sendMsg(): " << msg << std::endl;
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog::sendMsg(): " << msg << std::endl;
#endif
rsMsgs -> ChatSend(ci);
ui.lineEdit->clear();
@ -799,7 +799,9 @@ void PeersDialog::insertSendList()
void PeersDialog::toggleSendItem( QTreeWidgetItem *item, int col )
{
#ifdef PEERS_DEBUG
std::cerr << "ToggleSendItem()" << std::endl;
#endif
/* extract id */
std::string id = (item -> text(4)).toStdString();

View File

@ -218,6 +218,9 @@ void SharedFilesDialog::playselectedfiles()
}
playFiles(fullpaths);
std::cerr << "SharedFilesDialog::playselectedfiles() Completed";
std::cerr << std::endl;
}

View File

@ -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;
}

View File

@ -577,7 +577,7 @@ void ChanMsgDialog::cancelMessage()
/* First the Msg (People) ones */
void ChanMsgDialog::togglePersonItem( QTreeWidgetItem *item, int col )
{
std::cerr << "TogglePersonItem()" << std::endl;
//std::cerr << "TogglePersonItem()" << std::endl;
/* extract id */
std::string id = (item -> text(1)).toStdString();
@ -594,7 +594,7 @@ void ChanMsgDialog::togglePersonItem( QTreeWidgetItem *item, int col )
/* Second the Channel ones */
void ChanMsgDialog::toggleChannelItem( QTreeWidgetItem *item, int col )
{
std::cerr << "ToggleChannelItem()" << std::endl;
//std::cerr << "ToggleChannelItem()" << std::endl;
/* extract id */
std::string id = (item -> text(2)).toStdString();
@ -611,7 +611,7 @@ void ChanMsgDialog::toggleChannelItem( QTreeWidgetItem *item, int col )
/* This is actually for both */
void ChanMsgDialog::toggleRecommendItem( QTreeWidgetItem *item, int col )
{
std::cerr << "ToggleRecommendItem()" << std::endl;
//std::cerr << "ToggleRecommendItem()" << std::endl;
/* extract name */
std::string id = (item -> text(0)).toStdString();