<p>This pull request overhauls commotion-mesh-applet to leverage the new commotionc core "library", which now contains all essential functions needed to establish a commotion network. Commotion-mesh-applet now serves as ONLY a frontend for other Commotion functions, including those automatically invoked by nm-dispatcher-olsrd.  This pull request therefore depends on <a href="https://github.com/opentechinstitute/commotion-linux-py/commit/f37ed66" class="commit-link">opentechinstitute/commotion-linux-py@<tt>f37ed66</tt></a> and <a href="https://github.com/opentechinstitute/nm-dispatcher-olsrd/commit/ce35103ddf5890cd000d76168eb786460b7ce3da" class="commit-link">opentechinstitute/nm-dispatcher-olsrd@<tt>ce35103</tt></a></p>

<p>Fixes issue <a href="https://github.com/opentechinstitute/commotion-mesh-applet/issues/4" class="issue-link" title="Unbound local variable 'ac'">#4</a> , <a href="https://github.com/opentechinstitute/commotion-mesh-applet/issues/6" class="issue-link" title='Ubuntu 13.04 raring, "Show mesh status" fails'>#6</a> , <a href="https://github.com/opentechinstitute/commotion-mesh-applet/issues/7" class="issue-link" title="Move log location">#7</a> , <a href="https://github.com/opentechinstitute/commotion-mesh-applet/issues/16" class="issue-link" title="set infobar to MESSAGE_ERROR when its not connected">#16</a> ; Partially addresses <a href="https://github.com/opentechinstitute/commotion-mesh-applet/issues/9" class="issue-link" title="Add interface for managing settings and profiles">#9</a> , <a href="https://github.com/opentechinstitute/commotion-mesh-applet/issues/12" class="issue-link" title="Integrate driver check into mesh-applet logic">#12</a> </p>

<p>Fixes <a href="https://github.com/opentechinstitute/commotion-linux-py/issues/1" class="issue-link" title="Move log location">opentechinstitute/commotion-linux-py#1</a>, <a href="https://github.com/opentechinstitute/commotion-linux-py/issues/8" class="issue-link" title="Add item in applet menu for opening local apps browser">opentechinstitute/commotion-linux-py#8</a></p>

<p>To test this pull request, all of the following steps must be done for our three supported platforms (Ubuntu 12.04 or later, Ubuntu 11.10 or earlier, and Debian testing):</p>

<ul>
<li> Install the commotion-linux-py, olsrd, python-networkmanager, and commotion-wpasupplicant debian packages from downloads.commotionwireless.net/linux with dpkg -i</li>
<li> On debian, recompile and reinstall the wpasupplicant package with CONFIG_IBSS_RSN=y set in /debian/config/linux. (To do this, apt-get source wpasupplicant, make the change, then dpkg-buildpackage -rfakeroot -uc -b in the root of the extracted source package, and the dpkg -i the newly-rebuilt package)</li>
<li>Log in and log out of a user session to confirm that the applet loads automatically.</li>
<li>Test all menu entries.  Confirm that a signal-strength icon shows up next to any profile that is compatible with an active mesh.  Edit a network profile using the built-in vi-based editor.  Connect to a mesh using the applet menu, and confirm that all mesh status menu options are (a) available, and (b) produce useful information.<br>
</li>
<li>Check /var/log/syslog to confirm that there are log messages coming in from commotion-mesh-applet.<br>
</li>
</ul><p>KNOWN BUGS:</p>

<ul>
<li>Even though olsrd is running properly, it may sometimes fail to get routes when operating in the context of an encrypted mesh. This bug may be in upstream; in any case, it is beyond the scope of this pull request.  If you run into problems testing the applet with an encrypted mesh, try using an unencrypted one.<br>
</li>
<li>The check for IBSS_RSN compatibility doesn't work for debian testing (hence the need to preemptively recompile wpasupplicant on debian).  There is a partial fix in commotion-linux-py's postinst script; watch closely to see if the check fails when installing on debian (which it should)</li>
</ul>

<hr>

<h4>You can merge this Pull Request by running</h4>
<pre>  git pull https://github.com/opentechinstitute/commotion-mesh-applet decompose</pre>
<p>Or view, comment on, or merge it at:</p>
<p>  <a href='https://github.com/opentechinstitute/commotion-mesh-applet/pull/17'>https://github.com/opentechinstitute/commotion-mesh-applet/pull/17</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Added skeleton of fallback system for OSes with old versions of wpa_supplicant</li>
  <li>Added support functions for fallback system, adapted from nm-dispatcher-olsrd functions that should probably be put in a common library</li>
  <li>Fixed typos, finished full implementation of fallback init, and reintegrated the fallback routine into applet_support.py</li>
  <li>Fixed several minor but show-stopping bugs, and added missing line to kill wpa_supplicant.</li>
  <li>Completed full fallback routine, and added exit routine to kill wpa_supplicant and olsrd when the applet exits</li>
  <li>Decomposed fallback routine in preparation for moving it to another file; added robust disconnect routine and associated menu item</li>
  <li>Fixed tiny typo</li>
  <li>Rewired code to use new commotionc module functions; removed redundant functions that now live in the aforementioned module</li>
  <li>Fixed very incorrect subprocess call that invokes the fallback routine</li>
  <li>Debugged icon display logic, which was failing due to several bugs in connection parsing and comparison routines</li>
  <li>Replaced erroneous subprocess call causing applet to become unresponsive after connecting + a bug causing applet crash when not connected</li>
  <li>Fixed typo</li>
  <li>Rewired calls to fallback script to support up/down logic, so as to reduce the # of gksu password prompts</li>
  <li>Added commotion-linux dependency; full path for wpa_supplicant call</li>
  <li>Overhauled logging such that all output is now routed through commotionc, and deposited in one central location</li>
  <li>Added menu option for editing network profiles, backed by gksudo call to vim</li>
  <li>Added context-aware menu items for fns that should only be available when connected to mesh; fixed bug in position of commotionc init</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/opentechinstitute/commotion-mesh-applet/pull/17/files#diff-0">.gitignore</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/opentechinstitute/commotion-mesh-applet/pull/17/files#diff-1">commotion_applet_support.py</a>
    (109)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/opentechinstitute/commotion-mesh-applet/pull/17/files#diff-2">debian/control</a>
    (1)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/opentechinstitute/commotion-mesh-applet/pull/17.patch'>https://github.com/opentechinstitute/commotion-mesh-applet/pull/17.patch</a></li>
  <li><a href='https://github.com/opentechinstitute/commotion-mesh-applet/pull/17.diff'>https://github.com/opentechinstitute/commotion-mesh-applet/pull/17.diff</a></li>
</ul>