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:
thunder2 2012-01-31 00:06:24 +00:00
parent 55d53e6dd4
commit 602ae72d7d
59 changed files with 530 additions and 83 deletions

View File

@ -370,7 +370,10 @@ void FriendsDialog::addChatMsg(bool incoming, bool history, const QString &name,
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);
}

View File

@ -435,24 +435,36 @@ static QString getBaseDir()
switch (styleType) {
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");
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";
break;
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");
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";
break;
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");
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";
break;
case TYPE_UNKNOWN:

View File

@ -173,7 +173,10 @@ QString formatText(const QString &text, unsigned int flag)
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)
@ -217,28 +220,100 @@ bool findAnchors(const QString &text, QStringList& urls)
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)
{
if (currentElement.tagName().toLower() == "html") {
// change <html> to <span>
currentElement.setTagName("span");
}
QDomNode styleNode;
QDomAttr styleAttr;
bool addBR = false;
QDomNodeList children = currentElement.childNodes();
for (uint index = 0; index < children.length(); ) {
QDomNode node = children.item(index);
// compress style attribute
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("; ", ";");
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
// remove <head>
currentElement.removeChild(node);
// no ++index;
continue;
}
QDomNode style = element.attributes().namedItem("style");
if (style.isAttr()) {
QDomAttr attr = style.toAttr();
// compress style attribute
QString value = attr.value().simplified();
value.replace("margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;", "margin:0px 0px 0px 0px;");
value.replace("; ", ";");
attr.setValue(value);
}
// iterate children
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;
}
@ -254,6 +329,13 @@ void optimizeHtml(QTextEdit *textEdit, QString &text)
text = textEdit->toHtml();
optimizeHtml(text);
}
void optimizeHtml(QString &text)
{
int originalLength = text.length();
// remove doctype
text.remove(QRegExp("<!DOCTYPE[^>]*>"));
@ -266,7 +348,7 @@ void optimizeHtml(QTextEdit *textEdit, QString &text)
optimizeHtml(doc, body);
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)

View File

@ -114,6 +114,7 @@ QString formatText(const QString &text, unsigned int flag);
bool findAnchors(const QString &text, QStringList& urls);
void optimizeHtml(QTextEdit *textEdit, QString &text);
void optimizeHtml(QString &text);
QString toHtml(QString text, bool realHtml = true);
} // namespace RsHtml

View File

@ -474,30 +474,54 @@
<file>images/window_fullscreen.png</file>
<file>images/window_nofullscreen.png</file>
<file>layouts/default.ui</file>
<file>qss/chat/private/info.xml</file>
<file>qss/chat/private/incoming.htm</file>
<file>qss/chat/private/outgoing.htm</file>
<file>qss/chat/private/hincoming.htm</file>
<file>qss/chat/private/houtgoing.htm</file>
<file>qss/chat/private/ooutgoing.htm</file>
<file>qss/chat/private/main.css</file>
<file>qss/chat/private/variants/Standard.css</file>
<file>qss/chat/public/info.xml</file>
<file>qss/chat/public/incoming.htm</file>
<file>qss/chat/public/outgoing.htm</file>
<file>qss/chat/public/hincoming.htm</file>
<file>qss/chat/public/houtgoing.htm</file>
<file>qss/chat/public/ooutgoing.htm</file>
<file>qss/chat/public/main.css</file>
<file>qss/chat/public/variants/Standard.css</file>
<file>qss/chat/history/info.xml</file>
<file>qss/chat/history/incoming.htm</file>
<file>qss/chat/history/outgoing.htm</file>
<file>qss/chat/history/hincoming.htm</file>
<file>qss/chat/history/houtgoing.htm</file>
<file>qss/chat/history/ooutgoing.htm</file>
<file>qss/chat/history/main.css</file>
<file>qss/chat/history/variants/Standard.css</file>
<file>qss/chat/standard/private/info.xml</file>
<file>qss/chat/standard/private/incoming.htm</file>
<file>qss/chat/standard/private/outgoing.htm</file>
<file>qss/chat/standard/private/hincoming.htm</file>
<file>qss/chat/standard/private/houtgoing.htm</file>
<file>qss/chat/standard/private/ooutgoing.htm</file>
<file>qss/chat/standard/private/main.css</file>
<file>qss/chat/standard/private/variants/Standard.css</file>
<file>qss/chat/standard/public/info.xml</file>
<file>qss/chat/standard/public/incoming.htm</file>
<file>qss/chat/standard/public/outgoing.htm</file>
<file>qss/chat/standard/public/hincoming.htm</file>
<file>qss/chat/standard/public/houtgoing.htm</file>
<file>qss/chat/standard/public/ooutgoing.htm</file>
<file>qss/chat/standard/public/main.css</file>
<file>qss/chat/standard/public/variants/Standard.css</file>
<file>qss/chat/standard/history/info.xml</file>
<file>qss/chat/standard/history/incoming.htm</file>
<file>qss/chat/standard/history/outgoing.htm</file>
<file>qss/chat/standard/history/hincoming.htm</file>
<file>qss/chat/standard/history/houtgoing.htm</file>
<file>qss/chat/standard/history/ooutgoing.htm</file>
<file>qss/chat/standard/history/main.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/angry.png</file>
<file>smileys/bad.png</file>

View 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>

View File

@ -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>

View 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>

View 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>

View 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;
}

View File

@ -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>

View 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>

View File

@ -0,0 +1,7 @@
<style type="text/css">
%css-style%
</style>
<span class='time'>%date% %time%</span>
<span class='name hincomingName'>%name%:</span>
%message%

View File

@ -0,0 +1,7 @@
<style type="text/css">
%css-style%
</style>
<span class='time'>%date% %time%</span>
<span class='name houtgoingName'>%name%:</span>
%message%

View File

@ -0,0 +1,7 @@
<style type="text/css">
%css-style%
</style>
<span class='time'>%time%</span>
<span class='name incomingName'>%name%:</span>
%message%

View 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>

View 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;
}

View File

@ -0,0 +1,7 @@
<style type="text/css">
%css-style%
</style>
<span class='time'>%time%</span>
<span class='name ooutgoingName'>%name%:</span>
%message%

View File

@ -0,0 +1,7 @@
<style type="text/css">
%css-style%
</style>
<span class='time'>%time%</span>
<span class='name outgoingName'>%name%:</span>
%message%

View File

@ -0,0 +1,7 @@
<style type="text/css">
%css-style%
</style>
<span class='hincomingTime'>%date% %time%</span>
<span class='name hincomingName'>%name%:</span>
%message%

View File

@ -0,0 +1,7 @@
<style type="text/css">
%css-style%
</style>
<span class='houtgoingTime'>%date% %time%</span>
<span class='name houtgoingName'>%name%:</span>
%message%

View File

@ -0,0 +1,7 @@
<style type="text/css">
%css-style%
</style>
<span class='incomingTime'>%time%</span>
<span class='name incomingName'>%name%:</span>
%message%

View 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>

View 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;
}

View File

@ -0,0 +1,7 @@
<style type="text/css">
%css-style%
</style>
<span class='ooutgoingTime'>%time%</span>
<span class='name ooutgoingName'>%name%:</span>
%message%

View File

@ -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.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -5,7 +5,7 @@
.time {
}
.incomingTable{
.incomingTable {
background-color:#dfedff;
}
@ -18,7 +18,7 @@
color: #295b07;
}
.outgoingTable{
.outgoingTable {
background-color:#f5f5f5;
}
@ -31,7 +31,7 @@
color: #244578;
}
.hincomingTable{
.hincomingTable {
background-color:#dfedff;
}
@ -57,7 +57,7 @@
color: #244578;
}
.ooutgoingTable{
.ooutgoingTable {
background-color:#ffbebe;
}

View File

@ -3,5 +3,5 @@
</style>
<span class='hincomingTime'>%date% %time%</span>
<span class='hincomingName'><strong>%name%</strong></span>
<span class='name hincomingName'>%name%</span><br>
%message%

View File

@ -3,5 +3,5 @@
</style>
<span class='houtgoingTime'>%date% %time%</span>
<span class='houtgoingName'><strong>%name%</strong></span>
<span class='name houtgoingName'>%name%</span><br>
%message%

View File

@ -3,5 +3,5 @@
</style>
<span class='incomingTime'>%time%</span>
<span class='incomingName'><strong>%name%</strong></span>
<span class='name incomingName'>%name%</span><br>
%message%

View File

@ -1,8 +1,12 @@
.name {
font-weight: bold;
}
.incomingTime {
color:#C00000;
}
.incomingName{
.incomingName {
color:#2D84C9;
}
@ -10,7 +14,7 @@
color:#C00000;
}
.outgoingName{
.outgoingName {
color:#2D84C9;
}
@ -18,7 +22,7 @@
color:#800000;
}
.hincomingName{
.hincomingName {
color:#1E5684;
}
@ -26,7 +30,7 @@
color:#800000;
}
.houtgoingName{
.houtgoingName {
color:#1E5684;
}
@ -34,7 +38,6 @@
color:#C00000;
}
.ooutgoingName{
.ooutgoingName {
color:#2D84C9;
}

View File

@ -3,5 +3,5 @@
</style>
<span class='ooutgoingTime'>%time%</span>
<span class='ooutgoingName'><strong>%name%</strong></span>
<span class='name ooutgoingName'>%name%</span><br>
%message%

View File

@ -3,5 +3,5 @@
</style>
<span class='outgoingTime'>%time%</span>
<span class='outgoingName'><strong>%name%</strong></span>
<span class='name outgoingName'>%name%</span><br>
%message%

View File

@ -202,27 +202,15 @@ void ChatPage::setPreviewMessages(QString &stylePath, QString styleVariant, QTex
textBrowser->clear();
QString nameIncoming = "Incoming";
QString nameOutgoing = "Outgoing";
QString nameIncoming = tr("Incoming");
QString nameOutgoing = tr("Outgoing");
QDateTime timestmp = QDateTime::fromTime_t(time(NULL));
QTextEdit textEdit;
QString message;
textEdit.setText(tr("Incoming message in history"));
message = textEdit.toHtml();
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_HINCOMING, nameIncoming, timestmp, message, CHAT_FORMATTEXT_EMBED_SMILEYS));
textEdit.setText(tr("Outgoing message in history"));
message = textEdit.toHtml();
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));
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_HINCOMING, nameIncoming, timestmp, tr("Incoming message in history"), CHAT_FORMATTEXT_EMBED_SMILEYS));
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_HOUTGOING, nameOutgoing, timestmp, tr("Outgoing message in history"), CHAT_FORMATTEXT_EMBED_SMILEYS));
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_INCOMING, nameIncoming, timestmp, tr("Incoming message"), CHAT_FORMATTEXT_EMBED_SMILEYS));
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_OUTGOING, nameOutgoing, timestmp, tr("Outgoing message"), CHAT_FORMATTEXT_EMBED_SMILEYS));
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_OOUTGOING, nameOutgoing, timestmp, tr("Outgoing offline message"), CHAT_FORMATTEXT_EMBED_SMILEYS));
}
void ChatPage::fillPreview(QListWidget *listWidget, QComboBox *comboBox, QTextBrowser *textBrowser)

View File

@ -381,7 +381,11 @@ void RshareSettings::setChatScreenFont(const QString &font)
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();
}
@ -393,7 +397,11 @@ void RshareSettings::setPublicChatStyle(const QString &stylePath, const QString
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();
}
@ -405,7 +413,11 @@ void RshareSettings::setPrivateChatStyle(const QString &stylePath, const QString
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();
}

View File

@ -1384,27 +1384,37 @@ p, li { white-space: pre-wrap; }
<translation>Verlauf</translation>
</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>
<translation>Eingehehende Nachricht aus dem Verlauf</translation>
</message>
<message>
<location line="+3"/>
<location line="+1"/>
<source>Outgoing message in history</source>
<translation>Ausgehende Nachricht aus dem Verlauf</translation>
</message>
<message>
<location line="+3"/>
<location line="+1"/>
<source>Incoming message</source>
<translation>Eingehehende Nachricht</translation>
</message>
<message>
<location line="+3"/>
<location line="+1"/>
<source>Outgoing message</source>
<translation>Ausgehehende Nachricht</translation>
</message>
<message>
<location line="+3"/>
<location line="+1"/>
<source>Outgoing offline message</source>
<translation>Ausgehehende offline Nachricht</translation>
</message>
@ -1416,16 +1426,31 @@ p, li { white-space: pre-wrap; }
<source>Standard style for group chat</source>
<translation>Standard Stil für den Gruppenchat</translation>
</message>
<message>
<location line="+4"/>
<source>Compact style for group chat</source>
<translation>Kompakter Stil für den Gruppenchat</translation>
</message>
<message>
<location line="+7"/>
<source>Standard style for private chat</source>
<translation>Standard Stil für den privaten Chat</translation>
</message>
<message>
<location line="+4"/>
<source>Compact style for private chat</source>
<translation>Kompakter Stil für den privaten Chat</translation>
</message>
<message>
<location line="+7"/>
<source>Standard style for history</source>
<translation>Standard Stil für den Verlauf</translation>
</message>
<message>
<location line="+4"/>
<source>Compact style for history</source>
<translation>Kompakter Stil für den Verlauf</translation>
</message>
</context>
<context>
<name>ChatWidget</name>
@ -5307,7 +5332,7 @@ p, li { white-space: pre-wrap; }
<translation>tippt...</translation>
</message>
<message>
<location line="+115"/>
<location line="+118"/>
<location line="+2"/>
<source>New group chat</source>
<translation>Neuer Gruppenchat</translation>