Merge remote-tracking branch 'remotes/retroshare/master' into feature/msys2enhancements

This commit is contained in:
hunbernd 2020-06-19 22:48:43 +02:00
commit a5d23d0b3f
90 changed files with 2773 additions and 1593 deletions

View file

@ -340,6 +340,10 @@ void GenCertDialog::setupState()
ui.hiddenport_spinBox->setVisible(hidden_state && !tor_auto);
ui.cbUseBob->setVisible(hidden_state && !tor_auto);
#ifndef RS_USE_I2P_BOB
ui.cbUseBob->setDisabled(true);
ui.cbUseBob->setToolTip(tr("BOB support is not available"));
#endif
if(!mAllFieldsOk)
{

View file

@ -1575,6 +1575,14 @@ void IdDialog::loadIdentities(const std::map<RsGxsGroupId,RsGxsIdGroup>& ids_set
/* count items */
int itemCount = contactsItem->childCount() + allItem->childCount() + ownItem->childCount();
ui->label_count->setText( "(" + QString::number( itemCount ) + ")" );
int contactsCount = contactsItem->childCount() ;
int allCount = allItem->childCount() ;
int ownCount = ownItem->childCount();
contactsItem->setText(0, tr("My contacts") + " (" + QString::number( contactsCount ) + ")" );
allItem->setText(0, tr("All") + " (" + QString::number( allCount ) + ")" );
ownItem->setText(0, tr("My own identities") + " (" + QString::number( ownCount ) + ")" );
navigate(RsGxsId(oldCurrentId));
filterIds();

View file

@ -146,6 +146,8 @@ void PostedCardView::setup()
QAction *CopyLinkAction = new QAction(QIcon(""),tr("Copy RetroShare Link"), this);
connect(CopyLinkAction, SIGNAL(triggered()), this, SLOT(copyMessageLink()));
QAction *showInPeopleAct = new QAction(QIcon(), tr("Show author in people tab"), this);
connect(showInPeopleAct, SIGNAL(triggered()), this, SLOT(showAuthorInPeople()));
int S = QFontMetricsF(font()).height() ;
@ -157,6 +159,8 @@ void PostedCardView::setup()
QMenu *menu = new QMenu();
menu->addAction(CopyLinkAction);
menu->addSeparator();
menu->addAction(showInPeopleAct);
ui->shareButton->setMenu(menu);
ui->clearButton->hide();
@ -172,90 +176,106 @@ void PostedCardView::fill()
// return;
// }
QPixmap sqpixmap2 = QPixmap(":/images/thumb-default.png");
RsReputationLevel overall_reputation = rsReputations->overallReputationLevel(mPost.mMeta.mAuthorId);
bool redacted = (overall_reputation == RsReputationLevel::LOCALLY_NEGATIVE);
mInFill = true;
int desired_height = 1.5*(ui->voteDownButton->height() + ui->voteUpButton->height() + ui->scoreLabel->height());
int desired_width = sqpixmap2.width()*desired_height/(float)sqpixmap2.height();
QDateTime qtime;
qtime.setTime_t(mPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy");
QString timestamp2 = misc::timeRelativeToNow(mPost.mMeta.mPublishTs);
ui->dateLabel->setText(timestamp2);
ui->dateLabel->setToolTip(timestamp);
ui->fromLabel->setId(mPost.mMeta.mAuthorId);
// Use QUrl to check/parse our URL
// The only combination that seems to work: load as EncodedUrl, extract toEncoded().
QByteArray urlarray(mPost.mLink.c_str());
QUrl url = QUrl::fromEncoded(urlarray.trimmed());
QString urlstr = "Invalid Link";
QString sitestr = "Invalid Link";
bool urlOkay = url.isValid();
if (urlOkay)
{
QString scheme = url.scheme();
if ((scheme != "https")
&& (scheme != "http")
&& (scheme != "ftp")
&& (scheme != "retroshare"))
{
urlOkay = false;
sitestr = "Invalid Link Scheme";
}
}
if (urlOkay)
{
urlstr = QString("<a href=\"");
urlstr += QString(url.toEncoded());
urlstr += QString("\" ><span style=\" text-decoration: underline; color:#2255AA;\"> ");
urlstr += messageName();
urlstr += QString(" </span></a>");
QString siteurl = url.toEncoded();
sitestr = QString("<a href=\"%1\" ><span style=\" text-decoration: underline; color:#0079d3;\"> %2 </span></a>").arg(siteurl).arg(siteurl);
ui->titleLabel->setText(urlstr);
}else
{
ui->titleLabel->setText(messageName());
}
if (urlarray.isEmpty())
{
ui->siteLabel->hide();
}
ui->siteLabel->setText(sitestr);
if(mPost.mImage.mData != NULL)
{
QPixmap pixmap;
GxsIdDetails::loadPixmapFromData(mPost.mImage.mData, mPost.mImage.mSize, pixmap,GxsIdDetails::ORIGINAL);
// Wiping data - as its been passed to thumbnail.
QPixmap scaledpixmap;
if(pixmap.width() > 800){
QPixmap scaledpixmap = pixmap.scaledToWidth(800, Qt::SmoothTransformation);
ui->pictureLabel->setPixmap(scaledpixmap);
}else{
ui->pictureLabel->setPixmap(pixmap);
}
}
else if (mPost.mImage.mData == NULL)
{
if(redacted) {
ui->commentButton->setDisabled(true);
ui->voteUpButton->setDisabled(true);
ui->voteDownButton->setDisabled(true);
ui->picture_frame->hide();
}
else
{
ui->picture_frame->show();
}
ui->fromLabel->setId(mPost.mMeta.mAuthorId);
ui->titleLabel->setText(tr( "<p><font color=\"#ff0000\"><b>The author of this message (with ID %1) is banned.</b>").arg(QString::fromStdString(mPost.mMeta.mAuthorId.toStdString()))) ;
QDateTime qtime;
qtime.setTime_t(mPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy");
ui->dateLabel->setText(timestamp);
} else {
QPixmap sqpixmap2 = FilesDefs::getPixmapFromQtResourcePath(":/images/thumb-default.png");
mInFill = true;
int desired_height = 1.5*(ui->voteDownButton->height() + ui->voteUpButton->height() + ui->scoreLabel->height());
int desired_width = sqpixmap2.width()*desired_height/(float)sqpixmap2.height();
QDateTime qtime;
qtime.setTime_t(mPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy");
QString timestamp2 = misc::timeRelativeToNow(mPost.mMeta.mPublishTs);
ui->dateLabel->setText(timestamp2);
ui->dateLabel->setToolTip(timestamp);
ui->fromLabel->setId(mPost.mMeta.mAuthorId);
// Use QUrl to check/parse our URL
// The only combination that seems to work: load as EncodedUrl, extract toEncoded().
QByteArray urlarray(mPost.mLink.c_str());
QUrl url = QUrl::fromEncoded(urlarray.trimmed());
QString urlstr = "Invalid Link";
QString sitestr = "Invalid Link";
bool urlOkay = url.isValid();
if (urlOkay)
{
QString scheme = url.scheme();
if ((scheme != "https")
&& (scheme != "http")
&& (scheme != "ftp")
&& (scheme != "retroshare"))
{
urlOkay = false;
sitestr = "Invalid Link Scheme";
}
}
if (urlOkay)
{
urlstr = QString("<a href=\"");
urlstr += QString(url.toEncoded());
urlstr += QString("\" ><span style=\" text-decoration: underline; color:#2255AA;\"> ");
urlstr += messageName();
urlstr += QString(" </span></a>");
QString siteurl = url.toEncoded();
sitestr = QString("<a href=\"%1\" ><span style=\" text-decoration: underline; color:#0079d3;\"> %2 </span></a>").arg(siteurl).arg(siteurl);
ui->titleLabel->setText(urlstr);
}else
{
ui->titleLabel->setText(messageName());
}
if (urlarray.isEmpty())
{
ui->siteLabel->hide();
}
ui->siteLabel->setText(sitestr);
if(mPost.mImage.mData != NULL)
{
QPixmap pixmap;
GxsIdDetails::loadPixmapFromData(mPost.mImage.mData, mPost.mImage.mSize, pixmap,GxsIdDetails::ORIGINAL);
// Wiping data - as its been passed to thumbnail.
QPixmap scaledpixmap;
if(pixmap.width() > 800){
QPixmap scaledpixmap = pixmap.scaledToWidth(800, Qt::SmoothTransformation);
ui->pictureLabel->setPixmap(scaledpixmap);
}else{
ui->pictureLabel->setPixmap(pixmap);
}
}
else if (mPost.mImage.mData == NULL)
{
ui->picture_frame->hide();
}
else
{
ui->picture_frame->show();
}
}
//QString score = "Hot" + QString::number(post.mHotScore);
//score += " Top" + QString::number(post.mTopScore);

View file

@ -32,6 +32,8 @@
#include "gui/common/FilesDefs.h"
#include "util/qtthreadsutils.h"
#include "util/HandleRichText.h"
#include "gui/MainWindow.h"
#include "gui/Identity/IdDialog.h"
#include "PhotoView.h"
#include "ui_PostedItem.h"
@ -338,6 +340,24 @@ void BasePostedItem::viewPicture()
/* window will destroy itself! */
}
void BasePostedItem::showAuthorInPeople()
{
if(mPost.mMeta.mAuthorId.isNull())
{
std::cerr << "(EE) GxsForumThreadWidget::loadMsgData_showAuthorInPeople() ERROR Missing Message Data...";
std::cerr << std::endl;
}
/* window will destroy itself! */
IdDialog *idDialog = dynamic_cast<IdDialog*>(MainWindow::getPage(MainWindow::People));
if (!idDialog)
return ;
MainWindow::showWindow(MainWindow::People);
idDialog->navigate(RsGxsId(mPost.mMeta.mAuthorId));
}
//========================================================================================
// PostedItem //
//========================================================================================
@ -394,6 +414,8 @@ void PostedItem::setup()
QAction *CopyLinkAction = new QAction(QIcon(""),tr("Copy RetroShare Link"), this);
connect(CopyLinkAction, SIGNAL(triggered()), this, SLOT(copyMessageLink()));
QAction *showInPeopleAct = new QAction(QIcon(), tr("Show author in people tab"), this);
connect(showInPeopleAct, SIGNAL(triggered()), this, SLOT(showAuthorInPeople()));
int S = QFontMetricsF(font()).height() ;
@ -407,6 +429,8 @@ void PostedItem::setup()
QMenu *menu = new QMenu();
menu->addAction(CopyLinkAction);
menu->addSeparator();
menu->addAction(showInPeopleAct);
ui->shareButton->setMenu(menu);
ui->clearButton->hide();
@ -438,8 +462,6 @@ void PostedItem::makeUpVote()
emit vote(msgId, true);
}
void PostedItem::setComment(const RsGxsComment& cmt)
{
ui->newCommentLabel->show();
@ -459,97 +481,115 @@ void PostedItem::setCommentsSize(int comNb)
void PostedItem::fill()
{
RetroShareLink link = RetroShareLink::createGxsGroupLink(RetroShareLink::TYPE_POSTED, mGroupMeta.mGroupId, groupName());
ui->nameLabel->setText(link.toHtml());
RsReputationLevel overall_reputation = rsReputations->overallReputationLevel(mPost.mMeta.mAuthorId);
bool redacted = (overall_reputation == RsReputationLevel::LOCALLY_NEGATIVE);
QPixmap sqpixmap2 = QPixmap(":/images/thumb-default.png");
if(redacted) {
ui->expandButton->setDisabled(true);
ui->commentButton->setDisabled(true);
ui->voteUpButton->setDisabled(true);
ui->voteDownButton->setDisabled(true);
mInFill = true;
int desired_height = 1.5*(ui->voteDownButton->height() + ui->voteUpButton->height() + ui->scoreLabel->height());
int desired_width = sqpixmap2.width()*desired_height/(float)sqpixmap2.height();
ui->thumbnailLabel->setPixmap( QPixmap(":/images/thumb-default.png"));
ui->fromLabel->setId(mPost.mMeta.mAuthorId);
ui->titleLabel->setText(tr( "<p><font color=\"#ff0000\"><b>The author of this message (with ID %1) is banned.</b>").arg(QString::fromStdString(mPost.mMeta.mAuthorId.toStdString()))) ;
QDateTime qtime;
qtime.setTime_t(mPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy");
ui->dateLabel->setText(timestamp);
} else {
RetroShareLink link = RetroShareLink::createGxsGroupLink(RetroShareLink::TYPE_POSTED, mGroupMeta.mGroupId, groupName());
ui->nameLabel->setText(link.toHtml());
QDateTime qtime;
qtime.setTime_t(mPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy");
QString timestamp2 = misc::timeRelativeToNow(mPost.mMeta.mPublishTs);
ui->dateLabel->setText(timestamp2);
ui->dateLabel->setToolTip(timestamp);
QPixmap sqpixmap2 = FilesDefs::getPixmapFromQtResourcePath(":/images/thumb-default.png");
ui->fromLabel->setId(mPost.mMeta.mAuthorId);
mInFill = true;
int desired_height = 1.5*(ui->voteDownButton->height() + ui->voteUpButton->height() + ui->scoreLabel->height());
int desired_width = sqpixmap2.width()*desired_height/(float)sqpixmap2.height();
// Use QUrl to check/parse our URL
// The only combination that seems to work: load as EncodedUrl, extract toEncoded().
QByteArray urlarray(mPost.mLink.c_str());
QUrl url = QUrl::fromEncoded(urlarray.trimmed());
QString urlstr = "Invalid Link";
QString sitestr = "Invalid Link";
QDateTime qtime;
qtime.setTime_t(mPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy");
QString timestamp2 = misc::timeRelativeToNow(mPost.mMeta.mPublishTs);
ui->dateLabel->setText(timestamp2);
ui->dateLabel->setToolTip(timestamp);
bool urlOkay = url.isValid();
if (urlOkay)
{
QString scheme = url.scheme();
if ((scheme != "https")
&& (scheme != "http")
&& (scheme != "ftp")
&& (scheme != "retroshare"))
ui->fromLabel->setId(mPost.mMeta.mAuthorId);
// Use QUrl to check/parse our URL
// The only combination that seems to work: load as EncodedUrl, extract toEncoded().
QByteArray urlarray(mPost.mLink.c_str());
QUrl url = QUrl::fromEncoded(urlarray.trimmed());
QString urlstr = "Invalid Link";
QString sitestr = "Invalid Link";
bool urlOkay = url.isValid();
if (urlOkay)
{
urlOkay = false;
sitestr = "Invalid Link Scheme";
QString scheme = url.scheme();
if ((scheme != "https")
&& (scheme != "http")
&& (scheme != "ftp")
&& (scheme != "retroshare"))
{
urlOkay = false;
sitestr = "Invalid Link Scheme";
}
}
}
if (urlOkay)
{
urlstr = QString("<a href=\"");
urlstr += QString(url.toEncoded());
urlstr += QString("\" ><span style=\" text-decoration: underline; color:#2255AA;\"> ");
urlstr += messageName();
urlstr += QString(" </span></a>");
if (urlOkay)
{
urlstr = QString("<a href=\"");
urlstr += QString(url.toEncoded());
urlstr += QString("\" ><span style=\" text-decoration: underline; color:#2255AA;\"> ");
urlstr += messageName();
urlstr += QString(" </span></a>");
QString siteurl = url.toEncoded();
sitestr = QString("<a href=\"%1\" ><span style=\" text-decoration: underline; color:#0079d3;\"> %2 </span></a>").arg(siteurl).arg(siteurl);
QString siteurl = url.toEncoded();
sitestr = QString("<a href=\"%1\" ><span style=\" text-decoration: underline; color:#0079d3;\"> %2 </span></a>").arg(siteurl).arg(siteurl);
ui->titleLabel->setText(urlstr);
}else
{
ui->titleLabel->setText(messageName());
ui->titleLabel->setText(urlstr);
}else
{
ui->titleLabel->setText(messageName());
}
if (urlarray.isEmpty())
{
ui->siteLabel->hide();
}
ui->siteLabel->setText(sitestr);
if(mPost.mImage.mData != NULL)
{
QPixmap pixmap;
GxsIdDetails::loadPixmapFromData(mPost.mImage.mData, mPost.mImage.mSize, pixmap,GxsIdDetails::ORIGINAL);
// Wiping data - as its been passed to thumbnail.
QPixmap sqpixmap = pixmap.scaled(desired_width,desired_height, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
ui->thumbnailLabel->setPixmap(sqpixmap);
ui->thumbnailLabel->setToolTip(tr("Click to view Picture"));
QPixmap scaledpixmap;
if(pixmap.width() > 800){
QPixmap scaledpixmap = pixmap.scaledToWidth(800, Qt::SmoothTransformation);
ui->pictureLabel->setPixmap(scaledpixmap);
}else{
ui->pictureLabel->setPixmap(pixmap);
}
}
else if (urlOkay && (mPost.mImage.mData == NULL))
{
ui->expandButton->setDisabled(true);
ui->thumbnailLabel->setPixmap(FilesDefs::getPixmapFromQtResourcePath(LINK_IMAGE));
}
else
{
ui->expandButton->setDisabled(true);
ui->thumbnailLabel->setPixmap(sqpixmap2);
if (urlarray.isEmpty())
{
ui->siteLabel->hide();
}
ui->siteLabel->setText(sitestr);
if(mPost.mImage.mData != NULL)
{
QPixmap pixmap;
GxsIdDetails::loadPixmapFromData(mPost.mImage.mData, mPost.mImage.mSize, pixmap,GxsIdDetails::ORIGINAL);
// Wiping data - as its been passed to thumbnail.
QPixmap sqpixmap = pixmap.scaled(desired_width,desired_height, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
ui->thumbnailLabel->setPixmap(sqpixmap);
ui->thumbnailLabel->setToolTip(tr("Click to view Picture"));
QPixmap scaledpixmap;
if(pixmap.width() > 800){
QPixmap scaledpixmap = pixmap.scaledToWidth(800, Qt::SmoothTransformation);
ui->pictureLabel->setPixmap(scaledpixmap);
}else{
ui->pictureLabel->setPixmap(pixmap);
}
}
else if (urlOkay && (mPost.mImage.mData == NULL))
{
ui->expandButton->setDisabled(true);
ui->thumbnailLabel->setPixmap(FilesDefs::getPixmapFromQtResourcePath(LINK_IMAGE));
}
else
{
ui->expandButton->setDisabled(true);
ui->thumbnailLabel->setPixmap(sqpixmap2);
}
}
@ -701,5 +741,3 @@ void PostedItem::toggleNotes()
}
}

View file

@ -55,6 +55,7 @@ private slots:
void readAndClearItem();
void copyMessageLink();
void viewPicture();
void showAuthorInPeople();
signals:
void vote(const RsGxsGrpMsgIdPair& msgId, bool up);

View file

@ -298,199 +298,10 @@
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="logoLabel">
<property name="minimumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="pixmap">
<pixmap resource="../icons.qrc">:/icons/png/postedlinks.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="namelabel">
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QFormLayout" name="formLayout">
<property name="topMargin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Popularity</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="poplabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="infoPostsLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Posts</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="infoPosts">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">0</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="createdlabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Created</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="createdinfolabel">
<property name="text">
<string>unknown</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Administrator:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="GxsIdLabel" name="infoAdministrator">
<property name="text">
<string>unknown</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Distribution:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="infoDistribution">
<property name="text">
<string>unknown</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="infoLastPostLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Last Post:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="infoLastPost">
<property name="text">
<string notr="true">unknown</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
<property name="topMargin">
<number>6</number>
</property>
<item row="0" column="1">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -503,7 +314,7 @@
</property>
</spacer>
</item>
<item row="2" column="0" colspan="2">
<item row="1" column="0" colspan="2">
<widget class="QTextBrowser" name="infoDescription">
<property name="styleSheet">
<string notr="true"/>
@ -526,6 +337,194 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="0" column="0">
<layout class="QFormLayout" name="formLayout">
<property name="topMargin">
<number>0</number>
</property>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Popularity</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="poplabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="infoPostsLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Posts</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="infoPosts">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">0</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="createdlabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Created</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="createdinfolabel">
<property name="text">
<string>unknown</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Administrator:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="GxsIdLabel" name="infoAdministrator">
<property name="text">
<string>unknown</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Distribution:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="infoDistribution">
<property name="text">
<string>unknown</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="infoLastPostLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Last Post:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="infoLastPost">
<property name="text">
<string notr="true">unknown</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="logoLabel">
<property name="minimumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="pixmap">
<pixmap resource="../icons.qrc">:/icons/png/postedlinks.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="namelabel">
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>

View file

@ -39,19 +39,19 @@
//#define DEBUG_EID_PAINT 1
/* To test it you can make an empty.qss file with:
QTreeView::item, QTreeWidget::item{
QTreeView::item, QTreeWidget::item, QListWidget::item{
color: #AB0000;
background-color: #00DC00;
}
QTreeView::item:selected, QTreeWidget::item:selected{
QTreeView::item:selected, QTreeWidget::item:selected, QListWidget::item:selected{
color: #00CD00;
background-color: #0000BA;
}
QTreeView::item:hover, QTreeWidget::item:hover{
QTreeView::item:hover, QTreeWidget::item:hover, QListWidget::item:hover{
color: #0000EF;
background-color: #FEDCBA;
}
QQTreeView::item:selected:hover, TreeWidget::item:selected:hover{
QQTreeView::item:selected:hover, TreeWidget::item:selected:hover, QListWidget::item:selected:hover{
color: #ABCDEF;
background-color: #FE0000;
}

View file

@ -23,6 +23,10 @@
#ifndef ELNODE_H
#define ELNODE_H
#include "graphwidget.h"
#include <retroshare/rstypes.h>
#include <QApplication>
#if QT_VERSION >= 0x040600
#include <QGraphicsObject>
@ -30,9 +34,7 @@
#include <QGraphicsItem>
#endif
#include <QList>
#include <retroshare/rstypes.h>
#include "graphwidget.h"
#include <QPainterPath>
class Edge;
QT_BEGIN_NAMESPACE

View file

@ -937,5 +937,7 @@
<file>emojione/1F1FF-1F1FC.png</file>
<file>emojione/flags.png</file>
<file>emojione/flags2.png</file>
<file>emojione/man-facepalming.png</file>
<file>emojione/woman-facepalming.png</file>
</qresource>
</RCC>

View file

@ -113,6 +113,8 @@
"emojione/people2.png"|":man_with_gua_pi_mao:":"emojione/1F472.png";
"emojione/people2.png"|":levitate:|:man_in_business_suit_levitating:":"emojione/1F574.png";
"emojione/people2.png"|":dancer:":"emojione/1F483.png";
"emojione/people2.png"|":man_facepalming:":"emojione/man-facepalming.png";
"emojione/people2.png"|":woman_facepalming:":"emojione/woman-facepalming.png";
"emojione/people2.png"|":bust_in_silhouette:":"emojione/1F464.png";
"emojione/people2.png"|":busts_in_silhouette:":"emojione/1F465.png";
"emojione/people2.png"|":family:":"emojione/1F46A.png";

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -18,6 +18,14 @@
* *
*******************************************************************************/
#include "GxsCommentTreeWidget.h"
#include "gui/common/FilesDefs.h"
#include "gui/common/RSElidedItemDelegate.h"
#include "gui/common/RSTreeWidgetItem.h"
#include "gui/gxs/GxsCreateCommentDialog.h"
#include "gui/gxs/GxsIdTreeWidgetItem.h"
#include <QAbstractTextDocumentLayout>
#include <QApplication>
#include <QClipboard>
@ -28,13 +36,6 @@
#include <QPainterPath>
#include <QTextDocument>
#include "gui/common/RSElidedItemDelegate.h"
#include "gui/common/FilesDefs.h"
#include "gui/gxs/GxsCommentTreeWidget.h"
#include "gui/gxs/GxsCreateCommentDialog.h"
#include "gui/gxs/GxsIdTreeWidgetItem.h"
#include "gui/common/RSTreeWidgetItem.h"
#include <iostream>
#define PCITEM_COLUMN_COMMENT 0

View file

@ -18,22 +18,23 @@
* *
*******************************************************************************/
#include <QApplication>
#include <QThread>
#include <QTimerEvent>
#include <QMutexLocker>
#include <math.h>
#include <util/rsdir.h>
#include "gui/common/AvatarDialog.h"
#include "GxsIdDetails.h"
#include "gui/common/AvatarDialog.h"
#include "retroshare-gui/RsAutoUpdatePage.h"
#include <retroshare/rspeers.h>
#include <util/rsdir.h>
#include <iostream>
#include <QApplication>
#include <QMutexLocker>
#include <QPainter>
#include <QPainterPath>
#include <QThread>
#include <QTimerEvent>
#include <iostream>
#include <cmath>
/* Images for tag icons */
#define IMAGE_LOADING ":/images/folder-draft.png"

View file

@ -301,6 +301,7 @@
<file>icons/png/arrow-left.png</file>
<file>icons/png/next-unread.png</file>
<file>icons/mail/compose.png</file>
<file>icons/mail/downloadall.png</file>
<file>icons/mail/delete.png</file>
<file>icons/mail/tags.png</file>
<file>icons/mail/quote.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

@ -1206,6 +1206,12 @@ MessageComposer *MessageComposer::replyMsg(const std::string &msgId, bool all)
// needed to send system flags with reply
msgComposer->msgFlags = (msgInfo.msgflags & RS_MSG_SYSTEM);
MsgTagInfo tagInfo;
rsMail->getMessageTag(msgId, tagInfo);
msgComposer->m_tagIds = tagInfo.tagIds;
msgComposer->showTagLabels();
msgComposer->calculateTitle();
/* window will destroy itself! */

View file

@ -36,6 +36,7 @@
#include "gui/common/TagDefs.h"
#include "gui/common/PeerDefs.h"
#include "gui/common/Emoticons.h"
#include "gui/common/FilesDefs.h"
#include "gui/settings/rsharesettings.h"
#include "MessageComposer.h"
#include "MessageWidget.h"
@ -51,8 +52,8 @@
#include <retroshare/rsmsgs.h>
/* Images for context menu icons */
#define IMAGE_DOWNLOAD ":/images/start.png"
#define IMAGE_DOWNLOADALL ":/images/startall.png"
#define IMAGE_DOWNLOAD ":/icons/png/download.png"
#define IMAGE_DOWNLOADALL ":/icons/mail/downloadall.png"
#define COLUMN_FILE_NAME 0
#define COLUMN_FILE_SIZE 1
@ -555,6 +556,7 @@ void MessageWidget::fill(const std::string &msgId)
for (it = recList.begin(); it != recList.end(); ++it) {
QTreeWidgetItem *item = new QTreeWidgetItem;
item->setText(COLUMN_FILE_NAME, QString::fromUtf8(it->fname.c_str()));
item->setIcon(COLUMN_FILE_NAME, FilesDefs::getIconFromFileType(it->fname.c_str()));
item->setText(COLUMN_FILE_SIZE, misc::friendlyUnit(it->size));
item->setData(COLUMN_FILE_SIZE, Qt::UserRole, QVariant(qulonglong(it->size)) );
item->setText(COLUMN_FILE_HASH, QString::fromStdString(it->hash.toStdString()));
@ -667,10 +669,14 @@ void MessageWidget::fill(const std::string &msgId)
}
ui.subjectText->setText(QString::fromUtf8(msgInfo.title.c_str()));
unsigned int formatTextFlag = RSHTML_FORMATTEXT_EMBED_LINKS ;
// emoticons disabled because of crazy cost.
//text = RsHtmlMsg(msgInfo.msgflags).formatText(ui.msgText->document(), QString::fromUtf8(msgInfo.msg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS);
text = RsHtmlMsg(msgInfo.msgflags).formatText(ui.msgText->document(), QString::fromUtf8(msgInfo.msg.c_str()), RSHTML_FORMATTEXT_EMBED_LINKS);
// embed smileys ?
if (Settings->valueFromGroup(QString("Messages"), QString::fromUtf8("Emoticons"), true).toBool()) {
formatTextFlag |= RSHTML_FORMATTEXT_EMBED_SMILEYS ;
}
text = RsHtmlMsg(msgInfo.msgflags).formatText(ui.msgText->document(), QString::fromUtf8(msgInfo.msg.c_str()), formatTextFlag);
ui.msgText->resetImagesStatus(Settings->getMsgLoadEmbeddedImages() || (msgInfo.msgflags & RS_MSG_LOAD_EMBEDDED_IMAGES));
ui.msgText->setHtml(text);

View file

@ -53,6 +53,7 @@
#include <algorithm>
/* Images for context menu icons */
#define IMAGE_MAIL ":/icons/png/message.png"
#define IMAGE_MESSAGE ":/icons/mail/compose.png"
#define IMAGE_MESSAGEREMOVE ":/icons/mail/delete.png"
#define IMAGE_STAR_ON ":/images/star-on-16.png"
@ -766,7 +767,7 @@ void MessagesDialog::openAsTab()
return;
}
ui.tabWidget->addTab(msgWidget, msgWidget->subject(true));
ui.tabWidget->addTab(msgWidget,QIcon(IMAGE_MAIL), msgWidget->subject(true));
ui.tabWidget->setCurrentWidget(msgWidget);
connect(msgWidget, SIGNAL(messageRemoved()), this, SLOT(messageRemoved()));
@ -1104,7 +1105,10 @@ void MessagesDialog::removemessage()
void MessagesDialog::messageRemoved()
{
ui.messageTreeWidget->setCurrentIndex(lastSelectedIndex);
if (lastSelectedIndex.isValid())
ui.messageTreeWidget->setCurrentIndex(lastSelectedIndex);
else
insertMsgTxtAndFiles(QModelIndex());
}
void MessagesDialog::undeletemessage()

View file

@ -904,6 +904,16 @@ MessagesDialog QWidget#messageTreeWidget::item {
padding: 2px;
}
MessagesDialog QWidget#messageTreeWidget::item:selected {
background-color: #cde8ff;
color: black;
}
MessagesDialog QWidget#messageTreeWidget::item:hover {
background-color: #e5f3ff;
color: black;
}
GxsForumThreadWidget QWidget#threadTreeWidget::item {
padding: 2px;
}

View file

@ -39,7 +39,6 @@ MessagePage::MessagePage(QWidget * parent, Qt::WindowFlags flags)
connect (ui.editpushButton, SIGNAL(clicked(bool)), this, SLOT (editTag()));
connect (ui.deletepushButton, SIGNAL(clicked(bool)), this, SLOT (deleteTag()));
connect (ui.defaultTagButton, SIGNAL(clicked(bool)), this, SLOT (defaultTag()));
//connect (ui.encryptedMsgs_CB, SIGNAL(toggled(bool)), this, SLOT (toggleEnableEncryptedDistantMsgs(bool)));
connect (ui.tags_listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(currentRowChangedTag(int)));
@ -54,6 +53,7 @@ MessagePage::MessagePage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.setMsgToReadOnActivate,SIGNAL(toggled(bool)), this,SLOT(updateMsgToReadOnActivate()));
connect(ui.loadEmbeddedImages, SIGNAL(toggled(bool)), this,SLOT(updateLoadEmbededImages() ));
connect(ui.openComboBox, SIGNAL(currentIndexChanged(int)),this,SLOT(updateMsgOpen() ));
connect(ui.emoticonscheckBox, SIGNAL(toggled(bool)), this,SLOT(updateLoadEmoticons() ));
}
MessagePage::~MessagePage()
@ -84,6 +84,7 @@ void MessagePage::updateMsgToReadOnActivate() { Settings->setMsgSetToReadOnActiv
void MessagePage::updateLoadEmbededImages() { Settings->setMsgLoadEmbeddedImages(ui.loadEmbeddedImages->isChecked()); }
void MessagePage::updateMsgOpen() { Settings->setMsgOpen( static_cast<RshareSettings::enumMsgOpen>(ui.openComboBox->itemData(ui.openComboBox->currentIndex()).toInt()) ); }
void MessagePage::updateDistantMsgs() { Settings->setValue("DistantMessages", ui.comboBox->currentIndex()); }
void MessagePage::updateLoadEmoticons() { Settings->setValueToGroup("Messages", "Emoticons", ui.emoticonscheckBox->isChecked()); }
void MessagePage::updateMsgTags()
{
@ -110,9 +111,12 @@ void MessagePage::updateMsgTags()
void
MessagePage::load()
{
Settings->beginGroup(QString("Messages"));
whileBlocking(ui.setMsgToReadOnActivate)->setChecked(Settings->getMsgSetToReadOnActivate());
whileBlocking(ui.loadEmbeddedImages)->setChecked(Settings->getMsgLoadEmbeddedImages());
whileBlocking(ui.openComboBox)->setCurrentIndex(ui.openComboBox->findData(Settings->getMsgOpen()));
whileBlocking(ui.emoticonscheckBox)->setChecked(Settings->value("Emoticons", true).toBool());
Settings->endGroup();
// state of filter combobox
@ -267,3 +271,4 @@ void MessagePage::currentRowChangedTag(int row)
ui.editpushButton->setEnabled(bEditEnable);
ui.deletepushButton->setEnabled(bDeleteEnable);
}

View file

@ -58,6 +58,7 @@ private slots:
void updateMsgOpen() ;
void updateDistantMsgs() ;
void updateMsgTags() ;
void updateLoadEmoticons();
private:
void fillTags();

View file

@ -65,14 +65,7 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="loadEmbeddedImages">
<property name="text">
<string>Load embedded images</string>
</property>
</widget>
</item>
<item row="2" column="0">
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="openLabel">
@ -86,6 +79,20 @@
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="loadEmbeddedImages">
<property name="text">
<string>Load embedded images</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="emoticonscheckBox">
<property name="text">
<string>Load Emoticons</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View file

@ -23,6 +23,7 @@
#include <gui/notifyqt.h>
#include "rshare.h"
#include "rsharesettings.h"
#include "util/i2pcommon.h"
#include "util/RsNetUtil.h"
#include "util/misc.h"
@ -82,6 +83,10 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags)
manager = NULL ;
mOngoingConnectivityCheck = -1;
#ifndef RS_USE_I2P_BOB
ui.hiddenServiceTab->removeTab(TAB_HIDDEN_SERVICE_I2P_BOB); // warning: the order of operation here is very important.
#endif
if(RsAccounts::isHiddenNode())
{
if(RsAccounts::isTorAuto())
@ -1352,7 +1357,7 @@ void ServerPage::updateInProxyIndicator()
ui.iconlabel_service_incoming->setMovie(movie);
movie->start();
if (mHiddenType == RS_HIDDEN_TYPE_I2P && mBobSettings.enableBob) {
if (mHiddenType == RS_HIDDEN_TYPE_I2P && mBobSettings.enable) {
QTcpSocket tcpSocket;
@ -1439,15 +1444,16 @@ void ServerPage::getNewKey()
void ServerPage::loadKey()
{
mBobSettings.keys = ui.pteBobServerKey->toPlainText().toStdString();
mBobSettings.addr = p3I2pBob::keyToBase32Addr(mBobSettings.keys);
mBobSettings.address.privateKey = ui.pteBobServerKey->toPlainText().toStdString();
mBobSettings.address.publicKey = i2p::publicKeyFromPrivate(mBobSettings.address.privateKey);
mBobSettings.address.base32 = i2p::keyToBase32Addr(mBobSettings.address.publicKey);
rsAutoProxyMonitor::taskSync(autoProxyType::I2PBOB, autoProxyTask::setSettings, &mBobSettings);
}
void ServerPage::enableBob(bool checked)
{
mBobSettings.enableBob = checked;
mBobSettings.enable = checked;
rsAutoProxyMonitor::taskSync(autoProxyType::I2PBOB, autoProxyTask::setSettings, &mBobSettings);
@ -1487,7 +1493,7 @@ void ServerPage::toggleBobAdvancedSettings(bool checked)
{
ui.swBobAdvanced->setCurrentIndex(checked ? 1 : 0);
if (!mBobSettings.keys.empty()) {
if (!mBobSettings.address.privateKey.empty()) {
if (checked) {
ui.pbBobGenAddr->show();
} else {
@ -1578,9 +1584,9 @@ void ServerPage::loadCommon()
whileBlocking(ui.hiddenpage_proxyPort_i2p_2)->setValue(proxyport); // this one is for bob tab
// don't use whileBlocking here
ui.cb_enableBob->setChecked(mBobSettings.enableBob);
ui.cb_enableBob->setChecked(mBobSettings.enable);
if (!mBobSettings.keys.empty()) {
if (!mBobSettings.address.privateKey.empty()) {
ui.lBobB32Addr->show();
ui.leBobB32Addr->show();
}
@ -1623,13 +1629,13 @@ void ServerPage::saveBob()
void ServerPage::updateStatusBob()
{
QString addr = QString::fromStdString(mBobSettings.addr);
QString addr = QString::fromStdString(mBobSettings.address.base32);
if (ui.leBobB32Addr->text() != addr) {
ui.leBobB32Addr->setText(addr);
ui.hiddenpage_serviceAddress->setText(addr);
ui.pteBobServerKey->setPlainText(QString::fromStdString(mBobSettings.keys));
ui.pteBobServerKey->setPlainText(QString::fromStdString(mBobSettings.address.privateKey));
if (!mBobSettings.keys.empty()) {
if (!mBobSettings.address.privateKey.empty()) {
// we have an addr -> show fields
ui.lBobB32Addr->show();
ui.leBobB32Addr->show();
@ -1655,7 +1661,7 @@ void ServerPage::updateStatusBob()
QString bobSimpleText = QString();
bobSimpleText.append(tr("RetroShare uses BOB to set up a %1 tunnel at %2:%3 (named %4)\n\n"
"When changing options (e.g. port) use the buttons at the bottom to restart BOB.\n\n").
arg(mBobSettings.keys.empty() ? tr("client") : tr("server"),
arg(mBobSettings.address.privateKey.empty() ? tr("client") : tr("server"),
ui.hiddenpage_proxyAddress_i2p_2->text(),
ui.hiddenpage_proxyPort_i2p_2->text(),
bs.tunnelName.empty() ? tr("unknown") :
@ -1777,15 +1783,15 @@ void ServerPage::updateStatusBob()
void ServerPage::setUpBobElements()
{
ui.gbBob->setEnabled(mBobSettings.enableBob);
if (mBobSettings.enableBob) {
ui.gbBob->setEnabled(mBobSettings.enable);
if (mBobSettings.enable) {
ui.hiddenpage_proxyAddress_i2p->setEnabled(false);
ui.hiddenpage_proxyAddress_i2p->setToolTip("Use I2P/BOB settings to change this value");
ui.hiddenpage_proxyPort_i2p->setEnabled(false);
ui.hiddenpage_proxyPort_i2p->setToolTip("Use I2P/BOB settings to change this value");
ui.leBobB32Addr->setText(QString::fromStdString(mBobSettings.addr));
ui.pteBobServerKey->setPlainText(QString::fromStdString(mBobSettings.keys));
ui.leBobB32Addr->setText(QString::fromStdString(mBobSettings.address.base32));
ui.pteBobServerKey->setPlainText(QString::fromStdString(mBobSettings.address.privateKey));
// cast to int to avoid problems
int li, lo, qi, qo, vi, vo;

View file

@ -49,6 +49,9 @@
#include "gui/gxs/GxsIdLabel.h"
#include "gui/gxs/GxsIdDetails.h"
#include "gui/gxs/GxsIdTreeWidgetItem.h"
#include "gui/Identity/IdDialog.h"
#include "gui/MainWindow.h"
#include "gui/common/FilesDefs.h"
#define COL_PENDING_ID 0
#define COL_PENDING_DESTINATION 1
@ -61,11 +64,13 @@
#define COL_PENDING_DESTINATION_ID 8
#define COL_GROUP_GRP_ID 0
#define COL_GROUP_NUM_MSGS 1
#define COL_GROUP_SIZE_MSGS 2
#define COL_GROUP_SUBSCRIBED 3
#define COL_GROUP_POPULARITY 4
#define COL_GROUP_UNIQUE_ID 5
#define COL_GROUP_PUBLISHTS 1
#define COL_GROUP_NUM_MSGS 2
#define COL_GROUP_SIZE_MSGS 3
#define COL_GROUP_SUBSCRIBED 4
#define COL_GROUP_POPULARITY 5
#define COL_GROUP_UNIQUE_ID 6
#define COL_GROUP_AUTHOR_ID 7
//static const int PARTIAL_VIEW_SIZE = 9 ;
//static const int MAX_TUNNEL_REQUESTS_DISPLAY = 10 ;
@ -94,8 +99,10 @@ GxsTransportStatistics::GxsTransportStatistics(QWidget *parent)
QHeaderView_setSectionResizeMode(groupTreeWidget->header(), QHeaderView::ResizeToContents);
connect(treeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(CustomPopupMenu(QPoint)));
treeWidget->setColumnHidden(COL_PENDING_DESTINATION_ID,true);
connect(groupTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(CustomPopupMenuGroups(QPoint)));
treeWidget->setColumnHidden(COL_PENDING_DESTINATION_ID,true);
groupTreeWidget->setColumnHidden(COL_GROUP_AUTHOR_ID,true);
// load settings
processSettings(true);
@ -139,7 +146,20 @@ void GxsTransportStatistics::CustomPopupMenu( QPoint )
QTreeWidgetItem *item = treeWidget->currentItem();
if (item) {
contextMnu.addAction(QIcon(":/images/info16.png"), tr("Details"), this, SLOT(personDetails()));
contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(":/images/info16.png"), tr("View details"), this, SLOT(personDetails()));
}
contextMnu.exec(QCursor::pos());
}
void GxsTransportStatistics::CustomPopupMenuGroups( QPoint )
{
QMenu contextMnu( this );
QTreeWidgetItem *item = groupTreeWidget->currentItem();
if (item) {
contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(":/images/info16.png"), tr("View details"), this, SLOT(showAuthorInPeople()));
}
@ -275,9 +295,10 @@ void GxsTransportStatistics::updateContent()
groupTreeWidget->addTopLevelItem(item);
groupTreeWidget->setItemExpanded(item,openned_groups.find(it->first) != openned_groups.end());
QString msg_time_string = (stat.last_publish_TS>0)?QString(" (Last msg: %1)").arg(QDateTime::fromTime_t((uint)stat.last_publish_TS).toString()):"" ;
QString msg_time_string = (stat.last_publish_TS>0)?QString("(Last msg: %1)").arg(QDateTime::fromTime_t((uint)stat.last_publish_TS).toString()):"" ;
item->setData(COL_GROUP_NUM_MSGS, Qt::DisplayRole, QString::number(stat.mNumMsgs) + msg_time_string) ;
item->setData(COL_GROUP_PUBLISHTS, Qt::DisplayRole, msg_time_string) ;
item->setData(COL_GROUP_NUM_MSGS, Qt::DisplayRole, QString::number(stat.mNumMsgs) ) ;
item->setData(COL_GROUP_GRP_ID, Qt::DisplayRole, QString::fromStdString(it->first.toStdString())) ;
item->setData(COL_GROUP_SIZE_MSGS, Qt::DisplayRole, QString::number(stat.mTotalSizeOfMsgs)) ;
item->setData(COL_GROUP_SUBSCRIBED,Qt::DisplayRole, stat.subscribed?tr("Yes"):tr("No")) ;
@ -308,6 +329,8 @@ void GxsTransportStatistics::updateContent()
rsIdentity->getIdDetails(meta.mAuthorId,idDetails);
QPixmap pixmap ;
QDateTime qdatetime;
qdatetime.setTime_t(meta.mPublishTs);
if(idDetails.mAvatar.mSize == 0 || !GxsIdDetails::loadPixmapFromData(idDetails.mAvatar.mData, idDetails.mAvatar.mSize, pixmap,GxsIdDetails::SMALL))
pixmap = GxsIdDetails::makeDefaultIcon(meta.mAuthorId,GxsIdDetails::SMALL);
@ -315,7 +338,9 @@ void GxsTransportStatistics::updateContent()
sitem->setIcon(COL_GROUP_GRP_ID, QIcon(pixmap));
sitem->setData(COL_GROUP_UNIQUE_ID, Qt::DisplayRole,QString::fromStdString(meta.mMsgId.toStdString()));
sitem->setData(COL_GROUP_NUM_MSGS,Qt::DisplayRole, QDateTime::fromTime_t(meta.mPublishTs).toString());
sitem->setData(COL_GROUP_AUTHOR_ID, Qt::DisplayRole, QString::fromStdString(meta.mAuthorId.toStdString())) ;
sitem->setText(COL_GROUP_PUBLISHTS, QDateTime::fromTime_t(meta.mPublishTs).toString());
sitem->setData(COL_GROUP_PUBLISHTS, Qt::UserRole, qdatetime);
}
}
}
@ -333,6 +358,25 @@ void GxsTransportStatistics::personDetails()
dialog->show();
}
void GxsTransportStatistics::showAuthorInPeople()
{
QTreeWidgetItem *item = groupTreeWidget->currentItem();
std::string id = item->text(COL_GROUP_AUTHOR_ID).toStdString();
if (id.empty()) {
return;
}
/* window will destroy itself! */
IdDialog *idDialog = dynamic_cast<IdDialog*>(MainWindow::getPage(MainWindow::People));
if (!idDialog)
return ;
MainWindow::showWindow(MainWindow::People);
idDialog->navigate(RsGxsId(id));
}
#ifdef TO_REMOVE
void GxsTransportStatistics::loadGroupMeta(const std::vector<RsGroupMetaData>& groupInfo)
{

View file

@ -51,7 +51,10 @@ public:
private slots:
/** Create the context popup menu and it's submenus */
void CustomPopupMenu( QPoint point );
void CustomPopupMenuGroups( QPoint point ) ;
void personDetails();
void showAuthorInPeople();
private:
void updateDisplay(bool complete) ;

View file

@ -41,7 +41,7 @@
<bool>true</bool>
</property>
<attribute name="headerShowSortIndicator" stdset="0">
<bool>false</bool>
<bool>true</bool>
</attribute>
<column>
<property name="text">
@ -108,6 +108,12 @@
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<attribute name="headerShowSortIndicator" stdset="0">
<bool>true</bool>
</attribute>
<column>
<property name="text">
<string>Group ID / Author</string>
@ -115,7 +121,12 @@
</column>
<column>
<property name="text">
<string>Number of messages / Publish TS</string>
<string>Publish TS</string>
</property>
</column>
<column>
<property name="text">
<string>Number of messages </string>
</property>
</column>
<column>

View file

@ -51,6 +51,10 @@ background: black;
color: lightgray;
border-color: transparent;
}
QTreeView::item, QTreeWidget::item, QListWidget::item{
color: lightgray;
}
QDialog, QMainWindow{
background-color: qlineargradient(spread:reflect, x1:0, y1:0, x2:0, y2:1, stop:0 rgb(25, 25, 25), stop:0.05 rgb(0, 0, 0), stop:0.95 rgb(0, 0, 0), stop:1 rgb(25, 25, 25));
}
@ -255,6 +259,12 @@ QTextEdit {
color: white;
}
RSTextBrowser, MimeTextEdit
{
/*qproperty-textColorQuote: rgb(125, 125, 255);*/
qproperty-textColorQuotes: ColorList(#789922 #039bd5 #800000 #800080 #008080 #b10dc9 #85144b #3d9970);
}
/* OpModeStatus need to be at end to overload other values*/
OpModeStatus {
qproperty-opMode_Full_Color: #007000;

View file

@ -51,6 +51,9 @@ QWidget {
selection-background-color: #1464A0;
selection-color: #F0F0F0;
}
QTreeView::item, QTreeWidget::item, QListWidget::item{
color: #F0F0F0;
}
QWidget:disabled {
background-color: #19232D;
@ -2152,5 +2155,5 @@ GxsChannelDialog GroupTreeWidget QTreeWidget#treeWidget::item{
RSTextBrowser, MimeTextEdit
{
/*qproperty-textColorQuote: rgb(125, 125, 255);*/
qproperty-textColorQuotes: ColorList(#0000ff #00ff00 #00ffff #ff0000 #ff00ff #ffff00 #ffffff);
qproperty-textColorQuotes: ColorList(#789922 #039bd5 #800000 #800080 #008080 #b10dc9 #85144b #3d9970);
}

View file

@ -60,6 +60,9 @@ QWidget
border-image: none;
outline: 0;
}
QTreeView::item, QTreeWidget::item, QListWidget::item{
color: silver;
}
QWidget:item:hover
{
@ -1299,7 +1302,7 @@ WireGroupItem QFrame#frame{
RSTextBrowser, MimeTextEdit
{
/*qproperty-textColorQuote: rgb(125, 125, 255);*/
qproperty-textColorQuotes: ColorList(#0000ff #00ff00 #00ffff #ff0000 #ff00ff #ffff00 #ffffff);
qproperty-textColorQuotes: ColorList(#789922 #039bd5 #800000 #800080 #008080 #b10dc9 #85144b #3d9970);
}
ChatWidget QFrame#pluginTitleFrame

View file

@ -345,12 +345,16 @@ openbsd-* {
LIBS *= -rdynamic
}
################################### COMMON stuff ##################################
wikipoos {
PRE_TARGETDEPS *= $$OUT_PWD/../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
LIBS *= $$OUT_PWD/../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
LIBS *= -lglib-2.0
}
################################### HEADERS & SOURCES #############################
# Tor controller
HEADERS += TorControl/AddOnionCommand.h \