mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-15 01:17:16 -05:00
Added new compact style for chat.
Improved the HTML optimizer. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4867 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
55d53e6dd4
commit
602ae72d7d
@ -370,7 +370,10 @@ void FriendsDialog::addChatMsg(bool incoming, bool history, const QString &name,
|
|||||||
type = ChatStyle::FORMATMSG_OUTGOING;
|
type = ChatStyle::FORMATMSG_OUTGOING;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QString formatMsg = style.formatMessage(type, name, incoming ? recvTime : sendTime, message, formatFlag);
|
// Remove <p>'s from older RetroShare versions before 31.01.2012 (can be removed later)
|
||||||
|
QString optimizedMessage = message;
|
||||||
|
RsHtml::optimizeHtml(optimizedMessage);
|
||||||
|
QString formatMsg = style.formatMessage(type, name, incoming ? recvTime : sendTime, optimizedMessage, formatFlag);
|
||||||
|
|
||||||
ui.msgText->append(formatMsg);
|
ui.msgText->append(formatMsg);
|
||||||
}
|
}
|
||||||
|
@ -435,24 +435,36 @@ static QString getBaseDir()
|
|||||||
|
|
||||||
switch (styleType) {
|
switch (styleType) {
|
||||||
case TYPE_PUBLIC:
|
case TYPE_PUBLIC:
|
||||||
if (getStyleInfo(":/qss/chat/public", ":/qss/chat/public", standardInfo)) {
|
if (getStyleInfo(":/qss/chat/standard/public", ":/qss/chat/standard/public", standardInfo)) {
|
||||||
standardInfo.styleDescription = tr("Standard style for group chat");
|
standardInfo.styleDescription = tr("Standard style for group chat");
|
||||||
styles.append(standardInfo);
|
styles.append(standardInfo);
|
||||||
}
|
}
|
||||||
|
if (getStyleInfo(":/qss/chat/compact/public", ":/qss/chat/compact/public", standardInfo)) {
|
||||||
|
standardInfo.styleDescription = tr("Compact style for group chat");
|
||||||
|
styles.append(standardInfo);
|
||||||
|
}
|
||||||
stylePath = "stylesheets/public";
|
stylePath = "stylesheets/public";
|
||||||
break;
|
break;
|
||||||
case TYPE_PRIVATE:
|
case TYPE_PRIVATE:
|
||||||
if (getStyleInfo(":/qss/chat/private", ":/qss/chat/private", standardInfo)) {
|
if (getStyleInfo(":/qss/chat/standard/private", ":/qss/chat/standard/private", standardInfo)) {
|
||||||
standardInfo.styleDescription = tr("Standard style for private chat");
|
standardInfo.styleDescription = tr("Standard style for private chat");
|
||||||
styles.append(standardInfo);
|
styles.append(standardInfo);
|
||||||
}
|
}
|
||||||
|
if (getStyleInfo(":/qss/chat/compact/private", ":/qss/chat/compact/private", standardInfo)) {
|
||||||
|
standardInfo.styleDescription = tr("Compact style for private chat");
|
||||||
|
styles.append(standardInfo);
|
||||||
|
}
|
||||||
stylePath = "stylesheets/private";
|
stylePath = "stylesheets/private";
|
||||||
break;
|
break;
|
||||||
case TYPE_HISTORY:
|
case TYPE_HISTORY:
|
||||||
if (getStyleInfo(":/qss/chat/history", ":/qss/chat/history", standardInfo)) {
|
if (getStyleInfo(":/qss/chat/standard/history", ":/qss/chat/standard/history", standardInfo)) {
|
||||||
standardInfo.styleDescription = tr("Standard style for history");
|
standardInfo.styleDescription = tr("Standard style for history");
|
||||||
styles.append(standardInfo);
|
styles.append(standardInfo);
|
||||||
}
|
}
|
||||||
|
if (getStyleInfo(":/qss/chat/compact/history", ":/qss/chat/compact/history", standardInfo)) {
|
||||||
|
standardInfo.styleDescription = tr("Compact style for history");
|
||||||
|
styles.append(standardInfo);
|
||||||
|
}
|
||||||
stylePath = "stylesheets/history";
|
stylePath = "stylesheets/history";
|
||||||
break;
|
break;
|
||||||
case TYPE_UNKNOWN:
|
case TYPE_UNKNOWN:
|
||||||
|
@ -173,7 +173,10 @@ QString formatText(const QString &text, unsigned int flag)
|
|||||||
embedHtml(doc, body, defEmbedAhref);
|
embedHtml(doc, body, defEmbedAhref);
|
||||||
}
|
}
|
||||||
|
|
||||||
return doc.toString(-1); // -1 removes any annoying carriage return misinterpreted by QTextEdit
|
QString formattedText = doc.toString(-1); // -1 removes any annoying carriage return misinterpreted by QTextEdit
|
||||||
|
optimizeHtml(formattedText);
|
||||||
|
|
||||||
|
return formattedText;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void findElements(QDomDocument& doc, QDomElement& currentElement, const QString& nodeName, const QString& nodeAttribute, QStringList &elements)
|
static void findElements(QDomDocument& doc, QDomElement& currentElement, const QString& nodeName, const QString& nodeAttribute, QStringList &elements)
|
||||||
@ -217,28 +220,100 @@ bool findAnchors(const QString &text, QStringList& urls)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void removeElement(QDomElement& parentElement, QDomElement& element)
|
||||||
|
{
|
||||||
|
QDomNodeList children = element.childNodes();
|
||||||
|
while (children.length() > 0) {
|
||||||
|
QDomNode childElement = element.removeChild(children.item(children.length() - 1));
|
||||||
|
parentElement.insertAfter(childElement, element);
|
||||||
|
}
|
||||||
|
parentElement.removeChild(element);
|
||||||
|
}
|
||||||
|
|
||||||
static void optimizeHtml(QDomDocument& doc, QDomElement& currentElement)
|
static void optimizeHtml(QDomDocument& doc, QDomElement& currentElement)
|
||||||
{
|
{
|
||||||
|
if (currentElement.tagName().toLower() == "html") {
|
||||||
|
// change <html> to <span>
|
||||||
|
currentElement.setTagName("span");
|
||||||
|
}
|
||||||
|
|
||||||
|
QDomNode styleNode;
|
||||||
|
QDomAttr styleAttr;
|
||||||
|
bool addBR = false;
|
||||||
|
|
||||||
QDomNodeList children = currentElement.childNodes();
|
QDomNodeList children = currentElement.childNodes();
|
||||||
for (uint index = 0; index < children.length(); ) {
|
for (uint index = 0; index < children.length(); ) {
|
||||||
QDomNode node = children.item(index);
|
QDomNode node = children.item(index);
|
||||||
if (node.isElement()) {
|
|
||||||
QDomElement element = node.toElement();
|
|
||||||
if (element.tagName().toLower() == "head") {
|
|
||||||
// remove head
|
|
||||||
currentElement.removeChild(node);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
QDomNode style = element.attributes().namedItem("style");
|
|
||||||
if (style.isAttr()) {
|
|
||||||
QDomAttr attr = style.toAttr();
|
|
||||||
// compress style attribute
|
// compress style attribute
|
||||||
QString value = attr.value().simplified();
|
styleNode = node.attributes().namedItem("style");
|
||||||
|
if (styleNode.isAttr()) {
|
||||||
|
styleAttr = styleNode.toAttr();
|
||||||
|
QString value = styleAttr.value().simplified();
|
||||||
value.replace("margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;", "margin:0px 0px 0px 0px;");
|
value.replace("margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;", "margin:0px 0px 0px 0px;");
|
||||||
value.replace("; ", ";");
|
value.replace("; ", ";");
|
||||||
attr.setValue(value);
|
styleAttr.setValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (node.isElement()) {
|
||||||
|
QDomElement element = node.toElement();
|
||||||
|
|
||||||
|
// not <p>
|
||||||
|
if (addBR && element.tagName().toLower() != "p") {
|
||||||
|
// add <br> after a removed <p> but not before a <p>
|
||||||
|
QDomElement elementBr = doc.createElement("br");
|
||||||
|
currentElement.insertBefore(elementBr, element);
|
||||||
|
addBR = false;
|
||||||
|
++index;
|
||||||
|
}
|
||||||
|
|
||||||
|
// <body>
|
||||||
|
if (element.tagName().toLower() == "body") {
|
||||||
|
if (element.attributes().length() == 0) {
|
||||||
|
// remove <body> without attributes
|
||||||
|
removeElement(currentElement, element);
|
||||||
|
// no ++index;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// change <body> to <span>
|
||||||
|
element.setTagName("span");
|
||||||
|
}
|
||||||
|
|
||||||
|
// <head>
|
||||||
|
if (element.tagName().toLower() == "head") {
|
||||||
|
// remove <head>
|
||||||
|
currentElement.removeChild(node);
|
||||||
|
// no ++index;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// iterate children
|
||||||
optimizeHtml(doc, element);
|
optimizeHtml(doc, element);
|
||||||
|
|
||||||
|
// <p>
|
||||||
|
if (element.tagName().toLower() == "p") {
|
||||||
|
// <p style="...">
|
||||||
|
//styleNode = element.attributes().namedItem("style");
|
||||||
|
if (element.attributes().size() == 1 && styleNode.isAttr()) {
|
||||||
|
QString value = styleAttr.toAttr().value().simplified();
|
||||||
|
if (value == "margin:0px 0px 0px 0px;-qt-block-indent:0;text-indent:0px;" ||
|
||||||
|
value.startsWith("-qt-paragraph-type:empty;margin:0px 0px 0px 0px;-qt-block-indent:0;text-indent:0px;")) {
|
||||||
|
|
||||||
|
if (addBR) {
|
||||||
|
// add <br> after a removed <p> before a removed <p>
|
||||||
|
QDomElement elementBr = doc.createElement("br");
|
||||||
|
currentElement.insertBefore(elementBr, element);
|
||||||
|
++index;
|
||||||
|
}
|
||||||
|
// remove Qt standard <p> or empty <p>
|
||||||
|
index += element.childNodes().length();
|
||||||
|
removeElement(currentElement, element);
|
||||||
|
addBR = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
addBR = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
++index;
|
++index;
|
||||||
}
|
}
|
||||||
@ -254,6 +329,13 @@ void optimizeHtml(QTextEdit *textEdit, QString &text)
|
|||||||
|
|
||||||
text = textEdit->toHtml();
|
text = textEdit->toHtml();
|
||||||
|
|
||||||
|
optimizeHtml(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
void optimizeHtml(QString &text)
|
||||||
|
{
|
||||||
|
int originalLength = text.length();
|
||||||
|
|
||||||
// remove doctype
|
// remove doctype
|
||||||
text.remove(QRegExp("<!DOCTYPE[^>]*>"));
|
text.remove(QRegExp("<!DOCTYPE[^>]*>"));
|
||||||
|
|
||||||
@ -266,7 +348,7 @@ void optimizeHtml(QTextEdit *textEdit, QString &text)
|
|||||||
optimizeHtml(doc, body);
|
optimizeHtml(doc, body);
|
||||||
text = doc.toString(-1);
|
text = doc.toString(-1);
|
||||||
|
|
||||||
std::cerr << "Optimized text to " << text.length() << " bytes , instead of " << textEdit->toHtml().length() << std::endl;
|
std::cerr << "Optimized text to " << text.length() << " bytes , instead of " << originalLength << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString toHtml(QString text, bool realHtml)
|
QString toHtml(QString text, bool realHtml)
|
||||||
|
@ -114,6 +114,7 @@ QString formatText(const QString &text, unsigned int flag);
|
|||||||
bool findAnchors(const QString &text, QStringList& urls);
|
bool findAnchors(const QString &text, QStringList& urls);
|
||||||
|
|
||||||
void optimizeHtml(QTextEdit *textEdit, QString &text);
|
void optimizeHtml(QTextEdit *textEdit, QString &text);
|
||||||
|
void optimizeHtml(QString &text);
|
||||||
QString toHtml(QString text, bool realHtml = true);
|
QString toHtml(QString text, bool realHtml = true);
|
||||||
|
|
||||||
} // namespace RsHtml
|
} // namespace RsHtml
|
||||||
|
@ -474,30 +474,54 @@
|
|||||||
<file>images/window_fullscreen.png</file>
|
<file>images/window_fullscreen.png</file>
|
||||||
<file>images/window_nofullscreen.png</file>
|
<file>images/window_nofullscreen.png</file>
|
||||||
<file>layouts/default.ui</file>
|
<file>layouts/default.ui</file>
|
||||||
<file>qss/chat/private/info.xml</file>
|
<file>qss/chat/standard/private/info.xml</file>
|
||||||
<file>qss/chat/private/incoming.htm</file>
|
<file>qss/chat/standard/private/incoming.htm</file>
|
||||||
<file>qss/chat/private/outgoing.htm</file>
|
<file>qss/chat/standard/private/outgoing.htm</file>
|
||||||
<file>qss/chat/private/hincoming.htm</file>
|
<file>qss/chat/standard/private/hincoming.htm</file>
|
||||||
<file>qss/chat/private/houtgoing.htm</file>
|
<file>qss/chat/standard/private/houtgoing.htm</file>
|
||||||
<file>qss/chat/private/ooutgoing.htm</file>
|
<file>qss/chat/standard/private/ooutgoing.htm</file>
|
||||||
<file>qss/chat/private/main.css</file>
|
<file>qss/chat/standard/private/main.css</file>
|
||||||
<file>qss/chat/private/variants/Standard.css</file>
|
<file>qss/chat/standard/private/variants/Standard.css</file>
|
||||||
<file>qss/chat/public/info.xml</file>
|
<file>qss/chat/standard/public/info.xml</file>
|
||||||
<file>qss/chat/public/incoming.htm</file>
|
<file>qss/chat/standard/public/incoming.htm</file>
|
||||||
<file>qss/chat/public/outgoing.htm</file>
|
<file>qss/chat/standard/public/outgoing.htm</file>
|
||||||
<file>qss/chat/public/hincoming.htm</file>
|
<file>qss/chat/standard/public/hincoming.htm</file>
|
||||||
<file>qss/chat/public/houtgoing.htm</file>
|
<file>qss/chat/standard/public/houtgoing.htm</file>
|
||||||
<file>qss/chat/public/ooutgoing.htm</file>
|
<file>qss/chat/standard/public/ooutgoing.htm</file>
|
||||||
<file>qss/chat/public/main.css</file>
|
<file>qss/chat/standard/public/main.css</file>
|
||||||
<file>qss/chat/public/variants/Standard.css</file>
|
<file>qss/chat/standard/public/variants/Standard.css</file>
|
||||||
<file>qss/chat/history/info.xml</file>
|
<file>qss/chat/standard/history/info.xml</file>
|
||||||
<file>qss/chat/history/incoming.htm</file>
|
<file>qss/chat/standard/history/incoming.htm</file>
|
||||||
<file>qss/chat/history/outgoing.htm</file>
|
<file>qss/chat/standard/history/outgoing.htm</file>
|
||||||
<file>qss/chat/history/hincoming.htm</file>
|
<file>qss/chat/standard/history/hincoming.htm</file>
|
||||||
<file>qss/chat/history/houtgoing.htm</file>
|
<file>qss/chat/standard/history/houtgoing.htm</file>
|
||||||
<file>qss/chat/history/ooutgoing.htm</file>
|
<file>qss/chat/standard/history/ooutgoing.htm</file>
|
||||||
<file>qss/chat/history/main.css</file>
|
<file>qss/chat/standard/history/main.css</file>
|
||||||
<file>qss/chat/history/variants/Standard.css</file>
|
<file>qss/chat/standard/history/variants/Standard.css</file>
|
||||||
|
<file>qss/chat/compact/private/info.xml</file>
|
||||||
|
<file>qss/chat/compact/private/incoming.htm</file>
|
||||||
|
<file>qss/chat/compact/private/outgoing.htm</file>
|
||||||
|
<file>qss/chat/compact/private/hincoming.htm</file>
|
||||||
|
<file>qss/chat/compact/private/houtgoing.htm</file>
|
||||||
|
<file>qss/chat/compact/private/ooutgoing.htm</file>
|
||||||
|
<file>qss/chat/compact/private/main.css</file>
|
||||||
|
<file>qss/chat/compact/private/variants/Standard.css</file>
|
||||||
|
<file>qss/chat/compact/public/info.xml</file>
|
||||||
|
<file>qss/chat/compact/public/incoming.htm</file>
|
||||||
|
<file>qss/chat/compact/public/outgoing.htm</file>
|
||||||
|
<file>qss/chat/compact/public/hincoming.htm</file>
|
||||||
|
<file>qss/chat/compact/public/houtgoing.htm</file>
|
||||||
|
<file>qss/chat/compact/public/ooutgoing.htm</file>
|
||||||
|
<file>qss/chat/compact/public/main.css</file>
|
||||||
|
<file>qss/chat/compact/public/variants/Standard.css</file>
|
||||||
|
<file>qss/chat/compact/history/info.xml</file>
|
||||||
|
<file>qss/chat/compact/history/incoming.htm</file>
|
||||||
|
<file>qss/chat/compact/history/outgoing.htm</file>
|
||||||
|
<file>qss/chat/compact/history/hincoming.htm</file>
|
||||||
|
<file>qss/chat/compact/history/houtgoing.htm</file>
|
||||||
|
<file>qss/chat/compact/history/ooutgoing.htm</file>
|
||||||
|
<file>qss/chat/compact/history/main.css</file>
|
||||||
|
<file>qss/chat/compact/history/variants/Standard.css</file>
|
||||||
<file>smileys/amorous.png</file>
|
<file>smileys/amorous.png</file>
|
||||||
<file>smileys/angry.png</file>
|
<file>smileys/angry.png</file>
|
||||||
<file>smileys/bad.png</file>
|
<file>smileys/bad.png</file>
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
%css-style%
|
||||||
|
</style>
|
||||||
|
<table class='hincomingTable' width='100%'>
|
||||||
|
<tr><td>
|
||||||
|
<span class='hincomingTime'>%date% %time%</span>
|
||||||
|
<span class='name hincomingName'>%name%:</span>
|
||||||
|
%message%
|
||||||
|
</td></tr>
|
||||||
|
</table>
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
%css-style%
|
||||||
|
</style>
|
||||||
|
<table class='houtgoingTable' width='100%'>
|
||||||
|
<tr><td>
|
||||||
|
<span class='houtgoingTime'>%date% %time%</span>
|
||||||
|
<span class='name houtgoingName'>%name%:</span>
|
||||||
|
%message%
|
||||||
|
</td></tr>
|
||||||
|
</table>
|
||||||
|
|
11
retroshare-gui/src/gui/qss/chat/compact/history/incoming.htm
Normal file
11
retroshare-gui/src/gui/qss/chat/compact/history/incoming.htm
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
%css-style%
|
||||||
|
</style>
|
||||||
|
<table class='incomingTable' width='100%'>
|
||||||
|
<tr><td>
|
||||||
|
<span class='incomingTime'>%date% %time%</span>
|
||||||
|
<span class='name incomingName'>%name%:</span>
|
||||||
|
%message%
|
||||||
|
</td></tr>
|
||||||
|
</table>
|
||||||
|
|
12
retroshare-gui/src/gui/qss/chat/compact/history/info.xml
Normal file
12
retroshare-gui/src/gui/qss/chat/compact/history/info.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE RetroShare_StyleInfo>
|
||||||
|
<RetroShare_Style version="1.0">
|
||||||
|
<style>
|
||||||
|
<name>RetroShare compact</name>
|
||||||
|
<description>The description is defined in ChatStyle.cpp for translation</description>
|
||||||
|
</style>
|
||||||
|
<author>
|
||||||
|
<name>RetroShare Team</name>
|
||||||
|
<email></email>
|
||||||
|
</author>
|
||||||
|
</RetroShare_Style>
|
66
retroshare-gui/src/gui/qss/chat/compact/history/main.css
Normal file
66
retroshare-gui/src/gui/qss/chat/compact/history/main.css
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
.name {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time {
|
||||||
|
}
|
||||||
|
|
||||||
|
.incomingTable {
|
||||||
|
background-color:#dfedff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.incomingTime {
|
||||||
|
color: #295b07;
|
||||||
|
}
|
||||||
|
|
||||||
|
.incomingName {
|
||||||
|
color: #295b07;
|
||||||
|
}
|
||||||
|
|
||||||
|
.outgoingTable {
|
||||||
|
background-color:#f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.outgoingTime {
|
||||||
|
color: #244578;
|
||||||
|
}
|
||||||
|
|
||||||
|
.outgoingName {
|
||||||
|
color: #244578;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hincomingTable {
|
||||||
|
background-color:#dfedff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hincomingTime {
|
||||||
|
color: #295b07;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hincomingName {
|
||||||
|
color: #295b07;
|
||||||
|
}
|
||||||
|
|
||||||
|
.houtgoingTable{
|
||||||
|
background-color:#f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.houtgoingTime {
|
||||||
|
color: #244578;
|
||||||
|
}
|
||||||
|
|
||||||
|
.houtgoingName {
|
||||||
|
color: #244578;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ooutgoingTable {
|
||||||
|
background-color:#ffbebe;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ooutgoingTime {
|
||||||
|
color: #244578;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ooutgoingName {
|
||||||
|
color: #244578;
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
%css-style%
|
||||||
|
</style>
|
||||||
|
<table class='ooutgoingTable' width='100%'>
|
||||||
|
<tr><td>
|
||||||
|
<span class='ooutgoingTime'>%date% %time%</span>
|
||||||
|
<span class='name ooutgoingName'>%name%:</span>
|
||||||
|
%message%
|
||||||
|
</td></tr>
|
||||||
|
</table>
|
||||||
|
|
11
retroshare-gui/src/gui/qss/chat/compact/history/outgoing.htm
Normal file
11
retroshare-gui/src/gui/qss/chat/compact/history/outgoing.htm
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
%css-style%
|
||||||
|
</style>
|
||||||
|
<table class='outgoingTable' width='100%'>
|
||||||
|
<tr><td>
|
||||||
|
<span class='outgoingTime'>%date% %time%</span>
|
||||||
|
<span class='name outgoingName'>%name%:</span>
|
||||||
|
%message%
|
||||||
|
</td></tr>
|
||||||
|
</table>
|
||||||
|
|
@ -0,0 +1,7 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
%css-style%
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<span class='time'>%date% %time%</span>
|
||||||
|
<span class='name hincomingName'>%name%:</span>
|
||||||
|
%message%
|
@ -0,0 +1,7 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
%css-style%
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<span class='time'>%date% %time%</span>
|
||||||
|
<span class='name houtgoingName'>%name%:</span>
|
||||||
|
%message%
|
@ -0,0 +1,7 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
%css-style%
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<span class='time'>%time%</span>
|
||||||
|
<span class='name incomingName'>%name%:</span>
|
||||||
|
%message%
|
12
retroshare-gui/src/gui/qss/chat/compact/private/info.xml
Normal file
12
retroshare-gui/src/gui/qss/chat/compact/private/info.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE RetroShare_StyleInfo>
|
||||||
|
<RetroShare_Style version="1.0">
|
||||||
|
<style>
|
||||||
|
<name>RetroShare compact</name>
|
||||||
|
<description>The description is defined in ChatStyle.cpp for translation</description>
|
||||||
|
</style>
|
||||||
|
<author>
|
||||||
|
<name>RetroShare Team</name>
|
||||||
|
<email></email>
|
||||||
|
</author>
|
||||||
|
</RetroShare_Style>
|
27
retroshare-gui/src/gui/qss/chat/compact/private/main.css
Normal file
27
retroshare-gui/src/gui/qss/chat/compact/private/main.css
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
.name {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time {
|
||||||
|
color:#808080;
|
||||||
|
}
|
||||||
|
|
||||||
|
.incomingName {
|
||||||
|
color:#42940C;
|
||||||
|
}
|
||||||
|
|
||||||
|
.outgoingName {
|
||||||
|
color:#2F5A9B;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hincomingName {
|
||||||
|
color:#88f042;
|
||||||
|
}
|
||||||
|
|
||||||
|
.houtgoingName {
|
||||||
|
color:#6491d2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ooutgoingName {
|
||||||
|
color:#ff0000;
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
%css-style%
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<span class='time'>%time%</span>
|
||||||
|
<span class='name ooutgoingName'>%name%:</span>
|
||||||
|
%message%
|
@ -0,0 +1,7 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
%css-style%
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<span class='time'>%time%</span>
|
||||||
|
<span class='name outgoingName'>%name%:</span>
|
||||||
|
%message%
|
@ -0,0 +1,7 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
%css-style%
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<span class='hincomingTime'>%date% %time%</span>
|
||||||
|
<span class='name hincomingName'>%name%:</span>
|
||||||
|
%message%
|
@ -0,0 +1,7 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
%css-style%
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<span class='houtgoingTime'>%date% %time%</span>
|
||||||
|
<span class='name houtgoingName'>%name%:</span>
|
||||||
|
%message%
|
@ -0,0 +1,7 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
%css-style%
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<span class='incomingTime'>%time%</span>
|
||||||
|
<span class='name incomingName'>%name%:</span>
|
||||||
|
%message%
|
12
retroshare-gui/src/gui/qss/chat/compact/public/info.xml
Normal file
12
retroshare-gui/src/gui/qss/chat/compact/public/info.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE RetroShare_StyleInfo>
|
||||||
|
<RetroShare_Style version="1.0">
|
||||||
|
<style>
|
||||||
|
<name>RetroShare compact</name>
|
||||||
|
<description>The description is defined in ChatStyle.cpp for translation</description>
|
||||||
|
</style>
|
||||||
|
<author>
|
||||||
|
<name>RetroShare Team</name>
|
||||||
|
<email></email>
|
||||||
|
</author>
|
||||||
|
</RetroShare_Style>
|
43
retroshare-gui/src/gui/qss/chat/compact/public/main.css
Normal file
43
retroshare-gui/src/gui/qss/chat/compact/public/main.css
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
.name {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.incomingTime {
|
||||||
|
color:#C00000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.incomingName {
|
||||||
|
color:#2D84C9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.outgoingTime {
|
||||||
|
color:#C00000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.outgoingName {
|
||||||
|
color:#2D84C9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hincomingTime {
|
||||||
|
color:#800000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hincomingName {
|
||||||
|
color:#1E5684;
|
||||||
|
}
|
||||||
|
|
||||||
|
.houtgoingTime {
|
||||||
|
color:#800000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.houtgoingName {
|
||||||
|
color:#1E5684;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ooutgoingTime {
|
||||||
|
color:#C00000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ooutgoingName {
|
||||||
|
color:#ff0000;
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
%css-style%
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<span class='ooutgoingTime'>%time%</span>
|
||||||
|
<span class='name ooutgoingName'>%name%:</span>
|
||||||
|
%message%
|
@ -0,0 +1,7 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
%css-style%
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<span class='outgoingTime'>%time%</span>
|
||||||
|
<span class='name outgoingName'>%name%:</span>
|
||||||
|
%message%
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 1.3 KiB |
@ -3,5 +3,5 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<span class='hincomingTime'>%date% %time%</span>
|
<span class='hincomingTime'>%date% %time%</span>
|
||||||
<span class='hincomingName'><strong>%name%</strong></span>
|
<span class='name hincomingName'>%name%</span><br>
|
||||||
%message%
|
%message%
|
@ -3,5 +3,5 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<span class='houtgoingTime'>%date% %time%</span>
|
<span class='houtgoingTime'>%date% %time%</span>
|
||||||
<span class='houtgoingName'><strong>%name%</strong></span>
|
<span class='name houtgoingName'>%name%</span><br>
|
||||||
%message%
|
%message%
|
@ -3,5 +3,5 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<span class='incomingTime'>%time%</span>
|
<span class='incomingTime'>%time%</span>
|
||||||
<span class='incomingName'><strong>%name%</strong></span>
|
<span class='name incomingName'>%name%</span><br>
|
||||||
%message%
|
%message%
|
@ -1,3 +1,7 @@
|
|||||||
|
.name {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
.incomingTime {
|
.incomingTime {
|
||||||
color:#C00000;
|
color:#C00000;
|
||||||
}
|
}
|
||||||
@ -37,4 +41,3 @@
|
|||||||
.ooutgoingName {
|
.ooutgoingName {
|
||||||
color:#2D84C9;
|
color:#2D84C9;
|
||||||
}
|
}
|
||||||
|
|
@ -3,5 +3,5 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<span class='ooutgoingTime'>%time%</span>
|
<span class='ooutgoingTime'>%time%</span>
|
||||||
<span class='ooutgoingName'><strong>%name%</strong></span>
|
<span class='name ooutgoingName'>%name%</span><br>
|
||||||
%message%
|
%message%
|
@ -3,5 +3,5 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<span class='outgoingTime'>%time%</span>
|
<span class='outgoingTime'>%time%</span>
|
||||||
<span class='outgoingName'><strong>%name%</strong></span>
|
<span class='name outgoingName'>%name%</span><br>
|
||||||
%message%
|
%message%
|
@ -202,27 +202,15 @@ void ChatPage::setPreviewMessages(QString &stylePath, QString styleVariant, QTex
|
|||||||
|
|
||||||
textBrowser->clear();
|
textBrowser->clear();
|
||||||
|
|
||||||
QString nameIncoming = "Incoming";
|
QString nameIncoming = tr("Incoming");
|
||||||
QString nameOutgoing = "Outgoing";
|
QString nameOutgoing = tr("Outgoing");
|
||||||
QDateTime timestmp = QDateTime::fromTime_t(time(NULL));
|
QDateTime timestmp = QDateTime::fromTime_t(time(NULL));
|
||||||
QTextEdit textEdit;
|
|
||||||
QString message;
|
|
||||||
|
|
||||||
textEdit.setText(tr("Incoming message in history"));
|
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_HINCOMING, nameIncoming, timestmp, tr("Incoming message in history"), CHAT_FORMATTEXT_EMBED_SMILEYS));
|
||||||
message = textEdit.toHtml();
|
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_HOUTGOING, nameOutgoing, timestmp, tr("Outgoing message in history"), CHAT_FORMATTEXT_EMBED_SMILEYS));
|
||||||
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_HINCOMING, nameIncoming, timestmp, message, CHAT_FORMATTEXT_EMBED_SMILEYS));
|
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_INCOMING, nameIncoming, timestmp, tr("Incoming message"), CHAT_FORMATTEXT_EMBED_SMILEYS));
|
||||||
textEdit.setText(tr("Outgoing message in history"));
|
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_OUTGOING, nameOutgoing, timestmp, tr("Outgoing message"), CHAT_FORMATTEXT_EMBED_SMILEYS));
|
||||||
message = textEdit.toHtml();
|
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_OOUTGOING, nameOutgoing, timestmp, tr("Outgoing offline message"), CHAT_FORMATTEXT_EMBED_SMILEYS));
|
||||||
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_HOUTGOING, nameOutgoing, timestmp, message, CHAT_FORMATTEXT_EMBED_SMILEYS));
|
|
||||||
textEdit.setText(tr("Incoming message"));
|
|
||||||
message = textEdit.toHtml();
|
|
||||||
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_INCOMING, nameIncoming, timestmp, message, CHAT_FORMATTEXT_EMBED_SMILEYS));
|
|
||||||
textEdit.setText(tr("Outgoing message"));
|
|
||||||
message = textEdit.toHtml();
|
|
||||||
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_OUTGOING, nameOutgoing, timestmp, message, CHAT_FORMATTEXT_EMBED_SMILEYS));
|
|
||||||
textEdit.setText(tr("Outgoing offline message"));
|
|
||||||
message = textEdit.toHtml();
|
|
||||||
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_OOUTGOING, nameOutgoing, timestmp, message, CHAT_FORMATTEXT_EMBED_SMILEYS));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatPage::fillPreview(QListWidget *listWidget, QComboBox *comboBox, QTextBrowser *textBrowser)
|
void ChatPage::fillPreview(QListWidget *listWidget, QComboBox *comboBox, QTextBrowser *textBrowser)
|
||||||
|
@ -381,7 +381,11 @@ void RshareSettings::setChatScreenFont(const QString &font)
|
|||||||
|
|
||||||
void RshareSettings::getPublicChatStyle(QString &stylePath, QString &styleVariant)
|
void RshareSettings::getPublicChatStyle(QString &stylePath, QString &styleVariant)
|
||||||
{
|
{
|
||||||
stylePath = valueFromGroup("Chat", "StylePublic", ":/qss/chat/public").toString();
|
stylePath = valueFromGroup("Chat", "StylePublic", ":/qss/chat/standard/public").toString();
|
||||||
|
// Correct changed standard path for older RetroShare versions before 31.01.2012 (can be removed later)
|
||||||
|
if (stylePath == ":/qss/chat/public") {
|
||||||
|
stylePath = ":/qss/chat/standard/public";
|
||||||
|
}
|
||||||
styleVariant = valueFromGroup("Chat", "StylePublicVariant", "").toString();
|
styleVariant = valueFromGroup("Chat", "StylePublicVariant", "").toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -393,7 +397,11 @@ void RshareSettings::setPublicChatStyle(const QString &stylePath, const QString
|
|||||||
|
|
||||||
void RshareSettings::getPrivateChatStyle(QString &stylePath, QString &styleVariant)
|
void RshareSettings::getPrivateChatStyle(QString &stylePath, QString &styleVariant)
|
||||||
{
|
{
|
||||||
stylePath = valueFromGroup("Chat", "StylePrivate", ":/qss/chat/private").toString();
|
stylePath = valueFromGroup("Chat", "StylePrivate", ":/qss/chat/standard/private").toString();
|
||||||
|
// Correct changed standard path for older RetroShare versions before 31.01.2012 (can be removed later)
|
||||||
|
if (stylePath == ":/qss/chat/private") {
|
||||||
|
stylePath = ":/qss/chat/standard/private";
|
||||||
|
}
|
||||||
styleVariant = valueFromGroup("Chat", "StylePrivateVariant", "").toString();
|
styleVariant = valueFromGroup("Chat", "StylePrivateVariant", "").toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -405,7 +413,11 @@ void RshareSettings::setPrivateChatStyle(const QString &stylePath, const QString
|
|||||||
|
|
||||||
void RshareSettings::getHistoryChatStyle(QString &stylePath, QString &styleVariant)
|
void RshareSettings::getHistoryChatStyle(QString &stylePath, QString &styleVariant)
|
||||||
{
|
{
|
||||||
stylePath = valueFromGroup("Chat", "StyleHistory", ":/qss/chat/history").toString();
|
stylePath = valueFromGroup("Chat", "StyleHistory", ":/qss/chat/standard/history").toString();
|
||||||
|
// Correct changed standard path for older RetroShare versions before 31.01.2012 (can be removed later)
|
||||||
|
if (stylePath == ":/qss/chat/history") {
|
||||||
|
stylePath = ":/qss/chat/standard/history";
|
||||||
|
}
|
||||||
styleVariant = valueFromGroup("Chat", "StylePrivateVariant", "").toString();
|
styleVariant = valueFromGroup("Chat", "StylePrivateVariant", "").toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
@ -1384,27 +1384,37 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation>Verlauf</translation>
|
<translation>Verlauf</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/settings/ChatPage.cpp" line="+211"/>
|
<location filename="../gui/settings/ChatPage.cpp" line="+205"/>
|
||||||
|
<source>Incoming</source>
|
||||||
|
<translation>Eingehend</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+1"/>
|
||||||
|
<source>Outgoing</source>
|
||||||
|
<translation>Ausgehend</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+3"/>
|
||||||
<source>Incoming message in history</source>
|
<source>Incoming message in history</source>
|
||||||
<translation>Eingehehende Nachricht aus dem Verlauf</translation>
|
<translation>Eingehehende Nachricht aus dem Verlauf</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+3"/>
|
<location line="+1"/>
|
||||||
<source>Outgoing message in history</source>
|
<source>Outgoing message in history</source>
|
||||||
<translation>Ausgehende Nachricht aus dem Verlauf</translation>
|
<translation>Ausgehende Nachricht aus dem Verlauf</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+3"/>
|
<location line="+1"/>
|
||||||
<source>Incoming message</source>
|
<source>Incoming message</source>
|
||||||
<translation>Eingehehende Nachricht</translation>
|
<translation>Eingehehende Nachricht</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+3"/>
|
<location line="+1"/>
|
||||||
<source>Outgoing message</source>
|
<source>Outgoing message</source>
|
||||||
<translation>Ausgehehende Nachricht</translation>
|
<translation>Ausgehehende Nachricht</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+3"/>
|
<location line="+1"/>
|
||||||
<source>Outgoing offline message</source>
|
<source>Outgoing offline message</source>
|
||||||
<translation>Ausgehehende offline Nachricht</translation>
|
<translation>Ausgehehende offline Nachricht</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -1416,16 +1426,31 @@ p, li { white-space: pre-wrap; }
|
|||||||
<source>Standard style for group chat</source>
|
<source>Standard style for group chat</source>
|
||||||
<translation>Standard Stil für den Gruppenchat</translation>
|
<translation>Standard Stil für den Gruppenchat</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+4"/>
|
||||||
|
<source>Compact style for group chat</source>
|
||||||
|
<translation>Kompakter Stil für den Gruppenchat</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+7"/>
|
<location line="+7"/>
|
||||||
<source>Standard style for private chat</source>
|
<source>Standard style for private chat</source>
|
||||||
<translation>Standard Stil für den privaten Chat</translation>
|
<translation>Standard Stil für den privaten Chat</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+4"/>
|
||||||
|
<source>Compact style for private chat</source>
|
||||||
|
<translation>Kompakter Stil für den privaten Chat</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+7"/>
|
<location line="+7"/>
|
||||||
<source>Standard style for history</source>
|
<source>Standard style for history</source>
|
||||||
<translation>Standard Stil für den Verlauf</translation>
|
<translation>Standard Stil für den Verlauf</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+4"/>
|
||||||
|
<source>Compact style for history</source>
|
||||||
|
<translation>Kompakter Stil für den Verlauf</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ChatWidget</name>
|
<name>ChatWidget</name>
|
||||||
@ -5307,7 +5332,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation>tippt...</translation>
|
<translation>tippt...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+115"/>
|
<location line="+118"/>
|
||||||
<location line="+2"/>
|
<location line="+2"/>
|
||||||
<source>New group chat</source>
|
<source>New group chat</source>
|
||||||
<translation>Neuer Gruppenchat</translation>
|
<translation>Neuer Gruppenchat</translation>
|
||||||
|
Loading…
Reference in New Issue
Block a user