pbx_kdeconsole.cc 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. #include "pbx_kdeconsole.moc"
  14. KAsteriskConsole::KAsteriskConsole() : KTMainWindow()
  15. {
  16. QVBoxLayout *box;
  17. QFrame *f;
  18. f = new QFrame(this);
  19. setGeometry(100,100,600,400);
  20. /* Menus */
  21. file = new QPopupMenu();
  22. file->insertItem("&Exit", this, SLOT(slotExit()));
  23. help = kapp->getHelpMenu(TRUE, "KDE Asterisk Console\nby Mark Spencer");
  24. setCaption("Asterisk Console");
  25. /* Box */
  26. box = new QVBoxLayout(f, 20, 5);
  27. /* Menu bar creation */
  28. menu = new KMenuBar(this);
  29. menu->insertItem("&File", file);
  30. menu->insertItem("&Help", help);
  31. /* Verbose stuff */
  32. verbose = new QListBox(f, "verbose");
  33. /* Exit button */
  34. btnExit = new QPushButton("Exit", f, "exit");
  35. btnExit->show();
  36. connect(btnExit, SIGNAL(clicked()), this, SLOT(slotExit()));
  37. box->addWidget(verbose, 1);
  38. box->addWidget(btnExit, 0);
  39. setView(f, TRUE);
  40. statusBar()->message("Ready", 2000);
  41. }
  42. void KAsteriskConsole::slotExit()
  43. {
  44. close();
  45. }
  46. void KAsteriskConsole::closeEvent(QCloseEvent *)
  47. {
  48. kapp->quit();
  49. }