Diffstat (limited to 'noncore/net/opieirc/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/mainwindow.cpp | 20 |
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 @@ #include <opie2/odebug.h> #include <qwhatsthis.h> #include "mainwindow.h" #include "ircservertab.h" +#include "dcctransfertab.h" #include "ircserverlist.h" #include "ircsettings.h" +#include <stdio.h> + + QString MainWindow::appCaption() { return QObject::tr("Opie IRC"); } MainWindow::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( a->setWhatsThis(tr("Create a new connection to an IRC server")); a->addTo(irc); a = new QAction(tr("Settings"), Resource::loadPixmap("SettingsIcon"), QString::null, 0, this, 0); a->setWhatsThis(tr("Configure OpieIRC's behavior and appearance")); connect(a, SIGNAL(activated()), this, SLOT(settings())); a->addTo(irc); + m_dccTab = 0; loadSettings(); } /*IRCTabWidget MainWindow::getTabWidget(){ return m_tabWidget; } */ @@ -74,12 +79,15 @@ void MainWindow::addTab(IRCTab *tab) { void MainWindow::changeEvent(IRCTab *tab) { if (tab->id() != m_tabWidget->currentPageIndex()) m_tabWidget->setTabColor(tab->id(), blue); } void MainWindow::killTab(IRCTab *tab, bool imediate) { + if (tab == m_dccTab) + m_dccTab = 0; + m_toDelete.append( tab ); if ( imediate ) slotKillTabsLater(); else QTimer::singleShot(0, this, SLOT(slotKillTabsLater()) ); @@ -134,6 +142,18 @@ void MainWindow::slotPrevTab() { } void MainWindow::slotPing( const QString& /*channel*/ ) { raise(); } +void MainWindow::addDCC(DCCTransfer::Type type, Q_UINT32 ip4Addr, Q_UINT16 port, + const QString &filename, const QString &nickname, unsigned int size) { + + if (!m_dccTab) { + m_dccTab = new DCCTransferTab(this); + addTab(m_dccTab); + m_dccTab->show(); + } + + m_dccTab->addTransfer(type, ip4Addr, port, filename, nickname, size); +} + |