diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-10 17:59:03 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-14 11:12:23 (GMT) |
commit | ec1b88bab709c4472304818dc95395112286bce2 (patch) | |
tree | 7439e1ba73a5168db87c8dc765dd60085ed53fa4 | |
parent | b70a893e1e1eb759bf10309eb95c12e55f10538b (diff) |
Don't run trivial initializations on idle
They shouldn't really take any noticable time and they
makes the code a mess.
-rwxr-xr-x | src/jarabe/main.py | 49 |
1 files changed, 12 insertions, 37 deletions
diff --git a/src/jarabe/main.py b/src/jarabe/main.py index 0fc08f9..0d305e5 100755 --- a/src/jarabe/main.py +++ b/src/jarabe/main.py @@ -71,38 +71,12 @@ def unfreeze_dcon_cb(): logging.debug('STARTUP: unfreeze_dcon_cb') screen.set_dcon_freeze(0) -def setup_frame_cb(): - logging.debug('STARTUP: setup_frame_cb') - frame.get_view() - -def setup_keyhandler_cb(): - logging.debug('STARTUP: setup_keyhandler_cb') - keyhandler.setup(frame.get_view()) - -def setup_gesturehandler_cb(): - logging.debug('STARTUP: setup_gesturehandler_cb') - gesturehandler.setup(frame.get_view()) - -def setup_cursortracker_cb(): - logging.debug('STARTUP: setup_cursortracker_cb') - cursortracker.setup() - -def setup_journal_cb(): - logging.debug('STARTUP: setup_journal_cb') - journalactivity.start() - -def show_software_updates_cb(): - logging.debug('STARTUP: show_software_updates_cb') +def check_software_updates(): + logging.debug('STARTUP: check_software_updates') if os.path.isfile(os.path.expanduser('~/.sugar-update')): home_window = homewindow.get_instance() home_window.get_home_box().show_software_updates_alert() -def setup_notification_service_cb(): - notifications.init() - -def setup_file_transfer_cb(): - filetransfer.init() - def setup_window_manager(): logging.debug('STARTUP: window_manager') @@ -123,16 +97,17 @@ def bootstrap(): setup_window_manager() launcher.setup() + keyboard.setup() - GObject.idle_add(setup_frame_cb) - GObject.idle_add(setup_keyhandler_cb) - GObject.idle_add(setup_gesturehandler_cb) - GObject.idle_add(setup_journal_cb) - GObject.idle_add(setup_notification_service_cb) - GObject.idle_add(setup_file_transfer_cb) - GObject.idle_add(show_software_updates_cb) + frame_view = frame.get_view() + keyhandler.setup(frame_view) + gesturehandler.setup(frame_view) + notifications.init() + filetransfer.init() - keyboard.setup() + journalactivity.start() + + check_software_updates() def set_fonts(): client = GConf.Client.get_default() @@ -214,7 +189,7 @@ def main(): # even when we initially get blocked on the intro screen GObject.idle_add(unfreeze_dcon_cb) - GObject.idle_add(setup_cursortracker_cb) + cursortracker.setup() # make sure we have the correct cursor in the intro screen # TODO #3204 if subprocess.call('echo $DISPLAY; xsetroot -cursor_name left_ptr', |