Moved the star to the first column in MessagesDialog.

Fixed debug output in FriendsDialog.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4220 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-05-24 23:35:11 +00:00
parent b1953fd769
commit 265650c88d
2 changed files with 61 additions and 62 deletions

View File

@ -110,7 +110,7 @@
#define TYPE_GROUP 2 #define TYPE_GROUP 2
/****** /******
* #define PEERS_DEBUG 1 * #define FRIENDS_DEBUG 1
*****/ *****/
@ -587,7 +587,7 @@ void FriendsDialog::updateDisplay()
/* get the list of peers from the RsIface. */ /* get the list of peers from the RsIface. */
void FriendsDialog::insertPeers() void FriendsDialog::insertPeers()
{ {
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "FriendsDialog::insertPeers() called." << std::endl; std::cerr << "FriendsDialog::insertPeers() called." << std::endl;
#endif #endif
@ -790,8 +790,8 @@ void FriendsDialog::insertPeers()
fillGpgIds.push_back(gpgId); fillGpgIds.push_back(gpgId);
//add the gpg friends //add the gpg friends
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "FriendsDialog::insertPeers() inserting gpg_id : " << *it << std::endl; std::cerr << "FriendsDialog::insertPeers() inserting gpg_id : " << gpgId << std::endl;
#endif #endif
/* make a widget per friend */ /* make a widget per friend */
@ -883,7 +883,7 @@ void FriendsDialog::insertPeers()
RsPeerDetails sslDetail; RsPeerDetails sslDetail;
if (!rsPeers->getPeerDetails(sslId, sslDetail) || !rsPeers->isFriend(sslId)) { if (!rsPeers->getPeerDetails(sslId, sslDetail) || !rsPeers->isFriend(sslId)) {
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "Removing widget from the view : id : " << sslId << std::endl; std::cerr << "Removing widget from the view : id : " << sslId << std::endl;
#endif #endif
//child has disappeared, remove it from the gpg_item //child has disappeared, remove it from the gpg_item
@ -896,7 +896,7 @@ void FriendsDialog::insertPeers()
if (newChild) { if (newChild) {
sslItem = new RSTreeWidgetItem(m_compareRole, TYPE_SSL); //set type to 1 for custom popup menu sslItem = new RSTreeWidgetItem(m_compareRole, TYPE_SSL); //set type to 1 for custom popup menu
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "FriendsDialog::insertPeers() inserting sslItem." << std::endl; std::cerr << "FriendsDialog::insertPeers() inserting sslItem." << std::endl;
#endif #endif
@ -1153,12 +1153,12 @@ void FriendsDialog::exportfriend()
{ {
QTreeWidgetItem *c = getCurrentPeer(); QTreeWidgetItem *c = getCurrentPeer();
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "FriendsDialog::exportfriend()" << std::endl; std::cerr << "FriendsDialog::exportfriend()" << std::endl;
#endif #endif
if (!c) if (!c)
{ {
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "FriendsDialog::exportfriend() None Selected -- sorry" << std::endl; std::cerr << "FriendsDialog::exportfriend() None Selected -- sorry" << std::endl;
#endif #endif
return; return;
@ -1168,8 +1168,8 @@ void FriendsDialog::exportfriend()
if (misc::getSaveFileName(this, RshareSettings::LASTDIR_CERT, tr("Save Certificate"), tr("Certificates (*.pqi)"), fileName)) if (misc::getSaveFileName(this, RshareSettings::LASTDIR_CERT, tr("Save Certificate"), tr("Certificates (*.pqi)"), fileName))
{ {
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "FriendsDialog::exportfriend() Saving to: " << file << std::endl; std::cerr << "FriendsDialog::exportfriend() Saving to: " << fileName.toStdString() << std::endl;
#endif #endif
if (rsPeers) if (rsPeers)
{ {
@ -1248,13 +1248,13 @@ QTreeWidgetItem *FriendsDialog::getCurrentPeer()
QTreeWidgetItem *item = peerWidget -> currentItem(); QTreeWidgetItem *item = peerWidget -> currentItem();
if (!item) if (!item)
{ {
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "Invalid Current Item" << std::endl; std::cerr << "Invalid Current Item" << std::endl;
#endif #endif
return NULL; return NULL;
} }
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
/* Display the columns of this item. */ /* Display the columns of this item. */
std::ostringstream out; std::ostringstream out;
out << "CurrentPeerItem: " << std::endl; out << "CurrentPeerItem: " << std::endl;
@ -1284,12 +1284,12 @@ QTreeWidgetItem *FriendsDialog::getCurrentPeer()
void FriendsDialog::removefriend() void FriendsDialog::removefriend()
{ {
QTreeWidgetItem *c = getCurrentPeer(); QTreeWidgetItem *c = getCurrentPeer();
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "FriendsDialog::removefriend()" << std::endl; std::cerr << "FriendsDialog::removefriend()" << std::endl;
#endif #endif
if (!c) if (!c)
{ {
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "FriendsDialog::removefriend() None Selected -- sorry" << std::endl; std::cerr << "FriendsDialog::removefriend() None Selected -- sorry" << std::endl;
#endif #endif
return; return;
@ -1302,7 +1302,6 @@ void FriendsDialog::removefriend()
rsPeers->removeFriend(getPeerRsCertId(c)); rsPeers->removeFriend(getPeerRsCertId(c));
emit friendsUpdated() ; emit friendsUpdated() ;
} }
else
return; return;
} }
} }
@ -1310,12 +1309,12 @@ void FriendsDialog::removefriend()
void FriendsDialog::connectfriend() void FriendsDialog::connectfriend()
{ {
QTreeWidgetItem *c = getCurrentPeer(); QTreeWidgetItem *c = getCurrentPeer();
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "FriendsDialog::connectfriend()" << std::endl; std::cerr << "FriendsDialog::connectfriend()" << std::endl;
#endif #endif
if (!c) if (!c)
{ {
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "FriendsDialog::connectfriend() Noone Selected -- sorry" << std::endl; std::cerr << "FriendsDialog::connectfriend() Noone Selected -- sorry" << std::endl;
#endif #endif
return; return;
@ -1366,7 +1365,7 @@ void FriendsDialog::addFriend()
void FriendsDialog::resetStatusBar() void FriendsDialog::resetStatusBar()
{ {
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "FriendsDialog: reseting status bar." << std::endl ; std::cerr << "FriendsDialog: reseting status bar." << std::endl ;
#endif #endif
@ -1377,7 +1376,7 @@ void FriendsDialog::updateStatusTyping()
{ {
if(time(NULL) - last_status_send_time > 5) // limit 'peer is typing' packets to at most every 10 sec if(time(NULL) - last_status_send_time > 5) // limit 'peer is typing' packets to at most every 10 sec
{ {
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "FriendsDialog: sending group chat typing info." << std::endl ; std::cerr << "FriendsDialog: sending group chat typing info." << std::endl ;
#endif #endif
@ -1394,7 +1393,7 @@ void FriendsDialog::updateStatusTyping()
// //
void FriendsDialog::updateStatusString(const QString& peer_id, const QString& status_string) void FriendsDialog::updateStatusString(const QString& peer_id, const QString& status_string)
{ {
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "FriendsDialog: received group chat typing info. updating gui." << std::endl ; std::cerr << "FriendsDialog: received group chat typing info. updating gui." << std::endl ;
#endif #endif
@ -1406,7 +1405,7 @@ void FriendsDialog::updateStatusString(const QString& peer_id, const QString& st
void FriendsDialog::updatePeersAvatar(const QString& peer_id) void FriendsDialog::updatePeersAvatar(const QString& peer_id)
{ {
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "FriendsDialog: Got notified of new avatar for peer " << peer_id.toStdString() << std::endl ; std::cerr << "FriendsDialog: Got notified of new avatar for peer " << peer_id.toStdString() << std::endl ;
#endif #endif
@ -1427,7 +1426,7 @@ void FriendsDialog::updatePeerStatusString(const QString& peer_id,const QString&
} }
else else
{ {
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "Updating public chat msg from peer " << rsPeers->getPeerName(peer_id.toStdString()) << ": " << status_string.toStdString() << std::endl ; std::cerr << "Updating public chat msg from peer " << rsPeers->getPeerName(peer_id.toStdString()) << ": " << status_string.toStdString() << std::endl ;
#endif #endif
@ -1475,12 +1474,12 @@ void FriendsDialog::insertChat()
std::list<ChatInfo> newchat; std::list<ChatInfo> newchat;
if (!rsMsgs->getPublicChatQueue(newchat)) if (!rsMsgs->getPublicChatQueue(newchat))
{ {
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "no chat available." << std::endl ; std::cerr << "no chat available." << std::endl ;
#endif #endif
return; return;
} }
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "got new chat." << std::endl; std::cerr << "got new chat." << std::endl;
#endif #endif
std::list<ChatInfo>::iterator it; std::list<ChatInfo>::iterator it;
@ -1500,8 +1499,8 @@ void FriendsDialog::insertChat()
QString name = QString::fromStdString(rsPeers->getPeerName(it->rsid)); QString name = QString::fromStdString(rsPeers->getPeerName(it->rsid));
QString msg = QString::fromStdWString(it->msg); QString msg = QString::fromStdWString(it->msg);
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "FriendsDialog::insertChat(): " << msg << std::endl; std::cerr << "FriendsDialog::insertChat(): " << msg.toStdString() << std::endl;
#endif #endif
bool incoming = false; bool incoming = false;
@ -1570,8 +1569,8 @@ void FriendsDialog::sendMsg()
std::wstring message = lineWidget->toHtml().toStdWString(); std::wstring message = lineWidget->toHtml().toStdWString();
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::string msg(ci.msg.begin(), ci.msg.end()); std::string msg(message.begin(), message.end());
std::cerr << "FriendsDialog::sendMsg(): " << msg << std::endl; std::cerr << "FriendsDialog::sendMsg(): " << msg << std::endl;
#endif #endif
@ -1660,7 +1659,7 @@ void FriendsDialog::insertSendList()
//void FriendsDialog::toggleSendItem( QTreeWidgetItem *item, int col ) //void FriendsDialog::toggleSendItem( QTreeWidgetItem *item, int col )
//{ //{
// #ifdef PEERS_DEBUG //#ifdef FRIENDS_DEBUG
// std::cerr << "ToggleSendItem()" << std::endl; // std::cerr << "ToggleSendItem()" << std::endl;
//#endif //#endif
// //
@ -1792,7 +1791,7 @@ void FriendsDialog::updateAvatar()
rsMsgs->getOwnAvatarData(data,size); rsMsgs->getOwnAvatarData(data,size);
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "Image size = " << size << std::endl ; std::cerr << "Image size = " << size << std::endl ;
#endif #endif
@ -1817,7 +1816,7 @@ void FriendsDialog::getAvatar()
QPixmap picture; QPixmap picture;
picture = QPixmap(fileName).scaled(96,96, Qt::IgnoreAspectRatio,Qt::SmoothTransformation); picture = QPixmap(fileName).scaled(96,96, Qt::IgnoreAspectRatio,Qt::SmoothTransformation);
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "Sending avatar image down the pipe" << std::endl ; std::cerr << "Sending avatar image down the pipe" << std::endl ;
#endif #endif
@ -1827,7 +1826,7 @@ void FriendsDialog::getAvatar()
buffer.open(QIODevice::WriteOnly); buffer.open(QIODevice::WriteOnly);
picture.save(&buffer, "PNG"); // writes image into ba in PNG format picture.save(&buffer, "PNG"); // writes image into ba in PNG format
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "Image size = " << ba.size() << std::endl ; std::cerr << "Image size = " << ba.size() << std::endl ;
#endif #endif
@ -1908,7 +1907,7 @@ void FriendsDialog::fileHashingFinished(AttachFileItem* file)
//check that the file is ok tos end //check that the file is ok tos end
if (file->getState() == AFI_STATE_ERROR) { if (file->getState() == AFI_STATE_ERROR) {
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "PopupChatDialog::fileHashingFinished error file is not hashed." << std::endl; std::cerr << "PopupChatDialog::fileHashingFinished error file is not hashed." << std::endl;
#endif #endif
return; return;
@ -1927,8 +1926,8 @@ void FriendsDialog::fileHashingFinished(AttachFileItem* file)
// std::string mesgString = "<a href='retroshare://file|" + (file->FileName()) + "|" + fileSize + "|" + (file->FileHash()) + "'>" // std::string mesgString = "<a href='retroshare://file|" + (file->FileName()) + "|" + fileSize + "|" + (file->FileHash()) + "'>"
// + "retroshare://file|" + (file->FileName()) + "|" + fileSize + "|" + (file->FileHash()) + "</a>"; // + "retroshare://file|" + (file->FileName()) + "|" + fileSize + "|" + (file->FileHash()) + "</a>";
#ifdef PEERS_DEBUG #ifdef FRIENDS_DEBUG
std::cerr << "FriendsDialog::fileHashingFinished mesgString : " << mesgString << std::endl; std::cerr << "FriendsDialog::fileHashingFinished mesgString : " << mesgString.toStdString() << std::endl;
#endif #endif
/* convert to real html document */ /* convert to real html document */

View File

@ -62,12 +62,12 @@
#define IMAGE_STAR_OFF ":/images/star-off-16.png" #define IMAGE_STAR_OFF ":/images/star-off-16.png"
#define COLUMN_COUNT 8 #define COLUMN_COUNT 8
#define COLUMN_ATTACHEMENTS 0 #define COLUMN_STAR 0
#define COLUMN_SUBJECT 1 #define COLUMN_ATTACHEMENTS 1
#define COLUMN_UNREAD 2 #define COLUMN_SUBJECT 2
#define COLUMN_FROM 3 #define COLUMN_UNREAD 3
#define COLUMN_DATE 4 #define COLUMN_FROM 4
#define COLUMN_STAR 5 #define COLUMN_DATE 5
#define COLUMN_CONTENT 6 #define COLUMN_CONTENT 6
#define COLUMN_TAGS 7 #define COLUMN_TAGS 7
@ -361,7 +361,7 @@ MessagesDialog::~MessagesDialog()
void MessagesDialog::processSettings(bool bLoad) void MessagesDialog::processSettings(bool bLoad)
{ {
int messageTreeVersion = 1; // version number for the settings to solve problems when modifying the column count int messageTreeVersion = 2; // version number for the settings to solve problems when modifying the column count
m_bProcessSettings = true; m_bProcessSettings = true;