From 9e076ac94e0a1df2adbafe52318ad812b921e094 Mon Sep 17 00:00:00 2001
From: Renaud Le Gac <renaud.legac@free.fr>
Date: Thu, 22 Dec 2011 12:44:23 +0100
Subject: [PATCH] Rename configurator cfg_blabla into to_blabla.

---
 models/widgets.py               |  8 ++++----
 modules/plugin_dbui/__init__.py |  2 +-
 modules/plugin_dbui/navtree.py  | 17 +++++++----------
 3 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/models/widgets.py b/models/widgets.py
index f75d226b..cc59e2ce 100755
--- a/models/widgets.py
+++ b/models/widgets.py
@@ -181,17 +181,17 @@ gridModifier.set_filters(*filters,
 #
 formNode = dbui.Node(T('Forms'), 
                      db.tables, 
-                     lambda tablename: cvtSvc.to_form_panel(db[tablename]))
+                     configurator=lambda tablename: cvtSvc.to_form_panel(db[tablename]))
 
 gridNode = dbui.Node(T('Tables'), 
                      db.tables, 
-                     lambda tablename: cvtSvc.to_grid_panel(db[tablename]))
+                     configurator=lambda tablename: cvtSvc.to_grid_panel(db[tablename]))
 
 reportNode = dbui.Node(T('Reports'),
                        {'report_1': URL(c="reports", f="report_1"),
                         'report_2': (URL(c="reports", f="report_2"), cvtSvc.to_form_items(dummy.foo1))},
-                       dbui.cfg_url_panel,
-                       configurators={'report_2': dbui.cfg_configurable_url_panel})
+                       configurators={'report_1': dbui.to_urlPanel,
+                                      'report_2': dbui.to_panelWithUrlSelector})
 
 viewportModifier = dbui.ViewportModifier()
 viewportModifier.add_node(formNode, gridNode, reportNode)
diff --git a/modules/plugin_dbui/__init__.py b/modules/plugin_dbui/__init__.py
index 2102222d..1e8c57b2 100755
--- a/modules/plugin_dbui/__init__.py
+++ b/modules/plugin_dbui/__init__.py
@@ -23,5 +23,5 @@ from helper import (get_field_validators,
                     is_table_with_foreign_fields)
 from mapper import map_default, map_tabpanel
 from modifier import Spacer, Widget
-from navtree import Node, cfg_configurable_url_panel, cfg_url_panel
+from navtree import Node, to_panelWithUrlSelector, to_urlPanel
 from viewportmodifier import ViewportModifier
\ No newline at end of file
diff --git a/modules/plugin_dbui/navtree.py b/modules/plugin_dbui/navtree.py
index 67135d0d..895a7c1d 100644
--- a/modules/plugin_dbui/navtree.py
+++ b/modules/plugin_dbui/navtree.py
@@ -9,14 +9,11 @@ from gluon import current
 from helper import is_mathjax
 
 
-def cfg_configurable_url_panel(key, value):
-    """ Return the configuration dictionary for a panel displaying
-    an URL. The argument of the URL can be change using a form
-    appearing on the right side. The form is defined by a table
-    of the dummy database.
-
-    The ExtJS widget behind the scene is App.panel.PanelWithConfigurator.
-
+def to_panelWithUrlSelector(key, value):
+    """Return the configuration dictionary for a App.PanelWithUrlSelector.
+    the main panel displays the URL content while the selector panel shows
+    a form allowing to change the URL argument. 
+    
         key
             it the name of the leaf
 
@@ -50,7 +47,7 @@ def cfg_configurable_url_panel(key, value):
     return cfg
 
 
-def cfg_url_panel(key, url):
+def to_urlPanel(key, url):
     """Return the configuration dictionary for an Ext.Panel
     displaying an URL.
     
@@ -85,7 +82,7 @@ class Node(object):
     
     Dedicated configurator can be setup for each node if needed.
     """
-    def __init__(self, text, leaves, configurator, configurators={}, hidden=[]):
+    def __init__(self, text, leaves, configurator=None, configurators={}, hidden=[]):
         """Constructor of the node
         
                 text
-- 
GitLab