Author: eallen
Date: 2008-11-26 11:52:44 -0500 (Wed, 26 Nov 2008)
New Revision: 2888
Modified:
mgmt/trunk/cumin/python/cumin/page.py
mgmt/trunk/cumin/python/cumin/pool.py
Log:
Make last pool selected "sticky"
Modified: mgmt/trunk/cumin/python/cumin/page.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/page.py 2008-11-26 16:06:25 UTC (rev 2887)
+++ mgmt/trunk/cumin/python/cumin/page.py 2008-11-26 16:52:44 UTC (rev 2888)
@@ -57,6 +57,9 @@
self.pool = PoolFrame(app, "pool")
self.add_mode(self.pool)
+ self.sticky_pool = Parameter(app, "last_pool")
+ self.add_parameter(self.sticky_pool)
+
self.change_password = ChangePasswordForm(app, "password")
self.add_mode(self.change_password)
@@ -128,6 +131,12 @@
self.__tabs.set_messaging_tab(session)
self.view.set_messaging_mode(session)
+ def set_last_pool(self, session, pool):
+ self.sticky_pool.set(session, pool)
+
+ def get_last_pool(self, session):
+ return self.sticky_pool.get(session)
+
class MainFrameTabs(LinkSet):
def __init__(self, app, name):
super(MainFrameTabs, self).__init__(app, name)
@@ -182,7 +191,11 @@
self.parent.selection.set(session, self.name)
self.page.main.view.grid.show(session)
- pool = self.app.model.get_main_pool()
+ last_pool = self.page.main.get_last_pool(session)
+ if last_pool:
+ pool = model.Pool.get(last_pool)
+ else:
+ pool = self.app.model.get_main_pool()
if pool:
self.page.main.pool.show_object(session, pool)
Modified: mgmt/trunk/cumin/python/cumin/pool.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/pool.py 2008-11-26 16:06:25 UTC (rev 2887)
+++ mgmt/trunk/cumin/python/cumin/pool.py 2008-11-26 16:52:44 UTC (rev 2888)
@@ -47,6 +47,7 @@
def render_content(self, session, data):
pool = Identifiable(data["id"])
+ self.page.main.set_last_pool(session, data["id"])
href = self.frame.pool.get_href(session, pool)
return fmt_link(href, data["name"])
Show replies by date