Skip to content

Commit

Permalink
Bug 343647 - Keep scrolled report location
Browse files Browse the repository at this point in the history
If you have a large report and have scrolled down to the bottom and
decide to tab to a different page and come back the report is back at
the top. This was due to reloading the report before focusing so change
this so it only loads once, if the report needs refreshing then there
is the reload toolbar button.
  • Loading branch information
Bob-IT committed Nov 28, 2020
1 parent 72d742e commit 161ab69
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gnucash/gnome/gnc-plugin-page-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ typedef struct GncPluginPageReportPrivate

/* The page is in the process of reloading the html */
gboolean reloading;
gboolean loaded;

/// the gnc_html abstraction this PluginPage contains
// gnc_html *html;
Expand Down Expand Up @@ -255,7 +256,8 @@ gnc_plugin_page_report_focus_widget (GncPluginPage *report_plugin_page)
{
GtkWidget *widget = gnc_html_get_webview (priv->html);

gnc_plugin_page_report_load_uri (report_plugin_page);
if (!priv->loaded) // so we only do the load once
gnc_plugin_page_report_load_uri (report_plugin_page);

if (GTK_IS_WIDGET(widget))
{
Expand Down Expand Up @@ -384,6 +386,8 @@ gnc_plugin_page_report_load_uri (GncPluginPage *page)
gnc_html_show_url(priv->html, type, url_location, url_label, 0);
g_free(url_location);

priv->loaded = TRUE;

gnc_plugin_page_report_set_progressbar( page, FALSE );

// this resets the window for the progressbar to NULL
Expand Down Expand Up @@ -460,6 +464,7 @@ gnc_plugin_page_report_create_widget( GncPluginPage *page )
// priv->html = gnc_html_new( topLvl );
priv->html = gnc_html_factory_create_html();
gnc_html_set_parent( priv->html, topLvl );
priv->loaded = FALSE;

gnc_html_history_set_node_destroy_cb(gnc_html_get_history(priv->html),
gnc_plugin_page_report_history_destroy_cb,
Expand Down

0 comments on commit 161ab69

Please sign in to comment.