mirror of
https://github.com/gryf/wicd.git
synced 2025-12-20 04:48:00 +01:00
- Fixed a crash bug caused by dBm signal strength not being found correctly.
- Fixed a crash caused by an incorrectly named variable in wicd.py.
This commit is contained in:
@@ -562,15 +562,16 @@ class ConnectionWizard(dbus.service.Object):
|
|||||||
strength = int(self.wifi.GetSignalStrength())
|
strength = int(self.wifi.GetSignalStrength())
|
||||||
except:
|
except:
|
||||||
strength = 0
|
strength = 0
|
||||||
print 'returning current signal strength',strength
|
|
||||||
return strength
|
return strength
|
||||||
#end function GetCurrentSignalStrength
|
#end function GetCurrentSignalStrength
|
||||||
|
|
||||||
@dbus.service.method('org.wicd.daemon.wireless')
|
@dbus.service.method('org.wicd.daemon.wireless')
|
||||||
def GetCurrentDBMStrength(self):
|
def GetCurrentDBMStrength(self):
|
||||||
''' returns the current dbm signal strength '''
|
''' returns the current dbm signal strength '''
|
||||||
|
try:
|
||||||
dbm_strength = int(self.wifi.GetDBMStrength())
|
dbm_strength = int(self.wifi.GetDBMStrength())
|
||||||
|
except:
|
||||||
|
dbm_strength = 0
|
||||||
return dbm_strength
|
return dbm_strength
|
||||||
|
|
||||||
@dbus.service.method('org.wicd.daemon.wireless')
|
@dbus.service.method('org.wicd.daemon.wireless')
|
||||||
|
|||||||
7
wicd.py
7
wicd.py
@@ -222,6 +222,7 @@ class TrayIcon():
|
|||||||
self.tr.set_from_file("images/no-signal.png")
|
self.tr.set_from_file("images/no-signal.png")
|
||||||
if daemon.CheckIfConnecting():
|
if daemon.CheckIfConnecting():
|
||||||
self.tr.set_tooltip(language['connecting'])
|
self.tr.set_tooltip(language['connecting'])
|
||||||
|
self.tr.set_from_file(wpath.images + "no-signal.png")
|
||||||
else:
|
else:
|
||||||
self.tr.set_tooltip(language['not_connected'])
|
self.tr.set_tooltip(language['not_connected'])
|
||||||
daemon.SetCurrentInterface('')
|
daemon.SetCurrentInterface('')
|
||||||
@@ -360,7 +361,7 @@ class TrayIcon():
|
|||||||
''' Toggles the wicd GUI '''
|
''' Toggles the wicd GUI '''
|
||||||
if self.gui_win == None:
|
if self.gui_win == None:
|
||||||
self.gui_win = gui.appGui()
|
self.gui_win = gui.appGui()
|
||||||
elif self.gui_win.is_active == False:
|
elif self.gui_win.is_visible == False:
|
||||||
self.gui_win.show_win()
|
self.gui_win.show_win()
|
||||||
else:
|
else:
|
||||||
self.gui_win.exit()
|
self.gui_win.exit()
|
||||||
@@ -474,8 +475,8 @@ def main(argv):
|
|||||||
use_tray = False
|
use_tray = False
|
||||||
|
|
||||||
# Redirect stderr and stdout for logging purposes
|
# Redirect stderr and stdout for logging purposes
|
||||||
sys.stderr = log
|
#sys.stderr = log
|
||||||
sys.stdout = log
|
#sys.stdout = log
|
||||||
|
|
||||||
# Set up the tray icon GUI and backend
|
# Set up the tray icon GUI and backend
|
||||||
tray_icon = TrayIcon(use_tray)
|
tray_icon = TrayIcon(use_tray)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ channel_pattern = re.compile('.*Channel:? ?(\d\d?)',re.DOTALL | re.I | re.M
|
|||||||
strength_pattern = re.compile('.*Quality:?=? ?(\d\d*)',re.DOTALL | re.I | re.M | re.S)
|
strength_pattern = re.compile('.*Quality:?=? ?(\d\d*)',re.DOTALL | re.I | re.M | re.S)
|
||||||
# These next two look a lot a like, altstrength is for Signal level = xx/100,
|
# These next two look a lot a like, altstrength is for Signal level = xx/100,
|
||||||
# which is just an alternate way of displaying link quality, signaldbm is
|
# which is just an alternate way of displaying link quality, signaldbm is
|
||||||
# for displaying actualy signal strength (-xx dBm).
|
# for displaying actual signal strength (-xx dBm).
|
||||||
altstrength_pattern = re.compile('.*Signal level:?=? ?(\d\d*)',re.DOTALL | re.I | re.M | re.S)
|
altstrength_pattern = re.compile('.*Signal level:?=? ?(\d\d*)',re.DOTALL | re.I | re.M | re.S)
|
||||||
signaldbm_pattern = re.compile('.*Signal level:?=? ?(-\d\d*)',re.DOTALL | re.I | re.M | re.S)
|
signaldbm_pattern = re.compile('.*Signal level:?=? ?(-\d\d*)',re.DOTALL | re.I | re.M | re.S)
|
||||||
mode_pattern = re.compile('.*Mode:(.*?)\n',re.DOTALL | re.I | re.M | re.S)
|
mode_pattern = re.compile('.*Mode:(.*?)\n',re.DOTALL | re.I | re.M | re.S)
|
||||||
|
|||||||
Reference in New Issue
Block a user