Diffstat (limited to 'noncore/net/opieirc/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/opieirc/mainwindow.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/noncore/net/opieirc/mainwindow.cpp b/noncore/net/opieirc/mainwindow.cpp index 3ed29e3..8f76cdd 100644 --- a/noncore/net/opieirc/mainwindow.cpp +++ b/noncore/net/opieirc/mainwindow.cpp | |||
@@ -21,39 +21,44 @@ MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow( | |||
21 | menuBar->insertItem(tr("IRC"), irc); | 21 | menuBar->insertItem(tr("IRC"), irc); |
22 | QAction *a = new QAction(tr("New connection"), Resource::loadPixmap("pass"), QString::null, 0, this, 0); | 22 | QAction *a = new QAction(tr("New connection"), Resource::loadPixmap("pass"), QString::null, 0, this, 0); |
23 | connect(a, SIGNAL(activated()), this, SLOT(newConnection())); | 23 | connect(a, SIGNAL(activated()), this, SLOT(newConnection())); |
24 | a->setWhatsThis(tr("Create a new connection to an IRC server")); | 24 | a->setWhatsThis(tr("Create a new connection to an IRC server")); |
25 | a->addTo(irc); | 25 | a->addTo(irc); |
26 | a = new QAction(tr("Settings"), Resource::loadPixmap("SettingsIcon"), QString::null, 0, this, 0); | 26 | a = new QAction(tr("Settings"), Resource::loadPixmap("SettingsIcon"), QString::null, 0, this, 0); |
27 | a->setWhatsThis(tr("Configure OpieIRC's behavior and appearance")); | 27 | a->setWhatsThis(tr("Configure OpieIRC's behavior and appearance")); |
28 | connect(a, SIGNAL(activated()), this, SLOT(settings())); | 28 | connect(a, SIGNAL(activated()), this, SLOT(settings())); |
29 | a->addTo(irc); | 29 | a->addTo(irc); |
30 | loadSettings(); | 30 | loadSettings(); |
31 | } | 31 | } |
32 | 32 | ||
33 | /*IRCTabWidget MainWindow::getTabWidget(){ | ||
34 | return m_tabWidget; | ||
35 | } */ | ||
36 | |||
33 | void MainWindow::loadSettings() { | 37 | void MainWindow::loadSettings() { |
34 | Config config("OpieIRC"); | 38 | Config config("OpieIRC"); |
35 | config.setGroup("OpieIRC"); | 39 | config.setGroup("OpieIRC"); |
36 | IRCTab::m_backgroundColor = config.readEntry("BackgroundColor", "#FFFFFF"); | 40 | IRCTab::m_backgroundColor = config.readEntry("BackgroundColor", "#FFFFFF"); |
37 | IRCTab::m_textColor = config.readEntry("TextColor", "#000000"); | 41 | IRCTab::m_textColor = config.readEntry("TextColor", "#000000"); |
38 | IRCTab::m_errorColor = config.readEntry("ErrorColor", "#FF0000"); | 42 | IRCTab::m_errorColor = config.readEntry("ErrorColor", "#FF0000"); |
39 | IRCTab::m_selfColor = config.readEntry("SelfColor", "#CC0000"); | 43 | IRCTab::m_selfColor = config.readEntry("SelfColor", "#CC0000"); |
40 | IRCTab::m_otherColor = config.readEntry("OtherColor", "#0000BB"); | 44 | IRCTab::m_otherColor = config.readEntry("OtherColor", "#0000BB"); |
41 | IRCTab::m_serverColor = config.readEntry("ServerColor", "#0000FF"); | 45 | IRCTab::m_serverColor = config.readEntry("ServerColor", "#0000FF"); |
42 | IRCTab::m_notificationColor = config.readEntry("NotificationColor", "#AA3300"); | 46 | IRCTab::m_notificationColor = config.readEntry("NotificationColor", "#AA3300"); |
43 | IRCTab::m_maxLines = config.readNumEntry("Lines", 100); | 47 | IRCTab::m_maxLines = config.readNumEntry("Lines", 100); |
44 | } | 48 | } |
45 | 49 | ||
46 | void MainWindow::selected(QWidget *) { | 50 | void MainWindow::selected(QWidget *) { |
47 | m_tabWidget->setTabColor(m_tabWidget->currentPageIndex(), black); | 51 | m_tabWidget->setTabColor(m_tabWidget->currentPageIndex(), black); |
52 | emit updateScroll(); | ||
48 | } | 53 | } |
49 | 54 | ||
50 | void MainWindow::addTab(IRCTab *tab) { | 55 | void MainWindow::addTab(IRCTab *tab) { |
51 | connect(tab, SIGNAL(changed(IRCTab *)), this, SLOT(changeEvent(IRCTab *))); | 56 | connect(tab, SIGNAL(changed(IRCTab *)), this, SLOT(changeEvent(IRCTab *))); |
52 | m_tabWidget->addTab(tab, tab->title()); | 57 | m_tabWidget->addTab(tab, tab->title()); |
53 | m_tabWidget->showPage(tab); | 58 | m_tabWidget->showPage(tab); |
54 | tab->setID(m_tabWidget->currentPageIndex()); | 59 | tab->setID(m_tabWidget->currentPageIndex()); |
55 | m_tabs.append(tab); | 60 | m_tabs.append(tab); |
56 | } | 61 | } |
57 | 62 | ||
58 | void MainWindow::changeEvent(IRCTab *tab) { | 63 | void MainWindow::changeEvent(IRCTab *tab) { |
59 | if (tab->id() != m_tabWidget->currentPageIndex()) | 64 | if (tab->id() != m_tabWidget->currentPageIndex()) |