Remove wicd plugin
Unmaintained and not working
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
from .wicd_support import WicdPlugin
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
[info]
|
|
||||||
name: Wicd support
|
|
||||||
short_name: wicd_support
|
|
||||||
version: 1.2.1
|
|
||||||
description: Support for autodetecting network status from Wicd network connection manager.
|
|
||||||
Requires wicd and python-dbus.
|
|
||||||
authors = Denis Fomin <fominde@gmail.com>
|
|
||||||
homepage = https://dev.gajim.org/gajim/gajim-plugins/wikis/WicdSupportPlugin
|
|
||||||
min_gajim_version: 1.1.91
|
|
||||||
max_gajim_version: 1.2.90
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 608 B |
@@ -1,77 +0,0 @@
|
|||||||
import os
|
|
||||||
|
|
||||||
from gajim.common import app
|
|
||||||
from gajim.common import dbus_support
|
|
||||||
|
|
||||||
from gajim.plugins import GajimPlugin
|
|
||||||
from gajim.plugins.helpers import log_calls
|
|
||||||
from gajim.plugins.plugins_i18n import _
|
|
||||||
|
|
||||||
|
|
||||||
class WicdPlugin(GajimPlugin):
|
|
||||||
@log_calls('WicdPlugin')
|
|
||||||
def init(self):
|
|
||||||
self.description = _(
|
|
||||||
'Support for autodetection of network status '
|
|
||||||
'for Wicd Network Manager.\nRequires wicd and python-dbus.')
|
|
||||||
self.config_dialog = None
|
|
||||||
self.test_activatable()
|
|
||||||
|
|
||||||
def test_activatable(self):
|
|
||||||
self.available_text = ''
|
|
||||||
if os.name == 'nt':
|
|
||||||
self.available_text = _('Plugin can\'t be run under Windows.')
|
|
||||||
self.activatable = False
|
|
||||||
return
|
|
||||||
if not dbus_support.supported:
|
|
||||||
self.activatable = False
|
|
||||||
self.available_text += _('python-dbus is missing! '
|
|
||||||
'Install python-dbus.')
|
|
||||||
|
|
||||||
@log_calls('WicdPlugin')
|
|
||||||
def activate(self):
|
|
||||||
try:
|
|
||||||
import dbus
|
|
||||||
from gajim.common.dbus_support import system_bus
|
|
||||||
|
|
||||||
self.bus = system_bus.bus()
|
|
||||||
|
|
||||||
if 'org.wicd.daemon' not in self.bus.list_names():
|
|
||||||
return
|
|
||||||
wicd_object = self.bus.get_object('org.wicd.daemon',
|
|
||||||
'/org/wicd/daemon')
|
|
||||||
self.props = dbus.Interface(wicd_object,
|
|
||||||
'org.freedesktop.DBus.Properties')
|
|
||||||
self.bus.add_signal_receiver(self.state_changed,
|
|
||||||
'StatusChanged',
|
|
||||||
'org.wicd.daemon',
|
|
||||||
'org.wicd.daemon',
|
|
||||||
'/org/wicd/daemon')
|
|
||||||
except dbus.DBusException:
|
|
||||||
pass
|
|
||||||
|
|
||||||
@log_calls('WicdPlugin')
|
|
||||||
def deactivate(self):
|
|
||||||
self.bus.remove_signal_receiver(self.state_changed,
|
|
||||||
'StatusChanged',
|
|
||||||
'org.wicd.daemon',
|
|
||||||
'org.wicd.daemon',
|
|
||||||
'/org/wicd/daemon')
|
|
||||||
|
|
||||||
def state_changed(self, state, _info):
|
|
||||||
# Connection state constants
|
|
||||||
# NOT_CONNECTED = 0
|
|
||||||
# CONNECTING = 1
|
|
||||||
# WIRELESS = 2
|
|
||||||
# WIRED = 3
|
|
||||||
# SUSPENDED = 4
|
|
||||||
if state in (2, 3):
|
|
||||||
for connection in app.connections.values():
|
|
||||||
if app.config.get_per('accounts', connection.name,
|
|
||||||
'listen_to_network_manager') and connection.time_to_reconnect:
|
|
||||||
connection._reconnect()
|
|
||||||
else:
|
|
||||||
for connection in app.connections.values():
|
|
||||||
if app.config.get_per('accounts', connection.name,
|
|
||||||
'listen_to_network_manager') and connection.connected > 1:
|
|
||||||
connection._disconnectedReconnCB()
|
|
||||||
Reference in New Issue
Block a user