<!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][16429] </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=16429">16429</a></dd>
<dt>Author</dt> <dd>jmesquita</dd>
<dt>Date</dt> <dd>2010-01-20 20:48:53 -0600 (Wed, 20 Jan 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add a taskbar icon. We need a designer, please...</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunkfscommcallcpp">freeswitch/trunk/fscomm/call.cpp</a></li>
<li><a href="#freeswitchtrunkfscommcallh">freeswitch/trunk/fscomm/call.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="#freeswitchtrunkfscommresourcesqrc">freeswitch/trunk/fscomm/resources.qrc</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#freeswitchtrunkfscommresourcestaskbar_iconpng">freeswitch/trunk/fscomm/resources/taskbar_icon.png</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkfscommcallcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/call.cpp (16428 => 16429)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/call.cpp        2010-01-21 02:36:28 UTC (rev 16428)
+++ freeswitch/trunk/fscomm/call.cpp        2010-01-21 02:48:53 UTC (rev 16429)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #include "call.h"
</span><ins>+#include <QtGui>
</ins><span class="cx"> #include <fshost.h>
</span><span class="cx">
</span><span class="cx"> Call::Call()
</span><span class="lines">@@ -67,3 +68,13 @@
</span><span class="cx">
</span><span class="cx"> return status;
</span><span class="cx"> }
</span><ins>+
+void Call::sendDTMF(QString digit)
+{
+ QString result;
+ QString dtmf_string = QString("dtmf %1").arg(digit);
+ if (g_FSHost.sendCmd("pa", dtmf_string.toAscii(), &result) == SWITCH_STATUS_FALSE) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not send DTMF digit %s on call[%s]", digit.toAscii().data(), _uuid.toAscii().data());
+ QMessageBox::critical(0, QWidget::tr("DTMF Error"), QWidget::tr("There was an error sending DTMF, please report this bug."), QMessageBox::Ok);
+ }
+}
</ins></span></pre></div>
<a id="freeswitchtrunkfscommcallh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/call.h (16428 => 16429)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/call.h        2010-01-21 02:36:28 UTC (rev 16428)
+++ freeswitch/trunk/fscomm/call.h        2010-01-21 02:48:53 UTC (rev 16429)
</span><span class="lines">@@ -63,6 +63,7 @@
</span><span class="cx"> void setActive(bool isActive) { _isActive = isActive; }
</span><span class="cx"> bool isActive() { return _isActive == true; }
</span><span class="cx"> switch_status_t toggleRecord(bool);
</span><ins>+ void sendDTMF(QString digit);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> int _call_id;
</span></span></pre></div>
<a id="freeswitchtrunkfscommmainwindowcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/mainwindow.cpp (16428 => 16429)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/mainwindow.cpp        2010-01-21 02:36:28 UTC (rev 16428)
+++ freeswitch/trunk/fscomm/mainwindow.cpp        2010-01-21 02:48:53 UTC (rev 16429)
</span><span class="lines">@@ -40,6 +40,11 @@
</span><span class="cx"> {
</span><span class="cx"> ui->setupUi(this);
</span><span class="cx">
</span><ins>+ /* Setup the taskbar icon */
+ sysTray = new QSystemTrayIcon(QIcon(":/images/taskbar_icon"), this);
+ sysTray->setToolTip(tr("FSComm"));
+
+ /* Connect DTMF buttons */
</ins><span class="cx"> dialpadMapper = new QSignalMapper(this);
</span><span class="cx"> connect(ui->dtmf0Btn, SIGNAL(clicked()), dialpadMapper, SLOT(map()));
</span><span class="cx"> connect(ui->dtmf1Btn, SIGNAL(clicked()), dialpadMapper, SLOT(map()));
</span><span class="lines">@@ -73,8 +78,9 @@
</span><span class="cx"> dialpadMapper->setMapping(ui->dtmfDBtn, QString("D"));
</span><span class="cx"> dialpadMapper->setMapping(ui->dtmfAstBtn, QString("*"));
</span><span class="cx"> dialpadMapper->setMapping(ui->dtmfPoundBtn, QString("#"));
</span><del>- connect(dialpadMapper, SIGNAL(mapped(QString)), this, SLOT(dialDTMF(QString)));
</del><ins>+ connect(dialpadMapper, SIGNAL(mapped(QString)), this, SLOT(sendDTMF(QString)));
</ins><span class="cx">
</span><ins>+ /* Connect events related to FreeSWITCH */
</ins><span class="cx"> connect(&g_FSHost, SIGNAL(ready()),this, SLOT(fshostReady()));
</span><span class="cx"> connect(&g_FSHost, SIGNAL(ringing(QSharedPointer<Call>)), this, SLOT(ringing(QSharedPointer<Call>)));
</span><span class="cx"> connect(&g_FSHost, SIGNAL(answered(QSharedPointer<Call>)), this, SLOT(answered(QSharedPointer<Call>)));
</span><span class="lines">@@ -86,6 +92,7 @@
</span><span class="cx"> connect(&g_FSHost, SIGNAL(delAccount(QSharedPointer<Account>)), this, SLOT(accountDel(QSharedPointer<Account>)));
</span><span class="cx"> /*connect(&g_FSHost, SIGNAL(coreLoadingError(QString)), this, SLOT(coreLoadingError(QString)));*/
</span><span class="cx">
</span><ins>+ /* Connect call commands */
</ins><span class="cx"> connect(ui->newCallBtn, SIGNAL(clicked()), this, SLOT(makeCall()));
</span><span class="cx"> connect(ui->answerBtn, SIGNAL(clicked()), this, SLOT(paAnswer()));
</span><span class="cx"> connect(ui->hangupBtn, SIGNAL(clicked()), this, SLOT(paHangup()));
</span><span class="lines">@@ -95,6 +102,7 @@
</span><span class="cx"> connect(ui->action_Exit, SIGNAL(triggered()), this, SLOT(close()));
</span><span class="cx"> connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(showAbout()));
</span><span class="cx"> connect(ui->actionSetDefaultAccount, SIGNAL(triggered(bool)), this, SLOT(setDefaultAccount()));
</span><ins>+ connect(sysTray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(sysTrayActivated(QSystemTrayIcon::ActivationReason)));
</ins><span class="cx">
</span><span class="cx"> /* Set the context menus */
</span><span class="cx"> ui->tableAccounts->addAction(ui->actionSetDefaultAccount);
</span><span class="lines">@@ -186,13 +194,9 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MainWindow::dialDTMF(QString dtmf)
</del><ins>+void MainWindow::sendDTMF(QString dtmf)
</ins><span class="cx"> {
</span><del>- QString result;
- QString dtmf_string = QString("dtmf %1").arg(dtmf);
- if (g_FSHost.sendCmd("pa", dtmf_string.toAscii(), &result) == SWITCH_STATUS_FALSE) {
- ui->textEdit->setText("Error sending that command");
- }
</del><ins>+ g_FSHost.getCurrentActiveCall().data()->sendDTMF(dtmf);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MainWindow::callListDoubleClick(QListWidgetItem *item)
</span><span class="lines">@@ -228,6 +232,8 @@
</span><span class="cx"> ui->newCallBtn->setEnabled(true);
</span><span class="cx"> ui->textEdit->setEnabled(true);
</span><span class="cx"> ui->textEdit->setText("Ready to dial and receive calls!");
</span><ins>+ sysTray->show();
+ sysTray->showMessage(tr("Status"), tr("FSComm has initialized!"), QSystemTrayIcon::Information, 5000);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MainWindow::paAnswer()
</span><span class="lines">@@ -464,3 +470,23 @@
</span><span class="cx"> "<p>Compiled FSComm version: %1"
</span><span class="cx"> "<p>%2").arg(SWITCH_VERSION_FULL, result));
</span><span class="cx"> }
</span><ins>+
+void MainWindow::sysTrayActivated(QSystemTrayIcon::ActivationReason reason)
+{
+ switch(reason)
+ {
+ case QSystemTrayIcon::Trigger:
+ {
+ if (this->isVisible())
+ this->hide();
+ else {
+ this->show();
+ this->activateWindow();
+ this->raise();
+ }
+ break;
+ }
+ default:
+ break;
+ }
+}
</ins></span></pre></div>
<a id="freeswitchtrunkfscommmainwindowh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/mainwindow.h (16428 => 16429)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/mainwindow.h        2010-01-21 02:36:28 UTC (rev 16428)
+++ freeswitch/trunk/fscomm/mainwindow.h        2010-01-21 02:48:53 UTC (rev 16429)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include <QMainWindow>
</span><span class="cx"> #include <QListWidgetItem>
</span><span class="cx"> #include <QSignalMapper>
</span><ins>+#include <QSystemTrayIcon>
</ins><span class="cx"> #include <switch.h>
</span><span class="cx"> #include <fshost.h>
</span><span class="cx"> #include <call.h>
</span><span class="lines">@@ -44,7 +45,6 @@
</span><span class="cx"> class MainWindow;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-
</del><span class="cx"> class MainWindow : public QMainWindow {
</span><span class="cx"> Q_OBJECT
</span><span class="cx"> public:
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx"> void showAbout();
</span><span class="cx"> void prefTriggered();
</span><span class="cx"> void coreLoadingError(QString);
</span><del>- void dialDTMF(QString);
</del><ins>+ void sendDTMF(QString);
</ins><span class="cx"> void callListDoubleClick(QListWidgetItem *);
</span><span class="cx"> void makeCall();
</span><span class="cx"> void fshostReady();
</span><span class="lines">@@ -78,11 +78,13 @@
</span><span class="cx"> void accountAdd(QSharedPointer<Account>);
</span><span class="cx"> void accountDel(QSharedPointer<Account>);
</span><span class="cx"> void accountStateChanged(QSharedPointer<Account>);
</span><ins>+ void sysTrayActivated(QSystemTrayIcon::ActivationReason reason);
</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>+ QSystemTrayIcon *sysTray;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> #endif // MAINWINDOW_H
</span></span></pre></div>
<a id="freeswitchtrunkfscommresourcestaskbar_iconpng"></a>
<div class="binary"><h4>Added: freeswitch/trunk/fscomm/resources/taskbar_icon.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: freeswitch/trunk/fscomm/resources/taskbar_icon.png
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:mime-type
</span><span class="cx"> + application/octet-stream
</span><a id="freeswitchtrunkfscommresourcesqrc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/resources.qrc (16428 => 16429)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/resources.qrc        2010-01-21 02:36:28 UTC (rev 16428)
+++ freeswitch/trunk/fscomm/resources.qrc        2010-01-21 02:48:53 UTC (rev 16429)
</span><span class="lines">@@ -5,6 +5,7 @@
</span><span class="cx"> <file alias="pref_audio.gif">resources/pref_audio.gif</file>
</span><span class="cx"> <file alias="pref_general.jpg">resources/pref_general.jpg</file>
</span><span class="cx"> <file alias="pref_accounts.jpg">resources/pref_accounts.jpg</file>
</span><ins>+ <file alias="taskbar_icon.png">resources/taskbar_icon.png</file>
</ins><span class="cx"> </qresource>
</span><span class="cx"> <qresource prefix="/confs">
</span><span class="cx"> <file alias="freeswitch.xml">conf/freeswitch.xml</file>
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>