<!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][17232] </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=17232">17232</a></dd>
<dt>Author</dt> <dd>jmesquita</dd>
<dt>Date</dt> <dd>2010-04-07 00:05:03 -0500 (Wed, 07 Apr 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add new debug tools to FSComm to help on development. Check tools-&gt;debug.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunkfscommFSCommpro">freeswitch/trunk/fscomm/FSComm.pro</a></li>
<li><a href="#freeswitchtrunkfscommfshostcpp">freeswitch/trunk/fscomm/fshost.cpp</a></li>
<li><a href="#freeswitchtrunkfscommfshosth">freeswitch/trunk/fscomm/fshost.h</a></li>
<li><a href="#freeswitchtrunkfscommmainwindowcpp">freeswitch/trunk/fscomm/mainwindow.cpp</a></li>
<li><a href="#freeswitchtrunkfscommmainwindowh">freeswitch/trunk/fscomm/mainwindow.h</a></li>
<li><a href="#freeswitchtrunkfscommmainwindowui">freeswitch/trunk/fscomm/mainwindow.ui</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>freeswitch/trunk/fscomm/debugtools/</li>
<li><a href="#freeswitchtrunkfscommdebugtoolsconsolewindowcpp">freeswitch/trunk/fscomm/debugtools/consolewindow.cpp</a></li>
<li><a href="#freeswitchtrunkfscommdebugtoolsconsolewindowh">freeswitch/trunk/fscomm/debugtools/consolewindow.h</a></li>
<li><a href="#freeswitchtrunkfscommdebugtoolsconsolewindowui">freeswitch/trunk/fscomm/debugtools/consolewindow.ui</a></li>
<li><a href="#freeswitchtrunkfscommdebugtoolssortfilterproxymodelcpp">freeswitch/trunk/fscomm/debugtools/sortfilterproxymodel.cpp</a></li>
<li><a href="#freeswitchtrunkfscommdebugtoolssortfilterproxymodelh">freeswitch/trunk/fscomm/debugtools/sortfilterproxymodel.h</a></li>
<li><a href="#freeswitchtrunkfscommdebugtoolsstatedebugdialogcpp">freeswitch/trunk/fscomm/debugtools/statedebugdialog.cpp</a></li>
<li><a href="#freeswitchtrunkfscommdebugtoolsstatedebugdialogh">freeswitch/trunk/fscomm/debugtools/statedebugdialog.h</a></li>
<li><a href="#freeswitchtrunkfscommdebugtoolsstatedebugdialogui">freeswitch/trunk/fscomm/debugtools/statedebugdialog.ui</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkfscommFSCommpro"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/FSComm.pro (17231 => 17232)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/FSComm.pro        2010-04-06 20:03:57 UTC (rev 17231)
+++ freeswitch/trunk/fscomm/FSComm.pro        2010-04-07 05:05:03 UTC (rev 17232)
</span><span class="lines">@@ -33,7 +33,10 @@
</span><span class="cx">     preferences/prefaccounts.cpp \
</span><span class="cx">     account.cpp \
</span><span class="cx">     widgets/codecwidget.cpp \
</span><del>-    channel.cpp
</del><ins>+    channel.cpp \
+    debugtools/consolewindow.cpp \
+    debugtools/sortfilterproxymodel.cpp \
+    debugtools/statedebugdialog.cpp
</ins><span class="cx"> HEADERS += mainwindow.h \
</span><span class="cx">     fshost.h \
</span><span class="cx">     call.h \
</span><span class="lines">@@ -45,10 +48,15 @@
</span><span class="cx">     preferences/prefaccounts.h \
</span><span class="cx">     account.h \
</span><span class="cx">     widgets/codecwidget.h \
</span><del>-    channel.h
</del><ins>+    channel.h \
+    debugtools/consolewindow.h \
+    debugtools/sortfilterproxymodel.h \
+    debugtools/statedebugdialog.h
</ins><span class="cx"> FORMS += mainwindow.ui \
</span><span class="cx">     preferences/prefdialog.ui \
</span><span class="cx">     preferences/accountdialog.ui \
</span><del>-    widgets/codecwidget.ui
</del><ins>+    widgets/codecwidget.ui \
+    debugtools/consolewindow.ui \
+    debugtools/statedebugdialog.ui
</ins><span class="cx"> RESOURCES += resources.qrc
</span><span class="cx"> OTHER_FILES += conf/freeswitch.xml
</span></span></pre></div>
<a id="freeswitchtrunkfscommdebugtoolsconsolewindowcpp"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/fscomm/debugtools/consolewindow.cpp (0 => 17232)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/debugtools/consolewindow.cpp                                (rev 0)
+++ freeswitch/trunk/fscomm/debugtools/consolewindow.cpp        2010-04-07 05:05:03 UTC (rev 17232)
</span><span class="lines">@@ -0,0 +1,158 @@
</span><ins>+#include &quot;consolewindow.h&quot;
+#include &quot;ui_consolewindow.h&quot;
+
+ConsoleWindow::ConsoleWindow(QWidget *parent) :
+    QMainWindow(parent),
+    ui(new Ui::ConsoleWindow),
+    findNext(false)
+{
+    ui-&gt;setupUi(this);
+    sourceModel = new ConsoleModel(this);
+    model = new SortFilterProxyModel(this);
+    model-&gt;setSourceModel(sourceModel);
+    model-&gt;setFilterKeyColumn(0);
+    ui-&gt;consoleListView-&gt;setModel(model);
+    ui-&gt;consoleListView-&gt;setColumnWidth(0, 2000);
+
+    connect(sourceModel, SIGNAL(beforeInserting()),
+                     this, SLOT(setConditionalScroll()));
+    connect(sourceModel, SIGNAL(afterInserting()),
+                     this, SLOT(conditionalScroll()));
+
+    connect(ui-&gt;btnSend, SIGNAL(clicked()),
+                     this, SLOT(cmdSendClicked()));
+    connect(ui-&gt;lineCmd, SIGNAL(textChanged(QString)),
+                     this, SLOT(lineCmdChanged(QString)));
+
+    _levelFilter = new QSignalMapper(this);
+    connect(ui-&gt;checkEmerg, SIGNAL(clicked()), _levelFilter, SLOT(map()));
+    connect(ui-&gt;checkAlert, SIGNAL(clicked()), _levelFilter, SLOT(map()));
+    connect(ui-&gt;checkCrit, SIGNAL(clicked()), _levelFilter, SLOT(map()));
+    connect(ui-&gt;checkDebug, SIGNAL(clicked()), _levelFilter, SLOT(map()));
+    connect(ui-&gt;checkError, SIGNAL(clicked()), _levelFilter, SLOT(map()));
+    connect(ui-&gt;checkInfo, SIGNAL(clicked()), _levelFilter, SLOT(map()));
+    connect(ui-&gt;checkNotice, SIGNAL(clicked()), _levelFilter, SLOT(map()));
+    connect(ui-&gt;checkWarn, SIGNAL(clicked()), _levelFilter, SLOT(map()));
+    _levelFilter-&gt;setMapping(ui-&gt;checkEmerg, SWITCH_LOG_CONSOLE);
+    _levelFilter-&gt;setMapping(ui-&gt;checkAlert, SWITCH_LOG_ALERT);
+    _levelFilter-&gt;setMapping(ui-&gt;checkCrit, SWITCH_LOG_CRIT);
+    _levelFilter-&gt;setMapping(ui-&gt;checkDebug, SWITCH_LOG_DEBUG);
+    _levelFilter-&gt;setMapping(ui-&gt;checkError, SWITCH_LOG_ERROR);
+    _levelFilter-&gt;setMapping(ui-&gt;checkInfo, SWITCH_LOG_INFO);
+    _levelFilter-&gt;setMapping(ui-&gt;checkNotice, SWITCH_LOG_NOTICE);
+    _levelFilter-&gt;setMapping(ui-&gt;checkWarn, SWITCH_LOG_WARNING);
+    connect(_levelFilter, SIGNAL(mapped(int)), this, SLOT(filterModelLogLevel(int)));
+
+    connect(ui-&gt;btnFilterClear, SIGNAL(clicked()),
+                     this, SLOT(filterClear()));
+    connect(ui-&gt;lineFilter, SIGNAL(textChanged(QString)),
+                     this, SLOT(filterStringChanged()));
+    connect(ui-&gt;filterCaseSensitivityCheckBox, SIGNAL(toggled(bool)),
+                     this, SLOT(filterStringChanged()));
+    connect(ui-&gt;filterSyntaxComboBox, SIGNAL(currentIndexChanged(int)),
+                     this, SLOT(filterStringChanged()));
+    connect(ui-&gt;filterReverseCheckBox, SIGNAL(toggled(bool)),
+                     this, SLOT(reverseFilterChecked()));
+
+    connect(&amp;g_FSHost, SIGNAL(eventLog(QSharedPointer&lt;switch_log_node_t&gt;,switch_log_level_t)), this, SLOT(loggerHandler(QSharedPointer&lt;switch_log_node_t&gt;,switch_log_level_t)));
+
+}
+
+ConsoleWindow::~ConsoleWindow()
+{
+    delete ui;
+}
+
+void ConsoleWindow::changeEvent(QEvent *e)
+{
+    QMainWindow::changeEvent(e);
+    switch (e-&gt;type()) {
+    case QEvent::LanguageChange:
+        ui-&gt;retranslateUi(this);
+        break;
+    default:
+        break;
+    }
+}
+
+void ConsoleWindow::setConditionalScroll()
+{
+    autoScroll = (ui-&gt;consoleListView-&gt;verticalScrollBar()-&gt;maximum() == ui-&gt;consoleListView-&gt;verticalScrollBar()-&gt;value());
+}
+
+void ConsoleWindow::conditionalScroll()
+{
+    if (autoScroll)
+        ui-&gt;consoleListView-&gt;scrollToBottom();
+}
+
+void ConsoleWindow::cmdSendClicked()
+{
+    if (ui-&gt;lineCmd-&gt;text().isEmpty()) return;
+
+    QString cmd = ui-&gt;lineCmd-&gt;text().split(&quot; &quot;, QString::SkipEmptyParts)[0];
+    if (cmd.isEmpty()) return;
+
+    QStringList split = ui-&gt;lineCmd-&gt;text().split(&quot; &quot;, QString::SkipEmptyParts);
+    if (split.isEmpty()) return;
+    QString args;
+    for (int i=1; i&lt;split.length(); i++)
+    {
+        args += split[i];
+        if (i!=split.length()-1)
+            args += &quot; &quot;;
+    }
+
+    QString res;
+    g_FSHost.sendCmd(cmd.toAscii().data(), args.toAscii().data(), &amp;res);
+    QStandardItem *item = new QStandardItem(res);
+    item-&gt;setData(SWITCH_LOG_CONSOLE, ConsoleModel::LogLevelRole);
+    addNewConsoleItem(item);
+    ui-&gt;lineCmd-&gt;clear();
+}
+
+void ConsoleWindow::lineCmdChanged(QString text)
+{
+    ui-&gt;btnSend-&gt;setDisabled(text.isEmpty());
+}
+
+void ConsoleWindow::filterModelLogLevel(int level)
+{
+    model-&gt;setLogLevelFilter(level);
+}
+
+void ConsoleWindow::loggerHandler(QSharedPointer&lt;switch_log_node_t&gt; node, switch_log_level_t level)
+{
+    if (level &gt; ui-&gt;comboLogLevel-&gt;currentIndex()) return;
+    QString text(node.data()-&gt;data);
+    if (!text.isEmpty())
+    {
+         /* Remove \r\n */
+        QStringList textList = text.split(QRegExp(&quot;(\r+)&quot;), QString::SkipEmptyParts);
+        QString final_str;
+        for (int line = 0; line&lt;textList.size(); line++)
+        {
+            final_str += textList[line];
+        }
+        QStringList lines = final_str.split(QRegExp(&quot;(\n+)&quot;), QString::SkipEmptyParts);
+        for (int line = 0; line &lt; lines.size(); ++line)
+        {
+            QStandardItem *item = new QStandardItem(lines[line]);
+            item-&gt;setData(level, ConsoleModel::LogLevelRole);
+            item-&gt;setData(node.data()-&gt;userdata, ConsoleModel::UUIDRole);
+            addNewConsoleItem(item);
+        }
+    }
+}
+
+void ConsoleWindow::addNewConsoleItem(QStandardItem *item)
+{
+    QSettings settings;
+    settings.beginGroup(&quot;Console&quot;);
+    QPalette palette = settings.value(QString(&quot;log-level-%1-palette&quot;).arg(item-&gt;data(Qt::UserRole).toInt())).value&lt;QPalette&gt;();
+    QFont font = settings.value(QString(&quot;log-level-%1-font&quot;).arg(item-&gt;data(Qt::UserRole).toInt())).value&lt;QFont&gt;();
+    item-&gt;setBackground(palette.base());
+    item-&gt;setForeground(palette.text());
+    item-&gt;setFont(font);
+    sourceModel-&gt;appendRow(item);
+}
</ins></span></pre></div>
<a id="freeswitchtrunkfscommdebugtoolsconsolewindowh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/fscomm/debugtools/consolewindow.h (0 => 17232)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/debugtools/consolewindow.h                                (rev 0)
+++ freeswitch/trunk/fscomm/debugtools/consolewindow.h        2010-04-07 05:05:03 UTC (rev 17232)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+#ifndef CONSOLEWINDOW_H
+#define CONSOLEWINDOW_H
+
+#include &lt;QtGui&gt;
+#include &quot;fshost.h&quot;
+#include &quot;sortfilterproxymodel.h&quot;
+
+namespace Ui {
+    class ConsoleWindow;
+}
+
+class ConsoleWindow : public QMainWindow {
+    Q_OBJECT
+public:
+    ConsoleWindow(QWidget *parent = 0);
+    ~ConsoleWindow();
+
+protected:
+    void changeEvent(QEvent *e);
+
+/*public slots:
+    void clearConsoleContents();
+    void saveLogToFile();
+    void pastebinLog();
+    void filterLogUUID(QString);
+    void findText();*/
+
+private slots:
+    void setConditionalScroll();
+    void conditionalScroll();
+    /*void filterClear();
+    void filterStringChanged();*/
+    void loggerHandler(QSharedPointer&lt;switch_log_node_t&gt; node, switch_log_level_t level);
+    void addNewConsoleItem(QStandardItem *item);
+    void cmdSendClicked();
+    void lineCmdChanged(QString);
+    /*void reverseFilterChecked();*/
+    void filterModelLogLevel(int);
+
+
+private:
+    Ui::ConsoleWindow *ui;
+    ConsoleModel *sourceModel;
+    QModelIndexList foundItems;
+    SortFilterProxyModel *model;
+    /*pastebinDialog *_pastebinDlg;
+    FindDialog *_findDialog;*/
+    bool findNext;
+    bool autoScroll;
+    QSignalMapper *_levelFilter;
+
+    /*void readSettings();
+    void writeSettings();*/
+};
+
+#endif // CONSOLEWINDOW_H
</ins></span></pre></div>
<a id="freeswitchtrunkfscommdebugtoolsconsolewindowui"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/fscomm/debugtools/consolewindow.ui (0 => 17232)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/debugtools/consolewindow.ui                                (rev 0)
+++ freeswitch/trunk/fscomm/debugtools/consolewindow.ui        2010-04-07 05:05:03 UTC (rev 17232)
</span><span class="lines">@@ -0,0 +1,466 @@
</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;ConsoleWindow&lt;/class&gt;
+ &lt;widget class=&quot;QMainWindow&quot; name=&quot;ConsoleWindow&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;696&lt;/width&gt;
+    &lt;height&gt;559&lt;/height&gt;
+   &lt;/rect&gt;
+  &lt;/property&gt;
+  &lt;property name=&quot;windowTitle&quot;&gt;
+   &lt;string&gt;MainWindow&lt;/string&gt;
+  &lt;/property&gt;
+  &lt;widget class=&quot;QWidget&quot; name=&quot;centralwidget&quot;&gt;
+   &lt;layout class=&quot;QVBoxLayout&quot; name=&quot;verticalLayout_4&quot;&gt;
+    &lt;item&gt;
+     &lt;widget class=&quot;QGroupBox&quot; name=&quot;groupBox_2&quot;&gt;
+      &lt;property name=&quot;maximumSize&quot;&gt;
+       &lt;size&gt;
+        &lt;width&gt;16777215&lt;/width&gt;
+        &lt;height&gt;118&lt;/height&gt;
+       &lt;/size&gt;
+      &lt;/property&gt;
+      &lt;property name=&quot;title&quot;&gt;
+       &lt;string&gt;Filter&lt;/string&gt;
+      &lt;/property&gt;
+      &lt;layout class=&quot;QVBoxLayout&quot; name=&quot;verticalLayout_2&quot;&gt;
+       &lt;item&gt;
+        &lt;layout class=&quot;QHBoxLayout&quot; name=&quot;horizontalLayout_3&quot;&gt;
+         &lt;item&gt;
+          &lt;widget class=&quot;QLineEdit&quot; name=&quot;lineFilter&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;QComboBox&quot; name=&quot;filterSyntaxComboBox&quot;&gt;
+           &lt;property name=&quot;enabled&quot;&gt;
+            &lt;bool&gt;false&lt;/bool&gt;
+           &lt;/property&gt;
+           &lt;property name=&quot;sizeAdjustPolicy&quot;&gt;
+            &lt;enum&gt;QComboBox::AdjustToContentsOnFirstShow&lt;/enum&gt;
+           &lt;/property&gt;
+           &lt;item&gt;
+            &lt;property name=&quot;text&quot;&gt;
+             &lt;string&gt;Regular Expression&lt;/string&gt;
+            &lt;/property&gt;
+           &lt;/item&gt;
+           &lt;item&gt;
+            &lt;property name=&quot;text&quot;&gt;
+             &lt;string&gt;Wildcard&lt;/string&gt;
+            &lt;/property&gt;
+           &lt;/item&gt;
+           &lt;item&gt;
+            &lt;property name=&quot;text&quot;&gt;
+             &lt;string&gt;Fixed String&lt;/string&gt;
+            &lt;/property&gt;
+           &lt;/item&gt;
+           &lt;item&gt;
+            &lt;property name=&quot;text&quot;&gt;
+             &lt;string&gt;UUID&lt;/string&gt;
+            &lt;/property&gt;
+           &lt;/item&gt;
+          &lt;/widget&gt;
+         &lt;/item&gt;
+         &lt;item&gt;
+          &lt;widget class=&quot;QPushButton&quot; name=&quot;btnFilterClear&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;&amp;amp;Clear&lt;/string&gt;
+           &lt;/property&gt;
+          &lt;/widget&gt;
+         &lt;/item&gt;
+        &lt;/layout&gt;
+       &lt;/item&gt;
+       &lt;item&gt;
+        &lt;layout class=&quot;QHBoxLayout&quot; name=&quot;horizontalLayout_2&quot;&gt;
+         &lt;item&gt;
+          &lt;widget class=&quot;QCheckBox&quot; name=&quot;filterCaseSensitivityCheckBox&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;Case sensitive filter&lt;/string&gt;
+           &lt;/property&gt;
+           &lt;property name=&quot;checked&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;QCheckBox&quot; name=&quot;filterReverseCheckBox&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;Reverse filter&lt;/string&gt;
+           &lt;/property&gt;
+           &lt;property name=&quot;checked&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;QLabel&quot; name=&quot;lblWarningMsg&quot;&gt;
+           &lt;property name=&quot;text&quot;&gt;
+            &lt;string/&gt;
+           &lt;/property&gt;
+          &lt;/widget&gt;
+         &lt;/item&gt;
+         &lt;item&gt;
+          &lt;spacer name=&quot;horizontalSpacer&quot;&gt;
+           &lt;property name=&quot;orientation&quot;&gt;
+            &lt;enum&gt;Qt::Horizontal&lt;/enum&gt;
+           &lt;/property&gt;
+           &lt;property name=&quot;sizeHint&quot; stdset=&quot;0&quot;&gt;
+            &lt;size&gt;
+             &lt;width&gt;358&lt;/width&gt;
+             &lt;height&gt;20&lt;/height&gt;
+            &lt;/size&gt;
+           &lt;/property&gt;
+          &lt;/spacer&gt;
+         &lt;/item&gt;
+        &lt;/layout&gt;
+       &lt;/item&gt;
+      &lt;/layout&gt;
+     &lt;/widget&gt;
+    &lt;/item&gt;
+    &lt;item&gt;
+     &lt;widget class=&quot;QSplitter&quot; name=&quot;splitter&quot;&gt;
+      &lt;property name=&quot;orientation&quot;&gt;
+       &lt;enum&gt;Qt::Horizontal&lt;/enum&gt;
+      &lt;/property&gt;
+      &lt;widget class=&quot;QWidget&quot; name=&quot;layoutWidget_2&quot;&gt;
+       &lt;layout class=&quot;QVBoxLayout&quot; name=&quot;verticalLayout_3&quot;&gt;
+        &lt;property name=&quot;sizeConstraint&quot;&gt;
+         &lt;enum&gt;QLayout::SetMaximumSize&lt;/enum&gt;
+        &lt;/property&gt;
+        &lt;item&gt;
+         &lt;widget class=&quot;QGroupBox&quot; name=&quot;groupBox&quot;&gt;
+          &lt;property name=&quot;maximumSize&quot;&gt;
+           &lt;size&gt;
+            &lt;width&gt;120&lt;/width&gt;
+            &lt;height&gt;16777215&lt;/height&gt;
+           &lt;/size&gt;
+          &lt;/property&gt;
+          &lt;property name=&quot;title&quot;&gt;
+           &lt;string&gt;Log Level Filter&lt;/string&gt;
+          &lt;/property&gt;
+          &lt;layout class=&quot;QVBoxLayout&quot; name=&quot;verticalLayout&quot;&gt;
+           &lt;item&gt;
+            &lt;widget class=&quot;QCheckBox&quot; name=&quot;checkEmerg&quot;&gt;
+             &lt;property name=&quot;text&quot;&gt;
+              &lt;string&gt;Console&lt;/string&gt;
+             &lt;/property&gt;
+             &lt;property name=&quot;checked&quot;&gt;
+              &lt;bool&gt;true&lt;/bool&gt;
+             &lt;/property&gt;
+            &lt;/widget&gt;
+           &lt;/item&gt;
+           &lt;item&gt;
+            &lt;widget class=&quot;QCheckBox&quot; name=&quot;checkAlert&quot;&gt;
+             &lt;property name=&quot;text&quot;&gt;
+              &lt;string&gt;Alert&lt;/string&gt;
+             &lt;/property&gt;
+             &lt;property name=&quot;checked&quot;&gt;
+              &lt;bool&gt;true&lt;/bool&gt;
+             &lt;/property&gt;
+            &lt;/widget&gt;
+           &lt;/item&gt;
+           &lt;item&gt;
+            &lt;widget class=&quot;QCheckBox&quot; name=&quot;checkCrit&quot;&gt;
+             &lt;property name=&quot;text&quot;&gt;
+              &lt;string&gt;Critical&lt;/string&gt;
+             &lt;/property&gt;
+             &lt;property name=&quot;checked&quot;&gt;
+              &lt;bool&gt;true&lt;/bool&gt;
+             &lt;/property&gt;
+            &lt;/widget&gt;
+           &lt;/item&gt;
+           &lt;item&gt;
+            &lt;widget class=&quot;QCheckBox&quot; name=&quot;checkError&quot;&gt;
+             &lt;property name=&quot;text&quot;&gt;
+              &lt;string&gt;Error&lt;/string&gt;
+             &lt;/property&gt;
+             &lt;property name=&quot;checked&quot;&gt;
+              &lt;bool&gt;true&lt;/bool&gt;
+             &lt;/property&gt;
+            &lt;/widget&gt;
+           &lt;/item&gt;
+           &lt;item&gt;
+            &lt;widget class=&quot;QCheckBox&quot; name=&quot;checkWarn&quot;&gt;
+             &lt;property name=&quot;text&quot;&gt;
+              &lt;string&gt;Warning&lt;/string&gt;
+             &lt;/property&gt;
+             &lt;property name=&quot;checked&quot;&gt;
+              &lt;bool&gt;true&lt;/bool&gt;
+             &lt;/property&gt;
+            &lt;/widget&gt;
+           &lt;/item&gt;
+           &lt;item&gt;
+            &lt;widget class=&quot;QCheckBox&quot; name=&quot;checkNotice&quot;&gt;
+             &lt;property name=&quot;text&quot;&gt;
+              &lt;string&gt;Notice&lt;/string&gt;
+             &lt;/property&gt;
+             &lt;property name=&quot;checked&quot;&gt;
+              &lt;bool&gt;true&lt;/bool&gt;
+             &lt;/property&gt;
+            &lt;/widget&gt;
+           &lt;/item&gt;
+           &lt;item&gt;
+            &lt;widget class=&quot;QCheckBox&quot; name=&quot;checkInfo&quot;&gt;
+             &lt;property name=&quot;text&quot;&gt;
+              &lt;string&gt;Info&lt;/string&gt;
+             &lt;/property&gt;
+             &lt;property name=&quot;checked&quot;&gt;
+              &lt;bool&gt;true&lt;/bool&gt;
+             &lt;/property&gt;
+            &lt;/widget&gt;
+           &lt;/item&gt;
+           &lt;item&gt;
+            &lt;widget class=&quot;QCheckBox&quot; name=&quot;checkDebug&quot;&gt;
+             &lt;property name=&quot;text&quot;&gt;
+              &lt;string&gt;Debug&lt;/string&gt;
+             &lt;/property&gt;
+             &lt;property name=&quot;checked&quot;&gt;
+              &lt;bool&gt;true&lt;/bool&gt;
+             &lt;/property&gt;
+            &lt;/widget&gt;
+           &lt;/item&gt;
+           &lt;item&gt;
+            &lt;spacer name=&quot;verticalSpacer&quot;&gt;
+             &lt;property name=&quot;orientation&quot;&gt;
+              &lt;enum&gt;Qt::Vertical&lt;/enum&gt;
+             &lt;/property&gt;
+             &lt;property name=&quot;sizeHint&quot; stdset=&quot;0&quot;&gt;
+              &lt;size&gt;
+               &lt;width&gt;20&lt;/width&gt;
+               &lt;height&gt;18&lt;/height&gt;
+              &lt;/size&gt;
+             &lt;/property&gt;
+            &lt;/spacer&gt;
+           &lt;/item&gt;
+          &lt;/layout&gt;
+         &lt;/widget&gt;
+        &lt;/item&gt;
+        &lt;item&gt;
+         &lt;widget class=&quot;Line&quot; name=&quot;line&quot;&gt;
+          &lt;property name=&quot;orientation&quot;&gt;
+           &lt;enum&gt;Qt::Horizontal&lt;/enum&gt;
+          &lt;/property&gt;
+         &lt;/widget&gt;
+        &lt;/item&gt;
+        &lt;item&gt;
+         &lt;widget class=&quot;QGroupBox&quot; name=&quot;groupBox_3&quot;&gt;
+          &lt;property name=&quot;maximumSize&quot;&gt;
+           &lt;size&gt;
+            &lt;width&gt;120&lt;/width&gt;
+            &lt;height&gt;16777215&lt;/height&gt;
+           &lt;/size&gt;
+          &lt;/property&gt;
+          &lt;property name=&quot;title&quot;&gt;
+           &lt;string&gt;Loglevel&lt;/string&gt;
+          &lt;/property&gt;
+          &lt;layout class=&quot;QGridLayout&quot; name=&quot;gridLayout&quot;&gt;
+           &lt;item row=&quot;0&quot; column=&quot;0&quot;&gt;
+            &lt;widget class=&quot;QComboBox&quot; name=&quot;comboLogLevel&quot;&gt;
+             &lt;property name=&quot;enabled&quot;&gt;
+              &lt;bool&gt;true&lt;/bool&gt;
+             &lt;/property&gt;
+             &lt;property name=&quot;sizePolicy&quot;&gt;
+              &lt;sizepolicy hsizetype=&quot;Preferred&quot; vsizetype=&quot;Fixed&quot;&gt;
+               &lt;horstretch&gt;0&lt;/horstretch&gt;
+               &lt;verstretch&gt;0&lt;/verstretch&gt;
+              &lt;/sizepolicy&gt;
+             &lt;/property&gt;
+             &lt;property name=&quot;layoutDirection&quot;&gt;
+              &lt;enum&gt;Qt::LeftToRight&lt;/enum&gt;
+             &lt;/property&gt;
+             &lt;property name=&quot;currentIndex&quot;&gt;
+              &lt;number&gt;7&lt;/number&gt;
+             &lt;/property&gt;
+             &lt;item&gt;
+              &lt;property name=&quot;text&quot;&gt;
+               &lt;string&gt;Console&lt;/string&gt;
+              &lt;/property&gt;
+             &lt;/item&gt;
+             &lt;item&gt;
+              &lt;property name=&quot;text&quot;&gt;
+               &lt;string&gt;Alert&lt;/string&gt;
+              &lt;/property&gt;
+             &lt;/item&gt;
+             &lt;item&gt;
+              &lt;property name=&quot;text&quot;&gt;
+               &lt;string&gt;Critical&lt;/string&gt;
+              &lt;/property&gt;
+             &lt;/item&gt;
+             &lt;item&gt;
+              &lt;property name=&quot;text&quot;&gt;
+               &lt;string&gt;Error&lt;/string&gt;
+              &lt;/property&gt;
+             &lt;/item&gt;
+             &lt;item&gt;
+              &lt;property name=&quot;text&quot;&gt;
+               &lt;string&gt;Warning&lt;/string&gt;
+              &lt;/property&gt;
+             &lt;/item&gt;
+             &lt;item&gt;
+              &lt;property name=&quot;text&quot;&gt;
+               &lt;string&gt;Notice&lt;/string&gt;
+              &lt;/property&gt;
+             &lt;/item&gt;
+             &lt;item&gt;
+              &lt;property name=&quot;text&quot;&gt;
+               &lt;string&gt;Info&lt;/string&gt;
+              &lt;/property&gt;
+             &lt;/item&gt;
+             &lt;item&gt;
+              &lt;property name=&quot;text&quot;&gt;
+               &lt;string&gt;Debug&lt;/string&gt;
+              &lt;/property&gt;
+             &lt;/item&gt;
+            &lt;/widget&gt;
+           &lt;/item&gt;
+          &lt;/layout&gt;
+         &lt;/widget&gt;
+        &lt;/item&gt;
+       &lt;/layout&gt;
+      &lt;/widget&gt;
+      &lt;widget class=&quot;QTableView&quot; name=&quot;consoleListView&quot;&gt;
+       &lt;property name=&quot;autoScroll&quot;&gt;
+        &lt;bool&gt;false&lt;/bool&gt;
+       &lt;/property&gt;
+       &lt;property name=&quot;editTriggers&quot;&gt;
+        &lt;set&gt;QAbstractItemView::NoEditTriggers&lt;/set&gt;
+       &lt;/property&gt;
+       &lt;property name=&quot;tabKeyNavigation&quot;&gt;
+        &lt;bool&gt;false&lt;/bool&gt;
+       &lt;/property&gt;
+       &lt;property name=&quot;showDropIndicator&quot; stdset=&quot;0&quot;&gt;
+        &lt;bool&gt;false&lt;/bool&gt;
+       &lt;/property&gt;
+       &lt;property name=&quot;dragDropOverwriteMode&quot;&gt;
+        &lt;bool&gt;false&lt;/bool&gt;
+       &lt;/property&gt;
+       &lt;property name=&quot;selectionMode&quot;&gt;
+        &lt;enum&gt;QAbstractItemView::ExtendedSelection&lt;/enum&gt;
+       &lt;/property&gt;
+       &lt;property name=&quot;horizontalScrollMode&quot;&gt;
+        &lt;enum&gt;QAbstractItemView::ScrollPerPixel&lt;/enum&gt;
+       &lt;/property&gt;
+       &lt;property name=&quot;showGrid&quot;&gt;
+        &lt;bool&gt;false&lt;/bool&gt;
+       &lt;/property&gt;
+       &lt;property name=&quot;wordWrap&quot;&gt;
+        &lt;bool&gt;false&lt;/bool&gt;
+       &lt;/property&gt;
+       &lt;property name=&quot;cornerButtonEnabled&quot;&gt;
+        &lt;bool&gt;false&lt;/bool&gt;
+       &lt;/property&gt;
+       &lt;attribute name=&quot;horizontalHeaderVisible&quot;&gt;
+        &lt;bool&gt;false&lt;/bool&gt;
+       &lt;/attribute&gt;
+       &lt;attribute name=&quot;horizontalHeaderCascadingSectionResizes&quot;&gt;
+        &lt;bool&gt;false&lt;/bool&gt;
+       &lt;/attribute&gt;
+       &lt;attribute name=&quot;horizontalHeaderHighlightSections&quot;&gt;
+        &lt;bool&gt;false&lt;/bool&gt;
+       &lt;/attribute&gt;
+       &lt;attribute name=&quot;horizontalHeaderShowSortIndicator&quot; stdset=&quot;0&quot;&gt;
+        &lt;bool&gt;false&lt;/bool&gt;
+       &lt;/attribute&gt;
+       &lt;attribute name=&quot;horizontalHeaderStretchLastSection&quot;&gt;
+        &lt;bool&gt;false&lt;/bool&gt;
+       &lt;/attribute&gt;
+       &lt;attribute name=&quot;verticalHeaderVisible&quot;&gt;
+        &lt;bool&gt;false&lt;/bool&gt;
+       &lt;/attribute&gt;
+       &lt;attribute name=&quot;verticalHeaderCascadingSectionResizes&quot;&gt;
+        &lt;bool&gt;false&lt;/bool&gt;
+       &lt;/attribute&gt;
+       &lt;attribute name=&quot;verticalHeaderDefaultSectionSize&quot;&gt;
+        &lt;number&gt;20&lt;/number&gt;
+       &lt;/attribute&gt;
+       &lt;attribute name=&quot;verticalHeaderHighlightSections&quot;&gt;
+        &lt;bool&gt;false&lt;/bool&gt;
+       &lt;/attribute&gt;
+       &lt;attribute name=&quot;verticalHeaderShowSortIndicator&quot; stdset=&quot;0&quot;&gt;
+        &lt;bool&gt;false&lt;/bool&gt;
+       &lt;/attribute&gt;
+       &lt;attribute name=&quot;verticalHeaderStretchLastSection&quot;&gt;
+        &lt;bool&gt;false&lt;/bool&gt;
+       &lt;/attribute&gt;
+      &lt;/widget&gt;
+     &lt;/widget&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;property name=&quot;enabled&quot;&gt;
+         &lt;bool&gt;true&lt;/bool&gt;
+        &lt;/property&gt;
+        &lt;property name=&quot;maximumSize&quot;&gt;
+         &lt;size&gt;
+          &lt;width&gt;16777215&lt;/width&gt;
+          &lt;height&gt;26&lt;/height&gt;
+         &lt;/size&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;minimumSize&quot;&gt;
+         &lt;size&gt;
+          &lt;width&gt;0&lt;/width&gt;
+          &lt;height&gt;28&lt;/height&gt;
+         &lt;/size&gt;
+        &lt;/property&gt;
+        &lt;property name=&quot;maximumSize&quot;&gt;
+         &lt;size&gt;
+          &lt;width&gt;85&lt;/width&gt;
+          &lt;height&gt;28&lt;/height&gt;
+         &lt;/size&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;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;widget class=&quot;QMenuBar&quot; name=&quot;menubar&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;696&lt;/width&gt;
+     &lt;height&gt;24&lt;/height&gt;
+    &lt;/rect&gt;
+   &lt;/property&gt;
+  &lt;/widget&gt;
+  &lt;widget class=&quot;QStatusBar&quot; name=&quot;statusbar&quot;/&gt;
+ &lt;/widget&gt;
+ &lt;resources/&gt;
+ &lt;connections/&gt;
+&lt;/ui&gt;
</ins></span></pre></div>
<a id="freeswitchtrunkfscommdebugtoolssortfilterproxymodelcpp"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/fscomm/debugtools/sortfilterproxymodel.cpp (0 => 17232)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/debugtools/sortfilterproxymodel.cpp                                (rev 0)
+++ freeswitch/trunk/fscomm/debugtools/sortfilterproxymodel.cpp        2010-04-07 05:05:03 UTC (rev 17232)
</span><span class="lines">@@ -0,0 +1,116 @@
</span><ins>+#include &lt;QtGui&gt;
+#include &quot;sortfilterproxymodel.h&quot;
+
+ConsoleModel::ConsoleModel (QObject *parent)
+        : QAbstractTableModel(parent)
+{
+    QSettings settings;
+    batchSize = settings.value(&quot;Console/batchSize&quot;, 200).toInt();
+    insertionTimer = new QBasicTimer;
+    insertionTimer-&gt;start(0, this);
+}
+
+int ConsoleModel::rowCount ( const QModelIndex &amp; parent ) const
+{
+    if (parent.isValid())
+        return 0;
+    return _listDisplayModel.count();
+}
+
+int ConsoleModel::columnCount ( const QModelIndex &amp; /*parent*/ ) const
+{
+    return 1;
+}
+
+QVariant ConsoleModel::data ( const QModelIndex &amp; index, int role ) const
+{
+    if (!index.isValid())
+        return QVariant();
+    return _listDisplayModel.at(index.row())-&gt;data(role);
+}
+
+void ConsoleModel::clear()
+{
+    _listDisplayModel.clear();
+    reset();
+}
+
+void ConsoleModel::appendRow ( QStandardItem* item )
+{
+    _listInsertModel.append(item);
+    insertionTimer-&gt;start(0, this);
+}
+
+void ConsoleModel::timerEvent(QTimerEvent *e)
+{
+
+    if (e-&gt;timerId() == insertionTimer-&gt;timerId())
+    {
+        if (!_listInsertModel.isEmpty())
+        {
+            int inserted_items = 0;
+            int toBeInserted = 0;
+            if (_listInsertModel.size() &lt; batchSize)
+            {
+                toBeInserted = _listInsertModel.size() - 1;
+            } else {
+                 toBeInserted = batchSize - 1;
+            }
+            emit beforeInserting();
+            beginInsertRows( QModelIndex(), _listDisplayModel.size(), _listDisplayModel.size() + toBeInserted );
+            while( !_listInsertModel.isEmpty() &amp;&amp; inserted_items &lt;= batchSize)
+            {
+                _listDisplayModel.append(_listInsertModel.takeFirst());
+                inserted_items++;
+            }
+            endInsertRows();
+            emit afterInserting();
+        } else {
+            insertionTimer-&gt;stop();
+        }
+    }
+}
+
+SortFilterProxyModel::SortFilterProxyModel(QObject *parent)
+        : QSortFilterProxyModel(parent)
+{
+    reverseFlag = false;
+    for(int i = 0; i &lt; 8; i++)
+        loglevels.insert(i, true);
+}
+
+void SortFilterProxyModel::toggleReverseFlag()
+{
+    reverseFlag = !reverseFlag;
+    invalidateFilter();
+}
+
+void SortFilterProxyModel::setLogLevelFilter(int level)
+{
+    loglevels.replace(level, loglevels.value(level) == false);
+    // Let us filter
+    invalidateFilter();
+}
+
+void SortFilterProxyModel::setUUIDFilterLog(QString uuid)
+{
+    _uuid = uuid;
+    invalidateFilter();
+}
+
+bool SortFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex &amp;source_parent) const
+{
+    QModelIndex index0 = sourceModel()-&gt;index(source_row, 0, source_parent);
+    bool uuidMatch = true;
+
+    if (!_uuid.isEmpty())
+        uuidMatch = (sourceModel()-&gt;data(index0, ConsoleModel::UUIDRole).toString() == _uuid);
+
+    bool res = (loglevels.value(sourceModel()-&gt;data(index0, Qt::UserRole).toInt()) == true
+            &amp;&amp; sourceModel()-&gt;data(index0).toString().contains(filterRegExp())
+            &amp;&amp; uuidMatch);
+    if (reverseFlag)
+        return !res;
+    else
+        return res;
+}
</ins></span></pre></div>
<a id="freeswitchtrunkfscommdebugtoolssortfilterproxymodelh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/fscomm/debugtools/sortfilterproxymodel.h (0 => 17232)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/debugtools/sortfilterproxymodel.h                                (rev 0)
+++ freeswitch/trunk/fscomm/debugtools/sortfilterproxymodel.h        2010-04-07 05:05:03 UTC (rev 17232)
</span><span class="lines">@@ -0,0 +1,97 @@
</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) freeswitch.org&gt;
+ *
+ */
+#ifndef SORTFILTERPROXYMODEL_H
+#define SORTFILTERPROXYMODEL_H
+
+#include &lt;QSortFilterProxyModel&gt;
+#include &lt;QAbstractTableModel&gt;
+#include &lt;QVector&gt;
+#include &lt;QList&gt;
+
+class QBasicTimer;
+class QStandardItem;
+class QScrollBar;
+
+class ConsoleModel : public QAbstractTableModel
+{
+    Q_OBJECT
+public:
+    ConsoleModel (QObject *parent = 0);
+    int rowCount ( const QModelIndex &amp; parent = QModelIndex() ) const;
+    int columnCount ( const QModelIndex &amp; parent = QModelIndex() ) const;
+    QVariant data ( const QModelIndex &amp; index, int role = Qt::DisplayRole ) const;
+    void appendRow ( QStandardItem* item );
+    void clear();
+    QList&lt;QStandardItem *&gt; modelData() { return _listDisplayModel; }
+
+    enum {
+        LogLevelRole = Qt::UserRole,
+        UUIDRole
+    };
+signals:
+    void beforeInserting();
+    void afterInserting();
+protected:
+    void timerEvent(QTimerEvent *);
+private:
+    QList&lt;QStandardItem *&gt; _listDisplayModel;
+    QList&lt;QStandardItem *&gt; _listInsertModel;
+    int batchSize;
+    QBasicTimer *insertionTimer;
+};
+
+class SortFilterProxyModel : public QSortFilterProxyModel
+{
+    Q_OBJECT
+
+public:
+    SortFilterProxyModel(QObject *parent = 0);
+    void setLogLevelFilter(int level);
+    void setUUIDFilterLog(QString uuid);
+    void toggleReverseFlag();
+
+protected:
+    bool filterAcceptsRow(int source_row, const QModelIndex &amp;source_parent) const;
+
+private:
+    QVector&lt;bool&gt; loglevels;
+    QString _uuid;
+    bool reverseFlag;
+};
+
+#endif // SORTFILTERPROXYMODEL_H
</ins></span></pre></div>
<a id="freeswitchtrunkfscommdebugtoolsstatedebugdialogcpp"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/fscomm/debugtools/statedebugdialog.cpp (0 => 17232)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/debugtools/statedebugdialog.cpp                                (rev 0)
+++ freeswitch/trunk/fscomm/debugtools/statedebugdialog.cpp        2010-04-07 05:05:03 UTC (rev 17232)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+#include &quot;statedebugdialog.h&quot;
+#include &quot;ui_statedebugdialog.h&quot;
+
+StateDebugDialog::StateDebugDialog(QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::StateDebugDialog)
+{
+    ui-&gt;setupUi(this);
+    connect(&amp;g_FSHost, SIGNAL(newEvent(QSharedPointer&lt;switch_event_t&gt;)), this, SLOT(newEvent(QSharedPointer&lt;switch_event_t&gt;)));
+    connect(ui-&gt;listUUID, SIGNAL(itemSelectionChanged()), this, SLOT(currentUuidChanged()));
+    connect(ui-&gt;listEvents, SIGNAL(itemSelectionChanged()), this, SLOT(currentEventsChanged()));
+}
+
+StateDebugDialog::~StateDebugDialog()
+{
+    delete ui;
+}
+
+void StateDebugDialog::changeEvent(QEvent *e)
+{
+    QDialog::changeEvent(e);
+    switch (e-&gt;type()) {
+    case QEvent::LanguageChange:
+        ui-&gt;retranslateUi(this);
+        break;
+    default:
+        break;
+    }
+}
+
+void StateDebugDialog::newEvent(QSharedPointer&lt;switch_event_t&gt;event)
+{
+    /* We don't want to keep track of events that are not calls at this moment */
+    if (QString(switch_event_get_header_nil(event.data(), &quot;Unique-ID&quot;)).isEmpty())
+        return;
+
+    QString uuid(switch_event_get_header_nil(event.data(), &quot;Unique-ID&quot;));
+
+    if (!_events.contains(uuid))
+    {
+        QList&lt;QSharedPointer&lt;switch_event_t&gt; &gt; tmpListEvents;
+        tmpListEvents.append(event);
+        _events.insert(uuid, tmpListEvents);
+        ui-&gt;listUUID-&gt;addItem(new QListWidgetItem(uuid));
+    }
+    else
+    {
+        QList&lt;QSharedPointer&lt;switch_event_t&gt; &gt; tmpListEvents = _events.value(uuid);
+        tmpListEvents.append(event);
+        _events.insert(uuid, tmpListEvents);
+    }
+}
+
+void StateDebugDialog::currentUuidChanged()
+{;
+    ui-&gt;listEvents-&gt;clear();
+    ui-&gt;listDetails-&gt;clear();
+    QString uuid = ui-&gt;listUUID-&gt;currentItem()-&gt;text();
+    foreach(QSharedPointer&lt;switch_event_t&gt; e, _events.value(uuid))
+    {
+        ui-&gt;listEvents-&gt;addItem(new QListWidgetItem(switch_event_name(e.data()-&gt;event_id)));
+    }
+}
+
+void StateDebugDialog::currentEventsChanged()
+{
+    ui-&gt;listDetails-&gt;clear();
+    int r = ui-&gt;listEvents-&gt;currentRow();
+    QString uuid = ui-&gt;listUUID-&gt;currentItem()-&gt;text();
+    QList&lt;QSharedPointer&lt;switch_event_t&gt; &gt; tmpListEvents = _events.value(uuid);
+    QSharedPointer&lt;switch_event_t&gt; e = tmpListEvents.at(r);
+    for(switch_event_header_t* h = e.data()-&gt;headers; h != e.data()-&gt;last_header; h = h-&gt;next)
+    {
+        ui-&gt;listDetails-&gt;addItem(new QListWidgetItem(QString(&quot;%1 = %2&quot;).arg(h-&gt;name, h-&gt;value)));
+    }
+}
</ins></span></pre></div>
<a id="freeswitchtrunkfscommdebugtoolsstatedebugdialogh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/fscomm/debugtools/statedebugdialog.h (0 => 17232)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/debugtools/statedebugdialog.h                                (rev 0)
+++ freeswitch/trunk/fscomm/debugtools/statedebugdialog.h        2010-04-07 05:05:03 UTC (rev 17232)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+#ifndef STATEDEBUGDIALOG_H
+#define STATEDEBUGDIALOG_H
+
+#include &lt;QtGui&gt;
+#include &quot;fshost.h&quot;
+
+namespace Ui {
+    class StateDebugDialog;
+}
+
+class StateDebugDialog : public QDialog {
+    Q_OBJECT
+public:
+    StateDebugDialog(QWidget *parent = 0);
+    ~StateDebugDialog();
+
+private slots:
+    void newEvent(QSharedPointer&lt;switch_event_t&gt; event);
+    void currentUuidChanged();
+    void currentEventsChanged();
+
+protected:
+    void changeEvent(QEvent *e);
+
+private:
+    Ui::StateDebugDialog *ui;
+    QHash&lt;QString, QList&lt;QSharedPointer&lt;switch_event_t&gt; &gt; &gt; _events;
+};
+
+#endif // STATEDEBUGDIALOG_H
</ins></span></pre></div>
<a id="freeswitchtrunkfscommdebugtoolsstatedebugdialogui"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/fscomm/debugtools/statedebugdialog.ui (0 => 17232)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/debugtools/statedebugdialog.ui                                (rev 0)
+++ freeswitch/trunk/fscomm/debugtools/statedebugdialog.ui        2010-04-07 05:05:03 UTC (rev 17232)
</span><span class="lines">@@ -0,0 +1,79 @@
</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;StateDebugDialog&lt;/class&gt;
+ &lt;widget class=&quot;QDialog&quot; name=&quot;StateDebugDialog&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;804&lt;/width&gt;
+    &lt;height&gt;235&lt;/height&gt;
+   &lt;/rect&gt;
+  &lt;/property&gt;
+  &lt;property name=&quot;windowTitle&quot;&gt;
+   &lt;string&gt;Debug Events&lt;/string&gt;
+  &lt;/property&gt;
+  &lt;layout class=&quot;QVBoxLayout&quot; name=&quot;verticalLayout_4&quot;&gt;
+   &lt;item&gt;
+    &lt;widget class=&quot;QSplitter&quot; name=&quot;splitter&quot;&gt;
+     &lt;property name=&quot;orientation&quot;&gt;
+      &lt;enum&gt;Qt::Horizontal&lt;/enum&gt;
+     &lt;/property&gt;
+     &lt;widget class=&quot;QWidget&quot; name=&quot;layoutWidget&quot;&gt;
+      &lt;layout class=&quot;QVBoxLayout&quot; name=&quot;verticalLayout_3&quot;&gt;
+       &lt;item&gt;
+        &lt;widget class=&quot;QLabel&quot; name=&quot;label&quot;&gt;
+         &lt;property name=&quot;text&quot;&gt;
+          &lt;string&gt;UUID&lt;/string&gt;
+         &lt;/property&gt;
+         &lt;property name=&quot;alignment&quot;&gt;
+          &lt;set&gt;Qt::AlignCenter&lt;/set&gt;
+         &lt;/property&gt;
+        &lt;/widget&gt;
+       &lt;/item&gt;
+       &lt;item&gt;
+        &lt;widget class=&quot;QListWidget&quot; name=&quot;listUUID&quot;/&gt;
+       &lt;/item&gt;
+      &lt;/layout&gt;
+     &lt;/widget&gt;
+     &lt;widget class=&quot;QWidget&quot; name=&quot;layoutWidget&quot;&gt;
+      &lt;layout class=&quot;QVBoxLayout&quot; name=&quot;verticalLayout_2&quot;&gt;
+       &lt;item&gt;
+        &lt;widget class=&quot;QLabel&quot; name=&quot;label_2&quot;&gt;
+         &lt;property name=&quot;text&quot;&gt;
+          &lt;string&gt;EVENTS&lt;/string&gt;
+         &lt;/property&gt;
+         &lt;property name=&quot;alignment&quot;&gt;
+          &lt;set&gt;Qt::AlignCenter&lt;/set&gt;
+         &lt;/property&gt;
+        &lt;/widget&gt;
+       &lt;/item&gt;
+       &lt;item&gt;
+        &lt;widget class=&quot;QListWidget&quot; name=&quot;listEvents&quot;/&gt;
+       &lt;/item&gt;
+      &lt;/layout&gt;
+     &lt;/widget&gt;
+     &lt;widget class=&quot;QWidget&quot; name=&quot;layoutWidget&quot;&gt;
+      &lt;layout class=&quot;QVBoxLayout&quot; name=&quot;verticalLayout&quot;&gt;
+       &lt;item&gt;
+        &lt;widget class=&quot;QLabel&quot; name=&quot;label_3&quot;&gt;
+         &lt;property name=&quot;text&quot;&gt;
+          &lt;string&gt;DETAILS&lt;/string&gt;
+         &lt;/property&gt;
+         &lt;property name=&quot;alignment&quot;&gt;
+          &lt;set&gt;Qt::AlignCenter&lt;/set&gt;
+         &lt;/property&gt;
+        &lt;/widget&gt;
+       &lt;/item&gt;
+       &lt;item&gt;
+        &lt;widget class=&quot;QListWidget&quot; name=&quot;listDetails&quot;/&gt;
+       &lt;/item&gt;
+      &lt;/layout&gt;
+     &lt;/widget&gt;
+    &lt;/widget&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="freeswitchtrunkfscommfshostcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/fshost.cpp (17231 => 17232)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/fshost.cpp        2010-04-06 20:03:57 UTC (rev 17231)
+++ freeswitch/trunk/fscomm/fshost.cpp        2010-04-07 05:05:03 UTC (rev 17232)
</span><span class="lines">@@ -43,7 +43,10 @@
</span><span class="cx">     switch_core_set_globals();
</span><span class="cx"> 
</span><span class="cx">     qRegisterMetaType&lt;QSharedPointer&lt;Call&gt; &gt;(&quot;QSharedPointer&lt;Call&gt;&quot;);
</span><del>-    qRegisterMetaType&lt;QSharedPointer&lt;Call&gt; &gt;(&quot;QSharedPointer&lt;Channel&gt;&quot;);
</del><ins>+    qRegisterMetaType&lt;QSharedPointer&lt;switch_event_t&gt; &gt;(&quot;QSharedPointer&lt;switch_event_t&gt;&quot;);
+    qRegisterMetaType&lt;QSharedPointer&lt;switch_log_node_t&gt; &gt;(&quot;QSharedPointer&lt;switch_log_node_t&gt;&quot;);
+    qRegisterMetaType&lt;switch_log_level_t&gt;(&quot;switch_log_level_t&quot;);
+    qRegisterMetaType&lt;QSharedPointer&lt;Channel&gt; &gt;(&quot;QSharedPointer&lt;Channel&gt;&quot;);
</ins><span class="cx">     qRegisterMetaType&lt;QSharedPointer&lt;Account&gt; &gt;(&quot;QSharedPointer&lt;Account&gt;&quot;);
</span><span class="cx"> 
</span><span class="cx">     connect(this, SIGNAL(loadedModule(QString,QString)), this, SLOT(minimalModuleLoaded(QString,QString)));
</span><span class="lines">@@ -115,6 +118,11 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void FSHost::generalLoggerHandler(QSharedPointer&lt;switch_log_node_t&gt;node, switch_log_level_t level)
+{
+    emit eventLog(node, level);
+}
+
</ins><span class="cx"> void FSHost::run(void)
</span><span class="cx"> {
</span><span class="cx">     switch_core_flag_t flags = SCF_USE_SQL | SCF_USE_AUTO_NAT;
</span><span class="lines">@@ -150,6 +158,7 @@
</span><span class="cx">         emit coreLoadingError(err);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    switch_log_bind_logger(loggerHandler, SWITCH_LOG_DEBUG, SWITCH_FALSE);
</ins><span class="cx">     emit ready();
</span><span class="cx"> 
</span><span class="cx">     /* Go into the runtime loop. If the argument is true, this basically sets runtime.running = 1 and loops while that is set
</span><span class="lines">@@ -172,6 +181,8 @@
</span><span class="cx"> {
</span><span class="cx">     QString uuid = switch_event_get_header_nil(event.data(), &quot;Unique-ID&quot;);
</span><span class="cx"> 
</span><ins>+    emit newEvent(event);
+
</ins><span class="cx">     switch(event.data()-&gt;event_id) {
</span><span class="cx">     case SWITCH_EVENT_CHANNEL_CREATE: /*1A - 17B*/
</span><span class="cx">         {
</span></span></pre></div>
<a id="freeswitchtrunkfscommfshosth"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/fshost.h (17231 => 17232)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/fshost.h        2010-04-06 20:03:57 UTC (rev 17231)
+++ freeswitch/trunk/fscomm/fshost.h        2010-04-07 05:05:03 UTC (rev 17232)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx">     explicit FSHost(QObject *parent = 0);
</span><span class="cx">     switch_status_t sendCmd(const char *cmd, const char *args, QString *res);
</span><span class="cx">     void generalEventHandler(QSharedPointer&lt;switch_event_t&gt;event);
</span><ins>+    void generalLoggerHandler(QSharedPointer&lt;switch_log_node_t&gt;node, switch_log_level_t level);
</ins><span class="cx">     QSharedPointer&lt;Call&gt; getCallByUUID(QString uuid) { return _active_calls.value(uuid); }
</span><span class="cx">     QSharedPointer&lt;Call&gt; getCurrentActiveCall();
</span><span class="cx">     QList&lt;QSharedPointer&lt;Account&gt; &gt; getAccounts() { return _accounts.values(); }
</span><span class="lines">@@ -64,6 +65,11 @@
</span><span class="cx">     void loadedModule(QString, QString);
</span><span class="cx">     void ready(void);
</span><span class="cx"> 
</span><ins>+
+    /* Logging signals */
+    void eventLog(QSharedPointer&lt;switch_log_node_t&gt;, switch_log_level_t);
+    void newEvent(QSharedPointer&lt;switch_event_t&gt;);
+
</ins><span class="cx">     /* Call signals */
</span><span class="cx">     void ringing(QSharedPointer&lt;Call&gt;);
</span><span class="cx">     void answered(QSharedPointer&lt;Call&gt;);
</span><span class="lines">@@ -121,7 +127,7 @@
</span><span class="cx"> /*
</span><span class="cx">    Used to match callback from fs core. We dup the event and call the class
</span><span class="cx">    method callback to make use of the signal/slot infrastructure.
</span><del>-*/
</del><ins>+  */
</ins><span class="cx"> static void eventHandlerCallback(switch_event_t *event)
</span><span class="cx"> {
</span><span class="cx">     switch_event_t *clone = NULL;
</span><span class="lines">@@ -131,4 +137,15 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+/*
+  Used to propagate logs on the application
+  */
+static switch_status_t loggerHandler(const switch_log_node_t *node, switch_log_level_t level)
+{
+    switch_log_node_t *clone = switch_log_node_dup(node);
+    QSharedPointer&lt;switch_log_node_t&gt; l(clone);
+    g_FSHost.generalLoggerHandler(l, level);
+    return SWITCH_STATUS_SUCCESS;
+}
+
</ins><span class="cx"> #endif // FSHOST_H
</span></span></pre></div>
<a id="freeswitchtrunkfscommmainwindowcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/mainwindow.cpp (17231 => 17232)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/mainwindow.cpp        2010-04-06 20:03:57 UTC (rev 17231)
+++ freeswitch/trunk/fscomm/mainwindow.cpp        2010-04-07 05:05:03 UTC (rev 17232)
</span><span class="lines">@@ -36,7 +36,10 @@
</span><span class="cx"> MainWindow::MainWindow(QWidget *parent) :
</span><span class="cx">     QMainWindow(parent),
</span><span class="cx">     ui(new Ui::MainWindow),
</span><del>-    preferences(NULL)
</del><ins>+    preferences(NULL),
+    _consoleWindow(NULL),
+    _stateDebugDialog(NULL)
+
</ins><span class="cx"> {
</span><span class="cx">     ui-&gt;setupUi(this);
</span><span class="cx"> 
</span><span class="lines">@@ -100,6 +103,8 @@
</span><span class="cx">     connect(ui-&gt;tableCalls, SIGNAL(itemDoubleClicked(QTableWidgetItem*)), this, SLOT(callTableDoubleClick(QTableWidgetItem*)));
</span><span class="cx">     connect(ui-&gt;action_Preferences, SIGNAL(triggered()), this, SLOT(prefTriggered()));
</span><span class="cx">     connect(ui-&gt;action_Exit, SIGNAL(triggered()), this, SLOT(close()));
</span><ins>+    connect(ui-&gt;actionConsole, SIGNAL(triggered()), this, SLOT(debugConsoleTriggered()));
+    connect(ui-&gt;actionEvents, SIGNAL(triggered()), this, SLOT(debugEventsTriggered()));
</ins><span class="cx">     connect(ui-&gt;actionAbout, SIGNAL(triggered()), this, SLOT(showAbout()));
</span><span class="cx">     connect(ui-&gt;actionSetDefaultAccount, SIGNAL(triggered(bool)), this, SLOT(setDefaultAccount()));
</span><span class="cx">     connect(sysTray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(sysTrayActivated(QSystemTrayIcon::ActivationReason)));
</span><span class="lines">@@ -151,6 +156,28 @@
</span><span class="cx">     settings.endGroup();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void MainWindow::debugEventsTriggered()
+{
+    if (!_stateDebugDialog)
+        _stateDebugDialog = new StateDebugDialog();
+
+    _stateDebugDialog-&gt;raise();
+    _stateDebugDialog-&gt;show();
+    _stateDebugDialog-&gt;activateWindow();
+}
+
+void MainWindow::debugConsoleTriggered()
+{
+
+    if (!_consoleWindow)
+        _consoleWindow = new ConsoleWindow();
+
+    _consoleWindow-&gt;raise();
+    _consoleWindow-&gt;show();
+    _consoleWindow-&gt;activateWindow();
+
+}
+
</ins><span class="cx"> void MainWindow::prefTriggered()
</span><span class="cx"> {
</span><span class="cx">     if (!preferences)
</span></span></pre></div>
<a id="freeswitchtrunkfscommmainwindowh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/mainwindow.h (17231 => 17232)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/mainwindow.h        2010-04-06 20:03:57 UTC (rev 17231)
+++ freeswitch/trunk/fscomm/mainwindow.h        2010-04-07 05:05:03 UTC (rev 17232)
</span><span class="lines">@@ -40,6 +40,8 @@
</span><span class="cx"> #include &lt;call.h&gt;
</span><span class="cx"> #include &lt;account.h&gt;
</span><span class="cx"> #include &quot;preferences/prefdialog.h&quot;
</span><ins>+#include &quot;debugtools/consolewindow.h&quot;
+#include &quot;debugtools/statedebugdialog.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace Ui {
</span><span class="cx">     class MainWindow;
</span><span class="lines">@@ -80,11 +82,15 @@
</span><span class="cx">     void accountStateChanged(QSharedPointer&lt;Account&gt;);
</span><span class="cx">     void sysTrayActivated(QSystemTrayIcon::ActivationReason reason);
</span><span class="cx">     void updateCallTimers();
</span><ins>+    void debugConsoleTriggered();
+    void debugEventsTriggered();
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     Ui::MainWindow *ui;
</span><span class="cx">     QSignalMapper *dialpadMapper;
</span><span class="cx">     PrefDialog *preferences;
</span><ins>+    ConsoleWindow *_consoleWindow;
+    StateDebugDialog * _stateDebugDialog;
</ins><span class="cx">     QSystemTrayIcon *sysTray;
</span><span class="cx">     QTimer *callTimer;
</span><span class="cx"> };
</span></span></pre></div>
<a id="freeswitchtrunkfscommmainwindowui"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/mainwindow.ui (17231 => 17232)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/mainwindow.ui        2010-04-06 20:03:57 UTC (rev 17231)
+++ freeswitch/trunk/fscomm/mainwindow.ui        2010-04-07 05:05:03 UTC (rev 17232)
</span><span class="lines">@@ -375,7 +375,21 @@
</span><span class="cx">     &lt;/property&gt;
</span><span class="cx">     &lt;addaction name=&quot;actionAbout&quot;/&gt;
</span><span class="cx">    &lt;/widget&gt;
</span><ins>+   &lt;widget class=&quot;QMenu&quot; name=&quot;menuTools&quot;&gt;
+    &lt;property name=&quot;title&quot;&gt;
+     &lt;string&gt;&amp;amp;Tools&lt;/string&gt;
+    &lt;/property&gt;
+    &lt;widget class=&quot;QMenu&quot; name=&quot;menuDebug&quot;&gt;
+     &lt;property name=&quot;title&quot;&gt;
+      &lt;string&gt;&amp;amp;Debug&lt;/string&gt;
+     &lt;/property&gt;
+     &lt;addaction name=&quot;actionConsole&quot;/&gt;
+     &lt;addaction name=&quot;actionEvents&quot;/&gt;
+    &lt;/widget&gt;
+    &lt;addaction name=&quot;menuDebug&quot;/&gt;
+   &lt;/widget&gt;
</ins><span class="cx">    &lt;addaction name=&quot;menu_File&quot;/&gt;
</span><ins>+   &lt;addaction name=&quot;menuTools&quot;/&gt;
</ins><span class="cx">    &lt;addaction name=&quot;menuHelp&quot;/&gt;
</span><span class="cx">   &lt;/widget&gt;
</span><span class="cx">   &lt;widget class=&quot;QToolBar&quot; name=&quot;mainToolBar&quot;&gt;
</span><span class="lines">@@ -410,6 +424,16 @@
</span><span class="cx">     &lt;string&gt;Set the default account for dialing out.&lt;/string&gt;
</span><span class="cx">    &lt;/property&gt;
</span><span class="cx">   &lt;/action&gt;
</span><ins>+  &lt;action name=&quot;actionConsole&quot;&gt;
+   &lt;property name=&quot;text&quot;&gt;
+    &lt;string&gt;Console&lt;/string&gt;
+   &lt;/property&gt;
+  &lt;/action&gt;
+  &lt;action name=&quot;actionEvents&quot;&gt;
+   &lt;property name=&quot;text&quot;&gt;
+    &lt;string&gt;Events&lt;/string&gt;
+   &lt;/property&gt;
+  &lt;/action&gt;
</ins><span class="cx">  &lt;/widget&gt;
</span><span class="cx">  &lt;layoutdefault spacing=&quot;6&quot; margin=&quot;11&quot;/&gt;
</span><span class="cx">  &lt;resources/&gt;
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>