Diffstat (limited to 'noncore/net/opieirc/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/opieirc/mainwindow.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/noncore/net/opieirc/mainwindow.cpp b/noncore/net/opieirc/mainwindow.cpp index 0923a11..1143213 100644 --- a/noncore/net/opieirc/mainwindow.cpp +++ b/noncore/net/opieirc/mainwindow.cpp | |||
@@ -7,6 +7,11 @@ | |||
7 | #include "ircserverlist.h" | 7 | #include "ircserverlist.h" |
8 | #include "ircsettings.h" | 8 | #include "ircsettings.h" |
9 | 9 | ||
10 | QString MainWindow::appCaption() { | ||
11 | return QObject::tr("Opie IRC"); | ||
12 | } | ||
13 | |||
14 | |||
10 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { | 15 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { |
11 | setCaption(tr("IRC Client")); | 16 | setCaption(tr("IRC Client")); |
12 | m_tabWidget = new IRCTabWidget(this); | 17 | m_tabWidget = new IRCTabWidget(this); |
@@ -52,6 +57,11 @@ void MainWindow::selected(QWidget *) { | |||
52 | 57 | ||
53 | void MainWindow::addTab(IRCTab *tab) { | 58 | void MainWindow::addTab(IRCTab *tab) { |
54 | connect(tab, SIGNAL(changed(IRCTab*)), this, SLOT(changeEvent(IRCTab*))); | 59 | connect(tab, SIGNAL(changed(IRCTab*)), this, SLOT(changeEvent(IRCTab*))); |
60 | connect(tab, SIGNAL(ping (const QString&)), this, SLOT(slotPing(const QString&))); | ||
61 | connect(tab, SIGNAL(nextTab()), this, SLOT(slotNextTab())); | ||
62 | connect(tab, SIGNAL(prevTab()), this, SLOT(slotPrevTab())); | ||
63 | connect(tab, SIGNAL(closeTab()), this, SLOT(slotCloseTab())); | ||
64 | |||
55 | m_tabWidget->addTab(tab, tab->title()); | 65 | m_tabWidget->addTab(tab, tab->title()); |
56 | m_tabWidget->showPage(tab); | 66 | m_tabWidget->showPage(tab); |
57 | tab->setID(m_tabWidget->currentPageIndex()); | 67 | tab->setID(m_tabWidget->currentPageIndex()); |
@@ -89,3 +99,30 @@ void MainWindow::settings() { | |||
89 | } | 99 | } |
90 | } | 100 | } |
91 | } | 101 | } |
102 | |||
103 | |||
104 | void MainWindow::slotNextTab() { | ||
105 | int i = m_tabWidget->currentPageIndex (); | ||
106 | m_tabWidget->setCurrentPage ( i+1 ); | ||
107 | |||
108 | int j = m_tabWidget->currentPageIndex (); | ||
109 | if ( i == j ) | ||
110 | m_tabWidget->setCurrentPage ( 1 ); | ||
111 | } | ||
112 | |||
113 | void MainWindow::slotPrevTab() { | ||
114 | int i = m_tabWidget->currentPageIndex (); | ||
115 | if ( i > 1 ) | ||
116 | m_tabWidget->setCurrentPage ( i-1 ); | ||
117 | } | ||
118 | |||
119 | void MainWindow::slotCloseTab() { | ||
120 | IRCTab *tab = (IRCTab *) m_tabWidget->currentPage (); | ||
121 | if ( tab ) | ||
122 | killTab ( tab ); | ||
123 | } | ||
124 | |||
125 | void MainWindow::slotPing( const QString& channel ) { | ||
126 | raise(); | ||
127 | } | ||
128 | |||