mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix some transient parent warnings for gnc_launch_assoc
Add a Gtkwindow parent parameter to above function so it can be passed to the error warning dialog.
This commit is contained in:
parent
57eac14d82
commit
e745f4cfee
@ -458,7 +458,7 @@ gnc_gnome_help (const char *file_name, const char *anchor)
|
||||
* toolkit.
|
||||
*/
|
||||
void
|
||||
gnc_launch_assoc (const char *uri)
|
||||
gnc_launch_assoc (GtkWindow *parent, const char *uri)
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSString *uri_str = [NSString stringWithUTF8String: uri];
|
||||
@ -473,14 +473,14 @@ gnc_launch_assoc (const char *uri)
|
||||
return;
|
||||
}
|
||||
|
||||
gnc_error_dialog(NULL, "%s", message);
|
||||
gnc_error_dialog(parent, "%s", message);
|
||||
|
||||
[pool release];
|
||||
return;
|
||||
}
|
||||
#elif defined G_OS_WIN32 /* G_OS_WIN32 */
|
||||
void
|
||||
gnc_launch_assoc (const char *uri)
|
||||
gnc_launch_assoc (GtkWindow *parent, const char *uri)
|
||||
{
|
||||
wchar_t *winuri = NULL;
|
||||
gchar *filename = NULL;
|
||||
@ -506,7 +506,7 @@ gnc_launch_assoc (const char *uri)
|
||||
{
|
||||
const gchar *message =
|
||||
_("GnuCash could not find the associated file");
|
||||
gnc_error_dialog(NULL, "%s:\n%s", message, filename);
|
||||
gnc_error_dialog(parent, "%s:\n%s", message, filename);
|
||||
}
|
||||
g_free (wincmd);
|
||||
g_free (winuri);
|
||||
@ -516,7 +516,7 @@ gnc_launch_assoc (const char *uri)
|
||||
|
||||
#else
|
||||
void
|
||||
gnc_launch_assoc (const char *uri)
|
||||
gnc_launch_assoc (GtkWindow *parent, const char *uri)
|
||||
{
|
||||
GError *error = NULL;
|
||||
gboolean success;
|
||||
@ -550,7 +550,7 @@ gnc_launch_assoc (const char *uri)
|
||||
else
|
||||
error_uri = g_strdup (uri);
|
||||
|
||||
gnc_error_dialog(NULL, "%s\n%s", message, error_uri);
|
||||
gnc_error_dialog(parent, "%s\n%s", message, error_uri);
|
||||
g_free (error_uri);
|
||||
}
|
||||
PERR ("%s", error->message);
|
||||
|
@ -58,13 +58,13 @@ void gnc_gnome_help (const char *file_name,
|
||||
const char *anchor);
|
||||
/** Launch the default gnome browser and open the provided URI.
|
||||
*/
|
||||
void gnc_launch_assoc (const char *uri);
|
||||
void gnc_launch_assoc (GtkWindow *parent, const char *uri);
|
||||
|
||||
/** Set the help callback to 'gnc_book_options_help_cb' to open a help browser
|
||||
* and point it to the Book Options link in the Help file.
|
||||
*/
|
||||
void gnc_options_dialog_set_book_options_help_cb (GNCOptionWin *win);
|
||||
|
||||
|
||||
/** Set the initial values of new book options to values specified in user
|
||||
* preferences.
|
||||
*/
|
||||
|
@ -4449,7 +4449,7 @@ get_file_strsplit (const gchar *partial)
|
||||
static gboolean
|
||||
url_signal_cb (GtkAboutDialog *dialog, gchar *uri, gpointer data)
|
||||
{
|
||||
gnc_launch_assoc (uri);
|
||||
gnc_launch_assoc (GTK_WINDOW(dialog), uri);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -303,7 +303,7 @@ row_selected_cb (GtkTreeView *view, GtkTreePath *path,
|
||||
|
||||
if (uri_out_scheme) // make sure we have a scheme entry
|
||||
{
|
||||
gnc_launch_assoc (uri_out);
|
||||
gnc_launch_assoc (gnc_ui_get_gtk_window(GTK_WIDGET (view)), uri_out);
|
||||
g_free (uri_out_scheme);
|
||||
}
|
||||
else
|
||||
|
@ -1368,7 +1368,7 @@ gsr_default_execassociated_handler (GNCSplitReg *gsr, gpointer data)
|
||||
|
||||
if (uri_scheme) // make sure we have a scheme entry
|
||||
{
|
||||
gnc_launch_assoc (run_uri);
|
||||
gnc_launch_assoc (GTK_WINDOW (gsr->window), run_uri);
|
||||
g_free (uri_scheme);
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user