summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircquerytab.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/opieirc/ircquerytab.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircquerytab.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/net/opieirc/ircquerytab.cpp b/noncore/net/opieirc/ircquerytab.cpp
index c6b8211..b946174 100644
--- a/noncore/net/opieirc/ircquerytab.cpp
+++ b/noncore/net/opieirc/ircquerytab.cpp
@@ -4,48 +4,49 @@
IRCQueryTab::IRCQueryTab(IRCPerson *person, IRCServerTab *parentTab, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) {
m_mainWindow = mainWindow;
m_parentTab = parentTab;
m_person = new IRCPerson(*person); /* We need this (the person might sign off and the original IRCPerson gets deleted) */
m_description->setText(tr("Talking to ") + " <b>" + person->nick() + "</b>");
QHBox *hbox = new QHBox(this);
m_textview = new QTextView(hbox);
m_textview->setHScrollBarMode(QScrollView::AlwaysOff);
m_textview->setVScrollBarMode(QScrollView::AlwaysOn);
m_textview->setTextFormat(RichText);
m_field = new QLineEdit(this);
m_layout->add(hbox);
hbox->show();
m_layout->add(m_field);
m_field->setFocus();
connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand()));
settingsChanged();
}
void IRCQueryTab::appendText(QString text) {
/* not using append because it creates layout problems */
m_textview->setText(m_textview->text() + text);
m_textview->ensureVisible(0, m_textview->contentsHeight());
+ emit changed(this);
}
IRCQueryTab::~IRCQueryTab() {
m_parentTab->removeQueryTab(this);
delete m_person;
}
void IRCQueryTab::processCommand() {
QString text = m_field->text();
if (text.length()>0) {
if (session()->isSessionActive()) {
if (text.startsWith("/") && !text.startsWith("//")) {
/* Command mode */
m_parentTab->executeCommand(this, text);;
} else {
if (text.startsWith("//"))
text = text.right(text.length()-1);
session()->sendMessage(m_person, m_field->text());
appendText("<font color=\"" + m_textColor + "\">&lt;</font><font color=\"" + m_selfColor + "\">"+m_parentTab->server()->nick()+"</font><font color=\"" + m_textColor + "\">&gt; "+IRCOutput::toHTML(m_field->text())+"</font><br>");
}
} else {
appendText("<font color=\"" + m_errorColor + "\">"+tr("Disconnected")+"</font><br>");
}
}