diff --git a/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp b/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp index a77916079..11d318699 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp @@ -22,6 +22,7 @@ */ #include "GxsIdChooser.h" +#include "GxsIdDetails.h" #include #include @@ -63,41 +64,18 @@ bool GxsIdChooser::MakeIdDesc(const RsGxsId &id, QString &desc) { RsIdentityDetails details; - bool found = rsIdentity->getIdDetails(id, details); - if (found) + std::list icons; + if (!GxsIdDetails::MakeIdDesc(id, false, desc, icons)) { - desc = QString::fromUtf8(details.mNickname.c_str()); - - std::list::iterator it; - for(it = details.mRecognTags.begin(); it != details.mRecognTags.end(); it++) + if (mTimerCount > MAX_TRY) { - desc += " ("; - desc += QString::number(it->tag_class); - desc += ":"; - desc += QString::number(it->tag_type); - desc += ")"; - } - - if (details.mPgpLinked) - { - desc += " (PGP) ["; - } - else - { - desc += " (Anon) ["; - } - } else { - if (mTimerCount <= MAX_TRY) { - desc = QString("%1 ... [").arg(tr("Loading")); - } else { desc = QString("%1 ... [").arg(tr("Not found")); + desc += QString::fromStdString(id.substr(0,5)); + desc += "...]"; } + return false; } - - desc += QString::fromStdString(id.substr(0,5)); - desc += "...]"; - - return found; + return true; } void GxsIdChooser::addPrivateId(const RsGxsId &gxsId, bool replace) diff --git a/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp b/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp new file mode 100644 index 000000000..cd715a1b7 --- /dev/null +++ b/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp @@ -0,0 +1,216 @@ +/* + * Retroshare Gxs Support + * + * Copyright 2012-2013 by Robert Fernie. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License Version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + * + * Please report all bugs and problems to "retroshare@lunamutt.com". + * + */ + +#include "GxsIdDetails.h" + +#include + +#include +#include +#include + + +/* Images for tag icons */ +#define IMAGE_LOADING ":/images/folder-draft.png" +#define IMAGE_PGPKNOWN ":/images/vote_up.png" +#define IMAGE_PGPUNKNOWN ":/images/vote_up.png" +#define IMAGE_ANON ":/images/vote_down.png" + +#define IMAGE_DEV_AMBASSADOR ":/images/vote_down.png" +#define IMAGE_DEV_CONTRIBUTOR ":/images/vote_down.png" +#define IMAGE_DEV_TRANSLATOR ":/images/vote_down.png" +#define IMAGE_DEV_PATCHER ":/images/vote_down.png" +#define IMAGE_DEV_DEVELOPER ":/images/vote_down.png" + +static const int IconSize = 20; + +const int kRecognTagClass_DEVELOPMENT = 1; + +const int kRecognTagType_Dev_Ambassador = 1; +const int kRecognTagType_Dev_Contributor = 2; +const int kRecognTagType_Dev_Translator = 3; +const int kRecognTagType_Dev_Patcher = 4; +const int kRecognTagType_Dev_Developer = 5; + + +static bool findTagIcon(int tag_class, int tag_type, QIcon &icon) +{ + switch(tag_class) + { + default: + case 0: + icon = QIcon(IMAGE_DEV_AMBASSADOR); + break; + case 1: + icon = QIcon(IMAGE_DEV_CONTRIBUTOR); + break; + } + return true; +} + + +static bool CreateIdIcon(const std::string &id, QIcon &idIcon) +{ + QPixmap image(IconSize, IconSize); + QPainter painter(&image); + + painter.fillRect(0, 0, IconSize, IconSize, Qt::black); + + int len = id.length(); + for(int i = 0; i + 1 < len; i += 2) + { + char hex1 = id[i]; + char hex2 = id[i+1]; + int x = (hex1 >= 'a') ? (hex1 - 'a' + 10) : (hex1 - '0'); + int y = (hex2 >= 'a') ? (hex2 - 'a' + 10) : (hex2 - '0'); + painter.fillRect(x, y, x+1, y+1, Qt::green); + } + idIcon = QIcon(image); + return true; +} + + +bool GxsIdDetails::MakeIdDesc(const RsGxsId &id, bool doIcons, QString &str, std::list &icons) +{ + RsIdentityDetails details; + + if (!rsIdentity->getIdDetails(id, details)) + { + std::cerr << "GxsIdTreeWidget::MakeIdDesc() FAILED TO GET ID"; + std::cerr << std::endl; + + str = QObject::tr("Loading... ") + QString::fromStdString(id.substr(0,5)); + + if (!doIcons) + { + QIcon baseIcon = QIcon(IMAGE_LOADING); + icons.push_back(baseIcon); + } + + return false; + } + + str = QString::fromUtf8(details.mNickname.c_str()); + + std::list::iterator it; + for(it = details.mRecognTags.begin(); it != details.mRecognTags.end(); it++) + { + str += " ("; + str += QString::number(it->tag_class); + str += ":"; + str += QString::number(it->tag_type); + str += ")"; + } + + + bool addCode = true; + if (details.mPgpLinked) + { + str += " (PGP) ["; + if (details.mPgpKnown) + { + /* look up real name */ + std::string authorName = rsPeers->getPeerName(details.mPgpId); + str += QString::fromUtf8(authorName.c_str()); + str += "]"; + + addCode = false; + } + } + else + { + str += " (Anon) ["; + } + + if (addCode) + { + str += QString::fromStdString(id.substr(0,5)); + str += "...]"; + } + + if (!doIcons) + { + return true; + } + + QIcon idIcon; + CreateIdIcon(id, idIcon); + icons.push_back(idIcon); + + // ICON Logic. + QIcon baseIcon; + if (details.mPgpLinked) + { + if (details.mPgpKnown) + { + baseIcon = QIcon(IMAGE_PGPKNOWN); + } + else + { + baseIcon = QIcon(IMAGE_PGPUNKNOWN); + } + } + else + { + baseIcon = QIcon(IMAGE_ANON); + } + + icons.push_back(baseIcon); + // Add In RecognTags Icons. + for(it = details.mRecognTags.begin(); it != details.mRecognTags.end(); it++) + { + QIcon tagIcon; + if (findTagIcon(it->tag_class, it->tag_type, tagIcon)) + { + icons.push_back(tagIcon); + } + } + + icons.push_back(QIcon(IMAGE_ANON)); + icons.push_back(QIcon(IMAGE_ANON)); + icons.push_back(QIcon(IMAGE_ANON)); + + std::cerr << "GxsIdTreeWidget::MakeIdDesc() ID Ok"; + std::cerr << std::endl; + + return true; +} + +bool GxsIdDetails::GenerateCombinedIcon(QIcon &outIcon, std::list &icons) +{ + int count = icons.size(); + QPixmap image(IconSize * count, IconSize); + QPainter painter(&image); + + painter.fillRect(0, 0, IconSize * count, IconSize, Qt::transparent); + std::list::iterator it; + int i = 0; + for(it = icons.begin(); it != icons.end(); it++, i++) + { + it->paint(&painter, IconSize * i, 0, IconSize, IconSize); + } + + outIcon = QIcon(image); + return true; +} + diff --git a/retroshare-gui/src/gui/gxs/GxsIdDetails.h b/retroshare-gui/src/gui/gxs/GxsIdDetails.h new file mode 100644 index 000000000..ef966ad76 --- /dev/null +++ b/retroshare-gui/src/gui/gxs/GxsIdDetails.h @@ -0,0 +1,42 @@ +/* + * Retroshare Gxs Support + * + * Copyright 2012-2013 by Robert Fernie. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License Version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + * + * Please report all bugs and problems to "retroshare@lunamutt.com". + * + */ + +#ifndef _GXS_ID_DETAILS_H +#define _GXS_ID_DETAILS_H + +#include +#include +#include +#include + +namespace GxsIdDetails +{ + + bool MakeIdDesc(const RsGxsId &id, bool doIcons, + QString &desc, std::list &icons); + + bool GenerateCombinedIcon(QIcon &outIcon, std::list &icons); + +} // namespace GxsIdDetails. + +#endif diff --git a/retroshare-gui/src/gui/gxs/GxsIdLabel.cpp b/retroshare-gui/src/gui/gxs/GxsIdLabel.cpp index 12373f212..dc0eded55 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdLabel.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdLabel.cpp @@ -22,6 +22,7 @@ */ #include "GxsIdLabel.h" +#include "GxsIdDetails.h" #include @@ -59,56 +60,6 @@ bool GxsIdLabel::getId(RsGxsId &id) return true; } -static bool MakeIdDesc(const RsGxsId &id, QString &str) -{ - RsIdentityDetails details; - - if (!rsIdentity->getIdDetails(id, details)) - { - str = "Loading... " + QString::fromStdString(id.substr(0,5)); - return false; - } - - str = QString::fromUtf8(details.mNickname.c_str()); - - std::list::iterator it; - for(it = details.mRecognTags.begin(); it != details.mRecognTags.end(); it++) - { - str += " ("; - str += QString::number(it->tag_class); - str += ":"; - str += QString::number(it->tag_type); - str += ")"; - } - - bool addCode = true; - if (details.mPgpLinked) - { - str += " (PGP) ["; - if (details.mPgpKnown) - { - /* look up real name */ - std::string authorName = rsPeers->getPeerName(details.mPgpId); - str += QString::fromUtf8(authorName.c_str()); - str += "]"; - - addCode = false; - } - } - else - { - str += " (Anon) ["; - } - - if (addCode) - { - str += QString::fromStdString(id.substr(0,5)); - str += "...]"; - } - - return true; -} - #define MAX_ATTEMPTS 3 void GxsIdLabel::loadId() @@ -117,7 +68,8 @@ void GxsIdLabel::loadId() /* try and get details - if not there ... set callback */ QString desc; - bool loaded = MakeIdDesc(mId, desc); + std::list icons; + bool loaded = GxsIdDetails::MakeIdDesc(mId, false, desc, icons); setText(desc); diff --git a/retroshare-gui/src/gui/gxs/GxsIdTreeWidget.cpp b/retroshare-gui/src/gui/gxs/GxsIdTreeWidget.cpp new file mode 100644 index 000000000..d75c8820f --- /dev/null +++ b/retroshare-gui/src/gui/gxs/GxsIdTreeWidget.cpp @@ -0,0 +1,173 @@ +/* + * Retroshare Gxs Support + * + * Copyright 2012-2013 by Robert Fernie. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License Version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + * + * Please report all bugs and problems to "retroshare@lunamutt.com". + * + */ + +#include "GxsIdTreeWidget.h" +#include "GxsIdDetails.h" + +#include +#include + +#include + +#include + +static void paintGxsId( QPainter * painter, + const QStyleOptionViewItem & option /*, const QRect &rect */, const RsGxsId &id ) +{ + QString desc; + std::list icons; + if (!GxsIdDetails::MakeIdDesc(id, true, desc, icons)) + { + /* flag for reloading */ + } + + const QRect &rect = option.rect; + int x = rect.left(); + int y = rect.top(); + int height = rect.height(); + int width = rect.width(); + + + std::list::iterator it; + const int IconSize = 15; + int i = 0; + for(it = icons.begin(); it != icons.end(); it++, i++) + { + it->paint(painter, x, y, IconSize, IconSize); + x += IconSize; + } + +#define DELTA_X 4 + QRect textRect = rect.adjusted(DELTA_X + IconSize * i, 0, 0, 0); + painter->drawText(textRect, 0, desc, NULL); +} + + +GxsIdItemDelegate::GxsIdItemDelegate(GxsIdTreeWidget *tree, int col, QObject *parent) +:QStyledItemDelegate(parent), mTree(tree), mGxsIdColumn(col) +{ + return; +} + +void GxsIdItemDelegate::paint( QPainter * painter, + const QStyleOptionViewItem & option, const QModelIndex & index ) const +{ + std::cerr << "GxsIdItemDelegate::paint()"; + std::cerr << std::endl; + + RsGxsId id = mTree->ItemTextFromIndex(index, mGxsIdColumn).toStdString(); + paintGxsId(painter, option, id); +} + +QSize GxsIdItemDelegate::sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const +{ + std::cerr << "GxsIdItemDelegate::sizeHint()"; + std::cerr << std::endl; + + return QStyledItemDelegate::sizeHint(option, index); +} + +/******************************************************************/ + +GxsIdRSItemDelegate::GxsIdRSItemDelegate(GxsIdRSTreeWidget *tree, int col, QObject *parent) +:QStyledItemDelegate(parent), mTree(tree), mGxsIdColumn(col) +{ + return; +} + +void GxsIdRSItemDelegate::paint( QPainter * painter, + const QStyleOptionViewItem & option, const QModelIndex & index ) const +{ + std::cerr << "GxsIdRSItemDelegate::paint()"; + std::cerr << std::endl; + + RsGxsId id = mTree->ItemTextFromIndex(index, mGxsIdColumn).toStdString(); + paintGxsId(painter, option, id); +} + +QSize GxsIdRSItemDelegate::sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const +{ + std::cerr << "GxsIdRSItemDelegate::sizeHint()"; + std::cerr << std::endl; + + return QStyledItemDelegate::sizeHint(option, index); +} + +/******************************************************************/ + +GxsIdTreeWidget::GxsIdTreeWidget(QWidget *parent) +:QTreeWidget(parent), mIdDelegate(NULL) +{ + return; +} + + +void GxsIdTreeWidget::setGxsIdColumn(int col) +{ + mIdDelegate = new GxsIdItemDelegate(this, col, this); + setItemDelegateForColumn(col, mIdDelegate); +} + + +QString GxsIdTreeWidget::ItemTextFromIndex(const QModelIndex & index, int column ) const +{ + // get real item. + QTreeWidgetItem *item = itemFromIndex(index); + if (!item) + { + std::cerr << "GxsIdTreeWidget::ItemTextFromIndex() Invalid Item"; + std::cerr << std::endl; + QString text; + return text; + } + return item->text(column); +} + + +GxsIdRSTreeWidget::GxsIdRSTreeWidget(QWidget *parent) +:RSTreeWidget(parent), mIdDelegate(NULL) +{ + return; +} + +void GxsIdRSTreeWidget::setGxsIdColumn(int col) +{ + mIdDelegate = new GxsIdRSItemDelegate(this, col, this); + setItemDelegateForColumn(col, mIdDelegate); +} + + +QString GxsIdRSTreeWidget::ItemTextFromIndex(const QModelIndex & index, int column ) const +{ + // get real item. + QTreeWidgetItem *item = itemFromIndex(index); + if (!item) + { + std::cerr << "GxsIdTreeWidget::ItemTextFromIndex() Invalid Item"; + std::cerr << std::endl; + QString text; + return text; + } + return item->text(column); +} + diff --git a/retroshare-gui/src/gui/gxs/GxsIdTreeWidget.h b/retroshare-gui/src/gui/gxs/GxsIdTreeWidget.h new file mode 100644 index 000000000..423f82664 --- /dev/null +++ b/retroshare-gui/src/gui/gxs/GxsIdTreeWidget.h @@ -0,0 +1,96 @@ +/* + * Retroshare Gxs Support + * + * Copyright 2012-2013 by Robert Fernie. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License Version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + * + * Please report all bugs and problems to "retroshare@lunamutt.com". + * + */ + +#ifndef _GXS_ID_TREEWIDGET_H +#define _GXS_ID_TREEWIDGET_H + +#include +#include + +#include "gui/common/RSTreeWidget.h" + +/***** + * To draw multiple fancy Icons, and refresh IDs properly we need + * to overload QTreeWidget, and provide a QItemDelegate to draw stuff. + * + * The ItemDelegate + * + ****/ + +class GxsIdTreeWidget; +class GxsIdRSTreeWidget; + +class GxsIdItemDelegate : public QStyledItemDelegate +{ + public: + GxsIdItemDelegate(GxsIdTreeWidget *tree, int gxsIdColumn, QObject *parent = 0); + virtual void paint ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const; + virtual QSize sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const; + + private: + GxsIdTreeWidget *mTree; + int mGxsIdColumn; +}; + + +class GxsIdRSItemDelegate : public QStyledItemDelegate +{ + public: + GxsIdRSItemDelegate(GxsIdRSTreeWidget *tree, int gxsIdColumn, QObject *parent = 0); + virtual void paint ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const; + virtual QSize sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const; + + private: + GxsIdRSTreeWidget *mTree; + int mGxsIdColumn; +}; + + +class GxsIdTreeWidget : public QTreeWidget +{ +public: + GxsIdTreeWidget(QWidget *parent = NULL); + virtual ~GxsIdTreeWidget() { return; } + +void setGxsIdColumn(int col); +QString ItemTextFromIndex(const QModelIndex & index, int column ) const; + +private: + GxsIdItemDelegate *mIdDelegate; +}; + + +class GxsIdRSTreeWidget : public RSTreeWidget +{ +public: + GxsIdRSTreeWidget(QWidget *parent = NULL); + virtual ~GxsIdRSTreeWidget() { return; } + +void setGxsIdColumn(int col); +QString ItemTextFromIndex(const QModelIndex & index, int column ) const; + +private: + GxsIdRSItemDelegate *mIdDelegate; +}; + +#endif diff --git a/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.cpp b/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.cpp index fcba60a52..f53fa5c08 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.cpp @@ -22,6 +22,8 @@ */ #include "GxsIdTreeWidgetItem.h" +#include "GxsIdDetails.h" + #include "rshare.h" #include @@ -30,63 +32,6 @@ #define MAX_ATTEMPTS 5 -static bool MakeIdDesc(const RsGxsId &id, QString &str) -{ - RsIdentityDetails details; - - if (!rsIdentity->getIdDetails(id, details)) - { - std::cerr << "GxsIdRSTreeWidgetItem::MakeIdDesc() FAILED TO GET ID"; - std::cerr << std::endl; - - str = "Loading... " + QString::fromStdString(id.substr(0,5)); - return false; - } - - str = QString::fromUtf8(details.mNickname.c_str()); - - std::list::iterator it; - for(it = details.mRecognTags.begin(); it != details.mRecognTags.end(); it++) - { - str += " ("; - str += QString::number(it->tag_class); - str += ":"; - str += QString::number(it->tag_type); - str += ")"; - } - - - bool addCode = true; - if (details.mPgpLinked) - { - str += " (PGP) ["; - if (details.mPgpKnown) - { - /* look up real name */ - std::string authorName = rsPeers->getPeerName(details.mPgpId); - str += QString::fromUtf8(authorName.c_str()); - str += "]"; - - addCode = false; - } - } - else - { - str += " (Anon) ["; - } - - if (addCode) - { - str += QString::fromStdString(id.substr(0,5)); - str += "...]"; - } - - std::cerr << "GxsIdRSTreeWidgetItem::MakeIdDesc() ID Ok"; - std::cerr << std::endl; - - return true; -} - /** Constructor */ GxsIdRSTreeWidgetItem::GxsIdRSTreeWidgetItem(const RSTreeWidgetItemCompareRole *compareRole, QTreeWidget *parent) : QObject(NULL), RSTreeWidgetItem(compareRole, parent), mCount(0), mColumn(0) @@ -138,7 +83,14 @@ void GxsIdRSTreeWidgetItem::loadId() /* try and get details - if not there ... set callback */ QString desc; - bool loaded = MakeIdDesc(mId, desc); + std::list icons; + bool loaded = GxsIdDetails::MakeIdDesc(mId, true, desc, icons); + QIcon combinedIcon; + if (!icons.empty()) + { + GxsIdDetails::GenerateCombinedIcon(combinedIcon, icons); + setIcon(mColumn, combinedIcon); + } setText(mColumn, desc); @@ -210,8 +162,15 @@ void GxsIdTreeWidgetItem::loadId() /* try and get details - if not there ... set callback */ QString desc; - bool loaded = MakeIdDesc(mId, desc); - + std::list icons; + bool loaded = GxsIdDetails::MakeIdDesc(mId, true, desc, icons); + QIcon combinedIcon; + if (!icons.empty()) + { + GxsIdDetails::GenerateCombinedIcon(combinedIcon, icons); + setIcon(mColumn, combinedIcon); + } + setText(mColumn, desc); if (loaded) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index e8241a272..eaeac80de 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -193,6 +193,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const std::string &forumId, QWidget * // mTimer->start(); mFillThread = NULL; + ui->threadTreeWidget->setGxsIdColumn(COLUMN_THREAD_AUTHOR); setForumId(forumId); @@ -803,7 +804,8 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum item->setText(COLUMN_THREAD_DATE, text); item->setData(COLUMN_THREAD_DATE, ROLE_THREAD_SORT, sort); - item->setId(msg.mMeta.mAuthorId, COLUMN_THREAD_AUTHOR); + item->setText(COLUMN_THREAD_AUTHOR, QString::fromStdString(msg.mMeta.mAuthorId)); + //item->setId(msg.mMeta.mAuthorId, COLUMN_THREAD_AUTHOR); //#TODO #if 0 text = QString::fromUtf8(authorName.c_str()); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui index d2956ae81..58980fd45 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui @@ -153,7 +153,7 @@ - + 9 @@ -519,9 +519,9 @@
gui/common/LineEditClear.h
- RSTreeWidget + GxsIdRSTreeWidget QTreeWidget -
gui/common/RSTreeWidget.h
+
gui/gxs/GxsIdTreeWidget.h
diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index 0ccd9e3b7..f314e4e0f 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -1175,10 +1175,12 @@ gxsgui { HEADERS += gui/gxs/GxsGroupDialog.h \ gui/gxs/WikiGroupDialog.h \ + gui/gxs/GxsIdDetails.h \ gui/gxs/GxsIdChooser.h \ gui/gxs/GxsIdLabel.h \ gui/gxs/GxsCircleChooser.h \ gui/gxs/GxsCircleLabel.h \ + gui/gxs/GxsIdTreeWidget.h \ gui/gxs/GxsIdTreeWidgetItem.h \ gui/gxs/GxsCommentTreeWidget.h \ gui/gxs/GxsCommentContainer.h \ @@ -1203,10 +1205,12 @@ gxsgui { SOURCES += gui/gxs/GxsGroupDialog.cpp \ gui/gxs/WikiGroupDialog.cpp \ + gui/gxs/GxsIdDetails.cpp \ gui/gxs/GxsIdChooser.cpp \ gui/gxs/GxsIdLabel.cpp \ gui/gxs/GxsCircleChooser.cpp \ gui/gxs/GxsCircleLabel.cpp \ + gui/gxs/GxsIdTreeWidget.cpp \ gui/gxs/GxsIdTreeWidgetItem.cpp \ gui/gxs/GxsCommentTreeWidget.cpp \ gui/gxs/GxsCommentContainer.cpp \