mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-24 08:41:26 -04:00
* Fixed Colors and Fonts for Private and Group Chat.
* Fixed Chat Delay. * Cleaned up Options->Server, removing unneccessary stuff. * Cleaned up Config Friend, removing stuff. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@472 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
cb795b3c67
commit
65bb6a65d7
9 changed files with 453 additions and 501 deletions
|
@ -83,12 +83,14 @@ ChatDialog::ChatDialog(QWidget *parent)
|
|||
/* to hide the header */
|
||||
ui.msgSendList->header()->hide();
|
||||
|
||||
textColor = Qt::black;
|
||||
_currentColor = Qt::black;
|
||||
QPixmap pxm(24,24);
|
||||
pxm.fill(textColor);
|
||||
pxm.fill(_currentColor);
|
||||
ui.colorChatButton->setIcon(pxm);
|
||||
|
||||
QFont font = QFont("Comic Sans MS", 10);
|
||||
//QFont font = QFont("Comic Sans MS", 10);
|
||||
mCurrentFont = QFont("Comic Sans MS", 12);
|
||||
ui.lineEdit->setFont(mCurrentFont);
|
||||
|
||||
setChatInfo(tr("Welcome to RetroShare's group chat."), QString::fromUtf8("blue"));
|
||||
|
||||
|
@ -98,6 +100,9 @@ ChatDialog::ChatDialog(QWidget *parent)
|
|||
|
||||
_underline = false;
|
||||
|
||||
QTimer *timer = new QTimer(this);
|
||||
timer->connect(timer, SIGNAL(timeout()), this, SLOT(insertChat()));
|
||||
timer->start(500); /* half a second */
|
||||
|
||||
/* Hide platform specific features */
|
||||
#ifdef Q_WS_WIN
|
||||
|
@ -121,6 +126,11 @@ void ChatDialog::msgSendListCostumPopupMenu( QPoint point )
|
|||
|
||||
void ChatDialog::insertChat()
|
||||
{
|
||||
if (!rsMsgs->chatAvailable())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
std::list<ChatInfo> newchat;
|
||||
if (!rsMsgs->getNewChat(newchat))
|
||||
{
|
||||
|
@ -134,6 +144,9 @@ void ChatDialog::insertChat()
|
|||
/* add in lines at the bottom */
|
||||
for(it = newchat.begin(); it != newchat.end(); it++)
|
||||
{
|
||||
std::string msg(it->msg.begin(), it->msg.end());
|
||||
std::cerr << "ChatDialog::insertChat(): " << msg << std::endl;
|
||||
|
||||
/* are they private? */
|
||||
if (it->chatflags & RS_CHAT_PRIVATE)
|
||||
{
|
||||
|
@ -205,8 +218,12 @@ void ChatDialog::sendMsg()
|
|||
ci.msg = lineWidget->toHtml().toStdWString();
|
||||
ci.chatflags = RS_CHAT_PUBLIC;
|
||||
|
||||
std::string msg(ci.msg.begin(), ci.msg.end());
|
||||
std::cerr << "ChatDialog::sendMsg(): " << msg << std::endl;
|
||||
|
||||
rsMsgs -> ChatSend(ci);
|
||||
ui.lineEdit->clear();
|
||||
setFont();
|
||||
|
||||
/* redraw send list */
|
||||
insertSendList();
|
||||
|
@ -340,39 +357,34 @@ void ChatDialog::clearOldChats()
|
|||
void ChatDialog::setColor()
|
||||
{
|
||||
|
||||
bool ok;
|
||||
QRgb color = QColorDialog::getRgba(ui.lineEdit->textColor().rgba(), &ok, this);
|
||||
if (ok) {
|
||||
_currentColor = QColor(color);
|
||||
ui.lineEdit->setTextColor(_currentColor);
|
||||
QPixmap pxm(24,24);
|
||||
pxm.fill(_currentColor);
|
||||
ui.colorChatButton->setIcon(pxm);
|
||||
}
|
||||
ui.lineEdit->setFocus();
|
||||
|
||||
bool ok;
|
||||
QRgb color = QColorDialog::getRgba(ui.lineEdit->textColor().rgba(), &ok, this);
|
||||
if (ok) {
|
||||
_currentColor = QColor(color);
|
||||
QPixmap pxm(24,24);
|
||||
pxm.fill(_currentColor);
|
||||
ui.colorChatButton->setIcon(pxm);
|
||||
}
|
||||
setFont();
|
||||
}
|
||||
|
||||
void ChatDialog::getFont()
|
||||
{
|
||||
bool ok;
|
||||
QFont font = QFontDialog::getFont(&ok, QFont(ui.lineEdit->toHtml()), this);
|
||||
if (ok) {
|
||||
ui.lineEdit->setFont(font);
|
||||
}
|
||||
void ChatDialog::getFont()
|
||||
{
|
||||
bool ok;
|
||||
mCurrentFont = QFontDialog::getFont(&ok, mCurrentFont, this);
|
||||
setFont();
|
||||
}
|
||||
|
||||
void ChatDialog::setFont()
|
||||
{
|
||||
void ChatDialog::setFont()
|
||||
{
|
||||
mCurrentFont.setBold(ui.textboldChatButton->isChecked());
|
||||
mCurrentFont.setUnderline(ui.textunderlineChatButton->isChecked());
|
||||
mCurrentFont.setItalic(ui.textitalicChatButton->isChecked());
|
||||
ui.lineEdit->setFont(mCurrentFont);
|
||||
ui.lineEdit->setTextColor(_currentColor);
|
||||
|
||||
ui.lineEdit->setFocus();
|
||||
|
||||
QFont font = QFont("Comic Sans MS", 10);
|
||||
|
||||
font.setBold(ui.textboldChatButton->isChecked());
|
||||
font.setUnderline(ui.textunderlineChatButton->isChecked());
|
||||
font.setItalic(ui.textitalicChatButton->isChecked());
|
||||
//font.setStrikeOut(ui.textstrikeChatButton->isChecked());
|
||||
ui.lineEdit->setFont(font);
|
||||
|
||||
}
|
||||
|
||||
void ChatDialog::underline()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue