mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix transient parent for SX since last run... at startup
This commit is contained in:
parent
995c3cf4c3
commit
8986795251
@ -41,6 +41,7 @@
|
||||
#include "dialog-sx-since-last-run.h"
|
||||
|
||||
#include "gnc-prefs.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "gnc-ui-util.h"
|
||||
#include "Query.h"
|
||||
#include "qof.h"
|
||||
@ -847,7 +848,7 @@ gnc_sx_sxsincelast_book_opened(void)
|
||||
|
||||
if (summary.need_dialog)
|
||||
{
|
||||
gnc_ui_sx_since_last_run_dialog(inst_model, auto_created_txns);
|
||||
gnc_ui_sx_since_last_run_dialog (gnc_ui_get_main_window (NULL), inst_model, auto_created_txns);
|
||||
auto_created_txns = NULL;
|
||||
}
|
||||
else
|
||||
@ -858,7 +859,7 @@ gnc_sx_sxsincelast_book_opened(void)
|
||||
return;
|
||||
|
||||
gnc_info_dialog
|
||||
(NULL,
|
||||
(gnc_ui_get_main_window (NULL),
|
||||
ngettext
|
||||
("There are no Scheduled Transactions to be entered at this time. "
|
||||
"(One transaction automatically created)",
|
||||
@ -959,7 +960,7 @@ variable_value_changed_cb(GtkCellRendererText *cell,
|
||||
}
|
||||
|
||||
GncSxSinceLastRunDialog*
|
||||
gnc_ui_sx_since_last_run_dialog(GncSxInstanceModel *sx_instances, GList *auto_created_txn_guids)
|
||||
gnc_ui_sx_since_last_run_dialog (GtkWindow *parent, GncSxInstanceModel *sx_instances, GList *auto_created_txn_guids)
|
||||
{
|
||||
GncSxSinceLastRunDialog *dialog;
|
||||
GtkBuilder *builder;
|
||||
@ -970,6 +971,7 @@ gnc_ui_sx_since_last_run_dialog(GncSxInstanceModel *sx_instances, GList *auto_cr
|
||||
gnc_builder_add_from_file (builder, "dialog-sx.glade", "since_last_run_dialog");
|
||||
|
||||
dialog->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "since_last_run_dialog"));
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog->dialog), parent);
|
||||
|
||||
// Set the style context for this dialog so it can be easily manipulated with css
|
||||
gnc_widget_set_style_context (GTK_WIDGET(dialog->dialog), "GncSxSinceLastRunDialog");
|
||||
|
@ -47,7 +47,7 @@ void gnc_sx_sxsincelast_book_opened(void);
|
||||
/**
|
||||
* Create the since-last-run dialog.
|
||||
**/
|
||||
GncSxSinceLastRunDialog* gnc_ui_sx_since_last_run_dialog(GncSxInstanceModel *sx_instances,
|
||||
GncSxSinceLastRunDialog* gnc_ui_sx_since_last_run_dialog (GtkWindow *parent, GncSxInstanceModel *sx_instances,
|
||||
GList *auto_created_txn_guids);
|
||||
|
||||
#endif
|
||||
|
@ -551,7 +551,7 @@ gnc_main_window_cmd_actions_scheduled_transaction_editor (GtkAction *action, Gnc
|
||||
static void
|
||||
gnc_main_window_cmd_actions_since_last_run (GtkAction *action, GncMainWindowActionData *data)
|
||||
{
|
||||
GncMainWindow *window;
|
||||
GtkWindow *window;
|
||||
GncSxInstanceModel *sx_instances;
|
||||
GncSxSummary summary;
|
||||
GList *auto_created_txns = NULL;
|
||||
@ -560,7 +560,7 @@ gnc_main_window_cmd_actions_since_last_run (GtkAction *action, GncMainWindowActi
|
||||
|
||||
g_return_if_fail (data != NULL);
|
||||
|
||||
window = data->window;
|
||||
window = GTK_WINDOW (data->window);
|
||||
|
||||
if (qof_book_is_readonly(gnc_get_current_book()))
|
||||
{
|
||||
@ -573,18 +573,18 @@ gnc_main_window_cmd_actions_since_last_run (GtkAction *action, GncMainWindowActi
|
||||
gnc_sx_instance_model_effect_change(sx_instances, TRUE, &auto_created_txns, NULL);
|
||||
if (summary.need_dialog)
|
||||
{
|
||||
gnc_ui_sx_since_last_run_dialog(sx_instances, auto_created_txns);
|
||||
gnc_ui_sx_since_last_run_dialog (window, sx_instances, auto_created_txns);
|
||||
auto_created_txns = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (summary.num_auto_create_no_notify_instances == 0)
|
||||
{
|
||||
gnc_info_dialog(GTK_WINDOW (window), "%s", nothing_to_do_msg);
|
||||
gnc_info_dialog (window, "%s", nothing_to_do_msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
gnc_info_dialog(GTK_WINDOW (window), ngettext
|
||||
gnc_info_dialog(window, ngettext
|
||||
/* Translators: %d is the number of transactions. This is a
|
||||
ngettext(3) message. */
|
||||
("There are no Scheduled Transactions to be entered at this time. "
|
||||
|
@ -1456,7 +1456,6 @@
|
||||
</action-widgets>
|
||||
</object>
|
||||
<object class="GtkDialog" id="since_last_run_dialog">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title" translatable="yes">Since Last Run...</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
|
Loading…
Reference in New Issue
Block a user