Replace GtkLabel with a GtkTextView within a GtkScrolledWindow for error summary for csv account import so that window doesn't get larger than screen with large error messages.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22814 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
J. Alex Aycinena
2013-02-27 23:31:35 +00:00
parent 9b9409ece5
commit 3b9a438507
3 changed files with 20 additions and 6 deletions

View File

@@ -410,10 +410,13 @@ csv_import_assistant_summary_page_prepare (GtkAssistant *assistant,
if (!g_strcmp0(info->error, "") == 0)
{
GtkTextBuffer *buffer;
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (info->summary_error_view));
text = g_strdup_printf(gettext ("Import completed but with errors!\n\nThe number of Accounts added was %u and "
"updated was %u.\n\nSee below for errors..." ), info->num_new, info->num_updates );
errtext = g_strdup_printf ( "%s", info->error);
gtk_label_set_text (GTK_LABEL(info->summary_error), errtext);
gtk_text_buffer_set_text (buffer, errtext, -1);
g_free(errtext);
g_free(info->error);
}
@@ -604,7 +607,7 @@ csv_import_assistant_create (CsvImportInfo *info)
info->finish_label = GTK_WIDGET(gtk_builder_get_object(builder, "end_page"));
/* Summary Page */
info->summary_label = GTK_WIDGET(gtk_builder_get_object(builder, "summary_label"));
info->summary_error = GTK_WIDGET(gtk_builder_get_object(builder, "summary_error"));
info->summary_error_view = GTK_WIDGET(gtk_builder_get_object(builder, "summary_error_view"));
g_signal_connect (G_OBJECT(window), "destroy",
G_CALLBACK (csv_import_assistant_destroy_cb), info);

View File

@@ -341,14 +341,25 @@ Cancel to abort.</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="summary_error">
<object class="GtkScrolledWindow" id="summary_error_scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="wrap">True</property>
<property name="border_width">1</property>
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">etched-in</property>
<child>
<object class="GtkTextView" id="summary_error_view">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_margin">2</property>
<property name="right_margin">2</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>

View File

@@ -49,7 +49,7 @@ typedef struct
GtkWidget *header_row_spin;
GtkWidget *finish_label;
GtkWidget *summary_label;
GtkWidget *summary_error;
GtkWidget *summary_error_view;
gchar *starting_dir;
gchar *file_name;