Problems changing Loan Druid- Amendment to Glade or glade-fixup?

Nick manville at doctors.org.uk
Sun Apr 17 11:01:36 EDT 2011


I had a look at the conversion but I just couldn't get gtkbuilder to 
pull the new assistant object out of the glade file in gtkbuilder folder.

The lines I am using in druid.c are:

#define SX_GLADE_FILE "sched-xact.glade"
#define LOAN_DRUID_GLADE_NAME     "Loan Assistant"

GtkBuilder *builder;
GtkAssistant *assistest;

builder =  gnc_builder_add_from_file (SX_GLADE_FILE, LOAN_DRUID_GLADE_NAME);
assistest = GTK_ASSISTANT (gtk_builder_get_object (builder, 
LOAN_DRUID_GLADE_NAME));

and then fails on

g_assert (assistest !=NULL); before I even try to do anything with it.

Any hints on what else needs to be changed just to get this bit to work? 
Is there another file that tells it to look in gtkbuilder not glade (I 
thought that was what gnc_builder_add_from_file was supposed to sort out?)
  Probably a total noob error but can't think what I am missing (Getting 
frustrated as have trawled hard through the file to get it to compile, 
still a lot more work to go though.) I have checked that the new 
sched-xact.glade is appearing in unstable/share/gnucash/gtkbuilder


(And the start of the additions to the sched-xact.glade file:
<object class="GtkAssistant" id="Loan Assistant">
<property name="border_width">12</property>
<property name="title">Loan and Mortgage Repayment Setup</property>
<child>
<object class="GtkLabel" id="loan_intro_pg">
<property name="visible">True</property>
         ....)

On 08/04/11 13:48, Geert Janssens wrote:
> On vrijdag 8 april 2011, Nick wrote:
>> Hi,
>> I'm trying to make some small amendments to the loan druid, when I save
>> the file I find that the xml for commit_pg has it's property
>> "GNOME_EDGE_FINISH" changed to "Edge Finish" every time I save it, which
>> then causes the druid code to collapse at ld_com_new when I get to the
>> final page (That is: the final page of the druid has a Forward, rather
>> than Apply button - the forward is currently pointing at a g-assert
>> (FALSE) in loan-druid.c)
>>
>> I am using Glade 3.6.7. on Ubuntu 10.10.
>>
>> Aside from manually editing this everytime I save the Glade file, does
>> anybody know if I can setup my Glade differently to stop it doing this?
>> Could (should) glade-fixup be changed to incorporate this?
>>
>> Working:
>> <widget class="GnomeDruidPageEdge" id="commit_pg">
>> <property name="visible">True</property>
>> <property name="position">GNOME_EDGE_FINISH</property>
>> <property name="text" translatable="yes">Press apply to commit these
>> changes.</property>
>> </widget>
>>
>> Not working:
>>
>> <widget class="GnomeDruidPageEdge" id="commit_pg">
>> <property name="visible">True</property>
>> <property name="position">Edge Finish</property>
>> <property name="text" translatable="yes">Press apply to commit these
>> changes.</property>
>> </widget>
>>
>> Thanks
>> Nick
>>
>>
> Hi,
>
> I run into the same issue with Glade on Fedora 14, and haven't seen a solution
> yet. I always end up manually fixing that page. And as the GnomeDruid widget
> is a deprecated widget, I doubt the Glade developers will ever fix this.
>
> On that vein, as you are willing to improve the Druid, wouldn't you want to
> convert it to a GtkAssistant at the same time ? You can take a look at my
> recent commits in trunk [1] as an example of the work it takes. In my
> experience there are a few changes, but not too many.
>
> [1] These commits convert the New Account Hierarchy Druid into an Assistant:
> http://svn.gnucash.org/trac/changeset/20529
> http://svn.gnucash.org/trac/changeset/20530
> http://svn.gnucash.org/trac/changeset/20531
> http://svn.gnucash.org/trac/changeset/20532
> http://svn.gnucash.org/trac/changeset/20533
> http://svn.gnucash.org/trac/changeset/20534
>
> Of these, r20531 is relevant, in that GtkAssistant widgets can only be loaded
> with gtkbuilder, so I have created a separate directory for gtkbuilder
> compatible glade files and saved all the glade files in there in gtkbuilder
> format. You can copy most of the widgets from the druid's pages in the
> gtkassistant main vbox and work from there.
>
> r20533 shows the bulk of the change in code, which is 75% replacing the
> libglade/druid specific function calls and header includes with
> gtibuilder/gtkassistant equivalents. The remaining 25% is writing a function
> that is called when the user clicks forward (on_prepare), to set the prepare
> the widgets on the page to be shown.
>
> Let me note on the other hand that the gtkassistant widget doesn't work fully
> well in the Glade interface designer here. The designer has a tendency to add
> empty pages in front of the assistant. So I also have to manually correct the
> glade file after each change (bye removing a number of<placeholder>
> statements).
>
> It would really be great if you would do this conversion while you are working
> in that area. Otherwise it has to happen some time later, because the Druid
> widgets have to go anyway in this development cycle and some effort may have
> to be spent twice.
>
> Geert



More information about the gnucash-devel mailing list