mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 21:58:57 -04:00
fixed styles loading in chat. Added missing history/compact/colored style
This commit is contained in:
parent
d053400914
commit
1e1fe7708f
6 changed files with 38 additions and 3 deletions
|
@ -578,7 +578,10 @@ static bool getStyleInfo(QString stylePath, QString stylePathRelative, ChatStyle
|
||||||
{
|
{
|
||||||
variants.clear();
|
variants.clear();
|
||||||
|
|
||||||
|
std::cerr << "Getting variants for style: \"" << stylePath.toStdString() << "\"" << std::endl;
|
||||||
|
|
||||||
if (stylePath.isEmpty()) {
|
if (stylePath.isEmpty()) {
|
||||||
|
std::cerr << "empty!" << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -586,11 +589,13 @@ static bool getStyleInfo(QString stylePath, QString stylePathRelative, ChatStyle
|
||||||
QDir dir(QApplication::applicationDirPath());
|
QDir dir(QApplication::applicationDirPath());
|
||||||
if (dir.cd(stylePath) == false) {
|
if (dir.cd(stylePath) == false) {
|
||||||
// style not found
|
// style not found
|
||||||
|
std::cerr << "no path!" << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dir.cd("variants") == false) {
|
if (dir.cd("variants") == false) {
|
||||||
// no variants available
|
// no variants available
|
||||||
|
std::cerr << "no variants!" << std::endl;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -621,6 +621,7 @@
|
||||||
<file>qss/chat/compact/history/system.htm</file>
|
<file>qss/chat/compact/history/system.htm</file>
|
||||||
<file>qss/chat/compact/history/main.css</file>
|
<file>qss/chat/compact/history/main.css</file>
|
||||||
<file>qss/chat/compact/history/variants/Standard.css</file>
|
<file>qss/chat/compact/history/variants/Standard.css</file>
|
||||||
|
<file>qss/chat/compact/history/variants/Colored.css</file>
|
||||||
<file>qss/stylesheet/qss.default</file>
|
<file>qss/stylesheet/qss.default</file>
|
||||||
<file>qss/stylesheet/Standard.qss</file>
|
<file>qss/stylesheet/Standard.qss</file>
|
||||||
<file>images/connect/connectFriendWatermark.png</file>
|
<file>images/connect/connectFriendWatermark.png</file>
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
.incomingName {
|
||||||
|
color:%color%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.outgoingName {
|
||||||
|
color:%color%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hincomingName {
|
||||||
|
color:%color%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.houtgoingName {
|
||||||
|
color:%color%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ooutgoingName {
|
||||||
|
color:%color%;
|
||||||
|
}
|
|
@ -30,7 +30,6 @@
|
||||||
#include <retroshare/rspeers.h>
|
#include <retroshare/rspeers.h>
|
||||||
#include "ChatPage.h"
|
#include "ChatPage.h"
|
||||||
#include <gui/RetroShareLink.h>
|
#include <gui/RetroShareLink.h>
|
||||||
#include "gui/chat/ChatStyle.h"
|
|
||||||
#include "gui/chat/ChatDialog.h"
|
#include "gui/chat/ChatDialog.h"
|
||||||
#include "gui/notifyqt.h"
|
#include "gui/notifyqt.h"
|
||||||
#include "rsharesettings.h"
|
#include "rsharesettings.h"
|
||||||
|
@ -46,7 +45,7 @@
|
||||||
#define IMAGE_CHAT_DELETE ":/images/deletemail24.png"
|
#define IMAGE_CHAT_DELETE ":/images/deletemail24.png"
|
||||||
#define IMAGE_CHAT_COPY ":/images/copyrslink.png"
|
#define IMAGE_CHAT_COPY ":/images/copyrslink.png"
|
||||||
|
|
||||||
static QString loadStyleInfo(ChatStyle::enumStyleType type, QComboBox *style_CB, QComboBox *comboBox, QString &styleVariant)
|
QString ChatPage::loadStyleInfo(ChatStyle::enumStyleType type, QComboBox *style_CB, QComboBox *comboBox, QString &styleVariant)
|
||||||
{
|
{
|
||||||
QList<ChatStyleInfo> styles;
|
QList<ChatStyleInfo> styles;
|
||||||
QList<ChatStyleInfo>::iterator style;
|
QList<ChatStyleInfo>::iterator style;
|
||||||
|
@ -87,6 +86,15 @@ static QString loadStyleInfo(ChatStyle::enumStyleType type, QComboBox *style_CB,
|
||||||
|
|
||||||
whileBlocking(style_CB)->setCurrentIndex(activeItem);
|
whileBlocking(style_CB)->setCurrentIndex(activeItem);
|
||||||
|
|
||||||
|
switch(type)
|
||||||
|
{
|
||||||
|
case ChatStyle::TYPE_PUBLIC: on_publicList_currentRowChanged(activeItem); break ;
|
||||||
|
case ChatStyle::TYPE_PRIVATE: on_privateList_currentRowChanged(activeItem); break ;
|
||||||
|
case ChatStyle::TYPE_HISTORY: on_historyList_currentRowChanged(activeItem); break ;
|
||||||
|
default:
|
||||||
|
break ;
|
||||||
|
}
|
||||||
|
|
||||||
/* now the combobox should be filled */
|
/* now the combobox should be filled */
|
||||||
|
|
||||||
int index = comboBox->findText(styleVariant);
|
int index = comboBox->findText(styleVariant);
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#define _CHATPAGE_H
|
#define _CHATPAGE_H
|
||||||
|
|
||||||
#include <retroshare-gui/configpage.h>
|
#include <retroshare-gui/configpage.h>
|
||||||
|
#include "gui/chat/ChatStyle.h"
|
||||||
#include "ui_ChatPage.h"
|
#include "ui_ChatPage.h"
|
||||||
|
|
||||||
class ChatPage : public ConfigPage
|
class ChatPage : public ConfigPage
|
||||||
|
@ -71,6 +72,7 @@ class ChatPage : public ConfigPage
|
||||||
private:
|
private:
|
||||||
void setPreviewMessages(QString &stylePath, QString styleVariant, QTextBrowser *textBrowser);
|
void setPreviewMessages(QString &stylePath, QString styleVariant, QTextBrowser *textBrowser);
|
||||||
void fillPreview(QComboBox *listWidget, QComboBox *comboBox, QTextBrowser *textBrowser);
|
void fillPreview(QComboBox *listWidget, QComboBox *comboBox, QTextBrowser *textBrowser);
|
||||||
|
QString loadStyleInfo(ChatStyle::enumStyleType type, QComboBox *style_CB, QComboBox *comboBox, QString &styleVariant);
|
||||||
|
|
||||||
QFont fontTempChat;
|
QFont fontTempChat;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="general">
|
<widget class="QWidget" name="general">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue