gnucash maint: Multiple changes pushed

Robert Fewell bobit at code.gnucash.org
Thu Feb 13 11:38:11 EST 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/b23d2445 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/7577afe0 (commit)
	from  https://github.com/Gnucash/gnucash/commit/f66b7ed2 (commit)



commit b23d2445fc6b437b41f11740cdae5dd012f7b9dd
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Feb 13 16:34:25 2020 +0000

    New budgets save state information with no changes
    
    If you create a new budget and do not change any thing when closing the
    budget or quitting with new budget open the state information for that
    budget is saved but the budget is not. To fix this make a change to the
    new budget description to force the save of the new budget.

diff --git a/gnucash/gnome/gnc-plugin-budget.c b/gnucash/gnome/gnc-plugin-budget.c
index 2056afe2a..ff50121e2 100644
--- a/gnucash/gnome/gnc-plugin-budget.c
+++ b/gnucash/gnome/gnc-plugin-budget.c
@@ -149,11 +149,19 @@ gnc_plugin_budget_cmd_new_budget (GtkAction *action,
 {
     GncBudget *budget;
     GncPluginPage *page;
+    gchar *description, *date;
 
     g_return_if_fail (user_data != NULL);
 
     budget = gnc_budget_new (gnc_get_current_book());
     page = gnc_plugin_page_budget_new (budget);
+
+    date = qof_print_date (gnc_time (NULL));
+    description = g_strdup_printf ("%s: %s",  _("Created"), date);
+    gnc_budget_set_description (budget, description);
+    g_free (description);
+    g_free (date);
+
     gnc_main_window_open_page (user_data->window, page);
 }
 

commit 7577afe0a9e6353dce2de2e99e7973dbd8ad2319
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Feb 13 15:00:54 2020 +0000

    Bug 796911 - Minimum window width to large.
    
    This is down to the amount of information that is displayed on the
    register status bar which can also be influenced by the type of
    register being displayed. To fix this the text labels used have been
    enabled to ellipsize at the end and also the displayed information has
    been added to a tooltip. So for example the minimum app size was
    957x736 and after the changes it can be 610x475.

diff --git a/gnucash/gnome/gnc-split-reg.c b/gnucash/gnome/gnc-split-reg.c
index 599a16705..12dcfe5e5 100644
--- a/gnucash/gnome/gnc-split-reg.c
+++ b/gnucash/gnome/gnc-split-reg.c
@@ -511,10 +511,17 @@ gsr_update_summary_label( GtkWidget *label,
 {
     gnc_numeric amount;
     char string[256];
+    const gchar *label_str = NULL;
+    GtkWidget *text_label, *hbox;
+    gchar *tooltip;
 
     if ( label == NULL )
         return;
 
+    hbox = g_object_get_data (G_OBJECT(label), "text_box");
+    text_label = g_object_get_data (G_OBJECT(label), "text_label");
+    label_str = gtk_label_get_text (GTK_LABEL(text_label));
+
     amount = (*getter)( leader );
 
     if ( reverse )
@@ -534,6 +541,13 @@ gsr_update_summary_label( GtkWidget *label,
 
     gnc_set_label_color( label, amount );
     gtk_label_set_text( GTK_LABEL(label), string );
+
+    if (label_str)
+    {
+        tooltip = g_strdup_printf ("%s %s", label_str, string);
+        gtk_widget_set_tooltip_text (GTK_WIDGET(hbox), tooltip);
+        g_free (tooltip);
+    }
 }
 
 static
@@ -2418,7 +2432,7 @@ GtkWidget*
 add_summary_label (GtkWidget *summarybar, gboolean pack_start, const char *label_str, GtkWidget *extra)
 {
     GtkWidget *hbox;
-    GtkWidget *label;
+    GtkWidget *text_label, *secondary_label;
 
     hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
     gtk_box_set_homogeneous (GTK_BOX (hbox), FALSE);
@@ -2427,18 +2441,21 @@ add_summary_label (GtkWidget *summarybar, gboolean pack_start, const char *label
     else
         gtk_box_pack_end( GTK_BOX(summarybar), hbox, FALSE, FALSE, 5 );
 
-    label = gtk_label_new( label_str );
-    gnc_label_set_alignment(label, 1.0, 0.5 );
-    gtk_box_pack_start( GTK_BOX(hbox), label, FALSE, FALSE, 0 );
+    text_label = gtk_label_new (label_str);
+    gnc_label_set_alignment (text_label, 1.0, 0.5 );
+    gtk_label_set_ellipsize (GTK_LABEL(text_label), PANGO_ELLIPSIZE_END);
+    gtk_box_pack_start (GTK_BOX(hbox), text_label, FALSE, FALSE, 0);
 
-    label = gtk_label_new( "" );
-    gnc_label_set_alignment(label, 1.0, 0.5 );
-    gtk_box_pack_start( GTK_BOX(hbox), label, FALSE, FALSE, 0 );
+    secondary_label = gtk_label_new ( "" );
+    g_object_set_data (G_OBJECT(secondary_label), "text_label", text_label);
+    g_object_set_data (G_OBJECT(secondary_label), "text_box", hbox);
+    gnc_label_set_alignment (secondary_label, 1.0, 0.5 );
+    gtk_box_pack_start (GTK_BOX(hbox), secondary_label, FALSE, FALSE, 0);
 
     if (extra != NULL)
         gtk_box_pack_start( GTK_BOX(hbox), extra, FALSE, FALSE, 0 );
 
-    return label;
+    return secondary_label;
 }
 
 static void



Summary of changes:
 gnucash/gnome/gnc-plugin-budget.c |  8 ++++++++
 gnucash/gnome/gnc-split-reg.c     | 33 +++++++++++++++++++++++++--------
 2 files changed, 33 insertions(+), 8 deletions(-)



More information about the gnucash-changes mailing list