make output of adhoc command selectable. Fixes #3697
This commit is contained in:
parent
c3574bce51
commit
27ca6e13c5
|
@ -172,6 +172,7 @@
|
||||||
<object class="GtkLabel" id="notes_label">
|
<object class="GtkLabel" id="notes_label">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="label" translatable="yes">Please wait while the command is sending...</property>
|
<property name="label" translatable="yes">Please wait while the command is sending...</property>
|
||||||
|
<property name="selectable">True</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
|
|
@ -408,6 +408,7 @@ class CommandWindow:
|
||||||
|
|
||||||
self.data_form_widget.set_sensitive(True)
|
self.data_form_widget.set_sensitive(True)
|
||||||
try:
|
try:
|
||||||
|
self.data_form_widget.selectable = True
|
||||||
self.data_form_widget.data_form = self.dataform
|
self.data_form_widget.data_form = self.dataform
|
||||||
except dataforms.Error:
|
except dataforms.Error:
|
||||||
self.stage5(error=_('Service sent malformed data'),
|
self.stage5(error=_('Service sent malformed data'),
|
||||||
|
|
|
@ -52,6 +52,7 @@ class DataFormWidget(gtk.Alignment, object):
|
||||||
gtk.Alignment.__init__(self, xscale=1.0, yscale=1.0)
|
gtk.Alignment.__init__(self, xscale=1.0, yscale=1.0)
|
||||||
|
|
||||||
self._data_form = None
|
self._data_form = None
|
||||||
|
self.selectable = False
|
||||||
|
|
||||||
self.xml = gtkgui_helpers.get_gtk_builder('data_form_window.ui',
|
self.xml = gtkgui_helpers.get_gtk_builder('data_form_window.ui',
|
||||||
'data_form_vbox')
|
'data_form_vbox')
|
||||||
|
@ -147,7 +148,8 @@ class DataFormWidget(gtk.Alignment, object):
|
||||||
|
|
||||||
self.clean_data_form()
|
self.clean_data_form()
|
||||||
|
|
||||||
self.singleform = SingleForm(self._data_form)
|
self.singleform = SingleForm(self._data_form,
|
||||||
|
selectable=self.selectable)
|
||||||
def _on_validated(widget):
|
def _on_validated(widget):
|
||||||
self.emit('validated')
|
self.emit('validated')
|
||||||
self.singleform.connect('validated', _on_validated)
|
self.singleform.connect('validated', _on_validated)
|
||||||
|
@ -314,7 +316,7 @@ class SingleForm(gtk.Table, object):
|
||||||
validated = (gobject.SIGNAL_RUN_LAST | gobject.SIGNAL_ACTION, None, ())
|
validated = (gobject.SIGNAL_RUN_LAST | gobject.SIGNAL_ACTION, None, ())
|
||||||
)
|
)
|
||||||
|
|
||||||
def __init__(self, dataform):
|
def __init__(self, dataform, selectable=False):
|
||||||
assert isinstance(dataform, dataforms.SimpleDataForm)
|
assert isinstance(dataform, dataforms.SimpleDataForm)
|
||||||
|
|
||||||
gtk.Table.__init__(self)
|
gtk.Table.__init__(self)
|
||||||
|
@ -368,6 +370,7 @@ class SingleForm(gtk.Table, object):
|
||||||
|
|
||||||
commonwidget = False
|
commonwidget = False
|
||||||
widget = gtk.Label(field.value)
|
widget = gtk.Label(field.value)
|
||||||
|
widget.set_property('selectable', selectable)
|
||||||
widget.set_line_wrap(True)
|
widget.set_line_wrap(True)
|
||||||
self.attach(widget, leftattach, rightattach, linecounter,
|
self.attach(widget, leftattach, rightattach, linecounter,
|
||||||
linecounter+1, xoptions=gtk.FILL, yoptions=gtk.FILL)
|
linecounter+1, xoptions=gtk.FILL, yoptions=gtk.FILL)
|
||||||
|
@ -506,7 +509,13 @@ class SingleForm(gtk.Table, object):
|
||||||
textwidget.get_buffer().connect('changed',
|
textwidget.get_buffer().connect('changed',
|
||||||
self.on_text_multi_textbuffer_changed, field)
|
self.on_text_multi_textbuffer_changed, field)
|
||||||
textwidget.get_buffer().set_text(field.value)
|
textwidget.get_buffer().set_text(field.value)
|
||||||
textwidget.set_sensitive(readwrite)
|
if readwrite:
|
||||||
|
textwidget.set_sensitive(True)
|
||||||
|
else:
|
||||||
|
if selectable:
|
||||||
|
textwidget.set_editable(True)
|
||||||
|
else:
|
||||||
|
textwidget.set_sensitive(False)
|
||||||
|
|
||||||
widget = gtk.ScrolledWindow()
|
widget = gtk.ScrolledWindow()
|
||||||
widget.add(textwidget)
|
widget.add(textwidget)
|
||||||
|
@ -535,6 +544,7 @@ class SingleForm(gtk.Table, object):
|
||||||
else:
|
else:
|
||||||
commonwidget=False
|
commonwidget=False
|
||||||
widget = gtk.Label(field.value)
|
widget = gtk.Label(field.value)
|
||||||
|
widget.set_property('selectable', selectable)
|
||||||
widget.set_sensitive(True)
|
widget.set_sensitive(True)
|
||||||
widget.set_alignment(0.0, 0.5)
|
widget.set_alignment(0.0, 0.5)
|
||||||
widget=decorate_with_tooltip(widget, field)
|
widget=decorate_with_tooltip(widget, field)
|
||||||
|
|
Loading…
Reference in New Issue