diff --git a/retroshare-gui/src/gui/FriendsDialog.cpp b/retroshare-gui/src/gui/FriendsDialog.cpp index 7d4fa50d2..21f70f4f2 100644 --- a/retroshare-gui/src/gui/FriendsDialog.cpp +++ b/retroshare-gui/src/gui/FriendsDialog.cpp @@ -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

'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); } diff --git a/retroshare-gui/src/gui/chat/ChatStyle.cpp b/retroshare-gui/src/gui/chat/ChatStyle.cpp index 1ae88feed..cdaa5b134 100644 --- a/retroshare-gui/src/gui/chat/ChatStyle.cpp +++ b/retroshare-gui/src/gui/chat/ChatStyle.cpp @@ -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: diff --git a/retroshare-gui/src/gui/chat/HandleRichText.cpp b/retroshare-gui/src/gui/chat/HandleRichText.cpp index eed0f5583..84d6c7bb8 100644 --- a/retroshare-gui/src/gui/chat/HandleRichText.cpp +++ b/retroshare-gui/src/gui/chat/HandleRichText.cpp @@ -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 to + 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

+ if (addBR && element.tagName().toLower() != "p") { + // add
after a removed

but not before a

+ QDomElement elementBr = doc.createElement("br"); + currentElement.insertBefore(elementBr, element); + addBR = false; + ++index; + } + + // + if (element.tagName().toLower() == "body") { + if (element.attributes().length() == 0) { + // remove without attributes + removeElement(currentElement, element); + // no ++index; + continue; + } + // change to + element.setTagName("span"); + } + + // if (element.tagName().toLower() == "head") { - // remove head + // remove 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); + + //

+ if (element.tagName().toLower() == "p") { + //

+ //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
after a removed

before a removed

+ QDomElement elementBr = doc.createElement("br"); + currentElement.insertBefore(elementBr, element); + ++index; + } + // remove Qt standard

or empty

+ 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("]*>")); @@ -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) diff --git a/retroshare-gui/src/gui/chat/HandleRichText.h b/retroshare-gui/src/gui/chat/HandleRichText.h index dfe9ce6b2..13e6b1f2f 100644 --- a/retroshare-gui/src/gui/chat/HandleRichText.h +++ b/retroshare-gui/src/gui/chat/HandleRichText.h @@ -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 diff --git a/retroshare-gui/src/gui/images.qrc b/retroshare-gui/src/gui/images.qrc index 659803c00..4a3147d57 100644 --- a/retroshare-gui/src/gui/images.qrc +++ b/retroshare-gui/src/gui/images.qrc @@ -474,30 +474,54 @@ images/window_fullscreen.png images/window_nofullscreen.png layouts/default.ui - qss/chat/private/info.xml - qss/chat/private/incoming.htm - qss/chat/private/outgoing.htm - qss/chat/private/hincoming.htm - qss/chat/private/houtgoing.htm - qss/chat/private/ooutgoing.htm - qss/chat/private/main.css - qss/chat/private/variants/Standard.css - qss/chat/public/info.xml - qss/chat/public/incoming.htm - qss/chat/public/outgoing.htm - qss/chat/public/hincoming.htm - qss/chat/public/houtgoing.htm - qss/chat/public/ooutgoing.htm - qss/chat/public/main.css - qss/chat/public/variants/Standard.css - qss/chat/history/info.xml - qss/chat/history/incoming.htm - qss/chat/history/outgoing.htm - qss/chat/history/hincoming.htm - qss/chat/history/houtgoing.htm - qss/chat/history/ooutgoing.htm - qss/chat/history/main.css - qss/chat/history/variants/Standard.css + qss/chat/standard/private/info.xml + qss/chat/standard/private/incoming.htm + qss/chat/standard/private/outgoing.htm + qss/chat/standard/private/hincoming.htm + qss/chat/standard/private/houtgoing.htm + qss/chat/standard/private/ooutgoing.htm + qss/chat/standard/private/main.css + qss/chat/standard/private/variants/Standard.css + qss/chat/standard/public/info.xml + qss/chat/standard/public/incoming.htm + qss/chat/standard/public/outgoing.htm + qss/chat/standard/public/hincoming.htm + qss/chat/standard/public/houtgoing.htm + qss/chat/standard/public/ooutgoing.htm + qss/chat/standard/public/main.css + qss/chat/standard/public/variants/Standard.css + qss/chat/standard/history/info.xml + qss/chat/standard/history/incoming.htm + qss/chat/standard/history/outgoing.htm + qss/chat/standard/history/hincoming.htm + qss/chat/standard/history/houtgoing.htm + qss/chat/standard/history/ooutgoing.htm + qss/chat/standard/history/main.css + qss/chat/standard/history/variants/Standard.css + qss/chat/compact/private/info.xml + qss/chat/compact/private/incoming.htm + qss/chat/compact/private/outgoing.htm + qss/chat/compact/private/hincoming.htm + qss/chat/compact/private/houtgoing.htm + qss/chat/compact/private/ooutgoing.htm + qss/chat/compact/private/main.css + qss/chat/compact/private/variants/Standard.css + qss/chat/compact/public/info.xml + qss/chat/compact/public/incoming.htm + qss/chat/compact/public/outgoing.htm + qss/chat/compact/public/hincoming.htm + qss/chat/compact/public/houtgoing.htm + qss/chat/compact/public/ooutgoing.htm + qss/chat/compact/public/main.css + qss/chat/compact/public/variants/Standard.css + qss/chat/compact/history/info.xml + qss/chat/compact/history/incoming.htm + qss/chat/compact/history/outgoing.htm + qss/chat/compact/history/hincoming.htm + qss/chat/compact/history/houtgoing.htm + qss/chat/compact/history/ooutgoing.htm + qss/chat/compact/history/main.css + qss/chat/compact/history/variants/Standard.css smileys/amorous.png smileys/angry.png smileys/bad.png diff --git a/retroshare-gui/src/gui/qss/chat/compact/history/hincoming.htm b/retroshare-gui/src/gui/qss/chat/compact/history/hincoming.htm new file mode 100644 index 000000000..fc424dde4 --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/history/hincoming.htm @@ -0,0 +1,11 @@ + + + +
+%date% %time% +%name%: +%message% +
+ \ No newline at end of file diff --git a/retroshare-gui/src/gui/qss/chat/compact/history/houtgoing.htm b/retroshare-gui/src/gui/qss/chat/compact/history/houtgoing.htm new file mode 100644 index 000000000..b55089c3a --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/history/houtgoing.htm @@ -0,0 +1,11 @@ + + + +
+%date% %time% +%name%: +%message% +
+ \ No newline at end of file diff --git a/retroshare-gui/src/gui/qss/chat/compact/history/incoming.htm b/retroshare-gui/src/gui/qss/chat/compact/history/incoming.htm new file mode 100644 index 000000000..967bff6c4 --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/history/incoming.htm @@ -0,0 +1,11 @@ + + + +
+%date% %time% +%name%: +%message% +
+ \ No newline at end of file diff --git a/retroshare-gui/src/gui/qss/chat/compact/history/info.xml b/retroshare-gui/src/gui/qss/chat/compact/history/info.xml new file mode 100644 index 000000000..578124d18 --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/history/info.xml @@ -0,0 +1,12 @@ + + + + + + RetroShare Team + + + \ No newline at end of file diff --git a/retroshare-gui/src/gui/qss/chat/compact/history/main.css b/retroshare-gui/src/gui/qss/chat/compact/history/main.css new file mode 100644 index 000000000..a5307dc8c --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/history/main.css @@ -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; +} diff --git a/retroshare-gui/src/gui/qss/chat/compact/history/ooutgoing.htm b/retroshare-gui/src/gui/qss/chat/compact/history/ooutgoing.htm new file mode 100644 index 000000000..a82504278 --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/history/ooutgoing.htm @@ -0,0 +1,11 @@ + + + +
+%date% %time% +%name%: +%message% +
+ \ No newline at end of file diff --git a/retroshare-gui/src/gui/qss/chat/compact/history/outgoing.htm b/retroshare-gui/src/gui/qss/chat/compact/history/outgoing.htm new file mode 100644 index 000000000..b159c809d --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/history/outgoing.htm @@ -0,0 +1,11 @@ + + + +
+%date% %time% +%name%: +%message% +
+ \ No newline at end of file diff --git a/retroshare-gui/src/gui/qss/chat/history/variants/Standard.css b/retroshare-gui/src/gui/qss/chat/compact/history/variants/Standard.css similarity index 100% rename from retroshare-gui/src/gui/qss/chat/history/variants/Standard.css rename to retroshare-gui/src/gui/qss/chat/compact/history/variants/Standard.css diff --git a/retroshare-gui/src/gui/qss/chat/compact/private/hincoming.htm b/retroshare-gui/src/gui/qss/chat/compact/private/hincoming.htm new file mode 100644 index 000000000..3166d5896 --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/private/hincoming.htm @@ -0,0 +1,7 @@ + + +%date% %time% +%name%: +%message% \ No newline at end of file diff --git a/retroshare-gui/src/gui/qss/chat/compact/private/houtgoing.htm b/retroshare-gui/src/gui/qss/chat/compact/private/houtgoing.htm new file mode 100644 index 000000000..0f3f45aa2 --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/private/houtgoing.htm @@ -0,0 +1,7 @@ + + +%date% %time% +%name%: +%message% \ No newline at end of file diff --git a/retroshare-gui/src/gui/qss/chat/compact/private/incoming.htm b/retroshare-gui/src/gui/qss/chat/compact/private/incoming.htm new file mode 100644 index 000000000..8b2842482 --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/private/incoming.htm @@ -0,0 +1,7 @@ + + +%time% +%name%: +%message% \ No newline at end of file diff --git a/retroshare-gui/src/gui/qss/chat/compact/private/info.xml b/retroshare-gui/src/gui/qss/chat/compact/private/info.xml new file mode 100644 index 000000000..578124d18 --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/private/info.xml @@ -0,0 +1,12 @@ + + + + + + RetroShare Team + + + \ No newline at end of file diff --git a/retroshare-gui/src/gui/qss/chat/compact/private/main.css b/retroshare-gui/src/gui/qss/chat/compact/private/main.css new file mode 100644 index 000000000..614f8661d --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/private/main.css @@ -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; +} diff --git a/retroshare-gui/src/gui/qss/chat/compact/private/ooutgoing.htm b/retroshare-gui/src/gui/qss/chat/compact/private/ooutgoing.htm new file mode 100644 index 000000000..a342ea0a9 --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/private/ooutgoing.htm @@ -0,0 +1,7 @@ + + +%time% +%name%: +%message% \ No newline at end of file diff --git a/retroshare-gui/src/gui/qss/chat/compact/private/outgoing.htm b/retroshare-gui/src/gui/qss/chat/compact/private/outgoing.htm new file mode 100644 index 000000000..d781f860e --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/private/outgoing.htm @@ -0,0 +1,7 @@ + + +%time% +%name%: +%message% \ No newline at end of file diff --git a/retroshare-gui/src/gui/qss/chat/private/variants/Standard.css b/retroshare-gui/src/gui/qss/chat/compact/private/variants/Standard.css similarity index 100% rename from retroshare-gui/src/gui/qss/chat/private/variants/Standard.css rename to retroshare-gui/src/gui/qss/chat/compact/private/variants/Standard.css diff --git a/retroshare-gui/src/gui/qss/chat/compact/public/hincoming.htm b/retroshare-gui/src/gui/qss/chat/compact/public/hincoming.htm new file mode 100644 index 000000000..320f2a2ef --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/public/hincoming.htm @@ -0,0 +1,7 @@ + + +%date% %time% +%name%: +%message% \ No newline at end of file diff --git a/retroshare-gui/src/gui/qss/chat/compact/public/houtgoing.htm b/retroshare-gui/src/gui/qss/chat/compact/public/houtgoing.htm new file mode 100644 index 000000000..1a7b1ecc0 --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/public/houtgoing.htm @@ -0,0 +1,7 @@ + + +%date% %time% +%name%: +%message% \ No newline at end of file diff --git a/retroshare-gui/src/gui/qss/chat/compact/public/incoming.htm b/retroshare-gui/src/gui/qss/chat/compact/public/incoming.htm new file mode 100644 index 000000000..bcc98bab0 --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/public/incoming.htm @@ -0,0 +1,7 @@ + + +%time% +%name%: +%message% \ No newline at end of file diff --git a/retroshare-gui/src/gui/qss/chat/compact/public/info.xml b/retroshare-gui/src/gui/qss/chat/compact/public/info.xml new file mode 100644 index 000000000..578124d18 --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/public/info.xml @@ -0,0 +1,12 @@ + + + + + + RetroShare Team + + + \ No newline at end of file diff --git a/retroshare-gui/src/gui/qss/chat/compact/public/main.css b/retroshare-gui/src/gui/qss/chat/compact/public/main.css new file mode 100644 index 000000000..25b2f4686 --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/public/main.css @@ -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; +} diff --git a/retroshare-gui/src/gui/qss/chat/compact/public/ooutgoing.htm b/retroshare-gui/src/gui/qss/chat/compact/public/ooutgoing.htm new file mode 100644 index 000000000..2ad258edb --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/public/ooutgoing.htm @@ -0,0 +1,7 @@ + + +%time% +%name%: +%message% \ No newline at end of file diff --git a/retroshare-gui/src/gui/qss/chat/compact/public/outgoing.htm b/retroshare-gui/src/gui/qss/chat/compact/public/outgoing.htm new file mode 100644 index 000000000..2ce0ac8ea --- /dev/null +++ b/retroshare-gui/src/gui/qss/chat/compact/public/outgoing.htm @@ -0,0 +1,7 @@ + + +%time% +%name%: +%message% \ No newline at end of file diff --git a/retroshare-gui/src/gui/qss/chat/public/variants/Standard.css b/retroshare-gui/src/gui/qss/chat/compact/public/variants/Standard.css similarity index 100% rename from retroshare-gui/src/gui/qss/chat/public/variants/Standard.css rename to retroshare-gui/src/gui/qss/chat/compact/public/variants/Standard.css diff --git a/retroshare-gui/src/gui/qss/chat/images/Thumbs.db b/retroshare-gui/src/gui/qss/chat/images/Thumbs.db deleted file mode 100644 index d4795cf89..000000000 Binary files a/retroshare-gui/src/gui/qss/chat/images/Thumbs.db and /dev/null differ diff --git a/retroshare-gui/src/gui/qss/chat/images/rstray3.png b/retroshare-gui/src/gui/qss/chat/images/rstray3.png deleted file mode 100644 index d03d45063..000000000 Binary files a/retroshare-gui/src/gui/qss/chat/images/rstray3.png and /dev/null differ diff --git a/retroshare-gui/src/gui/qss/chat/history/hincoming.htm b/retroshare-gui/src/gui/qss/chat/standard/history/hincoming.htm similarity index 100% rename from retroshare-gui/src/gui/qss/chat/history/hincoming.htm rename to retroshare-gui/src/gui/qss/chat/standard/history/hincoming.htm diff --git a/retroshare-gui/src/gui/qss/chat/history/houtgoing.htm b/retroshare-gui/src/gui/qss/chat/standard/history/houtgoing.htm similarity index 100% rename from retroshare-gui/src/gui/qss/chat/history/houtgoing.htm rename to retroshare-gui/src/gui/qss/chat/standard/history/houtgoing.htm diff --git a/retroshare-gui/src/gui/qss/chat/history/incoming.htm b/retroshare-gui/src/gui/qss/chat/standard/history/incoming.htm similarity index 100% rename from retroshare-gui/src/gui/qss/chat/history/incoming.htm rename to retroshare-gui/src/gui/qss/chat/standard/history/incoming.htm diff --git a/retroshare-gui/src/gui/qss/chat/history/info.xml b/retroshare-gui/src/gui/qss/chat/standard/history/info.xml similarity index 100% rename from retroshare-gui/src/gui/qss/chat/history/info.xml rename to retroshare-gui/src/gui/qss/chat/standard/history/info.xml diff --git a/retroshare-gui/src/gui/qss/chat/history/main.css b/retroshare-gui/src/gui/qss/chat/standard/history/main.css similarity index 85% rename from retroshare-gui/src/gui/qss/chat/history/main.css rename to retroshare-gui/src/gui/qss/chat/standard/history/main.css index ebd5d18bd..af0cd950d 100644 --- a/retroshare-gui/src/gui/qss/chat/history/main.css +++ b/retroshare-gui/src/gui/qss/chat/standard/history/main.css @@ -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; } diff --git a/retroshare-gui/src/gui/qss/chat/history/ooutgoing.htm b/retroshare-gui/src/gui/qss/chat/standard/history/ooutgoing.htm similarity index 100% rename from retroshare-gui/src/gui/qss/chat/history/ooutgoing.htm rename to retroshare-gui/src/gui/qss/chat/standard/history/ooutgoing.htm diff --git a/retroshare-gui/src/gui/qss/chat/history/outgoing.htm b/retroshare-gui/src/gui/qss/chat/standard/history/outgoing.htm similarity index 100% rename from retroshare-gui/src/gui/qss/chat/history/outgoing.htm rename to retroshare-gui/src/gui/qss/chat/standard/history/outgoing.htm diff --git a/retroshare-gui/src/gui/qss/chat/standard/history/variants/Standard.css b/retroshare-gui/src/gui/qss/chat/standard/history/variants/Standard.css new file mode 100644 index 000000000..e69de29bb diff --git a/retroshare-gui/src/gui/qss/chat/private/hincoming.htm b/retroshare-gui/src/gui/qss/chat/standard/private/hincoming.htm similarity index 100% rename from retroshare-gui/src/gui/qss/chat/private/hincoming.htm rename to retroshare-gui/src/gui/qss/chat/standard/private/hincoming.htm diff --git a/retroshare-gui/src/gui/qss/chat/private/houtgoing.htm b/retroshare-gui/src/gui/qss/chat/standard/private/houtgoing.htm similarity index 100% rename from retroshare-gui/src/gui/qss/chat/private/houtgoing.htm rename to retroshare-gui/src/gui/qss/chat/standard/private/houtgoing.htm diff --git a/retroshare-gui/src/gui/qss/chat/private/incoming.htm b/retroshare-gui/src/gui/qss/chat/standard/private/incoming.htm similarity index 100% rename from retroshare-gui/src/gui/qss/chat/private/incoming.htm rename to retroshare-gui/src/gui/qss/chat/standard/private/incoming.htm diff --git a/retroshare-gui/src/gui/qss/chat/private/info.xml b/retroshare-gui/src/gui/qss/chat/standard/private/info.xml similarity index 100% rename from retroshare-gui/src/gui/qss/chat/private/info.xml rename to retroshare-gui/src/gui/qss/chat/standard/private/info.xml diff --git a/retroshare-gui/src/gui/qss/chat/private/main.css b/retroshare-gui/src/gui/qss/chat/standard/private/main.css similarity index 100% rename from retroshare-gui/src/gui/qss/chat/private/main.css rename to retroshare-gui/src/gui/qss/chat/standard/private/main.css diff --git a/retroshare-gui/src/gui/qss/chat/private/ooutgoing.htm b/retroshare-gui/src/gui/qss/chat/standard/private/ooutgoing.htm similarity index 100% rename from retroshare-gui/src/gui/qss/chat/private/ooutgoing.htm rename to retroshare-gui/src/gui/qss/chat/standard/private/ooutgoing.htm diff --git a/retroshare-gui/src/gui/qss/chat/private/outgoing.htm b/retroshare-gui/src/gui/qss/chat/standard/private/outgoing.htm similarity index 100% rename from retroshare-gui/src/gui/qss/chat/private/outgoing.htm rename to retroshare-gui/src/gui/qss/chat/standard/private/outgoing.htm diff --git a/retroshare-gui/src/gui/qss/chat/standard/private/variants/Standard.css b/retroshare-gui/src/gui/qss/chat/standard/private/variants/Standard.css new file mode 100644 index 000000000..e69de29bb diff --git a/retroshare-gui/src/gui/qss/chat/public/hincoming.htm b/retroshare-gui/src/gui/qss/chat/standard/public/hincoming.htm similarity index 61% rename from retroshare-gui/src/gui/qss/chat/public/hincoming.htm rename to retroshare-gui/src/gui/qss/chat/standard/public/hincoming.htm index 6b20807d5..e4734b0d3 100644 --- a/retroshare-gui/src/gui/qss/chat/public/hincoming.htm +++ b/retroshare-gui/src/gui/qss/chat/standard/public/hincoming.htm @@ -3,5 +3,5 @@ %date% %time% -%name% +%name%
%message% diff --git a/retroshare-gui/src/gui/qss/chat/public/houtgoing.htm b/retroshare-gui/src/gui/qss/chat/standard/public/houtgoing.htm similarity index 61% rename from retroshare-gui/src/gui/qss/chat/public/houtgoing.htm rename to retroshare-gui/src/gui/qss/chat/standard/public/houtgoing.htm index b9c22da01..305eaf838 100644 --- a/retroshare-gui/src/gui/qss/chat/public/houtgoing.htm +++ b/retroshare-gui/src/gui/qss/chat/standard/public/houtgoing.htm @@ -3,5 +3,5 @@ %date% %time% -%name% +%name%
%message% diff --git a/retroshare-gui/src/gui/qss/chat/public/incoming.htm b/retroshare-gui/src/gui/qss/chat/standard/public/incoming.htm similarity index 59% rename from retroshare-gui/src/gui/qss/chat/public/incoming.htm rename to retroshare-gui/src/gui/qss/chat/standard/public/incoming.htm index f65d02b56..bdb1a1a43 100644 --- a/retroshare-gui/src/gui/qss/chat/public/incoming.htm +++ b/retroshare-gui/src/gui/qss/chat/standard/public/incoming.htm @@ -3,5 +3,5 @@ %time% -%name% +%name%
%message% diff --git a/retroshare-gui/src/gui/qss/chat/public/info.xml b/retroshare-gui/src/gui/qss/chat/standard/public/info.xml similarity index 100% rename from retroshare-gui/src/gui/qss/chat/public/info.xml rename to retroshare-gui/src/gui/qss/chat/standard/public/info.xml diff --git a/retroshare-gui/src/gui/qss/chat/public/main.css b/retroshare-gui/src/gui/qss/chat/standard/public/main.css similarity index 63% rename from retroshare-gui/src/gui/qss/chat/public/main.css rename to retroshare-gui/src/gui/qss/chat/standard/public/main.css index d276a74ca..4750522cb 100644 --- a/retroshare-gui/src/gui/qss/chat/public/main.css +++ b/retroshare-gui/src/gui/qss/chat/standard/public/main.css @@ -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; } - diff --git a/retroshare-gui/src/gui/qss/chat/public/ooutgoing.htm b/retroshare-gui/src/gui/qss/chat/standard/public/ooutgoing.htm similarity index 59% rename from retroshare-gui/src/gui/qss/chat/public/ooutgoing.htm rename to retroshare-gui/src/gui/qss/chat/standard/public/ooutgoing.htm index 715c9375a..dc8f97008 100644 --- a/retroshare-gui/src/gui/qss/chat/public/ooutgoing.htm +++ b/retroshare-gui/src/gui/qss/chat/standard/public/ooutgoing.htm @@ -3,5 +3,5 @@ %time% -%name% +%name%
%message% diff --git a/retroshare-gui/src/gui/qss/chat/public/outgoing.htm b/retroshare-gui/src/gui/qss/chat/standard/public/outgoing.htm similarity index 59% rename from retroshare-gui/src/gui/qss/chat/public/outgoing.htm rename to retroshare-gui/src/gui/qss/chat/standard/public/outgoing.htm index 59e07d67f..dad318ffd 100644 --- a/retroshare-gui/src/gui/qss/chat/public/outgoing.htm +++ b/retroshare-gui/src/gui/qss/chat/standard/public/outgoing.htm @@ -3,5 +3,5 @@ %time% -%name% +%name%
%message% diff --git a/retroshare-gui/src/gui/qss/chat/standard/public/variants/Standard.css b/retroshare-gui/src/gui/qss/chat/standard/public/variants/Standard.css new file mode 100644 index 000000000..e69de29bb diff --git a/retroshare-gui/src/gui/settings/ChatPage.cpp b/retroshare-gui/src/gui/settings/ChatPage.cpp index 1f7b1be34..45eda072a 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.cpp +++ b/retroshare-gui/src/gui/settings/ChatPage.cpp @@ -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) diff --git a/retroshare-gui/src/gui/settings/rsharesettings.cpp b/retroshare-gui/src/gui/settings/rsharesettings.cpp index e52a2285b..086c97731 100644 --- a/retroshare-gui/src/gui/settings/rsharesettings.cpp +++ b/retroshare-gui/src/gui/settings/rsharesettings.cpp @@ -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(); } diff --git a/retroshare-gui/src/lang/retroshare_de.qm b/retroshare-gui/src/lang/retroshare_de.qm index b2c8fdeba..4be1bcf6a 100644 Binary files a/retroshare-gui/src/lang/retroshare_de.qm and b/retroshare-gui/src/lang/retroshare_de.qm differ diff --git a/retroshare-gui/src/lang/retroshare_de.ts b/retroshare-gui/src/lang/retroshare_de.ts index c52680404..f4033c244 100644 --- a/retroshare-gui/src/lang/retroshare_de.ts +++ b/retroshare-gui/src/lang/retroshare_de.ts @@ -1384,27 +1384,37 @@ p, li { white-space: pre-wrap; } Verlauf - + + Incoming + Eingehend + + + + Outgoing + Ausgehend + + + Incoming message in history Eingehehende Nachricht aus dem Verlauf - + Outgoing message in history Ausgehende Nachricht aus dem Verlauf - + Incoming message Eingehehende Nachricht - + Outgoing message Ausgehehende Nachricht - + Outgoing offline message Ausgehehende offline Nachricht @@ -1416,16 +1426,31 @@ p, li { white-space: pre-wrap; } Standard style for group chat Standard Stil für den Gruppenchat + + + Compact style for group chat + Kompakter Stil für den Gruppenchat + Standard style for private chat Standard Stil für den privaten Chat + + + Compact style for private chat + Kompakter Stil für den privaten Chat + Standard style for history Standard Stil für den Verlauf + + + Compact style for history + Kompakter Stil für den Verlauf + ChatWidget @@ -5307,7 +5332,7 @@ p, li { white-space: pre-wrap; } tippt... - + New group chat Neuer Gruppenchat