summaryrefslogtreecommitdiff
path: root/pbx/kdeconsole_main.cc
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2006-07-07 02:20:28 +0000
committerKevin P. Fleming <kpfleming@digium.com>2006-07-07 02:20:28 +0000
commit13ba816edd4423421eef061f69fb83e574a318e9 (patch)
tree6accd2704343d0f4734e6539fe4746883a2006a1 /pbx/kdeconsole_main.cc
parent3be4c8d3eb4c2beb04ec3f0a557d9449147549fa (diff)
rename this file so it doesn't appear to be a module by itself
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@37279 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'pbx/kdeconsole_main.cc')
-rw-r--r--pbx/kdeconsole_main.cc81
1 files changed, 81 insertions, 0 deletions
diff --git a/pbx/kdeconsole_main.cc b/pbx/kdeconsole_main.cc
new file mode 100644
index 000000000..0bb2d73e2
--- /dev/null
+++ b/pbx/kdeconsole_main.cc
@@ -0,0 +1,81 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
+ * KDE Console monitor -- Mostly glue code
+ *
+ * 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 "asterisk/module.h"
+#include "asterisk/channel.h"
+#include "asterisk/logger.h"
+#include "asterisk/lock.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;
+}
+
+}