Merge pull request #260 from PhenomRetroShare/Add_SendAsPlainText_And_NoEmoteIcon_Button

Add buttons to send message in plain text and without EmoteIcon.
This commit is contained in:
Cyril Soler 2016-06-14 20:30:06 -04:00 committed by GitHub
commit cedce2ecef
15 changed files with 221 additions and 103 deletions

View File

@ -72,7 +72,7 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
QObject::connect( ui.filterLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(filterItems(QString))); QObject::connect( ui.filterLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(filterItems(QString)));
QObject::connect( ui.filterLineEdit, SIGNAL(filterChanged(int)), this, SLOT(filterColumnChanged(int))); QObject::connect( ui.filterLineEdit, SIGNAL(filterChanged(int)), this, SLOT(filterColumnChanged(int)));
QObject::connect( ui.createlobbytoolButton, SIGNAL(clicked()), this, SLOT(createChatLobby())); QObject::connect( ui.createLobbyToolButton, SIGNAL(clicked()), this, SLOT(createChatLobby()));
compareRole = new RSTreeWidgetItemCompareRole; compareRole = new RSTreeWidgetItemCompareRole;
compareRole->setRole(COLUMN_NAME, ROLE_SORT); compareRole->setRole(COLUMN_NAME, ROLE_SORT);

View File

@ -10,8 +10,17 @@
<height>517</height> <height>517</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="QVBoxLayout">
<property name="margin"> <property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
@ -28,8 +37,17 @@
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Sunken</enum> <enum>QFrame::Sunken</enum>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="titleBarFrameLayout">
<property name="margin"> <property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number> <number>2</number>
</property> </property>
<item> <item>
@ -53,7 +71,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<spacer> <spacer name="titleBarVSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -91,7 +109,7 @@
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<widget class="QWidget" name="layoutWidget"> <widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="lobbyTreeVLayout">
<item> <item>
<widget class="QFrame" name="toolBarFrame"> <widget class="QFrame" name="toolBarFrame">
<property name="styleSheet"> <property name="styleSheet">
@ -103,7 +121,7 @@
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="toolBarFrameGLayout">
<property name="leftMargin"> <property name="leftMargin">
<number>2</number> <number>2</number>
</property> </property>
@ -130,7 +148,7 @@
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QToolButton" name="createlobbytoolButton"> <widget class="QToolButton" name="createLobbyToolButton">
<property name="toolTip"> <property name="toolTip">
<string>Create chat lobby</string> <string>Create chat lobby</string>
</property> </property>
@ -183,8 +201,17 @@
<number>0</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="_lobby_blank_page"> <widget class="QWidget" name="_lobby_blank_page">
<layout class="QGridLayout" name="gridLayout_4"> <layout class="QGridLayout" name="_lobby_blank_pageGLayout">
<property name="margin"> <property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing"> <property name="spacing">
@ -195,13 +222,13 @@
<property name="title"> <property name="title">
<string>Selected lobby info</string> <string>Selected lobby info</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="lobbyinfo_groupBoxVLayout">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="lobbyInfoHLayout">
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="lobbyInfoNameVLayout">
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="lobbyname_label">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -214,7 +241,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="lobbyid_label">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -227,7 +254,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="lobbytopic_label">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -240,7 +267,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="lobbytype_label">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -253,7 +280,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="lobbysec_label">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -266,7 +293,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_5"> <widget class="QLabel" name="lobbypeers_label">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -281,7 +308,7 @@
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="lobbyInfoValueVLayout">
<item> <item>
<widget class="QLabel" name="lobbyname_lineEdit"> <widget class="QLabel" name="lobbyname_lineEdit">
<property name="sizePolicy"> <property name="sizePolicy">
@ -372,7 +399,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer"> <spacer name="lobbyInfoVSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>

View File

@ -13,7 +13,7 @@
<property name="windowTitle"> <property name="windowTitle">
<string notr="true">MainWindow</string> <string notr="true">MainWindow</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="ChatLobbyDialogHLayout">
<property name="margin"> <property name="margin">
<number>0</number> <number>0</number>
</property> </property>
@ -52,7 +52,7 @@
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="participantsFrameVLayout">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>

View File

@ -99,6 +99,10 @@ ChatWidget::ChatWidget(QWidget *parent) :
ui->addFileButton->setIconSize(iconSize); ui->addFileButton->setIconSize(iconSize);
ui->pushtoolsButton->setFixedSize(buttonSize); ui->pushtoolsButton->setFixedSize(buttonSize);
ui->pushtoolsButton->setIconSize(iconSize); ui->pushtoolsButton->setIconSize(iconSize);
ui->sendAsPlainTextButton->setFixedSize(buttonSize);
ui->sendAsPlainTextButton->setIconSize(iconSize);
ui->noEmbedButton->setFixedSize(buttonSize);
ui->noEmbedButton->setIconSize(iconSize);
ui->notifyButton->setFixedSize(buttonSize); ui->notifyButton->setFixedSize(buttonSize);
ui->notifyButton->setIconSize(iconSize); ui->notifyButton->setIconSize(iconSize);
ui->markButton->setFixedSize(buttonSize); ui->markButton->setFixedSize(buttonSize);
@ -191,6 +195,7 @@ ChatWidget::ChatWidget(QWidget *parent) :
menu->addAction(ui->actionSaveChatHistory); menu->addAction(ui->actionSaveChatHistory);
menu->addAction(ui->actionMessageHistory); menu->addAction(ui->actionMessageHistory);
ui->pushtoolsButton->setMenu(menu); ui->pushtoolsButton->setMenu(menu);
ui->sendAsPlainTextButton->setChecked(Settings->getChatSendAsPlainTextByDef());
ui->textBrowser->installEventFilter(this); ui->textBrowser->installEventFilter(this);
ui->textBrowser->viewport()->installEventFilter(this); ui->textBrowser->viewport()->installEventFilter(this);
@ -899,7 +904,8 @@ void ChatWidget::addChatMsg(bool incoming, const QString &name, const RsGxsId gx
// embed smileys ? // embed smileys ?
if (Settings->valueFromGroup(QString("Chat"), QString::fromUtf8("Emoteicons_PrivatChat"), true).toBool()) { if (Settings->valueFromGroup(QString("Chat"), QString::fromUtf8("Emoteicons_PrivatChat"), true).toBool()) {
formatTextFlag |= RSHTML_FORMATTEXT_EMBED_SMILEYS; if (!message.contains("NoEmbed=\"true\""))
formatTextFlag |= RSHTML_FORMATTEXT_EMBED_SMILEYS;
} }
// Always fix colors // Always fix colors
@ -1134,7 +1140,12 @@ void ChatWidget::sendChat()
} }
QString text; QString text;
RsHtml::optimizeHtml(chatWidget, text); if (ui->sendAsPlainTextButton->isChecked()){
text = chatWidget->toPlainText();
text.replace(QChar(-4),"");//Char used when image on text.
} else {
RsHtml::optimizeHtml(chatWidget, text, (ui->noEmbedButton->isChecked() ? RSHTML_FORMATTEXT_NO_EMBED : 0));
}
std::string msg = text.toUtf8().constData(); std::string msg = text.toUtf8().constData();
if (msg.empty()) { if (msg.empty()) {

View File

@ -513,6 +513,42 @@ border-image: url(:/images/closepressed.png)
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QToolButton" name="sendAsPlainTextButton">
<property name="toolTip">
<string>Send as plain text without font.</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/ColoredText.png</normaloff>
<normalon>:/images/SimpleText.png</normalon>:/images/ColoredText.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="noEmbedButton">
<property name="toolTip">
<string>Don't replace tag with Emote Icon.</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/emoticons/kopete/kopete020.png</normaloff>
<normalon>:/images/SmileyText.png</normalon>:/images/emoticons/kopete/kopete020.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item> <item>
<widget class="QFrame" name="pluginButtonFrame"> <widget class="QFrame" name="pluginButtonFrame">
<property name="frameShape"> <property name="frameShape">

View File

@ -658,5 +658,8 @@
<file>images/rsmessenger16.png</file> <file>images/rsmessenger16.png</file>
<file>images/rsmessenger32.png</file> <file>images/rsmessenger32.png</file>
<file>images/rsmessenger48.png</file> <file>images/rsmessenger48.png</file>
<file>images/SmileyText.png</file>
<file>images/SimpleText.png</file>
<file>images/ColoredText.png</file>
</qresource> </qresource>
</RCC> </RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -100,7 +100,7 @@ ChatPage::ChatPage(QWidget * parent, Qt::WindowFlags flags)
/* Invoke the Qt Designer generated object setup routine */ /* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this); ui.setupUi(this);
connect(ui.distantChatcomboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(distantChatComboBoxChanged(int))); connect(ui.distantChatComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(distantChatComboBoxChanged(int)));
#if QT_VERSION < 0x040600 #if QT_VERSION < 0x040600
ui.minimumContrastLabel->hide(); ui.minimumContrastLabel->hide();
@ -123,12 +123,13 @@ ChatPage::save(QString &/*errmsg*/)
Settings->setValue("MinimumContrast", ui.minimumContrast->value()); Settings->setValue("MinimumContrast", ui.minimumContrast->value());
Settings->endGroup(); Settings->endGroup();
// state of distant Chat combobox // state of distant Chat combobox
Settings->setValue("DistantChat", ui.distantChatcomboBox->currentIndex()); Settings->setValue("DistantChat", ui.distantChatComboBox->currentIndex());
Settings->setChatScreenFont(fontTempChat.toString()); Settings->setChatScreenFont(fontTempChat.toString());
NotifyQt::getInstance()->notifyChatFontChanged(); NotifyQt::getInstance()->notifyChatFontChanged();
Settings->setChatSendMessageWithCtrlReturn(ui.sendMessageWithCtrlReturn->isChecked()); Settings->setChatSendMessageWithCtrlReturn(ui.sendMessageWithCtrlReturn->isChecked());
Settings->setChatSendAsPlainTextByDef(ui.sendAsPlainTextByDef->isChecked());
Settings->setChatSearchCharToStartSearch(ui.sbSearch_CharToStart->value()); Settings->setChatSearchCharToStartSearch(ui.sbSearch_CharToStart->value());
Settings->setChatSearchCaseSensitively(ui.cbSearch_CaseSensitively->isChecked()); Settings->setChatSearchCaseSensitively(ui.cbSearch_CaseSensitively->isChecked());
@ -231,11 +232,12 @@ ChatPage::load()
// state of distant Chat combobox // state of distant Chat combobox
int index = Settings->value("DistantChat", 0).toInt(); int index = Settings->value("DistantChat", 0).toInt();
ui.distantChatcomboBox->setCurrentIndex(index); ui.distantChatComboBox->setCurrentIndex(index);
fontTempChat.fromString(Settings->getChatScreenFont()); fontTempChat.fromString(Settings->getChatScreenFont());
ui.sendMessageWithCtrlReturn->setChecked(Settings->getChatSendMessageWithCtrlReturn()); ui.sendMessageWithCtrlReturn->setChecked(Settings->getChatSendMessageWithCtrlReturn());
ui.sendAsPlainTextByDef->setChecked(Settings->getChatSendAsPlainTextByDef());
ui.sbSearch_CharToStart->setValue(Settings->getChatSearchCharToStartSearch()); ui.sbSearch_CharToStart->setValue(Settings->getChatSearchCharToStartSearch());
ui.cbSearch_CaseSensitively->setChecked(Settings->getChatSearchCaseSensitively()); ui.cbSearch_CaseSensitively->setChecked(Settings->getChatSearchCaseSensitively());

View File

@ -6,11 +6,11 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>705</width> <width>635</width>
<height>517</height> <height>600</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout">
<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">
@ -20,15 +20,15 @@
<attribute name="title"> <attribute name="title">
<string>General</string> <string>General</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_5"> <layout class="QGridLayout" name="generalGLayout">
<item row="0" column="0" colspan="2"> <item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox_3"> <widget class="QGroupBox" name="distantGBox">
<property name="title"> <property name="title">
<string>Distant Chat</string> <string>Distant Chat</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_4"> <layout class="QGridLayout" name="distantGBoxGLayout">
<item row="0" column="2"> <item row="0" column="2">
<widget class="QComboBox" name="distantChatcomboBox"> <widget class="QComboBox" name="distantChatComboBox">
<item> <item>
<property name="text"> <property name="text">
<string>Everyone</string> <string>Everyone</string>
@ -47,7 +47,7 @@
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLabel" name="distantchatlabel"> <widget class="QLabel" name="distantChatLabel">
<property name="text"> <property name="text">
<string>Accept encrypted distant chat from</string> <string>Accept encrypted distant chat from</string>
</property> </property>
@ -57,9 +57,9 @@
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="QVBoxLayout" name="leftVLayout">
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="chatSettingsGBox">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -69,7 +69,7 @@
<property name="title"> <property name="title">
<string>Chat Settings</string> <string>Chat Settings</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="chatSettingsGBoxVLayout">
<item> <item>
<widget class="QCheckBox" name="checkBox_emoteprivchat"> <widget class="QCheckBox" name="checkBox_emoteprivchat">
<property name="text"> <property name="text">
@ -111,7 +111,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="hl_minimumFontSize"> <layout class="QHBoxLayout" name="minimumFontSizeHLayout">
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
@ -123,7 +123,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="hs_minimumFontSize"> <spacer name="minimumFontSizeHSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -168,7 +168,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_40"> <layout class="QHBoxLayout" name="minimumContrastHLayout">
<item> <item>
<widget class="QLabel" name="minimumContrastLabel"> <widget class="QLabel" name="minimumContrastLabel">
<property name="text"> <property name="text">
@ -177,7 +177,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_2"> <spacer name="minimumContrastHSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -211,15 +211,22 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="sendAsPlainTextByDef">
<property name="text">
<string>Send as plain text by default</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="chatLobbyGroupBox"> <widget class="QGroupBox" name="chatLobbyGBox">
<property name="title"> <property name="title">
<string>Chat Lobby</string> <string>Chat Lobby</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_6"> <layout class="QVBoxLayout" name="chatLobbyGBoxVLayout">
<item> <item>
<widget class="QCheckBox" name="chatLobby_Blink"> <widget class="QCheckBox" name="chatLobby_Blink">
<property name="text"> <property name="text">
@ -228,7 +235,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="defIDLabel">
<property name="text"> <property name="text">
<string>Default identity for chat lobbies:</string> <string>Default identity for chat lobbies:</string>
</property> </property>
@ -237,7 +244,7 @@
<item> <item>
<layout class="QHBoxLayout" name="nickNameLayout"> <layout class="QHBoxLayout" name="nickNameLayout">
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="chatLobbyIdentity_HSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -261,7 +268,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer_2"> <spacer name="leftVSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
@ -276,13 +283,13 @@
</layout> </layout>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="rightVLayout">
<item> <item>
<widget class="QGroupBox" name="groupBox_2"> <widget class="QGroupBox" name="privateChatGBox">
<property name="title"> <property name="title">
<string>Private Chat</string> <string>Private Chat</string>
</property> </property>
<layout class="QVBoxLayout" name="_2"> <layout class="QVBoxLayout" name="privateChatGBoxVLayout">
<item> <item>
<widget class="QCheckBox" name="chat_NewWindow"> <widget class="QCheckBox" name="chat_NewWindow">
<property name="text"> <property name="text">
@ -315,11 +322,11 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBoxIRCColors"> <widget class="QGroupBox" name="chatFontGBox">
<property name="title"> <property name="title">
<string>Chat Font</string> <string>Chat Font</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="chatFontGBoxVLayout">
<property name="spacing"> <property name="spacing">
<number>2</number> <number>2</number>
</property> </property>
@ -366,7 +373,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBoxSearch"> <widget class="QGroupBox" name="searchGBox">
<property name="title"> <property name="title">
<string>Search by default</string> <string>Search by default</string>
</property> </property>
@ -530,7 +537,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer"> <spacer name="rightVSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
@ -550,9 +557,9 @@
<attribute name="title"> <attribute name="title">
<string>History</string> <string>History</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="historyVLayout">
<item> <item>
<widget class="QLabel" name="label_8"> <widget class="QLabel" name="histHeaderLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -574,11 +581,11 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_6"> <layout class="QHBoxLayout" name="histSetupVLayout">
<item> <item>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="histSetupGLayout">
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="publicHeaderLabel">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -591,7 +598,7 @@
</widget> </widget>
</item> </item>
<item row="0" column="2"> <item row="0" column="2">
<widget class="QLabel" name="label_5"> <widget class="QLabel" name="privateHeaderLabel">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -604,7 +611,7 @@
</widget> </widget>
</item> </item>
<item row="0" column="3"> <item row="0" column="3">
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="lobbyHeaderLabel">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -617,7 +624,7 @@
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_7"> <widget class="QLabel" name="labelChatEnable">
<property name="layoutDirection"> <property name="layoutDirection">
<enum>Qt::LeftToRight</enum> <enum>Qt::LeftToRight</enum>
</property> </property>
@ -651,7 +658,7 @@
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="label1"> <widget class="QLabel" name="labelChatSaveCount">
<property name="text"> <property name="text">
<string>Saved messages (0 = unlimited):</string> <string>Saved messages (0 = unlimited):</string>
</property> </property>
@ -718,7 +725,7 @@
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
<widget class="QLabel" name="label2"> <widget class="QLabel" name="labelChatLoadCount">
<property name="text"> <property name="text">
<string>Number of messages restored (0 = off):</string> <string>Number of messages restored (0 = off):</string>
</property> </property>
@ -769,7 +776,7 @@
</layout> </layout>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_4"> <spacer name="histSetupHSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -784,15 +791,15 @@
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox_5"> <widget class="QGroupBox" name="histGenGBox">
<property name="title"> <property name="title">
<string>General</string> <string>General</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_8"> <layout class="QVBoxLayout" name="histGenGBoxVLayout">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_5"> <layout class="QHBoxLayout" name="max_storage_period_HLayout">
<item> <item>
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="max_storage_period_Label">
<property name="text"> <property name="text">
<string>Maximum storage period, in days (0=keep all):</string> <string>Maximum storage period, in days (0=keep all):</string>
</property> </property>
@ -802,7 +809,7 @@
<widget class="QSpinBox" name="max_storage_period"/> <widget class="QSpinBox" name="max_storage_period"/>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_3"> <spacer name="max_storage_period_HSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -820,7 +827,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer_4"> <spacer name="histVSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
@ -838,7 +845,7 @@
<attribute name="title"> <attribute name="title">
<string>Style</string> <string>Style</string>
</attribute> </attribute>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="styleHLayout">
<item> <item>
<widget class="QTabWidget" name="styleTabWidget"> <widget class="QTabWidget" name="styleTabWidget">
<property name="tabPosition"> <property name="tabPosition">
@ -851,11 +858,11 @@
<attribute name="title"> <attribute name="title">
<string>Group chat</string> <string>Group chat</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="publicLayout_1"> <layout class="QVBoxLayout" name="publicTabVLayout">
<item> <item>
<layout class="QHBoxLayout" name="publiclLayout_2"> <layout class="QHBoxLayout" name="publicStyleHLayout">
<item> <item>
<layout class="QVBoxLayout" name="publicLayout_3"> <layout class="QVBoxLayout" name="publicStyleListVLayout">
<item> <item>
<widget class="QListWidget" name="publicList"> <widget class="QListWidget" name="publicList">
<property name="sizePolicy"> <property name="sizePolicy">
@ -873,7 +880,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="publicLayout_4"> <layout class="QHBoxLayout" name="publicStyleVarHLayout">
<item> <item>
<widget class="QLabel" name="publicLabelVariant"> <widget class="QLabel" name="publicLabelVariant">
<property name="sizePolicy"> <property name="sizePolicy">
@ -921,7 +928,7 @@
<enum>QLayout::SetFixedSize</enum> <enum>QLayout::SetFixedSize</enum>
</property> </property>
<item> <item>
<widget class="QLabel" name="labelPublicAuthor"> <widget class="QLabel" name="publicLabelAuthor">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -934,7 +941,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="labelPublicDescription"> <widget class="QLabel" name="publicLabelDescription">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -986,11 +993,11 @@
<attribute name="title"> <attribute name="title">
<string>Private chat</string> <string>Private chat</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="privateLayout_1"> <layout class="QVBoxLayout" name="privateTabVLayout">
<item> <item>
<layout class="QHBoxLayout" name="privatelLayout_2"> <layout class="QHBoxLayout" name="privateStyleHLayout">
<item> <item>
<layout class="QVBoxLayout" name="privateLayout_3"> <layout class="QVBoxLayout" name="privateStyleListVLayout">
<item> <item>
<widget class="QListWidget" name="privateList"> <widget class="QListWidget" name="privateList">
<property name="sizePolicy"> <property name="sizePolicy">
@ -1008,7 +1015,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="privateLayout_4"> <layout class="QHBoxLayout" name="privateStyleVarHLayout">
<item> <item>
<widget class="QLabel" name="privateLabelVariant"> <widget class="QLabel" name="privateLabelVariant">
<property name="sizePolicy"> <property name="sizePolicy">
@ -1056,7 +1063,7 @@
<enum>QLayout::SetFixedSize</enum> <enum>QLayout::SetFixedSize</enum>
</property> </property>
<item> <item>
<widget class="QLabel" name="labelPrivateAuthor"> <widget class="QLabel" name="privateLabelAuthor">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1069,7 +1076,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="labelPrivateDescription"> <widget class="QLabel" name="privateLabelDescription">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1121,11 +1128,11 @@
<attribute name="title"> <attribute name="title">
<string>History</string> <string>History</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="historyLayout_1"> <layout class="QVBoxLayout" name="historyTabVLayout">
<item> <item>
<layout class="QHBoxLayout" name="historylLayout_2"> <layout class="QHBoxLayout" name="historyStyleHLayout">
<item> <item>
<layout class="QVBoxLayout" name="historyLayout_3"> <layout class="QVBoxLayout" name="historyStyleListVLayout">
<item> <item>
<widget class="QListWidget" name="historyList"> <widget class="QListWidget" name="historyList">
<property name="sizePolicy"> <property name="sizePolicy">
@ -1143,7 +1150,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="historyLayout_4"> <layout class="QHBoxLayout" name="historyStyleVarHLayout">
<item> <item>
<widget class="QLabel" name="historyLabelVariant"> <widget class="QLabel" name="historyLabelVariant">
<property name="sizePolicy"> <property name="sizePolicy">
@ -1191,7 +1198,7 @@
<enum>QLayout::SetFixedSize</enum> <enum>QLayout::SetFixedSize</enum>
</property> </property>
<item> <item>
<widget class="QLabel" name="labelHistoryAuthor"> <widget class="QLabel" name="historyLabelAuthor">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1204,7 +1211,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="labelHistoryDescription"> <widget class="QLabel" name="historyLabelDescription">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>

View File

@ -512,6 +512,26 @@ void RshareSettings::setChatSendMessageWithCtrlReturn(bool bValue)
setValueToGroup("Chat", "SendMessageWithCtrlReturn", bValue); setValueToGroup("Chat", "SendMessageWithCtrlReturn", bValue);
} }
bool RshareSettings::getChatSendAsPlainTextByDef()
{
return valueFromGroup("Chat", "SendAsPlainTextByDef", false).toBool();
}
void RshareSettings::setChatSendAsPlainTextByDef(bool bValue)
{
setValueToGroup("Chat", "SendAsPlainTextByDef", bValue);
}
bool RshareSettings::getChatSearchShowBarByDefault()
{
return valueFromGroup("Chat", "SearchShowBarByDefault", false).toBool();
}
void RshareSettings::setChatSearchShowBarByDefault(bool bValue)
{
setValueToGroup("Chat", "SearchShowBarByDefault", bValue);
}
void RshareSettings::setChatSearchCharToStartSearch(int iValue) void RshareSettings::setChatSearchCharToStartSearch(int iValue)
{ {
setValueToGroup("Chat", "SearchCharToStartSearch", iValue); setValueToGroup("Chat", "SearchCharToStartSearch", iValue);

View File

@ -209,6 +209,12 @@ public:
bool getChatSendMessageWithCtrlReturn(); bool getChatSendMessageWithCtrlReturn();
void setChatSendMessageWithCtrlReturn(bool bValue); void setChatSendMessageWithCtrlReturn(bool bValue);
bool getChatSendAsPlainTextByDef();
void setChatSendAsPlainTextByDef(bool bValue);
bool getChatSearchShowBarByDefault();
void setChatSearchShowBarByDefault(bool bValue);
void setChatSearchCharToStartSearch(int iValue); void setChatSearchCharToStartSearch(int iValue);
int getChatSearchCharToStartSearch(); int getChatSearchCharToStartSearch();

View File

@ -874,6 +874,12 @@ static void styleCreate(QDomDocument& doc
optAttr = doc.createAttribute("RSOptimized"); optAttr = doc.createAttribute("RSOptimized");
optAttr.setValue("v2"); optAttr.setValue("v2");
styleElem.attributes().setNamedItem(optAttr); styleElem.attributes().setNamedItem(optAttr);
if (flag & RSHTML_FORMATTEXT_NO_EMBED) {
QDomAttr noEmbedAttr;
noEmbedAttr = doc.createAttribute("NoEmbed");
noEmbedAttr.setValue("true");
styleElem.attributes().setNamedItem(noEmbedAttr);
}
} }
while(styleElem.childNodes().count()>0) { while(styleElem.childNodes().count()>0) {

View File

@ -31,19 +31,19 @@
#define HANDLE_RICH_TEXT_H_ #define HANDLE_RICH_TEXT_H_
/* Flags for RsHtml::formatText */ /* Flags for RsHtml::formatText */
#define RSHTML_FORMATTEXT_EMBED_SMILEYS 1 #define RSHTML_FORMATTEXT_EMBED_SMILEYS 0x0001//1
#define RSHTML_FORMATTEXT_EMBED_LINKS 2 #define RSHTML_FORMATTEXT_EMBED_LINKS 0x0002//2
#define RSHTML_FORMATTEXT_OPTIMIZE 4 #define RSHTML_FORMATTEXT_OPTIMIZE 0x0004//4
#define RSHTML_FORMATTEXT_REPLACE_LINKS 8 #define RSHTML_FORMATTEXT_REPLACE_LINKS 0x0008//8
#define RSHTML_FORMATTEXT_REMOVE_COLOR 16 #define RSHTML_FORMATTEXT_REMOVE_COLOR 0x0010//16
#define RSHTML_FORMATTEXT_FIX_COLORS 32 /* Make text readable */ #define RSHTML_FORMATTEXT_FIX_COLORS 0x0020//32 /* Make text readable */
#define RSHTML_FORMATTEXT_REMOVE_FONT_WEIGHT 64 /* Remove bold */ #define RSHTML_FORMATTEXT_REMOVE_FONT_WEIGHT 0x0040//64 /* Remove bold */
#define RSHTML_FORMATTEXT_REMOVE_FONT_STYLE 128 /* Remove italics */ #define RSHTML_FORMATTEXT_REMOVE_FONT_STYLE 0x0080//128 /* Remove italics */
#define RSHTML_FORMATTEXT_REMOVE_FONT_FAMILY 256 #define RSHTML_FORMATTEXT_REMOVE_FONT_FAMILY 0x0100//256
#define RSHTML_FORMATTEXT_REMOVE_FONT_SIZE 512 #define RSHTML_FORMATTEXT_REMOVE_FONT_SIZE 0x0200//512
#define RSHTML_FORMATTEXT_REMOVE_FONT (RSHTML_FORMATTEXT_REMOVE_FONT_WEIGHT | RSHTML_FORMATTEXT_REMOVE_FONT_STYLE | RSHTML_FORMATTEXT_REMOVE_FONT_FAMILY | RSHTML_FORMATTEXT_REMOVE_FONT_SIZE) #define RSHTML_FORMATTEXT_REMOVE_FONT (RSHTML_FORMATTEXT_REMOVE_FONT_WEIGHT | RSHTML_FORMATTEXT_REMOVE_FONT_STYLE | RSHTML_FORMATTEXT_REMOVE_FONT_FAMILY | RSHTML_FORMATTEXT_REMOVE_FONT_SIZE)
#define RSHTML_FORMATTEXT_CLEANSTYLE (RSHTML_FORMATTEXT_REMOVE_FONT | RSHTML_FORMATTEXT_REMOVE_COLOR) #define RSHTML_FORMATTEXT_CLEANSTYLE (RSHTML_FORMATTEXT_REMOVE_FONT | RSHTML_FORMATTEXT_REMOVE_COLOR)
#define RSHTML_FORMATTEXT_NO_EMBED 0x0400//1024
/* Flags for RsHtml::optimizeHtml */ /* Flags for RsHtml::optimizeHtml */
#define RSHTML_OPTIMIZEHTML_MASK (RSHTML_FORMATTEXT_CLEANSTYLE | RSHTML_FORMATTEXT_FIX_COLORS | RSHTML_FORMATTEXT_OPTIMIZE) #define RSHTML_OPTIMIZEHTML_MASK (RSHTML_FORMATTEXT_CLEANSTYLE | RSHTML_FORMATTEXT_FIX_COLORS | RSHTML_FORMATTEXT_OPTIMIZE)