gnucash maint: Use python 3.3 VirtualEnv on travis.

John Ralls jralls at code.gnucash.org
Sat Jan 23 13:45:51 EST 2016


Updated	 via  https://github.com/Gnucash/gnucash/commit/aa2c1303 (commit)
	from  https://github.com/Gnucash/gnucash/commit/ed8e79c6 (commit)



commit aa2c1303fd642cf5f8de74e2c48e9a68279a7a20
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Jan 23 10:45:36 2016 -0800

    Use python 3.3 VirtualEnv on travis.
    
    Should fix get-pip.py installation failure.

diff --git a/src/app-utils/gnc-sx-instance-model.c b/src/app-utils/gnc-sx-instance-model.c
index cf7472e..ad4a765 100644
--- a/src/app-utils/gnc-sx-instance-model.c
+++ b/src/app-utils/gnc-sx-instance-model.c
@@ -941,14 +941,14 @@ _get_template_split_account(const SchedXaction* sx, const Split *template_split,
                                       NULL);
     if (kvp_val == NULL)
     {
-        GString *err = g_string_new("");
-        g_string_printf(err, "Null account kvp value for SX [%s], cancelling creation.",
-                        xaccSchedXactionGetName(sx));
-        g_critical("%s", err->str);
+        GString *err = g_strdup_printf("Null account kvp value for SX [%s], "
+                                       "cancelling creation.",
+                                       xaccSchedXactionGetName(sx));
+        g_critical("%s", err);
         if (creation_errors != NULL)
             *creation_errors = g_list_append(*creation_errors, err);
         else
-            g_string_free(err, TRUE);
+            g_free(err, TRUE);
         return FALSE;
     }
     acct_guid = kvp_value_get_guid( kvp_val );
@@ -1247,7 +1247,7 @@ create_each_transaction_helper(Transaction *template_txn, void *user_data)
 
     if (err_flag)
     {
-        g_critical("new transaction creation sx [%s]",
+        g_critical("Error in SX transaction [%s], creation aborted.",
                    xaccSchedXactionGetName(sx));
         xaccTransDestroy(new_txn);
         xaccTransCommitEdit(new_txn);
diff --git a/src/gnome/dialog-sx-since-last-run.c b/src/gnome/dialog-sx-since-last-run.c
index 3964e68..9fa3f49 100644
--- a/src/gnome/dialog-sx-since-last-run.c
+++ b/src/gnome/dialog-sx-since-last-run.c
@@ -791,10 +791,36 @@ gnc_sx_slr_tree_model_adapter_new(GncSxInstanceModel *instances)
     return rtn;
 }
 
+static void
+creation_error_dialog (GtkWindow *parent, GList **creation_errors)
+{
+    GList *node = *creation_errors;
+    GtkMessageDialog *dialog = NULL;
+    gchar *message = NULL;
+    if (*creation_errors == NULL) return;
+    for(; node != NULL; node = g_list_next (node))
+    {
+        const gchar *fmt = message == NULL ? "%s%s" : "%s\n%s";
+        gchar *new_msg = g_strdup_printf (fmt, message, node->data);
+        g_free (message);
+        message = new_msg;
+        g_free(node->data);
+    }
+    g_list_free (*creation_errors);
+    creation_errors = NULL;
+    dialog = gtk_message_dialog_new (parent, GTK_DIALOG_MODAL,
+                                     GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
+                                     "%s", message);
+    gtk_dialog_run (dialog);
+    gtk_widget_unref (dialog);
+    g_free (message);
+}
+
 void
 gnc_sx_sxsincelast_book_opened(void)
 {
     GList *auto_created_txns = NULL;
+    GList *creation_errors = NULL;
     GncSxInstanceModel *inst_model;
     GncSxSummary summary;
 
@@ -810,7 +836,8 @@ gnc_sx_sxsincelast_book_opened(void)
     inst_model = gnc_sx_get_current_instances();
     gnc_sx_instance_model_summarize(inst_model, &summary);
     gnc_sx_summary_print(&summary);
-    gnc_sx_instance_model_effect_change(inst_model, TRUE, &auto_created_txns, NULL);
+    gnc_sx_instance_model_effect_change(inst_model, TRUE, &auto_created_txns,
+                                        &creation_errors);
 
     if (summary.need_dialog)
     {
@@ -837,6 +864,8 @@ gnc_sx_sxsincelast_book_opened(void)
     }
     g_list_free(auto_created_txns);
     g_object_unref(G_OBJECT(inst_model));
+    if (creation_errors)
+        creation_error_dialog(&creation_errors);
 }
 
 static void
@@ -1075,6 +1104,7 @@ dialog_destroy_cb(GtkWidget *object, GncSxSinceLastRunDialog *app_dialog)
 static void
 dialog_response_cb(GtkDialog *dialog, gint response_id, GncSxSinceLastRunDialog *app_dialog)
 {
+    GList* creation_errors = NULL;
     switch (response_id)
     {
     case GTK_RESPONSE_OK:
@@ -1108,8 +1138,11 @@ dialog_response_cb(GtkDialog *dialog, gint response_id, GncSxSinceLastRunDialog
         }
     }
     gnc_suspend_gui_refresh();
-    gnc_sx_slr_model_effect_change(app_dialog->editing_model, FALSE, &app_dialog->created_txns, NULL);
+    gnc_sx_slr_model_effect_change(app_dialog->editing_model, FALSE, &app_dialog->created_txns, &creation_errors);
     gnc_resume_gui_refresh();
+    if (creation_errors)
+        creation_error_dialog(&creation_errors);
+
     if (gtk_toggle_button_get_active(app_dialog->review_created_txns_toggle)
             && g_list_length(app_dialog->created_txns) > 0)
     {



Summary of changes:
 src/app-utils/gnc-sx-instance-model.c | 12 ++++++------
 src/gnome/dialog-sx-since-last-run.c  | 37 +++++++++++++++++++++++++++++++++--
 2 files changed, 41 insertions(+), 8 deletions(-)



More information about the gnucash-changes mailing list