mirror of
https://github.com/gryf/wicd.git
synced 2025-12-20 12:58:07 +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())
|
||||
except:
|
||||
strength = 0
|
||||
print 'returning current signal strength',strength
|
||||
return strength
|
||||
#end function GetCurrentSignalStrength
|
||||
|
||||
@dbus.service.method('org.wicd.daemon.wireless')
|
||||
def GetCurrentDBMStrength(self):
|
||||
''' returns the current dbm signal strength '''
|
||||
|
||||
try:
|
||||
dbm_strength = int(self.wifi.GetDBMStrength())
|
||||
except:
|
||||
dbm_strength = 0
|
||||
return dbm_strength
|
||||
|
||||
@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")
|
||||
if daemon.CheckIfConnecting():
|
||||
self.tr.set_tooltip(language['connecting'])
|
||||
self.tr.set_from_file(wpath.images + "no-signal.png")
|
||||
else:
|
||||
self.tr.set_tooltip(language['not_connected'])
|
||||
daemon.SetCurrentInterface('')
|
||||
@@ -360,7 +361,7 @@ class TrayIcon():
|
||||
''' Toggles the wicd GUI '''
|
||||
if self.gui_win == None:
|
||||
self.gui_win = gui.appGui()
|
||||
elif self.gui_win.is_active == False:
|
||||
elif self.gui_win.is_visible == False:
|
||||
self.gui_win.show_win()
|
||||
else:
|
||||
self.gui_win.exit()
|
||||
@@ -474,8 +475,8 @@ def main(argv):
|
||||
use_tray = False
|
||||
|
||||
# Redirect stderr and stdout for logging purposes
|
||||
sys.stderr = log
|
||||
sys.stdout = log
|
||||
#sys.stderr = log
|
||||
#sys.stdout = log
|
||||
|
||||
# Set up the tray icon GUI and backend
|
||||
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)
|
||||
# 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
|
||||
# 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)
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user