do not enable zeroconf if avahi or bonjour is not available. Fixes #4891
This commit is contained in:
parent
a802edbf65
commit
f1ae7fc984
|
@ -148,6 +148,15 @@ SHOW_LIST = ['offline', 'connecting', 'online', 'chat', 'away', 'xa', 'dnd',
|
||||||
# zeroconf account name
|
# zeroconf account name
|
||||||
ZEROCONF_ACC_NAME = 'Local'
|
ZEROCONF_ACC_NAME = 'Local'
|
||||||
|
|
||||||
|
HAVE_ZEROCONF = True
|
||||||
|
try:
|
||||||
|
import avahi
|
||||||
|
except ImportError:
|
||||||
|
try:
|
||||||
|
import pybonjour
|
||||||
|
except ImportError:
|
||||||
|
HAVE_ZEROCONF = False
|
||||||
|
|
||||||
HAVE_PYCRYPTO = True
|
HAVE_PYCRYPTO = True
|
||||||
try:
|
try:
|
||||||
import Crypto
|
import Crypto
|
||||||
|
|
|
@ -1499,8 +1499,11 @@ class AccountsWindow:
|
||||||
self.notebook.set_current_page(1)
|
self.notebook.set_current_page(1)
|
||||||
|
|
||||||
def init_zeroconf_account(self):
|
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)
|
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)
|
self.xml.get_widget('zeroconf_notebook').set_sensitive(enable)
|
||||||
# General tab
|
# General tab
|
||||||
st = gajim.config.get_per('accounts', gajim.ZEROCONF_ACC_NAME,
|
st = gajim.config.get_per('accounts', gajim.ZEROCONF_ACC_NAME,
|
||||||
|
|
|
@ -3275,7 +3275,7 @@ class Interface:
|
||||||
gajim.proxy65_manager = proxy65_manager.Proxy65Manager(gajim.idlequeue)
|
gajim.proxy65_manager = proxy65_manager.Proxy65Manager(gajim.idlequeue)
|
||||||
gajim.default_session_type = ChatControlSession
|
gajim.default_session_type = ChatControlSession
|
||||||
self.register_handlers()
|
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] = \
|
gajim.connections[gajim.ZEROCONF_ACC_NAME] = \
|
||||||
connection_zeroconf.ConnectionZeroconf(gajim.ZEROCONF_ACC_NAME)
|
connection_zeroconf.ConnectionZeroconf(gajim.ZEROCONF_ACC_NAME)
|
||||||
for account in gajim.config.get_per('accounts'):
|
for account in gajim.config.get_per('accounts'):
|
||||||
|
|
Loading…
Reference in New Issue