diff frontends/src/tools/xmlui.py @ 975:b37b1d183ac3

reverted changeset 5c7707c958d8 (revision 969)
author souliane <souliane@mailoo.org>
date Thu, 03 Apr 2014 14:38:48 +0200
parents 5c7707c958d8
children d2e612a45e76
line wrap: on
line diff
--- a/frontends/src/tools/xmlui.py	Wed Apr 02 12:37:32 2014 +0200
+++ b/frontends/src/tools/xmlui.py	Thu Apr 03 14:38:48 2014 +0200
@@ -311,10 +311,6 @@
                     callback_id = node.getAttribute("callback")
                     ctrl = self.widget_factory.createButtonWidget(parent, value, self.onButtonPress)
                     ctrl._xmlui_param_id = (callback_id, [field.getAttribute('name') for field in node.getElementsByTagName("field_back")])
-                elif type_ == "internal_button":
-                    action = node.getAttribute("action")
-                    ctrl = self.widget_factory.createButtonWidget(parent, value, self.onInternalButtonPress)
-                    ctrl._xmlui_param_id = (action, [field.getAttribute('name') for field in node.getElementsByTagName("internal_field")])
                 else:
                     print(_("FIXME FIXME FIXME: widget type [%s] is not implemented") % type_)
                     raise NotImplementedError(_("FIXME FIXME FIXME: type [%s] is not implemented") % type_)
@@ -417,39 +413,6 @@
                 data[escaped] = ctrl['control']._xmluiGetValue()
         self._xmluiLaunchAction(callback_id, data)
 
-    def onInternalButtonPress(self, button):
-        """ Called when an internal XMLUI button is clicked
-        Do the processing associated to the button
-        @param button: the button clicked
-
-        """
-        action, fields = button._xmlui_param_id
-        if action not in ('copy', 'move'):
-            raise NotImplementedError(_("FIXME: XMLUI internal action [%s] is not implemented") % action)
-        source = None
-        for field in fields:
-            widget = self.ctrl_list[field]['control']
-            if not source:
-                source = widget
-                continue
-            if isinstance(widget, ListWidget):
-                if isinstance(source, ListWidget):
-                    values = source._xmluiGetSelectedValues()
-                else:
-                    values = [source._xmluiGetValue()]
-                    if action == 'move':
-                        source._xmluiSetValue('')
-                widget._xmluiAddValues(values, select=True)
-            else:
-                if isinstance(source, ListWidget):
-                    value = u', '.join(source._xmluiGetSelectedValues())
-                else:
-                    value = source._xmluiGetValue()
-                    if action == 'move':
-                        source._xmluiSetValue('')
-                widget._xmluiSetValue(value)
-            source = None
-
     def onFormSubmitted(self, ignore=None):
         """ An XMLUI form has been submited
         call the submit action associated with this form