From ec1b88bab709c4472304818dc95395112286bce2 Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Mon, 10 Dec 2012 17:59:03 +0000 Subject: Don't run trivial initializations on idle They shouldn't really take any noticable time and they makes the code a mess. --- 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', -- cgit v0.9.1