summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/oscar/aim/aimjoinchat.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /kopete/protocols/oscar/aim/aimjoinchat.cpp
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/protocols/oscar/aim/aimjoinchat.cpp')
-rw-r--r--kopete/protocols/oscar/aim/aimjoinchat.cpp94
1 files changed, 94 insertions, 0 deletions
diff --git a/kopete/protocols/oscar/aim/aimjoinchat.cpp b/kopete/protocols/oscar/aim/aimjoinchat.cpp
new file mode 100644
index 00000000..8b8c78a9
--- /dev/null
+++ b/kopete/protocols/oscar/aim/aimjoinchat.cpp
@@ -0,0 +1,94 @@
+// aimjoinchat.cpp
+
+// Copyright (C) 2005 Matt Rogers <mattr@kde.org>
+
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02110-1301 USA
+
+#include "aimjoinchat.h"
+
+#include <qlineedit.h>
+#include <qcombobox.h>
+#include <klocale.h>
+
+#include "aimjoinchatbase.h"
+#include "aimaccount.h"
+
+AIMJoinChatUI::AIMJoinChatUI( AIMAccount* account, bool modal,
+ QWidget* parent, const char* name )
+ : KDialogBase( parent, name, modal, i18n( "Join AIM Chat Room" ),
+ Cancel | User1, User1, true, i18n( "Join" ) )
+{
+
+ kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "Account " << account->accountId()
+ << " joining a chat room" << endl;
+
+ m_account = account;
+
+ m_joinUI = new AIMJoinChatBase( this, "aimjoinchatbase" );
+
+ setMainWidget( m_joinUI );
+
+ QObject::connect( this, SIGNAL( user1Clicked() ), this, SLOT( joinChat() ) );
+ QObject::connect( this, SIGNAL( cancelClicked() ), this, SLOT( closeClicked() ) );
+}
+
+AIMJoinChatUI::~AIMJoinChatUI()
+{
+ m_exchanges.clear();
+}
+
+void AIMJoinChatUI::setExchangeList( const QValueList<int>& list )
+{
+ m_exchanges = list;
+ QStringList exchangeList;
+ QValueList<int>::const_iterator it = list.begin();
+ while ( it != list.end() )
+ {
+ exchangeList.append( QString::number( ( *it ) ) );
+ ++it;
+ }
+
+
+ m_joinUI->exchange->insertStringList( exchangeList );
+}
+
+void AIMJoinChatUI::joinChat()
+{
+ m_roomName = m_joinUI->roomName->text();
+ int item = m_joinUI->exchange->currentItem();
+ m_exchange = m_joinUI->exchange->text( item );
+
+ emit closing( QDialog::Accepted );
+}
+
+void AIMJoinChatUI::closeClicked()
+{
+ //hmm, do nothing?
+ emit closing( QDialog::Rejected );
+}
+
+QString AIMJoinChatUI::roomName() const
+{
+ return m_roomName;
+}
+
+QString AIMJoinChatUI::exchange() const
+{
+ return m_exchange;
+}
+
+#include "aimjoinchat.moc"
+//kate: space-indent on; indent-width 4;