def _do_import_locked(self, dlgclass, src_radio, dst_rthread):
# An import/export action needs to be done in the absence of any
# other queued changes. So, we make sure that nothing else is
# staged for the thread and lock it up. Then we use the hidden
# interface to queue our own changes before opening it up to the
# rest of the world.
dst_rthread._qlock_when_idle(5) # Suspend job submission when idle
dialog = dlgclass(src_radio, dst_rthread.radio, self.parent_window)
r = dialog.run()
dialog.hide()
if r != gtk.RESPONSE_OK:
dst_rthread._qunlock()
return
count = dialog.do_import(dst_rthread)
LOG.debug("Imported %i" % count)
dst_rthread._qunlock()
if count > 0:
self.editor_changed()
current_editor = self.get_current_editor()
gobject.idle_add(current_editor.prefill)
return count
评论列表
文章目录