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

View File

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

View File

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

View File

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

View File

@ -267,10 +267,10 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
ui->infoDescription->clear(); ui->infoDescription->clear();
} else { } else {
ui->infoPosts->setText(QString::number(group.mMeta.mVisibleMsgCount)); 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->infoLastPost->setText(DateTime::formatLongDateTime(group.mMeta.mLastPost));
ui->infoDescription->setText(QString::fromUtf8(group.mDescription.c_str())); ui->infoDescription->setText(QString::fromUtf8(group.mDescription.c_str()));
ui->infoAdministrator->setId(group.mMeta.mAuthorId) ; ui->infoAdministrator->setId(group.mMeta.mAuthorId) ;

View File

@ -879,6 +879,9 @@ 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("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("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("Posts (at neighbor nodes)")).arg(group.mMeta.mVisibleMsgCount);
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("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("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)); tw->mForumDescription += QString("<b>%1: \t</b>%2<br/>").arg(tr("Storage")).arg(getDurationString( rsGxsForums->getStoragePeriod(group.mMeta.mGroupId)/86400));