r16378 - gnucash/trunk/src - Bug#457944: Keep splash screen during file loading.

Josh Sled jsled at cvs.gnucash.org
Thu Aug 2 19:48:05 EDT 2007


Author: jsled
Date: 2007-08-02 19:48:04 -0400 (Thu, 02 Aug 2007)
New Revision: 16378
Trac: http://svn.gnucash.org/trac/changeset/16378

Modified:
   gnucash/trunk/src/bin/gnucash-bin.c
   gnucash/trunk/src/gnome-utils/gnc-file.c
   gnucash/trunk/src/gnome-utils/gnc-splash.c
   gnucash/trunk/src/gnome-utils/gnc-window.c
Log:
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>


Modified: gnucash/trunk/src/bin/gnucash-bin.c
===================================================================
--- gnucash/trunk/src/bin/gnucash-bin.c	2007-08-02 23:41:14 UTC (rev 16377)
+++ gnucash/trunk/src/bin/gnucash-bin.c	2007-08-02 23:48:04 UTC (rev 16378)
@@ -470,7 +470,6 @@
     
     if (!nofile && (fn = get_file_to_load())) {
         gnc_update_splash_screen(_("Loading data..."));
-        gnc_destroy_splash_screen();
         gnc_file_open_file(fn);
         g_free(fn);
     } 

Modified: gnucash/trunk/src/gnome-utils/gnc-file.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-file.c	2007-08-02 23:41:14 UTC (rev 16377)
+++ gnucash/trunk/src/gnome-utils/gnc-file.c	2007-08-02 23:48:04 UTC (rev 16378)
@@ -191,7 +191,6 @@
   const char *fmt, *label;
   gint response;
 
-  gnc_destroy_splash_screen(); /* Just in case */
   if (NULL == newfile) { newfile = _("(null)"); }
 
   switch (io_error)
@@ -668,8 +667,6 @@
                  );
     int rc;
 
-    gnc_destroy_splash_screen(); /* Just in case */
-
     dialog = gtk_message_dialog_new(NULL,
 				    0,
 				    GTK_MESSAGE_WARNING,

Modified: gnucash/trunk/src/gnome-utils/gnc-splash.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-splash.c	2007-08-02 23:41:14 UTC (rev 16377)
+++ gnucash/trunk/src/gnome-utils/gnc-splash.c	2007-08-02 23:48:04 UTC (rev 16378)
@@ -108,6 +108,11 @@
   separator = gtk_hseparator_new();
 
   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..."));
   gtk_label_set_markup(GTK_LABEL(progress), markup);
   g_free(markup);
@@ -150,12 +155,15 @@
 
   if (progress)
   {
-    markup = g_markup_printf_escaped(MARKUP_STRING, string);
-    gtk_label_set_markup (GTK_LABEL(progress), markup);
-    g_free (markup);
+    if(string && strcmp(string, ""))
+    {
+      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 */
-    while (gtk_events_pending ())
-      gtk_main_iteration ();
+      /* make sure new text is up */
+      while (gtk_events_pending ())
+       gtk_main_iteration ();
+    }
   }
 }

Modified: gnucash/trunk/src/gnome-utils/gnc-window.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-window.c	2007-08-02 23:41:14 UTC (rev 16377)
+++ gnucash/trunk/src/gnome-utils/gnc-window.c	2007-08-02 23:48:04 UTC (rev 16378)
@@ -29,6 +29,7 @@
 #include "gnc-engine.h"
 #include "gnc-plugin-page.h"
 #include "gnc-window.h"
+#include "gnc-splash.h"
 
 static QofLogModule log_module = GNC_MOD_GUI;
 
@@ -174,6 +175,8 @@
     return;
   }
 
+  gnc_update_splash_screen(message);
+
   if (percentage < 0) {
     gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progressbar), " ");
     gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar), 0.0);



More information about the gnucash-changes mailing list