Re: [gnome-db] Screenshots: mystery buttons



On 12/4/06, Murray Cumming <murrayc murrayc com> wrote:
On Mon, 2006-12-04 at 11:53 +0100, Vivien Malerba wrote:
[snip]
> This is usefull for example if a user makes several modifications and
> wants to undo a modification at a later time (of course as long as he
> has not comitted his changes).

So, for forms, changes are only written to the database when the user
presses some kind of "Commit" button, not when just moving out of the
entry widget?


There are 3 kinds of forms: the GnomeDbBasicForm, the GnomeDbRawForm and
the GnomeDbForm:
* the GnomeDbBasicForm displays data from parameters in a
GdaParameterList object, and as such has no link with a GdaDataModel
* the GnomeDbRawForm creates a GdaParameterList from the GdaDataModel
to display data from (a GdaParameter per column in the data model) and
then uses a GnomeDbBasicForm on that parameters list (actually it's a
GdaDataModelIter which itself inherits GdaParameterList)
* the GnomeDbForm puts together a GnomeDbRawForm and a "control
toolbar" to perform actions such as move to next row, etc

Internally here is what a GnomeDbRawForm does:
GdaDataModel to display -> create a GdaDataProxy -> create a
GdaDataModelIter from the proxy -> use that object to give to the
GnomeDbBasicForm.

Basically the GnomeDbRawForm's only job then is to keep track of which
row is displayed and update the individual GdaParameters' values from
the current row.

So if the user modifies a value in the form, that value change is made
in the GdaDataProxy object, no actual change is made to the original
GdaDataModel until the user asks for that. This action can be done
using the gda_data_proxy_apply_all_changes() function, or when the
user clicks on the "commit" button (3rd from the left in the
GnomeDbForm's toolbal) if the GnomeDbRawForm is in a GnomeDbForm.

To summarise, the user entered modifications in GnomeDbRaw{Form,Grid}
and GnomeDb{From,Grid} widgets are stored within the GdaDataProxy, and
"propagated" to the original GdaDataModel (the one passed as
constructor to the widgets) only when requested; it's the
GdaDataProxy's job and responsability.

To answer your question, the GdaDataProxy can be configured to
"commit" any change as soon as a change is made using the "autocommit"
property.

Cheers,

Vivien



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