Re: [mlview-list]Completion table and document/DTD association (bug #127125)



Hello Nicolas,

 Well, yes it would be nice to hide the element/attributes completion widget
when completion is not possible.

 When is completion basically not possible ?
They are around two cases when element/attributes name completion
is not possible:

1/when the current selected xml node is not valid
The current selected node can be in a non valid state if
either no DTD is present (neiter internal nor external subset)
or a DTD is present and the current selected node does not
validated against the DTD.

2/when the user has switched off the validation setting key

This implies that the "completion_is_possible" state is  (in the worst case)
specific to each xml node of the document.

We could first the following API :

gboolean
MlViewXMLDocument::is_completion_possible (MlViewXMLDocument *a_this,
                                           xmlNode *a_current_xml_node,
                                           MlViewAppContext *a_ctxt) ;

It would obviously return TRUE if completion is possible, FALSE otherwise.

 Then comes the hidding/showing of the completion widget.
Today, the completion widget is packed in a GtkHPaned widget.
Putting the gutter GtkHPaned at the extreme right hand side would hide
the completion widget.

 But how to trigger the hidding/showing of the completion widget ?
As I said before, the "completion_is_possible" state is specific to each xml
node. So each time the user selects an xml node, we can just hide/show the
completion widget. To achieve this, we can connect to the
MlViewXMLDocument::node_selected signal (in MlViewTreeView::construct()),
test if completion is possible, and show/hide the completion widget accordingly.

Would this proposal suits you ?

Thank you for your time.

Cheers,

Dodji.



Selon Nicolas Centa <nicolas centa free fr>:

> Hello,
> 
> After having been looking at the bug in
> http://bugzilla.gnome.org/show_bug.cgi?id=127125,
> I was asking if it was possible to modify some things in order for the
> completion table 
> to be hidden or to hide itself if it is not usable, when no DTD is
> associated with the document
> (when no completion is possible).
> 
> I think the needs would be simple for the API : the view, or the
> completion table, needs to
> know if completion is possible, if a DTD is associated with a document,
> and needs to receive
> a signal when completion becomes possible (or maybe impossible), when a
> DTD is associated
> with a document. 
> 
> I don't know exactly how to code such an API, and I don't know if it is
> that simple. But I
> think it would be useful for the GUI's usability.
> 
> So I just want to know all your opinions about this problem. 
> 
> Thanks,
> 
> Nicolas Centa
> 
> PS : thanks to Baptiste who has reported the bug.
> 
> _______________________________________________
> Mlview-list mailing list
> Mlview-list gnome org
> http://mail.gnome.org/mailman/listinfo/mlview-list
> 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]