Fix some transient parent warnings

This commit is contained in:
Robert Fewell 2017-12-30 17:20:58 +00:00
parent 7c52f9ec43
commit 108f7fbd11
10 changed files with 31 additions and 20 deletions

View File

@ -1197,7 +1197,7 @@ gnc_prefs_connect_one (const gchar *name,
* @return A pointer to the newly created dialog.
*/
static GtkWidget *
gnc_preferences_dialog_create(void)
gnc_preferences_dialog_create(GtkWindow *parent)
{
GtkBuilder *builder;
GtkWidget *dialog, *notebook, *label, *image;
@ -1236,6 +1236,9 @@ gnc_preferences_dialog_create(void)
// Set the style context for this dialog so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(dialog), "GncPreferenceDialog");
/* parent */
gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(parent));
#ifndef REGISTER2_ENABLED
/* Hide preferences that are related to register2 */
box = GTK_WIDGET (gtk_builder_get_object (builder, "label14"));
@ -1425,7 +1428,7 @@ close_handler (gpointer user_data)
* preferences dialog already exists it will be raised to the top of
* the window stack instead of creating a new dialog. */
void
gnc_preferences_dialog (void)
gnc_preferences_dialog (GtkWindow *parent)
{
GtkWidget *dialog;
@ -1437,7 +1440,7 @@ gnc_preferences_dialog (void)
return;
}
dialog = gnc_preferences_dialog_create();
dialog = gnc_preferences_dialog_create(parent);
gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(dialog));
gtk_widget_show(dialog);

View File

@ -60,6 +60,8 @@
#ifndef GNC_DIALOG_PREFERENCES_H
#define GNC_DIALOG_PREFERENCES_H
#include <gtk/gtk.h>
/** This function adds a full page of preferences to the preferences
* dialog. When the dialog is created, the specified widget will be
* pulled from the specified glade file and added to the preferences
@ -100,7 +102,7 @@ void gnc_preferences_add_to_page (const gchar *filename,
* the user. The preferences dialog is a singleton, so if a
* preferences dialog already exists it will be raised to the top of
* the window stack instead of creating a new dialog. */
void gnc_preferences_dialog (void);
void gnc_preferences_dialog (GtkWindow *parent);
#endif
/** @} */

View File

@ -4199,7 +4199,7 @@ gnc_main_window_cmd_edit_paste (GtkAction *action, GncMainWindow *window)
static void
gnc_main_window_cmd_edit_preferences (GtkAction *action, GncMainWindow *window)
{
gnc_preferences_dialog ();
gnc_preferences_dialog (GTK_WINDOW(window));
}
static void

View File

@ -549,7 +549,7 @@ fincalc_init_commodity_gae (GNCAmountEdit *edit)
}
void
gnc_ui_fincalc_dialog_create(void)
gnc_ui_fincalc_dialog_create(GtkWindow *parent)
{
FinCalcDialog *fcd;
GtkWidget *button;
@ -575,6 +575,10 @@ gnc_ui_fincalc_dialog_create(void)
// Set the style context for this dialog so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(fcd->dialog), "GncFinCalcDialog");
/* parent */
if (parent != NULL)
gtk_window_set_transient_for (GTK_WINDOW(fcd->dialog), GTK_WINDOW(parent));
gnc_register_gui_component (DIALOG_FINCALC_CM_CLASS,
NULL, close_handler, fcd);

View File

@ -25,7 +25,7 @@
typedef struct _FinCalcDialog FinCalcDialog;
void gnc_ui_fincalc_dialog_create(void);
void gnc_ui_fincalc_dialog_create(GtkWindow *parent);
void gnc_ui_fincalc_dialog_destroy(FinCalcDialog *fcd);
#endif

View File

@ -375,7 +375,7 @@ get_trans_info (AssocDialog *assoc_dialog)
}
static void
gnc_assoc_dialog_create (AssocDialog *assoc_dialog)
gnc_assoc_dialog_create (GtkWindow *parent, AssocDialog *assoc_dialog)
{
GtkWidget *dialog;
GtkBuilder *builder;
@ -396,6 +396,10 @@ gnc_assoc_dialog_create (AssocDialog *assoc_dialog)
// Set the style context for this dialog so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(dialog), "GncTransAssocDialog");
/* parent */
if (parent != NULL)
gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(parent));
assoc_dialog->view = GTK_WIDGET(gtk_builder_get_object (builder, "treeview"));
path_head = GTK_WIDGET(gtk_builder_get_object (builder, "path-head"));
@ -500,7 +504,7 @@ show_handler (const char *klass, gint component_id,
* Return: nothing *
\********************************************************************/
void
gnc_trans_assoc_dialog ()
gnc_trans_assoc_dialog (GtkWindow *parent)
{
AssocDialog *assoc_dialog;
@ -512,7 +516,7 @@ gnc_trans_assoc_dialog ()
}
assoc_dialog = g_new0 (AssocDialog, 1);
gnc_assoc_dialog_create (assoc_dialog);
gnc_assoc_dialog_create (parent, assoc_dialog);
gnc_register_gui_component (DIALOG_ASSOC_CM_CLASS,
refresh_handler, close_handler,

View File

@ -23,6 +23,6 @@
#ifndef DIALOG_TRANS_ASSOC_H
#define DIALOG_TRANS_ASSOC_H
void gnc_trans_assoc_dialog (void);
void gnc_trans_assoc_dialog (GtkWindow *parent);
#endif

View File

@ -616,7 +616,7 @@ static void
gnc_main_window_cmd_tools_imap_editor (GtkAction *action, GncMainWindowActionData *data)
{
gnc_set_busy_cursor(NULL, TRUE);
gnc_imap_dialog (NULL);
gnc_imap_dialog (GTK_WIDGET (data->window));
gnc_unset_busy_cursor(NULL);
}
@ -624,7 +624,7 @@ static void
gnc_main_window_cmd_tools_trans_assoc (GtkAction *action, GncMainWindowActionData *data)
{
gnc_set_busy_cursor (NULL, TRUE);
gnc_trans_assoc_dialog ();
gnc_trans_assoc_dialog (GTK_WINDOW (data->window));
gnc_unset_busy_cursor (NULL);
}
@ -632,7 +632,7 @@ static void
gnc_main_window_cmd_tools_price_editor (GtkAction *action, GncMainWindowActionData *data)
{
gnc_set_busy_cursor(NULL, TRUE);
gnc_prices_dialog (NULL);
gnc_prices_dialog (GTK_WIDGET (data->window));
gnc_unset_busy_cursor(NULL);
}
@ -640,14 +640,14 @@ static void
gnc_main_window_cmd_tools_commodity_editor (GtkAction *action, GncMainWindowActionData *data)
{
gnc_set_busy_cursor(NULL, TRUE);
gnc_commodities_dialog (NULL);
gnc_commodities_dialog (GTK_WIDGET (data->window));
gnc_unset_busy_cursor(NULL);
}
static void
gnc_main_window_cmd_tools_financial_calculator (GtkAction *action, GncMainWindowActionData *data)
{
gnc_ui_fincalc_dialog_create();
gnc_ui_fincalc_dialog_create(GTK_WINDOW (data->window));
}
static void

View File

@ -361,7 +361,6 @@
</columns>
</object>
<object class="GtkDialog" id="deletion_date_dialog">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Remove Old Prices</property>

View File

@ -21,7 +21,6 @@
</columns>
</object>
<object class="GtkDialog" id="transaction_association_dialog">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="can_default">True</property>