Merge branch 'matcher-help' into Bug797275

This commit is contained in:
David Cousens 2019-06-29 13:53:08 +10:00
commit 98cf760c6e
2 changed files with 78 additions and 40 deletions

View File

@ -740,6 +740,9 @@
<action-widget response="-5">ok_button1</action-widget>
</action-widgets>
</object>
<object class="GtkTextBuffer" id="textbuffer1">
<property name="text" translatable="yes">Multiple transaction rows may be selected and a transfer account assigned to all selected rows. Use Ctrl Left Click or Shift-Click to select multiple rows and then Right Click to select a transfer account. Only rows with "A" checked can be added to a selection.</property>
</object>
<object class="GtkTextBuffer" id="textbuffer2">
<property name="text" translatable="yes">This transaction probably requires your intervention or it will be imported unbalanced.</property>
</object>
@ -1095,6 +1098,35 @@
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow 36">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">never</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTextView" id="textview6">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="pixels_above_lines">5</property>
<property name="pixels_below_lines">5</property>
<property name="editable">False</property>
<property name="wrap_mode">word</property>
<property name="left_margin">5</property>
<property name="right_margin">5</property>
<property name="cursor_visible">False</property>
<property name="buffer">textbuffer1</property>
<property name="accepts_tab">False</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">11</property>
<property name="width">2</property>
</packing>
</child>
<child>
<placeholder/>
</child>
@ -1257,9 +1289,9 @@
</object>
</child>
<action-widgets>
<action-widget response="-11">matcher__help</action-widget>
<action-widget response="-6">matcher_cancel</action-widget>
<action-widget response="-5">matcher_ok</action-widget>
<action-widget response="-11">matcher__help</action-widget>
</action-widgets>
</object>
</interface>

View File

@ -113,22 +113,23 @@ static void gnc_gen_trans_assign_transfer_account (
static void gnc_gen_trans_assign_transfer_account_to_selection_cb (
GtkMenuItem *menuitem,
GNCImportMainMatcher *info);
static void gnc_gen_trans_view_popup_menu (GtkTreeView *treeview,
static void gnc_gen_trans_view_popup_menu (
GtkTreeView *treeview,
GdkEvent *event,
GNCImportMainMatcher *info);
static gboolean gnc_gen_trans_onButtonPressed_cb (GtkTreeView *treeview,
static gboolean gnc_gen_trans_onButtonPressed_cb (
GtkTreeView *treeview,
GdkEvent *event,
GNCImportMainMatcher *info);
static gboolean gnc_gen_trans_onPopupMenu_cb (GtkTreeView *treeview,
static gboolean gnc_gen_trans_onPopupMenu_cb (
GtkTreeView *treeview,
GdkEvent *event,
GNCImportMainMatcher *info);
static gboolean view_selection_function (GtkTreeSelection *selection,
static void refresh_model_row (
GNCImportMainMatcher *gui,
GtkTreeModel *model,
GtkTreePath *path,
gboolean path_currently_selected,
gpointer data);
static void refresh_model_row (GNCImportMainMatcher *gui, GtkTreeModel *model,
GtkTreeIter *iter, GNCImportTransInfo *info);
GtkTreeIter *iter,
GNCImportTransInfo *info);
/* end local prototypes */
void gnc_gen_trans_list_delete (GNCImportMainMatcher *info)
@ -243,6 +244,7 @@ on_matcher_help_clicked (GtkButton *button, gpointer user_data)
gnc_builder_add_from_file (builder, "dialog-import.glade", "textbuffer3");
gnc_builder_add_from_file (builder, "dialog-import.glade", "textbuffer4");
gnc_builder_add_from_file (builder, "dialog-import.glade", "textbuffer5");
gnc_builder_add_from_file (builder, "dialog-import.glade", "textbuffer1");
gnc_builder_add_from_file (builder, "dialog-import.glade", "matcher_help_dialog");
if (info->dark_theme == TRUE)
@ -287,7 +289,8 @@ run_account_picker_dialog (GNCImportMainMatcher *info,
g_assert (trans_info);
old_acc = gnc_import_TransInfo_get_destacc (trans_info);
new_acc = gnc_import_select_account (info->main_widget,
new_acc = gnc_import_select_account (
info->main_widget,
NULL,
TRUE,
_("Destination account for the auto-balance split."),
@ -464,7 +467,8 @@ gnc_gen_trans_assign_transfer_account (GtkTreeView *treeview,
}
static void
gnc_gen_trans_assign_transfer_account_to_selection_cb (GtkMenuItem *menuitem,
gnc_gen_trans_assign_transfer_account_to_selection_cb (
GtkMenuItem *menuitem,
GNCImportMainMatcher *info)
{
GtkTreeView *treeview;
@ -494,13 +498,15 @@ gnc_gen_trans_assign_transfer_account_to_selection_cb (GtkMenuItem *menuitem,
{
gchar *path_str = gtk_tree_path_to_string (l->data);
DEBUG("passing first = %s", first ? "true" : "false");
DEBUG("passing is_selection = %s", is_selection ? "true" : "false");
DEBUG("passing is_selection = %s",
is_selection ? "true" : "false");
DEBUG("passing path = %s", path_str);
g_free (path_str);
DEBUG("passing account value = %s",
gnc_account_get_full_name (assigned_account));
gnc_gen_trans_assign_transfer_account (treeview,
&first, is_selection, l->data, &assigned_account, info);
&first, is_selection, l->data,
&assigned_account, info);
DEBUG("returned value of account = %s",
gnc_account_get_full_name (assigned_account));
DEBUG("returned value of first = %s", first ? "true" : "false");
@ -575,7 +581,8 @@ gnc_gen_trans_view_popup_menu (GtkTreeView *treeview,
ENTER ("");
menu = gtk_menu_new();
menuitem = gtk_menu_item_new_with_label (_("Assign a transfer account."));
menuitem = gtk_menu_item_new_with_label (
_("Assign a transfer account to the selection."));
g_signal_connect (menuitem, "activate",
G_CALLBACK(
gnc_gen_trans_assign_transfer_account_to_selection_cb),
@ -646,7 +653,6 @@ gnc_gen_trans_onPopupMenu_cb (GtkTreeView *treeview,
return TRUE;
}
static GtkTreeViewColumn *
add_text_column(GtkTreeView *view, const gchar *title, int col_num)
{