diff --git a/retroshare-gui/src/gui/MessengerWindow.cpp b/retroshare-gui/src/gui/MessengerWindow.cpp index b7e8856cd..a31126035 100644 --- a/retroshare-gui/src/gui/MessengerWindow.cpp +++ b/retroshare-gui/src/gui/MessengerWindow.cpp @@ -96,7 +96,7 @@ void MessengerWindow::releaseInstance() /** Constructor */ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags) -: RWindow("MessengerWindow", parent, flags) + : RWindow("MessengerWindow", parent, flags) { /* Invoke the Qt Designer generated object setup routine */ ui.setupUi(this); @@ -115,11 +115,6 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags) 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 */ ui.messengertreeWidget->header()->hide(); @@ -165,6 +160,7 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags) #endif } + void MessengerWindow::messengertreeWidgetCostumPopupMenu( QPoint point ) { QTreeWidgetItem *c = getCurrentPeer(); @@ -457,7 +453,6 @@ void MessengerWindow::insertPeers() } } - RsPeerDetails ssl_details; int i = 0; if (gpg_connected) { @@ -466,23 +461,45 @@ void MessengerWindow::insertPeers() std::list::iterator it = statusInfo.begin(); - for(; it != statusInfo.end(); it++){ - rsPeers->getPeerDetails(it->id, ssl_details); - if(detail.id == ssl_details.gpg_id){ + + for(; it != statusInfo.end() ; it++){ + + std::list::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; rsStatus->getStatusString(it->status, status); gpg_item -> setText(1, QString::fromStdString(status)); - if(it->status == RS_STATUS_ONLINE) - gpg_item -> setIcon(0,(QIcon(IMAGE_ONLINE))); - else - if(it->status == RS_STATUS_AWAY) - gpg_item -> setIcon(0,(QIcon(IMAGE_AWAY))); - else - if(it->status == RS_STATUS_BUSY) - gpg_item -> setIcon(0,(QIcon(IMAGE_BUSY))); + 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) + gpg_item -> setIcon(0,(QIcon(IMAGE_ONLINE))); + else + if(it->status == RS_STATUS_AWAY) + gpg_item -> setIcon(0,(QIcon(IMAGE_AWAY))); + else + if(it->status == RS_STATUS_BUSY) + gpg_item -> setIcon(0,(QIcon(IMAGE_BUSY))); } + } } diff --git a/retroshare-gui/src/gui/MessengerWindow.h b/retroshare-gui/src/gui/MessengerWindow.h index fc3027dfe..ca17ede69 100644 --- a/retroshare-gui/src/gui/MessengerWindow.h +++ b/retroshare-gui/src/gui/MessengerWindow.h @@ -29,6 +29,7 @@ #include #include #include "chat/PopupChatDialog.h" +#include "RsAutoUpdatePage.h" class LogoBar; diff --git a/retroshare-gui/src/gui/MessengerWindow.ui b/retroshare-gui/src/gui/MessengerWindow.ui index 0b0faa90d..654d65c20 100644 --- a/retroshare-gui/src/gui/MessengerWindow.ui +++ b/retroshare-gui/src/gui/MessengerWindow.ui @@ -1,451 +1,454 @@ - - - MessengerWindow - - - - 0 - 0 - 295 - 507 - - - - RetroShare Messenger - - - - :/images/rstray3.png:/images/rstray3.png - - - - - 0 - - - 0 - - - - - #messengerframetop { -border: none; -background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, -stop: 0 #a6a6a6, stop: 0.08 #7f7f7f, -stop: 0.39999 #717171, stop: 0.4 #626262, -stop: 0.9 #4c4c4c, stop: 1 #333333); -} - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 6 - - - 6 - - - 6 - - - 2 - - - 0 - - - - - - - - 70 - 70 - - - - - 70 - 70 - - - - Click to Change your Avatar - - - QToolButton#avatarButton{border-image: url(:/images/mystatus_bg.png);} - - - - :/images/user/personal64.png:/images/user/personal64.png - - - - 50 - 50 - - - - true - - - - - - - 4 - - - 6 - - - - - true - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Change your Status and your display</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">picture here.</p></body></html> - - - QComboBox::NoInsert - - - true - - - 0 - - - - Online - - - - :/images/im-user.png:/images/im-user.png - - - - - Busy - - - - :/images/im-user-busy.png:/images/im-user-busy.png - - - - - Away - - - - :/images/im-user-away.png:/images/im-user-away.png - - - - - - - - Change your Personal Status here... - - - border: 1px solid #CCCCCC; - - - - - - - TextLabel - - - - - - - - - - - - - - - 16777215 - 38 - - - - #frame { -border-image:none; -background-color: qlineargradient(x1: 0, y1: 0, x2: 0.0, y2: 1.0, -stop: 0 #ffffff, -stop: 0.4 #eeeeee, -stop: 0.401 #e2e2e2, -stop: 1 #dddddd); -color: #CCCCCC; -border-top: 1px solid #606060; -border-bottom: 1px solid #CCCCCC; -} - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 6 - - - - - - 0 - 0 - - - - - 32 - 32 - - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Add a Friend</p></body></html> - - - - - - - :/images/user/add_user24.png:/images/user/add_user24.png - - - - 24 - 24 - - - - Qt::ToolButtonTextBesideIcon - - - true - - - - - - - - 0 - 0 - - - - Share Files for your Friends - - - - - - ... - - - - :/images/friendsfolder24.png:/images/friendsfolder24.png - - - - 24 - 24 - - - - true - - - - - - - QPushButton::menu-indicator { -subcontrol-origin: padding; -subcontrol-position: bottom right; -} - - - - - - - - - :/images/looknfeel.png:/images/looknfeel.png - - - - 24 - 24 - - - - true - - - - - - - Qt::Horizontal - - - - 161 - 20 - - - - - - - - - - - QFrame#logoframe{ -background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, -stop:0 #FEFEFE, stop:1 #E8E8E8); - -border: 1px solid #CCCCCC;} - - - QFrame::NoFrame - - - QFrame::Raised - - - - - - - QFrame#frame_2{ -background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, -stop:0 #FEFEFE, stop:1 #E8E8E8); -} - - - - 9 - - - 6 - - - - - Qt::CustomContextMenu - - - border: 1px solid #CCCCCC; - - - - 18 - 18 - - - - 22 - - - 0 - - - false - - - - - - - - - - - - 0 - 0 - 295 - 27 - - - - - - - :/images/sort_decrease.png:/images/sort_decrease.png - - - Sort Descending Order - - - Sort Descending Order - - - - - - :/images/sort_incr.png:/images/sort_incr.png - - - Sort Ascending Order - - - Sort Ascending Order - - - - - Set root is Decorated - - - Set Root Decorated - - - - - Set Root is not Decorated - - - - - true - - - Hide Offline Friends - - - - - - - - + + + MessengerWindow + + + + 0 + 0 + 295 + 507 + + + + RetroShare Messenger + + + + :/images/rstray3.png:/images/rstray3.png + + + + + 0 + + + 0 + + + + + #messengerframetop { +border: none; +background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, +stop: 0 #a6a6a6, stop: 0.08 #7f7f7f, +stop: 0.39999 #717171, stop: 0.4 #626262, +stop: 0.9 #4c4c4c, stop: 1 #333333); +} + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 6 + + + 6 + + + 6 + + + 2 + + + 0 + + + + + + + + 70 + 70 + + + + + 70 + 70 + + + + Click to Change your Avatar + + + QToolButton#avatarButton{border-image: url(:/images/mystatus_bg.png);} + + + + :/images/user/personal64.png:/images/user/personal64.png + + + + 50 + 50 + + + + true + + + + + + + 4 + + + 6 + + + + + true + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Change your Status and your display</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">picture here.</p></body></html> + + + QComboBox::NoInsert + + + true + + + 0 + + + + Online + + + + :/images/im-user.png:/images/im-user.png + + + + + Busy + + + + :/images/im-user-busy.png:/images/im-user-busy.png + + + + + Away + + + + :/images/im-user-away.png:/images/im-user-away.png + + + + + + + + Change your Personal Status here... + + + border: 1px solid #CCCCCC; + + + + + + + TextLabel + + + + + + + + + + + + + + + 16777215 + 38 + + + + #frame { +border-image:none; +background-color: qlineargradient(x1: 0, y1: 0, x2: 0.0, y2: 1.0, +stop: 0 #ffffff, +stop: 0.4 #eeeeee, +stop: 0.401 #e2e2e2, +stop: 1 #dddddd); +color: #CCCCCC; +border-top: 1px solid #606060; +border-bottom: 1px solid #CCCCCC; +} + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 6 + + + + + + 0 + 0 + + + + + 32 + 32 + + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Add a Friend</p></body></html> + + + + + + + :/images/user/add_user24.png:/images/user/add_user24.png + + + + 24 + 24 + + + + Qt::ToolButtonTextBesideIcon + + + true + + + + + + + + 0 + 0 + + + + Share Files for your Friends + + + + + + ... + + + + :/images/friendsfolder24.png:/images/friendsfolder24.png + + + + 24 + 24 + + + + true + + + + + + + QPushButton::menu-indicator { +subcontrol-origin: padding; +subcontrol-position: bottom right; +} + + + + + + + + + :/images/looknfeel.png:/images/looknfeel.png + + + + 24 + 24 + + + + true + + + + + + + Qt::Horizontal + + + + 161 + 20 + + + + + + + + + + + QFrame#logoframe{ +background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, +stop:0 #FEFEFE, stop:1 #E8E8E8); + +border: 1px solid #CCCCCC;} + + + QFrame::NoFrame + + + QFrame::Raised + + + + + + + QFrame#frame_2{ +background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, +stop:0 #FEFEFE, stop:1 #E8E8E8); +} + + + + 9 + + + 6 + + + + + Qt::CustomContextMenu + + + border: 1px solid #CCCCCC; + + + + 40 + 40 + + + + 22 + + + 0 + + + false + + + false + + + + + + + + + + + + 0 + 0 + 295 + 21 + + + + + + + :/images/sort_decrease.png:/images/sort_decrease.png + + + Sort Descending Order + + + Sort Descending Order + + + + + + :/images/sort_incr.png:/images/sort_incr.png + + + Sort Ascending Order + + + Sort Ascending Order + + + + + Set root is Decorated + + + Set Root Decorated + + + + + Set Root is not Decorated + + + + + true + + + Hide Offline Friends + + + + + + + +