1
0
mirror of https://github.com/gryf/wicd.git synced 2026-03-18 15:53:32 +01:00
This commit is contained in:
Dan O'Reilly
2009-02-17 23:44:25 -05:00
2 changed files with 15 additions and 21 deletions

View File

@@ -86,23 +86,18 @@ class wrap_exceptions:
try: try:
return f(*args, **kargs) return f(*args, **kargs)
except KeyboardInterrupt: except KeyboardInterrupt:
gobject.source_remove(redraw_tag) #gobject.source_remove(redraw_tag)
loop.quit() loop.quit()
ui.stop() ui.stop()
print "\n"+language['terminated'] print "\n"+language['terminated']
#raise #raise
except DBusException: except DBusException:
gobject.source_remove(redraw_tag) #gobject.source_remove(redraw_tag)
loop.quit() loop.quit()
ui.stop() ui.stop()
print "\n"+language['dbus_fail'] print "\n"+language['dbus_fail']
raise raise
except : except :
# If the UI isn't inactive (redraw_tag wouldn't normally be
# set), then don't try to stop it, just gracefully die.
if redraw_tag != -1:
# Remove update_ui from the event queue
gobject.source_remove(redraw_tag)
# Quit the loop # Quit the loop
loop.quit() loop.quit()
# Zap the screen # Zap the screen
@@ -897,16 +892,15 @@ def main():
('green','dark green','default'), ('green','dark green','default'),
('blue','dark blue','default'), ('blue','dark blue','default'),
('red','dark red','default'), ('red','dark red','default'),
('bold','white','default','bold')]) ('bold','white','black','bold')])
# This is a wrapper around a function that calls another a function that is a # This is a wrapper around a function that calls another a function that is a
# wrapper around a infinite loop. Fun. # wrapper around a infinite loop. Fun.
ui.run_wrapper(run) ui.run_wrapper(run)
def run(): def run():
global loop,redraw_tag global loop
ui.set_mouse_tracking() ui.set_mouse_tracking()
redraw_tag = -1
app = appGUI() app = appGUI()
# Connect signals and whatnot to UI screen control functions # Connect signals and whatnot to UI screen control functions
@@ -919,7 +913,7 @@ def run():
'org.wicd.daemon') 'org.wicd.daemon')
loop = gobject.MainLoop() loop = gobject.MainLoop()
# Update what the interface looks like as an idle function # Update what the interface looks like as an idle function
redraw_tag = gobject.idle_add(app.update_ui) gobject.idle_add(app.update_ui)
# Update the connection status on the bottom every 1.5 s. # Update the connection status on the bottom every 1.5 s.
gobject.timeout_add(1500,app.update_status) gobject.timeout_add(1500,app.update_status)
gobject.idle_add(app.idle_incr) gobject.idle_add(app.idle_incr)

View File

@@ -27,7 +27,7 @@ import subprocess
# VERSIONNUMBER # VERSIONNUMBER
VERSION_NUM = '1.6.0' VERSION_NUM = '1.6.0'
REVISION_NUM = 'unknown' REVISION_NUM = 'unknown'
CURSES_REVNO = 'r273' CURSES_REVNO = 'r274'
try: try:
if not os.path.exists('vcsinfo.py'): if not os.path.exists('vcsinfo.py'):