<!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][14267] </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=14267">14267</a></dd>
<dt>Author</dt> <dd>jmesquita</dd>
<dt>Date</dt> <dd>2009-07-15 23:56:31 -0500 (Wed, 15 Jul 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre>Added a small combobox to easily change loglevel. We remember it after disconnection as well.</pre>
<h3>Modified 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="#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="#freeswitchtrunkcontribjmesquitafsguisrcincludeconsolepageh">freeswitch/trunk/contrib/jmesquita/fsgui/src/include/consolepage.h</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguisrcincludefs_guih">freeswitch/trunk/contrib/jmesquita/fsgui/src/include/fs_gui.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkcontribjmesquitafsguiresourcesconsolepageui"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/resources/consolepage.ui (14266 => 14267)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/resources/consolepage.ui        2009-07-16 03:41:59 UTC (rev 14266)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/resources/consolepage.ui        2009-07-16 04:56:31 UTC (rev 14267)
</span><span class="lines">@@ -6,10 +6,16 @@
</span><span class="cx"> <rect>
</span><span class="cx"> <x>0</x>
</span><span class="cx"> <y>0</y>
</span><del>- <width>274</width>
- <height>244</height>
</del><ins>+ <width>570</width>
+ <height>443</height>
</ins><span class="cx"> </rect>
</span><span class="cx"> </property>
</span><ins>+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
</ins><span class="cx"> <property name="windowTitle">
</span><span class="cx"> <string>consolePage</string>
</span><span class="cx"> </property>
</span><span class="lines">@@ -18,27 +24,87 @@
</span><span class="cx"> <widget class="QTextEdit" name="textConsole"/>
</span><span class="cx"> </item>
</span><span class="cx"> <item>
</span><del>- <layout class="QHBoxLayout" name="horizontalLayout">
</del><ins>+ <layout class="QHBoxLayout" name="horizontalLayout_2">
</ins><span class="cx"> <item>
</span><del>- <widget class="QLineEdit" name="lineCmd"/>
</del><ins>+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLineEdit" name="lineCmd"/>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btnSend">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Send</string>
+ </property>
+ <property name="shortcut">
+ <string>Return</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
</ins><span class="cx"> </item>
</span><span class="cx"> <item>
</span><del>- <widget class="QPushButton" name="btnSend">
- <property name="enabled">
- <bool>false</bool>
</del><ins>+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>LogLevel</string>
</ins><span class="cx"> </property>
</span><del>- <property name="text">
- <string>Send</string>
- </property>
- <property name="shortcut">
- <string>Return</string>
- </property>
- <property name="autoDefault">
- <bool>true</bool>
- </property>
- <property name="default">
- <bool>true</bool>
- </property>
</del><ins>+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QComboBox" name="comboLogLevel">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <item>
+ <property name="text">
+ <string>Console</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Alert</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Crit</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Err</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Warning</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Notice</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Info</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Debug</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
</ins><span class="cx"> </widget>
</span><span class="cx"> </item>
</span><span class="cx"> </layout>
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcconsolepagecpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/consolepage.cpp (14266 => 14267)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/consolepage.cpp        2009-07-16 03:41:59 UTC (rev 14266)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/consolepage.cpp        2009-07-16 04:56:31 UTC (rev 14267)
</span><span class="lines">@@ -46,16 +46,19 @@
</span><span class="cx"> m_ui(new Ui::consolePage)
</span><span class="cx"> {
</span><span class="cx"> m_ui->setupUi(this);
</span><ins>+ connect(m_ui->comboLogLevel, SIGNAL(currentIndexChanged(int)),
+ this, SLOT(loglevelChanged(int)));
</ins><span class="cx"> }
</span><span class="cx"> consolePage::~consolePage()
</span><span class="cx"> {
</span><del>- delete m_ui;
</del><ins>+ writeSettings();
</ins><span class="cx"> if (eslConnection->isRunning())
</span><span class="cx"> {
</span><span class="cx"> eslConnection->disconnect();
</span><span class="cx"> eslConnection->wait();
</span><span class="cx"> }
</span><span class="cx"> delete eslConnection;
</span><ins>+ delete m_ui;
</ins><span class="cx"> }
</span><span class="cx"> void consolePage::init(QString host)
</span><span class="cx"> {
</span><span class="lines">@@ -133,18 +136,22 @@
</span><span class="cx"> void consolePage::gotConnectedSlot()
</span><span class="cx"> {
</span><span class="cx"> appendConsoleText(tr("Connected!"));
</span><del>- m_ui->lineCmd->setEnabled(true);
</del><ins>+ m_ui->lineCmd->setEnabled(eslConnection->connected());
+ m_ui->comboLogLevel->setEnabled(eslConnection->connected());
</ins><span class="cx"> m_ui->lineCmd->setFocus();
</span><ins>+ readSettings();
</ins><span class="cx"> }
</span><span class="cx"> void consolePage::gotDisconnectedSlot()
</span><span class="cx"> {
</span><span class="cx"> appendConsoleText(tr("Disconnected!"));
</span><del>- m_ui->lineCmd->setDisabled(true);
</del><ins>+ m_ui->lineCmd->setEnabled(eslConnection->connected());
+ m_ui->comboLogLevel->setEnabled(eslConnection->connected());
</ins><span class="cx"> }
</span><span class="cx"> void consolePage::connectionFailedSlot(QString msg)
</span><span class="cx"> {
</span><span class="cx"> appendConsoleText("Connection Failed: "+msg);
</span><del>- m_ui->lineCmd->setDisabled(true);
</del><ins>+ m_ui->lineCmd->setEnabled(eslConnection->connected());
+ m_ui->comboLogLevel->setEnabled(eslConnection->connected());
</ins><span class="cx"> }
</span><span class="cx"> void consolePage::gotEventSlot(ESLevent * event)
</span><span class="cx"> {
</span><span class="lines">@@ -205,3 +212,35 @@
</span><span class="cx"> }
</span><span class="cx"> delete event;
</span><span class="cx"> }
</span><ins>+void consolePage::loglevelChanged(int loglevel)
+{
+ if (!eslConnection->connected())
+ {
+ appendConsoleText(QString("Cannot change loglevel if not connected."));
+ return;
+ }
+ ESLevent *event = eslConnection->sendRecv(QString("log %1").arg(loglevel).toAscii());
+ if (event)
+ {
+ appendConsoleText(QString("Changed loglevel to %1").arg(m_ui->comboLogLevel->currentText()));
+ }
+ else
+ {
+ appendConsoleText(QString("Could not change loglevel"));
+ }
+}
+void consolePage::readSettings()
+{
+ QString settingsApplication = "FSGui";
+ QString settingsOrganization = "FreeSWITCH";
+ QSettings settings(settingsOrganization, settingsApplication);
+ m_ui->comboLogLevel->setCurrentIndex(settings.value(QString("servers/%1/loglevel").arg(host)).toInt());
+}
+void consolePage::writeSettings()
+{
+ QString settingsApplication = "FSGui";
+ QString settingsOrganization = "FreeSWITCH";
+ QSettings settings(settingsOrganization, settingsApplication);
+ qDebug() << m_ui->comboLogLevel->currentIndex();
+ settings.setValue(QString("servers/%1/loglevel").arg(host), m_ui->comboLogLevel->currentIndex());
+}
</ins></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcesl_connectioncpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/esl_connection.cpp (14266 => 14267)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/esl_connection.cpp        2009-07-16 03:41:59 UTC (rev 14266)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/esl_connection.cpp        2009-07-16 04:56:31 UTC (rev 14267)
</span><span class="lines">@@ -77,7 +77,6 @@
</span><span class="cx">
</span><span class="cx"> if (esl_connect(&handle, _host->toAscii(), x_port, _pass->toAscii()) == ESL_SUCCESS)
</span><span class="cx"> {
</span><del>- sendRecv("log 7");
</del><span class="cx"> emit gotConnected();
</span><span class="cx"> }
</span><span class="cx"> start();
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcfs_guicpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/fs_gui.cpp (14266 => 14267)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/fs_gui.cpp        2009-07-16 03:41:59 UTC (rev 14266)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/fs_gui.cpp        2009-07-16 04:56:31 UTC (rev 14267)
</span><span class="lines">@@ -45,8 +45,9 @@
</span><span class="cx"> m_ui(new Ui::Cfsgui),
</span><span class="cx"> serverDialog(NULL)
</span><span class="cx"> {
</span><del>- m_ui->setupUi(this);
</del><span class="cx">
</span><ins>+ m_ui->setupUi(this);
+
</ins><span class="cx"> // Set the default status bar message
</span><span class="cx"> m_ui->statusBar->showMessage(tr("Ready"));
</span><span class="cx">
</span><span class="lines">@@ -58,6 +59,7 @@
</span><span class="cx"> this, SLOT(closeTab(int)));
</span><span class="cx">
</span><span class="cx"> m_ui->tabWidget->clear();
</span><ins>+ showMaximized();
</ins><span class="cx"> }
</span><span class="cx"> Cfsgui::~Cfsgui()
</span><span class="cx"> {
</span><span class="lines">@@ -86,7 +88,6 @@
</span><span class="cx"> }
</span><span class="cx"> void Cfsgui::closeEvent(QCloseEvent *e)
</span><span class="cx"> {
</span><del>- /* TODO: We have to stop threads and do cleanup */
</del><span class="cx"> e->accept();
</span><span class="cx"> }
</span><span class="cx"> void Cfsgui::newConnectionFromDialog()
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcincludeconsolepageh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/include/consolepage.h (14266 => 14267)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/include/consolepage.h        2009-07-16 03:41:59 UTC (rev 14266)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/include/consolepage.h        2009-07-16 04:56:31 UTC (rev 14267)
</span><span class="lines">@@ -31,7 +31,10 @@
</span><span class="cx"> void getDisconnectedSlot();
</span><span class="cx"> void typedCommand();
</span><span class="cx"> void sendCommand();
</span><ins>+ void loglevelChanged(int loglevel);
</ins><span class="cx"> private:
</span><ins>+ void writeSettings();
+ void readSettings();
</ins><span class="cx"> Ui::consolePage *m_ui;
</span><span class="cx"> ESLconnection *eslConnection;
</span><span class="cx"> QString host;
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcincludefs_guih"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/include/fs_gui.h (14266 => 14267)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/include/fs_gui.h        2009-07-16 03:41:59 UTC (rev 14266)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/include/fs_gui.h        2009-07-16 04:56:31 UTC (rev 14267)
</span><span class="lines">@@ -66,6 +66,7 @@
</span><span class="cx"> private:
</span><span class="cx"> Ui::Cfsgui *m_ui;
</span><span class="cx"> CserverManager *serverDialog;
</span><ins>+ void saveWindowSettings();
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> #endif // FS_GUI_H
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>