equal
deleted
inserted
replaced
61 connect(acInfo, SIGNAL(triggered(bool)), this, SLOT(onInfo())); |
61 connect(acInfo, SIGNAL(triggered(bool)), this, SLOT(onInfo())); |
62 acKick = new QAction(QAction::tr("Kick"), chatNicks); |
62 acKick = new QAction(QAction::tr("Kick"), chatNicks); |
63 connect(acKick, SIGNAL(triggered(bool)), this, SLOT(onKick())); |
63 connect(acKick, SIGNAL(triggered(bool)), this, SLOT(onKick())); |
64 acBan = new QAction(QAction::tr("Ban"), chatNicks); |
64 acBan = new QAction(QAction::tr("Ban"), chatNicks); |
65 connect(acBan, SIGNAL(triggered(bool)), this, SLOT(onBan())); |
65 connect(acBan, SIGNAL(triggered(bool)), this, SLOT(onBan())); |
66 |
66 |
67 chatNicks->insertAction(0, acInfo); |
67 chatNicks->insertAction(0, acInfo); |
68 } |
68 } |
69 |
69 |
70 void HWChatWidget::returnPressed() |
70 void HWChatWidget::returnPressed() |
71 { |
71 { |
79 chatStrings.removeFirst(); |
79 chatStrings.removeFirst(); |
80 |
80 |
81 QString formattedStr = Qt::escape(str); |
81 QString formattedStr = Qt::escape(str); |
82 if (formattedStr.startsWith("***")) |
82 if (formattedStr.startsWith("***")) |
83 formattedStr = QString("<font color=grey>%1</font>").arg(formattedStr); |
83 formattedStr = QString("<font color=grey>%1</font>").arg(formattedStr); |
84 |
84 |
85 chatStrings.append(formattedStr); |
85 chatStrings.append(formattedStr); |
86 |
86 |
87 chatText->setHtml(chatStrings.join("<br>")); |
87 chatText->setHtml(chatStrings.join("<br>")); |
88 |
88 |
89 chatText->moveCursor(QTextCursor::End); |
89 chatText->moveCursor(QTextCursor::End); |
90 } |
90 } |
91 |
91 |
92 void HWChatWidget::onServerMessage(const QString& str) |
92 void HWChatWidget::onServerMessage(const QString& str) |
93 { |
93 { |
94 if (chatStrings.size() > 250) |
94 if (chatStrings.size() > 250) |
95 chatStrings.removeFirst(); |
95 chatStrings.removeFirst(); |
96 |
96 |
97 chatStrings.append("<hr>" + str + "<hr>"); |
97 chatStrings.append("<hr>" + str + "<hr>"); |
98 |
98 |
99 chatText->setHtml(chatStrings.join("<br>")); |
99 chatText->setHtml(chatStrings.join("<br>")); |
100 |
100 |
101 chatText->moveCursor(QTextCursor::End); |
101 chatText->moveCursor(QTextCursor::End); |
102 } |
102 } |
103 |
103 |
161 |
161 |
162 void HWChatWidget::adminAccess(bool b) |
162 void HWChatWidget::adminAccess(bool b) |
163 { |
163 { |
164 chatNicks->removeAction(acKick); |
164 chatNicks->removeAction(acKick); |
165 chatNicks->removeAction(acBan); |
165 chatNicks->removeAction(acBan); |
166 |
166 |
167 if(b) |
167 if(b) |
168 { |
168 { |
169 chatNicks->insertAction(0, acKick); |
169 chatNicks->insertAction(0, acKick); |
170 // chatNicks->insertAction(0, acBan); |
170 // chatNicks->insertAction(0, acBan); |
171 } |
171 } |