Can someone help me make the SLR dialog do what I want?

Tim Wunder tim at thewunders.org
Thu Aug 23 22:53:43 EDT 2007


So after complaining about the new SLR dialog for the millionth time on IRC, I 
was told that I should just send in a patch that makes it do what I want. Not 
being a programmer, I said that it's easier to just whine and complain. 
Regardless, I've decided to take what brain cells I have left and try to use 
them to grok the code behind the SLR dialog. It's not easy. Neither one of my 
brain cells are very keen on cooperating, and that makes it hard to 
concentrate with all the bickering going on. But that's for me and my 
therapist to discuss...

Anyway, what brings me here is the result of some experimenting I did changing 
some things in dialog-sx-since-last-run.c.
The easy thing to change was to get rid of a bit of the geek-speak in the 
dialog by changing the instance state names here:
static char* gnc_sx_instance_state_names[] = {
    N_("Ignored"),
    N_("Postponed"),
    N_("To be Created"),
    N_("Reminder"),
    N_("Automatically Created"),
    NULL
};
That was easy and I liked the result. Encouraged, I sought to reading more of 
the code to see where it builds the list of SXs that get displayed. I want 
only SXs that will be in a Reminder, To Be Created, or Automatically Created 
state to display. I have a lot of SXs and having those that are neither ready 
to be created nor reminders adds unwanted clutter for me. 
While I was looking, I found 
this: "gtk_tree_view_expand_all(dialog->instance_view);" in 
GncSxSinceLastRunDialog*
gnc_ui_sx_since_last_run_dialog(GncSxInstanceModel *sx_instances, GList 
*auto_created_txn_guids)

Both my braincells agreed that this must be where all the SXs get expanded. So 
I decided to comment that out to see what would happen. The result was as 
expected, the dialog displays with none of the SXs expanded. That really 
cleans up the dialog for me. So I got to thinking... there must be a way to 
only expand a certain subset of SXs (like just expand the To Be Created SXs, 
or even just the TBC's that have variables). 

I'm guessing that using gtk_tree_view_expand_row () instead of 
gtk_tree_view_expand_all() would somehow do it, but that's as far as I've 
gotten. My C skills are virtually non-existent, but I'm willing to learn (at 
least enough to accomplish what I want). Anybody care to explain to me how I 
can attack this? Do I need to create a new function that expands only certain 
rows in the list and use that to replace gtk_tree_view_expand_all()? How do I 
do that? 

A gentle nudge in the right direction would be much appreciated. :)

Thanks, 
Tim

P.S. Another thought I had was to display the SXs in a color-coded manner so 
that Automatics could be grey'd (I think the State column is grey'd out 
already), the Reminders could be yellow, the To Be Created without variables 
could be dark green while the To Be Created that have variables could be 
displayd light green. (But that's just a crazy idea my left brain cell 
had...)
-- 
Fedora Core release 6 (Zod), Linux 2.6.22.2-42.fc6
KDE: 3.5.7-9.fc6 Fedora
 22:20:01 up 4 days,  7:24,  3 users,  load average: 0.16, 0.15, 0.16
"It's what you learn after you know it all that counts" John Wooden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20070823/8f29a768/attachment.bin 


More information about the gnucash-devel mailing list