Save to URI [Was: Re: gda-dev does not compile]
Derek Atkins
warlord at MIT.EDU
Sun Dec 24 11:09:28 EST 2006
What's the point of the global, static fb_info? In general static
storage is a Bad Idea (TM).
As for the QSF Importer -- I'm not at all surprised that it doesn't
use the GnuCash APIs :( Feel free to change that ;)
-derek
Quoting Mark Johnson <mrj001 at shaw.ca>:
> Phil Longstaff wrote:
>
>>> First, I thought I had found something when I found the function
>>> gtk_file_chooser_set_local_only, but the wretched dialog insists on
>>> trying to display the directory of the entered URI when one clicks
>>> Save. Naturally, such a directory does not exist. Entering
>>> gda://AnActualConection results in an error.
>>>
>>
>> I found that function too and thought it would fix things, but it
>> didn't.
>>
>> I didn't see an error. What I saw was that the returned file looked
>> like /path.../gda%3A%2F%2FAnActualConection. I have some code which
>> looks for "%3A%2F%2F" and then searches around for the URI that was
>> entered. This works, but now means I need to add the sync function to
>> the backend to blow away the current contents of the database and save
>> the new contents. I should have this ready to commit in a few days.
>> This will at least allow saving to a GDA database.
>>
>>
> What version of gtk+ do you have? Mine is 2.8.20. This might
> account for the different behaviour, but does not really help as
> neither works for us.
>
> I have attached a patch against gda-dev (svn 15247), which changes
> the FileChooser to a FileSelection. It can be applied in the gda-dev
> directory. You will need to pass -p1 to patch.
>
> The dialog accepted a URL like gda://MyDatabaseConnection. However,
> as you noted, it does not yet save anything. This code should help
> you to work on that part.
>
> I combined elements of the code from 1.8.12, gda-dev (different OK
> Buttons), and an example from the gnome documentation (used to reduce
> the number of callback functions compared to 1.8.12).
>
> Note that filters did not work in 1.8.12 with the FileSelection; they
> still don't work with this code either.
>
> There are 4 type values that can be passed in. I was unable to find
> a way to get the function called with "Import" type. Note that
> "File->Import->QSF Import" puts up a FileSelection Dialog, but does
> not call the gnc_file_dialog function in gnc-file.c. This suggests
> some redundant code is now present.
>
> This patch may also be useful in allowing users to enter URLs of the
> postgres://XXX sort. I was unable to find an open bug related to
> this problem. Let me know if there is somewhere else I should submit
> this patch for the postgres problem. (I only found 2 bugs for this;
> both closed - 332251 & 329802.)
>
> Mark
>
>
>
--
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
warlord at MIT.EDU PGP key available
More information about the gnucash-devel
mailing list