better network_manager detection
This commit is contained in:
parent
161cdf1e49
commit
a1bf7363c7
|
@ -2370,9 +2370,8 @@ class Interface:
|
|||
self.remote_ctrl = None
|
||||
|
||||
if gajim.config.get('networkmanager_support') and dbus_support.supported:
|
||||
try:
|
||||
import network_manager_listener
|
||||
except:
|
||||
if not network_manager_listener.supported:
|
||||
print >> sys.stderr, _('Network Manager support not available')
|
||||
|
||||
self.show_vcard_when_connect = []
|
||||
|
|
|
@ -27,14 +27,15 @@ def device_no_longer_active(self, *args):
|
|||
'listen_to_network_manager') and connection.connected > 1:
|
||||
connection._disconnectedReconnCB()
|
||||
|
||||
supported = False
|
||||
|
||||
try:
|
||||
from common.dbus_support import system_bus
|
||||
|
||||
import dbus
|
||||
import dbus.glib
|
||||
|
||||
bus = system_bus.SystemBus()
|
||||
|
||||
if 'org.freedesktop.NetworkManager' in bus.list_names():
|
||||
supported = True
|
||||
bus.add_signal_receiver(device_no_longer_active,
|
||||
'DeviceNoLongerActive',
|
||||
'org.freedesktop.NetworkManager',
|
||||
|
@ -46,4 +47,3 @@ bus.add_signal_receiver(device_now_active,
|
|||
'org.freedesktop.NetworkManager',
|
||||
'org.freedesktop.NetworkManager',
|
||||
'/org/freedesktop/NetworkManager')
|
||||
|
||||
|
|
Loading…
Reference in New Issue