Author: asterix Date: 2009-03-16 09:43:13 +0100 (Mon, 16 Mar 2009) New Revision: 11167
Modified: trunk/src/common/gajim.py trunk/src/config.py trunk/src/gajim.py Log: do not enable zeroconf if avahi or bonjour is not available. Fixes #4891
Modified: trunk/src/common/gajim.py =================================================================== --- trunk/src/common/gajim.py 2009-03-15 12:11:50 UTC (rev 11166) +++ trunk/src/common/gajim.py 2009-03-16 08:43:13 UTC (rev 11167) @@ -148,6 +148,15 @@ # zeroconf account name ZEROCONF_ACC_NAME = 'Local'
+HAVE_ZEROCONF = True +try: + import avahi +except ImportError: + try: + import pybonjour + except ImportError: + HAVE_ZEROCONF = False + HAVE_PYCRYPTO = True try: import Crypto
Modified: trunk/src/config.py =================================================================== --- trunk/src/config.py 2009-03-15 12:11:50 UTC (rev 11166) +++ trunk/src/config.py 2009-03-16 08:43:13 UTC (rev 11167) @@ -1499,8 +1499,11 @@ self.notebook.set_current_page(1)
def init_zeroconf_account(self): - enable = gajim.config.get('enable_zeroconf') + enable = gajim.config.get('enable_zeroconf') and gajim.HAVE_ZEROCONF self.xml.get_widget('enable_zeroconf_checkbutton2').set_active(enable) + if not gajim.HAVE_ZEROCONF: + self.xml.get_widget('enable_zeroconf_checkbutton2').set_sensitive( + False) self.xml.get_widget('zeroconf_notebook').set_sensitive(enable) # General tab st = gajim.config.get_per('accounts', gajim.ZEROCONF_ACC_NAME,
Modified: trunk/src/gajim.py =================================================================== --- trunk/src/gajim.py 2009-03-15 12:11:50 UTC (rev 11166) +++ trunk/src/gajim.py 2009-03-16 08:43:13 UTC (rev 11167) @@ -3275,7 +3275,7 @@ gajim.proxy65_manager = proxy65_manager.Proxy65Manager(gajim.idlequeue) gajim.default_session_type = ChatControlSession self.register_handlers() - if gajim.config.get('enable_zeroconf'): + if gajim.config.get('enable_zeroconf') and gajim.HAVE_ZEROCONF: gajim.connections[gajim.ZEROCONF_ACC_NAME] = \ connection_zeroconf.ConnectionZeroconf(gajim.ZEROCONF_ACC_NAME) for account in gajim.config.get_per('accounts'):