added module ds cache on a session basis
git-svn-id: file:///home/svn/framework3/trunk@4399 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
ddb22785ee
commit
96a6131bf0
|
@ -73,6 +73,15 @@ class Core
|
|||
}
|
||||
end
|
||||
|
||||
#
|
||||
# Initializes the datastore cache
|
||||
#
|
||||
def initialize(driver)
|
||||
super
|
||||
|
||||
@dscache = {}
|
||||
end
|
||||
|
||||
#
|
||||
# Returns the name of the command dispatcher.
|
||||
#
|
||||
|
@ -91,6 +100,10 @@ class Core
|
|||
if (active_module)
|
||||
active_module.reset_ui
|
||||
|
||||
# Save the module's datastore so that we can load it later
|
||||
# if the module is used again
|
||||
@dscache[active_module.fullname] = active_module.datastore.dup
|
||||
|
||||
self.active_module = nil
|
||||
end
|
||||
|
||||
|
@ -1044,6 +1057,11 @@ class Core
|
|||
# Update the active module
|
||||
self.active_module = mod
|
||||
|
||||
# If a datastore cache exists for this module, then load it up
|
||||
if @dscache[active_module.fullname]
|
||||
active_module.datastore.update(@dscache[active_module.fullname])
|
||||
end
|
||||
|
||||
mod.init_ui(driver.input, driver.output)
|
||||
|
||||
# Update the command prompt
|
||||
|
|
Loading…
Reference in New Issue