/*************************************************************************** dlgjabbersendraw.cpp - Raw XML dialog ------------------- begin : Sun Aug 25 2002 copyright : (C) 2002-2003 by Till Gerken email : kopete-devel@kde.org *************************************************************************** *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "dlgjabbersendraw.h" #include #include #include #include #include "jabberclient.h" dlgJabberSendRaw::dlgJabberSendRaw ( JabberClient *client, TQWidget *parent, const char *name ) : DlgSendRaw (parent, name) { // Connect the GUI elements to things that do stuff connect (btnSend, TQT_SIGNAL (clicked ()), this, TQT_SLOT (slotSend ())); connect (btnClose, TQT_SIGNAL (clicked ()), this, TQT_SLOT (slotCancel ())); connect (btnClear, TQT_SIGNAL (clicked ()), this, TQT_SLOT (slotClear ())); connect (inputWidget, TQT_SIGNAL (activated (int)), this, TQT_SLOT (slotCreateMessage (int))); m_client = client; show(); } dlgJabberSendRaw::~dlgJabberSendRaw () { // Nothing yet } void dlgJabberSendRaw::slotCancel () { close(true); } void dlgJabberSendRaw::slotClear () { inputWidget->setCurrentItem(0); tePacket->clear(); } void dlgJabberSendRaw::slotCreateMessage(int index) { switch (index) { case 1: tePacket->setText(TQString("\n\n\n") .arg ( m_client->jid().domain () ) ); break; case 2: tePacket->setText("\n\?\?\?\n\?\?\?\n"); break; case 3: tePacket->setText("\n"); break; case 4: tePacket->setText(TQString("\nBody text\n") .arg ( m_client->jid().node (), m_client->jid().domain (), m_client->jid().resource () ) ); break; case 5: tePacket->setText(TQString("\nSubjectBody text\n") .arg ( m_client->jid().node (), m_client->jid().domain (), m_client->jid().resource () ) ); break; case 6: tePacket->setText("\n\n\nGROUP\n\n\n"); break; case 7: tePacket->setText("\n\n\n\n"); break; case 8: tePacket->setText(""); break; default: tePacket->clear(); break; } } void dlgJabberSendRaw::slotSend() { kdDebug (14130) << "[dlgJabberSendRaw] Sending RAW message" << endl; // Tell our engine to send m_client->send (tePacket->text ()); // set temlapte combobox to "User Defined" and clear content inputWidget->setCurrentItem(0); tePacket->clear(); } #include "dlgjabbersendraw.moc"