mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
update display of the profilewidget tab in peersdialog
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2087 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
0b736d9f28
commit
2f13d31725
@ -297,7 +297,16 @@ void PeersDialog::keyPressEvent(QKeyEvent *e)
|
|||||||
|
|
||||||
void PeersDialog::updateDisplay()
|
void PeersDialog::updateDisplay()
|
||||||
{
|
{
|
||||||
insertPeers() ;
|
// add self nick and Avatar to Friends.
|
||||||
|
RsPeerDetails pd ;
|
||||||
|
if (rsPeers->getPeerDetails(rsPeers->getOwnId(),pd)) {
|
||||||
|
QString titleStr("<span style=\"font-size:16pt; font-weight:500;"
|
||||||
|
"color:#32cd32;\">%1</span>");
|
||||||
|
ui.nicklabel->setText(titleStr.arg(QString::fromStdString(pd.name) + tr(" (me)") + QString::fromStdString(pd.location))) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
insertPeers() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the list of peers from the RsIface. */
|
/* get the list of peers from the RsIface. */
|
||||||
@ -308,6 +317,7 @@ void PeersDialog::insertPeers()
|
|||||||
|
|
||||||
if (!rsPeers) {
|
if (!rsPeers) {
|
||||||
/* not ready yet! */
|
/* not ready yet! */
|
||||||
|
std::cerr << "PeersDialog::insertPeers() not ready yet : rsPeers unintialized." << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,14 +333,6 @@ void PeersDialog::insertPeers()
|
|||||||
/* get a link to the table */
|
/* get a link to the table */
|
||||||
QTreeWidget *peertreeWidget = ui.peertreeWidget;
|
QTreeWidget *peertreeWidget = ui.peertreeWidget;
|
||||||
|
|
||||||
// add self nick and Avatar to Friends.
|
|
||||||
RsPeerDetails pd ;
|
|
||||||
if (rsPeers->getPeerDetails(rsPeers->getOwnId(),pd)) {
|
|
||||||
QString titleStr("<span style=\"font-size:16pt; font-weight:500;"
|
|
||||||
"color:#32cd32;\">%1</span>");
|
|
||||||
ui.nicklabel->setText(titleStr.arg(QString::fromStdString(pd.name) + tr(" (me)"))) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
//remove items that are not fiends anymore
|
//remove items that are not fiends anymore
|
||||||
int index = 0;
|
int index = 0;
|
||||||
while (index < peertreeWidget->topLevelItemCount()) {
|
while (index < peertreeWidget->topLevelItemCount()) {
|
||||||
|
@ -43,7 +43,7 @@ ProfileWidget::ProfileWidget(QWidget *parent, Qt::WFlags flags)
|
|||||||
|
|
||||||
connect(ui.editstatuspushButton,SIGNAL(clicked()), this, SLOT(statusmessagedlg()));
|
connect(ui.editstatuspushButton,SIGNAL(clicked()), this, SLOT(statusmessagedlg()));
|
||||||
|
|
||||||
loadDialog();
|
//loadDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Destructor. */
|
/** Destructor. */
|
||||||
@ -58,25 +58,25 @@ void ProfileWidget::closeEvent (QCloseEvent * event)
|
|||||||
QWidget::closeEvent(event);
|
QWidget::closeEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileWidget::loadDialog()
|
void ProfileWidget::showEvent ( QShowEvent * event )
|
||||||
{
|
{
|
||||||
|
|
||||||
RsPeerDetails detail;
|
RsPeerDetails detail;
|
||||||
if (rsPeers->getPeerDetails(rsPeers->getOwnId(),detail))
|
if (rsPeers->getPeerDetails(rsPeers->getOwnId(),detail))
|
||||||
{
|
{
|
||||||
|
|
||||||
ui.name->setText(QString::fromStdString(detail.name));
|
ui.name->setText(QString::fromStdString(detail.name));
|
||||||
ui.country->setText(QString::fromStdString(detail.location));
|
ui.country->setText(QString::fromStdString(detail.location));
|
||||||
|
|
||||||
ui.peerid->setText(QString::fromStdString(detail.id));
|
ui.peerid->setText(QString::fromStdString(detail.id));
|
||||||
|
|
||||||
// Dont Show a timestamp in RS calculate the day
|
// Dont Show a timestamp in RS calculate the day
|
||||||
QDateTime date = QDateTime::fromTime_t(detail.lastConnect);
|
QDateTime date = QDateTime::fromTime_t(detail.lastConnect);
|
||||||
QString stime = date.toString(Qt::LocalDate);
|
QString stime = date.toString(Qt::LocalDate);
|
||||||
|
|
||||||
/* set retroshare version */
|
/* set retroshare version */
|
||||||
std::map<std::string, std::string>::iterator vit;
|
std::map<std::string, std::string>::iterator vit;
|
||||||
std::map<std::string, std::string> versions;
|
std::map<std::string, std::string> versions;
|
||||||
bool retv = rsDisc->getDiscVersions(versions);
|
bool retv = rsDisc->getDiscVersions(versions);
|
||||||
if (retv && versions.end() != (vit = versions.find(detail.id)))
|
if (retv && versions.end() != (vit = versions.find(detail.id)))
|
||||||
{
|
{
|
||||||
|
@ -43,7 +43,7 @@ protected:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void loadDialog();
|
void showEvent ( QShowEvent * event );
|
||||||
void statusmessagedlg();
|
void statusmessagedlg();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user