Discussion:
How to mark a project as modified?
Marco Diego Aurélio Mesquita
2010-02-28 17:01:04 UTC
Permalink
I know the bugzilla is the recommended place to file bugs, but I think
it would be useful to discuss it here.

Steps to reproduce the bug:
Create a new project in glade (3.6.7)
Add a toplvevel window
Save the project
Modify the height or width of the window: glade "mark" the project
as modified.

It doesn't seems to be a complicated bug and I want to fix it myself,
but I need guidance on the code. So, my questions are:
How can I "mark" a project as modified? Which callback (chain) is
called when the user changes a window name? Which callback is called
when the user changes a window width?

Having the answers for these questions would (I think) be enough for
me to fix this bug myself.

Thanks!
_______________________________________________
Glade-devel maillist - Glade-***@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-devel
Tristan Van Berkom
2010-02-28 18:44:23 UTC
Permalink
Post by Marco Diego Aurélio Mesquita
I know the bugzilla is the recommended place to file bugs, but I think
it would be useful to discuss it here.
 Create a new project in glade (3.6.7)
 Add a toplvevel window
 Save the project
 Modify the height or width of the window: glade "mark" the project
as modified.
It doesn't seems to be a complicated bug and I want to fix it myself,
How can I "mark" a project as modified? Which callback (chain) is
called when the user changes a window name? Which callback is called
when the user changes a window width?
Having the answers for these questions would (I think) be enough for
me to fix this bug myself.
Hi,
Thanks for taking a minute to put your hands into Glade,
I cant reproduce your bug running 3.6.7 or newer here
(theres not many bugfixes in trunk unreleased, but some are).

FYI, Whether a project is dirty or not is detected completely by
watching the undo stack of the project
(A list of GladeCommands on the GladeProject).

when we save we mark the current command as the clean
state then walking forward and backward through the commands
updates the project dirty state as needed (the project does it
internally with its command stack).

Try pulling from the master branch of Glade and building that if you
have development versions of GTK+ available to you
(since I cant reproduce your bug, maybe you can check if its fixed by now).

Cheers,
-Tristan

PS: The mailing list is fine to discuss bugs yes, but when unreported
bugs are found, then I need people to actually make the journey to bugzilla
and enter the data into our bug list as well as discussing it, either
here or in bugzilla.
_______________________________________________
Glade-devel maillist - Glade-***@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-devel
Tristan Van Berkom
2010-02-28 21:31:12 UTC
Permalink
Post by Marco Diego Aurélio Mesquita
Post by Tristan Van Berkom
I cant reproduce your bug running 3.6.7 or newer here
 Create a new project
 Add a toplevel window
 Save the project
 Click on the default width checkbox: the project won't be marked as modified.
Thats normal, but could be addressed (maybe I misunderstood your previous
post, I thought the window resize was dirtying the project).

Ok, so we only save builder stuff in builder files, so the rule is GtkBuilder
will choke on anything it doesnt recognize, which is ok since we can verify
the version of GTK+ you are running when loading the version encoded
Glade file.

So a checkbox state that enables/disables editing of a property in the UI
is not a part of that metadata, currently we load the project and if an
"optional" property is non-default, we turn the option on (enable the checkbox),
iirc it updates automatically this way at undo/redo time as well.

If we wanted to introduce metadata that has nothing to do with GtkBuilder,
then we do it in comments (currently we save the naming policy that way
for instance)

So, if we wanted the checkboxes to be part of the project data; we could
create a virtual boolean property on the data model for it and serialize
it as comments, we would need to write some generic code that reads/writes
in comment form at a GladeWidget level (entries along side <property
... /> tags).

I think its alot of task for a not so bad bug, but if you thought it would
be cool thing to do then the comment serialization stuff could come in
handy later ;-)

Cheers,
-Tristan
_______________________________________________
Glade-devel maillist - Glade-***@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-devel
Marco Diego Aurélio Mesquita
2010-02-28 23:35:45 UTC
Permalink
Attached is a patch that fixes the issue. I know that the best place
for it would be the bugzilla, but it is such a trivial patch that I
see no problem in accepting it from here.

Thanks!
Tristan Van Berkom
2010-03-09 19:10:23 UTC
Permalink
Thanks Marco, for now its in git.gnome.org until I manage to pull out
a release..

Cheers,
-Tristan
Post by Marco Diego Aurélio Mesquita
Attached is a patch that fixes the issue. I know that the best place
for it would be the bugzilla, but it is such a trivial patch that I
see no problem in accepting it from here.
Thanks!
_______________________________________________
http://lists.ximian.com/mailman/listinfo/glade-devel
_______________________________________________
Glade-devel maillist - Glade-***@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-devel
Marco Diego Aurélio Mesquita
2010-03-09 21:12:46 UTC
Permalink
Post by Tristan Van Berkom
Thanks Marco, for now its in git.gnome.org until I manage to pull out
a release..
I'm happy to make such contribution.
_______________________________________________
Glade-devel maillist - Glade-***@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-devel

Loading...