From 3f752b9eae7f517746228579790a4b671e616862 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 11 Jun 2013 21:26:12 +0000 Subject: [PATCH] improved GUI for distant chat link management git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6425 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- .../src/gui/CreateMsgLinkDialog.cpp | 24 ++++++++++---- retroshare-gui/src/gui/CreateMsgLinkDialog.ui | 32 +++++++++---------- 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/retroshare-gui/src/gui/CreateMsgLinkDialog.cpp b/retroshare-gui/src/gui/CreateMsgLinkDialog.cpp index 77b60e1ed..e6eedd22a 100644 --- a/retroshare-gui/src/gui/CreateMsgLinkDialog.cpp +++ b/retroshare-gui/src/gui/CreateMsgLinkDialog.cpp @@ -68,12 +68,21 @@ void CreateMsgLinkDialog::updateCurrentRow(int r) std::cerr << "Parsing link : " << text.toString().toStdString() << std::endl; RetroShareLink link(text) ; - if( link.type() == RetroShareLink::TYPE_PRIVATE_CHAT ) - _current_link_type_LE->setText( tr("Private chat invite") ) ; - else - _current_link_type_LE->setText( tr("Public message invite") ) ; + RsPeerDetails detail ; + rsPeers->getPeerDetails(link.GPGId().toStdString(),detail) ; - _current_link_dst_LE->setText(link.GPGId()) ; + if( link.type() == RetroShareLink::TYPE_PRIVATE_CHAT ) + { + _current_link_type_LE->setText( tr("Private chat invite") ) ; + _usable_LB->setText(tr("Usable only by :")) ; + } + else + { + _current_link_type_LE->setText( tr("Public message invite") ) ; + _usable_LB->setText(tr("Usable to contact :")) ; + } + + _current_link_dst_LE->setText(QString::fromStdString(detail.name)+" ("+link.GPGId()+")") ; _current_link_date_DE->setDateTime(QDateTime::fromTime_t(link.timeStamp())) ; } @@ -117,8 +126,11 @@ void CreateMsgLinkDialog::update() continue; } + RsPeerDetails detail ; + rsPeers->getPeerDetails(link.GPGId().toStdString(),detail) ; + QListWidgetItem *item = new QListWidgetItem; - item->setData(Qt::DisplayRole,tr("Private chat invite to ")+QString::fromStdString(invites[i].destination_pgp_id)) ; + item->setData(Qt::DisplayRole,tr("Private chat invite to ")+QString::fromStdString(detail.name)+" ("+QString::fromStdString(invites[i].destination_pgp_id)+")") ; item->setData(Qt::UserRole,link.toString()) ; _existing_links_LW->insertItem(0,item) ; diff --git a/retroshare-gui/src/gui/CreateMsgLinkDialog.ui b/retroshare-gui/src/gui/CreateMsgLinkDialog.ui index d5a23d8c4..e484026d0 100644 --- a/retroshare-gui/src/gui/CreateMsgLinkDialog.ui +++ b/retroshare-gui/src/gui/CreateMsgLinkDialog.ui @@ -6,8 +6,8 @@ 0 0 - 565 - 465 + 590 + 388 @@ -47,7 +47,7 @@ - + Usable by: @@ -91,19 +91,6 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -213,6 +200,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + +