Added actions for disable/enable Emoticons in Privat Chat and for Clear Chat History

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2374 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-02-19 22:31:32 +00:00
parent 5633e7b5f4
commit a32c4b74b4
4 changed files with 105 additions and 0 deletions

View File

@ -1181,6 +1181,21 @@ p, li { white-space: pre-wrap; }
<height>24</height> <height>24</height>
</size> </size>
</property> </property>
<property name="styleSheet">
<string notr="true">QPushButton::menu-indicator {
subcontrol-origin: padding;
subcontrol-position: bottom right;
}
QPushButton::menu-indicator:pressed, QPushButton::menu-indicator:open {
position: relative;
top: 1px; left: 1px; /* shift the arrow by 2 px */
}
QPushButton:hover {
border: 1px solid #CCCCCC;
}</string>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>

View File

@ -123,6 +123,11 @@ PopupChatDialog::PopupChatDialog(std::string id, std::string name,
/*Disabled style Button when will switch chat style RetroShare will crash need to be fix */ /*Disabled style Button when will switch chat style RetroShare will crash need to be fix */
//ui.styleButton->setEnabled(false); //ui.styleButton->setEnabled(false);
QMenu * toolmenu = new QMenu();
toolmenu->addAction(ui.actionClear_Chat);
toolmenu->addAction(ui.action_Disable_Emoticons);
ui.pushtoolsButton->setMenu(toolmenu);
mCurrentColor = Qt::black; mCurrentColor = Qt::black;
@ -267,6 +272,8 @@ void PopupChatDialog::addChatMsg(ChatInfo *ci)
std::cout << "PopupChatDialog:addChatMsg message : " << message.toStdString() << std::endl; std::cout << "PopupChatDialog:addChatMsg message : " << message.toStdString() << std::endl;
#endif #endif
if(!ui.action_Disable_Emoticons->isChecked())
{
QHashIterator<QString, QString> i(smileys); QHashIterator<QString, QString> i(smileys);
while(i.hasNext()) while(i.hasNext())
{ {
@ -274,6 +281,8 @@ std::cout << "PopupChatDialog:addChatMsg message : " << message.toStdString() <<
foreach(QString code, i.key().split("|")) foreach(QString code, i.key().split("|"))
message.replace(code, "<img src=\"" + i.value() + "\" />"); message.replace(code, "<img src=\"" + i.value() + "\" />");
} }
}
history /*<< nickColor << color << font << fontSize*/ << timestamp << name << message; history /*<< nickColor << color << font << fontSize*/ << timestamp << name << message;
QString formatMsg = loadEmptyStyle()/*.replace(nickColor) QString formatMsg = loadEmptyStyle()/*.replace(nickColor)
@ -600,6 +609,11 @@ QString PopupChatDialog::loadEmptyStyle()
} }
} }
void PopupChatDialog::on_actionClear_Chat_triggered()
{
ui.textBrowser->clear();
}
void PopupChatDialog::changeStyle() void PopupChatDialog::changeStyle()
{ {
QString newStyle = QFileDialog::getOpenFileName(this, tr("Open Style"), QString newStyle = QFileDialog::getOpenFileName(this, tr("Open Style"),

View File

@ -103,6 +103,8 @@ private slots:
void sendChat(); void sendChat();
void getAvatar(); void getAvatar();
void on_actionClear_Chat_triggered();
private: private:

View File

@ -13,6 +13,9 @@
<property name="windowTitle"> <property name="windowTitle">
<string>MainWindow</string> <string>MainWindow</string>
</property> </property>
<property name="styleSheet">
<string notr="true">QToolBar#toolBar{background-image: url(:/images/connect/connectFriendBanner.png)}</string>
</property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QGridLayout"> <layout class="QGridLayout">
<property name="rightMargin"> <property name="rightMargin">
@ -214,6 +217,13 @@ border-image: url(:/images/mystatus_bg.png);
<height>46</height> <height>46</height>
</size> </size>
</property> </property>
<property name="styleSheet">
<string notr="true">QFrame#Chatbuttonframe{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #FEFEFE, stop:1 #E8E8E8);
border: 1px solid #CCCCCC;}</string>
</property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>
@ -443,6 +453,53 @@ p, li { white-space: pre-wrap; }
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="8">
<widget class="QPushButton" name="pushtoolsButton">
<property name="minimumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QPushButton::menu-indicator {
subcontrol-origin: padding;
subcontrol-position: bottom right;
}
QPushButton::menu-indicator:pressed, QPushButton::menu-indicator:open {
position: relative;
top: 1px; left: 1px; /* shift the arrow by 2 px */
}
QPushButton:hover {
border: 1px solid #CCCCCC;
}</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/configure.png</normaloff>:/images/configure.png</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@ -565,6 +622,23 @@ p, li { white-space: pre-wrap; }
<string>Set your Avatar Picture</string> <string>Set your Avatar Picture</string>
</property> </property>
</action> </action>
<action name="actionClear_Chat">
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/edit-clear-history.png</normaloff>:/images/edit-clear-history.png</iconset>
</property>
<property name="text">
<string>Clear Chat</string>
</property>
</action>
<action name="action_Disable_Emoticons">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Disable Emoticons</string>
</property>
</action>
</widget> </widget>
<resources> <resources>
<include location="../images.qrc"/> <include location="../images.qrc"/>