Commits

Adam Coddington  committed 658abd2

Code cleanup; updating application name, etc.

  • Participants
  • Parent commits fe2ed52
  • Branches development

Comments (0)

Files changed (2)

File 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, 0)
+__version__ = (1, 0, 1)
 
 def get_version():
     return '.'.join(str(bit) for bit in __version__)

File push_to_talk_app/application.py

 
         gtk.StatusIcon.__init__(self)
 
-        self.verify_unity_configuration()
+        self.configure_unity()
 
         saved_interface = self.get_saved_interface()
         self.audio_interface = saved_interface if saved_interface else self.INTERFACES[0]
         self.set_visible(True)
         self.start()
 
-    def verify_unity_configuration(self):
-        NAME = 'python'
+    def configure_unity(self):
+        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 NAME not in value:
+            if 'all' not in value and application_name not in value:
                 unpacked = value.unpack()
-                unpacked.append(NAME)
+                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.")
         self.logger.debug(final_xml)
         return final_xml
 
-def configure_unity():
-    pass
-
 def run_from_cmdline():
     parser = OptionParser()
     parser.add_option('-v', '--verbose', dest='verbose', action='store_true', default=False)
-    parser.add_option('--configure-unity', dest='configure_unity', action='store_true', default=False)
     (opts, args, ) = parser.parse_args()
 
     logging.basicConfig(
             level=logging.DEBUG if opts.verbose else logging.WARNING
         )
 
-    if opts.configure_unity:
-        configure_unity()
-    else:
-        PushToTalk()
-        gtk.main()
+    PushToTalk()
+    gtk.main()