mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug#457944: Keep splash screen during file loading.
- do not destroy the splash screen during file loading - display which reports are rendered in the progress field of the splash screen Patch from Herbert Thoma <herbert.thoma iis fraunhofer de> git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16378 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
71e8d79a57
commit
5e7e7edf59
@ -470,7 +470,6 @@ inner_main (void *closure, int argc, char **argv)
|
|||||||
|
|
||||||
if (!nofile && (fn = get_file_to_load())) {
|
if (!nofile && (fn = get_file_to_load())) {
|
||||||
gnc_update_splash_screen(_("Loading data..."));
|
gnc_update_splash_screen(_("Loading data..."));
|
||||||
gnc_destroy_splash_screen();
|
|
||||||
gnc_file_open_file(fn);
|
gnc_file_open_file(fn);
|
||||||
g_free(fn);
|
g_free(fn);
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,6 @@ show_session_error (QofBackendError io_error,
|
|||||||
const char *fmt, *label;
|
const char *fmt, *label;
|
||||||
gint response;
|
gint response;
|
||||||
|
|
||||||
gnc_destroy_splash_screen(); /* Just in case */
|
|
||||||
if (NULL == newfile) { newfile = _("(null)"); }
|
if (NULL == newfile) { newfile = _("(null)"); }
|
||||||
|
|
||||||
switch (io_error)
|
switch (io_error)
|
||||||
@ -668,8 +667,6 @@ gnc_post_file_open (const char * filename)
|
|||||||
);
|
);
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
gnc_destroy_splash_screen(); /* Just in case */
|
|
||||||
|
|
||||||
dialog = gtk_message_dialog_new(NULL,
|
dialog = gtk_message_dialog_new(NULL,
|
||||||
0,
|
0,
|
||||||
GTK_MESSAGE_WARNING,
|
GTK_MESSAGE_WARNING,
|
||||||
|
@ -108,6 +108,11 @@ gnc_show_splash_screen (void)
|
|||||||
separator = gtk_hseparator_new();
|
separator = gtk_hseparator_new();
|
||||||
|
|
||||||
progress = gtk_label_new(NULL);
|
progress = gtk_label_new(NULL);
|
||||||
|
/* the set_max_width avoids "bumping" of the splash screen
|
||||||
|
if a long string is given in gnc_update_splash_screen();
|
||||||
|
presumably it would be better to inhibit size change of the
|
||||||
|
top level container, but I don't know how to do this */
|
||||||
|
gtk_label_set_max_width_chars(GTK_LABEL(progress), 50);
|
||||||
markup = g_markup_printf_escaped(MARKUP_STRING, _("Loading..."));
|
markup = g_markup_printf_escaped(MARKUP_STRING, _("Loading..."));
|
||||||
gtk_label_set_markup(GTK_LABEL(progress), markup);
|
gtk_label_set_markup(GTK_LABEL(progress), markup);
|
||||||
g_free(markup);
|
g_free(markup);
|
||||||
@ -150,12 +155,15 @@ gnc_update_splash_screen (const gchar *string)
|
|||||||
|
|
||||||
if (progress)
|
if (progress)
|
||||||
{
|
{
|
||||||
markup = g_markup_printf_escaped(MARKUP_STRING, string);
|
if(string && strcmp(string, ""))
|
||||||
gtk_label_set_markup (GTK_LABEL(progress), markup);
|
{
|
||||||
g_free (markup);
|
markup = g_markup_printf_escaped(MARKUP_STRING, string);
|
||||||
|
gtk_label_set_markup (GTK_LABEL(progress), markup);
|
||||||
|
g_free (markup);
|
||||||
|
|
||||||
/* make sure new text is up */
|
/* make sure new text is up */
|
||||||
while (gtk_events_pending ())
|
while (gtk_events_pending ())
|
||||||
gtk_main_iteration ();
|
gtk_main_iteration ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "gnc-engine.h"
|
#include "gnc-engine.h"
|
||||||
#include "gnc-plugin-page.h"
|
#include "gnc-plugin-page.h"
|
||||||
#include "gnc-window.h"
|
#include "gnc-window.h"
|
||||||
|
#include "gnc-splash.h"
|
||||||
|
|
||||||
static QofLogModule log_module = GNC_MOD_GUI;
|
static QofLogModule log_module = GNC_MOD_GUI;
|
||||||
|
|
||||||
@ -174,6 +175,8 @@ gnc_window_show_progress (const char *message, double percentage)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gnc_update_splash_screen(message);
|
||||||
|
|
||||||
if (percentage < 0) {
|
if (percentage < 0) {
|
||||||
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progressbar), " ");
|
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progressbar), " ");
|
||||||
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar), 0.0);
|
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar), 0.0);
|
||||||
|
Loading…
Reference in New Issue
Block a user