mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-27 08:25:53 -04:00
Added links colors with settings feature
This commit is contained in:
parent
5361bed037
commit
5abefa4664
23 changed files with 170 additions and 18 deletions
|
@ -34,6 +34,7 @@
|
||||||
#include "util/qtthreadsutils.h"
|
#include "util/qtthreadsutils.h"
|
||||||
#include "util/HandleRichText.h"
|
#include "util/HandleRichText.h"
|
||||||
#include "gui/Identity/IdDialog.h"
|
#include "gui/Identity/IdDialog.h"
|
||||||
|
#include "gui/settings/rsharesettings.h"
|
||||||
#include "gui/MainWindow.h"
|
#include "gui/MainWindow.h"
|
||||||
|
|
||||||
#include "ui_BoardPostDisplayWidget_compact.h"
|
#include "ui_BoardPostDisplayWidget_compact.h"
|
||||||
|
@ -235,8 +236,10 @@ void BoardPostDisplayWidgetBase::baseSetup()
|
||||||
if (urlOkay)
|
if (urlOkay)
|
||||||
{
|
{
|
||||||
QString siteurl = url.toEncoded();
|
QString siteurl = url.toEncoded();
|
||||||
|
linkColor = Settings->getLinkColor();
|
||||||
|
|
||||||
label->setStyleSheet("text-decoration: underline; color:#2255AA;");
|
QString colorstring = QString("%1;").arg(linkColor.name());
|
||||||
|
label->setStyleSheet("text-decoration: underline; color:" + colorstring );
|
||||||
label->setCursor(QCursor(Qt::PointingHandCursor));
|
label->setCursor(QCursor(Qt::PointingHandCursor));
|
||||||
label->setToolTip(siteurl);
|
label->setToolTip(siteurl);
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,8 @@ signals:
|
||||||
protected:
|
protected:
|
||||||
RsPostedPost mPost;
|
RsPostedPost mPost;
|
||||||
uint8_t mDisplayFlags;
|
uint8_t mDisplayFlags;
|
||||||
|
private:
|
||||||
|
QColor linkColor;
|
||||||
};
|
};
|
||||||
|
|
||||||
class BoardPostDisplayWidget_compact : public BoardPostDisplayWidgetBase
|
class BoardPostDisplayWidget_compact : public BoardPostDisplayWidgetBase
|
||||||
|
@ -146,6 +148,8 @@ protected:
|
||||||
void setup() override; // to be overloaded by the different views
|
void setup() override; // to be overloaded by the different views
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QColor linkColor;
|
||||||
|
|
||||||
/** Qt Designer generated object */
|
/** Qt Designer generated object */
|
||||||
Ui::BoardPostDisplayWidget_compact *ui;
|
Ui::BoardPostDisplayWidget_compact *ui;
|
||||||
};
|
};
|
||||||
|
|
|
@ -229,9 +229,14 @@ void PostedCardView::fill()
|
||||||
|
|
||||||
if (urlOkay)
|
if (urlOkay)
|
||||||
{
|
{
|
||||||
|
linkColor = Settings->getLinkColor();
|
||||||
|
QString colorstring = QString("%1;").arg(linkColor.name());
|
||||||
|
|
||||||
QString urlstr = QString("<a href=\"");
|
QString urlstr = QString("<a href=\"");
|
||||||
urlstr += QString(url.toEncoded());
|
urlstr += QString(url.toEncoded());
|
||||||
urlstr += QString("\" ><span style=\" text-decoration: underline; color:#2255AA;\"> ");
|
urlstr += QString("\" ><span style=\" text-decoration: underline; color:");
|
||||||
|
urlstr += colorstring;
|
||||||
|
urlstr += QString("\"> ");
|
||||||
urlstr += messageName();
|
urlstr += messageName();
|
||||||
urlstr += QString(" </span></a>");
|
urlstr += QString(" </span></a>");
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,8 @@ protected:
|
||||||
void toggleNotes() override;
|
void toggleNotes() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QColor linkColor;
|
||||||
|
|
||||||
/** Qt Designer generated object */
|
/** Qt Designer generated object */
|
||||||
Ui::PostedCardView *ui;
|
Ui::PostedCardView *ui;
|
||||||
};
|
};
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include "util/HandleRichText.h"
|
#include "util/HandleRichText.h"
|
||||||
#include "gui/MainWindow.h"
|
#include "gui/MainWindow.h"
|
||||||
#include "gui/Identity/IdDialog.h"
|
#include "gui/Identity/IdDialog.h"
|
||||||
|
#include "gui/settings/rsharesettings.h"
|
||||||
#include "PhotoView.h"
|
#include "PhotoView.h"
|
||||||
#include "gui/Posted/PostedDialog.h"
|
#include "gui/Posted/PostedDialog.h"
|
||||||
#include "ui_PostedItem.h"
|
#include "ui_PostedItem.h"
|
||||||
|
@ -527,7 +528,6 @@ void PostedItem::fill()
|
||||||
// The only combination that seems to work: load as EncodedUrl, extract toEncoded().
|
// The only combination that seems to work: load as EncodedUrl, extract toEncoded().
|
||||||
QByteArray urlarray(mPost.mLink.c_str());
|
QByteArray urlarray(mPost.mLink.c_str());
|
||||||
QUrl url = QUrl::fromEncoded(urlarray.trimmed());
|
QUrl url = QUrl::fromEncoded(urlarray.trimmed());
|
||||||
QString urlstr = "Invalid Link";
|
|
||||||
QString sitestr = "Invalid Link";
|
QString sitestr = "Invalid Link";
|
||||||
|
|
||||||
bool urlOkay = url.isValid();
|
bool urlOkay = url.isValid();
|
||||||
|
@ -546,9 +546,14 @@ void PostedItem::fill()
|
||||||
|
|
||||||
if (urlOkay)
|
if (urlOkay)
|
||||||
{
|
{
|
||||||
urlstr = QString("<a href=\"");
|
linkColor = Settings->getLinkColor();
|
||||||
|
QString colorstring = QString("%1;").arg(linkColor.name());
|
||||||
|
|
||||||
|
QString urlstr = QString("<a href=\"");
|
||||||
urlstr += QString(url.toEncoded());
|
urlstr += QString(url.toEncoded());
|
||||||
urlstr += QString("\" ><span style=\" text-decoration: underline; color:#2255AA;\"> ");
|
urlstr += QString("\" ><span style=\" text-decoration: underline; color:");
|
||||||
|
urlstr += colorstring;
|
||||||
|
urlstr += QString("\"> ");
|
||||||
urlstr += messageName();
|
urlstr += messageName();
|
||||||
urlstr += QString(" </span></a>");
|
urlstr += QString(" </span></a>");
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,8 @@ private slots:
|
||||||
void toggleNotes() override;
|
void toggleNotes() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QColor linkColor;
|
||||||
|
|
||||||
/** Qt Designer generated object */
|
/** Qt Designer generated object */
|
||||||
Ui::PostedItem *ui;
|
Ui::PostedItem *ui;
|
||||||
};
|
};
|
||||||
|
|
|
@ -908,7 +908,7 @@ void PostedListWidgetWithModel::insertBoardDetails(const RsPostedGroup& group)
|
||||||
ui->infoAdministrator->setId(group.mMeta.mAuthorId) ;
|
ui->infoAdministrator->setId(group.mMeta.mAuthorId) ;
|
||||||
|
|
||||||
link = RetroShareLink::createMessage(group.mMeta.mAuthorId, "");
|
link = RetroShareLink::createMessage(group.mMeta.mAuthorId, "");
|
||||||
ui->infoAdministrator->setText(link.toHtml());
|
ui->infoAdministrator->setText(link.toHtmlColored());
|
||||||
|
|
||||||
ui->createdinfolabel->setText(DateTime::formatLongDateTime(group.mMeta.mPublishTs));
|
ui->createdinfolabel->setText(DateTime::formatLongDateTime(group.mMeta.mPublishTs));
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QTextBrowser" name="trans_Description">
|
<widget class="RSTextBrowser" name="trans_Description">
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
</property>
|
</property>
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
</style></head><body style=" font-family:'.AppleSystemUIFont'; font-size:13pt; font-weight:400; font-style:normal;">
|
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:13pt; font-weight:400; font-style:normal;">
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Description</span></p></body></html></string>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Description</span></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="textInteractionFlags">
|
<property name="textInteractionFlags">
|
||||||
|
@ -619,6 +619,11 @@ p, li { white-space: pre-wrap; }
|
||||||
<header>gui/common/RSTabWidget.h</header>
|
<header>gui/common/RSTabWidget.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>RSTextBrowser</class>
|
||||||
|
<extends>QTextBrowser</extends>
|
||||||
|
<header>gui/common/RSTextBrowser.h</header>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../icons.qrc"/>
|
<include location="../icons.qrc"/>
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#include "msgs/MessageComposer.h"
|
#include "msgs/MessageComposer.h"
|
||||||
#include "Posted/PostedDialog.h"
|
#include "Posted/PostedDialog.h"
|
||||||
#include "util/misc.h"
|
#include "util/misc.h"
|
||||||
|
#include "gui/settings/rsharesettings.h"
|
||||||
|
|
||||||
#include <retroshare/rsfiles.h>
|
#include <retroshare/rsfiles.h>
|
||||||
#include <retroshare/rsgxsforums.h>
|
#include <retroshare/rsgxsforums.h>
|
||||||
|
@ -431,6 +432,8 @@ void RetroShareLink::fromUrl(const QUrl& url)
|
||||||
RetroShareLink::RetroShareLink()
|
RetroShareLink::RetroShareLink()
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
|
linkColor = Settings->getLinkColor();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RetroShareLink RetroShareLink::createFile(const QString& name, uint64_t size, const QString& hash)
|
RetroShareLink RetroShareLink::createFile(const QString& name, uint64_t size, const QString& hash)
|
||||||
|
@ -1132,6 +1135,22 @@ QString RetroShareLink::toHtml() const
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString RetroShareLink::toHtmlColored() const
|
||||||
|
{
|
||||||
|
//linkColor = Settings->getLinkColor();
|
||||||
|
QString colorstring = QString("%1;").arg(linkColor.name());
|
||||||
|
|
||||||
|
QString html = "<a href=\"" + toString() + "\"";
|
||||||
|
|
||||||
|
QString linkTitle = title();
|
||||||
|
if (!linkTitle.isEmpty()) {
|
||||||
|
html += " title=\"" + linkTitle + "\"";
|
||||||
|
}
|
||||||
|
html += "style=\"color:" + colorstring + "\"> " + niceName() + "</a>" ;
|
||||||
|
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
|
||||||
QString RetroShareLink::toHtmlFull() const
|
QString RetroShareLink::toHtmlFull() const
|
||||||
{
|
{
|
||||||
return QString("<a href=\"") + toString() + "\">" + toString() + "</a>" ;
|
return QString("<a href=\"") + toString() + "\">" + toString() + "</a>" ;
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
#include <QColor>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
@ -138,6 +139,8 @@ class RetroShareLink
|
||||||
|
|
||||||
QString toHtmlSize() const ;
|
QString toHtmlSize() const ;
|
||||||
|
|
||||||
|
QString toHtmlColored() const;
|
||||||
|
|
||||||
QUrl toUrl() const ;
|
QUrl toUrl() const ;
|
||||||
|
|
||||||
bool operator==(const RetroShareLink& l) const { return _type == l._type && _hash == l._hash ; }
|
bool operator==(const RetroShareLink& l) const { return _type == l._type && _hash == l._hash ; }
|
||||||
|
@ -176,6 +179,7 @@ class RetroShareLink
|
||||||
time_t _time_stamp ; // time stamp at which the link will expire.
|
time_t _time_stamp ; // time stamp at which the link will expire.
|
||||||
QString _radix_group_data;
|
QString _radix_group_data;
|
||||||
uint32_t _count ;
|
uint32_t _count ;
|
||||||
|
QColor linkColor;
|
||||||
|
|
||||||
unsigned int _subType; // for general use as sub type for _type (RSLINK_SUBTYPE_...)
|
unsigned int _subType; // for general use as sub type for _type (RSLINK_SUBTYPE_...)
|
||||||
};
|
};
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "util/HandleRichText.h"
|
#include "util/HandleRichText.h"
|
||||||
#include "gui/RetroShareLink.h"
|
#include "gui/RetroShareLink.h"
|
||||||
#include "util/imageutil.h"
|
#include "util/imageutil.h"
|
||||||
|
#include "gui/settings/rsharesettings.h"
|
||||||
|
|
||||||
#include <retroshare/rspeers.h>
|
#include <retroshare/rspeers.h>
|
||||||
|
|
||||||
|
@ -44,6 +45,10 @@ MimeTextEdit::MimeTextEdit(QWidget *parent)
|
||||||
mForceCompleterShowNextKeyEvent = false;
|
mForceCompleterShowNextKeyEvent = false;
|
||||||
highliter = new RsSyntaxHighlighter(this);
|
highliter = new RsSyntaxHighlighter(this);
|
||||||
mOnlyPlainText = false;
|
mOnlyPlainText = false;
|
||||||
|
|
||||||
|
linkColor = Settings->getLinkColor();
|
||||||
|
QString sheet = QString::fromLatin1("a { text-decoration: underline; color: %1 }").arg(linkColor.name());
|
||||||
|
document()->setDefaultStyleSheet(sheet);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MimeTextEdit::canInsertFromMimeData(const QMimeData* source) const
|
bool MimeTextEdit::canInsertFromMimeData(const QMimeData* source) const
|
||||||
|
|
|
@ -91,6 +91,7 @@ private:
|
||||||
RsSyntaxHighlighter *highliter;
|
RsSyntaxHighlighter *highliter;
|
||||||
bool mOnlyPlainText;
|
bool mOnlyPlainText;
|
||||||
int mMaxBytes = -1; //limit content size, for pasting images
|
int mMaxBytes = -1; //limit content size, for pasting images
|
||||||
|
QColor linkColor;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MIMETEXTEDIT_H
|
#endif // MIMETEXTEDIT_H
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "RSImageBlockWidget.h"
|
#include "RSImageBlockWidget.h"
|
||||||
#include "gui/common/FilesDefs.h"
|
#include "gui/common/FilesDefs.h"
|
||||||
#include "util/imageutil.h"
|
#include "util/imageutil.h"
|
||||||
|
#include "gui/settings/rsharesettings.h"
|
||||||
|
|
||||||
#include <retroshare/rsinit.h> //To get RsAccounts
|
#include <retroshare/rsinit.h> //To get RsAccounts
|
||||||
|
|
||||||
|
@ -50,6 +51,10 @@ RSTextBrowser::RSTextBrowser(QWidget *parent) :
|
||||||
|
|
||||||
highlighter = new RsSyntaxHighlighter(this);
|
highlighter = new RsSyntaxHighlighter(this);
|
||||||
|
|
||||||
|
linkColor = Settings->getLinkColor();
|
||||||
|
QString sheet = QString::fromLatin1("a { text-decoration: underline; color: %1 }").arg(linkColor.name());
|
||||||
|
document()->setDefaultStyleSheet(sheet);
|
||||||
|
|
||||||
connect(this, SIGNAL(anchorClicked(QUrl)), this, SLOT(linkClicked(QUrl)));
|
connect(this, SIGNAL(anchorClicked(QUrl)), this, SLOT(linkClicked(QUrl)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,8 @@ private:
|
||||||
RSImageBlockWidget *mImageBlockWidget;
|
RSImageBlockWidget *mImageBlockWidget;
|
||||||
bool mLinkClickActive;
|
bool mLinkClickActive;
|
||||||
RsSyntaxHighlighter *highlighter;
|
RsSyntaxHighlighter *highlighter;
|
||||||
|
QColor linkColor;
|
||||||
|
|
||||||
QList<QAction*> mContextMenuActions;
|
QList<QAction*> mContextMenuActions;
|
||||||
#ifdef RSTEXTBROWSER_CHECKIMAGE_DEBUG
|
#ifdef RSTEXTBROWSER_CHECKIMAGE_DEBUG
|
||||||
QRect mCursorRectStart;
|
QRect mCursorRectStart;
|
||||||
|
|
|
@ -328,7 +328,7 @@ void GxsForumMsgItem::fillParentMessage()
|
||||||
ui->parentFrame->hide();
|
ui->parentFrame->hide();
|
||||||
|
|
||||||
RetroShareLink linkParent = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_FORUM, mParentMessage.mMeta.mGroupId, mParentMessage.mMeta.mMsgId, QString::fromUtf8(mParentMessage.mMeta.mMsgName.c_str()));
|
RetroShareLink linkParent = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_FORUM, mParentMessage.mMeta.mGroupId, mParentMessage.mMeta.mMsgId, QString::fromUtf8(mParentMessage.mMeta.mMsgName.c_str()));
|
||||||
ui->parentSubLabel->setText(linkParent.toHtml());
|
ui->parentSubLabel->setText(linkParent.toHtmlColored());
|
||||||
ui->parentMsgLabel->setText(RsHtml().formatText(NULL, QString::fromUtf8(mParentMessage.mMsg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
|
ui->parentMsgLabel->setText(RsHtml().formatText(NULL, QString::fromUtf8(mParentMessage.mMsg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
|
||||||
ui->parentNameLabel->setId(mParentMessage.mMeta.mAuthorId);
|
ui->parentNameLabel->setId(mParentMessage.mMeta.mAuthorId);
|
||||||
|
|
||||||
|
@ -358,7 +358,7 @@ void GxsForumMsgItem::fillMessage()
|
||||||
|
|
||||||
QString title = tr("Forum Feed") + ": ";
|
QString title = tr("Forum Feed") + ": ";
|
||||||
RetroShareLink link = RetroShareLink::createGxsGroupLink(RetroShareLink::TYPE_FORUM, mMessage.mMeta.mGroupId, groupName());
|
RetroShareLink link = RetroShareLink::createGxsGroupLink(RetroShareLink::TYPE_FORUM, mMessage.mMeta.mGroupId, groupName());
|
||||||
title += link.toHtml();
|
title += link.toHtmlColored();
|
||||||
ui->titleLabel->setText(title);
|
ui->titleLabel->setText(title);
|
||||||
|
|
||||||
setReadStatus(IS_MSG_NEW(mMessage.mMeta.mMsgStatus), IS_MSG_UNREAD(mMessage.mMeta.mMsgStatus) || IS_MSG_NEW(mMessage.mMeta.mMsgStatus));
|
setReadStatus(IS_MSG_NEW(mMessage.mMeta.mMsgStatus), IS_MSG_UNREAD(mMessage.mMeta.mMsgStatus) || IS_MSG_NEW(mMessage.mMeta.mMsgStatus));
|
||||||
|
@ -379,14 +379,14 @@ void GxsForumMsgItem::fillMessage()
|
||||||
ui->currNameLabel->setId(mMessage.mMeta.mAuthorId);
|
ui->currNameLabel->setId(mMessage.mMeta.mAuthorId);
|
||||||
|
|
||||||
RetroShareLink msgLink = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_FORUM, mMessage.mMeta.mGroupId, mMessage.mMeta.mMsgId, messageName());
|
RetroShareLink msgLink = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_FORUM, mMessage.mMeta.mGroupId, mMessage.mMeta.mMsgId, messageName());
|
||||||
ui->currSubLabel->setText(msgLink.toHtml());
|
ui->currSubLabel->setText(msgLink.toHtmlColored());
|
||||||
if (wasExpanded() || ui->expandFrame->isVisible())
|
if (wasExpanded() || ui->expandFrame->isVisible())
|
||||||
fillExpandFrame();
|
fillExpandFrame();
|
||||||
|
|
||||||
ui->timestamplabel->setText(DateTime::formatLongDateTime(mMessage.mMeta.mPublishTs));
|
ui->timestamplabel->setText(DateTime::formatLongDateTime(mMessage.mMeta.mPublishTs));
|
||||||
|
|
||||||
/* header stuff */
|
/* header stuff */
|
||||||
ui->subjectLabel->setText(msgLink.toHtml());
|
ui->subjectLabel->setText(msgLink.toHtmlColored());
|
||||||
|
|
||||||
if (mIsHome)
|
if (mIsHome)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1327,7 +1327,7 @@ void GxsChannelPostsWidgetWithModel::insertChannelDetails(const RsGxsChannelGrou
|
||||||
if(!group.mMeta.mAuthorId.isNull())
|
if(!group.mMeta.mAuthorId.isNull())
|
||||||
{
|
{
|
||||||
RetroShareLink link = RetroShareLink::createMessage(group.mMeta.mAuthorId, "");
|
RetroShareLink link = RetroShareLink::createMessage(group.mMeta.mAuthorId, "");
|
||||||
ui->infoAdministrator->setText(link.toHtml());
|
ui->infoAdministrator->setText(link.toHtmlColored());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ui->infoAdministrator->setText("[No contact author]");
|
ui->infoAdministrator->setText("[No contact author]");
|
||||||
|
|
|
@ -397,12 +397,12 @@
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTextBrowser" name="infoDescription">
|
<widget class="RSTextBrowser" name="infoDescription">
|
||||||
<property name="html">
|
<property name="html">
|
||||||
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
</style></head><body style=" font-family:'.AppleSystemUIFont'; font-size:13pt; font-weight:400; font-style:normal;">
|
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:13pt; font-weight:400; font-style:normal;">
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Description</span></p></body></html></string>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Description</span></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="textInteractionFlags">
|
<property name="textInteractionFlags">
|
||||||
|
@ -548,7 +548,7 @@ p, li { white-space: pre-wrap; }
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTextBrowser" name="postDetails_TE">
|
<widget class="RSTextBrowser" name="postDetails_TE">
|
||||||
<property name="openExternalLinks">
|
<property name="openExternalLinks">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
@ -679,6 +679,11 @@ p, li { white-space: pre-wrap; }
|
||||||
<extends>QToolButton</extends>
|
<extends>QToolButton</extends>
|
||||||
<header>gui/common/SubscribeToolButton.h</header>
|
<header>gui/common/SubscribeToolButton.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>RSTextBrowser</class>
|
||||||
|
<extends>QTextBrowser</extends>
|
||||||
|
<header>gui/common/RSTextBrowser.h</header>
|
||||||
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>GxsCommentDialog</class>
|
<class>GxsCommentDialog</class>
|
||||||
<extends>QWidget</extends>
|
<extends>QWidget</extends>
|
||||||
|
|
|
@ -704,7 +704,7 @@ void MessageWidget::fill(const std::string &msgId)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui.fromText->setText(link.toHtml());
|
ui.fromText->setText(link.toHtmlColored());
|
||||||
ui.fromText->setToolTip(tooltip_string) ;
|
ui.fromText->setToolTip(tooltip_string) ;
|
||||||
if (toolButtonReply) toolButtonReply->setEnabled(true);
|
if (toolButtonReply) toolButtonReply->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,6 +144,7 @@ void ChatPage::updateChatSearchParams()
|
||||||
Settings->setChatSearchSearchWithoutLimit(ui.cbSearch_WithoutLimit->isChecked());
|
Settings->setChatSearchSearchWithoutLimit(ui.cbSearch_WithoutLimit->isChecked());
|
||||||
Settings->setChatSearchMaxSearchLimitColor(ui.sbSearch_MaxLimitColor->value());
|
Settings->setChatSearchMaxSearchLimitColor(ui.sbSearch_MaxLimitColor->value());
|
||||||
Settings->setChatSearchFoundColor(rgbChatSearchFoundColor);
|
Settings->setChatSearchFoundColor(rgbChatSearchFoundColor);
|
||||||
|
Settings->setLinkColor(rgbLinkColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatPage::updateDefaultLobbyIdentity()
|
void ChatPage::updateDefaultLobbyIdentity()
|
||||||
|
@ -435,6 +436,11 @@ ChatPage::load()
|
||||||
pix.fill(rgbChatSearchFoundColor);
|
pix.fill(rgbChatSearchFoundColor);
|
||||||
ui.btSearch_FoundColor->setIcon(pix);
|
ui.btSearch_FoundColor->setIcon(pix);
|
||||||
|
|
||||||
|
rgbLinkColor=Settings->getLinkColor();
|
||||||
|
QPixmap colorpix(24, 24);
|
||||||
|
colorpix.fill(rgbLinkColor);
|
||||||
|
ui.linkColorButton->setIcon(colorpix);
|
||||||
|
|
||||||
whileBlocking(ui.publicChatLoadCount)->setValue(Settings->getPublicChatHistoryCount());
|
whileBlocking(ui.publicChatLoadCount)->setValue(Settings->getPublicChatHistoryCount());
|
||||||
whileBlocking(ui.privateChatLoadCount)->setValue(Settings->getPrivateChatHistoryCount());
|
whileBlocking(ui.privateChatLoadCount)->setValue(Settings->getPrivateChatHistoryCount());
|
||||||
whileBlocking(ui.lobbyChatLoadCount)->setValue(Settings->getLobbyChatHistoryCount());
|
whileBlocking(ui.lobbyChatLoadCount)->setValue(Settings->getLobbyChatHistoryCount());
|
||||||
|
@ -695,6 +701,19 @@ void ChatPage::on_btSearch_FoundColor_clicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ChatPage::on_linkColorButton_clicked()
|
||||||
|
{
|
||||||
|
bool ok;
|
||||||
|
QRgb color = QColorDialog::getRgba(rgbLinkColor, &ok, window());
|
||||||
|
if (ok) {
|
||||||
|
rgbLinkColor=color;
|
||||||
|
QPixmap pix(24, 24);
|
||||||
|
pix.fill(color);
|
||||||
|
ui.linkColorButton->setIcon(pix);
|
||||||
|
Settings->setLinkColor(rgbLinkColor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ChatPage::distantChatComboBoxChanged(int i)
|
void ChatPage::distantChatComboBoxChanged(int i)
|
||||||
{
|
{
|
||||||
switch(i)
|
switch(i)
|
||||||
|
|
|
@ -56,6 +56,7 @@ class ChatPage : public ConfigPage
|
||||||
|
|
||||||
void on_cbSearch_WithoutLimit_toggled(bool);
|
void on_cbSearch_WithoutLimit_toggled(bool);
|
||||||
void on_btSearch_FoundColor_clicked();
|
void on_btSearch_FoundColor_clicked();
|
||||||
|
void on_linkColorButton_clicked();
|
||||||
|
|
||||||
void distantChatComboBoxChanged(int);
|
void distantChatComboBoxChanged(int);
|
||||||
|
|
||||||
|
@ -86,6 +87,7 @@ class ChatPage : public ConfigPage
|
||||||
QString historyStyleVariant;
|
QString historyStyleVariant;
|
||||||
|
|
||||||
QRgb rgbChatSearchFoundColor;
|
QRgb rgbChatSearchFoundColor;
|
||||||
|
QRgb rgbLinkColor;
|
||||||
|
|
||||||
/** Qt Designer generated object */
|
/** Qt Designer generated object */
|
||||||
Ui::ChatPage ui;
|
Ui::ChatPage ui;
|
||||||
|
|
|
@ -266,6 +266,19 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -477,6 +490,45 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Link Color</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_17">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_10">
|
||||||
|
<property name="text">
|
||||||
|
<string>Color of the links</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="linkColorButton">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Set link color</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>312</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="rightVSpacer">
|
<spacer name="rightVSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
|
|
@ -1222,6 +1222,15 @@ void RshareSettings::setMessageFontSize(int value)
|
||||||
setValueToGroup("Message", "FontSize", value);
|
setValueToGroup("Message", "FontSize", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RshareSettings::setLinkColor(QRgb rgbValue)
|
||||||
|
{
|
||||||
|
setValueToGroup("Chat", "LinkColor", QString::number(rgbValue));
|
||||||
|
}
|
||||||
|
QRgb RshareSettings::getLinkColor()
|
||||||
|
{
|
||||||
|
return valueFromGroup("Chat", "LinkColor", QString::number(QColor(3, 155, 198).rgba())).toUInt();
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef RS_JSONAPI
|
#ifdef RS_JSONAPI
|
||||||
bool RshareSettings::getJsonApiEnabled()
|
bool RshareSettings::getJsonApiEnabled()
|
||||||
{
|
{
|
||||||
|
|
|
@ -349,6 +349,9 @@ public:
|
||||||
int getMessageFontSize();
|
int getMessageFontSize();
|
||||||
void setMessageFontSize(int value);
|
void setMessageFontSize(int value);
|
||||||
|
|
||||||
|
void setLinkColor(QRgb rgbValue);
|
||||||
|
QRgb getLinkColor();
|
||||||
|
|
||||||
#ifdef RS_JSONAPI
|
#ifdef RS_JSONAPI
|
||||||
bool getJsonApiEnabled();
|
bool getJsonApiEnabled();
|
||||||
void setJsonApiEnabled(bool enabled);
|
void setJsonApiEnabled(bool enabled);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue