mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Introduced gwrapped gnc_gnome_locate_data_file().=
This was supposed to go with r12942. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@12945 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
ed3b1e3ab9
commit
109f82f964
@ -42,10 +42,6 @@
|
||||
static QofLogModule log_module = GNC_MOD_GUI;
|
||||
static GnomeProgram *gnucash_program = NULL;
|
||||
|
||||
static const struct poptOption nullPoptTable[] = {
|
||||
{ NULL, 0, 0, NULL, 0 }
|
||||
};
|
||||
|
||||
char *
|
||||
gnc_gnome_locate_pixmap (const char *name)
|
||||
{
|
||||
@ -64,6 +60,19 @@ gnc_gnome_locate_pixmap (const char *name)
|
||||
return fullname;
|
||||
}
|
||||
|
||||
char *
|
||||
gnc_gnome_locate_file (GnomeFileDomain domain, const char *name)
|
||||
{
|
||||
char *fullname;
|
||||
|
||||
g_return_val_if_fail(name, NULL);
|
||||
fullname = gnome_program_locate_file(gnucash_program,
|
||||
domain, name, TRUE, NULL);
|
||||
if (!fullname)
|
||||
PERR ("Could not locate file %s", name);
|
||||
return fullname;
|
||||
}
|
||||
|
||||
char *
|
||||
gnc_gnome_locate_data_file (const char *name)
|
||||
{
|
||||
@ -121,7 +130,7 @@ gnc_gnome_init (int argc, char **argv, const char * version)
|
||||
gnc_gtk_add_rc_file();
|
||||
gnucash_program = gnome_program_init(
|
||||
"gnucash", version, LIBGNOMEUI_MODULE,
|
||||
argc, argv, GNOME_PARAM_POPT_TABLE, nullPoptTable,
|
||||
argc, argv,
|
||||
GNOME_PROGRAM_STANDARD_PROPERTIES, GNOME_PARAM_NONE);
|
||||
|
||||
/* initialization required for gtkhtml */
|
||||
|
@ -35,6 +35,8 @@
|
||||
#ifndef GNC_GNOME_UTILS_H
|
||||
#define GNC_GNOME_UTILS_H
|
||||
|
||||
#include <libgnome/libgnome.h>
|
||||
|
||||
/** Initialize the Gnome libraries. */
|
||||
void gnc_gnome_init (int argc, char **argv, const char * version);
|
||||
|
||||
@ -83,6 +85,20 @@ char *gnc_gnome_locate_data_file (const char *name);
|
||||
*/
|
||||
char *gnc_gnome_locate_ui_file (const char *name);
|
||||
|
||||
/** Given a file name, find the file in the directories associated
|
||||
* with the given file domain. This routine will display an error
|
||||
* message if it can't find the file.
|
||||
*
|
||||
* @param doamin The GnomeFileDomain, e.g. GNOME_FILE_DOMAIN_APP_HELP
|
||||
*
|
||||
* @param name The name of the file to be found.
|
||||
*
|
||||
* @return the full path name of the file, or NULL of the file can't
|
||||
* be found.
|
||||
*
|
||||
* @note It is the caller's responsibility to free the returned string.
|
||||
*/
|
||||
char *gnc_gnome_locate_file (GnomeFileDomain domain, const char *name);
|
||||
|
||||
/** Launch the default gnome help browser and open to a given link
|
||||
* within a given file. This routine will display an error message
|
||||
|
@ -493,4 +493,12 @@ if they say 'Yes'. The return is false if the user says 'Cancel'.")
|
||||
'(((<gw:mchars> caller-owned const) message)
|
||||
(<gw:double> percentage))
|
||||
"Set the progressbar window from the given GncWindow.")
|
||||
|
||||
(gw:wrap-function
|
||||
ws
|
||||
'gnc:gnome-locate-data-file
|
||||
'(<gw:mchars> caller-owned)
|
||||
"gnc_gnome_locate_data_file"
|
||||
'(((<gw:mchars> caller-owned const) name))
|
||||
"Find the file in the application data directory.")
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user