mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-19 14:30:43 -04:00
added display of usage statistics for GXS identities
This commit is contained in:
parent
ef0850e65b
commit
d3051eff1a
9 changed files with 85 additions and 17 deletions
|
@ -1849,6 +1849,24 @@ void IdDialog::insertIdDetails(uint32_t token)
|
|||
default:
|
||||
std::cerr << "Unexpected value in own opinion: " << info.mOwnOpinion << std::endl;
|
||||
}
|
||||
|
||||
// now fill in usage cases
|
||||
|
||||
RsIdentityDetails det ;
|
||||
rsIdentity->getIdDetails(RsGxsId(data.mMeta.mGroupId),det) ;
|
||||
|
||||
QString usage_txt ;
|
||||
std::map<time_t,std::string> rmap ;
|
||||
for(std::map<std::string,time_t>::const_iterator it(det.mUseCases.begin());it!=det.mUseCases.end();++it)
|
||||
rmap.insert(std::make_pair(it->second,it->first)) ;
|
||||
|
||||
for(std::map<time_t,std::string>::const_iterator it(rmap.begin());it!=rmap.end();++it)
|
||||
usage_txt += QString("<b>")+ getHumanReadableDuration(now - data.mLastUsageTS) + "</b> \t: " + QString::fromStdString(it->second) + "<br/>" ;
|
||||
|
||||
if(usage_txt.isNull())
|
||||
usage_txt = tr("<b>[Unused]</b>") ;
|
||||
|
||||
ui->usageStatistics_TB->setText(usage_txt) ;
|
||||
}
|
||||
|
||||
void IdDialog::modifyReputation()
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1269</width>
|
||||
<height>911</height>
|
||||
<height>1040</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -595,6 +595,18 @@ p, li { white-space: pre-wrap; }
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Usage statistics</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="usageStatistics_TB"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="reputationVSpacer">
|
||||
<property name="orientation">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue