def do_activate(self):
# application is already running check
if len(StickyManager.stickylist) > 0:
# existing app instance, create a new sticky
st = StickyManager.create_sticky(self)
st.connect("delete-event", self.window_close)
st.btnNew.connect("clicked", self.window_new)
st.show_all()
else:
# new instance, restore saved stickies and show them
StickyManager.restore_stickies(self)
for st in StickyManager.stickylist:
st.connect("delete-event", self.window_close)
st.btnNew.connect("clicked", self.window_new)
st.show_all()
# periodically autosave all stickies
GLib.timeout_add_seconds(4, self.autosaver)
评论列表
文章目录