Author: justi9
Date: 2008-04-08 12:35:27 -0400 (Tue, 08 Apr 2008)
New Revision: 1864
Modified:
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/widgets.py
Log:
Reintroduce icons, this time using the ui metadata.
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-04-08 16:25:12 UTC (rev 1863)
+++ mgmt/cumin/python/cumin/model.py 2008-04-08 16:35:27 UTC (rev 1864)
@@ -318,6 +318,9 @@
def get_title(self, session):
return "Object"
+ def get_icon_href(self, session):
+ return "resource?name=action-36.png"
+
def get_object_href(self, session, object):
branch = session.branch()
self.show_object(branch, object)
@@ -472,6 +475,9 @@
#action.title = "Send Ping"
#action.summary = True
+ def get_icon_href(self, session):
+ return "resource?name=system-36.png"
+
def show_object(self, session, system):
return self.cumin_model.show_main(session).show_system(session, system)
@@ -512,6 +518,9 @@
prop = CuminProperty(self, "dataDir")
prop.title = "Data Directory"
+ def get_icon_href(self, session):
+ return "resource?name=broker-36.png"
+
def show_object(self, session, broker):
reg = broker.registrations[0]
return self.cumin_model.show_main(session).show_broker(session, reg)
@@ -709,6 +718,9 @@
def get_title(self, session):
return "Queue"
+ def get_icon_href(self, session):
+ return "resource?name=queue-36.png"
+
def show_object(self, session, queue):
frame = self.cumin_model.show_main(session)
frame = frame.show_broker(session, queue.vhost.broker.registrations[0])
@@ -787,6 +799,9 @@
def get_title(self, session):
return "Exchange"
+ def get_icon_href(self, session):
+ return "resource?name=exchange-36.png"
+
class CuminBinding(RemoteClass):
def __init__(self, model):
super(CuminBinding, self).__init__(model, "binding",
@@ -849,6 +864,9 @@
def get_title(self, session):
return "Client"
+ def get_icon_href(self, session):
+ return "resource?name=client-36.png"
+
def get_object_name(self, client):
return client.address
@@ -981,6 +999,9 @@
def get_title(self, session):
return "Broker Registration"
+ def get_icon_href(self, session):
+ return "resource?name=broker-36.png"
+
def show_object(self, session, reg):
return self.cumin_model.show_main(session).show_broker(session, reg)
@@ -996,6 +1017,9 @@
def get_title(self, session):
return "Broker Group"
+ def get_icon_href(self, session):
+ return "resource?name=group-36.png"
+
class ModelPage(Page):
def __init__(self, app, name):
super(ModelPage, self).__init__(app, name)
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2008-04-08 16:25:12 UTC (rev 1863)
+++ mgmt/cumin/python/cumin/widgets.py 2008-04-08 16:35:27 UTC (rev 1864)
@@ -285,7 +285,8 @@
return cls.get_object_title(session, object)
def render_icon_href(self, session, object):
- return "resource?name=action-36.png"
+ cls = self.app.model.get_class_by_object(object)
+ return cls.get_icon_href(session)
class SummaryProperties(CuminProperties):
def do_get_items(self, session, object):