show in people - enabled for yourself; Votes in tooltip; lastpost 1970 to Never

This commit is contained in:
RetroPooh 2017-01-11 22:44:27 +03:00
parent 0dd63b3ba6
commit 36dbdee409
6 changed files with 26 additions and 19 deletions

View File

@ -239,7 +239,7 @@ void ChatLobbyDialog::participantsTreeWidgetCustomPopupMenu(QPoint)
votePositiveAct->setEnabled(false);
voteNeutralAct->setEnabled(false);
banAct->setEnabled(false);
showinpeopleAct->setEnabled(false);
showinpeopleAct->setEnabled(true);
if (selectedItems.size())
{
@ -252,7 +252,6 @@ void ChatLobbyDialog::participantsTreeWidgetCustomPopupMenu(QPoint)
votePositiveAct->setEnabled(true);
voteNeutralAct->setEnabled(true);
banAct->setEnabled(true);
showinpeopleAct->setEnabled(true);
QList<QTreeWidgetItem*>::iterator item;
for (item = selectedItems.begin(); item != selectedItems.end(); ++item) {
@ -312,12 +311,8 @@ void ChatLobbyDialog::showInPeopleTab()
QList<QTreeWidgetItem*> selectedItems = ui.participantsList->selectedItems();
if (selectedItems.count()!=1)
return;
QList<QTreeWidgetItem*>::iterator item;
RsGxsId nickname;
for (item = selectedItems.begin(); item != selectedItems.end(); ++item)
{
dynamic_cast<GxsIdRSTreeWidgetItem*>(*item)->getId(nickname) ;
}
dynamic_cast<GxsIdRSTreeWidgetItem*>(*selectedItems.begin())->getId(nickname);
IdDialog *idDialog = dynamic_cast<IdDialog*>(MainWindow::getPage(MainWindow::People));
if (!idDialog)
return ;

View File

@ -480,7 +480,10 @@ void GroupTreeWidget::fillGroupItems(QTreeWidgetItem *categoryItem, const QList<
if(!IS_GROUP_SUBSCRIBED(itemInfo.subscribeFlags))
tooltip += "\n" + QString::number(itemInfo.max_visible_posts) + " messages available" ;
// if(itemInfo.max_visible_posts) // wtf? this=0 when there are some posts definitely exist - lastpost is recent
tooltip += "\n" + tr("Last Post") + ": " + DateTime::formatLongDateTime(itemInfo.lastpost) ;
if(itemInfo.lastpost == QDateTime::fromTime_t(0))
tooltip += "\n" + tr("Last Post") + ": " + tr("Never") ;
else
tooltip += "\n" + tr("Last Post") + ": " + DateTime::formatLongDateTime(itemInfo.lastpost) ;
if(!IS_GROUP_SUBSCRIBED(itemInfo.subscribeFlags))
tooltip += "\n" + tr("Subscribe to download and read messages") ;

View File

@ -416,7 +416,10 @@ void GxsGroupDialog::updateFromExistingMeta(const QString &description)
ui.nameline->setText(QString::fromUtf8(mGrpMeta.mGroupName.c_str()));
ui.popline->setText(QString::number( mGrpMeta.mPop)) ;
ui.postsline->setText(QString::number(mGrpMeta.mVisibleMsgCount));
ui.lastpostline->setText(DateTime::formatLongDateTime(mGrpMeta.mLastPost));
if(mGrpMeta.mLastPost==0)
ui.lastpostline->setText(tr("Never"));
else
ui.lastpostline->setText(DateTime::formatLongDateTime(mGrpMeta.mLastPost));
ui.authorLabel->setId(mGrpMeta.mAuthorId);
ui.IDline->setText(QString::fromStdString(mGrpMeta.mGroupId.toStdString()));
ui.descriptiontextEdit->setPlainText(description);

View File

@ -991,9 +991,12 @@ QString nickname ;
else
comment += QString("<br/>%1:&nbsp;%2").arg(QApplication::translate("GxsIdDetails", "Authentication"), QApplication::translate("GxsIdDetails", "anonymous"));
if(details.mReputation.mFriendsPositiveVotes > 0) comment += "<br/><b>+" + QString::number(details.mReputation.mFriendsPositiveVotes) + "</b>";
if(details.mReputation.mFriendsNegativeVotes > 0) comment += "<br/><b>-" + QString::number(details.mReputation.mFriendsNegativeVotes) + "</b>";
if(details.mReputation.mFriendsPositiveVotes || details.mReputation.mFriendsNegativeVotes)
{
comment += "<br/>Votes:";
if(details.mReputation.mFriendsPositiveVotes > 0) comment += " <b>+" + QString::number(details.mReputation.mFriendsPositiveVotes) + "</b>";
if(details.mReputation.mFriendsNegativeVotes > 0) comment += " <b>-" + QString::number(details.mReputation.mFriendsNegativeVotes) + "</b>";
}
return comment;
}

View File

@ -266,12 +266,12 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
ui->infoPosts->clear();
ui->infoDescription->clear();
} else {
ui->infoPosts->setText(QString::number(group.mMeta.mVisibleMsgCount));
ui->infoLastPost->setText(DateTime::formatLongDateTime(group.mMeta.mLastPost));
ui->infoDescription->setText(QString::fromUtf8(group.mDescription.c_str()));
ui->infoPosts->setText(QString::number(group.mMeta.mVisibleMsgCount));
if(group.mMeta.mLastPost==0)
ui->infoLastPost->setText(tr("Never"));
else
ui->infoLastPost->setText(DateTime::formatLongDateTime(group.mMeta.mLastPost));
ui->infoDescription->setText(QString::fromUtf8(group.mDescription.c_str()));
ui->infoAdministrator->setId(group.mMeta.mAuthorId) ;

View File

@ -879,7 +879,10 @@ static QString getDurationString(uint32_t days)
tw->mForumDescription = QString("<b>%1: \t</b>%2<br/>").arg(tr("Forum name"), QString::fromUtf8( group.mMeta.mGroupName.c_str()));
tw->mForumDescription += QString("<b>%1: \t</b>%2<br/>").arg(tr("Subscribers")).arg(group.mMeta.mPop);
tw->mForumDescription += QString("<b>%1: \t</b>%2<br/>").arg(tr("Posts (at neighbor nodes)")).arg(group.mMeta.mVisibleMsgCount);
tw->mForumDescription += QString("<b>%1: \t</b>%2<br/>").arg(tr("Last post")).arg(DateTime::formatLongDateTime(group.mMeta.mLastPost));
if(group.mMeta.mLastPost==0)
tw->mForumDescription += QString("<b>%1: \t</b>%2<br/>").arg(tr("Last post")).arg(tr("Never"));
else
tw->mForumDescription += QString("<b>%1: \t</b>%2<br/>").arg(tr("Last post")).arg(DateTime::formatLongDateTime(group.mMeta.mLastPost));
tw->mForumDescription += QString("<b>%1: \t</b>%2<br/>").arg(tr("Synchronization")).arg(getDurationString( rsGxsForums->getSyncPeriod(group.mMeta.mGroupId)/86400 )) ;
tw->mForumDescription += QString("<b>%1: \t</b>%2<br/>").arg(tr("Storage")).arg(getDurationString( rsGxsForums->getStoragePeriod(group.mMeta.mGroupId)/86400));