fix a bug in computing line numbers
[asterisk/asterisk.git] / pbx / pbx_kdeconsole.cc
1 /*
2  * Asterisk -- A telephony toolkit for Linux.
3  *
4  * KDE Console monitor -- Class implmementation
5  * 
6  * Copyright (C) 1999, Mark Spencer
7  *
8  * Mark Spencer <markster@linux-support.net>
9  *
10  * This program is free software, distributed under the terms of
11  * the GNU General Public License
12  */
13
14 /*** MODULEINFO
15         <depend>qt</depend>
16  ***/
17
18 #include "pbx_kdeconsole.moc"
19
20 KAsteriskConsole::KAsteriskConsole() : KTMainWindow()
21 {
22         QVBoxLayout *box;
23         QFrame *f;
24         
25         f = new QFrame(this);
26         
27         setGeometry(100,100,600,400);
28         /* Menus */
29         file = new QPopupMenu();
30         file->insertItem("&Exit", this, SLOT(slotExit()));
31         
32         help = kapp->getHelpMenu(TRUE, "KDE Asterisk Console\nby Mark Spencer");
33         
34         setCaption("Asterisk Console");
35         
36         /* Box */
37         box = new QVBoxLayout(f, 20, 5);
38         
39         /* Menu bar creation */
40         menu = new KMenuBar(this);
41         menu->insertItem("&File", file);
42         menu->insertItem("&Help", help);
43         /* Verbose stuff */
44         verbose = new QListBox(f, "verbose");
45         /* Exit button */
46         btnExit = new QPushButton("Exit", f, "exit");
47         btnExit->show();
48         connect(btnExit,  SIGNAL(clicked()), this, SLOT(slotExit()));
49         
50         box->addWidget(verbose, 1);
51         box->addWidget(btnExit, 0);
52         setView(f, TRUE);
53         statusBar()->message("Ready", 2000);
54 }
55
56 void KAsteriskConsole::slotExit()
57 {
58         close();
59 }
60
61 void KAsteriskConsole::closeEvent(QCloseEvent *)
62 {
63         kapp->quit();
64 }
65