restored open messenger to main window left hand panel

replaced messenger peer icons with avatars




git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2735 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2010-04-20 08:42:45 +00:00
parent 38463c905e
commit ab477885c3
3 changed files with 490 additions and 469 deletions

View File

@ -115,11 +115,6 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags)
connect(ui.messagelineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(savestatusmessage())); connect(ui.messagelineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(savestatusmessage()));
QTimer *timer = new QTimer(this);
timer->connect(timer, SIGNAL(timeout()), this, SLOT(savestatus()));
timer->start(1000); /* one second */
/* to hide the header */ /* to hide the header */
ui.messengertreeWidget->header()->hide(); ui.messengertreeWidget->header()->hide();
@ -165,6 +160,7 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags)
#endif #endif
} }
void MessengerWindow::messengertreeWidgetCostumPopupMenu( QPoint point ) void MessengerWindow::messengertreeWidgetCostumPopupMenu( QPoint point )
{ {
QTreeWidgetItem *c = getCurrentPeer(); QTreeWidgetItem *c = getCurrentPeer();
@ -457,7 +453,6 @@ void MessengerWindow::insertPeers()
} }
} }
RsPeerDetails ssl_details;
int i = 0; int i = 0;
if (gpg_connected) { if (gpg_connected) {
@ -466,13 +461,35 @@ void MessengerWindow::insertPeers()
std::list<StatusInfo>::iterator it = statusInfo.begin(); std::list<StatusInfo>::iterator it = statusInfo.begin();
for(; it != statusInfo.end() ; it++){ for(; it != statusInfo.end() ; it++){
rsPeers->getPeerDetails(it->id, ssl_details);
if(detail.id == ssl_details.gpg_id){ std::list<std::string>::iterator cont_it = sslContacts.begin();
// don't forget the kids
for(; cont_it != sslContacts.end(); cont_it++){
if((it->id == *cont_it) && (rsPeers->isOnline(*cont_it))){
std::string status; std::string status;
rsStatus->getStatusString(it->status, status); rsStatus->getStatusString(it->status, status);
gpg_item -> setText(1, QString::fromStdString(status)); gpg_item -> setText(1, QString::fromStdString(status));
unsigned char *data = NULL;
int size = 0 ;
rsMsgs->getAvatarData(it->id ,data,size);
if(size != 0){
QPixmap avatar ;
avatar.loadFromData(data,size,"PNG") ;
QIcon avatar_icon(avatar);
QSize av_icon_size(100, 100);
gpg_item-> setIcon(0, avatar_icon);
delete[] data;
}else
if(it->status == RS_STATUS_ONLINE) if(it->status == RS_STATUS_ONLINE)
gpg_item -> setIcon(0,(QIcon(IMAGE_ONLINE))); gpg_item -> setIcon(0,(QIcon(IMAGE_ONLINE)));
else else
@ -481,7 +498,7 @@ void MessengerWindow::insertPeers()
else else
if(it->status == RS_STATUS_BUSY) if(it->status == RS_STATUS_BUSY)
gpg_item -> setIcon(0,(QIcon(IMAGE_BUSY))); gpg_item -> setIcon(0,(QIcon(IMAGE_BUSY)));
}
} }
} }

View File

@ -29,6 +29,7 @@
#include <gui/settings/rsharesettings.h> #include <gui/settings/rsharesettings.h>
#include <gui/common/rwindow.h> #include <gui/common/rwindow.h>
#include "chat/PopupChatDialog.h" #include "chat/PopupChatDialog.h"
#include "RsAutoUpdatePage.h"
class LogoBar; class LogoBar;

View File

@ -368,8 +368,8 @@ stop:0 #FEFEFE, stop:1 #E8E8E8);
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
<width>18</width> <width>40</width>
<height>18</height> <height>40</height>
</size> </size>
</property> </property>
<property name="indentation"> <property name="indentation">
@ -381,6 +381,9 @@ stop:0 #FEFEFE, stop:1 #E8E8E8);
<attribute name="headerShowSortIndicator" stdset="0"> <attribute name="headerShowSortIndicator" stdset="0">
<bool>false</bool> <bool>false</bool>
</attribute> </attribute>
<attribute name="headerShowSortIndicator" stdset="0">
<bool>false</bool>
</attribute>
</widget> </widget>
</item> </item>
</layout> </layout>
@ -394,7 +397,7 @@ stop:0 #FEFEFE, stop:1 #E8E8E8);
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>295</width> <width>295</width>
<height>27</height> <height>21</height>
</rect> </rect>
</property> </property>
</widget> </widget>