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, 6 insertions, 3 deletions
diff --git a/noncore/net/opieirc/ircquerytab.cpp b/noncore/net/opieirc/ircquerytab.cpp index 1fddc6d..53474b9 100644 --- a/noncore/net/opieirc/ircquerytab.cpp +++ b/noncore/net/opieirc/ircquerytab.cpp | |||
@@ -7,37 +7,40 @@ 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 | |||
19 | connect(m_field, SIGNAL(nextTab()), this, SIGNAL(nextTab())); | 20 | connect(m_field, SIGNAL(nextTab()), this, SIGNAL(nextTab())); |
20 | connect(m_field, SIGNAL(prevTab()), this, SIGNAL(prevTab())); | 21 | connect(m_field, SIGNAL(prevTab()), this, SIGNAL(prevTab())); |
21 | connect(m_field, SIGNAL(closeTab()),this, SIGNAL(closeTab())); | 22 | connect(m_field, SIGNAL(closeTab()),this, SLOT(remove())); |
22 | 23 | connect(this, SIGNAL(editFocus()), m_field, SLOT(setEditFocus())); | |
23 | 24 | ||
24 | QWhatsThis::add(m_field, tr("Type your text here in order to send a message to the other person")); | 25 | QWhatsThis::add(m_field, tr("Type your text here in order to send a message to the other person")); |
25 | m_layout->add(hbox); | 26 | m_layout->add(hbox); |
26 | hbox->show(); | 27 | hbox->show(); |
27 | m_layout->add(m_field); | 28 | m_layout->add(m_field); |
28 | m_field->setFocus(); | 29 | |
29 | connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand())); | 30 | connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand())); |
30 | connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling())); | 31 | connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling())); |
31 | settingsChanged(); | 32 | settingsChanged(); |
33 | m_field->setFocus(); | ||
34 | m_field->setActiveWindow(); | ||
32 | } | 35 | } |
33 | 36 | ||
34 | void IRCQueryTab::scrolling(){ | 37 | void IRCQueryTab::scrolling(){ |
35 | m_textview->ensureVisible(0, m_textview->contentsHeight()); | 38 | m_textview->ensureVisible(0, m_textview->contentsHeight()); |
36 | } | 39 | } |
37 | 40 | ||
38 | 41 | ||
39 | void IRCQueryTab::appendText(QString text) { | 42 | void IRCQueryTab::appendText(QString text) { |
40 | /* not using append because it creates layout problems */ | 43 | /* not using append because it creates layout problems */ |
41 | QString txt = m_textview->text() + text + "\n"; | 44 | QString txt = m_textview->text() + text + "\n"; |
42 | if (m_maxLines > 0 && m_lines >= m_maxLines) { | 45 | if (m_maxLines > 0 && m_lines >= m_maxLines) { |
43 | int firstBreak = txt.find('\n'); | 46 | int firstBreak = txt.find('\n'); |