<!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][17135] </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=17135">17135</a></dd>
<dt>Author</dt> <dd>jmesquita</dd>
<dt>Date</dt> <dd>2010-03-29 21:09:08 -0500 (Mon, 29 Mar 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add more information to splash screen and warn users when very important modules are not loaded.</pre>

<h3>Modified Paths</h3>
<ul>
<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="#freeswitchtrunkfscommmaincpp">freeswitch/trunk/fscomm/main.cpp</a></li>
<li><a href="#freeswitchtrunkfscommmainwindowcpp">freeswitch/trunk/fscomm/mainwindow.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkfscommfshostcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/fshost.cpp (17134 => 17135)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/fshost.cpp        2010-03-29 23:02:47 UTC (rev 17134)
+++ freeswitch/trunk/fscomm/fshost.cpp        2010-03-30 02:09:08 UTC (rev 17135)
</span><span class="lines">@@ -45,8 +45,15 @@
</span><span class="cx">     qRegisterMetaType&lt;QSharedPointer&lt;Call&gt; &gt;(&quot;QSharedPointer&lt;Call&gt;&quot;);
</span><span class="cx">     qRegisterMetaType&lt;QSharedPointer&lt;Account&gt; &gt;(&quot;QSharedPointer&lt;Account&gt;&quot;);
</span><span class="cx"> 
</span><ins>+    connect(this, SIGNAL(loadedModule(QString,QString,QString)), this, SLOT(minimalModuleLoaded(QString,QString,QString)));
+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+QBool FSHost::isModuleLoaded(QString modName)
+{
+    return _loadedModules.contains(modName);
+}
+
</ins><span class="cx"> void FSHost::createFolders()
</span><span class="cx"> {
</span><span class="cx">     /* Create directory structure for softphone with default configs */
</span><span class="lines">@@ -117,14 +124,14 @@
</span><span class="cx">     createFolders();
</span><span class="cx"> 
</span><span class="cx">     /* If you need to override configuration directories, you need to change them in the SWITCH_GLOBAL_dirs global structure */
</span><del>-    qDebug() &lt;&lt; &quot;Initializing core...&quot; &lt;&lt; endl;
</del><ins>+    qDebug() &lt;&lt; &quot;Initializing core...&quot;;
</ins><span class="cx">     /* Initialize the core and load modules, that will startup FS completely */
</span><span class="cx">     if (switch_core_init(flags, console, &amp;err) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">         fprintf(stderr, &quot;Failed to initialize FreeSWITCH's core: %s\n&quot;, err);
</span><span class="cx">         emit coreLoadingError(err);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    qDebug() &lt;&lt; &quot;Everything OK, Entering runtime loop ...&quot; &lt;&lt; endl;
</del><ins>+    qDebug() &lt;&lt; &quot;Everything OK, Entering runtime loop ...&quot;;
</ins><span class="cx"> 
</span><span class="cx">     if (switch_event_bind(&quot;FSHost&quot;, SWITCH_EVENT_ALL, SWITCH_EVENT_SUBCLASS_ANY, eventHandlerCallback, NULL) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">             switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Couldn't bind!\n&quot;);
</span><span class="lines">@@ -136,12 +143,14 @@
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Couldn't load mod_qsettings\n&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    emit loadingModules(&quot;Loading modules...&quot;, Qt::AlignRight|Qt::AlignBottom, Qt::blue);
</ins><span class="cx">     if (switch_core_init_and_modload(flags, console, &amp;err) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">         fprintf(stderr, &quot;Failed to initialize FreeSWITCH's core: %s\n&quot;, err);
</span><span class="cx">         emit coreLoadingError(err);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     emit ready();
</span><ins>+
</ins><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="cx">      * If its false, it initializes the libedit for the console, then does the same thing
</span><span class="cx">      */
</span><span class="lines">@@ -154,7 +163,7 @@
</span><span class="cx">     destroy_status = switch_core_destroy();
</span><span class="cx">     if (destroy_status == SWITCH_STATUS_SUCCESS)
</span><span class="cx">     {
</span><del>-        qDebug() &lt;&lt; &quot;We have properly shutdown the core.&quot; &lt;&lt; endl;
</del><ins>+        qDebug() &lt;&lt; &quot;We have properly shutdown the core.&quot;;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -407,11 +416,27 @@
</span><span class="cx">             }
</span><span class="cx">             break;
</span><span class="cx">         }
</span><ins>+    case SWITCH_EVENT_MODULE_LOAD:
+        {
+            QString modType = switch_event_get_header_nil(event, &quot;type&quot;);
+            QString modName = switch_event_get_header_nil(event, &quot;name&quot;);
+            QString modKey = switch_event_get_header_nil(event, &quot;key&quot;);
+            emit loadedModule(modType, modName, modKey);
+            break;
+        }
</ins><span class="cx">     default:
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void FSHost::minimalModuleLoaded(QString modType, QString modName, QString modKey)
+{
+    if (modType == &quot;endpoint&quot;)
+    {
+        _loadedModules.append(modKey);
+    }
+}
+
</ins><span class="cx"> void FSHost::accountReloadCmd(QSharedPointer&lt;Account&gt; acc)
</span><span class="cx"> {
</span><span class="cx">     QString res;
</span></span></pre></div>
<a id="freeswitchtrunkfscommfshosth"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/fshost.h (17134 => 17135)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/fshost.h        2010-03-29 23:02:47 UTC (rev 17134)
+++ freeswitch/trunk/fscomm/fshost.h        2010-03-30 02:09:08 UTC (rev 17135)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #define FSHOST_H
</span><span class="cx"> 
</span><span class="cx"> #include &lt;QThread&gt;
</span><ins>+#include &lt;QColor&gt;
</ins><span class="cx"> #include &lt;QHash&gt;
</span><span class="cx"> #include &lt;QSharedPointer&gt;
</span><span class="cx"> #include &lt;switch.h&gt;
</span><span class="lines">@@ -50,12 +51,15 @@
</span><span class="cx">     QSharedPointer&lt;Account&gt; getCurrentDefaultAccount();
</span><span class="cx">     QSharedPointer&lt;Account&gt; getAccountByName(QString accStr);
</span><span class="cx">     void accountReloadCmd(QSharedPointer&lt;Account&gt; acc);
</span><ins>+    QBool isModuleLoaded(QString);
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     void run(void);
</span><span class="cx"> 
</span><span class="cx"> signals:
</span><span class="cx">     void coreLoadingError(QString);
</span><ins>+    void loadingModules(QString, int, QColor);
+    void loadedModule(QString, QString, QString);
</ins><span class="cx">     void ready(void);
</span><span class="cx">     void ringing(QSharedPointer&lt;Call&gt;);
</span><span class="cx">     void answered(QSharedPointer&lt;Call&gt;);
</span><span class="lines">@@ -69,6 +73,7 @@
</span><span class="cx"> private slots:
</span><span class="cx">     /* We need to wait for the gateway deletion before reloading it */
</span><span class="cx">     void accountReloadSlot(QSharedPointer&lt;Account&gt;);
</span><ins>+    void minimalModuleLoaded(QString, QString, QString);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     switch_status_t processBlegEvent(switch_event_t *, QString);
</span><span class="lines">@@ -79,6 +84,7 @@
</span><span class="cx">     QHash&lt;QString, QSharedPointer&lt;Account&gt; &gt; _accounts;
</span><span class="cx">     QHash&lt;QString, QString&gt; _bleg_uuids;
</span><span class="cx">     QList&lt;QString&gt; _reloading_Accounts;
</span><ins>+    QList&lt;QString&gt; _loadedModules;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> extern FSHost g_FSHost;
</span></span></pre></div>
<a id="freeswitchtrunkfscommmaincpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/main.cpp (17134 => 17135)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/main.cpp        2010-03-29 23:02:47 UTC (rev 17134)
+++ freeswitch/trunk/fscomm/main.cpp        2010-03-30 02:09:08 UTC (rev 17135)
</span><span class="lines">@@ -41,8 +41,10 @@
</span><span class="cx">     QPixmap image(&quot;:/images/splash.png&quot;);
</span><span class="cx">     QSplashScreen *splash = new QSplashScreen(image);
</span><span class="cx">     splash-&gt;show();
</span><del>-    splash-&gt;showMessage(&quot;Loading, please wait...&quot;, Qt::AlignRight|Qt::AlignBottom, Qt::blue);
</del><ins>+    splash-&gt;showMessage(&quot;Loading core, please wait...&quot;, Qt::AlignRight|Qt::AlignBottom, Qt::blue);
</ins><span class="cx"> 
</span><ins>+    QObject::connect(&amp;g_FSHost, SIGNAL(loadingModules(QString,int,QColor)), splash, SLOT(showMessage(QString,int,QColor)));
+
</ins><span class="cx">     QObject::connect(&amp;g_FSHost, SIGNAL(ready()), splash, SLOT(close()));
</span><span class="cx">     MainWindow w;    
</span><span class="cx">     QObject::connect(&amp;g_FSHost, SIGNAL(ready()), &amp;w, SLOT(show()));
</span></span></pre></div>
<a id="freeswitchtrunkfscommmainwindowcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/mainwindow.cpp (17134 => 17135)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/mainwindow.cpp        2010-03-29 23:02:47 UTC (rev 17134)
+++ freeswitch/trunk/fscomm/mainwindow.cpp        2010-03-30 02:09:08 UTC (rev 17135)
</span><span class="lines">@@ -90,7 +90,7 @@
</span><span class="cx">     connect(&amp;g_FSHost, SIGNAL(accountStateChange(QSharedPointer&lt;Account&gt;)), this, SLOT(accountStateChanged(QSharedPointer&lt;Account&gt;)));
</span><span class="cx">     connect(&amp;g_FSHost, SIGNAL(newAccount(QSharedPointer&lt;Account&gt;)), this, SLOT(accountAdd(QSharedPointer&lt;Account&gt;)));
</span><span class="cx">     connect(&amp;g_FSHost, SIGNAL(delAccount(QSharedPointer&lt;Account&gt;)), this, SLOT(accountDel(QSharedPointer&lt;Account&gt;)));
</span><del>-    /*connect(&amp;g_FSHost, SIGNAL(coreLoadingError(QString)), this, SLOT(coreLoadingError(QString)));*/
</del><ins>+    connect(&amp;g_FSHost, SIGNAL(coreLoadingError(QString)), this, SLOT(coreLoadingError(QString)));
</ins><span class="cx"> 
</span><span class="cx">     /* Connect call commands */
</span><span class="cx">     connect(ui-&gt;newCallBtn, SIGNAL(clicked()), this, SLOT(makeCall()));
</span><span class="lines">@@ -163,8 +163,9 @@
</span><span class="cx"> 
</span><span class="cx"> void MainWindow::coreLoadingError(QString err)
</span><span class="cx"> {
</span><del>-    QMessageBox::warning(this, &quot;Error Loading Core...&quot;, err, QMessageBox::Ok);
-    QApplication::exit(255);
</del><ins>+    QMessageBox::critical(this, tr(&quot;Core error!&quot;),
+                          tr(&quot;The core failed to load. Please, ask for help as the softphone will not be useable. Error code: %1&quot;).arg(err),
+                          QMessageBox::Ok);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MainWindow::accountAdd(QSharedPointer&lt;Account&gt; acc)
</span><span class="lines">@@ -283,6 +284,19 @@
</span><span class="cx">     ui-&gt;textEdit-&gt;setText(&quot;Ready to dial and receive calls!&quot;);
</span><span class="cx">     sysTray-&gt;show();
</span><span class="cx">     sysTray-&gt;showMessage(tr(&quot;Status&quot;), tr(&quot;FSComm has initialized!&quot;), QSystemTrayIcon::Information, 5000);
</span><ins>+
+    if (!g_FSHost.isModuleLoaded(&quot;mod_sofia&quot;))
+    {
+        QMessageBox::warning(this, tr(&quot;SIP not available&quot;),
+                             tr(&quot;Sofia could not be loaded, therefore, SIP will not be available.&quot;),
+                             QMessageBox::Ok);
+    }
+    if (!g_FSHost.isModuleLoaded(&quot;mod_portaudio&quot;))
+    {
+        QMessageBox::warning(this, tr(&quot;Audio not available&quot;),
+                             tr(&quot;Portaudio could not be loaded. Please check if mod_portaudio is properly compiled.&quot;),
+                             QMessageBox::Ok);
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MainWindow::paAnswer()
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>