Diffstat (limited to 'noncore/net/opieirc/ircquerytab.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircquerytab.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/noncore/net/opieirc/ircquerytab.cpp b/noncore/net/opieirc/ircquerytab.cpp index a113b04..1fddc6d 100644 --- a/noncore/net/opieirc/ircquerytab.cpp +++ b/noncore/net/opieirc/ircquerytab.cpp | |||
@@ -7,24 +7,29 @@ IRCQueryTab::IRCQueryTab(IRCPerson *person, IRCServerTab *parentTab, MainWindow | |||
7 | m_mainWindow = mainWindow; | 7 | m_mainWindow = mainWindow; |
8 | m_parentTab = parentTab; | 8 | m_parentTab = parentTab; |
9 | m_lines = 0; | 9 | m_lines = 0; |
10 | m_person = new IRCPerson(*person); /* We need this (the person might sign off and the original IRCPerson gets deleted) */ | 10 | m_person = new IRCPerson(*person); /* We need this (the person might sign off and the original IRCPerson gets deleted) */ |
11 | m_description->setText(tr("Talking to ") + " <b>" + person->nick() + "</b>"); | 11 | m_description->setText(tr("Talking to ") + " <b>" + person->nick() + "</b>"); |
12 | QHBox *hbox = new QHBox(this); | 12 | QHBox *hbox = new QHBox(this); |
13 | m_textview = new QTextView(hbox); | 13 | m_textview = new QTextView(hbox); |
14 | m_textview->setHScrollBarMode(QScrollView::AlwaysOff); | 14 | m_textview->setHScrollBarMode(QScrollView::AlwaysOff); |
15 | m_textview->setVScrollBarMode(QScrollView::AlwaysOn); | 15 | m_textview->setVScrollBarMode(QScrollView::AlwaysOn); |
16 | m_textview->setTextFormat(RichText); | 16 | m_textview->setTextFormat(RichText); |
17 | QWhatsThis::add(m_textview, tr("Private discussion")); | 17 | QWhatsThis::add(m_textview, tr("Private discussion")); |
18 | m_field = new IRCHistoryLineEdit(this); | 18 | m_field = new IRCHistoryLineEdit(this); |
19 | connect(m_field, SIGNAL(nextTab()), this, SIGNAL(nextTab())); | ||
20 | connect(m_field, SIGNAL(prevTab()), this, SIGNAL(prevTab())); | ||
21 | connect(m_field, SIGNAL(closeTab()),this, SIGNAL(closeTab())); | ||
22 | |||
23 | |||
19 | QWhatsThis::add(m_field, tr("Type your text here in order to send a message to the other person")); | 24 | QWhatsThis::add(m_field, tr("Type your text here in order to send a message to the other person")); |
20 | m_layout->add(hbox); | 25 | m_layout->add(hbox); |
21 | hbox->show(); | 26 | hbox->show(); |
22 | m_layout->add(m_field); | 27 | m_layout->add(m_field); |
23 | m_field->setFocus(); | 28 | m_field->setFocus(); |
24 | connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand())); | 29 | connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand())); |
25 | connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling())); | 30 | connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling())); |
26 | settingsChanged(); | 31 | settingsChanged(); |
27 | } | 32 | } |
28 | 33 | ||
29 | void IRCQueryTab::scrolling(){ | 34 | void IRCQueryTab::scrolling(){ |
30 | m_textview->ensureVisible(0, m_textview->contentsHeight()); | 35 | m_textview->ensureVisible(0, m_textview->contentsHeight()); |
@@ -35,24 +40,28 @@ void IRCQueryTab::appendText(QString text) { | |||
35 | /* not using append because it creates layout problems */ | 40 | /* not using append because it creates layout problems */ |
36 | QString txt = m_textview->text() + text + "\n"; | 41 | QString txt = m_textview->text() + text + "\n"; |
37 | if (m_maxLines > 0 && m_lines >= m_maxLines) { | 42 | if (m_maxLines > 0 && m_lines >= m_maxLines) { |
38 | int firstBreak = txt.find('\n'); | 43 | int firstBreak = txt.find('\n'); |
39 | if (firstBreak != -1) { | 44 | if (firstBreak != -1) { |
40 | txt = "<qt bgcolor=\"" + m_backgroundColor + "\"/>" + txt.right(txt.length() - (firstBreak + 1)); | 45 | txt = "<qt bgcolor=\"" + m_backgroundColor + "\"/>" + txt.right(txt.length() - (firstBreak + 1)); |
41 | } | 46 | } |
42 | } else { | 47 | } else { |
43 | m_lines++; | 48 | m_lines++; |
44 | } | 49 | } |
45 | m_textview->setText(txt); | 50 | m_textview->setText(txt); |
46 | m_textview->ensureVisible(0, m_textview->contentsHeight()); | 51 | m_textview->ensureVisible(0, m_textview->contentsHeight()); |
52 | |||
53 | if ( IRCServerTab::containsPing( text, m_parentTab ) ) | ||
54 | emit ping( title() ); | ||
55 | |||
47 | emit changed(this); | 56 | emit changed(this); |
48 | } | 57 | } |
49 | 58 | ||
50 | IRCQueryTab::~IRCQueryTab() { | 59 | IRCQueryTab::~IRCQueryTab() { |
51 | m_parentTab->removeQueryTab(this); | 60 | m_parentTab->removeQueryTab(this); |
52 | delete m_person; | 61 | delete m_person; |
53 | } | 62 | } |
54 | 63 | ||
55 | void IRCQueryTab::processCommand() { | 64 | void IRCQueryTab::processCommand() { |
56 | QString text = m_field->text(); | 65 | QString text = m_field->text(); |
57 | if (text.length()>0) { | 66 | if (text.length()>0) { |
58 | if (session()->isSessionActive()) { | 67 | if (session()->isSessionActive()) { |