<!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][14299] </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=14299">14299</a></dd>
<dt>Author</dt> <dd>jmesquita</dd>
<dt>Date</dt> <dd>2009-07-20 01:10:15 -0500 (Mon, 20 Jul 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre>New feature: Ability to save console log to disk
New feature: Ability to pastebin.freeswitch.org (bugs detected that still need to be fixed.)</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="#freeswitchtrunkcontribjmesquitafsguisrcconsolepagecpp">freeswitch/trunk/contrib/jmesquita/fsgui/src/consolepage.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>
<h3>Added Paths</h3>
<ul>
<li><a href="#freeswitchtrunkcontribjmesquitafsguiresourcespastebindialogui">freeswitch/trunk/contrib/jmesquita/fsgui/resources/pastebindialog.ui</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguisrcincludepastebindialogh">freeswitch/trunk/contrib/jmesquita/fsgui/src/include/pastebindialog.h</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguisrcpastebindialogcpp">freeswitch/trunk/contrib/jmesquita/fsgui/src/pastebindialog.cpp</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 (14298 => 14299)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/fsgui.pro        2009-07-19 01:36:33 UTC (rev 14298)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/fsgui.pro        2009-07-20 06:10:15 UTC (rev 14299)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> DESTDIR = ./bin/
</span><span class="cx"> message(The project will be installed in $$DESTDIR)
</span><ins>+QT += network
</ins><span class="cx"> TARGET = fs_gui
</span><span class="cx"> TEMPLATE = app
</span><span class="cx"> MOC_DIR = ./build/
</span><span class="lines">@@ -11,7 +12,8 @@
</span><span class="cx"> src/esl_connection.cpp \
</span><span class="cx"> src/consolepage.cpp \
</span><span class="cx"> src/preferencesdialog.cpp \
</span><del>- src/completers.cpp
</del><ins>+ src/completers.cpp \
+ src/pastebindialog.cpp
</ins><span class="cx"> INCLUDEPATH += ../../../libs/esl/src/include \
</span><span class="cx"> src/include
</span><span class="cx"> HEADERS += src/include/fs_gui.h \
</span><span class="lines">@@ -20,11 +22,13 @@
</span><span class="cx"> src/include/consolepage.h \
</span><span class="cx"> src/include/global_defines.h \
</span><span class="cx"> src/include/preferencesdialog.h \
</span><del>- src/include/completers.h
</del><ins>+ src/include/completers.h \
+ src/include/pastebindialog.h
</ins><span class="cx"> FORMS += resources/fs_gui.ui \
</span><span class="cx"> resources/server_manager.ui \
</span><span class="cx"> resources/consolepage.ui \
</span><del>- resources/preferencesdialog.ui
</del><ins>+ resources/preferencesdialog.ui \
+ resources/pastebindialog.ui
</ins><span class="cx"> LIBS += -L../../../libs/esl \
</span><span class="cx"> -lesl
</span><span class="cx"> RESOURCES += resources/resources.qrc
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguiresourcesfs_guiui"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/resources/fs_gui.ui (14298 => 14299)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/resources/fs_gui.ui        2009-07-19 01:36:33 UTC (rev 14298)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/resources/fs_gui.ui        2009-07-20 06:10:15 UTC (rev 14299)
</span><span class="lines">@@ -59,6 +59,8 @@
</span><span class="cx"> <addaction name="actionConnect"/>
</span><span class="cx"> <addaction name="actionDisconnect"/>
</span><span class="cx"> <addaction name="separator"/>
</span><ins>+ <addaction name="actionSaveLog"/>
+ <addaction name="separator"/>
</ins><span class="cx"> <addaction name="actionQuit"/>
</span><span class="cx"> </widget>
</span><span class="cx"> <widget class="QMenu" name="menuHelp">
</span><span class="lines">@@ -75,8 +77,15 @@
</span><span class="cx"> </property>
</span><span class="cx"> <addaction name="actionPreferences"/>
</span><span class="cx"> </widget>
</span><ins>+ <widget class="QMenu" name="menu_Tools">
+ <property name="title">
+ <string>&amp;Tools</string>
+ </property>
+ <addaction name="actionPastebinLog"/>
+ </widget>
</ins><span class="cx"> <addaction name="menuFile"/>
</span><span class="cx"> <addaction name="menuEdit"/>
</span><ins>+ <addaction name="menu_Tools"/>
</ins><span class="cx"> <addaction name="menuHelp"/>
</span><span class="cx"> </widget>
</span><span class="cx"> <widget class="QStatusBar" name="statusBar">
</span><span class="lines">@@ -95,6 +104,9 @@
</span><span class="cx"> </property>
</span><span class="cx"> </action>
</span><span class="cx"> <action name="actionConnect">
</span><ins>+ <property name="enabled">
+ <bool>false</bool>
+ </property>
</ins><span class="cx"> <property name="text">
</span><span class="cx"> <string>&amp;Connect</string>
</span><span class="cx"> </property>
</span><span class="lines">@@ -131,11 +143,31 @@
</span><span class="cx"> <string>Register to &amp;ClueCon</string>
</span><span class="cx"> </property>
</span><span class="cx"> </action>
</span><ins>+ <action name="actionSaveLog">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Save Log</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+S</string>
+ </property>
+ </action>
+ <action name="actionPastebinLog">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Pastebin Log</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+Y</string>
+ </property>
+ </action>
</ins><span class="cx"> </widget>
</span><span class="cx"> <layoutdefault spacing="6" margin="11"/>
</span><del>- <resources>
- <include location="resources.qrc"/>
- </resources>
</del><ins>+ <resources/>
</ins><span class="cx"> <connections>
</span><span class="cx"> <connection>
</span><span class="cx"> <sender>actionQuit</sender>
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguiresourcespastebindialogui"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/jmesquita/fsgui/resources/pastebindialog.ui (0 => 14299)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/resources/pastebindialog.ui         (rev 0)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/resources/pastebindialog.ui        2009-07-20 06:10:15 UTC (rev 14299)
</span><span class="lines">@@ -0,0 +1,233 @@
</span><ins>+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>pastebinDialog</class>
+ <widget class="QDialog" name="pastebinDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>352</width>
+ <height>310</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>Pastebin</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="minimumSize">
+ <size>
+ <width>80</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Url</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineURL">
+ <property name="text">
+ <string>pastebin.freeswitch.org</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="minimumSize">
+ <size>
+ <width>80</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Port</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="linePort">
+ <property name="text">
+ <string>80</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="label_3">
+ <property name="minimumSize">
+ <size>
+ <width>80</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Username</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineUsername">
+ <property name="text">
+ <string>pastebin</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLabel" name="label_4">
+ <property name="minimumSize">
+ <size>
+ <width>80</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Password</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="linePassword">
+ <property name="text">
+ <string>freeswitch</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="title">
+ <string>Options</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_5">
+ <item>
+ <widget class="QLabel" name="label_5">
+ <property name="minimumSize">
+ <size>
+ <width>80</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Your name</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineName"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_6">
+ <item>
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>Paste duration</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioDay">
+ <property name="text">
+ <string>A day</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioMonth">
+ <property name="text">
+ <string>A month</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioForever">
+ <property name="text">
+ <string>Forever</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>pastebinDialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>pastebinDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
</ins></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcconsolepagecpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/consolepage.cpp (14298 => 14299)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/consolepage.cpp        2009-07-19 01:36:33 UTC (rev 14298)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/consolepage.cpp        2009-07-20 06:10:15 UTC (rev 14299)
</span><span class="lines">@@ -87,6 +87,10 @@
</span><span class="cx">          eslConnection->disconnect();        
</span><span class="cx">         }
</span><span class="cx"> }
</span><ins>+QString consolePage::getConsoleText()
+{
+ return m_ui->textConsole->toPlainText();
+}
</ins><span class="cx"> void consolePage::doConnect()
</span><span class="cx"> {
</span><span class="cx"> eslConnection->doConnect();
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcfs_guicpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/fs_gui.cpp (14298 => 14299)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/fs_gui.cpp        2009-07-19 01:36:33 UTC (rev 14298)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/fs_gui.cpp        2009-07-20 06:10:15 UTC (rev 14299)
</span><span class="lines">@@ -39,12 +39,15 @@
</span><span class="cx"> #include "fs_gui.h"
</span><span class="cx"> #include "ui_fs_gui.h"
</span><span class="cx"> #include "consolepage.h"
</span><ins>+#include <QtNetwork>
</ins><span class="cx">
</span><span class="cx"> Cfsgui::Cfsgui(QWidget *parent) :
</span><span class="cx"> QMainWindow(parent),
</span><span class="cx"> m_ui(new Ui::Cfsgui),
</span><span class="cx"> serverDialog(NULL),
</span><del>- prefDialog(NULL)
</del><ins>+ prefDialog(NULL),
+ fileDialog(NULL),
+ pasteDialog(NULL)
</ins><span class="cx"> {
</span><span class="cx">
</span><span class="cx"> m_ui->setupUi(this);
</span><span class="lines">@@ -59,10 +62,15 @@
</span><span class="cx"> this, SLOT(doConnect()));
</span><span class="cx"> connect(m_ui->actionDisconnect, SIGNAL(triggered()),
</span><span class="cx"> this, SLOT(doDisconnect()));
</span><ins>+ connect(m_ui->actionSaveLog, SIGNAL(triggered()),
+ this, SLOT(saveLog()));
+ connect(m_ui->actionPastebinLog, SIGNAL(triggered()),
+ this, SLOT(pastebinLog()));
</ins><span class="cx"> connect(m_ui->actionAbout, SIGNAL(triggered()),
</span><span class="cx"> this, SLOT(showAbout()));
</span><span class="cx"> connect(m_ui->actionRegisterClueCon, SIGNAL(triggered()),
</span><span class="cx"> this, SLOT(registerClueCon()));
</span><ins>+
</ins><span class="cx"> connect(m_ui->tabWidget, SIGNAL(tabCloseRequested(int)),
</span><span class="cx"> this, SLOT(closeTab(int)));
</span><span class="cx"> connect(m_ui->tabWidget, SIGNAL(currentChanged(int)),
</span><span class="lines">@@ -160,11 +168,15 @@
</span><span class="cx"> {
</span><span class="cx"> m_ui->actionConnect->setDisabled(true);
</span><span class="cx"> m_ui->actionDisconnect->setEnabled(true);
</span><ins>+ m_ui->actionSaveLog->setEnabled(true);
+ m_ui->actionPastebinLog->setEnabled(true);
</ins><span class="cx"> }
</span><span class="cx"> void Cfsgui::gotDisconnected()
</span><span class="cx"> {
</span><span class="cx"> m_ui->actionConnect->setEnabled(true);
</span><span class="cx"> m_ui->actionDisconnect->setDisabled(true);
</span><ins>+ m_ui->actionSaveLog->setDisabled(true);
+ m_ui->actionPastebinLog->setDisabled(true);
</ins><span class="cx"> }
</span><span class="cx"> void Cfsgui::backgroundColorChanged()
</span><span class="cx"> {
</span><span class="lines">@@ -174,6 +186,43 @@
</span><span class="cx"> tab->setConsoleBackground();
</span><span class="cx"> }
</span><span class="cx"> }
</span><ins>+void Cfsgui::saveLog()
+{
+ consolePage *tab = static_cast<consolePage *>(m_ui->tabWidget->widget(m_ui->tabWidget->currentIndex()));
+ if (tab)
+ {
+ if(!fileDialog)
+ {
+ fileDialog = new QFileDialog(this);
+ }
+
+ fileDialog->setAcceptMode(QFileDialog::AcceptSave);
+
+ if (fileDialog->exec())
+ {
+ QStringList fileNames = fileDialog->selectedFiles();
+ QFile file(fileNames[0]);
+ file.open(QIODevice::WriteOnly|QIODevice::Truncate|QIODevice::Text);
+ file.write(tab->getConsoleText().toAscii());
+ file.close();
+ }
+ }
+}
+void Cfsgui::pastebinLog()
+{
+ consolePage *tab = static_cast<consolePage *>(m_ui->tabWidget->widget(m_ui->tabWidget->currentIndex()));
+ if (tab)
+ {
+ if (!pasteDialog)
+ {
+ pasteDialog = new pastebinDialog(this);
+ }
+ pasteDialog->setText(tab->getConsoleText());
+ pasteDialog->show();
+ pasteDialog->raise();
+ pasteDialog->activateWindow();
+ }
+}
</ins><span class="cx"> void Cfsgui::registerClueCon()
</span><span class="cx"> {
</span><span class="cx"> QDesktopServices::openUrl(QUrl("http://www.cluecon.com/user/register"));
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcincludeconsolepageh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/include/consolepage.h (14298 => 14299)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/include/consolepage.h        2009-07-19 01:36:33 UTC (rev 14298)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/include/consolepage.h        2009-07-20 06:10:15 UTC (rev 14299)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> int isConnected();
</span><span class="cx"> void doConnect();
</span><span class="cx"> void doDisconnect();
</span><ins>+ QString getConsoleText();
</ins><span class="cx">
</span><span class="cx"> protected:
</span><span class="cx"> virtual void changeEvent(QEvent *e);
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcincludefs_guih"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/include/fs_gui.h (14298 => 14299)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/include/fs_gui.h        2009-07-19 01:36:33 UTC (rev 14298)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/include/fs_gui.h        2009-07-20 06:10:15 UTC (rev 14299)
</span><span class="lines">@@ -42,12 +42,12 @@
</span><span class="cx"> #include <QtGui>
</span><span class="cx"> #include "server_manager.h"
</span><span class="cx"> #include "preferencesdialog.h"
</span><ins>+#include "pastebindialog.h"
</ins><span class="cx">
</span><span class="cx"> namespace Ui {
</span><span class="cx"> class Cfsgui;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-
</del><span class="cx"> class Cfsgui : public QMainWindow {
</span><span class="cx"> Q_OBJECT
</span><span class="cx"> Q_DISABLE_COPY(Cfsgui)
</span><span class="lines">@@ -66,6 +66,8 @@
</span><span class="cx"> void closeTab(int);
</span><span class="cx"> void changeTab(int);
</span><span class="cx"> void backgroundColorChanged();
</span><ins>+ void saveLog();
+ void pastebinLog();
</ins><span class="cx"> void registerClueCon();
</span><span class="cx"> void doConnect();
</span><span class="cx"> void doDisconnect();
</span><span class="lines">@@ -76,6 +78,8 @@
</span><span class="cx"> Ui::Cfsgui *m_ui;
</span><span class="cx"> CserverManager *serverDialog;
</span><span class="cx"> preferencesDialog *prefDialog;
</span><ins>+ QFileDialog *fileDialog;
+ pastebinDialog *pasteDialog;
</ins><span class="cx"> void saveWindowSettings();
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcincludepastebindialogh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/jmesquita/fsgui/src/include/pastebindialog.h (0 => 14299)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/include/pastebindialog.h         (rev 0)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/include/pastebindialog.h        2009-07-20 06:10:15 UTC (rev 14299)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+#ifndef PASTEBINDIALOG_H
+#define PASTEBINDIALOG_H
+
+#include <QtGui/QDialog>
+
+namespace Ui {
+ class pastebinDialog;
+}
+
+class QHttp;
+class QString;
+
+class pastebinDialog : public QDialog {
+ Q_OBJECT
+ Q_DISABLE_COPY(pastebinDialog)
+public:
+ explicit pastebinDialog(QWidget *parent = 0);
+ virtual ~pastebinDialog();
+ void setText(QString);
+
+protected:
+ virtual void changeEvent(QEvent *e);
+
+private:
+ Ui::pastebinDialog *m_ui;
+ QString text;
+ QHttp * pastebinHttp;
+
+private slots:
+ void pastebinFinished(int, bool);
+ void pasteIt();
+};
+
+#endif // PASTEBINDIALOG_H
</ins></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcpastebindialogcpp"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/jmesquita/fsgui/src/pastebindialog.cpp (0 => 14299)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/pastebindialog.cpp         (rev 0)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/pastebindialog.cpp        2009-07-20 06:10:15 UTC (rev 14299)
</span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+#include <QtGui>
+#include <QtNetwork>
+#include "pastebindialog.h"
+#include "ui_pastebindialog.h"
+
+pastebinDialog::pastebinDialog(QWidget *parent) :
+ QDialog(parent),
+ m_ui(new Ui::pastebinDialog)
+{
+ m_ui->setupUi(this);
+
+ connect(this, SIGNAL(accepted()),
+ this, SLOT(pasteIt()));
+}
+
+pastebinDialog::~pastebinDialog()
+{
+ delete m_ui;
+}
+
+void pastebinDialog::changeEvent(QEvent *e)
+{
+ QDialog::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ m_ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
+void pastebinDialog::pastebinFinished(int req, bool isError)
+{
+ QMessageBox msgBox;
+ if (isError)
+ {
+ msgBox.setText(QString("Error on pastebin: %1").arg(pastebinHttp->errorString()));
+ msgBox.setIcon(QMessageBox::Critical);
+ msgBox.exec();
+ }
+ else
+ {
+ msgBox.setText("Pastebin correctly pasted!");
+ msgBox.setIcon(QMessageBox::Information);
+ msgBox.exec();
+ }
+}
+void pastebinDialog::pasteIt()
+{
+
+ pastebinHttp = new QHttp(this);
+
+ /* TODO: Make a progress thing? */
+ connect(pastebinHttp, SIGNAL(requestFinished(int,bool)),
+ this, SLOT(pastebinFinished(int,bool)));
+
+ QHttpRequestHeader header( "POST", "/pastebin.php") ;
+ header.setValue( "Host", "pastebin.freeswitch.org" ) ;
+ header.setContentType( "application/x-www-form-urlencoded" ) ;
+
+ pastebinHttp->setHost(m_ui->lineURL->text(), QHttp::ConnectionModeHttp, m_ui->linePort->text().toInt());
+ pastebinHttp->setUser(m_ui->lineUsername->text(), m_ui->linePassword->text());
+ header.setValue( "User-Agent", "FsGUI");
+ QString params("parent_pid=&format=fslog");
+ params.append("&code2=%1").arg(text);
+ if (m_ui->lineName->text().trimmed() == "")
+ params.append("&poster=%1&paste=Send&remember=0").arg(tr("Anonymous"));
+ if (m_ui->radioDay->isChecked())
+ params.append("&expiry=%1").arg("d");
+ if (m_ui->radioMonth->isChecked())
+ params.append("&expiry=%1").arg("m");
+ if (m_ui->radioForever->isChecked())
+ params.append("&expiry=%1").arg("f");
+ pastebinHttp->request(header, params.toUtf8());
+}
+void pastebinDialog::setText(QString consoleText)
+{
+ text = consoleText;
+}
</ins></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>