summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/irc/ui/channellistdialog.cpp
blob: cd12714730d59abfc1e87b8742c2cad3b687c0fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
    channellistdialog.cpp - IRC Channel Search Dialog

    Copyright (c) 2004      by Jason Keirstead <[email protected]>
    Copyright (c) 2005      by Michel Hermier <[email protected]>

    Kopete    (c) 2002-2005 by the Kopete developers <[email protected]>

    *************************************************************************
    *                                                                       *
    * 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 "channellistdialog.h"

#include "kircengine.h"

#include "kopeteuiglobal.h"

#include "tqlayout.h"

ChannelListDialog::ChannelListDialog(KIRC::Engine *engine, const TQString &caption, TQObject *target, const char* slotJoinChan)
	: KDialogBase(Kopete::UI::Global::mainWidget(), "channel_list_widget", false, caption, Close)
{
	m_engine = engine;
	m_list = new ChannelList( this, engine );

	connect( m_list, TQ_SIGNAL( channelDoubleClicked( const TQString & ) ),
		target, slotJoinChan );

	connect( m_list, TQ_SIGNAL( channelDoubleClicked( const TQString & ) ),
		this, TQ_SLOT( slotChannelDoubleClicked( const TQString & ) ) );

	new TQHBoxLayout( m_list, 0, spacingHint() );

	setInitialSize( TQSize( 500, 400 ) );
	setMainWidget( m_list );
	show();
}

void ChannelListDialog::clear()
{
	m_list->clear();
}

void ChannelListDialog::search()
{
	m_list->search();
}

void ChannelListDialog::slotChannelDoubleClicked( const TQString & )
{
	close();
}

#include "channellistdialog.moc"