mirror of
https://github.com/gryf/wicd.git
synced 2025-12-29 01:42:33 +01:00
add support for nevershow buttons and options
This commit is contained in:
@@ -105,6 +105,9 @@ language['dhcp_failed'] = _('''Connection Failed: Unable to Get IP Address''')
|
||||
language['setting_static_ip'] = _('''Setting static IP addresses...''')
|
||||
language['connecting_to_daemon'] = _('''Connecting to daemon...''')
|
||||
language['automatic_connect'] = _('''Automatically connect to this network''')
|
||||
language['never_connect'] = _('Never connect to this network')
|
||||
language['show_never_connect'] = _('Show never connect networks')
|
||||
language['hide_never_connect'] = _('Hide never connect networks')
|
||||
language['add_new_wired_profile'] = _('''Add a new wired profile''')
|
||||
language['dhcp_client'] = _('''DHCP Client''')
|
||||
language['display_type_dialog'] = _('''Use dBm to measure signal strength''')
|
||||
|
||||
@@ -101,6 +101,7 @@ class WicdDaemon(dbus.service.Object):
|
||||
self.connection_info = [""]
|
||||
self.auto_connecting = False
|
||||
self.prefer_wired = False
|
||||
self.show_never_connect = True
|
||||
self.dhcp_client = 0
|
||||
self.link_detect_tool = 0
|
||||
self.flush_tool = 0
|
||||
@@ -565,6 +566,20 @@ class WicdDaemon(dbus.service.Object):
|
||||
self.config.set("Settings", "prefer_wired", bool(value), write=True)
|
||||
self.prefer_wired = bool(value)
|
||||
|
||||
@dbus.service.method('org.wicd.daemon')
|
||||
def GetShowNeverConnect(self):
|
||||
""" Returns True if show_never_connect is set
|
||||
|
||||
if True then the client will show networks marked as never connect
|
||||
"""
|
||||
return self.show_never_connect
|
||||
|
||||
@dbus.service.method('org.wicd.daemon')
|
||||
def SetShowNeverConnect(self, value):
|
||||
""" Sets the how_never_connect state. """
|
||||
self.config.set("Settings", "show_never_connect", bool(value), write=True)
|
||||
self.show_never_connect = bool(value)
|
||||
|
||||
@dbus.service.method('org.wicd.daemon')
|
||||
def SetConnectionStatus(self, state, info):
|
||||
""" Sets the connection status.
|
||||
@@ -875,6 +890,8 @@ class WicdDaemon(dbus.service.Object):
|
||||
self.SetSudoApp(app_conf.get("Settings", "sudo_app", default=0))
|
||||
self.SetPreferWiredNetwork(app_conf.get("Settings", "prefer_wired",
|
||||
default=False))
|
||||
self.SetShowNeverConnect(app_conf.get("Settings", "show_never_connect",
|
||||
default=True))
|
||||
app_conf.write()
|
||||
|
||||
if os.path.isfile(wireless_conf):
|
||||
@@ -1302,6 +1319,12 @@ class WirelessDaemon(dbus.service.Object):
|
||||
if self.debug_mode:
|
||||
print network["essid"] + ' has profile'
|
||||
if bool(network.get('automatic')):
|
||||
try:
|
||||
if network.get('never'):
|
||||
print network["essid"],'marked never connect'
|
||||
continue
|
||||
except:
|
||||
print network["essid"],'has no never connect value'
|
||||
print 'trying to automatically connect to...' + \
|
||||
network["essid"]
|
||||
self.ConnectWireless(x)
|
||||
@@ -1700,7 +1723,7 @@ def main(argv):
|
||||
if o in ('-n', '--no-poll'):
|
||||
no_poll = True
|
||||
if o in ('-k', '--kill'):
|
||||
kill = True
|
||||
kill = True
|
||||
|
||||
if kill:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user