[tabs] Remove UI components that depend on missing cubes, see #3295979 #3282158
authorDimitri Papadopoulos <dimitri.papadopoulos@cea.fr>
Thu, 14 Nov 2013 13:38:20 +0000
changeset 443 61681ac94bac
parent 442 f281d5661547
child 444 d8d2c665fbbb
[tabs] Remove UI components that depend on missing cubes, see #3295979 #3282158
views/tabs.py
--- a/views/tabs.py	Thu Nov 14 13:34:37 2013 +0000
+++ b/views/tabs.py	Thu Nov 14 13:38:20 2013 +0000
@@ -222,7 +222,7 @@
 ###############################################################################
 ### TABBLABLE COMPONENTS - SCANVIEWER #########################################
 ###############################################################################
-class BrainomicsTabblableSCanViewerQuestion(AbstractBrainomicsTabblable):
+class BrainomicsTabblableScanViewerQuestion(AbstractBrainomicsTabblable):
     __select__ = AbstractBrainomicsTabblable.__select__ & is_instance('Scan')
     __regid__ = 'entity-scan-tab'
 
@@ -231,19 +231,17 @@
 
     def render_content(self, w, **kwargs):
         entity = self.cw_rset.get_entity(0, 0)
-        if 'slices-view' in self._cw.vreg['views']:
-            w(entity.view('slices-view'))
-        else:
-            w(u'<h4>%s</h4>' % self._cw._('The brainoviz cube is required'))
+        w(entity.view('slices-view'))
 
 
 ###############################################################################
 ### REGISTRATION CALLBACK #####################################################
 ###############################################################################
 def registration_callback(vreg):
-    vreg.register_all(globals().values(), __name__, (BrainomicsTabblableTimeline,))
-    try:
-        from cubes.vtimeline import views
+    vreg.register_all(globals().values(), __name__,
+                      (BrainomicsTabblableTimeline,
+                       BrainomicsTabblableScanViewerQuestion))
+    if 'vtimeline' in vreg.config.cubes():
         vreg.register(BrainomicsTabblableTimeline)
-    except ImportError:
-        pass
+    if 'brainoviz' in vreg.config.cubes():
+        vreg.register(BrainomicsTabblableScanViewerQuestion)