Remove unused display_value
review59001
This commit is contained in:
1 parent
dcd15228d2
commit
4c3027400c
13 files changed
+6
-64
No files matched your search
@@ -184,12 +184,6 @@ class Binary(WidgetInterface):
|
||||
self.but_save_as.set_sensitive(bool(field.get(record)))
|
||||
return True
|
||||
|
||||
def display_value(self):
|
||||
if self.wid_text:
|
||||
return self.wid_text.get_text()
|
||||
else:
|
||||
return ''
|
||||
|
||||
def set_value(self, record, field):
|
||||
if self.wid_text:
|
||||
self.filename_field.set_client(self.record,
|
||||
|
||||
@@ -105,9 +105,6 @@ class Calendar(WidgetInterface):
|
||||
self.entry.set_text(value)
|
||||
return True
|
||||
|
||||
def display_value(self):
|
||||
return self.entry.get_text()
|
||||
|
||||
def cal_open(self, widget):
|
||||
win = gtk.Dialog(_('Date Selection'), self.window,
|
||||
gtk.DIALOG_MODAL|gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||
@@ -241,9 +238,6 @@ class DateTime(WidgetInterface):
|
||||
self.entry.set_text(value)
|
||||
return True
|
||||
|
||||
def display_value(self):
|
||||
return self.entry.get_text()
|
||||
|
||||
def cal_open(self, widget):
|
||||
win = gtk.Dialog(_('Date Time Selection'), self.window,
|
||||
gtk.DIALOG_MODAL|gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||
|
||||
@@ -68,18 +68,16 @@ class Char(WidgetInterface):
|
||||
value = ''
|
||||
else:
|
||||
value = field.get(record) or ''
|
||||
self.display_value(value)
|
||||
|
||||
def display_value(self, value):
|
||||
if not self.autocomplete:
|
||||
self.entry.set_text(value)
|
||||
return
|
||||
for idx, row in enumerate(self.entry_store):
|
||||
if row[0] == value:
|
||||
self.entry.set_active(idx)
|
||||
return
|
||||
else:
|
||||
self.entry.get_child().set_text(value)
|
||||
for idx, row in enumerate(self.entry_store):
|
||||
if row[0] == value:
|
||||
self.entry.set_active(idx)
|
||||
return
|
||||
else:
|
||||
self.entry.get_child().set_text(value)
|
||||
|
||||
def _readonly_set(self, value):
|
||||
sensitivity = {True: gtk.SENSITIVITY_OFF, False: gtk.SENSITIVITY_AUTO}
|
||||
|
||||
@@ -29,9 +29,3 @@ class CheckBox(WidgetInterface):
|
||||
self.widget.set_active(False)
|
||||
return False
|
||||
self.widget.set_active(bool(field.get(record)))
|
||||
|
||||
def display_value(self):
|
||||
if self.widget.get_active():
|
||||
return _('True')
|
||||
else:
|
||||
return _('False')
|
||||
@@ -48,9 +48,6 @@ class FloatTime(WidgetInterface):
|
||||
|
||||
self.entry.set_text(common.float_time_to_text(val, self.conv))
|
||||
|
||||
def display_value(self):
|
||||
return self.entry.get_text()
|
||||
|
||||
def _readonly_set(self, value):
|
||||
super(FloatTime, self)._readonly_set(value)
|
||||
self.entry.set_editable(not value)
|
||||
|
||||
@@ -30,9 +30,6 @@ class Integer(Char):
|
||||
self.entry.set_text(locale.format('%d',
|
||||
field.get(record) or 0, True))
|
||||
|
||||
def display_value(self):
|
||||
return self.entry.get_text()
|
||||
|
||||
def sig_insert_text(self, entry, new_text, new_text_length, position):
|
||||
value = entry.get_text()
|
||||
position = entry.get_position()
|
||||
|
||||
@@ -110,9 +110,6 @@ class WidgetInterface(object):
|
||||
self.visible = True
|
||||
widget.show()
|
||||
|
||||
def display_value(self):
|
||||
return self.field.get_client(self.record)
|
||||
|
||||
def _focus_in(self):
|
||||
pass
|
||||
|
||||
|
||||
@@ -194,15 +194,6 @@ class Many2Many(WidgetInterface):
|
||||
self.screen.display()
|
||||
return True
|
||||
|
||||
def display_value(self):
|
||||
ids = self.field.get_default(self.record)
|
||||
try:
|
||||
result = rpc.execute('model', self.attrs['relation'], 'read',
|
||||
ids, ['rec_name'], rpc.CONTEXT)
|
||||
except TrytonServerError:
|
||||
return str(ids)
|
||||
return ', '.join(x['rec_name'] for x in result)
|
||||
|
||||
def set_value(self, record, field):
|
||||
self.screen.current_view.set_value()
|
||||
return True
|
||||
@@ -380,9 +380,6 @@ class One2Many(WidgetInterface):
|
||||
self.screen.display()
|
||||
return True
|
||||
|
||||
def display_value(self):
|
||||
return '<' + self.attrs.get('string', '') + '>'
|
||||
|
||||
def set_value(self, record, field):
|
||||
self.screen.current_view.set_value()
|
||||
if self.screen.modified(): # TODO check if required
|
||||
|
||||
@@ -35,6 +35,3 @@ class ProgressBar(WidgetInterface):
|
||||
self.widget.set_text(locale.format('%.' + str(digits[1]) + 'f',
|
||||
value, True))
|
||||
self.widget.set_fraction(value / 100.0)
|
||||
|
||||
def display_value(self):
|
||||
return self.widget.get_text()
|
||||
@@ -290,10 +290,6 @@ class Reference(WidgetInterface):
|
||||
self.but_open.set_image(img)
|
||||
self.changed = True
|
||||
|
||||
def display_value(self):
|
||||
return self.widget_combo.get_child().get_text() + ', ' + \
|
||||
self.wid_text.get_text()
|
||||
|
||||
def sig_key_pressed(self, *args):
|
||||
key = args[1].string.lower()
|
||||
if self.last_key[0] == key:
|
||||
|
||||
@@ -179,9 +179,6 @@ class Selection(WidgetInterface):
|
||||
child.set_text('')
|
||||
self.changed = True
|
||||
|
||||
def display_value(self):
|
||||
return self.entry.get_child().get_text()
|
||||
|
||||
def sig_changed(self, *args):
|
||||
if self.changed:
|
||||
self._focus_out()
|
||||
@@ -118,10 +118,3 @@ class TextBox(WidgetInterface):
|
||||
elif spell:
|
||||
spell.detach()
|
||||
del spell
|
||||
|
||||
def display_value(self):
|
||||
lines = (self.field.get_client(self.record) or '').split('\n')
|
||||
if len(lines) > 1:
|
||||
return lines[0] + '...'
|
||||
else:
|
||||
return lines[0]
|
||||
Reference in new issue
Block a user