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

@ -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 */
//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;
@ -267,6 +272,8 @@ void PopupChatDialog::addChatMsg(ChatInfo *ci)
std::cout << "PopupChatDialog:addChatMsg message : " << message.toStdString() << std::endl;
#endif
if(!ui.action_Disable_Emoticons->isChecked())
{
QHashIterator<QString, QString> i(smileys);
while(i.hasNext())
{
@ -274,6 +281,8 @@ std::cout << "PopupChatDialog:addChatMsg message : " << message.toStdString() <<
foreach(QString code, i.key().split("|"))
message.replace(code, "<img src=\"" + i.value() + "\" />");
}
}
history /*<< nickColor << color << font << fontSize*/ << timestamp << name << message;
QString formatMsg = loadEmptyStyle()/*.replace(nickColor)
@ -600,6 +609,11 @@ QString PopupChatDialog::loadEmptyStyle()
}
}
void PopupChatDialog::on_actionClear_Chat_triggered()
{
ui.textBrowser->clear();
}
void PopupChatDialog::changeStyle()
{
QString newStyle = QFileDialog::getOpenFileName(this, tr("Open Style"),