author | wazlaf <wazlaf> | 2002-09-30 08:07:05 (UTC) |
---|---|---|
committer | wazlaf <wazlaf> | 2002-09-30 08:07:05 (UTC) |
commit | a999acbcd1b8bc1715f2ad2dda6acedf423b89ea (patch) (unidiff) | |
tree | 898d433efa8ff3b25a5d10ab4dc4a0a9bc415104 /noncore/net/opieirc/mainwindow.cpp | |
parent | 75dccdfe90324e9ff2426930ae185c3a6bdab734 (diff) | |
download | opie-a999acbcd1b8bc1715f2ad2dda6acedf423b89ea.zip opie-a999acbcd1b8bc1715f2ad2dda6acedf423b89ea.tar.gz opie-a999acbcd1b8bc1715f2ad2dda6acedf423b89ea.tar.bz2 |
tabs now change their color when actions occur
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 | |||
@@ -10,7 +10,8 @@ | |||
10 | 10 | ||
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); |
16 | QPEMenuBar *menuBar = new QPEMenuBar(this); | 17 | QPEMenuBar *menuBar = new QPEMenuBar(this); |
@@ -37,12 +38,23 @@ void MainWindow::loadSettings() { | |||
37 | IRCTab::m_notificationColor = config.readEntry("NotificationColor", "#AA3300"); | 38 | IRCTab::m_notificationColor = config.readEntry("NotificationColor", "#AA3300"); |
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); |
48 | m_tabs.remove(tab); | 60 | m_tabs.remove(tab); |