Diffstat (limited to 'noncore/net/opieirc/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/mainwindow.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/noncore/net/opieirc/mainwindow.cpp b/noncore/net/opieirc/mainwindow.cpp index d78e5ab..fe59c3b 100644 --- a/noncore/net/opieirc/mainwindow.cpp +++ b/noncore/net/opieirc/mainwindow.cpp | |||
@@ -11,5 +11,6 @@ | |||
11 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags f) : QMainWindow(parent, name, f) { | 11 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags f) : QMainWindow(parent, name, f) { |
12 | setCaption(tr("IRC Client")); | 12 | setCaption(tr("IRC Client")); |
13 | m_tabWidget = new QTabWidget(this); | 13 | m_tabWidget = new IRCTabWidget(this); |
14 | connect(m_tabWidget, SIGNAL(currentChanged(QWidget *)), this, SLOT(selected(QWidget *))); | ||
14 | setCentralWidget(m_tabWidget); | 15 | setCentralWidget(m_tabWidget); |
15 | setToolBarsMovable(FALSE); | 16 | setToolBarsMovable(FALSE); |
@@ -38,10 +39,21 @@ void MainWindow::loadSettings() { | |||
38 | } | 39 | } |
39 | 40 | ||
41 | void MainWindow::selected(QWidget *) { | ||
42 | m_tabWidget->setTabColor(m_tabWidget->currentPageIndex(), &black); | ||
43 | } | ||
44 | |||
40 | void MainWindow::addTab(IRCTab *tab) { | 45 | void MainWindow::addTab(IRCTab *tab) { |
46 | connect(tab, SIGNAL(changed(IRCTab *)), this, SLOT(changeEvent(IRCTab *))); | ||
41 | m_tabWidget->addTab(tab, tab->title()); | 47 | m_tabWidget->addTab(tab, tab->title()); |
42 | m_tabWidget->showPage(tab); | 48 | m_tabWidget->showPage(tab); |
49 | tab->setID(m_tabWidget->currentPageIndex()); | ||
43 | m_tabs.append(tab); | 50 | m_tabs.append(tab); |
44 | } | 51 | } |
45 | 52 | ||
53 | void MainWindow::changeEvent(IRCTab *tab) { | ||
54 | if (tab->id() != m_tabWidget->currentPageIndex()) | ||
55 | m_tabWidget->setTabColor(tab->id(), &blue); | ||
56 | } | ||
57 | |||
46 | void MainWindow::killTab(IRCTab *tab) { | 58 | void MainWindow::killTab(IRCTab *tab) { |
47 | m_tabWidget->removePage(tab); | 59 | m_tabWidget->removePage(tab); |