Commits

Adam Coddington committed b7ccc63

Only attempt to configure unity if the schema for unity can be found.

Comments (0)

Files changed (2)

push_to_talk_app/__init__.py

 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 __author__ = 'Adam Coddington <me@adamcoddington.net>'
-__version__ = (1, 0, 3)
+__version__ = (1, 0, 4)
 
 def get_version():
     return '.'.join(str(bit) for bit in __version__)

push_to_talk_app/application.py

         application_name = 'ptt'
         schema = 'com.canonical.Unity.Panel'
         key = 'systray-whitelist'
-        settings = Gio.Settings(schema)
-        value = settings.get_value(key)
-        if value:
-            if 'all' not in value and application_name not in value:
-                unpacked = value.unpack()
-                unpacked.append(application_name)
-                updated = GLib.Variant('as', unpacked)
-                settings.set_value(key, updated)
-                raise Exception("You must log-out and log-in again for your system tray icon to appear.")
+        if schema in Gio.Settings.list_schemas():
+            settings = Gio.Settings(schema)
+            value = settings.get_value(key)
+            if value:
+                if 'all' not in value and application_name not in value:
+                    unpacked = value.unpack()
+                    unpacked.append(application_name)
+                    updated = GLib.Variant('as', unpacked)
+                    settings.set_value(key, updated)
+                    raise Exception("You must log-out and log-in again for your system tray icon to appear.")
 
     def get_saved_interface(self):
         try: