Fixed the size problem of the group tree

* Fixed the size problem of the group tree
* Added to format the Administrator as rs link for easyer contact admin.
* Format the Channel Description on the Channel posts widget for clickable links
This commit is contained in:
defnax 2018-12-23 17:58:37 +01:00
parent 3f59cfc7ea
commit 1c998e4f8e
8 changed files with 65 additions and 10 deletions

View File

@ -143,7 +143,7 @@ GroupTreeWidget::GroupTreeWidget(QWidget *parent) :
/* Initialize display button */
initDisplayMenu(ui->displayButton);
ui->treeWidget->setIconSize(QSize(S*1.6,S*1.6));
ui->treeWidget->setIconSize(QSize(S*1.8,S*1.8));
}
GroupTreeWidget::~GroupTreeWidget()
@ -405,7 +405,7 @@ QTreeWidgetItem *GroupTreeWidget::addCategoryItem(const QString &name, const QIc
int S = QFontMetricsF(font).height();
item->setSizeHint(COLUMN_NAME, QSize(S*1.1, S*1.1));
item->setSizeHint(COLUMN_NAME, QSize(S*1.9, S*1.9));
item->setForeground(COLUMN_NAME, QBrush(textColorCategory()));
nameLabel->setTextColor(textColorCategory());
item->setData(COLUMN_DATA, ROLE_COLOR, GROUPTREEWIDGET_COLOR_CATEGORY);

View File

@ -27,6 +27,8 @@
#include "util/DateTime.h"
#include "GxsGroupDialog.h"
#include "gui/common/PeerDefs.h"
#include "gui/RetroShareLink.h"
#include "retroshare/rsgxsflags.h"
#include <algorithm>
@ -445,6 +447,8 @@ void GxsGroupDialog::updateFromExistingMeta(const QString &description)
setupReadonly();
clearForm();
setGroupSignFlags(mGrpMeta.mSignFlags) ;
RetroShareLink link;
/* setup name */
ui.groupName->setText(QString::fromUtf8(mGrpMeta.mGroupName.c_str()));
@ -457,7 +461,10 @@ void GxsGroupDialog::updateFromExistingMeta(const QString &description)
ui.lastpostline->setText(tr("Never"));
else
ui.lastpostline->setText(DateTime::formatLongDateTime(mGrpMeta.mLastPost));
ui.authorLabel->setId(mGrpMeta.mAuthorId);
ui.authorLabel->setId(mGrpMeta.mAuthorId);
link = RetroShareLink::createMessage(mGrpMeta.mAuthorId, "");
ui.authorLabel->setText(link.toHtml());
ui.IDline->setText(QString::fromStdString(mGrpMeta.mGroupId.toStdString()));
ui.descriptiontextEdit->setPlainText(description);

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1237</width>
<height>1189</height>
<width>600</width>
<height>658</height>
</rect>
</property>
<property name="windowTitle">
@ -44,7 +44,7 @@
<enum>QFrame::Raised</enum>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="createmode">
<layout class="QGridLayout" name="gridLayout_8">
@ -656,6 +656,9 @@
<property name="text">
<string>GxsIdLabel</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">

View File

@ -32,6 +32,9 @@
#include "gui/settings/rsharesettings.h"
#include "gui/feeds/SubFileItem.h"
#include "gui/notifyqt.h"
#include "gui/RetroShareLink.h"
#include "util/HandleRichText.h"
#include <algorithm>
#include "util/DateTime.h"
@ -257,6 +260,8 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
bool autoDownload ;
rsGxsChannels->getChannelAutoDownload(group.mMeta.mGroupId,autoDownload);
setAutoDownload(autoDownload);
RetroShareLink link;
if (IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags)) {
ui->feedToolButton->setEnabled(true);
@ -273,9 +278,24 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
ui->infoLastPost->setText(tr("Never"));
else
ui->infoLastPost->setText(DateTime::formatLongDateTime(group.mMeta.mLastPost));
ui->infoDescription->setText(QString::fromUtf8(group.mDescription.c_str()));
QString formatDescription = QString::fromUtf8(group.mDescription.c_str());
unsigned int formatFlag = RSHTML_FORMATTEXT_EMBED_LINKS;
// embed smileys ?
if (Settings->valueFromGroup(QString("ChannelPostsWidget"), QString::fromUtf8("Emoteicons_ChannelDecription"), true).toBool()) {
formatFlag |= RSHTML_FORMATTEXT_EMBED_SMILEYS;
}
formatDescription = RsHtml().formatText(NULL, formatDescription, formatFlag);
ui->infoDescription->setText(formatDescription);
ui->infoAdministrator->setId(group.mMeta.mAuthorId) ;
link = RetroShareLink::createMessage(group.mMeta.mAuthorId, "");
ui->infoAdministrator->setText(link.toHtml());
QString distrib_string ( "[unknown]" );
@ -302,6 +322,7 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
default:
std::cerr << "(EE) badly initialised group distribution ID = " << group.mMeta.mCircleType << std::endl;
}
ui->infoDistribution->setText(distrib_string);

View File

@ -460,8 +460,8 @@
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Description&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Description&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
@ -489,6 +489,9 @@ p, li { white-space: pre-wrap; }
<property name="text">
<string>unknown</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">

View File

@ -52,4 +52,15 @@ void ChannelPage::load()
{
whileBlocking(ui.loadThreadCheckBox)->setChecked(Settings->getChannelLoadThread());
ui.groupFrameSettingsWidget->loadSettings(GroupFrameSettings::Channel);
Settings->beginGroup(QString("ChannelPostsWidget"));
whileBlocking(ui.emoteicon_checkBox)->setChecked(Settings->value("Emoteicons_ChannelDecription", true).toBool());
Settings->endGroup();
}
void ChannelPage::updateEmotes()
{
Settings->beginGroup(QString("ChannelPostsWidget"));
Settings->setValue("Emoteicons_ChannelDecription", ui.emoteicon_checkBox->isChecked());
Settings->endGroup();
}

View File

@ -40,6 +40,9 @@ public:
virtual QString pageName() const { return tr("Channels") ; }
virtual QString helpText() const { return ""; }
private slots:
void updateEmotes();
protected slots:
void updateLoadThread() ;

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>423</width>
<height>340</height>
<height>334</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_3">
@ -36,6 +36,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="emoteicon_checkBox">
<property name="text">
<string>Load Emoticons</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>