summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/mainwindow.cpp
Unidiff
Diffstat (limited to 'noncore/net/opieirc/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/mainwindow.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/noncore/net/opieirc/mainwindow.cpp b/noncore/net/opieirc/mainwindow.cpp
index 1811a0c..3d60107 100644
--- a/noncore/net/opieirc/mainwindow.cpp
+++ b/noncore/net/opieirc/mainwindow.cpp
@@ -4,15 +4,19 @@
4#include <opie2/odebug.h> 4#include <opie2/odebug.h>
5 5
6#include <qwhatsthis.h> 6#include <qwhatsthis.h>
7 7
8#include "mainwindow.h" 8#include "mainwindow.h"
9#include "ircservertab.h" 9#include "ircservertab.h"
10#include "dcctransfertab.h"
10#include "ircserverlist.h" 11#include "ircserverlist.h"
11#include "ircsettings.h" 12#include "ircsettings.h"
12 13
14#include <stdio.h>
15
16
13QString MainWindow::appCaption() { 17QString MainWindow::appCaption() {
14 return QObject::tr("Opie IRC"); 18 return QObject::tr("Opie IRC");
15} 19}
16 20
17 21
18MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { 22MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) {
@@ -30,12 +34,13 @@ MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(
30 a->setWhatsThis(tr("Create a new connection to an IRC server")); 34 a->setWhatsThis(tr("Create a new connection to an IRC server"));
31 a->addTo(irc); 35 a->addTo(irc);
32 a = new QAction(tr("Settings"), Resource::loadPixmap("SettingsIcon"), QString::null, 0, this, 0); 36 a = new QAction(tr("Settings"), Resource::loadPixmap("SettingsIcon"), QString::null, 0, this, 0);
33 a->setWhatsThis(tr("Configure OpieIRC's behavior and appearance")); 37 a->setWhatsThis(tr("Configure OpieIRC's behavior and appearance"));
34 connect(a, SIGNAL(activated()), this, SLOT(settings())); 38 connect(a, SIGNAL(activated()), this, SLOT(settings()));
35 a->addTo(irc); 39 a->addTo(irc);
40 m_dccTab = 0;
36 loadSettings(); 41 loadSettings();
37} 42}
38 43
39/*IRCTabWidget MainWindow::getTabWidget(){ 44/*IRCTabWidget MainWindow::getTabWidget(){
40 return m_tabWidget; 45 return m_tabWidget;
41} */ 46} */
@@ -74,12 +79,15 @@ void MainWindow::addTab(IRCTab *tab) {
74void MainWindow::changeEvent(IRCTab *tab) { 79void MainWindow::changeEvent(IRCTab *tab) {
75 if (tab->id() != m_tabWidget->currentPageIndex()) 80 if (tab->id() != m_tabWidget->currentPageIndex())
76 m_tabWidget->setTabColor(tab->id(), blue); 81 m_tabWidget->setTabColor(tab->id(), blue);
77} 82}
78 83
79void MainWindow::killTab(IRCTab *tab, bool imediate) { 84void MainWindow::killTab(IRCTab *tab, bool imediate) {
85 if (tab == m_dccTab)
86 m_dccTab = 0;
87
80 m_toDelete.append( tab ); 88 m_toDelete.append( tab );
81 89
82 if ( imediate ) 90 if ( imediate )
83 slotKillTabsLater(); 91 slotKillTabsLater();
84 else 92 else
85 QTimer::singleShot(0, this, SLOT(slotKillTabsLater()) ); 93 QTimer::singleShot(0, this, SLOT(slotKillTabsLater()) );
@@ -134,6 +142,18 @@ void MainWindow::slotPrevTab() {
134} 142}
135 143
136void MainWindow::slotPing( const QString& /*channel*/ ) { 144void MainWindow::slotPing( const QString& /*channel*/ ) {
137 raise(); 145 raise();
138} 146}
139 147
148void MainWindow::addDCC(DCCTransfer::Type type, Q_UINT32 ip4Addr, Q_UINT16 port,
149 const QString &filename, const QString &nickname, unsigned int size) {
150
151 if (!m_dccTab) {
152 m_dccTab = new DCCTransferTab(this);
153 addTab(m_dccTab);
154 m_dccTab->show();
155 }
156
157 m_dccTab->addTransfer(type, ip4Addr, port, filename, nickname, size);
158}
159