[kupfer] icons: Load kupfer-object in lazy after-display scheduler phase
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [kupfer] icons: Load kupfer-object in lazy after-display scheduler phase
- Date: Tue, 29 Mar 2011 14:24:04 +0000 (UTC)
commit 0dd1558de3200bf96f3ff48bb189bfcf7a8d4868
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Tue Mar 29 16:22:31 2011 +0200
icons: Load kupfer-object in lazy after-display scheduler phase
kupfer/icons.py | 4 ++--
kupfer/scheduler.py | 6 ++++++
2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/kupfer/icons.py b/kupfer/icons.py
index caaa686..5f5d4f2 100644
--- a/kupfer/icons.py
+++ b/kupfer/icons.py
@@ -19,7 +19,7 @@ def _icon_theme_changed(theme):
_default_theme = gtk.icon_theme_get_default()
_default_theme.connect("changed", _icon_theme_changed)
-def load_kupfer_icons(sched=None):
+def load_kupfer_icons(scheduler):
"""Load in kupfer icons from installed files"""
ilist = "art/icon-list"
ilist_file_path = config.get_data_file(ilist)
@@ -40,7 +40,7 @@ def load_kupfer_icons(sched=None):
pretty.print_debug(__name__, "Loading icon", icon_name, "at", size,
"from", icon_path)
-scheduler.GetScheduler().connect("load", load_kupfer_icons)
+scheduler.GetScheduler().connect("after-display", load_kupfer_icons)
def load_plugin_icon(plugin_name, icon_name, icon_data):
"Load icon from @icon_data into the name @icon_name"
diff --git a/kupfer/scheduler.py b/kupfer/scheduler.py
index fab93f6..8519c2b 100644
--- a/kupfer/scheduler.py
+++ b/kupfer/scheduler.py
@@ -25,6 +25,10 @@ class Scheduler (gobject.GObject, pretty.OutputMixin):
def display(self):
self.output_debug("Display")
self.emit("display")
+ gobject.idle_add(self._after_display)
+ def _after_display(self):
+ self.output_debug("After Display")
+ self.emit("after-display")
def finish(self):
self.emit("finish")
gobject.signal_new("load", Scheduler, gobject.SIGNAL_RUN_LAST,
@@ -33,6 +37,8 @@ gobject.signal_new("loaded", Scheduler, gobject.SIGNAL_RUN_LAST,
gobject.TYPE_BOOLEAN, ())
gobject.signal_new("display", Scheduler, gobject.SIGNAL_RUN_LAST,
gobject.TYPE_BOOLEAN, ())
+gobject.signal_new("after-display", Scheduler, gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_BOOLEAN, ())
gobject.signal_new("finish", Scheduler, gobject.SIGNAL_RUN_LAST,
gobject.TYPE_BOOLEAN, ())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]