aboutsummaryrefslogtreecommitdiffstats
path: root/pbx/pbx_kdeconsole.cc
blob: 6c281736646342b3052fa1b2297e8c2420bed357 (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
/*
 * Asterisk -- A telephony toolkit for Linux.
 *
 * KDE Console monitor -- Class implmementation
 * 
 * Copyright (C) 1999, Mark Spencer
 *
 * Mark Spencer <markster@linux-support.net>
 *
 * This program is free software, distributed under the terms of
 * the GNU General Public License
 */

#include "pbx_kdeconsole.moc"

KAsteriskConsole::KAsteriskConsole() : KTMainWindow()
{
	QVBoxLayout *box;
	QFrame *f;
	
	f = new QFrame(this);
	
	setGeometry(100,100,600,400);
	/* Menus */
	file = new QPopupMenu();
	file->insertItem("&Exit", this, SLOT(slotExit()));
	
	help = kapp->getHelpMenu(TRUE, "KDE Asterisk Console\nby Mark Spencer");
	
	setCaption("Asterisk Console");
	
	/* Box */
	box = new QVBoxLayout(f, 20, 5);
	
	/* Menu bar creation */
	menu = new KMenuBar(this);
	menu->insertItem("&File", file);
	menu->insertItem("&Help", help);
	/* Verbose stuff */
	verbose = new QListBox(f, "verbose");
	/* Exit button */
	btnExit = new QPushButton("Exit", f, "exit");
	btnExit->show();
	connect(btnExit,  SIGNAL(clicked()), this, SLOT(slotExit()));
	
	box->addWidget(verbose, 1);
	box->addWidget(btnExit, 0);
	setView(f, TRUE);
	statusBar()->message("Ready", 2000);
}

void KAsteriskConsole::slotExit()
{
	close();
}

void KAsteriskConsole::closeEvent(QCloseEvent *)
{
	kapp->quit();
}