From a62da671af0ecbb124b0a6eeb7d666a8d85c2032 Mon Sep 17 00:00:00 2001
From: Mark Spencer <markster@digium.com>
Date: Wed, 27 Oct 1999 02:12:33 +0000
Subject: [PATCH] Version 0.1.0 from FTP

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@11 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 pbx/pbx_kdeconsole.h       | 37 +++++++++++++++++
 pbx/pbx_kdeconsole_main.cc | 81 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 118 insertions(+)
 create mode 100755 pbx/pbx_kdeconsole.h
 create mode 100755 pbx/pbx_kdeconsole_main.cc

diff --git a/pbx/pbx_kdeconsole.h b/pbx/pbx_kdeconsole.h
new file mode 100755
index 0000000000..e003e48f10
--- /dev/null
+++ b/pbx/pbx_kdeconsole.h
@@ -0,0 +1,37 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
+ * KDE Console monitor -- Header file
+ * 
+ * Copyright (C) 1999, Adtran Inc. and Linux Support Services, LLC
+ *
+ * Mark Spencer <markster@linux-support.net>
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License
+ */
+
+#include <kapp.h>
+#include <ktmainwindow.h>
+#include <qpushbutton.h>
+#include <kmenubar.h>
+#include <qpopupmenu.h>
+#include <qlistbox.h>
+#include <qlayout.h>
+#include <qframe.h>
+
+class KAsteriskConsole : public KTMainWindow
+{
+	Q_OBJECT
+public:
+	KAsteriskConsole();
+	void closeEvent(QCloseEvent *);
+	QListBox *verbose;
+public slots:
+	void slotExit();
+private:
+	void KAsteriskConsole::verboser(char *stuff, int opos, int replacelast, int complete);
+	QPushButton *btnExit;
+	KMenuBar *menu;
+	QPopupMenu *file, *help;
+};
diff --git a/pbx/pbx_kdeconsole_main.cc b/pbx/pbx_kdeconsole_main.cc
new file mode 100755
index 0000000000..7ddc742344
--- /dev/null
+++ b/pbx/pbx_kdeconsole_main.cc
@@ -0,0 +1,81 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
+ * KDE Console monitor -- Mostly glue code
+ * 
+ * Copyright (C) 1999, Adtran Inc. and Linux Support Services, LLC
+ *
+ * Mark Spencer <markster@linux-support.net>
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License
+ */
+
+#include <asterisk/module.h>
+#include <asterisk/channel.h>
+#include <asterisk/logger.h>
+#include <pthread.h>
+#include "pbx_kdeconsole.h"
+
+static char *dtext = "KDE Console Monitor";
+
+static int inuse = 0;
+
+static KAsteriskConsole *w;
+
+static void verboser(char *stuff, int opos, int replacelast, int complete)
+{
+	const char *s2[2];
+	s2[0] = stuff;
+	s2[1] = NULL;
+	if (replacelast)  {
+		printf("Removing %d\n", w->verbose->count());
+		w->verbose->removeItem(w->verbose->count());
+	}
+	w->verbose->insertStrList(s2, 1, -1);
+	w->verbose->setBottomItem(w->verbose->count());
+}
+
+static int kde_main(int argc, char *argv[])
+{
+	KApplication a ( argc, argv );
+	w = new KAsteriskConsole();
+	a.setMainWidget(w);
+	w->show();
+	ast_register_verbose(verboser);
+	return a.exec();
+}
+
+static void *kdemain(void *data)
+{
+	/* It would appear kde really wants to be main */;
+	char *argv[1] = { "asteriskconsole" };
+	kde_main(1, argv);
+	return NULL;
+}
+
+extern "C" {
+
+int unload_module(void)
+{
+	return inuse;
+}
+
+int load_module(void)
+{
+	pthread_t t;
+	pthread_create(&t, NULL, kdemain, NULL);
+	return 0;
+}
+
+int usecount(void)
+{
+	return inuse;
+}
+
+char *description(void)
+{
+	return dtext;
+}
+
+}
-- 
GitLab