<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[Freeswitch-trunk][14264] </title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<div id="header">FreeSWITCH Subversion</div>
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://fisheye.freeswitch.org/changelog/FreeSWITCH?cs=14264">14264</a></dd>
<dt>Author</dt> <dd>jmesquita</dd>
<dt>Date</dt> <dd>2009-07-15 19:49:41 -0500 (Wed, 15 Jul 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Yep, we now have multiple tabs.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunkcontribjmesquitafsguifsguipro">freeswitch/trunk/contrib/jmesquita/fsgui/fsgui.pro</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguiresourcesfs_guiui">freeswitch/trunk/contrib/jmesquita/fsgui/resources/fs_gui.ui</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguisrcesl_connectioncpp">freeswitch/trunk/contrib/jmesquita/fsgui/src/esl_connection.cpp</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguisrcfs_guicpp">freeswitch/trunk/contrib/jmesquita/fsgui/src/fs_gui.cpp</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguisrcincludeesl_connectionh">freeswitch/trunk/contrib/jmesquita/fsgui/src/include/esl_connection.h</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguisrcincludefs_guih">freeswitch/trunk/contrib/jmesquita/fsgui/src/include/fs_gui.h</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguisrcserver_managercpp">freeswitch/trunk/contrib/jmesquita/fsgui/src/server_manager.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#freeswitchtrunkcontribjmesquitafsguiresourcesconsolepageui">freeswitch/trunk/contrib/jmesquita/fsgui/resources/consolepage.ui</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguisrcconsolepagecpp">freeswitch/trunk/contrib/jmesquita/fsgui/src/consolepage.cpp</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguisrcincludeconsolepageh">freeswitch/trunk/contrib/jmesquita/fsgui/src/include/consolepage.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkcontribjmesquitafsguifsguipro"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/fsgui.pro (14263 => 14264)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/fsgui.pro        2009-07-16 00:46:35 UTC (rev 14263)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/fsgui.pro        2009-07-16 00:49:41 UTC (rev 14264)
</span><span class="lines">@@ -1,27 +1,23 @@
</span><del>-
</del><span class="cx"> DESTDIR = ./bin/
</span><span class="cx"> message(The project will be installed in $$DESTDIR)
</span><span class="cx"> TARGET = fs_gui
</span><span class="cx"> TEMPLATE = app
</span><del>-
</del><span class="cx"> MOC_DIR = ./build/
</span><span class="cx"> OBJECTS_DIR = ./build/
</span><span class="cx"> UI_DIR = ./build/
</span><del>-
-SOURCES += ./src/main.cpp \
-    ./src/fs_gui.cpp \
-    ./src/server_manager.cpp \
-    ./src/esl_connection.cpp
-
</del><ins>+SOURCES += src/main.cpp \
+    src/fs_gui.cpp \
+    src/server_manager.cpp \
+    src/esl_connection.cpp \
+    src/consolepage.cpp
</ins><span class="cx"> INCLUDEPATH += ../../../libs/esl/src/include \
</span><del>-    ./src/include
-
-HEADERS += ./src/include/fs_gui.h \
-    ./src/include/server_manager.h \
-    ./src/include/esl_connection.h
-
-FORMS += ./resources/fs_gui.ui \
-    ./resources/server_manager.ui
-
</del><ins>+    src/include
+HEADERS += src/include/fs_gui.h \
+    src/include/server_manager.h \
+    src/include/esl_connection.h \
+    src/include/consolepage.h
+FORMS += resources/fs_gui.ui \
+    resources/server_manager.ui \
+    resources/consolepage.ui
</ins><span class="cx"> LIBS += -L../../../libs/esl \
</span><span class="cx">     -lesl
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguiresourcesconsolepageui"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/jmesquita/fsgui/resources/consolepage.ui (0 => 14264)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/resources/consolepage.ui                                (rev 0)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/resources/consolepage.ui        2009-07-16 00:49:41 UTC (rev 14264)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+&lt;ui version=&quot;4.0&quot;&gt;
+ &lt;class&gt;consolePage&lt;/class&gt;
+ &lt;widget class=&quot;QWidget&quot; name=&quot;consolePage&quot;&gt;
+  &lt;property name=&quot;geometry&quot;&gt;
+   &lt;rect&gt;
+    &lt;x&gt;0&lt;/x&gt;
+    &lt;y&gt;0&lt;/y&gt;
+    &lt;width&gt;274&lt;/width&gt;
+    &lt;height&gt;244&lt;/height&gt;
+   &lt;/rect&gt;
+  &lt;/property&gt;
+  &lt;property name=&quot;windowTitle&quot;&gt;
+   &lt;string&gt;consolePage&lt;/string&gt;
+  &lt;/property&gt;
+  &lt;layout class=&quot;QVBoxLayout&quot; name=&quot;verticalLayout&quot;&gt;
+   &lt;item&gt;
+    &lt;widget class=&quot;QTextEdit&quot; name=&quot;textConsole&quot;/&gt;
+   &lt;/item&gt;
+   &lt;item&gt;
+    &lt;layout class=&quot;QHBoxLayout&quot; name=&quot;horizontalLayout&quot;&gt;
+     &lt;item&gt;
+      &lt;widget class=&quot;QLineEdit&quot; name=&quot;lineCmd&quot;/&gt;
+     &lt;/item&gt;
+     &lt;item&gt;
+      &lt;widget class=&quot;QPushButton&quot; name=&quot;btnSend&quot;&gt;
+       &lt;property name=&quot;enabled&quot;&gt;
+        &lt;bool&gt;false&lt;/bool&gt;
+       &lt;/property&gt;
+       &lt;property name=&quot;text&quot;&gt;
+        &lt;string&gt;Send&lt;/string&gt;
+       &lt;/property&gt;
+       &lt;property name=&quot;autoDefault&quot;&gt;
+        &lt;bool&gt;true&lt;/bool&gt;
+       &lt;/property&gt;
+       &lt;property name=&quot;default&quot;&gt;
+        &lt;bool&gt;true&lt;/bool&gt;
+       &lt;/property&gt;
+      &lt;/widget&gt;
+     &lt;/item&gt;
+    &lt;/layout&gt;
+   &lt;/item&gt;
+  &lt;/layout&gt;
+ &lt;/widget&gt;
+ &lt;resources/&gt;
+ &lt;connections/&gt;
+&lt;/ui&gt;
</ins></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguiresourcesfs_guiui"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/resources/fs_gui.ui (14263 => 14264)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/resources/fs_gui.ui        2009-07-16 00:46:35 UTC (rev 14263)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/resources/fs_gui.ui        2009-07-16 00:49:41 UTC (rev 14264)
</span><span class="lines">@@ -6,8 +6,8 @@
</span><span class="cx">    &lt;rect&gt;
</span><span class="cx">     &lt;x&gt;0&lt;/x&gt;
</span><span class="cx">     &lt;y&gt;0&lt;/y&gt;
</span><del>-    &lt;width&gt;600&lt;/width&gt;
-    &lt;height&gt;400&lt;/height&gt;
</del><ins>+    &lt;width&gt;296&lt;/width&gt;
+    &lt;height&gt;303&lt;/height&gt;
</ins><span class="cx">    &lt;/rect&gt;
</span><span class="cx">   &lt;/property&gt;
</span><span class="cx">   &lt;property name=&quot;windowTitle&quot;&gt;
</span><span class="lines">@@ -18,7 +18,7 @@
</span><span class="cx">     &lt;item&gt;
</span><span class="cx">      &lt;widget class=&quot;QTabWidget&quot; name=&quot;tabWidget&quot;&gt;
</span><span class="cx">       &lt;property name=&quot;currentIndex&quot;&gt;
</span><del>-       &lt;number&gt;1&lt;/number&gt;
</del><ins>+       &lt;number&gt;0&lt;/number&gt;
</ins><span class="cx">       &lt;/property&gt;
</span><span class="cx">       &lt;property name=&quot;tabsClosable&quot;&gt;
</span><span class="cx">        &lt;bool&gt;true&lt;/bool&gt;
</span><span class="lines">@@ -53,36 +53,6 @@
</span><span class="cx">       &lt;/widget&gt;
</span><span class="cx">      &lt;/widget&gt;
</span><span class="cx">     &lt;/item&gt;
</span><del>-    &lt;item&gt;
-     &lt;layout class=&quot;QHBoxLayout&quot; name=&quot;horizontalLayout&quot;&gt;
-      &lt;item&gt;
-       &lt;widget class=&quot;QLineEdit&quot; name=&quot;lineCmd&quot;&gt;
-        &lt;property name=&quot;enabled&quot;&gt;
-         &lt;bool&gt;false&lt;/bool&gt;
-        &lt;/property&gt;
-       &lt;/widget&gt;
-      &lt;/item&gt;
-      &lt;item&gt;
-       &lt;widget class=&quot;QPushButton&quot; name=&quot;btnSend&quot;&gt;
-        &lt;property name=&quot;enabled&quot;&gt;
-         &lt;bool&gt;false&lt;/bool&gt;
-        &lt;/property&gt;
-        &lt;property name=&quot;text&quot;&gt;
-         &lt;string&gt;Send&lt;/string&gt;
-        &lt;/property&gt;
-        &lt;property name=&quot;shortcut&quot;&gt;
-         &lt;string&gt;Return&lt;/string&gt;
-        &lt;/property&gt;
-        &lt;property name=&quot;autoDefault&quot;&gt;
-         &lt;bool&gt;false&lt;/bool&gt;
-        &lt;/property&gt;
-        &lt;property name=&quot;default&quot;&gt;
-         &lt;bool&gt;true&lt;/bool&gt;
-        &lt;/property&gt;
-       &lt;/widget&gt;
-      &lt;/item&gt;
-     &lt;/layout&gt;
-    &lt;/item&gt;
</del><span class="cx">    &lt;/layout&gt;
</span><span class="cx">   &lt;/widget&gt;
</span><span class="cx">   &lt;widget class=&quot;QMenuBar&quot; name=&quot;menuBar&quot;&gt;
</span><span class="lines">@@ -90,7 +60,7 @@
</span><span class="cx">     &lt;rect&gt;
</span><span class="cx">      &lt;x&gt;0&lt;/x&gt;
</span><span class="cx">      &lt;y&gt;0&lt;/y&gt;
</span><del>-     &lt;width&gt;600&lt;/width&gt;
</del><ins>+     &lt;width&gt;296&lt;/width&gt;
</ins><span class="cx">      &lt;height&gt;26&lt;/height&gt;
</span><span class="cx">     &lt;/rect&gt;
</span><span class="cx">    &lt;/property&gt;
</span><span class="lines">@@ -148,10 +118,6 @@
</span><span class="cx">   &lt;/action&gt;
</span><span class="cx">  &lt;/widget&gt;
</span><span class="cx">  &lt;layoutdefault spacing=&quot;6&quot; margin=&quot;11&quot;/&gt;
</span><del>- &lt;tabstops&gt;
-  &lt;tabstop&gt;lineCmd&lt;/tabstop&gt;
-  &lt;tabstop&gt;btnSend&lt;/tabstop&gt;
- &lt;/tabstops&gt;
</del><span class="cx">  &lt;resources/&gt;
</span><span class="cx">  &lt;connections&gt;
</span><span class="cx">   &lt;connection&gt;
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcconsolepagecpp"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/jmesquita/fsgui/src/consolepage.cpp (0 => 14264)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/consolepage.cpp                                (rev 0)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/consolepage.cpp        2009-07-16 00:49:41 UTC (rev 14264)
</span><span class="lines">@@ -0,0 +1,204 @@
</span><ins>+/*
+ * Copyright (c) 2007, Anthony Minessale II
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of the original author; nor the names of any contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Contributor(s):
+ *
+ * Joao Mesquita &lt;jmesquita (at) gmail.com&gt;
+ *
+ */
+#include &lt;QtGui&gt;
+#include &quot;consolepage.h&quot;
+#include &quot;ui_consolepage.h&quot;
+#include &quot;esl_connection.h&quot;
+#include &quot;esl.h&quot;
+
+consolePage::consolePage(QWidget *parent) :
+    QWidget(parent),
+    m_ui(new Ui::consolePage)
+{
+    m_ui-&gt;setupUi(this);
+}
+consolePage::~consolePage()
+{
+    delete m_ui;
+}
+void consolePage::init(QString host)
+{
+    this-&gt;host = host;
+    connect(m_ui-&gt;lineCmd, SIGNAL(textChanged(QString)),
+            this, SLOT(typedCommand()));
+    connect(m_ui-&gt;btnSend, SIGNAL(clicked()),
+            this, SLOT(sendCommand()));
+
+    QString settingsApplication = &quot;FSGui&quot;;
+    QString settingsOrganization = &quot;FreeSWITCH&quot;;
+
+    QSettings settings(settingsOrganization, settingsApplication);
+
+    settings.beginGroup(&quot;servers&quot;);
+    settings.beginGroup(host);
+    QString port = settings.value(&quot;port&quot;).toString();
+    QString pass = settings.value(&quot;password&quot;).toString();
+    settings.endGroup();
+    settings.endGroup();
+
+    qDebug() &lt;&lt; settings.allKeys();
+    eslConnection = new ESLconnection(host.toAscii(),
+                                      port.toAscii(),
+                                      pass.toAscii());
+
+    /* Connect signals from eslConnection */
+    connect(eslConnection, SIGNAL(gotConnected(void)),
+            this, SLOT(gotConnectedSlot(void)));
+    connect(eslConnection, SIGNAL(gotDisconnected(void)),
+            this, SLOT(gotDisconnectedSlot(void)));
+    connect(eslConnection, SIGNAL(connectionFailed(QString)),
+            this, SLOT(connectionFailedSlot(QString)));
+    connect(eslConnection, SIGNAL(gotEvent(ESLevent*)),
+            this, SLOT(gotEventSlot(ESLevent*)));
+
+    eslConnection-&gt;doConnect();
+}
+void consolePage::changeEvent(QEvent *e)
+{
+    QWidget::changeEvent(e);
+    switch (e-&gt;type()) {
+    case QEvent::LanguageChange:
+        m_ui-&gt;retranslateUi(this);
+        break;
+    default:
+        break;
+    }
+}
+void consolePage::appendConsoleText(const QString text)
+{
+    m_ui-&gt;textConsole-&gt;append(text);
+}
+void consolePage::getDisconnectedSlot()
+{
+    eslConnection-&gt;disconnect();
+}
+void consolePage::typedCommand()
+{
+    m_ui-&gt;btnSend-&gt;setDisabled(m_ui-&gt;lineCmd-&gt;text().isEmpty());
+}
+void consolePage::sendCommand()
+{
+    QStringList cmdList = m_ui-&gt;lineCmd-&gt;text().split(&quot; &quot;);
+    QString args(&quot;&quot;);
+    for(int i = 1; i &lt; cmdList.size(); i++)
+    {
+        args += cmdList[i];
+        if (i != cmdList.size()-1)
+            args += &quot; &quot;;
+    }
+    ESLevent *e = new ESLevent(eslConnection-&gt;api(cmdList[0].toAscii(), args.toAscii()));
+    gotEventSlot(e);
+    m_ui-&gt;lineCmd-&gt;clear();
+}
+void consolePage::gotConnectedSlot()
+{
+    appendConsoleText(tr(&quot;Connected!&quot;));
+    m_ui-&gt;lineCmd-&gt;setEnabled(true);
+    m_ui-&gt;lineCmd-&gt;setFocus();
+}
+void consolePage::gotDisconnectedSlot()
+{
+    appendConsoleText(tr(&quot;Disconnected!&quot;));
+    m_ui-&gt;lineCmd-&gt;setDisabled(true);
+    delete eslConnection;
+}
+void consolePage::connectionFailedSlot(QString msg)
+{
+    appendConsoleText(&quot;Connection Failed: &quot;+msg);
+    m_ui-&gt;lineCmd-&gt;setDisabled(true);
+    delete eslConnection;
+}
+void consolePage::gotEventSlot(ESLevent * event)
+{
+    QString type (event-&gt;getHeader(&quot;Content-Type&quot;));
+    if (QString::compare(&quot;log/data&quot;, type, Qt::CaseInsensitive) == 0)
+    {
+        switch (atoi(event-&gt;getHeader(&quot;log-level&quot;)))
+        {
+        case ESL_LOG_LEVEL_NOTICE:
+            {
+                m_ui-&gt;textConsole-&gt;setTextColor(Qt::cyan);
+                break;
+            }
+        case ESL_LOG_LEVEL_WARNING:
+            {
+                m_ui-&gt;textConsole-&gt;setTextColor(Qt::yellow);
+                break;
+            }
+        case ESL_LOG_LEVEL_ERROR:
+        case ESL_LOG_LEVEL_CRIT:
+            {
+                m_ui-&gt;textConsole-&gt;setTextColor(Qt::red);
+                break;
+            }
+        case ESL_LOG_LEVEL_ALERT:
+        case ESL_LOG_LEVEL_EMERG:
+        case ESL_LOG_LEVEL_INFO:
+            {
+                m_ui-&gt;textConsole-&gt;setTextColor(Qt::green);
+                break;
+            }
+        case ESL_LOG_LEVEL_DEBUG:
+            {
+                m_ui-&gt;textConsole-&gt;setTextColor(Qt::magenta);
+                break;
+            }
+        default:
+            {
+                m_ui-&gt;textConsole-&gt;setTextColor(Qt::black);
+            }
+        }
+    }
+    else
+    {
+        m_ui-&gt;textConsole-&gt;setTextColor(Qt::black);
+    }
+
+    if (event-&gt;getBody())
+    {
+        QString text = event-&gt;getBody();
+
+        if (text.endsWith(&quot;\r\n&quot;))
+            text.chop(2);
+        if (text.endsWith(&quot;\n&quot;))
+            text.chop(1);
+
+        appendConsoleText(text);
+    }
+    delete event;
+}
</ins></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcesl_connectioncpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/esl_connection.cpp (14263 => 14264)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/esl_connection.cpp        2009-07-16 00:46:35 UTC (rev 14263)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/esl_connection.cpp        2009-07-16 00:49:41 UTC (rev 14264)
</span><span class="lines">@@ -86,7 +86,6 @@
</span><span class="cx">     else
</span><span class="cx">     {
</span><span class="cx">         emit connectionFailed(QString(handle.err));
</span><del>-        qDebug() &lt;&lt; handle.err;
</del><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -291,7 +290,6 @@
</span><span class="cx">         if (!connected())
</span><span class="cx">         {
</span><span class="cx">             emit gotDisconnected();
</span><del>-            qDebug() &lt;&lt; handle.err;
</del><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         else
</span><span class="lines">@@ -387,7 +385,7 @@
</span><span class="cx">     return nextHeader();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-const char *ESLevent::serialize(const char *format)
</del><ins>+const char *ESLevent::serialize()
</ins><span class="cx"> {
</span><span class="cx">     this_check(&quot;&quot;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcfs_guicpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/fs_gui.cpp (14263 => 14264)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/fs_gui.cpp        2009-07-16 00:46:35 UTC (rev 14263)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/fs_gui.cpp        2009-07-16 00:49:41 UTC (rev 14264)
</span><span class="lines">@@ -38,8 +38,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;fs_gui.h&quot;
</span><span class="cx"> #include &quot;ui_fs_gui.h&quot;
</span><del>-#include &quot;esl_connection.h&quot;
-#include &quot;esl.h&quot;
</del><ins>+#include &quot;consolepage.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> Cfsgui::Cfsgui(QWidget *parent) :
</span><span class="cx">     QMainWindow(parent),
</span><span class="lines">@@ -55,24 +54,14 @@
</span><span class="cx">             this, SLOT(newConnectionFromDialog()));
</span><span class="cx">     connect(m_ui-&gt;actionAbout, SIGNAL(triggered()),
</span><span class="cx">             this, SLOT(showAbout()));
</span><del>-    connect(m_ui-&gt;lineCmd, SIGNAL(textChanged(QString)),
-            this, SLOT(typedCommand()));
-    connect(m_ui-&gt;btnSend, SIGNAL(clicked()),
-            this, SLOT(sendCommand()));
</del><span class="cx"> 
</span><del>-    /* Why QtDesigner does not allow me to delete this? */
-    m_ui-&gt;tabWidget-&gt;removeTab(1);
-    delete m_ui-&gt;tab_2;
</del><ins>+    m_ui-&gt;tabWidget-&gt;clear();
</ins><span class="cx"> }
</span><span class="cx"> Cfsgui::~Cfsgui()
</span><span class="cx"> {
</span><span class="cx">     delete m_ui;
</span><span class="cx">     delete serverDialog;
</span><span class="cx"> }
</span><del>-void Cfsgui::appendConsoleText(const QString text)
-{
-    m_ui-&gt;textConsole-&gt;append(text);
-}
</del><span class="cx"> void Cfsgui::showAbout()
</span><span class="cx"> {
</span><span class="cx">     QMessageBox::about(this, tr(&quot;About FSGui&quot;),
</span><span class="lines">@@ -81,115 +70,7 @@
</span><span class="cx">                           &quot;&lt;p&gt;This is small application that will help you connect &quot;
</span><span class="cx">                           &quot;to your FreeSWITCH&amp;copy; installation.&quot;));
</span><span class="cx"> }
</span><del>-void Cfsgui::getDisconnectedSlot()
-{
-    eslConnection-&gt;disconnect();
-}
-void Cfsgui::typedCommand()
-{
-    m_ui-&gt;btnSend-&gt;setDisabled(m_ui-&gt;lineCmd-&gt;text().isEmpty());
-}
-void Cfsgui::sendCommand()
-{
-    QStringList cmdList = m_ui-&gt;lineCmd-&gt;text().split(&quot; &quot;);
-    QString args(&quot;&quot;);
-    for(int i = 1; i &lt; cmdList.size(); i++)
-    {
-        args += cmdList[i];
-        if (i != cmdList.size()-1)
-            args += &quot; &quot;;
-    }
-    ESLevent *e = new ESLevent(eslConnection-&gt;api(cmdList[0].toAscii(), args.toAscii()));
-    gotEventSlot(e);
-    m_ui-&gt;lineCmd-&gt;clear();
-}
-void Cfsgui::gotConnectedSlot()
-{
-    m_ui-&gt;statusBar-&gt;showMessage(tr(&quot;Connected&quot;));
-    appendConsoleText(tr(&quot;Connected!&quot;));
-    m_ui-&gt;actionConnect-&gt;setDisabled(true);
-    m_ui-&gt;actionDisconnect-&gt;setEnabled(true);
-    m_ui-&gt;lineCmd-&gt;setEnabled(true);
-    m_ui-&gt;lineCmd-&gt;setFocus();
-}
-void Cfsgui::gotDisconnectedSlot()
-{
-    m_ui-&gt;statusBar-&gt;showMessage(tr(&quot;Disconnected&quot;));
-    appendConsoleText(tr(&quot;Disconnected!&quot;));
-    m_ui-&gt;actionConnect-&gt;setEnabled(true);
-    m_ui-&gt;actionDisconnect-&gt;setDisabled(true);
-    m_ui-&gt;lineCmd-&gt;setDisabled(true);
-    delete eslConnection;
-}
-void Cfsgui::connectionFailedSlot(QString msg)
-{
-    qDebug() &lt;&lt; msg;
-    m_ui-&gt;statusBar-&gt;showMessage(&quot;Connection Failed: &quot;+msg);
-    appendConsoleText(&quot;Connection Failed: &quot;+msg);
-    m_ui-&gt;actionConnect-&gt;setEnabled(true);
-    m_ui-&gt;actionDisconnect-&gt;setDisabled(true);
-    m_ui-&gt;lineCmd-&gt;setDisabled(true);
-    delete eslConnection;
-}
-void Cfsgui::gotEventSlot(ESLevent * event)
-{
-    QString type (event-&gt;getHeader(&quot;Content-Type&quot;));
-    if (QString::compare(&quot;log/data&quot;, type, Qt::CaseInsensitive) == 0)
-    {
-        switch (atoi(event-&gt;getHeader(&quot;log-level&quot;)))
-        {
-        case ESL_LOG_LEVEL_NOTICE:
-            {
-                m_ui-&gt;textConsole-&gt;setTextColor(Qt::cyan);
-                break;
-            }
-        case ESL_LOG_LEVEL_WARNING:
-            {
-                m_ui-&gt;textConsole-&gt;setTextColor(Qt::yellow);
-                break;
-            }
-        case ESL_LOG_LEVEL_ERROR:
-        case ESL_LOG_LEVEL_CRIT:
-            {
-                m_ui-&gt;textConsole-&gt;setTextColor(Qt::red);
-                break;
-            }
-        case ESL_LOG_LEVEL_ALERT:
-        case ESL_LOG_LEVEL_EMERG:
-        case ESL_LOG_LEVEL_INFO:
-            {
-                m_ui-&gt;textConsole-&gt;setTextColor(Qt::green);
-                break;
-            }
-        case ESL_LOG_LEVEL_DEBUG:
-            {
-                m_ui-&gt;textConsole-&gt;setTextColor(Qt::magenta);
-                break;
-            }
-        default:
-            {
-                m_ui-&gt;textConsole-&gt;setTextColor(Qt::black);
-            }
-        }
-    }
-    else
-    {
-        m_ui-&gt;textConsole-&gt;setTextColor(Qt::black);
-    }
</del><span class="cx"> 
</span><del>-    if (event-&gt;getBody())
-    {
-        QString text = event-&gt;getBody();
-
-        if (text.endsWith(&quot;\r\n&quot;))
-            text.chop(2);
-        if (text.endsWith(&quot;\n&quot;))
-            text.chop(1);
-
-        appendConsoleText(text);
-    }
-    delete event;
-}
</del><span class="cx"> void Cfsgui::changeEvent(QEvent *e)
</span><span class="cx"> {
</span><span class="cx">     QMainWindow::changeEvent(e);
</span><span class="lines">@@ -218,24 +99,8 @@
</span><span class="cx"> 
</span><span class="cx">     if (serverDialog-&gt;exec())
</span><span class="cx">     {
</span><del>-        m_ui-&gt;statusBar-&gt;showMessage(&quot;Connecting...&quot;);
-        eslConnection = new ESLconnection(serverDialog-&gt;getHost().toAscii(),
-                                          serverDialog-&gt;getPort().toAscii(),
-                                          serverDialog-&gt;getPass().toAscii());
-        /* Connect signals from eslConnection */
-        connect(eslConnection, SIGNAL(gotConnected(void)),
-                this, SLOT(gotConnectedSlot(void)));
-        connect(eslConnection, SIGNAL(gotDisconnected(void)),
-                this, SLOT(gotDisconnectedSlot(void)));
-        connect(eslConnection, SIGNAL(connectionFailed(QString)),
-                this, SLOT(connectionFailedSlot(QString)));
-        connect(eslConnection, SIGNAL(gotEvent(ESLevent*)),
-                this, SLOT(gotEventSlot(ESLevent*)));
-
-        /* Connect the disconnect menu */
-        connect(m_ui-&gt;actionDisconnect, SIGNAL(triggered()),
-                this, SLOT(getDisconnectedSlot()));
-
-        eslConnection-&gt;doConnect();
</del><ins>+        consolePage *page = new consolePage();
+        m_ui-&gt;tabWidget-&gt;addTab(page, serverDialog-&gt;getHost());
+        page-&gt;init(serverDialog-&gt;getHost());
</ins><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcincludeconsolepageh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/jmesquita/fsgui/src/include/consolepage.h (0 => 14264)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/include/consolepage.h                                (rev 0)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/include/consolepage.h        2009-07-16 00:49:41 UTC (rev 14264)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+#ifndef CONSOLEPAGE_H
+#define CONSOLEPAGE_H
+
+#include &lt;QtGui/QWidget&gt;
+
+namespace Ui {
+    class consolePage;
+}
+
+/* Forward declarations */
+class ESLevent;
+class ESLconnection;
+
+class consolePage : public QWidget {
+    Q_OBJECT
+
+public:
+    consolePage(QWidget *parent = 0);
+    ~consolePage();
+    void init(QString host);
+
+protected:
+    virtual void changeEvent(QEvent *e);
+    void appendConsoleText(const QString);
+
+private slots:
+    void gotConnectedSlot();
+    void gotDisconnectedSlot();
+    void connectionFailedSlot(QString);
+    void gotEventSlot(ESLevent *);
+    void getDisconnectedSlot();
+    void typedCommand();
+    void sendCommand();
+private:
+    Ui::consolePage *m_ui;
+    ESLconnection *eslConnection;
+    QString host;
+};
+
+#endif // CONSOLEPAGE_H
</ins></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcincludeesl_connectionh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/include/esl_connection.h (14263 => 14264)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/include/esl_connection.h        2009-07-16 00:46:35 UTC (rev 14263)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/include/esl_connection.h        2009-07-16 00:49:41 UTC (rev 14264)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">         ESLevent(esl_event_t *wrap_me, int free_me = 0);
</span><span class="cx">         ESLevent(ESLevent *me);
</span><span class="cx">         virtual ~ESLevent();
</span><del>-        const char *serialize(const char *format = NULL);
</del><ins>+        const char *serialize();
</ins><span class="cx">         bool setPriority(esl_priority_t priority = ESL_PRIORITY_NORMAL);
</span><span class="cx">         const char *getHeader(const char *header_name);
</span><span class="cx">         char *getBody(void);
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcincludefs_guih"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/include/fs_gui.h (14263 => 14264)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/include/fs_gui.h        2009-07-16 00:46:35 UTC (rev 14263)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/include/fs_gui.h        2009-07-16 00:49:41 UTC (rev 14264)
</span><span class="lines">@@ -46,9 +46,6 @@
</span><span class="cx">     class Cfsgui;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-/* Forward declarations */
-class ESLevent;
-class ESLconnection;
</del><span class="cx"> 
</span><span class="cx"> class Cfsgui : public QMainWindow {
</span><span class="cx">     Q_OBJECT
</span><span class="lines">@@ -60,23 +57,14 @@
</span><span class="cx"> protected:
</span><span class="cx">     virtual void changeEvent(QEvent *e);
</span><span class="cx">     void closeEvent(QCloseEvent *e);
</span><del>-    void appendConsoleText(const QString);
</del><span class="cx"> 
</span><span class="cx"> private slots:
</span><span class="cx">     void showAbout();
</span><span class="cx">     void newConnectionFromDialog();
</span><del>-    void gotConnectedSlot();
-    void gotDisconnectedSlot();
-    void connectionFailedSlot(QString);
-    void gotEventSlot(ESLevent *);
-    void getDisconnectedSlot();
-    void typedCommand();
-    void sendCommand();
</del><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     Ui::Cfsgui *m_ui;
</span><span class="cx">     CserverManager *serverDialog;
</span><del>-    ESLconnection *eslConnection;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> #endif // FS_GUI_H
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcserver_managercpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/server_manager.cpp (14263 => 14264)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/server_manager.cpp        2009-07-16 00:46:35 UTC (rev 14263)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/server_manager.cpp        2009-07-16 00:49:41 UTC (rev 14264)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> {
</span><span class="cx">     m_ui-&gt;setupUi(this);
</span><span class="cx"> 
</span><del>-    settingsApplication = &quot;FsGUI&quot;;
</del><ins>+    settingsApplication = &quot;FSGui&quot;;
</ins><span class="cx">     settingsOrganization = &quot;FreeSWITCH&quot;;
</span><span class="cx">     readSettings();
</span><span class="cx">     connect(m_ui-&gt;btnSave, SIGNAL(clicked()),
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>