Diffstat (limited to 'noncore/net/opieirc/ircquerytab.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircquerytab.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/noncore/net/opieirc/ircquerytab.cpp b/noncore/net/opieirc/ircquerytab.cpp index 21a53dc..a113b04 100644 --- a/noncore/net/opieirc/ircquerytab.cpp +++ b/noncore/net/opieirc/ircquerytab.cpp | |||
@@ -13,27 +13,33 @@ IRCQueryTab::IRCQueryTab(IRCPerson *person, IRCServerTab *parentTab, MainWindow | |||
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 | QWhatsThis::add(m_field, tr("Type your text here in order to send a message to the other person")); | 19 | QWhatsThis::add(m_field, tr("Type your text here in order to send a message to the other person")); |
20 | m_layout->add(hbox); | 20 | m_layout->add(hbox); |
21 | hbox->show(); | 21 | hbox->show(); |
22 | m_layout->add(m_field); | 22 | m_layout->add(m_field); |
23 | m_field->setFocus(); | 23 | m_field->setFocus(); |
24 | connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand())); | 24 | connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand())); |
25 | connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling())); | ||
25 | settingsChanged(); | 26 | settingsChanged(); |
26 | } | 27 | } |
27 | 28 | ||
29 | void IRCQueryTab::scrolling(){ | ||
30 | m_textview->ensureVisible(0, m_textview->contentsHeight()); | ||
31 | } | ||
32 | |||
33 | |||
28 | void IRCQueryTab::appendText(QString text) { | 34 | void IRCQueryTab::appendText(QString text) { |
29 | /* not using append because it creates layout problems */ | 35 | /* not using append because it creates layout problems */ |
30 | QString txt = m_textview->text() + text + "\n"; | 36 | QString txt = m_textview->text() + text + "\n"; |
31 | if (m_maxLines > 0 && m_lines >= m_maxLines) { | 37 | if (m_maxLines > 0 && m_lines >= m_maxLines) { |
32 | int firstBreak = txt.find('\n'); | 38 | int firstBreak = txt.find('\n'); |
33 | if (firstBreak != -1) { | 39 | if (firstBreak != -1) { |
34 | txt = "<qt bgcolor=\"" + m_backgroundColor + "\"/>" + txt.right(txt.length() - (firstBreak + 1)); | 40 | txt = "<qt bgcolor=\"" + m_backgroundColor + "\"/>" + txt.right(txt.length() - (firstBreak + 1)); |
35 | } | 41 | } |
36 | } else { | 42 | } else { |
37 | m_lines++; | 43 | m_lines++; |
38 | } | 44 | } |
39 | m_textview->setText(txt); | 45 | m_textview->setText(txt); |